From d782070a1cdddf68d1b71e8e5dffb84f24543968 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 17 十二月 2025 15:56:47 +0800
Subject: [PATCH] 最新版本541200007

---
 admin/src/api/business/warning.js                                                                                   |    3 
 admin/src/components/common/Tree.vue                                                                                |   10 +-
 server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/PageRegionInfoResponse.java |    4 
 server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/HkSyncCloudController.java                         |   11 ++
 admin/src/views/business/regionDevice.vue                                                                           |  202 ++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 221 insertions(+), 9 deletions(-)

diff --git a/admin/src/api/business/warning.js b/admin/src/api/business/warning.js
index b39ea7f..323cad0 100644
--- a/admin/src/api/business/warning.js
+++ b/admin/src/api/business/warning.js
@@ -20,6 +20,9 @@
 export function regionList (data) {
   return request.post('/visitsAdmin/cloudService/business/hksync/regionList', data)
 }
+export function refreshRegionData (data) {
+  return request.post('/visitsAdmin/cloudService/business/hksync/refreshRegionData', data)
+}
 export function updateStatus (data) {
   return request.post('/visitsAdmin/cloudService/business/warning/updateStatus', data)
 }
diff --git a/admin/src/components/common/Tree.vue b/admin/src/components/common/Tree.vue
index 5d6fd7b..0c68c47 100644
--- a/admin/src/components/common/Tree.vue
+++ b/admin/src/components/common/Tree.vue
@@ -2,9 +2,9 @@
     <div class="tree">
         <div v-for="(item, index) of list" :key="index" @click.stop="clickIten(item)">
             <div class="tree_item">
-                <i class="el-icon-caret-bottom" :class="{ 'activeColor': item.fsStatus === 1 }" v-show="item.fsStatus === 1 && item.childList.length > 0"></i>
-                <i class="el-icon-caret-right color" v-show="item.childList.length > 0 && (item.fsStatus === 0 || !item.fsStatus)"></i>
-                <div class="tree_item_label long-title-style" :title="item.name" :class="{ 'activeColor': item.fsDate === 1 && item.childList.length === 0 }">{{ item.name }}</div>
+                <i class="el-icon-caret-bottom" :class="{ 'activeColor': item.fsStatus === 1 }" v-show="item.fsStatus === 1 && item.childList && item.childList.length > 0"></i>
+                <i class="el-icon-caret-right color" v-show="item.childList && item.childList.length > 0 && (item.fsStatus === 0 || !item.fsStatus)"></i>
+                <div class="tree_item_label long-title-style" :title="item.name" :class="{ 'activeColor': item.fsDate === 1 &&(!item.childList || item.childList.length === 0) }">{{ item.name }}</div>
                 <!--                <i class="el-icon-caret-bottom" :class="{ 'activeColor': item[defaultProps.status] }" v-show="item[defaultProps.status] && item[defaultProps.children]"></i>-->
 <!--                <i class="el-icon-caret-right color" v-show="item[defaultProps.children] && !item[defaultProps.status]"></i>-->
 <!--                <div class="tree_item_label long-title-style" :title="item[defaultProps.name]" :class="{ 'activeColor': item[defaultProps.status] && !item[defaultProps.children] }">{{ item[defaultProps.name] }}</div>-->
@@ -83,7 +83,7 @@
         i.fsDate = 0
       })
       item.fsDate = fsDate
