| | |
| | | total: total, |
| | | layout: 'total, sizes, prev, pager, next, jumper' |
| | | }" |
| | | :table-style="{ width: '100%', height: 'calc(100vh - 23em)' }"> |
| | | height="calc(100vh - 23em)" |
| | | :table-style="{ width: '100%' }"> |
| | | <template #inspector="{ row }"> |
| | | <div class="person-tags"> |
| | | <!-- 调试信息,上线时删除 --> |
| | |
| | | // 单选框配置 |
| | | const activeRadio = ref("taskManage"); |
| | | const radios = reactive([ |
| | | { name: "taskManage", label: "定时任务管理" }, |
| | | { name: "task", label: "定时任务记录" }, |
| | | { name: "taskManage", label: "巡检任务" }, |
| | | { name: "task", label: "巡检记录" }, |
| | | ]); |
| | | |
| | | // 表格数据 |
| | |
| | | |
| | | // 列配置 |
| | | const columns = ref([ |
| | | { prop: "taskName", label: "巡检任务名称", minWidth: 160 }, |
| | | { prop: "inspectionProject", label: "巡检项目", minWidth: 150 }, |
| | | { prop: "remarks", label: "备注", minWidth: 150 }, |
| | | { prop: "inspector", label: "执行巡检人", minWidth: 150, slot: "inspector" }, |
| | | { prop: "taskName", label: "巡检任务名称", minWidth: 200 }, |
| | | { prop: "inspectionProject", label: "巡检项目", minWidth: 180 }, |
| | | { prop: "remarks", label: "备注", minWidth: 180 }, |
| | | { prop: "inspector", label: "执行巡检人", minWidth: 180, slot: "inspector" }, |
| | | { |
| | | prop: "isEnabled", |
| | | label: "是否启用", |
| | |
| | | { |
| | | prop: "frequencyType", |
| | | label: "频次", |
| | | minWidth: 150, |
| | | // formatter: (_, __, val) => ({ |
| | | // DAILY: "每日", |
| | | // WEEKLY: "每周", |
| | | // MONTHLY: "每月", |
| | | // QUARTERLY: "季度" |
| | | // }[val] || "") |
| | | minWidth: 120, |
| | | formatData: params => { |
| | | return params === "DAILY" |
| | | ? "每日" |
| | |
| | | { |
| | | prop: "frequencyDetail", |
| | | label: "开始日期与时间", |
| | | minWidth: 150, |
| | | minWidth: 200, |
| | | formatter: (row, column, cellValue) => { |
| | | // 先判断是否是字符串 |
| | | if (typeof cellValue !== "string") return ""; |
| | |
| | | ); |
| | | }, |
| | | }, |
| | | { prop: "registrant", label: "登记人", minWidth: 100 }, |
| | | { prop: "registrant", label: "登记人", minWidth: 120 }, |
| | | { |
| | | prop: "createTime", |
| | | label: "登记日期", |
| | | minWidth: 100, |
| | | minWidth: 180, |
| | | formatData: cell => { |
| | | if (!cell) return "-"; |
| | | try { |
| | |
| | | return val == 1 ? "success" : "danger"; |
| | | }, |
| | | }, |
| | | { prop: "abnormalDescription", label: "异常描述", minWidth: 100 }, |
| | | { prop: "abnormalDescription", label: "异常描述", minWidth: 150 }, |
| | | ]); |
| | | |
| | | // 操作列配置 |
| | |
| | | label: "操作", |
| | | width: operations.length > 1 ? 180 : 130, |
| | | fixed: "right", |
| | | align: 'center', |
| | | align: "center", |
| | | dataType: "action", |
| | | operation: operations |
| | | .map(op => { |
| | |
| | | operationsArr.value = ["edit"]; |
| | | } else if (value === "task") { |
| | | const operationColumn = getOperationColumn(["upload", "viewFile"]); |
| | | // 定时任务记录不展示"是否启用"列 |
| | | // 巡检记录不展示"是否启用"列 |
| | | const taskColumns = columns.value.filter(col => col.prop !== "isEnabled"); |
| | | tableColumns.value = [ |
| | | ...taskColumns, |
| | |
| | | .then(() => { |
| | | // 根据当前选中的标签页调用不同的导出接口 |
| | | if (activeRadio.value === "taskManage") { |
| | | // 定时任务管理 |
| | | proxy.download("/timingTask/export", {}, "定时任务管理.xlsx"); |
| | | // 巡检任务 |
| | | proxy.download("/timingTask/export", {}, "巡检任务.xlsx"); |
| | | } else if (activeRadio.value === "task") { |
| | | // 定时任务记录 |
| | | proxy.download("/inspectionTask/export", {}, "定时任务记录.xlsx"); |
| | | // 巡检记录 |
| | | proxy.download("/inspectionTask/export", {}, "巡检记录.xlsx"); |
| | | } |
| | | }) |
| | | .catch(() => { |