|
|
|
@ -98,127 +98,226 @@ const optionList = await optionListApi() |
|
|
|
|
|
|
|
const systemOptions = ref<any>([]) |
|
|
|
// systemOptions.value = optionList.systems
|
|
|
|
export const searchFormSchema: FormSchema[] = [ |
|
|
|
{ |
|
|
|
label: '机组', |
|
|
|
field: 'unit', |
|
|
|
component: 'Select', |
|
|
|
// defaultValue: optionList.units[0].id || null,
|
|
|
|
defaultValue: null, |
|
|
|
|
|
|
|
colProps: { span: 4 }, |
|
|
|
|
|
|
|
componentProps: ({ schema, tableAction, formActionType, formModel }) => { |
|
|
|
return { |
|
|
|
// xxxx props
|
|
|
|
// export const searchFormSchema: FormSchema[] = [
|
|
|
|
// {
|
|
|
|
// label: '机组',
|
|
|
|
// field: 'unit',
|
|
|
|
// component: 'Select',
|
|
|
|
// // defaultValue: optionList.units[0].id || null,
|
|
|
|
// defaultValue: null,
|
|
|
|
//
|
|
|
|
// colProps: { span: 4 },
|
|
|
|
//
|
|
|
|
// componentProps: ({ schema, tableAction, formActionType, formModel }) => {
|
|
|
|
// return {
|
|
|
|
// // xxxx props
|
|
|
|
// placeholder: '全部机组',
|
|
|
|
// options: optionList.units.map(unit => ({ value: unit.id, label: unit.name })),
|
|
|
|
// onChange: async (e: any) => {
|
|
|
|
// // const { reload } = tableAction
|
|
|
|
// // reload()
|
|
|
|
// // or
|
|
|
|
// console.log(e)
|
|
|
|
// const param: systemSelectParams = {
|
|
|
|
// unitId: e,
|
|
|
|
// typeId: formModel.type,
|
|
|
|
// }
|
|
|
|
// //如果typeId是空,则不设置system'Options
|
|
|
|
// if (!param.typeId || !param.unitId) {
|
|
|
|
// systemOptions.value = []
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// systemOptions.value = await subSystemListApi(param)
|
|
|
|
// // formModel.system = systemOptions.value[0].id
|
|
|
|
// },
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// label: '系统',
|
|
|
|
// field: 'type',
|
|
|
|
// component: 'Select',
|
|
|
|
// // defaultValue: optionList.types[0].id || null,
|
|
|
|
// defaultValue: null,
|
|
|
|
//
|
|
|
|
// colProps: { span: 4 },
|
|
|
|
// componentProps: ({ formModel }) => {
|
|
|
|
// return {
|
|
|
|
// placeholder: '全部系统',
|
|
|
|
// options: optionList.types.map(type => ({ value: type.id, label: type.name })),
|
|
|
|
// onChange: async (e: any) => {
|
|
|
|
// // const { reload } = tableAction
|
|
|
|
// // reload()
|
|
|
|
// // or
|
|
|
|
// console.log(e)
|
|
|
|
// const param: systemSelectParams = {
|
|
|
|
// unitId: formModel.unit,
|
|
|
|
// typeId: e,
|
|
|
|
// }
|
|
|
|
// //如果typeId是空,则不设置system'Options
|
|
|
|
// if (!param.typeId || !param.unitId) {
|
|
|
|
// systemOptions.value = []
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// systemOptions.value = await subSystemListApi(param)
|
|
|
|
// },
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// label: '子系统',
|
|
|
|
// field: 'system',
|
|
|
|
// component: 'Select',
|
|
|
|
// // defaultValue: systemOptions.value[0].id || null,
|
|
|
|
// defaultValue: null,
|
|
|
|
// colProps: { span: 4 },
|
|
|
|
// componentProps: () => {
|
|
|
|
// return {
|
|
|
|
// placeholder: '全部子系统',
|
|
|
|
// options: systemOptions.value.map(system => ({ value: system.id, label: system.name })),
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
//
|
|
|
|
// {
|
|
|
|
// label: '模型实例名称',
|
|
|
|
// field: 'mpName',
|
|
|
|
// component: 'Input',
|
|
|
|
// labelWidth: 100,
|
|
|
|
//
|
|
|
|
// defaultValue: '',
|
|
|
|
// colProps: { span: 5 },
|
|
|
|
// }, {
|
|
|
|
// label: '算法',
|
|
|
|
// field: 'algorithmId',
|
|
|
|
// component: 'Select',
|
|
|
|
// labelWidth: 40,
|
|
|
|
// componentProps: {
|
|
|
|
// placeholder: '全部算法',
|
|
|
|
// options: [{ value: 1, label: "主成分分析(PCA)" }, { value: 2, label: "神经网络(ANN)" }],
|
|
|
|
// },
|
|
|
|
// defaultValue: null,
|
|
|
|
// colProps: { span: 3 },
|
|
|
|
// show:true
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// label: '状态1',
|
|
|
|
// field: 'running',
|
|
|
|
// component: 'Input',
|
|
|
|
// show: false,
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// label: '状态2',
|
|
|
|
// field: 'runningLog',
|
|
|
|
// component: 'Input',
|
|
|
|
// show: false,
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// label: '状态3',
|
|
|
|
// field: 'isUpdate',
|
|
|
|
// component: 'Input',
|
|
|
|
// show: false,
|
|
|
|
// },
|
|
|
|
// ]
|
|
|
|
/** |
|
|
|
* 获取搜索表单 schema |
|
|
|
* @param showAlgorithm 是否显示算法字段 |
|
|
|
*/ |
|
|
|
export function getSearchFormSchema(showAlgorithm = true): FormSchema[] { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
label: '机组', |
|
|
|
field: 'unit', |
|
|
|
component: 'Select', |
|
|
|
defaultValue: null, |
|
|
|
colProps: { span: 4 }, |
|
|
|
componentProps: ({ formModel }) => ({ |
|
|
|
placeholder: '全部机组', |
|
|
|
options: optionList.units.map(unit => ({ value: unit.id, label: unit.name })), |
|
|
|
onChange: async (e: any) => { |
|
|
|
// const { reload } = tableAction
|
|
|
|
// reload()
|
|
|
|
// or
|
|
|
|
console.log(e) |
|
|
|
const param: systemSelectParams = { |
|
|
|
unitId: e, |
|
|
|
typeId: formModel.type, |
|
|
|
} |
|
|
|
//如果typeId是空,则不设置system'Options
|
|
|
|
const param: systemSelectParams = { unitId: e, typeId: formModel.type } |
|
|
|
if (!param.typeId || !param.unitId) { |
|
|
|
systemOptions.value = [] |
|
|
|
return |
|
|
|
} |
|
|
|
systemOptions.value = await subSystemListApi(param) |
|
|
|
// formModel.system = systemOptions.value[0].id
|
|
|
|
}, |
|
|
|
} |
|
|
|
}), |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '系统', |
|
|
|
field: 'type', |
|
|
|
component: 'Select', |
|
|
|
// defaultValue: optionList.types[0].id || null,
|
|
|
|
defaultValue: null, |
|
|
|
|
|
|
|
colProps: { span: 4 }, |
|
|
|
componentProps: ({ formModel }) => { |
|
|
|
return { |
|
|
|
{ |
|
|
|
label: '系统', |
|
|
|
field: 'type', |
|
|
|
component: 'Select', |
|
|
|
defaultValue: null, |
|
|
|
colProps: { span: 4 }, |
|
|
|
componentProps: ({ formModel }) => ({ |
|
|
|
placeholder: '全部系统', |
|
|
|
options: optionList.types.map(type => ({ value: type.id, label: type.name })), |
|
|
|
onChange: async (e: any) => { |
|
|
|
// const { reload } = tableAction
|
|
|
|
// reload()
|
|
|
|
// or
|
|
|
|
console.log(e) |
|
|
|
const param: systemSelectParams = { |
|
|
|
unitId: formModel.unit, |
|
|
|
typeId: e, |
|
|
|
} |
|
|
|
//如果typeId是空,则不设置system'Options
|
|
|
|
const param: systemSelectParams = { unitId: formModel.unit, typeId: e } |
|
|
|
if (!param.typeId || !param.unitId) { |
|
|
|
systemOptions.value = [] |
|
|
|
return |
|
|
|
} |
|
|
|
systemOptions.value = await subSystemListApi(param) |
|
|
|
}, |
|
|
|
} |
|
|
|
}), |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '子系统', |
|
|
|
field: 'system', |
|
|
|
component: 'Select', |
|
|
|
// defaultValue: systemOptions.value[0].id || null,
|
|
|
|
defaultValue: null, |
|
|
|
colProps: { span: 4 }, |
|
|
|
componentProps: () => { |
|
|
|
return { |
|
|
|
{ |
|
|
|
label: '子系统', |
|
|
|
field: 'system', |
|
|
|
component: 'Select', |
|
|
|
defaultValue: null, |
|
|
|
colProps: { span: 4 }, |
|
|
|
componentProps: () => ({ |
|
|
|
placeholder: '全部子系统', |
|
|
|
options: systemOptions.value.map(system => ({ value: system.id, label: system.name })), |
|
|
|
} |
|
|
|
}), |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
label: '模型实例名称', |
|
|
|
field: 'mpName', |
|
|
|
component: 'Input', |
|
|
|
labelWidth: 100, |
|
|
|
|
|
|
|
defaultValue: '', |
|
|
|
colProps: { span: 5 }, |
|
|
|
}, { |
|
|
|
label: '算法', |
|
|
|
field: 'algorithmId', |
|
|
|
component: 'Select', |
|
|
|
labelWidth: 40, |
|
|
|
componentProps: { |
|
|
|
placeholder: '全部算法', |
|
|
|
options: [{ value: 1, label: "主成分分析(PCA)" }, { value: 2, label: "神经网络(ANN)" }], |
|
|
|
{ |
|
|
|
label: '模型实例名称', |
|
|
|
field: 'mpName', |
|
|
|
component: 'Input', |
|
|
|
labelWidth: 100, |
|
|
|
defaultValue: '', |
|
|
|
colProps: { span: 5 }, |
|
|
|
}, |
|
|
|
defaultValue: null, |
|
|
|
colProps: { span: 3 }, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '状态1', |
|
|
|
field: 'running', |
|
|
|
component: 'Input', |
|
|
|
show: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '状态2', |
|
|
|
field: 'runningLog', |
|
|
|
component: 'Input', |
|
|
|
show: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '状态3', |
|
|
|
field: 'isUpdate', |
|
|
|
component: 'Input', |
|
|
|
show: false, |
|
|
|
}, |
|
|
|
] |
|
|
|
|
|
|
|
{ |
|
|
|
label: '算法', |
|
|
|
field: 'algorithmId', |
|
|
|
component: 'Select', |
|
|
|
labelWidth: 40, |
|
|
|
componentProps: { |
|
|
|
placeholder: '全部算法', |
|
|
|
options: [ |
|
|
|
{ value: 1, label: '主成分分析(PCA)' }, |
|
|
|
{ value: 2, label: '神经网络(ANN)' }, |
|
|
|
], |
|
|
|
}, |
|
|
|
defaultValue: null, |
|
|
|
colProps: { span: 3 }, |
|
|
|
show: showAlgorithm, // 根据参数决定是否显示
|
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '状态1', |
|
|
|
field: 'running', |
|
|
|
component: 'Input', |
|
|
|
show: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '状态2', |
|
|
|
field: 'runningLog', |
|
|
|
component: 'Input', |
|
|
|
show: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '状态3', |
|
|
|
field: 'isUpdate', |
|
|
|
component: 'Input', |
|
|
|
show: false, |
|
|
|
}, |
|
|
|
] |
|
|
|
} |
|
|
|
export const formSchema: FormSchema[] = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|