guoxiaohuan 4 лет назад
Родитель
Сommit
cc350e706e

+ 114 - 62
src/components/Legend/src/legend.vue

@@ -11,11 +11,11 @@
             <el-collapse-transition v-if='(type==1 || floors.length>0)&& isMessage && legendTable.length>0'>
                 <div class='legend-tab' v-if='showView===1'>
                     <div class='legend-table2' v-if='systemName=="土建装饰"'>
-                        <lengend-view @changeSwitch='handleSwich' :remarksText='remarksText' ref='viewLengend' :systemName='systemName'></lengend-view>
+                        <lengend-view @changeSwitch='handleSwich' ref='viewLengend' :systemName='systemName'></lengend-view>
                     </div>
                     <div class='legend-table' v-else>
                         <div>
-                            <lengend-view @changeSwitch='handleSwich' :remarksText='remarksText' ref='viewLengend' :systemName='systemName'></lengend-view>
+                            <lengend-view @changeSwitch='handleSwich' ref='viewLengend' :systemName='systemName'></lengend-view>
                         </div>
                     </div>
                 </div>
@@ -31,7 +31,6 @@
                         :editTable='editTable'
                         @saveNum='saveNum'
                         @cance='cance'
-                        :remarksText='remarksText'
                     ></lengend-edit>
                 </div>
             </el-collapse-transition>
