riverhourupdelaywarnlist.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. <div>
  11. <el-row>
  12. <el-col :span="24">
  13. <basic-container>
  14. <avue-crud :option="option" :table-loading="loading" :page.sync="page" :data="data" ref="crud"
  15. v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate"
  16. @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset"
  17. @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
  18. @refresh-change="refreshChange" @on-load="onLoad">
  19. </avue-crud>
  20. </basic-container>
  21. </el-col>
  22. </el-row>
  23. </div>
  24. </template>
  25. <script>
  26. import { getRiverHourupdelayPage, getDetail } from "@/api/business/warning/warning.js";
  27. import { mapGetters } from "vuex";
  28. export default {
  29. components: {
  30. },
  31. props: {
  32. deptId: {
  33. type: [Number],
  34. required: true
  35. },
  36. },
  37. name: 'warninglist',
  38. data() {
  39. return {
  40. dialogTitle: "异常测站列表",
  41. id: "",
  42. form: {},
  43. selectionList: [],
  44. query: {},
  45. loading: true,
  46. page: {
  47. pageSize: 10,
  48. currentPage: 1,
  49. total: 0,
  50. },
  51. option: {
  52. labelWidth: 120,
  53. viewLabelWidth: 100,
  54. searchlabelWidth: 100,
  55. height: "auto",
  56. calcHeight: 80,
  57. align: "center",
  58. headerAlign: "center",
  59. tip: false,
  60. simplePage: true,
  61. searchShow: true,
  62. searchMenuSpan: 6,
  63. addBtn: false,
  64. tree: true,
  65. border: true,
  66. index: true,
  67. editBtn: false,
  68. delBtn: false,
  69. menuWidth: 200,
  70. dialogType: "drawer",
  71. dialogClickModal: false,
  72. columnBtn: false,
  73. menu: false,
  74. column: [
  75. {
  76. label: "测站编码",
  77. prop: "rtuCode",
  78. span: 24,
  79. search: true,
  80. width: 160,
  81. html: true,
  82. formatter: (val) => {
  83. if (val.rtuName) {
  84. return '<b>' + val.rtuName + '</b>' + '<b>【' + val.rtuCode + '】</b>'
  85. } else {
  86. return '<b>' + val.rtuCode + '</b>'
  87. }
  88. }
  89. },
  90. {
  91. label: "测站名称",
  92. prop: "rtuName",
  93. span: 24,
  94. search: true,
  95. hide: true,
  96. },
  97. // {
  98. // label: "行政区",
  99. // prop: "adCity",
  100. // span: 12,
  101. // html: true,
  102. // formatter: (val) => {
  103. // if (val.adDist) {
  104. // return '<b>' + val.adCity + '</b>/' + '<b>' + val.adDist + '</b>'
  105. // } else {
  106. // return '<b>' + val.adCity + '</b>'
  107. // }
  108. // }
  109. // },
  110. {
  111. label: "运维单位",
  112. prop: "manageCompany",
  113. span: 12,
  114. width: 180
  115. },
  116. {
  117. label: "异常信息",
  118. prop: "warningDesc",
  119. span: 12,
  120. },
  121. {
  122. label: "异常类别",
  123. prop: "warningKind",
  124. span: 12,
  125. html: true,
  126. formatter: (val) => {
  127. if (val.warningKind) {
  128. let htmltext = '';
  129. if (val.warningKind == 1) {
  130. htmltext = '<b style="color:red">测站离线</b>';
  131. } else if (val.warningKind == 2) {
  132. htmltext = '<b style="color:red">测站时钟异常</b>';
  133. } else if (val.warningKind == 3) {
  134. htmltext = '<b style="color:red">测站雨量小时报漏报</b>';
  135. } else if (val.warningKind == 4) {
  136. htmltext = '<b style="color:red">测站水位小时报漏报</b>';
  137. } else if (val.warningKind == 5) {
  138. htmltext = '<b style="color:red">雨量5分钟上报延时</b>';
  139. } else if (val.warningKind == 6) {
  140. htmltext = '<b style="color:red">雨量站小时上报延时</b>';
  141. } else if (val.warningKind == 7) {
  142. htmltext = '<b style="color:red">水位站小时上报延时</b>';
  143. } else if (val.warningKind == 8) {
  144. htmltext = '<b style="color:red">雨量疑似异常值</b>';
  145. }
  146. return htmltext;
  147. }
  148. }
  149. },
  150. {
  151. label: "发生时间",
  152. prop: "warningHappenTime",
  153. span: 12,
  154. width: 150
  155. },
  156. ],
  157. },
  158. data: [],
  159. };
  160. },
  161. computed: {
  162. ...mapGetters(["userInfo", "permission"]),
  163. permissionList() {
  164. return {
  165. // closeBtn: this.vaildData(this.permission.order_close, false),
  166. // changeBtn: this.vaildData(this.permission.order_change, false),
  167. };
  168. },
  169. },
  170. created() {
  171. },
  172. methods: {
  173. init() {
  174. // this.onLoad(this.page);
  175. },
  176. searchReset() {
  177. this.query = {};
  178. this.page.currentPage = 1;
  179. this.onLoad(this.page);
  180. },
  181. searchChange(params, done) {
  182. this.query = params;
  183. this.page.currentPage = 1;
  184. this.onLoad(this.page, params);
  185. done();
  186. },
  187. selectionChange(list) {
  188. this.selectionList = list;
  189. },
  190. selectionClear() {
  191. this.selectionList = [];
  192. this.$refs.crud.toggleSelection();
  193. },
  194. beforeOpen(done, type) {
  195. if (["edit", "view"].includes(type)) {
  196. getDetail(this.form.id).then((res) => {
  197. this.form = res.data.data;
  198. });
  199. }
  200. done();
  201. },
  202. currentChange(currentPage) {
  203. this.page.currentPage = currentPage;
  204. },
  205. sizeChange(pageSize) {
  206. this.page.pageSize = pageSize;
  207. },
  208. refreshChange() {
  209. var params = {};
  210. this.onLoad(this.page, params);
  211. },
  212. onLoad(page, params = {}) {
  213. this.loading = true;
  214. params['deptId'] = this.deptId;
  215. //console.log("load " + JSON.stringify(params))
  216. getRiverHourupdelayPage(
  217. page.currentPage,
  218. page.pageSize,
  219. Object.assign(params, this.query)
  220. ).then((res) => {
  221. const data = res.data.data;
  222. this.page.total = data.total;
  223. this.data = data.records;
  224. this.loading = false;
  225. this.selectionClear();
  226. });
  227. },
  228. },
  229. };
  230. </script>
  231. <style lang="scss" scoped>
  232. .line {
  233. display: flex;
  234. flex-direction: row;
  235. justify-content: flex-start;
  236. }
  237. .line .lineText {
  238. margin-left: 10px;
  239. margin-right: 0px;
  240. display: flex;
  241. flex-direction: column;
  242. justify-content: center;
  243. }
  244. .line .lineText .orderCount {
  245. color: green;
  246. font-size: 0.8rem;
  247. }
  248. .line .lineText .spliteLine {
  249. color: gray;
  250. font-size: 0.8rem;
  251. }
  252. .line .lineText .orderUnconfirm {
  253. color: lightcoral;
  254. font-size: 0.8rem;
  255. }
  256. .line .lineText .orderProcessing {
  257. color: dodgerblue;
  258. font-size: 0.8rem;
  259. }
  260. </style>