소스 검색

Merge branch 'dev' of git.sagacloud.cn:yunxing/wanda-bm-guide-h5 into dev

zhangyu 4 년 전
부모
커밋
3247579d3d

+ 2 - 2
src/router/index.ts

@@ -72,7 +72,7 @@ const routes: Array<RouteConfig> = [
         name: 'EquipmentList',
         component: () => import(/* webpackChunkName: "equipmentList" */ '../views/equipmentFacilities/EquipmentList.vue'),
         meta: {
-            keepAlive: false,
+            keepAlive: true,
             showTabbar: false,
             hideNarBar: true,
         },
@@ -81,7 +81,7 @@ const routes: Array<RouteConfig> = [
     {
         path: '/moreEquipmentList',
         name: 'MoreEquipmentList',
-        component: () => import(/* webpackChunkName: "equipmentList" */ '../views/equipmentFacilities/MoreEquipmentList.vue'),
+        component: () => import(/* webpackChunkName: "moreEquipmentList" */ '../views/equipmentFacilities/MoreEquipmentList.vue'),
         meta: {
             keepAlive: false,
             showTabbar: false,

+ 66 - 0
src/views/equipmentFacilities/EquipmentList.vue

@@ -120,19 +120,29 @@ export default {
             modalData: {
                 system: '',
                 sbss: '全部',
+                sbssText: '全部',
             },
             // 弹窗中使用备份数据
             modalDataBak: {
                 system: '',
                 sbss: '全部',
+                sbssText: '全部',
             },
         }
     },
     computed: {
         ...mapGetters(['plazaId', 'smsxt', 'categoryId']),
     },
+    activated() {
+        console.log('----------activated')
+        console.log(this.$route)
+        if (this.$route.params.from === 'indexPage') {
+            this.initPage()
+        }
+    },
     components: {},
     created() {
+        console.log('created')
         this.system_code = this.smsxt
         let { title, category_code } = this.$route.query
         this.title = title
@@ -142,6 +152,55 @@ export default {
     beforeMount() {},
     mounted() {},
     methods: {
+        /**
+         * 初始化页面
+         * 页面keepAlive
+         * 页面详情返回该页面,保留页面状态
+         * 页面从index进入时,执行init操作 (数据 + create生命周期 中的操作 )
+         */
+        initPage() {
+            this.title = ''
+            this.keyword = ''
+            this.page = 1
+            this.size = 20
+            this.list = []
+            this.loading = false
+            this.finished = false
+            this.category_code = ''
+            this.showPopup = false
+            this.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: '' },
+            ]
+            this.system_code = '' //系统cod
+            this.sbss_code = '' //设备设施cod
+            this.sbssList = [{ text: '全部', code: '全部', active: 'active' }] //设备设施筛选条
+            this.loadMore = false
+            // 弹窗中使用数据
+            this.modalData = {
+                system: '',
+                sbss: '全部',
+                sbssText: '全部',
+            }
+            // 弹窗中使用备份数据
+            this.modalDataBak = {
+                system: '',
+                sbss: '全部',
+                sbssText: '全部',
+            }
+            this.system_code = this.smsxt
+            let { title, category_code } = this.$route.query
+            this.title = title
+            this.category_code = category_code
+            this.onLoad()
+        },
         backPage() {
             this.$router.go(-1)
         },
@@ -277,6 +336,7 @@ export default {
             // 弹窗选中的系统
             console.log(data)
             this.$set(this.modalDataBak, 'sbss', data.code)
+            this.$set(this.modalDataBak, 'sbssText', data.text)
         },
         /**
          * 获取设备设施筛选条件
@@ -316,14 +376,18 @@ export default {
             this.modalDataBak = {
                 system: '',
                 sbss: '全部',
+                sbssText: '全部',
             }
             this.modalData = {
                 system: '',
                 sbss: '全部',
+                sbssText: '全部',
             }
             this.system_code = this.smsxt
             this.sbss_code = ''
             this.showPopup = false
+            // title 修改
+            this.title = this.$route.query.title
             // 初始化数据,查询列表
             this.initData()
             this.onLoad()
@@ -336,6 +400,8 @@ export default {
             this.showPopup = false
             this.system_code = this.modalData.system
             this.sbss_code = this.modalData.sbss
+            // title 修改
+            this.title = this.modalData.sbssText
             // 初始化数据,查询列表
             this.initData()
             this.onLoad()

+ 4 - 1
src/views/equipmentFacilities/LowVoltageCabinet.vue

@@ -324,9 +324,12 @@ export default {
                 postParams: {
                     locflList: ['5201', '5204', '5209'], //低压柜
                     // location: '',
-                    system_code: this.smsxt,
+                    // system_code: this.smsxt,
                 },
             }
+            if (this.smsxt) {
+                queryData.postParams.system_code = this.smsxt
+            }
             let res = await querySmsLocation(queryData)
             console.log(res)
             if (!res?.data?.data) {

+ 7 - 16
src/views/equipmentFacilities/MainEquipmentDetail.vue

@@ -104,7 +104,6 @@ export default {
         return {
             title: '',
             // 查询下拉菜单,主列表使用
-            major: '', //系统
             type_code: '', //自定义分类内码
             brand: '', //品牌
             classstructureid: '', //设备分类
@@ -140,24 +139,19 @@ export default {
     components: {},
     created() {
         // 从路由中获取参数
-
-        // title, 标题 高压进线柜(4)
-
-        // major,  暖通 等
-
         //  brand,   品牌如果没有传递‘--’
         //  classstructureid, 设备分类
         //  manufacturer, 生产厂商  如果没有传递‘--’
         // sbxh,    设备类型  如果没有传递‘--’
         // type_code    自定义分类内码
-        let { title, major, type_code, brand, classstructureid, manufacturer, sbxh } = this.$route.params
-        this.title = title || '高压进线柜(4)'
-        this.major = major || '暖通'
-        this.type_code = type_code || 'nt023'
+        // TODO: 参数修改
+        let { type_code, brand, classstructureid, manufacturer, sbxh } = this.$route.params
+        this.title = '高压进线柜(4)'
+        this.type_code = type_code || 'nt011'
         this.brand = brand || '--'
-        this.classstructureid = classstructureid || '1714'
-        this.manufacturer = manufacturer || '深圳麦克威尔空调制冷有限公司'
-        this.sbxh = sbxh || '050A'
+        this.classstructureid = classstructureid || '1700'
+        this.manufacturer = manufacturer || '开利空调销售服务(上海)有限公司'
+        this.sbxh = sbxh || '19XR-50514QELCH52'
 
         // 设置 筛选抽屉中的 楼层
         let floorList = [{ code: '全部', gcname: '全部', gcode: '全部', gname: '全部', seq: null, active: 'active' }]
@@ -178,11 +172,9 @@ export default {
          */
         async getOptions() {
             let data = {
-                major: this.major,
                 plazaId: this.plazaId,
                 onlyMainAsset: true,
             }
-            // TODO: type_code
             let postParams = [{ columnName: { sbglgs: 'sbglgs' }, params: { type_code: this.type_code }, tableName: 'sms_asset' }]
             let res = await queryOptions({ data, postParams })
             if (!res?.data?.data) {
@@ -241,7 +233,6 @@ export default {
         async getList() {
             let queryData = {
                 data: {
-                    major: this.major,
                     plazaId: this.plazaId,
                     page: this.page,
                     size: this.size,

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

@@ -498,7 +498,7 @@ export default {
             }
             this.$router.push({ name: 'EngineRoomPicture', params: {} })
         },
-        
+
         handleMainAsset() {
             this.$router.push({ name: 'MainEquipment' })
         },
@@ -557,7 +557,7 @@ export default {
         goToEquipment(data) {
             console.log(data)
             let { name, category_code } = data
-            this.$router.push({ name: 'EquipmentList', query: { title: name, category_code } })
+            this.$router.push({ name: 'EquipmentList', query: { title: name, category_code }, params: { from: 'indexPage' } })
         },
         /**
          * 点击更多设备卡片,跳转设备列表页面

+ 19 - 0
src/views/overview/UpdateRecord.vue

@@ -84,9 +84,28 @@ export default {
         // 查询下拉菜单
         this.querySelect()
     },
+    activated() {
+        if (this.$route.params.initPage) {
+            this.initPage()
+        }
+    },
     beforeMount() {},
     mounted() {},
     methods: {
+        initPage() {
+            this.objtype = 0
+            this.option = []
+            this.list = []
+            this.loading = false
+            this.finished = false
+            this.page = 1
+            this.size = 6
+            this.count = 0
+            // 查询更新记录列表
+            this.getList()
+            // 查询下拉菜单
+            this.querySelect()
+        },
         /**
          * 查询事件类型 下拉菜单
          */

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

@@ -357,7 +357,7 @@ export default {
          */
         goToUpdateRecord() {
             if (this.showNoticeBar) {
-                this.$router.push({ name: 'UpdateRecord' })
+                this.$router.push({ name: 'UpdateRecord', params: { initPage: true } })
             }
         },
     },
@@ -576,7 +576,7 @@ export default {
                             }
                         }
                         .info + .info {
-                            border-top: 1px solid #E6E6E6;
+                            border-top: 1px solid #e6e6e6;
                             margin-top: 5px;
                             padding-top: 5px;
                         }