派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-05-30 a312e0dd96d8f7e96fb3341f1a55561b12394405
src/components/LayerController/modules/LcServiceLayer.vue
@@ -68,8 +68,53 @@
      } else {
        this.toggleLayer(item)
      }
      /* <<<<<<< HEAD
      bus.$emit('changeSearchBar', item)
      this.serviceLayers.forEach(function (item1, index1) {
        if (item1.layers) {
          item1.istrue = 0
          item1.isfalse = 0
          item1.layers.forEach(function (item2, index2) {
            if (item2.layers) {
              item2.istrue = 0
              item2.isfalse = 0
              item2.layers.forEach(function (item3, index3) {
                if (item3.checked) { item2.istrue += 1 } else { item2.isfalse += 1 }
              })
              //  console.log(item2.layers.length, item2.istrue, item2.isfalse, item2.type)
              if (item2.istrue === item2.layers.length) {
                item2.type = 2
                item2.checked = true
              } else if (item2.isfalse === item2.layers.length) {
                item2.type = 0
                item2.checked = false
              } else {
                item2.type = 1
              }
              if (item1.name === '专题图层') {
                bus.$emit('changeSearchBar', item2)
                // console.log(item2, 'item2')
              }
              if (item2.checked) { item1.istrue += 1 } else { item1.isfalse += 1 }
            }
          })
          if (item1.istrue === item1.layers.length) {
            item1.type = 2 // 全选
            item1.checked = true
          } else if (item1.isfalse === item1.layers.length) {
            item1.type = 0 // 不选
            item1.checked = false
          } else {
            item1.type = 1 // 半选
          }
          if (item1.name === '企业应急') {
            // console.log(item1)
            bus.$emit('changeSearchBar', item1)
          }
          // console.log(item1.layers.length, item1.istrue, item1.isfalse, item1.type)
        }
      })
>>>>>>> de7390c66ef3e3fe316e804495a78d05a01f0160 */
      // console.log(this.serviceLayers)
    },
    swLayers (configs, checked) {