管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-05-31 c5fcf797d52299e307347ed416f91aa32b056165
模型透明度修改
已修改1个文件
65 ■■■■ 文件已修改
src/views/Tools/setPellucidity.vue 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 + ")')",
      });