This commit is contained in:
zh
2025-11-06 16:10:33 +08:00
parent b582f4a366
commit 909dd090e6
10 changed files with 181 additions and 59 deletions

View File

@ -0,0 +1,60 @@
// electron.vite.config.ts
import { resolve } from "path";
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
import vue from "@vitejs/plugin-vue";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
import path from "path";
var electron_vite_config_default = defineConfig({
main: {
plugins: [externalizeDepsPlugin()]
},
preload: {
plugins: [externalizeDepsPlugin()]
},
renderer: {
resolve: {
alias: {
"@renderer": resolve("src/renderer/src"),
"@": resolve("src/renderer/src")
}
},
plugins: [
vue(),
AutoImport({
imports: ["vue"],
dts: "src/auto-imports.d.ts",
// 自动生成类型声明文件
resolvers: [ElementPlusResolver()]
}),
Components({
resolvers: [ElementPlusResolver()]
}),
// SVG图标插件配置
// 配置SVG图标插件
createSvgIconsPlugin({
iconDirs: [path.resolve(process.cwd(), "src/renderer/src/icons/svg")],
symbolId: "icon-[name]",
// 自动清除 SVG 中的 fill 和 stroke 属性
svgoOptions: {
plugins: [{ name: "removeAttrs", params: { attrs: ["fill", "stroke", "stroke-width"] } }]
}
})
]
/*server: {
port: 8848,
proxy: {
'/api': {
target: localStorage.getItem('ip') || 'http://127.0.0.1:8848',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
}*/
}
});
export {
electron_vite_config_default as default
};

View File

@ -0,0 +1,60 @@
// electron.vite.config.ts
import { resolve } from "path";
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
import vue from "@vitejs/plugin-vue";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
import path from "path";
var electron_vite_config_default = defineConfig({
main: {
plugins: [externalizeDepsPlugin()]
},
preload: {
plugins: [externalizeDepsPlugin()]
},
renderer: {
resolve: {
alias: {
"@renderer": resolve("src/renderer/src"),
"@": resolve("src/renderer/src")
}
},
plugins: [
vue(),
AutoImport({
imports: ["vue"],
dts: "src/auto-imports.d.ts",
// 自动生成类型声明文件
resolvers: [ElementPlusResolver()]
}),
Components({
resolvers: [ElementPlusResolver()]
}),
// SVG图标插件配置
// 配置SVG图标插件
createSvgIconsPlugin({
iconDirs: [path.resolve(process.cwd(), "src/renderer/src/icons/svg")],
symbolId: "icon-[name]",
// 自动清除 SVG 中的 fill 和 stroke 属性
svgoOptions: {
plugins: [{ name: "removeAttrs", params: { attrs: ["fill", "stroke", "stroke-width"] } }]
}
})
]
/*server: {
port: 8848,
proxy: {
'/api': {
target: localStorage.getItem('ip') || 'http://127.0.0.1:8848',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
}*/
}
});
export {
electron_vite_config_default as default
};

View File

