index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <div class='box'>
  3. <div class='condition'>
  4. <p>
  5. <span style="margin-right: 12px">建筑名称</span>
  6. <el-select v-model='buildVlaue' placeholder='请选择'>
  7. <el-option
  8. v-for='item in options'
  9. :key='item.BuildId'
  10. :label='item.BuildLocalName'
  11. :value='item.BuildId'
  12. ></el-option>
  13. </el-select>
  14. </p>
  15. </div>
  16. <el-tabs v-model='activeName' @tab-click='handleClick' style="background:#fff">
  17. <el-tab-pane label='现场无法找到的资产' name='first'>
  18. <saga-nofind :buildVlaue='buildVlaue' :floorsObj='floorsObj'></saga-nofind>
  19. </el-tab-pane>
  20. <el-tab-pane label='未画入模型的资产' name='second'>
  21. <saga-nopaint :buildVlaue='buildVlaue' :floorsObj='floorsObj'></saga-nopaint>
  22. </el-tab-pane>
  23. <el-tab-pane label='无对应岗位的资产' name='third'>
  24. <saga-nomap :buildVlaue='buildVlaue' :floorsObj='floorsObj' :allFamilyObj='allFamilyObj'></saga-nomap>
  25. </el-tab-pane>
  26. <el-tab-pane label='未扫楼验证的资产' name='fourth'>
  27. <saga-verify :buildVlaue='buildVlaue' :floorsObj='floorsObj' :allEquipObj='allEquipObj'></saga-verify>
  28. </el-tab-pane>
  29. </el-tabs>
  30. </div>
  31. </template>
  32. <script>
  33. import SagaNofind from './Nofind'
  34. import SagaNopaint from './Nopaint'
  35. import SagaNomap from './Nomap'
  36. import SagaVerify from './Noverify'
  37. import { mapGetters } from 'vuex'
  38. //api
  39. import {
  40. getBuildSelect, //根据项目ID获得建筑列表
  41. getAllbusiness,
  42. getAllFamily
  43. } from '@/api/scan/request'
  44. export default {
  45. name: 'build-assets',
  46. data() {
  47. return {
  48. activeName: 'first',
  49. buildVlaue: '',
  50. options: [],
  51. floorsObj: {},
  52. allFamilyObj: {},
  53. allEquipObj: {}
  54. }
  55. },
  56. computed: {
  57. ...mapGetters('layout', ['currentProjectId', 'userId', 'secret'])
  58. },
  59. components: {
  60. SagaNofind,
  61. SagaNopaint,
  62. SagaNomap,
  63. SagaVerify
  64. },
  65. methods: {
  66. handleClick() {},
  67. //获取建筑列表
  68. getBuilding() {
  69. let param = {
  70. ProjId: this.currentProjectId,
  71. UserId: this.userId
  72. }
  73. getBuildSelect(param).then(res => {
  74. if (res.data.Result == 'success') {
  75. let data = res.data.BuildList
  76. this.options = data
  77. this.buildVlaue = data.length ? data[0].BuildId : ''
  78. }
  79. })
  80. },
  81. //获取所有楼层
  82. getFloors() {
  83. let param = {
  84. ProjId: this.currentProjectId,
  85. secret: this.secret,
  86. id: this.currentProjectId,
  87. type: ['Fl']
  88. }
  89. getAllbusiness(param).then(res => {
  90. if (res.data.Result == 'success') {
  91. res.data.Content.forEach(item => {
  92. this.floorsObj[item.infos.FloorID] = item.infos.FloorLocalName
  93. })
  94. }
  95. })
  96. },
  97. //获取设备组
  98. getAllFamily() {
  99. getAllFamily().then(result => {
  100. if (result.data.Result == "success") {
  101. console.log(result.data.Content)
  102. let list = result.data.Content;
  103. list.forEach(ele => {
  104. this.allFamilyObj[ele.code] = ele
  105. })
  106. this.allEquipObj = {}
  107. this.getEquip(list)
  108. }
  109. });
  110. },
  111. getEquip(list) {
  112. list.forEach(ele => {
  113. if(ele.content) {
  114. ele.content.forEach(keng => {
  115. this.allEquipObj[keng.code] = keng.name
  116. })
  117. }
  118. })
  119. },
  120. async init() {
  121. await this.getAllFamily();
  122. await this.getFloors();
  123. await this.getBuilding()
  124. }
  125. },
  126. created() {
  127. this.init()
  128. },
  129. watch: {
  130. currentProjectId(){
  131. this.init()
  132. }
  133. }
  134. }
  135. </script>
  136. <style scoped lang='less'>
  137. .box {
  138. .condition {
  139. padding: 10px;
  140. display: flex;
  141. border: 1px solid #dfe6ec;
  142. background:#fff;
  143. margin-bottom: 10px;
  144. }
  145. }
  146. </style>
  147. <style>
  148. .box .el-tabs__nav {margin-left: 10px;}
  149. </style>