| | |
| | | controls-position="right"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="数据点" prop="mmItemOutput.pointid"> |
| | | <el-select |
| | | v-model="dataForm.mmItemOutput.pointid" |
| | | filterable |
| | | @change="changeOutputPoint" |
| | | placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in pointList" |
| | | :key="item.id" |
| | | :label="item.pointName" |
| | | :value="item.id"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="dataForm.itemtypename === 'MergeItem'"> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="dataForm.itemtypename === 'NormalItem'"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="结果"> |
| | | <el-select v-model="dataForm.mmPredictModel.resultstrid" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in resultstridList" |
| | | :key="item.id" |
| | | :label="item.resultstr" |
| | | :value="item.id"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联项目"> |
| | | <el-select v-model="dataForm.mmPredictModel.mpkprojectid" placeholder="请选择"> |
| | | <el-option |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="编号"> |
| | | <el-input |
| | | v-model="dataForm.mmPredictModel.modelno" placeholder="编号" maxlength="30" readonly |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-divider content-position="left" v-if="dataForm.itemtypename === 'NormalItem'">模型输出 |
| | | </el-divider> |
| | | <el-button |
| | | @click="addItemOutput(dataForm.mmItemOutputList)" |
| | | type="primary" |
| | | size="small"> |
| | | 添加 |
| | | </el-button> |
| | | <el-table |
| | | v-if="dataForm.itemtypename === 'NormalItem'" |
| | | :data="dataForm.mmItemOutputList" |
| | | border |
| | | style="width: 100%; margin-top: 5px;"> |
| | | <el-table-column prop="outputorder" label="排序" align="center" width="80px" /> |
| | | <el-table-column label="结果" align="center" width="150px"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.resultstr" placeholder="请输入"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="结果数据类型" align="center" width="150px"> |
| | | <template #default="scope"> |
| | | <el-select |
| | | v-model="scope.row.resultType" |
| | | @change="(value) => resultTypeChange(value,scope.row)" |
| | | filterable |
| | | placeholder="请选择"> |
| | | <el-option |
| | | v-for="dict in getIntDictOptions(DICT_TYPE.MODEL_RESULT_TYPE)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value"/> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="索引" align="center" width="120px"> |
| | | <template #default="scope"> |
| | | <el-input-number style="width:100%;hight:100%" :disabled="scope.row.resultType !== 2" v-model="scope.row.resultIndex" :min="0" step-strictly controls-position="right"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="数据点" align="center"> |
| | | <template #default="scope"> |
| | | <el-select |
| | | v-model="scope.row.pointid" |
| | | filterable |
| | | @change="(value) => changeOutputPoint(value,scope.row)" |
| | | placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in pointList" |
| | | :key="item.id" |
| | | :label="item.pointName" |
| | | :value="item.id"/> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="" label="操作" width="80" align="center"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | @click="deleteItemOutput(scope.$index, dataForm.mmItemOutputList)" |
| | | type="text" |
| | | size="small"> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-divider content-position="left" v-if="dataForm.itemtypename === 'NormalItem'">模型设置参数 |
| | | </el-divider> |
| | | <el-table |
| | | v-if="dataForm.itemtypename === 'NormalItem'" |
| | | :data="dataForm.mmModelArithSettingsList" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-divider content-position="left" v-if="dataForm.itemtypename === 'NormalItem'">输入参数 |
| | | <el-divider content-position="left" v-if="dataForm.itemtypename === 'NormalItem'">模型输入参数 |
| | | </el-divider> |
| | | <el-table |
| | | v-if="dataForm.itemtypename === 'NormalItem'" |
| | |
| | | import * as DaPoint from '@/api/data/da/point' |
| | | import {useUpload} from '@/api/model/pre/item' |
| | | import * as ScheduleModelApi from '@/api/model/sche/model' |
| | | import request from "@/config/axios"; |
| | | |
| | | const {uploadUrl, httpRequest} = useUpload() |
| | | |
| | |
| | | status: undefined, |
| | | categoryid: undefined |
| | | }, |
| | | mmItemOutput: { |
| | | id: undefined, |
| | | itemid: undefined, |
| | | pointid: undefined, |
| | | resulttableid: undefined, |
| | | tagname: undefined, |
| | | outputorder: undefined |
| | | }, |
| | | mmItemOutputList: [], |
| | | mmPredictModel: { |
| | | id: undefined, |
| | | modelno: undefined, |
| | |
| | | 'mmPredictItem.status': [{required: true, message: '是否启用不能为空', trigger: 'blur'}], |
| | | 'dmModuleItem.moduleid': [{required: true, message: '管网不能为空', trigger: 'blur'}], |
| | | 'dmModuleItem.itemorder': [{required: true, message: '排序不能为空', trigger: 'blur'}], |
| | | 'mmItemOutput.pointid': [{required: true, message: '数据点不能为空', trigger: 'blur'}], |
| | | |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | |
| | | // 获取数据点列表 |
| | | pointNoList.value = await DaPoint.getPointList(queryParams) |
| | | if (pointNoList.value.length > 0) { |
| | | pointList.value = [] |
| | | pointNoList.value.forEach(function (value) { |
| | | pointList.value.push(value) |
| | | pointMap[value.id] = value.pointname |
| | | pointMap[value.id] = value.pointName |
| | | }) |
| | | } |
| | | |
| | |
| | | try { |
| | | getInfo(id) |
| | | } finally { |
| | | /*formLoading.value = false*/ |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | formLoading.value = false |
| | |
| | | if (!formRef) return |
| | | const valid = await formRef.value.validate() |
| | | if (!valid) return |
| | | |
| | | //校验模型输出 |
| | | if (dataForm.value.mmItemOutputList == undefined || dataForm.value.mmItemOutputList.length <= 0) { |
| | | message.error("模型输出不为空") |
| | | return |
| | | } |
| | | |
| | | let flag = false |
| | | dataForm.value.mmItemOutputList.forEach(e => { |
| | | if (e.resultstr == undefined || e.resultstr === '' || e.resultType == undefined || e.resultType === '' || e.pointid == undefined || e.pointid === '' || (e.resultType === 2 && (e.resultIndex == undefined || e.resultIndex === ''))) { |
| | | message.error("模型输出数据异常") |
| | | flag = true |
| | | } |
| | | }) |
| | | if (flag) return |
| | | |
| | | // 提交请求 |
| | | formLoading.value = true |
| | | try { |
| | |
| | | row.modelparamid = '' |
| | | } |
| | | |
| | | function changeOutputPoint(value) { |
| | | dataForm.value.mmItemOutput.tagname = pointMap[value] |
| | | function changeOutputPoint(value,row) { |
| | | row.tagname = pointMap[value] |
| | | } |
| | | |
| | | function deleteExpressionRow(index, rows) { |
| | |
| | | let row = JSON.parse(JSON.stringify(rows[index])) |
| | | rows.splice(index, 0, row) |
| | | orderRow(rows) |
| | | } |
| | | function addItemOutput(list) { |
| | | list.push({}) |
| | | orderItemOutput(list) |
| | | } |
| | | function deleteItemOutput(index: string, rows) { |
| | | if (!rows || rows.length === 1) { |
| | | message.error('不能全部删除!') |
| | | return |
| | | } |
| | | rows.splice(index, 1) |
| | | orderItemOutput(rows) |
| | | } |
| | | function orderItemOutput(list) { |
| | | list.sort((a, b) => a.outputorder - b.outputorder); |
| | | let outputorder = 1 |
| | | list.forEach(function (value) { |
| | | value.outputorder = outputorder |
| | | outputorder++ |
| | | }) |
| | | } |
| | | |
| | | function resultTypeChange(value, row) { |
| | | if (value === 1) { |
| | | row.resultIndex = undefined |
| | | }else if (value === 2) { |
| | | row.resultIndex = 0 |
| | | } |
| | | } |
| | | |
| | | function orderRow(rows) { |
| | |
| | | dataForm.value.mmPredictModel.trainsamplength = 60 |
| | | dataForm.value.mmPredictModel.isonlinetrain = 0 |
| | | dataForm.value.mmPredictModel.status = 1 |
| | | dataForm.value.mmItemOutput.outputorder = 1 |
| | | dataForm.value.mmItemOutput.resulttableid = '3cc2b483-3a01-40f7-a419-0c260210d8eb' |
| | | dataForm.value.mmItemOutputList = [] |
| | | expressionList.value = [{ |
| | | point: '', |
| | | operator: '' |
| | |
| | | status: 1, |
| | | categoryid: '' |
| | | }, |
| | | mmItemOutput: { |
| | | id: '', |
| | | itemid: '', |
| | | pointid: '', |
| | | resulttableid: '3cc2b483-3a01-40f7-a419-0c260210d8eb', |
| | | tagname: '', |
| | | outputorder: 1 |
| | | }, |
| | | mmItemOutputList: [], |
| | | mmPredictModel: { |
| | | id: '', |
| | | modelno: '', |