Compare commits

...

5 Commits

  1. 6
      src/api/alert/warn/index.ts
  2. 7
      src/views/exa/HistoryLine.vue
  3. 13
      src/views/run/calc/index.vue
  4. 35
      src/views/run/instant/index.vue
  5. 241
      src/views/run/instant/instant.data.ts
  6. 30
      src/views/warn/alarm/index.vue
  7. 71
      src/views/warn/config/UpdateModal.vue
  8. 52
      src/views/warn/config/index.vue
  9. 14
      src/views/warn/config/warn.data.ts

6
src/api/alert/warn/index.ts

@ -26,6 +26,12 @@ export function getWarnPageReal(params: WarnPageReqVO) {
return defHttp.get({ url: '/alert/warn/page-real', params }) return defHttp.get({ url: '/alert/warn/page-real', params })
} }
// 修改预警
export function createWarn(data: WarnVO) {
return defHttp.post({ url: '/alert/warn/create', data })
}
// 修改预警 // 修改预警
export function updateWarn(data: WarnVO) { export function updateWarn(data: WarnVO) {
return defHttp.put({ url: '/alert/warn/update', data }) return defHttp.put({ url: '/alert/warn/update', data })

7
src/views/exa/HistoryLine.vue

@ -60,8 +60,9 @@ watch(
text: props.title, text: props.title,
show: true, show: true,
textStyle: { // textStyle: { //
fontFamily: 'sans-serif', // fontFamily:
fontWeight: 350, '"PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif',
fontWeight: 600,
color: 'black', // color: 'black', //
fontSize: 16, // fontSize: 16, //
}, },
@ -87,7 +88,7 @@ watch(
// //
grid: { grid: {
x: '2%', x: '2%',
y: '5%', y: '10%',
x2: '2%', x2: '2%',
y2: '10%', y2: '10%',
containLabel: false, containLabel: false,

13
src/views/run/calc/index.vue

@ -30,9 +30,9 @@ const statusMap = {
// //
const selectedRowss = ref<any[]>([]) const selectedRowss = ref<any[]>([])
const searchSchema = ref<FormSchema[]>(getSearchFormSchema(true)) // const searchSchema = getSearchFormSchema(true,true) //
const [registerTable, {getForm, reload, getDataSource, updateTableDataRecord}] = useTable({ const [registerTable, {setProps,getForm, reload, getDataSource, updateTableDataRecord}] = useTable({
title: '实例列表', title: '实例列表',
api: getInstantPage, api: getInstantPage,
rowKey: 'mpId', rowKey: 'mpId',
@ -40,13 +40,16 @@ const [registerTable, {getForm, reload, getDataSource, updateTableDataRecord}] =
columns, columns,
formConfig: { formConfig: {
labelWidth: 70, labelWidth: 70,
schemas: searchSchema.value, schemas: searchSchema,
showResetButton: false, showResetButton: false,
submitButtonOptions:{
preIcon: IconEnum.SEARCH,
},
actionColOptions: { actionColOptions: {
span: 2, span: 3,
style: { style: {
textAlign: 'left', textAlign: 'left',
marginLeft: '10px', marginLeft: '5px',
} }
} }
}, },

35
src/views/run/instant/index.vue

@ -24,7 +24,7 @@ const [registerHistoryModal, { openModal: openHistoryModal }] = useModal()
const [registerCreateModal, { openModal: openCreateModal }] = useModal() const [registerCreateModal, { openModal: openCreateModal }] = useModal()
const [registerUpdateModal, { openModal: openUpdateModal }] = useModal() const [registerUpdateModal, { openModal: openUpdateModal }] = useModal()
const searchSchema = ref<FormSchema[]>(getSearchFormSchema(true,true)) // const searchSchema = getSearchFormSchema(true,true) //
const [registerTable, { setProps,getForm, reload, getDataSource, updateTableDataRecord }] = useTable({ const [registerTable, { setProps,getForm, reload, getDataSource, updateTableDataRecord }] = useTable({
title: '实例列表', title: '实例列表',
@ -44,24 +44,7 @@ const [registerTable, { setProps,getForm, reload, getDataSource, updateTableData
} }
}, },
formConfig: {}, formConfig: { labelWidth: 70,
useSearchForm: true,
showTableSetting: true,
showIndexColumn: false,
actionColumn: {
width: 240,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right',
},
})
onMounted(async () => {
//
const searchSchema = await getSearchFormSchema(true,true,true,false,false,false) //
setProps({ formConfig: {
labelWidth: 70,
schemas: searchSchema, schemas: searchSchema,
showResetButton: false, showResetButton: false,
submitButtonOptions:{ submitButtonOptions:{
@ -73,10 +56,18 @@ onMounted(async () => {
textAlign: 'left', textAlign: 'left',
marginLeft: '5px', marginLeft: '5px',
} }
} }}) } },
// useSearchForm: true,
reload() showTableSetting: true,
showIndexColumn: false,
actionColumn: {
width: 240,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right',
},
}) })
function handleDetail(record) { function handleDetail(record) {
console.log(record) console.log(record)
router.push(`/run/instant/detail?mpId=${record.mpId}`) router.push(`/run/instant/detail?mpId=${record.mpId}`)

241
src/views/run/instant/instant.data.ts

@ -94,113 +94,115 @@ export const columns: BasicColumn[] = [
] ]
const optionList = await optionListApi()
const systemOptions = ref<any>([])
// /** //显示全部就不查询子系统
// * 获取搜索表单 schema const param: systemSelectParams = { unitId: optionList.units[0].id, typeId: optionList.types[0].id }
// * @param showAlgorithm 是否显示算法字段 systemOptions.value = await subSystemListApi(param)
// */
// export async function getSearchFormSchema(showAlgorithm = true,showAll=true): FormSchema[] {
// const optionList = await optionListApi() /**
// const systemOptions = ref<any>([]) * schema
// if(!showAll){ * @param showAlgorithm
// const param: systemSelectParams = { unitId: optionList.units[0].id, typeId: optionList.types[0].id } */
// systemOptions.value = await subSystemListApi(param) export function getSearchFormSchema(showAlgorithm = true,showAll=true): FormSchema[] {
// } if(showAll){systemOptions.value=[]}
// return [ return [
// { {
// label: '机组', label: '机组',
// field: 'unit', field: 'unit',
// component: 'Select', component: 'Select',
// defaultValue: showAll ? null: optionList.units[0].id, defaultValue: showAll ? null: optionList.units[0].id,
// colProps: { span: 4 }, colProps: { span: 4 },
// componentProps: ({ formModel }) => ({ componentProps: ({ formModel }) => ({
// placeholder: '全部机组', placeholder: '全部机组',
// style: { 'color': 'green', fontSize: '14px' }, style: { 'color': 'green', fontSize: '14px' },
// options: optionList.units.map(unit => ({ value: unit.id, label: unit.name })), options: optionList.units.map(unit => ({ value: unit.id, label: unit.name })),
// onChange: async (e: any) => { onChange: async (e: any) => {
// const param: systemSelectParams = { unitId: e, typeId: formModel.type } const param: systemSelectParams = { unitId: e, typeId: formModel.type }
// if (!param.typeId || !param.unitId) { if (!param.typeId || !param.unitId) {
// systemOptions.value = [] systemOptions.value = []
// return return
// } }
// systemOptions.value = await subSystemListApi(param) systemOptions.value = await subSystemListApi(param)
// }, },
// }), }),
// }, },
// { {
// label: '系统', label: '系统',
// field: 'type', field: 'type',
// component: 'Select', component: 'Select',
// defaultValue: showAll ? null: optionList.types[0].id, defaultValue: showAll ? null: optionList.types[0].id,
// colProps: { span: 4 }, colProps: { span: 4 },
// componentProps: ({ formModel }) => ({ componentProps: ({ formModel }) => ({
// placeholder: '全部系统', placeholder: '全部系统',
// options: optionList.types.map(type => ({ value: type.id, label: type.name })), options: optionList.types.map(type => ({ value: type.id, label: type.name })),
// onChange: async (e: any) => { onChange: async (e: any) => {
// const param: systemSelectParams = { unitId: formModel.unit, typeId: e } const param: systemSelectParams = { unitId: formModel.unit, typeId: e }
// if (!param.typeId || !param.unitId) { if (!param.typeId || !param.unitId) {
// systemOptions.value = [] systemOptions.value = []
// return return
// } }
// systemOptions.value = await subSystemListApi(param) systemOptions.value = await subSystemListApi(param)
// }, },
// }), }),
// }, },
// { {
// label: '子系统', label: '子系统',
// field: 'system', field: 'system',
// component: 'Select', component: 'Select',
// defaultValue: showAll ? null: systemOptions[0].id, defaultValue: showAll ? null: systemOptions[0].id,
// colProps: { span: 4 }, colProps: { span: 4 },
// componentProps: () => ({ componentProps: () => ({
// placeholder: '全部子系统', placeholder: '全部子系统',
// options: systemOptions.value.map(system => ({ value: system.id, label: system.name })), options: systemOptions.value.map(system => ({ value: system.id, label: system.name })),
// }), }),
// }, },
// { {
// label: '模型实例名称', label: '模型实例名称',
// field: 'mpName', field: 'mpName',
// component: 'Input', component: 'Input',
// labelWidth: 120, labelWidth: 120,
// defaultValue: '', defaultValue: '',
// colProps: { span: 5 }, colProps: { span: 5 },
// }, },
// { {
// label: '算法', label: '算法',
// field: 'algorithmId', field: 'algorithmId',
// component: 'Select', component: 'Select',
// labelWidth: 50, labelWidth: 50,
// componentProps: { componentProps: {
// placeholder: '全部算法', placeholder: '全部算法',
// options: [ options: [
// { value: 1, label: '主成分分析(PCA)' }, { value: 1, label: '主成分分析(PCA)' },
// { value: 2, label: '神经网络(ANN)' }, { value: 2, label: '神经网络(ANN)' },
// ], ],
// }, },
// defaultValue: null, defaultValue: null,
// colProps: { span: 3 }, colProps: { span: 3 },
// show: showAlgorithm, // 根据参数决定是否显示 show: showAlgorithm, // 根据参数决定是否显示
// }, },
// { {
// label: '状态1', label: '状态1',
// field: 'running', field: 'running',
// component: 'Input', component: 'Input',
// show: false, show: false,
// }, },
// { {
// label: '状态2', label: '状态2',
// field: 'runningLog', field: 'runningLog',
// component: 'Input', component: 'Input',
// show: false, show: false,
// }, },
// { {
// label: '状态3', label: '状态3',
// field: 'isUpdate', field: 'isUpdate',
// component: 'Input', component: 'Input',
// show: false, show: false,
// }, },
// ] ]
// } }
/** /**
* schemavben * schemavben
*/ */
@ -211,7 +213,7 @@ export interface selectParams {
systemId: number | null; systemId: number | null;
} }
export async function getSearchFormSchema( export async function getSearchFormSchema1(
showAlgorithm = true, showAlgorithm = true,
showAll = true, showAll = true,
showName=true, showName=true,
@ -219,7 +221,6 @@ export async function getSearchFormSchema(
haveMpId = true, haveMpId = true,
haveWarn = true, haveWarn = true,
): Promise<FormSchema[]> { ): Promise<FormSchema[]> {
const optionList = await optionListApi() const optionList = await optionListApi()
const mpList = ref<any[]>([]) const mpList = ref<any[]>([])
// 子系统 options 用普通变量维护(不是 ref) // 子系统 options 用普通变量维护(不是 ref)
@ -270,18 +271,6 @@ const mpList = ref<any[]>([])
else{ else{
formActionType.setFieldsValue({system: null}) 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{ else{
formActionType.setFieldsValue({system: null}) 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})
// }
}, },
}), }),
}, },

30
src/views/warn/alarm/index.vue

@ -25,6 +25,7 @@ const { createMessage } = useMessage()
const { t } = useI18n() const { t } = useI18n()
const [registerUpdateModal, { openModal: openUpdateModal }] = useModal() const [registerUpdateModal, { openModal: openUpdateModal }] = useModal()
const [registerTrendModal, { openModal: openTrendModal }] = useModal() const [registerTrendModal, { openModal: openTrendModal }] = useModal()
const searchSchema = getSearchFormSchema(false, true) //
const [registerTable, { setProps,getForm,reload, getDataSource,setTableData,updateTableDataRecord }] = useTable({ const [registerTable, { setProps,getForm,reload, getDataSource,setTableData,updateTableDataRecord }] = useTable({
title: '集中告警列表', title: '集中告警列表',
@ -34,22 +35,7 @@ const [registerTable, { setProps,getForm,reload, getDataSource,setTableData,upda
columns, columns,
//, //,
useSearchForm: true, useSearchForm: true,
formConfig: {}, formConfig: { labelWidth: 80,
showTableSetting: true,
showIndexColumn: false,
actionColumn: {
width: 200,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right',
}
})
onMounted(async () => {
//
const searchSchema = await getSearchFormSchema(false, true,true,false,false,false) //
setProps({ formConfig: {
labelWidth: 80,
schemas: searchSchema, schemas: searchSchema,
showResetButton: false, showResetButton: false,
submitButtonOptions:{ submitButtonOptions:{
@ -61,9 +47,17 @@ setProps({ formConfig: {
textAlign: 'left', textAlign: 'left',
marginLeft: '10px', marginLeft: '10px',
} }
} }}) }},
showTableSetting: true,
showIndexColumn: false,
actionColumn: {
width: 200,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right',
}
}) })
function handleUpdate(record: Recordable) { function handleUpdate(record: Recordable) {
openUpdateModal(true, { record, isUpdate: true }) openUpdateModal(true, { record, isUpdate: true })
} }

71
src/views/warn/config/UpdateModal.vue

@ -5,7 +5,7 @@ import {useI18n} from '@/hooks/web/useI18n'
import {useMessage} from '@/hooks/web/useMessage' import {useMessage} from '@/hooks/web/useMessage'
import {BasicForm, useForm} from '@/components/Form' import {BasicForm, useForm} from '@/components/Form'
import {BasicModal, useModalInner} from '@/components/Modal' import {BasicModal, useModalInner} from '@/components/Modal'
import {getWarn, updateWarn} from '@/api/alert/warn' import {getWarn, createWarn, updateWarn} from '@/api/alert/warn'
import {getSearchFormSchema} from '@/views/run/instant/instant.data' import {getSearchFormSchema} from '@/views/run/instant/instant.data'
import {Divider, Descriptions, DescriptionsItem} from 'ant-design-vue' import {Divider, Descriptions, DescriptionsItem} from 'ant-design-vue'
import {getInstantPoint} from "@/api/alert/run/instant"; import {getInstantPoint} from "@/api/alert/run/instant";
@ -16,7 +16,7 @@ const emit = defineEmits(['success', 'register'])
const {t} = useI18n() const {t} = useI18n()
const {createMessage} = useMessage() const {createMessage} = useMessage()
const isUpdate = ref(true) const isUpdate = ref(true)
const pointLoading = ref(true)
// //
const [registerQueryForm, { const [registerQueryForm, {
@ -35,7 +35,7 @@ const [registerQueryForm, {
}) })
const [registerForm, {setFieldsValue, resetFields, validate}] = useForm({ const [registerForm, {setFieldsValue, getFieldsValue,resetFields, validate}] = useForm({
labelWidth: 120, labelWidth: 120,
baseColProps: {span: 24}, baseColProps: {span: 24},
schemas: updateWarnForm, schemas: updateWarnForm,
@ -50,13 +50,43 @@ function getPointInfo(list, inputName) {
} }
async function handleQuery() { async function handleQuery() {
setProps({
submitButtonOptions: { loading: true },
})
try {
// //
const queryValues = await validateQueryForm() const queryValues = await validateQueryForm()
pointLoading.value = true
// //
const res = await getInstantPoint(queryValues.mpId) const res = await getInstantPoint(queryValues.mpId)
//inputNameinputName //inputNameinputName
pointInfo.value = getPointInfo(res, queryValues?.inputName) pointInfo.value = getPointInfo(res, queryValues?.inputName)
// biasPointInfo:"XN.M00010001B"
// faultVariablePointInfo:"XN.M00010001F"
// id:1
// inputInfo:"HN_01_1RRA010MT_AVALUE"
// inputName:"HN_01_1RRA010MT_AVALUE"
// outPointInfo:"XN.M00010001R"
// unit:""
const {inputInfo, inputName, outPointInfo, ...rest} = pointInfo.value
//
pointInfo.value = {
...rest,
pointId: inputInfo,
pointName: inputName,
outputPoint: outPointInfo,
} }
}
finally {
setProps({
submitButtonOptions: { loading: false },
})
pointLoading.value = false
}
}
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
resetFields() resetFields()
setModalProps({width: 800, useWrapper: true, minHeight: 180, confirmLoading: false}) setModalProps({width: 800, useWrapper: true, minHeight: 180, confirmLoading: false})
@ -74,8 +104,10 @@ const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data)
await handleQuery() await handleQuery()
} }
}) })
async function handleSubmit() { async function handleSubmit() {
try { try {
const values = await validate() const values = await validate()
setModalProps({confirmLoading: true}) setModalProps({confirmLoading: true})
if (unref(isUpdate)) { if (unref(isUpdate)) {
@ -83,10 +115,25 @@ async function handleSubmit() {
closeModal() closeModal()
emit('success') emit('success')
createMessage.success(t('common.saveSuccessText')) createMessage.success(t('common.saveSuccessText'))
} } else {
else{
// //
//
const queryValues = await validateQueryForm()
//
if (queryValues.inputName !== pointInfo.value.pointName) {
createMessage.error('请确保点号信息与查询结果一致,如果不一致请重新查询')
return
}
//
const values = await validate()
//
const mergedValues = {...queryValues, ...values, ...pointInfo.value}
//
mergedValues.equation = `[${mergedValues.biasPointInfo}]>UPLIMIT or [${mergedValues.biasPointInfo}]<LOWLIMIT`
await createWarn(mergedValues)
closeModal()
emit('success')
createMessage.success(t('common.saveSuccessText'))
} }
} finally { } finally {
setModalProps({confirmLoading: false}) setModalProps({confirmLoading: false})
@ -101,14 +148,16 @@ async function handleSubmit() {
<BasicForm v-if="!isUpdate" @register="registerQueryForm" @submit="handleQuery"/> <BasicForm v-if="!isUpdate" @register="registerQueryForm" @submit="handleQuery"/>
<Divider v-if="!isUpdate" style="margin-top:0px"/> <Divider v-if="!isUpdate" style="margin-top:0px"/>
<!--查询出来的结果--> <!--查询出来的结果-->
<spin :spinning="pointLoading">
<Descriptions v-if="!isUpdate" bordered size="small" :column="2"> <Descriptions v-if="!isUpdate" bordered size="small" :column="2">
<DescriptionsItem label="测点名">{{ pointInfo?.inputInfo }}</DescriptionsItem> <DescriptionsItem label="测点名">{{ pointInfo?.pointName }}</DescriptionsItem>
<DescriptionsItem label="测点点号">{{ pointInfo?.inputName }}</DescriptionsItem> <DescriptionsItem label="测点点号">{{ pointInfo?.pointId }}</DescriptionsItem>
<DescriptionsItem label="重构点名">{{ pointInfo?.inputInfo + "-重构值" }}</DescriptionsItem> <DescriptionsItem label="重构点名">{{ pointInfo?.pointName + "-重构值" }}</DescriptionsItem>
<DescriptionsItem label="重构点号">{{ pointInfo?.outPointInfo }}</DescriptionsItem> <DescriptionsItem label="重构点号">{{ pointInfo?.outputPoint }}</DescriptionsItem>
<DescriptionsItem label="残差点名">{{ pointInfo?.inputInfo + "-偏差值" }}</DescriptionsItem> <DescriptionsItem label="残差点名">{{ pointInfo?.pointName + "-偏差值" }}</DescriptionsItem>
<DescriptionsItem label="残差点号">{{ pointInfo?.biasPointInfo }}</DescriptionsItem> <DescriptionsItem label="残差点号">{{ pointInfo?.biasPointInfo }}</DescriptionsItem>
</Descriptions> </Descriptions>
</spin>
<Divider v-if="!isUpdate" style="margin-top:10px"/> <Divider v-if="!isUpdate" style="margin-top:10px"/>
<BasicForm @register="registerForm"/> <BasicForm @register="registerForm"/>
</BasicModal> </BasicModal>

52
src/views/warn/config/index.vue

@ -24,13 +24,34 @@ const { createMessage } = useMessage()
const { t } = useI18n() const { t } = useI18n()
const [registerUpdateModal, { openModal: openUpdateModal }] = useModal() const [registerUpdateModal, { openModal: openUpdateModal }] = useModal()
const [registerTrendModal, { openModal: openTrendModal }] = useModal()
const searchSchema = getSearchFormSchema(false, true) //
const searchForm = computed<FormSchema[]>(() => {
const schemas = [searchFormSchema]
schemas.push(...searchSchema)
return schemas
})
const [registerTable, { setProps,getForm, reload, getDataSource, updateTableDataRecord }] = useTable({ const [registerTable, { setProps,getForm, reload, getDataSource, updateTableDataRecord }] = useTable({
title: '预警测点列表', title: '预警测点列表',
api: getWarnPage, api: getWarnPage,
rowKey: 'warnId', rowKey: 'warnId',
immediate: true, immediate: true,
columns, columns,
formConfig: {}, formConfig: { labelWidth: 80,
schemas: searchForm.value,
showResetButton: false,
submitButtonOptions:{
preIcon: IconEnum.SEARCH,
},
actionColOptions: {
span: 4,
style: {
textAlign: 'left',
marginLeft: '5px',
}
}},
beforeFetch: (params) => ({ beforeFetch: (params) => ({
...params, ...params,
mpId: route.query.mpId ?? null, mpId: route.query.mpId ?? null,
@ -67,36 +88,7 @@ async function handleTrend(record: Recordable) {
warnId.value=record.warnId; warnId.value=record.warnId;
openTrendModal(true, { record }) openTrendModal(true, { record })
} }
onMounted(async () => {
//
const searchSchema = await getSearchFormSchema(false, true,true,false,false,false) //
const searchForm = computed<FormSchema[]>(() => {
const schemas = [searchFormSchema]
schemas.push(...searchSchema)
return schemas
})
console.log(searchForm.value)
//
setProps({ formConfig: {
labelWidth: 80,
schemas: searchForm.value,
showResetButton: false,
submitButtonOptions:{
preIcon: IconEnum.SEARCH,
},
actionColOptions: {
span: 4,
style: {
textAlign: 'left',
marginLeft: '5px',
}
} }})
//
reload()
})
</script> </script>
<template> <template>
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">

14
src/views/warn/config/warn.data.ts

@ -149,6 +149,12 @@ export const updateWarnForm: FormSchema[] = [
component: 'Input', component: 'Input',
required: true, required: true,
show: false, show: false,
dynamicRules: ({ values }) => {
// 假设:有 warnId = 编辑,没有 = 新增
return values.warnId
? [{ required: true, message: '编号不能为空' }]
: []
},
}, },
{ {
label: '残差上限', label: '残差上限',
@ -562,7 +568,7 @@ export const InstantForm: FormSchema[] = [
component: 'Select', component: 'Select',
defaultValue: mpList.value?.[0]?.mpId, defaultValue: mpList.value?.[0]?.mpId,
colProps: { span:10}, colProps: { span:10},
componentProps: () => ({ componentProps: ({ formModel, formActionType }) => ({
placeholder: '模型实例', placeholder: '模型实例',
allowClear: false, allowClear: false,
options:mpList.value.map(instant => ({ options:mpList.value.map(instant => ({
@ -574,14 +580,14 @@ export const InstantForm: FormSchema[] = [
const res = await getInstantPoint(mpId) const res = await getInstantPoint(mpId)
console.log(res) console.log(res)
pointList.value=res; pointList.value=res;
formModel.inputName = res.data?.[0]?.inputName formModel.inputName = res[0]?.inputName
formActionType.setFieldsValue({ formActionType.setFieldsValue({
inputName: res.data?.[0]?.inputName, inputName: res[0]?.inputName,
}) })
} }
})}, })},
{ {
label: '预警点', label: '预警点',
field: 'inputName', field: 'inputName',
component: 'Select', component: 'Select',
defaultValue: pointList.value?.[0]?.inputName, defaultValue: pointList.value?.[0]?.inputName,

Loading…
Cancel
Save