12-3
This commit is contained in:
@ -82,6 +82,7 @@ let mainWindow;
|
|||||||
|
|
||||||
let isSeverInit = false
|
let isSeverInit = false
|
||||||
let isAppInit = false
|
let isAppInit = false
|
||||||
|
let severError:any = undefined
|
||||||
function createWindow(): void {
|
function createWindow(): void {
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
|
|
||||||
@ -172,7 +173,7 @@ function createWindow(): void {
|
|||||||
ipcMain.on('splash-completed', () => {
|
ipcMain.on('splash-completed', () => {
|
||||||
// 启动页进度条已完成,可以关闭启动页并显示主窗口
|
// 启动页进度条已完成,可以关闭启动页并显示主窗口
|
||||||
if (isSeverInit) {
|
if (isSeverInit) {
|
||||||
mainWindow.webContents.send('program-init')
|
mainWindow.webContents.send('program-init', severError)
|
||||||
}
|
}
|
||||||
isAppInit = true
|
isAppInit = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -406,7 +407,7 @@ function createWindow(): void {
|
|||||||
// 条件:仅按了 Alt 键(无其他键组合、不是组合键、不是重复按键)
|
// 条件:仅按了 Alt 键(无其他键组合、不是组合键、不是重复按键)
|
||||||
if (
|
if (
|
||||||
input.key === 'Alt' && // 按键是 Alt
|
input.key === 'Alt' && // 按键是 Alt
|
||||||
!input.ctrl && // 未按 Ctrl
|
!input.control && // 未按 Ctrl
|
||||||
!input.shift && // 未按 Shift
|
!input.shift && // 未按 Shift
|
||||||
!input.meta && // 未按 Meta(Win/Mac)
|
!input.meta && // 未按 Meta(Win/Mac)
|
||||||
!input.isComposing && // 非输入法组合态
|
!input.isComposing && // 非输入法组合态
|
||||||
@ -621,20 +622,29 @@ if (!gotTheLock) {
|
|||||||
// console.log(`批处理输出: ${string}`);
|
// console.log(`批处理输出: ${string}`);
|
||||||
// 临时处理:应用启动失败或项目文档地址出现时,认为服务初始化完成;后续需后端配合
|
// 临时处理:应用启动失败或项目文档地址出现时,认为服务初始化完成;后续需后端配合
|
||||||
if (string.indexOf('APPLICATION FAILED TO START') !== -1) {
|
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) {
|
else if (string.indexOf('项目文档地址') !== -1) {
|
||||||
if (!isSeverInit) {
|
if (!isSeverInit) {
|
||||||
isSeverInit = true
|
isSeverInit = true
|
||||||
if (isAppInit) {
|
if (isAppInit) {
|
||||||
mainWindow.webContents.send('program-init')
|
mainWindow.webContents.send('program-init', false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on('judgment-isSeverInit', (event) => {
|
ipcMain.on('judgment-isSeverInit', (event) => {
|
||||||
event.returnValue = isSeverInit
|
event.returnValue = {
|
||||||
|
isSeverInit: isSeverInit,
|
||||||
|
severError: severError
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 监听错误输出(stderr)
|
// 监听错误输出(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 {
|
.cesium-viewer-cesiumWidgetContainer {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cesium-viewer-cesiumWidgetContainer .cesium-widget:nth-of-type(1) {
|
.cesium-viewer-cesiumWidgetContainer .cesium-widget:nth-of-type(1) {
|
||||||
|
|||||||
@ -654,6 +654,10 @@ img {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.jedate {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
.custom-slider-tooltip {
|
.custom-slider-tooltip {
|
||||||
display: block !important;
|
display: block !important;
|
||||||
opacity: 1 !important;
|
opacity: 1 !important;
|
||||||
|
|||||||
@ -91,11 +91,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div style="display: flex; margin-bottom: 12px; align-items: center">
|
<div style="display: flex; margin-bottom: 12px; align-items: center">
|
||||||
<span class="label" style="flex: 0 0 60px">经度(x)</span>
|
<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>
|
||||||
<div style="display: flex; margin-bottom: 10px; align-items: center">
|
<div style="display: flex; margin-bottom: 10px; align-items: center">
|
||||||
<span class="label" style="flex: 0 0 60px">纬度(y)</span>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
import { useTreeNode } from '@/views/components/tree/hooks/treeNode'
|
import { useTreeNode } from '@/views/components/tree/hooks/treeNode'
|
||||||
|
import { rightClick } from '../../entityClick'
|
||||||
|
import { getEventBus } from '../../../../home/eventBus'
|
||||||
const { cusAddNodes } = useTreeNode()
|
const { cusAddNodes } = useTreeNode()
|
||||||
export function renderVector(node, ifFly = true) {
|
export function renderVector(node, ifFly = true) {
|
||||||
// if (node.detail != "") node.detail.field = node.detail.fieldName || "id";
|
// if (node.detail != "") node.detail.field = node.detail.fieldName || "id";
|
||||||
@ -51,13 +53,17 @@ export function renderVector(node, ifFly = true) {
|
|||||||
}
|
}
|
||||||
if (ifFly) Vector.flyTo();
|
if (ifFly) Vector.flyTo();
|
||||||
// Vector.onClick = shpTotal;
|
// Vector.onClick = shpTotal;
|
||||||
Vector.onClick = () => {
|
Vector.onClick = (a,b,c) => {
|
||||||
alert('left')
|
const eventBus = getEventBus()
|
||||||
|
rightClick({id: b})
|
||||||
|
eventBus.emit("openDialog", 'vectorAttr', b);
|
||||||
|
// alert('left')
|
||||||
};
|
};
|
||||||
//鼠标右键点击事件
|
//鼠标右键点击事件
|
||||||
// Vector.onRightClick = shpSelect;
|
// Vector.onRightClick = shpSelect;
|
||||||
Vector.onRightClick = () => {
|
Vector.onRightClick = (a,b,c) => {
|
||||||
alert('right')
|
rightClick({id: b})
|
||||||
|
// alert('right')
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -343,10 +343,13 @@ export const useRightOperate = () => {
|
|||||||
}
|
}
|
||||||
console.log(node.id, 'nnodenodenodenodeode')
|
console.log(node.id, 'nnodenodenodenodeode')
|
||||||
if (node) {
|
if (node) {
|
||||||
if (node.sourceType == 'pressModel' || node.sourceType == 'roam') {
|
if(node.sourceType === 'Feature') {
|
||||||
eventBus.emit("openDialog", node.sourceType, node);
|
eventBus.emit('openDialog','vectorAttr', node.id);
|
||||||
|
}
|
||||||
|
else if (node.sourceType == 'pressModel' || node.sourceType == 'roam') {
|
||||||
|
eventBus.emit('openDialog', node.sourceType, node);
|
||||||
} else {
|
} else {
|
||||||
eventBus.emit("openDialog", node.sourceType, node.id);
|
eventBus.emit('openDialog', node.sourceType, node.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,7 +111,7 @@ export const useTree = () => {
|
|||||||
} else {
|
} else {
|
||||||
entityObject = (window as any)._entityMap.get(treeNode.id)
|
entityObject = (window as any)._entityMap.get(treeNode.id)
|
||||||
}
|
}
|
||||||
entityObject.flyTo()
|
entityObject?.flyTo()
|
||||||
}
|
}
|
||||||
console.log('entityObject', entityObject)
|
console.log('entityObject', entityObject)
|
||||||
|
|
||||||
@ -265,7 +265,7 @@ export const useTree = () => {
|
|||||||
|
|
||||||
|
|
||||||
// 如果当前节点有父节点,检查所有子节点状态
|
// 如果当前节点有父节点,检查所有子节点状态
|
||||||
if (parentNode) {
|
if (parentNode && parentNode.sourceType !== 'tileset') {
|
||||||
checkChildNodes(parentNode);
|
checkChildNodes(parentNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,6 +322,13 @@ export const useTree = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} 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 params = JSON.parse(node.params)
|
||||||
let entityObject
|
let entityObject
|
||||||
if (node.sourceType == 'pressModel') {
|
if (node.sourceType == 'pressModel') {
|
||||||
@ -335,7 +342,7 @@ export const useTree = () => {
|
|||||||
positions: params.positions,
|
positions: params.positions,
|
||||||
height: params.height,
|
height: params.height,
|
||||||
name: node.sourceName
|
name: node.sourceName
|
||||||
})
|
});
|
||||||
(window as any).pressModelEntities.set(node.id, entityObject)
|
(window as any).pressModelEntities.set(node.id, entityObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -614,6 +614,7 @@ defineExpose({
|
|||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
width: 17vw;
|
width: 17vw;
|
||||||
height: calc(100% - 420px);
|
height: calc(100% - 420px);
|
||||||
|
z-index: 1;
|
||||||
// overflow-x: hidden;
|
// overflow-x: hidden;
|
||||||
|
|
||||||
.box1 {
|
.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 { getdefaultStyle } from '../components/propertyBox/defaultStyle/style'
|
||||||
import { getdefaultLabelStyle } from '../components/propertyBox/defaultLabelStyle/style'
|
import { getdefaultLabelStyle } from '../components/propertyBox/defaultLabelStyle/style'
|
||||||
|
|
||||||
|
import { setEventBus } from './eventBus'
|
||||||
|
|
||||||
const { rightMenus } = useRightOperate()
|
const { rightMenus } = useRightOperate()
|
||||||
const firstMenuRef = ref(null)
|
const firstMenuRef = ref(null)
|
||||||
const bottomMenuRef = ref(null)
|
const bottomMenuRef = ref(null)
|
||||||
@ -146,6 +148,9 @@ let tree = ref()
|
|||||||
let selectImgRef = ref()
|
let selectImgRef = ref()
|
||||||
let editdirectoryBox = ref()
|
let editdirectoryBox = ref()
|
||||||
|
|
||||||
|
setEventBus(eventBus)
|
||||||
|
|
||||||
|
|
||||||
// 标注标绘默认样式
|
// 标注标绘默认样式
|
||||||
if (!localStorage.getItem('defaultStyle')) {
|
if (!localStorage.getItem('defaultStyle')) {
|
||||||
let defaultStyle = getdefaultStyle(null)
|
let defaultStyle = getdefaultStyle(null)
|
||||||
|
|||||||
@ -270,10 +270,15 @@ onMounted(() => {
|
|||||||
loginInit()
|
loginInit()
|
||||||
initialize()
|
initialize()
|
||||||
|
|
||||||
let isSeverInit = ipcRenderer.sendSync('judgment-isSeverInit');
|
let { isSeverInit, severError } = ipcRenderer.sendSync('judgment-isSeverInit');
|
||||||
// 如果服务端未初始化,等待初始化完成
|
// 如果服务端未初始化,等待初始化完成
|
||||||
if (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(() => {
|
setTimeout(() => {
|
||||||
getAuthCode()
|
getAuthCode()
|
||||||
getAuthInfo()
|
getAuthInfo()
|
||||||
@ -283,8 +288,12 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ipcRenderer.once('program-init', (error, e) => {
|
ipcRenderer.once('program-init', (e, error) => {
|
||||||
if (!router.currentRoute.value.query.type) {
|
if (error) {
|
||||||
|
ElMessage.error(error)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
else if (!router.currentRoute.value.query.type) {
|
||||||
getAuthCode()
|
getAuthCode()
|
||||||
getAuthInfo()
|
getAuthInfo()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user