|
@@ -73,9 +73,12 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="距离保养" align="center">
|
|
|
<template #default="scope">
|
|
|
- <span :class="getDistanceClass(scope.row.mainDistance)">
|
|
|
- {{ scope.row.mainDistance }}
|
|
|
- </span>
|
|
|
+ <template v-if="hasMaintenancePlan(scope.row.mainDistance)">
|
|
|
+ <span :class="getDistanceClass(scope.row.mainDistance)">
|
|
|
+ {{ scope.row.mainDistance }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <span v-else>无保养计划</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="所在部门" align="center" prop="deptName" />
|
|
@@ -91,6 +94,7 @@
|
|
|
type="primary"
|
|
|
@click="detail(scope.row)"
|
|
|
v-hasPermi="['rq:iot-device:query']"
|
|
|
+ v-if="hasMaintenancePlan(scope.row.mainDistance)"
|
|
|
>
|
|
|
详情
|
|
|
</el-button>
|
|
@@ -244,6 +248,12 @@ const getDistanceClass = (distance: number | string | null) => {
|
|
|
return '';
|
|
|
};
|
|
|
|
|
|
+// 判断是否有保养计划
|
|
|
+const hasMaintenancePlan = (mainDistance: any) => {
|
|
|
+ // 检查:非null、非undefined、非空字符串
|
|
|
+ return mainDistance != null && mainDistance !== '';
|
|
|
+};
|
|
|
+
|
|
|
/** 删除按钮操作 */
|
|
|
const handleDelete = async (id: number) => {
|
|
|
try {
|