chore: update

This commit is contained in:
xiaoxian521 2022-07-18 16:07:03 +08:00
parent a73610672f
commit af71024f42
15 changed files with 2023 additions and 4590 deletions

View File

@ -60,6 +60,7 @@ jobs:
run: | run: |
pnpm install pnpm install
pnpm lint pnpm lint
pnpm typecheck
env: env:
VALIDATE_ALL_CODEBASE: false VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main DEFAULT_BRANCH: main

1
.gitignore vendored
View File

@ -17,3 +17,4 @@ tests/**/coverage/
*.ntvs* *.ntvs*
*.njsproj *.njsproj
*.sln *.sln
tsconfig.tsbuildinfo

View File

@ -10,6 +10,7 @@
"report": "rimraf dist && cross-env vite build", "report": "rimraf dist && cross-env vite build",
"preview": "vite preview", "preview": "vite preview",
"preview:build": "pnpm build && vite preview", "preview:build": "pnpm build && vite preview",
"typecheck": "tsc --noEmit && vue-tsc --noEmit --skipLibCheck",
"cloc": "cross-env --max_old_space_size=4096 cloc . --exclude-dir=node_modules --exclude-lang=YAML", "cloc": "cross-env --max_old_space_size=4096 cloc . --exclude-dir=node_modules --exclude-lang=YAML",
"clean:cache": "rm -rf node_modules && rm -rf .eslintcache && pnpm install", "clean:cache": "rm -rf node_modules && rm -rf .eslintcache && pnpm install",
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix", "lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
@ -29,17 +30,17 @@
"dependencies": { "dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1", "@amap/amap-jsapi-loader": "^1.0.1",
"@ctrl/tinycolor": "^3.4.1", "@ctrl/tinycolor": "^3.4.1",
"@logicflow/core": "^1.1.16", "@logicflow/core": "^1.1.22",
"@logicflow/extension": "^1.1.16", "@logicflow/extension": "^1.1.22",
"@pureadmin/components": "^1.0.6", "@pureadmin/components": "^1.0.6",
"@pureadmin/descriptions": "^1.1.0", "@pureadmin/descriptions": "^1.1.0",
"@pureadmin/table": "^1.2.0", "@pureadmin/table": "^1.2.0",
"@pureadmin/utils": "^0.0.31", "@pureadmin/utils": "^0.0.32",
"@vueuse/core": "^8.7.4", "@vueuse/core": "^8.9.4",
"@vueuse/motion": "^2.0.0-beta.12", "@vueuse/motion": "^2.0.0-beta.12",
"@vueuse/shared": "^8.7.4", "@vueuse/shared": "^8.9.4",
"@wangeditor/editor": "^5.0.1", "@wangeditor/editor": "^5.1.10",
"@wangeditor/editor-for-vue": "^5.1.10", "@wangeditor/editor-for-vue": "^5.1.12",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"axios": "^0.27.2", "axios": "^0.27.2",
"china-area-data": "^5.0.1", "china-area-data": "^5.0.1",
@ -48,7 +49,7 @@
"dayjs": "^1.11.3", "dayjs": "^1.11.3",
"driver.js": "^0.9.8", "driver.js": "^0.9.8",
"echarts": "^5.3.3", "echarts": "^5.3.3",
"element-plus": "^2.2.8", "element-plus": "^2.2.9",
"element-resize-detector": "^1.2.3", "element-resize-detector": "^1.2.3",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"jsbarcode": "^3.11.5", "jsbarcode": "^3.11.5",
@ -59,7 +60,7 @@
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"path": "^0.12.7", "path": "^0.12.7",
"pinia": "^2.0.14", "pinia": "^2.0.16",
"qrcode": "^1.5.0", "qrcode": "^1.5.0",
"qs": "^6.10.1", "qs": "^6.10.1",
"resize-observer-polyfill": "^1.5.1", "resize-observer-polyfill": "^1.5.1",
@ -69,10 +70,10 @@
"v-contextmenu": "3.0.0", "v-contextmenu": "3.0.0",
"vue": "^3.2.37", "vue": "^3.2.37",
"vue-form-create2": "^1.2.8", "vue-form-create2": "^1.2.8",
"vue-i18n": "^9.2.0-beta.36", "vue-i18n": "^9.2.0-beta.39",
"vue-json-pretty": "^2.0.2", "vue-json-pretty": "^2.0.2",
"vue-pdf-embed": "^1.1.4", "vue-pdf-embed": "^1.1.4",
"vue-router": "^4.0.15", "vue-router": "^4.1.2",
"vue-types": "^4.1.1", "vue-types": "^4.1.1",
"vue-virtual-scroller": "^2.0.0-alpha.1", "vue-virtual-scroller": "^2.0.0-alpha.1",
"vuedraggable": "4.1.0", "vuedraggable": "4.1.0",
@ -94,7 +95,7 @@
"@iconify-icons/ri": "^1.2.1", "@iconify-icons/ri": "^1.2.1",
"@iconify-icons/uil": "^1.2.1", "@iconify-icons/uil": "^1.2.1",
"@iconify/vue": "^3.2.1", "@iconify/vue": "^3.2.1",
"@intlify/vite-plugin-vue-i18n": "^3.4.0", "@intlify/vite-plugin-vue-i18n": "^5.0.0",
"@pureadmin/theme": "^2.4.0", "@pureadmin/theme": "^2.4.0",
"@types/element-resize-detector": "1.1.3", "@types/element-resize-detector": "1.1.3",
"@types/js-cookie": "^3.0.1", "@types/js-cookie": "^3.0.1",
@ -107,14 +108,14 @@
"@types/qs": "^6.9.7", "@types/qs": "^6.9.7",
"@typescript-eslint/eslint-plugin": "^5.10.2", "@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2", "@typescript-eslint/parser": "^5.10.2",
"@vitejs/plugin-legacy": "^1.8.2", "@vitejs/plugin-legacy": "^2.0.0",
"@vitejs/plugin-vue": "^2.3.3", "@vitejs/plugin-vue": "^3.0.1",
"@vitejs/plugin-vue-jsx": "^1.3.10", "@vitejs/plugin-vue-jsx": "^2.0.0",
"@vue/eslint-config-prettier": "^7.0.0", "@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^10.0.0", "@vue/eslint-config-typescript": "^10.0.0",
"@vue/runtime-core": "^3.2.37", "@vue/runtime-core": "^3.2.37",
"autoprefixer": "^10.4.5", "autoprefixer": "^10.4.5",
"cloc": "^2.9.0", "cloc": "^2.10.0",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"eslint": "^8.8.0", "eslint": "^8.8.0",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^4.0.0",
@ -130,7 +131,6 @@
"prettier": "^2.5.1", "prettier": "^2.5.1",
"pretty-quick": "3.1.1", "pretty-quick": "3.1.1",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"rollup": "^2.70.1",
"rollup-plugin-visualizer": "^5.6.0", "rollup-plugin-visualizer": "^5.6.0",
"sass": "^1.51.0", "sass": "^1.51.0",
"stylelint": "^14.3.0", "stylelint": "^14.3.0",
@ -140,13 +140,22 @@
"stylelint-config-standard": "^24.0.0", "stylelint-config-standard": "^24.0.0",
"stylelint-order": "^5.0.0", "stylelint-order": "^5.0.0",
"typescript": "^4.6.3", "typescript": "^4.6.3",
"unocss": "^0.39.3", "unocss": "^0.44.3",
"unplugin-vue-define-options": "^0.6.1", "unplugin-vue-define-options": "^0.6.1",
"vite": "^2.9.13", "vite": "^3.0.1",
"vite-plugin-mock": "^2.9.6", "vite-plugin-mock": "^2.9.6",
"vite-plugin-remove-console": "^1.1.0", "vite-plugin-remove-console": "^1.1.0",
"vite-svg-loader": "^3.3.0", "vite-svg-loader": "^3.4.0",
"vue-eslint-parser": "^8.2.0" "vue-eslint-parser": "^8.2.0",
"vue-tsc": "^0.38.8"
},
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"rollup",
"terser"
]
}
}, },
"repository": "git@github.com:xiaoxian521/vue-pure-admin.git", "repository": "git@github.com:xiaoxian521/vue-pure-admin.git",
"author": "xiaoxian521", "author": "xiaoxian521",

