13404089107
2025-05-06 76bdc3ac16f983319df1b42e992a93aac10a7d76
修改射洪bug
1个文件已修改
50 ■■■■■ 已修改文件
src/view/car-manage/index.vue 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/car-manage/index.vue
@@ -30,11 +30,12 @@
                            <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>
@@ -52,6 +53,12 @@
                    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>
@@ -68,10 +75,10 @@
                <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">
@@ -92,7 +99,7 @@
</template>
<script>
import { getCarList,getCarType } from './service'
import { getCarList, getCarType } from './service'
import { search } from 'core-js/fn/symbol';
export default {
@@ -113,26 +120,37 @@
                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: '',
@@ -149,7 +167,7 @@
                pageCurr: 1,
                pageSize: 10
            };
            this.getList();
        },
        search() {
@@ -158,11 +176,11 @@
        },
        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() {
@@ -178,7 +196,7 @@
        },
        handle(index, row) {
            // TODO: 实现详情查看功能
            console.log('查看详情:', row);
            // console.log('查看详情:', row);
            this.$router.push({ path: '/car-detail', query: { id: row.id } });
        },
    }