| | |
| | | <el-input class="w--90" v-model="searchForm.endNum" placeholder="请输入最大值"></el-input> |
| | | </el-form-item> |
| | | </el-form-item> |
| | | <el-form-item label="车辆运营类型:" prop="operateType" class="unset_m" style="margin-right: 15px;"> |
| | | <!-- <el-form-item label="车辆运营类型:" prop="operateType" class="unset_m" style="margin-right: 15px;"> |
| | | <el-select :popper-append-to-body="false" v-model="searchForm.operateType" placeholder="请选择"> |
| | | <el-option v-for="(item,index) in options" :key="index" :label="item.name" :value="item.name"></el-option> |
| | | <el-option v-for="(item, index) in options" :key="index" :label="item.name" |
| | | :value="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item label="车辆状态:" prop="status" class="unset_m" style="margin-right: 15px;"> |
| | | <el-select :popper-append-to-body="false" v-model="searchForm.status" placeholder="请选择"> |
| | | <el-option label="在线" value="1"></el-option> |
| | |
| | | size="small">重置</el-button> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-tabs v-model="activeName" type="card" @tab-click="handleClick" style="margin-left: 30px;"> |
| | | <el-tab-pane v-for="(item,index) in options" :key="index" :label="item.name" :name="item.name"></el-tab-pane> |
| | | |
| | | </el-tabs> |
| | | |
| | | <div class="table-box ml--30 mt--23 mr--30"> |
| | | <el-table :data="tableData" border stripe style="width: 100%"> |
| | | <el-table-column type="index" label="序号" width="60"></el-table-column> |
| | |
| | | <el-table-column prop="operateType" label="车辆运营类型"></el-table-column> |
| | | <el-table-column prop="status" label="车辆状态"> |
| | | <template slot-scope="scope"> |
| | | <el-tag v-if="scope.row.status == 1" type="success">在线</el-tag> |
| | | <el-tag v-if="scope.row.status == 2" type="danger">异常</el-tag> |
| | | <el-tag v-if="scope.row.status == 4" type="danger">故障</el-tag> |
| | | <el-tag v-if="scope.row.status == 3" type="info">离线</el-tag> |
| | | <el-tag v-if="scope.row.status == 1" type="success">在线</el-tag> |
| | | <el-tag v-if="scope.row.status == 2" type="danger">异常</el-tag> |
| | | <el-tag v-if="scope.row.status == 4" type="danger">故障</el-tag> |
| | | <el-tag v-if="scope.row.status == 3" type="info">离线</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="100"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getCarList,getCarType } from './service' |
| | | import { getCarList, getCarType } from './service' |
| | | import { search } from 'core-js/fn/symbol'; |
| | | |
| | | export default { |
| | |
| | | pageCurr: 1, |
| | | pageSize: 10 |
| | | }, |
| | | options:[], |
| | | options: [], |
| | | tableData: [], |
| | | activeName:'全部' |
| | | }; |
| | | }, |
| | | created() { |
| | | this.$checkPermission(30) |
| | | |
| | | getCarType().then(res => { |
| | | this.options = res; |
| | | let arr = [{name:'全部'}] |
| | | this.options = [...arr, ...res]; |
| | | }); |
| | | // 判断URL参数并赋值 |
| | | const query = this.$route.query; |
| | | if (query && Object.keys(query).length > 0) { |
| | | if(query.id){ |
| | | if (query.id) { |
| | | this.searchForm.operateType = query.id; |
| | | } |
| | | } |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | handleClick(tab, event) { |
| | | if(tab.name == '全部'){ |
| | | this.searchForm.operateType = ''; |
| | | this.activeName = '全部'; |
| | | }else{ |
| | | this.searchForm.operateType = tab.name; |
| | | this.activeName = tab.name; |
| | | } |
| | | this.getList(); |
| | | }, |
| | | reset() { |
| | | this.searchForm = { |
| | | vehicleNumber: '', |
| | |
| | | pageCurr: 1, |
| | | pageSize: 10 |
| | | }; |
| | | |
| | | |
| | | this.getList(); |
| | | }, |
| | | search() { |
| | |
| | | }, |
| | | async getList() { |
| | | try { |
| | | const res = await getCarList({...this.searchForm}); |
| | | const res = await getCarList({ ...this.searchForm }); |
| | | this.tableData = res.records || []; |
| | | this.searchForm.total = res.total || 0; |
| | | } catch (error) { |
| | | console.error('获取车辆列表失败:', error); |
| | | // console.error('获取车辆列表失败:', error); |
| | | } |
| | | }, |
| | | exportExcell() { |
| | |
| | | }, |
| | | handle(index, row) { |
| | | // TODO: 实现详情查看功能 |
| | | console.log('查看详情:', row); |
| | | // console.log('查看详情:', row); |
| | | this.$router.push({ path: '/car-detail', query: { id: row.id } }); |
| | | }, |
| | | } |