6518
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -167,6 +167,7 @@ let autoPlay = computed(() => {
let scrollSwitch = computed(() => { let scrollSwitch = computed(() => {
// props . // props .
// @ts-expect-error
return props.data.length >= unref(options).limitMoveNum; return props.data.length >= unref(options).limitMoveNum;
}); });

View File

@ -5,7 +5,7 @@ import { emitter } from "/@/utils/mitt";
let show = ref<Boolean>(false); let show = ref<Boolean>(false);
const target = ref(null); const target = ref(null);
onClickOutside(target, event => { onClickOutside(target, (event: any) => {
if (event.clientX > target.value.offsetLeft) return; if (event.clientX > target.value.offsetLeft) return;
show.value = false; show.value = false;
}); });

View File

@ -9,8 +9,8 @@ import { useRoute, useRouter, RouteLocationMatched } from "vue-router";
const route = useRoute(); const route = useRoute();
const levelList = ref([]); const levelList = ref([]);
const router = useRouter(); const router = useRouter();
const routes = router.options.routes; const routes: any = router.options.routes;
const multiTags = useMultiTagsStoreHook().multiTags; const multiTags: any = useMultiTagsStoreHook().multiTags;
const isDashboard = (route: RouteLocationMatched): boolean | string => { const isDashboard = (route: RouteLocationMatched): boolean | string => {
const name = route && (route.name as string); const name = route && (route.name as string);

View File

@ -289,6 +289,7 @@ function dynamicRouteTag(value: string, parentPath: string): void {
}); });
} }
} }
// @ts-expect-error
concatPath(router.options.routes, value, parentPath); concatPath(router.options.routes, value, parentPath);
} }

View File

