src/api/model/pre/predict/index.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/api/model/sche/model/index.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/utils/dict.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/data/ind/item/AtomIndDefineForm.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/data/ind/item/DerIndDefineForm.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/data/ind/item/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/model/mcs/sche/model/ScheduleModelForm.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/model/mcs/sche/model/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/model/pre/item/MmPredictItemForm.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/model/pre/item/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/api/model/pre/predict/index.ts
@@ -1,4 +1,5 @@ import request from '@/config/axios' import {UploadRequestOptions} from "element-plus/es/components/upload/src/upload"; export interface MmPredictItemVO { id: string, @@ -72,30 +73,60 @@ // 查询MmPredictItem列表 export const getMmPredictItemPage = (params: MmPredictItemPageReqVO) => { return request.get({ url: '/model/pre/predict-item/page', params }) return request.get({ url: '/model/pre/item/page', params }) } // 查询MmPredictItem详情 export const getMmPredictItem = (id: number) => { return request.get({ url: `/model/pre/predict-item/get/${id}`}) return request.get({ url: `/model/pre/item/get/${id}`}) } // 新增MmPredictItem export const createMmPredictItem = (data: MmPredictItemVO) => { return request.post({ url: '/model/pre/predict-item/create', data }) return request.post({ url: '/model/pre/item/create', data }) } // 修改MmPredictItem export const updateMmPredictItem = (data: MmPredictItemVO) => { return request.put({ url: '/model/pre/predict-item/update', data }) return request.put({ url: '/model/pre/item/update', data }) } // 删除MmPredictItem export const deleteMmPredictItem = (id: number) => { return request.delete({ url: '/model/pre/predict-item/delete?id=' + id }) return request.delete({ url: '/model/pre/item/delete?id=' + id }) } // 查询getMmPredictItemList详情 export const getMmPredictItemList = () => { return request.get({ url: `/model/pre/predict-item/list`}) // 查询MmPredictItem列表 export const getMmPredictItemList = (params) => { return request.get({ url: `/model/pre/item/list`, params}) } export const updateModel = (data: any) => { return request.upload({ url: '/model/pre/item/upload-model', data }) } export const useUpload = () => { const uploadUrl = import.meta.env.VITE_BASE_URL + '/admin-api/model/pre/item/upload-model' const httpRequest = async (options: UploadRequestOptions) => { return new Promise((resolve, reject) => { updateModel({ file: options.file }) .then((res) => { if (res.code === 0) { resolve(res) } else { reject(res) } }) .catch((res) => { reject(res) }) }) } return { uploadUrl, httpRequest } } src/api/model/sche/model/index.ts
@@ -1,4 +1,7 @@ import request from '@/config/axios' import * as DataPointApi from '@/api/data/da/point' import * as PredictItemApi from '@/api/model/pre/predict' import {CommonEnabled} from "@/utils/constants"; export interface ScheduleModelVO { id: string @@ -65,11 +68,40 @@ } // 查询模型参数列表 export const getModelParamList = (modelparamListMap) => { modelparamListMap['point'] = [] } export const getModelParamList = async () => { // 查询getScheduleWorkPrecessList列表 export const getScheduleWorkPrecessList = (data: WorkPrecessParamVO) => { return request.get({ url: '/model/sche/model/work-process/list/all'},data) const dataPointList = ref([] as DataPointApi.DaPointVO) dataPointList.value = await DataPointApi.getPointList({}) const pointList = [] if (dataPointList.value) { dataPointList.value.forEach(item => { pointList.push( { id: item.pointNo, name: item.pointName } ) }) } const predictItemList = ref([] as PredictItemApi.MmPredictItemVO) predictItemList.value = await PredictItemApi.getMmPredictItemList({ status: CommonEnabled.ENABLE, itemtypename: 'NormalItem' }) const itemList = [] if (predictItemList.value) { predictItemList.value.forEach(item => { itemList.push( { id: item.id, name: item.itemname } ) }) } return { 'DATAPOINT':pointList, 'PREDICTITEM': itemList } } src/utils/dict.ts
@@ -249,7 +249,8 @@ OPCUA_CONNECTION_TYPE = 'opcua_connection_type', HTTP_METHOD = 'http_method', TIME_GRANULARITY = 'time_granularity', STAT_FUNC = 'stat_func', TIME_LIMIT = 'time_limit', ITEM_TYPE = 'item_type', DATA_STAT_FUNC = 'data_stat_func', IND_TIME_LIMIT = 'ind_time_limit', IND_ITEM_TYPE = 'ind_item_type', COM_IS_INT = 'com_is_int' } src/views/data/ind/item/AtomIndDefineForm.vue
@@ -44,31 +44,24 @@ </el-col> </el-row> <el-row> <el-col :span="8"> <el-col :span="6"> <el-form-item label="指标精度" prop="precision"> <el-input v-model="formData.precision"/> </el-form-item> </el-col> <el-col :span="8"> <el-col :span="6"> <el-form-item label="转换系数" prop="coefficient"> <el-input v-model="formData.coefficient"/> </el-form-item> </el-col> <el-col :span="8"> <el-col :span="6"> <el-form-item label="数量单位" prop="unit"> <el-input v-model="formData.unit"/> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="24"> <el-form-item label="备注" prop="remark"> <el-input v-model="formData.remark" type="textarea" maxlength="100"/> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="12"> <el-col :span="6"> <el-form-item label="数据集" prop="atomItem.dataSet"> <el-select v-model="formData.atomItem.dataSet" clearable placeholder="请选择数据集" @change="handleDataSetChange($event)"> <el-option @@ -80,7 +73,7 @@ </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-col :span="6"> <el-form-item label="使用字段" prop="atomItem.usingField"> <el-select v-model="formData.atomItem.usingField" clearable placeholder="请选择字段"> <el-option @@ -92,16 +85,23 @@ </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-col :span="6"> <el-form-item label="统计方式" prop="statFunc"> <el-select v-model="formData.atomItem.statFunc" placeholder="请选择"> <el-option v-for="dict in getStrDictOptions(DICT_TYPE.STAT_FUNC)" v-for="dict in getStrDictOptions(DICT_TYPE.DATA_STAT_FUNC)" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="24"> <el-form-item label="备注" prop="remark"> <el-input v-model="formData.remark" type="textarea" maxlength="100"/> </el-form-item> </el-col> </el-row> @@ -135,8 +135,8 @@ itemName: '', itemType: '', itemCategory: '', coefficient: '', precision: '', coefficient: 1, precision: 0, businessType: '', timeRange: '', timeGranularity: '', @@ -157,10 +157,12 @@ const formRules = reactive({ itemName: [{required: true, message: '指标名称不能为空', trigger: 'blur'}], itemCategory: [{required: true, message: '指标分类不能为空', trigger: 'blur'}], precision: [{validator: validateAsNumber, trigger: 'blur' }], /*precision: [{validator: validateAsNumber, trigger: 'blur' }], coefficient: [{validator: validateAsNumber, trigger: 'blur' }], statFunc: [{required: true, message: '统计方式不能为空', trigger: 'blur'}], timeGranularity: [{required: true, message: '时间粒度不能为空', trigger: 'blur'}], "atomItem.dataSet": [{required: true, message: '数据集不能为空', trigger: 'blur'}], "atomItem.usingField":[{required: true, message: '使用字段不能为空', trigger: 'blur'}] "atomItem.usingField":[{required: true, message: '使用字段不能为空', trigger: 'blur'}]*/ }) const formRef = ref() // 表单 Ref const dataSetList = ref([] as DataSetApi.DataSetVO[]) @@ -197,6 +199,7 @@ /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const submitForm = async () => { debugger // 校验表单 if (!formRef) return const valid = await formRef.value.validate() @@ -234,8 +237,8 @@ itemName: '', itemType: '', itemCategory: '', coefficient: '', precision: '', coefficient: 1, precision: 0, businessType: '', timeRange: '', timeGranularity: '', src/views/data/ind/item/DerIndDefineForm.vue
@@ -64,12 +64,12 @@ </el-col> </el-row> <el-row> <el-col :span="8"> <el-col :span="6"> <el-form-item label="指标精度" prop="precision"> <el-input v-model="formData.precision"/> </el-form-item> </el-col> <el-col :span="8"> <el-col :span="6"> <el-form-item label="转换系数" prop="coefficient"> <el-input v-model="formData.coefficient"/> </el-form-item> @@ -81,14 +81,7 @@ </el-col> </el-row> <el-row> <el-col :span="20"> <el-form-item label="备注" prop="remark"> <el-input v-model="formData.remark" type="textarea" maxlength="100"/> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="12"> <el-col :span="6"> <el-form-item label="时间标识" prop="timeLabel"> <el-select v-model="formData.derItem.timeLabel" clearable placeholder="请选择时间标识"> <el-option @@ -100,12 +93,12 @@ </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-col :span="6"> <el-form-item label="时间限定" prop="timeLimit"> <el-select v-model="formData.timeLimit" placeholder="请选择" @change="handleTimeLimitChange($event)"> <el-option v-for="dict in getStrDictOptions(DICT_TYPE.TIME_LIMIT)" v-for="dict in getStrDictOptions(DICT_TYPE.IND_TIME_LIMIT)" :key="dict.value" :label="dict.label" :value="dict.value" @@ -115,7 +108,7 @@ </el-col> </el-row> <el-row v-if="showTimeChange"> <el-col :span="12"> <el-col :span="6"> <el-form-item label="开始时间" prop="timeStart"> <el-date-picker v-model="formData.derItem.timeStart" @@ -124,7 +117,7 @@ /> </el-form-item> </el-col> <el-col :span="8"> <el-col :span="6"> <el-form-item label="结束时间" prop="timeEnd"> <el-date-picker v-model="formData.derItem.timeEnd" @@ -135,7 +128,7 @@ </el-col> </el-row> <el-row> <el-col :span="12"> <el-col :span="24"> <el-form-item label="分析维度" prop="dimension"> <el-select v-model="formData.derItem.dimension" clearable placeholder="请选择分析维度" multiple> <el-option @@ -145,6 +138,13 @@ :value="item.id + ''" /> </el-select> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="24"> <el-form-item label="备注" prop="remark"> <el-input v-model="formData.remark" type="textarea" maxlength="100"/> </el-form-item> </el-col> </el-row> @@ -180,8 +180,8 @@ itemName: '', itemType: '', itemCategory: '', coefficient: '', precision: '', coefficient: 1, precision: 0, businessType: '', timeRange: '', timeGranularity: '', @@ -213,9 +213,9 @@ const formRules = reactive({ itemName: [{required: true, message: '指标名称不能为空', trigger: 'blur'}], itemCategory: [{required: true, message: '指标类型不能为空', trigger: 'blur'}], precision: [{validator: validateAsNumber, trigger: 'blur' }], coefficient: [{validator: validateAsNumber, trigger: 'blur' }], "atomItem.id": [{required: true, message: '原子指标不能为空', trigger: 'blur'}] /*precision: [{validator: validateAsNumber, trigger: 'blur' }], coefficient: [{validator: validateAsNumber, trigger: 'blur' }],*/ /*"atomItem.id": [{required: true, message: '原子指标不能为空', trigger: 'blur'}]*/ }) const formRef = ref() // 表单 Ref const dataSourceList = ref([] as DataSourceConfigApi.DataSourceConfigVO[]) @@ -289,8 +289,8 @@ itemName: '', itemType: '', itemCategory: '', coefficient: '', precision: '', coefficient: 1, precision: 0, businessType: '', timeRange: '', timeGranularity: '', src/views/data/ind/item/index.vue
@@ -41,7 +41,7 @@ <el-table-column prop="itemCategoryName" label="指标分类" header-align="center" align="center" min-width="100"/> <el-table-column prop="itemType" label="指标类型" header-align="center" align="center" min-width="60"> <template #default="scope"> <dict-tag :type="DICT_TYPE.ITEM_TYPE" :value="scope.row.itemType" /> <dict-tag :type="DICT_TYPE.IND_ITEM_TYPE" :value="scope.row.itemType" /> </template> </el-table-column> <el-table-column prop="coefficient" label="系数" header-align="center" align="center" min-width="60"/> src/views/model/mcs/sche/model/ScheduleModelForm.vue
@@ -130,22 +130,21 @@ filterable placeholder="请选择"> <el-option v-for="(item, index) in modelparamListMap['k']" v-for="(item, index) in modelparamListMap[scope.row.modelparamtype]" :key="index" :label="item.name" :value="item.id" :disabled="!(item.type === scope.row.modelparamtype)"/> :value="item.id"/> </el-select> </template> </el-table-column> <el-table-column prop="" label="参数长度" width="120" width="160" align="center"> <template #default="scope"> <el-input size="mini" v-model="scope.row.datalength" maxlength="50" clearable style="width:100%;hight:100%"/> <el-input-number v-model="scope.row.datalength" :min="0" clearable controls-position="right" style="width:100%;hight:100%"/> </template> </el-table-column> <el-table-column @@ -182,7 +181,7 @@ label="键" align="center"> <template #default="scope"> <el-input size="mini" v-model="scope.row.key" maxlength="256" clearable <el-input size="mini" v-model="scope.row.key" maxlength="20" clearable style="width:100%;hight:100%"/> </template> </el-table-column> @@ -191,7 +190,7 @@ label="名称" align="center"> <template #default="scope"> <el-input size="mini" v-model="scope.row.name" maxlength="256" clearable <el-input size="mini" v-model="scope.row.name" maxlength="20" clearable style="width:100%;hight:100%"/> </template> </el-table-column> @@ -200,8 +199,14 @@ label="类型" align="center"> <template #default="scope"> <el-input size="mini" v-model="scope.row.valuetype" maxlength="256" clearable style="width:100%;hight:100%"/> <el-select v-model="scope.row.valuetype" placeholder="请选择"> <el-option v-for="dict in getStrDictOptions(DICT_TYPE.MODEL_METHOD_SETTING_VALUE_TYPE)" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select> </template> </el-table-column> <el-table-column @@ -333,10 +338,9 @@ } finally { formLoading.value = false } // 加载数据源列表 await ScheduleModelApi.getModelParamList(modelparamListMap) } // 加载参数列表 modelparamListMap.value = await ScheduleModelApi.getModelParamList() } defineExpose({ open }) // 提供 open 方法,用于打开弹窗 src/views/model/mcs/sche/model/index.vue
@@ -54,10 +54,10 @@ <el-table-column label="模型编号" align="center" prop="modelCode" min-width="100"/> <el-table-column label="模型名称" align="center" prop="modelName" min-width="100"/> <el-table-column label="模型类型" align="center" prop="modelType" min-width="100"/> <el-table-column label="类名" align="center" prop="className" min-width="200"/> <el-table-column label="类名" header-align="center" align="left" prop="className" min-width="200"/> <el-table-column label="方法名" align="center" prop="methodName" min-width="100"/> <el-table-column label="参数数量" align="center" prop="portLength" min-width="100"/> <el-table-column label="参数构造" align="center" prop="paramStructure" min-width="200" /> <el-table-column label="参数构造" header-align="center" align="left" prop="paramStructure" min-width="200" /> <el-table-column label="调用方式" align="center" prop="invocation" min-width="100"> <template #default="scope"> <dict-tag :type="DICT_TYPE.SCHE_MODEL_INVOCATION" :value="scope.row.invocation" /> src/views/model/pre/item/MmPredictItemForm.vue
@@ -10,19 +10,20 @@ <el-divider content-position="left">基本信息</el-divider> <el-row> <el-col :span="12"> <el-form-item label="预测项名"> <el-input v-model="dataForm.mmPredictItem.itemname" placeholder="预测项名"/> <el-form-item label="预测项名" prop="mmPredictItem.itemname"> <el-input v-model="dataForm.mmPredictItem.itemname" placeholder="预测项名" maxlength="50"/> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="编号"> <el-col :span="12" v-if="!!dataForm.id"> <el-form-item label="编号" prop="mmPredictItem.itemno"> <el-input v-model="dataForm.mmPredictItem.itemno" placeholder="编号" maxlength="50"/> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="12"> <el-form-item label="类型"> <el-form-item label="类型" prop="mmPredictItem.itemtypeid"> <el-select v-model="dataForm.mmPredictItem.itemtypeid" @change="changeItemtype" placeholder="请选择"> @@ -35,40 +36,47 @@ </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="粒度"> <el-input v-model="dataForm.mmPredictItem.granularity" placeholder="粒度" maxlength="5"/> <el-form-item label="粒度" prop="dataForm.mmPredictItem.granularity"> <el-select v-model="dataForm.mmPredictItem.granularity" placeholder="请选择"> <el-option v-for="dict in getStrDictOptions(DICT_TYPE.TIME_GRANULARITY)" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="12"> <el-form-item label="是否检查"> <el-form-item label="是否检查" prop="dataForm.mmPredictItem.workchecked"> <el-select v-model="dataForm.mmPredictItem.workchecked" placeholder="请选择"> <el-option v-for="item in isList" :key="item.code" :label="item.name" :value="item.code"/> v-for="dict in getIntDictOptions(DICT_TYPE.COM_IS_INT)" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="是否启用"> <el-select v-model="dataForm.dmModuleItem.status" placeholder="请选择"> <el-form-item label="是否启用" prop="dataForm.mmPredictItem.status"> <el-select v-model="dataForm.mmPredictItem.status" placeholder="请选择"> <el-option v-for="item in isList" :key="item.code" :label="item.name" :value="item.code"/> v-for="dict in getIntDictOptions(DICT_TYPE.COM_IS_INT)" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="12"> <el-form-item label="管网"> <el-form-item label="管网" prop="dataForm.dmModuleItem.moduleid"> <el-select v-model="dataForm.dmModuleItem.moduleid" placeholder="请选择"> <el-option v-for="item in moduleList" @@ -86,12 +94,13 @@ </el-row> <el-row> <el-col :span="12"> <el-form-item label="排序"> <el-input v-model="dataForm.dmModuleItem.itemorder" placeholder="排序" maxlength="36"/> <el-form-item label="排序" prop="dataForm.dmModuleItem.itemorder"> <el-input-number v-model="dataForm.dmModuleItem.itemorder" :min="1" clearable controls-position="right"/> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="数据点"> <el-form-item label="数据点" prop="dataForm.mmItemOutput.pointid"> <el-select v-model="dataForm.mmItemOutput.pointid" filterable @@ -100,25 +109,12 @@ <el-option v-for="item in pointList" :key="item.id" :label="item.pointname" :label="item.pointName" :value="item.id"/> </el-select> </el-form-item> </el-col> </el-row> <!-- <el-row> <el-col :span="12"> <el-form-item label="保存点位"> <el-select v-model="dataForm.mmPredictItem.saveindex" placeholder="请选择"> <el-option v-for="item in saveIndexList" :key="item.code" :label="item.name" :value="item.code"/> </el-select> </el-form-item> </el-col> </el-row>--> <el-row v-if="dataForm.itemtypename === 'MergeItem'"> <el-col :span="12"> <el-form-item label="预测长度"> @@ -130,8 +126,8 @@ </el-row> <el-divider content-position="left" v-if="dataForm.itemtypename === 'NormalItem'">模型信息 </el-divider> <el-row v-if="dataForm.itemtypename === 'NormalItem'"> <el-col :span="24"> <el-row :gutter="8" v-if="dataForm.itemtypename === 'NormalItem'"> <el-col :span="12"> <el-form-item label="模型名称"> <el-input v-model="dataForm.mmPredictModel.modelname" placeholder="模型名称" @@ -139,33 +135,29 @@ </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="编号" v-if="!!dataForm.id"> <el-input v-model="dataForm.mmPredictModel.modelno" placeholder="编号" maxlength="32" disabled/> </el-form-item> <el-upload class="upload-demo" :limit="1" :file-list="fileList" :before-upload="beforeUpload" :on-success="uploadModelSuccess" :on-error="uploadModelError" :action="uploadUrl" :http-request="httpRequest"> <el-button type="primary" @click="setReplaceModelOnly(false)"> <Icon icon="ep:upload"/> 上传模型 </el-button> <el-button size="small" type="primary" @click="setReplaceModelOnly(true)" v-if="!!dataForm.id"> <Icon icon="ep:upload"/> 更新模型 </el-button> </el-upload> </el-col> </el-row> <el-row v-if="dataForm.itemtypename === 'NormalItem'"> <el-col :span="12"> <el-form-item label="上传模型"> <el-upload class="upload-demo" :limit="1" :file-list="fileList" :before-upload="beforeUpload" :on-success="uploadModelSuccess" :on-error="uploadModelError" :action="uploadModelUrl"> <el-button size="small" type="primary" @click="setReplaceModelOnly(0)">点击上传 </el-button> <el-button size="small" type="primary" @click="setReplaceModelOnly(1)" v-if="!!dataForm.id">只替换模型 </el-button> </el-upload> </el-form-item> </el-col> <el-row :gutter="8" v-if="dataForm.itemtypename === 'NormalItem'"> <el-col :span="12"> <el-form-item label="结果"> <el-select v-model="dataForm.mmPredictModel.resultstrid" placeholder="请选择"> @@ -177,8 +169,15 @@ </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="编号" v-if="!!dataForm.id"> <el-input v-model="dataForm.mmPredictModel.modelno" placeholder="编号" maxlength="32" disabled/> </el-form-item> </el-col> </el-row> <el-row v-if="dataForm.itemtypename === 'NormalItem'"> <el-row :gutter="8" v-if="dataForm.itemtypename === 'NormalItem'"> <el-col :span="24"> <el-form-item label="路径"> <el-input @@ -187,7 +186,7 @@ </el-form-item> </el-col> </el-row> <el-row v-if="dataForm.itemtypename === 'NormalItem'"> <el-row :gutter="8" v-if="dataForm.itemtypename === 'NormalItem'"> <el-col :span="24"> <el-form-item label="类名"> <el-input @@ -196,7 +195,7 @@ </el-form-item> </el-col> </el-row> <el-row v-if="dataForm.itemtypename === 'NormalItem'"> <el-row :gutter="8" v-if="dataForm.itemtypename === 'NormalItem'"> <el-col :span="12"> <el-form-item label="方法名"> <el-input @@ -220,13 +219,13 @@ <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="" label="值" align="center"> <el-table-column prop="" label="值" align="center" min-width="150"> <template #default="scope"> <el-input v-model="scope.row.value" maxlength="256" style="width:100%;height:100%"/> <el-input size="mini" v-model="scope.row.value" maxlength="256" style="width:100%;height:100%"/> </template> </el-table-column> </el-table> <el-divider content-position="left" v-if="dataForm.itemtypename === 'NormalItem'">输入参数 </el-divider> <el-table @@ -238,14 +237,13 @@ <el-table-column prop="modelparamorder" label="序号" width="60" align="center"/> <el-table-column prop="" label="类型" width="200" align="center"> <template #default="scope"> <el-select v-model="scope.row.modelparamtype" @change="changeModelparamtype(value, scope.row)" placeholder="请选择"> <el-select v-model="scope.row.modelparamtype" placeholder="请选择"> <el-option v-for="item in dataForm.modelparamtypeList" :key="item" :label="item" :value="item"/> v-for="dict in getStrDictOptions(DICT_TYPE.MODEL_PARAM_TYPE)" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select> </template> </el-table-column> @@ -359,23 +357,25 @@ </Dialog> </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 DmModule from '@/api/model/pre/dm' import * as MmResultTable from '@/api/model/pre/result' import * as DaPoint from '@/api/data/da/point' import * as ScheduleModelApi from '@/api/model/sche/model' import {useUpload} from '@/api/model/pre/predict' const {uploadUrl, httpRequest} = useUpload() defineOptions({name: 'DataMmPredictItemForm'}) const {t} = useI18n() // 国际化 const message = useMessage() // 消息弹窗 const dialogVisible = ref(false) // 弹窗的是否展示 const pointLoading = ref(false) // 弹窗的是否展示 const dialogTitle = ref('') // 弹窗的标题 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 const formType = ref('') // 表单的类型:create - 新增;update - 修改 const uploadModelUrl = '' const pointLoading = ref(false) const itemTypeList = ref([]) const itemTypeMap = ref({}) const moduleList = ref([]) @@ -387,40 +387,18 @@ const predictList = ref([]) const predictItemList = ref([]) const modelparamList = ref([]) const modelparamListMap = ref([]) const modelparamListMap = ref({}) const modelparamMap = ref({}) const expressionList = ref([]) const fileList = ref([]) const operatorList = ['+', '-'] const replaceModelOnly = ref(0) const replaceModelOnly = ref(false) const queryParams = reactive({ pageNo: 1, pageSize: 10, pointNo: undefined, pointName: undefined, }) const isList = ref([ { code: 0, name: '否' }, { code: 1, name: '是' }]) /*const saveIndexList = ref([ { code: '2', name: 'T+2' }, { code: '30', name: 'T+30' }, { code: 'n', name: 'T+n' }])*/ const dataForm = ref({ id: undefined, itemtypename: undefined, @@ -431,11 +409,11 @@ caltypeid: undefined, itemtypeid: undefined, predictlength: undefined, granularity: undefined, granularity: 60, status: undefined, isfuse: undefined, predictphase: undefined, workchecked: '', workchecked: 0, unittransfactor: undefined, saveindex: undefined }, @@ -443,7 +421,7 @@ id: undefined, moduleid: undefined, itemid: undefined, itemorder: undefined, itemorder: 1, status: undefined, categoryid: undefined }, @@ -481,13 +459,27 @@ expression: undefined, num: undefined }, modelparamtypeList: ['DATAPOINT', 'PREDICTITEM', 'DAYWORKPROCESSPLAN', 'MONTHWORKPROCESSPLAN', 'ST_PLAN_NQ', 'ST_PLAN_BQ', 'ST_PLAN_NQ_HI', 'ST_PLAN_BQ_HI'], mmModelArithSettingsList: [], mmModelParamList: [] }) const formRules = reactive({ // itemno: [{required: true, message: '编号不能为空', trigger: 'blur'}], // itemname: [{required: true, message: '预测项名不能为空', trigger: 'blur'}], 'mmPredictItem.itemname': [{required: true, message: '预测项名不能为空', trigger: 'blur'}], 'mmPredictItem.itemtypeid': [{required: true, message: '类型不能为空', trigger: 'blur'}], 'dataForm.mmPredictItem.granularity': [{ required: true, message: '粒度不能为空', trigger: 'blur' }], 'dataForm.mmPredictItem.workchecked': [{ required: true, message: '是否检查不能为空', trigger: 'blur' }], 'dataForm.mmPredictItem.status': [{required: true, message: '是否启用不能为空', trigger: 'blur'}], 'dataForm.dmModuleItem.moduleid': [{required: true, message: '管网不能为空', trigger: 'blur'}], 'dataForm.dmModuleItem.itemorder': [{required: true, message: '排序不能为空', trigger: 'blur'}], 'dataForm.mmItemOutput.pointid': [{required: true, message: '数据点不能为空', trigger: 'blur'}], }) const formRef = ref() // 表单 Ref @@ -497,7 +489,6 @@ dialogTitle.value = t('action.' + type) formType.value = type dataForm.value.itemtypename = itemtypename || 'NormalItem' console.info(dataForm.value.itemtypename) // resetForm() resetFields(dataForm.value) setDefaultFields() @@ -511,7 +502,6 @@ if (id) { formLoading.value = true try { debugger getInfo(id) } finally { formLoading.value = false @@ -531,7 +521,6 @@ formLoading.value = true try { const data = dataForm.value as unknown as MmPredictItem.MmPredictItemVO debugger if (expressionList.value && expressionList.value.length > 0) { let expression = '' for (let i = 0; i < expressionList.value.length; i++) { @@ -624,7 +613,7 @@ if (response.code === 0) { message.success(t('上传成功')) dataForm.value.mmModelArithSettingsList = [] if (!replaceModelOnly) { if (!replaceModelOnly.value) { dataForm.value.mmModelParamList = [] } dataForm.value.mmPredictModel.modelpath = '' @@ -641,6 +630,7 @@ } }) } dataForm.value.mmPredictModel.modelname = response.data.originalFilename dataForm.value.mmPredictModel.classname = response.data.className dataForm.value.mmPredictModel.methodname = response.data.methodName if (response.data.paramPathList) { @@ -649,7 +639,7 @@ if (response.data.paramsArray) { dataForm.value.mmPredictModel.modelparamstructure = response.data.paramsArray.join(',') } if (response.data.paramsCount && !replaceModelOnly) { if (response.data.paramsCount && !replaceModelOnly.value) { for (let i = 0; i < response.data.paramsCount; i++) { dataForm.value.mmModelParamList.push({ modelparamportorder: (i + 1), @@ -680,7 +670,6 @@ function changeItemtype(value) { dataForm.value.itemtypename = itemTypeMap[value] console.info(dataForm.value.itemtypename) } function changeModelparamtype(value, row) { @@ -807,42 +796,6 @@ }) modelparamListMap['PREDICTITEM'] = paramList; } /*const dayParams = { 'processType': '日计划' } let dayScheduleRes = await ScheduleModelApi.getScheduleWorkPrecessList(dayParams) paramList = [] if (dayScheduleRes !== null) { dayScheduleRes.forEach(function (value) { paramList.push({ id: value.id, code: value.code, name: value.aliasName, type: 'DAYWORKPROCESSPLAN' }) modelparamMap[value.id] = value.aliasName }) modelparamListMap['DAYWORKPROCESSPLAN'] = paramList; } const monthParams = { 'processType': '月计划' } let monthScheduleRes = await ScheduleModelApi.getScheduleWorkPrecessList(monthParams) paramList = [] if (monthScheduleRes !== null) { monthScheduleRes.forEach(function (value) { paramList.push({ id: value.id, code: value.code, name: value.aliasName, type: 'MONTHWORKPROCESSPLAN' }) modelparamMap[value.id] = value.aliasName }) modelparamListMap['MONTHWORKPROCESSPLAN'] = paramList; }*/ } const setDefaultFields = () => { @@ -866,11 +819,10 @@ } /** 重置表单 */ /*const resetForm = () => { const resetForm = () => { dataForm.value = { mmModelArithSettingsList: [], mmModelParamList: [], modelparamtypeList: [], id: '', itemtypename: '', mmPredictItem: { @@ -880,11 +832,11 @@ caltypeid: '', itemtypeid: '', predictlength: '', granularity: '', granularity: 60, status: '', isfuse: '', predictphase: '', workchecked: '', workchecked: 0, unittransfactor: '', saveindex: '' }, @@ -892,7 +844,7 @@ id: '', moduleid: '', itemid: '', itemorder: '', itemorder: 1, status: 1, categoryid: '' }, @@ -932,7 +884,7 @@ } } formRef.value?.resetFields() }*/ } onMounted(() => { init() src/views/model/pre/item/index.vue
@@ -52,21 +52,36 @@ <ContentWrap> <el-table v-loading="loading" :data="list"> <el-table-column label="编号" align="center" prop="itemno"/> <el-table-column label="预测项名" align="center" prop="itemname"/> <!-- <el-table-column label="类型ID" align="center" prop="itemtypeid" />--> <el-table-column label="类型名称" align="center" prop="itemtypename"/> <el-table-column label="粒度" align="center" prop="granularity"/> <el-table-column label="是否融合" align="center" prop="isfuse"/> <el-table-column label="是否检查" align="center" prop="workchecked"/> <!-- <el-table-column label="模块ID" align="center" prop="moduleid" />--> <!-- <el-table-column label="排序" align="center" prop="itemorder" />--> <el-table-column label="是否启用" align="center" prop="status"/> <!-- <el-table-column label="类别ID" align="center" prop="categoryid" />--> <!-- <el-table-column label="数据点ID" align="center" prop="pointid" />--> <el-table-column label="预测项名" header-align="center" align="left" min-width="200" prop="itemname"/> <el-table-column label="类型名称" align="center" prop="itemtypename"> <template #default="scope"> <el-tag v-if="scope.row.itemtypename === 'NormalItem'" size="small" type="success">{{scope.row.itemtypename}}</el-tag> <el-tag v-else size="small" type="primary">{{scope.row.itemtypename}}</el-tag> </template> </el-table-column> <el-table-column label="预测长度" align="center" prop="predictlength"/> <el-table-column label="粒度" align="center" prop="granularity"> <template #default="scope"> <dict-tag :type="DICT_TYPE.TIME_GRANULARITY" :value="scope.row.granularity" /> </template> </el-table-column> <el-table-column label="是否融合" align="center" prop="isfuse"> <template #default="scope"> <dict-tag :type="DICT_TYPE.COM_IS_INT" :value="scope.row.isfuse" /> </template> </el-table-column> <el-table-column label="是否检查" align="center" prop="workchecked"> <template #default="scope"> <dict-tag :type="DICT_TYPE.COM_IS_INT" :value="scope.row.workchecked" /> </template> </el-table-column> <el-table-column label="是否启用" align="center" prop="status"> <template #default="scope"> <dict-tag :type="DICT_TYPE.COM_IS_INT" :value="scope.row.status" /> </template> </el-table-column> <el-table-column label="数据点名称" align="center" prop="tagname"/> <!-- <el-table-column label="存放表ID" align="center" prop="resulttableid" />--> <el-table-column label="存放表" align="center" prop="tablename"/> <el-table-column label="操作" align="center" min-width="110" fixed="right"> <template #default="scope"> <el-button @@ -104,6 +119,7 @@ <script lang="ts" setup> import MmPredictItemForm from './MmPredictItemForm.vue' import * as MmPredictItem from '@/api/model/pre/predict' import {DICT_TYPE} from "@/utils/dict"; defineOptions({name: 'DataMmPredictItem'})