yunxing 4 年 前
コミット
886b469ba2

+ 4 - 0
src/api/equipmentList.js

@@ -35,3 +35,7 @@ export function queryShops({ getParams }) {
 export function querySmsLocation({ data, postParams }) {
     return httputils.fetchJson(`/data/sms_location/query`, data, postParams)
 }
+// 设备设施 - 查询低压出线柜明细 
+export function queryDygjcxline({ data, postParams }) {
+    return httputils.fetchJson(`/data/sms_dygjcxline/queryDygjcxline`, data, postParams)
+}

+ 2 - 2
src/views/equipmentFacilities/EngineRoomPicture.vue

@@ -79,7 +79,7 @@ export default {
             title: '机房平面布置图',
             keyword: '',
             page: 1,
-            size: 2000, //TODO: size1500
+            size: 20, //TODO: size1500
             list: [],
             loading: false,
             finished: false,
@@ -168,7 +168,7 @@ export default {
             }
             let resData = res.data.data || []
             console.log(resData)
-            resData = resData.filter((v) => v.photos_num) // TODO:开发时 过滤有图片的列表项
+            // resData = resData.filter((v) => v.photos_num) // TODO:开发时 过滤有图片的列表项
             console.log(resData)
             this.list = this.list.concat(resData)
             this.count = res.data.count || 0

+ 132 - 34
src/views/equipmentFacilities/LowVoltageCabinet.vue

@@ -75,15 +75,13 @@ import { NavBar, Search, List, Cell, Icon, Popup, Button, Empty } from 'vant'
 Vue.use(NavBar).use(Search).use(List).use(Cell).use(Icon).use(Popup).use(Button).use(Empty)
 import { mapGetters } from 'vuex'
 
-import { querySmsLocation } from '@/api/equipmentList'
-import { queryPic } from '@/api/public'
-import ImagePreview from '@/components/ImagePreview'
+import { queryDygjcxline, querySmsLocation } from '@/api/equipmentList'
 import { sleep } from '@/utils/util'
 import { cloneDeep } from 'lodash'
 export default {
     name: 'LowVoltageCabinet',
     props: {},
-    components: { ImagePreview },
+    components: {},
     data() {
         return {
             mock: 2,
@@ -95,23 +93,23 @@ export default {
             loading: false,
             finished: false,
             showPopup: false,
-            systemList: [
-                { text: '全部', smsxt: '全部', active: 'active' },
-                { text: '供电系统', smsxt: '1001', active: '' },
-                { text: '暖通系统', smsxt: '1002', active: '' },
-                { text: '消防系统', smsxt: '1003', active: '' },
-                { text: '弱电系统', smsxt: '1004', active: '' },
-                { text: '给排水系统', smsxt: '1005', active: '' },
-                { text: '电梯系统', smsxt: '1006', active: '' },
-                { text: '燃气系统', smsxt: '1007', active: '' },
-                { text: '土建系统', smsxt: '1008', active: '' },
-            ],
+            systemList: [{ text: '全部', location: '全部', active: 'active' }],
+            modalData: {
+                location: '全部',
+            },
+            modalDataBak: {
+                location: '全部',
+            },
         }
     },
     computed: {
         ...mapGetters(['plazaId', 'smsxt', 'categoryId']),
     },
-    created() {},
+    created() {
+        // 查询筛选条件(右弹窗)
+        this.getFilterList()
+        this.getList()
+    },
     beforeMount() {},
     mounted() {},
     methods: {
@@ -119,6 +117,86 @@ export default {
             this.$router.go(-1)
         },
         /**
+         * 查询低压柜list
+         */
+        async getList() {
+            //             请求地址 POST /data/sms_dygjcxline/queryDygjcxline?plazaId=1000772&page=1&size=10&keyword=123:drawernum,outspec
+            // 参数说明
+            // {
+            //     "locfl": 1003,//分类内码
+            //     "locflList": [],//分类内码
+            //     "pageable:{    //低压出线柜条数
+            //        "pageNumber":1,
+            //        "pageSize":50
+            //      }
+            // }
+            let queryData = {
+                data: {
+                    page: this.page,
+                    size: this.size,
+                    plazaId: this.plazaId,
+                },
+                postParams: {
+                    locflList: ['5201', '5204', '5209'], //低压柜
+                    // location: '',
+                    pageable: {
+                        pageNumber: 1,
+                        pageSize: 10,
+                    },
+                },
+            }
+            let res = await queryDygjcxline(queryData)
+        },
+        /**
+         *
+         */
+        async onLoad() {
+            if (this.page > 1) {
+                await sleep(1000)
+            }
+            await this.getList()
+            // list无数据,不执行后续分页查询
+            if (!this.list.length) {
+                this.finished = true
+                return true
+            }
+            this.page++
+            this.loading = false
+            if (this.list.length >= this.count) {
+                this.finished = true
+            }
+        },
+        /**
+         * 查询筛选条件
+         */
+        async getFilterList() {
+            let queryData = {
+                data: {
+                    // page: this.page,
+                    // size: this.size,
+                    plazaId: this.plazaId,
+                },
+                postParams: {
+                    locflList: ['5201', '5204', '5209'], //低压柜
+                    // location: '',
+                    system_code: this.smsxt,
+                },
+            }
+            let res = await querySmsLocation(queryData)
+            console.log(res)
+            if (!res?.data?.data) {
+                this.systemList = [{ text: '全部', location: '全部', active: 'active' }]
+                return false
+            }
+            let data = res?.data?.data || []
+            data.map((item) => {
+                item.text = item.wzjc
+                item.active = ''
+            })
+            console.log(data)
+            this.systemList = [{ text: '全部', location: '全部', active: 'active' }, ...data]
+        },
+        /**
          * 点击右侧筛选
          */
         handleRightClick() {
@@ -135,39 +213,55 @@ export default {
             let systemList = this.systemList
             systemList.map((item) => {
                 item.active = ''
-                if (item.smsxt === data.smsxt) {
+                if (item.location === data.location) {
                     item.active = 'active'
                 }
             })
             // 弹窗选中的系统
-            // this.$set(this.modalDataBak, 'system', data.smsxt)
+            this.$set(this.modalDataBak, 'location', data.location)
         },
         /**
          * 重置
          */
         reset() {
-            // this.modalDataBak = {
-            //     system: '',
-            // }
-            // this.modalData = {
-            //     system: '',
-            // }
-            // this.system_code = this.smsxt
+            this.modalDataBak = {
+                location: '全部',
+            }
+            this.modalData = {
+                location: '全部',
+            }
+
+            let { systemList } = this
+            systemList.map((item) => {
+                item.active = ''
+                if (item.text === '全部') {
+                    item.active = 'active'
+                }
+            })
+            this.systemList = systemList
             this.showPopup = false
             // 初始化数据,查询列表
-            // this.initData()
-            // this.onLoad()
+            this.initData()
+            this.onLoad()
         },
         /**
          * 弹窗确认
          */
         confirm() {
-            // this.modalData = cloneDeep(this.modalDataBak)
+            this.modalData = cloneDeep(this.modalDataBak)
             this.showPopup = false
-            // this.system_code = this.modalData.system
             // 初始化数据,查询列表
-            // this.initData()
-            // this.onLoad()
+            this.initData()
+            this.onLoad()
+        },
+        /**
+         *  初始化数据,查询列表
+         */
+        initData() {
+            this.finished = false
+            this.page = 1
+            this.count = 0
+            this.list = []
         },
     },
 }
@@ -337,15 +431,19 @@ export default {
                         width: 100% !important;
                         min-width: 100% !important;
                         max-width: 100% !important;
-                        height: 40px;
+                        min-height: 40px;
+                        height: auto;
                         box-sizing: border-box;
-                        padding: 10px 10px 10px 0;
+                        padding: 5px 0 !important;
                         .m-btn {
                             width: 100%;
-                            height: 32px !important;
+                            font-size: 14px;
+                            height: 100%;
+                            // height: 32px !important;
                             text-align: center;
                             background: #eff0f1;
                             border-radius: 2px;
+                            padding: 5px 0 !important;
                         }
                     }
                 }

+ 2 - 2
src/views/equipmentFacilities/index.vue

@@ -384,7 +384,7 @@ export default {
          * 配电室低压柜及出线明细
          */
         hanldeDyg() {
-            this.$router.push({ name: 'LowVoltageCabinet', params: {} })
+            // this.$router.push({ name: 'LowVoltageCabinet', params: {} })
         },
         /**
          * 跳转 楼层分布
@@ -420,7 +420,7 @@ export default {
          * 点击更多设备卡片,跳转设备列表页面
          */
         goToMoreEquipment() {
-            this.$router.push({ name: 'MoreEquipmentList', params: {} })
+            // this.$router.push({ name: 'MoreEquipmentList', params: {} })
         },
     },
 }