管道基础大数据平台系统开发-【前端】-新系統界面
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<template>
  <Popup
    ref="pop"
    :title="title"
    @close="close(true)"
    width="400px"
    @cancel="close(false)"
  >
    <el-input
      size="small"
      v-model="modelForm.alpha"
      @input="update"
    ></el-input>
    <el-slider
      v-model="modelForm.alpha"
      @input="update"
      :min="0"
      :step="0.01"
      :max="1"
    ></el-slider>
    </el-form>
  </Popup>
</template>
 
<script>
import Popup from "./Popup";
 
 
export default {
  name: "AddOnlineMap",
  components: {
    Popup,
  },
  mixins: [],
  data() {
    return {
      title: "透明度",
      modelForm: {
        alpha: 1
      },
      titleset: null,
      index: null,
    };
  },
  computed: {
 
  },
  methods: {
 
    // 关闭弹窗
    close(isCloseBtn, removeLayer = true) {
      //   removeLayer && this.removeImageLayer();
      if (this.index != null) {
        this.$store.state.setAlphaList[this.index].alpha = this.modelForm.alpha;
 
      }
      this.index = null;
      // 重置data值
      Object.assign(this.$data, this.$options.data());
      !isCloseBtn && this.$refs.pop.close();
 
 
    },
    // 打开弹窗
    open() {
      this.close(true);
      this.$refs.pop.open();
      this.showTileSet();
    },
    changeToken(token) {
      this.mapCollection.tokne = token;
    },
    update() {
 
 
 
      this.titleset.style = new Cesium.Cesium3DTileStyle({
        color: "color('rgba(255,255,255," + this.modelForm.alpha + ")')",
      });
    },
    showTileSet() {
      this.index = null;
      var tile = this.$store.state.setAlphaDity
      for (var j in Viewer.scene.primitives._primitives) {
        if (Viewer.scene.primitives._primitives[j].id == tile.cnName) {
          this.titleset = Viewer.scene.primitives._primitives[j]
        }
      }
 
 
      var list = this.$store.state.setAlphaList;
 
      for (var i = 0; i < list.length; i++) {
        if (list[i].name == tile.cnName) {
          this.index = i;
        }
      }
 
      if (this.index != null) {
        this.modelForm.alpha = list[this.index].alpha;
 
      } else {
 
        this.modelForm.alpha = 1;
      }
    },
 
  },
};
</script>
 
<style scoped lang="less">
/deep/.el-card__body {
  padding: 0px !important;
}
.map {
  display: inline-block;
  cursor: pointer;
  margin: 5px;
  text-align: center;
 
  .el-image {
    border: 2px solid #fff;
    border-radius: 4px;
  }
}
.boxCard {
  margin-bottom: 5px;
}
</style>