12-3
This commit is contained in:
@ -82,6 +82,7 @@ let mainWindow;
|
||||
|
||||
let isSeverInit = false
|
||||
let isAppInit = false
|
||||
let severError:any = undefined
|
||||
function createWindow(): void {
|
||||
// Create the browser window.
|
||||
|
||||
@ -172,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(() => {
|
||||
@ -406,7 +407,7 @@ function createWindow(): void {
|
||||
// 条件:仅按了 Alt 键(无其他键组合、不是组合键、不是重复按键)
|
||||
if (
|
||||
input.key === 'Alt' && // 按键是 Alt
|
||||
!input.ctrl && // 未按 Ctrl
|
||||
!input.control && // 未按 Ctrl
|
||||
!input.shift && // 未按 Shift
|
||||
!input.meta && // 未按 Meta(Win/Mac)
|
||||
!input.isComposing && // 非输入法组合态
|
||||
@ -621,20 +622,29 @@ if (!gotTheLock) {
|
||||
// console.log(`批处理输出: ${string}`);
|
||||
// 临时处理:应用启动失败或项目文档地址出现时,认为服务初始化完成;后续需后端配合
|
||||
if (string.indexOf('APPLICATION FAILED TO START') !== -1) {
|
||||
mainWindow.webContents.send('program-init', '后端服务未正常启动,尝试更换地址或端口')
|
||||
severError = '后端服务未正常启动,尝试更换地址或端口'
|
||||
if (!isSeverInit) {
|
||||
isSeverInit = true
|
||||
if (isAppInit) {
|
||||
mainWindow.webContents.send('program-init', severError)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (string.indexOf('项目文档地址') !== -1) {
|
||||
if (!isSeverInit) {
|
||||
isSeverInit = true
|
||||
if (isAppInit) {
|
||||
mainWindow.webContents.send('program-init')
|
||||
mainWindow.webContents.send('program-init', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on('judgment-isSeverInit', (event) => {
|
||||
event.returnValue = isSeverInit
|
||||
event.returnValue = {
|
||||
isSeverInit: isSeverInit,
|
||||
severError: severError
|
||||
}
|
||||
})
|
||||
|
||||
// 监听错误输出(stderr)
|
||||
|
||||
8
src/renderer/public/sdk/YJEarth.min.js
vendored
8
src/renderer/public/sdk/YJEarth.min.js
vendored
File diff suppressed because one or more lines are too long
@ -55,6 +55,7 @@
|
||||
|
||||
.cesium-viewer-cesiumWidgetContainer {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.cesium-viewer-cesiumWidgetContainer .cesium-widget:nth-of-type(1) {
|
||||
|
||||
@ -654,6 +654,10 @@ img {
|
||||
}
|
||||
}
|
||||
|
||||
.jedate {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.custom-slider-tooltip {
|
||||
display: block !important;
|
||||
opacity: 1 !important;
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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')
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
@ -343,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
||||
@ -614,6 +614,7 @@ defineExpose({
|
||||
transform: translateY(-50%);
|
||||
width: 17vw;
|
||||
height: calc(100% - 420px);
|
||||
z-index: 1;
|
||||
// overflow-x: hidden;
|
||||
|
||||
.box1 {
|
||||
|
||||
11
src/renderer/src/views/home/eventBus.ts
Normal file
11
src/renderer/src/views/home/eventBus.ts
Normal file
@ -0,0 +1,11 @@
|
||||
let eventBus
|
||||
|
||||
function setEventBus(bus: any) {
|
||||
eventBus = bus
|
||||
}
|
||||
|
||||
function getEventBus() {
|
||||
return eventBus
|
||||
}
|
||||
|
||||
export { setEventBus, getEventBus }
|
||||
@ -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)
|
||||
|
||||
@ -117,23 +117,23 @@
|
||||
<template v-if="servVal == '单机'">
|
||||
<span class="itemLabel">端口</span>
|
||||
<el-form-item prop="localport" :rules="[
|
||||
{
|
||||
validator: validateLocalportRange,
|
||||
trigger: 'blur'
|
||||
}
|
||||
]">
|
||||
{
|
||||
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="[
|
||||
{
|
||||
validator: validatePortRange,
|
||||
message: '端口号必须在 1024–65535 之间',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]">
|
||||
{
|
||||
validator: validatePortRange,
|
||||
message: '端口号必须在 1024–65535 之间',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]">
|
||||
<el-input-number v-model="port" :controls="false" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
@ -192,8 +192,8 @@
|
||||
{{ t('auths.authType') }}
|
||||
</div>
|
||||
<div v-if="authInfo.status != null" class="auth_info_text" style="font-size: 16px" :style="{
|
||||
color: authInfo.status ? 'rgba(27, 248, 195, 1)' : 'rgba(255, 161, 69, 1)'
|
||||
}">
|
||||
color: authInfo.status ? 'rgba(27, 248, 195, 1)' : 'rgba(255, 161, 69, 1)'
|
||||
}">
|
||||
{{ authInfo.status ? t('auths.authTempExpire') : t('auths.authexpire') }}
|
||||
</div>
|
||||
<!-- <div v-else class="auth_info_text">{{ authInfo.message || '无' }}</div> -->
|
||||
@ -270,10 +270,15 @@ onMounted(() => {
|
||||
loginInit()
|
||||
initialize()
|
||||
|
||||
let isSeverInit = ipcRenderer.sendSync('judgment-isSeverInit');
|
||||
let { isSeverInit, severError } = ipcRenderer.sendSync('judgment-isSeverInit');
|
||||
// 如果服务端未初始化,等待初始化完成
|
||||
if (isSeverInit) {
|
||||
if (!router.currentRoute.value.query.type) {
|
||||
console.log('severError', severError)
|
||||
if (severError) {
|
||||
ElMessage.error(severError)
|
||||
return
|
||||
}
|
||||
else if (!router.currentRoute.value.query.type) {
|
||||
setTimeout(() => {
|
||||
getAuthCode()
|
||||
getAuthInfo()
|
||||
@ -283,13 +288,17 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
else {
|
||||
ipcRenderer.once('program-init', (error, e) => {
|
||||
if (!router.currentRoute.value.query.type) {
|
||||
getAuthCode()
|
||||
getAuthInfo()
|
||||
} else {
|
||||
isAuth.value = false
|
||||
}
|
||||
ipcRenderer.once('program-init', (e, error) => {
|
||||
if (error) {
|
||||
ElMessage.error(error)
|
||||
return
|
||||
}
|
||||
else if (!router.currentRoute.value.query.type) {
|
||||
getAuthCode()
|
||||
getAuthInfo()
|
||||
} else {
|
||||
isAuth.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user