From a9402174968dab48d2232cc39690cd69839b431c Mon Sep 17 00:00:00 2001
From: forevertyler <1318719240@qq.com>
Date: Wed, 2 Apr 2025 13:35:19 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E6=B0=B4=E4=BD=8D=E5=8E=86=E5=8F=B2?=
 =?UTF-8?q?=E3=80=81=E6=8A=A5=E8=AD=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/api/tyler/waterLevelAlarm.js              |  19 +++
 src/api/tyler/waterLevelHis.js                |  19 +++
 src/views/drainage/drainageDev/index.vue      |   2 +-
 .../index.vue                                 |  97 ++++++++------
 src/views/drainage/waterLevelHis/index.vue    | 120 ++++++++++++++++++
 .../drainage/waterPumpSwitchHis/index.vue     |   3 +
 6 files changed, 221 insertions(+), 39 deletions(-)
 create mode 100644 src/api/tyler/waterLevelAlarm.js
 create mode 100644 src/api/tyler/waterLevelHis.js
 rename src/views/drainage/{waterPumpHis copy => waterLevelAlarm}/index.vue (60%)
 create mode 100644 src/views/drainage/waterLevelHis/index.vue

diff --git a/src/api/tyler/waterLevelAlarm.js b/src/api/tyler/waterLevelAlarm.js
new file mode 100644
index 0000000..ffa3c6a
--- /dev/null
+++ b/src/api/tyler/waterLevelAlarm.js
@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+
+// 鏌ヨ姘存车鍘嗗彶淇℃伅鍒楄〃
+export function listSumpAlarmHistory(query) {
+  return request({
+    url: '/business/sump/alarm/history/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 鏌ヨ姘存车鍘嗗彶淇℃伅鎵€鏈夊垪琛�
+export function listAllSumpHistory(query) {
+  return request({
+    url: '/business/pump/history/listAll',
+    method: 'get',
+    params: query
+  })
+}
\ No newline at end of file
diff --git a/src/api/tyler/waterLevelHis.js b/src/api/tyler/waterLevelHis.js
new file mode 100644
index 0000000..4ad06e3
--- /dev/null
+++ b/src/api/tyler/waterLevelHis.js
@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+
+// 鏌ヨ姘存车鍘嗗彶淇℃伅鍒楄〃
+export function listSumpHistory(query) {
+  return request({
+    url: '/business/sump/history/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 鏌ヨ姘存车鍘嗗彶淇℃伅鎵€鏈夊垪琛�
+export function listAllSumpHistory(query) {
+  return request({
+    url: '/business/pump/history/listAll',
+    method: 'get',
+    params: query
+  })
+}
\ No newline at end of file
diff --git a/src/views/drainage/drainageDev/index.vue b/src/views/drainage/drainageDev/index.vue
index 06fd7fe..9303d69 100644
--- a/src/views/drainage/drainageDev/index.vue
+++ b/src/views/drainage/drainageDev/index.vue
@@ -110,7 +110,7 @@
           <el-input v-model="form.deviceName" placeholder="璇疯緭鍏ヨ澶囧悕绉�" />
         </el-form-item>
         <el-form-item label="璁惧缂栧彿" prop="deviceId">
-          <el-input v-model="form.deviceId" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" />
+          <el-input :disabled="disabledType" v-model="form.deviceId" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" />
         </el-form-item>
         
         <el-form-item label="璁惧瀹夎浣嶇疆" prop="installationLocation">
diff --git a/src/views/drainage/waterPumpHis copy/index.vue b/src/views/drainage/waterLevelAlarm/index.vue
similarity index 60%
rename from src/views/drainage/waterPumpHis copy/index.vue
rename to src/views/drainage/waterLevelAlarm/index.vue
index bcfab42..36442ca 100644
--- a/src/views/drainage/waterPumpHis copy/index.vue	
+++ b/src/views/drainage/waterLevelAlarm/index.vue
@@ -1,8 +1,8 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="" prop="pumpName">
-        <el-select v-model="queryParams.pumpName" placeholder="姘存车鍚嶇О" clearable>
+      <el-form-item label="" prop="sumpName">
+        <el-select v-model="queryParams.sumpName" placeholder="璁惧鍚嶇О" clearable>
           <el-option
             v-for="dict in devList"
             :key="dict.name"
@@ -20,19 +20,30 @@
       </el-form-item>
     </el-form>
 
-    
-
     <el-table v-loading="loading" :data="historyList" @selection-change="handleSelectionChange">
-      <el-table-column label="姘存车鍚嶇О" align="center" prop="pumpName" />
-      <el-table-column label="姘存车缂栧彿" align="center" prop="pumpId" />
-      <el-table-column label="鐢垫満鐢垫祦" align="center" prop="motorCurrent" />
-      <el-table-column label="鐢垫満杞存壙娓╁害" align="center" prop="motorBearingTemp" />
-      <el-table-column label="姘存车杞存壙娓╁害" align="center" prop="pumpBearingTemp" />
-      <el-table-column label="姘存车娴侀噺" align="center" prop="pumpFlow" />
-      <el-table-column label="鎺掓按绠¤矾鍘嬪姏" align="center" prop="drainagePressure" />
-      <el-table-column label="鐩戞祴鏃堕棿" align="center" prop="monitoringTime" width="180">
+      <el-table-column label="璁惧鍚嶇О" align="center" prop="sumpName" />
+      <el-table-column label="璁惧缂栧彿" align="center" prop="sumpId" />
+      <el-table-column label="璁惧瀹夎浣嶇疆" align="center" prop="installationLocation" />
+      <el-table-column label="娑蹭綅楂樺害(m)" align="center" prop="heghtThreshold" />
+      <el-table-column label="鎶ヨ鏃堕棿" align="center" prop="alarmTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.alarmTime) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="鐘舵€�" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.monitoringTime) }}</span>
+          <el-button
+            type="primary"
+            @click="handleUpdate(scope.row)"
+            v-if="scope.row.status==1"
+          >澶勭疆</el-button>
+          <span v-else>宸插缃�</span>
+       
+        </template>
+      </el-table-column>
+      <el-table-column label="瑙i櫎鎶ヨ鏃堕棿" align="center" prop="delAlarmTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.delAlarmTime) }}</span>
         </template>
       </el-table-column>
     </el-table>
@@ -44,12 +55,27 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
-    
+    <!-- 娣诲姞鎴栦慨鏀规帓姘磋澶囦俊鎭璇濇 -->
+    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="140px">
+        <el-form-item label="瑙i櫎鍘熷洜" prop="delAlarmResion">
+          <el-input type="textarea" v-model="form.delAlarmResion" placeholder="璇疯緭鍏ヨВ闄ゅ師鍥�" />
+        </el-form-item>
+        <el-form-item label="瑙i櫎鎶ヨ鏃堕暱(h)" prop="time">
+          <el-input v-model="form.time" placeholder="璇疯緭鍏ヨВ闄ゆ姤璀︽椂闀�(h)" />
+        </el-form-item>
+   
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
+        <el-button @click="cancel">鍙� 娑�</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-  import {getHistory, listHistory} from "@/api/tyler/waterPumpHis";
+  import {listSumpAlarmHistory, updateWarterPumpAlarmHis} from "@/api/tyler/waterLevelAlarm";
   import {draDeviceName} from "@/api/tyler/common";
 
   export default {
@@ -70,7 +96,7 @@
       showSearch: true,
       // 鎬绘潯鏁�
       total: 0,
-      // 姘存车鍘嗗彶淇℃伅琛ㄦ牸鏁版嵁
+      // 璁惧鍘嗗彶淇℃伅琛ㄦ牸鏁版嵁
       historyList: [],
       // 寮瑰嚭灞傛爣棰�
       title: "",
@@ -80,8 +106,8 @@
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        pumpId: null,
-        pumpName: null,
+        sumpId: null,
+        sumpName: null,
         motorCurrent: null,
         motorBearingTemp: null,
         pumpBearingTemp: null,
@@ -99,16 +125,16 @@
     };
   },
   created() {
-    draDeviceName({typeId:1}).then(res => {
+    draDeviceName({typeId:2}).then(res => {
       this.devList = res.data;
     })
     this.getList();
   },
   methods: {
-    /** 鏌ヨ姘存车鍘嗗彶淇℃伅鍒楄〃 */
+    /** 鏌ヨ璁惧鍘嗗彶淇℃伅鍒楄〃 */
     getList() {
       this.loading = true;
-      listHistory(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+      listSumpAlarmHistory(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
         this.historyList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -123,14 +149,8 @@
     reset() {
       this.form = {
         id: null,
-        pumpId: null,
-        pumpName: null,
-        motorCurrent: null,
-        motorBearingTemp: null,
-        pumpBearingTemp: null,
-        pumpFlow: null,
-        drainagePressure: null,
-        monitoringTime: null
+        delAlarmResion:null,
+        time:null,
       };
       this.resetForm("form");
     },
@@ -155,24 +175,25 @@
     handleAdd() {
       this.reset();
       this.open = true;
-      this.title = "娣诲姞姘存车鍘嗗彶淇℃伅";
+      this.title = "娣诲姞璁惧鍘嗗彶淇℃伅";
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
       this.reset();
-      const id = row.id || this.ids
-      getHistory(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "淇敼姘存车鍘嗗彶淇℃伅";
-      });
+      this.form.id = row.id;
+      this.open = true;
+      // getHistory(id).then(response => {
+      //   this.form = response.data;
+      //   this.open = true;
+      //   this.title = "淇敼璁惧鍘嗗彶淇℃伅";
+      // });
     },
     /** 鎻愪氦鎸夐挳 */
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
-            updateHistory(this.form).then(response => {
+            updateWarterPumpAlarmHis(this.form).then(response => {
               this.$modal.msgSuccess("淇敼鎴愬姛");
               this.open = false;
               this.getList();
@@ -190,7 +211,7 @@
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('鏄惁纭鍒犻櫎姘存车鍘嗗彶淇℃伅缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() {
+      this.$modal.confirm('鏄惁纭鍒犻櫎璁惧鍘嗗彶淇℃伅缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() {
         return delHistory(ids);
       }).then(() => {
         this.getList();
diff --git a/src/views/drainage/waterLevelHis/index.vue b/src/views/drainage/waterLevelHis/index.vue
new file mode 100644
index 0000000..6860090
--- /dev/null
+++ b/src/views/drainage/waterLevelHis/index.vue
@@ -0,0 +1,120 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="" prop="sumpName">
+        <el-select v-model="queryParams.sumpName" placeholder="璁惧鍚嶇О" clearable>
+          <el-option
+            v-for="dict in devList"
+            :key="dict.value"
+            :label="dict.name"
+            :value="dict.name"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="">
+        <el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="寮€濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡"></el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="historyList">
+      <el-table-column label="璁惧鍚嶇О" align="center" prop="sumpName" />
+      <el-table-column label="璁惧缂栧彿" align="center" prop="sumpId" />
+      <el-table-column label="璁惧瀹夎浣嶇疆" align="center" prop="installationLocation" />
+      <el-table-column label="娑蹭綅楂樺害锛坢锛�" align="center" prop="heghtThreshold" />
+      <el-table-column label="鐩戞祴鏃堕棿" align="center" prop="time" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.time) }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+    
+  </div>
+</template>
+
+<script>
+  import {getHistory, listSumpHistory} from "@/api/tyler/waterLevelHis";
+  import {draDeviceName} from "@/api/tyler/common";
+
+  export default {
+  name: "History",
+  data() {
+    return {
+      // 鏍硅矾寰�
+      baseURL: process.env.VUE_APP_BASE_API,
+      // 閬僵灞�
+      loading: true,
+      // 閫変腑鏁扮粍
+      ids: [],
+      // 闈炲崟涓鐢�
+      single: true,
+      // 闈炲涓鐢�
+      multiple: true,
+      // 鏄剧ず鎼滅储鏉′欢
+      showSearch: true,
+      // 鎬绘潯鏁�
+      total: 0,
+      // 璁惧鍘嗗彶淇℃伅琛ㄦ牸鏁版嵁
+      historyList: [],
+      // 寮瑰嚭灞傛爣棰�
+      title: "",
+      // 鏄惁鏄剧ず寮瑰嚭灞�
+      open: false,
+      // 鏌ヨ鍙傛暟
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        sumpName: null,
+      },
+      // 琛ㄥ崟鍙傛暟
+      form: {},
+      // 琛ㄥ崟鏍¢獙
+      rules: {},
+      // 鏃ユ湡鑼冨洿
+      dateRange: [],
+      devList: [],
+    };
+  },
+  created() {
+    draDeviceName({typeId:2}).then(res => {
+      this.devList = res.data;
+    })
+    this.getList();
+  },
+  methods: {
+    /** 鏌ヨ璁惧鍘嗗彶淇℃伅鍒楄〃 */
+    getList() {
+      this.loading = true;
+      listSumpHistory(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+        this.historyList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    
+   
+    /** 鎼滅储鎸夐挳鎿嶄綔 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 閲嶇疆鎸夐挳鎿嶄綔 */
+    resetQuery() {
+      this.dateRange = []
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+  }
+};
+</script>
diff --git a/src/views/drainage/waterPumpSwitchHis/index.vue b/src/views/drainage/waterPumpSwitchHis/index.vue
index e69de29..59b9d8a 100644
--- a/src/views/drainage/waterPumpSwitchHis/index.vue
+++ b/src/views/drainage/waterPumpSwitchHis/index.vue
@@ -0,0 +1,3 @@
+<template>
+  <div class="app-container">鏆傛棤</div>
+</template>
\ No newline at end of file
-- 
2.22.0