ソースを参照

电视墙 资源详情

wangzhe 2 年 前
コミット
8f5a43c871
3 ファイル変更110 行追加7 行削除
  1. 8 0
      src/api/datacenter.js
  2. 29 1
      src/components/TVWalls.vue
  3. 73 6
      src/views/datacenter.vue

+ 8 - 0
src/api/datacenter.js

@@ -41,3 +41,11 @@ export function fireControlViewPoint(type, name,deptId) {
     method: 'get'
   })
 }
+
+//根据表名及ID查询资源详情
+export function getResourceDetail(type, resourceId) {
+  return request({
+    url: '/sooka-middleware/visual/getResourceDetail?type='+type+'&id='+resourceId,
+    method: 'get'
+  })
+}

+ 29 - 1
src/components/TVWalls.vue

@@ -30,6 +30,11 @@
             <h4>电话:{{user.phone}}</h4>
           </div>
         </div>
+        <div class="leader-info-container" v-if="resourceDataShow">
+          <div class="leader-info-list-con" >
+            <h4 style="" v-for="resource in resourceData">{{resource.key}}:{{resource.value}}</h4>
+          </div>
+        </div>
       </div>
     </el-dialog>
   </div>
@@ -203,7 +208,9 @@ export default {
       pubKey: '',
       oWebControl: null,
       userData:[],
+      resourceData:[],
       userDataShow:false,
+      resourceDataShow:false,
     }
   },
   created() {
@@ -225,7 +232,7 @@ export default {
           })
       }
     },
-    showTVWall(data, val, item) {
+    showTVWall(data, val, item, resourceData) {
       selectConfigKey("DssVersion").then(res => {
         if(this.ws.getLocalDssVersion()!=res.data){
           this.$modal.confirm('系统检测到新客户端版本,请更新后使用', '系统提示', {
@@ -246,6 +253,27 @@ export default {
             this.userData = item;
             this.userDataShow = true;
           }
+          if(resourceData != null){
+            let myCollection = [];
+            Object.keys(resourceData).forEach((k) => {
+              // console.log("k=", k)
+              myCollection.push({
+                key: k,
+                value: resourceData[k]?resourceData[k]:'无'
+                // eval("("+'{'+k+' : resourceData[k]}'+")")
+              });
+            });
+            // console.log("myCollection=", myCollection);
+            // for (let i = 0; i < resourceData.length; i++) {
+            //   console.log("resourceData=", resourceData[i])
+            // }
+            this.resourceData = myCollection;
+            this.userDataShow = false;
+            this.resourceDataShow = true;
+          }else {
+            this.resourceDataShow = false;
+          }
+
           this.tvListJson = data
           this.data = val
           this.autoList = []

+ 73 - 6
src/views/datacenter.vue

@@ -98,12 +98,14 @@
       <vBottomMenu ref="bottomMenu"></vBottomMenu>
     </div>
     <eventLocation ref="eventLocation"></eventLocation>
-    <TVWall ref="TVWall"></TVWall>
+    <!--<TVWall ref="TVWall"></TVWall>-->
+    <TVWalls ref="TVWalls"></TVWalls>
   </div>
 </template>
 
 <script>
 import {
+  getResourceDetail,
   fireControlViewList,
   fireControlViewPoint,
 } from "@/api/datacenter";
@@ -113,6 +115,7 @@ import vheader from "@/components/v-header.vue"; //一体化共用头部
 import vBottomMenu from "@/components/vBottomMenu.vue"; //一体化公共底部菜单
 import eventLocation from "@/components/eventLocation.vue"; //事件定位弹窗
 import TVWall from "@/components/TVWall.vue"; //电视墙弹窗
+import TVWalls from "@/components/TVWalls.vue"; //电视墙弹窗
 import { getIconBg } from "@/api/components/sookaMapIcon";
 import {getUserProfile} from "@/api/system/user";
 import { Button } from '@/dahua/TVWalllib/iview' //资源底色控制文件
@@ -127,6 +130,7 @@ export default {
     vBottomMenu,
     eventLocation,
     TVWall,
+    TVWalls,
   },
   created() {
     /** ----------------------------------底部按钮公用组件开始------------------------------------- */
@@ -660,7 +664,7 @@ export default {
       return markersMap;
     },
     sewageOutletClick(data) {
-      console.log(data);
+      console.log("data=", data);
       const params = Object.assign({});
       params.longitude = data.longitude;
       params.latitude = data.latitude;
@@ -675,7 +679,68 @@ export default {
         },
       ];
       const labelChannels = [];
-      for (let i in data.cameraList) {
+      const id = data.id;
+      const type = data.indexName;
+      // alert(type+"="+id)
+      // alert(data.indexName)
+      // getResourceDetail("centerdata_t_resources_illegal_construction", id).then(res => {
+      getResourceDetail(type, id).then(res => {
+        console.log("getResourceDetail=", res)
+        // for (let i in data.cameraList) {
+        data.cameraList = res.data.cameras;
+        for (let i in data.cameraList) {
+          treeLabels.push({
+            id: null,
+            labelCode: data.cameraList[i].cameraCode,
+            labelName: data.cameraList[i].cameraName,
+            cameraType: data.cameraList[i].cameraType,
+            parentLabelCode: "999",
+          });
+          labelChannels.push({
+            labelCode: data.cameraList[i].cameraCode,
+            channelDates: [
+              {
+                channelCode: data.cameraList[i].cameraCode,
+                channelName: data.cameraList[i].cameraName,
+                channelSn: null,
+                cameraType: data.cameraList[i].cameraType,
+                online: "1",
+                cameraCode: "1",
+              },
+            ],
+          });
+        }
+        const dianshiqiang = [
+          {
+            switchTab: "2",
+            treeLabels: treeLabels,
+            labelChannels: labelChannels,
+          },
+        ];
+        if (data.cameraList.length > 0) {
+          // this.$refs.TVWall.showTVWall1(
+          //   data.longitude,
+          //   data.latitude,
+          //   dianshiqiang
+          // );
+          this.$refs.TVWalls.showTVWall(
+            dianshiqiang,
+            {
+              longitude: data.longitude,
+              latitude: data.latitude,
+            },
+            {
+              "修改人":"MC",
+              "修改人":"MC",
+              "修改人":"MC",
+              "修改人":"MC",
+              "修改人":"MC"
+            },
+            res.data.detail // item
+          );
+        }
+      });
+      /*for (let i in data.cameraList) {
         treeLabels.push({
           id: null,
           labelCode: data.cameraList[i].cameraCode,
@@ -704,13 +769,15 @@ export default {
           labelChannels: labelChannels,
         },
       ];
-      if (data.cameraList.length > 0) {
-        this.$refs.TVWall.showTVWall1(
+      // if (data.cameraList.length > 0) {
+      if (data.longitude != "" && data.latitude != "") {
+        // this.$refs.TVWall.showTVWall1(
+        this.$refs.TVWalls.showTVWall(
           data.longitude,
           data.latitude,
           dianshiqiang
         );
-      }
+      }*/
     },
     indentleftByDeptIdSetMarkers(deptId) {
       this.listCurrentIndex = deptId;