From eeddc808a8d6428bfd1c2d6e21e4a71f5e9bdbef Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期五, 13 十二月 2024 10:41:25 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/model/mpk/project/index.vue | 14 ++++--- src/api/model/mpk/project.ts | 7 ++- src/views/model/pre/item/index.vue | 39 ++++++++++++++----- src/views/model/sche/model/index.vue | 8 +++- src/api/data/da/point/index.ts | 5 ++ src/api/model/pre/item/index.ts | 2 + src/views/model/mpk/file/index.vue | 17 ++++++-- src/views/model/mpk/project/ProjectPackage.vue | 4 - src/views/model/sche/model/ScheduleModelForm.vue | 2 src/views/data/point/DaPointForm.vue | 17 +++++++- 10 files changed, 84 insertions(+), 31 deletions(-) diff --git a/src/api/data/da/point/index.ts b/src/api/data/da/point/index.ts index 366f331..3d48aa6 100644 --- a/src/api/data/da/point/index.ts +++ b/src/api/data/da/point/index.ts @@ -34,6 +34,11 @@ return request.get({ url: '/data/da/point/list', params }) } +// 查询DaPoint simpleList +export const getPointSimpleList = (params: DaPointPageReqVO) => { + return request.get({ url: '/data/da/point/simple-list', params }) +} + // 查询DaPoint详情 export const getDaPoint = (id: number) => { return request.get({ url: `/data/da/point/info/${id}`}) diff --git a/src/api/model/mpk/project.ts b/src/api/model/mpk/project.ts index 514b05b..33f1cf6 100644 --- a/src/api/model/mpk/project.ts +++ b/src/api/model/mpk/project.ts @@ -1,6 +1,6 @@ import request from '@/config/axios' -export const getPage = async (params: PageParam) => { +export const getPage = async (params) => { return await request.get({ url: '/model/mpk/project/page', params }) } @@ -21,13 +21,14 @@ } export const packageProject = (params) => { - return request.download({ url: '/model/mpk/file/packageModel', params }) + // 超时时间两分钟 + return request.download({ url: '/model/mpk/file/packageModel', params, timeout: 2 * 60 * 1000 }) } export const list = () => { return request.get({ url: '/model/mpk/project/list'}) } -export const getProjectModel = async (params: PageParam) => { +export const getProjectModel = async (params) => { return await request.get({ url: '/model/mpk/project/getProjectModel', params }) } diff --git a/src/api/model/pre/item/index.ts b/src/api/model/pre/item/index.ts index e27d8c4..7fe814d 100644 --- a/src/api/model/pre/item/index.ts +++ b/src/api/model/pre/item/index.ts @@ -69,6 +69,8 @@ export interface MmPredictItemPageReqVO extends PageParam { itemno?: string, itemname?: string, + itemtypeid?: string, + modulename?: string, } // 查询MmPredictItem列表 diff --git a/src/views/data/point/DaPointForm.vue b/src/views/data/point/DaPointForm.vue index 12536e0..5a1682b 100644 --- a/src/views/data/point/DaPointForm.vue +++ b/src/views/data/point/DaPointForm.vue @@ -292,7 +292,7 @@ filterable placeholder="请选择"> <el-option - v-for="(item, index) in pointList" + v-for="(item, index) in pointList2" :key="index" :label="item.pointName" :value="item.pointNo"/> @@ -326,6 +326,7 @@ import * as DaPoint from '@/api/data/da/point' import * as TagApi from '@/api/data/channel/tag' import {DICT_TYPE, getDictOptions, getIntDictOptions} from "@/utils/dict"; +import {getPointSimpleList} from "@/api/data/da/point"; defineOptions({name: 'DataDaPointForm'}) @@ -343,6 +344,13 @@ }]) const queryParams = reactive({ pointTypes: "MEASURE,CONSTANT", +}) +const pointList2 = ref([{ + pointName: '', + pointNo: '' +}]) +const queryParams2 = reactive({ + pointTypes: "MEASURE,CONSTANT,CALCULATE", }) const operatorList = ref(['+', '-', '*', '/', '&', '|', '!', '>', '<']) const formData = ref({ @@ -405,6 +413,7 @@ resetForm() getSourceOption() getPointList() + getPointList2() // 修改时,设置数据 if (id) { formLoading.value = true @@ -574,7 +583,11 @@ } const getPointList = async () => { - pointList.value = await DaPoint.getPointList(queryParams) + pointList.value = await DaPoint.getPointSimpleList(queryParams) +} + +const getPointList2 = async () => { + pointList2.value = await DaPoint.getPointSimpleList(queryParams2) } const getInfo = async (id) => { diff --git a/src/views/model/mpk/file/index.vue b/src/views/model/mpk/file/index.vue index 666a1f4..a3d2bde 100644 --- a/src/views/model/mpk/file/index.vue +++ b/src/views/model/mpk/file/index.vue @@ -24,10 +24,18 @@ label-width="68px" @submit.prevent > - <el-form-item label="模型名称" prop="pyName"> + <el-form-item label="模型名称" prop="pyChineseName"> + <el-input + v-model="queryParams.pyChineseName" + placeholder="请输入模型名称" + clearable + class="!w-240px" + /> + </el-form-item> + <el-form-item label="模型文件" prop="pyName"> <el-input v-model="queryParams.pyName" - placeholder="请输入模型名称" + placeholder="请输入模型文件名称" clearable class="!w-240px" /> @@ -59,8 +67,8 @@ :data="list" row-key="id" > - <el-table-column prop="pyChineseName" label="模型名称" header-align="center" align="center" min-width="100" /> - <el-table-column prop="pyName" label="模型文件" header-align="center" align="center" min-width="300"/> + <el-table-column prop="pyChineseName" label="模型名称" header-align="center" align="left" min-width="100" /> + <el-table-column prop="pyName" label="模型文件" header-align="center" align="left" min-width="300"/> <el-table-column prop="pyType" label="模型类型" :formatter="(r,c,v) => getDictLabel(DICT_TYPE.MODEL_TYPE,v)"/> <el-table-column prop="menuName" label="所属菜单" min-width="120px"/> <el-table-column prop="groupName" label="所属组" min-width="120px"/> @@ -148,6 +156,7 @@ const queryParams = reactive({ page: 1, limit: 10, + pyChineseName: '', pyName: '', label: '' }) diff --git a/src/views/model/mpk/project/ProjectPackage.vue b/src/views/model/mpk/project/ProjectPackage.vue index 3034300..8a48684 100644 --- a/src/views/model/mpk/project/ProjectPackage.vue +++ b/src/views/model/mpk/project/ProjectPackage.vue @@ -57,17 +57,15 @@ projectId: undefined, projectName: undefined, projectCode: undefined, - ids: undefined, version: undefined, }) /** 打开弹窗 */ - const open = async (projectId,projectName,projectCode,ids) => { + const open = async (projectId,projectName,projectCode) => { dialogVisible.value = true formData.projectId = projectId formData.projectName = projectName formData.projectCode = projectCode - formData.ids = ids formData.log = undefined formData.version = 'V' } diff --git a/src/views/model/mpk/project/index.vue b/src/views/model/mpk/project/index.vue index e7d90ba..7bc116d 100644 --- a/src/views/model/mpk/project/index.vue +++ b/src/views/model/mpk/project/index.vue @@ -133,6 +133,7 @@ import ProjectForm from './ProjectForm.vue' import ProjectPackage from './ProjectPackage.vue' import RelevanceModel from './ProjectPackageModelDialog.vue' + import * as projectApi from "@/api/model/mpk/project"; defineOptions({name: 'MpkProject'}) @@ -165,7 +166,7 @@ const handleCommand = (command: string, row) => { switch (command) { case 'packageModel': - packageModel(row.id, row.projectName, row.projectCode, row.models) + packageModel(row.id, row.projectName, row.projectCode) break default: break @@ -174,13 +175,14 @@ //打包 const projectPackageRef = ref(); - const packageModel = (projectId, projectName, projectCode, models) => { - let ids = models.map(e => e.id); - if (ids && ids.length > 0) { - projectPackageRef.value.open(projectId, projectName, projectCode, ids.join(",")); - } else { + const packageModel = async (projectId, projectName, projectCode) => { + //校验是否关联模型 + const data = await projectApi.getProjectModel({page: 1, pageSize: 1, projectId: projectId}) + if (data.total === 0) { message.error("请先为项目添加模型!") + return } + projectPackageRef.value.open(projectId, projectName, projectCode); } /** 搜索按钮操作 */ diff --git a/src/views/model/pre/item/index.vue b/src/views/model/pre/item/index.vue index 185ec8b..c1b6f60 100644 --- a/src/views/model/pre/item/index.vue +++ b/src/views/model/pre/item/index.vue @@ -27,6 +27,28 @@ class="!w-240px" /> </el-form-item> + <el-form-item label="类型" prop="itemtypeid"> + <el-select + v-model="queryParams.itemtypeid" + placeholder="请选择" + clearable + class="!w-240px"> + <el-option + v-for="item in itemTypeList" + :key="item.id" + :label="item.itemtypename" + :value="item.id"/> + </el-select> + </el-form-item> + <el-form-item label="管网名称" prop="modulename"> + <el-input + v-model="queryParams.modulename" + placeholder="请输入管网名称" + clearable + @keyup.enter="handleQuery" + class="!w-240px" + /> + </el-form-item> <el-form-item> <el-button @click="handleQuery"> <Icon icon="ep:search" class="mr-5px"/> @@ -66,16 +88,7 @@ <dict-tag :type="DICT_TYPE.PRED_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="modulename" /> <el-table-column label="是否启用" align="center" prop="status"> <template #default="scope"> <dict-tag :type="DICT_TYPE.COM_IS_INT" :value="scope.row.status" /> @@ -131,6 +144,7 @@ <script lang="ts" setup> import MmPredictItemForm from './MmPredictItemForm.vue' import MmPredictItemChart from './MmPredictItemChart.vue' +import * as MmItemType from '@/api/model/pre/type' import * as MmPredictItem from '@/api/model/pre/item' import {DICT_TYPE} from "@/utils/dict"; @@ -139,6 +153,7 @@ const message = useMessage() // 消息弹窗 const {t} = useI18n() // 国际化 +const itemTypeList = ref([]) const loading = ref(true) // 列表的加载中 const total = ref(0) // 列表的总页数 const list = ref([]) // 列表的数据 @@ -147,6 +162,8 @@ pageSize: 10, itemno: undefined, itemname: undefined, + itemtypeid: undefined, + modulename: undefined, }) const isList = ref([ { @@ -213,5 +230,7 @@ /** 初始化 **/ onMounted(async () => { await getList() + // 获取预测项类型列表 + itemTypeList.value = await MmItemType.getItemTypeList() }) </script> diff --git a/src/views/model/sche/model/ScheduleModelForm.vue b/src/views/model/sche/model/ScheduleModelForm.vue index da93fe9..d9b6aa1 100644 --- a/src/views/model/sche/model/ScheduleModelForm.vue +++ b/src/views/model/sche/model/ScheduleModelForm.vue @@ -57,7 +57,7 @@ <el-row> <el-col :span="12"> <el-form-item label="模型名称" prop="modelName"> - <el-input v-model="formData.modelName" placeholder="请输入模型名称" :disabled="true" /> + <el-input v-model="formData.modelName" placeholder="请输入模型名称"/> </el-form-item> </el-col> <el-col :span="12"> diff --git a/src/views/model/sche/model/index.vue b/src/views/model/sche/model/index.vue index 87b3cd1..ae84a63 100644 --- a/src/views/model/sche/model/index.vue +++ b/src/views/model/sche/model/index.vue @@ -52,8 +52,12 @@ <ContentWrap> <el-table v-loading="loading" :data="list"> <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="模型名称" header-align="center" align="left" prop="modelName" min-width="100"/> + <el-table-column label="模型类型" align="center" prop="modelType" min-width="100"> + <template #default="scope"> + <dict-tag :type="DICT_TYPE.SCHE_MODEL_TYPE" :value="scope.row.modelType" /> + </template> + </el-table-column> <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"/> -- Gitblit v1.9.3