月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-08-16 4401f18284cd0e9ed262d18a4ad28a17fdb2655a
src/views/layer/layerManage.vue
@@ -45,7 +45,7 @@
            </span> -->
            <span
              class="button"
              v-if="data.type == 2 || data.type == 3"
              v-if="data.isLayer == 1"
            >
              <el-dropdown trigger="click">
                <span class="el-dropdown-link">
@@ -110,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);
@@ -166,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;
@@ -226,15 +184,15 @@
  });
};
const clickdropdown = (res, e) => {
  if (!e.checked) {
    return ElMessage.error("请先勾选图层");
  }
  layerAttributeIsshow.value = false;
  layerDetailIsshow.value = false;
  layerObjData.value = e;
  if (res == 2) {
    layerAttributeIsshow.value = true;
  } else {
    if (!e.checked) {
      return ElMessage.error("请先勾选图层");
    }
    layerDetailIsshow.value = true;
  }
};
@@ -284,8 +242,6 @@
  // menuOption = menuOption.filter((item) => {
  //   return item.id != res;
  // });
  // console.log(res);
  // console.log(menuOption);
  // treeData = handleTree(menuOption, "id", "pid", "children");
};
@@ -295,6 +251,21 @@
    treeData.value = setTreeData(dt.result).sort(function (a, b) {
      return a.sort - b.sort;
    });
    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;