"点标注创建,渲染,添加接口,上树"
This commit is contained in:
Binary file not shown.
@ -20,4 +20,16 @@ export const TsApi = {
|
||||
data
|
||||
})
|
||||
},
|
||||
addTsSource: async (data: any) => {
|
||||
return await request.post({
|
||||
url: '/tsSource/add',
|
||||
data
|
||||
})
|
||||
},
|
||||
queryTsSource: async (data: any) => {
|
||||
return await request.post({
|
||||
url: '/tsSource/query',
|
||||
data
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
@ -27,21 +27,83 @@ import {$changeComponentShow} from "../../utils/communication";
|
||||
|
||||
const {getSelectedNodes, cusSelectNode, getSameLevel, cusNodeIcon, nodeType} = useTreeNode()
|
||||
import {showRightMenuTs} from "./tree"
|
||||
import {TsApi} from "../../api/ts";
|
||||
import {initMapData} from "./entity";
|
||||
|
||||
const rightMenuRef: any = ref()
|
||||
const treeObj = ref() //树形的实例
|
||||
const nodes: any = ref([])
|
||||
let zNodes: any = ref([])//树形结构数据
|
||||
let nodes: any = ref([])//选中的node节点
|
||||
let input2 = ref('')
|
||||
onMounted(() => {
|
||||
let data = [
|
||||
{
|
||||
name: "88",
|
||||
sourceType: "directory"
|
||||
let formData = new FormData()
|
||||
// let data = []
|
||||
formData.append('id', window["planId"])
|
||||
TsApi.queryTsSource(formData).then(async res => {
|
||||
console.log('queryTsSource', res)
|
||||
if (res.code == 200) {
|
||||
for (let i = res.data.length - 1; i >= 0; i--) {
|
||||
res.data[i].icon = await cusNodeIcon(res.data[i]);
|
||||
}
|
||||
zNodes.value = res.data
|
||||
console.log("data", zNodes.value)
|
||||
|
||||
treeObj.value = $.fn.zTree.init($(`#treeDemos`), setting, zNodes.value)
|
||||
window.treeObj = treeObj.value
|
||||
}
|
||||
]
|
||||
treeObj.value = $.fn.zTree.init($(`#treeDemos`), setting, data)
|
||||
window.treeObj = treeObj.value
|
||||
})
|
||||
|
||||
})
|
||||
const initTreeCallBack = () => {
|
||||
let arr = zNodes.value
|
||||
let layerTypes = [
|
||||
"arcgisWximagery",
|
||||
"arcgisBlueImagery",
|
||||
"ArcgisLWImagery",
|
||||
"gdlwImagery",
|
||||
"gdwxImagery",
|
||||
"gdslImagery",
|
||||
"layer",
|
||||
];
|
||||
let layers: any = []
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i].sourceType === 'directory') {
|
||||
continue
|
||||
}
|
||||
let detail = JSON.parse(arr[i].detail || '{}')
|
||||
let params = JSON.parse(arr[i].params || '{}')
|
||||
if (!detail.name) {
|
||||
detail.name = arr[i].sourceName
|
||||
}
|
||||
if (!detail.id) {
|
||||
detail.id = arr[i].id
|
||||
}
|
||||
if (layerTypes.includes(arr[i].sourceType)) {
|
||||
layers.push(
|
||||
{
|
||||
sourceType: arr[i].sourceType,
|
||||
detail: {...detail, ...params}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
initMapData(arr[i].sourceType, {...detail, ...params})
|
||||
}
|
||||
}
|
||||
|
||||
layers.sort((obj1, obj2) => {
|
||||
return obj1.detail.layerIndex - obj2.detail.layerIndex;
|
||||
});
|
||||
if (window.earth_ts) {
|
||||
for (let i = 0; i < layers.length; i++) {
|
||||
// initMapData(layers[i].sourceType, layers[i].detail, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
const onDblClick = (event: MouseEvent, treeId: string, treeNode: any) => {
|
||||
let entityObject
|
||||
entityObject = (window as any)._entityMap.get(treeNode.id)
|
||||
entityObject.flyTo()
|
||||
}
|
||||
const onClick = (event: MouseEvent, treeId: string, treeNode: any) => {
|
||||
console.log('selectNode', treeNode)
|
||||
|
||||
@ -131,20 +193,21 @@ const setting = {
|
||||
data: {
|
||||
key: {
|
||||
//zdatas数据中表示节点name的属性key
|
||||
name: "name",
|
||||
checked: "is_show",
|
||||
name: "sourceName",
|
||||
checked: "isShow",
|
||||
},
|
||||
simpleData: {
|
||||
enable: true,
|
||||
idKey: "id",
|
||||
pIdKey: "p_id",
|
||||
nameKey: "name",
|
||||
pIdKey: "parentId",
|
||||
nameKey: "sourceName",
|
||||
},
|
||||
},
|
||||
callback: {
|
||||
onMouseDown: onMouseDown,
|
||||
onRightClick: rightClick,
|
||||
onClick: onClick,
|
||||
onDblClick: onDblClick
|
||||
/*
|
||||
onClick: this.onClick,
|
||||
onDblClick: this.onDblClick,
|
||||
@ -162,8 +225,11 @@ const setting = {
|
||||
beforeClick: this.zTreeBeforeClick,
|
||||
onCheck: this.onCheck*/
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
defineExpose({
|
||||
initTreeCallBack
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -189,6 +255,19 @@ const setting = {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
:deep("li a.curSelectedNode") {
|
||||
background-color: #ffe6b0 !important;
|
||||
|
||||
}
|
||||
|
||||
.ztree {
|
||||
li {
|
||||
a.curSelectedNode {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-input__wrapper), :deep(.el-input__inner ) {
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import {$changeComponentPop} from "../../../utils/communication";
|
||||
|
||||
export const useRightOperate = () => {
|
||||
const addDirectory = () => {
|
||||
// $changeComponentPop('.adddirectoryBox', true)
|
||||
$changeComponentPop('.adddirectoryBox', true)
|
||||
console.log("addDirectory")
|
||||
}
|
||||
const addResource = () => {
|
||||
|
||||
@ -4,10 +4,11 @@
|
||||
<use xlink:href="#icon-tuichu"></use>
|
||||
</svg>
|
||||
<div id="earthContainer" class="fullSize"></div>
|
||||
<cabin></cabin>
|
||||
<cabin ref="cabin"></cabin>
|
||||
<element></element>
|
||||
<deduction :TSOBJ="tsOBJ"></deduction>
|
||||
<newEvent></newEvent>
|
||||
<addDirectory class="adddirectoryBox absolute zIndex999"></addDirectory>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -18,9 +19,11 @@ import Cabin from "./cabin.vue"
|
||||
import Element from "./element.vue"
|
||||
import NewEvent from "./newEvent.vue"
|
||||
import Deduction from "./deduction.vue";
|
||||
import AddDirectory from './components/tsdirectory.vue'
|
||||
import {TS} from "./sdk";
|
||||
import * as domain from "domain";
|
||||
|
||||
let cabin = ref()
|
||||
let tsOBJ = reactive({})
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
@ -33,6 +36,7 @@ for (const routeQueryKey in route.query) {
|
||||
}
|
||||
}
|
||||
console.log("params", params)
|
||||
window.planId = params.id
|
||||
|
||||
// 通过planID获取方案包含的所有事件
|
||||
let getEventList = () => {
|
||||
@ -79,6 +83,7 @@ const createEarth = async () => {
|
||||
setTimeout(() => {
|
||||
new YJ.Tools(window.earth_ts).flyHome()
|
||||
}, 1000)
|
||||
cabin.value.initTreeCallBack()
|
||||
}
|
||||
const closeSituationEdit = () => {
|
||||
router.back()
|
||||
@ -96,5 +101,9 @@ const closeSituationEdit = () => {
|
||||
height: 2.2222222222vh !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.adddirectoryBox {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -55,8 +55,11 @@ import {ref, onMounted} from "vue";
|
||||
import {Search} from '@element-plus/icons-vue'
|
||||
import {ModelApi} from "../../api/model";
|
||||
import {GraphApi} from "../../api/graphLabel";
|
||||
import {addMapSource} from "./entity";
|
||||
|
||||
import {addMapSource} from "./entity";
|
||||
import {useTreeNode} from "../components/tree/hooks/treeNode";
|
||||
|
||||
const {getSelectedNodes} = useTreeNode()
|
||||
const service = ref(localStorage.getItem('ip'))
|
||||
|
||||
interface Tree {
|
||||
@ -158,11 +161,15 @@ let getGraphTypeList = async () => {
|
||||
}
|
||||
// 添加标绘
|
||||
let addMarker = (item) => {
|
||||
let nodes = getSelectedNodes(window['treeObj'])
|
||||
console.log("绘制" + item.name)
|
||||
console.log("获取选中的节点", nodes)
|
||||
let id = new YJ.Tools().randomString()
|
||||
let pId = nodes.length >= 1 ? nodes[0].id : -1
|
||||
window.draw = new YJ.Draw[item.funName](earth_ts)
|
||||
window.draw.start((a, position) => {
|
||||
console.log(position)
|
||||
addMapSource({id: 777, type: item.type, name: item.source_name, position})
|
||||
addMapSource({id, type: item.type, name: item.source_name, position, pId})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,9 @@
|
||||
export function addMapSource(option) {
|
||||
import {TsApi} from "../../api/ts";
|
||||
import {useTreeNode} from '@/views/components/tree/hooks/treeNode'
|
||||
|
||||
const {cusAddNodes, getSelectedNode} = useTreeNode()
|
||||
|
||||
export function addMapSource(option, cb: any = null) {
|
||||
console.log("添加到地球上", option)
|
||||
let id = option.id || new YJ.Tools().randomString()
|
||||
let name = option.name
|
||||
@ -24,5 +29,37 @@ export function addMapSource(option) {
|
||||
}
|
||||
console.log('options', options)
|
||||
// 进数据库
|
||||
// 上树
|
||||
let dbOption = {
|
||||
"id": option.id,
|
||||
"sourceName": name,
|
||||
"sourceType": option.type,
|
||||
"sourcePath": "",
|
||||
"parentId": option.pId,
|
||||
"treeIndex": 0,
|
||||
"isShow": 1,
|
||||
"detail": JSON.stringify(options) || '{}',
|
||||
"params": "",
|
||||
"planId": window['planId']
|
||||
}
|
||||
console.log('dbOption', dbOption)
|
||||
TsApi.addTsSource(dbOption).then(res => {
|
||||
console.log("addTsSource", res)
|
||||
cb && cb(res)
|
||||
// 上树
|
||||
cusAddNodes(window.treeObj, getSelectedNode(window.treeObj), [dbOption], true)
|
||||
})
|
||||
}
|
||||
|
||||
export function initMapData(type, data) {
|
||||
let entityObject
|
||||
switch (type) {
|
||||
case 'point':
|
||||
console.log("ssssssss+++", window['earth_ts'])
|
||||
entityObject = new YJ.Obj.BillboardObject(window['earth_ts'], data)
|
||||
}
|
||||
if (entityObject) {
|
||||
if (entityObject.options.id) {
|
||||
(window as any)._entityMap.set(entityObject.options.id, entityObject)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,7 +151,10 @@ const getList = (params = null) => {
|
||||
formData.append(paramsKey, params[paramsKey])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
formData.append('username', params["createdBy"])
|
||||
|
||||
}
|
||||
TsApi.planList(formData).then(res => {
|
||||
console.log(res)
|
||||
@ -175,7 +178,7 @@ const toTSEdit = (row) => {
|
||||
console.log("当前推演方案", row)
|
||||
router.push({
|
||||
name: 'tsEdit', // 必须用 name 匹配路由,不能用 path
|
||||
query: {id: 123, name: "战时推演", start_time: 946684800000}
|
||||
query: {id: row.id, name: row.name, start_time: new Date(row.simulationStartTime).getTime()}
|
||||
})
|
||||
}
|
||||
const delPlan = (id) => {
|
||||
|
||||
@ -11,28 +11,31 @@
|
||||
</template>
|
||||
<div class="set_detail">
|
||||
<el-form
|
||||
ref="ruleFormRef"
|
||||
style="max-width: 600px"
|
||||
:model="sizeForm"
|
||||
label-width="auto"
|
||||
:label-position="'top'"
|
||||
|
||||
:rules="rules"
|
||||
>
|
||||
<el-form-item label="推演名称">
|
||||
<el-form-item label="推演名称" prop="name" required>
|
||||
<el-input v-model="sizeForm.name" placeholder="请填写名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仿真开始时间">
|
||||
<el-form-item label="仿真开始时间" prop="simulationStartTime" required>
|
||||
<el-date-picker
|
||||
v-model="sizeForm.date1"
|
||||
v-model="sizeForm.simulationStartTime"
|
||||
type="datetime"
|
||||
timezone="Asia/Shanghai"
|
||||
value-format="YYYY-MM-DDTHH:mm:ss"
|
||||
placeholder="请选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="推演描述" prop="desc">
|
||||
<el-form-item label="推演描述" prop="desc" required>
|
||||
<el-input v-model="sizeForm.desc" type="textarea" placeholder="请输入内容描述"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div class="optionbtn">
|
||||
<el-button @click="addPlan">确定</el-button>
|
||||
<el-button @click="addPlan(ruleFormRef)">确定</el-button>
|
||||
<el-button>取消</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -45,30 +48,69 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, reactive,} from "vue";
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {ElMessage, FormInstance, FormRules} from 'element-plus'
|
||||
import {TsApi} from "../../api/ts";
|
||||
|
||||
const eventBus: any = inject('bus')
|
||||
const emit = defineEmits(['addCallback']);
|
||||
const isShowPup = ref(false)
|
||||
const sizeForm = reactive({
|
||||
|
||||
|
||||
interface RuleForm {
|
||||
name: string,
|
||||
simulationStartTime: string,
|
||||
desc: string,
|
||||
}
|
||||
|
||||
const ruleFormRef = ref<FormInstance>()
|
||||
const sizeForm = reactive<RuleForm>({
|
||||
name: '',
|
||||
// date1: '',
|
||||
simulationStartTime: '',
|
||||
desc: '',
|
||||
})
|
||||
const addPlan = () => {
|
||||
TsApi.addPlan({name: sizeForm.name, desc: sizeForm.desc}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
})
|
||||
emit('addCallback');
|
||||
|
||||
const rules = reactive<FormRules<RuleForm>>({
|
||||
name: [
|
||||
{required: true, message: '推演名称不能为空', trigger: 'blur'},
|
||||
],
|
||||
desc: [
|
||||
{required: true, message: '推演描述不能为空', trigger: 'blur'},
|
||||
],
|
||||
simulationStartTime: [
|
||||
{required: true, message: '仿真开始时间不能为空', trigger: 'blur'},
|
||||
],
|
||||
})
|
||||
const submitForm = async (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
await formEl.validate((valid, fields) => {
|
||||
if (valid) {
|
||||
console.log('submit!')
|
||||
} else {
|
||||
console.log('error submit!', fields)
|
||||
}
|
||||
$(".newPlan")[0].style.display = "none"
|
||||
})
|
||||
}
|
||||
const addPlan = async (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
await formEl.validate((valid, fields) => {
|
||||
if (valid) {
|
||||
TsApi.addPlan(sizeForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
})
|
||||
emit('addCallback');
|
||||
}
|
||||
$(".newPlan")[0].style.display = "none"
|
||||
})
|
||||
} else {
|
||||
console.log('提交失败', fields)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
eventBus.on('openAddPlan', (data, cb, type) => {
|
||||
// selectCallback = cb
|
||||
// addType.value = type
|
||||
|
||||
@ -19,34 +19,34 @@
|
||||
stroke-linejoin="round" />
|
||||
</svg> -->
|
||||
<svg class="item_icon_bg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="162" height="44" viewBox="0 0 162 44" fill="none" preserveAspectRatio="none">
|
||||
<path fill="#000000" fill-opacity="0.5" d="M0 44L136.639 44L162 18L162 0L0 0L0 44Z" />
|
||||
width="162" height="44" viewBox="0 0 162 44" fill="none" preserveAspectRatio="none">
|
||||
<path fill="#000000" fill-opacity="0.5" d="M0 44L136.639 44L162 18L162 0L0 0L0 44Z"/>
|
||||
<path fill-rule="evenodd" fill="url(#linear_border_2218_109_0)"
|
||||
d="M136.006 42.5L1.5 42.5L1.5 1.5L160.5 1.5L160.5 17.3896L136.006 42.5ZM136.639 44L0 44L0 0L162 0L162 18L136.639 44Z" />
|
||||
d="M136.006 42.5L1.5 42.5L1.5 1.5L160.5 1.5L160.5 17.3896L136.006 42.5ZM136.639 44L0 44L0 0L162 0L162 18L136.639 44Z"/>
|
||||
<path d="M0 0L15.0533 0L49.1742 41L98.4484 41.2681L102 44L0 44L0 0Z"
|
||||
fill="rgba(var(--color-base1), 0.2)" />
|
||||
fill="rgba(var(--color-base1), 0.2)"/>
|
||||
<path d="M3 34L3 41L10 41L3 34Z" stroke="rgba(var(--color-base2), 1)" stroke-width="0.5"
|
||||
stroke-linejoin="round" />
|
||||
stroke-linejoin="round"/>
|
||||
<path d="M159 10L159 3L152 3L159 10Z" stroke="rgba(var(--color-base2), 1)" stroke-width="0.5"
|
||||
stroke-linejoin="round" />
|
||||
stroke-linejoin="round"/>
|
||||
<defs>
|
||||
<linearGradient id="linear_border_2218_109_0" x1="0" y1="-1.7520751953125" x2="140.2142333984375"
|
||||
y2="40.473846435546875" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0625" stop-color="rgba(var(--color-base1), 1)" />
|
||||
<stop offset="1" stop-color="var(--color-border1)" />
|
||||
y2="40.473846435546875" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0625" stop-color="rgba(var(--color-base1), 1)"/>
|
||||
<stop offset="1" stop-color="var(--color-border1)"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
<svg class="item_icon_bg item_icon_bg_hover" style="opacity: 0;" xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" width="163" height="45" viewBox="0 0 163 45" fill="none"
|
||||
preserveAspectRatio="none">
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" width="163" height="45" viewBox="0 0 163 45" fill="none"
|
||||
preserveAspectRatio="none">
|
||||
<path fill="url(#linear_fill_2218_82_1)"
|
||||
d="M0.5 44.5L137.139 44.5L162.5 18.5L162.5 0.5L0.5 0.5L0.5 44.5Z" />
|
||||
d="M0.5 44.5L137.139 44.5L162.5 18.5L162.5 0.5L0.5 0.5L0.5 44.5Z"/>
|
||||
<defs>
|
||||
<linearGradient id="linear_fill_2218_82_1" x1="84.9554443359375" y1="44.49997329711914"
|
||||
x2="84.95498657226562" y2="0.5" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.6" />
|
||||
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0" />
|
||||
x2="84.95498657226562" y2="0.5" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.6"/>
|
||||
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
@ -62,41 +62,41 @@
|
||||
</div>
|
||||
<div class="left_bottom" @click="fold">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"
|
||||
viewBox="0 0 32 32" fill="none">
|
||||
viewBox="0 0 32 32" fill="none">
|
||||
<path fill="#000000" fill-opacity="0.6"
|
||||
d="M16 0C24.835 0 32 7.16496 32 16C32 24.835 24.835 32 16 32C7.16496 32 0 24.835 0 16C0 7.16496 7.16496 0 16 0Z" />
|
||||
d="M16 0C24.835 0 32 7.16496 32 16C32 24.835 24.835 32 16 32C7.16496 32 0 24.835 0 16C0 7.16496 7.16496 0 16 0Z"/>
|
||||
<path fill="url(#linear_fill_2442_491_1)"
|
||||
d="M16 0C24.835 0 32 7.16496 32 16C32 24.835 24.835 32 16 32C7.16496 32 0 24.835 0 16C0 7.16496 7.16496 0 16 0Z" />
|
||||
d="M16 0C24.835 0 32 7.16496 32 16C32 24.835 24.835 32 16 32C7.16496 32 0 24.835 0 16C0 7.16496 7.16496 0 16 0Z"/>
|
||||
<path fill-rule="evenodd" fill="url(#linear_border_2442_491_0)"
|
||||
d="M32 16C32 7.16496 24.835 0 16 0C7.16496 0 0 7.16496 0 16C0 24.835 7.16496 32 16 32C24.835 32 32 24.835 32 16ZM30.5 16C30.5 7.99187 24.0081 1.5 16 1.5C7.99187 1.5 1.5 7.99187 1.5 16C1.5 24.0081 7.99187 30.5 16 30.5C24.0081 30.5 30.5 24.0081 30.5 16Z" />
|
||||
d="M32 16C32 7.16496 24.835 0 16 0C7.16496 0 0 7.16496 0 16C0 24.835 7.16496 32 16 32C24.835 32 32 24.835 32 16ZM30.5 16C30.5 7.99187 24.0081 1.5 16 1.5C7.99187 1.5 1.5 7.99187 1.5 16C1.5 24.0081 7.99187 30.5 16 30.5C24.0081 30.5 30.5 24.0081 30.5 16Z"/>
|
||||
<g filter="url(#filter_2442_492)">
|
||||
<path
|
||||
d="M10.4025 16.1283L19.1887 9.77097C19.1941 9.76721 19.1995 9.76361 19.205 9.76018C19.2106 9.75678 19.2162 9.75356 19.222 9.75054C19.2278 9.74754 19.2337 9.74473 19.2396 9.74211C19.2456 9.73947 19.2517 9.73705 19.2578 9.73486C19.2639 9.73265 19.2701 9.73065 19.2764 9.72886C19.2827 9.72708 19.289 9.7255 19.2954 9.72415C19.3017 9.72279 19.3082 9.72166 19.3146 9.72075C19.3211 9.71985 19.3275 9.71916 19.334 9.71868C19.3405 9.71821 19.347 9.71794 19.3535 9.7179C19.3601 9.71787 19.3666 9.71808 19.3731 9.7185C19.3796 9.71891 19.3861 9.71954 19.3925 9.7204C19.399 9.72125 19.4054 9.72234 19.4118 9.72365C19.4182 9.72493 19.4245 9.72645 19.4308 9.72818C19.4371 9.7299 19.4433 9.73184 19.4495 9.734C19.4556 9.73615 19.4617 9.7385 19.4677 9.74108C19.4737 9.74365 19.4795 9.74641 19.4854 9.74936C19.4912 9.75234 19.4969 9.7555 19.5024 9.75886C19.508 9.76222 19.5135 9.76577 19.5188 9.7695C19.5242 9.77322 19.5294 9.77712 19.5345 9.78122C19.5395 9.78531 19.5445 9.78956 19.5492 9.79397C19.554 9.7984 19.5587 9.80298 19.5631 9.80772C19.5676 9.81246 19.5719 9.81735 19.5761 9.8224C19.5802 9.82742 19.5842 9.83259 19.588 9.8379C19.5917 9.84318 19.5953 9.8486 19.5987 9.85415C19.6022 9.8597 19.6054 9.86536 19.6084 9.87115C19.6115 9.87691 19.6143 9.88277 19.6169 9.88872C19.6196 9.8947 19.622 9.90074 19.6242 9.90686C19.6264 9.913 19.6284 9.91921 19.6302 9.92547C19.632 9.93173 19.6336 9.93805 19.635 9.94443C19.6363 9.95079 19.6375 9.9572 19.6384 9.96365C19.6393 9.9701 19.64 9.97658 19.6405 9.98308C19.641 9.98958 19.6413 9.99609 19.6413 10.0026L19.6413 11.6788C19.6413 12.0415 19.4676 12.3889 19.1705 12.6022L13.9773 16.3599L19.1705 20.1176C19.1887 20.1308 19.2065 20.1445 19.2239 20.1587C19.2413 20.1729 19.2583 20.1876 19.2749 20.2028C19.2914 20.218 19.3075 20.2337 19.3231 20.2499C19.3387 20.266 19.3539 20.2826 19.3685 20.2997C19.3831 20.3167 19.3972 20.3342 19.4109 20.3521C19.4245 20.37 19.4375 20.3883 19.45 20.407C19.4625 20.4256 19.4745 20.4446 19.4859 20.464C19.4973 20.4834 19.5081 20.5031 19.5183 20.5231C19.5285 20.5431 19.5381 20.5634 19.5471 20.584C19.5562 20.6046 19.5646 20.6254 19.5724 20.6465C19.5801 20.6676 19.5873 20.6889 19.5938 20.7104C19.6003 20.7319 19.6062 20.7536 19.6115 20.7754C19.6167 20.7973 19.6213 20.8193 19.6252 20.8414C19.6292 20.8635 19.6325 20.8858 19.6351 20.9081C19.6377 20.9304 19.6396 20.9528 19.6409 20.9752C19.6422 20.9977 19.6429 21.0201 19.6428 21.0426L19.6428 22.7173C19.6428 22.9489 19.3777 23.0845 19.1887 22.9489L10.4025 16.5915C10.3979 16.5882 10.3935 16.5848 10.3892 16.5812C10.3849 16.5776 10.3807 16.5739 10.3766 16.57C10.3725 16.5662 10.3686 16.5623 10.3647 16.5582C10.3608 16.5541 10.3571 16.5499 10.3535 16.5456C10.3499 16.5414 10.3464 16.537 10.343 16.5325C10.3396 16.528 10.3364 16.5234 10.3334 16.5187C10.3302 16.514 10.3273 16.5093 10.3245 16.5044C10.3217 16.4996 10.319 16.4946 10.3165 16.4896C10.3139 16.4846 10.3116 16.4796 10.3094 16.4744C10.3071 16.4693 10.305 16.464 10.3031 16.4588C10.3012 16.4535 10.2994 16.4482 10.2978 16.4428C10.2962 16.4375 10.2948 16.4321 10.2934 16.4266C10.2921 16.4211 10.291 16.4156 10.29 16.4101C10.2891 16.4046 10.2882 16.3991 10.2876 16.3935C10.2869 16.3879 10.2864 16.3824 10.2861 16.3768C10.2858 16.3711 10.2856 16.3655 10.2856 16.3599C10.2856 16.3543 10.2858 16.3487 10.2861 16.3431C10.2864 16.3375 10.2869 16.3319 10.2876 16.3264C10.2882 16.3208 10.2891 16.3153 10.29 16.3097C10.291 16.3042 10.2921 16.2987 10.2934 16.2933C10.2948 16.2878 10.2962 16.2824 10.2978 16.277C10.2994 16.2716 10.3012 16.2663 10.3031 16.2611C10.305 16.2558 10.3071 16.2506 10.3094 16.2455C10.3116 16.2403 10.3139 16.2352 10.3165 16.2302C10.319 16.2252 10.3217 16.2203 10.3245 16.2154C10.3273 16.2106 10.3302 16.2058 10.3334 16.2011C10.3364 16.1965 10.3396 16.1919 10.343 16.1874C10.3464 16.1829 10.3499 16.1785 10.3535 16.1742C10.3571 16.1699 10.3608 16.1658 10.3647 16.1617C10.3686 16.1576 10.3725 16.1536 10.3766 16.1498C10.3807 16.146 10.3849 16.1423 10.3892 16.1387C10.3935 16.1351 10.3979 16.1316 10.4025 16.1283Z"
|
||||
fill="rgba(var(--color-base2), 1)" />
|
||||
fill="rgba(var(--color-base2), 1)"/>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="linear_fill_2442_491_1" x1="14.793701171875" y1="16.00537109375" x2="14.7939453125"
|
||||
y2="-6.678619384765625" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2" />
|
||||
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0" />
|
||||
y2="-6.678619384765625" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2"/>
|
||||
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linear_border_2442_491_0" x1="32" y1="-1.27423095703125" x2="4.303466796875"
|
||||
y2="29.435516357421875" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0625" stop-color="rgb(var(--color-base1))" />
|
||||
<stop offset="1" stop-color="var(--color-border1)" />
|
||||
y2="29.435516357421875" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0625" stop-color="rgb(var(--color-base1))"/>
|
||||
<stop offset="1" stop-color="var(--color-border1)"/>
|
||||
</linearGradient>
|
||||
<filter id="filter_2442_492" x="6.28564453125" y="5.717864990234375" width="17.357177734375"
|
||||
height="21.36663818359375" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="feFloodId_2442_492" />
|
||||
height="21.36663818359375" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="feFloodId_2442_492"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha_2442_492" />
|
||||
<feOffset dx="0" dy="0" />
|
||||
<feGaussianBlur stdDeviation="2" />
|
||||
<feComposite in2="hardAlpha_2442_492" operator="out" />
|
||||
result="hardAlpha_2442_492"/>
|
||||
<feOffset dx="0" dy="0"/>
|
||||
<feGaussianBlur stdDeviation="2"/>
|
||||
<feComposite in2="hardAlpha_2442_492" operator="out"/>
|
||||
<feColorMatrix type="matrix"
|
||||
values="0 0 0 0 0.1450980392156863 0 0 0 0 0.7686274509803922 0 0 0 0 0.7686274509803922 0 0 0 1 0" />
|
||||
<feBlend mode="normal" in2="feFloodId_2442_492" result="dropShadow_1_2442_492" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="dropShadow_1_2442_492" result="shape_2442_492" />
|
||||
values="0 0 0 0 0.1450980392156863 0 0 0 0 0.7686274509803922 0 0 0 0 0.7686274509803922 0 0 0 1 0"/>
|
||||
<feBlend mode="normal" in2="feFloodId_2442_492" result="dropShadow_1_2442_492"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="dropShadow_1_2442_492" result="shape_2442_492"/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
@ -105,16 +105,16 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRouter } from 'vue-router'
|
||||
import {useI18n} from 'vue-i18n'
|
||||
import {useRouter} from 'vue-router'
|
||||
|
||||
import { bus } from '@/utils/bus'
|
||||
import {bus} from '@/utils/bus'
|
||||
import leftSideSecond from '@/views/components/leftSide/leftSideSecond.vue'
|
||||
import { ElMessage, ElLoading } from 'element-plus'
|
||||
import {ElMessage, ElLoading} from 'element-plus'
|
||||
|
||||
const { ipcRenderer } = require('electron')
|
||||
const {ipcRenderer} = require('electron')
|
||||
const router = useRouter() // 路由实例
|
||||
const { t } = useI18n()
|
||||
const {t} = useI18n()
|
||||
const eventBus: any = inject('bus')
|
||||
const menuList: any = ref([
|
||||
// 方案推演
|
||||
@ -274,7 +274,9 @@ const handleClick = (item: any, e) => {
|
||||
if ((window as any).checkAuthIsValid) {
|
||||
console.log('打开态势推演')
|
||||
ipcRenderer.send('toggle-fullscreen', true)
|
||||
router.push({ path: '/ts' })
|
||||
window['earth'].destroy()
|
||||
window['earth'] = null
|
||||
router.push({path: '/ts'})
|
||||
|
||||
} else {
|
||||
ElMessage({
|
||||
@ -447,7 +449,7 @@ const clickMenu = (item: any) => {
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
>.item_icon_bg {
|
||||
> .item_icon_bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
@ -459,7 +461,7 @@ const clickMenu = (item: any) => {
|
||||
// background: url('../../../assets/images/hongse/left1.png') no-repeat;
|
||||
// background-size: 100% 100%;
|
||||
|
||||
>.item_icon_bg_hover {
|
||||
> .item_icon_bg_hover {
|
||||
opacity: 1 !important;
|
||||
}
|
||||
}
|
||||
@ -493,7 +495,8 @@ const clickMenu = (item: any) => {
|
||||
// background-size: 100% 100%;
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
>svg {
|
||||
|
||||
> svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@ -1,13 +1,21 @@
|
||||
import { $changeComponentShow } from '@/utils/communication'
|
||||
import { useTreeNode } from './treeNode'
|
||||
import { TreeApi } from '@/api/tree'
|
||||
import { initMapData } from '../../../../common/initMapData'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import {$changeComponentShow} from '@/utils/communication'
|
||||
import {useTreeNode} from './treeNode'
|
||||
import {TreeApi} from '@/api/tree'
|
||||
import {initMapData} from '../../../../common/initMapData'
|
||||
import {ElMessage} from 'element-plus'
|
||||
|
||||
export const useTree = () => {
|
||||
const rightMenuRef: any = ref() //右键菜单的实例
|
||||
const treeObj = ref() //树形的实例
|
||||
const { getSelectedNodes, showRightMenu, cusUpdateNode, cusSelectNode, getSameLevel, cusNodeIcon, nodeType } = useTreeNode() //树上一系列的方法hooks
|
||||
const {
|
||||
getSelectedNodes,
|
||||
showRightMenu,
|
||||
cusUpdateNode,
|
||||
cusSelectNode,
|
||||
getSameLevel,
|
||||
cusNodeIcon,
|
||||
nodeType
|
||||
} = useTreeNode() //树上一系列的方法hooks
|
||||
const nodes: any = ref([])
|
||||
/**
|
||||
* 用于捕获zTree上鼠标按键按下后的事件回调函数
|
||||
@ -79,8 +87,7 @@ export const useTree = () => {
|
||||
let t = window.earth.entityMap.get(n.id)
|
||||
if (t) {
|
||||
return t
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (n.parentId) {
|
||||
return getEntityObject(window.treeObj.getNodeByParam("id", n.parentId, null))
|
||||
}
|
||||
@ -89,8 +96,7 @@ export const useTree = () => {
|
||||
}
|
||||
entityObject = getEntityObject(treeNode)
|
||||
entityObject.flyTo(treeNode.id)
|
||||
}
|
||||
else if (treeNode.sourceType === "roam") {
|
||||
} else if (treeNode.sourceType === "roam") {
|
||||
// 飞行漫游
|
||||
ElMessage({
|
||||
message: '单击鼠标右键可结束当前漫游',
|
||||
@ -99,8 +105,7 @@ export const useTree = () => {
|
||||
let params = JSON.parse(treeNode.params)
|
||||
YJ.Global.FlyRoam.flyTo((window as any).earth, params.points);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (treeNode.sourceType == 'pressModel') {
|
||||
entityObject = (window as any).pressModelEntities.get(treeNode.id)
|
||||
} else {
|
||||
@ -222,29 +227,29 @@ export const useTree = () => {
|
||||
* 成为同级前一个节点,"next":成为同级后一个节点》
|
||||
* @returns {boolean} 返回 false,zTree 将恢复被拖拽的节点,也无法触发 onDrop 事件回调函数
|
||||
*/
|
||||
// @ts-ignore
|
||||
// @ts-ignore
|
||||
const beforeDrop = (
|
||||
treeId: any,
|
||||
treeNodes: any,
|
||||
targetNode: any,
|
||||
moveType: any
|
||||
) => {
|
||||
if (
|
||||
['prev', 'next', 'inner'].includes(moveType) &&
|
||||
['pressModel', 'terrainDig'].includes(treeNodes[0].sourceType)
|
||||
) {
|
||||
return false
|
||||
}
|
||||
if (['prev', 'next'].includes(moveType)) {
|
||||
let parent = treeObj.value.getNodeByParam('id', targetNode.parentId, null)
|
||||
if (parent && !nodeType[parent.sourceType].allowChildren) return false
|
||||
}
|
||||
if (targetNode) {
|
||||
if (moveType == 'inner' && !nodeType[targetNode.sourceType].allowChildren) {
|
||||
treeId: any,
|
||||
treeNodes: any,
|
||||
targetNode: any,
|
||||
moveType: any
|
||||
) => {
|
||||
if (
|
||||
['prev', 'next', 'inner'].includes(moveType) &&
|
||||
['pressModel', 'terrainDig'].includes(treeNodes[0].sourceType)
|
||||
) {
|
||||
return false
|
||||
}
|
||||
if (['prev', 'next'].includes(moveType)) {
|
||||
let parent = treeObj.value.getNodeByParam('id', targetNode.parentId, null)
|
||||
if (parent && !nodeType[parent.sourceType].allowChildren) return false
|
||||
}
|
||||
if (targetNode) {
|
||||
if (moveType == 'inner' && !nodeType[targetNode.sourceType].allowChildren) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 捕获 checkbox / radio 被勾选 或 取消勾选的事件回调函数
|
||||
* @param event
|
||||
@ -289,8 +294,7 @@ export const useTree = () => {
|
||||
}
|
||||
)
|
||||
window.treeObj.checkNode(parentNode, false, true);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
p_ids.push(
|
||||
{
|
||||
id: parentNode.id,
|
||||
@ -307,17 +311,17 @@ export const useTree = () => {
|
||||
|
||||
|
||||
let ids = [...p_ids]
|
||||
|
||||
// 更新节点状态修改地图资源状态
|
||||
function sourceStatus(node) {
|
||||
ids.push({ id: node.id, isShow: node.isShow ? 1 : 0 })
|
||||
ids.push({id: node.id, isShow: node.isShow ? 1 : 0})
|
||||
if (node.sourceType === 'directory') {
|
||||
if (node.children && node.children.length > 0) {
|
||||
node.children.forEach((item) => {
|
||||
sourceStatus(item)
|
||||
})
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
let params = JSON.parse(node.params)
|
||||
let entityObject
|
||||
if (node.sourceType == 'pressModel') {
|
||||
@ -332,7 +336,7 @@ export const useTree = () => {
|
||||
height: params.height,
|
||||
name: node.sourceName
|
||||
})
|
||||
(window as any).pressModelEntities.set(node.id, entityObject)
|
||||
(window as any).pressModelEntities.set(node.id, entityObject)
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -347,7 +351,7 @@ export const useTree = () => {
|
||||
"sourceName": node.sourceName,
|
||||
"isShow": node.isShow ? 1 : 0,
|
||||
}
|
||||
cusUpdateNode({ id: node.id, sourceName: node.sourceName, params: JSON.stringify(params) })
|
||||
cusUpdateNode({id: node.id, sourceName: node.sourceName, params: JSON.stringify(params)})
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -368,7 +372,6 @@ export const useTree = () => {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// let source_ids = [];
|
||||
// nodes.forEach((item) => {
|
||||
// if (item.isHidden == false) {
|
||||
@ -499,7 +502,7 @@ export const useTree = () => {
|
||||
check: {
|
||||
enable: true,
|
||||
nocheckInherit: false,
|
||||
chkboxType: { Y: 'ps', N: 's' }
|
||||
chkboxType: {Y: 'ps', N: 's'}
|
||||
},
|
||||
view: {
|
||||
selectedMulti: true
|
||||
@ -604,7 +607,7 @@ export const useTree = () => {
|
||||
brightness: 1
|
||||
})
|
||||
}
|
||||
res.data.list[i].svg = await cusNodeIcon(res.data.list[i]);
|
||||
res.data.list[i].icon = await cusNodeIcon(res.data.list[i]);
|
||||
}
|
||||
}
|
||||
zNodes.value = res.data.list
|
||||
@ -683,12 +686,11 @@ export const useTree = () => {
|
||||
layers.push(
|
||||
{
|
||||
sourceType: zNodes.value[i].sourceType,
|
||||
params: { ...detail, ...params }
|
||||
params: {...detail, ...params}
|
||||
}
|
||||
)
|
||||
}
|
||||
else {
|
||||
initMapData(zNodes.value[i].sourceType, { ...detail, ...params }, null)
|
||||
} else {
|
||||
initMapData(zNodes.value[i].sourceType, {...detail, ...params}, null)
|
||||
}
|
||||
}
|
||||
layers.sort((obj1, obj2) => {
|
||||
|
||||
Reference in New Issue
Block a user