|
@ -1,8 +1,11 @@ |
|
|
import moment from 'moment' |
|
|
import moment from 'moment' |
|
|
import { left } from 'inquirer/lib/utils/readline' |
|
|
import { left } from 'inquirer/lib/utils/readline' |
|
|
|
|
|
import { ref } from 'vue' |
|
|
import type { BasicColumn, FormSchema } from '@/components/Table' |
|
|
import type { BasicColumn, FormSchema } from '@/components/Table' |
|
|
import { DICT_TYPE, getDictOptions } from '@/utils/dict' |
|
|
import { DICT_TYPE, getDictOptions } from '@/utils/dict' |
|
|
import { getModelVersionList } from '@/api/alert/run/model/index' |
|
|
import { getModelVersionList } from '@/api/alert/run/model/index' |
|
|
|
|
|
import { optionListApi, subSystemListApi } from '@/api/alert/model/select' |
|
|
|
|
|
import type { systemSelectParams } from '@/api/alert/model/model/optionsModel' |
|
|
|
|
|
|
|
|
export const columns: BasicColumn[] = [ |
|
|
export const columns: BasicColumn[] = [ |
|
|
{ |
|
|
{ |
|
@ -90,14 +93,87 @@ export const columns: BasicColumn[] = [ |
|
|
|
|
|
|
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
const optionList = await optionListApi() |
|
|
|
|
|
|
|
|
|
|
|
const systemOptions = ref<any>([]) |
|
|
|
|
|
systemOptions.value = optionList.systems |
|
|
export const searchFormSchema: FormSchema[] = [ |
|
|
export const searchFormSchema: FormSchema[] = [ |
|
|
|
|
|
{ |
|
|
|
|
|
label: '机组', |
|
|
|
|
|
field: 'unit', |
|
|
|
|
|
component: 'Select', |
|
|
|
|
|
defaultValue: optionList.units[0].id || null, |
|
|
|
|
|
colProps: { span: 4 }, |
|
|
|
|
|
|
|
|
|
|
|
componentProps: ({ schema, tableAction, formActionType, formModel }) => { |
|
|
|
|
|
return { |
|
|
|
|
|
// xxxx props
|
|
|
|
|
|
allowClear: false, |
|
|
|
|
|
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, |
|
|
|
|
|
} |
|
|
|
|
|
systemOptions.value = await subSystemListApi(param) |
|
|
|
|
|
formModel.system = systemOptions.value[0].id |
|
|
|
|
|
}, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '系统', |
|
|
|
|
|
field: 'type', |
|
|
|
|
|
component: 'Select', |
|
|
|
|
|
defaultValue: optionList.types[0].id || null, |
|
|
|
|
|
colProps: { span: 4 }, |
|
|
|
|
|
componentProps: ({ formModel }) => { |
|
|
|
|
|
return { |
|
|
|
|
|
allowClear: false, |
|
|
|
|
|
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, |
|
|
|
|
|
} |
|
|
|
|
|
systemOptions.value = await subSystemListApi(param) |
|
|
|
|
|
}, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '子系统', |
|
|
|
|
|
field: 'system', |
|
|
|
|
|
component: 'Select', |
|
|
|
|
|
defaultValue: systemOptions.value[0].id || null, |
|
|
|
|
|
colProps: { span: 4 }, |
|
|
|
|
|
componentProps: () => { |
|
|
|
|
|
return { |
|
|
|
|
|
allowClear: false, |
|
|
|
|
|
placeholder: '请选择子系统', |
|
|
|
|
|
options: systemOptions.value.map(system => ({ value: system.id, label: system.name })), |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
label: '模型实例名称', |
|
|
label: '模型实例名称', |
|
|
field: 'mpName', |
|
|
field: 'mpName', |
|
|
component: 'Input', |
|
|
component: 'Input', |
|
|
|
|
|
labelWidth: 120, |
|
|
|
|
|
|
|
|
defaultValue: '', |
|
|
defaultValue: '', |
|
|
required: true, |
|
|
colProps: { span: 5 }, |
|
|
colProps: { span: 8 }, |
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '状态1', |
|
|
label: '状态1', |
|
|