月球大数据地理空间分析展示平台-【前端】-月球2期前端
src/views/layer/layerManage.vue
@@ -5,21 +5,26 @@
  >
    <div class="layerTitle">
      <div class="tileLeft">
        <div class="titleImg">
        <div
          @click="setCloseLayer"
          class="titleImg"
        >
          <ArrowLeft />
        </div>
        <div class="titleLable">
          图层管理
        </div>
        <div class="titleLable">图层管理</div>
      </div>
      <div class="titleImg">
      <div
        class="titleImg set"
        @click="layerSetBox"
      >
        <Setting />
      </div>
    </div>
    <div>
    <div class="layerContent">
      <div
        class="contentBox"
        v-for="(item,i) in menuOption"
        v-for="(item, i) in menuOption"
        :key="i"
      >
        <div class="contentTile">
          <div class="contentLeft">
@@ -27,27 +32,71 @@
            <div class="contentLabel">{{ item.name }}</div>
          </div>
          <div class="contentRight">
            <div class="contentCheck"><el-checkbox
            <div class="contentCheck">
              <el-checkbox
                @change="handlCheckAllChange(item)"
                v-model="item.checkedAll"
              >全部选中</el-checkbox></div>
              >全部选中</el-checkbox>
            </div>
            <div>
              <div
                @click="handlIsShow(item,1)"
                v-show="item.isShow"
                @click="handlIsShow(item.name)"
                class="contentUP"
                :class="{ accordion: item.isShow }"
              ></div>
              <div
                @click="handlIsShow(item,2)"
                v-show="!item.isShow"
                class="contentDown"
              ></div>
            </div>
          </div>
        </div>
        <div
          class="content"
          v-show="item.isShow"
        >
          <div
            class="layer_box"
            v-for="(v, k) in item.children"
            :key="k"
          >
            <div class="check_box">
              <el-checkbox
                @change="handlCheckAllChange(item)"
                v-model="v.layerState"
              >{{ v.layerName }}</el-checkbox>
              <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"
              >
                <el-option
                  v-for="item in stretchOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <layer-set
    v-show="layerSetIsshow"
    @SETstate="SETstate"
  ></layer-set>
</template>
<script lang="ts" setup>
@@ -59,30 +108,81 @@
  defineProps,
  defineEmits,
} from "vue";
const menuOption = [
import layerSet from "./layerSet";
const stretchValue = ref("");
const stretchOptions = [
  {
    value: "Option1",
    label: "Option1",
  },
  {
    value: "Option2",
    label: "Option2",
  },
  {
    value: "Option3",
    label: "Option3",
  },
  {
    value: "Option4",
    label: "Option4",
  },
  {
    value: "Option5",
    label: "Option5",
  },
];
const transparence = ref(0);
let menuOption = reactive([
  {
    name: "测试",
    isShow: true,
    isShow: false,
    checkedAll: false,
    children: [
      {
        layerState: false,
        layerName: "图层名称",
        layerUrl: "",
      },
    ],
  },
  {
    name: "测试1",
    isShow: true,
    isShow: false,
    checkedAll: true,
    layerState: false,
  },
];
]);
const layerSetIsshow = ref(false);
const emits = defineEmits(["setCloseLayer"]);
const handlCheckAllChange = (res) => {};
const handlIsShow = (res, boolean) => {};
const handlIsShow = (res: string) => {
  menuOption.forEach((e) => {
    if (e.name == res) {
      e.isShow = !e.isShow;
    }
  });
};
//图层设置弹框
const layerSetBox = () => {
  layerSetIsshow.value = !layerSetIsshow.value;
};
//关闭状态
const SETstate = (res) => {
  layerSetIsshow.value = res;
};
const setCloseLayer = () => {
  emits("setCloseLayer", false);
};
</script>
<style lang="less" scoped>
.layerBox {
  position: absolute;
  top: 135px;
  left: 100px;
  width: 359px;
  height: 680px;
  background: rgba(7, 8, 14, 0.8);
  box-shadow: inset 0px 10px 40px 10px rgba(38, 47, 71, 1);
  .layerTitle {
    width: calc(100% - 27px);
    height: 42px;
@@ -100,7 +200,7 @@
      align-items: center;
      .titleLable {
        font-size: 24px;
        font-size: 18px;
        font-family: Source Han Sans CN;
        font-weight: 400;
        color: #ffffff;
@@ -111,10 +211,19 @@
      height: 100%;
      display: flex;
      align-items: center;
      color: rgba(104, 156, 255, 1);
    }
    .set {
      cursor: pointer;
    }
  }
  .layerContent {
    padding: 0 8px;
  }
  .contentBox {
    margin-top: 3px;
    .content {
    }
  }
  .contentTile {
    width: 100%;
@@ -135,9 +244,11 @@
        margin-left: 16px;
      }
      .contentLabel {
        font-size: 20px;
        font-size: 16px;
        font-family: Source Han Sans CN;
        font-weight: 300;
        margin-bottom: 5px;
        color: #ffffff;
        margin-left: 7px;
      }
@@ -148,11 +259,21 @@
      align-items: center;
      .contentCheck {
        margin-right: 12px;
        /deep/.el-checkbox__label {
          font-size: 14px;
        }
      }
      .contentUP {
        width: 18px;
        height: 11px;
        background: url("../../assets/img/leftBtn/箭头-左 拷贝.png");
        background: url("../../assets/img/leftBtn/箭头-左 拷贝.png") no-repeat
          center;
        background-size: 100% 100%;
        cursor: pointer;
      }
      .accordion {
        transform: rotate(180deg);
      }
      .contentDown {
        width: 18px;
@@ -161,5 +282,69 @@
      }
    }
  }
  .content {
    background: #1e2a3d;
    padding: 10px;
  }
  .check_box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 50px;
    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%;
    }
  }
}
</style>
/deep/.el-select-dropdown__item {
  font-size: 12px !important;
}
</style>