中间表采集新增采集配置,实现可视化可控采集
This commit is contained in:
@@ -2,9 +2,11 @@ import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { checkActionCode, checkActionName } from './MesXslMixerAction.api';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{ title: '设备名称', align: 'center', dataIndex: 'equipmentId_dictText', width: 180 },
|
||||
{ title: '设备名称', align: 'center', dataIndex: 'equipmentName', width: 180 },
|
||||
{ title: '机台编号', align: 'center', dataIndex: 'equipId', width: 110 },
|
||||
{ title: '机台类型', align: 'center', dataIndex: 'equipType', width: 110 },
|
||||
{ title: '动作名称', align: 'center', dataIndex: 'actionName', width: 180 },
|
||||
{ title: '动作代号', align: 'center', dataIndex: 'actionCode', width: 160 },
|
||||
{ title: '动作代号', align: 'center', dataIndex: 'actionCode', width: 120 },
|
||||
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 170 },
|
||||
];
|
||||
|
||||
@@ -16,6 +18,7 @@ export const searchFormSchema: FormSchema[] = [
|
||||
componentProps: { dictCode: 'mes_xsl_equipment_ledger,equipment_name,id' },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{ label: '机台编号', field: 'equipId', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '动作名称', field: 'actionName', component: 'Input', colProps: { span: 6 } },
|
||||
{ label: '动作代号', field: 'actionCode', component: 'Input', colProps: { span: 6 } },
|
||||
];
|
||||
@@ -29,6 +32,21 @@ export const formSchema: FormSchema[] = [
|
||||
required: true,
|
||||
componentProps: { dictCode: 'mes_xsl_equipment_ledger,equipment_name,id', placeholder: '请选择设备台账中的设备' },
|
||||
},
|
||||
// 采集冗余字段:仅采集数据有值,只读展示
|
||||
{
|
||||
label: '机台编号',
|
||||
field: 'equipId',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true },
|
||||
ifShow: ({ values }) => !!values.equipId,
|
||||
},
|
||||
{
|
||||
label: '机台类型',
|
||||
field: 'equipType',
|
||||
component: 'Input',
|
||||
componentProps: { disabled: true },
|
||||
ifShow: ({ values }) => !!values.equipType,
|
||||
},
|
||||
{
|
||||
label: '动作名称',
|
||||
field: 'actionName',
|
||||
@@ -41,10 +59,10 @@ export const formSchema: FormSchema[] = [
|
||||
const v = value == null ? '' : String(value).trim();
|
||||
if (!v) return Promise.resolve();
|
||||
try {
|
||||
await checkActionName({ actionName: v, dataId: model?.id });
|
||||
await checkActionName({ equipmentId: model?.equipmentId, actionName: v, dataId: model?.id });
|
||||
return Promise.resolve();
|
||||
} catch (e: any) {
|
||||
return Promise.reject(e?.response?.data?.message || e?.message || '动作名称不能重复');
|
||||
return Promise.reject(e?.response?.data?.message || e?.message || '同一设备下动作名称不能重复');
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
@@ -63,10 +81,10 @@ export const formSchema: FormSchema[] = [
|
||||
const v = value == null ? '' : String(value).trim();
|
||||
if (!v) return Promise.resolve();
|
||||
try {
|
||||
await checkActionCode({ actionCode: v, dataId: model?.id });
|
||||
await checkActionCode({ equipmentId: model?.equipmentId, actionCode: v, dataId: model?.id });
|
||||
return Promise.resolve();
|
||||
} catch (e: any) {
|
||||
return Promise.reject(e?.response?.data?.message || e?.message || '动作代号不能重复');
|
||||
return Promise.reject(e?.response?.data?.message || e?.message || '同一设备下动作代号不能重复');
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
|
||||
Reference in New Issue
Block a user