rtumanage.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435
  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="#3F9EFF" statusBar="false" height="75px">
  12. <view style="width:100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
  13. <text style="color: #ffffff; font-size: 1rem;font-family: Microsoft YaHei;">{{title}}</text>
  14. </view>
  15. </uni-nav-bar>
  16. <view v-if="subSystem == 1">
  17. <uni-section title="查询" type="line">
  18. <view class="search-block">
  19. <view class="adcd-adnm">
  20. <uni-data-picker placeholder="请选择地区" popup-title="请选择所在地区" :localdata="regionTree"
  21. v-model="selectedTreeNode" @change="onTreeChange" @nodeclick="onTreeNodeClick"
  22. @popupopened="onTreePopupOpened" @popupclosed="onTreePopupClosed" :clear-icon="false">
  23. </uni-data-picker>
  24. </view>
  25. <view class="rtu-code">
  26. <uni-easyinput :styles="inputStyles" @input="searchRtuCodeValClear" prefixIcon="search"
  27. v-model="searchRtuCodeVal" placeholder="请输入测站编码">
  28. </uni-easyinput>
  29. </view>
  30. <view class="rtu-name">
  31. <uni-easyinput :styles="inputStyles" @input="searchRtuNameValClear" prefixIcon="search"
  32. v-model="searchRtuNameVal" placeholder="请输入测站名称">
  33. </uni-easyinput>
  34. </view>
  35. <view class="submit-btn">
  36. <button type="default" @click="search">查 询</button>
  37. </view>
  38. </view>
  39. </uni-section>
  40. <view class="count-info-line">
  41. <view class="rtuCount">
  42. <span class="name">测站数量: </span>
  43. <span v-if="countInfo.rtuCount" class="count">{{ countInfo.rtuCount }}</span>
  44. </view>
  45. <view class="warnRtuCount">
  46. <span class="name">异常测站数量: </span>
  47. <span v-if="countInfo.warningRtuCount" class="count">{{
  48. countInfo.warningRtuCount }}</span>
  49. </view>
  50. </view>
  51. <view style="padding-left: 0px;padding-right: 0px;">
  52. <uni-collapse v-model="value">
  53. <uni-collapse-item title="异常类别筛选条件" :show-animation="true">
  54. <view class="select-checkbox">
  55. <uni-data-checkbox v-model="warnKindOption" :localdata="warnKindItems"
  56. @change="warnKindOptionChange">
  57. </uni-data-checkbox>
  58. </view>
  59. </uni-collapse-item>
  60. </uni-collapse>
  61. </view>
  62. <uni-list>
  63. <uni-list-item v-for="item in list" :key="item.id">
  64. <template v-slot:body>
  65. <view class="list-item-block">
  66. <uni-row>
  67. <uni-col :span="20">
  68. <view class="items-line">
  69. <image v-if="item.runStatusId==1" class="item-title-run-status-icon"
  70. mode="widthFix" src="/static/images/icon_warning.png">
  71. </image>
  72. <image v-else class="item-title-run-status-icon" mode="widthFix"
  73. src="/static/images/icon_ok.png">
  74. </image>
  75. <text class="item-title-rtu-name">{{item.rtuName}}</text>
  76. <text class="item-title-rtu-code">[{{item.rtuCode}}]</text>
  77. </view>
  78. </uni-col>
  79. <uni-col :span="4">
  80. <view class="items-line" style="padding-top: 5px;"
  81. @click="onRtuDetailClick(item.rtuCode)">
  82. <text
  83. style="text-decoration-line: underline;font-size: 0.6rem;color:gray;">测站信息</text>
  84. </view>
  85. </uni-col>
  86. </uni-row>
  87. <view class="items-line">
  88. <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
  89. <text class="item-up-time-text">最后上线时间:</text>
  90. <text class="item-up-time-text">{{item.lastUpTime}}</text>
  91. </view>
  92. <view v-if="item.runStatusId==1" class="items-line">
  93. <uni-icons class="input-uni-icon" type="bars" size="18" color="lightblue" />
  94. <text class="item-up-time-text">异常类型:</text>
  95. <text class="item-up-time-text">{{item.warnKindInfo}}</text>
  96. </view>
  97. <view class="items-line">
  98. <uni-icons class="input-uni-icon" type="location" size="18" color="lightblue" />
  99. <text class="item-adcd-adnm-text">{{item.areaName}}</text>
  100. </view>
  101. <view class="item-button-group">
  102. <view class="item-button" @click="onLocationClick(item)">
  103. <view class="items-line">
  104. <uni-icons class="input-uni-icon" type="location" size="18" color="coral" />
  105. <text class="button-text">导航</text>
  106. </view>
  107. </view>
  108. <view class="item-button" @click="onWarningPageClick(item.rtuCode)">
  109. <view class="items-line">
  110. <uni-icons class="input-uni-icon" type="gear" size="18" color="coral" />
  111. <text class="button-text">异常信息</text>
  112. </view>
  113. </view>
  114. <view class="item-button" @click="onCheckOrderPageClick(item.rtuCode)">
  115. <view class="items-line">
  116. <uni-icons class="input-uni-icon" type="gear" size="18" color="coral" />
  117. <text class="button-text">维修任务</text>
  118. </view>
  119. </view>
  120. <view class="item-button" @click="onInspectionReportClick(item.rtuCode)">
  121. <view class="items-line">
  122. <uni-icons class="input-uni-icon" type="reload" size="18" color="coral" />
  123. <text class="button-text">设备巡检</text>
  124. </view>
  125. </view>
  126. <view class="item-button" @click="onSiteRealDataClick(item)">
  127. <view class="items-line">
  128. <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
  129. <text class="button-text">实时数据</text>
  130. </view>
  131. </view>
  132. <view v-if="permission.admin || permission.orgAdmin" class="item-button"
  133. @click="onManuallyOrderClick(item.rtuCode)">
  134. <view class="items-line">
  135. <uni-icons class="input-uni-icon" type="email" size="18" color="coral" />
  136. <text class="button-text">人工派单</text>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. </template>
  142. </uni-list-item>
  143. </uni-list>
  144. <uni-group>
  145. <view class="pagination-block">
  146. <uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  147. @change="pageChange" />
  148. </view>
  149. </uni-group>
  150. </view>
  151. <!-- 应急系统 -->
  152. <view v-else-if="subSystem == 2">
  153. <view class="page-body">
  154. <uni-drawer ref="yjDrawerRef" :width="yjDrawerWidth" mode="left">
  155. <view v-if="popBoxIndex ===1">
  156. <view class="scroll-view">
  157. <scroll-view class="scroll-view-box" scroll-y="true">
  158. <uni-section title="实时雨情" titleFontSize="0.8rem" type="line">
  159. <template v-slot:right>
  160. <view class="view-flex-inline" style="margin-right: 10px;"
  161. @click="yjPopMenuClose">
  162. <view class="text-under-line" style="color: blue;">关闭</view>
  163. </view>
  164. </template>
  165. <view class="search-block">
  166. <view class="rtu-code">
  167. <uni-easyinput :styles="inputStyles" @input="yjRainSearchRtuCodeValClear"
  168. prefixIcon="search" v-model="yjRainSearchRtuCodeVal"
  169. placeholder="请输入测站编码">
  170. </uni-easyinput>
  171. </view>
  172. <view class="rtu-name">
  173. <uni-easyinput :styles="inputStyles" @input="yjRainSearchRtuNameValClear"
  174. prefixIcon="search" v-model="yjRainSearchRtuNameVal"
  175. placeholder="请输入测站名称">
  176. </uni-easyinput>
  177. </view>
  178. <uni-group>
  179. <radio-group @change="onYjRainCountTypeRadioChange" class="view-flex-rs">
  180. <label style="margin-right: 5px;margin-bottom: 5px;;width:100px;"
  181. class="view-flex-inline"
  182. v-for="(item, index) in yjRainCountType.items" :key="item.id">
  183. <view>
  184. <radio :value="item.id"
  185. :checked="index === yjRainCountType.value" />
  186. </view>
  187. <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
  188. </label>
  189. </radio-group>
  190. </uni-group>
  191. <view class="submit-btn">
  192. <button type="default" @click="yjRainDataSearch">查 询</button>
  193. </view>
  194. </view>
  195. <uni-list style="min-height: 40px;">
  196. <uni-list-item v-for="item in yjRainTableData" :key="item.id">
  197. <template v-slot:body>
  198. <view class="list-item-block">
  199. <view class="view-flex-inline" @click="onYjRainDataRtuClick(item)">
  200. <view
  201. class="list-item-title list-item-text-ellipsis text-under-line"
  202. style="color: blue;">
  203. {{item.rtuName}}
  204. </view>
  205. </view>
  206. <view class="view-flex-inline">
  207. <text class="list-item-text" style="color: gray;">累计雨量:</text>
  208. <text class="list-item-text"
  209. style="color: coral;margin-left: 5px;">{{item.drp}}
  210. mm</text>
  211. </view>
  212. </view>
  213. </template>
  214. </uni-list-item>
  215. </uni-list>
  216. <uni-group>
  217. <view class="pagination-block" style="margin-top: 5px;">
  218. <uni-pagination :page-size="yjRainListPageSize"
  219. :current="yjRainListPageCurrent" :total="yjRainListTotal"
  220. @change="yjRainListPageChange" prevText="前一页" nextText="后一页" />
  221. </view>
  222. </uni-group>
  223. </uni-section>
  224. </scroll-view>
  225. </view>
  226. </view>
  227. <view v-if="popBoxIndex ===2">
  228. <view class="scroll-view">
  229. <scroll-view class="scroll-view-box" scroll-y="true">
  230. <uni-section title="预警信息" titleFontSize="0.8rem" type="line">
  231. <template v-slot:right>
  232. <view class="view-flex-inline" style="margin-right: 10px;"
  233. @click="yjPopMenuClose">
  234. <view class="text-under-line" style="color: blue;">关闭</view>
  235. </view>
  236. </template>
  237. <view class="search-block">
  238. <view class="rtu-name">
  239. <uni-easyinput :styles="inputStyles" @input="yjSearchWarnNameValClear"
  240. prefixIcon="search" v-model="yjSearchWarnNameVal" placeholder="请输入预警名称">
  241. </uni-easyinput>
  242. </view>
  243. <view class="rtu-name">
  244. <uni-easyinput :styles="inputStyles" @input="yjSearchAdNameValClear"
  245. prefixIcon="search" v-model="yjSearchAdNameVal" placeholder="请输入行政区名称">
  246. </uni-easyinput>
  247. </view>
  248. <view class="submit-btn">
  249. <button type="default" @click="yjWarnDataSearch">查 询</button>
  250. </view>
  251. </view>
  252. <uni-list style="min-height: 40px;">
  253. <uni-list-item v-for="item in yjWarnTableData" :key="item.id">
  254. <template v-slot:body>
  255. <view class="list-item-block">
  256. <view class="view-flex-inline" @click="onYjWarnDataRtuClick(item)">
  257. <view
  258. class="list-item-title list-item-text-ellipsis text-under-line"
  259. style="color: blue;">
  260. {{item.warnName}}
  261. </view>
  262. </view>
  263. <view class="view-flex-inline">
  264. <text class="list-item-text"
  265. style="margin-left: 0px;color: gray;">预警信息:{{item.warnInfo}}</text>
  266. </view>
  267. <view class="view-flex-inline">
  268. <text class="list-item-text"
  269. style="color: gray;">预警时间:{{item.warnTime}}</text>
  270. </view>
  271. <view class="view-flex-inline">
  272. <text class="list-item-text"
  273. style="color: gray;">行政区:</text>
  274. </view>
  275. </view>
  276. </template>
  277. </uni-list-item>
  278. </uni-list>
  279. <uni-group>
  280. <view class="pagination-block" style="margin-top: 5px;">
  281. <uni-pagination :page-size="yjWarnPageSize" :current="yjWarnPageCurrent"
  282. :total="yjWarnTotal" @change="yjWarnPageChange" prevText="前一页"
  283. nextText="后一页" />
  284. </view>
  285. </uni-group>
  286. </uni-section>
  287. </scroll-view>
  288. </view>
  289. </view>
  290. <view v-if="popBoxIndex ===3">
  291. <view class="scroll-view">
  292. <scroll-view class="scroll-view-box" scroll-y="true">
  293. <uni-section title="危险区信息" titleFontSize="0.8rem" type="line">
  294. <template v-slot:right>
  295. <view class="view-flex-inline" style="margin-right: 10px;"
  296. @click="yjPopMenuClose">
  297. <view class="text-under-line" style="color: blue;">关闭</view>
  298. </view>
  299. </template>
  300. <view class="search-block">
  301. <view class="rtu-name">
  302. <uni-easyinput :styles="inputStyles" @input="yjDangerAreaNameValClear"
  303. prefixIcon="search" v-model="yjDangerAreaNameVal"
  304. placeholder="请输入危险区名称">
  305. </uni-easyinput>
  306. </view>
  307. <view class="rtu-name">
  308. <uni-easyinput :styles="inputStyles" @input="yjDangerAreaAdNameValClear"
  309. prefixIcon="search" v-model="yjDangerAreaAdNameVal"
  310. placeholder="请输入行政区名称">
  311. </uni-easyinput>
  312. </view>
  313. <view class="submit-btn">
  314. <button type="default" @click="yjDangerAreaDataSearch">查 询</button>
  315. </view>
  316. </view>
  317. <uni-list style="min-height: 40px;">
  318. <uni-list-item v-for="item in yjDangerAreaTableData" :key="item.id">
  319. <template v-slot:body>
  320. <view class="list-item-block">
  321. <view class="view-flex-inline" @click="yjDangerAreaDataClick(item)">
  322. <view
  323. class="list-item-title list-item-text-ellipsis text-under-line"
  324. style="color: blue;">
  325. {{item.dangerAreaName}}
  326. </view>
  327. </view>
  328. <view class="view-flex-inline">
  329. <text class="list-item-text list-item-text-ellipsis"
  330. style="color: gray;">测站名称:{{item.rtuName}}</text>
  331. </view>
  332. <view class="view-flex-inline">
  333. <text class="list-item-text list-item-text-ellipsis"
  334. style="color: gray;">行政区:{{item.adnm}}</text>
  335. </view>
  336. <!-- <view class="view-flex-inline">
  337. <text class="list-item-text"
  338. style="color: gray;">经纬度:{{item.centerPointLng)}},{{toLocation(item.centerPointLat)}}</text>
  339. </view> -->
  340. </view>
  341. </template>
  342. </uni-list-item>
  343. </uni-list>
  344. <uni-group>
  345. <view class="pagination-block" style="margin-top: 5px;">
  346. <uni-pagination :page-size="yjDangerAreaPageSize"
  347. :current="yjDangerAreaPageCurrent" :total="yjDangerAreaTotal"
  348. @change="yjDangerAreaPageChange" prevText="前一页" nextText="后一页" />
  349. </view>
  350. </uni-group>
  351. </uni-section>
  352. </scroll-view>
  353. </view>
  354. </view>
  355. </uni-drawer>
  356. <view class="page-section page-section-gap">
  357. <map ref="mapId" :style="mapStyles" :latitude="latitude" :longitude="longitude"
  358. :markers="yjMapMarkers" :polygons="polygons" :scale="scale" :polyline="polylines">
  359. <cover-view v-if="yjDangerAreaCoverView==1" style="width: 200px;background-color: gray;">
  360. <uni-section title="危险区" type="line">
  361. <uni-list style="min-height: 40px;">
  362. <uni-list-item v-for="item in yjDangerAreas" :key="item.id">
  363. <template v-slot:body>
  364. <view class="list-item-block">
  365. <view class="view-flex-inline" @click="yjDangerAreaClick(item)">
  366. <view
  367. class="list-item-title list-item-text-ellipsis text-under-line"
  368. style="color: blue;">
  369. {{item.dangerAreaName}}
  370. </view>
  371. </view>
  372. </view>
  373. </template>
  374. </uni-list-item>
  375. </uni-list>
  376. </uni-section>
  377. </cover-view>
  378. <cover-view v-if="yjRtuCoverView==1" style="width: 200px;background-color: gray;">
  379. <uni-section title="关联站点" type="line">
  380. <uni-list style="min-height: 40px;">
  381. <uni-list-item v-for="item in yjDangerAreaRtus" :key="item.id">
  382. <template v-slot:body>
  383. <view class="list-item-block">
  384. <view class="view-flex-inline" @click="yjDangerAreaLinkRtuClick(item)">
  385. <view
  386. class="list-item-title list-item-text-ellipsis text-under-line"
  387. style="color: blue;">
  388. {{item.rtuName}}
  389. </view>
  390. </view>
  391. </view>
  392. </template>
  393. </uni-list-item>
  394. </uni-list>
  395. </uni-section>
  396. </cover-view>
  397. <cover-view v-if="yjDangerAreaLineCoverView==1" style="width: 200px;background-color: gray;">
  398. <uni-section title="转移路线" type="line">
  399. <uni-list style="min-height: 40px;">
  400. <uni-list-item v-for="item in yjDangerAreaLeaveLines" :key="item.id">
  401. <template v-slot:body>
  402. <view class="list-item-block">
  403. <view class="view-flex-inline" @click="yjDangerAreaLinkLineClick(item)">
  404. <view
  405. class="list-item-title list-item-text-ellipsis text-under-line"
  406. style="color: blue;">
  407. {{item.leaveLineName}}
  408. </view>
  409. </view>
  410. </view>
  411. </template>
  412. </uni-list-item>
  413. </uni-list>
  414. </uni-section>
  415. </cover-view>
  416. </map>
  417. </view>
  418. <uni-fab ref="fab" :pattern="pattern" :content="content" :horizontal="horizontal" :vertical="vertical"
  419. :direction="direction" @trigger="trigger" @fabClick="fabClick" />
  420. </view>
  421. </view>
  422. <view v-else></view>
  423. </view>
  424. </template>
  425. <script>
  426. import {
  427. gcoord
  428. } from '@/static/js/gcoord.global.prod.js'
  429. import
  430. navBtns
  431. from "@/api/home.js";
  432. import {
  433. role
  434. } from "@/api/role.js";
  435. import http from '@/http/api.js';
  436. export default {
  437. name: '',
  438. components: {
  439. },
  440. data() {
  441. return {
  442. title: '管理工作台',
  443. permission: {
  444. 'admin': false,
  445. 'orgAdmin': false,
  446. 'companyAdmin': false,
  447. 'companyServciePerson': false,
  448. 'yjServicePerson': false,
  449. },
  450. currentRole: '',
  451. subSystem: 0,
  452. barcurrent: 1,
  453. pageSize: 10,
  454. pageCurrent: 1,
  455. total: 0,
  456. list: [],
  457. regionTree: [],
  458. regionCode: '',
  459. selectedTreeNode: '',
  460. searchRtuNameVal: '',
  461. searchRtuCodeVal: '',
  462. query: {},
  463. inputStyles: {
  464. color: '#808080',
  465. borderColor: '#d3d3d3'
  466. },
  467. countInfo: {},
  468. loading: false,
  469. value: [],
  470. warnKindItems: [{
  471. 'value': 0,
  472. 'text': '全部'
  473. }, {
  474. 'value': 1,
  475. 'text': '离线'
  476. }, {
  477. 'value': 2,
  478. 'text': '时钟异常'
  479. }, {
  480. 'value': 3,
  481. 'text': '雨量漏报'
  482. }, {
  483. 'value': 4,
  484. 'text': '水位漏报'
  485. }, {
  486. 'value': 5,
  487. 'text': '5分钟上报延时'
  488. }, {
  489. 'value': 6,
  490. 'text': '雨量小时上报延时'
  491. }, {
  492. 'value': 7,
  493. 'text': '水位小时上报延时'
  494. }, {
  495. 'value': 8,
  496. 'text': '雨量疑似异常值'
  497. }],
  498. warnKindOption: 0,
  499. //以下为应急参数
  500. yjDangerAreaCoverView: 0,
  501. yjRtuCoverView: 0,
  502. yjDangerAreaLineCoverView: 0,
  503. latitude: 40.848119,
  504. longitude: 111.755426,
  505. zoom: true,
  506. scale: 14,
  507. polygons: [],
  508. polylines: [],
  509. includepoints: [],
  510. mapStyles: {
  511. width: '100%',
  512. height: '600px'
  513. },
  514. horizontal: 'right',
  515. vertical: 'bottom',
  516. direction: 'horizontal',
  517. pattern: {
  518. color: '#7A7E83',
  519. backgroundColor: '#fff',
  520. selectedColor: '#007AFF',
  521. buttonColor: '#007AFF',
  522. iconColor: '#fff'
  523. },
  524. content: [{
  525. iconPath: '/static/images/tabbar/home.png',
  526. selectedIconPath: '/static/images/tabbar/home_selected.png',
  527. text: '雨情',
  528. active: false
  529. },
  530. {
  531. iconPath: '/static/images/tabbar/warn.png',
  532. selectedIconPath: '/static/images/tabbar/warn_selected.png',
  533. text: '预警',
  534. active: false
  535. },
  536. {
  537. iconPath: '/static/images/tabbar/workbench.png',
  538. selectedIconPath: '/static/images/tabbar/workbench_selected.png',
  539. text: '危险区',
  540. active: false
  541. }
  542. ],
  543. popMenu: false,
  544. popBoxIndex: 0,
  545. yjMapMarkers: [],
  546. yjDrawerWidth: 200,
  547. //应急雨量参数
  548. yjRainCountType: {
  549. items: [{
  550. 'id': '0',
  551. 'dictValue': '默认'
  552. }, {
  553. 'id': '1',
  554. 'dictValue': '近1小时'
  555. }, {
  556. 'id': '2',
  557. 'dictValue': '近3小时'
  558. }, {
  559. 'id': '3',
  560. 'dictValue': '近6小时'
  561. }, {
  562. 'id': '4',
  563. 'dictValue': '近12小时'
  564. }, {
  565. 'id': '5',
  566. 'dictValue': '近24小时'
  567. }],
  568. value: 0,
  569. },
  570. yjRainListPageSize: 10,
  571. yjRainListPageCurrent: 1,
  572. yjRainListTotal: 0,
  573. yjRainTableData: [],
  574. yjRainSearchRtuNameVal: '',
  575. yjRainSearchRtuCodeVal: '',
  576. //应急预警参数
  577. yjSearchWarnNameVal: '',
  578. yjSearchAdNameVal: '',
  579. yjWarnPageSize: 10,
  580. yjWarnPageCurrent: 1,
  581. yjWarnTotal: 0,
  582. yjWarnTableData: [],
  583. //应急危险区参数
  584. yjDangerAreaNameVal: '',
  585. yjDangerAreaAdNameVal: '',
  586. yjDangerAreaPageSize: 10,
  587. yjDangerAreaPageCurrent: 1,
  588. yjDangerAreaTotal: 0,
  589. yjDangerAreaTableData: [],
  590. yjDangerAreaRtus: [],
  591. yjDangerAreaLeaveLines: [],
  592. yjDangerAreas: [],
  593. }
  594. },
  595. computed: {
  596. toLocation(l) {
  597. return new Number(l).toFixed(6);
  598. }
  599. },
  600. onInit(option) {
  601. console.log("onInit" + JSON.stringify(uni.getWindowInfo()))
  602. },
  603. onLoad(option) {
  604. let subSystemSelectInfo = uni.getStorageSync("SubSystemSelectInfo");
  605. this.subSystem = subSystemSelectInfo.subSystem;
  606. if (this.subSystem == 1) {
  607. this.title = "管理工作台";
  608. } else if (this.subSystem == 2) {
  609. this.title = "监测预警管理";
  610. this.yjDrawerWidth = uni.getWindowInfo().windowWidth - 100;
  611. this.mapStyles.height = (uni.getWindowInfo().windowHeight - 75 - 20) + "px";
  612. }
  613. if (this.$u.func.checkLogin()) {
  614. if (this.userInfo.role_name === role.admin) {
  615. this.permission.admin = true;
  616. this.currentRole = role.admin;
  617. } else if (this.userInfo.role_name === role.orgAdmin) {
  618. this.permission.orgAdmin = true;
  619. this.currentRole = role.orgAdmin;
  620. } else if (this.userInfo.role_name === role.companyAdmin) {
  621. this.permission.companyAdmin = true;
  622. this.currentRole = role.companyAdmin;
  623. } else if (this.userInfo.role_name === role.companyServciePerson) {
  624. this.permission.companyServciePerson = true;
  625. this.currentRole = role.companyServciePerson;
  626. } else if (this.userInfo.role_name === role.yjServicePerson) {
  627. this.permission.yjServicePerson = true;
  628. this.currentRole = role.yjServicePerson;
  629. }
  630. if (this.subSystem == 1) {
  631. this.getRegionTree();
  632. } else if (this.subSystem == 2) {
  633. }
  634. } else {
  635. this.$u.func.logout();
  636. }
  637. },
  638. onShow() {
  639. if (this.$u.func.checkLogin()) {
  640. if (this.subSystem == 1) {
  641. this.title = "管理工作台";
  642. } else if (this.subSystem == 2) {
  643. this.title = "监测预警管理";
  644. }
  645. if (this.userInfo.role_name !== this.currentRole) {
  646. this.permission.admin = false;
  647. this.permission.orgAdmin = false;
  648. this.permission.companyAdmin = false;
  649. this.permission.companyServciePerson = false;
  650. this.permission.yjServicePerson = false;
  651. if (this.userInfo.role_name === role.admin) {
  652. this.permission.admin = true;
  653. this.currentRole = role.admin;
  654. } else if (this.userInfo.role_name === role.orgAdmin) {
  655. this.permission.orgAdmin = true;
  656. this.currentRole = role.orgAdmin;
  657. } else if (this.userInfo.role_name === role.companyAdmin) {
  658. this.permission.companyAdmin = true;
  659. this.currentRole = role.companyAdmin;
  660. } else if (this.userInfo.role_name === role.companyServciePerson) {
  661. this.permission.companyServciePerson = true;
  662. this.currentRole = role.companyServciePerson;
  663. } else if (this.userInfo.role_name === role.yjServicePerson) {
  664. this.permission.yjServicePerson = true;
  665. this.currentRole = role.yjServicePerson;
  666. }
  667. if (this.subSystem == 1) {
  668. this.getRegionTree();
  669. } else if (this.subSystem == 2) {
  670. }
  671. }
  672. } else {
  673. this.$u.func.logout();
  674. }
  675. },
  676. onReady() {
  677. console.log("onReady" + JSON.stringify(uni.getWindowInfo()))
  678. this.mapStyles.height = (uni.getWindowInfo().windowHeight - 75 - 20) + "px";
  679. this.$refs.fab.open()
  680. },
  681. methods: {
  682. // 分页触发
  683. pageChange(e) {
  684. this.pageCurrent = e.current;
  685. this.getPage()
  686. },
  687. //行政区划选择
  688. onTreeNodeClick(node) {
  689. console.log(JSON.stringify(node))
  690. },
  691. onTreePopupOpened(e) {
  692. console.log(JSON.stringify(e))
  693. },
  694. onTreePopupClosed(e) {
  695. console.log(JSON.stringify(e))
  696. },
  697. onTreeChange(e) {
  698. console.log(JSON.stringify(e))
  699. let nodes = e.detail.value;
  700. if (nodes.length > 0) {
  701. let node = nodes[nodes.length - 1];
  702. this.regionCode = node.value;
  703. this.query = {};
  704. this.query['adCode'] = this.regionCode;
  705. this.searchRtuNameVal = '';
  706. this.searchRtuCodeVal = '';
  707. this.pageCurrent = 1;
  708. this.getPage();
  709. this.getCountInfo(this.regionCode);
  710. } else {
  711. this.regionCode = '';
  712. this.query = {};
  713. this.searchRtuNameVal = '';
  714. this.searchRtuCodeVal = '';
  715. this.pageCurrent = 1;
  716. this.getPage();
  717. this.getCountInfo(this.regionCode);
  718. }
  719. },
  720. //录入查询
  721. search() {
  722. this.pageCurrent = 1;
  723. // console.log(JSON.stringify(res))
  724. let params = {};
  725. if (this.searchRtuCodeVal.length > 0) {
  726. params['rtuCode'] = this.searchRtuCodeVal;
  727. }
  728. if (this.searchRtuNameVal.length > 0) {
  729. params['rtuName'] = this.searchRtuNameVal;
  730. }
  731. this.getPage(params);
  732. },
  733. searchRtuNameValClear(e) {
  734. if (e == null || e.length == 0) {
  735. this.searchRtuNameVal = '';
  736. let params = {};
  737. if (this.searchRtuCodeVal.length > 0) {
  738. params['rtuCode'] = this.searchRtuCodeVal;
  739. }
  740. this.getPage(params);
  741. }
  742. },
  743. searchRtuCodeValClear(e) {
  744. if (e == null || e.length == 0) {
  745. this.searchRtuCodeVal = '';
  746. let params = {};
  747. if (this.searchRtuNameVal.length > 0) {
  748. params['rtuName'] = this.searchRtuNameVal;
  749. }
  750. this.getPage(params);
  751. }
  752. },
  753. onBackPress() {
  754. // #ifdef APP-PLUS
  755. plus.key.hideSoftKeybord();
  756. // #endif
  757. },
  758. onRtuDetailClick(rtuCode) {
  759. uni.navigateTo({
  760. url: '/pages/rtu-manage/rtudetail?rtuCode=' + rtuCode
  761. })
  762. },
  763. onWarningPageClick(rtuCode) {
  764. uni.navigateTo({
  765. url: '/pages/warning/rtuwarninglist?rtuCode=' + rtuCode
  766. })
  767. },
  768. onLocationClick(item) {
  769. let lat = item.lat;
  770. let lng = item.lng;
  771. let name = item.rtuName;
  772. let add = item.locationDesc;
  773. uni.openLocation({
  774. latitude: Number(lat),
  775. longitude: Number(lng),
  776. name: name,
  777. address: "",
  778. success() {}
  779. })
  780. },
  781. onCheckOrderPageClick(rtuCode) {
  782. uni.navigateTo({
  783. url: '/pages/check-order/rtu/rtucheckorderlist?rtuCode=' + rtuCode
  784. })
  785. },
  786. onInspectionReportClick(rtuCode) {
  787. console.log("onInspectionReportClick")
  788. uni.navigateTo({
  789. url: '/pages/equipment-inspection/rtuinspectionreportview?rtuCode=' + rtuCode
  790. })
  791. },
  792. onSiteRealDataClick(item) {
  793. uni.navigateTo({
  794. url: '/pages/rtu-manage/rturealdatadetail?rtuCode=' + item.rtuCode + '&isRain=' + item.isRain +
  795. '&isRiver=' + item.isRiver + '&isRes=' + item.isRes + '&isGround=' + item.isGround,
  796. })
  797. },
  798. onManuallyOrderClick(rtuCode) {
  799. uni.navigateTo({
  800. url: '/pages/check-order/manuallyaddcheckorder?rtuCode=' + rtuCode
  801. })
  802. },
  803. warnKindOptionChange: function(evt) {
  804. let params = {};
  805. this.getPage(params);
  806. },
  807. getSiteData(val) {
  808. let htmltext = '';
  809. if (val.isRain === 1) {
  810. htmltext = htmltext + "降水:";
  811. if (val.drp) {
  812. htmltext = htmltext + val.drp;
  813. } else {
  814. htmltext = htmltext + "--";
  815. }
  816. }
  817. if (val.isRiver == 1) {
  818. if (htmltext.length > 0) {
  819. htmltext = htmltext + ' / ';
  820. }
  821. htmltext = htmltext + '水位:';
  822. if (val.rz) {
  823. htmltext = htmltext + val.rz;
  824. } else {
  825. htmltext = htmltext + "--";
  826. }
  827. } else if (val.isRes == 1) {
  828. if (htmltext.length > 0) {
  829. htmltext = htmltext + ' / ';
  830. }
  831. htmltext = htmltext + '水位:';
  832. if (val.z) {
  833. htmltext = htmltext + val.z;
  834. } else {
  835. htmltext = htmltext + "--";
  836. }
  837. }
  838. if (val.isGround == 1) {
  839. if (htmltext.length > 0) {
  840. htmltext = htmltext + ' / ';
  841. }
  842. htmltext = htmltext + '墒情含水层:';
  843. if (val.ground) {
  844. htmltext = htmltext + val.ground;
  845. } else {
  846. htmltext = htmltext + "--";
  847. }
  848. }
  849. return htmltext;
  850. },
  851. getRegionTree() {
  852. var that = this;
  853. http.request({
  854. url: '/galaxy-business/baseinfo/region/tree',
  855. method: 'GET',
  856. }).then(res => {
  857. if (res.data != null) {
  858. that.regionTree = res.data;
  859. that.regionCode = that.regionTree[0].id;
  860. that.selectedTreeNode = that.regionTree[0].id;
  861. that.query = {};
  862. that.query['adCode'] = that.regionCode;
  863. that.getPage();
  864. that.getCountInfo(that.regionCode);
  865. }
  866. }).catch(err => {
  867. console.log(err)
  868. })
  869. },
  870. getCountInfo(adCode) {
  871. let that = this;
  872. http.request({
  873. url: '/galaxy-business/rtu/manage/count',
  874. method: 'GET',
  875. data: {
  876. adCode
  877. }
  878. }).then(res => {
  879. that.countInfo = res.data;
  880. })
  881. },
  882. getPage(params = {}) {
  883. this.loading = true
  884. if (this.warnKindOption == 0) {} else {
  885. params['warnKind'] = this.warnKindOption;
  886. }
  887. const current = this.pageCurrent;
  888. const size = this.pageSize;
  889. let postData = Object.assign(params, this.query);
  890. var that = this;
  891. http.request({
  892. url: '/galaxy-business/rtu/manage/page',
  893. method: 'GET',
  894. params: {
  895. current,
  896. size,
  897. },
  898. data: postData,
  899. }).then(res => {
  900. // console.log(JSON.stringify(res.data))
  901. if (res.data.records != null) {
  902. that.list = res.data.records;
  903. }
  904. that.total = res.data.total;
  905. this.loading = false
  906. }).catch(err => {
  907. console.log(err)
  908. this.loading = false
  909. })
  910. },
  911. //以下为应急系统业务功能
  912. trigger(e) {
  913. let that = this;
  914. this.content[0].active = false;
  915. this.content[1].active = false;
  916. this.content[2].active = false;
  917. this.content[e.index].active = !e.item.active
  918. this.popBoxIndex = e.index + 1;
  919. this.$refs.yjDrawerRef.open()
  920. // if (this.$refs.fab.isShow) {
  921. // this.$refs.fab.close()
  922. // }
  923. this.$nextTick(() => {
  924. if (that.popBoxIndex == 1) {
  925. that.yjDangerAreaCoverView = 0;
  926. that.yjRtuCoverView = 0;
  927. that.yjDangerAreaLineCoverView = 0;
  928. that.getYjRainDataPage();
  929. } else if (that.popBoxIndex == 2) {
  930. that.yjDangerAreaCoverView = 0;
  931. that.yjRtuCoverView = 0;
  932. that.yjDangerAreaLineCoverView = 0;
  933. that.getYjWarnDataPage();
  934. } else if (that.popBoxIndex == 3) {
  935. that.yjDangerAreaCoverView = 1;
  936. that.yjRtuCoverView = 1;
  937. that.yjDangerAreaLineCoverView = 1;
  938. that.getYjDangerAreaDataPage();
  939. }
  940. })
  941. },
  942. fabClick() {
  943. // this.popMenu = !this.popMenu
  944. // if (!this.popMenu) {
  945. // this.content[0].active = false;
  946. // this.content[1].active = false;
  947. // this.content[2].active = false;
  948. // }
  949. },
  950. yjPopMenuClose() {
  951. // this.popMenu = false;
  952. // this.content[0].active = false;
  953. // this.content[1].active = false;
  954. // this.content[2].active = false;
  955. // if (this.$refs.fab.isShow) {
  956. // this.$refs.fab.close()
  957. // }
  958. this.$refs.yjDrawerRef.close();
  959. },
  960. //雨量数据业务
  961. yjRainListPageChange(e) {
  962. this.yjRainListPageCurrent = e.current;
  963. this.getYjRainDataPage()
  964. },
  965. yjRainDataSearch() {
  966. let params = {};
  967. if (this.yjRainSearchRtuCodeVal.length > 0) {
  968. params['rtuCode'] = this.yjRainSearchRtuCodeVal;
  969. }
  970. if (this.yjRainSearchRtuNameVal.length > 0) {
  971. params['rtuName'] = this.yjRainSearchRtuNameVal;
  972. }
  973. this.getYjRainDataPage(params);
  974. },
  975. getYjRainDataPage(params = {}) {
  976. const current = this.yjRainListPageCurrent;
  977. const size = this.yjRainListPageSize;
  978. const isSubmit = '0';
  979. if (this.yjRainCountType.value == 1) {
  980. params['rainCountType'] = 1;
  981. } else if (this.yjRainCountType.value == 2) {
  982. params['rainCountType'] = 3;
  983. } else if (this.yjRainCountType.value == 3) {
  984. params['rainCountType'] = 6;
  985. } else if (this.yjRainCountType.value == 4) {
  986. params['rainCountType'] = 12;
  987. } else if (this.yjRainCountType.value == 5) {
  988. params['rainCountType'] = 24;
  989. } else {
  990. params['rainCountType'] = 0;
  991. }
  992. let postData = Object.assign(params, this.query);
  993. console.log(JSON.stringify(postData))
  994. var that = this;
  995. http.request({
  996. url: '/galaxy-business/rtu/data/rain/yj/page',
  997. method: 'GET',
  998. params: {
  999. current,
  1000. size,
  1001. isSubmit
  1002. },
  1003. data: postData,
  1004. }).then(res => {
  1005. if (res.data.records != null) {
  1006. that.yjRainTableData = res.data.records;
  1007. }
  1008. that.yjRainListTotal = res.data.total;
  1009. if (that.yjRainListTotal == 0) {
  1010. that.yjRainListPageCurrent = 1;
  1011. }
  1012. }).catch(err => {
  1013. console.log(err)
  1014. })
  1015. },
  1016. onYjRainCountTypeRadioChange: function(evt) {
  1017. for (let i = 0; i < this.yjRainCountType.items.length; i++) {
  1018. if (this.yjRainCountType.items[i].id === evt.detail.value) {
  1019. this.yjRainCountType.value = i;
  1020. //this.getYjRainDataPage();
  1021. break;
  1022. }
  1023. }
  1024. },
  1025. yjRainSearchRtuNameValClear(e) {
  1026. if (e == null || e.length == 0) {
  1027. this.yjRainSearchRtuNameVal = '';
  1028. }
  1029. },
  1030. yjRainSearchRtuCodeValClear(e) {
  1031. if (e == null || e.length == 0) {
  1032. this.yjRainSearchRtuCodeValL = '';
  1033. }
  1034. },
  1035. onYjRainDataRtuClick(item) {
  1036. this.$refs.yjDrawerRef.close();
  1037. let that = this;
  1038. this.$nextTick(() => {
  1039. that.yjMapMarkers = [];
  1040. let marker = {};
  1041. marker['id'] = item.id;
  1042. marker['latitude'] = item.lat;
  1043. marker['longitude'] = item.lng;
  1044. let label = {};
  1045. label['content'] = item.rtuName + "(" + item.drp + "mm)";
  1046. label['color'] = '#ff0000';
  1047. label['bgColor'] = '#ffffff';
  1048. label['anchorY'] = -40;
  1049. marker['label'] = label;
  1050. marker['iconPath'] = "/static/images/icon_warning.png";
  1051. that.yjMapMarkers.push(marker)
  1052. that.latitude = item.lat;
  1053. that.longitude = item.lng;
  1054. })
  1055. },
  1056. //应急预警信息
  1057. yjSearchWarnNameValClear(e) {
  1058. if (e == null || e.length == 0) {
  1059. this.yjSearchWarnNameVal = '';
  1060. }
  1061. },
  1062. yjSearchAdNameValClear(e) {
  1063. if (e == null || e.length == 0) {
  1064. this.yjSearchAdNameVal = '';
  1065. }
  1066. },
  1067. yjWarnPageChange(e) {
  1068. this.yjDangerAreaPageCurrent = e.current;
  1069. this.getYjWarnDataPage()
  1070. },
  1071. onYjWarnDataRtuClick(item) {
  1072. this.$refs.yjDrawerRef.close();
  1073. let that = this;
  1074. this.$nextTick(() => {
  1075. that.yjMapMarkers = [];
  1076. let marker = {};
  1077. marker['id'] = item.id;
  1078. marker['latitude'] = item.warnLttd;
  1079. marker['longitude'] = item.warnLgtd;
  1080. let label = {};
  1081. label['content'] = item.warnName;
  1082. label['color'] = '#ff0000';
  1083. label['bgColor'] = '#ffffff';
  1084. label['anchorY'] = -40;
  1085. marker['label'] = label;
  1086. marker['iconPath'] = "/static/images/icon_warning.png";
  1087. that.yjMapMarkers.push(marker)
  1088. that.latitude = item.warnLttd;
  1089. that.longitude = item.warnLgtd;
  1090. })
  1091. },
  1092. yjWarnDataSearch() {
  1093. let params = {};
  1094. if (this.yjSearchWarnNameVal.length > 0) {
  1095. params['warnName'] = this.yjSearchWarnNameVal;
  1096. }
  1097. if (this.yjSearchAdNameVal.length > 0) {
  1098. params['dangerAreaName'] = this.yjSearchAdNameVal;
  1099. }
  1100. this.getYjWarnDataPage(params);
  1101. },
  1102. getYjWarnDataPage(params = {}) {
  1103. const current = this.yjWarnPageCurrent;
  1104. const size = this.yjWarnPageSize;
  1105. const isSubmit = '0';
  1106. let postData = Object.assign(params, this.query);
  1107. let that = this;
  1108. http.request({
  1109. url: '/galaxy-business/yj/warn/page',
  1110. method: 'GET',
  1111. params: {
  1112. current,
  1113. size,
  1114. },
  1115. data: postData,
  1116. }).then(res => {
  1117. if (res.data.records != null) {
  1118. that.yjWarnTableData = res.data.records;
  1119. }
  1120. that.yjWarnTotal = res.data.total;
  1121. if (that.yjWarnTotal == 0) {
  1122. that.yjWarnPageCurrent = 1;
  1123. }
  1124. }).catch(err => {
  1125. console.log(err)
  1126. })
  1127. },
  1128. //应急危险区业务
  1129. yjDangerAreaNameValClear(e) {
  1130. if (e == null || e.length == 0) {
  1131. this.yjDangerAreaNameVal = '';
  1132. }
  1133. },
  1134. yjDangerAreaAdNameValClear(e) {
  1135. if (e == null || e.length == 0) {
  1136. this.yjDangerAreaAdNameVal = '';
  1137. }
  1138. },
  1139. yjDangerAreaDataSearch() {
  1140. let params = {};
  1141. if (this.yjDangerAreaNameVal.length > 0) {
  1142. params['dangerAreaName'] = this.yjDangerAreaNameVal;
  1143. }
  1144. if (this.yjDangerAreaAdNameVal.length > 0) {
  1145. params['adName'] = this.yjDangerAreaAdNameVal;
  1146. }
  1147. this.getYjDangerAreaDataPage(params);
  1148. },
  1149. yjDangerAreaPageChange(e) {
  1150. this.yjDangerAreaPageCurrent = e.current;
  1151. this.getYjDangerAreaDataPage()
  1152. },
  1153. getYjDangerAreaDataPage(params = {}) {
  1154. const current = this.yjDangerAreaPageCurrent;
  1155. const size = this.yjDangerAreaPageSize;
  1156. const isSubmit = '0';
  1157. let postData = Object.assign(params, this.query);
  1158. let that = this;
  1159. http.request({
  1160. url: '/galaxy-business/map/dangerarea/page',
  1161. method: 'GET',
  1162. params: {
  1163. current,
  1164. size,
  1165. },
  1166. data: postData,
  1167. }).then(res => {
  1168. if (res.data.records != null) {
  1169. that.yjDangerAreaTableData = res.data.records;
  1170. }
  1171. that.yjDangerAreaTotal = res.data.total;
  1172. if (that.yjDangerAreaTotal == 0) {
  1173. that.yjDangerAreaPageCurrent = 1;
  1174. }
  1175. }).catch(err => {
  1176. console.log(err)
  1177. })
  1178. },
  1179. yjDangerAreaDataClick(item) {
  1180. this.$refs.yjDrawerRef.close();
  1181. let that = this;
  1182. this.yjDangerAreas = [];
  1183. let d = {};
  1184. d['id'] = item.id;
  1185. d['dangerAreaName'] = item.dangerAreaName;
  1186. d['lng'] = item.centerPointLng;
  1187. d['lat'] = item.centerPointLat;
  1188. this.yjDangerAreas.push(d);
  1189. this.$nextTick(() => {
  1190. let c = gcoord.transform(
  1191. [item.centerPointLng, item.centerPointLat],
  1192. gcoord.WGS84,
  1193. gcoord.GCJ02
  1194. );
  1195. that.latitude = c[1];
  1196. that.longitude = c[0];
  1197. this.scale = 14;
  1198. that.getDangerAreaDataGcoord(item.id);
  1199. })
  1200. },
  1201. getDangerAreaDataGcoord(id) {
  1202. let that = this;
  1203. let postData = {};
  1204. postData['id'] = id;
  1205. http.request({
  1206. url: '/galaxy-business/map/dangerarea/detail',
  1207. method: 'GET',
  1208. data: postData
  1209. }).then(res => {
  1210. if (res.data != null) {
  1211. that.includepoints = [];
  1212. that.polygons = [];
  1213. let p = {};
  1214. let ps = res.data.points.map(item => {
  1215. let l = gcoord.transform(
  1216. [item.pointLng, item.pointLat],
  1217. gcoord.WGS84,
  1218. gcoord.GCJ02
  1219. );
  1220. return {
  1221. latitude: l[1],
  1222. longitude: l[0],
  1223. }
  1224. })
  1225. p['points'] = ps;
  1226. that.includepoints.push(ps[0]);
  1227. let dashArray = [];
  1228. dashArray.push(4);
  1229. dashArray.push(10);
  1230. p['dashArray'] = dashArray;
  1231. if (res.data.dangerStatus == '1') {
  1232. p['strokeColor'] = '#FF0000';
  1233. p['fillColor'] = '#F72C5B7D';
  1234. } else {
  1235. p['strokeColor'] = '#FC8452';
  1236. p['fillColor'] = '#FAC8587D';
  1237. }
  1238. that.polygons.push(p);
  1239. that.yjMapMarkers = [];
  1240. let rtus = res.data.rtus.map(item => {
  1241. let rtu = {};
  1242. rtu['id'] = item.id;
  1243. rtu['latitude'] = item.lat;
  1244. rtu['longitude'] = item.lng;
  1245. rtu['rtuName'] = item.rtuName;
  1246. rtu['rtuCode'] = item.rtuCode;
  1247. return rtu;
  1248. });
  1249. that.yjDangerAreaRtus = rtus;
  1250. let leaveLines = res.data.leaveLines.map(item => {
  1251. let line = {};
  1252. line['id'] = item.id;
  1253. line['latitude'] = new Number(item.centerPointLat).toFixed(6);
  1254. line['longitude'] = new Number(item.centerPointLng).toFixed(6);
  1255. line['leaveLineName'] = item.leaveLineName;
  1256. return line;
  1257. });
  1258. that.yjDangerAreaLeaveLines = leaveLines;
  1259. that.scale = 14;
  1260. }
  1261. }).catch(err => {
  1262. console.log(err)
  1263. })
  1264. },
  1265. yjDangerAreaLinkRtuClick(item) {
  1266. this.yjMapMarkers = [];
  1267. let marker = {};
  1268. marker['id'] = item.id;
  1269. let l = gcoord.transform(
  1270. [item.longitude, item.latitude],
  1271. gcoord.WGS84,
  1272. gcoord.GCJ02
  1273. );
  1274. marker['latitude'] = l[1];
  1275. marker['longitude'] = l[0];
  1276. let label = {};
  1277. label['content'] = item.rtuName;
  1278. label['color'] = '#ff0000';
  1279. label['bgColor'] = '#ffffff';
  1280. label['anchorY'] = -40;
  1281. marker['label'] = label;
  1282. marker['iconPath'] = "/static/images/icon_warning.png";
  1283. this.yjMapMarkers.push(marker)
  1284. this.latitude = item.latitude;
  1285. this.longitude = item.longitude;
  1286. this.scale = 12;
  1287. },
  1288. yjDangerAreaLinkLineClick(item) {
  1289. let that = this;
  1290. this.polylines = [];
  1291. this.yjMapMarkers = [];
  1292. this.polygons = [];
  1293. let c = gcoord.transform(
  1294. [item.longitude, item.latitude],
  1295. gcoord.WGS84,
  1296. gcoord.GCJ02
  1297. );
  1298. this.latitude = c[1];
  1299. this.longitude = c[0];
  1300. this.scale = 16;
  1301. let id = item.id;
  1302. this.$nextTick(() => {
  1303. that.getYjDangerAreaLineDetail(id);
  1304. })
  1305. },
  1306. getYjDangerAreaLineDetail(id) {
  1307. let that = this;
  1308. let postData = {};
  1309. postData['id'] = id;
  1310. http.request({
  1311. url: '/galaxy-business/map/leaveline/detail',
  1312. method: 'GET',
  1313. data: postData
  1314. }).then(res => {
  1315. if (res.data != null) {
  1316. let p = {};
  1317. let ps = res.data.points.map(item => {
  1318. let l = gcoord.transform(
  1319. [item.pointLng, item.pointLat],
  1320. gcoord.WGS84,
  1321. gcoord.GCJ02
  1322. );
  1323. return {
  1324. latitude: l[1],
  1325. longitude: l[0],
  1326. }
  1327. })
  1328. p['points'] = ps;
  1329. p['color'] = '#ee0000';
  1330. that.polylines.push(p);
  1331. }
  1332. }).catch(err => {
  1333. console.log(err)
  1334. })
  1335. },
  1336. yjDangerAreaClick(item) {
  1337. let that = this;
  1338. this.polylines = [];
  1339. this.yjMapMarkers = [];
  1340. this.polygons = [];
  1341. this.$nextTick(() => {
  1342. let c = gcoord.transform(
  1343. [item.lng, item.lat],
  1344. gcoord.WGS84,
  1345. gcoord.GCJ02
  1346. );
  1347. that.latitude = c[1];
  1348. that.longitude = c[0];
  1349. this.scale = 14;
  1350. that.getDangerAreaDataGcoord(item.id);
  1351. })
  1352. }
  1353. }
  1354. }
  1355. </script>
  1356. <style lang="scss" scoped>
  1357. $nav-height: 75px;
  1358. .select-checkbox {
  1359. margin-top: 0px;
  1360. margin-bottom: 5px;
  1361. padding-left: 15px;
  1362. }
  1363. .count-info-line {
  1364. padding-top: 5px;
  1365. padding-bottom: 5px;
  1366. padding-left: 10px;
  1367. padding-right: 10px;
  1368. display: flex;
  1369. flex-direction: row;
  1370. align-items: center;
  1371. }
  1372. .count-info-line .rtuCount {
  1373. display: flex;
  1374. flex-direction: row;
  1375. align-items: center;
  1376. .name {
  1377. color: dimgray;
  1378. font-size: 0.7rem;
  1379. }
  1380. .count {
  1381. margin-left: 5px;
  1382. color: dodgerblue;
  1383. font-size: 0.7rem;
  1384. }
  1385. }
  1386. .count-info-line .warnRtuCount {
  1387. margin-left: 10px;
  1388. display: flex;
  1389. flex-direction: row;
  1390. align-items: center;
  1391. .name {
  1392. color: dimgray;
  1393. font-size: 0.7rem;
  1394. }
  1395. .count {
  1396. margin-left: 5px;
  1397. color: red;
  1398. font-size: 0.7rem;
  1399. }
  1400. }
  1401. .scroll-view {
  1402. /* #ifndef APP-NVUE */
  1403. width: 100%;
  1404. height: 100%;
  1405. /* #endif */
  1406. flex: 1
  1407. }
  1408. // 处理抽屉内容滚动
  1409. .scroll-view-box {
  1410. flex: 1;
  1411. position: absolute;
  1412. top: 0;
  1413. right: 0;
  1414. bottom: 0;
  1415. left: 0;
  1416. }
  1417. </style>