index.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <div class='box'>
  3. <div class='condition'>
  4. <p>
  5. <span style="margin-right: 12px">建筑名称</span>
  6. <el-select v-model='buildValue' placeholder='请选择'>
  7. <el-option v-for='item in options' :key='item.BuildID' :label='item.BuildLocalName' :value='item.BuildID'></el-option>
  8. </el-select>
  9. </p>
  10. </div>
  11. <el-tabs v-model='activeName' @tab-click='tabChange' style="background:#fff">
  12. <el-tab-pane v-for="item in tabList" :label='item.label' :name='item.name' :key="item.label"></el-tab-pane>
  13. </el-tabs>
  14. <assets-list :buildingData="options" :buildingId="buildValue" :active="activeName" ref="assetlist"></assets-list>
  15. </div>
  16. </template>
  17. <script>
  18. import assetsList from './assetsList'
  19. import { mapGetters } from 'vuex'
  20. //api
  21. import { buildingQuery } from '@/api/scan/request'
  22. export default {
  23. name: 'build-assets',
  24. data() {
  25. return {
  26. activeName: 'first',
  27. buildValue: '',
  28. options: [],
  29. floorsObj: {},
  30. allFamilyObj: {},
  31. allEquipObj: {},
  32. tabList: [
  33. { label: '现场无法找到的资产', name: "first" },
  34. { label: '未画入模型的资产', name: "second" },
  35. { label: '无对应岗位的资产', name: "third" },
  36. { label: '未扫楼验证的资产', name: "fourth" }
  37. ],
  38. }
  39. },
  40. computed: {
  41. ...mapGetters('layout', ['projectId', 'userId', 'secret'])
  42. },
  43. components: {
  44. assetsList
  45. },
  46. methods: {
  47. //获取建筑列表
  48. getBuilding() {
  49. buildingQuery({}, res => {
  50. this.options = res.Content
  51. this.buildValue = res.Content ? res.Content[0].BuildID : ''
  52. })
  53. },
  54. tabChange(tab) { }
  55. },
  56. created() {
  57. this.getBuilding()
  58. },
  59. watch: {
  60. projectId() {
  61. this.getBuilding()
  62. }
  63. }
  64. }
  65. </script>
  66. <style scoped lang='less'>
  67. .box {
  68. .condition {
  69. padding: 10px;
  70. display: flex;
  71. border: 1px solid #dfe6ec;
  72. background:#fff;
  73. margin-bottom: 10px;
  74. }
  75. /deep/ .el-tabs__nav{
  76. margin-left: 10px;
  77. }
  78. }
  79. </style>