Showing
18 changed files
with
96 additions
and
82 deletions
... | ... | @@ -29,6 +29,9 @@ |
29 | 29 | </div> |
30 | 30 | </template> |
31 | 31 | </a-tree> |
32 | + <div v-else class="empty-tree" style="margin: 200px auto"> | |
33 | + <a-empty :image="simpleImage" /> | |
34 | + </div> | |
32 | 35 | <categoryModal @register="registerModal" @handleReload="handleReload" /> |
33 | 36 | </div> |
34 | 37 | </PageWrapper> |
... | ... | @@ -39,13 +42,16 @@ |
39 | 42 | import { categoryModal } from './components/index'; |
40 | 43 | import { useModal } from '/@/components/Modal'; |
41 | 44 | import { deleteCategory, getAllCategory } from '/@/api/equipment/category'; |
42 | - import { ref, onMounted } from 'vue'; | |
45 | + import { ref, onMounted } from 'vue'; | |
46 | + import { Empty } from 'ant-design-vue'; | |
43 | 47 | import { useI18n } from '/@/hooks/web/useI18n'; |
44 | 48 | import { useMessage } from '/@/hooks/web/useMessage'; |
45 | 49 | const treeData = ref([]); // 声明为响应式变量 |
46 | 50 | const { t } = useI18n(); |
47 | 51 | const { createMessage } = useMessage(); |
48 | 52 | const searchKeyword = ref(''); |
53 | + | |
54 | + const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE; | |
49 | 55 | // 递归转换函数 |
50 | 56 | const transformTreeData = (data: any) => { |
51 | 57 | return data?.map((item) => { |
... | ... | @@ -100,7 +106,6 @@ |
100 | 106 | |
101 | 107 | // 编辑 |
102 | 108 | const handleEdit = (record?: any) => { |
103 | - console.log(record, 'record'); | |
104 | 109 | openModal(true, { |
105 | 110 | isUpdate: true, |
106 | 111 | record, | ... | ... |
... | ... | @@ -4,9 +4,14 @@ import { useI18n } from '/@/hooks/web/useI18n'; |
4 | 4 | export enum FormFieldsEnum { |
5 | 5 | CODE = 'code', |
6 | 6 | CATEGORY_NAME = 'reason', |
7 | + CATEGORY_STATUS = 'status', | |
7 | 8 | } |
8 | 9 | |
9 | 10 | const { t } = useI18n(); |
11 | +const statusOptions = [ | |
12 | + { label: t('equipment.errorReason.enableText'), value: 'ENABLE' }, | |
13 | + { label: t('equipment.errorReason.disabledText'), value: 'DISABLE' }, | |
14 | +]; | |
10 | 15 | |
11 | 16 | export const formSchema: FormSchema[] = [ |
12 | 17 | { |
... | ... | @@ -20,8 +25,17 @@ export const formSchema: FormSchema[] = [ |
20 | 25 | } |
21 | 26 | }, |
22 | 27 | { |
28 | + field: FormFieldsEnum.CATEGORY_STATUS, | |
29 | + label: t('equipment.errorReason.statusText'), | |
30 | + component: 'Select', | |
31 | + componentProps: { | |
32 | + options: statusOptions, | |
33 | + disabled: 'disabled', | |
34 | + }, | |
35 | + }, | |
36 | + { | |
23 | 37 | field: FormFieldsEnum.CATEGORY_NAME, |
24 | - label: t('application.api.text.categoryName'), | |
38 | + label: t('equipment.errorReason.nameText'), | |
25 | 39 | component: 'Input', |
26 | 40 | componentProps() { |
27 | 41 | return { | ... | ... |
... | ... | @@ -3,14 +3,11 @@ |
3 | 3 | import { BasicForm, useForm } from '/@/components/Form'; |
4 | 4 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
5 | 5 | import { formSchema } from './config'; |
6 | - import { useI18n } from '/@/hooks/web/useI18n'; | |
7 | 6 | import { JSONEditor } from '/@/components/CodeEditor'; |
8 | 7 | import { ApplicationApiItemType } from '/@/api/application/model/api'; |
9 | 8 | |
10 | 9 | const _emits = defineEmits(['success', 'register']); |
11 | 10 | |
12 | - const { t } = useI18n(); | |
13 | - | |
14 | 11 | const handleCount = ref<Number>(); // 0 新增 1 编辑 2 详情 |
15 | 12 | |
16 | 13 | const recordData = ref<ApplicationApiItemType>(); |
... | ... | @@ -22,11 +19,7 @@ |
22 | 19 | }); |
23 | 20 | |
24 | 21 | const cacheTitle = computed(() => |
25 | - unref(handleCount) === 0 | |
26 | - ? t('application.api.action.create') | |
27 | - : unref(handleCount) === 1 | |
28 | - ? t('application.api.action.edit') | |
29 | - : t('application.api.action.detail') | |
22 | + "故障详情" | |
30 | 23 | ); |
31 | 24 | |
32 | 25 | const [registerDrawer, { setDrawerProps }] = useDrawerInner(async (data) => { | ... | ... |
... | ... | @@ -7,13 +7,6 @@ |
7 | 7 | {{ t('equipment.errorReason.createCategoryText') }} |
8 | 8 | </Button> |
9 | 9 | </Authority> |
10 | - <Authority value="api:yt:errorReason:delete"> | |
11 | - <Popconfirm :title="t('common.deleteConfirmText')" @confirm="handleDelete()"> | |
12 | - <a-button color="error" :disabled="!isExistOption"> | |
13 | - {{ t('common.batchDeleteText') }} | |
14 | - </a-button> | |
15 | - </Popconfirm> | |
16 | - </Authority> | |
17 | 10 | </template> |
18 | 11 | <template #status="{ record }"> |
19 | 12 | <Switch |
... | ... | @@ -69,14 +62,11 @@ import { |
69 | 62 | getEquipmentErrorList |
70 | 63 | } from '/@/api/equipment/errorReason'; |
71 | 64 | import { columns, searchFormSchema } from './index'; |
72 | -import { getAuthCache } from '/@/utils/auth'; | |
73 | -import { USER_INFO_KEY } from '/@/enums/cacheEnum'; | |
74 | -import {Button, Popconfirm, Switch} from 'ant-design-vue'; | |
65 | +import {Button, Switch} from 'ant-design-vue'; | |
75 | 66 | import {Authority} from "/@/components/Authority"; |
76 | 67 | import {useModal} from "/@/components/Modal"; |
77 | 68 | import { reasonModal } from './components/index'; |
78 | 69 | import {useMessage} from "/@/hooks/web/useMessage"; |
79 | -import {useBatchOperation} from "/@/utils/useBatchOperation"; | |
80 | 70 | import { useDrawer} from "/@/components/Drawer"; |
81 | 71 | |
82 | 72 | import {FormDrawer} from "./components/FormDrawer/index"; |
... | ... | @@ -87,7 +77,7 @@ const { createMessage } = useMessage(); |
87 | 77 | |
88 | 78 | const [ |
89 | 79 | registerTable, |
90 | - { reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection }, | |
80 | + { reload, setLoading, getSelectRowKeys, setSelectedRowKeys }, | |
91 | 81 | ] = useTable({ |
92 | 82 | title: t('equipment.errorReason.listText'), |
93 | 83 | api: getEquipmentErrorList, |
... | ... | @@ -109,17 +99,7 @@ const [ |
109 | 99 | slots: { customRender: 'action' }, |
110 | 100 | fixed: 'right', |
111 | 101 | }, |
112 | - rowSelection: { | |
113 | - type: 'checkbox', | |
114 | - getCheckboxProps: (record: any) => { | |
115 | - return { | |
116 | - disabled: | |
117 | - getAuthCache(USER_INFO_KEY).id === record.id ? !!record.status : true, | |
118 | - }; | |
119 | - }, | |
120 | - }, | |
121 | 102 | }); |
122 | -const { isExistOption } = useBatchOperation(getRowSelection, setSelectedRowKeys); | |
123 | 103 | const [registerApplicationApiFormDrawer, { openDrawer }] = useDrawer(); |
124 | 104 | const [registerModal, { openModal }] = useModal(); |
125 | 105 | ... | ... |
... | ... | @@ -50,7 +50,7 @@ |
50 | 50 | import {computed, nextTick, reactive, ref} from "vue"; |
51 | 51 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
52 | 52 | import { SchemaFiled} from "../../config/enum"; |
53 | -import {BasicForm,useForm} from "/@/components/Form"; | |
53 | +import {BasicForm, FileItem, useForm} from "/@/components/Form"; | |
54 | 54 | import {formSchema} from "../../config/data"; |
55 | 55 | import {useHooks} from "/@/views/report/config/hooks/index.hooks"; |
56 | 56 | import {getUserListByOrg,ledgerEditDetailPage,saveLedger } from "/@/api/equipment/ledger" |
... | ... | @@ -59,6 +59,7 @@ import {useThrottleFn} from "@vueuse/shared/index"; |
59 | 59 | import {useMessage} from "/@/hooks/web/useMessage"; |
60 | 60 | import {useI18n} from "/@/hooks/web/useI18n"; |
61 | 61 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; |
62 | +import {buildUUID} from "/@/utils/uuid"; | |
62 | 63 | const { |
63 | 64 | setDefaultTime, |
64 | 65 | disableCustomWeekly, |
... | ... | @@ -116,6 +117,11 @@ const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async ( |
116 | 117 | } |
117 | 118 | selectedItem.value.username = data?.record?.directorName || ''; |
118 | 119 | selectedItem.value.id = data?.record?.directorId || ''; |
120 | + if (data?.record?.deviceImg) { | |
121 | + setFieldsValue({ | |
122 | + image: [{ uid: buildUUID(), name: 'name', url: data?.record?.deviceImg } as FileItem], | |
123 | + }); | |
124 | + } | |
119 | 125 | setFieldsValue(setDefaultTime()); |
120 | 126 | updateSchema(disableCustomWeekly(0)); |
121 | 127 | if (businessText.value === 'add') return; |
... | ... | @@ -163,6 +169,7 @@ const getValue = async () => { |
163 | 169 | const data = { |
164 | 170 | ...values, |
165 | 171 | buyDate: values.buyDate?.format('YYYY-MM-DD hh:mm:ss'), |
172 | + deviceImg: values.image?.[0]?.url, | |
166 | 173 | productDate: values.productDate?.format('YYYY-MM-DD hh:mm:ss'), |
167 | 174 | receiveDate: values.receiveDate?.format('YYYY-MM-DD hh:mm:ss'), |
168 | 175 | registeDate: values.registeDate?.format('YYYY-MM-DD hh:mm:ss'), | ... | ... |
... | ... | @@ -4,6 +4,8 @@ const { t } = useI18n(); |
4 | 4 | import { CategoryTreeSelect } from '../../../common/CategoryTreeSelect'; |
5 | 5 | import { OrgTreeSelect } from '../../../common/OrgTreeSelect'; |
6 | 6 | import {supplierListPull} from "/@/api/equipment/supplier"; |
7 | +import {uploadThumbnail} from "/@/api/configuration/center/configurationCenter"; | |
8 | +import {createImgPreview} from "/@/components/Preview"; | |
7 | 9 | useComponentRegister('OrgTreeSelect', OrgTreeSelect); |
8 | 10 | useComponentRegister('CategoryTreeSelect', CategoryTreeSelect); |
9 | 11 | const statusOptions = [ |
... | ... | @@ -13,6 +15,40 @@ const statusOptions = [ |
13 | 15 | ]; |
14 | 16 | export const formSchema: BFormSchema[] = [ |
15 | 17 | { |
18 | + field: 'image', | |
19 | + label: t('deviceManagement.product.imageText'), | |
20 | + component: 'ApiUpload', | |
21 | + changeEvent: 'update:fileList', | |
22 | + valueField: 'fileList', | |
23 | + componentProps: ({ formModel }) => { | |
24 | + return { | |
25 | + listType: 'picture-card', | |
26 | + maxFileLimit: 1, | |
27 | + accept: '.png,.jpg,.jpeg,.gif', | |
28 | + api: async (file: File) => { | |
29 | + try { | |
30 | + const formData = new FormData(); | |
31 | + formData.set('file', file); | |
32 | + const { fileStaticUri, fileName } = await uploadThumbnail(formData); | |
33 | + return { | |
34 | + uid: fileStaticUri, | |
35 | + name: fileName, | |
36 | + url: fileStaticUri, | |
37 | + }; | |
38 | + } catch (error) { | |
39 | + return {}; | |
40 | + } | |
41 | + }, | |
42 | + onPreview: (fileList) => { | |
43 | + createImgPreview({ imageList: [fileList.url!] }); | |
44 | + }, | |
45 | + onDelete(url: string) { | |
46 | + formModel.deleteUrl = url!; | |
47 | + }, | |
48 | + }; | |
49 | + }, | |
50 | + }, | |
51 | + { | |
16 | 52 | field: 'code', |
17 | 53 | label: t('equipment.ledger.nameCode'), |
18 | 54 | component: 'Input', | ... | ... |
... | ... | @@ -69,6 +69,12 @@ export enum DeviceListAuthEnum { |
69 | 69 | // 表格列数据 |
70 | 70 | export const columns: BasicColumn[] = [ |
71 | 71 | { |
72 | + title: t('repair.order.situationImg'), | |
73 | + dataIndex: 'deviceImg', | |
74 | + slots: { customRender: 'deviceImg' }, | |
75 | + width: 100, | |
76 | + }, | |
77 | + { | |
72 | 78 | title: t('business.deviceStatusText'), |
73 | 79 | dataIndex: 'status', |
74 | 80 | width: 110, | ... | ... |
... | ... | @@ -10,6 +10,18 @@ |
10 | 10 | </a-button> |
11 | 11 | </Authority> |
12 | 12 | </template> |
13 | + <template #deviceImg="{ record }"> | |
14 | + <TableImg | |
15 | + :size="30" | |
16 | + :showBadge="false" | |
17 | + :simpleShow="true" | |
18 | + :imgList=" | |
19 | + typeof record.deviceImg !== 'undefined' && record.deviceImg !== '' && record.deviceImg != null | |
20 | + ? [record.deviceImg] | |
21 | + : null | |
22 | + " | |
23 | + /> | |
24 | + </template> | |
13 | 25 | <template #status="{ record }"> |
14 | 26 | <Tag |
15 | 27 | :color=" |
... | ... | @@ -66,7 +78,7 @@ import { PageWrapper } from '/@/components/Page'; |
66 | 78 | import { LedgerDrawer } from "./components/modal/index" |
67 | 79 | const searchInfo = reactive<Recordable>({}); |
68 | 80 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo,'equipment'); |
69 | -import {BasicTable, TableAction, useTable} from "/@/components/Table"; | |
81 | +import {BasicTable, TableAction, TableImg, useTable} from "/@/components/Table"; | |
70 | 82 | import {OrganizationIdTree, useResetOrganizationTree} from "/@/views/common/organizationIdTree"; |
71 | 83 | import { getLedgerList, deleteLedger } from "/@/api/equipment/ledger" |
72 | 84 | import { |
... | ... | @@ -77,7 +89,7 @@ import { SbStatusEnum } from '/@/enums/deviceEnum'; |
77 | 89 | |
78 | 90 | import {useI18n} from "/@/hooks/web/useI18n"; |
79 | 91 | import {authBtn} from "/@/enums/roleEnum"; |
80 | -import {Button, Tag} from "ant-design-vue"; | |
92 | +import {Tag} from "ant-design-vue"; | |
81 | 93 | import {Authority} from "/@/components/Authority"; |
82 | 94 | import {getAuthCache} from "/@/utils/auth"; |
83 | 95 | import {USER_INFO_KEY} from "/@/enums/cacheEnum"; |
... | ... | @@ -99,11 +111,6 @@ const [ |
99 | 111 | reload, |
100 | 112 | setLoading, |
101 | 113 | setSelectedRowKeys, |
102 | - getForm, | |
103 | - getSelectRowKeys, | |
104 | - setProps, | |
105 | - getRowSelection, | |
106 | - clearSelectedRowKeys, | |
107 | 114 | }, |
108 | 115 | ] = useTable({ |
109 | 116 | title: t('equipment.ledger.ledgerListText'), |
... | ... | @@ -140,10 +147,6 @@ const [ |
140 | 147 | slots: { customRender: 'action' }, |
141 | 148 | fixed: 'right', |
142 | 149 | }, |
143 | - rowSelection: { | |
144 | - type: 'checkbox', | |
145 | - getCheckboxProps: (record: any) => {}, | |
146 | - }, | |
147 | 150 | }); |
148 | 151 | |
149 | 152 | ... | ... |
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 | </a-row> |
22 | 22 | <a-row :gutter="16"> |
23 | 23 | <a-col :span="12"> |
24 | - <a-form-item label="保养设备" name="status"> | |
24 | + <a-form-item label="状态" name="status"> | |
25 | 25 | <a-select |
26 | 26 | v-model:value="form.status" |
27 | 27 | :options="statusOptions" |
... | ... | @@ -69,7 +69,7 @@ |
69 | 69 | /> |
70 | 70 | </div> |
71 | 71 | </template> |
72 | - <template #checkPlanId="{ text, record, index }"> | |
72 | + <template #checkPlanId="{ record }"> | |
73 | 73 | <div> |
74 | 74 | <a-select |
75 | 75 | v-model:value="record.checkPlanId" |
... | ... | @@ -80,12 +80,12 @@ |
80 | 80 | /> |
81 | 81 | </div> |
82 | 82 | </template> |
83 | - <template #preserveDetail="{ text, record, index }"> | |
83 | + <template #preserveDetail="{ record }"> | |
84 | 84 | <div> |
85 | 85 | <a-textarea v-model:value="record.preserveDetail" :disabled="isViewMode"/> |
86 | 86 | </div> |
87 | 87 | </template> |
88 | - <template #operation="{ text, record, index }"> | |
88 | + <template #operation="{ index }"> | |
89 | 89 | <div> |
90 | 90 | <a-button type="link" @click="handleDelete(index)" :disabled="isViewMode">删除</a-button> |
91 | 91 | </div> |
... | ... | @@ -101,8 +101,6 @@ import { ref, onMounted, watch } from 'vue'; |
101 | 101 | import { getLedgerList } from "/@/api/equipment/ledger"; |
102 | 102 | import { getPlanList } from "/@/api/equipment/chenkPlan"; |
103 | 103 | import { useI18n } from "/@/hooks/web/useI18n"; |
104 | -import { message } from 'ant-design-vue'; | |
105 | - | |
106 | 104 | |
107 | 105 | const Options = ref([]); |
108 | 106 | const planOptions = ref([]); | ... | ... |