6/22完善引入,

This commit is contained in:
Zy
2026-06-22 08:14:35 +08:00
parent ea8129216b
commit 826bf3c782
208 changed files with 1122 additions and 1685 deletions

View File

@@ -26,15 +26,6 @@
<el-card class="flex-1" shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['carArea:add:cars']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['carArea:edit:car']">编辑</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['car:car:remove']">删除</el-button>
</el-col> -->
<right-toolbar
:disable-delete="multiple"
:disable-edit="single"
@@ -54,14 +45,14 @@
<el-table-column label="车辆品牌" width="155" align="center" prop="carBrand" />
<el-table-column label="车辆型号" width="155" align="center" prop="carModel" />
<el-table-column label="车身颜色" width="125" align="center" prop="carColor" />
<el-table-column label="持有人" width="155" align="center" prop="residentId">
<template #default="scope"> {{ getResidentName(scope.row.residentId) }} </template>
<el-table-column label="持有人" width="155" align="center" prop="userName">
<template #default="scope"> {{ scope.row.userName }} </template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['car:car:edit']">修改</el-button>
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['car:car:remove']">删除</el-button>
<el-button link type="primary" @click="handleUpdate(scope.row)" v-has-permi="['car:car:edit']">修改</el-button>
<el-button link type="primary" @click="handleDelete(scope.row)" v-has-permi="['car:car:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -73,7 +64,7 @@
<script setup name="Car" lang="ts">
import Pageheader from '@/components/Pageheader/index.vue';
import { listCar, getCar, delCar, addCar, updateCar } from '@/api/system/cars/index';
import { listCar, delCar } from '@/api/system/cars/index';
import { CarVO, CarQuery, CarForm } from '@/api/system/cars/type';
import { listResident } from '@/api/system/resident';
import { checkPermi } from '@/utils/permission';
@@ -122,28 +113,18 @@ const data = reactive<PageData<CarForm, CarQuery>>({
carBrand: undefined,
carModel: undefined,
carColor: undefined,
carImageUrl: undefined,
params: {}
carImageUrl: undefined
},
rules: {
id: [{ required: true, message: '车辆管理表id不能为空', trigger: 'blur' }]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 持有人 */
const ResidentList = ref([]);
const getResidentName = (id: string) => {
const find = ResidentList.value.find((item) => item.id === id);
if (!find) return '--';
return find.name;
};
const { queryParams } = toRefs(data);
/** 查询车辆管理列表 */
const getList = async () => {
loading.value = true;
listCar(queryParams.value)
.then((res) => {
carList.value = res.rows;
@@ -152,9 +133,6 @@ const getList = async () => {
.finally(() => {
loading.value = false;
});
const res1 = await listResident();
ResidentList.value = res1.rows;
loading.value = false;
};
/** 搜索按钮操作 */