Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

xu 7 hónapja
szülő
commit
1f88932240

+ 3 - 0
web/src/api/device.js

@@ -7,6 +7,7 @@ export const queryAllDevices = () => {
   })
 }
 
+// 获取设备列表
 export const queryDeviceList = (data) => {
   return service({
     url: '/device/queryDeviceList',
@@ -82,3 +83,5 @@ export const deleteDeviceGenre = (id) => {
     method: 'delete'
   })
 }
+
+

+ 17 - 0
web/src/view/admin/device/device.vue

@@ -192,6 +192,12 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item label="设备图标">
+          <icon
+            :meta="iconData"
+            style="width: 100%"
+          />
+        </el-form-item>
       </el-form>
       <template #footer>
         <div class="dialog-footer">
@@ -524,6 +530,7 @@ import {
   updateDeviceGenre
 } from '@/api/device'
 import { queryAllTunnels } from '@/api/tunnel'
+import icon from '@/view/superAdmin/menu/icon.vue'
 
 // 搜索条件
 const deviceSearch = ref({
@@ -779,6 +786,16 @@ const deviceDelete = (val) => {
     })
 }
 
+// 图标
+const iconData = reactive({
+  activeName: '',
+  title: '',
+  icon: '',
+  defaultMenu: false,
+  closeTab: false,
+  keepAlive: false,
+})
+
 onMounted(() => {
   getData()
 })

+ 29 - 21
web/src/view/screen/dataDashboard.vue

@@ -22,20 +22,26 @@
             <div
               v-for="item in deviceTypeList"
               :key="item.id"
-              class="deviceOption"
+              class="deviceOptionRow"
             >
-              <div class="deviceOption">
+              <div
+                v-for="item2 in item"
+                :key="item2.ID"
+                class="deviceOption"
+              >
                 <div style="width: 35px;height: 35px">
                   <img
-                      :src="item.url"
-                      style="width: 35px;height: 35px"
-                      alt=""
+                    :src="item.url"
+                    style="width: 35px;height: 35px"
+                    alt=""
                   >
                 </div>
                 <el-text
-                    style="padding-top: 8px;color: #ffffff"
-                    size="small"
-                >{{ item.label + item.value }}</el-text>
+                  style="padding-top: 8px;color: #ffffff"
+                  size="small"
+                >
+                  1/0
+                </el-text>
               </div>
             </div>
           </div>
@@ -119,7 +125,7 @@ import Map from '@/view/screen/components/map.vue'
 import * as echarts from 'echarts'
 import { useScreenStore } from '@/pinia/modules/screen'
 import { queryTunnelList } from '@/api/tunnel'
-import { queryAllDevices, queryAllDeviceGenres } from '@/api/device'
+import { queryAllDeviceGenres } from '@/api/device'
 
 const useScreen = useScreenStore()
 
@@ -152,9 +158,6 @@ onMounted(() => {
       loadingLamp(lampData.envData)
     }
   })
-  queryAllDevices().then(res => {
-    console.log('res', res)
-  })
   queryAllDeviceGenres().then(res => {
     if (res.code === 0) {
       const result = []
@@ -359,7 +362,7 @@ watch(() => useScreen.currentTunnel, (newValue) => {
     width: 20%;
     height: 1200px;
     .deviceSummary {
-      height: 150px;
+      height: 240px;
       .boxShape;
       .deviceSummary_title {
         width: 370px;
@@ -372,16 +375,21 @@ watch(() => useScreen.currentTunnel, (newValue) => {
       }
       .deviceOptionBox {
         width: 370px;
-        height: 120px;
-        display: flex;
+        height: 190px;
         margin-top: 20px;
-        .deviceOption {
-          width: 90px;
+        .deviceOptionRow {
+          width: 100%;
           height: 60px;
           display: flex;
-          flex-direction: column;
-          align-items: center;
-          color: #ffffff;
+          margin-top: 20px;
+          .deviceOption {
+            width: 90px;
+            height: 60px;
+            display: flex;
+            flex-direction: column;
+            align-items: center;
+            color: #ffffff;
+          }
         }
       }
     }
@@ -400,7 +408,7 @@ watch(() => useScreen.currentTunnel, (newValue) => {
       }
     }
     .warn {
-      height: 470px;
+      height: 400px;
       margin-top: 20px;
       .boxShape;
       .warnTitle {