| | |
| | | formatData: cell => { |
| | | if (!cell) return "-"; |
| | | try { |
| | | return dayjs(cell).format("YYYY-MM-DD HH:mm:ss"); |
| | | return dayjs(cell).format("YYYY-MM-DD"); |
| | | } catch { |
| | | return cell; |
| | | } |
| | |
| | | operation: operations |
| | | .map(op => { |
| | | switch (op) { |
| | | case "view": |
| | | return { |
| | | name: "详情", |
| | | clickFun: openViewDialog, |
| | | color: "#409EFF", |
| | | }; |
| | | case "edit": |
| | | return { |
| | | name: "编辑", |
| | |
| | | ]; |
| | | operationsArr.value = ["edit"]; |
| | | } else if (value === "task") { |
| | | const operationColumn = getOperationColumn(["upload", "viewFile"]); |
| | | const operationColumn = getOperationColumn(["view", "upload", "viewFile"]); |
| | | // 巡检记录不展示"是否启用"列 |
| | | const taskColumns = columns.value.filter(col => col.prop !== "isEnabled"); |
| | | tableColumns.value = [ |
| | | ...taskColumns, |
| | | ...(operationColumn ? [operationColumn] : []), |
| | | ]; |
| | | operationsArr.value = ["upload", "viewFile"]; |
| | | operationsArr.value = ["view", "upload", "viewFile"]; |
| | | } |
| | | pageNum.value = 1; |
| | | pageSize.value = 10; |
| | |
| | | |
| | | const openUploadDialog = row => { |
| | | nextTick(() => { |
| | | uploadFiles.value?.openDialog(row); |
| | | uploadFiles.value?.openDialog("add", row); |
| | | }); |
| | | }; |
| | | |
| | | const openViewDialog = row => { |
| | | nextTick(() => { |
| | | uploadFiles.value?.openDialog("view", row); |
| | | }); |
| | | }; |
| | | |