| ÎļþÃû´Ó src/views/inspectionManagement/index.vue ÐÞ¸Ä |
| | |
| | | </div> |
| | | <div> |
| | | <div> |
| | | <PIMTable :loading="tableLoading" |
| | | <PIMTable :table-loading="tableLoading" |
| | | :table-data="tableData" |
| | | :columns="tableColumns" |
| | | :column="tableColumns" |
| | | @selection-change="handleSelectionChange" |
| | | :show-selection="true" |
| | | :is-selection="true" |
| | | :border="true" |
| | | style="width: 100%;height: calc(100vh - 30em)" |
| | | operationsWidth="130" |
| | | :operations="operationsArr" |
| | | @edit="handleAdd" |
| | | @viewFile="viewFile" |
| | | :table-style="{ width: '100%', height: 'calc(100vh - 30em)' }" |
| | | v-if="tabName === 'task'" |
| | | > |
| | | <template #inspector="{ row }"> |
| | |
| | | // ç»ä»¶å¼å
¥ |
| | | import Pagination from "@/components/Pagination/index.vue"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import FormDia from "@/views/inspectionManagement/components/formDia.vue"; |
| | | import QrCodeDia from "@/views/inspectionManagement/components/qrCodeDia.vue"; |
| | | import ViewFiles from "@/views/inspectionManagement/components/viewFiles.vue"; |
| | | import ViewQrCodeFiles from "@/views/inspectionManagement/components/viewQrCodeFiles.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 { |
| | |
| | | { 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 }, |
| | |
| | | // åéåå |
| | | const radioChange = (value) => { |
| | | if (value === "taskManage") { |
| | | tableColumns.value = columns.value; |
| | | const operationColumn = getOperationColumn(['edit']); |
| | | tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])]; |
| | | operationsArr.value = ['edit']; |
| | | } else if (value === "task") { |
| | | tableColumns.value = columns.value; |
| | | const operationColumn = getOperationColumn(['viewFile']); |
| | | tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])]; |
| | | operationsArr.value = ['viewFile']; |
| | | } else { |
| | | tableColumns.value = columns1.value; |
| | | const operationColumn = getOperationColumn(['edit']); |
| | | tableColumns.value = [...columns1.value, ...(operationColumn ? [operationColumn] : [])]; |
| | | operationsArr.value = ['edit']; |
| | | } |
| | | pageNum.value = 1; |