gongchunyi
2026-08-12 fc62e83f73b4b8ff4714f995da4eafbb7f525d1a
src/views/equipmentManagement/inspectionManagement/index.vue
@@ -1,422 +1,366 @@
<template>
  <div class="app-container">
    <el-form :inline="true" :model="queryParams" class="search-form">
      <el-form-item label="搜索">
        <el-input
            v-model="queryParams.searchAll"
            placeholder="请输入关键字"
            clearable
            :style="{ width: '100%' }"
        />
    <el-form :inline="true"
             :model="queryParams"
             class="search-form">
      <el-form-item label="巡检任务名称">
        <el-input v-model="queryParams.taskName"
                  placeholder="请输入巡检任务名称"
                  clearable
                  style="width: 200px " />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="handleQuery">查询</el-button>
        <el-button type="primary"
                   @click="handleQuery">查询</el-button>
        <el-button @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-card>
      <!-- 标签页 -->
      <el-tabs
          v-model="activeTab"
          class="info-tabs"
          @tab-click="handleTabClick"
      >
        <el-tab-pane
            v-for="tab in tabs"
            :key="tab.name"
            :label="tab.label"
            :name="tab.name"
        />
      </el-tabs>
      <div style="display: flex;flex-direction: row;justify-content: space-between;" v-if="tabName === 'task'">
        <el-radio-group v-model="activeRadio" @change="radioChange">
      <div style="display: flex;flex-direction: row;justify-content: space-between;margin-bottom: 10px;">
        <el-radio-group v-model="activeRadio"
                        @change="radioChange">
          <el-radio-button v-for="tab in radios"
                           :key="tab.name"
                           :label="tab.label"
                           :value="tab.name"/>
                           :value="tab.name" />
        </el-radio-group>
        <!-- 操作按钮区 -->
        <el-space v-if="activeRadio !== 'task'">
          <el-button type="primary" :icon="Plus" @click="handleAdd(undefined)">新建</el-button>
          <el-button type="danger" :icon="Delete" @click="handleDelete">删除</el-button>
          <!-- <el-button type="info" plain :icon="Download">导出</el-button> -->
          <el-button type="primary"
                     :icon="Plus"
                     @click="handleAdd(undefined)">新建</el-button>
          <el-button type="danger"
                     :icon="Delete"
                     @click="handleDelete">删除</el-button>
          <el-button @click="handleOut">导出</el-button>
        </el-space>
        <el-space v-else>
          <el-button @click="handleOut">导出</el-button>
        </el-space>
      </div>
      <div>
        <div>
          <PIMTable :table-loading="tableLoading"
      <!-- 巡检任务 -->
      <div v-show="activeRadio === 'taskManage'">
        <PIMTable :table-loading="tableLoading"
                  :table-data="tableData"
                  :column="tableColumns"
                  @selection-change="handleSelectionChange"
                  @pagination="handlePagination"
                  :is-selection="true"
                  :border="true"
                  :table-style="{ width: '100%', height: 'calc(100vh - 30em)' }"
                  v-if="tabName === 'task'"
          >
                  :page="{
                  current: pageNum,
                  size: pageSize,
                  total: total,
                  layout: 'total, sizes, prev, pager, next, jumper'
                }"
                  height="calc(100vh - 23em)"
                  :table-style="{ width: '100%' }">
          <template #inspector="{ row }">
            <div class="person-tags">
              <!-- 调试信息,上线时删除 -->
              <!-- {{ console.log('inspector data:', row.inspector) }} -->
              <template v-if="row.inspector && row.inspector.length > 0">
                <el-tag
                  v-for="(person, index) in row.inspector"
                  :key="index"
                  size="small"
                  type="primary"
                  class="person-tag"
                >
                <el-tag v-for="(person, index) in row.inspector"
                        :key="index"
                        size="small"
                        type="primary"
                        class="person-tag">
                  {{ person }}
                </el-tag>
              </template>
              <span v-else class="no-data">--</span>
            </div>
          </template>
          </PIMTable>
          <el-table ref="table" :data="tableData" height="480" v-loading="tableLoading" border v-else style="width: 100%;height: calc(100vh - 25em)">
            <el-table-column label="序号" type="index" width="60" align="center" />
            <el-table-column prop="deviceName" label="设备名称" :show-overflow-tooltip="true">
              <template #default="scope">
                {{scope.row.qrCode.deviceName}}
              </template>
            </el-table-column>
            <el-table-column prop="location" label="所在位置描述" :show-overflow-tooltip="true">
              <template #default="scope">
                {{scope.row.qrCode.location}}
              </template>
            </el-table-column>
            <el-table-column prop="scanner" label="巡检人"></el-table-column>
            <el-table-column prop="scanTime" label="巡检时间"></el-table-column>
            <el-table-column fixed="right" label="操作">
              <template #default="scope">
                <el-button link type="primary" @click="handleAdd(scope.row)">查看附件</el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <pagination
            v-if="total>0"
            :page="pageNum"
            :limit="pageSize"
            :total="total"
            @pagination="handlePagination"
            :layout="'total, prev, pager, next, jumper'"
          <template #isEnabled="{ row }">
            <el-tag :type="row.isEnabled === 1 ? 'success' : 'danger'"
                    size="small">
              {{ row.isEnabled == 1 ? '是' : '否' }}
            </el-tag>
          </template>
        </PIMTable>
      </div>
      <!-- 巡检记录 - 日期分组折叠 -->
      <div v-show="activeRadio === 'task'">
        <el-table
          :data="groupedInspectionList"
          border
          v-loading="tableLoading"
          :expand-row-keys="inspectionExpandedRowKeys"
          :row-key="(row) => row.date"
          @expand-change="onInspectionExpandChange"
          height="calc(100vh - 23em)"
        >
          <el-table-column type="expand">
            <template #default="props">
              <el-table :data="props.row.children" border row-key="id">
                <el-table-column label="巡检任务名称" prop="taskName" align="center" min-width="180" />
                <el-table-column label="巡检项目" prop="inspectionProject" align="center" min-width="160" />
                <el-table-column label="巡检人" align="center" min-width="150">
                  <template #default="{ row }">
                    <template v-if="row.inspector && row.inspector.length > 0">
                      <el-tag v-for="(p, i) in row.inspector" :key="i" size="small" type="primary" class="person-tag">{{ p }}</el-tag>
                    </template>
                    <span v-else>--</span>
                  </template>
                </el-table-column>
                <el-table-column label="巡检状态" align="center" width="100">
                  <template #default="{ row }">
                    <el-tag :type="row.status === 1 ? 'success' : 'warning'" size="small">
                      {{ row.status === 1 ? '已完成' : '待巡检' }}
                    </el-tag>
                  </template>
                </el-table-column>
                <el-table-column label="巡检结果" prop="inspectionResult" align="center" min-width="120" />
                <el-table-column label="备注" prop="remarks" align="center" min-width="150" />
                <el-table-column label="异常描述" prop="abnormalDescription" align="center" min-width="150" />
                <el-table-column label="操作" align="center" width="200">
                  <template #default="{ row }">
                    <el-button type="primary" link @click="openUploadDialog(row)">上传</el-button>
                    <el-button type="success" link @click="viewFile(row)">查看附件</el-button>
                    <el-button type="warning" link v-if="row.status === 0" @click="handleSingleComplete(row)">巡检完成</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </template>
          </el-table-column>
          <el-table-column label="巡检日期" prop="date" align="center" />
          <el-table-column label="巡检记录数" prop="count" align="center" />
          <el-table-column label="待巡检数" align="center" width="120">
            <template #default="{ row }">
              {{ row.children.filter(c => c.status === 0).length }}
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center" width="200">
            <template #default="{ row }">
              <el-button
                type="primary"
                size="small"
                :disabled="!row.children.some(c => c.status === 0)"
                @click="handleBatchInspection(row.date)"
              >
                一键巡检完成
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <Pagination
          v-show="total > 0"
          :total="total"
          layout="total, sizes, prev, pager, next, jumper"
          :page="pageNum"
          :limit="pageSize"
          @pagination="handlePagination"
        />
      </div>
    </el-card>
    <form-dia ref="formDia" @closeDia="handleQuery"></form-dia>
    <qr-code-dia ref="qrCodeDia" @closeDia="handleQuery"></qr-code-dia>
    <form-dia ref="formDia"
              @closeDia="handleQuery"></form-dia>
    <view-files ref="viewFiles"></view-files>
    <view-qr-code-files ref="viewQrCodeFiles"></view-qr-code-files>
    <upload-files ref="uploadFiles"
                  @success="handleQuery"
                  @closeDia="handleQuery"></upload-files>
  </div>
