leader.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  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="getTrafficLeader(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="getTrafficLeader(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. getTrafficLeader,
  138. getPlanList,
  139. getRecordList,
  140. getPointList,
  141. getRy
  142. } from '@/api/leader'
  143. import supermap from '@/components/supermap' //超图
  144. import vheader from '@/components/v-header.vue' //一体化共用头部
  145. import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
  146. import eventLocation from '@/components/eventLocation.vue' //事件定位弹窗
  147. import TVWall from '@/components/TVWall.vue' //电视墙弹窗
  148. let echarts = require('echarts')
  149. export default {
  150. components: {
  151. supermap,
  152. vheader,
  153. vBottomMenu,
  154. eventLocation,
  155. TVWall
  156. },
  157. data() {
  158. return {
  159. iconCurrentIndex1: '1',
  160. listCurrentIndex1: '',
  161. listCurrentIndex2: '',
  162. //左右缩进
  163. indentStyle: '',
  164. indentleft: '',
  165. indentright: '',
  166. indentText: '收起左右栏',
  167. indentdisabled: false,
  168. visuForestCloudRYBO: [], //人员类型列表
  169. peopleList: [], //人员列表
  170. connectList: [], //画线
  171. xunLinListOne: [], //巡查任务
  172. recordList: [], //巡查记录
  173. showNothing: false, //暂无信息
  174. zrs: 0, //总人数
  175. zxrs: 0 //在线人数
  176. }
  177. },
  178. created() {
  179. this.getInit()
  180. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  181. window.showDialog = this.showDialog
  182. window.choseLayerSwitching = this.choseLayerSwitching
  183. window.choseLayerSwitchingList = this.choseLayerSwitchingList
  184. window.choseLayerSwitchingList_Data = this.choseLayerSwitchingList_Data
  185. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  186. },
  187. mounted(){
  188. this.bottomMenuList() //获取底部公共组件消息和任务
  189. },
  190. methods: {
  191. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  192. bottomMenuList() {
  193. this.$refs.bottomMenu.selectTaskList()//获取任务列表
  194. this.$refs.bottomMenu.selectMessageList()//获取消息列表
  195. },
  196. showDialog(click) {
  197. if (click == 'eventLocation') {
  198. this.$refs.eventLocation.showEventLocation()
  199. this.$refs.supermap.isEditableLayers = false
  200. this.$refs.bottomMenu.showChild = false
  201. this.$refs.bottomMenu.showBanChild = false
  202. this.$refs.bottomMenu.showChangChild = false
  203. } else if (click == 'editableLayers') {
  204. this.$refs.bottomMenu.showChild = false
  205. this.$refs.bottomMenu.showBanChild = false
  206. this.$refs.bottomMenu.showChangChild = false
  207. if (!this.$refs.supermap.isEditableLayers) {
  208. this.$refs.supermap.isEditableLayers = true
  209. } else {
  210. this.$refs.supermap.isEditableLayers = false
  211. }
  212. } else if (click == 'layerSwitching') {
  213. this.$refs.supermap.isEditableLayers = false
  214. this.$refs.bottomMenu.showBanChild = false
  215. this.$refs.bottomMenu.showChangChild = false
  216. if (!this.$refs.bottomMenu.showChild) {
  217. this.$refs.bottomMenu.showChild = true
  218. } else {
  219. this.$refs.bottomMenu.showChild = false
  220. }
  221. } else if (click == 'TVWall') {
  222. this.$refs.TVWall.showTVWall()
  223. this.$refs.supermap.isEditableLayers = false
  224. this.$refs.bottomMenu.showChild = false
  225. this.$refs.bottomMenu.showBanChild = false
  226. this.$refs.bottomMenu.showChangChild = false
  227. } else if (click == 'forestban') {
  228. this.$refs.supermap.isEditableLayers = false
  229. this.$refs.bottomMenu.showChild = false
  230. this.$refs.bottomMenu.showChangChild = false
  231. if (!this.$refs.bottomMenu.showBanChild) {
  232. this.$refs.bottomMenu.showBanChild = true
  233. } else {
  234. this.$refs.bottomMenu.showBanChild = false
  235. }
  236. } else if (click == 'forestchang') {
  237. this.$refs.supermap.isEditableLayers = false
  238. this.$refs.bottomMenu.showBanChild = false
  239. this.$refs.bottomMenu.showChild = false
  240. if (!this.$refs.bottomMenu.showChangChild) {
  241. this.$refs.bottomMenu.showChangChild = true
  242. } else {
  243. this.$refs.bottomMenu.showChangChild = false
  244. }
  245. }
  246. },
  247. //选择图层
  248. choseLayerSwitching(url, isClear) {
  249. this.$refs.supermap.layerSwitching(url, isClear)
  250. },
  251. //选择图层(传递数组)
  252. choseLayerSwitchingList(urlList) {
  253. this.$refs.supermap.layerSwitchingList(urlList)
  254. },
  255. //选择图层(传递数组) 带数据
  256. choseLayerSwitchingList_Data(urlList) {
  257. this.$refs.supermap.layerSwitchingList_Data(urlList)
  258. },
  259. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  260. //初始化
  261. getInit() {
  262. let that = this
  263. this.iconCurrentIndex1 = '1'
  264. this.listCurrentIndex1 = ''
  265. this.listCurrentIndex2 = ''
  266. //获取左侧菜单列表
  267. getRy().then(res => {
  268. that.visuForestCloudRYBO = res.data.visuForestCloudRYBO
  269. that.zrs = res.data.visuForestCloudRyZxBO.zrs
  270. that.zxrs = res.data.visuForestCloudRyZxBO.zxrs
  271. this.personnelChart()
  272. })
  273. },
  274. //获取左侧人员列表
  275. getTrafficLeader(linJob, linType) {
  276. this.listCurrentIndex1 = ''
  277. this.listCurrentIndex2 = ''
  278. this.iconCurrentIndex1 = linJob
  279. this.peopleList = []
  280. getTrafficLeader(linJob, linType).then(res => {
  281. this.peopleList = res.data
  282. })
  283. this.connectList = []
  284. this.$refs.supermap.clearC()
  285. },
  286. //点击左侧人员列表获取 巡查计划
  287. getPlanList(personId) {
  288. this.showNothing = false;
  289. this.recordList = [];
  290. getPlanList(personId).then(res => {
  291. this.xunLinListOne = res.data;
  292. })
  293. this.$refs.supermap.clearC()
  294. },
  295. //点击右侧巡查计划获取 巡查记录
  296. getRecordList(id) {
  297. this.showNothing = false;
  298. this.recordList = [];
  299. getRecordList(id).then(res => {
  300. this.recordList = res.data;
  301. })
  302. this.$refs.supermap.clearC()
  303. },
  304. //点击右侧巡查记录获取 巡查轨迹
  305. getPointList(id) {
  306. getPointList(id).then(res => {
  307. // console.log("落点",res.data);
  308. this.setPointList(res);
  309. })
  310. },
  311. //点击巡查轨迹时段 巡查轨迹落点
  312. setPointList(res) {
  313. let that = this;
  314. this.connectList = [];
  315. console.log("落点", res.data)
  316. if (res.data != null && res.data.length > 0) {
  317. for (let i = 0; i < res.data.length; i++) {
  318. let latlng = {
  319. lat: res.data[i].latitude,
  320. lng: res.data[i].longitude
  321. }
  322. this.connectList.push(latlng)
  323. }
  324. setTimeout(() => {
  325. that.$refs.supermap.clearC()
  326. that.$refs.supermap.setConnectList(this.connectList, 'red')
  327. }, 1000)
  328. } else {
  329. that.$refs.supermap.clearC()
  330. }
  331. },
  332. setConnectList(points, planName) {
  333. this.listCurrentIndex2 = planName
  334. this.connectList = []
  335. if (points != null && points != '') {
  336. this.connectList = JSON.parse(points)
  337. this.$refs.supermap.setConnectTwoList(this.connectList, 'red')
  338. }
  339. },
  340. //吉祥物收起左右框
  341. indent() {
  342. let list = document.getElementsByClassName('el-tooltip__popper')
  343. list[list.length - 1].style.display = 'none'
  344. if (this.indentStyle == '') {
  345. this.indentStyle = 'indent-style'
  346. this.indentleft = 'indent-left'
  347. this.indentright = 'indent-right'
  348. this.indentText = '展开左右栏'
  349. } else if (this.indentText == '展开左右栏') {
  350. this.indentStyle = ''
  351. this.indentleft = ''
  352. this.indentright = ''
  353. this.indentText = '收起左右栏'
  354. }
  355. },
  356. //人员chart
  357. personnelChart() {
  358. // 基于准备好的dom,初始化echarts实例
  359. let myChart = echarts.init(document.getElementById('personnel-chart'))
  360. // 绘制图表
  361. const handred = this.zrs
  362. let point = this.zxrs
  363. myChart.setOption({
  364. title: [{
  365. text: '总人数:' + handred + '人' + '\n' + '\n' + '在线人数:' + point + '人',
  366. x: '48%',
  367. y: '25%',
  368. textStyle: {
  369. fontWeight: 'normal',
  370. color: '#02d6fc',
  371. fontSize: '14'
  372. }
  373. }],
  374. series: [{
  375. name: 'circle',
  376. type: 'pie',
  377. center: ['22%', '50%'],
  378. radius: ['60%', '70%'],
  379. clockWise: true,
  380. label: {
  381. normal: {
  382. position: 'center'
  383. }
  384. },
  385. itemStyle: {
  386. normal: {
  387. label: {
  388. show: false
  389. },
  390. labelLine: {
  391. show: false
  392. }
  393. }
  394. },
  395. data: [{
  396. value: point,
  397. name: '当前在线',
  398. label: {
  399. show: true, //单独显示该数据项
  400. formatter: '{c}人',
  401. labelLayout: {
  402. top: '50%'
  403. },
  404. textStyle: {
  405. color: '#02d6fc',
  406. fontSize: 14
  407. }
  408. },
  409. itemStyle: {
  410. normal: {
  411. color: { // 完成的圆环的颜色
  412. colorStops: [{
  413. offset: 0,
  414. color: '#02d6fc' // 0% 处的颜色
  415. }, {
  416. offset: 1,
  417. color: '#367bec' // 100% 处的颜色
  418. }]
  419. },
  420. label: {
  421. show: false
  422. },
  423. labelLine: {
  424. show: false
  425. }
  426. }
  427. }
  428. }, {
  429. value: handred - point,
  430. itemStyle: {
  431. color: '#666'
  432. }
  433. }]
  434. }]
  435. })
  436. }
  437. },
  438. //过滤器
  439. filters: {
  440. //标题截取前20
  441. ellipsis20(value) {
  442. if (!value) return '';
  443. if (value.length > 20) {
  444. return value.slice(0, 20) + '...'
  445. }
  446. return value
  447. }
  448. },
  449. }
  450. </script>
  451. <style rel="stylesheet/scss" lang="scss" scoped>
  452. @import '@/assets/styles/base.scss';
  453. .h-27 {
  454. height: 27rem;
  455. }
  456. </style>