| | |
| | | <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" |
| | | <div class="set">
|
| | | <div
|
| | | @click="setAddManagerFile()"
|
| | | class="titleImg"
|
| | | style="margin-right: 10px"
|
| | | title="导入"
|
| | | >
|
| | | <el-icon :size="20">
|
| | | <FolderOpened />
|
| | | </el-icon>
|
| | | </div>
|
| | | <div
|
| | | @click="setoutManagerFile()"
|
| | | class="titleImg"
|
| | | style="margin-right: 10px"
|
| | | title="导出"
|
| | | >
|
| | | <el-icon :size="20">
|
| | | <Download />
|
| | | </el-icon>
|
| | | </div>
|
| | | <div
|
| | | @click="setAddManagerLayer"
|
| | | class="titleImg"
|
| | | style="margin-right: 10px"
|
| | | title="添加"
|
| | | >
|
| | | <el-icon :size="20">
|
| | | <Plus />
|
| | | </el-icon>
|
| | | </div>
|
| | | <div
|
| | | class="titleImg"
|
| | | @click="store.state.layerFlag = null" |
| | | title="关闭"> |
| | | <CloseBold /> |
| | | title="关闭"
|
| | | >
|
| | | <el-icon :size="20">
|
| | | <Close />
|
| | | </el-icon>
|
| | | </div>
|
| | | </div> |
| | | </div> |
| | | <div class="layerContent"> |
| | | <el-tree node-key="id" |
| | | <el-tree
|
| | | node-key="id"
|
| | | :props="props" |
| | | :highlight-current="false" |
| | | :data="treeData" |
| | | show-checkbox |
| | | :expand-on-click-node="false" |
| | | @check-change="handleCheckChange" |
| | | ref="treeRef"> |
| | | <template #default="{ node, data }"> |
| | | <span class="custom-tree-node"> |
| | | <span class="label">{{ node.label }}</span> |
| | | |
| | | <span class="button" |
| | | v-if="data.sourceType == 'demoAnimation'"> |
| | | <el-dropdown trigger="click"> |
| | | <span class="el-dropdown-link"> |
| | | <el-icon style="color: wheat" |
| | | class="el-icon--right"> |
| | | <MoreFilled /> |
| | | </el-icon> |
| | | </span> |
| | | <template #dropdown> |
| | | <el-dropdown-menu> |
| | | <el-dropdown-item @click="playNode(data)">播放</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </template> |
| | | </el-dropdown> |
| | | </span> |
| | | </span> |
| | | </template> |
| | | ref="treeRef"
|
| | | class="stafftree"
|
| | | >
|
| | | </el-tree> |
| | | </div> |
| | | </div> |
| | |
| | | children?: Tree[]; |
| | | } |
| | | const treeRef = ref<InstanceType<typeof ElTree>>(); |
| | | import { MoreFilled, Setting, CloseBold } from "@element-plus/icons-vue"; |
| | | import {
|
| | | MoreFilled,
|
| | | Setting,
|
| | | Close,
|
| | | Plus,
|
| | | defineProps,
|
| | | FolderOpened,
|
| | | Download
|
| | | } from "@element-plus/icons-vue";
|
| | | import palyTools from "@/assets/js/tool/palyTools"; |
| | | import configTool from "@/assets/js/tool/configTool"; |
| | | import layerManager from "@/assets/js/map/layerManage"; |
| | | import axios from "axios"; |
| | | import store from "@/store"; |
| | | const treeData = ref([]); |
| | |
|
| | | const props = { |
| | | label: "name", |
| | | children: "children", |
| | | children: "children"
|
| | | };
|
| | | const setAddManagerLayer = () => {
|
| | | store.state.setAddEntityList = {
|
| | | flag: true,
|
| | | title: "图层添加",
|
| | | type: 1
|
| | | };
|
| | | };
|
| | | const setAddManagerFile = () => {
|
| | | store.state.setAddEntityList = {
|
| | | flag: true,
|
| | | title: "图层导入",
|
| | | type: 3
|
| | | };
|
| | | };
|
| | | const setoutManagerFile = () => {
|
| | | configTool.saveToJson(treeData.value, "图层导出");
|
| | | }; |
| | | const handleCheckChange = (data, check, indeterminate) => { |
| | | if (data.children) return; |
| | |
| | | store.state.setAnimation = false; |
| | | }); |
| | | }; |
| | | const addGeometry = (val) => {
|
| | | if (val.flag) {
|
| | | for (var i in val.value) {
|
| | | treeData.value.push(val.value[i]);
|
| | | }
|
| | | } else {
|
| | | val.id = configTool.getEndDateTime();
|
| | | if (val.sourceType === "3DTiles") {
|
| | | treeData.value[0].children.push(val);
|
| | | } else if (val.sourceType === "WMS") {
|
| | | treeData.value[1].children.push(val);
|
| | | } else if (val.sourceType === "TMS") {
|
| | | treeData.value[2].children.push(val);
|
| | | }
|
| | | }
|
| | | };
|
| | | onMounted(() => { |
| | | setTreeStart(); |
| | | });
|
| | | defineExpose({
|
| | | addGeometry
|
| | | }); |
| | | watch( |
| | | () => store.state.setAnimation, |
| | |
| | | .titleImg { |
| | | width: 20px; |
| | | height: 100%; |
| | | color: #fff;
|
| | | display: flex; |
| | | align-items: center; |
| | | color: #fff; |
| | | } |
| | | |
| | | .set { |
| | | cursor: pointer; |
| | | display: flex;
|
| | | } |
| | | } |
| | | |
| | |
| | | /deep/ .el-tree-node { |
| | | background: #0d131d; |
| | | color: #ffffff; |
| | | font-size: 20px; |
| | | font-size: 14px;
|
| | | font-weight: 300; |
| | | margin-top: 3px; |
| | | padding: 8px; |
| | |
| | | background: #1e2a3d; |
| | | margin-top: 0; |
| | | padding: 4px; |
| | | font-size: 12px;
|
| | | } |
| | | } |
| | | |
| | | /deep/ .stafftree > .el-tree-node > .el-tree-node__content .el-checkbox {
|
| | | display: none;
|
| | | }
|
| | | /deep/ |
| | | .el-tree--highlight-current |
| | | .el-tree-node.is-current |