|
|
|
@ -94,113 +94,115 @@ export const columns: BasicColumn[] = [ |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
const optionList = await optionListApi() |
|
|
|
const systemOptions = ref<any>([]) |
|
|
|
|
|
|
|
// /**
|
|
|
|
// * 获取搜索表单 schema
|
|
|
|
// * @param showAlgorithm 是否显示算法字段
|
|
|
|
// */
|
|
|
|
// export async function getSearchFormSchema(showAlgorithm = true,showAll=true): FormSchema[] {
|
|
|
|
// const optionList = await optionListApi()
|
|
|
|
// const systemOptions = ref<any>([])
|
|
|
|
// if(!showAll){
|
|
|
|
// const param: systemSelectParams = { unitId: optionList.units[0].id, typeId: optionList.types[0].id }
|
|
|
|
// systemOptions.value = await subSystemListApi(param)
|
|
|
|
// }
|
|
|
|
// return [
|
|
|
|
// {
|
|
|
|
// label: '机组',
|
|
|
|
// field: 'unit',
|
|
|
|
// component: 'Select',
|
|
|
|
// defaultValue: showAll ? null: optionList.units[0].id,
|
|
|
|
// colProps: { span: 4 },
|
|
|
|
// componentProps: ({ formModel }) => ({
|
|
|
|
// placeholder: '全部机组',
|
|
|
|
// style: { 'color': 'green', fontSize: '14px' },
|
|
|
|
// options: optionList.units.map(unit => ({ value: unit.id, label: unit.name })),
|
|
|
|
// onChange: async (e: any) => {
|
|
|
|
// const param: systemSelectParams = { unitId: e, typeId: formModel.type }
|
|
|
|
// if (!param.typeId || !param.unitId) {
|
|
|
|
// systemOptions.value = []
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// systemOptions.value = await subSystemListApi(param)
|
|
|
|
// },
|
|
|
|
// }),
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// label: '系统',
|
|
|
|
// field: 'type',
|
|
|
|
// component: 'Select',
|
|
|
|
// defaultValue: showAll ? null: optionList.types[0].id,
|
|
|
|
// colProps: { span: 4 },
|
|
|
|
// componentProps: ({ formModel }) => ({
|
|
|
|
// placeholder: '全部系统',
|
|
|
|
// options: optionList.types.map(type => ({ value: type.id, label: type.name })),
|
|
|
|
// onChange: async (e: any) => {
|
|
|
|
// 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: showAll ? null: systemOptions[0].id,
|
|
|
|
// colProps: { span: 4 },
|
|
|
|
// componentProps: () => ({
|
|
|
|
// placeholder: '全部子系统',
|
|
|
|
// options: systemOptions.value.map(system => ({ value: system.id, label: system.name })),
|
|
|
|
// }),
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// label: '模型实例名称',
|
|
|
|
// field: 'mpName',
|
|
|
|
// component: 'Input',
|
|
|
|
// labelWidth: 120,
|
|
|
|
// defaultValue: '',
|
|
|
|
// colProps: { span: 5 },
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// label: '算法',
|
|
|
|
// field: 'algorithmId',
|
|
|
|
// component: 'Select',
|
|
|
|
// labelWidth: 50,
|
|
|
|
// 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,
|
|
|
|
// },
|
|
|
|
// ]
|
|
|
|
// }
|
|
|
|
//显示全部就不查询子系统
|
|
|
|
const param: systemSelectParams = { unitId: optionList.units[0].id, typeId: optionList.types[0].id } |
|
|
|
systemOptions.value = await subSystemListApi(param) |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 获取搜索表单 schema |
|
|
|
* @param showAlgorithm 是否显示算法字段 |
|
|
|
*/ |
|
|
|
export function getSearchFormSchema(showAlgorithm = true,showAll=true): FormSchema[] { |
|
|
|
if(showAll){systemOptions.value=[]} |
|
|
|
return [ |
|
|
|
{ |
|
|
|
label: '机组', |
|
|
|
field: 'unit', |
|
|
|
component: 'Select', |
|
|
|
defaultValue: showAll ? null: optionList.units[0].id, |
|
|
|
colProps: { span: 4 }, |
|
|
|
componentProps: ({ formModel }) => ({ |
|
|
|
placeholder: '全部机组', |
|
|
|
style: { 'color': 'green', fontSize: '14px' }, |
|
|
|
options: optionList.units.map(unit => ({ value: unit.id, label: unit.name })), |
|
|
|
onChange: async (e: any) => { |
|
|
|
const param: systemSelectParams = { unitId: e, typeId: formModel.type } |
|
|
|
if (!param.typeId || !param.unitId) { |
|
|
|
systemOptions.value = [] |
|
|
|
return |
|
|
|
} |
|
|
|
systemOptions.value = await subSystemListApi(param) |
|
|
|
}, |
|
|
|
}), |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '系统', |
|
|
|
field: 'type', |
|
|
|
component: 'Select', |
|
|
|
defaultValue: showAll ? null: optionList.types[0].id, |
|
|
|
colProps: { span: 4 }, |
|
|
|
componentProps: ({ formModel }) => ({ |
|
|
|
placeholder: '全部系统', |
|
|
|
options: optionList.types.map(type => ({ value: type.id, label: type.name })), |
|
|
|
onChange: async (e: any) => { |
|
|
|
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: showAll ? null: systemOptions[0].id, |
|
|
|
colProps: { span: 4 }, |
|
|
|
componentProps: () => ({ |
|
|
|
placeholder: '全部子系统', |
|
|
|
options: systemOptions.value.map(system => ({ value: system.id, label: system.name })), |
|
|
|
}), |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '模型实例名称', |
|
|
|
field: 'mpName', |
|
|
|
component: 'Input', |
|
|
|
labelWidth: 120, |
|
|
|
defaultValue: '', |
|
|
|
colProps: { span: 5 }, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '算法', |
|
|
|
field: 'algorithmId', |
|
|
|
component: 'Select', |
|
|
|
labelWidth: 50, |
|
|
|
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, |
|
|
|
}, |
|
|
|
] |
|
|
|
} |
|
|
|
/** |
|
|
|
* 获取搜索表单 schema(vben 标准版) |
|
|
|
*/ |
|
|
|
@ -211,7 +213,7 @@ export interface selectParams { |
|
|
|
systemId: number | null; |
|
|
|
} |
|
|
|
|
|
|
|
export async function getSearchFormSchema( |
|
|
|
export async function getSearchFormSchema1( |
|
|
|
showAlgorithm = true, |
|
|
|
showAll = true, |
|
|
|
showName=true, |
|
|
|
@ -219,7 +221,6 @@ export async function getSearchFormSchema( |
|
|
|
haveMpId = true, |
|
|
|
haveWarn = true, |
|
|
|
): Promise<FormSchema[]> { |
|
|
|
|
|
|
|
const optionList = await optionListApi() |
|
|
|
const mpList = ref<any[]>([]) |
|
|
|
// 子系统 options 用普通变量维护(不是 ref)
|
|
|
|
@ -270,18 +271,6 @@ const mpList = ref<any[]>([]) |
|
|
|
else{ |
|
|
|
formActionType.setFieldsValue({system: null}) |
|
|
|
} |
|
|
|
// //拿到该机组、该系统、该子系统的模型实例
|
|
|
|
// mpList.value = await getInstantList({
|
|
|
|
// unit: unitId,
|
|
|
|
// type: formModel.type,
|
|
|
|
// system: formModel.system,
|
|
|
|
// })
|
|
|
|
// if (mpList.value.length) {
|
|
|
|
// formActionType.setFieldsValue({mpId: mpList.value[0].mpId})
|
|
|
|
// }
|
|
|
|
// else{
|
|
|
|
// formActionType.setFieldsValue({mpId: null})
|
|
|
|
// }
|
|
|
|
}, |
|
|
|
}), |
|
|
|
}, |
|
|
|
@ -313,18 +302,6 @@ const mpList = ref<any[]>([]) |
|
|
|
else{ |
|
|
|
formActionType.setFieldsValue({system: null}) |
|
|
|
} |
|
|
|
// //拿到该机组、该系统、该子系统的模型实例
|
|
|
|
// mpList.value = await getInstantList({
|
|
|
|
// unit: formModel.unit,
|
|
|
|
// type: typeId,
|
|
|
|
// system: formModel.system,
|
|
|
|
// })
|
|
|
|
// if (mpList.value.length) {
|
|
|
|
// formActionType.setFieldsValue({mpId: mpList.value[0].mpId})
|
|
|
|
// }
|
|
|
|
// else{
|
|
|
|
// formActionType.setFieldsValue({mpId: null})
|
|
|
|
// }
|
|
|
|
}, |
|
|
|
}), |
|
|
|
}, |
|
|
|
|