@@ -116,7 +115,7 @@ export default {
     name: 'Legend',
     data() {
         return {
-            remarksText: '', //查询出来的备注
+            // remarksText: '', //查询出来的备注
             text1: '主要设备房包括:冷源机房,热源机房,开闭站,配变电所(室),发电机房,消防水泵房,消防高位水箱间,生活水泵房,慧云机房,垃圾房',
             text2: '图例后×的数字,代表此位置的数量',
             loading: true,
@@ -134,8 +133,8 @@ export default {
             floorSelectAble: [],
             floor: '', //传的楼层
             floorName: '',
-            planNum: '', //主要设备房
-            typeNum: '',
+            // planNum: '', //主要设备房
+            // typeNum: '',
             draftNum: null, //草稿箱数量, 编辑器修改icon右上角显示
             interval: 10 * 60 * 1000, //定时器时长,默认 10分钟
             timer: null, //保存定时器
@@ -143,7 +142,7 @@ export default {
         }
     },
     computed: {
-        ...mapGetters(['plazaId', 'fmapID', 'floorSelect', 'isMessage', 'ssoToken', 'showView', 'legendTable'])
+        ...mapGetters(['planNum', 'typeNum', 'plazaId', 'fmapID', 'floorSelect', 'isMessage', 'ssoToken', 'showView', 'legendTable'])
     },
     props: {
         floors: {
@@ -254,7 +253,7 @@ export default {
         },
         // 查询备注
         queryMarks() {
-            this.remarksText = ''
+            // this.remarksText = ''
             let postParams = {
                 categoryId: this.categoryId ? this.categoryId : this.$cookie.get('categoryId'),
                 projectId: this.$store.state.plazaId,
@@ -264,36 +263,47 @@ export default {
             }
             let data = {}
             queryRead({ data, postParams }).then(res => {
+                console.log(2222222222222222222222222222222222222222222)
                 if (res.data.Data && res.data.Data[0].Note) {
+                    console.log('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb')
+
                     let Res = res.data ? res.data.Data[0].Note : ''
                     if (Res) {
+                        this.$store.commit('SETREMARKSTEXT', Res)
+                        console.log(22222222222222222222)
                         // 返回有备注
-                        this.remarksText = Res
-
-                        let defaultCom = ''
-                        if (this.planNum && this.typeNum) {
-                            defaultCom = `${Res}<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
-                        } else if (this.planNum) {
-                            defaultCom = `${Res}<ol  style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
-                        } else if (this.typeNum) {
-                            defaultCom = `${Res}<ol   style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
-                        } else {
-                            defaultCom = Res
-                        }
-                        this.$store.commit('SETDEFAULTCOMMENT', defaultCom)
+                        // this.remarksText = Res
+                        // let defaultCom = ''
+                        // if (this.planNum && this.typeNum) {
+                        //     defaultCom = `${Res}<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
+                        // } else if (this.planNum) {
+                        //     defaultCom = `${Res}<ol  style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+                        // } else if (this.typeNum) {
+                        //     defaultCom = `${Res}<ol   style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
+                        // } else {
+                        //     defaultCom = Res
+                        // }
+                        // this.$store.commit('SETDEFAULTCOMMENT', defaultCom)
                     } else {
+                        let marks = ''
                         if (this.planNum && this.typeNum) {
-                            this.remarksText = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
+                            marks = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
                         } else if (this.planNum) {
-                            this.remarksText = `<ol  style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+                            marks = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
                         } else if (this.typeNum) {
-                            this.remarksText = `<ol   style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
+                            marks = `<ol style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
                         } else {
-                            this.remarksText = ''
+                            marks = ''
                         }
+                        console.log(marks)
+                        this.$store.commit('SETREMARKSTEXT', marks)
+                        console.log(33333333333333333333)
                     }
-                    this.$store.commit('SETREMARKSTEXT', this.remarksText)
+                    // this.$store.commit('SETREMARKSTEXT', this.remarksText)
                 }
+                // else {
+                // this.$store.commit('SETREMARKSTEXT', '')
+                // }
             })
         },
         // 点击展示图例框
@@ -374,34 +384,63 @@ export default {
             queryStatis({ data, postParams }).then(res => {
                 this.loading = false
                 let viewTable = []
-                this.planNum = ''
-                this.typeNum = ''
+                // this.planNum = ''
+                // this.typeNum = ''
                 viewTable = res.data.Data ? res.data.Data : []
                 this.$store.commit('SETLEGENDTABLE', viewTable)
                 if (viewTable.length > 0) {
                     viewTable.forEach(el => {
                         if (el.Name == '主要设备房') {
-                            this.planNum = el.Num
+                            this.$store.commit('SETPLANNUM', el.Num)
                         }
                         if (el.Type == 'Image' && el.Num > 1) {
-                            this.typeNum = el.Num
+                            this.$store.commit('SETTYPENUM', el.Num)
                         }
                     })
+                    if (this.remarksText) {
+                        this.$store.commit('SETREMARKSTEXT', this.remarksText)
+                        console.log()
+                        // 返回有备注
+                        // this.remarksText = Res
+                        // let defaultCom = ''
+                        // if (this.planNum && this.typeNum) {
+                        //     defaultCom = `${Res}<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
+                        // } else if (this.planNum) {
+                        //     defaultCom = `${Res}<ol  style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+                        // } else if (this.typeNum) {
+                        //     defaultCom = `${Res}<ol   style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
+                        // } else {
+                        //     defaultCom = Res
+                        // }
+                        // this.$store.commit('SETDEFAULTCOMMENT', defaultCom)
+                    } else {
+                        let marks = ''
+                        if (this.planNum && this.typeNum) {
+                            marks = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
+                        } else if (this.planNum) {
+                            marks = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+                        } else if (this.typeNum) {
+                            marks = `<ol style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
+                        } else {
+                            marks = ''
+                        }
+                        this.$store.commit('SETREMARKSTEXT', marks)
+                    }
                 }
                 // let remarksText = ''
-                this.remarksText = ''
-                this.$store.commit('SETREMARKSTEXT', '')
+                // this.remarksText = ''
+                // this.$store.commit('SETREMARKSTEXT', '')
 
-                if (this.planNum && this.typeNum) {
-                    this.remarksText = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
-                } else if (this.planNum) {
-                    this.remarksText = `<ol  style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
-                } else if (this.typeNum) {
-                    this.remarksText = `<ol   style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
-                } else {
-                    this.remarksText = ''
-                }
-                this.$store.commit('SETREMARKSTEXT', this.remarksText)
+                // if (this.planNum && this.typeNum) {
+                //     this.remarksText = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
+                // } else if (this.planNum) {
+                //     this.remarksText = `<ol  style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+                // } else if (this.typeNum) {
+                //     this.remarksText = `<ol   style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
+                // } else {
+                //     this.remarksText = ''
+                // }
+                // this.$store.commit('SETREMARKSTEXT', this.remarksText)
                 this.$nextTick(() => {
                     if (this.$refs.viewLengend) {
                         this.$refs.viewLengend.setSelected()
@@ -503,7 +542,7 @@ export default {
         },
         queryRemarksMethods() {},
         init() {
-            this.remarksText = ''
+            // this.remarksText = ''
             // 图例
             bus.$off('queryViewMethods') //解决触发多次监听
             bus.$on('queryViewMethods', () => {
@@ -513,32 +552,45 @@ export default {
             bus.$off('queryRemarksMethods')
             bus.$on('queryRemarksMethods', res => {
                 if (res) {
+                    this.$store.commit('SETREMARKSTEXT', res)
                     // 返回有备注
-                    this.remarksText = res
-
-                    let defaultCom = ''
-                    if (this.planNum && this.typeNum) {
-                        defaultCom = `${res}<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
-                    } else if (this.planNum) {
-                        defaultCom = `${res}<ol  style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
-                    } else if (this.typeNum) {
-                        defaultCom = `${res}<ol   style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
-                    } else {
-                        defaultCom = res
-                    }
-                    this.$store.commit('SETDEFAULTCOMMENT', defaultCom)
+                    // this.remarksText = res
+                    // let defaultCom = ''
+                    // if (this.planNum && this.typeNum) {
+                    //     defaultCom = `${res}<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
+                    // } else if (this.planNum) {
+                    //     defaultCom = `${res}<ol  style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+                    // } else if (this.typeNum) {
+                    //     defaultCom = `${res}<ol   style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
+                    // } else {
+                    //     defaultCom = res
+                    // }
+                    // this.$store.commit('SETDEFAULTCOMMENT', defaultCom)
                 } else {
+                    //     if (this.planNum && this.typeNum) {
+                    //         this.remarksText = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
+                    //     } else if (this.planNum) {
+                    //         this.remarksText = `<ol  style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+                    //     } else if (this.typeNum) {
+                    //         this.remarksText = `<ol   style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
+                    //     } else {
+                    //         this.remarksText = ''
+                    //     }
+                    // }
+                    // this.$store.commit('SETREMARKSTEXT', this.remarksText)
+                    let marks = ''
                     if (this.planNum && this.typeNum) {
-                        this.remarksText = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
+                        marks = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
                     } else if (this.planNum) {
-                        this.remarksText = `<ol  style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+                        marks = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
                     } else if (this.typeNum) {
-                        this.remarksText = `<ol   style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
+                        marks = `<ol style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
                     } else {
-                        this.remarksText = ''
+                        marks = ''
                     }
+                    console.log(marks)
+                    this.$store.commit('SETREMARKSTEXT', marks)
                 }
-                this.$store.commit('SETREMARKSTEXT', this.remarksText)
             })
         },
         // 设置图例整体高度
@@ -829,7 +881,7 @@ export default {
         }
     }
 }
-@media screen and (max-width:1600px){
+@media screen and (max-width: 1600px) {
     .legend-container .legend-tab .legend-table {
         max-height: 546px;
     }

+ 118 - 4
src/components/legendremarks.vue

@@ -4,7 +4,7 @@
 *@info:楼层功能-编辑图例备注
 */
 <template>
-    <div class='editModel'>
+    <div class='editModel' v-if='visible'>
         <a-modal v-model='visible' :title='title' :closable='false' :maskClosable='false' :width='648' :footer='null'>
             <div class='edit-x' @click='handlCancel'>X</div>
             <div class='edit_container' style='width:600px;height:156px'>
@@ -28,12 +28,16 @@
 <script>
 import { updateRead } from '@/api/public.js'
 import { mapGetters } from 'vuex'
+import { queryRead } from '@/api/public.js'
+
 export default {
     name: 'EditdMarks',
     data() {
         return {
             valLen: 0, //输入字数限制
             remarksTexts: '', //展示的备注
+            text1: '主要设备房包括:冷源机房,热源机房,开闭站,配变电所(室),发电机房,消防水泵房,消防高位水箱间,生活水泵房,慧云机房,垃圾房',
+            text2: '图例后×的数字,代表此位置的数量',
             editorOption: {
                 modules: {
                     toolbar: [['bold', 'underline'], [{ color: [] }], [{ list: 'ordered' }]]
@@ -46,7 +50,7 @@ export default {
         }
     },
     computed: {
-        ...mapGetters(['remarksText'])
+        ...mapGetters(['remarksText', 'typeNum', 'planNum'])
     },
     methods: {
         // 点击取消
@@ -73,11 +77,121 @@ export default {
         },
         // val为传过来的备注
         showModal() {
-            this.$emit('queryMarks')
+            // this.$emit('queryMarks')
             // this.$emit('')
             // return
+            this.query()
             this.visible = true
-            this.remarksTexts = this.remarksText
+            // this.remarksTexts = this.remarksText
+        },
+        query() {
+            if (this.remarksText) {
+                if (this.planNum && this.typeNum) {
+                    if (this.remarksText.search(`${this.text1}`) != -1) {
+                        // console.log(5555555555555)
+                        // console.log(this.remarksText.search(this.text1) != -1)
+                    } else {
+                        console.log(333333333)
+
+                        console.log(this.remarksText.search(this.text1) != -1)
+                    }
+                    this.remarksTexts = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
+                } else if (this.planNum) {
+                    this.remarksTexts = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+                } else if (this.typeNum) {
+                    this.remarksTexts = `<ol style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
+                } else {
+                    this.remarksTexts = ''
+                }
+                if (this.remarksText.search(`${this.text1}`) != -1) {
+                    this.remarksTexts = this.remarksText
+                } else {
+                    if (this.planNum) {
+                        this.remarksTexts = `${this.remarksText}<ol style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+                    } else {
+                        this.remarksTexts = this.remarksText
+                    }
+                    console.log(333333333)
+                }
+                if (this.remarksText.search(`${this.text2}`) != -1) {
+                    this.remarksTexts = this.remarksText
+                } else {
+                    if (this.planNum) {
+                        this.remarksTexts = `${this.remarksText}<ol style="padding-left: 1.5em;"><li>${this.text2}</li></ol>`
+                    } else {
+                        this.remarksTexts = this.remarksText
+                    }
+                    console.log(333333333)
+                }
+
+                //     console.log(this.remarksText.search(this.text1) != -1)
+                // }
+                // if (this.remarksText.search(`${this.text2}`) != -1) {
+                //     console.log(5555555555555)
+
+                //     console.log(this.remarksText.search(this.text1) != -1)
+                // } else {
+                //     console.log(333333333)
+
+                //     console.log(this.remarksText.search(this.text1) != -1)
+                // }
+
+                // this.remarksTexts = this.remarksText
+            } else {
+                if (this.planNum && this.typeNum) {
+                    this.remarksTexts = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
+                } else if (this.planNum) {
+                    this.remarksTexts = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+                } else if (this.typeNum) {
+                    this.remarksTexts = `<ol style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
+                } else {
+                    this.remarksTexts = ''
+                }
+            }
+            console.log(this.remarksTexts)
+            // let postParams = {
+            //     categoryId: this.$cookie.get('categoryId'),
+            //     projectId: this.$store.state.plazaId,
+            //     BuildingID: '1',
+            //     Pub: true,
+            //     FloorID: this.$cookie.get('floorNow')
+            // }
+            // let data = {}
+            // queryRead({ data, postParams }).then(res => {
+            //     if (res.data.Data && res.data.Data[0].Note) {
+            //         let Res = res.data ? res.data.Data[0].Note : ''
+            //         if (Res) {
+            //             // this.$store.commit('SETREMARKSTEXT', Res)
+            //             // console.log()
+            //             // 返回有备注
+            //             // this.remarksText = Res
+            //             // let defaultCom = ''
+            //             // if (this.planNum && this.typeNum) {
+            //             //     defaultCom = `${Res}<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
+            //             // } else if (this.planNum) {
+            //             //     defaultCom = `${Res}<ol  style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+            //             // } else if (this.typeNum) {
+            //             //     defaultCom = `${Res}<ol   style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
+            //             // } else {
+            //             //     defaultCom = Res
+            //             // }
+            //             // this.$store.commit('SETDEFAULTCOMMENT', defaultCom)
+            //         } else {
+            //             let marks = ''
+            //             if (this.planNum && this.typeNum) {
+            //                 marks = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li><li>${this.text2}</li></ol>`
+            //             } else if (this.planNum) {
+            //                 marks = `<ol style="padding-left: 1.5em;"><li>${this.text1}</li></ol>`
+            //             } else if (this.typeNum) {
+            //                 marks = `<ol style="padding-left: 1.5em;" ><li>${this.text2}</li></ol>`
+            //             } else {
+            //                 marks = ''
+            //             }
+            //             this.$store.commit('SETREMARKSTEXT', marks)
+            //         }
+            //         // this.$store.commit('SETREMARKSTEXT', this.remarksText)
+            //     }
+            // })
         },
         // 更新底图备注
         markUpdate(val) {

+ 10 - 10
src/components/viewLengend.vue

@@ -62,9 +62,9 @@
                 <el-switch v-model='swich' @change='handleSwich(swich)'></el-switch>
                 <span>隐藏数量为0的项目</span>
             </div>
-            <div class='remark' v-if='initText'>
+            <div class='remark' v-if='remarksText'>
                 <span class='remark-title'>注:</span>
-                <div :key='Date.now()' v-html='initText' class='remark-text'></div>
+                <div :key='Date.now()' v-html='remarksText' class='remark-text'></div>
             </div>
         </div>
     </div>
@@ -107,14 +107,14 @@ export default {
         }
     },
     computed: {
-        ...mapGetters(['scpzTable', 'legendTable', 'remarksText', 'defaultComment']),
-        initText() {
-            if (this.defaultComment) {
-                return this.defaultComment
-            } else {
-                return this.remarksText
-            }
-        }
+        ...mapGetters(['scpzTable', 'legendTable', 'remarksText'])
+        // initText() {
+        // if (this.defaultComment) {
+        //     return this.defaultComment
+        // } else {
+        //     return this.remarksText
+        // }
+        // }
     },
     mounted() {},
     created() {}

+ 11 - 5
src/store/index.js

@@ -32,13 +32,15 @@ export default new Vuex.Store({
         scpzTable: [], //土建装饰图例展示
         legendTable: [], //除土建装饰图例展示
         remarksText: '', //备注
-        defaultComment: '',
+        // defaultComment: '',
         bunkObj: {}, // 铺位名称
         currentFloor: {}, //当前选中的楼层信息
         accessLevel: -1, // 权限级别
         showView: 1,
         categoryId: 'GDXT', //当前选中的系统
         isGetmap: false, //是否可以请求底图(在项目中方可请求)
+        planNum: '', //主要设备房 展示备注需要
+        typeNum: '', //图例数量 展示备注需要
     },
     getters: {
         plazaName: (state) => state.plazaName,
@@ -56,10 +58,11 @@ export default new Vuex.Store({
         scpzTable: (state) => state.scpzTable,
         legendTable: (state) => state.legendTable,
         remarksText: (state) => state.remarksText,
-        defaultComment: (state) => state.defaultComment,
         bunkObj: (state) => state.bunkObj,
         showView: (state) => state.showView,
         isGetmap: (state) => state.isGetmap,
+        planNum: (state) => state.planNum,
+        typeNum: (state) => state.typeNum,
     },
     mutations: {
         SETPLAZENAME(state, data) {
@@ -121,9 +124,6 @@ export default new Vuex.Store({
         SETREMARKSTEXT(state, data) {
             state.remarksText = data
         },
-        SETDEFAULTCOMMENT(state, data) {
-            state.defaultComment = data
-        },
         SETBUNKOBJ(state, data) {
             state.bunkObj = data
         },
@@ -150,6 +150,12 @@ export default new Vuex.Store({
         SETISGETMAP(state, data) {
             state.isGetmap = data
         },
+        SETPLANNUM(state, data) {
+            state.planNum = data
+        },
+        SETTYPENUM(state, data) {
+            state.typeNum = data
+        },
     },
     actions: {
         // 获取项目列表、userId

+ 1 - 1
src/views/equipment/table/wbTable.vue

@@ -230,7 +230,7 @@ export default {
                 getParams.data.keyword += `${this.sbjc}:sbmc,assetnum;`
             }
             if (this.matters) {
-                getParams.data.keyword += `${this.matters}:sms.description,matters;`
+                getParams.data.keyword += `${this.matters}:description,matters;`
             }
             if (this.gzglid) {
                 getParams.data.keyword += `${this.gzglid}:wb_gzglid;`