index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!--
  2. 系统清单
  3. -->
  4. <template>
  5. <div id="deviceList">
  6. <saga-title :mess="mess"></saga-title>
  7. <div class="table-main">
  8. <div class="search-header">
  9. <floor-cascader @change="changeFloor"></floor-cascader>
  10. <my-cascader ref="cascader" @change="changeDevice"></my-cascader>
  11. </div>
  12. <hanson-table @close="close" ref="tableMain"></hanson-table>
  13. </div>
  14. <table-transfers></table-transfers>
  15. </div>
  16. </template>
  17. <script>
  18. import sagaTitle from "@/components/ledger/lib/title";
  19. import floorCascader from "@/components/ledger/lib/floorCascader";
  20. import myCascader from "@/components/ledger/lib/system";
  21. import hansonTable from "@/components/ledger/handsontables/system";
  22. import tableTransfers from "@/components/ledger/tableTransfers";
  23. import { mapGetters } from "vuex";
  24. import { countGeneralSys } from "@/api/scan/request"
  25. import 'handsontable-pro/dist/handsontable.full.css'
  26. export default {
  27. components: {
  28. sagaTitle,
  29. floorCascader,
  30. myCascader,
  31. hansonTable,
  32. tableTransfers
  33. },
  34. data() {
  35. return {
  36. mess: {
  37. perjectName: "",
  38. name: [
  39. {
  40. key: "系统",
  41. num: 0
  42. }
  43. ]
  44. },
  45. param: {
  46. buildId: "",
  47. floorId: "",
  48. deviceId: "",
  49. ProjId: '',
  50. secret: ''
  51. }
  52. };
  53. },
  54. computed: {
  55. ...mapGetters("layout", ["projectId", "secret", "userId"])
  56. },
  57. created() {
  58. this.param.ProjId = this.projectId
  59. this.param.secret = this.secret
  60. this.countGeneralSys()
  61. let SysType = this.$route.params.SysType;
  62. if (SysType) {
  63. this.$nextTick(() => {
  64. this.$refs.cascader.changeVal(SysType)
  65. })
  66. }
  67. },
  68. watch: {
  69. projectId() {
  70. this.param.ProjId = this.projectId
  71. this.param.secret = this.secret
  72. this.countGeneralSys()
  73. }
  74. },
  75. methods: {
  76. close(val) {
  77. this.countGeneralSys()
  78. if (!!val && !!val.Category) {
  79. if (this.$refs.cascader)
  80. this.$refs.cascader.changeVal(val.Category)
  81. }
  82. this.$refs.cascader.getData()
  83. },
  84. //获取系统统计信息
  85. countGeneralSys() {
  86. let param = {}
  87. countGeneralSys(param, res => {
  88. this.mess.name[0].num = res.Count
  89. })
  90. },
  91. //修改楼层
  92. changeFloor(value) {
  93. if (value[0]) {
  94. this.param.buildId = value[0]
  95. }
  96. if (value[1]) {
  97. this.param.floorId = value[1]
  98. } else {
  99. this.param.floorId = null
  100. }
  101. if (!!this.param.deviceId) {
  102. if (this.$refs.tableMain)
  103. this.$refs.tableMain.getHeaderData(this.param);
  104. }
  105. },
  106. //修改设备族
  107. changeDevice(value) {
  108. this.param.deviceId = value.Category
  109. if (value) {
  110. if (this.$refs.tableMain)
  111. this.$refs.tableMain.getHeaderData(this.param);
  112. }
  113. }
  114. }
  115. };
  116. </script>
  117. <style lang="scss" scoped>
  118. #deviceList {
  119. overflow: hidden;
  120. height: 100%;
  121. background-color: #fff;
  122. position: relative;
  123. .table-main {
  124. position: absolute;
  125. top: 87px;
  126. bottom: 0;
  127. left: 0;
  128. right: 0;
  129. background-color: #fff;
  130. // border-radius: 5px;
  131. // padding: 10px 0;
  132. }
  133. .search-header {
  134. overflow: hidden;
  135. padding-bottom: 10px;
  136. margin: 0 10px;
  137. border-bottom: 1px solid #bcbcbc;
  138. }
  139. }
  140. </style>