diff --git a/src/main/index.ts b/src/main/index.ts index eb297f0..5b43c3e 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -128,6 +128,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 && // 未按 Meta(Win/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) @@ -389,6 +402,19 @@ function createWindow(): void { // closeCB(newWindow.id) }); } + newWindow.webContents.on('before-input-event', (event, input) => { + // 条件:仅按了 Alt 键(无其他键组合、不是组合键、不是重复按键) + if ( + input.key === 'Alt' && // 按键是 Alt + !input.ctrl && // 未按 Ctrl + !input.shift && // 未按 Shift + !input.meta && // 未按 Meta(Win/Mac) + !input.isComposing && // 非输入法组合态 + input.type === 'keyDown' // 仅拦截按下事件 + ) { + event.preventDefault(); // 阻止 Alt 键的默认行为(激活菜单) + } + }); _winMap.set(id, newWindow.id); return _winMap } catch (error) { @@ -594,7 +620,10 @@ 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) { + mainWindow.webContents.send('program-init', '后端服务未正常启动,尝试更换地址或端口') + } + else if (string.indexOf('项目文档地址') !== -1) { if (!isSeverInit) { isSeverInit = true if (isAppInit) { diff --git a/src/renderer/public/sdk/custom/css/index.css b/src/renderer/public/sdk/custom/css/index.css index 04faf54..5749e5a 100644 --- a/src/renderer/public/sdk/custom/css/index.css +++ b/src/renderer/public/sdk/custom/css/index.css @@ -178,6 +178,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 +342,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 +2535,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 +2619,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 +2679,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 +2762,7 @@ /* 折线 */ .YJ-custom-base-dialog.polyline>.content { - width: 580px; + width: 600px; } .YJ-custom-base-dialog.polyline>.content>div #dashTextureDom { @@ -3796,7 +3797,7 @@ .yj-custom-icon { display: inline-block; width: 22px; - height: 10px; + height: 18px; margin-right: 5px; } diff --git a/src/renderer/public/tree/newFuzzySearch.js b/src/renderer/public/tree/newFuzzySearch.js index 1b4a813..978db79 100644 --- a/src/renderer/public/tree/newFuzzySearch.js +++ b/src/renderer/public/tree/newFuzzySearch.js @@ -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) { diff --git a/src/renderer/src/I18n/zh-CN.ts b/src/renderer/src/I18n/zh-CN.ts index ef51b9e..5d1ca3a 100644 --- a/src/renderer/src/I18n/zh-CN.ts +++ b/src/renderer/src/I18n/zh-CN.ts @@ -263,6 +263,8 @@ export default { rtmp: 'rtmp', 物资: '物资', 编辑内容: '编辑内容', + 请输入设备名称进行搜索: '请输入设备名称进行搜索', + 请输入物资名称进行搜索: '请输入物资名称进行搜索', 打开文本编辑器: '打开文本编辑器', 添加链接: '添加链接', 名称: '名称', diff --git a/src/renderer/src/I18n/zh-EN.ts b/src/renderer/src/I18n/zh-EN.ts index 77eeebf..4569f7b 100644 --- a/src/renderer/src/I18n/zh-EN.ts +++ b/src/renderer/src/I18n/zh-EN.ts @@ -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', diff --git a/src/renderer/src/I18n/zh-TW.ts b/src/renderer/src/I18n/zh-TW.ts index 23816a9..a36e7a6 100644 --- a/src/renderer/src/I18n/zh-TW.ts +++ b/src/renderer/src/I18n/zh-TW.ts @@ -155,6 +155,7 @@ export default { setting: '系統設置', project: '工程管理', device: '設備管理', + materials: '物資管理', modelManage: '模型管理', graphLabelManage: '軍標管理', photoManage: '圖標管理', @@ -261,6 +262,8 @@ export default { rtmp: 'rtmp', 物资: '物資', 编辑内容: '編輯內容', + 请输入设备名称进行搜索: '請輸入設備名稱進行搜索', + 请输入物资名称进行搜索: '請輸入物資名稱進行搜索', 打开文本编辑器: '打開文本編輯器', 添加链接: '添加鏈接', 名称: '名稱', diff --git a/src/renderer/src/api/tree/index.ts b/src/renderer/src/api/tree/index.ts index 0ff8f0f..2ca78a4 100644 --- a/src/renderer/src/api/tree/index.ts +++ b/src/renderer/src/api/tree/index.ts @@ -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' diff --git a/src/renderer/src/axios/index.ts b/src/renderer/src/axios/index.ts index 8eb1166..1c441ae 100644 --- a/src/renderer/src/axios/index.ts +++ b/src/renderer/src/axios/index.ts @@ -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 diff --git a/src/renderer/src/common/addMapSource.ts b/src/renderer/src/common/addMapSource.ts index d225190..bab941c 100644 --- a/src/renderer/src/common/addMapSource.ts +++ b/src/renderer/src/common/addMapSource.ts @@ -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) { diff --git a/src/renderer/src/common/initMapData.ts b/src/renderer/src/common/initMapData.ts index b082221..4e08fad 100644 --- a/src/renderer/src/common/initMapData.ts +++ b/src/renderer/src/common/initMapData.ts @@ -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 diff --git a/src/renderer/src/components/dialog/baseDialog.vue b/src/renderer/src/components/dialog/baseDialog.vue index 366539a..f64d9d7 100644 --- a/src/renderer/src/components/dialog/baseDialog.vue +++ b/src/renderer/src/components/dialog/baseDialog.vue @@ -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 } diff --git a/src/renderer/src/icons/svg/mbtiles.svg b/src/renderer/src/icons/svg/mbtiles.svg index 849baa7..ba44d46 100644 --- a/src/renderer/src/icons/svg/mbtiles.svg +++ b/src/renderer/src/icons/svg/mbtiles.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/renderer/src/views/components/bottomSide/bottomSide.vue b/src/renderer/src/views/components/bottomSide/bottomSide.vue index e577989..d26508d 100644 --- a/src/renderer/src/views/components/bottomSide/bottomSide.vue +++ b/src/renderer/src/views/components/bottomSide/bottomSide.vue @@ -2,22 +2,25 @@