</template>
<script setup>
import { Delete, Plus } from "@element-plus/icons-vue";
import { onMounted, ref, reactive, getCurrentInstance, nextTick } from "vue";
  import { Delete, Plus } from "@element-plus/icons-vue";
  import { onMounted, ref, reactive, getCurrentInstance, nextTick, computed } from "vue";
  import { ElMessage, ElMessageBox } from "element-plus";
  import dayjs from "dayjs";
// 组件引入
import Pagination from "@/components/Pagination/index.vue";
import PIMTable from "@/components/PIMTable/PIMTable.vue";
import FormDia from "@/views/equipmentManagement/inspectionManagement/components/formDia.vue";
import QrCodeDia from "@/views/equipmentManagement/inspectionManagement/components/qrCodeDia.vue";
import ViewFiles from "@/views/equipmentManagement/inspectionManagement/components/viewFiles.vue";
import ViewQrCodeFiles from "@/views/equipmentManagement/inspectionManagement/components/viewQrCodeFiles.vue";
  import PIMTable from "@/components/PIMTable/PIMTable.vue";
  import FormDia from "@/views/equipmentManagement/inspectionManagement/components/formDia.vue";
  import UploadFiles from "@/views/equipmentManagement/inspectionManagement/components/uploadFiles.vue";
  import ViewFiles from "@/views/equipmentManagement/inspectionManagement/components/viewFiles.vue";
