From d5207d8eaff6188ae0d79c07de17d0b8dbaed65a Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期一, 06 一月 2025 11:45:14 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/model/pre/item/index.vue |   88 +++++++++++++++++++++++++++++++++++---------
 1 files changed, 70 insertions(+), 18 deletions(-)

diff --git a/src/views/model/pre/item/index.vue b/src/views/model/pre/item/index.vue
index 84cac42..883fe9d 100644
--- a/src/views/model/pre/item/index.vue
+++ b/src/views/model/pre/item/index.vue
@@ -7,6 +7,7 @@
       ref="queryFormRef"
       :inline="true"
       label-width="68px"
+      @submit.prevent
     >
       <el-form-item label="编号" prop="itemno">
         <el-input
@@ -21,6 +22,28 @@
         <el-input
           v-model="queryParams.itemname"
           placeholder="请输入预测项名"
+          clearable
+          @keyup.enter="handleQuery"
+          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"
@@ -51,23 +74,34 @@
   <!-- 列表 -->
   <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="数据点名称" 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">
+      <el-table-column label="编号" align="center" min-width="150" prop="itemno"/>
+      <el-table-column label="预测项名" header-align="center" align="left" min-width="200" prop="itemname"/>
+      <el-table-column label="类型名称" align="center" min-width="120" 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="预测长度(min)" align="center" prop="predictlength"/>
+      <el-table-column label="粒度" align="center" prop="granularity">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.PRED_GRANULARITY" :value="scope.row.granularity" />
+        </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" />
+        </template>
+      </el-table-column>
+      <el-table-column label="运行时间" min-width="150" align="center" prop="lastTime"/>
+      <el-table-column label="运行状态" align="center" prop="runStatus">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.ITEM_RUN_STATUS" :value="scope.row.runStatus || 200" />
+        </template>
+      </el-table-column>
+      <el-table-column label="运行耗时(ms)" align="center" prop="duration"/>
+      <el-table-column label="操作" align="center" min-width="120" fixed="right">
         <template #default="scope">
           <el-button
             link
@@ -77,6 +111,7 @@
           >
             编辑
           </el-button>
+          <el-button link type="primary" @click="chartHandle(scope.row)">数据</el-button>
           <el-button
             link
             type="danger"
@@ -100,16 +135,23 @@
   <!-- 表单弹窗:添加/修改 -->
   <MmPredictItemForm ref="formRef" @success="getList"/>
 
+  <!-- 表单弹窗:数据 -->
+  <MmPredictItemChart ref="chartView" @success="getList"/>
+
 </template>
 <script lang="ts" setup>
 import MmPredictItemForm from './MmPredictItemForm.vue'
-import * as MmPredictItem from '@/api/model/pre/predict'
+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";
 
 defineOptions({name: 'DataMmPredictItem'})
 
 const message = useMessage() // 消息弹窗
 const {t} = useI18n() // 国际化
 
+const itemTypeList = ref([])
 const loading = ref(true) // 列表的加载中
 const total = ref(0) // 列表的总页数
 const list = ref([]) // 列表的数据
@@ -118,6 +160,8 @@
   pageSize: 10,
   itemno: undefined,
   itemname: undefined,
+  itemtypeid: undefined,
+  modulename: undefined,
 })
 const isList = ref([
   {
@@ -155,6 +199,12 @@
   handleQuery()
 }
 
+/** 查看数据操作 */
+const chartView  = ref()
+const chartHandle = (raw: object) => {
+  chartView.value.open(raw)
+}
+
 /** 添加/修改操作 */
 const formRef = ref()
 const openForm = (type: string, id?: number, itemtypename?: string) => {
@@ -178,5 +228,7 @@
 /** 初始化 **/
 onMounted(async () => {
   await getList()
+  // 获取预测项类型列表
+  itemTypeList.value = await MmItemType.getItemTypeList()
 })
 </script>

--
Gitblit v1.9.3