Browse Source

feat: 水质报警增加进出水区分

sunxiao 1 month ago
parent
commit
da1820cb62
3 changed files with 27 additions and 7 deletions
  1. 2 2
      .env.development
  2. 4 3
      src/components/RecodeSquareCardItem/index.vue
  3. 21 2
      src/views/analyse/WaterView.vue

+ 2 - 2
.env.development

@@ -1,5 +1,5 @@
 # 请求地址
-VITE_BASE_URL=http://chat.sequoialibra.com:81/apiServe/
-# VITE_BASE_URL=http://192.168.40.21:8080/
+# VITE_BASE_URL=http://chat.sequoialibra.com:81/apiServe/
+VITE_BASE_URL=http://192.168.40.21:8080/
 # 请求前缀
 VITE_BASE_PREFIX='' 

+ 4 - 3
src/components/RecodeSquareCardItem/index.vue

@@ -1,5 +1,5 @@
 <script setup>
-import { ref, computed } from 'vue';
+import { computed } from 'vue';
 import { NEllipsis } from "naive-ui";
 import { BaseButton, SvgIcon } from '@/components';
 import { truncateDecimals } from '@/utils/format';
@@ -65,8 +65,9 @@ const dataSources = computed(() => {
     return [
       { label: '报警时间', value: item.time },
       { label: '报警值',  value: truncateDecimals(item.warningVal), type: 'wraning', unit: 'mg/L' },
-      { label: '报警级别', value: item.level },
-      { label: '报警次数', value: item.counts },
+      // { label: '报警级别', value: item.level },
+      { label: '报警类型', value: item.symbolDesc },
+      { label: '持续时间', value: item.counts },
     ]
   }
   if (item.type == 1) {

+ 21 - 2
src/views/analyse/WaterView.vue

@@ -1,7 +1,7 @@
 <script setup lang="jsx">
-import { ref } from 'vue';
+import { ref, watch } from 'vue';
 import { useRouter } from 'vue-router';
-import { NTabs, NTab } from 'naive-ui';
+import { NTabs, NTab, NSelect } from 'naive-ui';
 import { useChatStore } from '@/stores/modules/chatStore';
 import { BaseTable, ChatWelcome, RecodeSquareCardItem, TheSubMenu, TheChatView } from "@/components";
 import { useInfinite, useRecommend, useFetchStream, useScroll } from '@/composables';
@@ -45,6 +45,19 @@ const visible = ref(false);
 
 const modalData = ref({});
 
+// 菜单水数据类型
+const waterTypeValue = ref('');
+
+const options = [
+  { label: '全部', value: '' },
+  { label: '进水', value: 0 },
+  { label: '出水', value: 1 }
+]
+
+watch(() => waterTypeValue.value, curValue => {
+  onRestore({ warningStatus: warningActive.value, waterType: curValue });
+})
+
 const handleModelVisible = () => {
   visible.value = true;
 } 
@@ -387,6 +400,9 @@ const handleWelcomeRecommend = question => {
             <n-tab name="oasis" tab="正在报警" @click="onChangeTabs(0)"></n-tab>
             <n-tab name="thebeatles" tab="历史报警" @click="onChangeTabs(1)"></n-tab>
           </n-tabs>
+          <div class="select-card">
+            <n-select v-model:value="waterTypeValue" :options="options" size="tiny"/>
+          </div>
         </div>
       </template>
 
@@ -555,4 +571,7 @@ const handleWelcomeRecommend = question => {
     }
   }
 }
+.select-card {
+  padding: 15px 10px 0 10px;
+}
 </style>