Showing
17 changed files
with
38 additions
and
118 deletions
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | const emit = defineEmits(['handleReload', 'register']); |
31 | 31 | const { createMessage } = useMessage(); |
32 | 32 | |
33 | - const [registerForm, { getFieldsValue, setFieldsValue, validate, resetFields }] = useForm({ | |
33 | + const [registerForm, { getFieldsValue, setFieldsValue, validate }] = useForm({ | |
34 | 34 | labelWidth: 150, |
35 | 35 | schemas, |
36 | 36 | actionColOptions: { | ... | ... |
... | ... | @@ -3,22 +3,16 @@ |
3 | 3 | import { BasicForm, useForm } from '/@/components/Form'; |
4 | 4 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
5 | 5 | import { formSchema } from './config'; |
6 | - import { useMessage } from '/@/hooks/web/useMessage'; | |
7 | 6 | import { useI18n } from '/@/hooks/web/useI18n'; |
8 | 7 | import { JSONEditor } from '/@/components/CodeEditor'; |
9 | 8 | import { ApplicationApiItemType } from '/@/api/application/model/api'; |
10 | - | |
11 | - const emits = defineEmits(['success', 'register']); | |
12 | - | |
13 | 9 | const { t } = useI18n(); |
14 | 10 | |
15 | - const { createMessage } = useMessage(); | |
16 | - | |
17 | 11 | const handleCount = ref<Number>(); // 0 新增 1 编辑 2 详情 |
18 | 12 | |
19 | 13 | const recordData = ref<ApplicationApiItemType>(); |
20 | 14 | |
21 | - const [registerForm, { resetFields, validate, setFieldsValue, setProps }] = useForm({ | |
15 | + const [registerForm, { resetFields, setFieldsValue, setProps }] = useForm({ | |
22 | 16 | labelWidth: 120, |
23 | 17 | schemas: formSchema, |
24 | 18 | showActionButtonGroup: false, |
... | ... | @@ -32,7 +26,7 @@ |
32 | 26 | : t('application.api.action.detail') |
33 | 27 | ); |
34 | 28 | |
35 | - const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { | |
29 | + const [registerDrawer, { setDrawerProps }] = useDrawerInner(async (data) => { | |
36 | 30 | setDrawerProps({ loading: true }); |
37 | 31 | await resetFields(); |
38 | 32 | handleCount.value = data.isUpdate; | ... | ... |
... | ... | @@ -74,8 +74,7 @@ import {columns, searchFormSchema} from "./index"; |
74 | 74 | import {useI18n} from "/@/hooks/web/useI18n"; |
75 | 75 | import {getPlanList} from "/@/api/equipment/chenkPlan"; |
76 | 76 | import { planModal } from './components/index'; |
77 | -import {Button, Popconfirm, Switch, Tag} from "ant-design-vue"; | |
78 | -import Icon from "/@/components/Icon"; | |
77 | +import {Button, Switch, Tag} from "ant-design-vue"; | |
79 | 78 | import {Authority} from "/@/components/Authority"; |
80 | 79 | import {useModal} from "/@/components/Modal"; |
81 | 80 | import {deleteEquipmentPlan} from "/@/api/equipment/chenkPlan"; |
... | ... | @@ -91,7 +90,7 @@ import {useDrawer} from "/@/components/Drawer"; |
91 | 90 | const [registerApplicationApiFormDrawer, { openDrawer }] = useDrawer(); |
92 | 91 | const [ |
93 | 92 | registerTable, |
94 | - { reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection }, | |
93 | + { reload, setLoading, setSelectedRowKeys }, | |
95 | 94 | ] = useTable({ |
96 | 95 | title: t('equipment.checkPlan.listText'), |
97 | 96 | api: getPlanList, |
... | ... | @@ -115,7 +114,7 @@ const [ |
115 | 114 | }, |
116 | 115 | rowSelection: { |
117 | 116 | type: 'checkbox', |
118 | - getCheckboxProps: (record: any) => {}, | |
117 | + getCheckboxProps: () => {}, | |
119 | 118 | }, |
120 | 119 | }); |
121 | 120 | ... | ... |
... | ... | @@ -3,22 +3,19 @@ |
3 | 3 | import { BasicForm, useForm } from '/@/components/Form'; |
4 | 4 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
5 | 5 | import { formSchema } from './config'; |
6 | - import { useMessage } from '/@/hooks/web/useMessage'; | |
7 | 6 | import { useI18n } from '/@/hooks/web/useI18n'; |
8 | 7 | import { JSONEditor } from '/@/components/CodeEditor'; |
9 | 8 | import { ApplicationApiItemType } from '/@/api/application/model/api'; |
10 | 9 | |
11 | - const emits = defineEmits(['success', 'register']); | |
10 | + const _emits = defineEmits(['success', 'register']); | |
12 | 11 | |
13 | 12 | const { t } = useI18n(); |
14 | 13 | |
15 | - const { createMessage } = useMessage(); | |
16 | - | |
17 | 14 | const handleCount = ref<Number>(); // 0 新增 1 编辑 2 详情 |
18 | 15 | |
19 | 16 | const recordData = ref<ApplicationApiItemType>(); |
20 | 17 | |
21 | - const [registerForm, { resetFields, validate, setFieldsValue, setProps }] = useForm({ | |
18 | + const [registerForm, { resetFields, setFieldsValue, setProps }] = useForm({ | |
22 | 19 | labelWidth: 120, |
23 | 20 | schemas: formSchema, |
24 | 21 | showActionButtonGroup: false, |
... | ... | @@ -32,7 +29,7 @@ |
32 | 29 | : t('application.api.action.detail') |
33 | 30 | ); |
34 | 31 | |
35 | - const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { | |
32 | + const [registerDrawer, { setDrawerProps }] = useDrawerInner(async (data) => { | |
36 | 33 | setDrawerProps({ loading: true }); |
37 | 34 | await resetFields(); |
38 | 35 | handleCount.value = data.isUpdate; | ... | ... |
... | ... | @@ -75,7 +75,7 @@ const { t } = useI18n(); |
75 | 75 | // 定义人员选项 |
76 | 76 | const Options = ref([]); |
77 | 77 | const searchInfo = reactive<Recordable>({}); |
78 | -const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | |
78 | +const { organizationIdTreeRef } = useResetOrganizationTree(searchInfo); | |
79 | 79 | const userVisible = ref(false); |
80 | 80 | const userModalTitle = ref('选人'); |
81 | 81 | const selectedItem = ref<{ id: string; username: string } | null>(null); |
... | ... | @@ -95,7 +95,7 @@ const selectedUsername = computed({ |
95 | 95 | }); |
96 | 96 | |
97 | 97 | const emits = defineEmits(['success', 'register']); |
98 | -const [registerForm, { validate, resetFields, setFieldsValue, updateSchema, setProps }] = useForm( | |
98 | +const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm( | |
99 | 99 | { |
100 | 100 | labelWidth: 140, |
101 | 101 | schemas: formSchema, | ... | ... |
1 | 1 | import {FormSchema as BFormSchema, useComponentRegister} from "../../../../components/Form"; |
2 | -import {useI18n} from "../../../../hooks/web/useI18n"; | |
2 | +import {useI18n} from "/@/hooks/web/useI18n"; | |
3 | 3 | const { t } = useI18n(); |
4 | 4 | import { CategoryTreeSelect } from '../../../common/CategoryTreeSelect'; |
5 | 5 | import { OrgTreeSelect } from '../../../common/OrgTreeSelect'; | ... | ... |
... | ... | @@ -50,7 +50,7 @@ const { createMessage } = useMessage(); |
50 | 50 | |
51 | 51 | const [ |
52 | 52 | registerTable, |
53 | - { reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection }, | |
53 | + { reload, setLoading, getSelectRowKeys, setSelectedRowKeys }, | |
54 | 54 | ] = useTable({ |
55 | 55 | title: t('equipment.supplier.listText'), |
56 | 56 | api: getSupplierList, |
... | ... | @@ -74,7 +74,7 @@ const [ |
74 | 74 | }, |
75 | 75 | rowSelection: { |
76 | 76 | type: 'checkbox', |
77 | - getCheckboxProps: (record: any) => {}, | |
77 | + getCheckboxProps: () => {}, | |
78 | 78 | }, |
79 | 79 | }); |
80 | 80 | ... | ... |
... | ... | @@ -127,7 +127,7 @@ const initialData = ref({ |
127 | 127 | |
128 | 128 | const [ |
129 | 129 | registerTable, |
130 | - { reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection }, | |
130 | + { reload, setLoading, setSelectedRowKeys }, | |
131 | 131 | ] = useTable({ |
132 | 132 | title: t('inspection.inspectionPlan.listText'), |
133 | 133 | api: getInspectionPlanList, |
... | ... | @@ -151,7 +151,7 @@ const [ |
151 | 151 | }, |
152 | 152 | rowSelection: { |
153 | 153 | type: 'checkbox', |
154 | - getCheckboxProps: (record: any) => {}, | |
154 | + getCheckboxProps: () => {}, | |
155 | 155 | }, |
156 | 156 | }); |
157 | 157 | ... | ... |
... | ... | @@ -73,7 +73,6 @@ |
73 | 73 | const isViewMode = ref(false); |
74 | 74 | const modalTitle = ref(''); |
75 | 75 | import { dateFormat } from '/@/utils/common/compUtils'; |
76 | - import {getRecordDetail} from "/@/api/inspection/serviceRecord"; | |
77 | 76 | const initialData = ref({ |
78 | 77 | form: { |
79 | 78 | code: '', |
... | ... | @@ -87,7 +86,7 @@ |
87 | 86 | }); |
88 | 87 | const [ |
89 | 88 | registerTable, |
90 | - { reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection }, | |
89 | + { reload, setLoading, setSelectedRowKeys, }, | |
91 | 90 | ] = useTable({ |
92 | 91 | title: t('inspection.inspectionRecord.listText'), |
93 | 92 | api: getInspectionRecordList, |
... | ... | @@ -111,7 +110,7 @@ |
111 | 110 | }, |
112 | 111 | rowSelection: { |
113 | 112 | type: 'checkbox', |
114 | - getCheckboxProps: (record: any) => {}, | |
113 | + getCheckboxProps: () => {}, | |
115 | 114 | }, |
116 | 115 | }); |
117 | 116 | ... | ... |
... | ... | @@ -99,13 +99,10 @@ |
99 | 99 | import { servicePlanModal } from "./components/index" |
100 | 100 | import { columns, searchFormSchema } from './index'; |
101 | 101 | import { useI18n } from '/@/hooks/web/useI18n'; |
102 | - import {Button, message, Tag} from 'ant-design-vue'; | |
103 | - import {useModal} from "/@/components/Modal"; | |
102 | + import {Button, Tag} from 'ant-design-vue'; | |
104 | 103 | import {useMessage} from "/@/hooks/web/useMessage"; |
105 | 104 | const { t } = useI18n(); |
106 | 105 | import { ref } from "vue" |
107 | - import {getPreservePlanDetail} from "/@/api/inspection/inspectionPlan"; | |
108 | - const [registerModal, { openModal }] = useModal(); | |
109 | 106 | const { createMessage } = useMessage(); |
110 | 107 | const modalVisible = ref(false); |
111 | 108 | const isViewMode = ref(false); |
... | ... | @@ -122,7 +119,7 @@ |
122 | 119 | }); |
123 | 120 | const [ |
124 | 121 | registerTable, |
125 | - { reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection }, | |
122 | + { reload, setLoading, setSelectedRowKeys, }, | |
126 | 123 | ] = useTable({ |
127 | 124 | title: t('inspection.servicePlan.listText'), |
128 | 125 | api: getServicePlanList, |
... | ... | @@ -146,7 +143,7 @@ |
146 | 143 | }, |
147 | 144 | rowSelection: { |
148 | 145 | type: 'checkbox', |
149 | - getCheckboxProps: (record: any) => {}, | |
146 | + getCheckboxProps: () => {}, | |
150 | 147 | }, |
151 | 148 | }); |
152 | 149 | |
... | ... | @@ -167,11 +164,9 @@ |
167 | 164 | }; |
168 | 165 | |
169 | 166 | const handleSubmit = async (data) => { |
170 | - console.log('提交的数据:', data); | |
171 | - | |
172 | 167 | modalVisible.value = false; |
173 | 168 | await savePreservePlan(data) |
174 | - message.success('提交成功'); | |
169 | + createMessage.success('提交成功'); | |
175 | 170 | handleReload() |
176 | 171 | }; |
177 | 172 | ... | ... |
... | ... | @@ -72,12 +72,12 @@ |
72 | 72 | </a-row> |
73 | 73 | <a-form-item label="保养明细" name="preserveDetailList"> |
74 | 74 | <a-table bordered :data-source="tableData" :columns="columns"> |
75 | - <template #deviceInfo="{ text, record, index }"> | |
75 | + <template #deviceInfo="{ record }"> | |
76 | 76 | <div> |
77 | 77 | {{record?.deviceInfo.name}} |
78 | 78 | </div> |
79 | 79 | </template> |
80 | - <template #status="{ text, record, index }"> | |
80 | + <template #status="{ record }"> | |
81 | 81 | <div> |
82 | 82 | <a-select |
83 | 83 | v-model:value="record.status" |
... | ... | @@ -88,7 +88,7 @@ |
88 | 88 | /> |
89 | 89 | </div> |
90 | 90 | </template> |
91 | - <template #operation="{ text, record, index }"> | |
91 | + <template #operation="{index }"> | |
92 | 92 | <div> |
93 | 93 | <a-button type="link" @click="handleDelete(index)" :disabled="isViewMode">删除</a-button> |
94 | 94 | </div> |
... | ... | @@ -119,13 +119,9 @@ |
119 | 119 | </template> |
120 | 120 | <script setup lang="ts"> |
121 | 121 | // 定义 props |
122 | -import {computed, onMounted, ref, unref, watch, reactive} from "vue"; | |
122 | +import {onMounted, ref, watch, reactive} from "vue"; | |
123 | 123 | import {getServicePlanList} from "/@/api/inspection/servicePlan"; |
124 | -import { ApiTreeSelect } from '/@/components/Form'; | |
125 | 124 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; |
126 | -import {OrganizationListItem} from "/@/api/system/model/systemModel"; | |
127 | -import {getOrganizationList} from "/@/api/system/system"; | |
128 | -import {useI18n} from "/@/hooks/web/useI18n"; | |
129 | 125 | import {getUserListByOrg} from "/@/api/equipment/ledger"; |
130 | 126 | import {useUserStore} from "/@/store/modules/user"; |
131 | 127 | import {serveRecordDetail} from "/@/api/inspection/serviceRecord"; |
... | ... | @@ -133,7 +129,7 @@ import {useMessage} from "/@/hooks/web/useMessage"; |
133 | 129 | const { createMessage } = useMessage(); |
134 | 130 | |
135 | 131 | const searchInfo = reactive<Recordable>({}); |
136 | -const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | |
132 | +const { organizationIdTreeRef } = useResetOrganizationTree(searchInfo); | |
137 | 133 | const userVisible = ref(false); |
138 | 134 | const userModalTitle = ref('选人'); |
139 | 135 | const selectedItem = ref<{ id: number; username: string } | null>(null); |
... | ... | @@ -238,56 +234,7 @@ const columns = [ |
238 | 234 | } |
239 | 235 | ]; |
240 | 236 | |
241 | - | |
242 | 237 | const userInfo = useUserStore(); |
243 | -const timespan = ref(Date.now()); | |
244 | -const orgList = ref<Recordable[]>([]); | |
245 | -const { t } = useI18n(); | |
246 | -const needReload = ref(true); | |
247 | -const getBindProps = computed<Recordable>(() => { | |
248 | - const params = {} | |
249 | - return { | |
250 | - replaceFields: { children: 'children', key: 'id', title: 'name', value: 'id' }, | |
251 | - getPopupContainer: () => document.body, | |
252 | - placeholder: t('deviceManagement.device.organizationPlaceholderText'), | |
253 | - maxLength: 250, | |
254 | - value: form.orgId, | |
255 | - dropdownStyle: { maxHeight: '300px' }, | |
256 | - api: async (params: OrganizationListItem) => { | |
257 | - try { | |
258 | - const result = ((await getOrganizationList(params)) as unknown as Recordable[]) || []; | |
259 | - orgList.value = result; | |
260 | - needReload.value = false; | |
261 | - return result; | |
262 | - } catch (error) { | |
263 | - return unref(orgList); | |
264 | - } | |
265 | - }, | |
266 | - params: { | |
267 | - ...params, | |
268 | - _t: unref(timespan), | |
269 | - }, | |
270 | - onChange: async (...args: any[]) => { | |
271 | - const _data = { | |
272 | - page: '1', | |
273 | - pageSize: '999', | |
274 | - tenantId: userInfo.getUserInfo.tenantId!, | |
275 | - organizationId: args?.[0] | |
276 | - } | |
277 | - const response = await getUserListByOrg(_data); // 调用接口 | |
278 | - Options.value = response.items?.map((item: any) => { | |
279 | - return { | |
280 | - label: item.username, | |
281 | - value: item.id, | |
282 | - } | |
283 | - }); | |
284 | - form.orgId.value = args?.[0] | |
285 | - | |
286 | - }, | |
287 | - }; | |
288 | -}); | |
289 | - | |
290 | - | |
291 | 238 | // 监听 initialData 的变化 |
292 | 239 | watch( |
293 | 240 | () => props.initialData, | ... | ... |
1 | 1 | import { FormSchema } from '/@/components/Form'; |
2 | 2 | import { useI18n } from '/@/hooks/web/useI18n'; |
3 | 3 | import { BasicColumn } from '/@/components/Table'; |
4 | -import {getServicePlanList} from "../../../api/inspection/servicePlan"; | |
4 | +import {getServicePlanList} from "/@/api/inspection/servicePlan"; | |
5 | 5 | const { t } = useI18n(); |
6 | 6 | |
7 | 7 | ... | ... |
... | ... | @@ -92,7 +92,7 @@ const initialData = ref({ |
92 | 92 | |
93 | 93 | const [ |
94 | 94 | registerTable, |
95 | - { reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection }, | |
95 | + { reload, setLoading, setSelectedRowKeys, }, | |
96 | 96 | ] = useTable({ |
97 | 97 | title: t('inspection.serviceRecord.listText'), |
98 | 98 | api: getServiceRecordList, |
... | ... | @@ -116,7 +116,7 @@ const [ |
116 | 116 | }, |
117 | 117 | rowSelection: { |
118 | 118 | type: 'checkbox', |
119 | - getCheckboxProps: (record: any) => {}, | |
119 | + getCheckboxProps: () => {}, | |
120 | 120 | }, |
121 | 121 | }); |
122 | 122 | |
... | ... | @@ -173,7 +173,6 @@ const handleEdit = async (record?: any) => { |
173 | 173 | modalTitle.value = '修改'; |
174 | 174 | try { |
175 | 175 | const response = await getRecordDetail({id}) |
176 | - console.log(response,'res') | |
177 | 176 | initialData.value = { |
178 | 177 | form: response, // 表单数据 |
179 | 178 | tableData: response.preserveDetailStatusList, // 表格数据 | ... | ... |
... | ... | @@ -3,22 +3,19 @@ |
3 | 3 | import { BasicForm, useForm } from '/@/components/Form'; |
4 | 4 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
5 | 5 | import { formSchema } from './config'; |
6 | - import { useMessage } from '/@/hooks/web/useMessage'; | |
7 | 6 | import { useI18n } from '/@/hooks/web/useI18n'; |
8 | 7 | import { JSONEditor } from '/@/components/CodeEditor'; |
9 | 8 | import { ApplicationApiItemType } from '/@/api/application/model/api'; |
10 | 9 | |
11 | - const emits = defineEmits(['success', 'register']); | |
10 | + const _emits = defineEmits(['success', 'register']); | |
12 | 11 | |
13 | 12 | const { t } = useI18n(); |
14 | 13 | |
15 | - const { createMessage } = useMessage(); | |
16 | - | |
17 | 14 | const handleCount = ref<Number>(); // 0 新增 1 编辑 2 详情 |
18 | 15 | |
19 | 16 | const recordData = ref<ApplicationApiItemType>(); |
20 | 17 | |
21 | - const [registerForm, { resetFields, validate, setFieldsValue, setProps }] = useForm({ | |
18 | + const [registerForm, { resetFields,setFieldsValue, setProps }] = useForm({ | |
22 | 19 | labelWidth: 120, |
23 | 20 | schemas: formSchema, |
24 | 21 | showActionButtonGroup: false, |
... | ... | @@ -32,7 +29,7 @@ |
32 | 29 | : t('application.api.action.detail') |
33 | 30 | ); |
34 | 31 | |
35 | - const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { | |
32 | + const [registerDrawer, { setDrawerProps, }] = useDrawerInner(async (data) => { | |
36 | 33 | setDrawerProps({ loading: true }); |
37 | 34 | await resetFields(); |
38 | 35 | handleCount.value = data.isUpdate; | ... | ... |
... | ... | @@ -67,7 +67,7 @@ const { createMessage } = useMessage(); |
67 | 67 | const userOptions = ref([]); |
68 | 68 | const Options = ref([]); |
69 | 69 | const searchInfo = reactive<Recordable>({}); |
70 | -const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | |
70 | +const { organizationIdTreeRef } = useResetOrganizationTree(searchInfo); | |
71 | 71 | const userVisible = ref(false); |
72 | 72 | const userModalTitle = ref('选人'); |
73 | 73 | const selectedItem = ref<{ id: string; username: string } | null>(null); | ... | ... |
... | ... | @@ -87,12 +87,12 @@ |
87 | 87 | import {useDrawer} from "/@/components/Drawer"; |
88 | 88 | import {deleteRepairOrder} from "/@/api/repair/order"; |
89 | 89 | import {useMessage} from "/@/hooks/web/useMessage"; |
90 | - const [registerApplicationApiFormDrawer, { openDrawer }] = useDrawer(); | |
90 | + const [registerApplicationApiFormDrawer, { }] = useDrawer(); | |
91 | 91 | const { createMessage } = useMessage(); |
92 | 92 | |
93 | 93 | const [ |
94 | 94 | registerTable, |
95 | - { reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection }, | |
95 | + { reload, setLoading, setSelectedRowKeys }, | |
96 | 96 | ] = useTable({ |
97 | 97 | title: t('repair.order.listText'), |
98 | 98 | api: getRepairOrderList, |
... | ... | @@ -116,7 +116,7 @@ |
116 | 116 | }, |
117 | 117 | rowSelection: { |
118 | 118 | type: 'checkbox', |
119 | - getCheckboxProps: (record: any) => {}, | |
119 | + getCheckboxProps: () => {}, | |
120 | 120 | }, |
121 | 121 | }); |
122 | 122 | |
... | ... | @@ -132,13 +132,6 @@ |
132 | 132 | }); |
133 | 133 | }; |
134 | 134 | |
135 | - const handleDetail = (record?: any) => { | |
136 | - openDrawer(true, { | |
137 | - isUpdate: 2, | |
138 | - record, | |
139 | - }); | |
140 | - }; | |
141 | - | |
142 | 135 | // 编辑 |
143 | 136 | const handleEdit = (record?: any) => { |
144 | 137 | openModal(true, { | ... | ... |