boosterAlarm.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <div>
  3. <div class="query mg-b-8">
  4. <div class="query-items">
  5. <div class="query-item">
  6. <div class="lable">场站:</div>
  7. <div class="search-input">
  8. <el-select
  9. v-model="stationId"
  10. clearable
  11. placeholder="请选择"
  12. popper-class="select"
  13. >
  14. <el-option
  15. v-for="item in ChangZhan"
  16. :key="item.id"
  17. :value="item.id"
  18. :label="item.name"
  19. ></el-option>
  20. </el-select>
  21. </div>
  22. </div>
  23. <div class="query-item">
  24. <div class="lable">开始日期:</div>
  25. <div class="search-input">
  26. <el-date-picker
  27. v-model="startDate"
  28. type="datetime"
  29. placeholder="开始日期"
  30. popper-class="date-select"
  31. value-format="YYYY-MM-DD HH:mm:ss"
  32. ></el-date-picker>
  33. </div>
  34. </div>
  35. <div class="query-item">
  36. <div class="lable">结束日期:</div>
  37. <div class="search-input">
  38. <el-date-picker
  39. v-model="endDate"
  40. type="datetime"
  41. placeholder="开始日期"
  42. popper-class="date-select"
  43. value-format="YYYY-MM-DD HH:mm:ss"
  44. ></el-date-picker>
  45. </div>
  46. </div>
  47. <div class="query-item">
  48. <div class="lable">等级:</div>
  49. <div class="search-input">
  50. <el-select
  51. v-model="level"
  52. clearable
  53. placeholder="请选择"
  54. popper-class="select"
  55. >
  56. <el-option
  57. v-for="item in levelArray"
  58. :key="item.id"
  59. :value="item.id"
  60. :label="item.name"
  61. />
  62. </el-select>
  63. </div>
  64. </div>
  65. <div class="query-actions">
  66. <button class="btn green" @click="getTable()">查询</button>
  67. <button class="btn green" @click="exportExcel()">导出</button>
  68. </div>
  69. </div>
  70. </div>
  71. <div class="table-box">
  72. <div class="title">升压站报警</div>
  73. <ComTable
  74. ref="curRef"
  75. :data="tableData"
  76. :pageSize="20"
  77. @onPagging="onChangePage"
  78. height="73vh"
  79. v-loading="tableLoading"
  80. element-loading-text="拼命加载中.."
  81. element-loading-background="rgba(0, 0, 0, 0.8)"
  82. ></ComTable>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import ComTable from "@/components/coms/table/table.vue";
  88. export default {
  89. name: "boosterAlarm",
  90. components: { ComTable },
  91. data() {
  92. let that = this;
  93. return {
  94. ChangZhan: [],
  95. levelArray: [
  96. {
  97. id: "",
  98. name: "请选择",
  99. },
  100. {
  101. id: "1",
  102. name: "低",
  103. },
  104. {
  105. id: "2",
  106. name: "中低",
  107. },
  108. {
  109. id: "3",
  110. name: "中",
  111. },
  112. {
  113. id: "4",
  114. name: "中高",
  115. },
  116. {
  117. id: "5",
  118. name: "高",
  119. },
  120. ],
  121. level: "",
  122. stationId: "MHS_FDC",
  123. startDate: "",
  124. endDate: "",
  125. tableLoading: true,
  126. pageIndex: 1,
  127. pageSize: 20,
  128. tableData: {
  129. column: [
  130. {
  131. name: "场站",
  132. field: "stationName",
  133. is_num: false,
  134. is_light: false,
  135. sortable: true,
  136. id: "id",
  137. },
  138. {
  139. name: "变电站",
  140. field: "",
  141. is_num: false,
  142. is_light: false,
  143. sortable: true,
  144. id: "id",
  145. },
  146. {
  147. name: "报警时间",
  148. field: "alertTime",
  149. is_num: false,
  150. is_light: false,
  151. sortable: true,
  152. id: "id",
  153. },
  154. {
  155. name: "报警描述",
  156. field: "alertText",
  157. is_num: false,
  158. is_light: false,
  159. sortable: true,
  160. id: "id",
  161. },
  162. {
  163. name: "处理方式",
  164. field: "",
  165. is_num: false,
  166. is_light: false,
  167. sortable: true,
  168. id: "id",
  169. },
  170. ],
  171. data: [],
  172. currentPageTotal: 0,
  173. },
  174. };
  175. },
  176. created() {
  177. this.ChangZhanVal();
  178. let end = new Date();
  179. let start = new Date(end.getTime() - 1 * 24 * 60 * 60 * 1000);
  180. this.endDate = end.formatDate("yyyy-MM-dd hh:mm:ss");
  181. this.startDate = start.formatDate("yyyy-MM-dd hh:mm:ss");
  182. this.getTable();
  183. },
  184. methods: {
  185. // 场站
  186. ChangZhanVal() {
  187. var that = this;
  188. that.API.requestData({
  189. method: "GET",
  190. baseURL: "http://10.155.32.4:9001/",
  191. subUrl: "benchmarking/wplist",
  192. success(res) {
  193. that.ChangZhan = res.data;
  194. that.stationId = res.data[0].id;
  195. },
  196. });
  197. },
  198. getTable() {
  199. let that = this;
  200. this.tableLoading = true;
  201. this.API.requestData({
  202. timeout: 30000,
  203. method: "GET",
  204. baseURL: "http://192.168.1.18:8075/",
  205. subUrl: "alarm/history/page2",
  206. data: {
  207. category1: "SYZ",
  208. stationid: this.stationId,
  209. starttime: this.startDate,
  210. endtime: this.endDate,
  211. pagenum: this.pageIndex,
  212. pagesize: this.pageSize,
  213. rank: that.level,
  214. },
  215. success(res) {
  216. that.tableData.data = res.data.records;
  217. that.tableLoading = false;
  218. that.tableData.total = res.data.total;
  219. },
  220. });
  221. },
  222. onChangePage(params) {
  223. this.pageIndex = params.pageIndex;
  224. this.pageSize = params.pageSize;
  225. this.getTable();
  226. },
  227. exportExcel() {
  228. this.BASE.exportExcel(this.tableData, "升压站报警");
  229. },
  230. },
  231. };
  232. </script>
  233. <style scoped>
  234. .title {
  235. background: rgba(255, 255, 255, 0.1);
  236. margin-bottom: 8px;
  237. padding: 1vh;
  238. }
  239. </style>