From 80aacffe078f45739a97560b5b0ea913f6154372 Mon Sep 17 00:00:00 2001 From: LOG1997 <2694233102@qq.com> Date: Tue, 30 Dec 2025 14:34:56 +0800 Subject: [PATCH] Feature action (#149) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: 👷 整合github action配置文件 * docs: 📝 贡献文档修改 * style: 💄 更新版本 * style: 💄 cargo.lock版本更新 * feat(husky): 增强Git标签版本校验脚本 添加了对Git标签指向提交与release分支一致性的校验功能。 脚本现在会检查tag指向的提交是否与当前或任何release分支的最新提交一致, 确保发布流程的准确性。如果当前在release分支上,直接比较分支HEAD与tag指向的提交; 如果不在release分支上,则遍历所有release分支查找匹配的提交。 * feat: ✨ 国际化 --- .husky/scripts/verifyTagVersion.js | 76 +++++ src/components/Loading/index.vue | 4 +- src/locales/en.ts | 163 +-------- src/locales/modules/button.ts | 63 ++++ src/locales/modules/data.ts | 42 +++ src/locales/modules/dialog.ts | 34 ++ src/locales/modules/error.ts | 60 ++++ src/locales/modules/footer.ts | 14 + src/locales/modules/index.ts | 11 + src/locales/modules/placeHolder.ts | 24 ++ src/locales/modules/sidebar.ts | 28 ++ src/locales/modules/table.ts | 104 ++++++ src/locales/modules/tooltip.ts | 44 +++ src/locales/modules/viewTitle.ts | 20 ++ src/locales/zhCn.ts | 163 +-------- .../FaceConfig/components/SelectFont.vue | 5 +- .../FaceConfig/components/UploadDialog.vue | 11 +- .../FaceConfig/parts/AbilitySetting.vue | 13 +- .../Global/FaceConfig/parts/DataSetting.vue | 4 +- .../Global/FaceConfig/parts/LayoutSetting.vue | 2 +- .../FaceConfig/parts/PatternSetting.vue | 2 +- .../Global/FaceConfig/parts/TextSetting.vue | 2 +- .../Global/FaceConfig/parts/ThemeSetting.vue | 9 +- .../ImageConfig/components/UploadDialog.vue | 4 +- .../MusicConfig/components/UploadDialog.vue | 11 +- src/views/Config/Global/MusicConfig/index.vue | 3 +- .../PersonAll/components/SinglePerson.vue | 29 +- .../Person/PersonAll/importExcel.worker.ts | 84 ++--- src/views/Config/Person/PersonAll/index.vue | 2 +- .../Config/Person/PersonAll/useViewModel.ts | 320 +++++++++--------- .../Config/Person/PersonAlready/index.vue | 1 - src/views/Config/Prize/usePrizeConfig.ts | 230 ++++++------- src/views/Config/index.vue | 2 +- .../Home/components/HeaderTitle/index.vue | 2 +- 34 files changed, 920 insertions(+), 666 deletions(-) create mode 100644 src/locales/modules/button.ts create mode 100644 src/locales/modules/data.ts create mode 100644 src/locales/modules/dialog.ts create mode 100644 src/locales/modules/error.ts create mode 100644 src/locales/modules/footer.ts create mode 100644 src/locales/modules/index.ts create mode 100644 src/locales/modules/placeHolder.ts create mode 100644 src/locales/modules/sidebar.ts create mode 100644 src/locales/modules/table.ts create mode 100644 src/locales/modules/tooltip.ts create mode 100644 src/locales/modules/viewTitle.ts diff --git a/.husky/scripts/verifyTagVersion.js b/.husky/scripts/verifyTagVersion.js index abd5c11..6fa2fe0 100644 --- a/.husky/scripts/verifyTagVersion.js +++ b/.husky/scripts/verifyTagVersion.js @@ -1,4 +1,5 @@ import fs from 'fs'; +import { execSync } from 'child_process'; try { // 读取 package.json 中的版本号 @@ -24,6 +25,81 @@ try { } else { console.log('✅ Git tag 版本校验通过'); } + + // 获取 tag 指向的提交哈希 + const tagCommit = execSync(`git rev-list -1 ${tag}`, { encoding: 'utf-8' }).trim(); + + // 获取当前分支名称 + let currentBranch; + try { + currentBranch = execSync('git branch --show-current', { encoding: 'utf-8' }).trim(); + } catch (e) { + console.error('无法获取当前分支名称'); + process.exit(1); + } + + // 检查当前分支是否为 release 分支 + if (currentBranch.startsWith('release/')) { + // 如果当前在 release 分支上,检查当前分支的 HEAD 提交是否与 tag 指向的提交一致 + const currentBranchCommit = execSync(`git rev-parse ${currentBranch}`, { encoding: 'utf-8' }).trim(); + + if (tagCommit !== currentBranchCommit) { + console.log('🏷️ Git tag 指向的提交与当前 release 分支的最新提交不一致'); + console.error(`当前 release 分支 "${currentBranch}" 的最新提交为: ${currentBranchCommit}`); + console.error(`Tag "${tag}" 指向的提交为: ${tagCommit}`); + process.exit(1); + } else { + console.log('✅ Git tag 指向的提交与当前 release 分支的最新提交一致'); + } + } else { + // 如果当前不在 release 分支上,查找所有 release 分支并检查是否有分支的 HEAD 与 tag 指向的提交一致 + console.log(`🔍 当前在 "${currentBranch}" 分支,检查 tag 指向的提交是否与任何 release 分支的最新提交一致`); + + // 获取所有本地分支 + const localBranchesOutput = execSync('git branch --format="%(refname:short)"', { encoding: 'utf-8' }); + const localBranches = localBranchesOutput.split('\n').map(b => b.trim()).filter(b => b); + + // 过滤出 release 分支 + const releaseBranches = localBranches.filter(branch => branch.startsWith('release/')); + + if (releaseBranches.length === 0) { + console.log('⚠️ 未找到 release 分支'); + process.exit(1); + } + + let foundMatchingBranch = false; + let matchingBranchName = ''; + + for (const branch of releaseBranches) { + try { + // 获取 release 分支的最新提交 + const releaseBranchCommit = execSync(`git rev-parse ${branch}`, { encoding: 'utf-8' }).trim(); + + // 检查是否与 tag 指向的提交一致 + if (tagCommit === releaseBranchCommit) { + foundMatchingBranch = true; + matchingBranchName = branch; + break; + } + } catch (e) { + // 如果无法获取分支信息,继续尝试下一个分支 + continue; + } + } + + if (!foundMatchingBranch) { + console.log('🏷️ Git tag 指向的提交与任何 release 分支的最新提交都不一致'); + console.error(`提供的 tag 为: ${tag}`); + console.error(`tag 指向的提交为: ${tagCommit}`); + console.log(`检查了以下 release 分支:`, releaseBranches); + console.log('可能的原因:'); + console.log('1. release 分支不是最新的'); + console.log('2. tag 指向的提交不在 release 分支上'); + process.exit(1); + } else { + console.log(`✅ Git tag 指向的提交与 release 分支 "${matchingBranchName}" 的最新提交一致`); + } + } } catch (error) { console.error('❌ 校验过程中发生错误:', error.message); process.exit(1); diff --git a/src/components/Loading/index.vue b/src/components/Loading/index.vue index 62a2781..2e6da35 100644 --- a/src/components/Loading/index.vue +++ b/src/components/Loading/index.vue @@ -1,11 +1,13 @@ @@ -13,7 +15,7 @@ const { visible, text } = loading diff --git a/src/locales/en.ts b/src/locales/en.ts index 02ba8fe..bd21cae 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -1,153 +1,14 @@ -export default { - button: { - enterLottery: 'Enter Lottery', - start: 'Start', - selectLucky: 'Draw the Lucky', - continue: 'Continue', - confirm: 'Confirm', - cancel: 'Cancel', - setting: 'Setting', - delete: 'Delete', - allDelete: 'Delete All', - downloadTemplate: 'Download Template', - importData: 'Import Data', - resetData: 'Reset Data', - exportResult: 'Export Result', - add: 'Add', - resetDefault: 'Reset Default', - resetAllData: 'Reset All Data', - clearPattern: 'Clear Pattern', - DefaultPattern: 'Default Pattern', - upload: 'Upload', - reset: 'Reset', - play: 'Play', - setLayout: 'Set Layout', - close: 'Close', - noInfoAndImport: 'No Info and import it', - useDefault: 'Use Default Data', - }, - sidebar: { - personConfiguration: 'Person Configuration', - personList: 'Person List', - winnerList: 'Winner List', - prizeConfiguration: 'Prize Configuration', - globalSetting: 'Global Configuration', - viewSetting: 'View Setting', - imagesManagement: 'Images Management', - musicManagement: 'Music Management', - operatingInstructions: 'Operating Instructions', - }, - viewTitle: { - personManagement: 'Person Management', - winnerManagement: 'Winner Management', - prizeManagement: 'Prize Management', - globalSetting: 'Global Setting', - operatingInstructions: 'Operating Instructions', - }, - table: { - // person configuration - number: 'Number', - name: 'Name', - prizeName: 'Name', - department: 'Department', - identity: 'Identity', - isLucky: 'Is Lucky', - operation: 'Operation', - setLuckyNumber: 'Set Lucky Number', - luckyPeopleNumber: 'Lucky People Number', +import { button, data, dialog, error, footer, placeHolder, sidebar, table, tooltip, viewTitle } from './modules' - detail: 'Detail', - noneData: 'No Data', - // prize configuration - fullParticipation: 'FullParticipation', - numberParticipants: 'NumberParticipants', - isDone: 'is Done', - image: 'Image', - onceNumber: 'Once Number', - time: 'Time', - // view setting - title: 'Main Title', - columnNumber: 'Column Number', - theme: 'Theme', - language: 'Language', - cardColor: 'Card Color', - winnerColor: 'Winner Color', - textColor: 'Text Color', - cardWidth: 'Card Width', - cardHeight: 'Card Height', - textSize: 'Text Size', - highlightColor: 'HighLight Color', - patternSetting: 'Pattern Setting', - alwaysDisplay: 'Always Display Prize List', - avatarDisplay: 'Show avatars or not', - selectPicture: 'Select a Picture', - backgroundImage: 'Select Background Image', - }, - dialog: { - titleTip: 'Tip!', - titleTemporary: 'Add Temporary Activity', - dialogPCWeb: 'Please use a PC browser to access for optimal display performance', - dialogDelAllPerson: 'This operation will delete all personnel list data. Do you want to continue?', - dialogResetWinner: 'This operation will clear the winning information of personnel. Do you want to continue?', - dialogResetAllData: 'This operation will reset all data. Do you want to continue?', - dialogSingleDrawLimit: 'Only 10 characters can be extracted in a single draw', - dialogLatestBrowser: 'Please use the latest version of Chrome or Edge browser', - tipResetPrize: 'Performing operations may reset data and cant recover, please proceed with caution', - }, - tooltip: { - settingConfiguration: 'Setting/Configuration', - nextSong: 'Right Click to Next Song', - noSongPlay: 'No Song to Play', - prizeList: 'Prize List', - addActivity: 'Add Activity', - downloadTemplateTip: 'After downloading the file, please fill in the data in Excel and save it in xlsx format', - uploadExcelTip: 'Upload the modified Excel file', - leftClick: 'Left Click to Slice', - toHome: 'to Home', - resetLayout: 'This item is time-consuming and performance intensive', - defaultLayout: 'The default pattern setting is valid for 17 columns, please set the number of other columns yourself', - doneCount: 'Number of winners', - edit: 'Edit', - delete: 'Delete', - }, - error: { - require: 'required field', - requireNumber: 'please enter a number', - minNumber1: 'the minimum is 1', - maxNumber100: 'the maximum is 100', - uploadSuccess: 'Upload Success', - uploadFail: 'Upload Failed', - notImage: 'Not Image', - personIsAllDone: 'All Person Is Done', - personNotEnough: 'Person Is Not Enough', - startDraw: 'Now Draw {count} {leftover} people', - completeInformation: 'Please provide complete information', - }, - placeHolder: { - enterTitle: 'Enter Title', - name: 'Name', - winnerCount: 'Lucky Person Count', - }, - data: { - yes: 'Yes', - no: 'No', - number: 'Number', - isWin: 'isWin', - avatar: 'avatar', - department: 'Department', - name: 'Name', - identity: 'Identity', - prizeName: 'Prize Name', - prizeTime: 'Prize Time', - operation: 'Operation', - delete: 'Delete', - removePerson: 'Remove the Person', - defaultTitle: 'The Prelude to the Six Ministries of the Ming Dynasty Cabinet', - xlsxName: 'personListTemplate-en.xlsx', - readmeName: 'readme-en.md', - }, - footer: { - 'self-reflection': 'Turn inward and examine yourself when you encounter difficulties in life.', - 'thiefEasy': 'Thief difficult mountain thief easily, breaking heart.', - }, +export default { + button: button.en, + sidebar: sidebar.en, + viewTitle: viewTitle.en, + table: table.en, + dialog: dialog.en, + tooltip: tooltip.en, + error: error.en, + placeHolder: placeHolder.en, + data: data.en, + footer: footer.en, } diff --git a/src/locales/modules/button.ts b/src/locales/modules/button.ts new file mode 100644 index 0000000..0c4b0ed --- /dev/null +++ b/src/locales/modules/button.ts @@ -0,0 +1,63 @@ +export const buttonEn = { + enterLottery: 'Enter Lottery', + start: 'Start', + selectLucky: 'Draw the Lucky', + continue: 'Continue', + confirm: 'Confirm', + cancel: 'Cancel', + setting: 'Setting', + delete: 'Delete', + allDelete: 'Delete All', + downloadTemplate: 'Download Template', + importData: 'Import Data', + resetData: 'Reset Data', + exportResult: 'Export Result', + add: 'Add', + resetDefault: 'Reset Default', + resetAllData: 'Reset All Data', + clearPattern: 'Clear Pattern', + DefaultPattern: 'Default Pattern', + upload: 'Upload', + reset: 'Reset', + play: 'Play', + setLayout: 'Set Layout', + close: 'Close', + noInfoAndImport: 'No Info and import it', + useDefault: 'Use Default Data', + loading: 'Loading...', +} + +export const buttonZhCn = { + enterLottery: '进入抽奖', + start: '开始', + selectLucky: '抽取幸运儿', + continue: '继续', + confirm: '确认', + cancel: '取消', + setting: '设置', + delete: '删除', + allDelete: '删除全部', + downloadTemplate: '下载模板', + importData: '导入数据', + resetData: '重置数据', + exportResult: '导出结果', + add: '添加', + resetDefault: '重置为默认', + resetAllData: '重置所有数据', + clearPattern: '清除图案', + DefaultPattern: '默认图案', + upload: '上传', + reset: '重置', + play: '播放', + setLayout: '重设布局', + close: '关闭', + noInfoAndImport: '暂无人员信息,前往导入', + useDefault: '使用默认数据', + loading: '加载中...', +} + +// 导出一个值 +export const button = { + en: buttonEn, + zhCn: buttonZhCn, +} diff --git a/src/locales/modules/data.ts b/src/locales/modules/data.ts new file mode 100644 index 0000000..9624d43 --- /dev/null +++ b/src/locales/modules/data.ts @@ -0,0 +1,42 @@ +export const dataEn = { + yes: 'Yes', + no: 'No', + number: 'Number', + isWin: 'isWin', + avatar: 'avatar', + department: 'Department', + name: 'Name', + identity: 'Identity', + prizeName: 'Prize Name', + prizeTime: 'Prize Time', + operation: 'Operation', + delete: 'Delete', + removePerson: 'Remove the Person', + defaultTitle: 'The Prelude to the Six Ministries of the Ming Dynasty Cabinet', + xlsxName: 'personListTemplate-en.xlsx', + readmeName: 'readme-en.md', +} + +export const dataZhCn = { + yes: '是', + no: '否', + number: '编号', + isWin: '是否中奖', + avatar: '头像', + department: '部门', + name: '姓名', + identity: '身份', + prizeName: '获奖', + prizeTime: '获奖时间', + operation: '操作', + delete: '删除', + removePerson: '移入未中奖名单', + defaultTitle: '大明内阁六部御前奏对', + xlsxName: '人口登记表-zhCn.xlsx', + readmeName: 'readme-zhCn.md', +} + +export const data = { + en: dataEn, + zhCn: dataZhCn, +} diff --git a/src/locales/modules/dialog.ts b/src/locales/modules/dialog.ts new file mode 100644 index 0000000..0c24b03 --- /dev/null +++ b/src/locales/modules/dialog.ts @@ -0,0 +1,34 @@ +export const dialogEn = { + titleTip: 'Tip!', + titleTemporary: 'Add Temporary Activity', + dialogPCWeb: 'Please use a PC browser to access for optimal display performance', + dialogDelAllPerson: 'This operation will delete all personnel list data. Do you want to continue?', + dialogResetWinner: 'This operation will clear the winning information of personnel. Do you want to continue?', + dialogResetAllData: 'This operation will reset all data. Do you want to continue?', + dialogSingleDrawLimit: 'Only 10 characters can be extracted in a single draw', + dialogLatestBrowser: 'Please use the latest version of Chrome or Edge browser', + tipResetPrize: 'Performing operations may reset data and cant recover, please proceed with caution', + uploadFileTitle: 'Upload File', + uploadImageTitle: 'Upload Image', + uploadAudioTitle: 'Upload Audio', +} + +export const dialogZhCn = { + titleTip: '提示!', + titleTemporary: '增加临时抽奖', + dialogPCWeb: '请使用PC进行访问以获得最佳显示效果', + dialogDelAllPerson: '该操作会删除所有人员数据,是否继续?', + dialogResetWinner: '该操作会清空人员中奖信息,是否继续?', + dialogResetAllData: '该操作会重置所有数据,是否继续?', + dialogSingleDrawLimit: '单次抽取只能抽取10位', + dialogLatestBrowser: '请使用最新版Chrome或者Edge浏览器', + tipResetPrize: '进行操作可能会重置数据并不可恢复,请谨慎操作', + uploadFileTitle: '上传文件', + uploadImageTitle: '上传图片', + uploadAudioTitle: '上传音频', +} + +export const dialog = { + en: dialogEn, + zhCn: dialogZhCn, +} diff --git a/src/locales/modules/error.ts b/src/locales/modules/error.ts new file mode 100644 index 0000000..9145386 --- /dev/null +++ b/src/locales/modules/error.ts @@ -0,0 +1,60 @@ +import { success } from 'zod' + +export const errorEn = { + require: 'required field', + requireNumber: 'please enter a number', + minNumber1: 'the minimum is 1', + maxNumber100: 'the maximum is 100', + uploadSuccess: 'Upload Success', + uploadFail: 'Upload Failed', + notImage: 'Not Image', + personIsAllDone: 'All Person Is Done', + personNotEnough: 'Person Is Not Enough', + startDraw: 'Now Draw {count} {leftover} people', + completeInformation: 'Please provide complete information', + notJsonFile: 'it isn\'t a JSON file', + notAudioFile: 'it isn\'t an audio file', + personNameEmpty: 'Please enter name', + excelFileError: 'The header is inconsistent, please download the template, modify it, and then upload it', + exportSuccess: 'Export Success', + exportFail: 'Export Failed', + importSuccess: 'Import Success', + importFail: 'Import Failed', + downloadSuccess: '下载成功', + deleteSuccess: '删除成功', + deleteFail: '删除失败', + success: 'Success', + fail: 'Failed', +} + +export const errorZhCn = { + require: '必填项', + requireNumber: '请输入数字', + minNumber1: '最小为1', + maxNumber100: '最大为100', + uploadSuccess: '上传成功', + uploadFail: '上传失败', + notImage: '不是图片', + personIsAllDone: '抽奖抽完了', + personNotEnough: '抽奖人数不足', + startDraw: '现在抽取{count}{leftover}人', + completeInformation: '请填写完整信息', + notJsonFile: '这不是一个JSON文件', + notAudioFile: '这不是一个音频文件', + personNameEmpty: '请填写姓名', + excelFileError: '表头不一致,请先下载模板然后修改后再上传', + exportSuccess: '导出成功', + exportFail: '导出失败', + importSuccess: '导入成功', + importFail: '导入失败', + downloadSuccess: '下载成功', + deleteSuccess: '删除成功', + deleteFail: '删除失败', + success: '成功', + fail: '失败', +} + +export const error = { + en: errorEn, + zhCn: errorZhCn, +} diff --git a/src/locales/modules/footer.ts b/src/locales/modules/footer.ts new file mode 100644 index 0000000..625a74f --- /dev/null +++ b/src/locales/modules/footer.ts @@ -0,0 +1,14 @@ +export const footerEn = { + 'self-reflection': 'Turn inward and examine yourself when you encounter difficulties in life.', + 'thiefEasy': 'Thief difficult mountain thief easily, breaking heart.', +} + +export const footerZhCn = { + 'self-reflection': '行有不得,反求诸己', + 'thiefEasy': '破山中贼易,破心中贼难', +} + +export const footer = { + en: footerEn, + zhCn: footerZhCn, +} diff --git a/src/locales/modules/index.ts b/src/locales/modules/index.ts new file mode 100644 index 0000000..90bb31f --- /dev/null +++ b/src/locales/modules/index.ts @@ -0,0 +1,11 @@ +// 导出该文件夹下的内容 +export * from './button' +export * from './data' +export * from './dialog' +export * from './error' +export * from './footer' +export * from './placeHolder' +export * from './sidebar' +export * from './table' +export * from './tooltip' +export * from './viewTitle' diff --git a/src/locales/modules/placeHolder.ts b/src/locales/modules/placeHolder.ts new file mode 100644 index 0000000..2605410 --- /dev/null +++ b/src/locales/modules/placeHolder.ts @@ -0,0 +1,24 @@ +export const placeHolderEn = { + enterTitle: 'Enter Title', + name: 'Name', + winnerCount: 'Lucky Person Count', + selectFont: 'Select Font', + timedStop: 'will stop at a scheduled time after starting', + imageName: 'Image Name', + personName: 'Please enter name', +} + +export const placeHolderZhCn = { + enterTitle: '输入标题', + name: '名称', + winnerCount: '中奖人数', + selectFont: '选择字体', + timedStop: '开始后定时抽取', + imageName: '图片名称', + personName: '请填写姓名', +} + +export const placeHolder = { + en: placeHolderEn, + zhCn: placeHolderZhCn, +} diff --git a/src/locales/modules/sidebar.ts b/src/locales/modules/sidebar.ts new file mode 100644 index 0000000..bbd70bc --- /dev/null +++ b/src/locales/modules/sidebar.ts @@ -0,0 +1,28 @@ +export const sidebarEn = { + personConfiguration: 'Person Configuration', + personList: 'Person List', + winnerList: 'Winner List', + prizeConfiguration: 'Prize Configuration', + globalSetting: 'Global Configuration', + viewSetting: 'View Setting', + imagesManagement: 'Images Management', + musicManagement: 'Music Management', + operatingInstructions: 'Operating Instructions', +} + +export const sidebarZhCn = { + personConfiguration: '人员配置', + personList: '人员列表', + winnerList: '中奖人员', + prizeConfiguration: '奖品配置', + globalSetting: '全局配置', + viewSetting: '界面设置', + imagesManagement: '图片管理', + musicManagement: '音乐管理', + operatingInstructions: '操作说明', +} + +export const sidebar = { + en: sidebarEn, + zhCn: sidebarZhCn, +} diff --git a/src/locales/modules/table.ts b/src/locales/modules/table.ts new file mode 100644 index 0000000..9c0be03 --- /dev/null +++ b/src/locales/modules/table.ts @@ -0,0 +1,104 @@ +import { reset } from 'canvas-confetti' +import { time } from 'zod/v4/core/regexes.cjs' + +export const tableEn = { + // field block name + abilitySetting: 'Ability Setting', + dataSetting: 'Data Setting', + layoutSetting: 'Layout Setting', + patternSetting: 'Pattern Setting', + textSetting: 'Text Setting', + themeSetting: 'Theme Setting', + // person configuration + number: 'Number', + name: 'Name', + prizeName: 'Name', + department: 'Department', + identity: 'Identity', + isLucky: 'Is Lucky', + operation: 'Operation', + setLuckyNumber: 'Set Lucky Number', + luckyPeopleNumber: 'Lucky People Number', + detail: 'Detail', + noneData: 'No Data', + // prize configuration + fullParticipation: 'FullParticipation', + numberParticipants: 'NumberParticipants', + isDone: 'is Done', + image: 'Image', + onceNumber: 'Once Number', + time: 'Time', + // view setting + title: 'Main Title', + columnNumber: 'Column Number', + theme: 'Theme', + language: 'Language', + cardColor: 'Card Color', + winnerColor: 'Winner Color', + textColor: 'Text Color', + cardWidth: 'Card Width', + cardHeight: 'Card Height', + textSize: 'Text Size', + highlightColor: 'HighLight Color', + alwaysDisplay: 'Always Display Prize List', + avatarDisplay: 'Show avatars or not', + selectPicture: 'Select a Picture', + backgroundImage: 'Select Background Image', + timedStop: 'Timed Stop', + playWinMusic: 'Play Win Music', + resetAllData: 'Reset All Data', +} + +export const tableZhCn = { + // field block name + abilitySetting: '功能设置', + dataSetting: '数据设置', + layoutSetting: '布局设置', + patternSetting: '图案设置', + textSetting: '文字设置', + themeSetting: '主题设置', + // person configuration + number: '编号', + name: '姓名', + prizeName: '名称', + department: '部门', + identity: '身份', + isLucky: '是否中奖', + operation: '操作', + setLuckyNumber: '设置中奖人数', + luckyPeopleNumber: '中奖人数', + detail: '详细信息', + noneData: '暂无数据', + // prize configuration + fullParticipation: '可重复', + numberParticipants: '抽奖人数', + isDone: '已抽取', + image: '图片', + onceNumber: '单次抽取个数', + time: '时间', + // view setting + title: '主标题', + columnNumber: '列数', + theme: '主题', + language: '语言', + cardColor: '卡片颜色', + winnerColor: '中奖卡片颜色', + textColor: '文字颜色', + cardWidth: '卡片宽度', + cardHeight: '卡片高度', + textSize: '文字大小', + highlightColor: '高亮颜色', + alwaysDisplay: '常显奖项列表', + avatarDisplay: '是否显示头像', + selectPicture: '选择一张图片', + backgroundImage: '选择背景图片', + timedStop: '定时停止', + playWinMusic: '播放中奖音乐', + resetAllData: '重置数据', + +} + +export const table = { + en: tableEn, + zhCn: tableZhCn, +} diff --git a/src/locales/modules/tooltip.ts b/src/locales/modules/tooltip.ts new file mode 100644 index 0000000..93d1ccd --- /dev/null +++ b/src/locales/modules/tooltip.ts @@ -0,0 +1,44 @@ +export const tooltipEn = { + settingConfiguration: 'Setting/Configuration', + nextSong: 'Right Click to Next Song', + noSongPlay: 'No Song to Play', + prizeList: 'Prize List', + addActivity: 'Add Activity', + downloadTemplateTip: 'After downloading the file, please fill in the data in Excel and save it in xlsx format', + uploadExcelTip: 'Upload the modified Excel file', + leftClick: 'Left Click to Slice', + toHome: 'to Home', + resetLayout: 'This item is time-consuming and performance intensive', + defaultLayout: 'The default pattern setting is valid for 17 columns, please set the number of other columns yourself', + doneCount: 'Number of winners', + edit: 'Edit', + delete: 'Delete', + timedStop: 'After the lottery begins, it will stop at a scheduled time by default, set to 0, with the unit in seconds. A value of 0 disables the scheduled stopping function', + uploadImage: 'Upload Image', + pleaseGoto: 'Please go to', +} + +export const tooltipZhCn = { + settingConfiguration: '设置/配置', + nextSong: '右键点击下一首', + noSongPlay: '没有音乐可以播放', + prizeList: '奖项列表', + addActivity: '添加抽奖', + downloadTemplateTip: '下载文件后,请在excel中填写数据,并保存为xlsx格式', + uploadExcelTip: '上传修改好的excel文件', + leftClick: '左键切割', + toHome: '主页', + resetLayout: '该项比较耗费时间和性能', + defaultLayout: '默认图案设置针对17列时有效,其他列数请自行设置', + doneCount: '已抽取', + edit: '编辑', + delete: '删除', + timedStop: '开始抽奖过后定时停止,默认为0,单位为秒,0为关闭定时停止功能', + uploadImage: '上传图片', + pleaseGoto: '请先前往', +} + +export const tooltip = { + en: tooltipEn, + zhCn: tooltipZhCn, +} diff --git a/src/locales/modules/viewTitle.ts b/src/locales/modules/viewTitle.ts new file mode 100644 index 0000000..86ddaab --- /dev/null +++ b/src/locales/modules/viewTitle.ts @@ -0,0 +1,20 @@ +export const viewTitleEn = { + personManagement: 'Person Management', + winnerManagement: 'Winner Management', + prizeManagement: 'Prize Management', + globalSetting: 'Global Setting', + operatingInstructions: 'Operating Instructions', +} + +export const viewTitleZhCn = { + personManagement: '人员管理', + winnerManagement: '已中奖人员管理', + prizeManagement: '奖项配置', + globalSetting: '全局配置', + operatingInstructions: '操作说明', +} + +export const viewTitle = { + en: viewTitleEn, + zhCn: viewTitleZhCn, +} diff --git a/src/locales/zhCn.ts b/src/locales/zhCn.ts index 5671de5..f485897 100644 --- a/src/locales/zhCn.ts +++ b/src/locales/zhCn.ts @@ -1,153 +1,14 @@ -export default { - button: { - enterLottery: '进入抽奖', - start: '开始', - selectLucky: '抽取幸运儿', - continue: '继续', - confirm: '确认', - cancel: '取消', - setting: '设置', - delete: '删除', - allDelete: '删除全部', - downloadTemplate: '下载模板', - importData: '导入数据', - resetData: '重置数据', - exportResult: '导出结果', - add: '添加', - resetDefault: '重置为默认', - resetAllData: '重置所有数据', - clearPattern: '清除图案', - DefaultPattern: '默认图案', - upload: '上传', - reset: '重置', - play: '播放', - setLayout: '重设布局', - close: '关闭', - noInfoAndImport: '暂无人员信息,前往导入', - useDefault: '使用默认数据', - }, - sidebar: { - personConfiguration: '人员配置', - personList: '人员列表', - winnerList: '中奖人员', - prizeConfiguration: '奖品配置', - globalSetting: '全局配置', - viewSetting: '界面设置', - imagesManagement: '图片管理', - musicManagement: '音乐管理', - operatingInstructions: '操作说明', - }, - viewTitle: { - personManagement: '人员管理', - winnerManagement: '已中奖人员管理', - prizeManagement: '奖项配置', - globalSetting: '全局配置', - operatingInstructions: '操作说明', - }, - table: { - // person configuration - number: '编号', - name: '姓名', - prizeName: '名称', - department: '部门', - identity: '身份', - isLucky: '是否中奖', - operation: '操作', - setLuckyNumber: '设置中奖人数', - luckyPeopleNumber: '中奖人数', +import { button, data, dialog, error, footer, placeHolder, sidebar, table, tooltip, viewTitle } from './modules' - detail: '详细信息', - noneData: '暂无数据', - // prize configuration - fullParticipation: '可重复', - numberParticipants: '抽奖人数', - isDone: '已抽取', - image: '图片', - onceNumber: '单次抽取个数', - time: '时间', - // view setting - title: '主标题', - columnNumber: '列数', - theme: '主题', - language: '语言', - cardColor: '卡片颜色', - winnerColor: '中奖卡片颜色', - textColor: '文字颜色', - cardWidth: '卡片宽度', - cardHeight: '卡片高度', - textSize: '文字大小', - highlightColor: '高亮颜色', - patternSetting: '图案设置', - alwaysDisplay: '常显奖项列表', - avatarDisplay: '是否显示头像', - selectPicture: '选择一张图片', - backgroundImage: '选择背景图片', - }, - dialog: { - titleTip: '提示!', - titleTemporary: '增加临时抽奖', - dialogPCWeb: '请使用PC进行访问以获得最佳显示效果', - dialogDelAllPerson: '该操作会删除所有人员数据,是否继续?', - dialogResetWinner: '该操作会清空人员中奖信息,是否继续?', - dialogResetAllData: '该操作会重置所有数据,是否继续?', - dialogSingleDrawLimit: '单次抽取只能抽取10位', - dialogLatestBrowser: '请使用最新版Chrome或者Edge浏览器', - tipResetPrize: '进行操作可能会重置数据并不可恢复,请谨慎操作', - }, - tooltip: { - settingConfiguration: '设置/配置', - nextSong: '右键点击下一首', - noSongPlay: '没有音乐可以播放', - prizeList: '奖项列表', - addActivity: '添加抽奖', - downloadTemplateTip: '下载文件后,请在excel中填写数据,并保存为xlsx格式', - uploadExcelTip: '上传修改好的excel文件', - leftClick: '左键切割', - toHome: '主页', - resetLayout: '该项比较耗费时间和性能', - defaultLayout: '默认图案设置针对17列时有效,其他列数请自行设置', - doneCount: '已抽取', - edit: '编辑', - delete: '删除', - }, - error: { - require: '必填项', - requireNumber: '请输入数字', - minNumber1: '最小为1', - maxNumber100: '最大为100', - uploadSuccess: '上传成功', - uploadFail: '上传失败', - notImage: '不是图片', - personIsAllDone: '抽奖抽完了', - personNotEnough: '抽奖人数不足', - startDraw: '现在抽取{count}{leftover}人', - completeInformation: '请填写完整信息', - }, - placeHolder: { - enterTitle: '输入标题', - name: '名称', - winnerCount: '中奖人数', - }, - data: { - yes: '是', - no: '否', - number: '编号', - isWin: '是否中奖', - avatar: '头像', - department: '部门', - name: '姓名', - identity: '身份', - prizeName: '获奖', - prizeTime: '获奖时间', - operation: '操作', - delete: '删除', - removePerson: '移入未中奖名单', - defaultTitle: '大明内阁六部御前奏对', - xlsxName: '人口登记表-zhCn.xlsx', - readmeName: 'readme-zhCn.md', - }, - footer: { - 'self-reflection': '行有不得,反求诸己', - 'thiefEasy': '破山中贼易,破心中贼难', - }, +export default { + button: button.zhCn, + sidebar: sidebar.zhCn, + viewTitle: viewTitle.zhCn, + table: table.zhCn, + dialog: dialog.zhCn, + tooltip: tooltip.zhCn, + error: error.zhCn, + placeHolder: placeHolder.zhCn, + data: data.zhCn, + footer: footer.zhCn, } diff --git a/src/views/Config/Global/FaceConfig/components/SelectFont.vue b/src/views/Config/Global/FaceConfig/components/SelectFont.vue index f4fc132..470461e 100644 --- a/src/views/Config/Global/FaceConfig/components/SelectFont.vue +++ b/src/views/Config/Global/FaceConfig/components/SelectFont.vue @@ -3,6 +3,7 @@ import { refDebounced } from '@vueuse/core' import { ChevronRight, ChevronsUpDownIcon } from 'lucide-vue-next' import { PopoverArrow } from 'reka-ui' import { computed, ref } from 'vue' +import { useI18n } from 'vue-i18n' import { Button } from '@/components/ui/button' import { Command, @@ -31,7 +32,7 @@ const { getFonts, disabled: browserDisabled, fonts } = useLocalFonts() const open = ref(false) const activeKey = ref('') const debouncedActiveKey = refDebounced(activeKey, 20) - +const { t } = useI18n() function selectFont(selectedValue: any) { open.value = false activeKey.value = '' @@ -67,7 +68,7 @@ const disabledStyle = computed(() => { @click="getFonts" > - {{ selectedFont || "选择字体..." }} + {{ selectedFont || t('placeHolder.selectFont') }} diff --git a/src/views/Config/Global/FaceConfig/components/UploadDialog.vue b/src/views/Config/Global/FaceConfig/components/UploadDialog.vue index 918f0c5..90ca385 100644 --- a/src/views/Config/Global/FaceConfig/components/UploadDialog.vue +++ b/src/views/Config/Global/FaceConfig/components/UploadDialog.vue @@ -1,8 +1,7 @@ @@ -6,22 +9,22 @@ const winMusic = defineModel('winMusic', { required: true })