点标注整个流程

This commit is contained in:
zyl
2025-11-04 17:07:54 +08:00
13 changed files with 356 additions and 40 deletions

View File

@ -99,8 +99,8 @@ function createWindow(): void {
splashWindow.show()
// 创建主窗口(保持原有配置,但先不显示)
const mainWindow = new BrowserWindow({
minWidth: 1780, // 添加最小宽度限制
minHeight: 920, // 添加最小高度限制
// minWidth: 1780, // 添加最小宽度限制
// minHeight: 920, // 添加最小高度限制
// fullscreen: true,
show: false,
frame: true,

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,8 @@ body {
align-items: center;
justify-content: center;
overflow: hidden;
background-image: url('./wavy-lines.svg');
/* background-image: url('./wavy-lines.svg'); */
background-color: #000000;
background-size: cover;
user-select: none;
}

View File

@ -43,6 +43,9 @@ export const initMapData = async (type, data, cd) => {
case 'ellipse':
entityObject = new YJ.Obj.EllipseObject(window.earth, data)
break
case 'sector':
entityObject = new YJ.Obj.SectorObject(window.earth, data)
break
case 'model':
console.log('model', data)
entityObject = new YJ.Obj.Model(window.earth, data)

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20" fill="none"><path d="M1.83089 11.2668L10.2871 14.8693L18.8224 11.4511C18.1453 9.76741 16.9828 8.32202 15.4819 7.29769C13.981 6.27335 12.2092 5.71609 10.3904 5.69636C8.57166 5.67663 6.7877 6.19533 5.26412 7.18686C3.74054 8.17838 2.54576 9.59821 1.83089 11.2668Z" fill="#00FFFF" fill-opacity="0.5"></path><path d="M1.18601 11.5253L1.63834 11.718L10.2818 15.4002L19.4622 11.7237L19.2791 11.2685C18.9224 10.3816 18.4443 9.56549 17.8449 8.82018C17.2455 8.07485 16.5505 7.43241 15.7599 6.89286C14.9693 6.35331 14.1172 5.93987 13.2036 5.65253C12.29 5.36518 11.3542 5.21633 10.3962 5.20595C9.43822 5.19555 8.49935 5.32407 7.57956 5.5915C6.6597 5.85896 5.79853 6.25381 4.99604 6.77606C4.19355 7.29831 3.48428 7.92548 2.86824 8.65756C2.25219 9.38965 1.7559 10.1951 1.37935 11.074L1.18601 11.5253ZM2.48927 11.0138L10.2934 14.3384L18.1708 11.1837C17.878 10.559 17.5137 9.97579 17.0781 9.43424C16.5396 8.76463 15.9151 8.18743 15.2048 7.70265C14.4945 7.21786 13.7289 6.84638 12.908 6.5882C12.0871 6.33003 11.2463 6.19627 10.3855 6.18693C9.52473 6.17759 8.68108 6.29307 7.85455 6.53339C7.028 6.77372 6.25418 7.12852 5.5331 7.59779C4.81201 8.06707 4.17469 8.63062 3.62113 9.28843C3.17347 9.82043 2.79618 10.3955 2.48927 11.0138Z" fill-rule="evenodd" fill="#00FFFF" ></path><path stroke="rgba(0, 255, 255, 1)" stroke-width="0.98" d="M0.802734 10.8286L10.2874 14.8692L20 10.9796"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,274 @@
<template>
<div class="tsdirectory">
<div class="box">
<div class="boxHeader nav">
<!-- <span></span> -->
<span class="label">{{ title }}</span>
<div class="close-box" @click="close">
<span class="close"></span>
<i>x</i>
</div>
</div>
<div class="boxBody">
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="80px"
@keyup.enter.native="submitForm(ruleForm)">
<el-form-item label="名称:" prop="sourceName">
<!-- @input="removeSpaces" -->
<el-input v-model.trim="form.sourceName" placeholder="图层文件夹"></el-input>
</el-form-item>
<el-form-item>
<div class="btnOption">
<el-button type="primary" @click="submitForm(ruleForm)">确定</el-button>
<el-button @click="cancel">取消</el-button>
</div>
</el-form-item>
</el-form>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import {$changeComponentPop} from '@/utils/communication'
import {throttle} from '@/utils/index'
import {ElMessage, FormInstance} from 'element-plus'
import {TreeApi} from '@/api/tree'
import {useTreeNode} from '@/views/components/tree/hooks/treeNode'
import {addMapSource} from "../entity";
const {getKeyOfSelectedNode, getSelectedNode, cusAddNodes, getSameLevel} = useTreeNode()
const title = ref('添加文件夹')
let form: any = reactive({
sourceName: '图层'
})
const ruleForm = ref()
const rules = reactive({
sourceName: [{required: true, message: '请输入名称', trigger: 'blur'}]
})
const removeSpaces = (value: string) => {
form.sourceName = value.replace(/\s/g, '')
}
const close = () => {
$changeComponentPop('.adddirectory', false)
}
const submitForm = async (formEl: FormInstance | undefined) => {
if (!formEl) return
await formEl.validate((valid, fields) => {
if (valid) {
add()
} else {
console.log('error submit!', fields)
}
})
}
const add = throttle(async () => {
let parentId = getKeyOfSelectedNode(window.treeObj, 'id')
let fnone = getSelectedNode(window.treeObj)
addMapSource({id: new YJ.Tools().randomString(), type: 'directory', pId: parentId}, res => {
if (res.code == 0 || res.code == 200) {
ElMessage({
message: '添加成功',
type: 'success'
})
cancel()
}
})
/* const res: any = await TreeApi.addDirectory({
id: new YJ.Tools().randomString(),
sourceName: form.sourceName,
parentId: parentId || undefined
})
console.log(res)
if (res.code == 0 || res.code == 200) {
const node = {
...res.data
}
let addNode = await cusAddNodes(window.treeObj, getSelectedNode(window.treeObj), [node], true) //添加节点
//获取该节点下的同级节点
const someNode: any = getSameLevel(window.treeObj, addNode[0])
console.log('someNode', someNode)
const newNode = someNode.map((item: any) => {
let index = item.getIndex()
item.treeIndex = index + 1
return {
...item,
treeIndex: item.getIndex()
}
})
ElMessage({
message: '添加成功',
type: 'success'
})
cancel()
} else {
ElMessage({
message: '添加失败',
type: 'error'
})
}*/
// console.log(res)
}, 3000)
////上传或修改树的层级
// const updateTree = async (newNode: any) => {
// const list = newNode.map((item: any) => {
// return {
// id: item.id,
// treeIndex: item.treeIndex,
// parentId: item.parentId
// }
// })
// console.log(list)
// const res = await TreeApi.updateTree({ list })
// if (res.code == 0) {
// ElMessage({
// message: '添加成功',
// type: 'success'
// })
// cancel()
// } else {
// ElMessage({
// message: '添加失败',
// type: 'error'
// })
// }
// }
const cancel = () => {
$changeComponentPop('.adddirectory', false)
form.sourceName = '图层'
ruleForm.value?.resetFields()
}
</script>
<style lang="scss">
.tsdirectory {
user-select: none;
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
.box {
width: 20vw;
height: 10vw;
display: flex;
flex-direction: column;
position: absolute;
left: 50%;
top: 45%;
transform: translate(-50%, -50%);
color: var(--color-sdk-auxiliary-public);
font-size: 14px;
// z-index: 999999;
background: linear-gradient(0deg, var(--color-sdk-bg-gradual)), rgba(0, 0, 0, 0.6);
border: 1.5px solid;
backdrop-filter: blur(2px);
border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1;
text-align: left;
font-family: 'sy-boldface';
.boxHeader {
display: flex;
justify-content: space-between;
font-size: 18px;
line-height: 46px;
padding: 5px 16px 5px 16px;
height: 46px;
.label {
font-family: 'Ali-mother-counts-bold';
font-size: 18px;
font-weight: 400;
color: rgba(255, 255, 255, 1);
text-align: left;
text-shadow: 0px 0px 9px rgb(20 118 255);
}
.close-box {
position: absolute;
top: -1px;
right: 0;
height: 30px;
cursor: pointer;
width: 30px;
border-radius: 0 0 0 90%;
overflow: hidden;
.close {
display: block;
width: 100%;
height: 100%;
background: rgba(var(--color-base1), 1);
opacity: 0.5;
}
i {
font-style: normal;
font-size: 18px;
font-weight: 900;
position: absolute;
top: -13px;
left: 11px;
}
}
}
.boxBody {
flex: auto;
flex-direction: column;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 20px;
.el-form--label-top .el-form-item__label {
padding: 0;
}
.el-form-item {
margin-bottom: 10px;
}
.el-form-item__label {
color: #fff;
}
.el-input__wrapper {
background-color: rgba(0, 0, 0, 0.5);
border: 0.2px solid rgba(var(--color-base1), 0.5);
box-shadow: 0 0 0 0.2px rgba(var(--color-base1), 0.5) inset !important;
/* 新增此行 */
}
.el-input__inner {
background-color: transparent;
color: #fff;
// border-color: rgba(var(--color-base1), 0.5) !important;
}
.btnOption {
margin-top: 5px;
text-align: right;
}
.el-button {
background: rgba(var(--color-base1), 0.2);
border-color: rgba(var(--color-base1), 0.5) !important;
color: #ffffff;
padding: 8px 16px;
}
.el-button:hover {
border-color: rgba(var(--color-base1), 1) !important;
}
}
}
}
</style>

View File

@ -64,29 +64,6 @@
<svg-icon class="subscript2" name="subscript2" :size="14" color="rgba(var(--color-base1), 1)"></svg-icon>
</div>
</div>
<svg>
<defs>
<linearGradient id="linear_border_2485_3" x1="59.5" y1="35.5" x2="59.5" y2="0.5"
gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="rgb(var(--color-base1))" />
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0" />
</linearGradient>
<linearGradient id="linear_fill_2485_4" x1="0" y1="34.101806640625" x2="102.996826171875"
y2="43.6986083984375" gradientUnits="userSpaceOnUse">
<stop offset="0.0625" stop-color="rgb(var(--color-base1))" />
<stop offset="1" stop-color="var(--color-border1)" />
</linearGradient>
</defs>
</svg>
<svg>
<defs>
<linearGradient id="linear_fill_2253_24_1" x1="61.658447265625" y1="35.5" x2="61.6580810546875" y2="0.5"
gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="rgba(var(--color-base1), 1)" stop-opacity="0.25" />
<stop offset="1" stop-color="rgba(var(--color-base1), 1)" stop-opacity="0" />
</linearGradient>
</defs>
</svg>
</div>
<div class="bottom_left" @click="fold">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"
@ -129,6 +106,28 @@
</defs>
</svg>
</div>
<svg>
<defs>
<linearGradient id="linear_border_2485_3" x1="59.5" y1="35.5" x2="59.5" y2="0.5" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="rgb(var(--color-base1))" />
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0" />
</linearGradient>
<linearGradient id="linear_fill_2485_4" x1="0" y1="34.101806640625" x2="102.996826171875" y2="43.6986083984375"
gradientUnits="userSpaceOnUse">
<stop offset="0.0625" stop-color="rgb(var(--color-base1))" />
<stop offset="1" stop-color="var(--color-border1)" />
</linearGradient>
</defs>
</svg>
<svg>
<defs>
<linearGradient id="linear_fill_2253_24_1" x1="61.658447265625" y1="35.5" x2="61.6580810546875" y2="0.5"
gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="rgba(var(--color-base1), 1)" stop-opacity="0.25" />
<stop offset="1" stop-color="rgba(var(--color-base1), 1)" stop-opacity="0" />
</linearGradient>
</defs>
</svg>
</div>
</template>
@ -397,6 +396,36 @@ const bottomMenuList = ref([
})
}
},
{
sourceName: '扇形',
key: 'DrawSector',
sourceType: 'sector',
className: 'public',
ref: ref(null),
fun: () => {
let Draw = new YJ.Draw.DrawSector(window.earth)
Draw.start(async (a, opt) => {
if (!opt) {
return
}
let id = new YJ.Tools().randomString()
let name = '扇形'
await addMapSource({
type: 'sector',
id: id,
sourceName: name,
opt: {
id: id,
name: name,
center: opt.center,
radius: opt.radius,
startAngle: opt.startAngle,
endAngle: opt.endAngle
}
})
})
}
},
{
sourceName: '集结地',
key: 'DrawAssemble',
@ -571,7 +600,7 @@ document.addEventListener('click', (e: any) => {
position: fixed;
height: 44px;
bottom: 1em;
left: 7vw;
left: 13vw;
}
.bottomMenu {
@ -723,7 +752,7 @@ document.addEventListener('click', (e: any) => {
.bottom_left {
position: fixed;
right: 18vw;
right: 13.5vw;
bottom: 1.5em;
height: 1.5vw;
width: 1.5vw;

View File

@ -190,6 +190,9 @@ const open = async (id: any, type: any) => {
else if(type && type === 'ellipse') {
title.value = '椭圆'
}
else if(type && type === 'sector') {
title.value = '扇形'
}
that = window.earth.entityMap.get(id)
originalOptions = structuredClone(that.options)
entityOptions.value = that

View File

@ -284,8 +284,8 @@ const goodsFilter = () => {
}
const goodsSelect = async (page) => {
let formData = new FormData()
formData.append('pageNum', 1)
formData.append('pageSize', 999999)
formData.append('pageNum', '1')
formData.append('pageSize', '999999')
formData.append('name', goodsKeywords.value)
const res = await MaterialApi.getList(formData)
if (res.code === 200) {

View File

@ -5,8 +5,8 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="32"
height="32"
viewBox="0 0 32 32"
height="34"
viewBox="0 0 32 34"
fill="none"
>
<path
@ -594,7 +594,7 @@ defineExpose({
right: 0;
top: 50%;
transform: translateY(-50%);
width: 18vw;
width: 17vw;
height: 33vw;
.box1 {

View File

@ -206,6 +206,11 @@ eventBus.on('openDialog', async (sourceType: any, id: any) => {
await nextTick()
dynamicComponentRef.value?.open(id, 'ellipse')
break
case 'sector':
currentComponent.value = circleObject
await nextTick()
dynamicComponentRef.value?.open(id, 'sector')
break
case 'rectangle':
currentComponent.value = polygonObject
await nextTick()