diff --git a/src/index.ejs b/src/index.ejs index a9b8264..8180cb2 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -2,7 +2,7 @@ - 卡树自动拷贝打印系统 V3.0 + 卡树自动拷贝打印系统 V3.1 <% if (htmlWebpackPlugin.options.nodeModules) { %> + + diff --git a/src/renderer/components/dispose.vue b/src/renderer/components/dispose.vue index e05f24f..8b5c7a9 100644 --- a/src/renderer/components/dispose.vue +++ b/src/renderer/components/dispose.vue @@ -251,7 +251,7 @@ export default { StopOnFailure: "false" SystemSn: "830001" TaskDir: "C:\\PrintTasks" - Version: "V3.0" + Version: "V3.1" iniparser.parse("F:\\controll\\config.ini", function (err, data) { console.log(err); diff --git a/src/renderer/components/filepath.json b/src/renderer/components/filepath.json index 11db010..0162e2e 100644 --- a/src/renderer/components/filepath.json +++ b/src/renderer/components/filepath.json @@ -1 +1 @@ -{"files":["C:\\Users\\jerry\\Desktop\\cardsoon\\卡树产品保修条款.docx"]} \ No newline at end of file +{"files":["\\\\NAS\\study\\research_reports\\餐饮服务\\“保健水晶鸡、鸭皮蛋”商业计划书.docx"]} \ No newline at end of file diff --git a/src/renderer/components/files/file.vue b/src/renderer/components/files/file.vue index 57f49f3..ef321e2 100644 --- a/src/renderer/components/files/file.vue +++ b/src/renderer/components/files/file.vue @@ -61,6 +61,32 @@ import archiverdialog from "./archiverdialog"; import { calcSize, getFileName, isFolder } from "./calc"; import { copy } from "./copy"; import { zip } from "./archiver"; + +// 网络路径检测工具函数 +const isNetworkPath = (path) => { + // 检测是否为网络路径 + // Windows 网络路径: \\hostname\path 或 \\IP\path + // Unix 网络路径: //hostname/path 或 //IP/path + return path.startsWith('\\\\') || path.startsWith('//') || + (path.includes(':') && !path.includes('\\') && !path.includes('/')); +}; + +const extractHostName = (path) => { + if (path.startsWith('\\\\')) { + // Windows 网络路径 \\hostname\path + const parts = path.substring(2).split('\\') + return parts[0] + } else if (path.startsWith('//')) { + // Unix 网络路径 //hostname/path + const parts = path.substring(2).split('/') + return parts[0] + } else if (path.includes(':')) { + // 可能包含 IP 地址 + const match = path.match(/^([^\\\/:]+)/) + return match ? match[1] : 'unknown' + } + return 'unknown' +}; export default { name: "Files", props: { @@ -96,6 +122,7 @@ export default { isCopy: false, isSucess: true, copyPath: "", + networkPaths: [], // 存储检测到的网络路径 }; }, mounted() { @@ -132,6 +159,12 @@ export default { // 是文件夹 this.sizeChange(f.size); } + + // 检测是否为网络路径 + if (isNetworkPath(f.path)) { + this.addNetworkPath(f.path); + } + return true; } else { //有了,不用加入 @@ -145,6 +178,7 @@ export default { properties: ["multiSelections"], }) .then(async (res) => { + console.log(res) for (const item of res.filePaths) { await fs.stat(item, function (err, res) { if (err) { @@ -167,6 +201,7 @@ export default { properties: ["openDirectory", "multiSelections"], }) .then((res) => { + console.log(res) for (const item of res.filePaths) { const result = _this.insertList({ name: getFileName(item), @@ -309,6 +344,62 @@ export default { getLists() { return this.filesList; }, + + // 添加网络路径到列表(按主机去重,仅认证根目录,如 \\\\NAS) + addNetworkPath(path) { + const hostName = extractHostName(path); + const existingIndex = this.networkPaths.findIndex(p => p.hostName === hostName); + + if (existingIndex === -1) { + // 尝试从本地存储获取已保存的认证信息 + let userName = ''; + let password = ''; + + try { + const stored = localStorage.getItem('networkCredentials'); + if (stored) { + const credentials = JSON.parse(stored); + if (credentials[hostName]) { + userName = credentials[hostName].userName; + password = credentials[hostName].password; + } + } + } catch (error) { + console.log('无法获取已保存的认证信息'); + } + + // 仅保存根路径用于展示与认证 + const rootPath = `\\\\${hostName}`; + this.networkPaths.push({ + path: rootPath, + hostName: hostName, + userName: userName, + password: password + }); + } + }, + + // 获取网络路径列表(按主机去重,返回根路径) + getNetworkPaths() { + const uniqueByHost = {}; + for (const item of this.networkPaths) { + if (!uniqueByHost[item.hostName]) { + uniqueByHost[item.hostName] = { + path: `\\\\${item.hostName}`, + hostName: item.hostName, + userName: item.userName || '', + password: item.password || '' + }; + } + } + return Object.values(uniqueByHost); + }, + + // 检查是否有网络路径 + hasNetworkPaths() { + return this.networkPaths.length > 0; + }, + haveFolderIsCalc() {}, }, computed: {}, diff --git a/src/renderer/components/login.vue b/src/renderer/components/login.vue index 1f23da2..98a09c0 100644 --- a/src/renderer/components/login.vue +++ b/src/renderer/components/login.vue @@ -210,6 +210,7 @@ export default { }, onSubmituser() { if (this.ruleForm.name == '1') { + this.setStep() this.$router.push({ path: '/main' }) @@ -234,95 +235,7 @@ export default { console.log(res.data) localStorage.setItem('loginrole', res.data.resultinfo.userRole) localStorage.setItem('loginname', res.data.resultinfo.userName) - const guideStep = [ - { - show: false, - placement: 'right', - step: this.$t('guide.step1'), - }, - { - show: false, - placement: 'right', - step: this.$t('guide.step2'), - }, - { - show: false, - placement: 'right', - step: this.$t('guide.step3'), - }, - { - show: false, - placement: 'left', - step: this.$t('guide.step4'), - }, - { - show: false, - placement: 'bottom', - step: this.$t('guide.step5'), - }, - { - show: false, - placement: 'bottom', - step: this.$t('guide.step6'), - }, - { - show: false, - placement: 'top', - step: this.$t('guide.step7'), - }, - { - show: false, - placement: 'right', - step: this.$t('guide.step8'), - }, - { - show: false, - placement: 'bottom', - step: this.$t('guide.step9'), - }, - { - show: false, - placement: 'bottom', - step: this.$t('guide.step10'), - }, - { - show: false, - placement: 'right', - step: this.$t('guide.step11'), - }, - { - show: false, - placement: 'right', - step: this.$t('guide.step12'), - }, - { - show: false, - placement: 'left', - step: this.$t('guide.step13'), - }, - { - show: false, - placement: 'bottom', - step: this.$t('guide.step14'), - }, - { - show: false, - placement: 'top', - step: this.$t('guide.step15'), - }, - { - show: false, - placement: 'top', - step: this.$t('guide.step16'), - }, - { - show: false, - placement: 'top', - step: this.$t('guide.step17'), - }, - ] - localStorage.setItem('guideStep', JSON.stringify(guideStep)) - localStorage.setItem('currentStep', 0) + this.setStep() this.$router.push({ path: '/main' }) @@ -346,6 +259,97 @@ export default { } }) }, + setStep() { + const guideStep = [ + { + show: false, + placement: 'right', + step: this.$t('guide.step1'), + }, + { + show: false, + placement: 'right', + step: this.$t('guide.step2'), + }, + { + show: false, + placement: 'right', + step: this.$t('guide.step3'), + }, + { + show: false, + placement: 'left', + step: this.$t('guide.step4'), + }, + { + show: false, + placement: 'bottom', + step: this.$t('guide.step5'), + }, + { + show: false, + placement: 'bottom', + step: this.$t('guide.step6'), + }, + { + show: false, + placement: 'top', + step: this.$t('guide.step7'), + }, + { + show: false, + placement: 'right', + step: this.$t('guide.step8'), + }, + { + show: false, + placement: 'bottom', + step: this.$t('guide.step9'), + }, + { + show: false, + placement: 'bottom', + step: this.$t('guide.step10'), + }, + { + show: false, + placement: 'right', + step: this.$t('guide.step11'), + }, + { + show: false, + placement: 'right', + step: this.$t('guide.step12'), + }, + { + show: false, + placement: 'left', + step: this.$t('guide.step13'), + }, + { + show: false, + placement: 'bottom', + step: this.$t('guide.step14'), + }, + { + show: false, + placement: 'top', + step: this.$t('guide.step15'), + }, + { + show: false, + placement: 'top', + step: this.$t('guide.step16'), + }, + { + show: false, + placement: 'top', + step: this.$t('guide.step17'), + }, + ] + localStorage.setItem('guideStep', JSON.stringify(guideStep)) + localStorage.setItem('currentStep', 0) + }, // 监听回车键执行事件 keyDown(e) { // 回车则执行登录方法 enter键的ASCII是13 diff --git a/src/renderer/components/main - 副本.vue b/src/renderer/components/main - 副本.vue new file mode 100644 index 0000000..751a311 --- /dev/null +++ b/src/renderer/components/main - 副本.vue @@ -0,0 +1,2161 @@ + + + + + diff --git a/src/renderer/components/recorder/ScreenRecorder.vue b/src/renderer/components/recorder/ScreenRecorder.vue new file mode 100644 index 0000000..ff32c8e --- /dev/null +++ b/src/renderer/components/recorder/ScreenRecorder.vue @@ -0,0 +1,252 @@ + + + + + diff --git a/src/renderer/components/work.vue b/src/renderer/components/work.vue index b94e4f2..0e5e8d1 100644 --- a/src/renderer/components/work.vue +++ b/src/renderer/components/work.vue @@ -251,6 +251,22 @@ {{ $t('work.senior') }} + + + + + 0) { + this.networkAuthPaths = networkPaths + this.networkAuthVisible = true + return true + } + } + return false + }, + + // 网络认证确认回调 + onNetworkAuthConfirm(netInfo) { + this.networkCredentials = netInfo + this.networkAuthVisible = false + + // 继续提交流程 + this.continueSubmit() + }, + + // 网络认证取消回调 + onNetworkAuthCancel() { + this.networkAuthVisible = false + this.$message.info(this.$t('networkAuth.authCanceled')) + }, + + // 继续提交流程 + continueSubmit() { + // 这里继续原来的提交逻辑 + this.performSubmit() + }, addFolder() { this.$refs.files.addFolder() }, @@ -2025,7 +2117,21 @@ export default { //}, 0); //console.log(1); }, - submit() { + async submit() { + // 停止录制(如果正在录制) + await this.stopRecordingIfActive() + + // 检查是否有网络路径需要认证 + if (this.checkNetworkPaths()) { + return // 等待用户完成网络认证 + } + + // 继续提交流程 + this.performSubmit() + }, + + // 实际的提交逻辑 + async performSubmit() { //提交最终的任务请求 let data = '' let pathName @@ -2201,6 +2307,12 @@ export default { if (this.high_setting_form.formatFile != 0) { data += '&formatFile=' + this.high_setting_form.formatFile //拷贝前类型 } + + // 添加网络路径认证信息 + if (this.networkCredentials && this.networkCredentials.length > 0) { + data += '&net_info=' + JSON.stringify(this.networkCredentials) + } + // if (this.file_form == 0 || this.file_form == 1 || this.file_form == 4 || this.file_form == 2 || this.file_form == 3 || this.file_form == 7) { // } else { @@ -2286,6 +2398,11 @@ export default { // 使用FormData上传文件 const formData = new FormData() formData.append('file', blob, path.basename(jsonFilePath)) + + // 添加网络路径认证信息 + if (this.networkCredentials && this.networkCredentials.length > 0) { + formData.append('net_info', JSON.stringify(this.networkCredentials)) + } that.submitLoading = true // 发送HTTP请求上传文件 that @@ -2517,7 +2634,7 @@ export default { computed: { file_percent() { let t = (this.size / (((this.size_form * 1000) / 1.024 / 1.024 / 1.024) * 1024 * 1024)) * 100 - return t > 100 ? 100.1 : t + return t ? t > 100 ? 100.1 : t : 0 }, print_op() { return [ diff --git a/src/renderer/components/worknet.vue b/src/renderer/components/worknet.vue index 9284460..3924781 100644 --- a/src/renderer/components/worknet.vue +++ b/src/renderer/components/worknet.vue @@ -1637,7 +1637,7 @@ export default { (this.size / (((this.size_form * 1000) / 1.024 / 1.024 / 1.024) * 1024 * 1024)) * 100; - return t > 100 ? 100.1 : t; + return t ? t > 100 ? 100.1 : t : 0 }, print_op() { return [ diff --git a/src/renderer/lang/cn.js b/src/renderer/lang/cn.js index 22ca1e1..e9972a3 100644 --- a/src/renderer/lang/cn.js +++ b/src/renderer/lang/cn.js @@ -1,4 +1,26 @@ export default { + recorder: { + startRecording: "开始录制", + stopRecording: "停止录制", + recordingStarted: "开始录制屏幕", + recordingStopped: "录制已停止", + savedSuccess: "录制已保存", + startFailed: "启动录制失败", + stopFailed: "停止录制失败", + saveFailed: "保存录制失败" + }, + networkAuth: { + title: "网络路径认证", + description: "检测到以下网络路径,请输入对应的用户名和密码:", + pathLabel: "网络路径:", + userName: "用户名", + password: "密码", + confirm: "确认", + cancel: "取消", + authRequired: "请填写所有网络路径的用户名和密码", + authSuccess: "网络认证信息已保存", + authCanceled: "已取消网络路径认证" + }, finger: { intTips: "指纹模块正在初始化", errorInttips: "指纹模块初始化失败", @@ -18,7 +40,7 @@ export default { login: "登录", fingerLogin: "使用指纹登录", title1: "CARDSOON USB存储卡", - title2: "自动拷贝打印系统 V3.0", + title2: "自动拷贝打印系统 V3.1", successLogin: "登录成功!", errorFingerlogin: "登录失败,请重试指纹!", errorLogin: "登录失败,请检查账号密码!", diff --git a/src/renderer/lang/en.js b/src/renderer/lang/en.js index 2483fb8..a53a063 100644 --- a/src/renderer/lang/en.js +++ b/src/renderer/lang/en.js @@ -1,4 +1,26 @@ export default { + recorder: { + startRecording: "Start Recording", + stopRecording: "Stop Recording", + recordingStarted: "Screen recording started", + recordingStopped: "Recording stopped", + savedSuccess: "Recording saved", + startFailed: "Failed to start recording", + stopFailed: "Failed to stop recording", + saveFailed: "Failed to save recording" + }, + networkAuth: { + title: "Network Path Authentication", + description: "The following network paths were detected. Please enter the corresponding username and password:", + pathLabel: "Network Path:", + userName: "Username", + password: "Password", + confirm: "Confirm", + cancel: "Cancel", + authRequired: "Please fill in username and password for all network paths", + authSuccess: "Network authentication information saved", + authCanceled: "Network path authentication canceled" + }, finger: { intTips: "The fingerprint module is initializing", errorInttips: "Fingerprint module initialization fail", diff --git a/src/renderer/lang/ocn.js b/src/renderer/lang/ocn.js index 3c338ed..a80cc1e 100644 --- a/src/renderer/lang/ocn.js +++ b/src/renderer/lang/ocn.js @@ -17,7 +17,7 @@ export default { login:"登入", fingerLogin:"使用指紋登入", title1:"CARDSOON USB存儲卡", - title2:"自動拷貝列印系統V3.0", + title2:"自動拷貝列印系統V3.1", successLogin:"登入成功! ", errorFingerlogin:"登入失敗,請重試指紋! ", errorLogin:"登入失敗,請檢查帳號密碼! ", diff --git a/src/renderer/store/modules/networkAuth.js b/src/renderer/store/modules/networkAuth.js new file mode 100644 index 0000000..803a7ec --- /dev/null +++ b/src/renderer/store/modules/networkAuth.js @@ -0,0 +1,70 @@ +const state = { + networkCredentials: {} +} + +const mutations = { + SET_NETWORK_CREDENTIALS(state, credentials) { + state.networkCredentials = { ...state.networkCredentials, ...credentials } + }, + + CLEAR_NETWORK_CREDENTIALS(state) { + state.networkCredentials = {} + }, + + UPDATE_NETWORK_CREDENTIAL(state, { hostName, credentials }) { + state.networkCredentials = { + ...state.networkCredentials, + [hostName]: credentials + } + } +} + +const actions = { + // 从 localStorage 加载网络认证信息 + loadNetworkCredentials({ commit }) { + try { + const stored = localStorage.getItem('networkCredentials') + if (stored) { + const credentials = JSON.parse(stored) + commit('SET_NETWORK_CREDENTIALS', credentials) + } + } catch (error) { + console.error('加载网络认证信息失败:', error) + } + }, + + // 保存网络认证信息到 localStorage + saveNetworkCredentials({ state }) { + try { + localStorage.setItem('networkCredentials', JSON.stringify(state.networkCredentials)) + } catch (error) { + console.error('保存网络认证信息失败:', error) + } + }, + + // 获取指定主机的认证信息 + getCredentialsForHost({ state }, hostName) { + return state.networkCredentials[hostName] || null + }, + + // 更新指定主机的认证信息 + updateCredentialsForHost({ commit }, { hostName, credentials }) { + commit('UPDATE_NETWORK_CREDENTIAL', { hostName, credentials }) + } +} + +const getters = { + // 获取所有网络认证信息 + allNetworkCredentials: state => state.networkCredentials, + + // 检查是否有网络认证信息 + hasNetworkCredentials: state => Object.keys(state.networkCredentials).length > 0 +} + +export default { + namespaced: true, + state, + mutations, + actions, + getters +} diff --git a/videos/soonworker_2025-09-02T04-30-36.webm b/videos/soonworker_2025-09-02T04-30-36.webm new file mode 100644 index 0000000..b7f4156 Binary files /dev/null and b/videos/soonworker_2025-09-02T04-30-36.webm differ