| | |
| | | import request from '@/config/axios' |
| | | import {UploadRequestOptions} from "element-plus/es/components/upload/src/upload"; |
| | | |
| | | export interface MmItemTypeVO { |
| | | id: string |
| | | export interface MmPredictItemVO { |
| | | id: string, |
| | | itemtypename: string, |
| | | itemclasstype: string, |
| | | assemblyname: string |
| | | mmPredictItem: { |
| | | id: string, |
| | | itemno: string, |
| | | itemname: string, |
| | | caltypeid: string, |
| | | itemtypeid: string, |
| | | predictlength: string, |
| | | granularity: number, |
| | | status: string, |
| | | isfuse: number, |
| | | predictphase: string, |
| | | workchecked: number, |
| | | unittransfactor: string, |
| | | saveindex: string |
| | | }, |
| | | dmModuleItem: { |
| | | id: string, |
| | | moduleid: string, |
| | | itemid: string, |
| | | itemorder: number, |
| | | status: number, |
| | | categoryid: string |
| | | }, |
| | | mmItemOutput: { |
| | | id: string, |
| | | itemid: string, |
| | | pointid: string, |
| | | resulttableid: string, |
| | | tagname: string, |
| | | outputorder: number |
| | | }, |
| | | mmPredictModel: { |
| | | id: string, |
| | | modelno: string, |
| | | modelname: string, |
| | | itemid: string, |
| | | arithid: string, |
| | | trainsamplength: number, |
| | | predictsamplength: string, |
| | | isonlinetrain: string, |
| | | modelpath: string, |
| | | isnormal: string, |
| | | normalmax: string, |
| | | normalmin: string, |
| | | status: number, |
| | | classname: string, |
| | | methodname: string, |
| | | modelparamstructure: string, |
| | | resultstrid: string, |
| | | settingmap: string |
| | | }, |
| | | mmPredictMergeItem: { |
| | | id: string, |
| | | itemid: string, |
| | | expression: string, |
| | | num: string |
| | | }, |
| | | modelparamtypeList: [], |
| | | mmModelArithSettingsList: [], |
| | | mmModelParamList: [] |
| | | } |
| | | |
| | | export interface MmItemTypePageReqVO extends PageParam { |
| | | itemtypename?: string |
| | | export interface MmPredictItemPageReqVO extends PageParam { |
| | | itemno?: string, |
| | | itemname?: string, |
| | | } |
| | | |
| | | // 查询MmItemType列表 |
| | | export const getMmItemTypePage = (params: MmItemTypePageReqVO) => { |
| | | return request.get({ url: '/model/pre/item-type/page', params }) |
| | | // 查询MmPredictItem列表 |
| | | export const getMmPredictItemPage = (params: MmPredictItemPageReqVO) => { |
| | | return request.get({ url: '/model/pre/item/page', params }) |
| | | } |
| | | |
| | | // 查询MmItemType详情 |
| | | export const getMmItemType = (id: number) => { |
| | | return request.get({ url: `/model/pre/item-type/get/${id}`}) |
| | | // 查询MmPredictItem详情 |
| | | export const getMmPredictItem = (id: number) => { |
| | | return request.get({ url: `/model/pre/item/get/${id}`}) |
| | | } |
| | | |
| | | // 新增MmItemType |
| | | export const createMmItemType = (data: MmItemTypeVO) => { |
| | | return request.post({ url: '/model/pre/item-type/create', data }) |
| | | // 新增MmPredictItem |
| | | export const createMmPredictItem = (data: MmPredictItemVO) => { |
| | | return request.post({ url: '/model/pre/item/create', data }) |
| | | } |
| | | |
| | | // 修改MmItemType |
| | | export const updateMmItemType = (data: MmItemTypeVO) => { |
| | | return request.put({ url: '/model/pre/item-type/update', data }) |
| | | // 修改MmPredictItem |
| | | export const updateMmPredictItem = (data: MmPredictItemVO) => { |
| | | return request.put({ url: '/model/pre/item/update', data }) |
| | | } |
| | | |
| | | // 删除MmItemType |
| | | export const deleteMmItemType = (id: number) => { |
| | | return request.delete({ url: '/model/pre/item-type/delete?id=' + id }) |
| | | // 删除MmPredictItem |
| | | export const deleteMmPredictItem = (id: number) => { |
| | | return request.delete({ url: '/model/pre/item/delete?id=' + id }) |
| | | } |
| | | |
| | | // 查询MmPredictItem列表 |
| | | export const getMmPredictItemList = (params) => { |
| | | return request.get({ url: `/model/pre/item/list`, params}) |
| | | } |
| | | |
| | | // 查询getItemTypeList详情 |
| | | export const getItemTypeList = () => { |
| | | return request.get({ url: `/model/pre/item-type/list`}) |
| | | 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 |
| | | } |
| | | } |
| | | |
| | | export const getMmPredictItemTree = () => { |
| | | return request.get({ url: `/model/pre/item/tree`}) |
| | | } |
| | | |
| | | export const getViewCharts = (params) => { |
| | | return request.get({ url: `/model/pre/item/view-charts`,params}) |
| | | } |
对比新文件 |
| | |
| | | import request from '@/config/axios' |
| | | |
| | | export interface MmItemTypeVO { |
| | | id: string |
| | | itemtypename: string, |
| | | itemclasstype: string, |
| | | assemblyname: string |
| | | } |
| | | |
| | | export interface MmItemTypePageReqVO extends PageParam { |
| | | itemtypename?: string |
| | | } |
| | | |
| | | // 查询MmItemType列表 |
| | | export const getMmItemTypePage = (params: MmItemTypePageReqVO) => { |
| | | return request.get({ url: '/model/pre/item-type/page', params }) |
| | | } |
| | | |
| | | // 查询MmItemType详情 |
| | | export const getMmItemType = (id: number) => { |
| | | return request.get({ url: `/model/pre/item-type/get/${id}`}) |
| | | } |
| | | |
| | | // 新增MmItemType |
| | | export const createMmItemType = (data: MmItemTypeVO) => { |
| | | return request.post({ url: '/model/pre/item-type/create', data }) |
| | | } |
| | | |
| | | // 修改MmItemType |
| | | export const updateMmItemType = (data: MmItemTypeVO) => { |
| | | return request.put({ url: '/model/pre/item-type/update', data }) |
| | | } |
| | | |
| | | // 删除MmItemType |
| | | export const deleteMmItemType = (id: number) => { |
| | | return request.delete({ url: '/model/pre/item-type/delete?id=' + id }) |
| | | } |
| | | |
| | | |
| | | // 查询getItemTypeList详情 |
| | | export const getItemTypeList = () => { |
| | | return request.get({ url: `/model/pre/item-type/list`}) |
| | | } |
| | |
| | | import request from '@/config/axios' |
| | | import * as DataPointApi from '@/api/data/da/point' |
| | | import * as PredictItemApi from '@/api/model/pre/predict' |
| | | import * as PredictItemApi from '@/api/model/pre/item' |
| | | import {CommonEnabled} from "@/utils/constants"; |
| | | |
| | | export interface ScheduleModelVO { |
| | |
| | | MODEL_METHOD_SETTING_TYPE = 'model_method_setting_type', |
| | | MODEL_METHOD_SETTING_VALUE_TYPE = 'model_method_setting_value_type', |
| | | PRED_GRANULARITY = 'pred_granularity', |
| | | ITEM_RUN_STATUS = 'item_run_status', |
| | | |
| | | // ========== DATA - 数据平台模块 ========== |
| | | DATA_FIELD_TYPE = 'data_field_type', |
| | |
| | | import * as CategoryApi from "@/api/data/ind/category"; |
| | | import * as DmModule from '@/api/model/pre/dm' |
| | | import * as ItemApi from "@/api/data/ind/item/item"; |
| | | import * as MmPredictItem from '@/api/model/pre/predict' |
| | | import * as MmPredictItem from '@/api/model/pre/item' |
| | | import * as echarts from "echarts"; |
| | | import { onMounted, ref } from 'vue'; |
| | | import { Search, ArrowLeft, ArrowRight,} from '@element-plus/icons-vue' |
| | |
| | | :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" |
| | |
| | | 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> |
| | |
| | | <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> |
| | |
| | | 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" |
| | |
| | | </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() |
| | |
| | | resetForm() |
| | | resetFields(dataForm.value) |
| | | setDefaultFields() |
| | | // 修改时,设置数据 |
| | | if (id) { |
| | | formLoading.value = true |
| | | try { |
| | | getInfo(id) |
| | | } finally { |
| | | /*formLoading.value = false*/ |
| | | } |
| | | } |
| | | |
| | | // 加载参数列表 |
| | | modelparamListMap.value = await ScheduleModelApi.getModelParamList() |
| | |
| | | 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() |
| | |
| | | // 获取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) { |
| | |
| | | }) |
| | | } |
| | | |
| | | // 修改时,设置数据 |
| | | if (id) { |
| | | formLoading.value = true |
| | | try { |
| | | getInfo(id) |
| | | } finally { |
| | | /*formLoading.value = false*/ |
| | | } |
| | | } |
| | | formLoading.value = false |
| | | } |
| | | defineExpose({open}) // 提供 open 方法,用于打开弹窗 |
| | |
| | | |
| | | 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 |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="运行时间" align="center" prop="lastTime"/> |
| | | <el-table-column label="运行状态" align="center" prop="runStatus"/> |
| | | <el-table-column label="运行耗时" align="center" prop="duration"/> |
| | | <el-table-column label="运行状态" align="center" prop="runStatus"> |
| | | <template #default="scope"> |
| | | <dict-tag :type="DICT_TYPE.ITEM_RUN_STATUS" :value="scope.row.runStatus" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="运行耗时(s)" align="center" prop="duration"/> |
| | | <el-table-column label="操作" align="center" min-width="120" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button |
| | |
| | | <script lang="ts" setup> |
| | | import MmPredictItemForm from './MmPredictItemForm.vue' |
| | | import MmPredictItemChart from './MmPredictItemChart.vue' |
| | | import * as MmPredictItem from '@/api/model/pre/predict' |
| | | import * as MmPredictItem from '@/api/model/pre/item' |
| | | import {DICT_TYPE} from "@/utils/dict"; |
| | | |
| | | defineOptions({name: 'DataMmPredictItem'}) |
| | |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as MmItemType from '@/api/model/pre/item' |
| | | import * as MmItemType from '@/api/model/pre/type' |
| | | |
| | | defineOptions({name: 'DataMmItemTypeForm'}) |
| | | |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import MmItemTypeForm from './ItemTypeForm.vue' |
| | | import * as MmItemType from '@/api/model/pre/item' |
| | | import * as MmItemType from '@/api/model/pre/type' |
| | | |
| | | defineOptions({name: 'DataMmItemType'}) |
| | | |