tianzhang.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. <template>
  2. <div class="visual-con">
  3. <!--头部-->
  4. <vheader></vheader>
  5. <!--主体-->
  6. <div class="visual-body">
  7. <!-- 左侧 -->
  8. <div class="leftbar" :class="indentleft" ref="left">
  9. <div class="forthis">
  10. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  11. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  12. <div class="this-title">
  13. <span>网格列表</span>
  14. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
  15. </div>
  16. <div class="i-list-con h-25">
  17. <div class="d-l-con-icon">
  18. <div class="icon-con" :class="{on:listCurrentIndex1==item.userId}"
  19. v-for="(item,index) in peopleList" @click="getLeaderTrack(item.userId)">
  20. <div class="icon icon-mid el-icon-user"></div>
  21. <div class="icon-text personnel-name">
  22. <h6>{{ item.nickName }}</h6>
  23. <h5>{{ item.deptName }}</h5>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. </dv-border-box-13>
  29. </div>
  30. <div class="forthis">
  31. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  32. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  33. <div class="this-title">
  34. <span>网格长</span>
  35. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
  36. </div>
  37. <div class="i-list-con h-27">
  38. <div class="d-l-con-icon">
  39. <div class="icon-con" :class="{on:listCurrentIndex1==item.userId}"
  40. v-for="(item,index) in peopleList" @click="getLeaderTrack(item.userId)">
  41. <div class="icon icon-mid el-icon-user"></div>
  42. <div class="icon-text personnel-name">
  43. <h6>{{ item.nickName }}</h6>
  44. <h5>{{ item.deptName }}</h5>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </dv-border-box-13>
  50. </div>
  51. </div>
  52. <!-- 地图 -->
  53. <supermap ref="supermap" style="width: 100%;height: 100vh;" :mapDiv="'forestMap'" class="indexSupermapClass"
  54. :mapSite="{doubleClickZoom:false}" :codes="['9fa5']" :isSideBySide="false"></supermap>
  55. <!-- 右侧 -->
  56. <div class="rightbar" :class="indentright" ref="right">
  57. <div class="forthis">
  58. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  59. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  60. <div class="this-title">
  61. <span>田长列表</span>
  62. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
  63. </div>
  64. <div class="i-list-con h-27">
  65. <div class="h-19 overflow-y">
  66. <div class="d-l-con" :class="{on:listCurrentIndex2==item.planName}"
  67. v-for="(item,index) in xunLinListOne"
  68. @click="getPointList(item.id)">
  69. <div class="d-l-l-text">
  70. <i class="i-small"></i>
  71. <h4>{{ item.timeBegin }} - {{ item.timeEnd }}</h4>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </dv-border-box-13>
  77. </div>
  78. <div class="forthis">
  79. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  80. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  81. <div class="this-title">
  82. <span>巡查时段</span>
  83. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
  84. </div>
  85. <div class="i-list-con h-27">
  86. <div class="h-19 overflow-y">
  87. <div class="d-l-con" :class="{on:listCurrentIndex2==item.planName}"
  88. v-for="(item,index) in xunLinListOne"
  89. @click="getPointList(item.id)">
  90. <div class="d-l-l-text">
  91. <i class="i-small"></i>
  92. <h4>{{ item.timeBegin }} - {{ item.timeEnd }}</h4>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </dv-border-box-13>
  98. </div>
  99. </div>
  100. <vBottomMenu ref="bottomMenu"></vBottomMenu>
  101. <!-- <el-tooltip :content="indentText" placement="top" :disabled="indentdisabled">-->
  102. <!-- <div class="mascot" ref="mascot" :class="indentStyle" @click="indent">-->
  103. <!-- <img src="@/assets/images/mascot.png"/>-->
  104. <!-- </div>-->
  105. <!-- </el-tooltip>-->
  106. </div>
  107. <eventLocation ref="eventLocation"></eventLocation>
  108. <TVWall ref="TVWall"></TVWall>
  109. </div>
  110. </template>
  111. <script>
  112. import {
  113. getForestLeader,
  114. getLeaderTrack,
  115. getTrackList,
  116. getPointList,
  117. getPlanList,
  118. getRy
  119. } from '@/api/leader'
  120. import supermap from '@/components/supermap' //超图
  121. import vheader from '@/components/v-header.vue' //一体化共用头部
  122. import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
  123. import eventLocation from '@/components/eventLocation.vue' //事件定位弹窗
  124. import TVWall from '@/components/TVWall.vue' //电视墙弹窗
  125. let echarts = require('echarts')
  126. export default {
  127. components: {
  128. supermap,
  129. vheader,
  130. vBottomMenu,
  131. eventLocation,
  132. TVWall
  133. },
  134. data() {
  135. return {
  136. iconCurrentIndex1: '1',
  137. listCurrentIndex1: '',
  138. listCurrentIndex2: '',
  139. //左右缩进
  140. indentStyle: '',
  141. indentleft: '',
  142. indentright: '',
  143. indentText: '收起左右栏',
  144. indentdisabled: false,
  145. visuForestCloudRYBO: [], //人员类型列表
  146. peopleList: [], //人员列表
  147. connectList: [], //画线
  148. xunLinListOne: [], //巡林计划
  149. zrs: 0, //总人数
  150. zxrs: 0 //在线人数
  151. }
  152. },
  153. created() {
  154. this.getInit()
  155. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  156. window.showDialog = this.showDialog
  157. window.choseLayerSwitching = this.choseLayerSwitching
  158. window.choseLayerSwitchingList = this.choseLayerSwitchingList
  159. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  160. },
  161. methods: {
  162. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  163. showDialog(click) {
  164. if (click == 'eventLocation') {
  165. this.$refs.eventLocation.showEventLocation()
  166. this.$refs.supermap.isEditableLayers = false
  167. this.$refs.bottomMenu.showChild = false
  168. this.$refs.bottomMenu.showBanChild = false
  169. this.$refs.bottomMenu.showChangChild = false
  170. } else if (click == 'editableLayers') {
  171. this.$refs.bottomMenu.showChild = false
  172. this.$refs.bottomMenu.showBanChild = false
  173. this.$refs.bottomMenu.showChangChild = false
  174. if (!this.$refs.supermap.isEditableLayers) {
  175. this.$refs.supermap.isEditableLayers = true
  176. } else {
  177. this.$refs.supermap.isEditableLayers = false
  178. }
  179. } else if (click == 'layerSwitching') {
  180. this.$refs.supermap.isEditableLayers = false
  181. this.$refs.bottomMenu.showBanChild = false
  182. this.$refs.bottomMenu.showChangChild = false
  183. if (!this.$refs.bottomMenu.showChild) {
  184. this.$refs.bottomMenu.showChild = true
  185. } else {
  186. this.$refs.bottomMenu.showChild = false
  187. }
  188. } else if (click == 'TVWall') {
  189. this.$refs.TVWall.showTVWall()
  190. this.$refs.supermap.isEditableLayers = false
  191. this.$refs.bottomMenu.showChild = false
  192. this.$refs.bottomMenu.showBanChild = false
  193. this.$refs.bottomMenu.showChangChild = false
  194. } else if (click == 'forestban') {
  195. this.$refs.supermap.isEditableLayers = false
  196. this.$refs.bottomMenu.showChild = false
  197. this.$refs.bottomMenu.showChangChild = false
  198. if (!this.$refs.bottomMenu.showBanChild) {
  199. this.$refs.bottomMenu.showBanChild = true
  200. } else {
  201. this.$refs.bottomMenu.showBanChild = false
  202. }
  203. } else if (click == 'forestchang') {
  204. this.$refs.supermap.isEditableLayers = false
  205. this.$refs.bottomMenu.showBanChild = false
  206. this.$refs.bottomMenu.showChild = false
  207. if (!this.$refs.bottomMenu.showChangChild) {
  208. this.$refs.bottomMenu.showChangChild = true
  209. } else {
  210. this.$refs.bottomMenu.showChangChild = false
  211. }
  212. }
  213. },
  214. //选择图层
  215. choseLayerSwitching(url, isClear) {
  216. this.$refs.supermap.layerSwitching(url, isClear)
  217. },
  218. //选择图层(传递数组)
  219. choseLayerSwitchingList(urlList) {
  220. this.$refs.supermap.layerSwitchingList(urlList)
  221. },
  222. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  223. //初始化
  224. getInit() {
  225. let that = this
  226. this.iconCurrentIndex1 = '1'
  227. this.listCurrentIndex1 = ''
  228. this.listCurrentIndex2 = ''
  229. //获取左侧菜单列表
  230. getRy().then(res => {
  231. that.visuForestCloudRYBO = res.data.visuForestCloudRYBO
  232. that.zrs = res.data.visuForestCloudRyZxBO.zrs
  233. that.zxrs = res.data.visuForestCloudRyZxBO.zxrs
  234. this.personnelChart()
  235. })
  236. //获取巡林计划
  237. // getPlanList().then(res => {
  238. // this.xunLinListOne = res.data
  239. // })
  240. // // 获取轨迹列表
  241. // getTrackList().then(res => {
  242. // this.xunLinListOne = res.data
  243. // })
  244. // 获取人员列表
  245. // getForestLeader(linJob, linType).then(res => {
  246. getForestLeader().then(res => {
  247. this.peopleList = res.data;
  248. console.log("人员",res.data)
  249. })
  250. this.connectList = []
  251. // this.$refs.supermap.clearC() //clearC undefined
  252. },
  253. //获取左侧人员列表
  254. getForestLeader(linJob, linType) {
  255. this.listCurrentIndex1 = ''
  256. this.listCurrentIndex2 = ''
  257. this.iconCurrentIndex1 = linJob
  258. this.peopleList = []
  259. getForestLeader(linJob, linType).then(res => {
  260. this.peopleList = res.data;
  261. })
  262. this.connectList = []
  263. this.$refs.supermap.clearC()
  264. },
  265. //点击左侧人员列表获取轨迹
  266. getLeaderTrack(personId) {
  267. getTrackList(personId).then(res => {
  268. console.log("轨迹",res.data);
  269. if(res.data.length > 0){// 当前资源人员有巡查轨迹 获取最新一条轨迹
  270. this.xunLinListOne = res.data;
  271. this.getPointList(res.data[0].id);
  272. }else {// 清空上一用户落点
  273. this.xunLinListOne = [{"timeBegin": "当前资源人员", "timeEnd": "暂无巡查轨迹"}];
  274. this.$refs.supermap.clearC()
  275. }
  276. })
  277. },
  278. getLeaderTrack_original(userId) {
  279. this.listCurrentIndex1 = userId
  280. let that = this
  281. this.connectList = []
  282. getLeaderTrack(userId).then(res => {
  283. // this.xunLinListOne = res.data;
  284. // 获取右侧轨迹列表
  285. // getPlanList().then(res => {
  286. // this.xunLinListOne = res.data
  287. // })
  288. if (res.data != null && res.data.length > 0) {
  289. for (let i = 0; i < res.data.length; i++) {
  290. let latlng = {
  291. lat: res.data[i].latitude,
  292. lng: res.data[i].longitude
  293. }
  294. this.connectList.push(latlng)
  295. }
  296. setTimeout(() => {
  297. that.$refs.supermap.clearC()
  298. that.$refs.supermap.setConnectList(this.connectList, 'red')
  299. }, 1000)
  300. } else {
  301. that.$refs.supermap.clearC()
  302. }
  303. })
  304. },
  305. getPointList(trackId) {
  306. let that = this;
  307. this.connectList = [];
  308. getPointList(trackId).then(res => {
  309. console.log("落点",res.data)
  310. if (res.data != null && res.data.length > 0) {
  311. for (let i = 0; i < res.data.length; i++) {
  312. let latlng = {
  313. lat: res.data[i].latitude,
  314. lng: res.data[i].longitude
  315. }
  316. this.connectList.push(latlng)
  317. }
  318. setTimeout(() => {
  319. that.$refs.supermap.clearC()
  320. that.$refs.supermap.setConnectList(this.connectList, 'red')
  321. }, 1000)
  322. } else {
  323. that.$refs.supermap.clearC()
  324. }
  325. })
  326. },
  327. setConnectList(points, planName) {
  328. this.listCurrentIndex2 = planName
  329. this.connectList = []
  330. if (points != null && points != '') {
  331. this.connectList = JSON.parse(points)
  332. this.$refs.supermap.setConnectTwoList(this.connectList, 'red')
  333. }
  334. },
  335. //吉祥物收起左右框
  336. indent() {
  337. let list = document.getElementsByClassName('el-tooltip__popper')
  338. list[list.length - 1].style.display = 'none'
  339. if (this.indentStyle == '') {
  340. this.indentStyle = 'indent-style'
  341. this.indentleft = 'indent-left'
  342. this.indentright = 'indent-right'
  343. this.indentText = '展开左右栏'
  344. } else if (this.indentText == '展开左右栏') {
  345. this.indentStyle = ''
  346. this.indentleft = ''
  347. this.indentright = ''
  348. this.indentText = '收起左右栏'
  349. }
  350. },
  351. //人员chart
  352. personnelChart() {
  353. // 基于准备好的dom,初始化echarts实例
  354. let myChart = echarts.init(document.getElementById('personnel-chart'))
  355. // 绘制图表
  356. const handred = this.zrs
  357. let point = this.zxrs
  358. myChart.setOption({
  359. title: [{
  360. text: '总人数:' + handred + '人' + '\n' + '\n' + '在线人数:' + point + '人',
  361. x: '48%',
  362. y: '25%',
  363. textStyle: {
  364. fontWeight: 'normal',
  365. color: '#02d6fc',
  366. fontSize: '14'
  367. }
  368. }],
  369. series: [{
  370. name: 'circle',
  371. type: 'pie',
  372. center: ['22%', '50%'],
  373. radius: ['60%', '70%'],
  374. clockWise: true,
  375. label: {
  376. normal: {
  377. position: 'center'
  378. }
  379. },
  380. itemStyle: {
  381. normal: {
  382. label: {
  383. show: false
  384. },
  385. labelLine: {
  386. show: false
  387. }
  388. }
  389. },
  390. data: [{
  391. value: point,
  392. name: '当前在线',
  393. label: {
  394. show: true, //单独显示该数据项
  395. formatter: '{c}人',
  396. labelLayout: {
  397. top: '50%'
  398. },
  399. textStyle: {
  400. color: '#02d6fc',
  401. fontSize: 14
  402. }
  403. },
  404. itemStyle: {
  405. normal: {
  406. color: { // 完成的圆环的颜色
  407. colorStops: [{
  408. offset: 0,
  409. color: '#02d6fc' // 0% 处的颜色
  410. }, {
  411. offset: 1,
  412. color: '#367bec' // 100% 处的颜色
  413. }]
  414. },
  415. label: {
  416. show: false
  417. },
  418. labelLine: {
  419. show: false
  420. }
  421. }
  422. }
  423. }, {
  424. value: handred - point,
  425. itemStyle: {
  426. color: '#666'
  427. }
  428. }]
  429. }]
  430. })
  431. }
  432. }
  433. }
  434. </script>
  435. <style rel="stylesheet/scss" lang="scss" scoped>
  436. @import '@/assets/styles/base.scss';
  437. .h-27 {
  438. height: 27rem;
  439. }
  440. </style>