月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-08-16 4401f18284cd0e9ed262d18a4ad28a17fdb2655a
src/views/layer/layerManage.vue
@@ -1,13 +1,22 @@
<template>
  <div v-drag class="layerBox">
  <div
    v-drag
    class="layerBox"
  >
    <div class="layerTitle">
      <div class="tileLeft">
        <div @click="setCloseLayer" class="titleImg">
        <div
          @click="setCloseLayer"
          class="titleImg"
        >
          <ArrowLeft />
        </div>
        <div class="titleLable">图层管理</div>
      </div>
      <div class="titleImg set" @click="layerSetBox">
      <div
        class="titleImg set"
        @click="layerSetBox"
      >
        <Setting />
      </div>
    </div>
@@ -34,7 +43,10 @@
                Delete
              </a>
            </span> -->
            <span class="button" v-if="data.isLayer == 1">
            <span
              class="button"
              v-if="data.isLayer == 1"
            >
              <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                  <el-icon class="el-icon--right">
@@ -43,12 +55,8 @@
                </span>
                <template #dropdown>
                  <el-dropdown-menu>
                    <el-dropdown-item @click.native="clickdropdown(1, data)"
                      >详细</el-dropdown-item
                    >
                    <el-dropdown-item @click.native="clickdropdown(2, data)"
                      >属性</el-dropdown-item
                    >
                    <el-dropdown-item @click.native="clickdropdown(1, data)">详细</el-dropdown-item>
                    <el-dropdown-item @click.native="clickdropdown(2, data)">属性</el-dropdown-item>
                  </el-dropdown-menu>
                </template>
              </el-dropdown>
@@ -102,49 +110,7 @@
const transparence = ref(0);
var treeData = ref([]);
var layerListData = ref([]);
let menuOption = reactive([
  {
    id: 1,
    name: "测试",
    isShow: false,
    checkedAll: false,
    type: 1,
    parentId: null,
  },
  {
    id: 2,
    layerState: false,
    name: "图层名称",
    layerUrl: "",
    type: 2,
    parentId: 1,
  },
  {
    id: 3,
    layerState: false,
    name: "图层菜单",
    layerUrl: "",
    type: 1,
    parentId: 1,
  },
  {
    id: 5,
    layerState: false,
    name: "图层名称11",
    layerUrl: "",
    type: 2,
    parentId: 3,
  },
  {
    id: 4,
    name: "测试1",
    isShow: false,
    checkedAll: true,
    layerState: false,
    type: 1,
    parentId: null,
  },
]);
let menuOption = reactive([]);
const layerSetIsshow = ref(false);
const layerAttributeIsshow = ref(false);
@@ -158,7 +124,7 @@
const selectedNodeId = ref(null as any); //做类型断言处理
const emits = defineEmits(["setCloseLayer"]);
//默认选中id
const DefaultId = ref([29]);
const DefaultId = ref([]);
//图层设置弹框
const layerSetBox = () => {
  layerSetIsshow.value = !layerSetIsshow.value;
@@ -276,8 +242,6 @@
  // menuOption = menuOption.filter((item) => {
  //   return item.id != res;
  // });
  // console.log(res);
  // console.log(menuOption);
  // treeData = handleTree(menuOption, "id", "pid", "children");
};
@@ -287,7 +251,22 @@
    treeData.value = setTreeData(dt.result).sort(function (a, b) {
      return a.sort - b.sort;
    });
    console.log(treeData.value);
    var std = [];
    var terrainId = null;
    dt.result.filter((res) => {
      if (res.isLayer == 1 && res.status == 1) {
        if (res.type == 1 && res.data == 2) {
          if (!terrainId) {
            terrainId = res.id;
            std.push(res.id);
          }
        } else {
          std.push(res.id);
        }
      }
    });
    DefaultId.value = std;
    //添加默认选中图层
    layerListData.value = dt.result;
    defaultLayer(treeData.value);