Merge branch 'main' into gitee

This commit is contained in:
xiaoxian521 2023-03-30 12:25:53 +08:00
commit 013ae275de
20 changed files with 1298 additions and 591 deletions

View File

@ -58,7 +58,7 @@ jobs:
- name: Build - name: Build
run: | run: |
pnpm install pnpm install --no-frozen-lockfile
pnpm lint pnpm lint
pnpm typecheck pnpm typecheck
env: env:

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2023 啝裳 Copyright (c) 2023 pure-admin
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -32,10 +32,10 @@
"@howdyjs/mouse-menu": "^2.0.5", "@howdyjs/mouse-menu": "^2.0.5",
"@logicflow/core": "^1.1.30", "@logicflow/core": "^1.1.30",
"@logicflow/extension": "^1.1.30", "@logicflow/extension": "^1.1.30",
"@pureadmin/descriptions": "^1.1.0", "@pureadmin/descriptions": "^1.1.1",
"@pureadmin/table": "^2.0.0", "@pureadmin/table": "^2.0.0",
"@pureadmin/utils": "^1.8.5", "@pureadmin/utils": "^1.8.5",
"@vueuse/core": "^9.12.0", "@vueuse/core": "^9.13.0",
"@vueuse/motion": "2.0.0-beta.12", "@vueuse/motion": "2.0.0-beta.12",
"@wangeditor/editor": "^5.1.21", "@wangeditor/editor": "^5.1.21",
"@wangeditor/editor-for-vue": "^5.1.12", "@wangeditor/editor-for-vue": "^5.1.12",
@ -44,9 +44,9 @@
"china-area-data": "^5.0.1", "china-area-data": "^5.0.1",
"cropperjs": "^1.5.12", "cropperjs": "^1.5.12",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"echarts": "^5.4.1", "echarts": "^5.4.2",
"el-table-infinite-scroll": "^3.0.1", "el-table-infinite-scroll": "^3.0.1",
"element-plus": "^2.2.30", "element-plus": "^2.3.1",
"element-resize-detector": "^1.2.4", "element-resize-detector": "^1.2.4",
"intro.js": "^6.0.0", "intro.js": "^6.0.0",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
@ -56,20 +56,20 @@
"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.30", "pinia": "^2.0.33",
"qrcode": "^1.5.1", "qrcode": "^1.5.1",
"qs": "^6.11.0", "qs": "^6.11.0",
"responsive-storage": "^2.1.0", "responsive-storage": "^2.2.0",
"sortablejs": "^1.15.0", "sortablejs": "^1.15.0",
"swiper": "^9.0.3", "swiper": "^9.1.0",
"typeit": "^8.7.1", "typeit": "^8.7.1",
"v-contextmenu": "3.0.0", "v-contextmenu": "3.0.0",
"vue": "^3.2.45", "vue": "^3.2.47",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
"vue-json-pretty": "^2.2.3", "vue-json-pretty": "^2.2.3",
"vue-pdf-embed": "^1.1.5", "vue-pdf-embed": "^1.1.5",
"vue-router": "^4.1.6", "vue-router": "^4.1.6",
"vue-types": "^4.2.1", "vue-types": "^5.0.2",
"vue-virtual-scroller": "2.0.0-beta.7", "vue-virtual-scroller": "2.0.0-beta.7",
"vue3-danmaku": "^1.2.0", "vue3-danmaku": "^1.2.0",
"vuedraggable": "^4.1.0", "vuedraggable": "^4.1.0",
@ -82,7 +82,7 @@
"@iconify-icons/ep": "^1.2.10", "@iconify-icons/ep": "^1.2.10",
"@iconify-icons/ri": "^1.2.4", "@iconify-icons/ri": "^1.2.4",
"@iconify/vue": "^4.0.2", "@iconify/vue": "^4.0.2",
"@intlify/unplugin-vue-i18n": "^0.8.1", "@intlify/unplugin-vue-i18n": "^0.10.0",
"@pureadmin/theme": "^3.0.0", "@pureadmin/theme": "^3.0.0",
"@types/element-resize-detector": "1.1.3", "@types/element-resize-detector": "1.1.3",
"@types/intro.js": "^5.1.0", "@types/intro.js": "^5.1.0",
@ -95,13 +95,13 @@
"@types/sortablejs": "^1.15.0", "@types/sortablejs": "^1.15.0",
"@typescript-eslint/eslint-plugin": "^5.43.0", "@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0", "@typescript-eslint/parser": "^5.43.0",
"@vitejs/plugin-vue": "^4.0.0", "@vitejs/plugin-vue": "^4.1.0",
"@vitejs/plugin-vue-jsx": "^3.0.0", "@vitejs/plugin-vue-jsx": "^3.0.1",
"@vue/eslint-config-prettier": "^7.0.0", "@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^11.0.2", "@vue/eslint-config-typescript": "^11.0.2",
"autoprefixer": "^10.4.13", "autoprefixer": "^10.4.14",
"cloc": "^2.11.0", "cloc": "^2.11.0",
"cssnano": "^5.1.14", "cssnano": "^6.0.0",
"eslint": "^8.8.0", "eslint": "^8.8.0",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^9.7.0", "eslint-plugin-vue": "^9.7.0",
@ -114,10 +114,10 @@
"postcss-scss": "^4.0.6", "postcss-scss": "^4.0.6",
"prettier": "^2.5.1", "prettier": "^2.5.1",
"pretty-quick": "3.1.1", "pretty-quick": "3.1.1",
"rimraf": "3.0.2", "rimraf": "^4.4.1",
"rollup-plugin-visualizer": "^5.9.0", "rollup-plugin-visualizer": "^5.9.0",
"sass": "^1.57.1", "sass": "^1.60.0",
"sass-loader": "^13.2.0", "sass-loader": "^13.2.2",
"stylelint": "^14.3.0", "stylelint": "^14.3.0",
"stylelint-config-html": "^1.0.0", "stylelint-config-html": "^1.0.0",
"stylelint-config-prettier": "^9.0.3", "stylelint-config-prettier": "^9.0.3",
@ -125,18 +125,18 @@
"stylelint-config-standard": "^29.0.0", "stylelint-config-standard": "^29.0.0",
"stylelint-order": "^5.0.0", "stylelint-order": "^5.0.0",
"svgo": "^3.0.2", "svgo": "^3.0.2",
"tailwindcss": "^3.2.4", "tailwindcss": "^3.2.7",
"terser": "^5.16.1", "terser": "^5.16.8",
"typescript": "^4.9.4", "typescript": "^5.0.2",
"unplugin-vue-define-options": "^1.0.0", "unplugin-vue-define-options": "^1.0.0",
"vite": "^4.1.1", "vite": "^4.2.1",
"vite-plugin-cdn-import": "^0.3.5", "vite-plugin-cdn-import": "^0.3.5",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-mock": "^2.9.6", "vite-plugin-mock": "^2.9.6",
"vite-plugin-remove-console": "^1.3.0", "vite-plugin-remove-console": "^2.1.0",
"vite-svg-loader": "^4.0.0", "vite-svg-loader": "^4.0.0",
"vue-eslint-parser": "^9.1.0", "vue-eslint-parser": "^9.1.0",
"vue-tsc": "^1.0.22" "vue-tsc": "^1.2.0"
}, },
"pnpm": { "pnpm": {
"peerDependencyRules": { "peerDependencyRules": {

1733
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
import { PropType } from "vue"; import { PropType } from "vue";
import { propTypes } from "@/utils/propTypes"; import propTypes from "@/utils/propTypes";
export const countToProps = { export const countToProps = {
startVal: propTypes.number.def(0), startVal: propTypes.number.def(0),
endVal: propTypes.number.def(2020), endVal: propTypes.number.def(2020),

View File

@ -1,5 +1,5 @@
import { PropType } from "vue"; import { PropType } from "vue";
import { propTypes } from "@/utils/propTypes"; import propTypes from "@/utils/propTypes";
export const reboundProps = { export const reboundProps = {
delay: propTypes.number.def(1), delay: propTypes.number.def(1),
blur: propTypes.number.def(2), blur: propTypes.number.def(2),

View File

@ -1,5 +1,5 @@
import { defineComponent, ref } from "vue"; import { defineComponent, ref } from "vue";
import { propTypes } from "@/utils/propTypes"; import propTypes from "@/utils/propTypes";
import "./filpper.css"; import "./filpper.css";
const props = { const props = {

View File

@ -8,7 +8,7 @@ import {
defineComponent defineComponent
} from "vue"; } from "vue";
import "./index.scss"; import "./index.scss";
import { propTypes } from "@/utils/propTypes"; import propTypes from "@/utils/propTypes";
import { isString, cloneDeep } from "@pureadmin/utils"; import { isString, cloneDeep } from "@pureadmin/utils";
import QRCode, { QRCodeRenderersOptions } from "qrcode"; import QRCode, { QRCodeRenderersOptions } from "qrcode";
import RefreshRight from "@iconify-icons/ep/refresh-right"; import RefreshRight from "@iconify-icons/ep/refresh-right";

View File

@ -27,6 +27,10 @@ const menuData = computed(() => {
: usePermissionStoreHook().wholeMenus; : usePermissionStoreHook().wholeMenus;
}); });
const loading = computed(() =>
pureApp.layout === "mix" ? false : menuData.value.length === 0 ? true : false
);
function getSubMenuData(path: string) { function getSubMenuData(path: string) {
// path // path
const parentPathArr = getParentPaths( const parentPathArr = getParentPaths(
@ -61,7 +65,7 @@ watch(
<template> <template>
<div <div
v-loading="menuData.length === 0" v-loading="loading"
:class="['sidebar-container', showLogo ? 'has-logo' : '']" :class="['sidebar-container', showLogo ? 'has-logo' : '']"
> >
<Logo v-if="showLogo" :collapse="isCollapse" /> <Logo v-if="showLogo" :collapse="isCollapse" />

View File

@ -139,7 +139,7 @@ router.beforeEach((to: toRouteType, _from, next) => {
if ( if (
usePermissionStoreHook().wholeMenus.length === 0 && usePermissionStoreHook().wholeMenus.length === 0 &&
to.path !== "/login" to.path !== "/login"
) ) {
initRouter().then((router: Router) => { initRouter().then((router: Router) => {
if (!useMultiTagsStoreHook().getMultiTagsCache) { if (!useMultiTagsStoreHook().getMultiTagsCache) {
const { path } = to; const { path } = to;
@ -158,6 +158,7 @@ router.beforeEach((to: toRouteType, _from, next) => {
} }
router.push(to.fullPath); router.push(to.fullPath);
}); });
}
toCorrectRoute(); toCorrectRoute();
} }
} else { } else {

View File

@ -367,6 +367,7 @@ export {
ascending, ascending,
filterTree, filterTree,
initRouter, initRouter,
addPathMatch,
isOneOfArray, isOneOfArray,
getHistoryMode, getHistoryMode,
addAsyncRoutes, addAsyncRoutes,

View File

@ -23,11 +23,11 @@ export const useAppStore = defineStore({
sortSwap: false sortSwap: false
}), }),
getters: { getters: {
getSidebarStatus() { getSidebarStatus(state) {
return this.sidebar.opened; return state.sidebar.opened;
}, },
getDevice() { getDevice(state) {
return this.device; return state.device;
} }
}, },
actions: { actions: {

View File

@ -14,14 +14,14 @@ export const useEpThemeStore = defineStore({
getConfig().Theme getConfig().Theme
}), }),
getters: { getters: {
getEpThemeColor() { getEpThemeColor(state) {
return this.epThemeColor; return state.epThemeColor;
}, },
/** 用于mix导航模式下hamburger-svg的fill属性 */ /** 用于mix导航模式下hamburger-svg的fill属性 */
fill() { fill(state) {
if (this.epTheme === "light") { if (state.epTheme === "light") {
return "#409eff"; return "#409eff";
} else if (this.epTheme === "yellow") { } else if (state.epTheme === "yellow") {
return "#d25f00"; return "#d25f00";
} else { } else {
return "#fff"; return "#fff";

View File

@ -17,8 +17,8 @@ export const useMultiTagsStore = defineStore({
)?.multiTagsCache )?.multiTagsCache
}), }),
getters: { getters: {
getMultiTagsCache() { getMultiTagsCache(state) {
return this.multiTagsCache; return state.multiTagsCache;
} }
}, },
actions: { actions: {

View File

@ -11,20 +11,19 @@ export const useSettingStore = defineStore({
hiddenSideBar: getConfig().HiddenSideBar hiddenSideBar: getConfig().HiddenSideBar
}), }),
getters: { getters: {
getTitle() { getTitle(state) {
return this.title; return state.title;
}, },
getFixedHeader() { getFixedHeader(state) {
return this.fixedHeader; return state.fixedHeader;
}, },
getHiddenSideBar() { getHiddenSideBar(state) {
return this.HiddenSideBar; return state.hiddenSideBar;
} }
}, },
actions: { actions: {
CHANGE_SETTING({ key, value }) { CHANGE_SETTING({ key, value }) {
// eslint-disable-next-line no-prototype-builtins if (Reflect.has(this, key)) {
if (this.hasOwnProperty(key)) {
this[key] = value; this[key] = value;
} }
}, },

View File

@ -1,5 +1,10 @@
import { CSSProperties, VNodeChild } from "vue"; import type { CSSProperties, VNodeChild } from "vue";
import { createTypes, VueTypeValidableDef, VueTypesInterface } from "vue-types"; import {
createTypes,
toValidableType,
VueTypesInterface,
VueTypeValidableDef
} from "vue-types";
export type VueNode = VNodeChild | JSX.Element; export type VueNode = VNodeChild | JSX.Element;
@ -8,7 +13,7 @@ type PropTypes = VueTypesInterface & {
readonly VNodeChild: VueTypeValidableDef<VueNode>; readonly VNodeChild: VueTypeValidableDef<VueNode>;
}; };
const propTypes = createTypes({ const newPropTypes = createTypes({
func: undefined, func: undefined,
bool: undefined, bool: undefined,
string: undefined, string: undefined,
@ -17,18 +22,18 @@ const propTypes = createTypes({
integer: undefined integer: undefined
}) as PropTypes; }) as PropTypes;
propTypes.extend([ // 从 vue-types v5.0 开始extend()方法已经废弃当前已改为官方推荐的ES6+方法 https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#the-extend-method
{ export default class propTypes extends newPropTypes {
name: "style", // a native-like validator that supports the `.validable` method
getter: true, static get style() {
type: [String, Object], return toValidableType("style", {
default: undefined type: [String, Object]
}, });
{
name: "VNodeChild",
getter: true,
type: undefined
} }
]);
export { propTypes }; static get VNodeChild() {
return toValidableType("VNodeChild", {
type: undefined
});
}
}

View File

@ -37,7 +37,7 @@ const columns: TableColumnList = [
:data="tableData" :data="tableData"
:columns="columns" :columns="columns"
highlight-current-row highlight-current-row
@current-change="handleCurrentChange" @page-current-change="handleCurrentChange"
/> />
<div style="margin-top: 20px"> <div style="margin-top: 20px">
<el-button @click="setCurrent(tableData[1])">Select second row</el-button> <el-button @click="setCurrent(tableData[1])">Select second row</el-button>

View File

@ -66,8 +66,8 @@ const {
" "
:columns="columns" :columns="columns"
:pagination="pagination" :pagination="pagination"
@size-change="onSizeChange" @page-size-change="onSizeChange"
@current-change="onCurrentChange" @page-current-change="onCurrentChange"
/> />
</div> </div>
</template> </template>

View File

@ -109,8 +109,8 @@ const {
color: 'var(--el-text-color-primary)' color: 'var(--el-text-color-primary)'
}" }"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@size-change="handleSizeChange" @page-size-change="handleSizeChange"
@current-change="handleCurrentChange" @page-current-change="handleCurrentChange"
> >
<template #operation="{ row }"> <template #operation="{ row }">
<el-button <el-button

View File

@ -111,8 +111,8 @@ const {
color: 'var(--el-text-color-primary)' color: 'var(--el-text-color-primary)'
}" }"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@size-change="handleSizeChange" @page-size-change="handleSizeChange"
@current-change="handleCurrentChange" @page-current-change="handleCurrentChange"
> >
<template #operation="{ row }"> <template #operation="{ row }">
<el-button <el-button