| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="管网" prop="dmModuleItem.moduleid"> |
| | | <el-select v-model="dataForm.dmModuleItem.moduleid" placeholder="请选择"> |
| | | <el-select v-model="dataForm.dmModuleItem.moduleid" placeholder="请选择" @change="clearExpressionList"> |
| | | <el-option |
| | | v-for="item in moduleList" |
| | | :key="item.id" |
| | |
| | | </el-row> |
| | | <el-row v-if="dataForm.itemtypename === 'MergeItem'"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预测长度"> |
| | | <el-form-item label="预测长度" prop="mmPredictItem.predictlength"> |
| | | <el-input |
| | | @change="clearExpressionList" |
| | | v-model="dataForm.mmPredictItem.predictlength" placeholder="预测长度" |
| | | maxlength="5"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="真实数据点"> |
| | | <el-select |
| | | v-model="dataForm.pointId" |
| | | filterable |
| | | clearable |
| | | 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> |
| | |
| | | <Icon icon="ep:upload"/> |
| | | 上传模型 |
| | | </el-button> |
| | | <el-button |
| | | size="small" type="primary" @click="setReplaceModelOnly(true)" |
| | | v-if="formType.value === 'update'"> |
| | | <el-button type="primary" plain @click="setReplaceModelOnly(true)"> |
| | | <Icon icon="ep:upload"/> |
| | | 更新模型 |
| | | </el-button> |
| | |
| | | </el-row> |
| | | <el-row v-if="dataForm.itemtypename === 'NormalItem'"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联项目"> |
| | | <el-form-item label="关联项目" prop="mmPredictModel.mpkprojectid"> |
| | | <el-select v-model="dataForm.mmPredictModel.mpkprojectid" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in mpkProjectList" |
| | |
| | | </el-divider> |
| | | <el-button |
| | | v-if="dataForm.itemtypename === 'NormalItem'" |
| | | @click="addItemOutput(dataForm.mmItemOutputList)" |
| | | @click="addItemOutput()" |
| | | type="primary" |
| | | size="small"> |
| | | 添加 |
| | |
| | | <el-select |
| | | v-model="scope.row.pointid" |
| | | filterable |
| | | clearable |
| | | @change="(value) => changeOutputPoint(value,scope.row)" |
| | | placeholder="请选择"> |
| | | <el-option |
| | |
| | | <el-table-column prop="valuetype" label="类型" align="center" min-width="150"/> |
| | | <el-table-column prop="" label="值" align="center" min-width="200"> |
| | | <template #default="scope"> |
| | | <el-input size="mini" v-model="scope.row.value" maxlength="256" |
| | | <el-input size="mini" v-model="scope.row.value" maxlength="1000" |
| | | :disabled="scope.row.key === 'pyFile'" |
| | | style="width:100%;height:100%"/> |
| | | </template> |
| | |
| | | 添加 |
| | | </el-button> |
| | | <el-button |
| | | @click="deleteRow(scope.$index, dataForm.mmModelParamList)" |
| | | @click="deleteRow(scope.$index, scope.row, dataForm.mmModelParamList)" |
| | | type="text" |
| | | size="mini"> |
| | | 删除 |
| | |
| | | v-model="scope.row.point" |
| | | placeholder="请选择" |
| | | filterable |
| | | :no-data-text="'无数据(预测长度:' + dataForm.mmPredictItem.predictlength + ';管网:' + moduleList.find(e => e.id === dataForm.dmModuleItem.moduleid)?.modulename + ')'" |
| | | @change="changeNormalItemSelect" |
| | | style="width: 100%"> |
| | | <el-option-group |
| | | v-for="group in modelparamListMap['NormalItem']" |
| | | v-for="group in modelparamListMap['NormalItem'].filter(e => e.predictlength == dataForm.mmPredictItem.predictlength && e.moduleid === dataForm.dmModuleItem.moduleid)" |
| | | :key="group.value" |
| | | :label="group.label" |
| | | > |
| | |
| | | num: undefined |
| | | }, |
| | | mmModelArithSettingsList: [], |
| | | mmModelParamList: [] |
| | | mmModelParamList: [], |
| | | pointId: undefined |
| | | }) |
| | | const formRules = reactive({ |
| | | 'mmPredictItem.itemname': [{required: true, message: '预测项名不能为空', trigger: 'blur'}], |
| | |
| | | 'mmPredictItem.status': [{required: true, message: '是否启用不能为空', trigger: 'blur'}], |
| | | 'dmModuleItem.moduleid': [{required: true, message: '管网不能为空', trigger: 'blur'}], |
| | | 'dmModuleItem.itemorder': [{required: true, message: '排序不能为空', trigger: 'blur'}], |
| | | 'mmPredictItem.predictlength': [{required: true, message: '预测长度不能为空', trigger: 'blur'}], |
| | | 'mmPredictModel.mpkprojectid': [{required: true, message: '关联项目不能为空', trigger: 'blur'}], |
| | | |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | |
| | | if (!formRef) return |
| | | const valid = await formRef.value.validate() |
| | | if (!valid) return |
| | | |
| | | //校验模型输出 |
| | | if (dataForm.itemtypename === 'NormalItem') { |
| | | if (dataForm.value.itemtypename === 'NormalItem') { |
| | | 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 === ''))) { |
| | | if (e.resultstr == undefined || e.resultstr === '' || e.resultType == undefined || e.resultType === '' || (e.resultType === 2 && (e.resultIndex == undefined || e.resultIndex === ''))) { |
| | | message.error("模型输出数据异常") |
| | | flag = true |
| | | return |
| | | } |
| | | }) |
| | | if (flag) return |
| | | } |
| | | if (dataForm.value.itemtypename === 'MergeItem') { |
| | | if (expressionList.value == undefined || expressionList.value.length <= 1) { |
| | | message.error("表达式长度低于2") |
| | | return |
| | | } |
| | | |
| | | let flag = false |
| | | expressionList.value.forEach((e,index) => { |
| | | if (e.point == undefined || e.point === '' || e.operator == undefined || (e.operator === '' && index != expressionList.value.length - 1)) { |
| | | message.error("表达式数据异常") |
| | | flag = true |
| | | return |
| | | } |
| | |
| | | rows.splice(index, 0, row) |
| | | } |
| | | |
| | | function deleteRow(index: string, rows) { |
| | | if (!rows || rows.length === 1) { |
| | | message.error('不能全部删除!') |
| | | function deleteRow(index, row, rows) { |
| | | if (!rows || rows.length === 1 || rows.filter(e => e.modelparamportorder === row.modelparamportorder).length === 1) { |
| | | message.error('不可删除!') |
| | | return |
| | | } |
| | | rows.splice(index, 1) |
| | |
| | | orderRow(rows) |
| | | } |
| | | |
| | | function addItemOutput(list) { |
| | | list.push({}) |
| | | orderItemOutput(list) |
| | | function addItemOutput() { |
| | | if (!dataForm.value.mmItemOutputList) { |
| | | dataForm.value.mmItemOutputList = [] |
| | | } |
| | | dataForm.value.mmItemOutputList.push({}) |
| | | orderItemOutput(dataForm.value.mmItemOutputList) |
| | | } |
| | | |
| | | function deleteItemOutput(index: string, rows) { |
| | |
| | | fileList.value = [] |
| | | } |
| | | |
| | | const clearExpressionList = (value) => { |
| | | expressionList.value = [{ |
| | | point: '', |
| | | operator: '' |
| | | }] |
| | | } |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | dataForm.value = { |