diff --git a/increment-version.js b/increment-version.js index 3239813..57b3e92 100644 --- a/increment-version.js +++ b/increment-version.js @@ -1,23 +1,41 @@ -import fs from 'node:fs' -import path, { dirname } from 'node:path' -import { fileURLToPath } from 'node:url' -import semver from 'semver' +import fs from 'node:fs'; +import path, { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import semver from 'semver'; +import { execSync } from 'child_process'; // 引入 child_process 模块用于执行 Git 命令 -const __filename = fileURLToPath(import.meta.url) -const __dirname = dirname(__filename) +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); -const packagePath = path.resolve(__dirname, 'package.json') -const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf-8')) +const packagePath = path.resolve(__dirname, 'package.json'); +const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf-8')); // 读取命令行参数(默认使用 'patch') -const versionType = process.argv[2] || 'patch' +const versionType = process.argv[2] || 'patch'; // 递增版本 -const newVersion = semver.inc(packageJson.version, versionType) +const newVersion = semver.inc(packageJson.version, versionType); if (!newVersion) { - throw new Error(`Invalid version type: ${versionType}`) + throw new Error(`Invalid version type: ${versionType}`); } -packageJson.version = newVersion -fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2)) -console.log(`Version updated to: ${newVersion}`) +packageJson.version = newVersion; +fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2)); +console.log(`Version updated to: ${newVersion}`); + +// 新增:自动提交 package.json 到远程仓库 +try { + // 将 package.json 添加到暂存区 + execSync('git add package.json'); + console.log('Added package.json to staging area.'); + + // 提交更改 + execSync(`git commit -m "fix: Update version to V${newVersion}"`); + console.log(`Committed changes with message: Update version to ${newVersion}`); + + // 推送到远程仓库 + execSync('git push'); + console.log('Pushed changes to remote repository.'); +} catch (error) { + console.error('Failed to commit and push changes:', error.message); +} \ No newline at end of file diff --git a/package.json b/package.json index 873c90d..4ef2ef3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "a8000-plus", "private": true, - "version": "1.0.1", + "version": "0.0.8", "type": "module", "scripts": { "dev": "vite", diff --git a/src/components/SimpleKeyboard.vue b/src/components/SimpleKeyboard.vue index 9400a2d..038d23a 100644 --- a/src/components/SimpleKeyboard.vue +++ b/src/components/SimpleKeyboard.vue @@ -33,7 +33,8 @@ export default { } if(this.layout){ keyParams.display = { - '{bksp}': "回退" // 设置删除键的显示字符 + '{bksp}': "删除", // 设置删除键的显示字符 + '{enter}': "回车" // 设置删除键的显示字符 } } this.keyboard = new Keyboard(this.keyboardClass, keyParams) diff --git a/src/pages/Index/Index.vue b/src/pages/Index/Index.vue index 7283e2d..c6b1e59 100644 --- a/src/pages/Index/Index.vue +++ b/src/pages/Index/Index.vue @@ -625,12 +625,12 @@ const onCloseDevice = ()=> { OkBtn: '确认', confirmCallback: () => { //关机时的遮罩层 - isLoading.value = true + isLoading.value = false confirmVisible.value = false //有时接口返回的太快,看不到loading状态,延迟1s,看一到loading状态。 setTimeout(async () => { await shutdown() - shutdownMessage.value = '设备已关机,请拔掉电源' + eMessage.success('设备已关机,请拔掉电源') }, 1000) }, cancelCallback: () => { diff --git a/src/pages/Index/Settings/Device.vue b/src/pages/Index/Settings/Device.vue index 2fbdb91..dec32b0 100644 --- a/src/pages/Index/Settings/Device.vue +++ b/src/pages/Index/Settings/Device.vue @@ -1,8 +1,18 @@