diff --git a/src/main/index.ts b/src/main/index.ts index 6e8aeeb..a90a9c3 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -472,7 +472,7 @@ function windowAllClosed() { console.log('所有窗口已关闭,执行清理脚本...'); getServer().close(() => { // 执行批处理文件 - const cleanupProcess = exec('D:/project/electron-4.0/electron-4/resources/java/stop.bat', (error, stdout, stderr) => { + const cleanupProcess = exec(stopBatPath.substring(1, 200), (error, stdout, stderr) => { if (error) { console.error(`清理脚本执行失败: ${error.message}`); } @@ -573,6 +573,27 @@ if (!gotTheLock) { } console.log(`批处理输出: ${stdout}`); }); + // const batProcess = spawn('cmd.exe', ['/c', startBatPath.substring(1, 200)]); + // // 实时监听标准输出(stdout) + // batProcess.stdout.on('data', (data) => { + // // data 是 Buffer 类型,转为字符串后输出 + // console.log(`批处理输出: ${data.toString().trim()}`); + // }); + + // // 监听错误输出(stderr) + // batProcess.stderr.on('data', (data) => { + // console.error(`错误输出: ${data.toString().trim()}`); + // }); + + // // 监听进程执行出错(如文件不存在、权限问题等) + // batProcess.on('error', (error) => { + // console.error(`执行错误: ${error.message}`); + // }); + + // // 监听进程退出事件(执行结束后触发) + // batProcess.on('close', (code) => { + // console.log(`批处理执行完毕,退出码: ${code}`); + // }); // Set app user model id for windows electronApp.setAppUserModelId('com.electron') diff --git a/src/renderer/public/sdk/custom/css/index.css b/src/renderer/public/sdk/custom/css/index.css index 23e7778..491ccbf 100644 --- a/src/renderer/public/sdk/custom/css/index.css +++ b/src/renderer/public/sdk/custom/css/index.css @@ -34,7 +34,7 @@ } :root { - --color-sdk-base-rgb: 0, 255, 255; + --color-base1: 0, 255, 255; --color-sdk-auxiliary: 0, 66, 66; --color-sdk-auxiliary-public: #ffffff; --color-sdk-warning-0: #1BF8C3; @@ -44,9 +44,9 @@ --color-sdk-text-head: #FFFFFF; --color-sdk-text-head-1: #E6F7FF; --color-sdk-text-head-2: #ADF1FF; - --color-sdk-gradual: rgb(0, 255, 255) 6.25%, rgb(0, 200, 255) 100%; - --color-sdk-bg-gradual: #00ffff33 0%, #00ffff00 100%; - --color-sdk-text-shadow: rgba(20, 118, 255, 1); + --color-sdk-gradual: rgb(var(--color-base1)) 6.25%, var(--color-border1) 100%; + --color-sdk-bg-gradual: rgba(var(--color-base1), 0.2) 0%, rgba(var(--color-base1), 0) 100%; + --color-text-shadow: rgba(20, 118, 255, 1); } .cesium-viewer-cesiumWidgetContainer { @@ -88,7 +88,7 @@ width: 70.5px; height: 6px; opacity: 1; - background: rgba(var(--color-sdk-base-rgb), 1); + background: rgba(var(--color-base1), 1); clip-path: polygon(0 0, calc(100% - 3px) 0, 100% 6px, 0 6px); } @@ -158,8 +158,8 @@ border-radius: 4px; white-space: nowrap; border-radius: 4px; - background: rgba(var(--color-sdk-base-rgb), 0.2); - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + background: rgba(var(--color-base1), 0.2); + border: 1px solid rgba(var(--color-base1), 0.5); display: flex; justify-content: flex-start; align-items: center; @@ -170,7 +170,7 @@ } .YJ-custom-base-dialog button:not(button[disabled]):hover { - border-color: rgba(var(--color-sdk-base-rgb), 1) !important; + border-color: rgba(var(--color-base1), 1) !important; cursor: pointer; } @@ -224,7 +224,7 @@ line-height: 0px; color: rgba(255, 255, 255, 1); text-align: left; - text-shadow: 0px 0px 9px var(--color-sdk-text-shadow); + text-shadow: 0px 0px 9px var(--color-text-shadow); -webkit-pointer-events: none; -moz-pointer-events: none; -ms-pointer-events: none; @@ -244,7 +244,7 @@ line-height: 0px; color: rgba(255, 255, 255, 1); text-align: left; - text-shadow: 0px 0px 9px var(--color-sdk-text-shadow) + text-shadow: 0px 0px 9px var(--color-text-shadow) } .YJ-custom-base-dialog>.title-box>.close-box { @@ -262,7 +262,7 @@ display: block; width: 100%; height: 100%; - background: rgba(var(--color-sdk-base-rgb), 1); + background: rgba(var(--color-base1), 1); opacity: 0.5; } @@ -336,7 +336,7 @@ .YJ-custom-base-dialog>.content textarea { font-size: 16px; background-color: rgba(0, 0, 0, 0.5); - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border: 1px solid rgba(var(--color-base1), 0.5); border-radius: 5px; line-height: 32px; height: 32px; @@ -351,13 +351,13 @@ } .YJ-custom-base-dialog>.content input[type=checkbox]:read-only { - background-color: rgba(var(--color-sdk-base-rgb), 0.2); + background-color: rgba(var(--color-base1), 0.2); } .YJ-custom-base-dialog>.content input:focus-visible, .YJ-custom-base-dialog>.content textarea:focus-visible { outline: none; - border-color: rgba(var(--color-sdk-base-rgb), 0.8); + border-color: rgba(var(--color-base1), 0.8); } .YJ-custom-base-dialog>.content select:focus-visible { @@ -366,7 +366,7 @@ } .YJ-custom-base-dialog>.content select { - background-color: rgba(var(--color-sdk-base-rgb), 0.2); + background-color: rgba(var(--color-base1), 0.2); border: 1px solid rgba(0, 255, 255, 0); border-radius: 5px; line-height: 32px; @@ -454,14 +454,14 @@ background-color: #ffffff00; color: #000; overflow: hidden; - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border: 1px solid rgba(var(--color-base1), 0.5); } .YJ-custom-base-dialog>.content .table input {} .YJ-custom-base-dialog>.content .table .tr { display: flex; - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border: 1px solid rgba(var(--color-base1), 0.5); border-right: none; } @@ -545,13 +545,13 @@ .YJ-custom-base-dialog>.content *::-webkit-scrollbar-thumb { border-radius: 5px; -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); - background-color: rgba(var(--color-sdk-base-rgb)); + background-color: rgba(var(--color-base1)); } .YJ-custom-base-dialog>.content *::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); border-radius: 5px; - background-color: rgba(var(--color-sdk-base-rgb), 0.1); + background-color: rgba(var(--color-base1), 0.1); } .YJ-custom-base-dialog>.content .table .table-body .tr:last-child {} @@ -559,7 +559,7 @@ .YJ-custom-base-dialog>.content .table .tr .th, .YJ-custom-base-dialog>.content .table .tr .td { flex: 1; - border-right: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border-right: 1px solid rgba(var(--color-base1), 0.5); padding: 5px 10px; display: flex; align-items: center; @@ -639,7 +639,7 @@ .YJ-custom-base-dialog>.content .table.camera-table .tr:last-child, .YJ-custom-base-dialog>.content .table.isc-table .tr:last-child { - border-bottom: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border-bottom: 1px solid rgba(var(--color-base1), 0.5); } .YJ-custom-base-dialog>.content .table.camera-table .tr .td span, @@ -692,7 +692,7 @@ height: 6px; border: 0; margin-top: 20px; - background: rgba(var(--color-sdk-base-rgb), 0.2); + background: rgba(var(--color-base1), 0.2); -webkit-appearance: none; } */ .YJ-custom-base-dialog>.content [type="range"] { @@ -709,7 +709,7 @@ .YJ-custom-base-dialog>.content [type="range"]::-webkit-slider-runnable-track { height: 6px; - background: rgba(var(--color-sdk-base-rgb), 0.2); + background: rgba(var(--color-base1), 0.2); } .YJ-custom-base-dialog>.content [type="range" i]::-webkit-slider-container { @@ -723,10 +723,10 @@ width: 20px; height: 20px; border-radius: 50%; - background-color: rgba(var(--color-sdk-base-rgb), 1); - border: 1px solid rgba(var(--color-sdk-base-rgb), 1); + background-color: rgba(var(--color-base1), 1); + border: 1px solid rgba(var(--color-base1), 1); margin-top: -7px; - border-image: linear-gradient(rgba(var(--color-sdk-base-rgb), 1), rgba(var(--color-sdk-base-rgb), 1)) 0 fill / 8 20 8 0 / 0px 0px 0 2000px; + border-image: linear-gradient(rgba(var(--color-base1), 1), rgba(var(--color-base1), 1)) 0 fill / 8 20 8 0 / 0px 0px 0 2000px; } @@ -757,11 +757,12 @@ font-weight: 700; font-family: 'D-Din-Bold'; font-size: 18px; */ - font-size: 12px; + font-family: 'ddin'; + font-size: 18px; font-weight: 400; letter-spacing: 0px; line-height: 24px; - color: rgba(204, 204, 204, 1); + color: rgb(255, 255, 255); text-align: left; vertical-align: top; } @@ -800,6 +801,15 @@ margin-right: -15px; } +.YJ-custom-base-dialog>.content .input-number-unit input[type=number] { + padding: 0 16px 0 10px; +} +.YJ-custom-base-dialog>.content .input-number-unit input[type=number]::-webkit-outer-spin-button, +.YJ-custom-base-dialog>.content .input-number-unit input[type=number]::-webkit-inner-spin-button { + margin-left: 5px; + margin-right: -12px; +} + .YJ-custom-base-dialog>.content .input-number-unit-1 input[type=number] { padding: 0 26px 0 10px; } @@ -916,11 +926,11 @@ } .fly-roam>.content .table .table-body .tr.active { - background: rgba(var(--color-sdk-base-rgb), 0.15); + background: rgba(var(--color-base1), 0.15); } .fly-roam>.content .table .table-body .tr:last-child { - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border: 1px solid rgba(var(--color-base1), 0.5); border-left: none; border-right: none; } @@ -935,7 +945,7 @@ cursor: no-drop; } .YJ-custom-base-dialog>.content .fly-roam .table .table-body .tr:last-child .play:hover { - border-color: rgba(var(--color-sdk-base-rgb), 0.5) !important; + border-color: rgba(var(--color-base1), 0.5) !important; } */ .fly-roam>.content .table .action { @@ -1065,7 +1075,7 @@ margin-top: 1px; font-size: 14px; background-color: rgba(0, 0, 0, 0.5); - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border: 1px solid rgba(var(--color-base1), 0.5); border-radius: 5px; line-height: 32px; height: 32px; @@ -1092,7 +1102,7 @@ } .YJ-custom-base-dialog .ew-color-picker .icon-pen-box:hover .icon-pen { - fill: rgba(var(--color-sdk-base-rgb), 1); + fill: rgba(var(--color-base1), 1); margin: 0; } @@ -1154,14 +1164,14 @@ .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.add, .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.subtract { - border-color: rgba(var(--color-sdk-base-rgb), 0.2); + border-color: rgba(var(--color-base1), 0.2); background: unset; line-height: 22px; } .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.add:hover, .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.subtract:hover { - border-color: rgba(var(--color-sdk-base-rgb), 0.4); + border-color: rgba(var(--color-base1), 0.4); } .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container svg, @@ -1445,13 +1455,13 @@ .DIV-cy-tabs .DIV-cy-tab-top::-webkit-scrollbar-thumb { border-radius: 5px; -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); - background-color: rgba(var(--color-sdk-base-rgb)); + background-color: rgba(var(--color-base1)); } .DIV-cy-tabs .DIV-cy-tab-top::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); border-radius: 5px; - background-color: rgba(var(--color-sdk-base-rgb), 0.1); + background-color: rgba(var(--color-base1), 0.1); } .DIV-cy-tabs .DIV-cy-tab-top::after { @@ -1474,11 +1484,11 @@ } .DIV-cy-tabs .DIV-cy-tab-pane-title .DIV-cy-tab-pane-title-p:hover { - border-bottom-color: rgba(var(--color-sdk-base-rgb)); + border-bottom-color: rgba(var(--color-base1)); } .DIV-cy-tabs .DIV-cy-tab-pane-title .DIV-cy-tab-pane-title-p:hover span { - text-shadow: 0px 0px 9px var(--color-sdk-text-shadow); + text-shadow: 0px 0px 9px var(--color-text-shadow); } .DIV-cy-tabs .DIV-cy-tab-pane-title:first-child { @@ -1515,11 +1525,11 @@ } .DIV-cy-tabs .DIV-cy-tab-pane-title-p.is-active { - border-bottom-color: rgba(var(--color-sdk-base-rgb)); + border-bottom-color: rgba(var(--color-base1)); } .DIV-cy-tabs .DIV-cy-tab-pane-title-p.is-active span { - text-shadow: 0px 0px 9px var(--color-sdk-text-shadow); + text-shadow: 0px 0px 9px var(--color-text-shadow); } /* 开关按钮样式 */ @@ -1530,8 +1540,8 @@ height: 20px; padding: 0; position: relative; - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.2); - background-color: rgba(var(--color-sdk-base-rgb), 0.2); + border: 1px solid rgba(var(--color-base1), 0.2); + background-color: rgba(var(--color-base1), 0.2); border-radius: 20px; background-clip: content-box; display: inline-block; @@ -1555,9 +1565,9 @@ .YJ-custom-base-dialog>.content .btn-switch:checked, .YJ-custom-base-dialog>.foot .btn-switch:checked { - border-color: rgba(var(--color-sdk-base-rgb), 1); - box-shadow: rgba(var(--color-sdk-base-rgb)) 0 0 0 16px inset; - background-color: rgba(var(--color-sdk-base-rgb)); + border-color: rgba(var(--color-base1), 1); + box-shadow: rgba(var(--color-base1)) 0 0 0 16px inset; + background-color: rgba(var(--color-base1)); } .YJ-custom-base-dialog>.content .btn-switch:checked:before, @@ -1709,12 +1719,12 @@ .YJ-custom-base-dialog>.content .cy_datalist input.datalist { border-color: #00000000; - background-color: rgba(var(--color-sdk-base-rgb), 0.2) !important; + background-color: rgba(var(--color-base1), 0.2) !important; } .YJ-custom-base-dialog>.content .cy_datalist dl { min-width: 100%; - border-color: rgba(var(--color-sdk-base-rgb), 0.5); + border-color: rgba(var(--color-base1), 0.5); } .YJ-custom-base-dialog>.content .cy_datalist dl dd { @@ -1727,17 +1737,17 @@ } .YJ-custom-base-dialog>.content .cy_datalist dl dd:hover { - background-color: rgba(var(--color-sdk-base-rgb), 0.2); + background-color: rgba(var(--color-base1), 0.2); color: white; } .YJ-custom-base-dialog>.content .cy_datalist dl dd.active { - color: rgba(var(--color-sdk-base-rgb)) !important; - /* background-color: rgba(var(--color-sdk-base-rgb), 0.2); */ + color: rgba(var(--color-base1)) !important; + /* background-color: rgba(var(--color-base1), 0.2); */ } .YJ-custom-base-dialog>.content .cy_datalist dl dd.active svg { - fill: rgba(var(--color-sdk-base-rgb)) + fill: rgba(var(--color-base1)) } .YJ-custom-base-dialog>.content .cy_datalist dl dd.active::before { @@ -1745,8 +1755,8 @@ display: inline-block; width: 8px; height: 4px; - border-bottom: 2px solid rgba(var(--color-sdk-base-rgb)); - border-left: 2px solid rgba(var(--color-sdk-base-rgb)); + border-bottom: 2px solid rgba(var(--color-base1)); + border-left: 2px solid rgba(var(--color-base1)); transform: rotate(-45deg); position: absolute; right: 6px; @@ -1808,7 +1818,7 @@ width: 23px; height: 26px; cursor: pointer; - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.2); + border: 1px solid rgba(var(--color-base1), 0.2); display: flex; align-items: center; justify-content: center; @@ -1942,13 +1952,13 @@ } .YJ-custom-base-dialog.trajectory-motion>.content .btn.is-active { - border-color: rgba(var(--color-sdk-base-rgb)); + border-color: rgba(var(--color-base1)); } .YJ-custom-base-dialog.trajectory-motion>.content .btn-group .btn.is-active>span { color: #fff; font-size: 16px; - text-shadow: 0px 0px 9px var(--color-sdk-text-shadow); + text-shadow: 0px 0px 9px var(--color-text-shadow); font-weight: 400; } @@ -2029,7 +2039,7 @@ .YJ-custom-base-dialog.sun-shine-surface>.content>div .progress { height: 100%; width: 0; - background: rgba(var(--color-sdk-base-rgb), 1); + background: rgba(var(--color-base1), 1); border-radius: 15px; position: relative; } @@ -2039,7 +2049,7 @@ height: 16px; background: white; /* border: 3px solid #4285f4; */ - background: rgba(var(--color-sdk-base-rgb), 1); + background: rgba(var(--color-base1), 1); border-radius: 50%; position: absolute; right: -8px; @@ -2255,7 +2265,7 @@ } .YJ-custom-base-dialog.submerge>.content .table-body .tr:last-child { - border-bottom: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border-bottom: 1px solid rgba(var(--color-base1), 0.5); } .YJ-custom-base-dialog.submerge>.content .table-empty { @@ -2331,7 +2341,7 @@ } .YJ-custom-base-dialog.view-shed>.content .range-box .range-bg { - background: rgba(var(--color-sdk-base-rgb), 0.2); + background: rgba(var(--color-base1), 0.2); height: 100%; width: 100%; mask: url(../img/range.svg); @@ -2353,7 +2363,7 @@ .YJ-custom-base-dialog.view-shed>.content .range-box .range-bg .range-process { width: 0; height: 100%; - background: rgba(var(--color-sdk-base-rgb), 1); + background: rgba(var(--color-base1), 1); } .YJ-custom-base-dialog.view-shed>.content .range-box .range-node-box { @@ -2399,7 +2409,7 @@ height: 20px; background: #ffffff; border-radius: 50%; - border: 2px solid rgba(var(--color-sdk-base-rgb), 1); + border: 2px solid rgba(var(--color-base1), 1); } .YJ-custom-base-dialog.view-shed>.content .range-box .range-node-box .range-node-active-text { @@ -2418,7 +2428,7 @@ .YJ-custom-base-dialog.view-shed>.content .range-box input[type="range"]::-webkit-slider-runnable-track { height: 6px; - background: rgba(var(--color-sdk-base-rgb), 0); + background: rgba(var(--color-base1), 0); } .YJ-custom-base-dialog.view-shed>.content .range-box input[type="range"]::-webkit-slider-thumb { @@ -2427,10 +2437,10 @@ width: 20px; height: 20px; border-radius: 50%; - background-color: rgba(var(--color-sdk-base-rgb), 0); - border: 1px solid rgba(var(--color-sdk-base-rgb), 0); + background-color: rgba(var(--color-base1), 0); + border: 1px solid rgba(var(--color-base1), 0); margin-top: -7px; - border-image: linear-gradient(rgba(var(--color-sdk-base-rgb), 0), rgba(var(--color-sdk-base-rgb), 0)) 0 fill / 8 20 8 0 / 0px 0px 0 2000px; + border-image: linear-gradient(rgba(var(--color-base1), 0), rgba(var(--color-base1), 0)) 0 fill / 8 20 8 0 / 0px 0px 0 2000px; } /* 通视分析 */ @@ -2473,7 +2483,7 @@ } .el-slider { - --el-slider-main-bg-color: rgba(var(--color-sdk-base-rgb), 1) + --el-slider-main-bg-color: rgba(var(--color-base1), 1) } /* 地形可视域分析 */ @@ -2704,6 +2714,11 @@ flex: 0 0 160px; } +.YJ-custom-base-dialog>.content>div .spatial-info-table .table-body .td input[type=number] { + font-family: 'ddin'; + font-size: 14px; +} + /* 集结地 */ .YJ-custom-base-dialog.assemble>.content { width: 600px; @@ -2930,33 +2945,33 @@ } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit .datalist { - background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; + background-color: rgba(var(--color-base1), 0.1) !important; border-radius: 4px 0px 0px 4px !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) .datalist { - background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; + background-color: rgba(var(--color-base1), 0.1) !important; border-radius: 4px 0px, 0px, 4px !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) .datalist { - background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; + background-color: rgba(var(--color-base1), 0.1) !important; border-radius: 0px 4px 4px 0px !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) input { - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; + border: 1px solid rgba(var(--color-base1), 0.5) !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) input { - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; + border: 1px solid rgba(var(--color-base1), 0.5) !important; } .YJ-custom-base-dialog.polyline>.content input.input-text { background-color: rgba(0, 0, 0, 0.5) !important; border-radius: unset !important; - border-top: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; - border-bottom: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; + border-top: 1px solid rgba(var(--color-base1), 0.5) !important; + border-bottom: 1px solid rgba(var(--color-base1), 0.5) !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist input { @@ -3057,33 +3072,33 @@ } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit .datalist { - background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; + background-color: rgba(var(--color-base1), 0.1) !important; border-radius: 4px 0px 0px 4px !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) .datalist { - background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; + background-color: rgba(var(--color-base1), 0.1) !important; border-radius: 4px 0px, 0px, 4px !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) .datalist { - background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; + background-color: rgba(var(--color-base1), 0.1) !important; border-radius: 0px 4px 4px 0px !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) input { - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; + border: 1px solid rgba(var(--color-base1), 0.5) !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) input { - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; + border: 1px solid rgba(var(--color-base1), 0.5) !important; } .YJ-custom-base-dialog.polyline>.content input.input-text { background-color: rgba(0, 0, 0, 0.5) !important; border-radius: unset !important; - border-top: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; - border-bottom: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; + border-top: 1px solid rgba(var(--color-base1), 0.5) !important; + border-bottom: 1px solid rgba(var(--color-base1), 0.5) !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist input { @@ -3109,19 +3124,19 @@ } .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.line { - border: 1px solid rgba(var(--color-sdk-base-rgb), 1); + border: 1px solid rgba(var(--color-base1), 1); height: 0px; margin-top: 4px; } .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.dash-line { - border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); + border: 1px dashed rgba(var(--color-base1), 1); height: 0px; margin-top: 4px; } .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.light-line { - border: 1px solid rgba(var(--color-sdk-base-rgb), 1); + border: 1px solid rgba(var(--color-base1), 1); height: 0px; margin-top: 4px; box-shadow: 0 0 3px #fff @@ -3138,13 +3153,13 @@ } .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.flow-dash-line1 { - border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); + border: 1px dashed rgba(var(--color-base1), 1); height: 0px; margin-top: 4px; } .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.flow-dash-line2 { - border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); + border: 1px dashed rgba(var(--color-base1), 1); height: 0px; margin-top: 4px; } @@ -3213,13 +3228,13 @@ .popup-textarea textarea::-webkit-scrollbar-thumb { border-radius: 5px!important; -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2)!important; - background-color: rgba(var(--color-sdk-base-rgb))!important; + background-color: rgba(var(--color-base1))!important; } .popup-textarea textarea::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2)!important; border-radius: 5px!important; - background-color: rgba(var(--color-sdk-base-rgb), 0.1)!important; + background-color: rgba(var(--color-base1), 0.1)!important; } /* 贴地图片 */ @@ -3292,19 +3307,19 @@ .YJ-custom-base-dialog.proj-convert>.content>div .top-line { top: 5px; border-radius: 0 4px 0 0; - border-top: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); - border-right: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border-top: 1px solid rgba(var(--color-base1), 0.5); + border-right: 1px solid rgba(var(--color-base1), 0.5); } .YJ-custom-base-dialog.proj-convert>.content>div .bottom-line { bottom: 5px; border-radius: 0 0 4px 0; - border-bottom: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); - border-right: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border-bottom: 1px solid rgba(var(--color-base1), 0.5); + border-right: 1px solid rgba(var(--color-base1), 0.5); } .YJ-custom-base-dialog.proj-convert>.content>div .icon-copy-box:hover .icon-copy { - fill: rgba(var(--color-sdk-base-rgb)); + fill: rgba(var(--color-base1)); } /* 高清截图 */ @@ -3325,7 +3340,7 @@ .YJ-custom-base-dialog.screenShotHD>.content>div .progress { width: 200px; height: 6px; - background: rgba(var(--color-sdk-base-rgb), 0.2); + background: rgba(var(--color-base1), 0.2); border-radius: 3px; position: relative; } @@ -3334,7 +3349,7 @@ width: 0%; height: 6px; border-radius: 3px; - background: rgba(var(--color-sdk-base-rgb), 1); + background: rgba(var(--color-base1), 1); } .YJ-custom-base-dialog.screenShotHD>.content>div .progress>.progress-text { @@ -3369,7 +3384,7 @@ } .YJ-custom-base-dialog.screenShotHD>.content>div .range-box .range-bg { - background: rgba(var(--color-sdk-base-rgb), 0.2); + background: rgba(var(--color-base1), 0.2); border-radius: 3px; height: 100%; width: 100%; @@ -3390,13 +3405,13 @@ .YJ-custom-base-dialog.screenShotHD>.content>div .range-box .range-bg .range-process { width: 0; height: 100%; - background: rgba(var(--color-sdk-base-rgb), 1); + background: rgba(var(--color-base1), 1); } .YJ-custom-base-dialog.screenShotHD>.content>div .range-box .range-bg .range-process { width: 0; height: 100%; - background: rgba(var(--color-sdk-base-rgb), 1); + background: rgba(var(--color-base1), 1); } .YJ-custom-base-dialog.screenShotHD>.content>div .range-box .range-node-box { @@ -3431,7 +3446,7 @@ height: 13px; background: #ffffff; border-radius: 50%; - border: 2px solid rgba(var(--color-sdk-base-rgb), 1); + border: 2px solid rgba(var(--color-base1), 1); } .YJ-custom-base-dialog.screenShotHD>.content>div .range-box .range-node-box .range-node-active-text { @@ -3450,7 +3465,7 @@ .YJ-custom-base-dialog.screenShotHD>.content>div .range-box input[type="range"]::-webkit-slider-runnable-track { height: 6px; - background: rgba(var(--color-sdk-base-rgb), 0); + background: rgba(var(--color-base1), 0); } .YJ-custom-base-dialog.screenShotHD>.content>div .range-box input[type="range"]::-webkit-slider-thumb { @@ -3459,10 +3474,10 @@ width: 20px; height: 20px; border-radius: 50%; - background-color: rgba(var(--color-sdk-base-rgb), 0); - border: 1px solid rgba(var(--color-sdk-base-rgb), 0); + background-color: rgba(var(--color-base1), 0); + border: 1px solid rgba(var(--color-base1), 0); margin-top: -7px; - border-image: linear-gradient(rgba(var(--color-sdk-base-rgb), 0), rgba(var(--color-sdk-base-rgb), 0)) 0 fill / 8 20 8 0 / 0px 0px 0 2000px; + border-image: linear-gradient(rgba(var(--color-base1), 0), rgba(var(--color-base1), 0)) 0 fill / 8 20 8 0 / 0px 0px 0 2000px; } /* 地图打印 */ @@ -3577,7 +3592,7 @@ flex: 0 0 25px; padding: 0; border-radius: 5px; - border: 1px solid rgba(var(--color-sdk-base-rgb), 1); + border: 1px solid rgba(var(--color-base1), 1); -webkit-appearance: none; vertical-align: middle; background: rgba(0, 0, 0, 0.5); @@ -3598,7 +3613,7 @@ .YJ-custom-checkbox-left:checked::after, .YJ-custom-checkbox-right:checked::after { content: "✔"; - background-color: rgba(var(--color-sdk-base-rgb), 1); + background-color: rgba(var(--color-base1), 1); color: rgba(var(--color-sdk-auxiliary), 1); width: 25px; height: 25px; @@ -3613,7 +3628,7 @@ flex: 0 0 14px; padding: 0; border-radius: 2px; - border: 1px solid rgba(var(--color-sdk-base-rgb), 1); + border: 1px solid rgba(var(--color-base1), 1); -webkit-appearance: none; vertical-align: middle; background-color: rgba(0, 0, 0, 0.5); @@ -3633,7 +3648,7 @@ .YJ-custom-base-dialog>.content input.YJ-custom-checkbox[type=checkbox]:checked::after { content: "✔"; - background-color: rgba(var(--color-sdk-base-rgb), 1); + background-color: rgba(var(--color-base1), 1); color: rgba(var(--color-sdk-auxiliary), 1); width: 12px; height: 12px; @@ -3727,13 +3742,13 @@ .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content::-webkit-scrollbar-thumb { border-radius: 5px; -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); - background-color: rgba(var(--color-sdk-base-rgb)); + background-color: rgba(var(--color-base1)); } .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); border-radius: 5px; - background-color: rgba(var(--color-sdk-base-rgb), 0.1); + background-color: rgba(var(--color-base1), 0.1); } .billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content-pane { @@ -3748,8 +3763,8 @@ .billboard-attribute-box .billboard-attribute-box-line { position: absolute; width: 0px; - /* border-left: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); */ - border-left: 1px solid rgba(var(--color-sdk-base-rgb), 1); + /* border-left: 1px solid rgba(var(--color-base1), 0.5); */ + border-left: 1px solid rgba(var(--color-base1), 1); /* transform: rotate(45deg); */ transform-origin: 0px 0px; -webkit-pointer-events: none; @@ -3797,7 +3812,7 @@ background-color: #ffffff00; color: #ffffff; overflow: hidden; - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border: 1px solid rgba(var(--color-base1), 0.5); } .billboard-attribute-box .table .table-head .tr { @@ -3808,11 +3823,11 @@ .billboard-attribute-box .table .tr { display: flex; - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border: 1px solid rgba(var(--color-base1), 0.5); border-right: none; } .billboard-attribute-box .table .tr .th, .billboard-attribute-box .table .tr .td { - border-right: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border-right: 1px solid rgba(var(--color-base1), 0.5); display: flex; justify-content: center; } @@ -3862,8 +3877,8 @@ } #YJ-custom-message.success { - /* background-color: #f0f9eb; */ - /* color: rgb(82, 196, 26); */ + /* background-color: #f0f9eb; + color: rgb(82, 196, 26); */ background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), linear-gradient(0deg, rgba(27, 248, 195, 0.5) 0%, rgba(27, 248, 195, 0) 100%); diff --git a/src/renderer/src/I18n/zh-CN.ts b/src/renderer/src/I18n/zh-CN.ts index b662712..ef217f1 100644 --- a/src/renderer/src/I18n/zh-CN.ts +++ b/src/renderer/src/I18n/zh-CN.ts @@ -149,6 +149,7 @@ export default { curve: '曲线标注', panel: '面标注', roam: '漫游路径', + untitled: '未命名对象' }, system: { systemTitle: '系统面板', diff --git a/src/renderer/src/I18n/zh-EN.ts b/src/renderer/src/I18n/zh-EN.ts index 77314f8..f174fa1 100644 --- a/src/renderer/src/I18n/zh-EN.ts +++ b/src/renderer/src/I18n/zh-EN.ts @@ -149,6 +149,7 @@ export default { curve: 'Curve', panel: 'Panel', roam: 'roam', + untitled: 'untitled' }, system: { systemTitle: 'Settings', diff --git a/src/renderer/src/I18n/zh-TW.ts b/src/renderer/src/I18n/zh-TW.ts index 340e21b..78b4d3d 100644 --- a/src/renderer/src/I18n/zh-TW.ts +++ b/src/renderer/src/I18n/zh-TW.ts @@ -148,6 +148,7 @@ export default { curve: '曲線標注', panel: '面標注', roam: '漫遊路徑', + untitled: '未命名對象' }, system: { systemTitle: '系統面板', diff --git a/src/renderer/src/assets/styles/global.css b/src/renderer/src/assets/styles/global.css index 3eea871..b5dfd2a 100644 --- a/src/renderer/src/assets/styles/global.css +++ b/src/renderer/src/assets/styles/global.css @@ -415,11 +415,11 @@ img { .ztree li span.button.chk { background: none; } -.ztree li span.button.roots_open, .ztree li span.button.bottom_open { +.ztree li span.button.roots_open, .ztree li span.button.bottom_open, .ztree li span.button.center_open { background: url(../images/tree/roots-open.png) 0 0 no-repeat; background-position: center !important; } -.ztree li span.button.roots_close, .ztree li span.button.bottom_close { +.ztree li span.button.roots_close, .ztree li span.button.bottom_close, .ztree li span.button.center_close{ background: url(../images/tree/roots-close.png) 0 0 no-repeat; background-position: center !important; } @@ -626,6 +626,22 @@ img { } } +.custom-slider-tooltip { + display: block !important; + opacity: 1 !important; + background: none !important; + border: none !important; + >span:nth-child(1) { + position: relative; + top: -18px; + pointer-events: none; + } +} + +.el-slider__runway { + background: rgba(var(--color-base1), 0.2) !important; +} + @media (max-height: 850px) { #distanceLegendDiv { .compass { diff --git a/src/renderer/src/common/initMapData.ts b/src/renderer/src/common/initMapData.ts index 6a5cc65..1e2f3c1 100644 --- a/src/renderer/src/common/initMapData.ts +++ b/src/renderer/src/common/initMapData.ts @@ -47,7 +47,6 @@ export const initMapData = async (type, data, cd) => { entityObject = new YJ.Obj.SectorObject(window.earth, data) break case 'model': - console.log('model', data) entityObject = new YJ.Obj.Model(window.earth, data) break case 'military': diff --git a/src/renderer/src/icons/svg/mif.svg b/src/renderer/src/icons/svg/mif.svg new file mode 100644 index 0000000..0dd5c16 --- /dev/null +++ b/src/renderer/src/icons/svg/mif.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/renderer/src/icons/svg/tab.svg b/src/renderer/src/icons/svg/tab.svg new file mode 100644 index 0000000..500b0fe --- /dev/null +++ b/src/renderer/src/icons/svg/tab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/renderer/src/main.ts b/src/renderer/src/main.ts index 995027f..72ed250 100644 --- a/src/renderer/src/main.ts +++ b/src/renderer/src/main.ts @@ -27,6 +27,7 @@ import '../public/tree/jquery.ztree.exhide.js' import '../public/tree/fuzzysearch.js' import '../public/tree/newFuzzySearch' import theme from "@/utils/theme"; +import { handleInputLimit } from '@/utils/index' import Pagination from './components/Pagination/index.vue' import dispatchEventStorage from '@/utils/watchLocalStorage' @@ -94,6 +95,7 @@ const setApp = createApp(App) // 定义全局方法 // setApp.config.globalProperties.$md5 = md5 +setApp.config.globalProperties.$handleInputLimit = handleInputLimit setApp.component('Pagination', Pagination) setupStore(setApp) setupSvgIcon(setApp) diff --git a/src/renderer/src/utils/index.ts b/src/renderer/src/utils/index.ts index 5761668..8fb54fa 100644 --- a/src/renderer/src/utils/index.ts +++ b/src/renderer/src/utils/index.ts @@ -65,3 +65,21 @@ export function getNamefromPath(path) { return name; } + +export function handleInputLimit(e) { + if (e.data === '-') { + } + else { + e.target.value = e.target.value || 0 + const minValue = parseFloat(e.target.min); + const maxValue = parseFloat(e.target.max); + if (!isNaN(maxValue) && e.target.value > maxValue) { + e.target.value = maxValue + e.target.dispatchEvent(new Event('input')) + } + else if (!isNaN(minValue) && e.target.value < minValue) { + e.target.value = minValue + e.target.dispatchEvent(new Event('input')) + } + } +} diff --git a/src/renderer/src/views/components/bottomSide/bottomSide.vue b/src/renderer/src/views/components/bottomSide/bottomSide.vue index 2f48792..f1fdf98 100644 --- a/src/renderer/src/views/components/bottomSide/bottomSide.vue +++ b/src/renderer/src/views/components/bottomSide/bottomSide.vue @@ -545,7 +545,7 @@ const fold = () => { }, index * itemDelay) }) // 同步bottom_left的位置和旋转 - bottom_left.style.right = '18vw' + bottom_left.style.right = '-35px' bottom_left.style.transform = 'rotate(270deg)' } else { // 折叠状态 @@ -558,7 +558,7 @@ const fold = () => { // 同步bottom_left的位置和旋转 setTimeout( () => { - bottom_left.style.right = '50%' + bottom_left.style.right = '48.5%' bottom_left.style.transform = 'rotate(90deg)' }, (itemCount - 1) * itemDelay @@ -750,9 +750,9 @@ document.addEventListener('click', (e: any) => { } .bottom_left { - position: fixed; - right: 13.5vw; - bottom: 1.5em; + position: absolute; + right: -35px; + bottom: 8px; height: 1.5vw; width: 1.5vw; // background: url('../../../assets/images/hongse/shou.png') no-repeat; diff --git a/src/renderer/src/views/components/headers/components/weather/index.vue b/src/renderer/src/views/components/headers/components/weather/index.vue index cdcb6ea..951095c 100644 --- a/src/renderer/src/views/components/headers/components/weather/index.vue +++ b/src/renderer/src/views/components/headers/components/weather/index.vue @@ -10,6 +10,7 @@ 光照效果 实时光照 { + weatherData.currWeather = data +} + var weatherChange = () => { currWeatherData = true + if (weatherData.currWeather) { let ss = getCurrentTime() sunshine && (sunshine.timeBar = ss) @@ -276,6 +351,14 @@ var weatherChange = () => { timeline.closeChangeDate() // sunshine && (sunshine.time = weatherData.time) + if (!switchStatus && document.getElementById('timePause').textContent == '播放') { + document.getElementById('timePause').click() + } + } else { + if (!switchStatus && document.getElementById('timePause').textContent == '暂停') { + //如果光照开关关闭,关闭实时光照,停止时间条 + document.getElementById('timePause').click() + } } } var getDateTimeString = () => { @@ -337,26 +420,60 @@ var getCurrentTime = () => { return `${hours}:${minutes}:${seconds}` } + +const emit = defineEmits(['childEvent', 'isPause']) + +//监听父组件点击 +watch( + () => props.parentClick, + (newVal, oldVal) => { + switchStatus.value = newVal + // 如果点击icon时,当前设置页面一打开,使用当前数据 + if (newVal) { + sunshine = new YJ.Global.efflect.Sunshine(window.earth, { + id: 123, + speed: weatherData.speed, + time: weatherData.time, + // @ts-ignore + hour: document.getElementById('currentTime').textContent + }) + window.sunshine = sunshine + } + } +) + var switchFunc = () => { switchStatus.value = !switchStatus.value if (switchStatus.value) { //开启 - sunshine = new YJ.Global.efflect.Sunshine(window.earth, { - id: 123, - speed: weatherData.speed, - time: weatherData.time, - // @ts-ignore - hour: document.getElementById('currentTime').textContent - }) - timeline.setSunShine(true) + if (!window.sunshine) { + sunshine = new YJ.Global.efflect.Sunshine(window.earth, { + id: 123, + speed: weatherData.speed, + time: weatherData.time, + // @ts-ignore + hour: document.getElementById('currentTime').textContent + }) + } else { + sunshine = window.sunshine + sunshine.timeBar(document.getElementById('currentTime').textContent) + if (weatherData) { + sunshine.darkness = weatherData.darkness + sunshine.speed = weatherData.speed + sunshine.softShadow = weatherData.softShadow + } + } + // timeline.setSunShine(true) } else { //关闭 - sunshine && sunshine.remove() - sunshine = null - // let timeData = now.setHours(0, 0, 0, 0) // 设置为当天0点 - // timeline.updateTime(timeData) - timeline.setSunShine(false) + // sunshine && sunshine.remove() + // sunshine = null + // delete window.sunshine + // timeline.setSunShine(false) } + //联动外面的图标 + // emit('childEvent', switchStatus.value) + emit('childEvent', weatherData) } //雨特效 @@ -390,6 +507,7 @@ var clickIcon = (item: any) => { } } var clickTimeIcon = (item: any) => { + weatherData.currWeather = false if (document.getElementById('timePause').textContent == '播放') { timelist.forEach((data) => { if (data.name != item.name) data.status = false diff --git a/src/renderer/src/views/components/headers/components/weather/timeLIne copy.ts b/src/renderer/src/views/components/headers/components/weather/timeLIne copy.ts new file mode 100644 index 0000000..ea7cf14 --- /dev/null +++ b/src/renderer/src/views/components/headers/components/weather/timeLIne copy.ts @@ -0,0 +1,263 @@ +// @ts-nocheck +import { ElMessage } from 'element-plus' +export default class TimeLine { + constructor(sdk, speed) { + this.sdk = { ...sdk }; + this.progress = document.getElementById('progress'); + this.handle = document.getElementById('handle'); + // this.timeline = document.getElementById('timeline'); + this.timeline = document.getElementsByClassName('timeline-container')[0]; + this.currentTime = document.getElementById('currentTime'); + this.timelineCon = document.getElementsByClassName('timeline-container')[0]; + this.speed = speed; + this.animationId; + this.startTime = performance.now(); + this.manualPosition = null; + // this.manualPosition = this.calculateTimePercentage(); + this.isDragging = false; + this.pauseed = true; + this.time = ''; + this.sunShine = false; + if (this.pauseed) { + this.pausedTime = this.startTime + } + this.update = this.update.bind(this); + + TimeLine.init(this) + } + static init(that) { + for (let i = 0; i <= 24; i++) { + if (i % 6 === 0) { + + const label = document.createElement('div'); + label.className = 'time-mark'; + label.textContent = `${i}:00`; + label.style.left = `${(i / 24) * 100}%`; + document.getElementsByClassName('time-marks')[0].appendChild(label) + const point = document.createElement('div'); + point.className = 'time-Point'; + document.getElementsByClassName('time-marks')[0].appendChild(point) + + } + } + that.setCurrBar()//设置当前时间 + that.startTime = performance.now() - ((that.manualPosition || 0) * 86400 * 1000 / that.speed); + that.timeline.addEventListener('mousedown', (e) => { + + if (e.srcElement.className === 'handle') { + if (!that.sunShine) { + ElMessage({ + message: '请开启光照功能', + type: 'warning' + }) + } else { + that.isDragging = true; + } + } + e.preventDefault(); + }); + + that.timeline.addEventListener('mousemove', (e) => { + if (!that.isDragging) return; + + const rect = that.timeline.getBoundingClientRect(); + let pos = (e.clientX - rect.left) / rect.width; + pos = Math.max(0, Math.min(1, pos)); + + that.manualPosition = pos; + that.progress.style.width = `${pos * 100}%`; + + const seconds = pos * 86400; + that.currentTime.textContent = that.formatTime(seconds); + }); + that.update(); + + document.getElementById('timePause').addEventListener('click', function () { + if (!that.sunShine) { + ElMessage({ + message: '请开启光照功能', + type: 'warning' + }) + } else { + that.pauseed = !that.pauseed; + if (that.pauseed) {//暂停 + that.pausedTime = performance.now(); // 记录暂停时刻 + document.getElementById('timePause').textContent = '播放'; + that.animationId && cancelAnimationFrame(that.animationId); + that.sdk.viewer.clock.shouldAnimate = false + } else {//播放 + let now = performance.now() + const pausedDuration = now - that.pausedTime; + document.getElementById('timePause').textContent = '暂停'; + that.manualPosition = null + that.startTime += pausedDuration; // 补偿暂停期间的时间差 + if (that.changeDate) {//切换日期后让时间从0开始 + if (that.changeDateGrag) { + that.changeDateGrag = undefined + } else { + that.startTime = now + } + that.changeDate = undefined + } + if (document.getElementById('weatherSwitch').style.color === 'rgba(var(--color-base1), 1)') {//判断光照开关是否开启,开启则打开cesium阴影 + that.sdk.viewer.clock.shouldAnimate = true + } + + that.update(); // 重启动画循环 + } + } + + }); + } + setSunShine(v) { + this.sunShine = v + if (this.sunShine) { + document.getElementById('timePause')?.click() + } else { + this.pauseed = true + this.pausedTime = performance.now(); // 记录暂停时刻 + document.getElementById('timePause').textContent = '播放'; + this.animationId && cancelAnimationFrame(this.animationId); + this.sdk.viewer.clock.shouldAnimate = false + // document.getElementById('timePause')?.click() + } + } + calculateTimePercentage() { + // 获取当前时间 + const now = new Date(); + const hours = now.getHours(); + const minutes = now.getMinutes(); + const seconds = now.getSeconds(); + + // 计算当前时间总秒数 + const totalSeconds = (hours * 3600) + (minutes * 60) + seconds; + + // 24小时总秒数 + const totalSecondsInDay = 24 * 3600; + + // 计算百分比并保留两位小数 + const percentage = (totalSeconds / totalSecondsInDay); + return percentage; + } + moveComplay(func) { + let that = this + // that.timeline.addEventListener('mouseup', () => { + document.addEventListener('mouseup', () => { + if (that.isDragging) { + that.isDragging = false; + if (that.manualPosition !== null) { + // that.sdk.viewer.clock.shouldAnimate = true + that.startTime = performance.now() - (that.manualPosition * 86400 * 1000 / that.speed); + that.manualPosition = null; + that.changeDate && (that.changeDateGrag = true) + if (!that.pauseed) { + that.update() + func(that.time) + } else { + that.pausedTime = performance.now(); // 记录暂停时刻 + func(that.currentTime.textContent) + } + + } + } + }); + } + setCurrBar() { + let pos = this.calculateTimePercentage() + this.manualPosition = pos; + this.progress.style.width = `${pos * 100}%`; + + const seconds = pos * 86400; + this.currentTime.textContent = this.formatTime(seconds); + } + formatTime(seconds) { + const hrs = Math.floor(seconds / 3600).toString().padStart(2, '0'); + const mins = Math.floor((seconds % 3600) / 60).toString().padStart(2, '0'); + const secs = Math.floor(seconds % 60).toString().padStart(2, '0'); + return `${hrs}:${mins}:${secs}`; + } + + update() { + if (this.manualPosition !== null) return; + if (this.changeDate) {//切换日期后让时间从0开始 + this.startTime = performance.now() + } + let elapsed = (performance.now() - this.startTime) * this.speed; + // if (this.elapsed) { + // elapsed = elapsed + this.elapsed + // this.elapsed = undefined + // } + const totalSeconds = elapsed / 1000;//秒 + const daySeconds = totalSeconds % 86400;//天 + const percentage = daySeconds / 86400; + + this.progress.style.width = `${percentage * 100}%`; + this.time = this.formatTime(daySeconds) + this.currentTime.textContent = this.time; + if (!this.pauseed) { + this.animationId && cancelAnimationFrame(this.animationId); + this.animationId = requestAnimationFrame(this.update); + } + } + setSpeed(v) { + let now = performance.now() + if (!this.pauseed) { + const currentProgress = this.manualPosition ?? + (performance.now() - this.startTime) * this.speed / (86400 * 1000); + this.speed = v; + this.startTime = performance.now() - (currentProgress * 86400 * 1000 / this.speed); + + } else { + let pausedDuration = now - this.pausedTime; + this.startTime += pausedDuration; // 补偿暂停期间的时间差 + const currentProgress = this.manualPosition ?? + (now - this.startTime) * this.speed / (86400 * 1000); + this.speed = v; + this.startTime = now - (currentProgress * 86400 * 1000 / this.speed); + + this.pausedTime = now; // 记录切换speed暂停时刻 + // this.speed = v; + } + this.manualPosition = null; + // this.update(); + + } + setTime(time) { + // 解析传入的时间字符串 "6:40" + const [hours, minutes] = time.split(':').map(Number); + + // 设置秒数为0 + const seconds = 0; + + // 计算传入时间总秒数 + const totalSeconds = (hours * 3600) + (minutes * 60) + seconds; + + // 24小时总秒数 + const totalSecondsInDay = 24 * 3600; + + // 计算百分比 + const pos = totalSeconds / totalSecondsInDay; + + this.manualPosition = pos; + this.progress.style.width = `${pos * 100}%`; + + const displaySeconds = pos * 86400; + this.currentTime.textContent = this.formatTime(displaySeconds); + } + closeChangeDate() { + this.changeDate && (this.changeDate = false) + } + updateTime() { + this.manualPosition = null; + this.startTime = performance.now() - ((this.manualPosition || 0) * 86400 * 1000 / this.speed); + this.pauseed && (this.changeDate = true) + this.changeDateGrag = undefined + this.update(); + } + clear() { + this.animationId && cancelAnimationFrame(this.animationId); + this.progress.style.width = '0%'; + this.currentTime.textContent = '00:00:00'; + } + +} diff --git a/src/renderer/src/views/components/headers/components/weather/timeLIne.ts b/src/renderer/src/views/components/headers/components/weather/timeLIne.ts index 5772a1c..38813a7 100644 --- a/src/renderer/src/views/components/headers/components/weather/timeLIne.ts +++ b/src/renderer/src/views/components/headers/components/weather/timeLIne.ts @@ -1,7 +1,7 @@ // @ts-nocheck import { ElMessage } from 'element-plus' export default class TimeLine { - constructor(sdk, speed) { + constructor(sdk, speed, sunShine, timeWords, initCallback) { this.sdk = { ...sdk }; this.progress = document.getElementById('progress'); this.handle = document.getElementById('handle'); @@ -9,6 +9,7 @@ export default class TimeLine { this.timeline = document.getElementsByClassName('timeline-container')[0]; this.currentTime = document.getElementById('currentTime'); this.timelineCon = document.getElementsByClassName('timeline-container')[0]; + this.timeWords = timeWords; this.speed = speed; this.animationId; this.startTime = performance.now(); @@ -17,15 +18,15 @@ export default class TimeLine { this.isDragging = false; this.pauseed = true; this.time = ''; - this.sunShine = false; + this.sunShine = sunShine || false; if (this.pauseed) { this.pausedTime = this.startTime } this.update = this.update.bind(this); - TimeLine.init(this) + TimeLine.init(this, initCallback) } - static init(that) { + static init(that, callback) { for (let i = 0; i <= 24; i++) { if (i % 6 === 0) { @@ -40,7 +41,7 @@ export default class TimeLine { } } - that.setCurrBar()//设置当前时间 + that.setCurrBar(that.timeWords)//设置当前时间 that.startTime = performance.now() - ((that.manualPosition || 0) * 86400 * 1000 / that.speed); that.timeline.addEventListener('mousedown', (e) => { @@ -73,36 +74,43 @@ export default class TimeLine { that.update(); document.getElementById('timePause').addEventListener('click', function () { - if (!that.sunShine) { - ElMessage({ - message: '请开启光照功能', - type: 'warning' - }) - } else { - that.pauseed = !that.pauseed; - if (that.pauseed) {//暂停 - that.pausedTime = performance.now(); // 记录暂停时刻 - document.getElementById('timePause').textContent = '播放'; - that.animationId && cancelAnimationFrame(that.animationId); - that.sdk.viewer.clock.shouldAnimate = false - } else {//播放 - let now = performance.now() - const pausedDuration = now - that.pausedTime; - document.getElementById('timePause').textContent = '暂停'; - that.manualPosition = null - that.startTime += pausedDuration; // 补偿暂停期间的时间差 - if (that.changeDate) {//切换日期后让时间从0开始 - if (that.changeDateGrag) { - that.changeDateGrag = undefined - } else { - that.startTime = now - } - that.changeDate = undefined - } - that.sdk.viewer.clock.shouldAnimate = true - that.update(); // 重启动画循环 + // if (!that.sunShine) { + // ElMessage({ + // message: '请开启光照功能', + // type: 'warning' + // }) + // } else { + that.pauseed = !that.pauseed; + if (that.pauseed) {//暂停 + that.pausedTime = performance.now(); // 记录暂停时刻 + document.getElementById('timePause').textContent = '播放'; + that.animationId && cancelAnimationFrame(that.animationId); + that.sdk.viewer && (that.sdk.viewer.clock.shouldAnimate = false) + + //判断当没有开启光照时,点击停止播放时关闭实时光照按钮 + if (document.getElementById('weatherSwitch').style.color == 'rgb(255, 255, 255)') { + callback(false) } + } else {//播放 + let now = performance.now() + const pausedDuration = now - that.pausedTime; + document.getElementById('timePause').textContent = '暂停'; + that.manualPosition = null + that.startTime += pausedDuration; // 补偿暂停期间的时间差 + if (that.changeDate) {//切换日期后让时间从0开始 + if (that.changeDateGrag) { + that.changeDateGrag = undefined + } else { + that.startTime = now + } + that.changeDate = undefined + } + if (document.getElementById('weatherSwitch').style.color === 'rgba(var(--color-base1), 1)') {//判断光照开关是否开启,开启则打开cesium阴影 + that.sdk.viewer.clock.shouldAnimate = true + } + that.update(); // 重启动画循环 } + // } }); } @@ -119,20 +127,56 @@ export default class TimeLine { // document.getElementById('timePause')?.click() } } - calculateTimePercentage() { - // 获取当前时间 - const now = new Date(); - const hours = now.getHours(); - const minutes = now.getMinutes(); - const seconds = now.getSeconds(); + // calculateTimePercentage() { + // // 获取当前时间 + // const now = new Date(); + // const hours = now.getHours(); + // const minutes = now.getMinutes(); + // const seconds = now.getSeconds(); - // 计算当前时间总秒数 - const totalSeconds = (hours * 3600) + (minutes * 60) + seconds; + // // 计算当前时间总秒数 + // const totalSeconds = (hours * 3600) + (minutes * 60) + seconds; + + // // 24小时总秒数 + // const totalSecondsInDay = 24 * 3600; + + // // 计算百分比并保留两位小数 + // const percentage = (totalSeconds / totalSecondsInDay); + // return percentage; + // } + calculateTimePercentage(timeString = null) { + let totalSeconds; + + if (timeString) { + // 解析传入的时间字符串 "HH:MM:SS" + const timeParts = timeString.split(':'); + const hours = parseInt(timeParts[0]); + const minutes = parseInt(timeParts[1]); + const seconds = parseInt(timeParts[2]); + + // 验证时间格式 + if (isNaN(hours) || isNaN(minutes) || isNaN(seconds) || + hours < 0 || hours > 23 || + minutes < 0 || minutes > 59 || + seconds < 0 || seconds > 59) { + throw new Error('Invalid time format. Please use "HH:MM:SS" format'); + } + + totalSeconds = (hours * 3600) + (minutes * 60) + seconds; + } else { + // 获取当前时间 + const now = new Date(); + const hours = now.getHours(); + const minutes = now.getMinutes(); + const seconds = now.getSeconds(); + + totalSeconds = (hours * 3600) + (minutes * 60) + seconds; + } // 24小时总秒数 const totalSecondsInDay = 24 * 3600; - // 计算百分比并保留两位小数 + // 计算百分比 const percentage = (totalSeconds / totalSecondsInDay); return percentage; } @@ -159,8 +203,8 @@ export default class TimeLine { } }); } - setCurrBar() { - let pos = this.calculateTimePercentage() + setCurrBar(time) { + let pos = this.calculateTimePercentage(time) this.manualPosition = pos; this.progress.style.width = `${pos * 100}%`; diff --git a/src/renderer/src/views/components/headers/index.vue b/src/renderer/src/views/components/headers/index.vue index 5074450..ce6d614 100644 --- a/src/renderer/src/views/components/headers/index.vue +++ b/src/renderer/src/views/components/headers/index.vue @@ -14,14 +14,22 @@
- + @@ -58,6 +66,17 @@ const headImg = computed(() => { } }) +let weatherIcon = ref(null) +const handleChildData = (data) => { + clickFun(data) +} + +//存储子组件播放按钮状态:true:暂停 + +const isPause = (data) => { + window.pauseBut = weatherClick && data ? true : false +} + const skinInfo = ref(JSON.parse(localStorage.getItem('systemSetting') || '{}').skinInfo || 'color1') const { t } = useI18n() @@ -67,7 +86,6 @@ const date = ref({ week: 0 }) window.addEventListener('setItemEvent', (e: any) => { - console.log('e', e) if (e.key == 'systemSetting') { let obj = JSON.parse(e.newValue) skinInfo.value = obj.skinInfo @@ -86,6 +104,7 @@ window.addEventListener('setItemEvent', (e: any) => { } }) var weatherClick = ref(false) +var weatherClickPop = ref(false) const setTime = () => { let date1 = new Date() let year: any = date1.getFullYear() @@ -113,10 +132,113 @@ const timer = setInterval(setTime, 1000) onUnmounted(() => { clearInterval(timer) }) - -var clickFun = () => { +let sunshine +var clickFun = (childData) => { weatherClick.value = !weatherClick.value - console.log('点击天气', weatherClick.value) + if (weatherClick.value) { + let data = JSON.parse(localStorage.getItem('shineSetting')) + if (!data) { + const now = new Date() + const formattedDate = now.toISOString().slice(0, 10) + data = { + currWeather: true, + softShadow: true, + darkness: 0.4, + speed: 1, + time: formattedDate, + timeerTime: '00:00:00', + wearther: [ + // 雨 + { + name: '雨', + svg: 'rain', + status: false + }, + // 雪 + { + name: '雪', + svg: 'snow', + status: false + }, + //雾 + { + name: '雾', + svg: 'fog', + status: false + }, + //星空 + { + name: '星空', + svg: 'skystarry', + status: false + } + ] + } + } + //光照 + if (childData.currWeather === undefined && weatherClickPop.value === false) { + sunshine = new YJ.Global.efflect.Sunshine(window.earth, { + id: 123, + speed: data.speed, + time: data.currWeather ? new Date().toISOString().slice(0, 10) : data.time, + // @ts-ignore + hour: data.currWeather ? new Date().toLocaleTimeString() : data.timeerTime + }) + window.sunshine = sunshine + sunshine.darkness = data.darkness + sunshine.softShadow = data.softShadow + + //天气效果 + if ((window as any).checkAuthIsValid) { + data.wearther.forEach((item) => { + if (item.status) { + func[item.svg](item) + } + }) + } else { + // ElMessage({ + // message: '您没有该功能的权限', + // type: 'warning' + // }) + } + } else if (weatherClickPop.value === false) { + sunshine = new YJ.Global.efflect.Sunshine(window.earth, { + id: 123, + speed: childData.speed, + time: childData.time, + // @ts-ignore + hour: document.getElementById('currentTime').textContent + }) + window.sunshine = sunshine + sunshine.darkness = childData.darkness + sunshine.softShadow = childData.softShadow + } + } else { + sunshine && sunshine.remove() + sunshine = null + window.sunshine && window.sunshine.remove() + delete window.sunshine + } +} +var func = { + rain: (item) => { + YJ.Global.efflect.rain(window.earth, item.status) + }, + //雪 + snow: (item) => { + YJ.Global.efflect.snow(window.earth, item.status) + }, + //雾 + fog: (item) => { + YJ.Global.efflect.fog(window.earth, item.status) + }, + // 星空 + skystarry: (item) => { + YJ.Global.efflect.skyStarry(window.earth, item.status) + } +} +var clickFunRight = () => { + weatherClickPop.value = !weatherClickPop.value } // onMounted(() => { diff --git a/src/renderer/src/views/components/propertyBox/CircleObject.vue b/src/renderer/src/views/components/propertyBox/CircleObject.vue index 31e6238..4dbea88 100644 --- a/src/renderer/src/views/components/propertyBox/CircleObject.vue +++ b/src/renderer/src/views/components/propertyBox/CircleObject.vue @@ -43,7 +43,7 @@
Z值统一增加
- + m
@@ -66,18 +66,18 @@
圆心坐标
+ v-model="entityOptions.center.lng" min="-180" max="180" v-if="activeTd.index == 1 && activeTd.name == 'lng'" @input="$handleInputLimit"> {{ entityOptions.center.lng.toFixed(8) }}
+ v-model="entityOptions.center.lat" min="-180" max="180" v-if="activeTd.index == 1 && activeTd.name == 'lat'" @input="$handleInputLimit"> {{ entityOptions.center.lat.toFixed(8) }}
+ v-if="activeTd.index == 1 && activeTd.name == 'alt'" @input="$handleInputLimit"> {{ entityOptions.height.toFixed(2) }}
@@ -98,7 +98,7 @@
描边宽度
- + px
@@ -132,6 +132,7 @@