checkData.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <!-- 查看系统的对话框 -->
  3. <div>
  4. <!-- <el-breadcrumb separator-class="el-icon-arrow-right" v-if="this.$router.currentRoute.path!='/home'">
  5. <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
  6. <el-breadcrumb-item>供电系统</el-breadcrumb-item>
  7. <el-breadcrumb-item >系统数据</el-breadcrumb-item>
  8. </el-breadcrumb> -->
  9. <!-- <over-view-of-sub-system :table-data="tableData" :total="total" v-if="overViewFlag"></over-view-of-sub-system> -->
  10. <!-- <span style="font-size: 10px;">搜索:</span>
  11. <el-select v-model="currentSubSystemId" placeholder="请选择子系统" @change="selectSubsystem()" style="width: 400px">
  12. <el-option v-for="item in options" :key="item.id" :label="item.subSystem" :value="item.id">
  13. </el-option>
  14. </el-select> -->
  15. <el-table
  16. :data="tableData"
  17. style="min-width: 100%"
  18. border
  19. v-loading="dataListLoading"
  20. >
  21. <el-table-column
  22. prop="id"
  23. label="设备id"
  24. header-align="center"
  25. align="center"
  26. min-width="5%"
  27. >
  28. </el-table-column>
  29. <el-table-column
  30. prop="name"
  31. label="设备"
  32. header-align="center"
  33. align="center"
  34. min-width="5%">
  35. </el-table-column>
  36. <el-table-column
  37. prop="subEquipmentCount"
  38. label="子设备个数"
  39. header-align="center"
  40. align="center"
  41. min-width="10%">
  42. </el-table-column>
  43. <!-- <el-table-column prop="measurePointNum" label="测点个数" header-align="center" align="center" width="180">-->
  44. <!-- </el-table-column>-->
  45. <el-table-column
  46. label="操作"
  47. header-align="center"
  48. align="center"
  49. min-width="10%">
  50. <template slot-scope="scope">
  51. <el-button
  52. type="text"
  53. size="small"
  54. @click="handleCheck(scope.row)"
  55. :disabled="scope.row.subEquipmentCount == 0?true:false"
  56. >查看</el-button> <!-- 这里要改,当子系统个数为0时,查看按钮不可用 -->
  57. </template>
  58. </el-table-column>
  59. <el-table-column
  60. prop="remark"
  61. label="备注"
  62. header-align="center"
  63. align="center"
  64. min-width="20%">
  65. </el-table-column>
  66. </el-table>
  67. <!-- 分页区域 -->
  68. <div style="display: flex;justify-content: flex-end">
  69. <el-pagination
  70. background
  71. @current-change="currentChange"
  72. @size-change="sizeChange"
  73. :current-page="page"
  74. :page-size="size"
  75. layout="sizes, prev, pager, next, jumper, ->, total, slot"
  76. :total="total">
  77. </el-pagination>
  78. </div>
  79. </div>
  80. </template>
  81. <script>
  82. export default {
  83. name: "checkSystem",
  84. props:['systemId'],
  85. data() {
  86. return {
  87. visible: false,
  88. options: [],
  89. tableData: [],
  90. page:1, //当前第几页
  91. size:10, //当前每页页数
  92. total:100, //全部数据量
  93. currentSystemId: 0,
  94. currentSubSystemId:'',
  95. currentsubSystem:'',
  96. dataListLoading: false,
  97. overViewFlag: false,
  98. }
  99. },
  100. mounted(){
  101. this.currentSystemId = this.systemId
  102. this.getSubsystemOption()
  103. // this.currentSystemId = window.sessionStorage.getItem("dataList_currentSystemId");
  104. // this.getSubsystemOption();
  105. // this.currentsubSystem = this.options[0].subSystem;
  106. // this.currentSubSystemId = this.options[0].id;//将当前煤矿与id设置为下拉框第一个
  107. // this.initData();
  108. },
  109. methods: {
  110. selectSubsystem(){
  111. for (let i in this.options) {
  112. if (this.options[i].id == this.currentSubSystemId){
  113. this.currentsubSystem = this.options[i].subSystem;
  114. break;
  115. }
  116. }
  117. this.initData();
  118. },
  119. getSubsystemOption(){
  120. this.getRequest('/dataList/getSubsystemOptionBySystemId/?systemId=' + this.currentSystemId).then(resp=>{
  121. if (resp){
  122. console.log(resp.data)
  123. this.options = resp.data;
  124. this.currentsubSystem = this.options[0].subSystem;
  125. this.currentSubSystemId = this.options[0].id;//将当前煤矿与id设置为下拉框第一个
  126. this.initData()
  127. }
  128. });
  129. },
  130. initData(){
  131. this.dataListLoading = true
  132. this.getRequest(
  133. "/equipmentManage/getEquipmentInfoBySubSystemId?subSystemId=" +
  134. this.currentSubSystemId + "&page=" + this.page + "&size=" + this.size
  135. ).then((resp) => {
  136. if (resp.data) {
  137. this.tableData = resp.data.data;
  138. this.total = resp.data.total;
  139. this.overViewFlag = true;
  140. }
  141. });
  142. this.dataListLoading = false
  143. // this.currentSystemId = parseInt(this.currentSystemId);
  144. // this.getRequest('/dataList/getEquipmentBySubsystemId/?subsystemId=' + this.currentSubSystemId + '&page=' + this.page + '&size=' + this.size).then(resp=>{
  145. // if (resp.data){
  146. // this.tableData = resp.data;
  147. // this.total = resp.data.size;
  148. // }
  149. // });
  150. /*this.getRequest('/coalSystemManage/getSystemOverview').then(resp =>{
  151. if (resp.data){
  152. this.options[0].num = resp.data.datasize + 'G';
  153. this.options[1].num = resp.data.systemCount + '个';
  154. this.options[2].num = resp.data.subSystemCount + '个';
  155. this.options[3].num = resp.data.equipmentCount + '个';
  156. }
  157. })*/
  158. },
  159. // 监听 pagesize 改变的事件
  160. currentChange(currentPage){
  161. this.page=currentPage;
  162. this.initData();
  163. },
  164. sizeChange(currentSize) {
  165. this.size = currentSize;
  166. this.initData();
  167. },
  168. // init(id) {
  169. // this.visible = true;
  170. // }
  171. handleCheck(equip) {
  172. window.sessionStorage.setItem("dataList_currentEquipId",equip.id); //存到sessionStorage中,下一个页面获取
  173. this.$router.push({
  174. name: 'powersupplyDataDetail',
  175. query: {
  176. equipmentId: equip.id,
  177. systemId: this.systemId
  178. }
  179. })
  180. }
  181. }
  182. }
  183. </script>
  184. <style scoped>
  185. </style>