From 3affb8887f5eff7d3c12f919aac7fe57da3a0f03 Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期六, 18 一月 2025 11:57:26 +0800
Subject: [PATCH] 计算预测项 表达式数据异常判定bug

---
 src/views/model/pre/item/index.vue |   40 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/src/views/model/pre/item/index.vue b/src/views/model/pre/item/index.vue
index 0d2e89f..8bf49b6 100644
--- a/src/views/model/pre/item/index.vue
+++ b/src/views/model/pre/item/index.vue
@@ -27,6 +27,19 @@
           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"
@@ -35,6 +48,20 @@
           @keyup.enter="handleQuery"
           class="!w-240px"
         />
+      </el-form-item>
+      <el-form-item label="运行状态" prop="runStatus">
+        <el-select
+          v-model="queryParams.runStatus"
+          placeholder="请选择"
+          clearable
+          class="!w-240px">
+          <el-option
+            v-for="dict in getIntDictOptions(DICT_TYPE.ITEM_RUN_STATUS)"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
       </el-form-item>
       <el-form-item>
         <el-button @click="handleQuery">
@@ -84,7 +111,7 @@
       <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" />
+          <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"/>
@@ -93,17 +120,15 @@
           <el-button
             link
             type="primary"
-            size="mini"
             @click="openForm('update', scope.row.id, scope.row.itemtypename)"
             v-hasPermi="['model:pre-item:update']"
           >
             编辑
           </el-button>
-          <el-button link size="mini" type="primary" @click="chartHandle(scope.row)">数据</el-button>
+          <el-button link type="primary" @click="chartHandle(scope.row)">数据</el-button>
           <el-button
             link
             type="danger"
-            size="mini"
             @click="handleDelete(scope.row.id)"
             v-hasPermi="['model:pre-item:delete']"
           >
@@ -131,14 +156,16 @@
 <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";
+import {DICT_TYPE, getIntDictOptions} 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([]) // 列表的数据
@@ -147,6 +174,7 @@
   pageSize: 10,
   itemno: undefined,
   itemname: undefined,
+  itemtypeid: undefined,
   modulename: undefined,
 })
 const isList = ref([
@@ -214,5 +242,7 @@
 /** 初始化 **/
 onMounted(async () => {
   await getList()
+  // 获取预测项类型列表
+  itemTypeList.value = await MmItemType.getItemTypeList()
 })
 </script>

--
Gitblit v1.9.3