minupdelaywarnlist.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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 { getMinupdelayPage, 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. },
  81. {
  82. label: "测站名称",
  83. prop: "rtuName",
  84. span: 24,
  85. search: true,
  86. },
  87. {
  88. label: "行政区",
  89. prop: "adCity",
  90. span: 12,
  91. html: true,
  92. formatter: (val) => {
  93. if (val.adDist) {
  94. return '<b>' + val.adCity + '</b>/' + '<b>' + val.adDist + '</b>'
  95. } else {
  96. return '<b>' + val.adCity + '</b>'
  97. }
  98. }
  99. },
  100. {
  101. label: "运维单位",
  102. prop: "manageCompany",
  103. span: 12,
  104. },
  105. {
  106. label: "异常信息",
  107. prop: "warningDesc",
  108. span: 12,
  109. },
  110. {
  111. label: "发生时间",
  112. prop: "warningHappenTime",
  113. span: 12,
  114. },
  115. ],
  116. },
  117. data: [],
  118. };
  119. },
  120. computed: {
  121. ...mapGetters(["userInfo", "permission"]),
  122. permissionList() {
  123. return {
  124. // closeBtn: this.vaildData(this.permission.order_close, false),
  125. // changeBtn: this.vaildData(this.permission.order_change, false),
  126. };
  127. },
  128. },
  129. created() {
  130. },
  131. methods: {
  132. init() {
  133. // this.onLoad(this.page);
  134. },
  135. searchReset() {
  136. this.query = {};
  137. this.page.currentPage = 1;
  138. this.onLoad(this.page);
  139. },
  140. searchChange(params, done) {
  141. this.query = params;
  142. this.page.currentPage = 1;
  143. this.onLoad(this.page, params);
  144. done();
  145. },
  146. selectionChange(list) {
  147. this.selectionList = list;
  148. },
  149. selectionClear() {
  150. this.selectionList = [];
  151. this.$refs.crud.toggleSelection();
  152. },
  153. beforeOpen(done, type) {
  154. if (["edit", "view"].includes(type)) {
  155. getDetail(this.form.id).then((res) => {
  156. this.form = res.data.data;
  157. });
  158. }
  159. done();
  160. },
  161. currentChange(currentPage) {
  162. this.page.currentPage = currentPage;
  163. },
  164. sizeChange(pageSize) {
  165. this.page.pageSize = pageSize;
  166. },
  167. refreshChange() {
  168. var params = {};
  169. this.onLoad(this.page, params);
  170. },
  171. onLoad(page, params = {}) {
  172. this.loading = true;
  173. params['deptId'] = this.deptId;
  174. console.log("load " + JSON.stringify(params))
  175. getMinupdelayPage(
  176. page.currentPage,
  177. page.pageSize,
  178. Object.assign(params, this.query)
  179. ).then((res) => {
  180. const data = res.data.data;
  181. this.page.total = data.total;
  182. this.data = data.records;
  183. this.loading = false;
  184. this.selectionClear();
  185. });
  186. },
  187. },
  188. };
  189. </script>
  190. <style lang="scss" scoped>
  191. .line {
  192. display: flex;
  193. flex-direction: row;
  194. justify-content: flex-start;
  195. }
  196. .line .lineText {
  197. margin-left: 10px;
  198. margin-right: 0px;
  199. display: flex;
  200. flex-direction: column;
  201. justify-content: center;
  202. }
  203. .line .lineText .orderCount {
  204. color: green;
  205. font-size: 0.8rem;
  206. }
  207. .line .lineText .spliteLine {
  208. color: gray;
  209. font-size: 0.8rem;
  210. }
  211. .line .lineText .orderUnconfirm {
  212. color: lightcoral;
  213. font-size: 0.8rem;
  214. }
  215. .line .lineText .orderProcessing {
  216. color: dodgerblue;
  217. font-size: 0.8rem;
  218. }
  219. </style>