leader.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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="getLeaderTrack(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. <span>巡查监测点计划</span>
  73. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
  74. </div>
  75. <div class="i-list-con h-73">
  76. <div class="h-19 overflow-y">
  77. <div class="d-l-con" :class="{on:listCurrentIndex2==item.planName}"
  78. v-for="(item,index) in xunLinListOne"
  79. @click="setConnectList(item.planLine,item.planName)">
  80. <div class="d-l-l-text">
  81. <i class="i-small"></i>
  82. <h4>{{ item.planName }}</h4>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </dv-border-box-13>
  88. </div>
  89. </div>
  90. <vBottomMenu ref="bottomMenu"></vBottomMenu>
  91. <!-- <el-tooltip :content="indentText" placement="top" :disabled="indentdisabled">-->
  92. <!-- <div class="mascot" ref="mascot" :class="indentStyle" @click="indent">-->
  93. <!-- <img src="@/assets/images/mascot.png"/>-->
  94. <!-- </div>-->
  95. <!-- </el-tooltip>-->
  96. </div>
  97. <eventLocation ref="eventLocation"></eventLocation>
  98. <TVWall ref="TVWall"></TVWall>
  99. </div>
  100. </template>
  101. <script>
  102. import {
  103. getForestLeader,
  104. getLeaderTrack,
  105. getPlanList,
  106. getRy
  107. } from '@/api/leader'
  108. import supermap from '@/components/supermap' //超图
  109. import vheader from '@/components/v-header.vue' //一体化共用头部
  110. import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
  111. import eventLocation from '@/components/eventLocation.vue' //事件定位弹窗
  112. import TVWall from '@/components/TVWall.vue' //电视墙弹窗
  113. let echarts = require('echarts')
  114. export default {
  115. components: {
  116. supermap,
  117. vheader,
  118. vBottomMenu,
  119. eventLocation,
  120. TVWall
  121. },
  122. data() {
  123. return {
  124. iconCurrentIndex1: '1',
  125. listCurrentIndex1: '',
  126. listCurrentIndex2: '',
  127. //左右缩进
  128. indentStyle: '',
  129. indentleft: '',
  130. indentright: '',
  131. indentText: '收起左右栏',
  132. indentdisabled: false,
  133. visuForestCloudRYBO: [], //人员类型列表
  134. peopleList: [], //人员列表
  135. connectList: [], //画线
  136. xunLinListOne: [], //巡林计划
  137. zrs: 0, //总人数
  138. zxrs: 0 //在线人数
  139. }
  140. },
  141. created() {
  142. this.getInit()
  143. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  144. window.showDialog = this.showDialog
  145. window.choseLayerSwitching = this.choseLayerSwitching
  146. window.choseLayerSwitchingList = this.choseLayerSwitchingList
  147. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  148. },
  149. methods: {
  150. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  151. showDialog(click) {
  152. if (click == 'eventLocation') {
  153. this.$refs.eventLocation.showEventLocation()
  154. this.$refs.supermap.isEditableLayers = false
  155. this.$refs.bottomMenu.showChild = false
  156. this.$refs.bottomMenu.showBanChild = false
  157. this.$refs.bottomMenu.showChangChild = false
  158. } else if (click == 'editableLayers') {
  159. this.$refs.bottomMenu.showChild = false
  160. this.$refs.bottomMenu.showBanChild = false
  161. this.$refs.bottomMenu.showChangChild = false
  162. if (!this.$refs.supermap.isEditableLayers) {
  163. this.$refs.supermap.isEditableLayers = true
  164. } else {
  165. this.$refs.supermap.isEditableLayers = false
  166. }
  167. } else if (click == 'layerSwitching') {
  168. this.$refs.supermap.isEditableLayers = false
  169. this.$refs.bottomMenu.showBanChild = false
  170. this.$refs.bottomMenu.showChangChild = false
  171. if (!this.$refs.bottomMenu.showChild) {
  172. this.$refs.bottomMenu.showChild = true
  173. } else {
  174. this.$refs.bottomMenu.showChild = false
  175. }
  176. } else if (click == 'TVWall') {
  177. this.$refs.TVWall.showTVWall()
  178. this.$refs.supermap.isEditableLayers = false
  179. this.$refs.bottomMenu.showChild = false
  180. this.$refs.bottomMenu.showBanChild = false
  181. this.$refs.bottomMenu.showChangChild = false
  182. } else if (click == 'forestban') {
  183. this.$refs.supermap.isEditableLayers = false
  184. this.$refs.bottomMenu.showChild = false
  185. this.$refs.bottomMenu.showChangChild = false
  186. if (!this.$refs.bottomMenu.showBanChild) {
  187. this.$refs.bottomMenu.showBanChild = true
  188. } else {
  189. this.$refs.bottomMenu.showBanChild = false
  190. }
  191. } else if (click == 'forestchang') {
  192. this.$refs.supermap.isEditableLayers = false
  193. this.$refs.bottomMenu.showBanChild = false
  194. this.$refs.bottomMenu.showChild = false
  195. if (!this.$refs.bottomMenu.showChangChild) {
  196. this.$refs.bottomMenu.showChangChild = true
  197. } else {
  198. this.$refs.bottomMenu.showChangChild = false
  199. }
  200. }
  201. },
  202. //选择图层
  203. choseLayerSwitching(url, isClear) {
  204. this.$refs.supermap.layerSwitching(url, isClear)
  205. },
  206. //选择图层(传递数组)
  207. choseLayerSwitchingList(urlList) {
  208. this.$refs.supermap.layerSwitchingList(urlList)
  209. },
  210. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  211. //初始化
  212. getInit() {
  213. let that = this
  214. this.iconCurrentIndex1 = '1'
  215. this.listCurrentIndex1 = ''
  216. this.listCurrentIndex2 = ''
  217. //获取左侧菜单列表
  218. getRy().then(res => {
  219. that.visuForestCloudRYBO = res.data.visuForestCloudRYBO
  220. that.zrs = res.data.visuForestCloudRyZxBO.zrs
  221. that.zxrs = res.data.visuForestCloudRyZxBO.zxrs
  222. this.personnelChart()
  223. })
  224. //获取巡查监测点计划
  225. getPlanList().then(res => {
  226. this.xunLinListOne = res.data
  227. })
  228. },
  229. //获取左侧人员列表
  230. getForestLeader(linJob, linType) {
  231. this.listCurrentIndex1 = ''
  232. this.listCurrentIndex2 = ''
  233. this.iconCurrentIndex1 = linJob
  234. this.peopleList = []
  235. getForestLeader(linJob, linType).then(res => {
  236. this.peopleList = res.data
  237. })
  238. this.connectList = []
  239. this.$refs.supermap.clearC()
  240. },
  241. //点击左侧人员列表获取轨迹
  242. getLeaderTrack(userId) {
  243. this.listCurrentIndex1 = userId
  244. let that = this
  245. this.connectList = []
  246. getLeaderTrack(userId).then(res => {
  247. console.log("alert(trackById)",res.data)
  248. if (res.data != null && res.data.length > 0) {
  249. for (let i = 0; i < res.data.length; i++) {
  250. let latlng = {
  251. lat: res.data[i].latitude,
  252. lng: res.data[i].longitude
  253. }
  254. this.connectList.push(latlng)
  255. }
  256. setTimeout(() => {
  257. that.$refs.supermap.clearC()
  258. that.$refs.supermap.setConnectList(this.connectList, 'red')
  259. }, 1000)
  260. } else {
  261. that.$refs.supermap.clearC()
  262. }
  263. })
  264. },
  265. setConnectList(points, planName) {
  266. this.listCurrentIndex2 = planName
  267. this.connectList = []
  268. if (points != null && points != '') {
  269. this.connectList = JSON.parse(points)
  270. this.$refs.supermap.setConnectTwoList(this.connectList, 'red')
  271. }
  272. },
  273. //吉祥物收起左右框
  274. indent() {
  275. let list = document.getElementsByClassName('el-tooltip__popper')
  276. list[list.length - 1].style.display = 'none'
  277. if (this.indentStyle == '') {
  278. this.indentStyle = 'indent-style'
  279. this.indentleft = 'indent-left'
  280. this.indentright = 'indent-right'
  281. this.indentText = '展开左右栏'
  282. } else if (this.indentText == '展开左右栏') {
  283. this.indentStyle = ''
  284. this.indentleft = ''
  285. this.indentright = ''
  286. this.indentText = '收起左右栏'
  287. }
  288. },
  289. //人员chart
  290. personnelChart() {
  291. // 基于准备好的dom,初始化echarts实例
  292. let myChart = echarts.init(document.getElementById('personnel-chart'))
  293. // 绘制图表
  294. const handred = this.zrs
  295. let point = this.zxrs
  296. myChart.setOption({
  297. title: [{
  298. text: '总人数:' + handred + '人' + '\n' + '\n' + '在线人数:' + point + '人',
  299. x: '48%',
  300. y: '25%',
  301. textStyle: {
  302. fontWeight: 'normal',
  303. color: '#02d6fc',
  304. fontSize: '14'
  305. }
  306. }],
  307. series: [{
  308. name: 'circle',
  309. type: 'pie',
  310. center: ['22%', '50%'],
  311. radius: ['60%', '70%'],
  312. clockWise: true,
  313. label: {
  314. normal: {
  315. position: 'center'
  316. }
  317. },
  318. itemStyle: {
  319. normal: {
  320. label: {
  321. show: false
  322. },
  323. labelLine: {
  324. show: false
  325. }
  326. }
  327. },
  328. data: [{
  329. value: point,
  330. name: '当前在线',
  331. label: {
  332. show: true, //单独显示该数据项
  333. formatter: '{c}人',
  334. labelLayout: {
  335. top: '50%'
  336. },
  337. textStyle: {
  338. color: '#02d6fc',
  339. fontSize: 14
  340. }
  341. },
  342. itemStyle: {
  343. normal: {
  344. color: { // 完成的圆环的颜色
  345. colorStops: [{
  346. offset: 0,
  347. color: '#02d6fc' // 0% 处的颜色
  348. }, {
  349. offset: 1,
  350. color: '#367bec' // 100% 处的颜色
  351. }]
  352. },
  353. label: {
  354. show: false
  355. },
  356. labelLine: {
  357. show: false
  358. }
  359. }
  360. }
  361. }, {
  362. value: handred - point,
  363. itemStyle: {
  364. color: '#666'
  365. }
  366. }]
  367. }]
  368. })
  369. }
  370. }
  371. }
  372. </script>
  373. <style rel="stylesheet/scss" lang="scss" scoped>
  374. @import '@/assets/styles/base.scss';
  375. .h-27 {
  376. height: 27rem;
  377. }
  378. </style>