-      if (item.childList.length > 0) {
+      if (item.childList &&item.childList.length > 0) {
         item.fsStatus === 0 || !item.fsStatus ? item.fsStatus = 1 : item.fsStatus = 0
       }
       this.$emit('callback', item, item)
@@ -92,7 +92,7 @@
     recursion (children) {
       children.forEach(item => {
         item.fsDate = 0
-        if (item.childList.length > 0) {
+        if (item.childList && item.childList.length > 0) {
           this.recursion(item.childList)
         }
         // item[this.defaultProps.status] = false
diff --git a/admin/src/views/business/regionDevice.vue b/admin/src/views/business/regionDevice.vue
new file mode 100644
index 0000000..4cc8669
--- /dev/null
+++ b/admin/src/views/business/regionDevice.vue
@@ -0,0 +1,202 @@
+<template>
+  <TableLayout1 class="menu-layout" :permissions="['system:menu:query']">
+    <template v-slot:menu>
+      <div
+          style="width: 100%; height: 50px; background: rgba(242, 242, 242, 1); line-height: 50px; text-align: center; font-size: 14px;">
+        鍖哄煙淇℃伅</div>
+      <div style="width: 100%; height: calc(100vh - 170px); overflow-y: scroll;">
+        <Tree :list="regionList" :defaultProps="{ name: 'name', status: 'fsStatus', children: 'childList', id: 'indexCode' }"  @callback="callback" />
+      </div>
+    </template>
+    <!-- 琛ㄦ牸鍜屽垎椤� -->
+    <template v-slot:table-wrap>
+      <ul class="toolbar" >
+        <li><el-button type="primary"  icon="el-icon-refresh" :loading="isWorking.sort"  @click="refreshRegionData()">鍒锋柊缂撳瓨</el-button></li>
+      </ul>
+      <el-form ref="searchForm" slot="search-form"   label-width="100px" inline>
+        <div class="platgroup_tabs">
+          <div class="tab" :class="{ active: activeGroup === item.id }" @click="groupClick(item)"
+               v-for="(item, i) in groupList" :key="i">
+            {{ item.name }}
+          </div>
+        </div>
+      </el-form>
+      <el-table :height="tableHeightNew" v-loading="isWorking.search" :data="currentList" stripe @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55"></el-table-column>
+        <el-table-column   prop="name" label="璁惧鍚嶇О" min-width="120px">  </el-table-column>
+        <el-table-column prop="indexCode" label="璁惧indexCode" min-width="200px"></el-table-column>
+        <el-table-column prop="regionName" label="鍖哄煙鍚嶇О" min-width="200px"></el-table-column>
+      </el-table>
+      <!--    鏌ョ湅浜哄憳寮�鍗¤褰�    -->
+    </template>
+  </TableLayout1>
+</template>
+
+<script>
+import TableLayout1 from '@/layouts/TableLayout1'
+import BaseTable from '@/components/base/BaseTable'
+import Tree from '@/components/common/Tree'
+import { refreshRegionData, regionList } from '@/api/business/warning'
+export default {
+  name: 'regionDevice',
+  extends: BaseTable,
+  components: { TableLayout1, Tree },
+  data: function () {
+    return {
+      regionList: [],
+      curentReg: {},
+      activeType: 0,
+      activeGroup: 0,
+      currentList: [],
+      groupList: [{ id: 0, name: '鐩戞帶鐐�', type: 0 }, { id: 1, name: '娑堥槻璁惧', type: 1 }, { id: 2, name: '娑堥槻浼犳劅鍣�', type: 2 }],
+      isWorking: {
+        sort: false
+      }
+    }
+  },
+  methods: {
+    currentDataList () {
+      this.currentList = []
+      if (this.activeGroup === 0) {
+        this.currentList = this.curentReg.carmeraList || []
+      } else if (this.activeGroup === 1) {
+        this.currentList = this.curentReg.deviceList || []
+      } else if (this.activeGroup === 2) {
+        this.currentList = this.curentReg.sensorList || []
+      }
+    },
+    groupClick (item) {
+      this.activeGroup = item.id
+      this.activeType = item.type
+      this.currentDataList()
+      this.handlePageChange()
+    },
+    // 鏌ヨ鏁版嵁
+    handlePageChange () {
+    },
+    // 鎺掑簭
+    refreshRegionData () {
+      if (this.isWorking.sort) {
+        return
+      }
+      this.isWorking.sort = true
+      refreshRegionData({})
+        .then(() => {
+          this.loadRegions()
+          this.$tip.apiSuccess('鍒锋柊鎴愬姛锛�')
+        })
+        .catch(e => {
+          this.$tip.apiFailed(e)
+        })
+        .finally(() => {
+          this.isWorking.sort = false
+        })
+    },
+    loadRegions () {
+      if (this.isWorking.loading) {
+        return
+      }
+      this.isWorking.loading =true
+      this.regionList = []
+      this.curentReg = {}
+      this.currentList = []
+      regionList(1)
+        .then(res => {
+          if (res && res.length > 0) {
+            res[0].fsStatus = 1
+            this.regionList = res
+            this.curentReg = res[0]
+            this.currentDataList()
+          }
+        }) .catch(e => {
+          })
+          .finally(() => {
+            this.isWorking.loading = false
+          })
+    },
+    getDepartmentTree (tree) {
+      if (tree == null) {
+        return []
+      }
+      return tree.map(item => {
+        const newItem = { ...item }
+        if (newItem) {
+          newItem.children = newItem.childList
+        }
+        if (item.children && item.children.length == 0) {
+          this.$delete(newItem, 'children')
+        } else {
+          newItem.children = this.getDepartmentTree(newItem.children)
+        }
+
+        if (newItem.type === this.searchForm.companyType) {
+          // newItem.disabled =false
+        } else {
+          newItem.disabled = true
+        }
+        return newItem
+      })
+    },
+    callback (row) {
+      console.log(row)
+      this.curentReg = row
+      this.currentDataList()
+    }
+  },
+  created () {
+    this.config({
+      module: '鑿滃崟',
+      api: '/system/menu'
+    })
+    this.loadRegions()
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+@import "@/assets/style/variables.scss";
+.platgroup_tabs {
+  flex: 1;
+  display: flex;
+  border-bottom: 1px solid #dfe2e8;
+
+  .tab {
+    color: #666666;
+    margin-right: 40px;
+    cursor: pointer;
+    padding-bottom: 18px;
+    border-bottom: 2px solid #fff;
+  }
+
+  .active {
+    font-weight: 500;
+    font-size: 15px;
+    color: #222222;
+    border-bottom: 2px solid $primary-color;
+  }
+}
+.menu-layout {
+  /deep/ .table-content {
+    margin-top: 0px;
+  }
+}
+// 鍥炬爣鍒�
+.table-column-icon {
+  // element-ui鍥炬爣
+  i {
+    background-color: $primary-color;
+    opacity: 0.72;
+    font-size: 20px;
+    color: #fff;
+    padding: 4px;
+    border-radius: 50%;
+  }
+  // 鑷畾涔夊浘鏍�
+  [class^="eva-icon-"] {
+    width: 20px;
+    height: 20px;
+    background-size: 16px;
+    vertical-align: middle;
+  }
+}
+</style>
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/HkSyncCloudController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/HkSyncCloudController.java
index 866a8f4..05774d8 100644
--- a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/HkSyncCloudController.java
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/HkSyncCloudController.java
@@ -327,7 +327,8 @@
         }catch (Exception e){
 
         }
-       /* if(result.size()==0){
+        boolean debug =false;
+         if(debug && result.size()==0){
             //------TODO---------娴嬭瘯妯℃嫙鏁版嵁----start-----
             for (int i = 0; i < 5; i++) {
                 PageRegionInfoResponse t = new PageRegionInfoResponse();
@@ -388,9 +389,15 @@
                 result.add(t);
             }
             //------TODO---------娴嬭瘯妯℃嫙鏁版嵁----end-----
-        }*/
+        }
         return ApiResponse.success(result);
     }
+    @ApiOperation("銆愭捣搴枫�戝己鍒跺埛鏂板尯鍩熴�佺洃鎺с�佹秷闃茶澶囩紦瀛�")
+    @PostMapping("/refreshRegionData")
+    public ApiResponse<String > refreshRegionData(HttpServletResponse response, @RequestHeader(Constants.HEADER_USER_TOKEN) String token ){
+        boardService.cacheRegionAndDeviceData( );
+        return ApiResponse.success(null);
+    }
 
 
 
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/PageRegionInfoResponse.java b/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/PageRegionInfoResponse.java
index 981013a..382c4cc 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/PageRegionInfoResponse.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/PageRegionInfoResponse.java
@@ -21,8 +21,8 @@
      private List<PageRegionInfoResponse> childList;
      @ApiModelProperty(value = "鐩戞帶鐐归泦鍚�")
      private    List<CarmeraListVO> carmeraList;
-     @ApiModelProperty(value = "娑堥槻浼犳劅鍣ㄩ泦鍚�")
-     private    List<CarmeraListVO> deviceList;
      @ApiModelProperty(value = "娑堥槻璁惧闆嗗悎")
+     private    List<CarmeraListVO> deviceList;
+     @ApiModelProperty(value = "娑堥槻浼犳劅鍣ㄩ泦鍚�")
      private    List<CarmeraListVO> sensorList;
 }

--
Gitblit v1.9.3