// 接口引入
import {
  delTimingTask,
  inspectionTaskList,
  timingTaskList
} from "@/api/inspectionManagement/index.js";
import {
  delQrCode,
  qrCodeList,
  qrCodeScanRecordList
} from "@/api/inspectionUpload/index.js";
  import {
    delTimingTask,
    inspectionTaskList,
    timingTaskList,
    completeInspection,
    batchCompleteInspection,
  } from "@/api/inspectionManagement/index.js";
  import Pagination from "@/components/PIMTable/Pagination.vue";
// 全局变量
const { proxy } = getCurrentInstance();
const formDia = ref();
const qrCodeDia = ref();
const viewFiles = ref();
const viewQrCodeFiles = ref();
  const { proxy } = getCurrentInstance();
  const formDia = ref();
  const viewFiles = ref();
  const uploadFiles = ref();
// 查询参数
const queryParams = reactive({
  searchAll: "",
});
  const queryParams = reactive({ taskName: "" });
// 标签页配置
const activeTab = ref("task");
const tabName = ref("task");
const tabs = reactive([
  { name: "task", label: "生产巡检" },
  { name: "qrCodeScanRecord", label: "现场巡检记录" },
]);
  const activeRadio = ref("taskManage");
  const radios = reactive([
    { name: "taskManage", label: "巡检任务" },
    { name: "task", label: "巡检记录" },
  ]);
// 单选框配置
const activeRadio = ref("taskManage");
const radios = reactive([
  { name: "taskManage", label: "定时任务管理" },
  { name: "task", label: "定时任务记录" },
  { name: "qrCode", label: "二维码管理" },
]);
  const selectedRows = ref([]);
  const tableData = ref([]);
  const operationsArr = ref([]);
  const tableColumns = ref([]);
  const tableLoading = ref(false);
  const total = ref(0);
  const pageNum = ref(1);
  const pageSize = ref(100);
