Browse Source

修改 更多主要设备

yunxing 4 năm trước cách đây
mục cha
commit
2a000effbb

+ 5 - 1
src/api/equipmentList.js

@@ -51,7 +51,11 @@ export function queryDygjcx({ data, postParams }) {
 export function queryDygjcxline({ getParams }) {
     return httputils.getJson(`/data/sms_dygjcxline/queryDygjcxline`, getParams)
 }
-// 查询更多主要设备
+// 查询更多主要设备 --废弃
 export function queryMoreAsset({ data, postParams }) {
     return httputils.fetchJson(`/data/sms_asset/queryAsset`, data, postParams)
 }
+// 查询更多设备卡片
+export function queryMoreSystemCard({ getParams }) {
+    return httputils.getJson(`/data/sms_asset/moreSystemCard`, getParams)
+}

+ 1 - 2
src/components/equipmentFacilities/Card.vue

@@ -84,7 +84,7 @@ export default {
     height: 100%;
     border-radius: 4px;
     background-size: cover !important;
-    padding: 8px 12px;
+    padding: 8px 0 8px 12px;
     line-height: 25px;
     display: flex;
     flex-direction: column;
@@ -209,5 +209,4 @@ export default {
         right: 8px;
     }
 }
-
 </style>

+ 2 - 2
src/store/index.ts

@@ -12,8 +12,8 @@ export default new Vuex.Store({
         ssoToken: 'admin:maohongru',
         appTitle: '管理说明书', //顶部标题
         // ssoToken: null,
-        // plazaId: '1000772', //项目Id 北京通州
-        plazaId: '1001825', //项目Id 成都龙泉驿
+        plazaId: '1000772', //项目Id 北京通州
+        // plazaId: '1001825', //项目Id 成都龙泉驿
         // plazaId: '1000423', //项目Id 大连高新
         fmapID: '',
         haveFengMap: -1, //是否有蜂鸟地图的数据 -1为等待 0 为失败 1 为成功

+ 7 - 6
src/views/equipmentFacilities/EquipmentList.vue

@@ -142,12 +142,13 @@ export default {
     },
     components: {},
     created() {
-        console.log('created')
-        this.system_code = this.smsxt
-        let { title, category_code } = this.$route.query
-        this.title = title
-        this.category_code = category_code
-        this.onLoad()
+        // console.log('created')
+        // this.system_code = this.smsxt
+        // let { title, category_code } = this.$route.query
+        // this.title = title
+        // this.category_code = category_code
+        
+        // this.onLoad() --会与 activated 中查询重复
     },
     beforeMount() {},
     mounted() {},

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

@@ -130,10 +130,6 @@ export default {
             // list无数据,不执行后续分页查询
             console.log(this.list)
             console.log(this.count)
-            // TODO: 111
-            this.loading = false
-            this.finished = true
-            return true
             if (!this.list.length) {
                 this.finished = true
                 this.loading = false

+ 49 - 29
src/views/equipmentFacilities/index.vue

@@ -26,7 +26,7 @@
             <!-- 分割线 -->
             <div class='divider'></div>
             <!-- 设备卡片 -->
-            <div class='card-container'>
+            <div class='card-container' :key='`card_${key}`'>
                 <m-card
                     class='card'
                     :type='item.type'
@@ -48,7 +48,7 @@
                     :unit='item.unit'
                     :total='item.total'
                     :number='item.number'
-                    v-for='(item,index) in cardList'
+                    v-for='(item,index) in moreCardList'
                     :key='index'
                     @click.native='goToEquipment(item)'
                 />
@@ -64,7 +64,7 @@ import Vue from 'vue'
 import { Cell, Toast } from 'vant'
 Vue.use(Cell).use(Toast)
 import { mapGetters, mapMutations } from 'vuex'
-import { querySystemCount, querySystemCard, querySystemImage, querySystemTuJianImage, queryRoomCount, queryMoreAsset } from '@/api/equipmentList'
+import { querySystemCount, querySystemCard, querySystemImage, querySystemTuJianImage, queryRoomCount, queryMoreSystemCard } from '@/api/equipmentList'
 
 import { appGraphElementQuery } from '@/api/public'
 import MCard from '@/components/equipmentFacilities/Card'
@@ -179,6 +179,7 @@ export default {
                 ],
             },
             listKey: `list_${new Date().getTime()}`,
+            key: new Date().getTime(),
             cardList: [],
             moreCardList: [],
             showMoreCardList: false,
@@ -211,7 +212,7 @@ export default {
         },
     },
     async created() {
-        window.vm = this
+        // window.vm = this
         // let initSys = {
         //     text: '供电',
         //     categoryId: 'GDXT',
@@ -238,7 +239,9 @@ export default {
          * @param { String }  currentSmsxt 系统id? 1001 - 1008
          */
         async changeSystem({ text, categoryId, smsxt }) {
+            this.key = new Date().getTime()
             this.showMoreCardList = false
+            this.moreCardList = []
             this.showRight = false
             this.currentSmsxt = smsxt
             this.systemText = text + '系统'
@@ -633,30 +636,45 @@ export default {
          * 点击更多设备卡片,跳转设备列表页面
          */
         async goToMoreEquipment(e) {
-            // this.$router.push({ name: 'MoreEquipmentList', params: {} })
-            console.log(e.target)
-            // TODO: 更多设备
-            return false
             this.showMoreCardList = true
-            this.moreCardList = cloneDeep(this.cardList)
-            console.log()
-            //
-            // let data = {
-            //     // page: 1,
-            //     // size: 400,
-            //     // subPage: 1,
-            //     // subSize: 100,
-            //     plazaId: this.plazaId,
-            //     onlyMainAsset: true,
-            // }
-            // let postParams = {
-            //     system_code: this.smsxt,
-            // }
-            // let res = await queryMoreAsset({ data, postParams })
-            // if (!res?.data?.data) {
-            //     return false
-            // }
-            // console.log(res.data.data)
+            let getParams = {
+                plazaId: this.plazaId,
+                system_code: this.smsxt,
+            }
+            let res = await queryMoreSystemCard({ getParams })
+            console.log(res)
+            if (!res?.data) {
+                return false
+            }
+            let moreCardList = res.data
+            moreCardList.map((item) => {
+                item.total = item.sl // card 第二行台数
+                item.name = item.category_name //card 第一行名称
+                // 设备卡片单位处理
+                if (item.name === '屋面logo') {
+                    item.unit = '个'
+                } else if (item.name === '玻璃护栏') {
+                    item.unit = '段'
+                } else {
+                    item.unit = '台'
+                }
+                /**
+                 * type 1: 正常运维 2:重要维保 3:重要维修
+                 */
+                // 默认正常
+                item.type = 1
+                item.number = 0
+                if (item.is_exception || item.is_exception_num) {
+                    // 有异常
+                    item.type = 3
+                    item.number = item.is_exception_num
+                } else if (item.is_detecting || item.is_detecting_num) {
+                    // 检测中
+                    item.type = 2
+                    item.number = item.is_detecting_num
+                }
+            })
+            this.moreCardList = moreCardList
         },
     },
 }
@@ -752,13 +770,15 @@ export default {
         .close {
             position: fixed;
             background-color: #fff;
+            color: #025baa;
             width: 50px;
             height: 50px;
+            box-shadow: 0px 2px 10px 0px rgba(31, 36, 41, 0.1);
             line-height: 50px;
             border-radius: 50px;
             text-align: center;
-            bottom: 80px;
-            right: 30px;
+            bottom: 70px;
+            right: 20px;
         }
     }
 }