Преглед изворни кода

解决楼层默认1F高亮,图例switch报错

shaun-sheep пре 4 година
родитељ
комит
ea9ea7954b

+ 13 - 0
package-lock.json

@@ -10843,6 +10843,11 @@
             "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
             "dev": true
         },
+        "tiny-cookie": {
+            "version": "1.0.1",
+            "resolved": "http://192.168.200.80:8081/repository/npm-saga/tiny-cookie/-/tiny-cookie-1.0.1.tgz",
+            "integrity": "sha1-dTeGB5xkKjw9CyrMrWAPjeEZrCo="
+        },
         "tinycolor2": {
             "version": "1.4.1",
             "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.1.tgz",
@@ -11324,6 +11329,14 @@
             "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.11.tgz",
             "integrity": "sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ=="
         },
+        "vue-cookie": {
+            "version": "1.1.4",
+            "resolved": "http://192.168.200.80:8081/repository/npm-saga/vue-cookie/-/vue-cookie-1.1.4.tgz",
+            "integrity": "sha1-uLRtESvan5Oi9HAXwu1SgtIGT9o=",
+            "requires": {
+                "tiny-cookie": "^1.0"
+            }
+        },
         "vue-eslint-parser": {
             "version": "5.0.0",
             "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-5.0.0.tgz",

+ 4 - 2
src/components/Legend/src/legend.vue

@@ -10,7 +10,7 @@
             <el-collapse-transition>
                 <div class='legend-tab' v-if='show'>
                     <div class='legend-table'>
-                        <lengend-view :tableData='tableData' :swich='value1'></lengend-view>
+                        <lengend-view :tableData='tableData' @changeSwitch='handleSwich'></lengend-view>
                     </div>
                 </div>
             </el-collapse-transition>
@@ -55,7 +55,6 @@ export default {
             text: '1.主要设备房包括:制冷机房、生活水泵房、消防泵房2.图例后    的数字,代表此位置的数量',
             show: false,
             show2: false,
-            value1: true,
             dataSelect2: [
                 { id: 'test1', name: '选择项' },
                 { id: 'test2', name: '单平米' },
@@ -182,6 +181,9 @@ export default {
         editTl() {
             this.show = false
             this.show2 = true
+        },
+        handleSwich(val) {
+            console.log(val)
         }
     },
     watch: {

+ 3 - 1
src/components/floorList.vue

@@ -36,7 +36,9 @@ export default {
             num: 0
         }
     },
-    mounted() {},
+    mounted() {
+        this.tabFloor('1F')
+    },
     computed: {
         ...mapGetters(['floorsArr'])
     },

+ 8 - 3
src/components/viewLengend.vue

@@ -22,7 +22,7 @@
             </el-table-column>
         </el-table>
         <div class='swich'>
-            <el-switch v-model='swich'></el-switch>
+            <el-switch v-model='swich' @change='handleSwich'></el-switch>
             <span>隐藏数量为0的项目</span>
         </div>
         <div class='remark'>
@@ -37,13 +37,18 @@
 </template>
 <script>
 export default {
-    props: ['tableData', 'swich'],
+    props: ['tableData'],
     data() {
-        return {}
+        return {
+            swich: true
+        }
     },
     methods: {
         handleSelectionChange(val) {
             this.multipleSelection = val
+        },
+        handleSwich() {
+            this.$emit('changeSwitch', this.swich)
         }
     },
     mounted() {}