// 表格数据
const selectedRows = ref([]);
const tableData = ref([]);
const operationsArr = ref([]);
const tableColumns = ref([]);
const tableLoading = ref(false);
const total = ref(0);
const pageNum = ref(1);
const pageSize = ref(10);
  const columns = ref([
    { 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: "是否启用", minWidth: 100, dataType: "slot", slot: "isEnabled" },
    {
      prop: "frequencyType", label: "频次", minWidth: 120,
      formatData: params => ({ DAILY: "每日", WEEKLY: "每周", MONTHLY: "每月", QUARTERLY: "季度" }[params] || ""),
    },
    {
      prop: "frequencyDetail", label: "开始日期与时间", minWidth: 200,
      formatter: (row, column, cellValue) => {
        if (typeof cellValue !== "string") return "";
        return cellValue.replace(/MON|TUE|WED|THU|FRI|SAT|SUN/g, match => ({ MON: "周一", TUE: "周二", WED: "周三", THU: "周四", FRI: "周五", SAT: "周六", SUN: "周日" }[match]));
      },
    },
    { prop: "registrant", label: "登记人", minWidth: 120 },
    {
      prop: "createTime", label: "登记日期", minWidth: 180,
      formatData: cell => { if (!cell) return "-"; try { return dayjs(cell).format("YYYY-MM-DD HH:mm:ss"); } catch { return cell; } },
    },
    { prop: "abnormalDescription", label: "异常描述", minWidth: 150 },
  ]);
