This commit is contained in:
zyl
2025-12-04 09:31:33 +08:00
71 changed files with 1078 additions and 633 deletions

View File

@ -1,4 +1,4 @@
import { app, shell, BrowserWindow, ipcMain, globalShortcut, dialog } from 'electron'
import { app, shell, BrowserWindow, ipcMain, globalShortcut, dialog, session } from 'electron'
import path, { join } from 'path'
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
import icon from '../../resources/earth.png?asset'
@ -82,6 +82,7 @@ let mainWindow;
let isSeverInit = false
let isAppInit = false
let severError:any = undefined
function createWindow(): void {
// Create the browser window.
@ -128,6 +129,19 @@ function createWindow(): void {
allowRunningInsecureContent: true
}
})
mainWindow.webContents.on('before-input-event', (event, input) => {
// 条件:仅按了 Alt 键(无其他键组合、不是组合键、不是重复按键)
if (
input.key === 'Alt' && // 按键是 Alt
!input.ctrl && // 未按 Ctrl
!input.shift && // 未按 Shift
!input.meta && // 未按 MetaWin/Mac
!input.isComposing && // 非输入法组合态
input.type === 'keyDown' // 仅拦截按下事件
) {
event.preventDefault(); // 阻止 Alt 键的默认行为(激活菜单)
}
});
let ymlBatPath = process.env.NODE_ENV === 'development' ? path.resolve(app.getAppPath(), 'resources', 'java', 'app', 'application.yml') : path.join(process.resourcesPath, 'app.asar.unpacked', 'resources', 'java', 'app', 'application.yml')
ymlBatPath = process.platform === 'win32' ? ymlBatPath.replace(/^(\w:)/, '/$1') : ymlBatPath
let ymlPath = ymlBatPath.substring(1, 200)
@ -159,7 +173,7 @@ function createWindow(): void {
ipcMain.on('splash-completed', () => {
// 启动页进度条已完成,可以关闭启动页并显示主窗口
if (isSeverInit) {
mainWindow.webContents.send('program-init')
mainWindow.webContents.send('program-init', severError)
}
isAppInit = true
setTimeout(() => {
@ -376,21 +390,103 @@ function createWindow(): void {
let _winMap = new Map();
// 监听渲染进程创建新窗口的请求
function createTempSession() {
// 生成唯一会话名称(避免冲突)
const sessionName = `temp-session-${Date.now()}-${Math.random().toString(36).slice(2)}`;
// 创建独立会话(基于默认分区,但命名唯一)
const tempSession = session.fromPartition(sessionName, {
cache: true, // 允许缓存,但会话独立
persistent: false // 非持久化,关闭后自动清理
});
// 清空会话初始缓存(确保无残留)
tempSession.clearStorageData({
storages: [
'appcache', 'cookies', 'localstorage', 'sessionstorage',
'indexdb', 'cachestorage', 'websql'
]
}).catch(err => console.error('清空临时会话缓存失败:', err));
return tempSession;
}
// @ts-ignore
ipcMain.handle('create-new-window', async (event, params, url, option, id) => {
// try {
// console.log('create-new-window', params, url, option, id)
// const newWindow = await new BrowserWindow(params)
// if (url) {
// await newWindow.loadURL(url)
// await newWindow.webContents.send("data", option)
// newWindow.on('closed', () => {
// _winMap.delete(id);
// // a.delete(newWindow.id)
// // closeCB(newWindow.id)
// });
// }
// _winMap.set(id, newWindow.id);
// return _winMap
// } catch (error) {
// console.error('创建窗口失败:', error);
// throw error; // 抛出错误以便渲染进程捕获
// }
try {
const newWindow = await new BrowserWindow(params)
if (url) {
await newWindow.loadURL(url)
await newWindow.webContents.send("data", option)
newWindow.on('closed', () => {
_winMap.delete(id);
// a.delete(newWindow.id)
// closeCB(newWindow.id)
});
// 1. 创建独立临时会话
const tempSession = createTempSession();
// 2. 合并窗口配置:注入独立会话
const windowConfig = {
...params,
webPreferences: {
...params.webPreferences,
session: tempSession, // 关键:使用独立会话
nodeIntegration: true,
contextIsolation: false,
devTools: true,
webSecurity: false,
allowRunningInsecureContent: true
}
};
// 3. 创建新窗口
const newWindow = new BrowserWindow(windowConfig);
// 4. 加载URL并发送初始化数据
if (url) {
await newWindow.loadURL(url);
await newWindow.webContents.send("data", option);
}
// 5. 窗口关闭时清理会话和映射
newWindow.on('closed', async () => {
_winMap.delete(id);
// 清空会话缓存并销毁
await tempSession.clearStorageData({
storages: ['all'] // 清空所有存储
});
// 解除会话引用触发GC
tempSession.clearCache();
session.removePartition(tempSession.getPartition());
});
// 6. 记录窗口映射
newWindow.webContents.on('before-input-event', (event, input) => {
// 条件:仅按了 Alt 键(无其他键组合、不是组合键、不是重复按键)
if (
input.key === 'Alt' && // 按键是 Alt
!input.control && // 未按 Ctrl
!input.shift && // 未按 Shift
!input.meta && // 未按 MetaWin/Mac
!input.isComposing && // 非输入法组合态
input.type === 'keyDown' // 仅拦截按下事件
) {
event.preventDefault(); // 阻止 Alt 键的默认行为(激活菜单)
}
});
_winMap.set(id, newWindow.id);
return _winMap
return _winMap;
} catch (error) {
console.error('创建窗口失败:', error);
throw error; // 抛出错误以便渲染进程捕获
@ -594,18 +690,30 @@ if (!gotTheLock) {
let string = data.toString().trim()
// console.log(`批处理输出: ${string}`);
// 临时处理:应用启动失败或项目文档地址出现时,认为服务初始化完成;后续需后端配合
if (string.indexOf('APPLICATION FAILED TO START') !== -1 || string.indexOf('项目文档地址') !== -1) {
if (string.indexOf('APPLICATION FAILED TO START') !== -1) {
severError = '后端服务未正常启动,尝试更换地址或端口'
if (!isSeverInit) {
isSeverInit = true
if (isAppInit) {
mainWindow.webContents.send('program-init')
mainWindow.webContents.send('program-init', severError)
}
}
}
else if (string.indexOf('项目文档地址') !== -1) {
if (!isSeverInit) {
isSeverInit = true
if (isAppInit) {
mainWindow.webContents.send('program-init', false)
}
}
}
});
ipcMain.on('judgment-isSeverInit', (event) => {
event.returnValue = isSeverInit
event.returnValue = {
isSeverInit: isSeverInit,
severError: severError
}
})
// 监听错误输出stderr

File diff suppressed because one or more lines are too long

View File

@ -55,6 +55,7 @@
.cesium-viewer-cesiumWidgetContainer {
position: relative;
overflow: hidden;
}
.cesium-viewer-cesiumWidgetContainer .cesium-widget:nth-of-type(1) {
@ -178,6 +179,7 @@
color: rgba(var(--color-base1), 1) !important;
cursor: pointer;
}
.YJ-custom-base-dialog button:not(button[disabled]):hover svg {
fill: rgba(var(--color-base1), 1) !important;
}
@ -341,7 +343,7 @@
.YJ-custom-base-dialog>.content input,
.YJ-custom-base-dialog>.content textarea {
font-size: 16px;
font-size: 14px;
background-color: rgba(0, 0, 0, 0.5);
border: 1px solid rgba(var(--color-base1), 0.5);
border-radius: 5px;
@ -2534,8 +2536,8 @@
.YJ-custom-base-dialog.polygon>.content .attribute-content-vr .table .tr .td:nth-child(3),
.YJ-custom-base-dialog.polygon>.content .attribute-content-rtmp .table .tr .th:nth-child(3),
.YJ-custom-base-dialog.polygon>.content .attribute-content-rtmp .table .tr .td:nth-child(3) {
flex: 0 0 165px;
width: 165px;
flex: 0 0 175px;
width: 175px;
justify-content: center;
}
@ -2618,8 +2620,8 @@
.YJ-custom-base-dialog.assemble>.content .attribute-content-vr .table .tr .td:nth-child(3),
.YJ-custom-base-dialog.assemble>.content .attribute-content-rtmp .table .tr .th:nth-child(3),
.YJ-custom-base-dialog.assemble>.content .attribute-content-rtmp .table .tr .td:nth-child(3) {
flex: 0 0 165px;
width: 165px;
flex: 0 0 175px;
width: 175px;
justify-content: center;
}
@ -2678,8 +2680,8 @@
.YJ-custom-base-dialog.pincerArrow>.content .attribute-content-vr .table .tr .td:nth-child(3),
.YJ-custom-base-dialog.pincerArrow>.content .attribute-content-rtmp .table .tr .th:nth-child(3),
.YJ-custom-base-dialog.pincerArrow>.content .attribute-content-rtmp .table .tr .td:nth-child(3) {
flex: 0 0 165px;
width: 165px;
flex: 0 0 175px;
width: 175px;
justify-content: center;
}
@ -2761,7 +2763,7 @@
/* 折线 */
.YJ-custom-base-dialog.polyline>.content {
width: 580px;
width: 600px;
}
.YJ-custom-base-dialog.polyline>.content>div #dashTextureDom {
@ -3796,7 +3798,7 @@
.yj-custom-icon {
display: inline-block;
width: 22px;
height: 10px;
height: 18px;
margin-right: 5px;
}

View File

@ -80,16 +80,16 @@ window.newFuzzySearch = function (
hideAllNode(allNodes)
nodeChildren.forEach((item) => {
if (item.oldname) {
item.sourceName = item.oldname
item.sourceName = item.oldname + ''
zTreeObj.updateNode(item)
}
if (contrast) {
if ((item.sourceName || '').indexOf(contrast) > -1) {
if (((item.sourceName || '')+'').indexOf(contrast) > -1) {
console.log('sourceName包含关键字')
console.log(item)
console.log(item.sourceName)
item.oldname = item.sourceName
item.oldname = item.sourceName + ''
item.highlight = true
let F = new RegExp(contrast, 'gi')
item.sourceName = item.oldname.replace(F, function (h) {

View File

@ -263,6 +263,8 @@ export default {
rtmp: 'rtmp',
: '物资',
: '编辑内容',
: '请输入设备名称进行搜索',
: '请输入物资名称进行搜索',
: '打开文本编辑器',
: '添加链接',
: '名称',

View File

@ -47,16 +47,16 @@ export default {
excel: 'Excel'
},
firstMenu: {
measure: 'measure',
tool: 'tool',
effect: 'effect',
measure: 'Measure',
tool: 'Tool',
effect: 'Special effects',
bigData: 'bigData',
modelLibrary: 'modelLibrary',
situation: 'situationLibrary',
modelLibrary: 'Model',
situation: 'Scheme',
onlinePictureSource: 'onlinePictureSource',
analysis: 'analysis',
analysis: 'Analyze',
militaryMark: 'militaryMark',
ersanwei: 'two and three-dimensional',
ersanwei: '2D/3D',
junbiao3d: '3D military logo'
},
effect: {
@ -155,7 +155,8 @@ export default {
authorize: 'Authorization Information',
setting: 'System settings',
project: 'Engineering Information',
device: 'device management',
device: 'Device management',
materials: 'Materials management',
modelManage: 'Model management',
graphLabelManage: 'Military Icon Management',
photoManage: 'Icon Management',
@ -262,6 +263,8 @@ export default {
rtmp: 'rtmp',
: 'Materials',
: 'Edit content',
: 'Please enter the device name to search',
: 'Please enter the materials name to search',
: 'Open the editor',
: 'Add Link',
: 'Name',

View File

@ -155,6 +155,7 @@ export default {
setting: '系統設置',
project: '工程管理',
device: '設備管理',
materials: '物資管理',
modelManage: '模型管理',
graphLabelManage: '軍標管理',
photoManage: '圖標管理',
@ -261,6 +262,8 @@ export default {
rtmp: 'rtmp',
: '物資',
: '編輯內容',
: '請輸入設備名稱進行搜索',
: '請輸入物資名稱進行搜索',
: '打開文本編輯器',
: '添加鏈接',
: '名稱',

View File

@ -27,6 +27,7 @@ export const TreeApi = {
url: `/source/addOtherSource`,
data
}).then((res) => {
ElMessage.closeAll()
ElMessage({
message: '添加成功',
type: 'success'
@ -50,6 +51,7 @@ export const TreeApi = {
url: `/source/update`,
data
}).then((res) => {
ElMessage.closeAll()
ElMessage({
message: '操作成功',
type: 'success'

View File

@ -654,6 +654,10 @@ img {
}
}
.jedate {
color: #000;
}
.custom-slider-tooltip {
display: block !important;
opacity: 1 !important;

View File

@ -44,12 +44,12 @@ service.interceptors.request.use(
const key = getRequestKey(config)
// 检查是否有相同请求正在进行
if (pendingRequests.has(key)) {
ElMessage({
message: '当前请求已存在,请稍后再试',
type: 'warning'
})
}
// if (pendingRequests.has(key)) {
// ElMessage({
// message: '当前请求已存在,请稍后再试',
// type: 'warning'
// })
// }
const controller = new AbortController()
config.signal = controller.signal

View File

@ -1,13 +1,13 @@
import {TreeApi} from '@/api/tree'
import {useTreeNode} from '../views/components/tree/hooks/treeNode'
import {initMapData} from './initMapData'
import { TreeApi } from '@/api/tree'
import { useTreeNode } from '../views/components/tree/hooks/treeNode'
import { initMapData } from './initMapData'
export const addMapSource = async ({type, id, sourceName = '未命名对象', opt = {}}) => {
const {cusAddNodes} = useTreeNode()
export const addMapSource = async ({ type, id, sourceName = '未命名对象', opt = {} }, cd:any = null) => {
const { cusAddNodes } = useTreeNode()
if (!id) {
id = new YJ.Tools().randomString()
}
let options: any = await initMapData(type, opt, null)
let options: any = await initMapData(type, opt, cd)
let selectedNodes = window.treeObj.getSelectedNodes()
let node = selectedNodes && selectedNodes[selectedNodes.length - 1]
function getParentId(nd: any) {
@ -15,7 +15,7 @@ export const addMapSource = async ({type, id, sourceName = '未命名对象', op
return nd.id
} else {
let parentNode = window.treeObj.getNodeByParam("id", nd.parentId, null);
if(parentNode) {
if (parentNode) {
return getParentId(parentNode)
}
else {
@ -28,7 +28,7 @@ export const addMapSource = async ({type, id, sourceName = '未命名对象', op
parentId = getParentId(node)
}
delete options.host
if(options.attribute && options.attribute.rtmp) {
if (options.attribute && options.attribute.rtmp) {
delete options.attribute.rtmp
}
switch (type) {

View File

@ -20,6 +20,7 @@ export const initMapData = async (type, data, cd) => {
case 'vrImage':
console.log(data, 'dataccccc')
entityObject = new YJ.Obj.BillboardObject(window.earth, data)
cd && cd(entityObject)
console.log('entityObject', entityObject)
// entityObject.options.billboard.defaultImage = ''
break
@ -62,11 +63,12 @@ export const initMapData = async (type, data, cd) => {
case 'terrain':
data.host = baseURL
entityObject = new YJ.Obj.Terrain(window.earth, data)
cd && cd(entityObject)
break
case 'layer':
data.host = baseURL
console.log('layer', data)
entityObject = new YJ.Obj.Layer(window.earth, data)
cd && cd(entityObject)
break
case 'gdslImagery':
data.host = baseURL
@ -177,11 +179,14 @@ export const initMapData = async (type, data, cd) => {
break
case 'geojson':
entityObject = new YJ.Obj.GeoJson(window.earth, data)
entityObject.on()
entityObject.on().then(()=>{
cd && cd(entityObject)
})
break
case 'vector':
let node = window.treeObj.getNodeByParam("id", data.id, null);
entityObject = renderVector(node, false)
cd && cd(entityObject)
break
default:
break

View File

@ -201,8 +201,8 @@ const moveDiv = () => {
newLeft = windowWidth - oMoveDivWidth
}
if (newTop <= 0) {
newTop = 0
if (newTop <= 97) {
newTop = 97
} else if (newTop + oMoveDivHeight > windowHeight) {
newTop = windowHeight - oMoveDivHeight
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -26,14 +26,17 @@
<span class="fankuai"></span>
{{ t('auths.authCode') }}
</div>
<div
class="auth_info_text"
<div class="auth_info_text">
<span @click="copy(authInfo.license_code)" style="cursor: pointer" title="点击可复制">{{
authInfo.license_code || ''
}}</span>
<svg-icon
name="copy"
@click="copy(authInfo.license_code)"
style="cursor: pointer"
title="点击可复制"
>
{{ authInfo.license_code || '' }}
<svg-icon name="copy" :size="20" style="margin-left: 30px"></svg-icon>
:size="20"
style="margin-left: 30px; cursor: pointer"
></svg-icon>
</div>
</div>
<div class="auth_info_box">
@ -522,8 +525,11 @@ const copy = async (text) => {
::v-deep .el-message-box {
--el-messagebox-title-color: #fff !important;
--el-messagebox-content-color: #fff !important;
background:
linear-gradient(180deg, rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0.2) 100%),
background: linear-gradient(
180deg,
rgba(var(--color-base1), 0) 0%,
rgba(var(--color-base1), 0.2) 100%
),
rgba(0, 0, 0, 0.6) !important;
}
@ -732,8 +738,11 @@ const copy = async (text) => {
.el-message-box {
--el-messagebox-title-color: #fff !important;
--el-messagebox-content-color: #fff !important;
background:
linear-gradient(180deg, rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0.2) 100%),
background: linear-gradient(
180deg,
rgba(var(--color-base1), 0) 0%,
rgba(var(--color-base1), 0.2) 100%
),
rgba(0, 0, 0, 0.6) !important;
.el-message-box__btns {

View File

@ -2,7 +2,8 @@
<div class="bottomMenuBox zIndex9" ref="bottomMenuBox">
<div class="animate__animated bottomMenu">
<div class="bottom_box" v-for="(item, i) of bottomMenuList" :key="i">
<div class="bottom_box_content" @click="addMarker(item, $event)" :title="t('bottomMenu.' + item.sourceType)">
<div class="bottom_box_content" @click="addMarker(item, $event)">
<el-tooltip :content="t('bottomMenu.' + item.sourceType)" effect="customized" placement="top" :hide-after="0">
<svg class="bottom_box_bg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="117.030029296875" height="44" viewBox="0 0 117.030029296875 44" fill="none"
preserveAspectRatio="none">
@ -18,6 +19,8 @@
</linearGradient>
</defs>
</svg>
</el-tooltip>
<svg class="bottom_box_bg bottom_box_bg_hover" style="opacity: 0;" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" width="118.09130859375" height="45"
viewBox="0 0 118.09130859375 45" fill="none" preserveAspectRatio="none">
@ -39,16 +42,16 @@
</div>
</div>
<div class="bottom_children" v-if="item.children" v-show="item.childrenShow">
<div class="bottom_childre_box" v-for="(item2, m) of item.children" :key="m"
@click="addMarker(item2, $event)" :title="t('bottomMenu.' + item2.sourceType)">
<div class="bottom_childre_box" v-for="(item2, m) of item.children" :key="m" @click="addMarker(item2, $event)">
<el-tooltip :content="t('bottomMenu.' + item2.sourceType)" effect="customized" placement="top" :hide-after="0">
<svg class="bottom_childre_box_bg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" width="6vw" height="44.5" viewBox="0 0 119 35.5" fill="none"
preserveAspectRatio="none">
<path d="M11 0.5L108 0.5L118 35.5L1 35.5L11 0.5Z" stroke="url(#linear_border_2485_3)" stroke-width="1"
fill="#000000" fill-opacity="0.5" />
<path d="M118 34.5L1 34.5L0 36.5L119 36.5L118 34.5Z" fill-rule="evenodd"
fill="url(#linear_fill_2485_4)" />
<path d="M118 34.5L1 34.5L0 36.5L119 36.5L118 34.5Z" fill-rule="evenodd" fill="url(#linear_fill_2485_4)" />
</svg>
</el-tooltip>
<svg class="bottom_childre_box_bg bottom_childre_box_bg_hover" style="opacity: 0;"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="118.32568359375"
height="36" viewBox="0 0 118.32568359375 36" fill="none" preserveAspectRatio="none">
@ -195,28 +198,28 @@ const bottomMenuList = ref([
let id = new YJ.Tools().randomString()
let name = t(`default.point`)
let defaultStyle = (JSON.parse(localStorage.getItem('defaultStyle') || '{}').point) || {}
if(!defaultStyle) {
if (!defaultStyle) {
defaultStyle = {}
}
if(!defaultStyle.billboard) {
if (!defaultStyle.billboard) {
defaultStyle.billboard = {}
}
if(!defaultStyle.label) {
if (!defaultStyle.label) {
defaultStyle.label = {}
}
if(defaultStyle.billboard.image) {
if (defaultStyle.billboard.image) {
try {
let urlObject = new URL(defaultStyle.billboardimage)
let pathname = urlObject.pathname
let folderName = pathname.split('/')[1]
if(folderName === 'iconLibrary') {
if (folderName === 'iconLibrary') {
let ip = localStorage.getItem('ip') || ''
let ipObject = new URL(ip)
urlObject.port = ipObject.port
defaultStyle.billboard.image = urlObject.href
}
else {
urlObject.port = availablePort.value+''
urlObject.port = availablePort.value + ''
defaultStyle.billboard.image = urlObject.href
}
} catch (error) {
@ -659,6 +662,14 @@ document.addEventListener('click', (e: any) => {
height: 44px;
bottom: 1em;
left: 13vw;
:deep(.el-tooltip__trigger) {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
pointer-events: all;
}
}
.bottomMenu {

View File

@ -5,14 +5,17 @@
<span class="fankuai"></span>
{{ t('auths.authCode') }}
</div>
<div
class="auth_info_text"
<div class="auth_info_text">
<span @click="copy(authInfo.license_code)" title="点击可复制" style="cursor: pointer">{{
authInfo.license_code || ''
}}</span>
<svg-icon
name="copy"
@click="copy(authInfo.license_code)"
style="cursor: pointer"
title="点击可复制"
>
{{ authInfo.license_code || '' }}
<svg-icon name="copy" :size="20" style="margin-left: 30px"></svg-icon>
:size="20"
style="margin-left: 30px; cursor: pointer"
></svg-icon>
</div>
</div>
<div class="auth_info_box">
@ -113,7 +116,6 @@ const getStatus = () => {
const getAuthCode = async () => {
const res = await AuthApi.authInfo()
authInfo.value.license_code = res.data
console.log(res, '码')
}
getAuthInfo()
getAuthCode()
@ -122,10 +124,8 @@ getAuthCode()
const copy = async (text) => {
try {
await toClipboard(text)
console.log('复制成功')
ElMessage.success('复制成功')
} catch (e) {
console.error('复制失败', e)
ElMessage.error('复制失败')
}
}

View File

@ -79,7 +79,7 @@
<template #icon>
<svg-icon name="POI" />
</template>
<span>POI导入</span>
<span>POIL导入</span>
</el-button>
</div>
<div class="fileList" v-if="poiList.length">

View File

@ -2,17 +2,6 @@
<div class="model-management-container">
<div class="equipment_title" style="margin-bottom: 10px">
<div>
<el-button
color="#004b4b"
style="border: 1px solid rgba(var(--color-base1), 0.5)"
@click="importModelDB"
>
<template #icon>
<svg-icon name="select" />
</template>
<span>选择军标库</span>
</el-button>
<el-button
color="#004b4b"
style="border: 1px solid rgba(var(--color-base1), 0.5)"
@ -23,6 +12,16 @@
</template>
<span>创建军标库</span>
</el-button>
<el-button
color="#004b4b"
style="border: 1px solid rgba(var(--color-base1), 0.5)"
@click="importModelDB"
>
<template #icon>
<svg-icon name="select" />
</template>
<span>选择军标库</span>
</el-button>
</div>
<el-input

View File

@ -2,17 +2,6 @@
<div class="model-management-container">
<div class="equipment_title" style="margin-bottom: 10px">
<div>
<el-button
color="#004b4b"
style="border: 1px solid rgba(var(--color-base1), 0.5)"
@click="importModelDB"
>
<template #icon>
<svg-icon name="select" />
</template>
<span>选择图标库</span>
</el-button>
<el-button
color="#004b4b"
style="border: 1px solid rgba(var(--color-base1), 0.5)"
@ -23,6 +12,16 @@
</template>
<span>创建图标库</span>
</el-button>
<el-button
color="#004b4b"
style="border: 1px solid rgba(var(--color-base1), 0.5)"
@click="importModelDB"
>
<template #icon>
<svg-icon name="select" />
</template>
<span>选择图标库</span>
</el-button>
</div>
<el-input
v-model="photoName"

View File

@ -658,7 +658,7 @@ const intoBack = async () => {
let _winMap = await ipcRenderer.invoke('get-_winMap')
if (!_winMap.has(id)) {
try {
const windowId = await ipcRenderer.invoke(
let windowId = await ipcRenderer.invoke(
'create-new-window',
{
title: '后台管理',
@ -683,10 +683,11 @@ const intoBack = async () => {
devTools: true
}
},
`http://localhost:${availablePort}/backManage/index.html#/login`,
`http://localhost:${availablePort}/backManage/index.html#/login?timestamp=${Date.now()}`,
{},
id
)
console.log('windowId', windowId, id)
} catch (error) {
console.error('创建窗口失败:', error)
}

View File

@ -1,5 +1,5 @@
<template>
<div class="set_pup">
<div class="set_pup" :class="{'dialog-en': isEN}">
<el-dialog
v-model="isShowPup"
:modal="true"
@ -135,10 +135,11 @@ import photoManage from './components/photoManage.vue'
import { useI18n } from 'vue-i18n'
const eventBus: any = inject('bus')
const { t } = useI18n()
const { t, locale } = useI18n()
const tabPosition = ref('left')
const activeName = ref('authorize')
const isShowPup = ref(false)
const isEN = ref(false)
const open = (data) => {
isShowPup.value = true
if (data !== 'current') {
@ -163,6 +164,25 @@ const close = () => {
isShowPup.value = false
}
onMounted(() => {
// 可以在这里添加初始化逻辑
if(locale.value === 'zh-EN') {
isEN.value = true
}
else {
isEN.value = false
}
})
watch(locale, ()=>{
if(locale.value === 'zh-EN') {
isEN.value = true
}
else {
isEN.value = false
}
})
defineExpose({
open,
close
@ -182,6 +202,7 @@ defineExpose({
),
rgba(0, 0, 0, 0.6);
border: 1px solid var(--color-border1);
padding-left: 0px;
// padding-left: 0 !important;
}
@ -308,14 +329,18 @@ defineExpose({
:deep(.el-tabs__item) {
width: 8vw;
color: #fff !important;
font-size: 1.1rem;
font-family: 黑体;
font-size: 0.9rem;
font-family: SourceHanSansTi;
font-weight: 500;
display: flex;
line-height: 38px;
display: block;
align-items: center;
justify-content: center;
text-align: center;
margin-bottom: 3px;
box-sizing: border-box;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
:deep(.el-tabs__item:hover) {
@ -366,4 +391,10 @@ defineExpose({
}
}
}
.set_pup.dialog-en {
:deep(.el-tabs__item) {
text-align: left;
}
}
</style>

View File

@ -2,9 +2,10 @@
<div class="leftBox" ref="leftBoxRef">
<div class="left animate__animated">
<div class="menus">
<div class="menus_itemBox" v-for="(item, index) in menuList" :title="t(`firstMenu.${item.name}`)">
<div class="menus_itemBox" v-for="(item, index) in menuList">
<el-tooltip :content="t(`firstMenu.${item.name}`)" effect="customized" placement="top" :hide-after="0">
<div class="item_icon" @click="(e) => {
handleClick(item, e)
handleClick(item, index, e)
}
">
<!-- <svg class="item_icon_bg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
@ -56,6 +57,8 @@
{{ t(`firstMenu.${item.name}`) }}
</div>
</div>
</el-tooltip>
</div>
<leftSideSecond class="absolute zIndex99 leftSideSecond" ref="leftSideSecondRef"></leftSideSecond>
</div>
@ -264,10 +267,12 @@ onMounted(() => {
document.addEventListener('click', handleClickOutside, true);
})
const leftSideSecondRef = ref()
const handleClick = (item: any, e) => {
console.log('点击了', item, e)
const handleClick = (item: any, index, e) => {
console.log('点击了', item, e, index)
$('.leftSideSecond')[0].style.left = '100%'
$('.leftSideSecond')[0].style.top = e.layerY - 120 + 'px'
// $('.leftSideSecond')[0].style.top = e.layerY + 120 + 'px'
$('.leftSideSecond')[0].style.top = `calc(${index} * 6.32vh)`
$('.leftSideSecond')[0].style.transform = 'translateY(calc(2.6vh - 50%))';
$('.leftSideSecond')[0].style.display = 'none'
if (item.children.length) {
$('.leftSideSecond')[0].style.display = 'block'

View File

@ -1,5 +1,5 @@
<template>
<Dialog ref="baseDialog" :title="title+'属性'" left="180px" top="100px" className="circle" :closeCallback="closeCallback">
<Dialog ref="baseDialog" :title="title + '属性'" left="180px" top="100px" className="circle" :closeCallback="closeCallback">
<template #content>
<span class="custom-divider"></span>
<div class="div-item">
@ -31,6 +31,7 @@
<attribute :entityOptions="entityOptions"></attribute>
</el-tab-pane>
<el-tab-pane label="空间信息" name="2">
<div class="div-item">
<div class="row">
<div class="col height-mode-box">
<span class="label" style="flex: 0 0 56px;">高度模式</span>
@ -43,7 +44,8 @@
<div class="col">
<span class="label">Z值统一增加</span>
<div class="input-number input-number-unit-1 height-box" :class="{ 'disabled': heightMode == 2 }">
<input class="input height" type="number" title="" min="-9999999" max="999999999" v-model="height" @input="$handleInputLimit">
<input class="input height" type="number" title="" min="-9999999" max="999999999" v-model="height"
@input="$handleInputLimit">
<span class="unit">m</span>
<span class="arrow"></span>
</div>
@ -66,12 +68,14 @@
<div class="td">圆心坐标</div>
<div class="td lng align-center" @dblclick="inputDblclick($event, 1, 'lng')">
<input class="input" @blur="inputBlurCallBack($event, 1, 'lng', 8)" type="number"
v-model="entityOptions.center.lng" min="-180" max="180" v-if="activeTd.index == 1 && activeTd.name == 'lng'" @input="$handleInputLimit">
v-model="entityOptions.center.lng" min="-180" max="180"
v-if="activeTd.index == 1 && activeTd.name == 'lng'" @input="$handleInputLimit">
<span style="pointer-events: none;" v-else>{{ entityOptions.center.lng.toFixed(8) }}</span>
</div>
<div class="td lat align-center" @dblclick="inputDblclick($event, 1, 'lat')">
<input class="input" @blur="inputBlurCallBack($event, 1, 'lat', 8)" type="number"
v-model="entityOptions.center.lat" min="-180" max="180" v-if="activeTd.index == 1 && activeTd.name == 'lat'" @input="$handleInputLimit">
v-model="entityOptions.center.lat" min="-180" max="180"
v-if="activeTd.index == 1 && activeTd.name == 'lat'" @input="$handleInputLimit">
<span style="pointer-events: none;" v-else>{{ entityOptions.center.lat.toFixed(8) }}</span>
</div>
<div class="td alt align-center" @dblclick="inputDblclick($event, 1, 'alt')">
@ -84,6 +88,7 @@
</div>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="面风格" name="3">
<div class="row">
@ -98,7 +103,8 @@
<div class="col">
<span class="label">描边宽度</span>
<div class="input-number input-number-unit-2">
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth" @input="$handleInputLimit">
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth"
@input="$handleInputLimit">
<span class="unit">px</span>
<span class="arrow"></span>
</div>
@ -124,7 +130,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>
@ -186,13 +192,13 @@ let originalOptions: any
let that: any
const open = async (id: any, type: any) => {
if(type && type === 'circle') {
if (type && type === 'circle') {
title.value = '圆'
}
else if(type && type === 'ellipse') {
else if (type && type === 'ellipse') {
title.value = '椭圆'
}
else if(type && type === 'sector') {
else if (type && type === 'sector') {
title.value = '扇形'
}
that = window.earth.entityMap.get(id)
@ -273,7 +279,7 @@ const heightConfirm = () => {
}
}
const inputDblclick = async (event, i, anme) => {
if(heightMode.value == 2) {
if (heightMode.value == 2) {
return
}
activeTd.value = {
@ -378,4 +384,15 @@ defineExpose({
})
</script>
<style scoped lang="scss"></style>
<style scoped lang="scss">
.circle.dialog-en {
::v-deep>.content {
.attribute-content-link .table .tr .td.operation button,
.attribute-content-vr .table .tr .td.operation button,
.attribute-content-rtmp .table .tr .td.operation button {
width: 76px !important;
flex: 0 0 76px !important;
}
}
}</style>

View File

@ -63,6 +63,7 @@
:min="0"
:max="maxNum"
placement="bottom"
style="max-width: 100%"
@change="precisionInput"
:show-tooltip="false"
popper-class="custom-tooltip"
@ -167,6 +168,7 @@ const draw = (e) => {
//滑块
var maxNum: any = ref(100)
var maxNumBar: any = ref(100)
const updateDataAttr = async () => {
await nextTick()
const sliderButton = document.querySelector('.el-slider__button-wrapper')
@ -183,7 +185,18 @@ const precisionMaxInput = () => {
}
// cutFill.heights = maxNum.value
}
watch(
() => maxNum.value,
(x, j) => {
if (!x) {
maxNum.value = 1
}
// if (precision.value != x) {
// visibility.precisions = x
// precision.value = x
// }
}
)
defineExpose({
open
})

View File

@ -191,6 +191,14 @@ const precisionMaxInput = () => {
}
// cutFill.heights = height.value
}
watch(
() => maxNum.value,
(x, j) => {
if (!x) {
maxNum.value = 1
}
}
)
const precisionInput = () => {
// let dom = document.getElementById('precision')
// if (precision.value < dom.min * 1) {

View File

@ -15,7 +15,7 @@
<button @click="draw">
<svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>重新绘制
</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -251,7 +251,7 @@
<span class="custom-divider" style="order: 10; margin-top: 12px"></span>
</template>
<template #footer>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -91,11 +91,11 @@
</div>
<div style="display: flex; margin-bottom: 12px; align-items: center">
<span class="label" style="flex: 0 0 60px">经度(x)</span>
<input class="input right-x" readonly />
<input class="input right-x" type="number" readonly />
</div>
<div style="display: flex; margin-bottom: 10px; align-items: center">
<span class="label" style="flex: 0 0 60px">纬度(y)</span>
<input class="input right-y" readonly />
<input class="input right-y" type="number" readonly />
</div>
</div>
</div>
@ -103,7 +103,7 @@
<span class="custom-divider"></span>
</template>
<template #footer>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -43,7 +43,7 @@
</div>
</template>
<!-- <template #footer>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template> -->
</Dialog>
</template>

View File

@ -90,7 +90,7 @@
</button>
</div>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -147,7 +147,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>
@ -401,4 +401,15 @@ defineExpose({
})
</script>
<style scoped lang="scss"></style>
<style scoped lang="scss">
.attackArrow.dialog-en {
::v-deep>.content {
.attribute-content-link .table .tr .td.operation button,
.attribute-content-vr .table .tr .td.operation button,
.attribute-content-rtmp .table .tr .td.operation button {
width: 76px !important;
flex: 0 0 76px !important;
}
}
}
</style>

View File

@ -47,15 +47,15 @@
</div>
<div class="td" v-else>{{ item.url }}</div>
<div class="td operation" v-if="linkEditActive.index === index">
<button style="width: 76px;flex: 0 0 76px" @click="linkConfirmEdit(index)">{{
<button @click="linkConfirmEdit(index)">{{
t('general.确认')
}}
</button>
<button style="width: 76px;flex: 0 0 76px" @click="linkCancelEdit">{{ t('general.取消') }}</button>
<button @click="linkCancelEdit">{{ t('general.取消') }}</button>
</div>
<div class="td operation" v-else>
<button style="width: 76px;flex: 0 0 76px" @click="linkEdit(index, item)">{{ t('general.编辑') }}</button>
<button style="width: 76px;flex: 0 0 76px" @click="linkDelete(index)">{{ t('general.删除') }}</button>
<button @click="linkEdit(index, item)">{{ t('general.编辑') }}</button>
<button @click="linkDelete(index)">{{ t('general.删除') }}</button>
</div>
</div>
</div>
@ -69,7 +69,7 @@
<div class="row">
<div class="col">
<span class="label">{{ t('general.编辑内容') }}</span>
<input class="input" type="text" v-model="cameraParams.keyWord" style="width: 180px;margin-right: 10px;"/>
<input class="input" type="text" :placeholder="t('general.请输入设备名称进行搜索')" v-model="cameraParams.keyWord" style="width: 180px;margin-right: 10px;"/>
<button class="select btn" @click="cameraSelect({page: 1, limit: cameraParams.pageSize })">
{{ t('general.搜索') }}
</button>
@ -244,7 +244,7 @@
<div class="row">
<div class="col">
<span class="label">{{ t('general.编辑内容') }}</span>
<input class="input goods-select-input" type="text" placeholder="请输入关键字" style="width: 180px;margin-right: 10px;"
<input class="input goods-select-input" type="text" :placeholder="t('general.请输入物资名称进行搜索')" style="width: 180px;margin-right: 10px;"
v-model="goodsKeywords">
<button class="select btn" @click="goodsFilter">{{ t('general.搜索') }}</button>
</div>
@ -388,8 +388,8 @@ const cameraSelect = ({page, limit}) => {
if (res.code === 0 || res.code === 200) {
if (res.data) {
cameraParams.value.total = res.data.total
if (res.data.records && res.data.records.length > 0) {
cameraList.value = res.data.records
if (res.data.records && res.data.records.length > 0) {
for (let i = 0; i < cameraList.value.length; i++) {
cameraList.value[i].checked = false
for (let j = 0; j < props.entityOptions.attributeCamera.length; j++) {
@ -724,8 +724,8 @@ const changeAttributeCamera = (e) => {
.YJ-custom-base-dialog > .content .attribute-content-vr .table .tr .td:nth-child(1),
.YJ-custom-base-dialog > .content .attribute-content-rtmp .table .tr .th:nth-child(1),
.YJ-custom-base-dialog > .content .attribute-content-rtmp .table .tr .td:nth-child(1) {
width: 164px;
flex: 0 0 164px;
width: 150px;
flex: 0 0 150px;
}
.YJ-custom-base-dialog > .content .attribute-content-link .table .tr .th:nth-child(2),
@ -744,21 +744,21 @@ const changeAttributeCamera = (e) => {
.YJ-custom-base-dialog > .content .attribute-content-vr .table .tr .td:nth-child(3),
.YJ-custom-base-dialog > .content .attribute-content-rtmp .table .tr .th:nth-child(3),
.YJ-custom-base-dialog > .content .attribute-content-rtmp .table .tr .td:nth-child(3) {
flex: 0 0 150px;
width: 150px;
flex: 0 0 175px;
width: 175px;
justify-content: center;
}
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-link .table .tr .th:nth-child(3),
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-link .table .tr .td:nth-child(3),
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-vr .table .tr .th:nth-child(3),
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-vr .table .tr .td:nth-child(3),
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-rtmp .table .tr .th:nth-child(3),
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-rtmp .table .tr .td:nth-child(3) {
flex: 0 0 190px;
width: 190px;
justify-content: center;
}
// .YJ-custom-base-dialog.dialog-en > .content .attribute-content-link .table .tr .th:nth-child(3),
// .YJ-custom-base-dialog.dialog-en > .content .attribute-content-link .table .tr .td:nth-child(3),
// .YJ-custom-base-dialog.dialog-en > .content .attribute-content-vr .table .tr .th:nth-child(3),
// .YJ-custom-base-dialog.dialog-en > .content .attribute-content-vr .table .tr .td:nth-child(3),
// .YJ-custom-base-dialog.dialog-en > .content .attribute-content-rtmp .table .tr .th:nth-child(3),
// .YJ-custom-base-dialog.dialog-en > .content .attribute-content-rtmp .table .tr .td:nth-child(3) {
// flex: 0 0 190px;
// width: 190px;
// justify-content: center;
// }
.YJ-custom-base-dialog > .content .attribute-content-link .table .tr .td .input-group .input,
.YJ-custom-base-dialog > .content .attribute-content-vr .table .tr .td .input-group .input,

View File

@ -26,11 +26,61 @@
<div class="row coordinate-select-box">
<div class="lable-left-line">
{{ t('dialog.point.转换坐标选择') }}
<el-select class="input input-select coordinate-select" style="width: 155px; margin-left: 20px"
<el-select style="width: 155px; margin-left: 20px;" v-model="coordinate" @change="coordinateChange">
<div class="group-header" :class="name_map1.filter((item) => {
return item.epsg == coordinate
}).length > 0
? 'arrowActive'
: ''
" @click="toggleGroup('hot')">
地理坐标系
<svg-icon v-if="isHotGroupOpen" name="arrow2" :size="10" :color="name_map1.filter((item) => {
return item.epsg == coordinate
}).length > 0
? 'rgba(0, 255, 255, 1)'
: 'rgba(255, 255, 255, 1)'
" style="margin-left: 10px"></svg-icon>
<svg-icon v-else name="arrow1" :size="10" :color="name_map1.filter((item) => {
return item.epsg == coordinate
}).length > 0
? 'rgba(0, 255, 255, 1)'
: 'rgba(255, 255, 255, 1)'
" style="margin-left: 10px"></svg-icon>
</div>
<div v-show="isHotGroupOpen">
<el-option v-for="item in name_map1" :key="item.epsg" :label="item.name"
:value="item.epsg"></el-option>
</div>
<div class="group-header" :class="name_map2.filter((item) => {
return item.epsg == coordinate
}).length > 0
? 'arrowActive'
: ''
" @click="toggleGroup('ty')">
投影坐标系
<svg-icon v-if="isHotGroupOpen2" name="arrow2" :size="10" :color="name_map2.filter((item) => {
return item.epsg == coordinate
}).length > 0
? 'rgba(0, 255, 255, 1)'
: 'rgba(255, 255, 255, 1)'
" style="margin-left: 10px"></svg-icon>
<svg-icon v-else name="arrow1" :size="10" :color="name_map2.filter((item) => {
return item.epsg == coordinate
}).length > 0
? 'rgba(0, 255, 255, 1)'
: 'rgba(255, 255, 255, 1)'
" style="margin-left: 10px"></svg-icon>
</div>
<div v-show="isHotGroupOpen2">
<el-option v-for="item in name_map2" :key="item.epsg" :label="item.name"
:value="item.epsg"></el-option>
</div>
</el-select>
<!-- <el-select class="input input-select coordinate-select" style="width: 155px; margin-left: 20px"
v-model="coordinate" @change="coordinateChange" placeholder="请选择">
<el-option v-for="item in epsg_map" :key="item.epsg" :label="item.name" :value="item.epsg">
</el-option>
</el-select>
</el-select> -->
</div>
</div>
</div>
@ -352,7 +402,7 @@
</div>
<button @click="remove">{{ t('general.删除') }}</button>
<button @click="confirm">{{ t('general.确定') }}</button>
<button @click="close">{{ t('general.关闭') }}</button>
<button @click="close">{{ t('general.取消') }}</button>
</template>
</Dialog>
</template>
@ -375,6 +425,31 @@ const { cusUpdateNode, getSelectedNodes, cusRemoveNode } = useTreeNode()
const baseDialog: any = ref(null)
const eventBus: any = inject('bus')
const name_map: any = ref([])
const name_map1: any = ref([])
const name_map2: any = ref([
{
epsg: 'EPSG:32601',
name: 'WGS84 通用横轴墨卡托投影'
},
{
epsg: 'EPSG:4534',
name: '2000 坐标 3 度不带代号'
},
{
epsg: 'EPSG:4513',
name: '2000 坐标 3 度带代号'
},
{
epsg: 'EPSG:4502',
name: '2000 坐标 6 度不带代号'
},
{
epsg: 'EPSG:4491',
name: '2000 坐标 6 度带代号'
}
])
const epsg_map = ref([
{
name: 'WGS 84 / UTM zone 3N',
@ -390,6 +465,10 @@ for (const [key, value] of window.earth.proj.epsg_map) {
}
epsg_map.value = array
let tool = new YJ.Tools(window.earth)
name_map.value = Array.from(tool.name_map.values())
name_map1.value = name_map.value.splice(0, 2)
const format1 = ref(true)
const format2 = ref(false)
const format3 = ref(false)
@ -434,6 +513,9 @@ const x = ref()
const y = ref()
const z = ref()
const coordinate = ref('EPSG:4326')
const isHotGroupOpen: any = ref(true)
const isHotGroupOpen2: any = ref(false)
const showPosiType: any = ref(false)
const heightMode = ref(0)
const labelColorRef = ref(null)
const sourceType = ref('')
@ -454,6 +536,13 @@ const open = async (id, type) => {
baseDialog.value?.open()
await nextTick()
let data = name_map1.value.filter((item) => item.epsg === coordinate.value)
showPosiType.value = data.length
if (data.length) {
isHotGroupOpen.value = true
} else {
isHotGroupOpen2.value = true
}
let labelColorPicker = new window.YJColorPicker({
el: labelColorRef.value,
size: 'mini', //颜色box类型
@ -519,6 +608,11 @@ const closeCallback = () => {
eventBus?.emit('destroyComponent')
}
const toggleGroup = (type: string) => {
if (type === 'hot') isHotGroupOpen.value = !isHotGroupOpen.value
if (type === 'ty') isHotGroupOpen2.value = !isHotGroupOpen2.value
}
const changeName = (e) => {
entityOptions.value.labelText = e.target.value
}
@ -771,7 +865,7 @@ defineExpose({
}
::v-deep>.content {
width: 590px;
width: 600px;
.title1 {
width: 46%;
@ -802,7 +896,7 @@ defineExpose({
.billboard-object.dialog-en {
::v-deep>.content {
width: 690px;
width: 660px;
.title1 {
width: 40%;

View File

@ -103,7 +103,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -59,13 +59,13 @@
<div class="row">
<div class="col">
<span class="label">线段缓冲</span>
<input class="btn-switch" type="checkbox" v-model="entityOptions.extend" @change="lineExtendchange"/>
<input class="btn-switch" type="checkbox" v-model="entityOptions.extend" @change="lineExtendchange" />
</div>
<div class="col" style="flex: 0 0 33%">
<span class="label">缓冲宽度</span>
<div class="input-number input-number-unit-1" style="width: 80px">
<input class="input" type="number" title="" min="0" data-min="0.01" max="999999"
@input="$handleInputLimit" v-model="entityOptions.extendWidth" />
<input class="input" type="number" title="" min="0" data-min="0.01" max="999999" @input="$handleInputLimit"
v-model="entityOptions.extendWidth" />
<span class="unit">m</span>
<span class="arrow"></span>
</div>
@ -190,7 +190,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>
@ -383,7 +383,7 @@ const open = async (id, type) => {
const heightModeChange = (val) => {
that.heightMode = heightMode.value
// @ts-ignore
if(heightMode.value === 0 || heightMode.value === '0' || heightMode.value === 1 || heightMode.value === '1') {
if (heightMode.value === 0 || heightMode.value === '0' || heightMode.value === 1 || heightMode.value === '1') {
entityOptions.value.extend = false
}
}
@ -425,8 +425,8 @@ const changeWordsName = (val) => {
const lineTypechange = () => { }
const lineExtendchange = (e)=>{
if(e.target.checked) {
const lineExtendchange = (e) => {
if (e.target.checked) {
heightMode.value = 2
}
}
@ -554,4 +554,14 @@ defineExpose({
}
}
}
.polyline.dialog-en {
::v-deep>.content {
.attribute-content-link .table .tr .td.operation button,
.attribute-content-vr .table .tr .td.operation button,
.attribute-content-rtmp .table .tr .td.operation button {
width: 76px !important;
flex: 0 0 76px !important;
}
}
}
</style>

View File

@ -56,7 +56,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -36,7 +36,7 @@
</template>
<template #footer>
<button @click="sure">确认</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -76,7 +76,7 @@
<template #footer>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -194,7 +194,7 @@
<button @click="returnY"><svg-icon name="yaxis" :size="12"></svg-icon>Y轴翻转</button>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -74,7 +74,7 @@
</template>
<template #footer>
<button @click="save">保存</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -1,6 +1,5 @@
<template>
<Dialog ref="baseDialog" title="贴地文字属性" left="180px" top="100px" className="ground-text"
:closeCallback="closeCallback">
<Dialog ref="baseDialog" title="贴地文字属性" left="180px" top="100px" className="ground-text" :closeCallback="closeCallback">
<template #content>
<span class="custom-divider"></span>
<div class="div-item">
@ -11,8 +10,7 @@
</div>
<div class="col">
<span class="label">颜色</span>
<div class="color" ref="colorRef" </div>
</div>
<div class="color" ref="colorRef"></div>
</div>
</div>
<span class="custom-divider"></span>
@ -25,7 +23,8 @@
</div>
<div class="col">
<span class="label">纬度</span>
<input class="input" type="number" title="" min="-90" max="90" v-model="entityOptions.lat" @input="$handleInputLimit">
<input class="input" type="number" title="" min="-90" max="90" v-model="entityOptions.lat"
@input="$handleInputLimit">
</div>
</div>
</div>
@ -37,8 +36,8 @@
<input type="range" max="360" min="0" step="1" v-model="entityOptions.angle">
<div class="input-number input-number-unit"
style="width: 100px;flex: 0 0 100px;margin-left: 10px;">
<input class="input" type="number" title="" min="0" max="360" step="1" @input="$handleInputLimit"
v-model="entityOptions.angle">
<input class="input" type="number" title="" min="0" max="360" step="1"
@input="$handleInputLimit" v-model="entityOptions.angle">
<span class="unit">°</span>
<span class="arrow"></span>
</div>
@ -60,14 +59,15 @@
<span class="label">滚动速度</span>
<input type="range" max="100" min="0" step="1" v-model="entityOptions.speed">
<div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">
<input class="input" type="number" title="" min="0" max="100" step="1" @input="$handleInputLimit"
v-model="entityOptions.speed">
<input class="input" type="number" title="" min="0" max="100" step="1"
@input="$handleInputLimit" v-model="entityOptions.speed">
<span class="arrow"></span>
</div>
</div>
</div>
</div>
<span class="custom-divider"></span>
</div>
</template>
<template #footer>
<div style="position: absolute; left: 24px; display: flex;">
@ -77,7 +77,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -32,7 +32,7 @@
</button>
</div>
<button @click="save">保存</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -38,7 +38,7 @@
<div class="row"></div>
<div class="row">
<div class="col">
<span class="label">字体样式</span>
<span class="label">字体风格</span>
</div>
</div>
<div class="row">
@ -63,7 +63,7 @@
</el-select>
</div>
</div>
<div class="row">
<!-- <div class="row">
<div class="col">
<div class="customized-tip"></div>
<span class="label" style="flex: none;">{{ t('general.text.style') }}</span>
@ -106,7 +106,7 @@
</div>
</div>
<div class="col"></div>
</div>
</div> -->
<span class="custom-divider"></span>
<div class="row"></div>
<div class="row">
@ -124,13 +124,6 @@
<div class="labelBackgroundColorStart" ref="labelBackgroundColorStartRef" style="margin-right: 10px;"></div>
<div class="labelBackgroundColorEnd" ref="labelBackgroundColorEndRef"></div>
</div>
<!-- <div class="col font-select-box">
<span class="label" style="flex: none">字体选择</span>
<el-select class="input input-select font-select" v-model="entityOptions.labelFontFamily">
<el-option v-for="item in fontList" :key="item.key" :label="item.name" :value="item.key">
</el-option>
</el-select>
</div> -->
</div>
<div class="row">
<div class="col">

View File

@ -31,7 +31,7 @@
<template #footer>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -524,7 +524,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -74,7 +74,7 @@
</template>
<template #footer>
<button @click="save">保存</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -183,7 +183,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -14,7 +14,7 @@
<el-input
v-model="modelName"
class="w-50 m-2"
placeholder="请输入图标类型进行搜索"
placeholder="请输入图标名称进行搜索"
:suffix-icon="Search"
/>
</div>
@ -205,9 +205,11 @@ let observer: IntersectionObserver | null = null
const treeRef: any = ref('')
watch(modelName, (val) => {
if (treeRef.value && treeRef.value !== '') {
treeRef.value?.filter(val)
}
// if (treeRef.value && treeRef.value !== '') {
// treeRef.value?.filter(val)
// }
getModelList()
// categories.value = []
})
watch(isShowPup, (val) => {
if (!val) {
@ -349,7 +351,6 @@ let typeArr = {
const modelClick = (index, row) => {
activeIndex.value = index
isShowPup.value = false
console.log(index, row)
let selectedImg
if (selectCallback) {
if (butActiveIndex.value === 0) {
@ -369,12 +370,21 @@ const modelClick = (index, row) => {
const getModelListByType = (id) => {
if (butActiveIndex.value === 0) {
categories.value = [...threePhoto]
let arr = threePhoto.filter((item) => {
return item.iconName.indexOf(modelName.value) > -1
})
// categories.value = [...threePhoto]
categories.value = arr
} else if (butActiveIndex.value === 1) {
categories.value = [...ordinaryPhoto]
let arr = ordinaryPhoto.filter((item) => {
return item.iconName.indexOf(modelName.value) > -1
})
// categories.value = [...ordinaryPhoto]
categories.value = arr
} else {
let formData = new FormData()
formData.append('iconTypeId', id)
formData.append('name', modelName.value)
PhotoApi.showModelByType(formData).then((res) => {
categories.value = res.data
})
@ -391,13 +401,23 @@ const getModelList = async () => {
}
]
if (butActiveIndex.value == 0) {
categories.value = [...threePhoto]
let arr = threePhoto.filter((item) => {
return item.iconName.indexOf(modelName.value) > -1
})
// categories.value = [...threePhoto]
categories.value = arr
}
if (butActiveIndex.value == 1) {
categories.value = [...ordinaryPhoto]
let arr = ordinaryPhoto.filter((item) => {
return item.iconName.indexOf(modelName.value) > -1
})
// categories.value = [...ordinaryPhoto]
categories.value = arr
}
} else {
const res: any = await PhotoApi.modelTypeList()
const params = new URLSearchParams()
params.append('iconName', modelName.value)
const res: any = await PhotoApi.modelTypeList(params)
if (res.code == 0 || res.code == 200) {
let data = transformNestedJson(res.data, 'name', 'label')
typeTreeData.value = data
@ -503,8 +523,11 @@ defineExpose({
// height: 50vh;
:deep(.el-dialog) {
background:
linear-gradient(180deg, rgba(var(--color-base1), 0.2) 0%, rgba(var(--color-base1), 0) 100%),
background: linear-gradient(
180deg,
rgba(var(--color-base1), 0.2) 0%,
rgba(var(--color-base1), 0) 100%
),
rgba(0, 0, 0, 0.6);
border: 1px solid var(--color-border1);
padding-left: 0 !important;
@ -915,10 +938,7 @@ defineExpose({
width: 90px;
height: 32px;
opacity: 1;
border-radius:
0px 4px,
4px,
0px;
border-radius: 0px 4px, 4px, 0px;
background: rgba(var(--color-base1), 0.2);
border: 1px solid rgba(var(--color-base1), 0.1);
display: flex;

View File

@ -1,5 +1,6 @@
<template>
<Dialog ref="baseDialog" :title="title+'属性'" left="180px" top="100px" className="polygon" :closeCallback="closeCallback">
<Dialog ref="baseDialog" :title="title + '属性'" left="180px" top="100px" className="polygon"
:closeCallback="closeCallback">
<template #content>
<span class="custom-divider"></span>
<div class="div-item">
@ -43,7 +44,8 @@
<div class="col">
<span class="label">Z值统一增加</span>
<div class="input-number input-number-unit-1 height-box" :class="{ 'disabled': heightMode == 2 }">
<input class="input height" type="number" title="" min="-9999999" max="999999999" v-model="height" @input="$handleInputLimit" />
<input class="input height" type="number" title="" min="-9999999" max="999999999" v-model="height"
@input="$handleInputLimit" />
<span class="unit">m</span>
<span class="arrow"></span>
</div>
@ -66,15 +68,18 @@
<div class="td">{{ i + 1 }}</div>
<div class="td lng align-center" @dblclick="inputDblclick($event, i, 'lng')">
<input class="input" @blur="inputBlurCallBack($event, i, 'lng', 8)" type="number"
v-model="item.lng" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lng'" @input="$handleInputLimit" />
v-model="item.lng" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lng'"
@input="$handleInputLimit" />
<span style="pointer-events: none;" v-else>{{ (item.lng).toFixed(8) }}</span>
</div>
<div class="td lat align-center" @dblclick="inputDblclick($event, i, 'lat')">
<input class="input" @blur="inputBlurCallBack($event, i, 'lat', 8)" type="number"
v-model="item.lat" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lat'" @input="$handleInputLimit">
v-model="item.lat" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lat'"
@input="$handleInputLimit">
<span style="pointer-events: none;" v-else>{{ (item.lat).toFixed(8) }}</span>
</div>
<div class="td alt align-center" @dblclick="inputDblclick($event, i, 'alt')" @input="$handleInputLimit">
<div class="td alt align-center" @dblclick="inputDblclick($event, i, 'alt')"
@input="$handleInputLimit">
<input class="input" @blur="inputBlurCallBack($event, i, 'alt', 2)" type="number"
v-model="entityOptions.height" min="-9999999" max="999999999"
v-if="activeTd.index == i && activeTd.name == 'alt'">
@ -98,7 +103,8 @@
<div class="col">
<span class="label">描边宽度</span>
<div class="input-number input-number-unit-2">
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth" @input="$handleInputLimit">
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth"
@input="$handleInputLimit">
<span class="unit">px</span>
<span class="arrow"></span>
</div>
@ -124,7 +130,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>
@ -186,10 +192,10 @@ let originalOptions: any
let that: any
const open = async (id: any, type: any) => {
if(type && type === 'rectangle') {
if (type && type === 'rectangle') {
title.value = '矩形'
}
else if(type && type === 'rendezvous') {
else if (type && type === 'rendezvous') {
title.value = '集结地'
}
that = window.earth.entityMap.get(id)
@ -270,7 +276,7 @@ const heightConfirm = () => {
}
}
const inputDblclick = async (event, i, anme) => {
if(heightMode.value == 2) {
if (heightMode.value == 2) {
return
}
activeTd.value = {
@ -376,4 +382,16 @@ defineExpose({
})
</script>
<style scoped lang="scss"></style>
<style scoped lang="scss">
.polygon.dialog-en {
::v-deep>.content {
.attribute-content-link .table .tr .td.operation button,
.attribute-content-vr .table .tr .td.operation button,
.attribute-content-rtmp .table .tr .td.operation button {
width: 76px !important;
flex: 0 0 76px !important;
}
}
}
</style>

View File

@ -64,7 +64,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -75,8 +75,8 @@
<div class="col" style="flex: 0 0 33%">
<span class="label">缓冲宽度</span>
<div class="input-number input-number-unit-1" style="width: 80px">
<input class="input" type="number" title="" min="0" data-min="0.01" max="999999"
@input="$handleInputLimit" v-model="entityOptions.extendWidth" />
<input class="input" type="number" title="" min="0" data-min="0.01" max="999999" @input="$handleInputLimit"
v-model="entityOptions.extendWidth" />
<span class="unit">m</span>
<span class="arrow"></span>
</div>
@ -111,13 +111,13 @@
</div>
</div>
</div>
<div class="div-item">
<div class="row">
<el-tabs v-model="activeName">
<el-tab-pane label="属性信息" name="1">
<attribute :entityOptions="entityOptions"></attribute>
</el-tab-pane>
<el-tab-pane label="空间信息" name="2">
<div class="div-item">
<div class="row">
<div class="col height-mode-box">
<span class="label" style="flex: 0 0 56px">高度模式</span>
@ -176,13 +176,15 @@
</div>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="标签风格" name="3">
<div class="div-item">
<labelStyle type="线" :entityOptions="entityOptions"></labelStyle>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
<span class="custom-divider"></span>
</template>
<template #footer>
@ -200,7 +202,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>
@ -391,7 +393,7 @@ const open = async (id: any, type) => {
const heightModeChange = (val) => {
that.heightMode = heightMode.value
// @ts-ignore
if(heightMode.value === 0 || heightMode.value === '0' || heightMode.value === 1 || heightMode.value === '1') {
if (heightMode.value === 0 || heightMode.value === '0' || heightMode.value === 1 || heightMode.value === '1') {
entityOptions.value.extend = false
}
}
@ -433,8 +435,8 @@ const changeWordsName = (val) => {
}
const lineTypechange = () => { }
const lineExtendchange = (e)=>{
if(e.target.checked) {
const lineExtendchange = (e) => {
if (e.target.checked) {
heightMode.value = 2
}
}
@ -562,4 +564,16 @@ defineExpose({
}
}
}
.polyline.dialog-en {
::v-deep>.content {
.attribute-content-link .table .tr .td.operation button,
.attribute-content-vr .table .tr .td.operation button,
.attribute-content-rtmp .table .tr .td.operation button {
width: 76px !important;
flex: 0 0 76px !important;
}
}
}
</style>

View File

@ -66,7 +66,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -82,7 +82,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -24,7 +24,7 @@ import { GisApi } from '@/api/gisApi'
const props = defineProps({
});
const host = window.location.host
const host = localStorage.getItem('ip')
const visible = ref(false)
const baseDialog:any = ref(null);
const eventBus:any = inject("bus");

View File

@ -39,7 +39,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -14,7 +14,7 @@
<template #footer>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -49,7 +49,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -233,7 +233,7 @@
<template #footer>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -21,7 +21,7 @@
</template>
<template #footer>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -12,18 +12,18 @@
<div class="div-item" style="display: flex">
<button @click="importHeader" style="margin-right: 15px">
<svg class="icon-updateheigh">
<use xlink:href="#icon-importHeader"></use></svg
>{{ t('vector.导入表头') }}
<use xlink:href="#icon-importHeader"></use>
</svg>{{ t('vector.导入表头') }}
</button>
<button @click="downloadHeader">
<svg>
<use xlink:href="#icon-download"></use></svg
>{{ t('vector.下载字典模板') }}
<use xlink:href="#icon-download"></use>
</svg>{{ t('vector.下载字典模板') }}
</button>
<button @click="exportExcel" style="position: absolute; right: 25px">
<svg>
<use xlink:href="#icon-export"></use></svg
>{{ t('vector.导出') }}
<use xlink:href="#icon-export"></use>
</svg>{{ t('vector.导出') }}
</button>
</div>
<span class="custom-divider"></span>
@ -113,9 +113,10 @@ const maxPageNum: any = ref(0)
const filterData: any = ref([])
const title = ref('')
const closeCallback = () => {
entityOptions.value.originalOptions = structuredClone(originalOptions)
entityOptions.value.reset()
eventBus.emit('destroyComponent')
// entityOptions.value.originalOptions = structuredClone(originalOptions)
// console.log('entityOptions--------------', entityOptions.value)
// entityOptions.value.reset()
// eventBus.emit('destroyComponent')
}
const getKeys = () => {
keyData.value = []
@ -140,9 +141,8 @@ let features
const open = async (id: any) => {
// that = window.earth.entityMap.get(id)
node = window.treeObj.getNodeByParam('id', id, null)
entityOptions.value.field = JSON.parse(node.params).field
that = getThat(node)
console.log(node, that, entityOptions.field, 'yyyyyyyyyyyyyy')
entityOptions.value.field = that.field
if (that.options.id === id) {
features = that.geojson.features
} else {
@ -157,7 +157,7 @@ const open = async (id: any) => {
let spliceData = arrSplice(arr, pageSize.value)
maxPageNum.value = spliceData.length
tableData.value = spliceData[pageNum.value - 1]
title.value = node.sourceName
title.value = node.title || node.sourceName
getKeys()
originalOptions = structuredClone(that.options)
entityOptions.value = that
@ -227,8 +227,8 @@ const getTableList = ({ page, limit }) => {
tableData.value = spliceData[pageNum.value - 1]
}
const changeFieId = async (e) => {
console.log(e, 'eeeeeeeee')
let data = JSON.parse(node.params)
let fNode = window.treeObj.getNodeByParam('id', that.options.id, null)
let data = JSON.parse(fNode.params)
data.field = e
let params2 = {
id: data.id,

View File

@ -98,7 +98,7 @@
</div>
<button @click="remove">删除</button>
<button @click="confirm">确定</button>
<button @click="close">关闭</button>
<button @click="close">取消</button>
</template>
</Dialog>
</template>

View File

@ -31,12 +31,16 @@
<span class="label">材质样式</span>
<el-select class="input input-select input-select-line-type" v-model="entityOptions.material">
<template #label="{ label, value }">
<i class="yj-custom-icon" :class="material[value].icon"></i>
<i class="yj-custom-icon" :class="material[value].icon"
:style="`background: url(${material[value].icon}) 100% 100% no-repeat;background-size: 100% 100%;`">
</i>
{{ label }}
</template>
<el-option v-for="item in material" :key="item.key" :label="item.name" :value="item.key">
<div style="display: flex; align-items: center;">
<i class="yj-custom-icon" :class="item.icon"></i>
<i class="yj-custom-icon" :class="item.icon"
:style="`background: url(${item.icon}) 100% 100% no-repeat;background-size: 100% 100%;`"
></i>
{{ item.name }}
</div>
</el-option>
@ -99,25 +103,25 @@ const material = ref([
name: '纯色墙',
value: '纯色墙',
key: 0,
icon: 'icon-wall'
icon: '../sdk/custom/img/icon-wall.png',
},
{
name: '上升墙',
value: '上升墙',
key: 1,
icon: 'icon-wall-gradient'
icon: '../sdk/custom/img/icon-wall-gradient.png'
},
{
name: '箭头墙',
value: '箭头墙',
key: 2,
icon: 'icon-wall-arrow'
icon: '../sdk/img/material/arrow.png'
},
{
name: '警戒墙',
value: '警戒墙',
key: 3,
icon: 'icon-wall-warn'
icon: '../sdk/img/material/warn.png'
}
])
eventBus.on("openStandTextAdd", () => {

View File

@ -1,4 +1,6 @@
import { useTreeNode } from '@/views/components/tree/hooks/treeNode'
import { rightClick } from '../../entityClick'
import { getEventBus } from '../../../../home/eventBus'
const { cusAddNodes } = useTreeNode()
export function renderVector(node, ifFly = true) {
// if (node.detail != "") node.detail.field = node.detail.fieldName || "id";
@ -51,13 +53,17 @@ export function renderVector(node, ifFly = true) {
}
if (ifFly) Vector.flyTo();
// Vector.onClick = shpTotal;
Vector.onClick = () => {
alert('left')
Vector.onClick = (a,b,c) => {
const eventBus = getEventBus()
rightClick({id: b})
eventBus.emit("openDialog", 'vectorAttr', b);
// alert('left')
};
//鼠标右键点击事件
// Vector.onRightClick = shpSelect;
Vector.onRightClick = () => {
alert('right')
Vector.onRightClick = (a,b,c) => {
rightClick({id: b})
// alert('right')
};
});
});

View File

@ -98,6 +98,7 @@ export const useRightOperate = () => {
params.params = JSON.stringify(params.params)
cusAddNodes(window.treeObj, params.parentId, [params])
let entityObject = renderVector(params, true);
entityObject.flyTo();
(window as any)._entityMap.set(id, entityObject)
} else if (["geojson"].includes(sourceType)) {
let baseURL = localStorage.getItem('ip')
@ -113,6 +114,8 @@ export const useRightOperate = () => {
width: 1,
color: "rgb(239, 6, 6, 1)",
}
}, (entity:any) => {
entity?.flyTo()
})
} else {
// 获取最后一个点的位置
@ -340,10 +343,13 @@ export const useRightOperate = () => {
}
console.log(node.id, 'nnodenodenodenodeode')
if (node) {
if (node.sourceType == 'pressModel' || node.sourceType == 'roam') {
eventBus.emit("openDialog", node.sourceType, node);
if(node.sourceType === 'Feature') {
eventBus.emit('openDialog','vectorAttr', node.id);
}
else if (node.sourceType == 'pressModel' || node.sourceType == 'roam') {
eventBus.emit('openDialog', node.sourceType, node);
} else {
eventBus.emit("openDialog", node.sourceType, node.id);
eventBus.emit('openDialog', node.sourceType, node.id);
}
}
}
@ -683,7 +689,9 @@ export const useRightOperate = () => {
})
for (let i = 0; i < res.data.length; i++) {
let item = res.data[i]
initMapData(type, JSON.parse(item.params), null)
initMapData(type, JSON.parse(item.params), (entity: any) => {
entity.flyTo()
})
}
cusAddNodes(window.treeObj, parentId, res.data)
}

View File

@ -111,7 +111,7 @@ export const useTree = () => {
} else {
entityObject = (window as any)._entityMap.get(treeNode.id)
}
entityObject.flyTo()
entityObject?.flyTo()
}
console.log('entityObject', entityObject)
@ -265,7 +265,7 @@ export const useTree = () => {
// 如果当前节点有父节点,检查所有子节点状态
if (parentNode) {
if (parentNode && parentNode.sourceType !== 'tileset') {
checkChildNodes(parentNode);
}
@ -322,6 +322,13 @@ export const useTree = () => {
})
}
} else {
if(node.sourceType === 'tileset') {
if (node.children && node.children.length > 0) {
node.children.forEach((item) => {
sourceStatus(item)
})
}
}
let params = JSON.parse(node.params)
let entityObject
if (node.sourceType == 'pressModel') {
@ -335,7 +342,7 @@ export const useTree = () => {
positions: params.positions,
height: params.height,
name: node.sourceName
})
});
(window as any).pressModelEntities.set(node.id, entityObject)
}

View File

@ -595,6 +595,7 @@ export const useTreeNode = () => {
node.sourceName = sourceName;
node.oldname = sourceName;
node.params = params;
delete node.title
window.treeObj.updateNode(node);
}

View File

@ -614,6 +614,7 @@ defineExpose({
transform: translateY(-50%);
width: 17vw;
height: calc(100% - 420px);
z-index: 1;
// overflow-x: hidden;
.box1 {

View File

@ -0,0 +1,11 @@
let eventBus
function setEventBus(bus: any) {
eventBus = bus
}
function getEventBus() {
return eventBus
}
export { setEventBus, getEventBus }

View File

@ -135,6 +135,8 @@ import { sysChange as utilsSysChange } from '@/utils/sysChange'
import { getdefaultStyle } from '../components/propertyBox/defaultStyle/style'
import { getdefaultLabelStyle } from '../components/propertyBox/defaultLabelStyle/style'
import { setEventBus } from './eventBus'
const { rightMenus } = useRightOperate()
const firstMenuRef = ref(null)
const bottomMenuRef = ref(null)
@ -146,6 +148,9 @@ let tree = ref()
let selectImgRef = ref()
let editdirectoryBox = ref()
setEventBus(eventBus)
// 标注标绘默认样式
if (!localStorage.getItem('defaultStyle')) {
let defaultStyle = getdefaultStyle(null)

View File

@ -187,24 +187,30 @@
<div class="item port">
<template v-if="servVal == '单机'">
<span class="itemLabel">端口</span>
<el-form-item prop="localport" :rules="[
<el-form-item
prop="localport"
:rules="[
{
validator: validateLocalportRange,
trigger: 'blur'
}
]">
]"
>
<el-input-number v-model="localport" :controls="false" />
</el-form-item>
</template>
<template v-if="servVal == '网络'">
<span class="itemLabel">端口</span>
<el-form-item prop="port" :rules="[
<el-form-item
prop="port"
:rules="[
{
validator: validatePortRange,
message: '端口号必须在 102465535 之间',
trigger: 'blur'
}
]">
]"
>
<el-input-number v-model="port" :controls="false" />
</el-form-item>
</template>
@ -250,14 +256,20 @@
<span class="fankuai"></span>
{{ t('auths.authCode') }}
</div>
<div
class="auth_info_text"
<div class="auth_info_text">
<span
@click="copy(authInfo.license_code)"
style="cursor: pointer"
title="点击可复制"
>{{ authInfo.license_code || '' }}</span
>
{{ authInfo.license_code || '' }}
<svg-icon name="copy" :size="20" style="margin-left: 30px"></svg-icon>
<svg-icon
name="copy"
:size="20"
@click="copy(authInfo.license_code)"
title="点击可复制"
style="margin-left: 30px; cursor: pointer"
></svg-icon>
</div>
</div>
<div class="auth_info_box">
@ -313,6 +325,14 @@
import { User, Unlock, Setting, SwitchButton } from '@element-plus/icons-vue'
import { useLogin } from './useLogin'
import { useSetUp } from './useSetUp'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
import useClipboard from 'vue-clipboard3'
import { ipcMain } from 'electron'
import { AuthApi } from '@/api/setting/auth'
import Dialog from '@/components/dialog/baseDialog.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { $sendElectronChanel } from '@/utils/communication'
const {
loginFormRef,
@ -330,7 +350,6 @@ const {
loginInit,
isDesktop
} = useLogin() // 登录逻辑
console.log('isDesktop', isDesktop)
const {
serviceDialog,
@ -358,21 +377,26 @@ onMounted(() => {
loginInit()
initialize()
let isSeverInit = ipcRenderer.sendSync('judgment-isSeverInit');
let { isSeverInit, severError } = ipcRenderer.sendSync('judgment-isSeverInit')
// 如果服务端未初始化,等待初始化完成
if (isSeverInit) {
if (!router.currentRoute.value.query.type) {
if (severError) {
ElMessage.error(severError)
return
} else if (!router.currentRoute.value.query.type) {
setTimeout(() => {
getAuthCode()
getAuthInfo()
}, 0);
}, 0)
} else {
isAuth.value = false
}
}
else {
ipcRenderer.once('program-init', () => {
if (!router.currentRoute.value.query.type) {
} else {
ipcRenderer.once('program-init', (e, error) => {
if (error) {
ElMessage.error(error)
return
} else if (!router.currentRoute.value.query.type) {
getAuthCode()
getAuthInfo()
} else {
@ -383,14 +407,6 @@ onMounted(() => {
})
//授权判断
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
import useClipboard from 'vue-clipboard3'
import { ipcMain } from 'electron'
import { AuthApi } from '@/api/setting/auth'
import Dialog from '@/components/dialog/baseDialog.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { $sendElectronChanel } from '@/utils/communication'
let isAuth = ref(true)
@ -402,7 +418,6 @@ const getAuthInfo = async () => {
if (typeof res.data === 'object') {
authInfo.value.generateTime = res.data.generateTime
authInfo.value.expireTime = res.data.expireTime
console.log(authInfo.value.expireTime, '授权时间222')
getStatus2()
getStatus(res.data.expireTime)
}
@ -512,7 +527,6 @@ const getStatus2 = () => {
const timestamp = new Date(authInfo.value.expireTime).getTime()
const currentTimestamp = Date.now()
console.log('timestamp', timestamp > currentTimestamp)
if (timestamp > currentTimestamp) {
authInfo.value.status = true
} else {
@ -540,27 +554,26 @@ const copy = async (text) => {
const validateLocalportRange = (rule, value, callback) => {
if (!localport.value) {
callback(new Error('请输入端口号')); // 校验失败
callback(new Error('请输入端口号')) // 校验失败
return
}
if (localport.value < 1024 || localport.value > 65535) {
callback(new Error('端口号范围在 102465535 之间')); // 校验失败
callback(new Error('端口号范围在 102465535 之间')) // 校验失败
} else {
callback(); // 校验通过
callback() // 校验通过
}
};
}
const validatePortRange = (rule, value, callback) => {
if (!port.value) {
callback(new Error('请输入端口号')); // 校验失败
callback(new Error('请输入端口号')) // 校验失败
return
}
if (port.value < 1024 || port.value > 65535) {
callback(new Error('端口号范围在 102465535 之间')); // 校验失败
callback(new Error('端口号范围在 102465535 之间')) // 校验失败
} else {
callback(); // 校验通过
callback() // 校验通过
}
};
}
</script>
<style lang="scss">
// 添加过渡样式
@ -1139,8 +1152,11 @@ const validatePortRange = (rule, value, callback) => {
::v-deep .el-message-box {
--el-messagebox-title-color: #fff !important;
--el-messagebox-content-color: #fff !important;
background:
linear-gradient(180deg, rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0.2) 100%),
background: linear-gradient(
180deg,
rgba(var(--color-base1), 0) 0%,
rgba(var(--color-base1), 0.2) 100%
),
rgba(0, 0, 0, 0.6) !important;
}
@ -1351,13 +1367,17 @@ const validatePortRange = (rule, value, callback) => {
.el-message-box {
--el-messagebox-title-color: #fff !important;
--el-messagebox-content-color: #fff !important;
background:
linear-gradient(180deg, rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0.2) 100%),
background: linear-gradient(
180deg,
rgba(var(--color-base1), 0) 0%,
rgba(var(--color-base1), 0.2) 100%
),
rgba(0, 0, 0, 0.6) !important;
.el-message-box__headerbtn {
display: none !important;
}
.el-message-box__btns {
.el-button {
--el-button-text-color: #fff;