yjwarn.vue 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740
  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="wrap">
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view class="nav-title">
  14. <text>{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <view class="container">
  18. <view style="width: 100%;">
  19. <map id="myMap" ref="myMap" :style="mapStyles" :latitude="latitude" :longitude="longitude"
  20. :markers="markets" :polygons="polygons" :scale="scale" :polyline="polylines">
  21. <cover-view style="line-height: normal;width: 100%;">
  22. <cover-view style="width:50px;height:50px;position: absolute;top: 20px;right: 10px;">
  23. <cover-view v-if="mapScreenMin" style="width:50px;height:50px;background-color: orange;">
  24. <cover-image style="width: 50px;height: 50px;" src="/static/images/icon_quanping.png"
  25. @click="onMapScreenMax"></cover-image>
  26. </cover-view>
  27. <cover-view v-if="mapScreenMax" style="width:50px;height:50px;background-color: orange;">
  28. <cover-image style="width: 50px;height: 50px;" src="/static/images/icon_feiquanping.png"
  29. @click="onMapScreenMin"></cover-image>
  30. </cover-view>
  31. </cover-view>
  32. </cover-view>
  33. </map>
  34. <view :style="popViewStyles">
  35. <view :style="searchViewStyles">
  36. <uni-section title="实时监测数据" titleFontSize="1rem" type="circle">
  37. <template v-slot:right>
  38. <view v-if="contentViewStatus==0" class="view-flex-inline" style="margin-right: 10px;"
  39. @click="onYjRainDataRefreshClick">
  40. <uni-icons class="input-uni-icon" type="refresh" size="18" color="skyblue" />
  41. <view style="color: gray;font-size: 0.9rem;margin-left: 5px;margin-right: 5px;">
  42. 刷新</view>
  43. </view>
  44. <view v-else-if="contentViewStatus==1" class="view-flex-inline"
  45. style="margin-right: 10px;" @click="onYjWarnBackClick">
  46. <uni-icons class="input-uni-icon" type="close" size="18" color="skyblue" />
  47. <view style="color: gray;font-size: 0.9rem;margin-left: 5px;margin-right: 5px;">
  48. 关闭预警</view>
  49. </view>
  50. <view v-else-if="contentViewStatus==2" class="view-flex-inline"
  51. style="margin-right: 10px;" @click="onYjDangerAreaBackClick">
  52. <uni-icons class="input-uni-icon" type="close" size="18" color="skyblue" />
  53. <view style="color: gray;font-size: 0.9rem;margin-left: 5px;margin-right: 5px;">
  54. 关闭危险区</view>
  55. </view>
  56. </template>
  57. </uni-section>
  58. </view>
  59. <scroll-view scroll-y="true" :style="popScrollViewStyles">
  60. <view v-if="contentViewStatus==0">
  61. <view class="search-block">
  62. <uni-collapse @change="searchAreaStatus"
  63. style="padding-left: 10px;padding-right: 10px;">
  64. <uni-collapse-item :show-animation="true">
  65. <template v-slot:title>
  66. <view class="view-flex-block-center" style="height: 40px;width: 100%;">
  67. <view class="view-flex-inline-center">
  68. <text v-if="showSearch"
  69. style="color: orange;font-size: 0.8rem;">点击收起</text>
  70. <text v-else
  71. style="color: orange;font-size: 0.8rem;">点击展开录入查询</text>
  72. </view>
  73. </view>
  74. </template>
  75. </uni-collapse-item>
  76. </uni-collapse>
  77. <view v-if="showSearch">
  78. <view style="padding-left: 10px;padding-right: 10px;">
  79. <uni-data-select v-model="cityRegionValue" :localdata="cityRegionData"
  80. @change="cityRegionChange" placeholder="请选择盟市"></uni-data-select>
  81. </view>
  82. <view style="margin-top: 10px;padding-left: 10px;padding-right: 10px;">
  83. <uni-data-select v-model="districtRegionValue" :localdata="districtRegionData"
  84. @change="districtRegionChange" placeholder="请选择区旗县"></uni-data-select>
  85. </view>
  86. <view style="margin-top: 10px;padding-left: 10px;padding-right: 10px;">
  87. <uni-data-select v-model="townRegionValue" :localdata="townRegionData"
  88. @change="townRegionChange" placeholder="请选择乡镇"></uni-data-select>
  89. </view>
  90. <view style="margin-top: 10px;padding-left: 10px;padding-right: 10px;">
  91. <uni-data-select v-model="countryRegionValue" :localdata="countryRegionData"
  92. @change="countryRegionChange" placeholder="请选择村"></uni-data-select>
  93. </view>
  94. <view class="rtu-code">
  95. <uni-easyinput :styles="inputStyles" @input="searchRtuCodeValClear"
  96. prefixIcon="search" v-model="searchRtuCodeVal" placeholder="请输入测站编码">
  97. </uni-easyinput>
  98. </view>
  99. <view class="rtu-name">
  100. <uni-easyinput :styles="inputStyles" @input="searchRtuNameValClear"
  101. prefixIcon="search" v-model="searchRtuNameVal" placeholder="请输入测站名称">
  102. </uni-easyinput>
  103. </view>
  104. <view class="submit-btn">
  105. <button type="default" @click="onSearch">查询</button>
  106. </view>
  107. </view>
  108. <uni-group>
  109. <radio-group @change="onYjRainCountTypeRadioChange" class="view-flex-rs">
  110. <label style="margin-right: 5px;margin-bottom: 5px;;width:100px;"
  111. class="view-flex-inline" v-for="(item, index) in yjRainCountType.items"
  112. :key="item.id">
  113. <view>
  114. <radio :value="item.id" :checked="index === yjRainCountType.value" />
  115. </view>
  116. <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
  117. </label>
  118. </radio-group>
  119. </uni-group>
  120. </view>
  121. <uni-list style="min-height: 40px;">
  122. <uni-list-item v-for="item in tableData" :key="item.id">
  123. <template v-slot:body>
  124. <view class="list-item-block">
  125. <view class="line" @click="onYjRainDataRtuClick(item)">
  126. <view class="title text-ellipsis text-underline "
  127. style="color: royalblue;">
  128. {{item.rtuName}}/{{item.rtuCode}}
  129. </view>
  130. </view>
  131. <view class="line">
  132. <text class="title" style="color: black;">上报时间:</text>
  133. <text class="text"
  134. style="color: gray;margin-left: 5px;">{{item.tm}}</text>
  135. </view>
  136. <view class="line">
  137. <text class="title" style="color: black;">累计雨量(mm):</text>
  138. <text class="text"
  139. style="color: gray;margin-left: 5px;">{{item.drp}}</text>
  140. </view>
  141. <view v-if="item.isWarn ==1">
  142. <view class="line">
  143. <text class="title" style="color: black;">预警信息:</text>
  144. <view class="text text-underline" style="color: coral;"
  145. @click="onYjWarnClick(item)">{{item.warnName}}</view>
  146. </view>
  147. </view>
  148. <view v-else>
  149. <view class="line">
  150. <text class="title" style="color: black;">预警信息:</text>
  151. <text class="text" style="color: coral;">暂无预警</text>
  152. </view>
  153. </view>
  154. <view v-if="item.isLinkDanger==1">
  155. <view class="line">
  156. <text class="title" style="color: black;">危险区信息:</text>
  157. <view v-for="da in item.dangerAreaList" :key="da.id"
  158. class="text text-underline" style="color: coral;"
  159. @click="onYjDangerAreaDataClick(da)">{{da.dangerAreaName}}
  160. </view>
  161. </view>
  162. </view>
  163. <view v-else>
  164. <view class="line">
  165. <text class="title" style="color: black;">危险区信息:</text>
  166. <view class="text" style="color: coral;">暂无数据</view>
  167. </view>
  168. </view>
  169. </view>
  170. </template>
  171. </uni-list-item>
  172. </uni-list>
  173. <uni-group>
  174. <view class="pagination-block" style="margin-top: 5px;">
  175. <uni-pagination :page-size="pageSize" :current="pageCurrent" :total="listTotal"
  176. @change="pageChange" prevText="前一页" nextText="后一页" />
  177. </view>
  178. </uni-group>
  179. </view>
  180. <view v-else-if="contentViewStatus==1">
  181. <view style="padding-left: 10px;padding-right: 10px;padding-top: 10px;">
  182. <view v-if="warnData.warnResponseStatus==1">
  183. <view class="point">
  184. <view class="dot">
  185. 4
  186. </view>
  187. <view class="time-title">响应反馈【{{warnData.replyTm}}】</view>
  188. </view>
  189. <view class="time-info">
  190. <view class="time-line">
  191. <uni-list style="width: 100%;">
  192. <uni-list-item v-for="(r,index) in warnData.warnResponseInfoList"
  193. :key="index" direction="column">
  194. <template v-slot:body>
  195. <view class="list-item-block">
  196. <view class="line">
  197. <view class="text">责任人:<span
  198. style="color: deepskyblue;"></span></view>
  199. </view>
  200. <view class="line">
  201. <view class="text">责任人类型:<span
  202. style="color: deepskyblue;"></span></view>
  203. </view>
  204. <view class="line">
  205. <view class="text">反馈情况:<span
  206. style="color: deepskyblue;">{{r.repltStatus}}</span>
  207. </view>
  208. </view>
  209. <view class="line">
  210. <view class="text">反馈时间:<span
  211. style="color: deepskyblue;">{{r.replyTm}}</span>
  212. </view>
  213. </view>
  214. <!-- <view>反馈内容:<span style="color: skyblue;"></span></view> -->
  215. <view class="line">
  216. <view class="text">是否收到预警短信:<span
  217. style="color: deepskyblue;">{{r.isReceive}}</span>
  218. </view>
  219. </view>
  220. <view class="line">
  221. <view class="text">是否发生沟道山洪:<span
  222. style="color: deepskyblue;">{{r.isFloodBoot}}</span>
  223. </view>
  224. </view>
  225. <view class="line">
  226. <view class="text">山洪是否出沟:<span
  227. style="color: deepskyblue;">{{r.isFloodOut}}</span>
  228. </view>
  229. </view>
  230. <view class="line">
  231. <view class="text">降雨是否持续:<span
  232. style="color: deepskyblue;">{{r.isRainContu}}</span>
  233. </view>
  234. </view>
  235. <view class="line">
  236. <view class="text">是否人员转移:<span
  237. style="color: deepskyblue;">{{r.isTrans}}</span>
  238. </view>
  239. </view>
  240. <view class="line">
  241. <view class="text">有无人员伤亡:<span
  242. style="color: deepskyblue;">{{r.isDeady}}</span>
  243. </view>
  244. </view>
  245. </view>
  246. </template>
  247. </uni-list-item>
  248. </uni-list>
  249. </view>
  250. </view>
  251. </view>
  252. <view v-if="warnData.ousideWarnStatus==1">
  253. <view class="point">
  254. <view class="dot">
  255. 3
  256. </view>
  257. <view class="time-title">外部预警【{{warnData.extTime}}】</view>
  258. </view>
  259. <view class="time-info">
  260. <view class="time-line">
  261. <uni-list style="width: 100%;">
  262. <uni-list-item v-for="(out,index) in warnData.outsideWarnInfoList"
  263. :key="index" direction="column">
  264. <template v-slot:body>
  265. <view class="list-item-block">
  266. <view class="line">
  267. <view class="text ">发布单位:<span
  268. style="color: deepskyblue;">{{out.deptName}}</span>
  269. </view>
  270. </view>
  271. <view class="line">
  272. <view class="text ">发布人:<span
  273. style="color: deepskyblue;">{{out.senderName}}</span>
  274. </view>
  275. </view>
  276. <view class="line">
  277. <view class="text">发布内容:<span
  278. style="color: deepskyblue;">{{out.messageInfo}}</span>
  279. </view>
  280. </view>
  281. </view>
  282. </template>
  283. </uni-list-item>
  284. </uni-list>
  285. </view>
  286. </view>
  287. </view>
  288. <view>
  289. <view class="point">
  290. <view class="dot">
  291. 2
  292. </view>
  293. <view class="time-title">内部预警【{{warnData.warnTime}}】</view>
  294. </view>
  295. <view class="time-info">
  296. <view class="time-line">
  297. <uni-list style="width: 100%;">
  298. <uni-list-item direction="column">
  299. <template v-slot:body>
  300. <view class="list-item-block">
  301. <view class="line">
  302. <view class="text">发布单位:<span
  303. style="color: deepskyblue;">系统自动</span></view>
  304. </view>
  305. </view>
  306. </template>
  307. </uni-list-item>
  308. <uni-list-item direction="column">
  309. <template v-slot:body>
  310. <view class="list-item-block">
  311. <view class="line">
  312. <view class="text">预警名称:<span
  313. style="color: deepskyblue;">{{warnData.warnName}}</span>
  314. </view>
  315. </view>
  316. </view>
  317. </template>
  318. </uni-list-item>
  319. <uni-list-item v-for="(inside,index) in warnData.insideWarnInfoList"
  320. :key="index" direction="column">
  321. <template v-slot:body>
  322. <view class="list-item-block">
  323. <view class="line">
  324. <view class="text ">类型:<span
  325. style="color: deepskyblue;">{{inside.sendObjectName}}</span>
  326. </view>
  327. </view>
  328. <view class="line">
  329. <view class="text ">接收人:<span
  330. style="color: deepskyblue;">{{inside.userName}}</span>
  331. </view>
  332. </view>
  333. <view class="line">
  334. <view class="text">所在单位:<span
  335. style="color: deepskyblue;">{{inside.deptName}}</span>
  336. </view>
  337. </view>
  338. <view class="line">
  339. <view class="text">职务:<span
  340. style="color: deepskyblue;">{{inside.posiTion}}</span>
  341. </view>
  342. </view>
  343. <view class="line">
  344. <view class="text">电话:<span
  345. style="color: deepskyblue;">{{inside.userTel}}</span>
  346. </view>
  347. </view>
  348. <view class="line">
  349. <view class="text">短信内容:<span
  350. style="color: deepskyblue;">{{inside.messageInfo}}</span>
  351. </view>
  352. </view>
  353. <view class="line">
  354. <view class="text">发送时间:<span
  355. style="color: deepskyblue;">{{inside.sendTime}}</span>
  356. </view>
  357. </view>
  358. <view class="line">
  359. <view class="text">发送单位:<span
  360. style="color: deepskyblue;"></span></view>
  361. </view>
  362. <view class="line">
  363. <view class="text">发送人:<span
  364. style="color: deepskyblue;">{{inside.senderName}}</span>
  365. </view>
  366. </view>
  367. <view class="line">
  368. <view v-if="inside.sendStatus ==0" class="text">
  369. 发送状态:<span style="color: deepskyblue;">失败</span>
  370. </view>
  371. <view v-else-if="inside.sendStatus ==1" class="text">
  372. 发送状态:<span style="color: deepskyblue;">成功</span>
  373. </view>
  374. </view>
  375. </view>
  376. </template>
  377. </uni-list-item>
  378. </uni-list>
  379. </view>
  380. </view>
  381. </view>
  382. <view>
  383. <view class="point">
  384. <view class="dot">
  385. 1
  386. </view>
  387. <view class="time-title">产生预警【{{warnData.warnTime}}】</view>
  388. </view>
  389. <view class="time-info">
  390. <view class="time-line">
  391. <uni-list style="width: 100%;">
  392. <uni-list-item direction="column">
  393. <template v-slot:body>
  394. <view class="list-item-block">
  395. <view class="line">
  396. <view class="text"><span
  397. style="color: deepskyblue;">{{warnData.warnInfo}}</span>
  398. </view>
  399. </view>
  400. </view>
  401. </template>
  402. </uni-list-item>
  403. </uni-list>
  404. </view>
  405. </view>
  406. </view>
  407. </view>
  408. </view>
  409. <view v-else-if="contentViewStatus==2">
  410. <view class="view-flex-inline" style="color: gray;margin-left: 10px;font-size: 0.9rem;">
  411. 图层选择: </view>
  412. <view class="view-flex-inline" style="margin-top: 0px;padding-left: 10px;">
  413. <uni-data-checkbox :multiple="true" mode="button" v-model="mapCheck"
  414. :localdata="mapItems" @change="mapChange"></uni-data-checkbox>
  415. </view>
  416. <view class="list-item-block" style="color: gray;padding-left: 10px;">
  417. <view class="line">
  418. <text class="title" style="color: gray;">危险区:</text>
  419. </view>
  420. <view class="line">
  421. <view class="view-flex-block-center view-border"
  422. style="border-radius: 5px;;margin-top: 2px;" @click="moveToYjDangerArea()">
  423. <view class="view-btn-text text-under-line"
  424. style="color: deepskyblue;font-size: 0.7rem;padding-left: 10px;padding-right: 10px;padding-bottom: 2px;">
  425. {{dangerAreaData.dangerAreaName}}
  426. </view>
  427. </view>
  428. </view>
  429. </view>
  430. <view class="list-item-block" style="color: gray;padding-left: 10px;margin-top: 5px;">
  431. <view class="line">
  432. <text class="title" style="color: gray;">关联站点:</text>
  433. </view>
  434. <view class="line">
  435. <view v-for="rtu in dangerAreaData.rtus" :key="rtu.id"
  436. class="view-flex-block-center view-border"
  437. style="border-radius: 5px; padding-right: 10px;margin-top: 2px;"
  438. @click="moveToYjDangerAreaLinkRtu(rtu)">
  439. <view class="view-btn-text text-under-line"
  440. style="color: deepskyblue;font-size: 0.7rem;padding-left: 10px;padding-right: 10px;padding-bottom: 2px;">
  441. {{rtu.stName}}
  442. </view>
  443. </view>
  444. </view>
  445. </view>
  446. <view class="list-item-block" style="color: gray;padding-left: 10px;margin-top: 5px;">
  447. <view class="line">
  448. <text class="title" style="color: gray;">关联转移路线:</text>
  449. </view>
  450. <view class="line">
  451. <view v-for="leaveline in dangerAreaData.leaveLines" :key="leaveline.id"
  452. class="view-flex-block-center view-border"
  453. style="border-radius: 5px; padding-right: 10px;margin-top: 2px;"
  454. @click="moveToYjDangerAreaLinkLine(leaveline)">
  455. <view class="view-btn-text text-under-line"
  456. style="color: deepskyblue;font-size: 0.7rem;padding-left: 10px;padding-right: 10px;padding-bottom: 2px;">
  457. {{leaveline.leaveLineName}}
  458. </view>
  459. </view>
  460. </view>
  461. </view>
  462. <view class="list-item-block" style="color: gray;padding-left: 10px;">
  463. <view class="line">
  464. <text class="title" style="color: gray;">关联家庭户:</text>
  465. </view>
  466. <view class="line">
  467. <view v-if="dangerAreaData.familyCount>0" class="view-flex-block-center view-border"
  468. style="border-radius: 5px;;margin-top: 2px;"
  469. @click="moveToYjDangerAreaFamily()">
  470. <view class="view-btn-text text-under-line"
  471. style="color: deepskyblue;font-size: 0.7rem;padding-left: 10px;padding-right: 10px;padding-bottom: 2px;">
  472. 共有{{dangerAreaData.familyCount}}户
  473. </view>
  474. </view>
  475. <view v-else>
  476. <view class="text" style="color: deepskyblue;font-size: 0.7rem;">暂无关联家庭户</view>
  477. </view>
  478. </view>
  479. </view>
  480. </view>
  481. <view v-else></view>
  482. </scroll-view>
  483. </view>
  484. </view>
  485. </view>
  486. </view>
  487. </template>
  488. <script>
  489. import {
  490. gcoord
  491. } from '@/static/js/gcoord.global.prod.js'
  492. import
  493. navBtns
  494. from "@/api/home.js";
  495. import http from '@/http/api.js';
  496. export default {
  497. name: 'rtuManageView',
  498. components: {},
  499. data() {
  500. return {
  501. title: '实时监测预警',
  502. query: {},
  503. inputStyles: {
  504. color: '#808080',
  505. borderColor: '#d3d3d3'
  506. },
  507. loading: false,
  508. mapScreenMax: false,
  509. mapScreenMin: true,
  510. showSearch: false,
  511. contentViewStatus: 0,
  512. cityRegionValue: '',
  513. cityRegionData: [],
  514. districtRegionValue: '',
  515. districtRegionData: [],
  516. townRegionValue: '',
  517. townRegionData: [],
  518. countryRegionValue: '',
  519. countryRegionData: [],
  520. //adCode: '',
  521. // yjRainDataCoverView: false,
  522. // yjWarnInfoCoverView: false,
  523. // yjDangerAreaCoverView: false,
  524. // yjPreCoverView: 0,
  525. latitude: 40.848119,
  526. longitude: 111.755426,
  527. zoom: true,
  528. scale: 13,
  529. markets: [],
  530. polygons: [],
  531. polylines: [],
  532. includepoints: [],
  533. mapStyles: {
  534. width: '100%',
  535. height: '200px'
  536. },
  537. popViewStyles: {
  538. width: '100%',
  539. height: '500px'
  540. },
  541. popScrollViewStyles: {
  542. width: '100%',
  543. height: '100px'
  544. },
  545. searchViewStyles: {
  546. width: '100%',
  547. height: '40px'
  548. },
  549. mapHeight: 200,
  550. popViewHeight: 500,
  551. horizontal: 'right',
  552. vertical: 'bottom',
  553. direction: 'horizontal',
  554. pattern: {
  555. color: '#7A7E83',
  556. backgroundColor: '#fff',
  557. selectedColor: '#007AFF',
  558. buttonColor: '#007AFF',
  559. iconColor: '#fff'
  560. },
  561. content: [{
  562. iconPath: '/static/images/tabbar/home.png',
  563. selectedIconPath: '/static/images/tabbar/home_selected.png',
  564. text: '雨情',
  565. active: false
  566. },
  567. {
  568. iconPath: '/static/images/tabbar/warn.png',
  569. selectedIconPath: '/static/images/tabbar/warn_selected.png',
  570. text: '预警',
  571. active: false
  572. },
  573. {
  574. iconPath: '/static/images/tabbar/workbench.png',
  575. selectedIconPath: '/static/images/tabbar/workbench_selected.png',
  576. text: '危险区',
  577. active: false
  578. }
  579. ],
  580. // popMenu: false,
  581. // popBoxIndex: 0,
  582. // yjDrawerWidth: 200,
  583. //应急雨量参数
  584. yjRainCountType: {
  585. items: [{
  586. 'id': '0',
  587. 'dictValue': '默认'
  588. }, {
  589. 'id': '1',
  590. 'dictValue': '近1小时'
  591. }, {
  592. 'id': '2',
  593. 'dictValue': '近3小时'
  594. }, {
  595. 'id': '3',
  596. 'dictValue': '近6小时'
  597. }, {
  598. 'id': '4',
  599. 'dictValue': '近12小时'
  600. }, {
  601. 'id': '5',
  602. 'dictValue': '近24小时'
  603. }],
  604. value: 0,
  605. },
  606. pageSize: 10,
  607. pageCurrent: 1,
  608. listTotal: 0,
  609. tableData: [],
  610. searchRtuNameVal: '',
  611. searchRtuCodeVal: '',
  612. //应急预警参数
  613. // yjSearchWarnNameVal: '',
  614. // yjSearchAdNameVal: '',
  615. // yjWarnPageSize: 10,
  616. // yjWarnPageCurrent: 1,
  617. // yjWarnTotal: 0,
  618. // yjWarnTableData: [],
  619. //应急危险区参数
  620. // yjDangerAreaNameVal: '',
  621. // yjDangerAreaAdNameVal: '',
  622. // yjDangerAreaPageSize: 10,
  623. // yjDangerAreaPageCurrent: 1,
  624. // yjDangerAreaTotal: 0,
  625. // yjDangerAreaTableData: [],
  626. // yjDangerAreaRtus: [],
  627. // yjDangerAreaLeaveLines: [],
  628. // yjDangerAreas: [],
  629. mapContext: null,
  630. mapCheck: [0, 1, 2, 3],
  631. mapItems: [{
  632. text: '危险区',
  633. value: 0
  634. },
  635. {
  636. text: '转移路线',
  637. value: 1
  638. },
  639. {
  640. text: '站点',
  641. value: 2
  642. },
  643. {
  644. text: '家庭户',
  645. value: 3
  646. }
  647. ],
  648. isShowDangerArea: true,
  649. isShowLine: true,
  650. isShowSite: true,
  651. isShowFamily: true,
  652. warnData: {},
  653. dangerAreaData: {},
  654. }
  655. },
  656. computed: {
  657. toLocation(l) {
  658. return new Number(l).toFixed(6);
  659. }
  660. },
  661. onInit(option) {
  662. console.log("onInit" + JSON.stringify(uni.getWindowInfo()))
  663. },
  664. onLoad(option) {
  665. this.getCityRegion({});
  666. this.$nextTick(() => {
  667. this.getPage({});
  668. })
  669. },
  670. onShow() {
  671. if (this.$u.func.checkLogin()) {} else {
  672. this.$u.func.logout();
  673. }
  674. },
  675. onReady() {
  676. //console.log("onReady" + JSON.stringify(uni.getWindowInfo()))
  677. this.mapHeight = 200;
  678. //uni.getWindowInfo().windowHeight - 50 - 500;
  679. this.mapStyles.height = this.mapHeight + "px";
  680. this.popViewHeight = uni.getWindowInfo().windowHeight - 50 - 200;
  681. this.popScrollViewStyles.height = (this.popViewHeight - 40) + "px";
  682. this.mapContext = uni.createMapContext('myMap', this);
  683. },
  684. methods: {
  685. toBack() {
  686. uni.navigateBack({
  687. delta: 1
  688. })
  689. },
  690. onBackPress() {
  691. // #ifdef APP-PLUS
  692. plus.key.hideSoftKeybord();
  693. // #endif
  694. },
  695. onMapScreenMax() {
  696. console.log("max")
  697. this.mapScreenMax = true;
  698. this.mapScreenMin = false;
  699. this.mapHeight = uni.getWindowInfo().windowHeight - 50 - 200;
  700. this.mapStyles.height = this.mapHeight + "px";
  701. this.popViewHeight = 200;
  702. this.popScrollViewStyles.height = (this.popViewHeight - 40) + "px";
  703. },
  704. onMapScreenMin() {
  705. console.log("min")
  706. this.mapScreenMax = false;
  707. this.mapScreenMin = true;
  708. this.mapHeight = 200;
  709. this.mapStyles.height = this.mapHeight + "px";
  710. this.popViewHeight = uni.getWindowInfo().windowHeight - 50 - 200;
  711. this.popScrollViewStyles.height = (this.popViewHeight - 40) + "px";
  712. },
  713. searchAreaStatus(e) {
  714. console.log(JSON.stringify(e))
  715. if (e.length > 0 && e[0] == '0') {
  716. this.showSearch = true;
  717. } else {
  718. this.showSearch = false;
  719. }
  720. },
  721. onYjRainDataRefreshClick() {
  722. this.pageCurrent = 1;
  723. this.query = {};
  724. this.searchRtuNameVal = '';
  725. this.searchRtuCodeVal = '';
  726. this.getPage({});
  727. },
  728. onYjWarnBackClick() {
  729. this.contentViewStatus = 0;
  730. },
  731. onYjDangerAreaBackClick() {
  732. this.contentViewStatus = 0;
  733. },
  734. //定位到测站
  735. onYjRainDataRtuClick(item) {
  736. this.isShowSite = true;
  737. this.mapCheck = [2];
  738. this.$nextTick(() => {
  739. this.markets = [];
  740. let marker = {};
  741. let c = gcoord.transform(
  742. [item.lng, item.lat],
  743. gcoord.WGS84,
  744. gcoord.GCJ02
  745. );
  746. marker['id'] = item.id;
  747. marker['latitude'] = c[1];
  748. marker['longitude'] = c[0];
  749. let label = {};
  750. label['content'] = item.rtuName + "(" + item.drp + "mm)";
  751. label['color'] = '#ff0000';
  752. label['bgColor'] = '#ffffff';
  753. label['anchorY'] = -40;
  754. marker['label'] = label;
  755. marker['iconPath'] = "/static/images/icon_warning.png";
  756. this.markets.push(marker)
  757. this.mapContext.moveToLocation({
  758. longitude: c[0],
  759. latitude: c[1],
  760. success: (res) => {
  761. }
  762. });
  763. })
  764. },
  765. //打开预警信息子页面
  766. onYjWarnClick(item) {
  767. let that = this;
  768. this.contentViewStatus = 1;
  769. this.$nextTick(() => {
  770. this.getWarnInfoDetail(item.warnId);
  771. })
  772. },
  773. //打开危险区信息子页面
  774. onYjDangerAreaDataClick(item) {
  775. let that = this;
  776. this.dangerAreaData.dangerAreaName = item.dangerAreaName;
  777. this.isShowDangerArea = true;
  778. this.isShowLine = true;
  779. this.isShowSite = true;
  780. this.isShowFamily = true;
  781. this.mapCheck = [0, 1, 2, 3];
  782. this.markets = [];
  783. this.polygons = [];
  784. this.polylines = [];
  785. this.contentViewStatus = 2;
  786. this.$nextTick(() => {
  787. let postData = {};
  788. postData['dangerAreaPid'] = item.dangerAreaPid;
  789. http.request({
  790. url: '/galaxy-business/map/dangerarea/detail',
  791. method: 'GET',
  792. data: postData
  793. }).then(res => {
  794. if (res.data != null) {
  795. //console.log(JSON.stringify(res.data))
  796. that.dangerAreaData = res.data;
  797. let centerPointLng = res.data.centerPointLng;
  798. let centerPointLat = res.data.centerPointLat;
  799. let dangerStatus = res.data.dangerStatus;
  800. if (that.isShowDangerArea) {
  801. let dangerAreaPoints = res.data.points;
  802. let p = {};
  803. let ps = dangerAreaPoints.map(item => {
  804. let l = gcoord.transform(
  805. [item.pointLng, item.pointLat],
  806. gcoord.WGS84,
  807. gcoord.GCJ02
  808. );
  809. return {
  810. latitude: l[1],
  811. longitude: l[0],
  812. }
  813. })
  814. p['points'] = ps;
  815. let dashArray = [];
  816. dashArray.push(4);
  817. dashArray.push(10);
  818. p['dashArray'] = dashArray;
  819. if (dangerStatus == '1') {
  820. p['strokeColor'] = '#FF0000';
  821. p['fillColor'] = '#F72C5B7D';
  822. } else {
  823. p['strokeColor'] = '#FC8452';
  824. p['fillColor'] = '#FAC8587D';
  825. }
  826. that.polygons.push(p);
  827. }
  828. if (that.isShowLine) {
  829. if (that.dangerAreaData.leaveLines != undefined && that.dangerAreaData
  830. .leaveLines != null && that
  831. .dangerAreaData.leaveLines.length > 0) {
  832. let line = that.dangerAreaData.leaveLines[0];
  833. that.getYjDangerAreaLineDetail(line);
  834. }
  835. }
  836. let rtus = [];
  837. if (that.isShowSite) {
  838. rtus = that.dangerAreaData.rtus.map(item => {
  839. let rtu = {};
  840. rtu['iconPath'] = '/static/images/icon_warning.png';
  841. rtu['id'] = parseInt(item.id);
  842. let r = gcoord.transform(
  843. [item.stLong, item.stLat],
  844. gcoord.WGS84,
  845. gcoord.GCJ02
  846. );
  847. rtu['latitude'] = r[1];
  848. rtu['longitude'] = r[0];
  849. rtu['width'] = 20;
  850. rtu['height'] = 20;
  851. let label = {};
  852. label['content'] = item.stName;
  853. label['color'] = '#000000';
  854. label['bgColor'] = '#ffffff';
  855. label['anchorY'] = -40;
  856. label['borderWidth'] = 1;
  857. label['borderColor'] = '#ff0000';
  858. label['padding'] = 4;
  859. rtu['label'] = label;
  860. return rtu;
  861. });
  862. }
  863. let familys = [];
  864. if (that.isShowFamily) {
  865. familys = that.dangerAreaData.familyPoints.map(item => {
  866. let rtu = {};
  867. rtu['iconPath'] = '/static/images/home.png';
  868. rtu['id'] = parseInt(item.id);
  869. let r = gcoord.transform(
  870. [item.longitude, item.latitude],
  871. gcoord.WGS84,
  872. gcoord.GCJ02
  873. );
  874. rtu['latitude'] = r[1];
  875. rtu['longitude'] = r[0];
  876. rtu['width'] = 20;
  877. rtu['height'] = 20;
  878. let label = {};
  879. label['content'] = item.personName;
  880. label['color'] = '#000000';
  881. label['bgColor'] = '#ffffff';
  882. label['anchorY'] = -40;
  883. label['borderWidth'] = 1;
  884. label['borderColor'] = '#ff0000';
  885. label['padding'] = 4;
  886. rtu['label'] = label;
  887. return rtu;
  888. });
  889. }
  890. let markets = rtus.concat(familys)
  891. that.markets = markets;
  892. let c = gcoord.transform(
  893. [centerPointLng, centerPointLat],
  894. gcoord.WGS84,
  895. gcoord.GCJ02
  896. );
  897. that.latitude = c[1];
  898. that.longitude = c[0];
  899. }
  900. }).catch(err => {
  901. console.log(err)
  902. })
  903. })
  904. },
  905. moveToYjDangerArea() {
  906. if (this.isShowDangerArea) {
  907. this.$nextTick(() => {
  908. let c = gcoord.transform(
  909. [this.dangerAreaData.centerPointLng, this.dangerAreaData.centerPointLat],
  910. gcoord.WGS84,
  911. gcoord.GCJ02
  912. );
  913. this.latitude = c[1];
  914. this.longitude = c[0];
  915. this.mapContext.moveToLocation({
  916. longitude: this.longitude,
  917. latitude: this.latitude,
  918. success: (res) => {
  919. }
  920. });
  921. })
  922. }
  923. },
  924. moveToYjDangerAreaLinkRtu(rtu) {
  925. if (this.isShowSite) {
  926. this.$nextTick(() => {
  927. let c = gcoord.transform(
  928. [rtu.stLong, rtu.stLat],
  929. gcoord.WGS84,
  930. gcoord.GCJ02
  931. );
  932. let lat = c[1];
  933. let long = c[0];
  934. this.mapContext.moveToLocation({
  935. longitude: long,
  936. latitude: lat,
  937. success: (res) => {
  938. }
  939. });
  940. })
  941. }
  942. },
  943. moveToYjDangerAreaLinkLine(line) {
  944. //console.log(JSON.stringify(line))
  945. //let that = this;
  946. if (this.isShowLine) {
  947. this.$nextTick(() => {
  948. let c = gcoord.transform(
  949. [line.centerPointLng, line.centerPointLat],
  950. gcoord.WGS84,
  951. gcoord.GCJ02
  952. );
  953. let lat = c[1];
  954. let long = c[0];
  955. this.mapContext.moveToLocation({
  956. longitude: long,
  957. latitude: lat,
  958. success: (res) => {
  959. }
  960. });
  961. this.getYjDangerAreaLineDetail(line);
  962. })
  963. }
  964. },
  965. moveToYjDangerAreaFamily() {
  966. if (this.isShowFamily) {
  967. this.$nextTick(() => {
  968. if (this.dangerAreaData.familyPoints != undefined && this.dangerAreaData.familyPoints !=
  969. null && this
  970. .dangerAreaData.familyPoints.length > 0) {
  971. let f = this.dangerAreaData.familyPoints[0];
  972. let c = gcoord.transform(
  973. [f.longitude, f.latitude],
  974. gcoord.WGS84,
  975. gcoord.GCJ02
  976. );
  977. this.mapContext.moveToLocation({
  978. longitude: c[0],
  979. latitude: c[1],
  980. success: (res) => {
  981. }
  982. });
  983. }
  984. })
  985. }
  986. },
  987. mapChange(e) {
  988. let selectDangerArea = false;
  989. let selectLine = false;
  990. let selectSite = false;
  991. let selectFamily = false;
  992. for (let i = 0; i < this.mapCheck.length; i++) {
  993. let value = this.mapCheck[i];
  994. if (value == 0) {
  995. selectDangerArea = true;
  996. } else if (value == 1) {
  997. selectLine = true;
  998. } else if (value == 2) {
  999. selectSite = true;
  1000. } else if (value == 3) {
  1001. selectFamily = true;
  1002. }
  1003. }
  1004. if (selectDangerArea) {
  1005. if (!this.isShowDangerArea) {
  1006. let p = {};
  1007. let ps = this.dangerAreaData.points.map(item => {
  1008. let l = gcoord.transform(
  1009. [item.pointLng, item.pointLat],
  1010. gcoord.WGS84,
  1011. gcoord.GCJ02
  1012. );
  1013. return {
  1014. latitude: l[1],
  1015. longitude: l[0],
  1016. }
  1017. })
  1018. p['points'] = ps;
  1019. let dashArray = [];
  1020. dashArray.push(4);
  1021. dashArray.push(10);
  1022. p['dashArray'] = dashArray;
  1023. if (this.dangerAreaData.dangerStatus == '1') {
  1024. p['strokeColor'] = '#FF0000';
  1025. p['fillColor'] = '#F72C5B7D';
  1026. } else {
  1027. p['strokeColor'] = '#FC8452';
  1028. p['fillColor'] = '#FAC8587D';
  1029. }
  1030. this.polygons.push(p);
  1031. this.isShowDangerArea = true;
  1032. }
  1033. } else {
  1034. this.polygons = [];
  1035. this.isShowDangerArea = false;
  1036. }
  1037. if (selectLine) {
  1038. if (!this.isShowLine) {
  1039. if (this.dangerAreaData.leaveLines != undefined && this.dangerAreaData.leaveLines != null && this
  1040. .dangerAreaData.leaveLines.length > 0) {
  1041. let line = this.dangerAreaData.leaveLines[0];
  1042. this.getYjDangerAreaLineDetail(line);
  1043. }
  1044. this.isShowLine = true;
  1045. }
  1046. } else {
  1047. this.polylines = [];
  1048. this.isShowLine = false;
  1049. }
  1050. let rtus = [];
  1051. if (selectSite) {
  1052. rtus = this.dangerAreaData.rtus.map(item => {
  1053. let rtu = {};
  1054. rtu['iconPath'] = '/static/images/icon_warning.png';
  1055. rtu['id'] = parseInt(item.id);
  1056. let r = gcoord.transform(
  1057. [item.stLong, item.stLat],
  1058. gcoord.WGS84,
  1059. gcoord.GCJ02
  1060. );
  1061. rtu['latitude'] = r[1];
  1062. rtu['longitude'] = r[0];
  1063. rtu['width'] = 20;
  1064. rtu['height'] = 20;
  1065. let label = {};
  1066. label['content'] = item.stName;
  1067. label['color'] = '#000000';
  1068. label['bgColor'] = '#ffffff';
  1069. label['anchorY'] = -40;
  1070. label['borderWidth'] = 1;
  1071. label['borderColor'] = '#ff0000';
  1072. label['padding'] = 4;
  1073. rtu['label'] = label;
  1074. return rtu;
  1075. });
  1076. this.isShowSite = true;
  1077. } else {
  1078. this.isShowSite = false;
  1079. }
  1080. let familys = [];
  1081. if (selectFamily) {
  1082. console.log(JSON.stringify(this.dangerAreaData.familyPoints))
  1083. familys = this.dangerAreaData.familyPoints.map(item => {
  1084. let rtu = {};
  1085. rtu['iconPath'] = '/static/images/home.png';
  1086. rtu['id'] = parseInt(item.id);
  1087. let r = gcoord.transform(
  1088. [item.longitude, item.latitude],
  1089. gcoord.WGS84,
  1090. gcoord.GCJ02
  1091. );
  1092. rtu['latitude'] = r[1];
  1093. rtu['longitude'] = r[0];
  1094. rtu['width'] = 20;
  1095. rtu['height'] = 20;
  1096. let label = {};
  1097. label['content'] = item.personName;
  1098. label['color'] = '#000000';
  1099. label['bgColor'] = '#ffffff';
  1100. label['anchorY'] = -40;
  1101. label['borderWidth'] = 1;
  1102. label['borderColor'] = '#ff0000';
  1103. label['padding'] = 4;
  1104. rtu['label'] = label;
  1105. return rtu;
  1106. });
  1107. this.isShowFamily = true;
  1108. } else {
  1109. this.isShowFamily = false;
  1110. }
  1111. let markets = rtus.concat(familys)
  1112. this.markets = markets;
  1113. },
  1114. cityRegionChange(e) {
  1115. this.cityRegionValue = e;
  1116. this.districtRegionData = [];
  1117. this.districtRegionValue = '';
  1118. this.townRegionData = [];
  1119. this.townRegionValue = '';
  1120. this.countryRegionData = [];
  1121. this.countryRegionValue = '';
  1122. let p = {
  1123. 'parentCode': this.cityRegionValue
  1124. }
  1125. this.getDistrictRegion(p);
  1126. this.query['adCode'] = this.cityRegionValue;
  1127. },
  1128. districtRegionChange(e) {
  1129. if (e == undefined || e == null || e == '') {
  1130. this.districtRegionValue = '';
  1131. this.townRegionData = [];
  1132. this.townRegionValue = '';
  1133. this.countryRegionData = [];
  1134. this.countryRegionValue = '';
  1135. this.query['adCode'] = this.cityRegionValue;
  1136. } else {
  1137. this.districtRegionValue = e;
  1138. this.townRegionData = [];
  1139. this.townRegionValue = '';
  1140. this.countryRegionData = [];
  1141. this.countryRegionValue = '';
  1142. let p = {
  1143. 'parentCode': this.districtRegionValue
  1144. }
  1145. this.getTownRegion(p);
  1146. this.query['adCode'] = this.districtRegionValue;
  1147. }
  1148. },
  1149. townRegionChange(e) {
  1150. if (e == undefined || e == null || e == '') {
  1151. this.townRegionValue = '';
  1152. this.countryRegionData = [];
  1153. this.countryRegionValue = '';
  1154. this.query['adCode'] = this.districtRegionValue;
  1155. } else {
  1156. this.townRegionValue = e;
  1157. this.countryRegionData = [];
  1158. this.countryRegionValue = '';
  1159. let p = {
  1160. 'parentCode': this.townRegionValue
  1161. }
  1162. this.getCountryRegion(p);
  1163. this.query['adCode'] = this.townRegionValue;
  1164. }
  1165. },
  1166. countryRegionChange(e) {
  1167. if (e == undefined || e == null || e == '') {
  1168. this.countryRegionValue = '';
  1169. this.query['adCode'] = this.townRegionValue;
  1170. } else {
  1171. this.countryRegionValue = e;
  1172. this.query['adCode'] = this.countryRegionValue;
  1173. }
  1174. },
  1175. getCityRegion(params = {}) {
  1176. let that = this;
  1177. http.request({
  1178. url: '/galaxy-business/baseinfo/region/whole/yj/list',
  1179. method: 'GET',
  1180. data: params,
  1181. }).then(res => {
  1182. //console.log(JSON.stringify(res.data))
  1183. that.cityRegionData = res.data.map(item => {
  1184. return {
  1185. value: item.adcd,
  1186. text: item.adnm,
  1187. }
  1188. })
  1189. }).catch(err => {
  1190. console.log(err)
  1191. })
  1192. },
  1193. getDistrictRegion(params = {}) {
  1194. let that = this;
  1195. http.request({
  1196. url: '/galaxy-business/baseinfo/region/whole/yj/list',
  1197. method: 'GET',
  1198. data: params,
  1199. }).then(res => {
  1200. that.districtRegionData = res.data.map(item => {
  1201. return {
  1202. value: item.adcd,
  1203. text: item.adnm,
  1204. }
  1205. })
  1206. }).catch(err => {
  1207. console.log(err)
  1208. })
  1209. },
  1210. getTownRegion(params = {}) {
  1211. let that = this;
  1212. http.request({
  1213. url: '/galaxy-business/baseinfo/region/whole/yj/list',
  1214. method: 'GET',
  1215. data: params,
  1216. }).then(res => {
  1217. that.townRegionData = res.data.map(item => {
  1218. return {
  1219. value: item.adcd,
  1220. text: item.adnm,
  1221. }
  1222. })
  1223. }).catch(err => {
  1224. console.log(err)
  1225. })
  1226. },
  1227. getCountryRegion(params = {}) {
  1228. let that = this;
  1229. http.request({
  1230. url: '/galaxy-business/baseinfo/region/whole/yj/list',
  1231. method: 'GET',
  1232. data: params,
  1233. }).then(res => {
  1234. that.countryRegionData = res.data.map(item => {
  1235. return {
  1236. value: item.adcd,
  1237. text: item.adnm,
  1238. }
  1239. })
  1240. }).catch(err => {
  1241. console.log(err)
  1242. })
  1243. },
  1244. getWarnInfoDetail(warnId) {
  1245. let that = this;
  1246. http.request({
  1247. url: '/galaxy-business/yj/warn/detail/all?warnId=' + warnId,
  1248. method: 'GET'
  1249. }).then(res => {
  1250. if (res && res.success) {
  1251. that.warnData = res.data;
  1252. }
  1253. }).catch(err => {
  1254. console.log(JOSN.stringify(err))
  1255. })
  1256. },
  1257. // openRainDataView() {
  1258. // let that = this;
  1259. // this.mapStyles.height = "200px";
  1260. // this.yjWarnInfoCoverView = false;
  1261. // this.yjDangerAreaCoverView = false;
  1262. // if (this.yjPreCoverView != 1) {
  1263. // this.yjMapMarkers = [];
  1264. // this.polygons = [];
  1265. // this.polylines = [];
  1266. // }
  1267. // this.yjPreCoverView = 1;
  1268. // this.yjRainDataCoverView = true;
  1269. // this.$nextTick(() => {
  1270. // let p = {};
  1271. // that.getYjRainDataPage(p);
  1272. // })
  1273. // },
  1274. // openWarnInfoView() {
  1275. // let that = this;
  1276. // this.mapStyles.height = "200px";
  1277. // this.yjRainDataCoverView = false;
  1278. // this.yjDangerAreaCoverView = false;
  1279. // if (this.yjPreCoverView != 2) {
  1280. // this.yjMapMarkers = [];
  1281. // this.polygons = [];
  1282. // this.polylines = [];
  1283. // }
  1284. // this.yjPreCoverView = 2;
  1285. // this.yjWarnInfoCoverView = true;
  1286. // this.$nextTick(() => {
  1287. // let p = {};
  1288. // that.getYjWarnDataPage(p);
  1289. // })
  1290. // },
  1291. // openDangerAreaView() {
  1292. // let that = this;
  1293. // this.mapStyles.height = "200px";
  1294. // this.yjRainDataCoverView = false;
  1295. // this.yjWarnInfoCoverView = false;
  1296. // if (this.yjPreCoverView != 3) {
  1297. // this.yjMapMarkers = [];
  1298. // this.polygons = [];
  1299. // this.polylines = [];
  1300. // }
  1301. // this.yjPreCoverView = 3;
  1302. // this.yjDangerAreaCoverView = true;
  1303. // this.$nextTick(() => {
  1304. // let p = {};
  1305. // that.getYjDangerAreaDataPage(p);
  1306. // })
  1307. // },
  1308. // yjPopMenuClose() {
  1309. // this.mapStyles.height = this.mapHeight + "px";
  1310. // this.yjRainDataCoverView = false;
  1311. // this.yjWarnInfoCoverView = false;
  1312. // this.yjDangerAreaCoverView = false;
  1313. // },
  1314. //雨量数据业务
  1315. pageChange(e) {
  1316. this.pageCurrent = e.current;
  1317. let params = {};
  1318. if (this.searchRtuCodeVal.length > 0) {
  1319. params['rtuCode'] = this.searchRtuCodeVal;
  1320. }
  1321. if (this.searchRtuNameVal.length > 0) {
  1322. params['rtuName'] = this.searchRtuNameVal;
  1323. }
  1324. this.getPage(params)
  1325. },
  1326. onSearch() {
  1327. this.pageCurrent = 1;
  1328. this.tableData = [];
  1329. let params = {};
  1330. if (this.searchRtuCodeVal.length > 0) {
  1331. params['rtuCode'] = this.searchRtuCodeVal;
  1332. }
  1333. if (this.searchRtuNameVal.length > 0) {
  1334. params['rtuName'] = this.searchRtuNameVal;
  1335. }
  1336. this.getPage(params);
  1337. // this.$nextTick(() => {
  1338. // this.showSearch = false;
  1339. // })
  1340. },
  1341. getPage(params = {}) {
  1342. const current = this.pageCurrent;
  1343. const size = this.pageSize;
  1344. const isSubmit = '0';
  1345. if (this.yjRainCountType.value == 1) {
  1346. params['rainCountType'] = 1;
  1347. } else if (this.yjRainCountType.value == 2) {
  1348. params['rainCountType'] = 3;
  1349. } else if (this.yjRainCountType.value == 3) {
  1350. params['rainCountType'] = 6;
  1351. } else if (this.yjRainCountType.value == 4) {
  1352. params['rainCountType'] = 12;
  1353. } else if (this.yjRainCountType.value == 5) {
  1354. params['rainCountType'] = 24;
  1355. } else {
  1356. params['rainCountType'] = 0;
  1357. }
  1358. let postData = Object.assign(params, this.query);
  1359. //console.log(JSON.stringify(postData))
  1360. var that = this;
  1361. http.request({
  1362. url: '/galaxy-business/yj/rain/page',
  1363. method: 'GET',
  1364. params: {
  1365. current,
  1366. size,
  1367. isSubmit
  1368. },
  1369. data: postData,
  1370. }).then(res => {
  1371. console.log(JSON.stringify(res))
  1372. if (res.data.records != null) {
  1373. that.tableData = res.data.records;
  1374. }
  1375. that.listTotal = res.data.total;
  1376. if (that.listTotal == 0) {
  1377. that.pageCurrent = 1;
  1378. }
  1379. }).catch(err => {
  1380. console.log(err)
  1381. })
  1382. },
  1383. onYjRainCountTypeRadioChange: function(evt) {
  1384. for (let i = 0; i < this.yjRainCountType.items.length; i++) {
  1385. if (this.yjRainCountType.items[i].id === evt.detail.value) {
  1386. this.yjRainCountType.value = i;
  1387. break;
  1388. }
  1389. }
  1390. this.getPage({});
  1391. },
  1392. searchRtuNameValClear(e) {
  1393. if (e == null || e.length == 0) {
  1394. this.searchRtuNameVal = '';
  1395. }
  1396. },
  1397. searchRtuCodeValClear(e) {
  1398. if (e == null || e.length == 0) {
  1399. this.searchRtuCodeValL = '';
  1400. }
  1401. },
  1402. //应急预警信息
  1403. yjSearchWarnNameValClear(e) {
  1404. if (e == null || e.length == 0) {
  1405. this.yjSearchWarnNameVal = '';
  1406. }
  1407. },
  1408. yjSearchAdNameValClear(e) {
  1409. if (e == null || e.length == 0) {
  1410. this.yjSearchAdNameVal = '';
  1411. }
  1412. },
  1413. // yjWarnPageChange(e) {
  1414. // this.yjDangerAreaPageCurrent = e.current;
  1415. // let params = {};
  1416. // if (this.yjSearchWarnNameVal.length > 0) {
  1417. // params['warnName'] = this.yjSearchWarnNameVal;
  1418. // }
  1419. // if (this.yjSearchAdNameVal.length > 0) {
  1420. // params['dangerAreaName'] = this.yjSearchAdNameVal;
  1421. // }
  1422. // this.getYjWarnDataPage(params)
  1423. // },
  1424. // yjWarnDataSearch() {
  1425. // let params = {};
  1426. // if (this.yjSearchWarnNameVal.length > 0) {
  1427. // params['warnName'] = this.yjSearchWarnNameVal;
  1428. // }
  1429. // if (this.yjSearchAdNameVal.length > 0) {
  1430. // params['dangerAreaName'] = this.yjSearchAdNameVal;
  1431. // }
  1432. // this.getYjWarnDataPage(params);
  1433. // },
  1434. // getYjWarnDataPage(params = {}) {
  1435. // const current = this.yjWarnPageCurrent;
  1436. // const size = this.yjWarnPageSize;
  1437. // const isSubmit = '0';
  1438. // let postData = Object.assign(params, this.query);
  1439. // let that = this;
  1440. // http.request({
  1441. // url: '/galaxy-business/yj/warn/page',
  1442. // method: 'GET',
  1443. // params: {
  1444. // current,
  1445. // size,
  1446. // },
  1447. // data: postData,
  1448. // }).then(res => {
  1449. // if (res.data.records != null) {
  1450. // that.yjWarnTableData = res.data.records;
  1451. // }
  1452. // that.yjWarnTotal = res.data.total;
  1453. // if (that.yjWarnTotal == 0) {
  1454. // that.yjWarnPageCurrent = 1;
  1455. // }
  1456. // }).catch(err => {
  1457. // console.log(err)
  1458. // })
  1459. // },
  1460. //应急危险区业务
  1461. // yjDangerAreaNameValClear(e) {
  1462. // if (e == null || e.length == 0) {
  1463. // this.yjDangerAreaNameVal = '';
  1464. // }
  1465. // },
  1466. // yjDangerAreaAdNameValClear(e) {
  1467. // if (e == null || e.length == 0) {
  1468. // this.yjDangerAreaAdNameVal = '';
  1469. // }
  1470. // },
  1471. // yjDangerAreaDataSearch() {
  1472. // let params = {};
  1473. // if (this.yjDangerAreaNameVal.length > 0) {
  1474. // params['dangerAreaName'] = this.yjDangerAreaNameVal;
  1475. // }
  1476. // this.getYjDangerAreaDataPage(params);
  1477. // },
  1478. // yjDangerAreaPageChange(e) {
  1479. // this.yjDangerAreaPageCurrent = e.current;
  1480. // let params = {};
  1481. // if (this.yjDangerAreaNameVal.length > 0) {
  1482. // params['dangerAreaName'] = this.yjDangerAreaNameVal;
  1483. // }
  1484. // this.getYjDangerAreaDataPage(params)
  1485. // },
  1486. // getYjDangerAreaDataPage(params = {}) {
  1487. // const current = this.yjDangerAreaPageCurrent;
  1488. // const size = this.yjDangerAreaPageSize;
  1489. // const isSubmit = '0';
  1490. // let postData = Object.assign(params, this.query);
  1491. // let that = this;
  1492. // http.request({
  1493. // url: '/galaxy-business/map/dangerarea/page',
  1494. // method: 'GET',
  1495. // params: {
  1496. // current,
  1497. // size,
  1498. // },
  1499. // data: postData,
  1500. // }).then(res => {
  1501. // if (res.data.records != null) {
  1502. // that.yjDangerAreaTableData = res.data.records;
  1503. // }
  1504. // that.yjDangerAreaTotal = res.data.total;
  1505. // if (that.yjDangerAreaTotal == 0) {
  1506. // that.yjDangerAreaPageCurrent = 1;
  1507. // }
  1508. // }).catch(err => {
  1509. // console.log(err)
  1510. // })
  1511. // },
  1512. // getDangerAreaDataGcoord(id) {
  1513. // let that = this;
  1514. // let postData = {};
  1515. // postData['id'] = id;
  1516. // http.request({
  1517. // url: '/galaxy-business/map/dangerarea/detail',
  1518. // method: 'GET',
  1519. // data: postData
  1520. // }).then(res => {
  1521. // if (res.data != null) {
  1522. // that.includepoints = [];
  1523. // that.polygons = [];
  1524. // let p = {};
  1525. // let ps = res.data.points.map(item => {
  1526. // let l = gcoord.transform(
  1527. // [item.pointLng, item.pointLat],
  1528. // gcoord.WGS84,
  1529. // gcoord.GCJ02
  1530. // );
  1531. // return {
  1532. // latitude: l[1],
  1533. // longitude: l[0],
  1534. // }
  1535. // })
  1536. // p['points'] = ps;
  1537. // that.includepoints.push(ps[0]);
  1538. // let dashArray = [];
  1539. // dashArray.push(4);
  1540. // dashArray.push(10);
  1541. // p['dashArray'] = dashArray;
  1542. // if (res.data.dangerStatus == '1') {
  1543. // p['strokeColor'] = '#FF0000';
  1544. // p['fillColor'] = '#F72C5B7D';
  1545. // } else {
  1546. // p['strokeColor'] = '#FC8452';
  1547. // p['fillColor'] = '#FAC8587D';
  1548. // }
  1549. // that.polygons.push(p);
  1550. // that.scale = 14;
  1551. // }
  1552. // }).catch(err => {
  1553. // console.log(err)
  1554. // })
  1555. // },
  1556. // onYjDangerAreaLinkRtuClick(rtu) {
  1557. // console.log(JSON.stringify(rtu))
  1558. // this.yjMapMarkers = [];
  1559. // let marker = {};
  1560. // marker['id'] = rtu.id;
  1561. // let l = gcoord.transform(
  1562. // [rtu.stLong, rtu.stLat],
  1563. // gcoord.WGS84,
  1564. // gcoord.GCJ02
  1565. // );
  1566. // marker['latitude'] = l[1];
  1567. // marker['longitude'] = l[0];
  1568. // let label = {};
  1569. // label['content'] = rtu.stName;
  1570. // label['color'] = '#ff0000';
  1571. // label['bgColor'] = '#ffffff';
  1572. // label['anchorY'] = -40;
  1573. // marker['label'] = label;
  1574. // marker['iconPath'] = "/static/images/icon_warning.png";
  1575. // this.yjMapMarkers.push(marker)
  1576. // this.latitude = l[1];
  1577. // this.longitude = l[0];
  1578. // this.scale = 14;
  1579. // },
  1580. // onYjDangerAreaLinkLineClick(line) {
  1581. // console.log(JSON.stringify(line))
  1582. // let that = this;
  1583. // this.polylines = [];
  1584. // let c = gcoord.transform(
  1585. // [line.centerPointLng, line.centerPointLat],
  1586. // gcoord.WGS84,
  1587. // gcoord.GCJ02
  1588. // );
  1589. // this.latitude = c[1];
  1590. // this.longitude = c[0];
  1591. // this.scale = 14;
  1592. // //let id = line.id;
  1593. // this.$nextTick(() => {
  1594. // that.getYjDangerAreaLineDetail(line);
  1595. // })
  1596. // },
  1597. getYjDangerAreaLineDetail(line) {
  1598. let that = this;
  1599. let postData = {};
  1600. postData['id'] = line.id;
  1601. http.request({
  1602. url: '/galaxy-business/map/leaveline/detail',
  1603. method: 'GET',
  1604. data: postData
  1605. }).then(res => {
  1606. if (res.data != null) {
  1607. that.polylines = [];
  1608. let p = {};
  1609. let ps = res.data.points.map(item => {
  1610. let l = gcoord.transform(
  1611. [item.pointLng, item.pointLat],
  1612. gcoord.WGS84,
  1613. gcoord.GCJ02
  1614. );
  1615. return {
  1616. latitude: l[1],
  1617. longitude: l[0],
  1618. }
  1619. })
  1620. p['points'] = ps;
  1621. if (that.dangerAreaData.dangerStatus == '1') {
  1622. p['color'] = '#FAC858FF';
  1623. } else {
  1624. p['color'] = '#F72C5BFF';
  1625. }
  1626. p['width'] = 4;
  1627. that.polylines.push(p);
  1628. }
  1629. }).catch(err => {
  1630. console.log(err)
  1631. })
  1632. },
  1633. // onYjDangerAreaClick(item) {
  1634. // let that = this;
  1635. // this.polygons = [];
  1636. // this.$nextTick(() => {
  1637. // let c = gcoord.transform(
  1638. // [item.lng, item.lat],
  1639. // gcoord.WGS84,
  1640. // gcoord.GCJ02
  1641. // );
  1642. // that.latitude = c[1];
  1643. // that.longitude = c[0];
  1644. // this.scale = 14;
  1645. // that.getDangerAreaDataGcoord(item.id);
  1646. // })
  1647. // }
  1648. }
  1649. }
  1650. </script>
  1651. <style lang="scss" scoped>
  1652. .tag {
  1653. display: flex;
  1654. flex-direction: row;
  1655. justify-content: flex-start;
  1656. align-items: center;
  1657. margin-bottom: 10px;
  1658. padding-left: 10px;
  1659. flex-wrap: wrap;
  1660. view {
  1661. margin: 5px;
  1662. }
  1663. }
  1664. .select-checkbox {
  1665. margin-top: 0px;
  1666. margin-bottom: 5px;
  1667. padding-left: 15px;
  1668. }
  1669. .scroll-view {
  1670. /* #ifndef APP-NVUE */
  1671. width: 100%;
  1672. height: 100%;
  1673. /* #endif */
  1674. flex: 1
  1675. }
  1676. // 处理抽屉内容滚动
  1677. .scroll-view-box {
  1678. flex: 1;
  1679. position: absolute;
  1680. top: 0;
  1681. right: 0;
  1682. bottom: 0;
  1683. left: 0;
  1684. }
  1685. .point {
  1686. display: flex;
  1687. flex-direction: row;
  1688. align-items: center;
  1689. margin: 15rpx 0;
  1690. }
  1691. .dot {
  1692. //margin-left: -22rpx;
  1693. background-color: #19be6b;
  1694. box-shadow: 0 0 5rpx 5rpx #71d5a1;
  1695. color: white;
  1696. width: 50rpx;
  1697. height: 50rpx;
  1698. padding: 5rpx;
  1699. font-size: 28rpx;
  1700. text-align: center;
  1701. border-radius: 50rpx;
  1702. }
  1703. .time-title {
  1704. font-size: 30rpx;
  1705. margin-left: 15rpx;
  1706. background-color: whitesmoke;
  1707. padding: 12rpx 25rpx;
  1708. border-radius: 50rpx;
  1709. color: orangered;
  1710. }
  1711. .time-info {
  1712. padding: 0rpx 0rpx 0rpx 25rpx;
  1713. }
  1714. .time-line {
  1715. border-left: 3rpx solid #71d5a1;
  1716. padding: 10rpx 10rpx 30rpx 20rpx;
  1717. }
  1718. </style>