修正ts类型

This commit is contained in:
Zy
2026-05-13 15:28:25 +08:00
parent 1b738c0f4d
commit a1750bc67b
114 changed files with 2346 additions and 613 deletions

View File

@@ -35,6 +35,7 @@ const formRef = ref();
const form = ref({
id: null,
itemName: '', // 项目名称
status: '0', // 状态 0正常 1停用
inspectionStandard: null // 巡检标准
});
const rules = ref({
@@ -48,6 +49,7 @@ if (route.query.id) {
form.value = {
id: res.data.id,
itemName: res.data.itemName,
status: res.data.status,
inspectionStandard: res.data.inspectionStandard
};
});

View File

@@ -76,7 +76,6 @@
<el-table-column label="未开始" align="center" prop="pendingTask" />
</el-table>
<pagination
:pagerCount="pagerCount"
v-show="total > 0"
:total="total"
:layout="layout"
@@ -104,7 +103,6 @@ const total = ref(100);
const queryFormRef = ref<ElFormInstance>();
const pagerCount = document.body.clientWidth <= 1500 ? 1 : 7;
const layout = document.body.clientWidth <= 1500 ? 'total, sizes, prev, pager, next' : 'total, sizes, prev, pager, next,';
const disabledDate = (time: Date) => {
return time.getTime() > Date.now();
@@ -311,7 +309,8 @@ const getList = async () => {
list.value[4].value += item.outUncompletedTasks ?? 0;
});
if (!Number.isNaN(+list.value[2].value) && !Number.isNaN(+list.value[1].value)) {
list.value[3].value = Math.min((Number(list.value[2].value) / Number(list.value[1].value)) * 100, 100).toFixed(2) + '%';
const num = Number(list.value[2].value) / Number(list.value[1].value);
list.value[3].value = Math.min((Number.isNaN(num) ? 0 : num) * 100, 100).toFixed(2) + '%';
}
handleEcartsData(ecartslist.value.find((item) => item.key === activeEchartsindex.value));

View File

@@ -57,7 +57,13 @@
<el-table-column label="计划路线" align="center" prop="routeNames" />
<el-table-column label="状态" width="150" align="center" prop="status">
<template #default="scope">
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1"></el-switch>
<el-switch
@change="(val: string) => handleChangeStatus(scope.row.id, val)"
v-model="scope.row.status"
active-value="0"
inactive-value="1"
></el-switch>
<!-- 0关闭 1开启 -->
</template>
</el-table-column>
<el-table-column label="操作" width="110" align="center" fixed="right" class-name="small-padding fixed-width">
@@ -74,7 +80,7 @@
</template>
<script setup name="Plan" lang="ts">
import { listPlan, getPlan, delPlan, addPlan, updatePlan } from '@/api/system/InspectionPlan/index';
import { listPlan, getPlan, delPlan, addPlan, updatePlan, changePlanStatus } from '@/api/system/InspectionPlan/index';
import { PlanVO, PlanQuery, PlanForm } from '@/api/system/InspectionPlan/type';
import { checkPermi } from '@/utils/permission';
import { numToWeek } from '@/utils/time';
@@ -203,7 +209,13 @@ const handleUpdate = async (row?: PlanVO) => {
}
});
};
/** 状态修改 */
function handleChangeStatus(id: string, status: string) {
changePlanStatus(id, status).then(() => {
proxy?.$modal.msgSuccess('操作成功');
getList();
});
}
/** 提交按钮 */
const submitForm = () => {
planFormRef.value?.validate(async (valid: boolean) => {

View File

@@ -55,7 +55,13 @@
<el-table-column label="巡检点位置" align="center" prop="location" />
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<DictTag :options="com_inspection_point_status" :value="scope.row.status"></DictTag>
<el-switch
@change="(val: string) => handleChangeStatus(scope.row.id, val)"
v-model="scope.row.status"
active-value="0"
inactive-value="1"
></el-switch>
<!-- 0开启 1关闭 -->
</template>
</el-table-column>
<el-table-column label="添加时间" align="center" prop="createTime" />
@@ -73,8 +79,8 @@
</template>
<script setup name="Point" lang="ts">
import PageHeader from '@/components/Pageheader/index.vue';
import { listPoint, getPoint, delPoint, addPoint, updatePoint } from '@/api/system/InspectionPoint/index';
import Pageheader from '@/components/Pageheader/index.vue';
import { listPoint, getPoint, delPoint, addPoint, updatePoint, changePointStatus } from '@/api/system/InspectionPoint/index';
import { PointVO, PointQuery, PointForm } from '@/api/system/InspectionPoint/type';
import { checkPermi } from '@/utils/permission';
@@ -218,6 +224,12 @@ const handleDelete = async (row?: PointVO) => {
await getList();
};
function handleChangeStatus(id: string, status: string) {
changePointStatus(id, status).then(() => {
proxy?.$modal.msgSuccess('操作成功');
getList();
});
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(

View File

@@ -78,7 +78,6 @@ const form = ref<RecordVO>({
planName: '',
actualStartTime: '',
actualEndTime: '',
statusLabel: '',
createByName: '',
details: [],
createTime: '',
@@ -89,6 +88,7 @@ if (route.query.id) {
userid.value = route.query.id;
getRecord(userid.value).then((res) => {
form.value = {
...form.value,
...res.data
};
});
@@ -122,7 +122,7 @@ const tableData = [
// 推出
const cancelForm = () => {
router.push({
path: '/carArea/monthCard'
path: '/Inspection/Record'
});
};
</script>

View File

@@ -62,56 +62,14 @@
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:route:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:route:remove']"></el-button>
</el-tooltip>
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['system:route:edit']">修改</el-button>
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:route:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改巡检路线对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="routeFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="巡检路线名称" prop="routeName">
<el-input v-model="form.routeName" placeholder="请输入巡检路线名称" />
</el-form-item>
<el-form-item label="路线描述" prop="description">
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="巡检点" prop="totalPoints">
<el-input v-model="form.totalPoints" placeholder="请输入巡检点" />
</el-form-item>
<el-form-item label="预计巡检时长" prop="estimatedTime">
<el-input v-model="form.estimatedTime" placeholder="请输入预计巡检时长" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="起点经度" prop="startLng">
<el-input v-model="form.startLng" placeholder="请输入起点经度" />
</el-form-item>
<el-form-item label="起点纬度" prop="startLat">
<el-input v-model="form.startLat" placeholder="请输入起点纬度" />
</el-form-item>
<el-form-item label="终点经度" prop="endLng">
<el-input v-model="form.endLng" placeholder="请输入终点经度" />
</el-form-item>
<el-form-item label="终点纬度" prop="endLat">
<el-input v-model="form.endLat" placeholder="请输入终点纬度" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
@@ -143,6 +101,7 @@ const dialog = reactive<DialogOption>({
const initFormData: RouteForm = {
id: undefined,
routeName: undefined,
pathPoints: undefined,
description: undefined,
totalPoints: undefined,
estimatedTime: undefined,
@@ -160,14 +119,14 @@ const data = reactive<PageData<RouteForm, RouteQuery>>({
pageSize: 10,
routeName: undefined,
description: undefined,
pathPoints: undefined,
totalPoints: undefined,
estimatedTime: undefined,
routeStatus: undefined,
startLng: undefined,
startLat: undefined,
endLng: undefined,
endLat: undefined,
params: {}
endLat: undefined
},
rules: {
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
@@ -258,7 +217,7 @@ const submitForm = () => {
/** 删除按钮操作 */
const handleDelete = async (row?: RouteVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除巡检路线编号为"' + _ids + '"的数据项').finally(() => (loading.value = false));
await proxy?.$modal.confirm('是否确认删除巡检路线?').finally(() => (loading.value = false));
await delRoute(_ids);
proxy?.$modal.msgSuccess('删除成功');
await getList();

View File

@@ -37,7 +37,7 @@
<el-table v-loading="loading" border :data="routeList">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="巡检人员" align="center" prop="inspectorName" show-overflow-tooltip />
<el-table-column label="巡检人员" align="center" prop="roleName" show-overflow-tooltip />
<el-table-column label="计划巡检任务" align="center" prop="totalTasks" />
<el-table-column label="按时完成" align="center" prop="completedTasks">
<template #default="scope">
@@ -76,8 +76,6 @@ const data = reactive({
});
const checkdata = ref([]);
// TODO 巡检人员名称
const { queryParams } = toRefs(data);
/** 查询巡检路线列表 */
const getList = async () => {

View File

@@ -5,7 +5,7 @@
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" label-width="100px" @submit.prevent="handleQuery" :model="queryParams" :inline="true">
<el-form-item label="执行状态" prop="taskName">
<el-form-item label="执行状态" prop="statuss">
<el-select v-model="queryParams.status" placeholder="请选择执行状态" clearable>
<el-option v-for="(item, index) in com_inspection_task_status" :key="index" :value="item.value" :label="item.label"></el-option>
</el-select>
@@ -73,7 +73,11 @@
<dict-tag :options="com_inspection_task_status" :value="scope.row.status"></dict-tag>
</template>
</el-table-column>
<el-table-column label="提醒时间" align="center" prop="remindTime" />
<el-table-column label="提醒时间" width="160" align="center" prop="remindTime">
<template #default="scope">
<dict-tag :options="com_inspection_remind_tiime" :value="scope.row.remindTime"></dict-tag>
</template>
</el-table-column>
<el-table-column label="关联巡检计划" align="center" prop="planId" />
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope">
@@ -96,7 +100,7 @@ import { checkPermi } from '@/utils/permission';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_inspection_task_status } = toRefs<any>(proxy?.useDict('com_inspection_task_status'));
const { com_inspection_plan_setting } = toRefs<any>(proxy?.useDict('com_inspection_plan_setting'));
const { com_inspection_remind_tiime } = toRefs<any>(proxy?.useDict('com_inspection_remind_tiime'));
const router = useRouter();
const taskList = ref<TaskVO[]>([]);
const buttonLoading = ref(false);
@@ -118,16 +122,7 @@ const dialog = reactive<DialogOption>({
const initFormData: TaskForm = {
id: undefined,
taskName: undefined,
planId: undefined,
inspectorId: undefined,
routeId: undefined,
taskTime: undefined,
costUnit: undefined,
status: undefined,
actualStartTime: undefined,
actualEndTime: undefined,
remark: undefined,
remindTime: undefined
status: undefined
};
const data = reactive<PageData<TaskForm, TaskQuery>>({
form: { ...initFormData },
@@ -135,16 +130,7 @@ const data = reactive<PageData<TaskForm, TaskQuery>>({
pageNum: 1,
pageSize: 10,
taskName: undefined,
planId: undefined,
inspectorId: undefined,
routeId: undefined,
taskTime: undefined,
costUnit: undefined,
status: undefined,
actualStartTime: undefined,
actualEndTime: undefined,
remindTime: undefined,
params: {}
status: undefined
},
rules: {
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],