@ -1,6 +1,8 @@
import { createProdMockServer } from "vite-plugin-mock/es/createProdMockServer"; import { createProdMockServer } from "vite-plugin-mock/es/createProdMockServer";
const modules = import.meta.globEager("../mock/*.ts"); const modules: Record<string, any> = import.meta.glob("../mock/*.ts", {
eager: true
});
const mockModules = []; const mockModules = [];
Object.keys(modules).forEach(key => { Object.keys(modules).forEach(key => {

View File

@ -10,12 +10,12 @@ import zhLocale from "element-plus/lib/locale/lang/zh-cn";
function siphonI18n(prefix = "zh-CN") { function siphonI18n(prefix = "zh-CN") {
return Object.fromEntries( return Object.fromEntries(
Object.entries(import.meta.globEager("../../locales/*.y(a)?ml")).map( Object.entries(
([key, value]) => { import.meta.glob("../../locales/*.y(a)?ml", { eager: true })
const matched = key.match(/([A-Za-z0-9-_]+)\./i)[1]; ).map(([key, value]: any) => {
return [matched, value.default]; const matched = key.match(/([A-Za-z0-9-_]+)\./i)[1];
} return [matched, value.default];
) })
)[prefix]; )[prefix];
} }

View File

@ -81,6 +81,7 @@ export const remainingPaths = Object.keys(remainingRouter).map(v => {
// 创建路由实例 // 创建路由实例
export const router: Router = createRouter({ export const router: Router = createRouter({
history: getHistoryMode(), history: getHistoryMode(),
// @ts-expect-error
routes: constantRoutes.concat(...remainingRouter), routes: constantRoutes.concat(...remainingRouter),
strict: true, strict: true,
scrollBehavior(to, from, savedPosition) { scrollBehavior(to, from, savedPosition) {
@ -150,7 +151,7 @@ router.beforeEach((to: toRouteType, _from, next) => {
}; };
// 未开启标签页缓存,刷新页面重定向到顶级路由(参考标签页操作例子,只针对静态路由) // 未开启标签页缓存,刷新页面重定向到顶级路由(参考标签页操作例子,只针对静态路由)
if (to.meta?.refreshRedirect) { if (to.meta?.refreshRedirect) {
const routes = router.options.routes; const routes: any = router.options.routes;
const { refreshRedirect } = to.meta; const { refreshRedirect } = to.meta;
const { name, meta } = findRouteByPath(refreshRedirect, routes); const { name, meta } = findRouteByPath(refreshRedirect, routes);
handTag( handTag(
@ -165,7 +166,7 @@ router.beforeEach((to: toRouteType, _from, next) => {
const index = findIndex(remainingRouter, v => { const index = findIndex(remainingRouter, v => {
return v.path == path; return v.path == path;
}); });
const routes = const routes: any =
index === -1 index === -1
? router.options.routes[0].children ? router.options.routes[0].children
: router.options.routes; : router.options.routes;

View File

@ -172,9 +172,9 @@ function onEdit(row?: onEditNRow) {
} }
// //
const { clipboardRef } = useCopyToClipboard(); const { clipboardValue } = useCopyToClipboard();
const cellDBLClickEvent: VxeTableEvents.CellDblclick = ({ row }) => { const cellDBLClickEvent: VxeTableEvents.CellDblclick = ({ row }) => {
clipboardRef.value = unref(row).model; clipboardValue.value = unref(row).model;
}; };
const xTable = ref({} as VxeTableInstance); const xTable = ref({} as VxeTableInstance);

View File

@ -38,9 +38,8 @@ function onCloseTags() {
getNodeByUniqueId(treeData.value, uniqueId).path; getNodeByUniqueId(treeData.value, uniqueId).path;
useMultiTagsStoreHook().handleTags("splice", currentPath); useMultiTagsStoreHook().handleTags("splice", currentPath);
if (currentPath === "/tabs/index") if (currentPath === "/tabs/index")
router.push({ // @ts-expect-error
path: multiTags.value[multiTags.value.length - 1].path router.push({ path: multiTags.value[multiTags.value.length - 1].path });
});
}); });
} }
</script> </script>

View File

@ -12,6 +12,7 @@ setOptions(
}, },
legend: { legend: {
orient: "vertical", orient: "vertical",
// @ts-expect-error
right: true right: true
}, },
series: [ series: [

View File

@ -61,12 +61,11 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
}, },
plugins: getPluginsList(command, VITE_LEGACY), plugins: getPluginsList(command, VITE_LEGACY),
optimizeDeps: { optimizeDeps: {
include: ["pinia", "vue-i18n", "lodash-es", "@vueuse/core"], include: ["pinia", "vue-i18n", "lodash-es", "@vueuse/core", "dayjs"],
exclude: ["@pureadmin/theme/dist/browser-utils"] exclude: ["@pureadmin/theme/dist/browser-utils"]
}, },
build: { build: {
sourcemap: false, sourcemap: false,
brotliSize: false,
// 消除打包大小超过500kb警告 // 消除打包大小超过500kb警告
chunkSizeWarningLimit: 4000 chunkSizeWarningLimit: 4000
}, },