// 列配置
const columns = ref([
  { prop: "taskName", label: "巡检任务名称", minWidth: 160 },
  { prop: "inspectionLocation", label: "地点", minWidth: 120 },
  { prop: "remarks", label: "备注", minWidth: 150 },
  { prop: "inspector", label: "执行巡检人", minWidth: 150, slot: "inspector" },
  {
    prop: "frequencyType",
    label: "频次",
    minWidth: 150,
    formatter: (_, __, val) => ({
      DAILY: "每日",
      WEEKLY: "每周",
      MONTHLY: "每月",
      QUARTERLY: "季度"
    }[val] || "")
  },
  {
    prop: "frequencyDetail",
    label: "开始日期与时间",
    minWidth: 150,
    formatter: (row, column, cellValue) => {
      // 先判断是否是字符串
      if (typeof cellValue !== 'string') return '';
      let val = cellValue;
      const replacements = {
        MON: '周一',
        TUE: '周二',
        WED: '周三',
        THU: '周四',
        FRI: '周五',
        SAT: '周六',
        SUN: '周日'
      };
      // 使用正则一次性替换所有匹配项
      return val.replace(/MON|TUE|WED|THU|FRI|SAT|SUN/g, match => replacements[match]);
    }
  },
  { prop: "registrant", label: "登记人", minWidth: 100 },
  { prop: "createTime", label: "登记日期", minWidth: 100 },
]);
// 操作列配置
const getOperationColumn = (operations) => {
  if (!operations || operations.length === 0) return null;
  const operationConfig = {
    label: "操作",
    width: 130,
    fixed: "right",
    dataType: "action",
    operation: operations.map(op => {
      switch (op) {
        case 'edit':
          return {
            name: "编辑",
            clickFun: handleAdd,
            color: "#409EFF"
          };
        case 'viewFile':
          return {
            name: "查看附件",
            clickFun: viewFile,
            color: "#67C23A"
          };
        default:
          return null;
      }
    }).filter(Boolean)
  };
  return operationConfig;
};
const columns1 = ref([
  { prop: "deviceName", label: "设备名称", minWidth: 160 },
  { prop: "location", label: "所在位置描述", minWidth: 120 },
  { prop: "createBy", label: "创建者", minWidth: 100 },
  { prop: "createTime", label: "创建时间", minWidth: 100 },
]);
onMounted(() => {
  radioChange('taskManage');
});
// 标签页点击事件
const handleTabClick = (tab) => {
  tabName.value = tab.props.name;
  tableData.value = [];
  getList();
};
// 单选变化
const radioChange = (value) => {
  if (value === "taskManage") {
    const operationColumn = getOperationColumn(['edit']);
    tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])];
    operationsArr.value = ['edit'];
  } else if (value === "task") {
    const operationColumn = getOperationColumn(['viewFile']);
    tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])];
    operationsArr.value = ['viewFile'];
  } else {
    const operationColumn = getOperationColumn(['edit']);
    tableColumns.value = [...columns1.value, ...(operationColumn ? [operationColumn] : [])];
    operationsArr.value = ['edit'];
  }
  pageNum.value = 1;
  pageSize.value = 10;
  getList();
};
// 查询操作
const handleQuery = () => {
  pageNum.value = 1;
  pageSize.value = 10;
  getList();
};
// 分页处理
const handlePagination = (val) => {
   pageNum.value = val.page;
   pageSize.value = val.limit;
   getList();
};
// 获取列表数据
const getList = () => {
  tableLoading.value = true;
  const params = { ...queryParams, size: pageSize.value, current: pageNum.value };
  let apiCall;
  if (tabName.value === 'task') {
    switch (activeRadio.value) {
      case "task":
        apiCall = inspectionTaskList(params);
        break;
      case "qrCode":
        apiCall = qrCodeList(params);
        break;
      default:
        apiCall = timingTaskList(params);
    }
  } else {
    apiCall = qrCodeScanRecordList(params);
  }
  apiCall.then(res => {
    const rawData = res.data.records || [];
    // 处理 inspector 字段,将字符串转换为数组(适用于所有情况)
    tableData.value = rawData.map(item => {
      const processedItem = { ...item };
      // 处理 inspector 字段
      if (processedItem.inspector) {
        if (typeof processedItem.inspector === 'string') {
          // 字符串按逗号分割
          processedItem.inspector = processedItem.inspector.split(',').map(s => s.trim()).filter(s => s);
        } else if (!Array.isArray(processedItem.inspector)) {
          // 非数组转为数组
          processedItem.inspector = [processedItem.inspector];
  const getOperationColumn = operations => {
    if (!operations || operations.length === 0) return null;
    return {
      label: "操作", width: operations.length > 1 ? 180 : 130, fixed: "right", align: "center", dataType: "action",
      operation: operations.map(op => {
        switch (op) {
          case "edit": return { name: "编辑", clickFun: handleAdd, color: "#409EFF" };
          case "upload": return { name: "上传", clickFun: openUploadDialog, color: "#409EFF" };
          case "viewFile": return { name: "查看附件", clickFun: viewFile, color: "#67C23A" };
          default: return null;
        }
      } else {
        // 空值设为空数组
        processedItem.inspector = [];
      }
      return processedItem;
      }).filter(Boolean),
    };
  };
  // 巡检记录 - 日期分组
  const inspectionExpandedRowKeys = ref([]);
  const groupInspectionByDate = (list) => {
    const map = {};
    list.forEach(item => {
      const date = item.dateStr || (item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD') : '未知日期');
      if (!map[date]) map[date] = [];
      map[date].push(item);
    });
    total.value = res.data.total || 0;
  }).finally(() => {
    tableLoading.value = false;
  });
};
    return Object.entries(map).map(([date, children]) => ({ date, children, count: children.length }));
  };
// 重置查询
const resetQuery = () => {
  for (const key in queryParams) {
    if (!["pageNum", "pageSize"].includes(key)) {
      queryParams[key] = "";
    }
  }
  handleQuery();
};
  const groupedInspectionList = computed(() => groupInspectionByDate(tableData.value));
// 新增 / 编辑
const handleAdd = (row) => {
  const type = row ? 'edit' : 'add';
  nextTick(() => {
    if (tabName.value === 'task') {
      if (activeRadio.value === "taskManage") {
        formDia.value?.openDialog(type, row);
      } else if (activeRadio.value === "qrCode") {
        qrCodeDia.value?.openDialog(type, row);
  const onInspectionExpandChange = (row, expandedRows) => {
    inspectionExpandedRowKeys.value = expandedRows.map(r => r.date);
  };
  // 单条巡检完成
  const handleSingleComplete = async (row) => {
    try {
      await ElMessageBox.confirm('确认将该巡检记录标记为完成?', '提示', { type: 'warning' });
      const res = await completeInspection(row.id);
      if (res.code === 200) {
        ElMessage.success('巡检完成');
        getList();
      } else {
        ElMessage.error(res.msg || '操作失败');
      }
    } else {
      viewQrCodeFiles.value?.openDialog(row);
    } catch { /* 取消 */ }
  };
  // 一键巡检完成
  const handleBatchInspection = async (dateStr) => {
    try {
      await ElMessageBox.confirm(`确认将 ${dateStr} 的所有待巡检记录标记为完成?`, '提示', { type: 'warning' });
      const res = await batchCompleteInspection(dateStr);
      if (res.code === 200) {
        ElMessage.success(res.msg || '批量完成成功');
        getList();
      } else {
        ElMessage.error(res.msg || '操作失败');
      }
    } catch { /* 取消 */ }
  };
  onMounted(() => { radioChange("taskManage"); });
  const radioChange = value => {
    inspectionExpandedRowKeys.value = [];
    if (value === "taskManage") {
      const operationColumn = getOperationColumn(["edit"]);
      tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])];
      operationsArr.value = ["edit"];
    } else if (value === "task") {
      const operationColumn = getOperationColumn(["upload", "viewFile"]);
      const taskColumns = columns.value.filter(col => col.prop !== "isEnabled");
      tableColumns.value = [...taskColumns, ...(operationColumn ? [operationColumn] : [])];
      operationsArr.value = ["upload", "viewFile"];
    }
  });
};
    pageNum.value = 1;
    getList();
  };
// 查看附件
const viewFile = (row) => {
  nextTick(() => {
    viewFiles.value?.openDialog(row);
  });
};
  const handleQuery = () => { pageNum.value = 1; getList(); };
// 删除操作
const handleDelete = () => {
  if (!selectedRows.value.length) {
    proxy.$modal.msgWarning("请选择要删除的数据");
    return;
  }
  const deleteIds = selectedRows.value.map(item => item.id);
  const api = activeRadio.value === "taskManage" ? delTimingTask : delQrCode;
  proxy.$modal.confirm('是否确认删除所选数据项?').then(() => {
    return api(deleteIds);
  }).then(() => {
    proxy.$modal.msgSuccess("删除成功");
    handleQuery();
  }).catch(() => {});
};
  const handlePagination = val => { pageNum.value = val.page; pageSize.value = val.limit; getList(); };
// 多选变更
const handleSelectionChange = (selection) => {
  selectedRows.value = selection;
};
  const getList = () => {
    tableLoading.value = true;
    const params = { ...queryParams, size: pageSize.value, current: pageNum.value };
    const apiCall = activeRadio.value === "task" ? inspectionTaskList(params) : timingTaskList(params);
    apiCall.then(res => {
      const rawData = res.data.records || [];
      tableData.value = rawData.map(item => {
        const processedItem = { ...item };
        if (processedItem.inspector) {
          if (typeof processedItem.inspector === "string") {
            processedItem.inspector = processedItem.inspector.split(",").map(s => s.trim()).filter(s => s);
          } else if (!Array.isArray(processedItem.inspector)) {
            processedItem.inspector = [processedItem.inspector];
          }
        } else {
          processedItem.inspector = [];
        }
        return processedItem;
      });
      total.value = res.data.total || 0;
    }).finally(() => { tableLoading.value = false; });
  };
  const resetQuery = () => { queryParams.taskName = ""; handleQuery(); };
  const handleAdd = row => { nextTick(() => { formDia.value?.openDialog(row ? "edit" : "add", row); }); };
  const viewFile = row => { nextTick(() => { viewFiles.value?.openDialog(row); }); };
  const openUploadDialog = row => { nextTick(() => { uploadFiles.value?.openDialog(row); }); };
  const handleDelete = () => {
    if (!selectedRows.value.length) { proxy.$modal.msgWarning("请选择要删除的数据"); return; }
    proxy.$modal.confirm("是否确认删除所选数据项?").then(() => delTimingTask(selectedRows.value.map(item => item.id)))
      .then(() => { proxy.$modal.msgSuccess("删除成功"); handleQuery(); }).catch(() => {});
  };
  const handleSelectionChange = selection => { selectedRows.value = selection; };
  const handleOut = () => {
    ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { confirmButtonText: "确认", cancelButtonText: "取消", type: "warning" })
      .then(() => {
        if (activeRadio.value === "taskManage") proxy.download("/timingTask/export", {}, "巡检任务.xlsx");
        else proxy.download("/inspectionTask/export", {}, "巡检记录.xlsx");
      }).catch(() => { proxy.$modal.msg("已取消"); });
  };
</script>
<style scoped>
.person-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.person-tag {
  margin-right: 4px;
  margin-bottom: 2px;
}
.no-data {
  color: #909399;
  font-size: 14px;
}
</style>
  .person-tags { display: flex; flex-wrap: wrap; gap: 4px; }
  .person-tag { margin-right: 4px; margin-bottom: 2px; }
  .no-data { color: #909399; font-size: 14px; }
</style>