OverwriteDetail.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <el-dialog
  3. :visible="visible"
  4. :before-close="e => hideDialog()"
  5. title="Overwrite Details"
  6. custom-class="overwrite-detail-dialog">
  7. <div class="table-view" v-loading="loading">
  8. <el-table
  9. :data="table.list"
  10. height="100%"
  11. class="no-border">
  12. <el-table-column
  13. align="center"
  14. label="Latest OCPP Status"
  15. prop="latestOcppStatus"
  16. min-width="160"/>
  17. <el-table-column
  18. align="center"
  19. label="Latest OCPI Status"
  20. prop="latestOcpiStatus"
  21. min-width="150"/>
  22. <el-table-column
  23. align="center"
  24. label="Current OCPP Status"
  25. prop="currentOcppStatus"
  26. min-width="180"/>
  27. <el-table-column
  28. align="center"
  29. label="Current OCPI Status"
  30. prop="currentOcpiStatus"
  31. min-width="180"/>
  32. <el-table-column
  33. align="center"
  34. label="Latest OCPI Status Expire Time"
  35. prop="latestOcpiStatusExpireTime"
  36. min-width="240"/>
  37. <el-table-column
  38. align="center"
  39. label="Action Type"
  40. prop="actionType"
  41. min-width="180"/>
  42. <el-table-column
  43. align="center"
  44. label="Action Reason"
  45. prop="actionReason"
  46. min-width="180"/>
  47. <el-table-column
  48. align="center"
  49. label="Create By"
  50. prop="createBy"
  51. min-width="150"/>
  52. <el-table-column
  53. align="center"
  54. label="Create On"
  55. prop="createTime"
  56. min-width="150"/>
  57. </el-table>
  58. </div>
  59. <div class="center" style="margin-bottom: -20px;">
  60. <Pagination
  61. v-show="table.total"
  62. :total="table.total"
  63. :page.sync="filter.pageNum"
  64. :limit.sync="filter.pageSize"
  65. @pagination="getDetailPages"/>
  66. </div>
  67. </el-dialog>
  68. </template>
  69. <script>
  70. import api from '../../../http/api/charge'
  71. import Pagination from '@/components/Pagination'
  72. export default {
  73. name: "DialogOverwriteDetail",
  74. props: {
  75. visible: {
  76. type: Boolean,
  77. default: false
  78. },
  79. id: {
  80. type: Number
  81. }
  82. },
  83. components: {Pagination},
  84. data() {
  85. return {
  86. loading: false,
  87. filter: {
  88. pageNum: 1,
  89. pageSize: 10,
  90. pageCriteria: {
  91. connectorPk: ''
  92. }
  93. },
  94. table: {
  95. total: 0,
  96. list: []
  97. }
  98. };
  99. },
  100. watch: {
  101. id: {
  102. immediate: true,
  103. handler(value) {
  104. if (value) {
  105. this.filter.pageCriteria.connectorPk = value
  106. }
  107. }
  108. },
  109. visible: {
  110. immediate: true,
  111. handler(value) {
  112. if (value) {
  113. this.getDetailPages()
  114. }
  115. }
  116. }
  117. },
  118. mounted() {
  119. },
  120. methods: {
  121. hideDialog() {
  122. this.$emit("hide");
  123. },
  124. getDetailPages() {
  125. this.loading = true;
  126. api.getConnectorActionPages(this.filter).then(res => {
  127. this.loading = false;
  128. if (res.data.totalRow && res.data.records) {
  129. this.table.total = res.data.totalRow;
  130. this.table.list = res.data.records;
  131. }
  132. }).catch(err => {
  133. this.loading = false;
  134. this.table.total = 0;
  135. this.table.list = [];
  136. this.$message.error(err)
  137. })
  138. }
  139. }
  140. }
  141. </script>
  142. <style scoped>
  143. >>> .overwrite-detail-dialog {
  144. width: 65vw;
  145. height: 90vh;
  146. display: flex;
  147. max-width: 1200px;
  148. flex-direction: column;
  149. margin-top: 5vh !important;
  150. }
  151. >>> .overwrite-detail-dialog .el-dialog__header {
  152. padding: 20px 20px 0;
  153. }
  154. >>> .overwrite-detail-dialog .el-dialog__body {
  155. flex: 1;
  156. padding: 20px;
  157. display: flex;
  158. overflow: hidden;
  159. flex-direction: column;
  160. }
  161. .overwrite-detail-dialog .table-view {
  162. flex: 1;
  163. overflow-y: auto;
  164. padding-top: 10px;
  165. margin-bottom: -10px;
  166. }
  167. @media screen and (max-width: 1200px) {
  168. >>> .overwrite-detail-dialog {
  169. width: 70vw;
  170. }
  171. }
  172. @media screen and (max-width: 1000px) {
  173. >>> .overwrite-detail-dialog {
  174. width: 80vw;
  175. }
  176. }
  177. @media screen and (max-width: 800px) {
  178. >>> .overwrite-detail-dialog {
  179. width: 90vw;
  180. }
  181. }
  182. @media screen and (max-width: 700px) {
  183. >>> .overwrite-detail-dialog {
  184. width: 99vw;
  185. }
  186. }
  187. @media screen and (max-width: 320px) {
  188. >>> .overwrite-detail-dialog {
  189. width: 100%;
  190. min-width: 300px;
  191. }
  192. }
  193. </style>