dialog.history.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div class="device-info">
  3. <DialogCom
  4. title="布撤防历史"
  5. :visible.sync="isShow"
  6. width="600px"
  7. @close="close"
  8. >
  9. <div class="page-body">
  10. <div>
  11. <div style="margin-bottom: 20px">
  12. <span> 所属机构:</span>
  13. <span>{{ protection.orgName }}</span>
  14. </div>
  15. <div style="margin-bottom: 20px">
  16. <span>报警控制器名称:</span>
  17. <span>{{ protection.name }}</span>
  18. </div>
  19. <div style="margin-bottom: 20px">
  20. <span> 24小时报警控制器:</span>
  21. <span>{{ protection.allHour ? "是" : "否" }}</span>
  22. </div>
  23. <div style="margin-bottom: 20px">
  24. <span>上报时间范围:</span>
  25. <DataRangePicker
  26. v-model="queryParams.updateTime"
  27. key="daterange"
  28. type="daterange"
  29. clearable
  30. range-separator="至"
  31. start-placeholder="开始日期"
  32. end-placeholder="结束日期"
  33. >
  34. </DataRangePicker>
  35. </div>
  36. <el-table :data="tableData" border style="width: 100%">
  37. <el-table-column type="index" label="序号" width="60"></el-table-column>
  38. <el-table-column prop="statusText" label="报警控制器状态"
  39. ><template slot-scope="r">
  40. {{ getLabel(statusDict, r.row.status) }}
  41. </template></el-table-column
  42. >
  43. <el-table-column prop="updateTime" label="布撤防登记时间">
  44. </el-table-column>
  45. <el-table-column
  46. prop="statusUpdatorName"
  47. label="登记人"
  48. ></el-table-column>
  49. </el-table>
  50. <div style="margin-top: 20px; text-align: right">
  51. <pagination
  52. v-show="total > 0"
  53. :total="total"
  54. :page.sync="queryParams.pageNum"
  55. :limit.sync="queryParams.pageSize"
  56. @pagination="getList"
  57. />
  58. </div>
  59. </div>
  60. </div>
  61. <div slot="footer" class="dialog-footer">
  62. <el-button @click="onHide">关闭</el-button>
  63. <!--<el-button type="primary" @click="onSubmit">确定</el-button> -->
  64. </div>
  65. </DialogCom>
  66. </div>
  67. </template>
  68. <script>
  69. import * as api from "@/api/resumption/protection";
  70. import { getLabel } from "./../../commonOption";
  71. import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
  72. export default {
  73. data() {
  74. const params = this.$route.params;
  75. return {
  76. id: params ? params.id : null,
  77. isShow: false,
  78. protection: {},
  79. tableData: [],
  80. queryParams: this.resetSearch(),
  81. total: 1,
  82. };
  83. },
  84. props: {
  85. statusDict: {
  86. type: Array,
  87. },
  88. },
  89. watch: {
  90. "queryParams.updateTime": {
  91. deep: true,
  92. handler(v) {
  93. this.refresh();
  94. },
  95. },
  96. },
  97. computed: {},
  98. methods: {
  99. getLabel,
  100. async refresh() {
  101. this.pageNum = 1;
  102. this.getList();
  103. },
  104. async getList() {
  105. await api.history(this.queryParams).then((v) => {
  106. this.tableData = v.rows;
  107. this.total = v.total;
  108. });
  109. },
  110. onHide() {
  111. this.isShow = false;
  112. },
  113. close() {
  114. this.queryParams = this.resetSearch();
  115. this.tableData = [];
  116. this.total = 0;
  117. },
  118. async show(protection) {
  119. this.protection = protection;
  120. this.queryParams = this.resetSearch();
  121. this.queryParams.protectionId = protection.id;
  122. await this.refresh();
  123. this.isShow = true;
  124. },
  125. handleSizeChange(val) {
  126. this.queryParams.pageSize = val;
  127. this.getList();
  128. },
  129. handleCurrentChange(val) {
  130. this.queryParams.pageNum = val;
  131. this.getList();
  132. },
  133. resetSearch() {
  134. return {
  135. pageNum: 1,
  136. pageSize: 10,
  137. protectionId: null,
  138. updateTime: [new Date(new Date() - 3600 * 1000 * 24 * 90), new Date()],
  139. };
  140. },
  141. // 事件
  142. //apimark//
  143. },
  144. created() {},
  145. mounted() {},
  146. components: {
  147. DataRangePicker,
  148. // EditAttribute,
  149. },
  150. };
  151. </script>
  152. <style lang="scss">
  153. .device_info {
  154. .el-form {
  155. width: 600px;
  156. padding-top: 40px;
  157. }
  158. }
  159. </style>