From 7b1ce6433c5a0617ddb73e18bda610f925b709fd Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期二, 12 十一月 2024 14:12:04 +0800 Subject: [PATCH] 预测项详情 --- src/views/model/pre/item/MmPredictItemForm.vue | 49 +++++++++++++++++++++++++++---------------------- 1 files changed, 27 insertions(+), 22 deletions(-) diff --git a/src/views/model/pre/item/MmPredictItemForm.vue b/src/views/model/pre/item/MmPredictItemForm.vue index 85fa6d6..2e72784 100644 --- a/src/views/model/pre/item/MmPredictItemForm.vue +++ b/src/views/model/pre/item/MmPredictItemForm.vue @@ -228,9 +228,9 @@ :data="dataForm.mmModelArithSettingsList" border style="width: 100%; margin-top: 5px;"> - <el-table-column prop="key" label="键" align="center"/> - <el-table-column prop="name" label="名称" align="center"/> - <el-table-column prop="valuetype" label="类型" align="center"/> + <el-table-column prop="key" label="键" align="center" min-width="150"/> + <el-table-column prop="name" label="名称" align="center" min-width="150"/> + <el-table-column prop="valuetype" label="类型" align="center" min-width="150"/> <el-table-column prop="" label="值" align="center" min-width="150"> <template #default="scope"> <el-input size="mini" v-model="scope.row.value" maxlength="256" @@ -281,18 +281,18 @@ style="width:100%;hight:100%"/> </template> </el-table-column> - <el-table-column prop="" label="操作" width="140" align="center"> + <el-table-column prop="" label="操作" width="120" align="center"> <template #default="scope"> <el-button @click="addRow(scope.$index, dataForm.mmModelParamList)" type="text" - size="small"> + size="mini"> 添加 </el-button> <el-button @click="deleteRow(scope.$index, dataForm.mmModelParamList)" type="text" - size="small"> + size="mini"> 删除 </el-button> </template> @@ -317,8 +317,8 @@ <el-option v-for="(item, index) in predictItemList" :key="index" - :label="item.name" - :value="item.code"/> + :label="item.itemname" + :value="item.itemno"/> </el-select> </template> </el-table-column> @@ -331,7 +331,7 @@ label="运算符" align="center"> <template #default="scope"> - <el-select v-model="scope.row.operator" placeholder="请选择"> + <el-select v-model="scope.row.operator" placeholder="请选择" clearable> <el-option v-for="item in operatorList" :key="item" @@ -370,13 +370,13 @@ </template> <script lang="ts" setup> import {DICT_TYPE, getIntDictOptions, getStrDictOptions} from '@/utils/dict' -import * as MmPredictItem from '@/api/model/pre/predict' -import * as MmItemType from '@/api/model/pre/item' +import * as MmPredictItem from '@/api/model/pre/item' +import * as MmItemType from '@/api/model/pre/type' import * as DmModule from '@/api/model/pre/dm' import * as MmResultTable from '@/api/model/pre/result' import * as ProjectApi from '@/api/model/mpk/project' import * as DaPoint from '@/api/data/da/point' -import {useUpload} from '@/api/model/pre/predict' +import {useUpload} from '@/api/model/pre/item' import * as ScheduleModelApi from '@/api/model/sche/model' const {uploadUrl, httpRequest} = useUpload() @@ -504,15 +504,6 @@ resetForm() resetFields(dataForm.value) setDefaultFields() - // 修改时,设置数据 - if (id) { - formLoading.value = true - try { - getInfo(id) - } finally { - /*formLoading.value = false*/ - } - } // 加载参数列表 modelparamListMap.value = await ScheduleModelApi.getModelParamList() @@ -525,7 +516,6 @@ if (!dataForm.value.id) { dataForm.value.mmPredictItem.itemtypeid = itemTypeList.value[0].id } - dataForm.value.itemtypename = itemTypeMap[dataForm.value.mmPredictItem.itemtypeid] // 获取管网列表 moduleList.value = await DmModule.getModuleList() @@ -536,6 +526,11 @@ // 获取mpk项目列表 mpkProjectList.value = await ProjectApi.list() + // 获取normal列表 + predictItemList.value = await MmPredictItem.getMmPredictItemList({ + itemtypename: 'NormalItem' + }) + // 获取数据点列表 pointNoList.value = await DaPoint.getPointList(queryParams) if (pointNoList.value.length > 0) { @@ -545,6 +540,15 @@ }) } + // 修改时,设置数据 + if (id) { + formLoading.value = true + try { + getInfo(id) + } finally { + /*formLoading.value = false*/ + } + } formLoading.value = false } defineExpose({open}) // 提供 open 方法,用于打开弹窗 @@ -609,6 +613,7 @@ const getInfo = async (id) => { dataForm.value = await MmPredictItem.getMmPredictItem(id) + dataForm.value.itemtypename = itemTypeMap[dataForm.value.mmPredictItem.itemtypeid] expressionList.value = [] if (dataForm.value.mmPredictMergeItem && dataForm.value.mmPredictMergeItem.expression) { let expression = dataForm.value.mmPredictMergeItem.expression -- Gitblit v1.9.3