leader.vue 18 KB

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