manage.vue 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055
  1. <!--
  2. * @Title:
  3. * @Description: 管理工作台
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="container">
  11. <uni-nav-bar :fixed="true" backgroundColor="#f7f7f7" statusBar="false" height="75px" leftWidth="0px">
  12. <view class="view-flex-inline">
  13. <view style="font-size: 1rem;">运维主面板</view>
  14. </view>
  15. </uni-nav-bar>
  16. <view class="nav">
  17. <u-grid :col="4" :border="false">
  18. <u-grid-item v-if="navButtonIndex[index]" bg-color="transparent" v-for="(item, index) in navButton"
  19. :key="index">
  20. <navigator v-if="item.badge" :url="item.url" hover-class="none" class="nav-item"
  21. open-type="navigate">
  22. <uni-badge class="uni-badge-left-margin" absolute="rightTop" :text="item.value" size="small">
  23. <image :src="item.img" mode="widthFix" class="nav-item-img"></image>
  24. </uni-badge>
  25. <view style="font-size: 0.9rem;font-weight: bold;">{{ item.name }}</view>
  26. </navigator>
  27. <navigator v-else :url="item.url" hover-class="none" class="nav-item" open-type="navigate">
  28. <image :src="item.img" mode="widthFix" class="nav-item-img"></image>
  29. <view style="font-size: 0.9rem;font-weight: bold;">{{ item.name }}</view>
  30. </navigator>
  31. </u-grid-item>
  32. </u-grid>
  33. </view>
  34. <uni-group>
  35. <swiper style="height: 100px;" circular :indicator-dots="false" :autoplay="true" :interval="2000"
  36. :duration="500">
  37. <swiper-item style="height: 200px;line-height: 300rpx;">
  38. <image src="/static/images/order-ad.png" style="height: 100%;" mode="heightFix"></image>
  39. </swiper-item>
  40. <swiper-item style="height: 200px;line-height: 300rpx;">
  41. <image src="/static/images/order-ad.png" style="height: 100%;" mode="heightFix"></image>
  42. </swiper-item>
  43. <swiper-item style="height: 200px;line-height: 300rpx;">
  44. <image src="/static/images/order-ad.png" style="height: 100%;" mode="heightFix"></image>
  45. </swiper-item>
  46. </swiper>
  47. </uni-group>
  48. <uni-section title="系统运行实时信息" type="circle">
  49. <uni-card title="运维项目">
  50. <view class="list-item-block">
  51. <view class="items-line">
  52. <uni-icons class="input-uni-icon" type="auth" size="18" color="lightblue" />
  53. <text class="item-title-rtu-name">共 10 个项目在运维中</text>
  54. </view>
  55. </view>
  56. </uni-card>
  57. <uni-card title="人员">
  58. <view class="list-item-block">
  59. <view class="items-line">
  60. <uni-icons class="input-uni-icon" type="auth" size="18" color="lightblue" />
  61. <text class="item-title-rtu-name">团队成员:10</text>
  62. </view>
  63. </view>
  64. </uni-card>
  65. </uni-section>
  66. </view>
  67. </template>
  68. <script>
  69. import {
  70. gcoord
  71. } from '@/static/js/gcoord.global.prod.js'
  72. import
  73. navBtns
  74. from "@/api/home.js";
  75. import {
  76. role
  77. } from "@/api/role.js";
  78. import http from '@/http/api.js';
  79. export default {
  80. name: '',
  81. components: {
  82. },
  83. data() {
  84. return {
  85. title: '管理工作台',
  86. permission: {
  87. 'admin': false,
  88. 'orgAdmin': false,
  89. 'companyAdmin': false,
  90. 'companyServciePerson': false,
  91. 'yjServicePerson': false,
  92. },
  93. navButton: [],
  94. navButtonIndex: [],
  95. currentRole: '',
  96. subSystem: 0,
  97. barcurrent: 1,
  98. pageSize: 10,
  99. pageCurrent: 1,
  100. total: 0,
  101. list: [],
  102. regionTree: [],
  103. regionCode: '',
  104. selectedTreeNode: '',
  105. searchRtuNameVal: '',
  106. searchRtuCodeVal: '',
  107. query: {},
  108. inputStyles: {
  109. color: '#808080',
  110. borderColor: '#d3d3d3'
  111. },
  112. countInfo: {},
  113. loading: false,
  114. value: [],
  115. warnKindItems: [{
  116. 'value': 0,
  117. 'text': '全部'
  118. }, {
  119. 'value': 1,
  120. 'text': '离线'
  121. }, {
  122. 'value': 2,
  123. 'text': '时钟异常'
  124. }, {
  125. 'value': 3,
  126. 'text': '雨量漏报'
  127. }, {
  128. 'value': 4,
  129. 'text': '水位漏报'
  130. }, {
  131. 'value': 5,
  132. 'text': '5分钟上报延时'
  133. }, {
  134. 'value': 6,
  135. 'text': '雨量小时上报延时'
  136. }, {
  137. 'value': 7,
  138. 'text': '水位小时上报延时'
  139. }, {
  140. 'value': 8,
  141. 'text': '雨量疑似异常值'
  142. }],
  143. warnKindOption: 0,
  144. //以下为应急参数
  145. yjDangerAreaCoverView: 0,
  146. yjRtuCoverView: 0,
  147. yjDangerAreaLineCoverView: 0,
  148. latitude: 40.848119,
  149. longitude: 111.755426,
  150. zoom: true,
  151. scale: 14,
  152. polygons: [],
  153. polylines: [],
  154. includepoints: [],
  155. mapStyles: {
  156. width: '100%',
  157. height: '600px'
  158. },
  159. horizontal: 'right',
  160. vertical: 'bottom',
  161. direction: 'horizontal',
  162. pattern: {
  163. color: '#7A7E83',
  164. backgroundColor: '#fff',
  165. selectedColor: '#007AFF',
  166. buttonColor: '#007AFF',
  167. iconColor: '#fff'
  168. },
  169. content: [{
  170. iconPath: '/static/images/tabbar/home.png',
  171. selectedIconPath: '/static/images/tabbar/home_selected.png',
  172. text: '雨情',
  173. active: false
  174. },
  175. {
  176. iconPath: '/static/images/tabbar/warn.png',
  177. selectedIconPath: '/static/images/tabbar/warn_selected.png',
  178. text: '预警',
  179. active: false
  180. },
  181. {
  182. iconPath: '/static/images/tabbar/workbench.png',
  183. selectedIconPath: '/static/images/tabbar/workbench_selected.png',
  184. text: '危险区',
  185. active: false
  186. }
  187. ],
  188. popMenu: false,
  189. popBoxIndex: 0,
  190. yjMapMarkers: [],
  191. yjDrawerWidth: 200,
  192. //应急雨量参数
  193. yjRainCountType: {
  194. items: [{
  195. 'id': '0',
  196. 'dictValue': '默认'
  197. }, {
  198. 'id': '1',
  199. 'dictValue': '近1小时'
  200. }, {
  201. 'id': '2',
  202. 'dictValue': '近3小时'
  203. }, {
  204. 'id': '3',
  205. 'dictValue': '近6小时'
  206. }, {
  207. 'id': '4',
  208. 'dictValue': '近12小时'
  209. }, {
  210. 'id': '5',
  211. 'dictValue': '近24小时'
  212. }],
  213. value: 0,
  214. },
  215. yjRainListPageSize: 10,
  216. yjRainListPageCurrent: 1,
  217. yjRainListTotal: 0,
  218. yjRainTableData: [],
  219. yjRainSearchRtuNameVal: '',
  220. yjRainSearchRtuCodeVal: '',
  221. //应急预警参数
  222. yjSearchWarnNameVal: '',
  223. yjSearchAdNameVal: '',
  224. yjWarnPageSize: 10,
  225. yjWarnPageCurrent: 1,
  226. yjWarnTotal: 0,
  227. yjWarnTableData: [],
  228. //应急危险区参数
  229. yjDangerAreaNameVal: '',
  230. yjDangerAreaAdNameVal: '',
  231. yjDangerAreaPageSize: 10,
  232. yjDangerAreaPageCurrent: 1,
  233. yjDangerAreaTotal: 0,
  234. yjDangerAreaTableData: [],
  235. yjDangerAreaRtus: [],
  236. yjDangerAreaLeaveLines: [],
  237. yjDangerAreas: [],
  238. }
  239. },
  240. computed: {
  241. toLocation(l) {
  242. return new Number(l).toFixed(6);
  243. }
  244. },
  245. onInit(option) {
  246. console.log("onInit" + JSON.stringify(uni.getWindowInfo()))
  247. },
  248. onLoad(option) {
  249. this.navButton = navBtns.navButtons;
  250. this.navButtonIndex = navBtns.orgAdminNavButton;
  251. this.$u.func.checkLoginExpires();
  252. if (this.isLogin) {
  253. }
  254. },
  255. onShow() {
  256. this.$u.func.checkLoginExpires();
  257. if (this.isLogin) {
  258. }
  259. },
  260. onReady() {
  261. console.log("onReady" + JSON.stringify(uni.getWindowInfo()))
  262. this.mapStyles.height = (uni.getWindowInfo().windowHeight - 75 - 20) + "px";
  263. },
  264. methods: {
  265. // 分页触发
  266. pageChange(e) {
  267. this.pageCurrent = e.current;
  268. this.getPage()
  269. },
  270. //行政区划选择
  271. onTreeNodeClick(node) {
  272. console.log(JSON.stringify(node))
  273. },
  274. onTreePopupOpened(e) {
  275. console.log(JSON.stringify(e))
  276. },
  277. onTreePopupClosed(e) {
  278. console.log(JSON.stringify(e))
  279. },
  280. onTreeChange(e) {
  281. console.log(JSON.stringify(e))
  282. let nodes = e.detail.value;
  283. if (nodes.length > 0) {
  284. let node = nodes[nodes.length - 1];
  285. this.regionCode = node.value;
  286. this.query = {};
  287. this.query['adCode'] = this.regionCode;
  288. this.searchRtuNameVal = '';
  289. this.searchRtuCodeVal = '';
  290. this.pageCurrent = 1;
  291. this.getPage();
  292. this.getCountInfo(this.regionCode);
  293. } else {
  294. this.regionCode = '';
  295. this.query = {};
  296. this.searchRtuNameVal = '';
  297. this.searchRtuCodeVal = '';
  298. this.pageCurrent = 1;
  299. this.getPage();
  300. this.getCountInfo(this.regionCode);
  301. }
  302. },
  303. //录入查询
  304. search() {
  305. this.pageCurrent = 1;
  306. // console.log(JSON.stringify(res))
  307. let params = {};
  308. if (this.searchRtuCodeVal.length > 0) {
  309. params['rtuCode'] = this.searchRtuCodeVal;
  310. }
  311. if (this.searchRtuNameVal.length > 0) {
  312. params['rtuName'] = this.searchRtuNameVal;
  313. }
  314. this.getPage(params);
  315. },
  316. searchRtuNameValClear(e) {
  317. if (e == null || e.length == 0) {
  318. this.searchRtuNameVal = '';
  319. let params = {};
  320. if (this.searchRtuCodeVal.length > 0) {
  321. params['rtuCode'] = this.searchRtuCodeVal;
  322. }
  323. this.getPage(params);
  324. }
  325. },
  326. searchRtuCodeValClear(e) {
  327. if (e == null || e.length == 0) {
  328. this.searchRtuCodeVal = '';
  329. let params = {};
  330. if (this.searchRtuNameVal.length > 0) {
  331. params['rtuName'] = this.searchRtuNameVal;
  332. }
  333. this.getPage(params);
  334. }
  335. },
  336. onBackPress() {
  337. // #ifdef APP-PLUS
  338. plus.key.hideSoftKeybord();
  339. // #endif
  340. },
  341. onRtuDetailClick(rtuCode) {
  342. uni.navigateTo({
  343. url: '/pages/rtu-manage/rtudetail?rtuCode=' + rtuCode
  344. })
  345. },
  346. onWarningPageClick(rtuCode) {
  347. uni.navigateTo({
  348. url: '/pages/warning/rtuwarninglist?rtuCode=' + rtuCode
  349. })
  350. },
  351. onLocationClick(item) {
  352. let lat = item.lat;
  353. let lng = item.lng;
  354. let name = item.rtuName;
  355. let add = item.locationDesc;
  356. uni.openLocation({
  357. latitude: Number(lat),
  358. longitude: Number(lng),
  359. name: name,
  360. address: "",
  361. success() {}
  362. })
  363. },
  364. onCheckOrderPageClick(rtuCode) {
  365. uni.navigateTo({
  366. url: '/pages/check-order/rtu/rtucheckorderlist?rtuCode=' + rtuCode
  367. })
  368. },
  369. onInspectionReportClick(rtuCode) {
  370. console.log("onInspectionReportClick")
  371. uni.navigateTo({
  372. url: '/pages/equipment-inspection/rtuinspectionreportview?rtuCode=' + rtuCode
  373. })
  374. },
  375. onSiteRealDataClick(item) {
  376. uni.navigateTo({
  377. url: '/pages/rtu-manage/rturealdatadetail?rtuCode=' + item.rtuCode + '&isRain=' + item.isRain +
  378. '&isRiver=' + item.isRiver + '&isRes=' + item.isRes + '&isGround=' + item.isGround,
  379. })
  380. },
  381. onManuallyOrderClick(rtuCode) {
  382. uni.navigateTo({
  383. url: '/pages/check-order/manuallyaddcheckorder?rtuCode=' + rtuCode
  384. })
  385. },
  386. warnKindOptionChange: function(evt) {
  387. let params = {};
  388. this.getPage(params);
  389. },
  390. getSiteData(val) {
  391. let htmltext = '';
  392. if (val.isRain === 1) {
  393. htmltext = htmltext + "降水:";
  394. if (val.drp) {
  395. htmltext = htmltext + val.drp;
  396. } else {
  397. htmltext = htmltext + "--";
  398. }
  399. }
  400. if (val.isRiver == 1) {
  401. if (htmltext.length > 0) {
  402. htmltext = htmltext + ' / ';
  403. }
  404. htmltext = htmltext + '水位:';
  405. if (val.rz) {
  406. htmltext = htmltext + val.rz;
  407. } else {
  408. htmltext = htmltext + "--";
  409. }
  410. } else if (val.isRes == 1) {
  411. if (htmltext.length > 0) {
  412. htmltext = htmltext + ' / ';
  413. }
  414. htmltext = htmltext + '水位:';
  415. if (val.z) {
  416. htmltext = htmltext + val.z;
  417. } else {
  418. htmltext = htmltext + "--";
  419. }
  420. }
  421. if (val.isGround == 1) {
  422. if (htmltext.length > 0) {
  423. htmltext = htmltext + ' / ';
  424. }
  425. htmltext = htmltext + '墒情含水层:';
  426. if (val.ground) {
  427. htmltext = htmltext + val.ground;
  428. } else {
  429. htmltext = htmltext + "--";
  430. }
  431. }
  432. return htmltext;
  433. },
  434. getRegionTree() {
  435. var that = this;
  436. http.request({
  437. url: '/galaxy-business/baseinfo/region/tree',
  438. method: 'GET',
  439. }).then(res => {
  440. if (res.data != null) {
  441. that.regionTree = res.data;
  442. that.regionCode = that.regionTree[0].id;
  443. that.selectedTreeNode = that.regionTree[0].id;
  444. that.query = {};
  445. that.query['adCode'] = that.regionCode;
  446. that.getPage();
  447. that.getCountInfo(that.regionCode);
  448. }
  449. }).catch(err => {
  450. console.log(err)
  451. })
  452. },
  453. getCountInfo(adCode) {
  454. let that = this;
  455. http.request({
  456. url: '/galaxy-business/rtu/manage/count',
  457. method: 'GET',
  458. data: {
  459. adCode
  460. }
  461. }).then(res => {
  462. that.countInfo = res.data;
  463. })
  464. },
  465. getPage(params = {}) {
  466. this.loading = true
  467. if (this.warnKindOption == 0) {} else {
  468. params['warnKind'] = this.warnKindOption;
  469. }
  470. const current = this.pageCurrent;
  471. const size = this.pageSize;
  472. let postData = Object.assign(params, this.query);
  473. var that = this;
  474. http.request({
  475. url: '/galaxy-business/rtu/manage/page',
  476. method: 'GET',
  477. params: {
  478. current,
  479. size,
  480. },
  481. data: postData,
  482. }).then(res => {
  483. // console.log(JSON.stringify(res.data))
  484. if (res.data.records != null) {
  485. that.list = res.data.records;
  486. }
  487. that.total = res.data.total;
  488. this.loading = false
  489. }).catch(err => {
  490. console.log(err)
  491. this.loading = false
  492. })
  493. },
  494. //以下为应急系统业务功能
  495. trigger(e) {
  496. let that = this;
  497. this.content[0].active = false;
  498. this.content[1].active = false;
  499. this.content[2].active = false;
  500. this.content[e.index].active = !e.item.active
  501. this.popBoxIndex = e.index + 1;
  502. this.$refs.yjDrawerRef.open()
  503. // if (this.$refs.fab.isShow) {
  504. // this.$refs.fab.close()
  505. // }
  506. this.$nextTick(() => {
  507. if (that.popBoxIndex == 1) {
  508. that.yjDangerAreaCoverView = 0;
  509. that.yjRtuCoverView = 0;
  510. that.yjDangerAreaLineCoverView = 0;
  511. that.getYjRainDataPage();
  512. } else if (that.popBoxIndex == 2) {
  513. that.yjDangerAreaCoverView = 0;
  514. that.yjRtuCoverView = 0;
  515. that.yjDangerAreaLineCoverView = 0;
  516. that.getYjWarnDataPage();
  517. } else if (that.popBoxIndex == 3) {
  518. that.yjDangerAreaCoverView = 1;
  519. that.yjRtuCoverView = 1;
  520. that.yjDangerAreaLineCoverView = 1;
  521. that.getYjDangerAreaDataPage();
  522. }
  523. })
  524. },
  525. fabClick() {
  526. // this.popMenu = !this.popMenu
  527. // if (!this.popMenu) {
  528. // this.content[0].active = false;
  529. // this.content[1].active = false;
  530. // this.content[2].active = false;
  531. // }
  532. },
  533. yjPopMenuClose() {
  534. // this.popMenu = false;
  535. // this.content[0].active = false;
  536. // this.content[1].active = false;
  537. // this.content[2].active = false;
  538. // if (this.$refs.fab.isShow) {
  539. // this.$refs.fab.close()
  540. // }
  541. this.$refs.yjDrawerRef.close();
  542. },
  543. //雨量数据业务
  544. yjRainListPageChange(e) {
  545. this.yjRainListPageCurrent = e.current;
  546. this.getYjRainDataPage()
  547. },
  548. yjRainDataSearch() {
  549. let params = {};
  550. if (this.yjRainSearchRtuCodeVal.length > 0) {
  551. params['rtuCode'] = this.yjRainSearchRtuCodeVal;
  552. }
  553. if (this.yjRainSearchRtuNameVal.length > 0) {
  554. params['rtuName'] = this.yjRainSearchRtuNameVal;
  555. }
  556. this.getYjRainDataPage(params);
  557. },
  558. getYjRainDataPage(params = {}) {
  559. const current = this.yjRainListPageCurrent;
  560. const size = this.yjRainListPageSize;
  561. const isSubmit = '0';
  562. if (this.yjRainCountType.value == 1) {
  563. params['rainCountType'] = 1;
  564. } else if (this.yjRainCountType.value == 2) {
  565. params['rainCountType'] = 3;
  566. } else if (this.yjRainCountType.value == 3) {
  567. params['rainCountType'] = 6;
  568. } else if (this.yjRainCountType.value == 4) {
  569. params['rainCountType'] = 12;
  570. } else if (this.yjRainCountType.value == 5) {
  571. params['rainCountType'] = 24;
  572. } else {
  573. params['rainCountType'] = 0;
  574. }
  575. let postData = Object.assign(params, this.query);
  576. console.log(JSON.stringify(postData))
  577. var that = this;
  578. http.request({
  579. url: '/galaxy-business/rtu/data/rain/yj/page',
  580. method: 'GET',
  581. params: {
  582. current,
  583. size,
  584. isSubmit
  585. },
  586. data: postData,
  587. }).then(res => {
  588. if (res.data.records != null) {
  589. that.yjRainTableData = res.data.records;
  590. }
  591. that.yjRainListTotal = res.data.total;
  592. if (that.yjRainListTotal == 0) {
  593. that.yjRainListPageCurrent = 1;
  594. }
  595. }).catch(err => {
  596. console.log(err)
  597. })
  598. },
  599. onYjRainCountTypeRadioChange: function(evt) {
  600. for (let i = 0; i < this.yjRainCountType.items.length; i++) {
  601. if (this.yjRainCountType.items[i].id === evt.detail.value) {
  602. this.yjRainCountType.value = i;
  603. //this.getYjRainDataPage();
  604. break;
  605. }
  606. }
  607. },
  608. yjRainSearchRtuNameValClear(e) {
  609. if (e == null || e.length == 0) {
  610. this.yjRainSearchRtuNameVal = '';
  611. }
  612. },
  613. yjRainSearchRtuCodeValClear(e) {
  614. if (e == null || e.length == 0) {
  615. this.yjRainSearchRtuCodeValL = '';
  616. }
  617. },
  618. onYjRainDataRtuClick(item) {
  619. this.$refs.yjDrawerRef.close();
  620. let that = this;
  621. this.$nextTick(() => {
  622. that.yjMapMarkers = [];
  623. let marker = {};
  624. marker['id'] = item.id;
  625. marker['latitude'] = item.lat;
  626. marker['longitude'] = item.lng;
  627. let label = {};
  628. label['content'] = item.rtuName + "(" + item.drp + "mm)";
  629. label['color'] = '#ff0000';
  630. label['bgColor'] = '#ffffff';
  631. label['anchorY'] = -40;
  632. marker['label'] = label;
  633. marker['iconPath'] = "/static/images/icon_warning.png";
  634. that.yjMapMarkers.push(marker)
  635. that.latitude = item.lat;
  636. that.longitude = item.lng;
  637. })
  638. },
  639. //应急预警信息
  640. yjSearchWarnNameValClear(e) {
  641. if (e == null || e.length == 0) {
  642. this.yjSearchWarnNameVal = '';
  643. }
  644. },
  645. yjSearchAdNameValClear(e) {
  646. if (e == null || e.length == 0) {
  647. this.yjSearchAdNameVal = '';
  648. }
  649. },
  650. yjWarnPageChange(e) {
  651. this.yjDangerAreaPageCurrent = e.current;
  652. this.getYjWarnDataPage()
  653. },
  654. onYjWarnDataRtuClick(item) {
  655. this.$refs.yjDrawerRef.close();
  656. let that = this;
  657. this.$nextTick(() => {
  658. that.yjMapMarkers = [];
  659. let marker = {};
  660. marker['id'] = item.id;
  661. marker['latitude'] = item.warnLttd;
  662. marker['longitude'] = item.warnLgtd;
  663. let label = {};
  664. label['content'] = item.warnName;
  665. label['color'] = '#ff0000';
  666. label['bgColor'] = '#ffffff';
  667. label['anchorY'] = -40;
  668. marker['label'] = label;
  669. marker['iconPath'] = "/static/images/icon_warning.png";
  670. that.yjMapMarkers.push(marker)
  671. that.latitude = item.warnLttd;
  672. that.longitude = item.warnLgtd;
  673. })
  674. },
  675. yjWarnDataSearch() {
  676. let params = {};
  677. if (this.yjSearchWarnNameVal.length > 0) {
  678. params['warnName'] = this.yjSearchWarnNameVal;
  679. }
  680. if (this.yjSearchAdNameVal.length > 0) {
  681. params['dangerAreaName'] = this.yjSearchAdNameVal;
  682. }
  683. this.getYjWarnDataPage(params);
  684. },
  685. getYjWarnDataPage(params = {}) {
  686. const current = this.yjWarnPageCurrent;
  687. const size = this.yjWarnPageSize;
  688. const isSubmit = '0';
  689. let postData = Object.assign(params, this.query);
  690. let that = this;
  691. http.request({
  692. url: '/galaxy-business/yj/warn/page',
  693. method: 'GET',
  694. params: {
  695. current,
  696. size,
  697. },
  698. data: postData,
  699. }).then(res => {
  700. if (res.data.records != null) {
  701. that.yjWarnTableData = res.data.records;
  702. }
  703. that.yjWarnTotal = res.data.total;
  704. if (that.yjWarnTotal == 0) {
  705. that.yjWarnPageCurrent = 1;
  706. }
  707. }).catch(err => {
  708. console.log(err)
  709. })
  710. },
  711. //应急危险区业务
  712. yjDangerAreaNameValClear(e) {
  713. if (e == null || e.length == 0) {
  714. this.yjDangerAreaNameVal = '';
  715. }
  716. },
  717. yjDangerAreaAdNameValClear(e) {
  718. if (e == null || e.length == 0) {
  719. this.yjDangerAreaAdNameVal = '';
  720. }
  721. },
  722. yjDangerAreaDataSearch() {
  723. let params = {};
  724. if (this.yjDangerAreaNameVal.length > 0) {
  725. params['dangerAreaName'] = this.yjDangerAreaNameVal;
  726. }
  727. if (this.yjDangerAreaAdNameVal.length > 0) {
  728. params['adName'] = this.yjDangerAreaAdNameVal;
  729. }
  730. this.getYjDangerAreaDataPage(params);
  731. },
  732. yjDangerAreaPageChange(e) {
  733. this.yjDangerAreaPageCurrent = e.current;
  734. this.getYjDangerAreaDataPage()
  735. },
  736. getYjDangerAreaDataPage(params = {}) {
  737. const current = this.yjDangerAreaPageCurrent;
  738. const size = this.yjDangerAreaPageSize;
  739. const isSubmit = '0';
  740. let postData = Object.assign(params, this.query);
  741. let that = this;
  742. http.request({
  743. url: '/galaxy-business/map/dangerarea/page',
  744. method: 'GET',
  745. params: {
  746. current,
  747. size,
  748. },
  749. data: postData,
  750. }).then(res => {
  751. if (res.data.records != null) {
  752. that.yjDangerAreaTableData = res.data.records;
  753. }
  754. that.yjDangerAreaTotal = res.data.total;
  755. if (that.yjDangerAreaTotal == 0) {
  756. that.yjDangerAreaPageCurrent = 1;
  757. }
  758. }).catch(err => {
  759. console.log(err)
  760. })
  761. },
  762. yjDangerAreaDataClick(item) {
  763. this.$refs.yjDrawerRef.close();
  764. let that = this;
  765. this.yjDangerAreas = [];
  766. let d = {};
  767. d['id'] = item.id;
  768. d['dangerAreaName'] = item.dangerAreaName;
  769. d['lng'] = item.centerPointLng;
  770. d['lat'] = item.centerPointLat;
  771. this.yjDangerAreas.push(d);
  772. this.$nextTick(() => {
  773. let c = gcoord.transform(
  774. [item.centerPointLng, item.centerPointLat],
  775. gcoord.WGS84,
  776. gcoord.GCJ02
  777. );
  778. that.latitude = c[1];
  779. that.longitude = c[0];
  780. this.scale = 14;
  781. that.getDangerAreaDataGcoord(item.id);
  782. })
  783. },
  784. getDangerAreaDataGcoord(id) {
  785. let that = this;
  786. let postData = {};
  787. postData['id'] = id;
  788. http.request({
  789. url: '/galaxy-business/map/dangerarea/detail',
  790. method: 'GET',
  791. data: postData
  792. }).then(res => {
  793. if (res.data != null) {
  794. that.includepoints = [];
  795. that.polygons = [];
  796. let p = {};
  797. let ps = res.data.points.map(item => {
  798. let l = gcoord.transform(
  799. [item.pointLng, item.pointLat],
  800. gcoord.WGS84,
  801. gcoord.GCJ02
  802. );
  803. return {
  804. latitude: l[1],
  805. longitude: l[0],
  806. }
  807. })
  808. p['points'] = ps;
  809. that.includepoints.push(ps[0]);
  810. let dashArray = [];
  811. dashArray.push(4);
  812. dashArray.push(10);
  813. p['dashArray'] = dashArray;
  814. if (res.data.dangerStatus == '1') {
  815. p['strokeColor'] = '#FF0000';
  816. p['fillColor'] = '#F72C5B7D';
  817. } else {
  818. p['strokeColor'] = '#FC8452';
  819. p['fillColor'] = '#FAC8587D';
  820. }
  821. that.polygons.push(p);
  822. that.yjMapMarkers = [];
  823. let rtus = res.data.rtus.map(item => {
  824. let rtu = {};
  825. rtu['id'] = item.id;
  826. rtu['latitude'] = item.lat;
  827. rtu['longitude'] = item.lng;
  828. rtu['rtuName'] = item.rtuName;
  829. rtu['rtuCode'] = item.rtuCode;
  830. return rtu;
  831. });
  832. that.yjDangerAreaRtus = rtus;
  833. let leaveLines = res.data.leaveLines.map(item => {
  834. let line = {};
  835. line['id'] = item.id;
  836. line['latitude'] = new Number(item.centerPointLat).toFixed(6);
  837. line['longitude'] = new Number(item.centerPointLng).toFixed(6);
  838. line['leaveLineName'] = item.leaveLineName;
  839. return line;
  840. });
  841. that.yjDangerAreaLeaveLines = leaveLines;
  842. that.scale = 14;
  843. }
  844. }).catch(err => {
  845. console.log(err)
  846. })
  847. },
  848. yjDangerAreaLinkRtuClick(item) {
  849. this.yjMapMarkers = [];
  850. let marker = {};
  851. marker['id'] = item.id;
  852. let l = gcoord.transform(
  853. [item.longitude, item.latitude],
  854. gcoord.WGS84,
  855. gcoord.GCJ02
  856. );
  857. marker['latitude'] = l[1];
  858. marker['longitude'] = l[0];
  859. let label = {};
  860. label['content'] = item.rtuName;
  861. label['color'] = '#ff0000';
  862. label['bgColor'] = '#ffffff';
  863. label['anchorY'] = -40;
  864. marker['label'] = label;
  865. marker['iconPath'] = "/static/images/icon_warning.png";
  866. this.yjMapMarkers.push(marker)
  867. this.latitude = item.latitude;
  868. this.longitude = item.longitude;
  869. this.scale = 12;
  870. },
  871. yjDangerAreaLinkLineClick(item) {
  872. let that = this;
  873. this.polylines = [];
  874. this.yjMapMarkers = [];
  875. this.polygons = [];
  876. let c = gcoord.transform(
  877. [item.longitude, item.latitude],
  878. gcoord.WGS84,
  879. gcoord.GCJ02
  880. );
  881. this.latitude = c[1];
  882. this.longitude = c[0];
  883. this.scale = 16;
  884. let id = item.id;
  885. this.$nextTick(() => {
  886. that.getYjDangerAreaLineDetail(id);
  887. })
  888. },
  889. getYjDangerAreaLineDetail(id) {
  890. let that = this;
  891. let postData = {};
  892. postData['id'] = id;
  893. http.request({
  894. url: '/galaxy-business/map/leaveline/detail',
  895. method: 'GET',
  896. data: postData
  897. }).then(res => {
  898. if (res.data != null) {
  899. let p = {};
  900. let ps = res.data.points.map(item => {
  901. let l = gcoord.transform(
  902. [item.pointLng, item.pointLat],
  903. gcoord.WGS84,
  904. gcoord.GCJ02
  905. );
  906. return {
  907. latitude: l[1],
  908. longitude: l[0],
  909. }
  910. })
  911. p['points'] = ps;
  912. p['color'] = '#ee0000';
  913. that.polylines.push(p);
  914. }
  915. }).catch(err => {
  916. console.log(err)
  917. })
  918. },
  919. yjDangerAreaClick(item) {
  920. let that = this;
  921. this.polylines = [];
  922. this.yjMapMarkers = [];
  923. this.polygons = [];
  924. this.$nextTick(() => {
  925. let c = gcoord.transform(
  926. [item.lng, item.lat],
  927. gcoord.WGS84,
  928. gcoord.GCJ02
  929. );
  930. that.latitude = c[1];
  931. that.longitude = c[0];
  932. this.scale = 14;
  933. that.getDangerAreaDataGcoord(item.id);
  934. })
  935. }
  936. }
  937. }
  938. </script>
  939. <style lang="scss" scoped>
  940. $nav-height: 75px;
  941. .nav {
  942. margin: 0rpx 0;
  943. box-sizing: border-box;
  944. padding: 0 10rpx;
  945. &-item {
  946. width: 100%;
  947. box-sizing: border-box;
  948. display: flex;
  949. flex-direction: column;
  950. align-items: center;
  951. justify-content: space-between;
  952. height: 130rpx;
  953. &-img {
  954. width: 80rpx;
  955. height: 80rpx;
  956. }
  957. &-name {
  958. font-size: 0.7rem;
  959. font-family: PingFang SC;
  960. font-weight: 500;
  961. color: #585b61;
  962. }
  963. }
  964. }
  965. .select-checkbox {
  966. margin-top: 0px;
  967. margin-bottom: 5px;
  968. padding-left: 15px;
  969. }
  970. .count-info-line {
  971. padding-top: 5px;
  972. padding-bottom: 5px;
  973. padding-left: 10px;
  974. padding-right: 10px;
  975. display: flex;
  976. flex-direction: row;
  977. align-items: center;
  978. }
  979. .count-info-line .rtuCount {
  980. display: flex;
  981. flex-direction: row;
  982. align-items: center;
  983. .name {
  984. color: dimgray;
  985. font-size: 0.7rem;
  986. }
  987. .count {
  988. margin-left: 5px;
  989. color: dodgerblue;
  990. font-size: 0.7rem;
  991. }
  992. }
  993. .count-info-line .warnRtuCount {
  994. margin-left: 10px;
  995. display: flex;
  996. flex-direction: row;
  997. align-items: center;
  998. .name {
  999. color: dimgray;
  1000. font-size: 0.7rem;
  1001. }
  1002. .count {
  1003. margin-left: 5px;
  1004. color: red;
  1005. font-size: 0.7rem;
  1006. }
  1007. }
  1008. .scroll-view {
  1009. /* #ifndef APP-NVUE */
  1010. width: 100%;
  1011. height: 100%;
  1012. /* #endif */
  1013. flex: 1
  1014. }
  1015. // 处理抽屉内容滚动
  1016. .scroll-view-box {
  1017. flex: 1;
  1018. position: absolute;
  1019. top: 0;
  1020. right: 0;
  1021. bottom: 0;
  1022. left: 0;
  1023. }
  1024. </style>