From ba25ad48f0d407abc78c2c109611ace501cdb58a Mon Sep 17 00:00:00 2001 From: 24kycj <1637269896@qq.com> Date: Sat, 15 Nov 2025 14:01:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=BC=95=E5=AF=BC=E4=B8=8E?= =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/index.js | 39 +- src/renderer/App.vue | 50 + src/renderer/components/workAdd/workAdd.vue | 473 +++++--- src/renderer/store/modules/chat.js | 1 + src/renderer/views/dashboard/index.vue | 1069 ++++++++++++++----- 5 files changed, 1185 insertions(+), 447 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 719e6d7..b052d2c 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -1,4 +1,6 @@ -import { app, BrowserWindow, Menu } from 'electron' +import { app, BrowserWindow, Menu, ipcMain, shell } from 'electron' +import path from 'path' +import fs from 'fs' import '../renderer/store' /** @@ -14,6 +16,18 @@ const winURL = process.env.NODE_ENV === 'development' ? `http://localhost:9080` : `file://${__dirname}/index.html` +// 获取应用根目录 +// 开发环境:项目根目录(__dirname 指向 dist/electron) +// 生产环境:可执行文件所在目录 +const root = process.env.NODE_ENV === "development" + ? path.resolve(__dirname, '../../') + : path.dirname(app.getPath("exe")) + +// 日志函数 +function writeLog(message) { + console.log(`[${new Date().toISOString()}] ${message}`) +} + function createWindow () { /** * Initial window options @@ -75,3 +89,26 @@ app.on('ready', () => { if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates() }) */ + +// IPC 处理:打开帮助文件 +ipcMain.on('open-help-file', async event => { + const helpFilePath = path.join(root, "CardsoonServer", "User Manual.pdf"); + + if (!fs.existsSync(helpFilePath)) { + const errorMsg = `帮助文件不存在: ${helpFilePath}`; + writeLog(errorMsg); + if (event.reply) { + event.reply('open-help-file-error', errorMsg); + } + return; + } + + try { + await shell.openPath(helpFilePath); + } catch (error) { + writeLog("打开帮助文件错误: " + error.message); + if (event.reply) { + event.reply('open-help-file-error', error.message); + } + } +}); diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 60194f2..0c29c71 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -228,4 +228,54 @@ export default { color: #fff; } } +// 引导样式 +.guide_body { + position: relative; + z-index: 200; + background-color: #fff; + padding: 0 10px; + border-radius: 4px; + border: 1px dashed #2e9bfb; + height: 100%; +} +.guide_box { + border: 1px dashed #2e9bfb; + padding: 12px; + .guide_title { + font-weight: bold; + font-size: 16px; + color: #000000; + line-height: 30px; + span { + font-size: 13px; + color: #999; + font-weight: 400; + } + } + .guide_desc { + font-size: 13px; + color: #000000; + line-height: 24px; + a { + color: #2e9bfb; + cursor: pointer; + } + } + .guide_btns { + padding: 10px 0 0; + display: flex; + align-items: center; + justify-content: end; + .guide_btn1 { + color: #999; + } + .guide_btn2 { + background-color: #2e9bfb; + border: none; + } + } +} +.el-popover { + padding: 0; +} diff --git a/src/renderer/components/workAdd/workAdd.vue b/src/renderer/components/workAdd/workAdd.vue index 45624e1..6f8ae46 100644 --- a/src/renderer/components/workAdd/workAdd.vue +++ b/src/renderer/components/workAdd/workAdd.vue @@ -4,194 +4,272 @@ :close-on-click-modal="false" :show-close="false">
+
-
-
-
光盘类型:
-
- - - - + +
+
新手引导({{ parseInt(currentStep) + 1 }}/{{ guideStep.length }}) +
+
{{ guideStep[8].step }}
+
+ 跳过引导 + 上一步 + {{ currentStep == + guideStep.length + - 1 ? '完成引导' : '下一步' }}
-
-
任务类型:
-
- - - - -
-
-
- -
-
- -
-
刻录速率:
-
- - - - -
-
-
-
刻录完成后校验光盘:
-
- -
-
-
-
刻录完成后关闭光盘:
-
- -
-
-
-
刻录完成后删除缓存:
-
- -
-
-
-
作业失败打印标签:
-
- -
-
-
-
允许跨盘:
-
- -
-
-
-
是否虚拟刻录:
-
- -
-
-
-
分盘设置:
-
- - -
{{ item.name }}
-
{{ item.desc }}
-
-
-
+
+
+
光盘类型:
+
+ + + +
-
- 取消 - 确定 +
+
任务类型:
+
+ + + + +
-
- -
高级作业设置
-
+ +
-
- -
-
-
-
内容
-
- -
添加文件夹
+ +
+
新手引导({{ parseInt(currentStep) + 1 }}/{{ guideStep.length }})
-
- -
添加文件
+
{{ guideStep[9].step }}
+
+ 跳过引导 + 上一步 + {{ currentStep == + guideStep.length + - 1 ? '完成引导' : '下一步' }}
-
- - - +
+
+ +
+
+
+
内容
+
+ +
添加文件夹
+
+
+ +
添加文件
+
+
+
+ + + +
+
+
+
+ + +
+
+ +
+
-
-
-
- - -
-
- -
-
+
- -
-
-
标签
- - - - - -
···
-
-
-
新建标签
-
-
-
- -
- + +
+
新手引导({{ parseInt(currentStep) + 1 }}/{{ guideStep.length }}) +
+
{{ guideStep[10].step }}
+
+ 跳过引导 + 上一步 + {{ currentStep == + guideStep.length + - 1 ? '完成引导' : '下一步' }}
-
-
-
{{ item.name }}
-
-
- -
-
- +
+ +
+
+
标签
+ + + + + +
···
+
+
+
新建标签
+
+
+
+ +
+
-
添加字段 +
+
+
{{ item.name }}
+
+
+ +
+
+ +
+
+
添加字段 +
+
-
+
@@ -209,10 +287,25 @@
- + +
+
新手引导({{ parseInt(currentStep) + 1 }}/{{ guideStep.length }}) +
+
{{ guideStep[12].step }}
+
+ 跳过引导 + 上一步 + {{ currentStep == + guideStep.length + - 1 ? '完成引导' : '下一步' }} +
+
+ +
@@ -425,6 +518,9 @@ export default { } ], cdList: [], + // 新手引导 + guideStep: null, + currentStep: 0, } }, watch: { @@ -547,7 +643,15 @@ export default { if (setForm) { this.$store.dispatch('setDatas', { name: 'setForm', data: JSON.parse(setForm) }) } - + // 新手引导 + this.guideStep = JSON.parse(localStorage.getItem('guideStep')) + this.currentStep = localStorage.getItem('currentStep') + if (this.guideStep[this.currentStep]) { + this.guideStep[this.currentStep].show = false + setTimeout(() => { + this.guideStep[this.currentStep].show = true + }, 200) + } }, methods: { // 右键事件 @@ -1043,7 +1147,44 @@ export default { initSet() { this.setForm = { ...this.$store.state.user.setForm } console.log(this.$store.state.user.setForm) - } + }, + // 退出新手引导 + exitGuide() { + for (let key in this.guideStep) { + this.guideStep[key].show = false + } + this.currentStep = -1 + localStorage.setItem('currentStep', this.currentStep) + localStorage.setItem('guideStep', JSON.stringify(this.guideStep)) + this.close() + }, + // 上一步 + prevStep(e) { + this.guideStep[this.currentStep].show = false + this.currentStep = parseInt(this.currentStep) - 1 + if (this.guideStep[this.currentStep]) { + this.guideStep[this.currentStep].show = true + localStorage.setItem('guideStep', JSON.stringify(this.guideStep)) + localStorage.setItem('currentStep', this.currentStep) + if (this.currentStep == 7) { + this.close() + } + } else { + this.exitGuide() + } + }, + // 下一步 + nextStep(e) { + this.guideStep[this.currentStep].show = false + this.currentStep = parseInt(this.currentStep) + 1 + if (this.guideStep[this.currentStep]) { + this.guideStep[this.currentStep].show = true + localStorage.setItem('guideStep', JSON.stringify(this.guideStep)) + localStorage.setItem('currentStep', this.currentStep) + } else { + this.exitGuide() + } + }, } } diff --git a/src/renderer/store/modules/chat.js b/src/renderer/store/modules/chat.js index 78d79ee..2b51cfa 100644 --- a/src/renderer/store/modules/chat.js +++ b/src/renderer/store/modules/chat.js @@ -213,6 +213,7 @@ const defaultData = { lack_ink: 0, // 缺墨警告 cover_flag: false, //是否盖盖 printer_name: '', //设备名称 + printer_path: '', //设备路径 printer_status: 'I', //设备状态 数字转成字符为I printer_tray: 'I', //设备托盘状态 数字转成字符为I red_last: 0, //红色墨盒遗留 diff --git a/src/renderer/views/dashboard/index.vue b/src/renderer/views/dashboard/index.vue index c246338..85a5b10 100644 --- a/src/renderer/views/dashboard/index.vue +++ b/src/renderer/views/dashboard/index.vue @@ -1,45 +1,115 @@