@ -276,6 +276,25 @@ function createWindow(): void {
mainWindow.on('leave-full-screen', () => { mainWindow.on('leave-full-screen', () => {
mainWindow.webContents.send('fullscreen-status-changed', false) mainWindow.webContents.send('fullscreen-status-changed', false)
}); });
mainWindow.on("close", (e) => {
e.preventDefault();
dialog
.showMessageBox(mainWindow, {
type: "warning",
title: "提示",
message: "是否确认退出系统?",
buttons: ["cancel", "ok"],
})
.then((res) => {
if (res.response) {
setTimeout(() => {
mainWindow.destroy()
mainWindow = null;
}, 200);
windowAllClosed();
}
});
});
let recorder; let recorder;
ipcMain.on("startRecoder", () => { ipcMain.on("startRecoder", () => {
@ -498,8 +517,10 @@ function forceQuit() {
app.relaunch(); app.relaunch();
} }
console.log('------退出-------'); console.log('------退出-------');
app.exit(); setTimeout(() => {
app.quit(); app.exit();
app.quit();
}, 500);
} else { } else {
// 其他系统 // 其他系统
process.exit(0); process.exit(0);
@ -518,14 +539,12 @@ function closeAllWindows() {
}); });
} }
const gotTheLock = app.requestSingleInstanceLock();
const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) { if (!gotTheLock) {
app.quit(); app.quit();
} else { } else {
if (app.isReady()) { app.on("ready", createWindow);
}
app.whenReady().then(() => { app.whenReady().then(() => {
// alert(devSplashURL) // alert(devSplashURL)
// alert(prodSplashURL) // alert(prodSplashURL)
@ -559,14 +578,6 @@ if (!gotTheLock) {
// IPC test // IPC test
ipcMain.on('ping', () => console.log('pong')) ipcMain.on('ping', () => console.log('pong'))
createWindow()
app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
}) })
// 退出时注销所有快捷键 // 退出时注销所有快捷键

View File

@ -85,7 +85,7 @@ let getWidth = (durationTime) => {
// 6. 让 progressStyle 间接依赖 refreshKey通过 getWidth // 6. 让 progressStyle 间接依赖 refreshKey通过 getWidth
let progressStyle = (task) => { let progressStyle = (task) => {
let taskLeft = task.startTime - window['tsObj']._Store._startTimestamp; let taskLeft = task.startTime - window['tsObj']._Store._startTimestamp;
let style = { let style:any = {
width: getWidth(task.duration_time) * 1000 + "px", width: getWidth(task.duration_time) * 1000 + "px",
left: getWidth(taskLeft) + "px", left: getWidth(taskLeft) + "px",
}; };

View File

@ -18,7 +18,7 @@
import {inject, ref} from 'vue' import {inject, ref} from 'vue'
const eventBus: any = inject('bus') const eventBus: any = inject('bus')
let eventObj = ref(null) let eventObj:any = ref(null)
eventBus.on('click-event-show-plane', (params) => { eventBus.on('click-event-show-plane', (params) => {
console.log('兄弟 B 的方法被触发了!', params) console.log('兄弟 B 的方法被触发了!', params)
eventObj.value = (eventObj.value == null ? params : null) eventObj.value = (eventObj.value == null ? params : null)

View File

@ -130,7 +130,7 @@ let eventCallback = () => {
let timeId = Math.round(props.TSOBJ._Store._currentTimestamp / 1000); let timeId = Math.round(props.TSOBJ._Store._currentTimestamp / 1000);
timeId *= 1000; timeId *= 1000;
// console.log(timeId) // console.log(timeId)
let taskIds = []; let taskIds:any = [];
let dataMap = props.TSOBJ._Store.dealData("startTime"); let dataMap = props.TSOBJ._Store.dealData("startTime");
console.log(dataMap) console.log(dataMap)

View File

@ -3,12 +3,7 @@
<div class="head_box"> <div class="head_box">
<!-- <span class="head_title">实景三维电子沙盘系统</span> --> <!-- <span class="head_title">实景三维电子沙盘系统</span> -->
<!-- <headSvg style="width: 100%;height: 100%;"></headSvg> --> <!-- <headSvg style="width: 100%;height: 100%;"></headSvg> -->
<img <img width="100%" height="100%" :src="headImg" alt="" />
width="100%"
height="100%"
:src="`../../../src/assets/images/theme/${skinInfo}/head.png`"
alt=""
/>
</div> </div>
<div class="dateTime"> <div class="dateTime">
<span>{{ date.hms }}</span> <span>{{ date.hms }}</span>
@ -17,12 +12,7 @@
<span>{{ t(`week.4`) }}</span> <span>{{ t(`week.4`) }}</span>
</div> </div>
<div class="weather"> <div class="weather">
<svg-icon <svg-icon name="weather" :size="40" @click="clickFun"></svg-icon>
name="weatherBase"
:class="weatherClick ? 'weatherIcon' : ''"
:size="40"
@click="clickFun"
></svg-icon>
</div> </div>
</div> </div>
<setTool ref="setToolRef"></setTool> <setTool ref="setToolRef"></setTool>
@ -63,7 +53,8 @@ const headImg = computed(() => {
} }
}) })
const skinInfo = ref(JSON.parse(localStorage.getItem('systemSetting') || '{}').skinInfo || 'color1')
const skinInfo = ref(JSON.parse(localStorage.getItem("systemSetting") || '{}').skinInfo || 'color1')
const { t } = useI18n() const { t } = useI18n()
const date = ref({ const date = ref({
@ -71,25 +62,26 @@ const date = ref({
hms: '', hms: '',
week: 0 week: 0
}) })
window.addEventListener('setItemEvent', (e: any) => { window.addEventListener("setItemEvent", (e: any) => {
console.log('e', e) console.log('e', e)
if (e.key == 'systemSetting') { if (e.key == "systemSetting") {
let obj = JSON.parse(e.newValue) let obj = JSON.parse(e.newValue);
skinInfo.value = obj.skinInfo skinInfo.value = obj.skinInfo;
let setting = JSON.parse(e.newValue) let setting = JSON.parse(e.newValue)
let dialogElm: any = document.getElementsByClassName('YJ-custom-base-dialog') let dialogElm: any = document.getElementsByClassName('YJ-custom-base-dialog')
if (setting.language === 'zh-EN') { if (setting.language === 'zh-EN') {
for (let i = 0; i < dialogElm.length; i++) { for (let i = 0; i < dialogElm.length; i++) {
dialogElm[i].classList.add('dialog-en') dialogElm[i].classList.add('dialog-en');
} }
} else { }
else {
for (let i = 0; i < dialogElm.length; i++) { for (let i = 0; i < dialogElm.length; i++) {
dialogElm[i].classList.remove('dialog-en') dialogElm[i].classList.remove('dialog-en');
} }
} }
} }
}) });
var weatherClick = ref(false) var weatherClick = ref(false)
const setTime = () => { const setTime = () => {
let date1 = new Date() let date1 = new Date()
@ -140,7 +132,7 @@ var clickFun = () => {
z-index: 999; z-index: 999;
pointer-events: none; pointer-events: none;
> * { >* {
pointer-events: all; pointer-events: all;
} }
@ -185,7 +177,7 @@ var clickFun = () => {
align-items: center; align-items: center;
font-family: 'alimamashuheiti'; font-family: 'alimamashuheiti';
& > span:first-child { &>span:first-child {
letter-spacing: 1px; letter-spacing: 1px;
font-size: 2rem; font-size: 2rem;
font-family: 'alimamashuheiti'; font-family: 'alimamashuheiti';
@ -197,23 +189,20 @@ var clickFun = () => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
& > span:first-child { &>span:first-child {
font-size: 0.9rem; font-size: 0.9rem;
} }
& > span:last-child { &>span:last-child {
font-size: 0.8rem; font-size: 0.8rem;
} }
} }
.weather { .weather {
margin-left: 15px; margin-left: 15px;
.weatherIcon {
fill: rgba(var(--color-base1), 1) !important;
}
svg { svg {
// fill: rgba(var(--color-base1), 1) !important; fill: rgba(var(--color-base1), 1) !important;
cursor: pointer; cursor: pointer;
} }
} }

View File

@ -26,6 +26,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
//@ts-nocheck
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { $changeComponentShow } from '@/utils/communication' import { $changeComponentShow } from '@/utils/communication'
import { useRightOperate } from './hooks/rightOperate' import { useRightOperate } from './hooks/rightOperate'

View File

@ -607,7 +607,7 @@ export const useTree = () => {
brightness: 1 brightness: 1
}) })
} }
res.data.list[i].icon = await cusNodeIcon(res.data.list[i]); res.data.list[i].svg = await cusNodeIcon(res.data.list[i]);
} }
} }
zNodes.value = res.data.list zNodes.value = res.data.list

View File

@ -193,28 +193,29 @@ onMounted(() => {
.content { .content {
.el-input__wrapper { .el-input__wrapper {
background-color: transparent; // background-color: transparent;
border: 0.2px solid rgba(var(--color-base1), 1); border: 0.2px solid rgba(var(--color-base1), 1);
box-shadow: 0 0 0 0.2px rgba(var(--color-base1), 1) inset !important; box-shadow: 0 0 0 0.2px rgba(var(--color-base1), 1) inset !important;
/* 新增此行 */ border-radius: 0;
padding: 3px 11px;
} }
.el-input__inner { .el-input__inner {
color: #fff; color: rgb(0, 66, 66);
} }
/* 新增图标颜色控制 */ /* 新增图标颜色控制 */
.el-input__prefix, .el-input__prefix,
.el-input__suffix { .el-input__suffix {
.el-icon { .el-icon {
color: rgba(var(--color-base1), 1); color: rgb(0, 66, 66);
/* 将#00ffff替换为你想用的颜色 */ /* 将#00ffff替换为你想用的颜色 */
font-size: 18px; font-size: 18px;
/* 可选:调整图标大小 */ /* 可选:调整图标大小 */
} }
&:hover .el-icon { &:hover .el-icon {
color: rgba(var(--color-base1), 1); color: rgb(0, 66, 66);
/* 悬停颜色保持一致 */ /* 悬停颜色保持一致 */
} }
} }
@ -300,13 +301,13 @@ onMounted(() => {
color: #eee; color: #eee;
text-align: center; text-align: center;
text-shadow: 0px 0px 4px rgba(80, 227, 230, 0.2); text-shadow: 0px 0px 4px rgba(80, 227, 230, 0.2);
font-style: italic; // font-style: italic;
letter-spacing: 5px; letter-spacing: 5px;
margin-bottom: 6px; margin-bottom: 6px;
} }
.title2 { .title2 {
font-size: 3rem; font-size: 2rem;
font-weight: 500; font-weight: 500;
color: #eee; color: #eee;
text-align: center; text-align: center;
@ -337,7 +338,7 @@ onMounted(() => {
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
margin-bottom: 1.5vw; margin-bottom: 1.5vw;
padding: 0.6vw 0; padding: 19px 0;
letter-spacing: 0.2vw; letter-spacing: 0.2vw;
font-size: 14px; font-size: 14px;
color: rgba(0, 66, 66, 1); color: rgba(0, 66, 66, 1);