chore: use unplugin i18n

pull/2/head
xingyu 2022-12-19 15:28:59 +08:00
parent 46c93b637f
commit 5434be460c
4 changed files with 73 additions and 46 deletions

View File

@ -1,7 +1,6 @@
import { resolve } from 'path'
import Vue from '@vitejs/plugin-vue'
import VueJsx from '@vitejs/plugin-vue-jsx'
import VueI18n from '@intlify/vite-plugin-vue-i18n'
import WindiCSS from 'vite-plugin-windicss'
import progress from 'vite-plugin-progress'
import EslintPlugin from 'vite-plugin-eslint'
@ -9,6 +8,7 @@ import PurgeIcons from 'vite-plugin-purge-icons'
import { ViteEjsPlugin } from 'vite-plugin-ejs'
import viteCompression from 'vite-plugin-compression'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import {
createStyleImportPlugin,
@ -51,7 +51,7 @@ export function createVitePlugins(VITE_APP_TITLE: string) {
cache: false,
include: ['src/**/*.vue', 'src/**/*.ts', 'src/**/*.tsx'] // 检查的文件
}),
VueI18n({
VueI18nPlugin({
runtimeOnly: true,
compositionOnly: true,
include: [resolve(__dirname, 'src/locales/**')]

View File

@ -58,7 +58,7 @@
"@commitlint/cli": "^17.3.0",
"@commitlint/config-conventional": "^17.3.0",
"@iconify/json": "^2.1.153",
"@intlify/vite-plugin-vue-i18n": "^6.0.3",
"@intlify/unplugin-vue-i18n": "^0.8.1",
"@purge-icons/generated": "^0.9.0",
"@types/intro.js": "^5.1.0",
"@types/lodash-es": "^4.17.6",

View File

@ -5,7 +5,7 @@ specifiers:
'@commitlint/config-conventional': ^17.3.0
'@iconify/iconify': ^3.0.1
'@iconify/json': ^2.1.153
'@intlify/vite-plugin-vue-i18n': ^6.0.3
'@intlify/unplugin-vue-i18n': ^0.8.1
'@purge-icons/generated': ^0.9.0
'@types/intro.js': ^5.1.0
'@types/lodash-es': ^4.17.6
@ -117,7 +117,7 @@ devDependencies:
'@commitlint/cli': 17.3.0
'@commitlint/config-conventional': 17.3.0
'@iconify/json': 2.1.153
'@intlify/vite-plugin-vue-i18n': 6.0.3_vite@4.0.2+vue-i18n@9.2.2
'@intlify/unplugin-vue-i18n': 0.8.1_vue-i18n@9.2.2
'@purge-icons/generated': 0.9.0
'@types/intro.js': 5.1.0
'@types/lodash-es': 4.17.6
@ -681,7 +681,7 @@ packages:
engines: {node: '>= 14'}
dependencies:
'@intlify/shared': 9.2.2
source-map: registry.npmmirror.com/source-map/0.6.1
source-map: 0.6.1
/@intlify/message-compiler/9.3.0-beta.10:
resolution: {integrity: sha512-RoOC6yceOykLRhN0NlbkNOBUx1el6iphx3W8NfOx3jHVNtfT1FYokx14/5sU3F1F0uxeG4sp6q+ppKvaF8o+ww==}
@ -700,28 +700,33 @@ packages:
engines: {node: '>= 14'}
dev: true
/@intlify/vite-plugin-vue-i18n/6.0.3_vite@4.0.2+vue-i18n@9.2.2:
resolution: {integrity: sha512-6SgNzPAOCR90wvt368lKzi7f/5ZEWJn22UCGvhFsP3XvKqlF3cVzojahgQ6o+LTdCkExeM6wPgd+haFf28E9VQ==}
engines: {node: '>= 14.6'}
/@intlify/unplugin-vue-i18n/0.8.1_vue-i18n@9.2.2:
resolution: {integrity: sha512-BhigujPmP6JL1FSxmpogCaL+REozncHCVkJuUnefz4GWBu3X+pRe5O7PeJn8/g+Iml2ieQJz4ISPMmEbuGQjqQ==}
engines: {node: '>= 14.16'}
peerDependencies:
petite-vue-i18n: '*'
vite: ^2.9.0 || ^3.0.0
vue-i18n: '*'
vue-i18n-bridge: '*'
peerDependenciesMeta:
petite-vue-i18n:
optional: true
vite:
optional: true
vue-i18n:
optional: true
vue-i18n-bridge:
optional: true
dependencies:
'@intlify/bundle-utils': 3.4.0_vue-i18n@9.2.2
'@intlify/shared': 9.3.0-beta.10
'@rollup/pluginutils': 4.2.1
'@vue/compiler-sfc': 3.2.45
debug: 4.3.4
fast-glob: 3.2.12
js-yaml: 4.1.0
json5: 2.2.1
pathe: 1.0.0
picocolors: 1.0.0
source-map: 0.6.1
vite: 4.0.2_qllbiz65uv43o3e5m5uhyo643e
unplugin: 1.0.1
vue-i18n: 9.2.2_vue@3.2.45
transitivePeerDependencies:
- supports-color
@ -987,7 +992,7 @@ packages:
'@babel/parser': registry.npmmirror.com/@babel/parser/7.20.5
'@vue/shared': registry.npmmirror.com/@vue/shared/3.2.45
estree-walker: registry.npmmirror.com/estree-walker/2.0.2
source-map: registry.npmmirror.com/source-map/0.6.1
source-map: 0.6.1
/@vue/compiler-dom/3.2.45:
resolution: {integrity: sha512-tyYeUEuKqqZO137WrZkpwfPCdiiIeXYCcJ8L4gWz9vqaxzIQRccTSwSWZ/Axx5YR2z+LvpUbmPNXxuBU45lyRw==}
@ -1914,7 +1919,7 @@ packages:
engines: {node: '>=8.0.0'}
dependencies:
mdn-data: 2.0.14
source-map: registry.npmmirror.com/source-map/0.6.1
source-map: 0.6.1
dev: true
/css-what/6.1.0:
@ -3255,6 +3260,19 @@ packages:
resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
dev: true
/json5/1.0.1:
resolution: {integrity: sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==}
hasBin: true
dependencies:
minimist: 1.2.7
dev: true
/json5/2.2.1:
resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==}
engines: {node: '>=6'}
hasBin: true
dev: true
/jsonc-eslint-parser/1.4.1:
resolution: {integrity: sha512-hXBrvsR1rdjmB2kQmUjf1rEIa+TqHBGMge8pwi++C+Si1ad7EjZrJcpgwym+QGK/pqTx+K7keFAtLlVNdLRJOg==}
engines: {node: '>=8.10.0'}
@ -3263,7 +3281,7 @@ packages:
eslint-utils: 2.1.0
eslint-visitor-keys: 1.3.0
espree: 6.2.1
semver: registry.npmmirror.com/semver/6.3.0
semver: 6.3.0
dev: true
/jsonfile/6.1.0:
@ -3372,7 +3390,7 @@ packages:
dependencies:
big.js: 5.2.2
emojis-list: 3.0.0
json5: registry.npmmirror.com/json5/1.0.1
json5: 1.0.1
dev: true
/locate-path/5.0.0:
@ -3983,6 +4001,10 @@ packages:
resolution: {integrity: sha512-6Y6s0vT112P3jD8dGfuS6r+lpa0qqNrLyHPOwvXMnyNTQaYiwgau2DP3aNDsR13xqtGj7rrPo+jFUATpU6/s+g==}
dev: true
/pathe/1.0.0:
resolution: {integrity: sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==}
dev: true
/picocolors/1.0.0:
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
dev: true
@ -4414,6 +4436,11 @@ packages:
compute-scroll-into-view: 1.0.17
dev: false
/semver/6.3.0:
resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==}
hasBin: true
dev: true
/semver/7.3.8:
resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==}
engines: {node: '>=10'}
@ -4553,7 +4580,7 @@ packages:
define-property: 0.2.5
extend-shallow: 2.0.1
map-cache: 0.2.2
source-map: registry.npmmirror.com/source-map/0.5.7
source-map: 0.5.7
source-map-resolve: 0.5.3
use: 3.1.1
transitivePeerDependencies:
@ -4588,6 +4615,11 @@ packages:
deprecated: See https://github.com/lydell/source-map-url#deprecated
dev: true
/source-map/0.5.7:
resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==}
engines: {node: '>=0.10.0'}
dev: true
/source-map/0.6.1:
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
engines: {node: '>=0.10.0'}
@ -5046,6 +5078,15 @@ packages:
engines: {node: '>= 10.0.0'}
dev: true
/unplugin/1.0.1:
resolution: {integrity: sha512-aqrHaVBWW1JVKBHmGo33T5TxeL0qWzfvjWokObHA9bYmN7eNDkwOxmLjhioHl9878qDFMAaT51XNroRyuz7WxA==}
dependencies:
acorn: 8.8.1
chokidar: 3.5.3
webpack-sources: 3.2.3
webpack-virtual-modules: 0.5.0
dev: true
/unset-value/1.0.0:
resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==}
engines: {node: '>=0.10.0'}
@ -5349,6 +5390,15 @@ packages:
resolution: {integrity: sha512-D0MieGooOs8RpsrK+vnejXnvh4OOv/+lTFB35JRkJJQt+uOjPE08XpaE0QBLMTRu47B1KGT/Nq3Gbag3Orinzw==}
dev: false
/webpack-sources/3.2.3:
resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==}
engines: {node: '>=10.13.0'}
dev: true
/webpack-virtual-modules/0.5.0:
resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==}
dev: true
/which-module/2.0.0:
resolution: {integrity: sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==}
dev: false
@ -6264,7 +6314,7 @@ packages:
'@babel/parser': registry.npmmirror.com/@babel/parser/7.20.5
'@vue/shared': registry.npmmirror.com/@vue/shared/3.2.45
estree-walker: registry.npmmirror.com/estree-walker/2.0.2
source-map: registry.npmmirror.com/source-map/0.6.1
source-map: 0.6.1
registry.npmmirror.com/@vue/compiler-dom/3.2.45:
resolution: {integrity: sha512-tyYeUEuKqqZO137WrZkpwfPCdiiIeXYCcJ8L4gWz9vqaxzIQRccTSwSWZ/Axx5YR2z+LvpUbmPNXxuBU45lyRw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.2.45.tgz}
@ -6758,15 +6808,6 @@ packages:
hasBin: true
dev: true
registry.npmmirror.com/json5/1.0.1:
resolution: {integrity: sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/json5/-/json5-1.0.1.tgz}
name: json5
version: 1.0.1
hasBin: true
dependencies:
minimist: 1.2.7
dev: true
registry.npmmirror.com/json5/2.2.1:
resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz}
name: json5
@ -6926,7 +6967,7 @@ packages:
dependencies:
chalk: 1.1.3
js-base64: 2.6.4
source-map: registry.npmmirror.com/source-map/0.5.7
source-map: 0.5.7
supports-color: registry.npmmirror.com/supports-color/3.2.3
dev: true
@ -7012,19 +7053,6 @@ packages:
version: 1.0.2
engines: {node: '>=0.10.0'}
registry.npmmirror.com/source-map/0.5.7:
resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/source-map/-/source-map-0.5.7.tgz}
name: source-map
version: 0.5.7
engines: {node: '>=0.10.0'}
dev: true
registry.npmmirror.com/source-map/0.6.1:
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz}
name: source-map
version: 0.6.1
engines: {node: '>=0.10.0'}
registry.npmmirror.com/supports-color/2.0.0:
resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/supports-color/-/supports-color-2.0.0.tgz}
name: supports-color
@ -7142,7 +7170,7 @@ packages:
dependencies:
browserslist: registry.npmmirror.com/browserslist/4.21.4
escalade: registry.npmmirror.com/escalade/3.1.1
picocolors: registry.npmmirror.com/picocolors/1.0.0
picocolors: 1.0.0
dev: true
registry.npmmirror.com/vite-plugin-purge-icons/0.9.2_vite@4.0.2:

View File

@ -95,10 +95,9 @@ const handleProcessClick = (
message
.confirm('确认标记为' + type + '?', t('common.reminder'))
.then(async () => {
ApiErrorLogApi.updateApiErrorLogPageApi(row.id, processSttatus).then(() => {
await ApiErrorLogApi.updateApiErrorLogPageApi(row.id, processSttatus)
message.success(t('common.updateSuccess'))
})
})
.finally(async () => {
//
await getList(xGrid)