yunxing 4 years ago
parent
commit
98a75ecc32

+ 50 - 14
src/views/equipmentFacilities/ElectricWell.vue

@@ -88,7 +88,11 @@
                 <!-- 设备设施 -->
                 <div class='sbss'>
                     <h1 class='title'>电井类型</h1>
-                    <!-- <div v-for='i in 10' :key='i'>{{i}}</div> -->
+                    <div class='system-btn-container'>
+                        <div class='system-btn' v-for='(item,index) in wellTypeList' :key='index'>
+                            <van-button class='m-btn' :class='item.active' @click='changeWellType(item)'>{{item.text}}</van-button>
+                        </div>
+                    </div>
                 </div>
                 <div class='footer'>
                     <van-button size='large' color='#025BAA' plain type='info' @click='reset'>重置</van-button>
@@ -123,6 +127,12 @@ export default {
             loading: false,
             showPopup: false,
             floorList: [],
+            wellTypeList: [
+                { text: '全部', id: '全部', active: 'active' },
+                { text: '强电井', id: '强电井', active: '' },
+                { text: '弱电井', id: '弱电井', active: '' },
+                { text: '强弱电井', id: '强弱电井', active: '' },
+            ],
             currentFloor: '全部',
             currentWellType: '全部',
             // 弹窗中使用数据
@@ -179,21 +189,25 @@ export default {
                 orderBy: `floor,1;welldesm,1;meterbox,1;`,
                 plazaId: this.plazaId,
             }
+            // 输入框搜索关键字
             if (this.keyword) {
                 getParams.keyword = `${this.keyword}:welldes,shopsnumList;`
             }
+            // 右侧弹窗 筛选楼层的类型
             if (this.currentFloor && this.currentFloor !== '全部') {
                 getParams.floor = this.currentFloor
             }
-            // debugger
+            // 右侧弹窗 筛选的电井类型
+            if (this.currentWellType && this.currentWellType !== '全部') {
+                getParams.keyword = getParams.keyword || ''
+                getParams.keyword += `${this.currentWellType}:welldes;`
+            }
             let resData = await queryShops({ getParams })
-            console.log(resData)
             if (!resData && !resData?.data) {
                 this.list = []
                 return false
             }
             let res_data = resData.data[0] || []
-            console.log(res_data)
             let list = []
             for (const item in res_data) {
                 console.log(item)
@@ -203,6 +217,7 @@ export default {
                     data: res_data[item],
                 })
             }
+            // 楼层降序排序 RF,F6-F1,B1
             list = list.sort((a, b) => b.seq - a.seq)
             this.list = list
             console.log(this.list)
@@ -256,6 +271,16 @@ export default {
             // 弹窗选中的系统
             this.$set(this.modalDataBak, 'floor', data.gcname)
         },
+        changeWellType(data) {
+            let { wellTypeList } = this
+            wellTypeList.map((item) => {
+                item.active = ''
+                if (item.text === data.text) {
+                    item.active = 'active'
+                }
+            })
+            this.$set(this.modalDataBak, 'wellType', data.text)
+        },
         /**
          * 重置
          */
@@ -268,9 +293,18 @@ export default {
                 floor: '',
                 wellType: '',
             }
+            this.wellTypeList = [
+                { text: '全部', id: '全部', active: 'active' },
+                { text: '强电井', id: '强电井', active: '' },
+                { text: '弱电井', id: '弱电井', active: '' },
+                { text: '强弱电井', id: '强弱电井', active: '' },
+            ]
             this.currentFloor = '全部'
             this.currentWellType = '全部'
             this.showPopup = false
+            // 初始化数据,查询列表
+            this.initData()
+            this.getList()
         },
         /**
          * 弹窗确认
@@ -459,7 +493,7 @@ export default {
                     color: #fff;
                 }
             }
-            // 设备设施
+            // 电井类型
             .sbss {
                 flex: 1;
                 display: flex;
@@ -470,22 +504,24 @@ export default {
                     height: 25px;
                 }
                 .system-btn-container {
+                    display: flex;
                     width: 100%;
-                    height: 40px;
-                    flex: 1;
-                    overflow: auto;
+                    flex-wrap: wrap;
+                    flex-flow: wrap;
                     .system-btn {
-                        width: 100% !important;
+                        width: 33% !important;
+                        min-width: 33% !important;
+                        max-width: 33% !important;
+                        height: 50px;
                         box-sizing: border-box;
-                        background: #eff0f1 !important;
-                        margin: 10px 0 10px 0;
+                        padding: 5px 10px 5px 0;
                         .m-btn {
-                            display: block !important;
-                            width: 100% !important;
+                            width: 100%;
                             height: 40px !important;
                             text-align: center;
                             background: #eff0f1;
                             border-radius: 2px;
+                            padding: 0 !important;
                         }
                     }
                 }
@@ -512,7 +548,7 @@ export default {
                 bottom: 30px;
                 right: 0;
                 width: 100%;
-                height: 40px;
+                height: 35px;
                 display: flex;
                 justify-content: space-around;
                 .van-button {

+ 1 - 1
src/views/equipmentFacilities/EquipmentList.vue

@@ -536,7 +536,7 @@ export default {
                 bottom: 30px;
                 right: 0;
                 width: 100%;
-                height: 40px;
+                height: 35px;
                 display: flex;
                 justify-content: space-around;
                 .van-button {