From f6ae5b335ace9ca2e735c07b891a9306054759d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Fri, 27 Dec 2024 14:20:34 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20=E5=A4=84=E7=90=86=E8=BD=AC?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .stylelintrc.yml | 3 +- package.json | 5 +- pnpm-lock.yaml | 292 ++++++++++++++++++++++++--- src/components/viewPost/tp-text.vue | 6 +- src/components/viewPost/tp-texts.vue | 54 ++--- src/pages/User/Combat.vue | 3 +- src/pages/common/PageAnno.vue | 4 +- src/utils/linkParser.ts | 4 +- src/utils/toolFunc.ts | 41 ++++ src/web/utils/annoParser.ts | 4 +- src/web/utils/tools.ts | 47 ----- 11 files changed, 340 insertions(+), 123 deletions(-) delete mode 100644 src/web/utils/tools.ts diff --git a/.stylelintrc.yml b/.stylelintrc.yml index 644dd8b3..987dc7ed 100644 --- a/.stylelintrc.yml +++ b/.stylelintrc.yml @@ -5,10 +5,11 @@ extends: - stylelint-config-standard-vue - stylelint-config-idiomatic-order plugins: + - stylelint-scss - stylelint-prettier - stylelint-order rules: - prettier/prettier: true property-no-vendor-prefix: - true - ignoreProperties: [backdrop-filter] + prettier/prettier: true diff --git a/package.json b/package.json index 38640c83..60b89b30 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "lint:fix": "concurrently \"pnpm:lint:*:fix\"", "lint:code": "eslint .", "lint:code:fix": "eslint . --fix", - "lint:style": "stylelint \"src/**/*.{vue,css}\"", + "lint:style": "stylelint \"src/**/*.{vue,css,scss}\" -f verbose", "lint:style:fix": "pnpm lint:style --fix", "lint:rust:fix": "cd src-tauri && cargo fmt", "prettier": "prettier . --write", @@ -88,6 +88,8 @@ "jsencrypt": "^3.3.2", "pinia": "^2.3.0", "pinia-plugin-persistedstate": "^4.1.3", + "sass": "^1.83.0", + "sass-loader": "^16.0.4", "uuid": "^11.0.3", "vue": "^3.5.13", "vue-echarts": "^7.0.3", @@ -127,6 +129,7 @@ "stylelint-high-performance-animation": "^1.10.0", "stylelint-order": "^6.0.4", "stylelint-prettier": "^5.0.2", + "stylelint-scss": "^6.10.0", "typescript": "^5.7.2", "typescript-eslint": "^8.18.0", "vite": "^6.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index af417ea5..97f26d07 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -71,6 +71,12 @@ importers: pinia-plugin-persistedstate: specifier: ^4.1.3 version: 4.1.3(pinia@2.3.0(typescript@5.7.2)(vue@3.5.13(typescript@5.7.2)))(rollup@4.28.1) + sass: + specifier: ^1.83.0 + version: 1.83.0 + sass-loader: + specifier: ^16.0.4 + version: 16.0.4(sass@1.83.0) uuid: specifier: ^11.0.3 version: 11.0.3 @@ -122,7 +128,7 @@ importers: version: 8.18.0(eslint@9.17.0(jiti@2.4.1))(typescript@5.7.2) '@vitejs/plugin-vue': specifier: ^5.2.1 - version: 5.2.1(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2)) + version: 5.2.1(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2)) concurrently: specifier: ^9.1.0 version: 9.1.0 @@ -183,6 +189,9 @@ importers: stylelint-prettier: specifier: ^5.0.2 version: 5.0.2(prettier@3.4.2)(stylelint@16.11.0(typescript@5.7.2)) + stylelint-scss: + specifier: ^6.10.0 + version: 6.10.0(stylelint@16.11.0(typescript@5.7.2)) typescript: specifier: ^5.7.2 version: 5.7.2 @@ -191,13 +200,13 @@ importers: version: 8.18.0(eslint@9.17.0(jiti@2.4.1))(typescript@5.7.2) vite: specifier: ^6.0.3 - version: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1) + version: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1) vite-plugin-vue-devtools: specifier: ^7.6.8 - version: 7.6.8(rollup@4.28.1)(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2)) + version: 7.6.8(rollup@4.28.1)(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2)) vite-plugin-vuetify: specifier: ^2.0.4 - version: 2.0.4(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2))(vuetify@3.7.5) + version: 2.0.4(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2))(vuetify@3.7.5) vue-eslint-parser: specifier: ^9.4.3 version: 9.4.3(eslint@9.17.0(jiti@2.4.1)) @@ -663,6 +672,94 @@ packages: cpu: [x64] os: [win32] + '@parcel/watcher-android-arm64@2.5.0': + resolution: {integrity: sha512-qlX4eS28bUcQCdribHkg/herLe+0A9RyYC+mm2PXpncit8z5b3nSqGVzMNR3CmtAOgRutiZ02eIJJgP/b1iEFQ==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [android] + + '@parcel/watcher-darwin-arm64@2.5.0': + resolution: {integrity: sha512-hyZ3TANnzGfLpRA2s/4U1kbw2ZI4qGxaRJbBH2DCSREFfubMswheh8TeiC1sGZ3z2jUf3s37P0BBlrD3sjVTUw==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [darwin] + + '@parcel/watcher-darwin-x64@2.5.0': + resolution: {integrity: sha512-9rhlwd78saKf18fT869/poydQK8YqlU26TMiNg7AIu7eBp9adqbJZqmdFOsbZ5cnLp5XvRo9wcFmNHgHdWaGYA==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [darwin] + + '@parcel/watcher-freebsd-x64@2.5.0': + resolution: {integrity: sha512-syvfhZzyM8kErg3VF0xpV8dixJ+RzbUaaGaeb7uDuz0D3FK97/mZ5AJQ3XNnDsXX7KkFNtyQyFrXZzQIcN49Tw==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [freebsd] + + '@parcel/watcher-linux-arm-glibc@2.5.0': + resolution: {integrity: sha512-0VQY1K35DQET3dVYWpOaPFecqOT9dbuCfzjxoQyif1Wc574t3kOSkKevULddcR9znz1TcklCE7Ht6NIxjvTqLA==} + engines: {node: '>= 10.0.0'} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@parcel/watcher-linux-arm-musl@2.5.0': + resolution: {integrity: sha512-6uHywSIzz8+vi2lAzFeltnYbdHsDm3iIB57d4g5oaB9vKwjb6N6dRIgZMujw4nm5r6v9/BQH0noq6DzHrqr2pA==} + engines: {node: '>= 10.0.0'} + cpu: [arm] + os: [linux] + libc: [musl] + + '@parcel/watcher-linux-arm64-glibc@2.5.0': + resolution: {integrity: sha512-BfNjXwZKxBy4WibDb/LDCriWSKLz+jJRL3cM/DllnHH5QUyoiUNEp3GmL80ZqxeumoADfCCP19+qiYiC8gUBjA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@parcel/watcher-linux-arm64-musl@2.5.0': + resolution: {integrity: sha512-S1qARKOphxfiBEkwLUbHjCY9BWPdWnW9j7f7Hb2jPplu8UZ3nes7zpPOW9bkLbHRvWM0WDTsjdOTUgW0xLBN1Q==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@parcel/watcher-linux-x64-glibc@2.5.0': + resolution: {integrity: sha512-d9AOkusyXARkFD66S6zlGXyzx5RvY+chTP9Jp0ypSTC9d4lzyRs9ovGf/80VCxjKddcUvnsGwCHWuF2EoPgWjw==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@parcel/watcher-linux-x64-musl@2.5.0': + resolution: {integrity: sha512-iqOC+GoTDoFyk/VYSFHwjHhYrk8bljW6zOhPuhi5t9ulqiYq1togGJB5e3PwYVFFfeVgc6pbz3JdQyDoBszVaA==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@parcel/watcher-win32-arm64@2.5.0': + resolution: {integrity: sha512-twtft1d+JRNkM5YbmexfcH/N4znDtjgysFaV9zvZmmJezQsKpkfLYJ+JFV3uygugK6AtIM2oADPkB2AdhBrNig==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [win32] + + '@parcel/watcher-win32-ia32@2.5.0': + resolution: {integrity: sha512-+rgpsNRKwo8A53elqbbHXdOMtY/tAtTzManTWShB5Kk54N8Q9mzNWV7tV+IbGueCbcj826MfWGU3mprWtuf1TA==} + engines: {node: '>= 10.0.0'} + cpu: [ia32] + os: [win32] + + '@parcel/watcher-win32-x64@2.5.0': + resolution: {integrity: sha512-lPrxve92zEHdgeff3aiu4gDOIt4u7sJYha6wbdEZDCDUhtjTsOMiaJzG5lMY4GkWH8p0fMmO2Ppq5G5XXG+DQw==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [win32] + + '@parcel/watcher@2.5.0': + resolution: {integrity: sha512-i0GV1yJnm2n3Yq1qw6QrUrd/LI9bE8WEBOTtOkpCXHHdyN3TAGgqAK/DAT05z4fq2x04cARXt2pDmjWjL92iTQ==} + engines: {node: '>= 10.0.0'} + '@pkgr/core@0.1.1': resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -1355,6 +1452,11 @@ packages: destr@2.0.3: resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==} + detect-libc@1.0.3: + resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==} + engines: {node: '>=0.10'} + hasBin: true + dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -1853,6 +1955,9 @@ packages: resolution: {integrity: sha512-InwqeHHN2XpumIkMvpl/DCJVrAHgCsG5+cn1XlnLWGwtZBm8QJfSusItfrwx81CTp5agNZqpKU2J/ccC5nGT4A==} engines: {node: '>= 4'} + immutable@5.0.3: + resolution: {integrity: sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==} + import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} @@ -2243,6 +2348,12 @@ packages: natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + neo-async@2.6.2: + resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + + node-addon-api@7.1.1: + resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} + node-fetch-native@1.6.4: resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==} @@ -2416,6 +2527,9 @@ packages: resolution: {integrity: sha512-OWgQ9/Pe23MnNJC0PL4uZp8k0EDaUvqpJFSiwFxOLClAhmD7UEisyhO3x5hVsD4xFrjReVTXydlrMes45dJ71w==} engines: {node: ^12 || >=14} + postcss-media-query-parser@0.2.3: + resolution: {integrity: sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==} + postcss-resolve-nested-selector@0.1.6: resolution: {integrity: sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==} @@ -2544,6 +2658,32 @@ packages: resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} engines: {node: '>= 0.4'} + sass-loader@16.0.4: + resolution: {integrity: sha512-LavLbgbBGUt3wCiYzhuLLu65+fWXaXLmq7YxivLhEqmiupCFZ5sKUAipK3do6V80YSU0jvSxNhEdT13IXNr3rg==} + engines: {node: '>= 18.12.0'} + peerDependencies: + '@rspack/core': 0.x || 1.x + node-sass: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 + sass: ^1.3.0 + sass-embedded: '*' + webpack: ^5.0.0 + peerDependenciesMeta: + '@rspack/core': + optional: true + node-sass: + optional: true + sass: + optional: true + sass-embedded: + optional: true + webpack: + optional: true + + sass@1.83.0: + resolution: {integrity: sha512-qsSxlayzoOjdvXMVLkzF84DJFc2HZEL/rFyGIKbbilYtAvlCxyuzUeff9LawTn4btVnLKg75Z8MMr1lxU1lfGw==} + engines: {node: '>=14.0.0'} + hasBin: true + sax@1.4.1: resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==} @@ -2750,6 +2890,12 @@ packages: prettier: '>=3.0.0' stylelint: '>=16.0.0' + stylelint-scss@6.10.0: + resolution: {integrity: sha512-y03if6Qw9xBMoVaf7tzp5BbnYhYvudIKzURkhSHzcHG0bW0fAYvQpTUVJOe7DyhHaxeThBil4ObEMvGbV7+M+w==} + engines: {node: '>=18.12.0'} + peerDependencies: + stylelint: ^16.0.2 + stylelint@16.11.0: resolution: {integrity: sha512-zrl4IrKmjJQ+h9FoMp69UMCq5SxeHk0URhxUBj4d3ISzo/DplOFBJZc7t7Dr6otB+1bfbbKNLOmCDpzKSlW+Nw==} engines: {node: '>=18.12.0'} @@ -3612,6 +3758,67 @@ snapshots: '@oxlint/win32-x64@0.15.2': optional: true + '@parcel/watcher-android-arm64@2.5.0': + optional: true + + '@parcel/watcher-darwin-arm64@2.5.0': + optional: true + + '@parcel/watcher-darwin-x64@2.5.0': + optional: true + + '@parcel/watcher-freebsd-x64@2.5.0': + optional: true + + '@parcel/watcher-linux-arm-glibc@2.5.0': + optional: true + + '@parcel/watcher-linux-arm-musl@2.5.0': + optional: true + + '@parcel/watcher-linux-arm64-glibc@2.5.0': + optional: true + + '@parcel/watcher-linux-arm64-musl@2.5.0': + optional: true + + '@parcel/watcher-linux-x64-glibc@2.5.0': + optional: true + + '@parcel/watcher-linux-x64-musl@2.5.0': + optional: true + + '@parcel/watcher-win32-arm64@2.5.0': + optional: true + + '@parcel/watcher-win32-ia32@2.5.0': + optional: true + + '@parcel/watcher-win32-x64@2.5.0': + optional: true + + '@parcel/watcher@2.5.0': + dependencies: + detect-libc: 1.0.3 + is-glob: 4.0.3 + micromatch: 4.0.8 + node-addon-api: 7.1.1 + optionalDependencies: + '@parcel/watcher-android-arm64': 2.5.0 + '@parcel/watcher-darwin-arm64': 2.5.0 + '@parcel/watcher-darwin-x64': 2.5.0 + '@parcel/watcher-freebsd-x64': 2.5.0 + '@parcel/watcher-linux-arm-glibc': 2.5.0 + '@parcel/watcher-linux-arm-musl': 2.5.0 + '@parcel/watcher-linux-arm64-glibc': 2.5.0 + '@parcel/watcher-linux-arm64-musl': 2.5.0 + '@parcel/watcher-linux-x64-glibc': 2.5.0 + '@parcel/watcher-linux-x64-musl': 2.5.0 + '@parcel/watcher-win32-arm64': 2.5.0 + '@parcel/watcher-win32-ia32': 2.5.0 + '@parcel/watcher-win32-x64': 2.5.0 + optional: true + '@pkgr/core@0.1.1': {} '@polka/url@1.0.0-next.28': {} @@ -3873,9 +4080,9 @@ snapshots: '@typescript-eslint/types': 8.18.0 eslint-visitor-keys: 4.2.0 - '@vitejs/plugin-vue@5.2.1(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2))': + '@vitejs/plugin-vue@5.2.1(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2))': dependencies: - vite: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1) + vite: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1) vue: 3.5.13(typescript@5.7.2) '@vue/babel-helper-vue-transform-on@1.2.5': {} @@ -3940,14 +4147,14 @@ snapshots: '@vue/devtools-api@6.6.4': {} - '@vue/devtools-core@7.6.8(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2))': + '@vue/devtools-core@7.6.8(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2))': dependencies: '@vue/devtools-kit': 7.6.8 '@vue/devtools-shared': 7.6.8 mitt: 3.0.1 nanoid: 5.0.9 pathe: 1.1.2 - vite-hot-client: 0.2.4(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1)) + vite-hot-client: 0.2.4(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1)) vue: 3.5.13(typescript@5.7.2) transitivePeerDependencies: - vite @@ -4323,6 +4530,9 @@ snapshots: destr@2.0.3: {} + detect-libc@1.0.3: + optional: true + dir-glob@3.0.1: dependencies: path-type: 4.0.0 @@ -4953,6 +5163,8 @@ snapshots: ignore@6.0.2: {} + immutable@5.0.3: {} + import-fresh@3.3.0: dependencies: parent-module: 1.0.1 @@ -5293,6 +5505,11 @@ snapshots: natural-compare@1.4.0: {} + neo-async@2.6.2: {} + + node-addon-api@7.1.1: + optional: true + node-fetch-native@1.6.4: {} node-releases@2.0.19: {} @@ -5475,6 +5692,8 @@ snapshots: postcss: 8.4.49 postcss-safe-parser: 6.0.0(postcss@8.4.49) + postcss-media-query-parser@0.2.3: {} + postcss-resolve-nested-selector@0.1.6: {} postcss-safe-parser@6.0.0(postcss@8.4.49): @@ -5620,6 +5839,20 @@ snapshots: es-errors: 1.3.0 is-regex: 1.2.1 + sass-loader@16.0.4(sass@1.83.0): + dependencies: + neo-async: 2.6.2 + optionalDependencies: + sass: 1.83.0 + + sass@1.83.0: + dependencies: + chokidar: 4.0.1 + immutable: 5.0.3 + source-map-js: 1.2.1 + optionalDependencies: + '@parcel/watcher': 2.5.0 + sax@1.4.1: {} scule@1.3.0: {} @@ -5829,6 +6062,18 @@ snapshots: prettier-linter-helpers: 1.0.0 stylelint: 16.11.0(typescript@5.7.2) + stylelint-scss@6.10.0(stylelint@16.11.0(typescript@5.7.2)): + dependencies: + css-tree: 3.1.0 + is-plain-object: 5.0.0 + known-css-properties: 0.35.0 + mdn-data: 2.12.2 + postcss-media-query-parser: 0.2.3 + postcss-resolve-nested-selector: 0.1.6 + postcss-selector-parser: 7.0.0 + postcss-value-parser: 4.2.0 + stylelint: 16.11.0(typescript@5.7.2) + stylelint@16.11.0(typescript@5.7.2): dependencies: '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) @@ -6087,11 +6332,11 @@ snapshots: uuid@11.0.3: {} - vite-hot-client@0.2.4(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1)): + vite-hot-client@0.2.4(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1)): dependencies: - vite: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1) + vite: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1) - vite-plugin-inspect@0.8.9(rollup@4.28.1)(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1)): + vite-plugin-inspect@0.8.9(rollup@4.28.1)(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1)): dependencies: '@antfu/utils': 0.7.10 '@rollup/pluginutils': 5.1.3(rollup@4.28.1) @@ -6102,28 +6347,28 @@ snapshots: perfect-debounce: 1.0.0 picocolors: 1.1.1 sirv: 3.0.0 - vite: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1) + vite: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1) transitivePeerDependencies: - rollup - supports-color - vite-plugin-vue-devtools@7.6.8(rollup@4.28.1)(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2)): + vite-plugin-vue-devtools@7.6.8(rollup@4.28.1)(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2)): dependencies: - '@vue/devtools-core': 7.6.8(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2)) + '@vue/devtools-core': 7.6.8(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2)) '@vue/devtools-kit': 7.6.8 '@vue/devtools-shared': 7.6.8 execa: 9.5.2 sirv: 3.0.0 - vite: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1) - vite-plugin-inspect: 0.8.9(rollup@4.28.1)(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1)) - vite-plugin-vue-inspector: 5.3.1(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1)) + vite: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1) + vite-plugin-inspect: 0.8.9(rollup@4.28.1)(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1)) + vite-plugin-vue-inspector: 5.3.1(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1)) transitivePeerDependencies: - '@nuxt/kit' - rollup - supports-color - vue - vite-plugin-vue-inspector@5.3.1(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1)): + vite-plugin-vue-inspector@5.3.1(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1)): dependencies: '@babel/core': 7.26.0 '@babel/plugin-proposal-decorators': 7.25.9(@babel/core@7.26.0) @@ -6134,22 +6379,22 @@ snapshots: '@vue/compiler-dom': 3.5.13 kolorist: 1.8.0 magic-string: 0.30.15 - vite: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1) + vite: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1) transitivePeerDependencies: - supports-color - vite-plugin-vuetify@2.0.4(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2))(vuetify@3.7.5): + vite-plugin-vuetify@2.0.4(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2))(vuetify@3.7.5): dependencies: '@vuetify/loader-shared': 2.0.3(vue@3.5.13(typescript@5.7.2))(vuetify@3.7.5) debug: 4.4.0 upath: 2.0.1 - vite: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1) + vite: 6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1) vue: 3.5.13(typescript@5.7.2) vuetify: 3.7.5(typescript@5.7.2)(vite-plugin-vuetify@2.0.4)(vue@3.5.13(typescript@5.7.2)) transitivePeerDependencies: - supports-color - vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1): + vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1): dependencies: esbuild: 0.24.0 postcss: 8.4.49 @@ -6158,6 +6403,7 @@ snapshots: '@types/node': 22.10.2 fsevents: 2.3.3 jiti: 2.4.1 + sass: 1.83.0 yaml: 2.6.1 vue-demi@0.13.11(vue@3.5.13(typescript@5.7.2)): @@ -6216,7 +6462,7 @@ snapshots: vue: 3.5.13(typescript@5.7.2) optionalDependencies: typescript: 5.7.2 - vite-plugin-vuetify: 2.0.4(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2))(vuetify@3.7.5) + vite-plugin-vuetify: 2.0.4(vite@6.0.3(@types/node@22.10.2)(jiti@2.4.1)(sass@1.83.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.2))(vuetify@3.7.5) wcag-color@1.1.1: {} diff --git a/src/components/viewPost/tp-text.vue b/src/components/viewPost/tp-text.vue index 39355ded..a72facf7 100644 --- a/src/components/viewPost/tp-text.vue +++ b/src/components/viewPost/tp-text.vue @@ -6,7 +6,7 @@ :title="props.data.attributes?.link" :style="getTextStyle()" > - {{ props.data.insert }} + {{ decodeRegExp(props.data.insert) }} @@ -17,7 +17,7 @@ :data="emoji" :key="indexE" /> - {{ props.data.insert }} + {{ decodeRegExp(props.data.insert) }} - diff --git a/src/pages/User/Combat.vue b/src/pages/User/Combat.vue index 506e97e2..6182a5f7 100644 --- a/src/pages/User/Combat.vue +++ b/src/pages/User/Combat.vue @@ -75,7 +75,7 @@ 统计周期 {{ item.startTime }} ~ {{ item.endTime }} 使用角色({{ item.detail.backup_avatars.length }}名) - + 详情
{ } else uidCur.value = ""; await loadCombat(); await showLoading.end(); + console.log("UserCombat", localCombat.value); }); watch(() => uidCur.value, loadCombat); diff --git a/src/pages/common/PageAnno.vue b/src/pages/common/PageAnno.vue index ed617e60..1d838edd 100644 --- a/src/pages/common/PageAnno.vue +++ b/src/pages/common/PageAnno.vue @@ -60,13 +60,13 @@ import { useRouter } from "vue-router"; import { useAppStore } from "@/store/modules/app.js"; import TGLogger from "@/utils/TGLogger.js"; +import { decodeRegExp } from "@/utils/toolFunc.js"; import Hk4eApi, { type AnnoLang, AnnoServer } from "@/web/request/hk4eReq.js"; import { getAnnoCard } from "@/web/utils/getAnnoCard.js"; -import { decodeRegExp } from "@/web/utils/tools.js"; type AnnoSelect = { text: string; value: string }; type AnnoKey = keyof typeof AnnoType; -type AnnoCard = { [key in AnnoKey]: TGApp.App.Announcement.ListCard[] }; +type AnnoCard = { [key in AnnoKey]: Array }; const annoServerList: Array = [ { text: "国服-官方服", value: AnnoServer.CN_ISLAND }, diff --git a/src/utils/linkParser.ts b/src/utils/linkParser.ts index 902188f6..fd271dbf 100644 --- a/src/utils/linkParser.ts +++ b/src/utils/linkParser.ts @@ -1,7 +1,7 @@ /** * @file src/utils/linkParser.ts * @description 处理链接 - * @since Beta v0.6.5 + * @since Beta v0.6.7 */ import showDialog from "@comp/func/dialog.js"; @@ -11,7 +11,7 @@ import { emit } from "@tauri-apps/api/event"; import TGClient from "./TGClient.js"; import { createPost } from "./TGWindow.js"; -import { getGameId } from "@/web/utils/tools.js"; +import { getGameId } from "@/utils/toolFunc.js"; /** * @function parsePost diff --git a/src/utils/toolFunc.ts b/src/utils/toolFunc.ts index c145c1bc..b4c92c9d 100644 --- a/src/utils/toolFunc.ts +++ b/src/utils/toolFunc.ts @@ -11,6 +11,8 @@ import type { KEYWORD } from "color-convert/conversions.js"; import { v4 } from "uuid"; import { score } from "wcag-color"; +import TGConstant from "@/web/constant/TGConstant.js"; + /** * @description 时间戳转换为时间字符串 * @returns {string} 时间字符串 d天 hh:mm:ss @@ -250,3 +252,42 @@ export function getVideoDuration(durationMill: number): string { result += `${seconds.toString().padStart(2, "0")}`; return result; } + +/** + * @description 转义正则表达式 + * @since Beta v0.3.3 + * @param {string} data 内容 + * @returns {string} 转义后的内容 + */ +export function decodeRegExp(data: string): string { + let res = data; + if (res.length === 0) return res; + res = res.replace(/</g, "<"); + res = res.replace(/>/g, ">"); + res = res.replace(/ /g, " "); + res = res.replace(/'/g, "'"); + res = res.replace(/"/g, `"`); + res = res.replace(/'/g, "'"); + res = res.replace(/&/g, "&"); + return res; +} + +/** + * @description 根据 gid 获取游戏名称 + * @param {number} gid + * @returns {string} + */ +export function getGameName(gid: number): string { + const game = TGConstant.BBS.CHANNELS.find((item) => item.gid === gid.toString()); + return game ? game.title : "未知游戏"; +} + +/** + * @description 获取游戏id + * @param {string} mini + * @returns {string} + */ +export function getGameId(mini: string): string { + const game = TGConstant.BBS.CHANNELS.find((item) => item.mini === mini); + return game ? game.gid : "0"; +} diff --git a/src/web/utils/annoParser.ts b/src/web/utils/annoParser.ts index a9552b29..49b2cc24 100644 --- a/src/web/utils/annoParser.ts +++ b/src/web/utils/annoParser.ts @@ -1,13 +1,13 @@ /** * @file web/utils/annoParser.ts * @description 解析游戏内公告数据 - * @since Beta v0.6.0 + * @since Beta v0.6.7 */ import TpText from "@comp/viewPost/tp-text.vue"; import { h, render } from "vue"; -import { decodeRegExp } from "./tools.js"; +import { decodeRegExp } from "@/utils/toolFunc.js"; /** * @description 预处理p diff --git a/src/web/utils/tools.ts b/src/web/utils/tools.ts deleted file mode 100644 index 215a3cd1..00000000 --- a/src/web/utils/tools.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @file web/utils/tools.ts - * @description 应用用到的工具函数 - * @since Beta v0.6.3 - */ - -import TGConstant from "@/web/constant/TGConstant.js"; - -/** - * @description 转义正则表达式 - * @since Beta v0.3.3 - * @param {string} data 内容 - * @returns {string} 转义后的内容 - */ -export function decodeRegExp(data: string): string { - let res = data; - if (res.length === 0) return res; - res = res.replace(/</g, "<"); - res = res.replace(/>/g, ">"); - res = res.replace(/ /g, " "); - res = res.replace(/'/g, "'"); - - res = res.replace(/"/g, `"`); - res = res.replace(/'/g, "'"); - res = res.replace(/&/g, "&"); - return res; -} - -/** - * @description 根据 gid 获取游戏名称 - * @param {number} gid - * @returns {string} - */ -export function getGameName(gid: number): string { - const game = TGConstant.BBS.CHANNELS.find((item) => item.gid === gid.toString()); - return game ? game.title : "未知游戏"; -} - -/** - * @description 获取游戏id - * @param {string} mini - * @returns {string} - */ -export function getGameId(mini: string): string { - const game = TGConstant.BBS.CHANNELS.find((item) => item.mini === mini); - return game ? game.gid : "0"; -}