| | |
| | | <template> |
| | | <div class="lalala tree-container"> |
| | | <el-form ref="form"> |
| | | <el-form-item> |
| | | <el-select |
| | | v-model="$store.state.pigCode" |
| | | clearable |
| | | filterable |
| | | style="width :100%" |
| | | @change="prjChanged" |
| | | placeholder="è¯·éæ©é¡¹ç®" |
| | | > |
| | | <el-option |
| | | v-for="item in menus" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | <div> |
| | | <!-- <Popup |
| | | ref="layer" |
| | | :closeHidePage="true" |
| | | :title="title" |
| | | :left="left" |
| | | :top="top" |
| | | :maxHeight="maxHeight" |
| | | @close="close" |
| | | > --> |
| | | <div class="treeContainer"> |
| | | <!-- <div class="treeTitle"> |
| | | <el-upload |
| | | class="button-group" |
| | | action="" |
| | | :auto-upload="false" |
| | | :show-file-list="false" |
| | | :on-change="loadJsonFromFile" |
| | | accept=".json" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-input |
| | | placeholder="è¾å
¥å
³é®åè¿è¡è¿æ»¤" |
| | | v-model="filterText" |
| | | class="search" |
| | | <el-button |
| | | type="primary" |
| | | size="mini" |
| | | slot="trigger" |
| | | icon="el-icon-folder-opened" |
| | | title="æå¼é
ç½®æä»¶" |
| | | ></el-button> |
| | | <el-button |
| | | type="primary" |
| | | size="mini" |
| | | icon="el-icon-download" |
| | | title="ä¿åé
ç½®æä»¶" |
| | | @click="save" |
| | | ></el-button> |
| | | </el-upload> |
| | | </div> --> |
| | | |
| | | <el-tree |
| | | ref="tree" |
| | | :data="treeData" |
| | | show-checkbox |
| | | node-key="id" |
| | | draggable |
| | | :allow-drop="allowDrop" |
| | | :expand-on-click-node="false" |
| | | :auto-expand-parent="false" |
| | | :default-expanded-keys="defaultExpanded" |
| | | :default-checked-keys="defaultCheck" |
| | | @node-expand="changeNodeExpand($event, true)" |
| | | @node-collapse="changeNodeExpand($event, false)" |
| | | @check="check" |
| | | @node-contextmenu="rightClick" |
| | | > |
| | | <span |
| | | class="custom-tree-node" |
| | | slot-scope="{ data }" |
| | | @dblclick="flyTo(data)" |
| | | @click="select(data)" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-tree |
| | | ref="tree" |
| | | :data="treeData" |
| | | node-key="id" |
| | | show-checkbox |
| | | :props="defaultProps" |
| | | @node-click="handleLeftclick" |
| | | @node-contextmenu="rightClick" |
| | | @check="handleCheckChange" |
| | | :default-checked-keys="handleTreeCheck" |
| | | :expand-on-click-node="false" |
| | | :filter-node-method="filterNode" |
| | | > |
| | | <span |
| | | class="slot-t-node" |
| | | slot-scope="{ node, data }" |
| | | > |
| | | <span v-show="!data.isEdit"> |
| | | <span :class="[data.id >= 99 ? 'slot-t-node--label' : '']">{{ |
| | | node.label |
| | | }}</span> |
| | | <span> |
| | | <i v-if="data.children" class="el-icon-folder"></i> |
| | | <i |
| | | v-else |
| | | :class=" |
| | | data.sourceType === 'location' ? 'el-icon-location-outline' : '' |
| | | " |
| | | ></i> |
| | | <el-input |
| | | v-if="data.rename" |
| | | v-model="data.name" |
| | | size="mini" |
| | | placeholder="请è¾å
¥åç§°" |
| | | @change="rename(data)" |
| | | @blur="rename(data)" |
| | | ></el-input> |
| | | <span v-else>{{ data.name }}</span> |
| | | </span> |
| | | </span> |
| | | <span v-show="data.isEdit"> |
| | | <el-input |
| | | class="slot-t-input" |
| | | size="mini" |
| | | autofocus |
| | | v-model="data.label" |
| | | :ref="'slotTreeInput' + data.id" |
| | | @blur.stop="nodeBlur(node, data)" |
| | | @keydown.native.enter="nodeBlur(node, data)" |
| | | ></el-input> |
| | | </span> |
| | | </span> |
| | | </el-tree> |
| | | <el-card |
| | | class="box-card" |
| | | ref="card" |
| | | </el-tree> |
| | | </div> |
| | | |
| | | <div |
| | | class="rightClickMenu" |
| | | v-if="rightClickMenuDisplay" |
| | | :style="{ ...rightClickMenuStyle }" |
| | | v-show="menuVisible" |
| | | > |
| | | <div |
| | | class="edit" |
| | | @click="showLayerAttribute()" |
| | | v-if="showProp && !shwoHistogram" |
| | | > |
| | | <i class="el-icon-tickets"></i> 屿§ |
| | | </div> |
| | | <div |
| | | class="edit" |
| | | @click="positioning()" |
| | | v-if="showLocal" |
| | | > |
| | | <i class="el-icon-tickets"></i> å®ä½ |
| | | </div> |
| | | <div |
| | | class="edit" |
| | | @click="pellucidity()" |
| | | v-if="showOpacity" |
| | | > |
| | | <i class="el-icon-tickets"></i> éæåº¦ |
| | | </div> |
| | | <div |
| | | class="edit" |
| | | @click="histogram()" |
| | | v-show="shwoHistogram" |
| | | > |
| | | <i class="el-icon-tickets"></i> é»åæ±ç¶å¾ |
| | | </div> |
| | | <div |
| | | class="edit" |
| | | v-show="shwoTileDown" |
| | | @click="tileDownload()" |
| | | > |
| | | <i class="el-icon-download"></i> ç¦çä¸è½½ |
| | | </div> |
| | | <div |
| | | class="edit" |
| | | v-show="shwoAnnex" |
| | | @click="annexDownload()" |
| | | > |
| | | <i class="el-icon-tickets"></i> éä»¶ |
| | | </div> |
| | | </el-card> |
| | | <ul> |
| | | <li @click="addFold"><i class="el-icon-plus"></i>æ·»å ç®å½</li> |
| | | <li @click="addLayer"><i class="el-icon-plus"></i>æ·»å å¾å±</li> |
| | | <li @click="addPosition"> |
| | | <i class="el-icon-location-outline"></i>æ·»å å®ä½ |
| | | </li> |
| | | <li v-if="!isClickParent" @click="editTreeNode"> |
| | | <i class="el-icon-edit"></i>ç¼è¾ |
| | | </li> |
| | | <li @click="openRename"><i class="el-icon-edit"></i>éå½å</li> |
| | | <li @click="deleteTreeNode"><i class="el-icon-delete"></i>å é¤</li> |
| | | </ul> |
| | | </div> |
| | | <!-- </Popup> --> |
| | | <!-- <add-terrain ref="addTerrain" @success="addSceneData" /> --> |
| | | <!-- <add-online-map |
| | | ref="addOnlineMap" |
| | | @success="addOtherData('å½±å', $event)" |
| | | /> --> |
| | | <!-- <add-image ref="addImage" @success="addSceneData" /> --> |
| | | <!-- <add-model ref="addModel" @success="addSceneData" /> --> |
| | | <!-- <add-pathLayer ref="addPathLayer" @success="addSceneData" /> --> |
| | | <!-- <add-wfs ref="addWfs" @success="addSceneData" /> --> |
| | | <!-- <add-vector ref="addVector" @success="addSceneData" /> --> |
| | | <!-- <add-geojson ref="addGeojson" @success="addSceneData" /> --> |
| | | <!-- <add-other ref="addOther" @success="addSceneData" /> --> |
| | | <!-- <get-scene ref="getScene" @success="openScene" /> --> |
| | | <!-- <save-scene ref="saveScene" @success="saveScene" /> --> |
| | | <!-- <select-data ref="select" @success="openThisTypePop" /> --> |
| | | <animationEdit |
| | | ref="animationEdit" |
| | | @success="updateAnimation" |
| | | @setAnimation="setAnimation" |
| | | /> |
| | | <!-- <Video ref="video" @success="addSceneData"></Video> |
| | | <Video3D ref="video3D" @success="addSceneData"></Video3D> --> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import GeoJSON from "ol/format/GeoJSON.js"; |
| | | import queryinfo from "./queryinfo.vue"; |
| | | import { Vector as VectorSource } from "ol/source"; |
| | | import { Vector as VectorLayer } from "ol/layer"; |
| | | import { perms_selectLayers, comprehensive_selectPubById, project_selectDirAll } from "../../api/api.js"; |
| | | import Bus from "@tools/Bus"; |
| | | import axios from "axios"; |
| | | import baseVuex from "./baseVuex"; |
| | | // import Popup from "@tools/Popup.vue"; |
| | | // import AddImage from "./AddImage"; |
| | | // import AddTerrain from "./AddTerrain"; |
| | | // import AddModel from "./AddModel"; |
| | | // import AddPathLayer from "./AddPathLayer"; |
| | | // import AddWfs from "./AddWfs"; |
| | | // import AddVector from "./AddVector"; |
| | | // import AddGeojson from "./AddGeojson"; |
| | | // import AddOther from "./AddOther"; |
| | | // import SelectData from "./SelectData"; |
| | | import animationEdit from "../../components/demoAnimation/animationEdit.vue"; |
| | | |
| | | // import AddOnlineMap from "./AddOnlineMap.vue"; |
| | | // import GetScene from "./GetScene.vue"; |
| | | // import SaveScene from "./SaveScene.vue"; |
| | | // import Video from "@c/object/Video.vue"; |
| | | // import Video3D from "@c/object/Video3D.vue"; |
| | | // å·¥ç¨æ å·¥å
· |
| | | let _treeTool; |
| | | export default { |
| | | name: "tree", |
| | | components: { queryinfo }, |
| | | name: "Layer", |
| | | components: { |
| | | // Popup, |
| | | // AddImage, |
| | | // AddTerrain, |
| | | // AddWfs, |
| | | // AddVector, |
| | | // AddGeojson, |
| | | // AddModel, |
| | | // AddPathLayer, |
| | | // AddOther, |
| | | // SelectData, |
| | | animationEdit, |
| | | // AddOnlineMap, |
| | | // GetScene, |
| | | // SaveScene, |
| | | // Video, |
| | | // Video3D, |
| | | }, |
| | | mixins: [baseVuex], |
| | | data() { |
| | | return { |
| | | isBusy: false, // æ£å¿ |
| | | lastPrjCode: "", // æå鿩项ç®ç¼ç |
| | | showProp: false, // 屿§ |
| | | shwoHistogram: false, // é»åæ±ç¶å¾ |
| | | showLocal: false, // å®ä½ |
| | | showOpacity: false, // ä¸éæåº¦ |
| | | shwoTileDown: false, // ç¦çä¸è½½ |
| | | menuVisible: false, // èå |
| | | shwoAnnex: false,//éä»¶ |
| | | levelArray: [ // é«ç¨æ°ç» |
| | | 0, 40000000, 20000000, 10000000, 5000000, 2000000, 1000000, 500000, |
| | | 250000, 200000, 100000, 50000, 17000, 9000, 5000, 2000, 1000, 500, 200, |
| | | 100, 50, 25, 10, 0, |
| | | ], |
| | | filterText: "", // å
³é®åè¿æ»¤ |
| | | currentData: "", // å½åæ°æ® |
| | | currentNode: "", // å½åèç¹ |
| | | rightClickMenuStyle: {}, // å³é®èåæ ·å¼ |
| | | handleTreeCheck: [], // é»è®¤éä¸é® |
| | | layerId: [ |
| | | "m_pipeline", |
| | | "th_strategic_channel", |
| | | "bs_project", |
| | | "m_sitepoint", |
| | | ], |
| | | treeData: [], // æ æ°æ® |
| | | sourceData: [], // æºæ°æ® |
| | | defaultProps: { // é»è®¤å±æ§å¼ |
| | | children: "children", |
| | | label: "cnName", |
| | | }, |
| | | mptLayer: [], // Mptå¾å± |
| | | menus: [] // èå项 |
| | | title: "å¾å±ç®¡ç", |
| | | left: "10px", |
| | | top: "10px", |
| | | maxHeight: "500px", |
| | | defaultCheck: [], |
| | | defaultExpanded: [], |
| | | selectNode: undefined, |
| | | rightClickMenuDisplay: false, |
| | | rightClickMenuStyle: {}, |
| | | isClickParent: false, |
| | | isNewFold: false, |
| | | newFoldName: undefined, |
| | | serverURL: "http://192.168.109.128:8080", |
| | | }; |
| | | }, |
| | | watch: { |
| | | filterText(val) { |
| | | this.$refs.tree.filter(val); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.getMenus(); |
| | | this.$bus.$on("treeDataCopy", (res) => { |
| | | this.$store.state.treeData = this.treeData; |
| | | this.$store.state.checkedKeys = this.$refs.tree.getCheckedKeys(); |
| | | }); |
| | | if (this.$store.state.showAllLayers) { |
| | | this.layersStart(); |
| | | this.$store.state.showAllLayers = false; |
| | | // è·åæ¬å°é
ç½®æä»¶ |
| | | if (this.$route.query.hasOwnProperty("layer")) { |
| | | axios |
| | | .get(`./layer/${this.$route.query.layer || "layer"}.json`) |
| | | .then((data) => { |
| | | data.name && sessionStorage.setItem("SmartEarthTitle", data.name); |
| | | document.title = sessionStorage.getItem("SmartEarthTitle"); |
| | | |
| | | this.setTreeData([]); |
| | | this.initData(data.data); |
| | | }); |
| | | } else if (this.treeData.length) { |
| | | // åå¨ç¼åæ°æ® |
| | | // å è½½åºæ¯æ°æ® |
| | | this.loadDataToScene(); |
| | | } else { |
| | | this.treeData = this.$store.state.treeData; |
| | | this.$refs.tree.setCheckedKeys(this.$store.state.checkedKeys); |
| | | axios.get(`/json/ZHé¾è·¯.json`).then((data) => { |
| | | this.setTreeData([]); |
| | | this.initData(data.data); |
| | | }); |
| | | // é»è®¤æ ç»æ |
| | | // this.setTreeData([ |
| | | // { id: "82A0C3DE", name: "å½±å", children: [] }, |
| | | // { id: "82C3DE", name: "å°å½¢", children: [] }, |
| | | // { id: "4FE10400", name: "模å", children: [] }, |
| | | // { id: "0A51CF71", name: "ç¢é", children: [] }, |
| | | // ]); |
| | | // å è½½åºæ¯æ°æ® |
| | | this.loadDataToScene(); |
| | | } |
| | | // æå¼å¼¹çª |
| | | // this.$refs.layer.open(); |
| | | |
| | | // å®ä¹ä¸è½¬ç«äºä»¶ |
| | | this.initBusEvent(); |
| | | }, |
| | | destroyed() { |
| | | _treeTool = undefined; |
| | | }, |
| | | methods: { |
| | | // è·åèå |
| | | async getMenus() { |
| | | let data = await project_selectDirAll(); |
| | | if (data && data.code == 200) this.menus = data.result; |
| | | close() { |
| | | Bus.$emit("checkTab", "index/add/treeLayer", false); |
| | | }, |
| | | // åå§åå¾å± |
| | | async layersStart() { |
| | | let data = await perms_selectLayers(); |
| | | if (data.code != 200) { |
| | | return this.$message.error("å¾å±å表æ¥è¯¢å¤±è´¥"); |
| | | // å®ä¹ä¸è½¬ç«äºä»¶ |
| | | initBusEvent() { |
| | | Bus.$off("addLayer"); |
| | | Bus.$on("addLayer", (type) => { |
| | | this.selectNode = this.$refs.tree && this.$refs.tree.getCurrentNode(); |
| | | this.openThisTypePop(type); |
| | | }); |
| | | Bus.$off("addServerData"); |
| | | Bus.$on("addServerData", (data) => { |
| | | this.selectNode = this.$refs.tree && this.$refs.tree.getCurrentNode(); |
| | | if (data.openProp) { |
| | | this.openThisTypePop(data.sourceType, undefined, data); |
| | | } else { |
| | | this.addSceneData(data); |
| | | } |
| | | }); |
| | | |
| | | Bus.$off("openLayer"); |
| | | Bus.$on("openLayer", (open = true) => { |
| | | // æå¼å¼¹çª |
| | | // if (open) { |
| | | // this.$refs.layer.open(); |
| | | // } else { |
| | | // this.$refs.layer.close(); |
| | | // } |
| | | }); |
| | | |
| | | Bus.$off("openServerFile"); |
| | | Bus.$on("openServerFile", (open = true) => { |
| | | // æå¼å¼¹çª |
| | | if (open) { |
| | | this.$refs.getScene.open(); |
| | | } else { |
| | | this.$refs.getScene.close(); |
| | | } |
| | | }); |
| | | Bus.$off("saveServerFile"); |
| | | Bus.$on("saveServerFile", (open = true) => { |
| | | // æå¼å¼¹çª |
| | | if (open) { |
| | | this.$refs.saveScene.open(); |
| | | } else { |
| | | this.$refs.saveScene.close(); |
| | | } |
| | | }); |
| | | |
| | | Bus.$off("saveFile"); |
| | | Bus.$on("saveFile", () => { |
| | | // ä¿åæä»¶ |
| | | this.save(); |
| | | }); |
| | | Bus.$off("openFile"); |
| | | Bus.$on("openFile", (file) => { |
| | | // JSON转为æ |
| | | this.loadJsonFromFile(file); |
| | | }); |
| | | Bus.$off("addFile"); |
| | | Bus.$on("addFile", () => { |
| | | this.selectNode = this.$refs.tree && this.$refs.tree.getCurrentNode(); |
| | | // æ·»å æä»¶ |
| | | this.append(this.selectNode); |
| | | }); |
| | | Bus.$off("addOtherData"); |
| | | Bus.$on("addOtherData", (parentName, data) => { |
| | | // æ·»å å
¶ä»æ°æ® |
| | | this.addOtherData(parentName, data); |
| | | }); |
| | | Bus.$off("removeTreeNode"); |
| | | Bus.$on("removeTreeNode", (entity) => { |
| | | // å é¤å
¶ä»æ°æ® |
| | | this.removeTreeNode({ id: entity.id }); |
| | | }); |
| | | Bus.$off("updataTreeNode"); |
| | | Bus.$on("updataTreeNode", (id, data) => { |
| | | // æ´æ°å
¶ä»æ°æ® |
| | | this.updataTreeNode({ |
| | | id: id, |
| | | nodeValue: data, |
| | | }); |
| | | }); |
| | | Bus.$off("clearFirstParentNode"); |
| | | Bus.$on("clearFirstParentNode", (parentName) => { |
| | | // æ¸
餿æå¯¹è±¡ |
| | | this.clearFirstParentNode(parentName); |
| | | }); |
| | | |
| | | Bus.$off("editDemoAnimation"); |
| | | Bus.$on("editDemoAnimation", () => { |
| | | this.editDemoAnimation(); |
| | | }); |
| | | }, |
| | | // 读åjsonæä»¶æ°æ® |
| | | loadJsonFromFile(file) { |
| | | let reader = new FileReader(); |
| | | reader.onload = (e) => { |
| | | let data = JSON.parse(e.target.result); |
| | | this.initData(data); |
| | | debugger; |
| | | window.localStorage.setItem("pathAnimation", data.pathAnimation); |
| | | }; |
| | | reader.readAsText(file.raw); |
| | | }, |
| | | // åå§åæ°æ® |
| | | initData(data) { |
| | | if (this.treeData.length) { |
| | | this.removeChildData(this.treeData); |
| | | } |
| | | |
| | | let checkKey = [], checkedLayers = []; |
| | | let layers = data.result.filter((lyr) => { |
| | | if (lyr.url && lyr.type == 2 && lyr.isShow == 1) { |
| | | checkKey.push(lyr.id); |
| | | if (lyr.serveType == "WMS") checkedLayers.push(lyr); |
| | | data.name && sessionStorage.setItem("SmartEarthTitle", data.name); |
| | | // è®¾ç½®å·¥ç¨æ æ°æ® |
| | | this.setTreeData(data.children); |
| | | // åå§å®ä½ |
| | | if (data.flyTo) { |
| | | this.setView(data.flyTo); |
| | | } |
| | | // å è½½åºæ¯æ°æ® |
| | | this.loadDataToScene(); |
| | | }, |
| | | // å è½½æ°æ®å°åºæ¯ |
| | | loadDataToScene() { |
| | | if (window.sgworld) { |
| | | // å·¥ç¨æ å·¥å
· |
| | | _treeTool = new window.TreeTool(window.sgworld); |
| | | window.sgworld._treeTool = _treeTool; |
| | | if (this.$refs.tree) { |
| | | this.defaultCheck = []; |
| | | this.defaultExpanded = []; |
| | | // éåèç¹ |
| | | this.ergodicNode({ children: this.treeData }); |
| | | } |
| | | return lyr; |
| | | }); |
| | | // åå¨éä¸å¾å± |
| | | this.treeData = this.setTreeData(layers); |
| | | this.sourceData = JSON.parse(JSON.stringify(this.treeData)); |
| | | this.$refs.tree.setCheckedKeys(checkKey); |
| | | sessionStorage.setItem("checkedLayers", JSON.stringify(checkedLayers)); |
| | | }, |
| | | // è®¾ç½®æ æ°æ® |
| | | setTreeData(source) { |
| | | /*let cloneData = JSON.parse(JSON.stringify(source)); // å¯¹æºæ°æ®æ·±åº¦å
é |
| | | return cloneData.filter((father) => { |
| | | // å¾ªç¯ææé¡¹ |
| | | let branchArr = cloneData.filter((child) => father.id == child.pid); // 对æ¯IDï¼åå«ä¸ä¸çº§èåï¼å¹¶è¿åæ°æ® |
| | | branchArr.length > 0 ? (father.children = branchArr) : ""; // ç»ç¶çº§æ·»å ä¸ä¸ªchildren屿§ï¼å¹¶èµå¼ |
| | | // å±äºåä¸å¯¹è±¡é®é¢ï¼ä¾å¦ï¼ä»¤ a=bãc=1 ï¼ç¶åå令 b.c=c ï¼é£ä¹ a.c=b.c=c=1 ï¼åçï¼åç»ä»¤ c.d=2 ,é£ä¹ a.c.d 乿¯=2ï¼ |
| | | return father.pid == 0; // è¿åä¸çº§èå |
| | | });*/ |
| | | |
| | | let arr = []; |
| | | let data = JSON.parse(JSON.stringify(source)); |
| | | this.setTreeChildData(data, arr, 0); |
| | | |
| | | return arr; |
| | | }, |
| | | // 设置æ åèç¹æ°æ® |
| | | setTreeChildData(data, arr, pid) { |
| | | let i = 0; |
| | | while (i < data.length) { |
| | | let d = data[i]; |
| | | if (d.pid == pid) { |
| | | arr.push(d); |
| | | data.splice(i, 1); |
| | | continue; |
| | | // åå§å®ä½ |
| | | if (this.viewCenter.length) { |
| | | this.flyTo({ |
| | | flyTo: this.viewCenter, |
| | | }); |
| | | } |
| | | |
| | | i++; |
| | | } |
| | | |
| | | arr.sort(function (a, b) { |
| | | return a.orderNum - b.orderNum; |
| | | }); |
| | | |
| | | for (let i in arr) { |
| | | let children = []; |
| | | this.setTreeChildData(data, children, arr[i].id); |
| | | if (children.length) arr[i].children = children; |
| | | document.title = |
| | | sessionStorage.getItem("SmartEarthTitle") || "SmartEarth"; |
| | | } else { |
| | | setTimeout(() => { |
| | | this.loadDataToScene(); |
| | | }, 500); |
| | | } |
| | | }, |
| | | // èç¹è·å¾ç¦ç¹äºä»¶ |
| | | nodeBlur(node, data) { |
| | | if (!data.label.length) return this.$message.error("èååä¸å¯ä¸ºç©ºï¼"); |
| | | if (data.isEdit) this.$set(data, "isEdit", false); |
| | | this.$nextTick(() => { |
| | | this.$refs["slotTreeInput" + data.id].$refs.input.focus(); |
| | | // éåèç¹ |
| | | ergodicNode(node, addData = true) { |
| | | node.rename = false; |
| | | if (node.expanded) { |
| | | this.defaultExpanded.push(node.id); |
| | | } |
| | | if ( |
| | | node.checked && |
| | | (!node.children || (node.children && !node.children.length)) |
| | | ) { |
| | | this.defaultCheck.push(node.id); |
| | | if (addData && node._children) { |
| | | node._children.forEach((item) => { |
| | | _treeTool.addData(item); |
| | | }); |
| | | } else { |
| | | addData && _treeTool.addData(node); |
| | | } |
| | | } |
| | | if (node.children && node.children.length) { |
| | | node.children.forEach((item) => { |
| | | this.ergodicNode(item, addData); |
| | | }); |
| | | } |
| | | }, |
| | | // æ´æ°èç¹å±å¼ç¶æ |
| | | changeNodeExpand(data, expanded) { |
| | | this.updataTreeNode({ |
| | | id: data.id, |
| | | key: "expanded", |
| | | value: expanded, |
| | | }); |
| | | }, |
| | | // é¼ æ å·¦å»äºä»¶ |
| | | handleLeftclick(data, node) { |
| | | this.rmListener(); |
| | | }, |
| | | // åæ¶é¼ æ çå¬äºä»¶ |
| | | rmListener() { |
| | | this.menuVisible = false; |
| | | // è¦åæ¶å
³æçå¬ï¼ä¸å
³æçæ¯ä¸ä¸ªåï¼ä¸ä¿¡ä½ è¯è¯ï¼è½ç¶åå°æ¾ç¤ºçæ¶å没æå¥æ¯ç
ï¼å ä¸ä¸ªalertä½ å°±ç¥éäº |
| | | document.removeEventListener("click", this.rmListener); |
| | | }, |
| | | // è¿æ»¤èç¹ |
| | | filterNode(value, data) { |
| | | if (!value) return true; |
| | | return data.cnName.indexOf(value) !== -1; |
| | | }, |
| | | // é¼ æ å³å»äºä»¶ |
| | | rightClick(event, object, node, element) { |
| | | if (object.type == 1 || node.data.children != null) return; |
| | | // å¾é |
| | | check(treeNode, data) { |
| | | let isCheck = data.checkedKeys.indexOf(treeNode.id) > -1; |
| | | // å¾éèç¹ |
| | | this.checkTreeNode({ id: treeNode.id, checked: isCheck }); |
| | | // æ´æ°åºæ¯æ°æ® |
| | | _treeTool.checkNode(treeNode, isCheck); |
| | | |
| | | this.currentNode = node; |
| | | this.currentData = object; |
| | | this.$store.state.propertiesName = object; |
| | | |
| | | this.showProp = object.serveType == "WMS"; // 屿§ |
| | | this.shwoHistogram = this.showProp && object.enName == "s_explorationpoint"; // é»åæ±ç¶å¾ |
| | | this.showLocal = ["Tileset", "3DML", "Mpt", "TMS", "DOM", "DEM"].indexOf(object.serveType) > -1; // å®ä½ |
| | | this.showOpacity = ["Tileset", "3DML"].indexOf(object.serveType) > -1; // ä¸éæåº¦ |
| | | this.shwoTileDown = ["TMS", "DOM"].indexOf(object.serveType) > -1 && object.pubid; // ç¦çä¸è½½ |
| | | this.menuVisible = this.showProp || this.shwoHistogram || this.showLocal || this.showOpacity || this.shwoTileDown; // èå |
| | | this.shwoAnnex = ['DEM', 'TMS'].indexOf(object.serveType) > -1;//éä»¶ |
| | | this.$refs.card.$el.style.left = event.pageX + 20 + "px"; |
| | | this.$refs.card.$el.style.top = event.pageY + "px"; |
| | | // åªè½åæ¶å è½½ä¸ä¸ªå°å½¢ |
| | | if ( |
| | | isCheck && |
| | | treeNode.sourceType && |
| | | treeNode.sourceType.indexOf("terrain") > -1 |
| | | ) { |
| | | let index = data.checkedNodes.findIndex((item) => { |
| | | return ( |
| | | item.sourceType && |
| | | item.sourceType.indexOf("terrain") > -1 && |
| | | item.id !== treeNode.id |
| | | ); |
| | | }); |
| | | if (index > -1) { |
| | | // åæ¶å¾é |
| | | this.$refs.tree.setChecked(data.checkedNodes[index].id, false); |
| | | this.checkTreeNode({ |
| | | id: data.checkedNodes[index].id, |
| | | checked: false, |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | // 屿§æ¾ç¤º |
| | | showLayerAttribute(data) { |
| | | this.rmListener(); |
| | | this.currentData = data ? data : this.currentData; |
| | | let layer = this.currentData.enName.replaceAll("_", ""); |
| | | this.$store.state.mapSpaceQueryLayer = layer; |
| | | this.$store.state.showPopBoxFlag = true; |
| | | this.$store.state.mapPopBoxFlag = "2"; |
| | | // æ·»å èç¹|æä»¶å¤¹ |
| | | append(data) { |
| | | this.$confirm("è¯·éæ©æ·»å ç±»å", "æç¤º", { |
| | | confirmButtonText: "æ°æ®", |
| | | cancelButtonText: "æä»¶å¤¹", |
| | | distinguishCancelAndClose: true, |
| | | closeOnClickModal: false, |
| | | }) |
| | | .then(() => { |
| | | // éæ©æ°æ® |
| | | this.selectData(data); |
| | | }) |
| | | .catch((action) => { |
| | | // æ·»å æä»¶å¤¹ |
| | | if (action === "cancel") { |
| | | this.addFolder(data); |
| | | } |
| | | }); |
| | | }, |
| | | // æ·»å æä»¶å¤¹ |
| | | addFolder(data) { |
| | | this.$prompt("请è¾å
¥æä»¶å¤¹åç§°", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | inputValue: "æ°å»ºæä»¶å¤¹", |
| | | closeOnClickModal: false, |
| | | }) |
| | | .then(({ value }) => { |
| | | let newChild = { |
| | | id: window.sgworld.Core.getuid(), |
| | | name: value, |
| | | rename: false, |
| | | children: [], |
| | | }; |
| | | this.addData(data, newChild); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | // éæ©æ°æ® |
| | | selectData(data) { |
| | | this.selectNode = data; |
| | | this.$refs.select.open(); |
| | | }, |
| | | // æå¼å¯¹äºç±»åçå¼¹çª |
| | | openThisTypePop(type, editData, defaultData) { |
| | | switch (type) { |
| | | case "wms": |
| | | case "wmts": |
| | | case "tdmap": |
| | | case "txmap": |
| | | case "gdmap": |
| | | case "bdmap": |
| | | case "local-map": |
| | | case "arcgis": |
| | | this.$refs.addImage.open(type, editData, defaultData); |
| | | break; |
| | | case "onlineMap": |
| | | this.$refs.addOnlineMap.open(type, editData, defaultData); |
| | | break; |
| | | case "terrain": |
| | | case "sgsterrain": |
| | | case "arcgisterrain": |
| | | this.$refs.addTerrain.open(type, editData, defaultData); |
| | | break; |
| | | case "CesiumGlobeTerrain": |
| | | this.addSceneData({ |
| | | id: window.sgworld.Core.getuid(), |
| | | name: "CesiumIonå
¨çå°å½¢", |
| | | sourceType: "CesiumGlobeTerrain", |
| | | }); |
| | | break; |
| | | case "b3dm": |
| | | case "gltf": |
| | | this.$refs.addModel.open(type, editData, defaultData); |
| | | break; |
| | | case "s3m": |
| | | this.$refs.addModel.open(type, editData, defaultData); |
| | | break; |
| | | case "kml": |
| | | this.$refs.addOther.open(type, editData, defaultData); |
| | | break; |
| | | case "wfs": |
| | | this.$refs.addWfs.open(type, editData, defaultData); |
| | | break; |
| | | case "vector": |
| | | this.$refs.addVector.open(type, editData, defaultData); |
| | | break; |
| | | case "geojson": |
| | | this.$refs.addGeojson.open(type, editData, defaultData); |
| | | break; |
| | | case "pathLayer": |
| | | this.$refs.addPathLayer.open(type, editData, defaultData); |
| | | break; |
| | | case "videoBox": |
| | | this.$refs.video.open(type, editData, defaultData); |
| | | break; |
| | | case "video3D": |
| | | this.$refs.video3D.open(type, editData, defaultData); |
| | | break; |
| | | } |
| | | }, |
| | | openScene(filedata) { |
| | | //http://localhost/iisweb/%E5%B7%A5%E7%A8%8B%E5%90%8D%E7%A7%B0.json |
| | | //"../upload/" + filedata.name + ".json" |
| | | axios |
| | | .get("../upload/" + filedata.name + ".json") |
| | | .then((data) => { |
| | | let json = data.data; |
| | | this.initData(json); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | saveScene(data) { |
| | | let fileName = data.name; |
| | | fileName = fileName + ".json"; |
| | | let layerdata = { |
| | | name: document.title, |
| | | id: 1, |
| | | open: true, |
| | | children: this.treeData, |
| | | flyTo: this.viewCenter, |
| | | }; |
| | | let content = JSON.stringify(layerdata); |
| | | let fData = new FormData(); |
| | | fData.append("json", content); |
| | | fData.append("fileName", fileName); |
| | | //this.serverURL + |
| | | axios |
| | | .post("../FileManager/fmc/saveFile", fData) |
| | | .then((data) => { |
| | | if (data.data == "success") { |
| | | alert("ä¿åæåï¼"); |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | // æ·»å æ°æ®å°åºæ¯ |
| | | addSceneData(data, isEdit) { |
| | | if (isEdit) { |
| | | this.updataTreeNode({ |
| | | id: data.id, |
| | | nodeValue: data, |
| | | }); |
| | | return; |
| | | } |
| | | data.checked = true; |
| | | // æ·»å èç¹ |
| | | this.addData(this.selectNode, data); |
| | | // æ·»å æ°æ®å°åºæ¯ |
| | | if (!_treeTool) { |
| | | // å·¥ç¨æ å·¥å
· |
| | | _treeTool = new window.TreeTool(window.sgworld); |
| | | window.sgworld._treeTool = _treeTool; |
| | | } |
| | | _treeTool.addData(data); |
| | | this.selectNode = undefined; |
| | | }, |
| | | // æ·»å æ èç¹ |
| | | addData(data, value) { |
| | | !value.rename && (value.rename = false); |
| | | this.addTreeChildren({ pid: data && data.id, item: value }); |
| | | this.expandedNode(data); |
| | | |
| | | value.checked && |
| | | this.$nextTick(() => { |
| | | this.$refs.tree.setChecked(value, true); |
| | | }); |
| | | }, |
| | | // æ ¹æ®ååè·åç¶èç¹ |
| | | getParentNodeByName(name) { |
| | | let index = this.treeData.findIndex((item) => { |
| | | return item.name === name; |
| | | }); |
| | | return this.treeData[index]; |
| | | }, |
| | | // æ·»å å
¶ä»æ°æ® |
| | | addOtherData(parentName, data) { |
| | | let parentNode = this.getParentNodeByName(parentName); |
| | | data.checked = true; |
| | | |
| | | if (!parentNode) { |
| | | parentNode = { |
| | | id: window.sgworld.Core.getuid(), |
| | | name: parentName, |
| | | children: [], |
| | | }; |
| | | this.addData(undefined, parentNode); |
| | | this.$nextTick(() => { |
| | | this.addData(parentNode, { ...data, item: undefined }); |
| | | _treeTool.treeData && _treeTool.treeData.set(data.id, data); |
| | | }); |
| | | } else { |
| | | this.addData(parentNode, { ...data, item: undefined }); |
| | | _treeTool.treeData && _treeTool.treeData.set(data.id, data); |
| | | } |
| | | }, |
| | | // æ·»å æ¼ç¤ºå¨ç» |
| | | editDemoAnimation() { |
| | | this.$prompt("请è¾å
¥æ¼ç¤ºå¨ç»åç§°", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | inputValue: "æ°å»ºæ¼ç¤ºå¨ç»", |
| | | closeOnClickModal: false, |
| | | }) |
| | | .then(({ value }) => { |
| | | let id = window.sgworld.Core.getuid(); |
| | | let data = { |
| | | id, |
| | | name: value, |
| | | sourceType: "demoAnimation", |
| | | animationDatas: [], |
| | | }; |
| | | this.addOtherData("æ¼ç¤ºå¨ç»", data); |
| | | this.$refs.animationEdit.open(id); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | //æ´æ°å¨ç» |
| | | updateAnimation(id, data) { |
| | | this.updataTreeNode({ |
| | | id: id, |
| | | key: "animationDatas", |
| | | value: data, |
| | | }); |
| | | }, |
| | | // 设置å¨ç»æ°æ® |
| | | setAnimation(keys, isCheck) { |
| | | if (keys) { |
| | | keys.forEach((element) => { |
| | | let treeNode = this.$refs.tree.getNode(element); |
| | | // å¾éèç¹ |
| | | this.checkTreeNode({ id: element, checked: isCheck }); |
| | | // æ´æ°åºæ¯æ°æ® |
| | | _treeTool.checkNode(treeNode.data, isCheck); |
| | | this.$refs.tree.setChecked(element, isCheck); |
| | | }); |
| | | } |
| | | }, |
| | | // å®ä½ |
| | | async positioning() { |
| | | this.rmListener(); |
| | | |
| | | if (["Tileset", "3DML"].indexOf(this.currentData.serveType) > -1) { |
| | | for (let i in Viewer.scene.primitives._primitives) { |
| | | if (Viewer.scene.primitives._primitives[i].id == this.currentData.cnName) { |
| | | Viewer.flyTo(Viewer.scene.primitives._primitives[i]); |
| | | break; |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | |
| | | if (["TMS", "DOM", "DEM"].indexOf(this.currentData.serveType) > -1 && this.currentData.pubid) { |
| | | let data = await comprehensive_selectPubById({ id: this.currentData.pubid }); |
| | | if (data.result && data.result.geom) { |
| | | let wkt = this.$wkt.parse(data.result.geom); |
| | | let height = this.getHeight(wkt.coordinates[2]); |
| | | Viewer.camera.flyTo({ |
| | | destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], sceneConfig.extureHeight), // 2000 |
| | | }); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | if ("Mpt" == this.currentData.serveType) { |
| | | if (this.currentData.json) { |
| | | var json = JSON.parse(this.currentData.json); |
| | | if (json.west) { |
| | | Viewer.camera.flyTo({ |
| | | destination: Cesium.Rectangle.fromDegrees(json.west, json.south, json.east, json.north) |
| | | }) |
| | | } |
| | | } else { |
| | | |
| | | Viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(101.8, 37.9, 10000000.0) }); // ä¸å½ |
| | | } |
| | | |
| | | } |
| | | }, |
| | | // é»åæ±ç¶å¾ |
| | | async histogram() { |
| | | this.rmListener(); |
| | | let layer = this.currentData.enName.replaceAll("_", ""); |
| | | this.$store.state.mapSpaceQueryLayer = layer; |
| | | this.$store.state.mapPopBoxFlag = "2"; |
| | | this.$store.state.showPopBoxFlag = true; |
| | | }, |
| | | // éæåº¦ |
| | | pellucidity() { |
| | | this.rmListener(); |
| | | for (let j in Viewer.scene.primitives._primitives) { |
| | | if (Viewer.scene.primitives._primitives[j].id == this.currentData.cnName) { |
| | | this.$store.state.setAlphaDity = this.currentData; |
| | | this.$bus.$emit("showPellucidity", true); |
| | | break; |
| | | } |
| | | } |
| | | }, |
| | | // è·åé«åº¦ |
| | | getHeight(level) { |
| | | if (level > -1 && level < 23) return this.levelArray[level]; |
| | | var res = 7 |
| | | return this.levelArray[res]; |
| | | }, |
| | | //éä»¶ä¸è½½ |
| | | annexDownload() { |
| | | this.$bus.$emit('annexDownload', this.currentData) |
| | | }, |
| | | |
| | | // ç¦çä¸è½½ |
| | | tileDownload() { |
| | | this.rmListener(); |
| | | |
| | | var that = this; |
| | | sgworld.Creator.createSimpleGraphic( |
| | | "rectangle", {}, |
| | | function (entity) { |
| | | that.getTileRectangle(entity); |
| | | sgworld.Creator.SimpleGraphic.clear(); |
| | | } |
| | | ); |
| | | }, |
| | | // è·åç¦çåè³èå´ |
| | | getTileRectangle(res) { |
| | | var value = res.rectangle.coordinates.getValue(); |
| | | var val = { |
| | | pubid: this.currentData.pubid, |
| | | pwd: "", |
| | | title: "", |
| | | xmax: Cesium.Math.toDegrees(value.east), |
| | | xmin: Cesium.Math.toDegrees(value.west), |
| | | ymax: Cesium.Math.toDegrees(value.north), |
| | | ymin: Cesium.Math.toDegrees(value.south) |
| | | } |
| | | this.$bus.$emit("titleDown", val); |
| | | }, |
| | | // å¾å±éä¸äºä»¶ |
| | | handleCheckChange(data, checked) { |
| | | if (this.isBusy) return; |
| | | |
| | | let nodes = []; |
| | | this.getNodes(data, nodes); |
| | | let obj = { WMS: [], Tileset: [], TMS: [], Mpt: [], DEM: [] }; |
| | | |
| | | for (let i = 0, c = nodes.length; i < c; i++) { |
| | | let node = nodes[i]; |
| | | switch (node.serveType) { |
| | | case "WMS": |
| | | obj.WMS.push(node); |
| | | break; |
| | | case "3DML": |
| | | case "Tileset": |
| | | obj.Tileset.push(node); |
| | | break; |
| | | case "TMS": |
| | | obj.TMS.push(node); |
| | | break; |
| | | case "Mpt": |
| | | obj.Mpt.push(node); |
| | | break; |
| | | case "DEM": |
| | | obj.DEM.push(node); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (obj.DEM.length) this.setChangeDEM(obj.DEM, checked); |
| | | if (obj.TMS.length) this.setChangeTMS(obj.TMS, checked); |
| | | if (obj.Mpt.length) this.setChangeMpt(obj.Mpt, checked); |
| | | if (obj.Tileset.length) this.setChangeTileset(obj.Tileset, checked); |
| | | if (obj.WMS.length) this.setChangeWMS(obj.WMS, checked); |
| | | }, |
| | | // è·ååèç¹ |
| | | getNodes(data, arr) { |
| | | if (data.children) { |
| | | for (let i = 0, c = data.children.length; i < c; i++) { |
| | | let node = data.children[i]; |
| | | if (node.children) { |
| | | this.getNodes(node, arr) |
| | | } else { |
| | | arr.push(node); |
| | | } |
| | | } |
| | | flyTo(treeNode) { |
| | | if (treeNode.animationDatas) { |
| | | this.$refs.animationEdit.start(treeNode.animationDatas); |
| | | } else { |
| | | arr.push(data); |
| | | _treeTool.flyTo(treeNode); |
| | | } |
| | | }, |
| | | // è·åèç¹ID |
| | | getCheckNodesIds() { |
| | | let nodes = this.$refs.tree.getCheckedNodes(); |
| | | let ids = []; |
| | | for (let i in nodes) { |
| | | ids.push(nodes[i].id); |
| | | } |
| | | |
| | | return ids; |
| | | select() { |
| | | this.rightClickMenuDisplay = false; |
| | | }, |
| | | // 忢WMSæå¡ |
| | | setChangeWMS(layers, checked) { |
| | | let value = this.$refs.tree.getCheckedNodes(); |
| | | this.$bus.$emit("showMenuLayer", value); |
| | | }, |
| | | // 忢Tileset |
| | | setChangeTileset(layers, checked) { |
| | | let ids = this.getCheckNodesIds(), arr = []; |
| | | for (let k in layers) { |
| | | let layer = layers[k]; |
| | | if (ids.indexOf(layer.id) > -1) { |
| | | arr.push(layer); |
| | | continue; |
| | | // ç§»é¤ |
| | | remove(data) { |
| | | // ç§»é¤èç¹ |
| | | this.removeTreeNode({ id: data.id }); |
| | | if (data.children) { |
| | | this.removeChildData(data.children); |
| | | } else { |
| | | // ç§»é¤åºæ¯æ°æ® |
| | | _treeTool.deleteData(data.id); |
| | | if (data.sourceType === "demoAnimation") { |
| | | Bus.$emit("closeAnimationEdit"); |
| | | } |
| | | |
| | | for (let j in Viewer.scene.primitives._primitives) { |
| | | if (Viewer.scene.primitives._primitives[j].id == layer.cnName) { |
| | | Viewer.scene.primitives.remove(Viewer.scene.primitives._primitives[j]); |
| | | break; |
| | | } |
| | | }, |
| | | removeChildData(nodes) { |
| | | nodes.forEach((item) => { |
| | | if (item.children) { |
| | | this.removeChildData(item.children); |
| | | } else { |
| | | // ç§»é¤åºæ¯æ°æ® |
| | | _treeTool.deleteData(item.id); |
| | | if (item.sourceType === "demoAnimation") { |
| | | Bus.$emit("closeAnimationEdit"); |
| | | } |
| | | } |
| | | |
| | | let list = this.$store.state.setAlphaList; |
| | | for (let i = 0; i < list.length; i++) { |
| | | if (list[i].name == layer.cnName) { |
| | | list.splice(i, 1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (arr.length) this.addTilesetLayers(arr); |
| | | }, |
| | | // æ·»å Tilesetå¾å± |
| | | addTilesetLayers(layers) { |
| | | for (let i in layers) { |
| | | let res = layers[i]; |
| | | let url = res.url.indexOf("{host}") > -1 ? res.url.replace("{host}", iisHost) : modelUrl + "/" + res.url; |
| | | |
| | | let tileset = Viewer.scene.primitives.add( |
| | | new Cesium.Cesium3DTileset({ |
| | | name: res.cnName, |
| | | url: url, |
| | | skipLevelOfDetail: true, // å¨éåæ¶åè·³è¿è¯¦æ
ï¼false |
| | | baseScreenSpaceError: 1024, |
| | | maximumScreenSpaceError: url.indexOf("/pnts/") > -1 ? 16 : 64, // æå¤§å±å¹ç©ºé´é误ï¼16ï¼æ°å¼å 大è½è®©æç»æå忍¡ç³ |
| | | skipScreenSpaceErrorFactor: 16, |
| | | skipLevels: 1, |
| | | immediatelyLoadDesiredLevelOfDetail: false, |
| | | loadSiblings: true, // èªå¨ä»ä¸å¿å¼å§è¶
æ¸
忍¡åï¼false |
| | | cullWithChildrenBounds: true, // 使ç¨å项边çä½ç§¯ç并鿥åé¤å¾åï¼true |
| | | cullRequestsWhileMoving: true, |
| | | cullRequestsWhileMovingMultiplier: 10, // å¼è¶å°è½å¤æ´å¿«çåé¤ï¼60 |
| | | preloadWhenHidden: true, |
| | | preferLeaves: true, // é¢è£
åèç¹ï¼false |
| | | maximumMemoryUsage: 768, // å
ååé
åå°æå©äºå
ååæ¶ï¼æåæ§è½ä½éª |
| | | progressiveResolutionHeightFraction: 0.5, // æ°å¼åäº0è½å¤è®©åå§å è½½å徿¨¡ç³ |
| | | dynamicScreenSpaceErrorDensity: 0.5, // æ°å¼å 大ï¼è½è®©å¨è¾¹å è½½åå¿« |
| | | dynamicScreenSpaceErrorFactor: 2, // 卿å±å¹ç©ºé´è¯¯å·®çç³»æ° |
| | | dynamicScreenSpaceError: true, // åå°ç¦»ç¸æºè¾è¿çå±å¹ç©ºé´é误ï¼falseï¼å
¨å±å è½½å®ä¹åææ¸
æ°åæ¿å± |
| | | }) |
| | | ); |
| | | tileset.readyPromise.then((tileset) => { |
| | | tileset.id = res.cnName; |
| | | tileset.layerId = res.id; |
| | | tileset.pubid = res.pubid; |
| | | |
| | | if (res.serveType != '3DML') { |
| | | // Cesium.Matrix4.equals(a,b) 夿ç©éµæ¯å¦ç¸çï¼æ´ä¸ªæ ¹èç¹æ¨¡åç©éµï¼è¯¥tileSet=>ä¸çåæ ç³»ï¼åä½ç©éµå¯¹è§çº¿å¼ä¸º1.0ç4*4ç©éµ |
| | | if (!Cesium.Matrix4.equals(tileset.root.transform, Cesium.Matrix4.IDENTITY)) { |
| | | // è·å模åçä¸çåæ (ç¬å¡å°)ï¼Cesium.Matrix4.getTranslation éè¿ä»¿å°åæ¢ç©éµè·å该tileSetçä¸çåæ |
| | | const transformCenter = Cesium.Matrix4.getTranslation(tileset.root.transform, new Cesium.Cartesian3()); |
| | | // å°ç¬å¡å°åæ 转æ¢ä¸ºWGS84ç»çº¬åº¦åæ ï¼æ¨¡åçï¼ |
| | | const transformCartographic = Cesium.Cartographic.fromCartesian(transformCenter); |
| | | // å°ç¬å¡å°åæ 转æ¢ä¸ºWGS84ç»çº¬åº¦åæ ï¼æªé¢çï¼ |
| | | const boundingSphereCartographic = Cesium.Cartographic.fromCartesian(tileset.boundingSphere.center); |
| | | const height = boundingSphereCartographic.height - transformCartographic.height; |
| | | // ä»ä¸ä¸ªCartesian3对象çæMatrix4忢ç©éµï¼è£åé¢çï¼ |
| | | window.modelHeight = height; |
| | | } else { |
| | | window.modelHeight = 0; |
| | | } |
| | | this.setTilesetArgs(tileset, res); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | // 忢TMS |
| | | setChangeTMS(layers, checked) { |
| | | let ids = this.getCheckNodesIds(), arr = []; |
| | | for (let j in layers) { |
| | | let layer = layers[j]; |
| | | if (ids.indexOf(layer.id) > -1) { |
| | | arr.push(layer); |
| | | continue; |
| | | } |
| | | |
| | | for (let i = 0; i < window.Viewer.imageryLayers._layers.length; i++) { |
| | | if (window.Viewer.imageryLayers._layers[i].name == layer.cnName) { |
| | | window.Viewer.imageryLayers.remove(window.Viewer.imageryLayers._layers[i]); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (arr.length) this.addTMSLayers(arr); |
| | | }, |
| | | // æ·»å TMSå¾å± |
| | | addTMSLayers(layers) { |
| | | |
| | | for (let i in layers) { |
| | | let res = layers[i]; |
| | | res.url = res.url.indexOf("{host}") > -1 ? res.url.replace("{host}", iisHost) : res.url; |
| | | |
| | | if (res.pubid) { |
| | | this.setTMSLayerByPubid(res); |
| | | continue; |
| | | } |
| | | |
| | | let layer = Viewer.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider({ |
| | | url: res.url, |
| | | maximumLevel: 22, |
| | | enablePickFeatures: false |
| | | }), 1); |
| | | |
| | | layer.id = res.id; |
| | | layer.name = res.cnName; |
| | | if (is_production) { |
| | | Viewer.imageryLayers.raiseToTop(layer);//å°å¾å±ä¸ç§»ä¸å± |
| | | Viewer.imageryLayers.lower(layer);//å°å¾å±ä¸ç§»ä¸å± |
| | | } |
| | | |
| | | } |
| | | }, |
| | | // 忢Mpt |
| | | setChangeMpt(layers, checked) { |
| | | let ids = this.getCheckNodesIds(), arr = []; |
| | | for (let j in layers) { |
| | | let layer = layers[j]; |
| | | if (ids.indexOf(layer.id) != -1) { |
| | | arr.push(layer); |
| | | continue; |
| | | } |
| | | |
| | | for (let i in this.mptLayer) { |
| | | if (this.mptLayer[i].treeobj.name == layer.cnName) { |
| | | this.mptLayer[i].deleteObject(); |
| | | this.mptLayer.splice(i, 1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (arr.length) this.addMptLayers(arr); |
| | | }, |
| | | // æ·»å Mptå¾å± |
| | | addMptLayers(layers) { |
| | | for (let i in layers) { |
| | | let res = layers[i]; |
| | | if (res.url.indexOf("{host}") > -1) res.url = res.url.replace("{host}", iisHost); |
| | | |
| | | let urls = res.url.split(';'); |
| | | var ops = { |
| | | url: urls[0], |
| | | layers: urls[1] |
| | | }; |
| | | if (res && res.json) { |
| | | var rs = JSON.parse(res.json); |
| | | ops.rectangle = Cesium.Rectangle.fromDegrees(rs.west, rs.south, rs.east, rs.north); |
| | | } |
| | | |
| | | let layer = sgworld.Creator.createImageryProvider(res.cnName, "wms", ops, "0", undefined, true, ""); |
| | | this.mptLayer.push(layer); |
| | | } |
| | | }, |
| | | // 忢DEM |
| | | setChangeDEM(layers, checked) { |
| | | let ids = this.getCheckNodesIds(), arr = []; |
| | | for (let i in layers) { |
| | | let layer = layers[i]; |
| | | if (ids.indexOf(layer.id) != -1) { |
| | | arr.push(layer.url); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | let url = arr.length ? arr[arr.length - 1] : null; |
| | | this.addDEMLayers(url, null == url); |
| | | }, |
| | | // æ·»å DEMå¾å± |
| | | addDEMLayers(url, useSG) { |
| | | if (useSG) { |
| | | if (Viewer.terrainProvider._isMPT) return; |
| | | |
| | | let option = { |
| | | url: window.sceneConfig.SGUrl, |
| | | layerName: window.sceneConfig.mptName, |
| | | requestVertexNormals: true |
| | | }; |
| | | sgworld.Creator.sfsterrainprovider("", option, "", true, ""); |
| | | return; |
| | | } |
| | | |
| | | if (url.indexOf("{host}") > -1) url = url.replace("{host}", iisHost); |
| | | Viewer.terrainProvider = new Cesium.CesiumTerrainProvider({ |
| | | url: url, |
| | | requestVertexNormals: true |
| | | }); |
| | | }, |
| | | // 设置Tilesetåæ° |
| | | async setTilesetArgs(tileset, res) { |
| | | if (res.serveType == '3DML' || !res.pubid) { |
| | | this.setTilesetHeigth(tileset, parseFloat(res.elev)); |
| | | return; |
| | | } |
| | | |
| | | const data = await comprehensive_selectPubById({ id: res.pubid }) |
| | | if (data.code == 200 && data.result.json) this.setTilesetCoord(tileset, data.result.json); |
| | | // æ¸
餿æå¯¹è±¡ |
| | | clearFirstParentNode(name) { |
| | | let parentnode = this.getParentNodeByName(name); |
| | | parentnode && this.remove(parentnode); |
| | | }, |
| | | // 设置Tileseté«åº¦ |
| | | setTilesetHeigth(tileset, height) { |
| | | //3dtile模åçè¾¹ççä½ |
| | | let boundingSphere = tileset.boundingSphere; |
| | | //迪å¡å°ç©ºé´ç´è§åæ =>å°çåæ ï¼å¼§åº¦å¶ï¼ |
| | | let cartographic_original = Cesium.Cartographic.fromCartesian(boundingSphere.center); |
| | | //å°çåæ ï¼å¼§åº¦å¶ï¼=>迪å¡å°ç©ºé´ç´è§åæ |
| | | let Cartesian3_original = Cesium.Cartesian3.fromRadians(cartographic_original.longitude, cartographic_original.latitude, cartographic_original.height); |
| | | let Cartesian3_offset = Cesium.Cartesian3.fromRadians(cartographic_original.longitude, cartographic_original.latitude, height); |
| | | //è·å¾å°é¢åoffsetçè½¬æ¢ |
| | | let translation = Cesium.Cartesian3.subtract(Cartesian3_offset, Cartesian3_original, new Cesium.Cartesian3()); |
| | | //ä¿®æ¹æ¨¡åç©éµ |
| | | tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); |
| | | // Viewer.flyTo(tileset); |
| | | // ä¿å |
| | | save() { |
| | | let data = { |
| | | name: document.title, |
| | | id: 1, |
| | | open: true, |
| | | children: this.treeData, |
| | | flyTo: this.viewCenter, |
| | | pathAnimation: window.localStorage.getItem("pathAnimation"), |
| | | }; |
| | | let content = JSON.stringify(data); |
| | | let blob = new Blob([content], { type: "" }); |
| | | var reader = new FileReader(); |
| | | reader.onloadend = () => { |
| | | let url = reader.result; |
| | | let triggerDownload = document.createElement("a"); |
| | | triggerDownload.download = (document.title || "layers") + ".json"; |
| | | triggerDownload.href = url; |
| | | triggerDownload.click(); |
| | | }; |
| | | reader.readAsDataURL(blob); |
| | | }, |
| | | // 设置Tilesetåæ |
| | | setTilesetCoord(tileset, json) { |
| | | let vm = JSON.parse(json); |
| | | let pos = Cesium.Cartesian3.fromDegrees(vm.lon, vm.lat, vm.height); |
| | | let converter = Cesium.Transforms.eastNorthUpToFixedFrame; |
| | | let hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(vm.yaw), 0, 0); |
| | | let matrix = Cesium.Transforms.headingPitchRollToFixedFrame(pos, hpr, Cesium.Ellipsoid.WGS84, converter); |
| | | tileset._root.transform = matrix; |
| | | // Viewer.flyTo(tileset); |
| | | // å³é®èåå
ç´ |
| | | rightClick(e, data, node, comp) { |
| | | this.isClickParent = !!data.children; |
| | | this.selectNode = data; |
| | | this.rightClickMenuStyle = { top: e.pageY + "px", left: e.pageX + "px" }; |
| | | this.rightClickMenuDisplay = true; |
| | | document.onclick = () => { |
| | | this.rightClickMenuDisplay = false; |
| | | document.onclick = undefined; |
| | | }; |
| | | }, |
| | | // æ ¹æ®Pubid设置TMSå¾å± |
| | | async setTMSLayerByPubid(res) { |
| | | const data = await comprehensive_selectPubById({ id: res.pubid }); |
| | | if (!data || data.code != 200) return; |
| | | |
| | | let provider = data.result.max > 0 ? |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: res.url, |
| | | minimumLevel: data.result.min, |
| | | maximumLevel: data.result.max, |
| | | enablePickFeatures: false |
| | | }) : |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: res.url, |
| | | minimumLevel: data.result.min, |
| | | enablePickFeatures: false |
| | | }); |
| | | |
| | | let layer = Viewer.imageryLayers.addImageryProvider(provider, 1); |
| | | layer.name = res.cnName; |
| | | |
| | | if (is_production) { |
| | | Viewer.imageryLayers.raiseToTop(layer);//å°å¾å±ä¸ç§»ä¸å± |
| | | Viewer.imageryLayers.lower(layer);//å°å¾å±ä¸ç§»ä¸å± |
| | | } |
| | | // if (data.result.geom) { |
| | | // let wkt = this.$wkt.parse(data.result.geom); |
| | | // Viewer.camera.flyTo({ |
| | | // destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], 2000) |
| | | // }); |
| | | // } |
| | | appendTreeNode() { |
| | | this.append(this.selectNode); |
| | | }, |
| | | // åæ¢é¡¹ç® |
| | | prjChanged(code) { |
| | | |
| | | this.$store.state.pigCode = code; |
| | | |
| | | //if (code) { |
| | | this.isBusy = true; |
| | | let checkedLayers = this.getCheckedLayersByCode(code); |
| | | |
| | | let checkedKeys = []; |
| | | for (let i in checkedLayers) { |
| | | checkedKeys.push(checkedLayers[i].id); |
| | | } |
| | | |
| | | this.treeData = this.getNewTreeData(code); |
| | | this.$store.state.treeData = this.treeData; |
| | | this.$refs.tree.setCheckedKeys(checkedKeys); |
| | | sessionStorage.setItem("checkedLayers", JSON.stringify(checkedLayers)); |
| | | this.isBusy = false; |
| | | //} |
| | | |
| | | for (let i = 0, c = this.treeData.length; i < c; i++) { |
| | | this.handleCheckChange(this.treeData[i], true); |
| | | } |
| | | // å³é®å 餿é®ç¹å»äºä»¶ |
| | | deleteTreeNode() { |
| | | this.remove(this.selectNode); |
| | | this.$refs.tree && this.$refs.tree.setCurrentKey(null); |
| | | this.selectNode = undefined; |
| | | }, |
| | | // æ ¹æ®é¡¹ç®ç¼ç è·åéä¸å¾å± |
| | | getCheckedLayersByCode(code) { |
| | | let layers = []; |
| | | for (let i = 0, c = this.treeData.length; i < c; i++) { |
| | | this.getCheckedChildLayersByCode(this.treeData[i], code, layers, false); |
| | | } |
| | | |
| | | return layers; |
| | | }, |
| | | // æ ¹æ®é¡¹ç®ç¼ç è·åéä¸åå¾å± |
| | | getCheckedChildLayersByCode(data, code, layers, isPrj) { |
| | | if (data.children && data.children.length) { |
| | | for (let i = 0, c = data.children.length; i < c; i++) { |
| | | let layer = data.children[i]; |
| | | if (layer.children && layer.children.length) { |
| | | let flag = layer.type == 1 && layer.isProject && layer.enName == code; |
| | | this.getCheckedChildLayersByCode(layer, code, layers, flag); |
| | | continue; |
| | | } |
| | | |
| | | //if (layer.type == 2 && (layer.isProject || isPrj)) { |
| | | // layers.push(layer); |
| | | //} |
| | | if (code) { |
| | | if (layer.type == 2 && (layer.isProject || isPrj)) layers.push(layer); |
| | | } else { |
| | | if (layer.isShow) layers.push(layer); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | |
| | | if (data.type == 2 && (data.isProject || isPrj)) { |
| | | layers.push(data); |
| | | } |
| | | }, |
| | | // è·åæ°æ æ°æ® |
| | | getNewTreeData(code) { |
| | | let data = JSON.parse(JSON.stringify(this.sourceData)); |
| | | if (!code) return data; |
| | | |
| | | this.setSubTreeData(data, code); |
| | | this.rmPrjTreeData(data, code); |
| | | |
| | | return data; |
| | | }, |
| | | // è®¾ç½®æ æ°æ®åèç¹ |
| | | setSubTreeData(data, code) { |
| | | let j = 0; |
| | | while (j < data.length) { |
| | | let d = data[j]; |
| | | if (d.type == 1 && d.isProject && d.enName != code) { |
| | | data.splice(j, 1); |
| | | continue; |
| | | } |
| | | |
| | | j++; |
| | | } |
| | | |
| | | for (let i = 0, c = data.length; i < c; i++) { |
| | | if (data[i].children && data[i].children.length) { |
| | | this.setSubTreeData(data[i].children, code); |
| | | // å³é®ç¼è¾æé®ç¼è¾æ èç¹ |
| | | editTreeNode() { |
| | | debugger; |
| | | if (this.selectNode) { |
| | | if (this.selectNode.sourceType === "SimpleGraphic") { |
| | | let entity = window.Viewer.entities.getById(this.selectNode.id); |
| | | sgworld.Creator.SimpleGraphic.openEditProp(entity); |
| | | } else if (this.selectNode.sourceType === "MilitaryPlotting") { |
| | | let entity = window.Viewer.entities.getById(this.selectNode.id); |
| | | sgworld.Creator.MilitaryPlotting.openEditProp(entity); |
| | | } else if (this.selectNode.sourceType === "demoAnimation") { |
| | | this.$refs.animationEdit.open( |
| | | this.selectNode.id, |
| | | this.selectNode.animationDatas |
| | | ); |
| | | } else { |
| | | this.openThisTypePop(this.selectNode.sourceType, this.selectNode); |
| | | } |
| | | } |
| | | }, |
| | | // ç§»é¤é¡¹ç®æ æ°æ® |
| | | rmPrjTreeData(data, code) { |
| | | /*let j = 0; |
| | | while (j < data.length) { |
| | | let d = data[j]; |
| | | if (d.type == 1 && d.isProject && d.enName == code) { |
| | | data.splice(j, 1); |
| | | data.concat(d.children); |
| | | continue; |
| | | } |
| | | |
| | | j++; |
| | | } |
| | | |
| | | for (let i = 0, c = data.length; i < c; i++) { |
| | | if (data[i].children && data[i].children.length) { |
| | | this.rmPrjTreeData(data[i].children, code); |
| | | } |
| | | }*/ |
| | | |
| | | let i = 0; |
| | | while (i < data.length) { |
| | | let d = data[i]; |
| | | if (!d.children) { |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!d.children.length) { |
| | | data.splice(i, 1); |
| | | continue; |
| | | } |
| | | |
| | | let j = 0; |
| | | while (j < d.children.length) { |
| | | let e = d.children[j]; |
| | | if (e.type == 1 && e.isProject && e.enName == code) { |
| | | d.children.splice(j, 1); |
| | | if (e.children && e.children.length) d.children = d.children.concat(e.children); |
| | | continue; |
| | | } |
| | | |
| | | j++; |
| | | } |
| | | |
| | | i++; |
| | | } |
| | | |
| | | for (let i = 0, c = data.length; i < c; i++) { |
| | | if (data[i].children && data[i].children.length) { |
| | | this.rmPrjTreeData(data[i].children, code); |
| | | } |
| | | } |
| | | // æ·»å ç®å½ |
| | | addFold() { |
| | | let newChild = { |
| | | id: window.sgworld.Core.getuid(), |
| | | name: "æ°å»ºç®å½", |
| | | children: [], |
| | | rename: true, |
| | | }; |
| | | this.addData(this.selectNode, newChild); |
| | | }, |
| | | // æ·»å WFSå¾å± * |
| | | addWFSLayers(res) { |
| | | let url = |
| | | res.resource + |
| | | "?service=WFS&version=1.0.0&request=GetFeature&typeName=" + |
| | | res.url + |
| | | "&outputFormat=application%2Fjson"; |
| | | $.ajax({ |
| | | url: url, |
| | | cache: false, |
| | | async: true, |
| | | success: function (data) { |
| | | let datasource = Cesium.GeoJsonDataSource.load(data, { |
| | | stroke: Cesium.Color.YELLOW, |
| | | fill: Cesium.Color.YELLOW.withAlpha(0.1), |
| | | alpha: 0.1, |
| | | strokeWidth: 8, |
| | | clampToGround: true, //æ¯å¦è´´å° |
| | | // æ·»å å®ä½ç¹ |
| | | addPosition() { |
| | | let degrees = sgworld.Navigate.getDegrees(); //ç»çº¬åº¦ |
| | | let heading = Cesium.Math.toDegrees(Viewer.camera.heading); //æ°´å¹³è§ |
| | | let pitch = Cesium.Math.toDegrees(Viewer.camera.pitch); //俯仰è§åº¦ |
| | | let newChild = { |
| | | id: window.sgworld.Core.getuid(), |
| | | name: "å
´è¶£ç¹", |
| | | sourceType: "location", |
| | | checked: true, |
| | | rename: true, |
| | | disabled: true, |
| | | flyTo: [ |
| | | degrees.lon.toFixed(6), |
| | | degrees.lat.toFixed(6), |
| | | degrees.height.toFixed(2), |
| | | heading, |
| | | pitch, |
| | | ], |
| | | }; |
| | | this.addData(this.selectNode, newChild); |
| | | }, |
| | | expandedNode(node) { |
| | | if (node && node.children && !node.expanded) { |
| | | let treeNode = this.$refs.tree.getNode(node.id); |
| | | if (treeNode) { |
| | | treeNode.expanded = true; |
| | | this.updataTreeNode({ |
| | | id: node.id, |
| | | key: "expanded", |
| | | value: true, |
| | | }); |
| | | datasource.then((data) => { |
| | | data.name = res.cnName; |
| | | window.Viewer.dataSources.add(data); |
| | | }); |
| | | }, |
| | | error: function (data) { |
| | | console.log("error"); |
| | | }, |
| | | } |
| | | } |
| | | }, |
| | | addLayer() { |
| | | this.selectData(this.selectNode); |
| | | }, |
| | | openRename() { |
| | | if (this.selectNode) { |
| | | this.selectNode.rename = true; |
| | | } |
| | | }, |
| | | rename(data) { |
| | | data.rename = false; |
| | | this.updataTreeNode({ |
| | | id: data.id, |
| | | key: "name", |
| | | value: data.name, |
| | | }); |
| | | let vectorLayer = new VectorLayer({ |
| | | name: res.cnName, |
| | | source: new VectorSource({ |
| | | url: url, |
| | | format: new GeoJSON(), |
| | | }), |
| | | }); |
| | | window.map.addLayer(vectorLayer); |
| | | } |
| | | }, |
| | | allowDrop(draggingNode, dropNode, type) { |
| | | if (type === "inner") { |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped lang="less"> |
| | | /* ç¹å»èç¹æ¶çéä¸é¢è² */ |
| | | .tree-container /deep/.el-tree-node.is-current > .el-tree-node__content { |
| | | color: #409eff !important; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node__expand-icon.expanded { |
| | | -webkit-transform: rotate(90deg); |
| | | transform: rotate(90deg); |
| | | } |
| | | |
| | | .tree-container /deep/ .el-icon-caret-right:before { |
| | | content: "\e791"; |
| | | font-size: 18px; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node__expand-icon { |
| | | margin-left: 1px; |
| | | padding: 0px; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node__expand-icon.is-leaf { |
| | | margin-left: 0px; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node { |
| | | position: relative; |
| | | padding-left: 10px; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node__children { |
| | | padding-left: 16px; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree > .el-tree-node:before { |
| | | border-left: none; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree > .el-tree-node:after { |
| | | border-top: none; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree > .el-tree-node:before { |
| | | border-left: none; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree > .el-tree-node:after { |
| | | border-top: none; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node:before { |
| | | content: ""; |
| | | left: 10px; |
| | | position: absolute; |
| | | right: auto; |
| | | border-width: 1px; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node:after { |
| | | content: ""; |
| | | left: 10px; |
| | | position: absolute; |
| | | right: auto; |
| | | border-width: 1px; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node:before { |
| | | border-left: 1px dashed #ccc; |
| | | bottom: 0px; |
| | | <style scoped lang="less" scoped> |
| | | .treeContainer { |
| | | width: 100%; |
| | | height: 100%; |
| | | top: -19px; |
| | | width: 1px; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node:after { |
| | | border-top: 1px dashed #ccc; |
| | | height: 25px; |
| | | top: 20px; |
| | | width: 20px; |
| | | } |
| | | .treeTitle { |
| | | text-align: center; |
| | | margin: 10px 0; |
| | | |
| | | .el-tree-node :last-child:before { |
| | | height: 40px; |
| | | } |
| | | |
| | | .tree-container { |
| | | margin: 10px; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree .el-tree-node { |
| | | position: relative; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node .el-tree-node__content { |
| | | height: 34px; |
| | | padding-left: 0px !important; |
| | | border: none; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node .el-tree-node__content::before { |
| | | border-left: 1px dashed #ccc; |
| | | height: 100%; |
| | | top: 0; |
| | | width: 1px; |
| | | margin-left: 1px; |
| | | margin-top: 0px; |
| | | z-index: 8; |
| | | } |
| | | |
| | | .tree-container |
| | | /deep/ |
| | | .el-tree-node |
| | | .el-tree-node__children |
| | | .el-tree-node__content::before { |
| | | border-left: 0px dashed #ccc; |
| | | height: 100%; |
| | | top: 0; |
| | | width: 1px; |
| | | margin-left: 1px; |
| | | margin-top: 0px; |
| | | z-index: 8; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node .el-tree-node__content::after { |
| | | border-top: 1px dashed #ccc; |
| | | height: 1px; |
| | | top: 18px; |
| | | width: 13px; |
| | | margin-left: 1px; |
| | | z-index: 8; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node { |
| | | .is-leaf + .el-checkbox .el-checkbox__inner { |
| | | display: inline-block; |
| | | } |
| | | |
| | | .el-checkbox .el-checkbox__inner { |
| | | //display: none; |
| | | } |
| | | } |
| | | |
| | | .tree-container |
| | | /deep/ |
| | | .el-tree-node |
| | | .el-tree-node__children |
| | | .el-tree-node__content::after { |
| | | border-top: 0px dashed #ccc; |
| | | } |
| | | |
| | | .tree-container .el-tree-node .el-tree-node__content::before, |
| | | .tree-container .el-tree-node .el-tree-node__content::after { |
| | | content: ""; |
| | | position: absolute; |
| | | right: auto; |
| | | } |
| | | |
| | | /deep/.el-table__placeholder { |
| | | padding-left: 8px; |
| | | } |
| | | |
| | | /deep/.el-card__body { |
| | | padding: 10px !important; |
| | | |
| | | > div { |
| | | padding-bottom: 10px; |
| | | border-bottom: 1px solid #ccc; |
| | | |
| | | &:hover { |
| | | color: #409eff; |
| | | /deep/ .el-upload { |
| | | margin-right: 10px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /deep/ .el-form .el-form-item { |
| | | padding-right: 0px !important; |
| | | } |
| | | .el-tree { |
| | | background: transparent; |
| | | color: #fff; |
| | | } |
| | | |
| | | /deep/ .el-form-item { |
| | | margin-bottom: 10px !important; |
| | | } |
| | | /deep/ .el-tree-node__content:hover { |
| | | background-color: rgba(245, 247, 250, 0.2); |
| | | } |
| | | |
| | | .text { |
| | | font-size: 14px; |
| | | } |
| | | /deep/ .el-tree-node:focus > .el-tree-node__content { |
| | | background-color: rgba(245, 247, 250, 0.2); |
| | | } |
| | | |
| | | .el-tree { |
| | | width: 100%; |
| | | margin-top: 10px; |
| | | } |
| | | /deep/ .custom-tree-node { |
| | | flex: 1; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | font-size: 14px; |
| | | padding-right: 10px; |
| | | |
| | | .search { |
| | | width: 100%; |
| | | } |
| | | i { |
| | | margin-right: 5px; |
| | | } |
| | | } |
| | | |
| | | .item { |
| | | padding: 18px 0; |
| | | /deep/ .el-checkbox > .is-disabled { |
| | | display: none; |
| | | } |
| | | } |
| | | |
| | | .add { |
| | | cursor: pointer; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .delete { |
| | | margin: 10px 0; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .edit { |
| | | margin-bottom: 10px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .search { |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .box-card { |
| | | .rightClickMenu { |
| | | position: fixed; |
| | | display: block; |
| | | z-index: 10000; |
| | | padding: 0px 0px; |
| | | background-color: #fff; |
| | | padding: 5px 0; |
| | | border: 1px solid #ebeef5; |
| | | border-radius: 4px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | } |
| | | .rightClickMenu ul { |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | .rightClickMenu ul li { |
| | | list-style: none; |
| | | margin: 0; |
| | | padding: 0 15px; |
| | | font-size: 14px; |
| | | line-height: 30px; |
| | | cursor: pointer; |
| | | color: black; |
| | | } |
| | | .rightClickMenu ul li:hover { |
| | | background-color: #ebeef5; |
| | | } |
| | | </style> |