zhangwencui
8 天以前 8ac00913c2fe8d008a9a7de8d4a7a23d838d1d9c
设备巡检tab页更名、表格无法拖拉问题
已修改1个文件
43 ■■■■■ 文件已修改
src/views/equipmentManagement/inspectionManagement/index.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/inspectionManagement/index.vue
@@ -52,7 +52,8 @@
                  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">
              <!-- 调试信息,上线时删除 -->
@@ -121,8 +122,8 @@
  // 单选框配置
  const activeRadio = ref("taskManage");
  const radios = reactive([
    { name: "taskManage", label: "定时任务管理" },
    { name: "task", label: "定时任务记录" },
    { name: "taskManage", label: "巡检任务" },
    { name: "task", label: "巡检记录" },
  ]);
  // 表格数据
@@ -137,10 +138,10 @@
  // 列配置
  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: "是否启用",
@@ -151,13 +152,7 @@
    {
      prop: "frequencyType",
      label: "频次",
      minWidth: 150,
      // formatter: (_, __, val) => ({
      //   DAILY: "每日",
      //   WEEKLY: "每周",
      //   MONTHLY: "每月",
      //   QUARTERLY: "季度"
      // }[val] || "")
      minWidth: 120,
      formatData: params => {
        return params === "DAILY"
          ? "每日"
@@ -173,7 +168,7 @@
    {
      prop: "frequencyDetail",
      label: "开始日期与时间",
      minWidth: 150,
      minWidth: 200,
      formatter: (row, column, cellValue) => {
        // 先判断是否是字符串
        if (typeof cellValue !== "string") return "";
@@ -194,11 +189,11 @@
        );
      },
    },
    { prop: "registrant", label: "登记人", minWidth: 100 },
    { prop: "registrant", label: "登记人", minWidth: 120 },
    {
      prop: "createTime",
      label: "登记日期",
      minWidth: 100,
      minWidth: 180,
      formatData: cell => {
        if (!cell) return "-";
        try {
@@ -220,7 +215,7 @@
        return val == 1 ? "success" : "danger";
      },
    },
    { prop: "abnormalDescription", label: "异常描述", minWidth: 100 },
    { prop: "abnormalDescription", label: "异常描述", minWidth: 150 },
  ]);
  // 操作列配置
@@ -231,7 +226,7 @@
      label: "操作",
      width: operations.length > 1 ? 180 : 130,
      fixed: "right",
            align: 'center',
      align: "center",
      dataType: "action",
      operation: operations
        .map(op => {
@@ -279,7 +274,7 @@
      operationsArr.value = ["edit"];
    } else if (value === "task") {
      const operationColumn = getOperationColumn(["upload", "viewFile"]);
      // 定时任务记录不展示"是否启用"列
      // 巡检记录不展示"是否启用"列
      const taskColumns = columns.value.filter(col => col.prop !== "isEnabled");
      tableColumns.value = [
        ...taskColumns,
@@ -422,11 +417,11 @@
      .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(() => {