refactor(mes/wm/barcode): 对齐 antd/ele componentProps 字母序与注释结构

审查 wm_barcode 时补齐:
- antd data.ts 的 componentProps 键统一为字母序(onChange 提到 options/
  placeholder 之前),与 ele 端保持一致
- antd index.vue 修正 checkedIds 的 JSDoc 错位(拆出「已选条码 ID」与
  「处理勾选变化」两段注释)
- ele config/data.ts 的「编辑时业务类型不允许变更」改为行尾注释,对齐 antd
pull/350/head
YunaiV 2026-05-29 22:24:28 +08:00
parent a8d60580be
commit e91d30e899
3 changed files with 12 additions and 11 deletions

View File

@ -73,8 +73,6 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
label: '业务类型',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.MES_WM_BARCODE_BIZ_TYPE, 'number'),
placeholder: '请选择业务类型',
// 业务类型变更时清空业务字段
onChange: () =>
formApi?.setValues({
@ -86,6 +84,8 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
areaWarehouseId: undefined,
areaLocationId: undefined,
}),
options: getDictOptions(DICT_TYPE.MES_WM_BARCODE_BIZ_TYPE, 'number'),
placeholder: '请选择业务类型',
},
rules: 'required',
},
@ -108,7 +108,6 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
label: '库区·仓库',
component: markRaw(WmWarehouseSelect),
componentProps: {
placeholder: '请选择仓库',
onChange: () =>
formApi?.setValues({
bizId: undefined,
@ -116,6 +115,7 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
bizName: undefined,
content: undefined,
}),
placeholder: '请选择仓库',
},
dependencies: {
triggerFields: ['bizType'],
@ -130,9 +130,9 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
triggerFields: ['bizType', 'locationWarehouseId'],
show: (values) => values.bizType === BarcodeBizTypeEnum.LOCATION,
componentProps: (values) => ({
onChange: (item: any) => syncBizDetail(formApi, item),
placeholder: '请选择库区',
warehouseId: values.locationWarehouseId,
onChange: (item: any) => syncBizDetail(formApi, item),
}),
},
rules: 'required',
@ -142,7 +142,6 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
label: '库位·仓库',
component: markRaw(WmWarehouseSelect),
componentProps: {
placeholder: '请选择仓库',
onChange: () =>
formApi?.setValues({
areaLocationId: undefined,
@ -151,6 +150,7 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
bizName: undefined,
content: undefined,
}),
placeholder: '请选择仓库',
},
dependencies: {
triggerFields: ['bizType'],
@ -165,8 +165,6 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
triggerFields: ['bizType', 'areaWarehouseId'],
show: (values) => values.bizType === BarcodeBizTypeEnum.AREA,
componentProps: (values) => ({
placeholder: '请选择库区',
warehouseId: values.areaWarehouseId,
onChange: () =>
formApi?.setValues({
bizId: undefined,
@ -174,6 +172,8 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
bizName: undefined,
content: undefined,
}),
placeholder: '请选择库区',
warehouseId: values.areaWarehouseId,
}),
},
},
@ -185,9 +185,9 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
triggerFields: ['bizType', 'areaLocationId'],
show: (values) => values.bizType === BarcodeBizTypeEnum.AREA,
componentProps: (values) => ({
placeholder: '请选择库位',
locationId: values.areaLocationId,
onChange: (item: any) => syncBizDetail(formApi, item),
placeholder: '请选择库位',
}),
},
rules: 'required',

View File

@ -31,8 +31,10 @@ const [FormModal, formModalApi] = useVbenModal({
const barcodeDetailRef = ref<InstanceType<typeof BarcodeDetail>>();
/** 处理勾选变化 */
/** 已选条码 ID */
const checkedIds = ref<number[]>([]);
/** 处理勾选变化 */
function handleRowCheckboxChange({
records,
}: {

View File

@ -37,8 +37,7 @@ export function useFormSchema(): VbenFormSchema[] {
dependencies: {
triggerFields: ['id'],
componentProps: (values) => ({
// 编辑时业务类型不允许变更
disabled: !!values.id,
disabled: !!values.id, // 编辑时业务类型不允许变更
}),
},
rules: 'required',