From e7361a60ec35521f6abfd0b9d5b17a6c4d4dea06 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 21 May 2026 18:48:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(iot)=EF=BC=9Amd=20=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=EF=BC=8C=E6=94=AF=E6=8C=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/views/mes/md/client/data.ts | 4 ++-- apps/web-antd/src/views/mes/md/item/data.ts | 4 ++-- apps/web-antd/src/views/mes/md/item/type/data.ts | 4 ++-- apps/web-antd/src/views/mes/md/vendor/data.ts | 4 ++-- apps/web-antd/src/views/mes/md/workstation/data.ts | 12 ++++++++++-- .../src/views/mes/md/workstation/workshop/data.ts | 6 +++--- apps/web-ele/src/views/mes/md/client/data.ts | 4 ++-- apps/web-ele/src/views/mes/md/item/data.ts | 4 ++-- apps/web-ele/src/views/mes/md/item/type/data.ts | 4 ++-- apps/web-ele/src/views/mes/md/vendor/data.ts | 4 ++-- .../web-ele/src/views/mes/md/vendor/modules/form.vue | 12 ++++++------ apps/web-ele/src/views/mes/md/workstation/data.ts | 12 ++++++++++-- .../src/views/mes/md/workstation/workshop/data.ts | 6 +++--- 13 files changed, 48 insertions(+), 32 deletions(-) diff --git a/apps/web-antd/src/views/mes/md/client/data.ts b/apps/web-antd/src/views/mes/md/client/data.ts index 6da0f7764..977f23d76 100644 --- a/apps/web-antd/src/views/mes/md/client/data.ts +++ b/apps/web-antd/src/views/mes/md/client/data.ts @@ -1,4 +1,4 @@ -import type { VbenFormSchema } from '#/adapter/form'; +import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesMdClientApi } from '#/api/mes/md/client'; @@ -14,7 +14,7 @@ import { generateAutoCode } from '#/api/mes/md/autocode/record'; import { MesAutoCodeRuleCode } from '#/views/mes/utils/constants'; /** 新增/修改客户的表单 */ -export function useFormSchema(formApi?: any): VbenFormSchema[] { +export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { return [ { fieldName: 'id', diff --git a/apps/web-antd/src/views/mes/md/item/data.ts b/apps/web-antd/src/views/mes/md/item/data.ts index 8c8d57624..794221710 100644 --- a/apps/web-antd/src/views/mes/md/item/data.ts +++ b/apps/web-antd/src/views/mes/md/item/data.ts @@ -1,4 +1,4 @@ -import type { VbenFormSchema } from '#/adapter/form'; +import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesMdItemApi } from '#/api/mes/md/item'; import type { MesMdProductBomApi } from '#/api/mes/md/item/productBom'; @@ -17,7 +17,7 @@ import { MdUnitMeasureSelect } from '#/views/mes/md/unitmeasure/components'; import { MesAutoCodeRuleCode } from '#/views/mes/utils/constants'; /** 新增/修改物料产品的表单 */ -export function useFormSchema(formApi?: any): VbenFormSchema[] { +export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { return [ { fieldName: 'id', diff --git a/apps/web-antd/src/views/mes/md/item/type/data.ts b/apps/web-antd/src/views/mes/md/item/type/data.ts index fba2543bf..12b29f67c 100644 --- a/apps/web-antd/src/views/mes/md/item/type/data.ts +++ b/apps/web-antd/src/views/mes/md/item/type/data.ts @@ -1,4 +1,4 @@ -import type { VbenFormSchema } from '#/adapter/form'; +import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesMdItemTypeApi } from '#/api/mes/md/item/type'; @@ -19,7 +19,7 @@ import { } from '#/views/mes/utils/constants'; /** 新增/修改物料分类的表单 */ -export function useFormSchema(formApi?: any): VbenFormSchema[] { +export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { return [ { fieldName: 'id', diff --git a/apps/web-antd/src/views/mes/md/vendor/data.ts b/apps/web-antd/src/views/mes/md/vendor/data.ts index 592240cb5..5f31bcf79 100644 --- a/apps/web-antd/src/views/mes/md/vendor/data.ts +++ b/apps/web-antd/src/views/mes/md/vendor/data.ts @@ -1,4 +1,4 @@ -import type { VbenFormSchema } from '#/adapter/form'; +import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesMdVendorApi } from '#/api/mes/md/vendor'; @@ -14,7 +14,7 @@ import { generateAutoCode } from '#/api/mes/md/autocode/record'; import { MesAutoCodeRuleCode } from '#/views/mes/utils/constants'; /** 新增/修改供应商的表单 */ -export function useFormSchema(formApi?: any): VbenFormSchema[] { +export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { return [ { fieldName: 'id', diff --git a/apps/web-antd/src/views/mes/md/workstation/data.ts b/apps/web-antd/src/views/mes/md/workstation/data.ts index 75248e2fc..74bdec3c6 100644 --- a/apps/web-antd/src/views/mes/md/workstation/data.ts +++ b/apps/web-antd/src/views/mes/md/workstation/data.ts @@ -1,4 +1,4 @@ -import type { VbenFormSchema } from '#/adapter/form'; +import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesMdWorkstationApi } from '#/api/mes/md/workstation'; @@ -20,7 +20,7 @@ import { MesAutoCodeRuleCode } from '#/views/mes/utils/constants'; import { MdWorkshopSelect } from './components'; /** 新增/修改工作站的表单 */ -export function useFormSchema(formApi?: any): VbenFormSchema[] { +export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { return [ { fieldName: 'id', @@ -37,6 +37,12 @@ export function useFormSchema(formApi?: any): VbenFormSchema[] { componentProps: { placeholder: '请输入工作站编码', }, + dependencies: { + triggerFields: ['id'], + componentProps: (values) => ({ + disabled: !!values.id, + }), + }, rules: 'required', suffix: () => h( @@ -205,6 +211,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '所在车间', component: markRaw(MdWorkshopSelect), componentProps: { + allowClear: true, placeholder: '请选择车间', }, }, @@ -213,6 +220,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '所属工序', component: markRaw(ProProcessSelect), componentProps: { + allowClear: true, placeholder: '请选择工序', }, }, diff --git a/apps/web-antd/src/views/mes/md/workstation/workshop/data.ts b/apps/web-antd/src/views/mes/md/workstation/workshop/data.ts index 32eb95f38..e0e03b258 100644 --- a/apps/web-antd/src/views/mes/md/workstation/workshop/data.ts +++ b/apps/web-antd/src/views/mes/md/workstation/workshop/data.ts @@ -1,4 +1,4 @@ -import type { VbenFormSchema } from '#/adapter/form'; +import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesMdWorkshopApi } from '#/api/mes/md/workstation/workshop'; @@ -15,7 +15,7 @@ import { getSimpleUserList } from '#/api/system/user'; import { MesAutoCodeRuleCode } from '#/views/mes/utils/constants'; /** 新增/修改车间的表单 */ -export function useFormSchema(formApi?: any): VbenFormSchema[] { +export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { return [ { fieldName: 'id', @@ -55,7 +55,7 @@ export function useFormSchema(formApi?: any): VbenFormSchema[] { } }, }, - { default: () => '自动生成' }, + { default: () => '生成' }, ), }, { diff --git a/apps/web-ele/src/views/mes/md/client/data.ts b/apps/web-ele/src/views/mes/md/client/data.ts index 1c4a8091d..a320fc433 100644 --- a/apps/web-ele/src/views/mes/md/client/data.ts +++ b/apps/web-ele/src/views/mes/md/client/data.ts @@ -1,4 +1,4 @@ -import type { VbenFormSchema } from '#/adapter/form'; +import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesMdClientApi } from '#/api/mes/md/client'; @@ -14,7 +14,7 @@ import { generateAutoCode } from '#/api/mes/md/autocode/record'; import { MesAutoCodeRuleCode } from '#/views/mes/utils/constants'; /** 新增/修改客户的表单 */ -export function useFormSchema(formApi?: any): VbenFormSchema[] { +export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { return [ { fieldName: 'id', diff --git a/apps/web-ele/src/views/mes/md/item/data.ts b/apps/web-ele/src/views/mes/md/item/data.ts index 2ba58e653..060fa0990 100644 --- a/apps/web-ele/src/views/mes/md/item/data.ts +++ b/apps/web-ele/src/views/mes/md/item/data.ts @@ -1,4 +1,4 @@ -import type { VbenFormSchema } from '#/adapter/form'; +import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesMdItemApi } from '#/api/mes/md/item'; import type { MesMdProductBomApi } from '#/api/mes/md/item/productBom'; @@ -17,7 +17,7 @@ import { MdUnitMeasureSelect } from '#/views/mes/md/unitmeasure/components'; import { MesAutoCodeRuleCode } from '#/views/mes/utils/constants'; /** 新增/修改物料产品的表单 */ -export function useFormSchema(formApi?: any): VbenFormSchema[] { +export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { return [ { fieldName: 'id', diff --git a/apps/web-ele/src/views/mes/md/item/type/data.ts b/apps/web-ele/src/views/mes/md/item/type/data.ts index 7bdd9df98..56b51cedc 100644 --- a/apps/web-ele/src/views/mes/md/item/type/data.ts +++ b/apps/web-ele/src/views/mes/md/item/type/data.ts @@ -1,4 +1,4 @@ -import type { VbenFormSchema } from '#/adapter/form'; +import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesMdItemTypeApi } from '#/api/mes/md/item/type'; @@ -19,7 +19,7 @@ import { } from '#/views/mes/utils/constants'; /** 新增/修改物料分类的表单 */ -export function useFormSchema(formApi?: any): VbenFormSchema[] { +export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { return [ { fieldName: 'id', diff --git a/apps/web-ele/src/views/mes/md/vendor/data.ts b/apps/web-ele/src/views/mes/md/vendor/data.ts index 79516e648..205db9cbf 100644 --- a/apps/web-ele/src/views/mes/md/vendor/data.ts +++ b/apps/web-ele/src/views/mes/md/vendor/data.ts @@ -1,4 +1,4 @@ -import type { VbenFormSchema } from '#/adapter/form'; +import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesMdVendorApi } from '#/api/mes/md/vendor'; @@ -14,7 +14,7 @@ import { generateAutoCode } from '#/api/mes/md/autocode/record'; import { MesAutoCodeRuleCode } from '#/views/mes/utils/constants'; /** 新增/修改供应商的表单 */ -export function useFormSchema(formApi?: any): VbenFormSchema[] { +export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { return [ { fieldName: 'id', diff --git a/apps/web-ele/src/views/mes/md/vendor/modules/form.vue b/apps/web-ele/src/views/mes/md/vendor/modules/form.vue index daca13f95..6d10830f5 100644 --- a/apps/web-ele/src/views/mes/md/vendor/modules/form.vue +++ b/apps/web-ele/src/views/mes/md/vendor/modules/form.vue @@ -24,12 +24,12 @@ const formData = ref(); const isDetail = computed(() => formMode.value === 'detail'); // 是否查看模式 const getTitle = computed(() => { - const titles: Record = { - create: '新增供应商', - update: '修改供应商', - detail: '查看供应商', - }; - return titles[formMode.value]; + if (formMode.value === 'detail') { + return $t('ui.actionTitle.view', ['供应商']); + } + return formMode.value === 'update' + ? $t('ui.actionTitle.edit', ['供应商']) + : $t('ui.actionTitle.create', ['供应商']); }); const [Form, formApi] = useVbenForm({ diff --git a/apps/web-ele/src/views/mes/md/workstation/data.ts b/apps/web-ele/src/views/mes/md/workstation/data.ts index 11ec6b0f3..a1e266a2f 100644 --- a/apps/web-ele/src/views/mes/md/workstation/data.ts +++ b/apps/web-ele/src/views/mes/md/workstation/data.ts @@ -1,4 +1,4 @@ -import type { VbenFormSchema } from '#/adapter/form'; +import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesMdWorkstationApi } from '#/api/mes/md/workstation'; @@ -20,7 +20,7 @@ import { MesAutoCodeRuleCode } from '#/views/mes/utils/constants'; import { MdWorkshopSelect } from './components'; /** 新增/修改工作站的表单 */ -export function useFormSchema(formApi?: any): VbenFormSchema[] { +export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { return [ { fieldName: 'id', @@ -37,6 +37,12 @@ export function useFormSchema(formApi?: any): VbenFormSchema[] { componentProps: { placeholder: '请输入工作站编码', }, + dependencies: { + triggerFields: ['id'], + componentProps: (values) => ({ + disabled: !!values.id, + }), + }, rules: 'required', suffix: () => h( @@ -202,6 +208,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '所在车间', component: markRaw(MdWorkshopSelect), componentProps: { + clearable: true, placeholder: '请选择车间', }, }, @@ -210,6 +217,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '所属工序', component: markRaw(ProProcessSelect), componentProps: { + clearable: true, placeholder: '请选择工序', }, }, diff --git a/apps/web-ele/src/views/mes/md/workstation/workshop/data.ts b/apps/web-ele/src/views/mes/md/workstation/workshop/data.ts index d8958abdb..22fa897cc 100644 --- a/apps/web-ele/src/views/mes/md/workstation/workshop/data.ts +++ b/apps/web-ele/src/views/mes/md/workstation/workshop/data.ts @@ -1,4 +1,4 @@ -import type { VbenFormSchema } from '#/adapter/form'; +import type { VbenFormApi, VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesMdWorkshopApi } from '#/api/mes/md/workstation/workshop'; @@ -15,7 +15,7 @@ import { getSimpleUserList } from '#/api/system/user'; import { MesAutoCodeRuleCode } from '#/views/mes/utils/constants'; /** 新增/修改车间的表单 */ -export function useFormSchema(formApi?: any): VbenFormSchema[] { +export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] { return [ { fieldName: 'id', @@ -54,7 +54,7 @@ export function useFormSchema(formApi?: any): VbenFormSchema[] { } }, }, - { default: () => '自动生成' }, + { default: () => '生成' }, ), }, {