From c5fcf797d52299e307347ed416f91aa32b056165 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期三, 31 五月 2023 14:56:23 +0800
Subject: [PATCH] 模型透明度修改

---
 src/views/Tools/setPellucidity.vue |   65 +++++++++++++++++++++++++++-----
 1 files changed, 55 insertions(+), 10 deletions(-)

diff --git a/src/views/Tools/setPellucidity.vue b/src/views/Tools/setPellucidity.vue
index d45e8e8..4435c87 100644
--- a/src/views/Tools/setPellucidity.vue
+++ b/src/views/Tools/setPellucidity.vue
@@ -6,20 +6,44 @@
     width="400px"
     @cancel="close(false)"
   >
+    <el-row :gutter="20">
+      <el-col :span="4">
+        <el-button
+          @click="alphaChange(1)"
+          icon="el-icon-minus"
+          size="small"
+        ></el-button>
+      </el-col>
+      <el-col :span="16">
+        <el-slider
+          v-model="modelForm.alpha"
+          :min="0"
+          :step="0.1"
+          :max="1"
+          @change="update()"
+        >
+        </el-slider>
+      </el-col>
+      <el-col :span="4">
+        <el-button
+          @click="alphaChange(2)"
+          icon="el-icon-plus"
+          size="small"
+        ></el-button>
+      </el-col>
+    </el-row>
+
     <!-- <el-input
       size="small"
       v-model="modelForm.alpha1"
       @input="update2"
     ></el-input> -->
-    <el-slider
-      v-model="modelForm.alpha"
+    <!-- <el-slider
       @input="update1"
-      :min="0"
-      :step="0.01"
-      :max="1"
+     
       show-input
     >
-    </el-slider>
+    </el-slider> -->
 
   </Popup>
 </template>
@@ -39,7 +63,7 @@
       title: "閫忔槑搴�",
       modelForm: {
         alpha: 1,
-        alpha1: 1,
+
       },
       titleset: null,
       index: null,
@@ -81,10 +105,31 @@
       this.modelForm.alpha1 = this.modelForm.alpha;
       this.update();
     },
+    alphaChange(res) {
+      switch (res) {
+        case 1:
+          if (this.modelForm.alpha <= 0) {
+            this.modelForm.alpha = 0
+          } else {
+            this.modelForm.alpha = this.modelForm.alpha - 0.1
+          }
+
+          this.update()
+          break;
+        case 2:
+          if (this.modelForm.alpha >= 1) {
+            this.modelForm.alpha = 1
+          } else {
+            this.modelForm.alpha = this.modelForm.alpha + 0.1
+          }
+          this.modelForm.alpha = this.modelForm.alpha.toFixed(1)
+          this.update()
+          break;
+      }
+    },
+
+
     update() {
-
-
-
       this.titleset.style = new Cesium.Cesium3DTileStyle({
         color: "color('rgba(255,255,255," + this.modelForm.alpha + ")')",
       });

--
Gitblit v1.9.3