rtumanage.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <template>
  2. <view class="wrap">
  3. <uNavBar :fixed="true" backgroundColor="#3F9EFF" statusBar="false" height="75px">
  4. <block slot="left">
  5. <view style="display: flex;flex-direction: column;justify-content: center;">
  6. <image src="/static/images/nav_logo.png" class="logo" mode="widthFix"></image>
  7. </view>
  8. </block>
  9. <view style="width:100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
  10. <text style="color: #ffffff; font-size: 1rem;font-family: Microsoft YaHei;">{{title}}</text>
  11. </view>
  12. </uNavBar>
  13. <view class="container">
  14. <uSection title="查询" titleFontSize="0.8rem" type="line" style="padding-left: 10px;padding-right: 10px;">
  15. <uni-data-picker placeholder="请选择机构" popup-title="请选择所在地区" :localdata="projectTree"
  16. v-model="selectedTreeNode" @change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened"
  17. @popupclosed="onpopupclosed">
  18. </uni-data-picker>
  19. </uSection>
  20. <view>
  21. <uni-search-bar placeholder="请录入测站编码或测站名称" @confirm="search" :focus="false" v-model="searchValue"
  22. @blur="blur" @focus="focus" @input="input" @cancel="cancel" @clear="clear">
  23. </uni-search-bar>
  24. </view>
  25. <uSection title="">
  26. <uni-list>
  27. <uni-list-item v-for="(item, index) in tableData" :key="index">
  28. <template v-slot:body>
  29. <view style="height: 125px;width: 100%;display: flex;flex-direction: column;">
  30. <!-- 测站名称 -->
  31. <view
  32. style="height:22%; width:100%;display:flex;flex-direction: row;justify-content: flex-start;align-items: center;">
  33. <image class="order-title-image" style="box-shadow:0 0 2px 2px lightblue"
  34. src="/static/images//manage//site.png" mode="widthFix">
  35. </image>
  36. <text style="margin-left: 10rpx; font-size: 1rem;font-weight: bold;">{{item.rtuName}}</text>
  37. <text
  38. style="margin-left:8rpx;font-size: 0.9rem;color:grey;">[{{item.rtuCode}}]</text>
  39. </view>
  40. <!-- 运行状态 -->
  41. <view
  42. style="height:18%;width: 100%;display: flex;flex-direction: row;align-items: center;">
  43. <view v-if="item.runStatusId==1"
  44. style="display: flex; flex-direction: row;align-items: center;">
  45. <image class="slot-image" src="/static/images/icon_warning.png" mode="widthFix">
  46. </image>
  47. <text style="color: orangered;font-size:0.7rem">预警</text>
  48. </view>
  49. <view v-else style="display: flex; flex-direction: row;align-items: center;">
  50. <image class="slot-image" src="/static/images/tabbar/demo_selected.png"
  51. mode="widthFix">
  52. </image>
  53. <text style="color: green;font-size:0.7rem">正常</text>
  54. </view>
  55. <text style="margin-left: 10px;color:gray;font-size:0.7rem;">最近上报时间</text>
  56. <text
  57. style="margin-left: 4px;color:gray;font-size:0.7rem;">{{item.lastUpTime}}</text>
  58. </view>
  59. <!-- 测站类型 -->
  60. <view
  61. style="height:18%;width: 100%;display: flex;flex-direction:row;justify-content: flex-start;align-items: center;">
  62. <text style="color:gray;font-size:0.7rem;margin-right: 5px;">测站类型:</text>
  63. <view v-if="item.isRain===1">
  64. <text style="color:gray;font-size:0.7rem">雨量站</text>
  65. </view>
  66. <view v-if="item.isRiver===1">
  67. <text v-if="item.isRain===1"
  68. style="margin-left:2px;margin-right:2px;color:skyblue;font-size:0.7rem">
  69. /
  70. </text>
  71. <text style="color:gray;font-size:0.7rem">河道站</text>
  72. </view>
  73. <view v-if="item.isRes===1">
  74. <text v-if="item.isRain===1 || item.isRiver===1"
  75. style="margin-left:2px;margin-right:2px;color:skyblue;font-size:0.7rem">
  76. /
  77. </text>
  78. <text style="color:gray;font-size:0.7rem">水库站</text>
  79. </view>
  80. </view>
  81. <!-- 业务数据 -->
  82. <view
  83. style="height:18%;display: flex;flex-direction:row;justify-content: flex-start;align-items: center;">
  84. <view>
  85. <text style="color:gray;font-size:0.6rem;margin-right: 5px;">实时数据:</text>
  86. </view>
  87. <view v-if="item.isRain===1">
  88. <text style="color:gray;font-size:0.6rem">降水(mm)</text>
  89. <text v-if="item.drp"
  90. style="margin-left:2px;color:gray;font-size:0.6rem">:{{item.drp}}</text>
  91. <text v-else style="margin-left:2px;color:gray;font-size:0.6rem">:</text>
  92. </view>
  93. <view v-if="item.isRiver===1">
  94. <text v-if="item.isRain===1"
  95. style="margin-left:2px;margin-right:2px;color:skyblue;font-size:0.6rem">
  96. /
  97. </text>
  98. <text style="color:gray;font-size:0.6rem">水位(m)</text>
  99. <text v-if="item.z"
  100. style="margin-left:2px;color:gray;font-size:0.6rem">:{{item.z}}</text>
  101. <text v-else style="margin-left:2px;color:gray;font-size:0.6rem">: </text>
  102. </view>
  103. <view v-if="item.isRes===1">
  104. <text v-if="item.isRain===1 || item.isRiver===1"
  105. style="margin-left:2px;margin-right:2px;color:skyblue;font-size:0.6rem">
  106. /
  107. </text>
  108. <text style="color:gray;font-size:0.6rem">库上水位(m)</text>
  109. <text v-if="item.rz"
  110. style="margin-left:2px;color:gray;font-size:0.6rem">:{{item.rz}}</text>
  111. <text v-else style="margin-left:2px;color:gray;font-size:0.6rem">: </text>
  112. </view>
  113. </view>
  114. <!-- 操作 -->
  115. <view
  116. style="height:22%;padding-top:4px;display: flex;flex-direction: row;justify-content: flex-end;">
  117. <view
  118. style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
  119. @click="toWarningPage(item.rtuCode)">
  120. <view style="display:flex;flex-direction: column;justify-content: center;">
  121. <uIcons class="input-uni-icon" type="notification" size="18"
  122. color="coral" />
  123. </view>
  124. <view
  125. style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
  126. <text style="color:black;font-size:0.7rem">预警信息</text>
  127. </view>
  128. </view>
  129. <view
  130. style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
  131. @click="toCheckOrderPage(item.rtuCode)">
  132. <view style="display:flex;flex-direction: column;justify-content: center;">
  133. <uIcons class="input-uni-icon" type="gear" size="18" color="coral" />
  134. </view>
  135. <view
  136. style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
  137. <text style="color:black;font-size:0.7rem">工单管理</text>
  138. </view>
  139. </view>
  140. <view
  141. style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
  142. @click="toLocation(item)">
  143. <view style="display:flex;flex-direction: column;justify-content: center;">
  144. <uIcons class="input-uni-icon" type="location" size="18" color="coral" />
  145. </view>
  146. <view
  147. style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
  148. <text style="color:black;font-size:0.7rem">导航</text>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. </template>
  154. </uni-list-item>
  155. </uni-list>
  156. <uGroup>
  157. <view class="uni-pagination-box">
  158. <uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  159. @change="change" />
  160. </view>
  161. </uGroup>
  162. </uSection>
  163. </view>
  164. </view>
  165. </template>
  166. <script>
  167. import http from '@/http/api.js';
  168. import uSearchBar from '@/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue'
  169. import uGroup from '@/uni_modules/uni-group/uni-group.vue'
  170. import uSection from '@/uni_modules/uni-section/uni-section.vue'
  171. import uNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue'
  172. import uDataPicker from '@/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue'
  173. import uTable from '@/uni_modules/uni-table/components/uni-table/uni-table.vue'
  174. import uPagination from '@/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue'
  175. import uBreadcrumb from '@/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue'
  176. import uList from '@/uni_modules/uni-list/components/uni-list/uni-list.vue'
  177. import uListItem from '@/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue'
  178. import uIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
  179. export default {
  180. name: '',
  181. components: {
  182. uGroup,
  183. uSection,
  184. uNavBar,
  185. uDataPicker,
  186. uList,
  187. uListItem,
  188. uTable,
  189. uBreadcrumb,
  190. uPagination,
  191. uIcons,
  192. },
  193. onLoad(option) {
  194. this.getProjectTree();
  195. },
  196. data() {
  197. return {
  198. title: '管理工作台',
  199. desc: '',
  200. tableData: [],
  201. // 每页数据量
  202. pageSize: 10,
  203. // 当前页
  204. pageCurrent: 1,
  205. // 数据总量
  206. total: 0,
  207. loading: false,
  208. selectedIndexs: [],
  209. projectTree: [],
  210. orgId: '',
  211. projectId: '',
  212. searchValue: '',
  213. selectedTreeNode: '',
  214. }
  215. },
  216. computed: {
  217. getIcon() {
  218. return path => {
  219. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  220. }
  221. },
  222. },
  223. onShow() {
  224. this.loadList();
  225. },
  226. methods: {
  227. onnodeclick(node) {
  228. if (node.projectId != null) {
  229. this.orgId = node.orgId;
  230. this.projectId = node.projectId;
  231. this.searchValue = '';
  232. this.pageCurrent = 1;
  233. this.loadList();
  234. }
  235. },
  236. onpopupopened(e) {
  237. },
  238. onpopupclosed(e) {
  239. },
  240. onchange(e) {
  241. console.log("onchange++++++"+e)
  242. },
  243. // 分页触发
  244. change(e) {
  245. //this.$refs.table.clearSelection()
  246. this.selectedIndexs.length = 0
  247. this.pageCurrent = e.current;
  248. this.loadList()
  249. },
  250. search(res) {
  251. this.loadList();
  252. },
  253. input(res) {
  254. },
  255. clear(res) {
  256. this.searchVal = '';
  257. this.loadList();
  258. },
  259. blur(res) {
  260. },
  261. focus(e) {
  262. },
  263. cancel(res) {
  264. this.searchVal = '';
  265. this.loadList();
  266. },
  267. onBackPress() {
  268. // #ifdef APP-PLUS
  269. plus.key.hideSoftKeybord();
  270. // #endif
  271. },
  272. getProjectTree() {
  273. var that = this;
  274. http.request({
  275. url: '/galaxy-test/rtu/manage/tree',
  276. method: 'GET',
  277. }).then(res => {
  278. if (res.data != null) {
  279. that.projectTree = res.data;
  280. that.selectedTreeNode = that.projectTree[0].value;
  281. that.orgId = that.projectTree[0].orgId;
  282. that.projectId = that.projectTree[0].projectId;
  283. that.loadList();
  284. }
  285. }).catch(err => {
  286. console.log(err)
  287. })
  288. },
  289. loadList() {
  290. this.loading = true
  291. const current = this.pageCurrent;
  292. const size = this.pageSize;
  293. const isSubmit = '0';
  294. var formData = {};
  295. formData['rtuName'] = this.searchValue;
  296. formData['projectId'] = this.projectId;
  297. formData['orgId'] = this.orgId;
  298. var that = this;
  299. http.request({
  300. url: '/galaxy-test/rtu/manage/page',
  301. method: 'GET',
  302. params: {
  303. current,
  304. size,
  305. isSubmit
  306. },
  307. data: formData,
  308. }).then(res => {
  309. if (res.data.records != null) {
  310. that.tableData = res.data.records;
  311. }
  312. that.total = res.data.total;
  313. this.loading = false
  314. }).catch(err => {
  315. console.log(err)
  316. this.loading = false
  317. })
  318. },
  319. toWarningPage(rtuCode) {
  320. uni.navigateTo({
  321. url: '/pages/warning/rtuwarninglist?rtuCode=' + rtuCode
  322. })
  323. },
  324. toLocation(item) {
  325. let lat = item.lat;
  326. let lng = item.lng;
  327. let name = item.rtuName;
  328. let add = item.locationDesc;
  329. uni.openLocation({
  330. latitude: Number(lat),
  331. longitude: Number(lng),
  332. name: name,
  333. address: "",
  334. success() {}
  335. })
  336. },
  337. toCheckOrderPage(rtuCode) {
  338. uni.navigateTo({
  339. url: '/pages/check-order/rtu/rtucheckorderlist?rtuCode=' + rtuCode
  340. })
  341. },
  342. }
  343. }
  344. </script>
  345. <style>
  346. /* page {
  347. background-color: rgb(240, 242, 244);
  348. } */
  349. </style>
  350. <style lang="scss" scoped>
  351. .logo {
  352. flex-shrink: 0;
  353. width: 100rpx;
  354. height: auto;
  355. }
  356. .order-title-image {
  357. /* #ifndef APP-NVUE */
  358. display: block;
  359. /* #endif */
  360. // margin-right: 10px;
  361. width: 20px;
  362. height: 20px;
  363. border-radius: 50%;
  364. }
  365. .u-cell-icon {
  366. width: 36rpx;
  367. height: 36rpx;
  368. margin-right: 8rpx;
  369. }
  370. .slot-box {
  371. /* #ifndef APP-NVUE */
  372. display: flex;
  373. /* #endif */
  374. flex-direction: row;
  375. align-items: center;
  376. }
  377. .slot-image {
  378. /* #ifndef APP-NVUE */
  379. display: block;
  380. /* #endif */
  381. margin-right: 10px;
  382. width: 20px;
  383. height: 20px;
  384. }
  385. .slot-text {
  386. flex: 1;
  387. font-size: 14px;
  388. color: #4cd964;
  389. margin-right: 10px;
  390. }
  391. .content-box {
  392. flex: 1;
  393. /* #ifdef APP-NVUE */
  394. justify-content: center;
  395. /* #endif */
  396. height: 100%;
  397. line-height: 44px;
  398. padding: 0 15px;
  399. position: relative;
  400. background-color: #fff;
  401. border-bottom-color: #f5f5f5;
  402. border-bottom-width: 1px;
  403. border-bottom-style: solid;
  404. }
  405. .content-text {
  406. font-size: 15px;
  407. }
  408. .example-body {
  409. /* #ifndef APP-NVUE */
  410. display: flex;
  411. /* #endif */
  412. flex-direction: row;
  413. justify-content: center;
  414. padding: 10px 0;
  415. background-color: #fff;
  416. }
  417. .button {
  418. border-color: #e5e5e5;
  419. border-style: solid;
  420. border-width: 1px;
  421. padding: 4px 8px;
  422. border-radius: 4px;
  423. }
  424. .button-text {
  425. font-size: 15px;
  426. }
  427. .slot-button {
  428. /* #ifndef APP-NVUE */
  429. display: flex;
  430. height: 100%;
  431. /* #endif */
  432. flex: 1;
  433. flex-direction: row;
  434. justify-content: center;
  435. align-items: center;
  436. padding: 0 20px;
  437. background-color: #ff5a5f;
  438. }
  439. .slot-button-text {
  440. color: #ffffff;
  441. font-size: 14px;
  442. }
  443. .search-result {
  444. padding-top: 10px;
  445. padding-bottom: 20px;
  446. text-align: center;
  447. }
  448. .search-result-text {
  449. text-align: center;
  450. font-size: 14px;
  451. color: #666;
  452. }
  453. .example-body {
  454. /* #ifndef APP-NVUE */
  455. display: block;
  456. /* #endif */
  457. padding: 0px;
  458. }
  459. .uni-mt-10 {
  460. margin-top: 10px;
  461. }
  462. </style>