leader.vue 18 KB

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