| | |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore() |
| | | const isAdminUser = computed(() => |
| | | ["admin", "普通2", "最高1"].some(r => (userStore.roles || []).includes(r)) |
| | | ) |
| | | import { Document, FolderOpened, UserFilled } from "@element-plus/icons-vue" |
| | | import { markRaw } from 'vue' |
| | | |
| | |
| | | dataType: "tag", |
| | | |
| | | formatData: (params) => { |
| | | if (params === 1) { |
| | | return "待处理"; |
| | | } else if (params === 2) { |
| | | return "已处理"; |
| | | } else { |
| | | return null; |
| | | if (params) { |
| | | let part = String(params) |
| | | const item = workOrderStatusOptions.value.find(item => item.value === part); |
| | | return item?.label || params; |
| | | } |
| | | return null; |
| | | }, |
| | | formatType: (params) => { |
| | | if (params === 1) { |
| | |
| | | Object.keys(searchForm.value).forEach(key => { |
| | | searchForm.value[key] = "" |
| | | }) |
| | | page.current = 1; |
| | | getList(); |
| | | } |
| | | // 表格选择数据 |
| | | const handleSelectionChange = (selection) => { |
| | |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | // 检查是否有他人维护的数据 |
| | | const unauthorizedData = selectedRows.value.filter(item => item.checkUserId !== userStore.id); |
| | | const unauthorizedData = selectedRows.value.filter(item => item.checkUserId !== userStore.id && !isAdminUser.value); |
| | | if (unauthorizedData.length > 0) { |
| | | proxy.$modal.msgWarning("不可删除他人维护的数据"); |
| | | return; |