yx 4 years ago
parent
commit
355d4ec826
2 changed files with 18 additions and 17 deletions
  1. 17 16
      src/components/Legend/src/legend.vue
  2. 1 1
      src/views/equipment/fenbuPic.vue

+ 17 - 16
src/components/Legend/src/legend.vue

@@ -169,6 +169,11 @@ export default {
             // 编辑器文案
             type: String,
             default: ''
+        },
+        // 区分lengend 在外边 0 还是弹窗内部 1
+        innerLeng: {
+            type: Number,
+            default: 0
         }
     },
     components: { lengendView, legendRemarks, lengendEdit },
@@ -208,10 +213,8 @@ export default {
             let res = null,
                 // floorId = this.$cookie.get('floorMapId'),
                 floorId = this.$store.state.currentFloor.gname || this.$cookie.get('floorMapId'),
-                categoryId = this.$cookie.get('categoryId')
-            // 暖通系统,消防系统上送值修改
-            categoryId == 'NTXT' && (categoryId = 'FZQZL')
-            categoryId == 'XFXT' && (categoryId = 'XFBFYCFL')
+                categoryId = this.categoryId || this.$cookie.get('categoryId')
+            // console.log('getDraftNum', this.innerLeng, categoryId)
             // 增加校验 floorId,防止上传 undefined
             if (!floorId) {
                 return true
@@ -345,12 +348,8 @@ export default {
         // 查询图例
         queryView(flag) {
             let postParams = {}
-            //FZQZL
-            //XFBFYCFL
-            // 暖通系统,消防系统上送值修改
-            let categoryId = this.$cookie.get('categoryId')
-            categoryId == 'NTXT' && (categoryId = 'FZQZL')
-            categoryId == 'XFXT' && (categoryId = 'XFBFYCFL')
+            let categoryId = this.categoryId || this.$cookie.get('categoryId')
+            // console.log('queryView', this.innerLeng, categoryId)
             let data = {
                 categoryId,
                 graphId: this.$cookie.get('graphId'),
@@ -384,10 +383,8 @@ export default {
         // 查询编辑状态图例
         queryEditNum(flag) {
             let postParams = {}
-            // 暖通系统,消防系统上送值修改
-            let categoryId = this.$cookie.get('categoryId')
-            categoryId == 'NTXT' && (categoryId = 'FZQZL')
-            categoryId == 'XFXT' && (categoryId = 'XFBFYCFL')
+            let categoryId = this.categoryId || this.$cookie.get('categoryId')
+            // console.log('queryEditNum', categoryId)
             let data = {
                 categoryId,
                 graphId: this.$cookie.get('graphId'),
@@ -403,7 +400,7 @@ export default {
             })
         },
         // 编辑数量
-        queryEdit(val) {
+        queryEddit(val) {
             let arr = []
             if (val.length > 0) {
                 val.forEach(el => {
@@ -471,6 +468,7 @@ export default {
         init() {
             // 图例
             bus.$on('queryViewMethods', () => {
+                // console.log('queryViewMethods')
                 this.queryView(false)
             })
             // 备注
@@ -495,9 +493,12 @@ export default {
         }
     },
     mounted() {
-        console.log('editTips', this.editTips)
+        // console.log('lengend mounted')
+        // console.log(this.categoryId)
+        // console.log('editTips', this.editTips)
         this.init()
         // 定时查询草稿箱数量
+        // TODO: 1
         this.getDraftNum() //首次查询
         this.timer = setInterval(() => {
             this.getDraftNum()

+ 1 - 1
src/views/equipment/fenbuPic.vue

@@ -2,7 +2,7 @@
     <div class='fenbu-box'>
         <!-- 图例 -->
         <div class='legend-boxs'>
-            <Legend :floors='floors' type='0' :categoryId='`${typecode=="FBT1"?"FZQZL":"XFBFYCFL"}`'></Legend>
+            <Legend :innerLeng='1' :floors='floors' type='0' :categoryId='`${typecode=="FBT1"?"FZQZL":"XFBFYCFL"}`'></Legend>
         </div>
         <floor-list v-if='floors.length>0' :floorsArr='floors' :type='1' @emitFloor='emitFloor' :id='"floor"'></floor-list>
         <div v-show='floors.length>0' class='canvas-box'>