Pārlūkot izejas kodu

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-bm-guide into develop

fujunwen 4 gadi atpakaļ
vecāks
revīzija
ba171edf70

+ 32 - 4
src/components/floorMap/index.vue

@@ -118,6 +118,7 @@ import { TipelineItem } from '../../lib/items/TipelineItem'
 import { SImageLegendItem } from '../../lib/items/SImageLegendItem'
 import equipDetail from '../../views/equipment/table/equipDetail'
 import { debounce } from 'lodash'
+import { Message } from 'element-ui'
 // import { uuid } from "@/components/mapClass/until";
 
 export default {
@@ -156,7 +157,7 @@ export default {
             showBtnWell: false,
             count: 0, // 顶楼为多张图时计数器
             equipKey: 1, //设备弹窗使用key值,解决打开弹窗数据为上次弹窗的数据
-            statusDisabled: ['停用', '已拆除'], //显示红色的设备状态
+            statusDisabled: ['已拆除'], //禁止跳转的设备状态
         }
     },
     props: {
@@ -235,19 +236,27 @@ export default {
         },
         // 查看浮层设备详情
         handleClickEquipDetail: debounce(function (row, column, event) {
+            window.vmm = this
             // 设备状态为停用或已拆除时,弹出消息
             if (this.statusDisabled.includes(row?.sb_status)) {
-                let message = `当前设备为“${row.sb_status}”状态,请前往编辑器重新编辑`
+                let message = `当前设备状态为“${row.sb_status}”,请复核现场情况,如有需要请前往编辑器删除。` // `当前设备为“${row.sb_status}”状态,请前往编辑器重新编辑`
                 // 防止出现多条message
                 // 已经有 message时,并且this.message的message字段与message一致时, 不进行提示
                 if (this.message && this.message.visible && this.message.message === message) {
                     return true
                 }
-
-                this.message = this.$message({
+                this.message = Message({
+                    showClose: true,
                     message,
                     type: 'warning',
+                    duration: 0,
+                    iconClass: 'el-icon-warning-outline',
+                    customClass: 'floor-map-warning',
                 })
+                // this.message = this.$message({
+                //     message,
+                //     type: 'warning',
+                // })
                 return true
             }
             if (row.assetnum) {
@@ -757,6 +766,11 @@ export default {
                 }
                 this.showStatusText = false
                 this.statusText = ''
+                // 关闭message提示
+                if (this.message) {
+                    this.message.close()
+                    this.message = null
+                }
             })
         },
         /**
@@ -923,4 +937,18 @@ a:hover {
         text-decoration: line-through;
     }
 }
+// 警告message样式修改
+.floor-map-warning {
+    background-color: #ffa53d;
+    color: #fff;
+    font-size: 14px;
+    /deep/ .el-icon-warning-outline {
+        font-weight: 600 !important;
+        margin-right: 5px;
+    }
+    /deep/.el-icon-close {
+        color: #fff;
+        opacity: 0.5;
+    }
+}
 </style>

+ 22 - 4
src/views/equipment/table/equipDetail.vue

@@ -56,20 +56,20 @@
                 <div v-if='activeId==1'>
                     <el-tabs v-model='activeName1' @tab-click='handleClickWb'>
                         <el-tab-pane label='重要维保' name='wb1' v-if='Object.keys(this.row).length>0'>
-                            <wbTable ref='wb1' :smsxt='smsxt' tabLabel='重要维保' :diff='diff' :assetnum='row.assetnum' :size='3'></wbTable>
+                            <wbTable ref='wb1' :smsxt='smsxt' tabLabel='重要维保' :diff='diff' :assetnum='row.assetnum' :size='size'></wbTable>
                         </el-tab-pane>
                         <el-tab-pane label='日常维保' name='wb2' v-if='Object.keys(this.row).length>0'>
-                            <rcwbTable ref='wb2' :smsxt='smsxt' tabLabel='日常维保' :diff='diff' :assetnum='row.assetnum' :size='3'></rcwbTable>
+                            <rcwbTable ref='wb2' :smsxt='smsxt' tabLabel='日常维保' :diff='diff' :assetnum='row.assetnum' :size='size'></rcwbTable>
                         </el-tab-pane>
                     </el-tabs>
                 </div>
                 <div v-if='activeId==2'>
                     <el-tabs v-model='activeName2' @tab-click='handleClickWx'>
                         <el-tab-pane label='重要维修' name='wx1' v-if='Object.keys(this.row).length>0'>
-                            <wxTable ref='wx1' :smsxt='smsxt' tabLabel='重要维修' :diff='diff' :assetnum='row.assetnum' :size='3'></wxTable>
+                            <wxTable ref='wx1' :smsxt='smsxt' tabLabel='重要维修' :diff='diff' :assetnum='row.assetnum' :size='size'></wxTable>
                         </el-tab-pane>
                         <el-tab-pane label='日常维修' name='wx2' v-if='Object.keys(this.row).length>0'>
-                            <rcwxTable ref='wx2' :smsxt='smsxt' tabLabel='日常维修' :diff='diff' :assetnum='row.assetnum' :size='3'></rcwxTable>
+                            <rcwxTable ref='wx2' :smsxt='smsxt' tabLabel='日常维修' :diff='diff' :assetnum='row.assetnum' :size='size'></rcwxTable>
                         </el-tab-pane>
                     </el-tabs>
                 </div>
@@ -118,6 +118,7 @@ export default {
             visible: false,
             smsxt: '',
             diff: '',
+            size: 5, //下部表格使用
         }
     },
     components: {
@@ -131,7 +132,24 @@ export default {
     computed: {
         ...mapGetters(['floorSelect']),
     },
+    mounted() {
+        window.addEventListener('resize', this.handleResize)
+        this.$once('hook:beforeDestroy', () => {
+            window.removeEventListener('resize', this.handleResize)
+        })
+    },
     methods: {
+        // 页面窗口变化,更新 size值
+        handleResize() {
+            let width = document.body.clientWidth
+            if (width >= 1920) {
+                this.size = 9
+            } else if (width >= 1600) {
+                this.size = 6
+            } else {
+                this.size = 5
+            }
+        },
         tabClick(item) {
             this.activeId = item
         },