diff --git a/apps/web-antd/src/api/erp/finance/receipt/index.ts b/apps/web-antd/src/api/erp/finance/receipt/index.ts index a02f8c5e8..e86a3f699 100644 --- a/apps/web-antd/src/api/erp/finance/receipt/index.ts +++ b/apps/web-antd/src/api/erp/finance/receipt/index.ts @@ -2,7 +2,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; -namespace ErpFinanceReceiptApi { +export namespace ErpFinanceReceiptApi { /** 收款单项 */ export interface FinanceReceiptItem { id?: number; diff --git a/apps/web-antd/src/api/iot/rule/scene/index.ts b/apps/web-antd/src/api/iot/rule/scene/index.ts index 5fc3224e1..59c8255a7 100644 --- a/apps/web-antd/src/api/iot/rule/scene/index.ts +++ b/apps/web-antd/src/api/iot/rule/scene/index.ts @@ -101,6 +101,7 @@ export interface Action { identifier?: string; value?: any; alertConfigId?: number; + params?: string; } /** 查询场景联动规则分页 */ diff --git a/apps/web-antd/src/api/iot/thingmodel/index.ts b/apps/web-antd/src/api/iot/thingmodel/index.ts index 341e0964e..354088704 100644 --- a/apps/web-antd/src/api/iot/thingmodel/index.ts +++ b/apps/web-antd/src/api/iot/thingmodel/index.ts @@ -175,17 +175,27 @@ export function deleteThingModelList(ids: number[]) { }); } -/** 导入物模型 TSL */ +/** 获取物模型 TSL */ +export function getThingModelTSL(productId: number) { + return requestClient.get( + '/iot/thing-model/get-tsl', + { params: { productId } }, + ); +} + +/** 导入物模型 TSL export function importThingModelTSL(productId: number, tslData: any) { return requestClient.post('/iot/thing-model/import-tsl', { productId, tslData, }); } + */ -/** 导出物模型 TSL */ +/** 导出物模型 TSL export function exportThingModelTSL(productId: number) { return requestClient.get('/iot/thing-model/export-tsl', { params: { productId }, }); } + */ diff --git a/apps/web-antd/src/components/bpmn-process-designer/package/designer/plugins/descriptor/activitiDescriptor.json b/apps/web-antd/src/components/bpmn-process-designer/package/designer/plugins/descriptor/activitiDescriptor.json index 94ba8f6cc..879785225 100644 --- a/apps/web-antd/src/components/bpmn-process-designer/package/designer/plugins/descriptor/activitiDescriptor.json +++ b/apps/web-antd/src/components/bpmn-process-designer/package/designer/plugins/descriptor/activitiDescriptor.json @@ -740,7 +740,10 @@ "name": "FailedJobRetryTimeCycle", "superClass": ["Element"], "meta": { - "allowedIn": ["activiti:AsyncCapable", "bpmn:MultiInstanceLoopCharacteristics"] + "allowedIn": [ + "activiti:AsyncCapable", + "bpmn:MultiInstanceLoopCharacteristics" + ] }, "properties": [ { diff --git a/apps/web-antd/src/components/bpmn-process-designer/package/designer/plugins/descriptor/camundaDescriptor.json b/apps/web-antd/src/components/bpmn-process-designer/package/designer/plugins/descriptor/camundaDescriptor.json index 8322561e7..18fe80288 100644 --- a/apps/web-antd/src/components/bpmn-process-designer/package/designer/plugins/descriptor/camundaDescriptor.json +++ b/apps/web-antd/src/components/bpmn-process-designer/package/designer/plugins/descriptor/camundaDescriptor.json @@ -727,7 +727,10 @@ "name": "FailedJobRetryTimeCycle", "superClass": ["Element"], "meta": { - "allowedIn": ["camunda:AsyncCapable", "bpmn:MultiInstanceLoopCharacteristics"] + "allowedIn": [ + "camunda:AsyncCapable", + "bpmn:MultiInstanceLoopCharacteristics" + ] }, "properties": [ { diff --git a/apps/web-antd/src/components/bpmn-process-designer/package/designer/plugins/descriptor/flowableDescriptor.json b/apps/web-antd/src/components/bpmn-process-designer/package/designer/plugins/descriptor/flowableDescriptor.json index c98c97236..2a929bd2d 100644 --- a/apps/web-antd/src/components/bpmn-process-designer/package/designer/plugins/descriptor/flowableDescriptor.json +++ b/apps/web-antd/src/components/bpmn-process-designer/package/designer/plugins/descriptor/flowableDescriptor.json @@ -910,7 +910,10 @@ "name": "FailedJobRetryTimeCycle", "superClass": ["Element"], "meta": { - "allowedIn": ["flowable:AsyncCapable", "bpmn:MultiInstanceLoopCharacteristics"] + "allowedIn": [ + "flowable:AsyncCapable", + "bpmn:MultiInstanceLoopCharacteristics" + ] }, "properties": [ { @@ -1254,11 +1257,11 @@ "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] }, "properties": [ - { - "name": "value", - "type": "Integer", - "isBody": true - } + { + "name": "value", + "type": "Integer", + "isBody": true + } ] }, { diff --git a/apps/web-antd/src/components/bpmn-process-designer/package/penal/time-event-config/TimeEventConfig.vue b/apps/web-antd/src/components/bpmn-process-designer/package/penal/time-event-config/TimeEventConfig.vue index 688863a80..7c5e1f6dc 100644 --- a/apps/web-antd/src/components/bpmn-process-designer/package/penal/time-event-config/TimeEventConfig.vue +++ b/apps/web-antd/src/components/bpmn-process-designer/package/penal/time-event-config/TimeEventConfig.vue @@ -238,7 +238,7 @@ watch(
diff --git a/apps/web-antd/src/router/routes/modules/iot.ts b/apps/web-antd/src/router/routes/modules/iot.ts index f43a547b0..54c0b27f8 100644 --- a/apps/web-antd/src/router/routes/modules/iot.ts +++ b/apps/web-antd/src/router/routes/modules/iot.ts @@ -18,7 +18,8 @@ const routes: RouteRecordRaw[] = [ title: '产品详情', activePath: '/iot/device/product', }, - component: () => import('#/views/iot/product/product/modules/detail/index.vue'), + component: () => + import('#/views/iot/product/product/modules/detail/index.vue'), }, { path: 'device/detail/:id', @@ -27,11 +28,11 @@ const routes: RouteRecordRaw[] = [ title: '设备详情', activePath: '/iot/device/device', }, - component: () => import('#/views/iot/device/device/modules/detail/index.vue'), + component: () => + import('#/views/iot/device/device/modules/detail/index.vue'), }, ], }, ]; export default routes; - diff --git a/apps/web-antd/src/views/ai/chat/manager/data.ts b/apps/web-antd/src/views/ai/chat/manager/data.ts index e9379d911..5990e515e 100644 --- a/apps/web-antd/src/views/ai/chat/manager/data.ts +++ b/apps/web-antd/src/views/ai/chat/manager/data.ts @@ -109,7 +109,7 @@ export function useGridFormSchemaMessage(): VbenFormSchema[] { label: '用户编号', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', }, diff --git a/apps/web-antd/src/views/ai/image/manager/data.ts b/apps/web-antd/src/views/ai/image/manager/data.ts index 9875ed7d7..d5e39b76b 100644 --- a/apps/web-antd/src/views/ai/image/manager/data.ts +++ b/apps/web-antd/src/views/ai/image/manager/data.ts @@ -15,7 +15,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '用户编号', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', }, diff --git a/apps/web-antd/src/views/ai/mindmap/manager/data.ts b/apps/web-antd/src/views/ai/mindmap/manager/data.ts index 3889353cf..eb56c92a9 100644 --- a/apps/web-antd/src/views/ai/mindmap/manager/data.ts +++ b/apps/web-antd/src/views/ai/mindmap/manager/data.ts @@ -12,7 +12,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '用户编号', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', }, diff --git a/apps/web-antd/src/views/ai/model/chatRole/data.ts b/apps/web-antd/src/views/ai/model/chatRole/data.ts index 2e1bc63bf..f06a832bf 100644 --- a/apps/web-antd/src/views/ai/model/chatRole/data.ts +++ b/apps/web-antd/src/views/ai/model/chatRole/data.ts @@ -93,7 +93,7 @@ export function useFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { placeholder: '请选择引用知识库', - api: getSimpleKnowledgeList, + api: () => getSimpleKnowledgeList(), labelField: 'name', mode: 'multiple', valueField: 'id', @@ -106,7 +106,7 @@ export function useFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { placeholder: '请选择引用工具', - api: getToolSimpleList, + api: () => getToolSimpleList(), mode: 'multiple', labelField: 'name', valueField: 'id', diff --git a/apps/web-antd/src/views/ai/model/model/data.ts b/apps/web-antd/src/views/ai/model/model/data.ts index 31f3ab05b..9dfe948f4 100644 --- a/apps/web-antd/src/views/ai/model/model/data.ts +++ b/apps/web-antd/src/views/ai/model/model/data.ts @@ -48,7 +48,7 @@ export function useFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { placeholder: '请选择API 秘钥', - api: getApiKeySimpleList, + api: () => getApiKeySimpleList(), labelField: 'name', valueField: 'id', allowClear: true, diff --git a/apps/web-antd/src/views/ai/music/manager/data.ts b/apps/web-antd/src/views/ai/music/manager/data.ts index 162e7a196..d6468eb0d 100644 --- a/apps/web-antd/src/views/ai/music/manager/data.ts +++ b/apps/web-antd/src/views/ai/music/manager/data.ts @@ -15,7 +15,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '用户编号', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', }, diff --git a/apps/web-antd/src/views/ai/write/manager/data.ts b/apps/web-antd/src/views/ai/write/manager/data.ts index d878d28ee..7c1768f64 100644 --- a/apps/web-antd/src/views/ai/write/manager/data.ts +++ b/apps/web-antd/src/views/ai/write/manager/data.ts @@ -15,7 +15,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '用户编号', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', }, diff --git a/apps/web-antd/src/views/bpm/group/data.ts b/apps/web-antd/src/views/bpm/group/data.ts index 455704f86..5adde2085 100644 --- a/apps/web-antd/src/views/bpm/group/data.ts +++ b/apps/web-antd/src/views/bpm/group/data.ts @@ -42,7 +42,7 @@ export function useFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { placeholder: '请选择成员', - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', mode: 'tags', diff --git a/apps/web-antd/src/views/bpm/processInstance/data.ts b/apps/web-antd/src/views/bpm/processInstance/data.ts index 214c58b0b..9b4b300d5 100644 --- a/apps/web-antd/src/views/bpm/processInstance/data.ts +++ b/apps/web-antd/src/views/bpm/processInstance/data.ts @@ -17,7 +17,7 @@ export function useGridFormSchema(): VbenFormSchema[] { // componentProps: { // placeholder: '请选择发起人', // allowClear: true, - // api: getSimpleUserList, + // api: () => getSimpleUserList(), // labelField: 'nickname', // valueField: 'id', // }, @@ -48,7 +48,7 @@ export function useGridFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入流程分类', allowClear: true, - api: getCategorySimpleList, + api: () => getCategorySimpleList(), labelField: 'name', valueField: 'code', }, diff --git a/apps/web-antd/src/views/bpm/processInstance/manager/data.ts b/apps/web-antd/src/views/bpm/processInstance/manager/data.ts index 1815cc2b5..1f6e8635c 100644 --- a/apps/web-antd/src/views/bpm/processInstance/manager/data.ts +++ b/apps/web-antd/src/views/bpm/processInstance/manager/data.ts @@ -23,7 +23,7 @@ export function useGridFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请选择发起人', allowClear: true, - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', }, @@ -54,7 +54,7 @@ export function useGridFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入流程分类', allowClear: true, - api: getCategorySimpleList, + api: () => getCategorySimpleList(), labelField: 'name', valueField: 'code', }, diff --git a/apps/web-antd/src/views/bpm/task/done/data.ts b/apps/web-antd/src/views/bpm/task/done/data.ts index ac42b8ddd..9491148ec 100644 --- a/apps/web-antd/src/views/bpm/task/done/data.ts +++ b/apps/web-antd/src/views/bpm/task/done/data.ts @@ -35,7 +35,7 @@ export function useGridFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入流程分类', allowClear: true, - api: getCategorySimpleList, + api: () => getCategorySimpleList(), labelField: 'name', valueField: 'code', }, diff --git a/apps/web-antd/src/views/bpm/task/todo/data.ts b/apps/web-antd/src/views/bpm/task/todo/data.ts index 77b859b4b..968db6234 100644 --- a/apps/web-antd/src/views/bpm/task/todo/data.ts +++ b/apps/web-antd/src/views/bpm/task/todo/data.ts @@ -35,7 +35,7 @@ export function useGridFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入流程分类', allowClear: true, - api: getCategorySimpleList, + api: () => getCategorySimpleList(), labelField: 'name', valueField: 'code', }, diff --git a/apps/web-antd/src/views/crm/business/data.ts b/apps/web-antd/src/views/crm/business/data.ts index 426471f8d..6948cbf31 100644 --- a/apps/web-antd/src/views/crm/business/data.ts +++ b/apps/web-antd/src/views/crm/business/data.ts @@ -41,10 +41,8 @@ export function useFormSchema(): VbenFormSchema[] { }, componentProps: { api: () => getSimpleUserList(), - fieldNames: { - label: 'nickname', - value: 'id', - }, + labelField: 'nickname', + valueField: 'id', placeholder: '请选择负责人', allowClear: true, }, @@ -57,10 +55,8 @@ export function useFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: () => getCustomerSimpleList(), - fieldNames: { - label: 'name', - value: 'id', - }, + labelField: 'name', + valueField: 'id', placeholder: '请选择客户', allowClear: true, }, @@ -85,10 +81,8 @@ export function useFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: () => getBusinessStatusTypeSimpleList(), - fieldNames: { - label: 'name', - value: 'id', - }, + labelField: 'name', + valueField: 'id', placeholder: '请选择商机状态组', allowClear: true, }, diff --git a/apps/web-antd/src/views/crm/business/detail/data.ts b/apps/web-antd/src/views/crm/business/detail/data.ts index 3b1a76f52..0600d76e5 100644 --- a/apps/web-antd/src/views/crm/business/detail/data.ts +++ b/apps/web-antd/src/views/crm/business/detail/data.ts @@ -1,11 +1,15 @@ -import type { VbenFormSchema } from '#/adapter/form'; import type { Ref } from 'vue'; + +import type { VbenFormSchema } from '#/adapter/form'; import type { CrmBusinessApi } from '#/api/crm/business'; import type { DescriptionItemSchema } from '#/components/description'; import { erpPriceInputFormatter, formatDateTime } from '@vben/utils'; -import { DEFAULT_STATUSES, getBusinessStatusSimpleList } from '#/api/crm/business/status'; +import { + DEFAULT_STATUSES, + getBusinessStatusSimpleList, +} from '#/api/crm/business/status'; /** 详情页的字段 */ export function useDetailSchema(): DescriptionItemSchema[] { diff --git a/apps/web-antd/src/views/crm/clue/data.ts b/apps/web-antd/src/views/crm/clue/data.ts index 3181b1da6..5983fde7f 100644 --- a/apps/web-antd/src/views/crm/clue/data.ts +++ b/apps/web-antd/src/views/crm/clue/data.ts @@ -53,7 +53,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '负责人', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', allowClear: true, diff --git a/apps/web-antd/src/views/crm/contact/data.ts b/apps/web-antd/src/views/crm/contact/data.ts index 760f08525..09336d478 100644 --- a/apps/web-antd/src/views/crm/contact/data.ts +++ b/apps/web-antd/src/views/crm/contact/data.ts @@ -42,10 +42,8 @@ export function useFormSchema(): VbenFormSchema[] { }, componentProps: { api: () => getSimpleUserList(), - fieldNames: { - label: 'nickname', - value: 'id', - }, + labelField: 'nickname', + valueField: 'id', placeholder: '请选择负责人', }, defaultValue: userStore.userInfo?.id, @@ -57,10 +55,8 @@ export function useFormSchema(): VbenFormSchema[] { rules: 'required', componentProps: { api: () => getCustomerSimpleList(), - fieldNames: { - label: 'name', - value: 'id', - }, + labelField: 'name', + valueField: 'id', placeholder: '请选择客户', }, }, @@ -139,10 +135,8 @@ export function useFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: () => getSimpleContactList(), - fieldNames: { - label: 'name', - value: 'id', - }, + labelField: 'name', + valueField: 'id', placeholder: '请选择直属上级', }, }, @@ -195,10 +189,8 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: () => getCustomerSimpleList(), - fieldNames: { - label: 'name', - value: 'id', - }, + labelField: 'name', + valueField: 'id', placeholder: '请选择客户', }, }, diff --git a/apps/web-antd/src/views/crm/contract/data.ts b/apps/web-antd/src/views/crm/contract/data.ts index 91ceb1953..36b0cecae 100644 --- a/apps/web-antd/src/views/crm/contract/data.ts +++ b/apps/web-antd/src/views/crm/contract/data.ts @@ -47,10 +47,8 @@ export function useFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: () => getSimpleUserList(), - fieldNames: { - label: 'nickname', - value: 'id', - }, + labelField: 'nickname', + valueField: 'id', }, dependencies: { triggerFields: ['id'], @@ -66,10 +64,8 @@ export function useFormSchema(): VbenFormSchema[] { rules: 'required', componentProps: { api: () => getCustomerSimpleList(), - fieldNames: { - label: 'name', - value: 'id', - }, + labelField: 'name', + valueField: 'id', placeholder: '请选择客户', }, }, @@ -142,10 +138,8 @@ export function useFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: () => getSimpleUserList(), - fieldNames: { - label: 'nickname', - value: 'id', - }, + labelField: 'nickname', + valueField: 'id', }, defaultValue: userStore.userInfo?.id, }, @@ -270,10 +264,8 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: () => getCustomerSimpleList(), - fieldNames: { - label: 'name', - value: 'id', - }, + labelField: 'name', + valueField: 'id', placeholder: '请选择客户', allowClear: true, }, diff --git a/apps/web-antd/src/views/crm/customer/data.ts b/apps/web-antd/src/views/crm/customer/data.ts index dc4e39df4..aa502383d 100644 --- a/apps/web-antd/src/views/crm/customer/data.ts +++ b/apps/web-antd/src/views/crm/customer/data.ts @@ -61,10 +61,8 @@ export function useFormSchema(): VbenFormSchema[] { }, componentProps: { api: () => getSimpleUserList(), - fieldNames: { - label: 'nickname', - value: 'id', - }, + labelField: 'nickname', + valueField: 'id', placeholder: '请选择负责人', allowClear: true, }, @@ -223,10 +221,8 @@ export function useImportFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: () => getSimpleUserList(), - fieldNames: { - label: 'nickname', - value: 'id', - }, + labelField: 'nickname', + valueField: 'id', placeholder: '请选择负责人', allowClear: true, class: 'w-full', diff --git a/apps/web-antd/src/views/crm/customer/detail/data.ts b/apps/web-antd/src/views/crm/customer/detail/data.ts index 5540a93e3..60e6a6bf8 100644 --- a/apps/web-antd/src/views/crm/customer/detail/data.ts +++ b/apps/web-antd/src/views/crm/customer/detail/data.ts @@ -28,10 +28,8 @@ export function useDistributeFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: () => getSimpleUserList(), - fieldNames: { - label: 'nickname', - value: 'id', - }, + labelField: 'nickname', + valueField: 'id', }, defaultValue: userStore.userInfo?.id, rules: 'required', diff --git a/apps/web-antd/src/views/crm/customer/limitConfig/data.ts b/apps/web-antd/src/views/crm/customer/limitConfig/data.ts index bdf5ea41d..fb079ae8a 100644 --- a/apps/web-antd/src/views/crm/customer/limitConfig/data.ts +++ b/apps/web-antd/src/views/crm/customer/limitConfig/data.ts @@ -34,11 +34,9 @@ export function useFormSchema(confType: LimitConfType): VbenFormSchema[] { label: '规则适用人群', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', mode: 'multiple', allowClear: true, placeholder: '请选择规则适用人群', diff --git a/apps/web-antd/src/views/crm/followup/data.ts b/apps/web-antd/src/views/crm/followup/data.ts index 79a341393..c19b02f32 100644 --- a/apps/web-antd/src/views/crm/followup/data.ts +++ b/apps/web-antd/src/views/crm/followup/data.ts @@ -85,8 +85,9 @@ export function useFormSchema( }); return res.list; }, + labelField: 'name', + valueField: 'id', mode: 'multiple', - fieldNames: { label: 'name', value: 'id' }, }, }, { @@ -105,8 +106,9 @@ export function useFormSchema( }); return res.list; }, + labelField: 'name', + valueField: 'id', mode: 'multiple', - fieldNames: { label: 'name', value: 'id' }, }, }, ]; diff --git a/apps/web-antd/src/views/crm/permission/modules/data.ts b/apps/web-antd/src/views/crm/permission/modules/data.ts index fdbe9bcbd..f2cb5a1f4 100644 --- a/apps/web-antd/src/views/crm/permission/modules/data.ts +++ b/apps/web-antd/src/views/crm/permission/modules/data.ts @@ -23,7 +23,7 @@ export function useTransferFormSchema(): VbenFormSchema[] { label: '选择新负责人', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', }, @@ -116,7 +116,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '选择人员', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', }, diff --git a/apps/web-antd/src/views/crm/product/data.ts b/apps/web-antd/src/views/crm/product/data.ts index e3702280b..32dc02b9d 100644 --- a/apps/web-antd/src/views/crm/product/data.ts +++ b/apps/web-antd/src/views/crm/product/data.ts @@ -43,10 +43,8 @@ export function useFormSchema(): VbenFormSchema[] { }, componentProps: { api: () => getSimpleUserList(), - fieldNames: { - label: 'nickname', - value: 'id', - }, + labelField: 'nickname', + valueField: 'id', placeholder: '请选择负责人', allowClear: true, }, diff --git a/apps/web-antd/src/views/crm/product/detail/data.ts b/apps/web-antd/src/views/crm/product/detail/data.ts index dc9bb6e11..1b783fc6f 100644 --- a/apps/web-antd/src/views/crm/product/detail/data.ts +++ b/apps/web-antd/src/views/crm/product/detail/data.ts @@ -70,4 +70,3 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] { }, ]; } - diff --git a/apps/web-antd/src/views/crm/receivable/data.ts b/apps/web-antd/src/views/crm/receivable/data.ts index b71ed0edd..2dfc958a5 100644 --- a/apps/web-antd/src/views/crm/receivable/data.ts +++ b/apps/web-antd/src/views/crm/receivable/data.ts @@ -45,10 +45,8 @@ export function useFormSchema(): VbenFormSchema[] { }, componentProps: { api: () => getSimpleUserList(), - fieldNames: { - label: 'nickname', - value: 'id', - }, + labelField: 'nickname', + valueField: 'id', placeholder: '请选择负责人', allowClear: true, }, @@ -61,10 +59,8 @@ export function useFormSchema(): VbenFormSchema[] { rules: 'required', componentProps: { api: () => getCustomerSimpleList(), - fieldNames: { - label: 'name', - value: 'id', - }, + labelField: 'name', + valueField: 'id', placeholder: '请选择客户', }, dependencies: { @@ -193,10 +189,8 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: () => getCustomerSimpleList(), - fieldNames: { - label: 'name', - value: 'id', - }, + labelField: 'name', + valueField: 'id', placeholder: '请选择客户', allowClear: true, }, diff --git a/apps/web-antd/src/views/crm/receivable/plan/data.ts b/apps/web-antd/src/views/crm/receivable/plan/data.ts index b9c950756..a004a9b48 100644 --- a/apps/web-antd/src/views/crm/receivable/plan/data.ts +++ b/apps/web-antd/src/views/crm/receivable/plan/data.ts @@ -29,10 +29,8 @@ export function useFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: () => getSimpleUserList(), - fieldNames: { - label: 'nickname', - value: 'id', - }, + labelField: 'nickname', + valueField: 'id', }, dependencies: { triggerFields: ['id'], @@ -48,11 +46,10 @@ export function useFormSchema(): VbenFormSchema[] { rules: 'required', componentProps: { api: () => getCustomerSimpleList(), - fieldNames: { - label: 'name', - value: 'id', - }, + labelField: 'name', + valueField: 'id', placeholder: '请选择客户', + allowClear: true, }, }, { @@ -63,6 +60,7 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { options: [], placeholder: '请选择合同', + allowClear: true, }, dependencies: { triggerFields: ['customerId'], @@ -156,10 +154,8 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { api: () => getCustomerSimpleList(), - fieldNames: { - label: 'name', - value: 'id', - }, + labelField: 'name', + valueField: 'id', placeholder: '请选择客户', allowClear: true, }, diff --git a/apps/web-antd/src/views/crm/receivable/plan/detail/data.ts b/apps/web-antd/src/views/crm/receivable/plan/detail/data.ts index 70d071649..233765322 100644 --- a/apps/web-antd/src/views/crm/receivable/plan/detail/data.ts +++ b/apps/web-antd/src/views/crm/receivable/plan/detail/data.ts @@ -31,8 +31,7 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'receivable', label: '实际回款金额', - content: (data) => - erpPriceInputFormatter(data?.receivable?.price ?? 0), + content: (data) => erpPriceInputFormatter(data?.receivable?.price ?? 0), }, ]; } @@ -78,8 +77,7 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] { { field: 'receivable', label: '实际回款金额', - content: (data) => - erpPriceInputFormatter(data?.receivable?.price ?? 0), + content: (data) => erpPriceInputFormatter(data?.receivable?.price ?? 0), }, { field: 'receivableRemain', @@ -92,8 +90,7 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] { { field: 'receivable.returnTime', label: '实际回款日期', - content: (data) => - formatDateTime(data?.receivable?.returnTime) as string, + content: (data) => formatDateTime(data?.receivable?.returnTime) as string, }, { field: 'remark', diff --git a/apps/web-antd/src/views/crm/statistics/customer/data.ts b/apps/web-antd/src/views/crm/statistics/customer/data.ts index ec37c668a..43cc36f63 100644 --- a/apps/web-antd/src/views/crm/statistics/customer/data.ts +++ b/apps/web-antd/src/views/crm/statistics/customer/data.ts @@ -99,7 +99,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '员工', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', placeholder: '请选择员工', diff --git a/apps/web-antd/src/views/crm/statistics/funnel/data.ts b/apps/web-antd/src/views/crm/statistics/funnel/data.ts index 87668577d..b704d1e71 100644 --- a/apps/web-antd/src/views/crm/statistics/funnel/data.ts +++ b/apps/web-antd/src/views/crm/statistics/funnel/data.ts @@ -73,7 +73,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '员工', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), allowClear: true, labelField: 'nickname', valueField: 'id', diff --git a/apps/web-antd/src/views/crm/statistics/performance/data.ts b/apps/web-antd/src/views/crm/statistics/performance/data.ts index e56c7ebf7..964f417ed 100644 --- a/apps/web-antd/src/views/crm/statistics/performance/data.ts +++ b/apps/web-antd/src/views/crm/statistics/performance/data.ts @@ -64,7 +64,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '员工', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', placeholder: '请选择员工', diff --git a/apps/web-antd/src/views/crm/statistics/portrait/data.ts b/apps/web-antd/src/views/crm/statistics/portrait/data.ts index 8eeff969b..3c2cc7c62 100644 --- a/apps/web-antd/src/views/crm/statistics/portrait/data.ts +++ b/apps/web-antd/src/views/crm/statistics/portrait/data.ts @@ -68,7 +68,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '员工', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', placeholder: '请选择员工', diff --git a/apps/web-antd/src/views/crm/statistics/portrait/index.vue b/apps/web-antd/src/views/crm/statistics/portrait/index.vue index 154ff710b..1d93478a4 100644 --- a/apps/web-antd/src/views/crm/statistics/portrait/index.vue +++ b/apps/web-antd/src/views/crm/statistics/portrait/index.vue @@ -38,8 +38,12 @@ const [Grid, gridApi] = useVbenVxeGrid({ ajax: { query: async (_, formValues) => { const res = await getDatas(activeTabName.value, formValues); - await renderLeftEcharts(getChartOptions(activeTabName.value, res).left); - await renderRightEcharts(getChartOptions(activeTabName.value, res).right); + await renderLeftEcharts( + getChartOptions(activeTabName.value, res).left, + ); + await renderRightEcharts( + getChartOptions(activeTabName.value, res).right, + ); return res; }, }, diff --git a/apps/web-antd/src/views/erp/finance/payment/data.ts b/apps/web-antd/src/views/erp/finance/payment/data.ts index a33430faf..9cf6dfc34 100644 --- a/apps/web-antd/src/views/erp/finance/payment/data.ts +++ b/apps/web-antd/src/views/erp/finance/payment/data.ts @@ -52,11 +52,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择供应商', allowClear: true, showSearch: true, - api: getSupplierSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getSupplierSimpleList(), + labelField: 'name', + valueField: 'id', }, rules: 'required', }, @@ -68,11 +66,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择财务人员', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { @@ -123,11 +119,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择付款账户', allowClear: true, showSearch: true, - api: getAccountSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getAccountSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -247,11 +241,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择供应商', allowClear: true, showSearch: true, - api: getSupplierSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getSupplierSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -262,11 +254,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择创建人', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { @@ -277,11 +267,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择财务人员', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { @@ -292,11 +280,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择付款账户', allowClear: true, showSearch: true, - api: getAccountSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getAccountSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { diff --git a/apps/web-antd/src/views/erp/finance/receipt/data.ts b/apps/web-antd/src/views/erp/finance/receipt/data.ts index e1839932a..85fc55c63 100644 --- a/apps/web-antd/src/views/erp/finance/receipt/data.ts +++ b/apps/web-antd/src/views/erp/finance/receipt/data.ts @@ -52,11 +52,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择客户', allowClear: true, showSearch: true, - api: getCustomerSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getCustomerSimpleList(), + labelField: 'name', + valueField: 'id', }, rules: 'required', }, @@ -68,11 +66,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择财务人员', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { @@ -123,11 +119,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择收款账户', allowClear: true, showSearch: true, - api: getAccountSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getAccountSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -247,11 +241,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择客户', allowClear: true, showSearch: true, - api: getCustomerSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getCustomerSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -262,11 +254,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择创建人', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { @@ -277,11 +267,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择财务人员', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { @@ -292,11 +280,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择收款账户', allowClear: true, showSearch: true, - api: getAccountSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getAccountSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { diff --git a/apps/web-antd/src/views/erp/finance/receipt/modules/form.vue b/apps/web-antd/src/views/erp/finance/receipt/modules/form.vue index 7f7726fc3..ed35d1df9 100644 --- a/apps/web-antd/src/views/erp/finance/receipt/modules/form.vue +++ b/apps/web-antd/src/views/erp/finance/receipt/modules/form.vue @@ -26,17 +26,18 @@ const formData = ref< } >({ id: undefined, - no: undefined, - customerId: undefined, - accountId: undefined, - financeUserId: undefined, - receiptTime: undefined, - remark: undefined, + no: '', + customerId: 0, + accountId: 0, + financeUserId: 0, + receiptTime: new Date(), + remark: '', fileUrl: undefined, totalPrice: 0, discountPrice: 0, receiptPrice: 0, items: [], + status: 0, }); const formType = ref(''); // 表单类型:'create' | 'edit' | 'detail' @@ -141,7 +142,21 @@ const [Modal, modalApi] = useVbenModal({ }, async onOpenChange(isOpen: boolean) { if (!isOpen) { - formData.value = undefined; + formData.value = { + id: undefined, + no: '', + customerId: 0, + accountId: 0, + financeUserId: 0, + receiptTime: new Date(), + remark: '', + totalPrice: 0, + discountPrice: 0, + receiptPrice: 0, + status: 0, + items: [], + bizNo: '', + }; return; } // 加载数据 @@ -191,4 +206,4 @@ const [Modal, modalApi] = useVbenModal({ - \ No newline at end of file + diff --git a/apps/web-antd/src/views/erp/product/product/data.ts b/apps/web-antd/src/views/erp/product/product/data.ts index cfde896db..e387f9908 100644 --- a/apps/web-antd/src/views/erp/product/product/data.ts +++ b/apps/web-antd/src/views/erp/product/product/data.ts @@ -3,6 +3,7 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; +import { handleTree } from '@vben/utils'; import { z } from '#/adapter/form'; import { getProductCategorySimpleList } from '#/api/erp/product/category'; @@ -60,7 +61,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '单位', component: 'ApiSelect', componentProps: { - api: getProductUnitSimpleList, + api: () => getProductUnitSimpleList(), labelField: 'name', valueField: 'id', placeholder: '请选择单位', diff --git a/apps/web-antd/src/views/erp/purchase/in/data.ts b/apps/web-antd/src/views/erp/purchase/in/data.ts index c249080fe..3853258cf 100644 --- a/apps/web-antd/src/views/erp/purchase/in/data.ts +++ b/apps/web-antd/src/views/erp/purchase/in/data.ts @@ -66,11 +66,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择供应商', allowClear: true, showSearch: true, - api: getSupplierSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getSupplierSimpleList(), + labelField: 'name', + valueField: 'id', }, rules: 'required', }, @@ -176,11 +174,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择结算账户', allowClear: true, showSearch: true, - api: getAccountSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getAccountSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -323,11 +319,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getProductSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -347,11 +341,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择供应商', allowClear: true, showSearch: true, - api: getSupplierSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getSupplierSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -362,7 +354,7 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择仓库', allowClear: true, showSearch: true, - api: getWarehouseSimpleList, + api: () => getWarehouseSimpleList(), labelField: 'name', valueField: 'id', }, @@ -375,11 +367,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择创建人', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { @@ -399,11 +389,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择结算账户', allowClear: true, showSearch: true, - api: getAccountSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getAccountSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -542,11 +530,9 @@ export function useOrderGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getProductSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { diff --git a/apps/web-antd/src/views/erp/purchase/order/data.ts b/apps/web-antd/src/views/erp/purchase/order/data.ts index 1ca7e5a57..f6d3760e7 100644 --- a/apps/web-antd/src/views/erp/purchase/order/data.ts +++ b/apps/web-antd/src/views/erp/purchase/order/data.ts @@ -52,11 +52,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择供应商', allowClear: true, showSearch: true, - api: getSupplierSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getSupplierSimpleList(), + labelField: 'name', + valueField: 'id', }, rules: 'required', }, @@ -142,11 +140,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择结算账户', allowClear: true, showSearch: true, - api: getAccountSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getAccountSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -265,11 +261,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getProductSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -289,11 +283,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择供应商', allowClear: true, showSearch: true, - api: getSupplierSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getSupplierSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -304,11 +296,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择创建人', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { diff --git a/apps/web-antd/src/views/erp/purchase/return/data.ts b/apps/web-antd/src/views/erp/purchase/return/data.ts index d82a3e67c..88ec806df 100644 --- a/apps/web-antd/src/views/erp/purchase/return/data.ts +++ b/apps/web-antd/src/views/erp/purchase/return/data.ts @@ -66,11 +66,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择供应商', allowClear: true, showSearch: true, - api: getSupplierSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getSupplierSimpleList(), + labelField: 'name', + valueField: 'id', }, rules: 'required', }, @@ -175,11 +173,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择结算账户', allowClear: true, showSearch: true, - api: getAccountSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getAccountSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -323,11 +319,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getProductSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -347,11 +341,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择供应商', allowClear: true, showSearch: true, - api: getSupplierSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getSupplierSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -362,7 +354,7 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择仓库', allowClear: true, showSearch: true, - api: getWarehouseSimpleList, + api: () => getWarehouseSimpleList(), labelField: 'name', valueField: 'id', }, @@ -375,11 +367,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择创建人', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { @@ -526,11 +516,9 @@ export function useOrderGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getProductSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { diff --git a/apps/web-antd/src/views/erp/sale/order/data.ts b/apps/web-antd/src/views/erp/sale/order/data.ts index 52f762458..f86880c1a 100644 --- a/apps/web-antd/src/views/erp/sale/order/data.ts +++ b/apps/web-antd/src/views/erp/sale/order/data.ts @@ -52,11 +52,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择客户', allowClear: true, showSearch: true, - api: getCustomerSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getCustomerSimpleList(), + labelField: 'name', + valueField: 'id', }, rules: 'required', }, @@ -68,11 +66,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择销售人员', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { @@ -157,11 +153,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择结算账户', allowClear: true, showSearch: true, - api: getAccountSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getAccountSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -281,11 +275,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getProductSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -305,11 +297,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择客户', allowClear: true, showSearch: true, - api: getCustomerSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getCustomerSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -320,11 +310,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择创建人', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { diff --git a/apps/web-antd/src/views/erp/sale/out/data.ts b/apps/web-antd/src/views/erp/sale/out/data.ts index 95f2853fc..3d095856c 100644 --- a/apps/web-antd/src/views/erp/sale/out/data.ts +++ b/apps/web-antd/src/views/erp/sale/out/data.ts @@ -544,11 +544,9 @@ export function useOrderGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getProductSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { diff --git a/apps/web-antd/src/views/erp/sale/return/data.ts b/apps/web-antd/src/views/erp/sale/return/data.ts index f2c5b9dc3..00501ce73 100644 --- a/apps/web-antd/src/views/erp/sale/return/data.ts +++ b/apps/web-antd/src/views/erp/sale/return/data.ts @@ -66,11 +66,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择客户', allowClear: true, showSearch: true, - api: getCustomerSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getCustomerSimpleList(), + labelField: 'name', + valueField: 'id', }, rules: 'required', }, @@ -82,11 +80,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择销售人员', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { @@ -191,11 +187,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { disabled: true, allowClear: true, showSearch: true, - api: getAccountSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getAccountSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -339,11 +333,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getProductSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -363,11 +355,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择客户', allowClear: true, showSearch: true, - api: getCustomerSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getCustomerSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -378,7 +368,7 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择仓库', allowClear: true, showSearch: true, - api: getWarehouseSimpleList, + api: () => getWarehouseSimpleList(), labelField: 'name', valueField: 'id', }, @@ -391,11 +381,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择创建人', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { @@ -543,11 +531,9 @@ export function useOrderGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getProductSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { diff --git a/apps/web-antd/src/views/erp/sale/return/modules/sale-order-select.vue b/apps/web-antd/src/views/erp/sale/return/modules/sale-order-select.vue index 4d44aeee1..f7d18b7de 100644 --- a/apps/web-antd/src/views/erp/sale/return/modules/sale-order-select.vue +++ b/apps/web-antd/src/views/erp/sale/return/modules/sale-order-select.vue @@ -114,4 +114,4 @@ const handleOk = () => { > - \ No newline at end of file + diff --git a/apps/web-antd/src/views/erp/stock/check/data.ts b/apps/web-antd/src/views/erp/stock/check/data.ts index 8a60c2ab2..33176d8b2 100644 --- a/apps/web-antd/src/views/erp/stock/check/data.ts +++ b/apps/web-antd/src/views/erp/stock/check/data.ts @@ -180,11 +180,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getProductSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -204,11 +202,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择仓库', allowClear: true, showSearch: true, - api: getWarehouseSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getWarehouseSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -219,11 +215,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择创建人', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { diff --git a/apps/web-antd/src/views/erp/stock/check/modules/item-form.vue b/apps/web-antd/src/views/erp/stock/check/modules/item-form.vue index 54d6e55f9..472d8ec10 100644 --- a/apps/web-antd/src/views/erp/stock/check/modules/item-form.vue +++ b/apps/web-antd/src/views/erp/stock/check/modules/item-form.vue @@ -305,4 +305,4 @@ onMounted(async () => { /> - \ No newline at end of file + diff --git a/apps/web-antd/src/views/erp/stock/in/data.ts b/apps/web-antd/src/views/erp/stock/in/data.ts index 5414474c4..e2ff7117c 100644 --- a/apps/web-antd/src/views/erp/stock/in/data.ts +++ b/apps/web-antd/src/views/erp/stock/in/data.ts @@ -50,11 +50,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] { placeholder: '请选择供应商', allowClear: true, showSearch: true, - api: getSupplierSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getSupplierSimpleList(), + labelField: 'name', + valueField: 'id', }, rules: 'required', }, @@ -189,11 +187,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getProductSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -213,11 +209,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择供应商', allowClear: true, showSearch: true, - api: getSupplierSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getSupplierSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -228,11 +222,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择仓库', allowClear: true, showSearch: true, - api: getWarehouseSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getWarehouseSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -243,11 +235,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择创建人', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { diff --git a/apps/web-antd/src/views/erp/stock/move/data.ts b/apps/web-antd/src/views/erp/stock/move/data.ts index dc1321e8f..fbc94a128 100644 --- a/apps/web-antd/src/views/erp/stock/move/data.ts +++ b/apps/web-antd/src/views/erp/stock/move/data.ts @@ -178,11 +178,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getProductSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -202,11 +200,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择调出仓库', allowClear: true, showSearch: true, - api: getWarehouseSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getWarehouseSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -217,11 +213,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择调入仓库', allowClear: true, showSearch: true, - api: getWarehouseSimpleList, - fieldNames: { - label: 'name', - value: 'id', - }, + api: () => getWarehouseSimpleList(), + labelField: 'name', + valueField: 'id', }, }, { @@ -232,11 +226,9 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择创建人', allowClear: true, showSearch: true, - api: getSimpleUserList, - fieldNames: { - label: 'nickname', - value: 'id', - }, + api: () => getSimpleUserList(), + labelField: 'nickname', + valueField: 'id', }, }, { diff --git a/apps/web-antd/src/views/erp/stock/record/data.ts b/apps/web-antd/src/views/erp/stock/record/data.ts index e4e3d0ecd..db0548c9a 100644 --- a/apps/web-antd/src/views/erp/stock/record/data.ts +++ b/apps/web-antd/src/views/erp/stock/record/data.ts @@ -19,7 +19,7 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, + api: () => getProductSimpleList(), labelField: 'name', valueField: 'id', }, @@ -32,7 +32,7 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择仓库', allowClear: true, showSearch: true, - api: getWarehouseSimpleList, + api: () => getWarehouseSimpleList(), labelField: 'name', valueField: 'id', }, diff --git a/apps/web-antd/src/views/erp/stock/stock/data.ts b/apps/web-antd/src/views/erp/stock/stock/data.ts index 037bb9c45..71c9a1549 100644 --- a/apps/web-antd/src/views/erp/stock/stock/data.ts +++ b/apps/web-antd/src/views/erp/stock/stock/data.ts @@ -15,7 +15,7 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', allowClear: true, showSearch: true, - api: getProductSimpleList, + api: () => getProductSimpleList(), labelField: 'name', valueField: 'id', }, @@ -28,7 +28,7 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请选择仓库', allowClear: true, showSearch: true, - api: getWarehouseSimpleList, + api: () => getWarehouseSimpleList(), labelField: 'name', valueField: 'id', }, diff --git a/apps/web-antd/src/views/infra/codegen/data.ts b/apps/web-antd/src/views/infra/codegen/data.ts index 2db43ba8b..921d1256b 100644 --- a/apps/web-antd/src/views/infra/codegen/data.ts +++ b/apps/web-antd/src/views/infra/codegen/data.ts @@ -25,13 +25,9 @@ export function useImportTableFormSchema(): VbenFormSchema[] { label: '数据源', component: 'ApiSelect', componentProps: { - api: async () => { - const data = await getDataSourceConfigList(); - return data.map((item) => ({ - label: item.name, - value: item.id, - })); - }, + api: () => getDataSourceConfigList(), + labelField: 'name', + valueField: 'id', autoSelect: 'first', placeholder: '请选择数据源', }, diff --git a/apps/web-antd/src/views/iot/alert/config/data.ts b/apps/web-antd/src/views/iot/alert/config/data.ts index 09ca905c7..379867edb 100644 --- a/apps/web-antd/src/views/iot/alert/config/data.ts +++ b/apps/web-antd/src/views/iot/alert/config/data.ts @@ -63,7 +63,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '关联场景联动规则', component: 'ApiSelect', componentProps: { - api: getSimpleRuleSceneList, + api: () => getSimpleRuleSceneList(), labelField: 'name', valueField: 'id', mode: 'multiple', @@ -76,7 +76,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '接收的用户', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', mode: 'multiple', diff --git a/apps/web-antd/src/views/iot/alert/record/data.ts b/apps/web-antd/src/views/iot/alert/record/data.ts index 10ebb12f3..70b13b267 100644 --- a/apps/web-antd/src/views/iot/alert/record/data.ts +++ b/apps/web-antd/src/views/iot/alert/record/data.ts @@ -17,7 +17,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '告警配置', component: 'ApiSelect', componentProps: { - api: getSimpleAlertConfigList, + api: () => getSimpleAlertConfigList(), labelField: 'name', valueField: 'id', placeholder: '请选择告警配置', @@ -40,7 +40,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '产品', component: 'ApiSelect', componentProps: { - api: getSimpleProductList, + api: () => getSimpleProductList(), labelField: 'name', valueField: 'id', placeholder: '请选择产品', @@ -53,7 +53,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '设备', component: 'ApiSelect', componentProps: { - api: getSimpleDeviceList, + api: () => getSimpleDeviceList(), labelField: 'deviceName', valueField: 'id', placeholder: '请选择设备', diff --git a/apps/web-antd/src/views/iot/device/device/data.ts b/apps/web-antd/src/views/iot/device/device/data.ts index e825055dc..a2fef45e8 100644 --- a/apps/web-antd/src/views/iot/device/device/data.ts +++ b/apps/web-antd/src/views/iot/device/device/data.ts @@ -5,6 +5,7 @@ import { DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; import { z } from '#/adapter/form'; +import { getSimpleDeviceList } from '#/api/iot/device/device'; import { getSimpleDeviceGroupList } from '#/api/iot/device/group'; import { DeviceTypeEnum, @@ -27,7 +28,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '产品', component: 'ApiSelect', componentProps: { - api: getSimpleProductList, + api: () => getSimpleProductList(), labelField: 'name', valueField: 'id', placeholder: '请选择产品', @@ -55,12 +56,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '网关设备', component: 'ApiSelect', componentProps: { - api: async () => { - const { getSimpleDeviceList } = await import( - '#/api/iot/device/device' - ); - return getSimpleDeviceList(DeviceTypeEnum.GATEWAY); - }, + api: () => getSimpleDeviceList(DeviceTypeEnum.GATEWAY), labelField: 'nickname', valueField: 'id', placeholder: '子设备可选择父设备', @@ -93,7 +89,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '设备分组', component: 'ApiSelect', componentProps: { - api: getSimpleDeviceGroupList, + api: () => getSimpleDeviceGroupList(), labelField: 'name', valueField: 'id', mode: 'multiple', @@ -113,16 +109,16 @@ export function useFormSchema(): VbenFormSchema[] { .optional() .or(z.literal('')), }, - // { - // fieldName: 'locationType', - // label: '定位类型', - // component: 'RadioGroup', - // componentProps: { - // options: getDictOptions(DICT_TYPE.IOT_LOCATION_TYPE, 'number'), - // buttonStyle: 'solid', - // optionType: 'button', - // }, - // }, + { + fieldName: 'locationType', + label: '定位类型', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.IOT_LOCATION_TYPE, 'number'), + buttonStyle: 'solid', + optionType: 'button', + }, + }, { fieldName: 'longitude', label: '设备经度', @@ -160,7 +156,7 @@ export function useGroupFormSchema(): VbenFormSchema[] { label: '设备分组', component: 'ApiSelect', componentProps: { - api: getSimpleDeviceGroupList, + api: () => getSimpleDeviceGroupList(), labelField: 'name', valueField: 'id', mode: 'multiple', @@ -203,7 +199,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '产品', component: 'ApiSelect', componentProps: { - api: getSimpleProductList, + api: () => getSimpleProductList(), labelField: 'name', valueField: 'id', placeholder: '请选择产品', @@ -253,7 +249,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '设备分组', component: 'ApiSelect', componentProps: { - api: getSimpleDeviceGroupList, + api: () => getSimpleDeviceGroupList(), labelField: 'name', valueField: 'id', placeholder: '请选择设备分组', diff --git a/apps/web-antd/src/views/iot/device/device/index.vue b/apps/web-antd/src/views/iot/device/device/index.vue index 06e34ac5e..f83a7c14a 100644 --- a/apps/web-antd/src/views/iot/device/device/index.vue +++ b/apps/web-antd/src/views/iot/device/device/index.vue @@ -32,7 +32,6 @@ import { getSimpleProductList } from '#/api/iot/product/product'; import { $t } from '#/locales'; import { useGridColumns } from './data'; -// @ts-ignore import DeviceCardView from './modules/DeviceCardView.vue'; import DeviceForm from './modules/DeviceForm.vue'; import DeviceGroupForm from './modules/DeviceGroupForm.vue'; diff --git a/apps/web-antd/src/views/iot/device/device/modules/DeviceGroupForm.vue b/apps/web-antd/src/views/iot/device/device/modules/DeviceGroupForm.vue index dbb75faa0..fa85a0ffb 100644 --- a/apps/web-antd/src/views/iot/device/device/modules/DeviceGroupForm.vue +++ b/apps/web-antd/src/views/iot/device/device/modules/DeviceGroupForm.vue @@ -44,7 +44,7 @@ const [Modal, modalApi] = useVbenModal({ // 关闭并提示 await modalApi.close(); emit('success'); - message.success($t('common.updateSuccess')); + message.success($t('ui.actionMessage.operationSuccess')); } finally { modalApi.unlock(); } diff --git a/apps/web-antd/src/views/iot/device/device/modules/DeviceImportForm.vue b/apps/web-antd/src/views/iot/device/device/modules/DeviceImportForm.vue index 1bf1e0a4f..04d674a5e 100644 --- a/apps/web-antd/src/views/iot/device/device/modules/DeviceImportForm.vue +++ b/apps/web-antd/src/views/iot/device/device/modules/DeviceImportForm.vue @@ -111,14 +111,14 @@ const [Modal, modalApi] = useVbenModal({ }); /** 下载模板 */ -const handleDownloadTemplate = async () => { +async function handleDownloadTemplate() { try { const res = await importDeviceTemplate(); downloadFileFromBlobPart({ fileName: '设备导入模版.xls', source: res }); } catch (error: any) { message.error(error.message || '下载失败'); } -}; +}