From 17d5aef8c4de732f1ee6b10854e64b651eb74425 Mon Sep 17 00:00:00 2001 From: crrashh1542 Date: Sun, 5 Nov 2023 00:13:05 +0800 Subject: [PATCH 1/7] =?UTF-8?q?perf:=20=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E7=AB=AF=E7=A7=BB=E9=99=A4moment=EF=BC=8C=E5=8A=A0=E5=BF=AB?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: crrashh1542 --- src/scripts/parseInfo.js | 20 ++++++++++++++++---- vue.config.js | 9 +++------ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/scripts/parseInfo.js b/src/scripts/parseInfo.js index 7e83791..600c8a0 100644 --- a/src/scripts/parseInfo.js +++ b/src/scripts/parseInfo.js @@ -2,14 +2,12 @@ /** * 此脚本用于在处理本项目相关信息 * @author crrashh1542 - * @version 1.0 + * @version 1.1 */ import packageInfo from '/package.json' import buildInfo from '/temp/buildInfo.json' -import moment from 'moment' - // packageInfo 相关 const packageVerNum = packageInfo.version // 项目版本号 const packageRepo = packageInfo.repository // 项目地址 @@ -20,9 +18,23 @@ const buildTime = buildInfo.time // 构建时间 const buildHash = buildInfo.hash // commit hash const buildNum = buildInfo.build // 构建次数 +// 构建时间处理 +const parseBuildTime = t => { + // 查看 /temp/buildInfo.js 可知,time 参数格式均为 xxxx-xx-xxTyy:yy+zz:zz + const date = t.slice(0, 10) + const time = t.slice(11, 19) + const offset = t.slice(19, 25) + + if(offset === '+08:00') { + return date + ' ' + time + ' CST' + } else { + return date + ' ' + time + } +} + // 数据处理 const pVersion = 'v' + packageVerNum + '@' + buildHash + ' (build ' + buildNum + ')' // 完整版本 -const pTime = moment(buildTime).format('YYYY-MM-DD HH:mm:ss') + ' CST' // 构建时间 +const pTime = parseBuildTime(buildTime) // 构建时间 const pRepo = packageRepo.split('https://github.com/')[1] // 项目名 const pVue = 'v' + packageDeps['vue'].split('^')[1] // Vue 框架版本 const pUI = 'v' + packageDeps['@fluentui/web-components'].split('^')[1] // 组件库版本 diff --git a/vue.config.js b/vue.config.js index 856ae45..31f4dca 100644 --- a/vue.config.js +++ b/vue.config.js @@ -58,16 +58,11 @@ module.exports = defineConfig({ } })) - // 打包忽略 moment/locales,避免打包文件体积过大 - config.plugin('ignore') - .use(new Webpack.IgnorePlugin({ - resourceRegExp: /^\.\/locale$/, // 要排除的目录 - contextRegExp: /moment$/ // 要被处理的目录 - })) // chunk 拆分 config.optimization.splitChunks({ chunks: 'all', cacheGroups: { + // GROUP1 ------ 第三方模块 vendor: { name: 'vendors', @@ -75,6 +70,7 @@ module.exports = defineConfig({ priority: 10, chunks: 'initial' }, + // GROUP2 ------ 项目内组件 commons: { name: 'common', @@ -84,6 +80,7 @@ module.exports = defineConfig({ }, }, }) + // GROUP3 ------ 运行时 config.optimization.runtimeChunk({ name: 'runtime' From 690912294f45638a56f40b8eb4882ee6c5a765bf Mon Sep 17 00:00:00 2001 From: crrashh1542 Date: Sun, 5 Nov 2023 00:14:11 +0800 Subject: [PATCH 2/7] =?UTF-8?q?perf:=20=E5=BC=95=E7=94=A8=E6=97=A0?= =?UTF-8?q?=E9=99=90=E4=BA=A4=E6=8D=A2=E6=97=B6=E9=97=B4=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 避免字体更换加载中渲染缺失 Signed-off-by: crrashh1542 --- src/assets/styles/reset.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/assets/styles/reset.less b/src/assets/styles/reset.less index 67b3fd9..8d90d63 100644 --- a/src/assets/styles/reset.less +++ b/src/assets/styles/reset.less @@ -1,10 +1,10 @@ /* 此样式表用于基础初始化 - * Date: 2023-09-01 / Version: 1.0.1 + * Date: 2023-11-05 / Version: 1.1.0 */ // 引入字体 -@import url('https://s.cdn.crrashh.com/prod/font/PingFang-SC-CN/3d9318c6-548c-4982-a591-4a25c3f9d5d4/index.css'); -@import url('https://s.cdn.crrashh.com/prod/font/Google-Sans/16a171a7-267e-4e9a-a222-4a1b493ce28a/index.css'); +@import url('https://s.cdn.crrashh.com/prod/font/PingFang-SC-CN/e5d34e48-3138-88be-303a-9e8bd2c54ee3/index.css'); +@import url('https://s.cdn.crrashh.com/prod/font/Google-Sans/aa7bb3f3-b88d-4f98-3310-83626911a5ba/index.css'); @import url('../fonts/iconfont/iconfont.less'); @import url('./global.less'); From 8f66707a7fd0224f816415e3fb3353d12f3333b5 Mon Sep 17 00:00:00 2001 From: crrashh1542 Date: Sun, 5 Nov 2023 00:15:18 +0800 Subject: [PATCH 3/7] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: crrashh1542 --- src/views/About.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/views/About.vue b/src/views/About.vue index 50ce7f5..c5e683b 100644 --- a/src/views/About.vue +++ b/src/views/About.vue @@ -5,17 +5,19 @@ import buildInfo from '../scripts/parseInfo' import Banner from '../components/Banner.vue' import Card from '../components/Card.vue' +const sources = [ + ['https://msbuilds.rg-adguard.net', 'MSFT BUFFET DATABASE'], + ['https://changewindows.org', 'ChangeWindows'], + ['https://bbs.pcbeta.com/viewthread-1941423-1-1.html', '远景论坛 - 2262x(2263x).2506/2552更新包和修复包下载 & 内部版本进度 & .NET CU'], + ['https://community.wvbtech.com', 'wvbCommunity'] +] + export default { name: 'ViewAbout', components: { Banner, Card }, data() { return { - buildInfo, - sources: [ - ['https://changewindows.org', 'ChangeWindows'], - ['https://bbs.pcbeta.com/viewthread-1941423-1-1.html', '远景论坛 - 2262x(2263x).2506/2552更新包和修复包下载 & 内部版本进度 & .NET CU'], - ['https://community.wvbtech.com', 'wvbCommunity'] - ] + buildInfo, sources } } } From 315d4c1d0c467a5f22a8d31c8ff0e238432424b1 Mon Sep 17 00:00:00 2001 From: crrashh1542 Date: Sun, 5 Nov 2023 00:19:58 +0800 Subject: [PATCH 4/7] =?UTF-8?q?style:=20=E8=B0=83=E6=95=B4=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E8=AE=BE=E5=A4=87=E4=B8=8B=E7=9A=84=E4=B8=8B=E8=BE=B9?= =?UTF-8?q?=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: crrashh1542 --- src/components/Footer.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Footer.vue b/src/components/Footer.vue index 197a5fe..5ceaddb 100644 --- a/src/components/Footer.vue +++ b/src/components/Footer.vue @@ -37,7 +37,7 @@ export default { .footer { --footer-line-height: 1.6; --footer-margin: .9em 0; - --footer-bottom-spacing: 72px; + --footer-bottom-spacing: 88px; } } From 466cd3b8dfe35a5f039a30bc53fdd7a5fc84807e Mon Sep 17 00:00:00 2001 From: crrashh1542 Date: Sun, 5 Nov 2023 00:25:43 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E6=80=BB=E6=9C=89=E4=B8=80=E4=B8=AA=E4=B8=BAtrue=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: crrashh1542 --- src/App.vue | 12 +++++++++--- src/components/Setting.vue | 14 ++------------ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/App.vue b/src/App.vue index 0ba20a7..004e017 100644 --- a/src/App.vue +++ b/src/App.vue @@ -18,26 +18,32 @@ export default { name: 'App', components: { Appbar, Foo, Setting, BottomNav }, setup() { - // STEP1 ------ 设置初始值,避免出现 undefined + + // STEP1 ------ 设置卡片显示的初始值,避免出现 undefined let [oriFlightVisibility, oriBranchVisibility] = [true, true] let data = reactive({ isShowFlight: oriFlightVisibility, isShowBranch: oriBranchVisibility }) + let [flightVisibility, branchVisibility] = [oriFlightVisibility, oriBranchVisibility] + // 切换显示状态 function setState(emitData) { - // STEP2 ------ 获取子组件传递的信息 和 App 的 data 信息 + // STEP2 ------ 获取子组件传递的信息 和 App 的 data 信息,0 是类型,1 是值 let [stateType, stateValue] = [emitData[0], emitData[1]] - let [flightVisibility, branchVisibility] = [oriFlightVisibility, oriBranchVisibility] + // STEP3 ------ 判断类型并改变值 if (stateType === 'isShowFlight') { flightVisibility = stateValue } else if (stateType === 'isShowBranch') { branchVisibility = stateValue } + // STEP4 ------ 对 data 数据做出替换 data.isShowFlight = flightVisibility data.isShowBranch = branchVisibility + + // console.log('flight ', data.isShowFlight, '\nbranch ', data.isShowBranch) } return { ...toRefs(data), setState } } diff --git a/src/components/Setting.vue b/src/components/Setting.vue index 1a90ff1..45883db 100644 --- a/src/components/Setting.vue +++ b/src/components/Setting.vue @@ -1,9 +1,6 @@