manage.vue 25 KB

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