1
wangjuncheng
2025-06-06 a0e9b51614f572aebf4706d7cff04618ebd08f2f
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
<template>
  <div class="custom-panel">
    <div class="panel-content">
      <el-button @click="handleSwitchChange" title="开启模型库">
      </el-button>
      <el-switch
        v-model="isDamEnabled"
        active-text="开挖开启"
        inactive-text="开挖关闭"
        @change="handleSwitchChange"
      />
    </div>
  </div>
</template>
 
 
<script setup>
import { ref } from 'vue';
import { ElSwitch } from 'element-plus';
const isDamEnabled = ref(false);
function handleDamOn() {
  earthCtrl.factory.createModelLibrary()
 
}
 
// 监听 switch 变化
function handleSwitchChange(value) {
  if (value) {
    handleDamOn();
  }
}
</script>
 
<style scoped>
.custom-panel {
  padding: 20px;
  width: 290px;
  background: url("@/assets/img/tools/plotting_new.png") no-repeat;
  filter: opacity(83%);
  background-size: 100% 100%;
  box-sizing: border-box;
}
 
.panel-content {
  display: flex;
  flex-direction: column;
}
</style>