Bläddra i källkod

Merge remote-tracking branch 'origin/visu_traffic' into visu_traffic

wang_xy 2 år sedan
förälder
incheckning
966f13bf3a

+ 15 - 0
src/api/forest.js

@@ -1,5 +1,20 @@
 import request from '@/utils/request'
 
+// 获取绑定的事件类型
+export function getMenuEventType() {
+  return request({
+    url: '/center-traffic/traffic/getMenuEventType',
+    method: 'get',
+  })
+}
+// 获取事件详情
+export function getEventPush(param) {
+  return request({
+    url: '/center-traffic/traffic/getEventPush',
+    method: 'post',
+    data: param
+  })
+}
 // 左侧获取部门信息
 export function getBaseInfo() {
   return request({

+ 11 - 11
src/components/vBottomMenu.vue

@@ -433,17 +433,17 @@
 						icon: 'iconfont sj-icon-clgj',
 						click: 'editableLayers'
 					},
-					{
-						name: '林班',
-						icon: 'iconfont sj-icon-lbzy',
-						click: 'forestban'
-					},
-
-					{
-						name: '林场',
-						icon: 'iconfont sj-icon-lczy',
-						click: 'forestchang'
-					},
+					// {
+					// 	name: '林班',
+					// 	icon: 'iconfont sj-icon-lbzy',
+					// 	click: 'forestban'
+					// },
+          //
+					// {
+					// 	name: '林场',
+					// 	icon: 'iconfont sj-icon-lczy',
+					// 	click: 'forestchang'
+					// },
 					{
 						name: '电视墙',
 						icon: 'el-icon-s-grid',

+ 1 - 0
src/store/getters.js

@@ -7,6 +7,7 @@ const getters = {
   token: state => state.user.token,
   avatar: state => state.user.avatar,
   name: state => state.user.name,
+  userId: state => state.user.id,
   introduction: state => state.user.introduction,
   roles: state => state.user.roles,
   permissions: state => state.user.permissions,

+ 5 - 0
src/store/modules/user.js

@@ -5,6 +5,7 @@ const user = {
   state: {
     token: getToken(),
     name: '',
+    userId: '',
     avatar: '',
     roles: [],
     permissions: []
@@ -28,6 +29,9 @@ const user = {
     },
     SET_PERMISSIONS: (state, permissions) => {
       state.permissions = permissions
+    },
+    SET_USERID: (state, userId) => {
+      state.userId = userId
     }
   },
 
@@ -65,6 +69,7 @@ const user = {
             commit('SET_ROLES', ['ROLE_DEFAULT'])
           }
           commit('SET_NAME', user.userName)
+          commit('SET_USERID', user.id)
           commit('SET_AVATAR', avatar)
           resolve(res)
         }).catch(error => {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 980 - 959
src/views/forest.vue


+ 3 - 5
src/views/from/dvCapsuleChart.vue

@@ -3,19 +3,17 @@
     <template v-if="mergedConfig">
       <div class="label-column">
         <div v-for="item in mergedConfig.data" :key="item.name" style="cursor: pointer" @click="getEventList(item)">
-          {{ item.name }} 
+          {{ item.name }}
         </div>
         <div>&nbsp;</div>
       </div>
       <div class="capsule-container">
-        <div class="capsule-item" v-for="(capsule, index) in capsuleLength" :key="index">
+        <div class="capsule-item" v-for="(capsule, index) in capsuleLength" :key="index" style="cursor: pointer" @click="getEventList(mergedConfig.data[index])">
           <div
-            @click="getEventList(capsule)"
             class="capsule-item-column"
-            :style="`cursor: pointer;width: ${capsule * 100}%; background-color: ${mergedConfig.colors[index % mergedConfig.colors.length]};`"
+            :style="`width: ${capsule * 100}%; background-color: ${mergedConfig.colors[index % mergedConfig.colors.length]};`"
           >
             <div
-              style="cursor: pointer" @click="getEventList(capsule)"
               v-if="mergedConfig.showValue"
               class="capsule-item-value"
             >{{ capsuleValue[index] }}

+ 37 - 9
src/views/leader.vue

@@ -77,7 +77,7 @@
                   <el-collapse-item v-for="(item,index) in xunLinListOne">
                     <template slot="title">
                       <div class="d-l-con sj-collapse"
-                           @click="getRecordList(item.id)">
+                           @click="getRecordList(item.id, item.patrolTrajectory)">
                         <div class="d-l-l-text">
                           <el-tooltip class="item" effect="dark" placement="left"
                                       style="width:10rem ;" :disabled="(item.taskName.length <= 20)">
@@ -171,8 +171,10 @@
 				indentText: '收起左右栏',
 				indentdisabled: false,
 				visuForestCloudRYBO: [], //人员类型列表
-				peopleList: [], //人员列表
-				connectList: [], //画线
+        personId: null, //人员
+        peopleList: [], //人员列表
+        connectList: [], //画线
+        patrolTrajectory: null, //任务画线
 				xunLinListOne: [], //巡查任务
 				recordList: [], //巡查记录
 				showNothing: false, //暂无信息
@@ -286,26 +288,35 @@
 				getTrafficLeader(linJob, linType).then(res => {
 					this.peopleList = res.data
 				})
-				this.connectList = []
-				this.$refs.supermap.clearC()
+        this.connectList = []
+        this.personId = null;
+        this.xunLinListOne = [];
+        this.patrolTrajectory = null;
+        this.$refs.supermap.clearC()
 			},
 			//点击左侧人员列表获取 巡查轨迹
 			getPlanList(personId) {
+        if(this.personId == personId){//当前人员已经被点击一次 不再重复加载
+          return;
+        }
+        this.personId = personId;
 				this.showNothing = false;
 				this.recordList = [];
 				getPlanList(personId).then(res => {
 					this.xunLinListOne = res.data;
 				})
+        this.patrolTrajectory = null;
 				this.$refs.supermap.clearC()
 			},
 			//点击右侧巡查轨迹获取 巡查记录
-			getRecordList(id) {
+			getRecordList(id, patrolTrajectory) {
 				this.showNothing = false;
 				this.recordList = [];
 				getRecordList(id).then(res => {
 					this.recordList = res.data;
 				})
-				this.$refs.supermap.clearC()
+        this.$refs.supermap.clearC();
+        this.setTaskPointList(patrolTrajectory);
 			},
 			//点击右侧巡查记录获取 巡查轨迹
 			getPointList(id) {
@@ -314,6 +325,23 @@
 					this.setPointList(res);
 				})
 			},
+      //点击巡查人员 巡查任务落点
+      setTaskPointList(patrolTrajectory) {
+        console.log("巡查任务落点", typeof JSON.parse(patrolTrajectory));
+        if(this.patrolTrajectory == patrolTrajectory){
+          this.patrolTrajectory = null;
+        }else {
+          this.patrolTrajectory = patrolTrajectory;
+          this.drawTaskPoint(this.patrolTrajectory);
+        }
+      },
+      // 巡查任务落点
+      drawTaskPoint(patrolTrajectory) {
+        setTimeout(() => {
+          this.$refs.supermap.clearC();
+          this.$refs.supermap.setConnectList(JSON.parse(patrolTrajectory), '#04f');
+        }, 1000)
+      },
 			//点击巡查轨迹时段 巡查轨迹落点
 			setPointList(res) {
 				let that = this;
@@ -328,8 +356,8 @@
 						this.connectList.push(latlng)
 					}
 					setTimeout(() => {
-						that.$refs.supermap.clearC()
-						that.$refs.supermap.setConnectList(this.connectList, 'red')
+						// that.$refs.supermap.clearC()
+						that.$refs.supermap.setConnectList(this.connectList, '#f40')
 					}, 1000)
 				} else {
 					that.$refs.supermap.clearC()