Parcourir la source

Merge branch 'main' of http://192.168.1.224:10880/IOT/hvac-web

wangshun il y a 2 mois
Parent
commit
79c5f242e8

+ 1 - 0
src/i18n/locales/zh.json

@@ -143,6 +143,7 @@
   "navigation": {
     "deviceList": "设备列表",
     "deviceManage": "设备管理",
+    "envMonitor": "环境监控",
     "gatewayList": "网关列表",
     "gatewayManage": "网关管理",
     "gatewayProtocol": "网关协议管理",

+ 21 - 0
src/router/index.ts

@@ -41,6 +41,27 @@ const routes: Readonly<RouteRecordRaw[]> = [
       },
     ],
   },
+  {
+    path: '/env-monitor',
+    redirect: '/env-monitor/index',
+    component: HvacLayout,
+    meta: {
+      title: 'envMonitor',
+      icon: 'setting',
+      hideSubMenu: true,
+      requiresAuth: true,
+    },
+    children: [
+      {
+        path: 'index',
+        name: 'envMonitor',
+        component: () => import('@/views/env-monitor/EnvMonitor.vue'),
+        meta: {
+          requiresAuth: true,
+        },
+      },
+    ],
+  },
   {
     path: '/protocol-manage',
     name: 'protocolManage',

+ 3 - 0
src/views/env-monitor/AreaEditor.vue

@@ -0,0 +1,3 @@
+<template>
+  <div>区域编辑器</div>
+</template>

+ 3 - 0
src/views/env-monitor/EnvMonitor.vue

@@ -0,0 +1,3 @@
+<template>
+  <div>环境监控</div>
+</template>

+ 2 - 18
src/views/setup-protocol/CreateProtocol.vue

@@ -35,7 +35,7 @@ const finish = async () => {
   if (props.form.protocolInfo.id) {
     await updateProtocolBaseInfo(props.form.protocolInfo);
   } else {
-    await addProtocolBaseInfo(props.form.protocolInfo);
+    props.form.protocolInfo.id = await addProtocolBaseInfo(props.form.protocolInfo);
   }
 
   await completeProtocolConfig(props.form.protocolInfo.id as number);
@@ -49,22 +49,6 @@ defineExpose<UseGuideStepItemExpose>({
 
 <template>
   <div>
-    <div class="result-header">
-      <div class="use-guide-title">{{ $t('setupProtocol.createProtocol') }}</div>
-    </div>
-    <ProtocolContent class="result-protocol" ref="protocolContent" :info="form.protocolInfo" />
+    <ProtocolContent ref="protocolContent" :info="form.protocolInfo" />
   </div>
 </template>
-
-<style lang="scss" scoped>
-.result-header {
-  display: flex;
-  justify-content: space-between;
-  width: calc(62% + 17px);
-  margin-bottom: 36px;
-}
-
-.result-protocol {
-  margin: 0 17px;
-}
-</style>

+ 12 - 13
src/views/setup-protocol/RecognitionResult.vue

@@ -2,6 +2,7 @@
 import { onMounted, useTemplateRef } from 'vue';
 import { message } from 'ant-design-vue';
 
+import SvgIcon from '@/components/SvgIcon.vue';
 import { useRequest } from '@/hooks/request';
 import { t } from '@/i18n';
 import { completeProtocolConfig, downloadUserProtocol, getProtocolBaseInfo, updateProtocolBaseInfo } from '@/api';
@@ -60,24 +61,22 @@ defineExpose<UseGuideStepItemExpose>({
 </script>
 
 <template>
-  <div>
-    <div class="result-header">
-      <div class="use-guide-title">{{ $t('setupProtocol.recognitionResult') }}</div>
-      <AButton @click="reRecognize">{{ $t('setupProtocol.reRecognize') }}</AButton>
-    </div>
-    <ProtocolContent class="result-protocol" ref="protocolContent" :info="form.protocolInfo" />
+  <div class="result-container">
+    <AButton class="icon-button recognize-button" @click="reRecognize">
+      <SvgIcon name="reload" />
+      {{ $t('setupProtocol.reRecognize') }}
+    </AButton>
+    <ProtocolContent ref="protocolContent" :info="form.protocolInfo" />
   </div>
 </template>
 
 <style lang="scss" scoped>
-.result-header {
-  display: flex;
-  justify-content: space-between;
-  width: calc(62% + 17px);
-  margin-bottom: 36px;
+.result-container {
+  position: relative;
 }
 
-.result-protocol {
-  margin: 0 17px;
+.recognize-button {
+  position: absolute;
+  top: -103px;
 }
 </style>

+ 10 - 5
src/views/setup-protocol/SelectStandardParams.vue

@@ -3,6 +3,7 @@ import { ref, watch } from 'vue';
 import { message } from 'ant-design-vue';
 import { debounce } from 'lodash-es';
 
+import SvgIcon from '@/components/SvgIcon.vue';
 import { useRequest } from '@/hooks/request';
 import { useViewVisible } from '@/hooks/view-visible';
 import { t } from '@/i18n';
@@ -147,7 +148,11 @@ defineExpose({
             :placeholder="$t('setupProtocol.plzEnterParamOrCode')"
             allow-clear
             @change="handleParamNameOrCodeChange"
-          />
+          >
+            <template #prefix>
+              <SvgIcon name="search-o" :size="12" color="#B2B2B2" />
+            </template>
+          </AInput>
         </div>
         <ATable
           :data-source="paramList"
@@ -184,14 +189,14 @@ defineExpose({
       <div class="params-selected">
         <div class="params-selected-header">
           <span class="params-label">{{ $t('setupProtocol.selectedParams') }} ({{ selectedParamIds.length }})</span>
-          <div @click="clearSelectedParams">clear</div>
+          <SvgIcon class="cursor-pointer" name="delete" :size="21" color="#F56C6C" @click="clearSelectedParams" />
         </div>
         <div class="params-selected-list">
           <div class="params-selected-item" v-for="item in selectedParams" :key="item.id">
             <div class="ellipsis-text params-selected-item-label" :title="item.paramName">
               {{ item.paramName }}
             </div>
-            <div class="params-selected-item-delete" @click="removeSelectedParam(item)">x</div>
+            <SvgIcon class="params-selected-item-delete" name="close-circle-o" @click="removeSelectedParam(item)" />
           </div>
         </div>
       </div>
@@ -274,7 +279,7 @@ defineExpose({
 }
 
 .params-selected-item-delete {
-  width: 16px;
-  height: 16px;
+  font-size: 16px;
+  color: var(--antd-color-text-secondary);
 }
 </style>