yunxing 4 years ago
parent
commit
051d4b9901
2 changed files with 71 additions and 18 deletions
  1. 1 1
      src/store/index.ts
  2. 70 17
      src/views/equipmentFacilities/Equipment.vue

+ 1 - 1
src/store/index.ts

@@ -12,7 +12,7 @@ export default new Vuex.Store({
         ssoToken: 'admin:liujiandong',
         appTitle: '管理说明书', //顶部标题
         // ssoToken: null,
-        plazaId: '1000423', //项目Id
+        plazaId: '1001145', //项目Id
         fmapID: '',
         haveFengMap: -1, //是否有蜂鸟地图的数据 -1为等待 0 为失败 1 为成功
         isMessage: true, //是否有发布的图

+ 70 - 17
src/views/equipmentFacilities/Equipment.vue

@@ -41,6 +41,7 @@
                 <img src="../../assets/images/xxx.png" alt="">
             </template>-->
         </van-empty>
+
         <!-- 点击头部筛选,出现的右侧弹窗 -->
         <van-popup class='m-popup-container' v-model='showPopup' position='right'>
             <div class='m-popup'>
@@ -58,12 +59,12 @@
                 <div class='sbss'>
                     <h1 class='title'>
                         设备设施
-                        <div v-for='i in 100' :key='i'>{{i}}</div>
+                        <!-- <div v-for='i in 10' :key='i'>{{i}}</div> -->
                     </h1>
                 </div>
                 <div class='footer'>
-                    <van-button size='large' color='#025BAA' plain type='info'>重置</van-button>
-                    <van-button size='large' color='#025BAA' type='info'>确定</van-button>
+                    <van-button size='large' color='#025BAA' plain type='info' @click='reset'>重置</van-button>
+                    <van-button size='large' color='#025BAA' type='info' @click='confirm'>确定</van-button>
                 </div>
             </div>
         </van-popup>
@@ -82,6 +83,7 @@ import { mapGetters } from 'vuex'
 
 import { queryEquipmentList } from '@/api/equipmentList'
 import { sleep } from '@/utils/util'
+import { cloneDeep } from 'lodash'
 export default {
     name: 'EngineRoomPicture',
     props: {},
@@ -95,18 +97,29 @@ export default {
             loading: false,
             finished: false,
             category_code: '',
-            showPopup: true,
+            showPopup: false,
             systemList: [
                 { text: '全部', smsxt: '', active: 'active' },
-                { text: '供电系统', smsxt: '', active: '' },
-                { text: '暖通系统', smsxt: '', active: '' },
-                { text: '消防系统', smsxt: '', active: '' },
-                { text: '弱电系统', smsxt: '', active: '' },
-                { text: '给排水系统', smsxt: '', active: '' },
-                { text: '电梯系统', smsxt: '', active: '' },
-                { text: '燃气系统', smsxt: '', active: '' },
-                { text: '土建系统', smsxt: '', 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: '' },
             ],
+            system_code: '', //系统code
+            // 弹窗中使用数据
+            modalData: {
+                system: '',
+                sbss: '',
+            },
+            // 弹窗中使用备份数据
+            modalDataBak: {
+                system: '',
+                sbss: '',
+            },
         }
     },
     computed: {
@@ -114,7 +127,7 @@ export default {
     },
     components: {},
     created() {
-        console.log(this.$route)
+        this.system_code = this.smsxt
         let { title, category_code } = this.$route.params
         this.title = title
         this.category_code = category_code
@@ -126,8 +139,13 @@ export default {
         backPage() {
             this.$router.go(-1)
         },
+        /**
+         * 点击右侧筛选
+         */
         handleRightClick() {
             this.showPopup = true
+            // 设置选中的专业系统
+            this.changeSystem({ smsxt: this.system_code })
         },
         /**
          * 获取设备列表
@@ -140,7 +158,7 @@ export default {
                 plazaId: this.plazaId,
                 category_code: this.category_code,
             }
-            let postParams = { system_code: this.smsxt }
+            let postParams = { system_code: this.system_code }
             // TODO: keyword
             if (this.keyword) {
                 data.keyword = `${this.keyword}:sbjc,assetnum;`
@@ -179,24 +197,59 @@ export default {
          * 搜索
          */
         onSearch() {
-            // 初实话数据,查询列表
+            // 初始化数据,查询列表
+            this.initData()
+            this.onLoad()
+        },
+        /**
+         *  初始化数据,查询列表
+         */
+        initData() {
             this.finished = false
             this.page = 1
             this.count = 0
             this.list = []
-            this.onLoad()
         },
         /**
          * popup 更改系统
          */
         changeSystem(data) {
+            console.log(data)
             let systemList = this.systemList
             systemList.map((item) => {
                 item.active = ''
-                if (item.text === data.text) {
+                if (item.smsxt === data.smsxt) {
                     item.active = 'active'
                 }
             })
+            // 弹窗选中的系统
+            this.$set(this.modalDataBak, 'system', data.smsxt)
+        },
+        /**
+         * 重置
+         */
+        reset() {
+            this.modalDataBak = {
+                system: '',
+                sbss: '',
+            }
+            this.modalData = {
+                system: '',
+                sbss: '',
+            }
+            this.system_code = this.smsxt
+            this.showPopup = false
+        },
+        /**
+         * 弹窗确认
+         */
+        confirm() {
+            this.modalData = cloneDeep(this.modalDataBak)
+            this.showPopup = false
+            this.system_code = this.systemList.filter((v) => v.active)[0].smsxt
+            // 初始化数据,查询列表
+            this.initData()
+            this.onLoad()
         },
     },
 }