月球大数据地理空间分析展示平台-【前端】-月球2期前端
WX
2023-07-21 bf48462e6ce0e0baa899c1c64c24c05290dc77fd
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<template>
  <div class="content">
    <div class="title">
      <label>详细编辑</label>
      <el-icon @click="setSpatialClose" :size="20" style="cursor: pointer">
        <Close />
      </el-icon>
    </div>
    <div class="layer_box">
      <div class="check_box">
        <!-- <el-checkbox @change="handlCheckAllChange" v-model="layerState">{{
          layerName
        }}</el-checkbox> -->
        {{ layerData.name }}
        <img src="../../assets/img/layer.png" alt="" />
      </div>
      <div class="slider-demo-block">
        <div class="demonstration">透明度</div>
        <el-slider v-model="transparence" />
        <div class="demonstration">{{ transparence }}%</div>
      </div>
      <div class="selectBox">
        <div class="selectTile demonstration">拉伸方式</div>
        <el-select
          v-model="stretchValue"
          class="m-2"
          placeholder="Select"
          size="small"
          @change="changeSelection(stretchValue)"
          ref="select"
        >
          <el-option
            v-for="item in stretchOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
            <img :src="item.url" style="height: 30px; margin-right: 10px" />
            <span>{{ item.label }}</span>
          </el-option>
        </el-select>
      </div>
    </div>
  </div>
</template>
 
<script lang="ts" setup>
import {
  ref,
  onMounted,
  onBeforeUnmount,
  reactive,
  defineProps,
  defineEmits,
} from "vue";
const stretchValue = ref("");
const transparence = ref(0);
let layerName = ref("图层名称");
let layerState = ref(false);
let select = ref();
const stretchOptions = [
  {
    value: "Option1",
    label: "Option1",
    url: "https://img2.baidu.com/it/u=3727554264,855092936&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",
  },
  {
    value: "Option2",
    label: "Option2",
    url: "https://img2.baidu.com/it/u=3727554264,855092936&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",
  },
];
const emits = defineEmits(["detailClose"]);
//defineProps 来接收组件的传值
const props = defineProps({
  layerData: Object,
});
const setSpatialClose = () => {
  emits("detailClose", false);
};
const handlCheckAllChange = (res) => {};
const changeSelection = (scope) => {
  let brand = scope;
  for (let index in stretchOptions) {
    let aa = stretchOptions[index];
    let value = aa.value;
    if (brand === value) {
      console.log(select.value);
      select.value.$el.children[0].children[0].setAttribute(
        "style",
        "background:url(" +
          aa.url +
          ") no-repeat 10px;background-size: 30px 30px;color:#333;padding-left: 50px;"
      );
    }
  }
};
</script>
 
<style lang="less" scoped>
.content {
  background: #1e2a3d;
  padding: 20px;
  height: 400px;
  margin-left: 20px;
  margin-top: 40px;
  .title {
    font-size: 18px;
    font-family: Source Han Sans CN;
    font-weight: 400;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .layer_box {
    margin-top: 10px;
  }
}
.check_box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 50px;
  padding-top: 10px;
  font-size: 16px;
  color: #ffffff;
  img {
    width: 22px;
    height: 19px;
  }
}
.check_box .el-checkbox {
  font-size: 16px;
  color: #ffffff;
}
.check_box /deep/ .el-checkbox__input.is-checked .el-checkbox__inner {
  background-color: rgba(13, 255, 0, 1);
  border-color: rgba(41, 109, 255, 1);
}
.check_box /deep/ .el-checkbox__input.is-checked + .el-checkbox__label {
  color: #fff;
}
.slider-demo-block {
  margin-top: 22px;
}
.demonstration {
  font-size: 12px;
  font-weight: 300;
  color: #d6e4ff;
}
/deep/ .el-slider__runway {
  height: 2px;
 
  background: #73a1fa;
}
/deep/ .el-slider__bar {
  height: 2px;
 
  background: #73a1fa;
}
/deep/ .el-slider__button {
  width: 17px;
  height: 18px;
  border: 0;
  background: url("../../assets/img/DBX.png") no-repeat center;
  background-size: 100% 100%;
  border-radius: 0;
}
.selectBox {
  margin-top: 24px;
  .selectTile {
    padding-bottom: 6px;
  }
  .el-select {
    width: 100%;
  }
}
/deep/.el-select-dropdown__item {
  font-size: 12px !important;
}
</style>