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 的「编辑时业务类型不允许变更」改为行尾注释,对齐 antdpull/350/head
parent
a8d60580be
commit
e91d30e899
|
|
@ -73,8 +73,6 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
|
||||||
label: '业务类型',
|
label: '业务类型',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: getDictOptions(DICT_TYPE.MES_WM_BARCODE_BIZ_TYPE, 'number'),
|
|
||||||
placeholder: '请选择业务类型',
|
|
||||||
// 业务类型变更时清空业务字段
|
// 业务类型变更时清空业务字段
|
||||||
onChange: () =>
|
onChange: () =>
|
||||||
formApi?.setValues({
|
formApi?.setValues({
|
||||||
|
|
@ -86,6 +84,8 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
|
||||||
areaWarehouseId: undefined,
|
areaWarehouseId: undefined,
|
||||||
areaLocationId: undefined,
|
areaLocationId: undefined,
|
||||||
}),
|
}),
|
||||||
|
options: getDictOptions(DICT_TYPE.MES_WM_BARCODE_BIZ_TYPE, 'number'),
|
||||||
|
placeholder: '请选择业务类型',
|
||||||
},
|
},
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
|
|
@ -108,7 +108,6 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
|
||||||
label: '库区·仓库',
|
label: '库区·仓库',
|
||||||
component: markRaw(WmWarehouseSelect),
|
component: markRaw(WmWarehouseSelect),
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择仓库',
|
|
||||||
onChange: () =>
|
onChange: () =>
|
||||||
formApi?.setValues({
|
formApi?.setValues({
|
||||||
bizId: undefined,
|
bizId: undefined,
|
||||||
|
|
@ -116,6 +115,7 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
|
||||||
bizName: undefined,
|
bizName: undefined,
|
||||||
content: undefined,
|
content: undefined,
|
||||||
}),
|
}),
|
||||||
|
placeholder: '请选择仓库',
|
||||||
},
|
},
|
||||||
dependencies: {
|
dependencies: {
|
||||||
triggerFields: ['bizType'],
|
triggerFields: ['bizType'],
|
||||||
|
|
@ -130,9 +130,9 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
|
||||||
triggerFields: ['bizType', 'locationWarehouseId'],
|
triggerFields: ['bizType', 'locationWarehouseId'],
|
||||||
show: (values) => values.bizType === BarcodeBizTypeEnum.LOCATION,
|
show: (values) => values.bizType === BarcodeBizTypeEnum.LOCATION,
|
||||||
componentProps: (values) => ({
|
componentProps: (values) => ({
|
||||||
|
onChange: (item: any) => syncBizDetail(formApi, item),
|
||||||
placeholder: '请选择库区',
|
placeholder: '请选择库区',
|
||||||
warehouseId: values.locationWarehouseId,
|
warehouseId: values.locationWarehouseId,
|
||||||
onChange: (item: any) => syncBizDetail(formApi, item),
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
|
|
@ -142,7 +142,6 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
|
||||||
label: '库位·仓库',
|
label: '库位·仓库',
|
||||||
component: markRaw(WmWarehouseSelect),
|
component: markRaw(WmWarehouseSelect),
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择仓库',
|
|
||||||
onChange: () =>
|
onChange: () =>
|
||||||
formApi?.setValues({
|
formApi?.setValues({
|
||||||
areaLocationId: undefined,
|
areaLocationId: undefined,
|
||||||
|
|
@ -151,6 +150,7 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
|
||||||
bizName: undefined,
|
bizName: undefined,
|
||||||
content: undefined,
|
content: undefined,
|
||||||
}),
|
}),
|
||||||
|
placeholder: '请选择仓库',
|
||||||
},
|
},
|
||||||
dependencies: {
|
dependencies: {
|
||||||
triggerFields: ['bizType'],
|
triggerFields: ['bizType'],
|
||||||
|
|
@ -165,8 +165,6 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
|
||||||
triggerFields: ['bizType', 'areaWarehouseId'],
|
triggerFields: ['bizType', 'areaWarehouseId'],
|
||||||
show: (values) => values.bizType === BarcodeBizTypeEnum.AREA,
|
show: (values) => values.bizType === BarcodeBizTypeEnum.AREA,
|
||||||
componentProps: (values) => ({
|
componentProps: (values) => ({
|
||||||
placeholder: '请选择库区',
|
|
||||||
warehouseId: values.areaWarehouseId,
|
|
||||||
onChange: () =>
|
onChange: () =>
|
||||||
formApi?.setValues({
|
formApi?.setValues({
|
||||||
bizId: undefined,
|
bizId: undefined,
|
||||||
|
|
@ -174,6 +172,8 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
|
||||||
bizName: undefined,
|
bizName: undefined,
|
||||||
content: undefined,
|
content: undefined,
|
||||||
}),
|
}),
|
||||||
|
placeholder: '请选择库区',
|
||||||
|
warehouseId: values.areaWarehouseId,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -185,9 +185,9 @@ export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
|
||||||
triggerFields: ['bizType', 'areaLocationId'],
|
triggerFields: ['bizType', 'areaLocationId'],
|
||||||
show: (values) => values.bizType === BarcodeBizTypeEnum.AREA,
|
show: (values) => values.bizType === BarcodeBizTypeEnum.AREA,
|
||||||
componentProps: (values) => ({
|
componentProps: (values) => ({
|
||||||
placeholder: '请选择库位',
|
|
||||||
locationId: values.areaLocationId,
|
locationId: values.areaLocationId,
|
||||||
onChange: (item: any) => syncBizDetail(formApi, item),
|
onChange: (item: any) => syncBizDetail(formApi, item),
|
||||||
|
placeholder: '请选择库位',
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,10 @@ const [FormModal, formModalApi] = useVbenModal({
|
||||||
|
|
||||||
const barcodeDetailRef = ref<InstanceType<typeof BarcodeDetail>>();
|
const barcodeDetailRef = ref<InstanceType<typeof BarcodeDetail>>();
|
||||||
|
|
||||||
/** 处理勾选变化 */
|
/** 已选条码 ID */
|
||||||
const checkedIds = ref<number[]>([]);
|
const checkedIds = ref<number[]>([]);
|
||||||
|
|
||||||
|
/** 处理勾选变化 */
|
||||||
function handleRowCheckboxChange({
|
function handleRowCheckboxChange({
|
||||||
records,
|
records,
|
||||||
}: {
|
}: {
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||||
dependencies: {
|
dependencies: {
|
||||||
triggerFields: ['id'],
|
triggerFields: ['id'],
|
||||||
componentProps: (values) => ({
|
componentProps: (values) => ({
|
||||||
// 编辑时业务类型不允许变更
|
disabled: !!values.id, // 编辑时业务类型不允许变更
|
||||||
disabled: !!values.id,
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue