diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..dd765724ef8f64c37c5ff0193f614b60ca7f1660 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# http://editorconfig.org +root = true + +# 表示所有文件适用 +[*] +charset = utf-8 # 设置文件字符集为 utf-8 +end_of_line = lf # 控制换行类型(lf | cr | crlf) +indent_style = tab # 缩进风格(tab | space) +insert_final_newline = true # 始终在文件末尾插入一个新行 + +# 表示仅 md 文件适用以下规则 +[*.md] +max_line_length = off # 关闭最大行长度限制 +trim_trailing_whitespace = false # 关闭末尾空格修剪 diff --git a/.env.development b/.env.development index 0c92b764be29441d2fd89022b0ed23a04e2188de..1d34584a43a0a670805a0194242bb0c45644b721 100644 --- a/.env.development +++ b/.env.development @@ -5,4 +5,12 @@ NODE_ENV='development' VITE_APP_TITLE = 'vue3-element-admin' VITE_APP_PORT = 3000 + +# API请求前缀 VITE_APP_BASE_API = '/dev-api' + +# proxy代理配置 +VITE_APP_TARGET_URL = 'http://vapi.youlai.tech' # 线上接口 +# VITE_APP_TARGET_URL = 'http://localhost:8989' # 本地接口,本地启动后端:https://gitee.com/youlaiorg/youlai-boot +# VITE_APP_TARGET_URL = 'http://localhost:3000' # 本地Mock +VITE_APP_TARGET_BASE_API = '' diff --git a/.env.production b/.env.production index bc89fec3ee419e99c13a3568e8b76c2dea800ce3..ad781c0809b9152bd9876375b812d6a4ec4092de 100644 --- a/.env.production +++ b/.env.production @@ -1,6 +1,11 @@ ## 生产环境 -NODE_ENV='production' VITE_APP_TITLE = 'vue3-element-admin' VITE_APP_PORT = 3000 + +# API请求前缀 VITE_APP_BASE_API = '/prod-api' + +# proxy代理配置 +VITE_APP_TARGET_URL = "http://vapi.youlai.tech" +VITE_APP_TARGET_BASE_API = '' diff --git a/.env.staging b/.env.staging index 7a0b3d37ac8c6b96be79600d35e8dbe41166f164..7b5894bb357747c1b466b7a92bea7ab316cd4e38 100644 --- a/.env.staging +++ b/.env.staging @@ -3,4 +3,6 @@ NODE_ENV='staging' VITE_APP_TITLE = 'vue3-element-admin' VITE_APP_PORT = 3000 -VITE_APP_BASE_API = '/prod--api' + +VITE_APP_TARGET_URL = 'http://localhost:3000'; +VITE_APP_BASE_API = '/prod-api' diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000000000000000000000000000000000..43af40f40b04b72962b5d6356f00441a8e606838 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,14 @@ +dist +node_modules +public +.husky +.vscode +.idea +*.sh +*.md + +src/assets + +.eslintrc.cjs +.prettierrc.cjs +.stylelintrc.cjs diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json new file mode 100644 index 0000000000000000000000000000000000000000..f4738bfcc31d71c19b21c58d72bd25f0705f09d4 --- /dev/null +++ b/.eslintrc-auto-import.json @@ -0,0 +1,284 @@ +{ + "globals": { + "Component": true, + "ComponentPublicInstance": true, + "ComputedRef": true, + "EffectScope": true, + "ElMessage": true, + "ElMessageBox": true, + "ElNotification": true, + "InjectionKey": true, + "PropType": true, + "Ref": true, + "VNode": true, + "asyncComputed": true, + "autoResetRef": true, + "computed": true, + "computedAsync": true, + "computedEager": true, + "computedInject": true, + "computedWithControl": true, + "controlledComputed": true, + "controlledRef": true, + "createApp": true, + "createEventHook": true, + "createGlobalState": true, + "createInjectionState": true, + "createReactiveFn": true, + "createReusableTemplate": true, + "createSharedComposable": true, + "createTemplatePromise": true, + "createUnrefFn": true, + "customRef": true, + "debouncedRef": true, + "debouncedWatch": true, + "defineAsyncComponent": true, + "defineComponent": true, + "eagerComputed": true, + "effectScope": true, + "extendRef": true, + "getCurrentInstance": true, + "getCurrentScope": true, + "h": true, + "ignorableWatch": true, + "inject": true, + "isDefined": true, + "isProxy": true, + "isReactive": true, + "isReadonly": true, + "isRef": true, + "makeDestructurable": true, + "markRaw": true, + "nextTick": true, + "onActivated": true, + "onBeforeMount": true, + "onBeforeUnmount": true, + "onBeforeUpdate": true, + "onClickOutside": true, + "onDeactivated": true, + "onErrorCaptured": true, + "onKeyStroke": true, + "onLongPress": true, + "onMounted": true, + "onRenderTracked": true, + "onRenderTriggered": true, + "onScopeDispose": true, + "onServerPrefetch": true, + "onStartTyping": true, + "onUnmounted": true, + "onUpdated": true, + "pausableWatch": true, + "provide": true, + "reactify": true, + "reactifyObject": true, + "reactive": true, + "reactiveComputed": true, + "reactiveOmit": true, + "reactivePick": true, + "readonly": true, + "ref": true, + "refAutoReset": true, + "refDebounced": true, + "refDefault": true, + "refThrottled": true, + "refWithControl": true, + "resolveComponent": true, + "resolveRef": true, + "resolveUnref": true, + "shallowReactive": true, + "shallowReadonly": true, + "shallowRef": true, + "syncRef": true, + "syncRefs": true, + "templateRef": true, + "throttledRef": true, + "throttledWatch": true, + "toRaw": true, + "toReactive": true, + "toRef": true, + "toRefs": true, + "toValue": true, + "triggerRef": true, + "tryOnBeforeMount": true, + "tryOnBeforeUnmount": true, + "tryOnMounted": true, + "tryOnScopeDispose": true, + "tryOnUnmounted": true, + "unref": true, + "unrefElement": true, + "until": true, + "useActiveElement": true, + "useAnimate": true, + "useArrayDifference": true, + "useArrayEvery": true, + "useArrayFilter": true, + "useArrayFind": true, + "useArrayFindIndex": true, + "useArrayFindLast": true, + "useArrayIncludes": true, + "useArrayJoin": true, + "useArrayMap": true, + "useArrayReduce": true, + "useArraySome": true, + "useArrayUnique": true, + "useAsyncQueue": true, + "useAsyncState": true, + "useAttrs": true, + "useBase64": true, + "useBattery": true, + "useBluetooth": true, + "useBreakpoints": true, + "useBroadcastChannel": true, + "useBrowserLocation": true, + "useCached": true, + "useClipboard": true, + "useCloned": true, + "useColorMode": true, + "useConfirmDialog": true, + "useCounter": true, + "useCssModule": true, + "useCssVar": true, + "useCssVars": true, + "useCurrentElement": true, + "useCycleList": true, + "useDark": true, + "useDateFormat": true, + "useDebounce": true, + "useDebounceFn": true, + "useDebouncedRefHistory": true, + "useDeviceMotion": true, + "useDeviceOrientation": true, + "useDevicePixelRatio": true, + "useDevicesList": true, + "useDisplayMedia": true, + "useDocumentVisibility": true, + "useDraggable": true, + "useDropZone": true, + "useElementBounding": true, + "useElementByPoint": true, + "useElementHover": true, + "useElementSize": true, + "useElementVisibility": true, + "useEventBus": true, + "useEventListener": true, + "useEventSource": true, + "useEyeDropper": true, + "useFavicon": true, + "useFetch": true, + "useFileDialog": true, + "useFileSystemAccess": true, + "useFocus": true, + "useFocusWithin": true, + "useFps": true, + "useFullscreen": true, + "useGamepad": true, + "useGeolocation": true, + "useIdle": true, + "useImage": true, + "useInfiniteScroll": true, + "useIntersectionObserver": true, + "useInterval": true, + "useIntervalFn": true, + "useKeyModifier": true, + "useLastChanged": true, + "useLocalStorage": true, + "useMagicKeys": true, + "useManualRefHistory": true, + "useMediaControls": true, + "useMediaQuery": true, + "useMemoize": true, + "useMemory": true, + "useMounted": true, + "useMouse": true, + "useMouseInElement": true, + "useMousePressed": true, + "useMutationObserver": true, + "useNavigatorLanguage": true, + "useNetwork": true, + "useNow": true, + "useObjectUrl": true, + "useOffsetPagination": true, + "useOnline": true, + "usePageLeave": true, + "useParallax": true, + "useParentElement": true, + "usePerformanceObserver": true, + "usePermission": true, + "usePointer": true, + "usePointerLock": true, + "usePointerSwipe": true, + "usePreferredColorScheme": true, + "usePreferredContrast": true, + "usePreferredDark": true, + "usePreferredLanguages": true, + "usePreferredReducedMotion": true, + "usePrevious": true, + "useRafFn": true, + "useRefHistory": true, + "useResizeObserver": true, + "useScreenOrientation": true, + "useScreenSafeArea": true, + "useScriptTag": true, + "useScroll": true, + "useScrollLock": true, + "useSessionStorage": true, + "useShare": true, + "useSlots": true, + "useSorted": true, + "useSpeechRecognition": true, + "useSpeechSynthesis": true, + "useStepper": true, + "useStorage": true, + "useStorageAsync": true, + "useStyleTag": true, + "useSupported": true, + "useSwipe": true, + "useTemplateRefsList": true, + "useTextDirection": true, + "useTextSelection": true, + "useTextareaAutosize": true, + "useThrottle": true, + "useThrottleFn": true, + "useThrottledRefHistory": true, + "useTimeAgo": true, + "useTimeout": true, + "useTimeoutFn": true, + "useTimeoutPoll": true, + "useTimestamp": true, + "useTitle": true, + "useToNumber": true, + "useToString": true, + "useToggle": true, + "useTransition": true, + "useUrlSearchParams": true, + "useUserMedia": true, + "useVModel": true, + "useVModels": true, + "useVibrate": true, + "useVirtualList": true, + "useWakeLock": true, + "useWebNotification": true, + "useWebSocket": true, + "useWebWorker": true, + "useWebWorkerFn": true, + "useWindowFocus": true, + "useWindowScroll": true, + "useWindowSize": true, + "watch": true, + "watchArray": true, + "watchAtMost": true, + "watchDebounced": true, + "watchDeep": true, + "watchEffect": true, + "watchIgnorable": true, + "watchImmediate": true, + "watchOnce": true, + "watchPausable": true, + "watchPostEffect": true, + "watchSyncEffect": true, + "watchThrottled": true, + "watchTriggerable": true, + "watchWithFilter": true, + "whenever": true + } +} diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000000000000000000000000000000000000..3300699c14273cf6710d7b459bce861a287f9cde --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,80 @@ +module.exports = { + root: true, + env: { + browser: true, + es2021: true, + node: true, + }, + parser: "vue-eslint-parser", + extends: [ + // 参考vuejs官方的eslint配置: https://eslint.vuejs.org/user-guide/#usage + "plugin:vue/vue3-recommended", + "./.eslintrc-auto-import.json", + "prettier", + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended", + ], + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + parser: "@typescript-eslint/parser", + project: "./tsconfig.*?.json", + createDefaultProgram: false, + extraFileExtensions: [".vue"], + }, + plugins: ["vue", "@typescript-eslint"], + rules: { + "vue/multi-word-component-names": "off", // 关闭组件名必须多字: https://eslint.vuejs.org/rules/multi-word-component-names.html + "@typescript-eslint/no-empty-function": "off", // 关闭空方法检查 + "@typescript-eslint/no-explicit-any": "off", // 关闭any类型的警告 + "vue/no-v-model-argument": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/ban-ts-ignore": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "vue/script-setup-uses-vars": "error", + "vue/no-reserved-component-names": "off", + "vue/custom-event-name-casing": "off", + "vue/attributes-order": "off", + "vue/one-component-per-file": "off", + "vue/html-closing-bracket-newline": "off", + "vue/max-attributes-per-line": "off", + "vue/multiline-html-element-content-newline": "off", + "vue/singleline-html-element-content-newline": "off", + "vue/attribute-hyphenation": "off", + "vue/require-default-prop": "off", + "vue/require-explicit-emits": "off", + "vue/html-self-closing": [ + "error", + { + html: { + void: "always", + normal: "never", + component: "always", + }, + svg: "always", + math: "always", + }, + ], + "vue/multi-word-component-names": "off", + }, + // eslint不能对html文件生效 + overrides: [ + { + files: ["*.html"], + processor: "vue/.vue", + }, + ], + // https://eslint.org/docs/latest/use/configure/language-options#specifying-globals + globals: { + DialogOption: "readonly", + OptionType: "readonly", + }, +}; diff --git a/.gitignore b/.gitignore index 1da66c1e9a35adf6d08ff4f687dea3c9860a0c59..1fd449a71e4486e3776d184cf894fc1a23a3ba05 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ dist-ssr # Editor directories and files .idea -.vscode *.suo *.ntvs* *.njsproj @@ -14,4 +13,5 @@ dist-ssr *.local package-lock.json -yarn.lock \ No newline at end of file +pnpm-lock.yaml +stats.html diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000000000000000000000000000000000000..e8511eaeaf61dd7e09c3e9f35cdee6c636568f1c --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000000000000000000000000000000000..37568d10abfa3b19c2e1a3d1ad6a59b13f4f2fc3 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run lint:lint-staged diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000000000000000000000000000000000..f3e9850f460c163870500fe21e4671dca1805640 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,11 @@ +dist +node_modules +public +.husky +.vscode +.idea +*.sh +*.md + +src/assets +stats.html diff --git a/.prettierrc.cjs b/.prettierrc.cjs new file mode 100644 index 0000000000000000000000000000000000000000..1c3421afcfe1590b91d08f74319a954620b401f5 --- /dev/null +++ b/.prettierrc.cjs @@ -0,0 +1,38 @@ +module.exports = { + // (x)=>{},单个参数箭头函数是否显示小括号。(always:始终显示;avoid:省略括号。默认:always) + arrowParens: "always", + // 开始标签的右尖括号是否跟随在最后一行属性末尾,默认false + bracketSameLine: false, + // 对象字面量的括号之间打印空格 (true - Example: { foo: bar } ; false - Example: {foo:bar}) + bracketSpacing: true, + // 是否格式化一些文件中被嵌入的代码片段的风格(auto|off;默认auto) + embeddedLanguageFormatting: "auto", + // 指定 HTML 文件的空格敏感度 (css|strict|ignore;默认css) + htmlWhitespaceSensitivity: "css", + // 当文件已经被 Prettier 格式化之后,是否会在文件顶部插入一个特殊的 @format 标记,默认false + insertPragma: false, + // 在 JSX 中使用单引号替代双引号,默认false + jsxSingleQuote: false, + // 每行最多字符数量,超出换行(默认80) + printWidth: 80, + // 超出打印宽度 (always | never | preserve ) + proseWrap: "preserve", + // 对象属性是否使用引号(as-needed | consistent | preserve;默认as-needed:对象的属性需要加引号才添加;) + quoteProps: "as-needed", + // 是否只格式化在文件顶部包含特定注释(@prettier| @format)的文件,默认false + requirePragma: false, + // 结尾添加分号 + semi: true, + // 使用单引号 (true:单引号;false:双引号) + singleQuote: false, + // 缩进空格数,默认2个空格 + tabWidth: 2, + // 元素末尾是否加逗号,默认es5: ES5中的 objects, arrays 等会添加逗号,TypeScript 中的 type 后不加逗号 + trailingComma: "es5", + // 指定缩进方式,空格或tab,默认false,即使用空格 + useTabs: false, + // vue 文件中是否缩进 \ No newline at end of file diff --git a/src/assets/icons/checkbox.svg b/src/assets/icons/checkbox.svg deleted file mode 100644 index 013fd3a273eec2b45ea72843d7b3334c5d750530..0000000000000000000000000000000000000000 --- a/src/assets/icons/checkbox.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/client.svg b/src/assets/icons/client.svg new file mode 100644 index 0000000000000000000000000000000000000000..ad4bc15a914565522a92dde6f13153b21df3ff64 --- /dev/null +++ b/src/assets/icons/client.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/clipboard.svg b/src/assets/icons/clipboard.svg deleted file mode 100644 index 90923ff6282ec6aa403936bbe44b68e134cb9bcf..0000000000000000000000000000000000000000 --- a/src/assets/icons/clipboard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/close.svg b/src/assets/icons/close.svg new file mode 100644 index 0000000000000000000000000000000000000000..5b5057f27e91ef29be61d8863a408c97bc7f08c3 --- /dev/null +++ b/src/assets/icons/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/close_all.svg b/src/assets/icons/close_all.svg new file mode 100644 index 0000000000000000000000000000000000000000..aa13cd755c1a2be7b7f1760bf34768588b7e59d3 --- /dev/null +++ b/src/assets/icons/close_all.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/close_left.svg b/src/assets/icons/close_left.svg new file mode 100644 index 0000000000000000000000000000000000000000..e5708ea5c5c32eb0225f8a68bcfe03f268b71e18 --- /dev/null +++ b/src/assets/icons/close_left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/close_other.svg b/src/assets/icons/close_other.svg new file mode 100644 index 0000000000000000000000000000000000000000..212e6c283f442230763e4c14bfacb27862f1baf3 --- /dev/null +++ b/src/assets/icons/close_other.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/close_right.svg b/src/assets/icons/close_right.svg new file mode 100644 index 0000000000000000000000000000000000000000..14d3cf39a11bf0674c3150f46508104eb827ef0d --- /dev/null +++ b/src/assets/icons/close_right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/code.svg b/src/assets/icons/code.svg deleted file mode 100644 index ed4d23cf4021f72022fa8f99ff89154c3741b3d6..0000000000000000000000000000000000000000 --- a/src/assets/icons/code.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/color.svg b/src/assets/icons/color.svg deleted file mode 100644 index 44a81aab1bb9de3907ec9fadaf2d9e616979390f..0000000000000000000000000000000000000000 --- a/src/assets/icons/color.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/component.svg b/src/assets/icons/component.svg deleted file mode 100644 index 29c345809974665d96ed42e261734bc56c37b826..0000000000000000000000000000000000000000 --- a/src/assets/icons/component.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/coupon.svg b/src/assets/icons/coupon.svg new file mode 100644 index 0000000000000000000000000000000000000000..2f952b240dc8dbe902c07f1fe197184530fbf5dc --- /dev/null +++ b/src/assets/icons/coupon.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/date-range.svg b/src/assets/icons/date-range.svg deleted file mode 100644 index fda571e700372418697293910f77957c07290cfe..0000000000000000000000000000000000000000 --- a/src/assets/icons/date-range.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/date.svg b/src/assets/icons/date.svg deleted file mode 100644 index 52dc73eecfaca2c315b54d99ba7030a79e549f36..0000000000000000000000000000000000000000 --- a/src/assets/icons/date.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/dict.svg b/src/assets/icons/dict.svg index 484937730750b9adb201df69abef2503760f7229..22a8278119da47dcc7ed727d277e9afc9dd664b3 100644 --- a/src/assets/icons/dict.svg +++ b/src/assets/icons/dict.svg @@ -1 +1,18 @@ - \ No newline at end of file + + + + + + + diff --git a/src/assets/icons/dict_item.svg b/src/assets/icons/dict_item.svg new file mode 100644 index 0000000000000000000000000000000000000000..903109a7fe810f8915bc52ec4c7a7dc0b65f0a34 --- /dev/null +++ b/src/assets/icons/dict_item.svg @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/src/assets/icons/document.svg b/src/assets/icons/document.svg new file mode 100644 index 0000000000000000000000000000000000000000..918ae33dca2316c16f5cc2ae866f9f5c1390f7b8 --- /dev/null +++ b/src/assets/icons/document.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/documentation.svg b/src/assets/icons/documentation.svg deleted file mode 100644 index 704312289e6ad2f65a3ace229e73fb5c7f3e94e9..0000000000000000000000000000000000000000 --- a/src/assets/icons/documentation.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/download.svg b/src/assets/icons/download.svg index c8969513493e7ac96725dcf2f01400e7c2c63df6..61ec1f9fffdf145470cc16ff9f8c01c9caaf26a8 100644 --- a/src/assets/icons/download.svg +++ b/src/assets/icons/download.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/assets/icons/druid.svg b/src/assets/icons/druid.svg deleted file mode 100644 index a2b4b4ed2481975a127506a9516e5c12417ac93e..0000000000000000000000000000000000000000 --- a/src/assets/icons/druid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/education.svg b/src/assets/icons/education.svg deleted file mode 100644 index 7bfb01d180f9ac9cf45429412129a7b7be4d8daf..0000000000000000000000000000000000000000 --- a/src/assets/icons/education.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/email.svg b/src/assets/icons/email.svg deleted file mode 100644 index 74d25e21a6f98b90b34b2b8d2ce2dd90b38eb000..0000000000000000000000000000000000000000 --- a/src/assets/icons/email.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/example.svg b/src/assets/icons/example.svg deleted file mode 100644 index 46f42b5323d11686c44b573729db0df115343d5c..0000000000000000000000000000000000000000 --- a/src/assets/icons/example.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/excel.svg b/src/assets/icons/excel.svg deleted file mode 100644 index 74d97b802f8bf84caf4c623e77f890f74516d50f..0000000000000000000000000000000000000000 --- a/src/assets/icons/excel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/form.svg b/src/assets/icons/form.svg deleted file mode 100644 index 9ab55a03f73575b6be0ee71fcd93630d7888bcbc..0000000000000000000000000000000000000000 --- a/src/assets/icons/form.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/assets/icons/goods-list.svg b/src/assets/icons/goods-list.svg new file mode 100644 index 0000000000000000000000000000000000000000..fcb971edc6ec3c436f5eb4afc5e11fe34440caf0 --- /dev/null +++ b/src/assets/icons/goods-list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/goods.svg b/src/assets/icons/goods.svg new file mode 100644 index 0000000000000000000000000000000000000000..60c1c734fcf451ef711e9fde5d3745c95f66664a --- /dev/null +++ b/src/assets/icons/goods.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/homepage.svg b/src/assets/icons/homepage.svg new file mode 100644 index 0000000000000000000000000000000000000000..48f4e2490b3bcee52b1221064b0ad906351276bc --- /dev/null +++ b/src/assets/icons/homepage.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/input.svg b/src/assets/icons/input.svg deleted file mode 100644 index ab91381e6df0ec6307d677f0dce75b9c9d95e5d5..0000000000000000000000000000000000000000 --- a/src/assets/icons/input.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/international.svg b/src/assets/icons/international.svg deleted file mode 100644 index e9b56eee2c59774f0431186b9af2ba7593bffcc0..0000000000000000000000000000000000000000 --- a/src/assets/icons/international.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/ip.svg b/src/assets/icons/ip.svg deleted file mode 100644 index e59f29b35f9919adca8ab2e295a51569f2e55182..0000000000000000000000000000000000000000 --- a/src/assets/icons/ip.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/assets/icons/job.svg b/src/assets/icons/job.svg deleted file mode 100644 index 2a93a25195e29eba9c76d7ce5bdd6f1a71f9aee4..0000000000000000000000000000000000000000 --- a/src/assets/icons/job.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/lab.svg b/src/assets/icons/lab.svg new file mode 100644 index 0000000000000000000000000000000000000000..d4d60aacf28a6373c50729d6aff2c2f1051eb3df --- /dev/null +++ b/src/assets/icons/lab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/language.svg b/src/assets/icons/language.svg index 0082b577ab28523f353fa71c00cb338446b2bb9c..d2dd693ddfecd05d079a287498fa70d1719787e8 100644 --- a/src/assets/icons/language.svg +++ b/src/assets/icons/language.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/assets/icons/link.svg b/src/assets/icons/link.svg index 48197ba4da7b4314a16a19a698fe96c1b2a7ad0b..9748d5303a495fb3ea7f260e48a7137e5774bc63 100644 --- a/src/assets/icons/link.svg +++ b/src/assets/icons/link.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/assets/icons/list.svg b/src/assets/icons/list.svg deleted file mode 100644 index 20259eddb7c0cf77efe9cb1c561d2df8961094f5..0000000000000000000000000000000000000000 --- a/src/assets/icons/list.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/lock.svg b/src/assets/icons/lock.svg deleted file mode 100644 index 74fee543dd1d9bc0ceb3310cc87bf65e268bf364..0000000000000000000000000000000000000000 --- a/src/assets/icons/lock.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/log.svg b/src/assets/icons/log.svg deleted file mode 100644 index d879d33b6cd96ae370e104d58589915441e1bcb3..0000000000000000000000000000000000000000 --- a/src/assets/icons/log.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/logininfor.svg b/src/assets/icons/logininfor.svg deleted file mode 100644 index 267f84474266c8ebe6ae61925a7c1cb4e3814079..0000000000000000000000000000000000000000 --- a/src/assets/icons/logininfor.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/menu.svg b/src/assets/icons/menu.svg index 719c78dc699b5378b718677b4b276fde634ae1f5..92c364c2317c7eba477fa1cb9748a8b36b033108 100644 --- a/src/assets/icons/menu.svg +++ b/src/assets/icons/menu.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/message.svg b/src/assets/icons/message.svg index 14ca81728a3de16e103a858b4ce31f8e0f550bce..ea1ddef10f911417c4aeee02b7dc091312eb3e08 100644 --- a/src/assets/icons/message.svg +++ b/src/assets/icons/message.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/money.svg b/src/assets/icons/money.svg index c1580de10e1f1c504f7bfcaba4f41b24d816d8f2..60f7acf4c53650e424b46924b48279e555b7b153 100644 --- a/src/assets/icons/money.svg +++ b/src/assets/icons/money.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/multi_level.svg b/src/assets/icons/multi_level.svg new file mode 100644 index 0000000000000000000000000000000000000000..a1a2792144f6252a02d48d673e203e96be125b22 --- /dev/null +++ b/src/assets/icons/multi_level.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/offline.svg b/src/assets/icons/offline.svg deleted file mode 100644 index d09cb16c5da6653b30010393bc52bddf131f647a..0000000000000000000000000000000000000000 --- a/src/assets/icons/offline.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/assets/icons/online.svg b/src/assets/icons/online.svg deleted file mode 100644 index 330a202935b887236b34200b163f6a421bad592f..0000000000000000000000000000000000000000 --- a/src/assets/icons/online.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/order.svg b/src/assets/icons/order.svg new file mode 100644 index 0000000000000000000000000000000000000000..8f2107ec41dfe129b3528e3dab30105f1a5a0bce --- /dev/null +++ b/src/assets/icons/order.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/pdf.svg b/src/assets/icons/pdf.svg deleted file mode 100644 index 957aa0cc3597c1277ded6367716067c9874552e0..0000000000000000000000000000000000000000 --- a/src/assets/icons/pdf.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/people.svg b/src/assets/icons/people.svg deleted file mode 100644 index 2bd54aeb728197066e987e8d8d98364f50ed5be6..0000000000000000000000000000000000000000 --- a/src/assets/icons/people.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/peoples.svg b/src/assets/icons/peoples.svg index 907404cd05694a9ae1095ec0edaceb1328500a9d..383b82d2729dd57d953dfbb01bfa01a9256ad60a 100644 --- a/src/assets/icons/peoples.svg +++ b/src/assets/icons/peoples.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/assets/icons/perm.svg b/src/assets/icons/perm.svg index 8ed624b9d1bf2f737048926f0cd425d9d633ad1c..b38d0657e4637e9136aec5254cf68f38b69c0697 100644 --- a/src/assets/icons/perm.svg +++ b/src/assets/icons/perm.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/assets/icons/phone.svg b/src/assets/icons/phone.svg deleted file mode 100644 index ab8e8c4e5b3765c92e98fd2ecfeeda892661ac17..0000000000000000000000000000000000000000 --- a/src/assets/icons/phone.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/post.svg b/src/assets/icons/post.svg deleted file mode 100644 index 2922c613bddb847c6f411e27b5ad874f577a633f..0000000000000000000000000000000000000000 --- a/src/assets/icons/post.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/publish.svg b/src/assets/icons/publish.svg new file mode 100644 index 0000000000000000000000000000000000000000..e9b489c323cff056fd6fdc1cc7da08a6b5cfb435 --- /dev/null +++ b/src/assets/icons/publish.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/qq.svg b/src/assets/icons/qq.svg deleted file mode 100644 index ee13d4ec2e54dbbe64009db689c502b05629721a..0000000000000000000000000000000000000000 --- a/src/assets/icons/qq.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/question.svg b/src/assets/icons/question.svg deleted file mode 100644 index cf75bd4bea55c98003ca97828fcb3e37d5c4450e..0000000000000000000000000000000000000000 --- a/src/assets/icons/question.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/rabbitmq.svg b/src/assets/icons/rabbitmq.svg new file mode 100644 index 0000000000000000000000000000000000000000..65aa19854a39a632bc72f364c606bb0db0e62921 --- /dev/null +++ b/src/assets/icons/rabbitmq.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/radio.svg b/src/assets/icons/radio.svg deleted file mode 100644 index 0cde34521ae7b5bddaaa2372a4472fc05f9135a4..0000000000000000000000000000000000000000 --- a/src/assets/icons/radio.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/refresh.svg b/src/assets/icons/refresh.svg new file mode 100644 index 0000000000000000000000000000000000000000..1f549f1ada0d5dff0f5c5f2a91f75da3a646fb34 --- /dev/null +++ b/src/assets/icons/refresh.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/route.svg b/src/assets/icons/route.svg deleted file mode 100644 index b207124471f937772bb7aec1039fdd2b8aac9c36..0000000000000000000000000000000000000000 --- a/src/assets/icons/route.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/assets/icons/row.svg b/src/assets/icons/row.svg deleted file mode 100644 index 07809922264539672115e4866d65c3e1e6032df9..0000000000000000000000000000000000000000 --- a/src/assets/icons/row.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/search.svg b/src/assets/icons/search.svg deleted file mode 100644 index 84233ddaa98a45d407cacdc869d9b7634f72d390..0000000000000000000000000000000000000000 --- a/src/assets/icons/search.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/security.svg b/src/assets/icons/security.svg new file mode 100644 index 0000000000000000000000000000000000000000..bcd9d2e6f64bed30b1b085eb504d5f875e386ee5 --- /dev/null +++ b/src/assets/icons/security.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/select.svg b/src/assets/icons/select.svg deleted file mode 100644 index d6283828bac413d2a10d4f6e267d7ba2f5f10aea..0000000000000000000000000000000000000000 --- a/src/assets/icons/select.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/server.svg b/src/assets/icons/server.svg deleted file mode 100644 index ca37b001e93c40a81dc3f9302795edc70e502457..0000000000000000000000000000000000000000 --- a/src/assets/icons/server.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/shopping.svg b/src/assets/icons/shopping.svg index 87513e7c5fdd4260e48f7ead3501e0b9f9798c2a..8d2b4bf95d5eedc397572bbb95e81e7b0ad7f5de 100644 --- a/src/assets/icons/shopping.svg +++ b/src/assets/icons/shopping.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/slider.svg b/src/assets/icons/slider.svg deleted file mode 100644 index fbe4f39f004ef8415e039234eaf4bf11b4d9985a..0000000000000000000000000000000000000000 --- a/src/assets/icons/slider.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/swagger.svg b/src/assets/icons/swagger.svg deleted file mode 100644 index 05d4e7bcee9829539a977c51c36560c4aad98c80..0000000000000000000000000000000000000000 --- a/src/assets/icons/swagger.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/switch.svg b/src/assets/icons/switch.svg deleted file mode 100644 index 0ba61e38d72b9af4c6e5a400baa0561f06d8d0c0..0000000000000000000000000000000000000000 --- a/src/assets/icons/switch.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/system.svg b/src/assets/icons/system.svg index dba28cf6fd1ad6992421638659003fdb0e07c032..e3b7e2d49f493919156e3e0e3aa23b5b04949634 100644 --- a/src/assets/icons/system.svg +++ b/src/assets/icons/system.svg @@ -1,2 +1 @@ - \ No newline at end of file + diff --git a/src/assets/icons/tab.svg b/src/assets/icons/tab.svg deleted file mode 100644 index b4b48e48085bb21b18da5386a6d4692a70301977..0000000000000000000000000000000000000000 --- a/src/assets/icons/tab.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/textarea.svg b/src/assets/icons/textarea.svg deleted file mode 100644 index 2709f292ea23aa87ba87d5ee2622c94994c1fbfb..0000000000000000000000000000000000000000 --- a/src/assets/icons/textarea.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/time-range.svg b/src/assets/icons/time-range.svg deleted file mode 100644 index 13c1202bdafa11c73c89ee472f3c810e834dfeca..0000000000000000000000000000000000000000 --- a/src/assets/icons/time-range.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/time.svg b/src/assets/icons/time.svg deleted file mode 100644 index b376e32a608f33f906cda57da3df809c0413a44e..0000000000000000000000000000000000000000 --- a/src/assets/icons/time.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/tool.svg b/src/assets/icons/tool.svg deleted file mode 100644 index c813067ef74945d7fcd48c7092131abd20375168..0000000000000000000000000000000000000000 --- a/src/assets/icons/tool.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/tree-table.svg b/src/assets/icons/tree-table.svg deleted file mode 100644 index 8aafdb829ebbe289f352a533d9764c4f9395e533..0000000000000000000000000000000000000000 --- a/src/assets/icons/tree-table.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/tree.svg b/src/assets/icons/tree.svg index dd4b7dd22fe06076831935066592caec48e323b0..d40a414d9e6099791bd7c0b19c1f22751208720e 100644 --- a/src/assets/icons/tree.svg +++ b/src/assets/icons/tree.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/upload.svg b/src/assets/icons/upload.svg deleted file mode 100644 index bae49c0a50e7bc0683d82e3af2e0064adc4108ad..0000000000000000000000000000000000000000 --- a/src/assets/icons/upload.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/user.svg b/src/assets/icons/user.svg index 0ba0716a62a92f7cb2f2e6f3c745ace2be6b3b31..e4c7b389fdcdf91bdb0d8439cd4b6d1b8a58e9de 100644 --- a/src/assets/icons/user.svg +++ b/src/assets/icons/user.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/uv.svg b/src/assets/icons/uv.svg new file mode 100644 index 0000000000000000000000000000000000000000..ca4c30126c399e532f578f864b9a879051df9eb5 --- /dev/null +++ b/src/assets/icons/uv.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/validCode.svg b/src/assets/icons/validCode.svg deleted file mode 100644 index cfb10214c53ee9e021a97733c9b5b5c39e388787..0000000000000000000000000000000000000000 --- a/src/assets/icons/validCode.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/verify_code.svg b/src/assets/icons/verify_code.svg new file mode 100644 index 0000000000000000000000000000000000000000..39bf478384a2fef8ac6d826f811a1d0f0e7b76b2 --- /dev/null +++ b/src/assets/icons/verify_code.svg @@ -0,0 +1,9 @@ + + + + diff --git a/src/assets/icons/wechat.svg b/src/assets/icons/wechat.svg deleted file mode 100644 index c586e5511722843f9c741d7530db146dfab864a4..0000000000000000000000000000000000000000 --- a/src/assets/icons/wechat.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/zip.svg b/src/assets/icons/zip.svg deleted file mode 100644 index f806fc4825739224caf820e6edf54e808961b1a6..0000000000000000000000000000000000000000 --- a/src/assets/icons/zip.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 2c5e158b068a4e9980f52fe5d7c9c3f7730617ba..a17fc3f041a6f1c18b279de639ea32a0976d2e03 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -1,19 +1,16 @@ \ No newline at end of file + diff --git a/src/components/Dictionary/index.vue b/src/components/Dictionary/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..855ad4e156d140bc3f791ad0635ac0102f26541c --- /dev/null +++ b/src/components/Dictionary/index.vue @@ -0,0 +1,61 @@ + + + diff --git a/src/components/GithubCorner/index.vue b/src/components/GithubCorner/index.vue index 2f507ca4b00b79740a7aaccad173c157b34ca366..4b0bba987a518b5153b2c1789fcf6d31a8059b24 100644 --- a/src/components/GithubCorner/index.vue +++ b/src/components/GithubCorner/index.vue @@ -1,17 +1,22 @@ - - diff --git a/src/components/IconSelect/index.vue b/src/components/IconSelect/index.vue index f4be7071d11a522afa90d649316076c134895790..e4f925fcc132802e57eb69942fb0ba2187ca3076 100644 --- a/src/components/IconSelect/index.vue +++ b/src/components/IconSelect/index.vue @@ -1,83 +1,165 @@ - + - \ No newline at end of file + diff --git a/src/components/LangSelect/index.vue b/src/components/LangSelect/index.vue index b94de2fb638ca28dad73776c6d8e6f9148939141..b4a63eadfd2647bbf71f90c1b40a17288e4652fb 100644 --- a/src/components/LangSelect/index.vue +++ b/src/components/LangSelect/index.vue @@ -1,49 +1,39 @@ + + - - - - \ No newline at end of file diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue index e0f85f21e212df7e6f0034e6022c706453ab912e..84e8f3e03c2b9ab320da25fe8cbe6f01f667d10b 100644 --- a/src/components/Pagination/index.vue +++ b/src/components/Pagination/index.vue @@ -1,102 +1,88 @@ - - diff --git a/src/components/RightPanel/index.vue b/src/components/RightPanel/index.vue index 41e2786daaff2f188df5d74fc8a5d8367d967f13..9dc5509cf1a01e26cbe36d1c241f2731fa390b90 100644 --- a/src/components/RightPanel/index.vue +++ b/src/components/RightPanel/index.vue @@ -1,155 +1,136 @@ - - - - diff --git a/src/components/Screenfull/index.vue b/src/components/Screenfull/index.vue deleted file mode 100644 index b5b86973182f3f5bd8c721c31cce8881618b518a..0000000000000000000000000000000000000000 --- a/src/components/Screenfull/index.vue +++ /dev/null @@ -1,12 +0,0 @@ - - - \ No newline at end of file diff --git a/src/components/SizeSelect/index.vue b/src/components/SizeSelect/index.vue index 32040a5ae3e7a47293e126322f1bda447be6f56f..f0800ba22f29d1580c34d0792d32058cebab5672 100644 --- a/src/components/SizeSelect/index.vue +++ b/src/components/SizeSelect/index.vue @@ -1,14 +1,31 @@ + + - - - - \ No newline at end of file diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue index 05cc3cde54eb39bc74f8fce4213ba9d1715b94de..07b65e8ddb62f744a0724db7445ed936874731fb 100644 --- a/src/components/SvgIcon/index.vue +++ b/src/components/SvgIcon/index.vue @@ -1,36 +1,45 @@ \ No newline at end of file + diff --git a/src/components/TagInput/index.vue b/src/components/TagInput/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..92b4129b611ec2a4bbc0109093dc3c10c14870b7 --- /dev/null +++ b/src/components/TagInput/index.vue @@ -0,0 +1,510 @@ + + + + diff --git a/src/components/TagInput/util.ts b/src/components/TagInput/util.ts new file mode 100644 index 0000000000000000000000000000000000000000..f216e311883951bd89e2e64bab16e08980beb3df --- /dev/null +++ b/src/components/TagInput/util.ts @@ -0,0 +1,34 @@ +/** + * getRePosFromStr 正则匹配字段返回位置信息 + * */ +export function getRePosFromStr(text: any = "", re: any = /\$.+?\$/g) { + const lines = text.split("\n"); + const positions: any = []; + let m; + for (let i = 0; i < lines.length; i++) { + const l = lines[i]; + while ((m = re.exec(l)) !== null) { + const tag = m[0].substring(1, m[0].length - 1); + positions.push({ + line: i, + start: m.index, + stop: m.index + m[0].length, + tag, + }); + } + } + return positions; +} +/** + * 输入框模式 + */ +export enum MODE { + // 文本 + TEXT = 1, + // 公式 + FORMULA, + // 只允许选择tag + ONLYTAG, + // 日期 + DATE, +} diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue deleted file mode 100644 index 0bfb2fa0bf2b632f237df2109ea86c6f97f0438d..0000000000000000000000000000000000000000 --- a/src/components/ThemePicker/index.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - diff --git a/src/components/TreeSelect/index.vue b/src/components/TreeSelect/index.vue deleted file mode 100644 index 18c99e40167b903d8192372da2b9bbf0e37a2023..0000000000000000000000000000000000000000 --- a/src/components/TreeSelect/index.vue +++ /dev/null @@ -1,170 +0,0 @@ - - - - - diff --git a/src/components/Upload/MultiUpload.vue b/src/components/Upload/MultiUpload.vue new file mode 100644 index 0000000000000000000000000000000000000000..0da012af6c0123edf4864761095f0aaa1c3a8e58 --- /dev/null +++ b/src/components/Upload/MultiUpload.vue @@ -0,0 +1,139 @@ + + + + + diff --git a/src/components/Upload/SingleUpload.vue b/src/components/Upload/SingleUpload.vue index 9a81fb5b5d7dcbb9dabf76ac351fbd02fbc45241..4038c72bb7b192432267a8a556906236bc959db0 100644 --- a/src/components/Upload/SingleUpload.vue +++ b/src/components/Upload/SingleUpload.vue @@ -1,142 +1,81 @@ - + + diff --git a/src/components/WangEditor/index.vue b/src/components/WangEditor/index.vue index bd53bae23ac5e1c7d2ead280b8f66e305730f613..2f4c6782383fa5971c32eba891d14e5027a7c756 100644 --- a/src/components/WangEditor/index.vue +++ b/src/components/WangEditor/index.vue @@ -1,73 +1,74 @@ - \ No newline at end of file + diff --git a/src/directive/index.ts b/src/directive/index.ts index 984b401602f542242d506752d708df726af8c00a..9c22eb69f123730bfb405a6e74c88ee538ea0dea 100644 --- a/src/directive/index.ts +++ b/src/directive/index.ts @@ -1 +1,9 @@ -export {hasPerm,hasRole} from "./permission"; \ No newline at end of file +import type { App } from "vue"; + +import { hasPerm } from "./permission"; + +// 全局注册 directive +export function setupDirective(app: App) { + // 使 v-hasPerm 在所有组件中都可用 + app.directive("hasPerm", hasPerm); +} diff --git a/src/directive/permission/index.ts b/src/directive/permission/index.ts index 7b278b7bd01f9cedeeb8bd48ef52e0b7c6842a1a..11d32068d157c3df41013d858d3e99d2871dd219 100644 --- a/src/directive/permission/index.ts +++ b/src/directive/permission/index.ts @@ -1,55 +1,55 @@ -import useStore from "@/store"; +import { useUserStoreHook } from "@/store/modules/user"; import { Directive, DirectiveBinding } from "vue"; /** - * 按钮权限校验 + * 按钮权限 */ export const hasPerm: Directive = { - mounted(el: HTMLElement, binding: DirectiveBinding) { - // 「超级管理员」拥有所有的按钮权限 - const { user } = useStore() - const roles = user.roles; - if (roles.includes('ROOT')) { - return true - } - // 「其他角色」按钮权限校验 - const { value } = binding; - if (value) { - const requiredPerms = value; // DOM绑定需要的按钮权限标识 + mounted(el: HTMLElement, binding: DirectiveBinding) { + // 「超级管理员」拥有所有的按钮权限 + const { roles, perms } = useUserStoreHook(); + if (roles.includes("ROOT")) { + return true; + } + // 「其他角色」按钮权限校验 + const { value } = binding; + if (value) { + const requiredPerms = value; // DOM绑定需要的按钮权限标识 - const hasPerm = user.perms.some(perm => { - return requiredPerms.includes(perm) - }) + const hasPerm = perms?.some((perm) => { + return requiredPerms.includes(perm); + }); - if (!hasPerm) { - el.parentNode && el.parentNode.removeChild(el); - } - } else { - throw new Error("need perms! Like v-has-perm=\"['sys:user:add','sys:user:edit']\""); - } + if (!hasPerm) { + el.parentNode && el.parentNode.removeChild(el); + } + } else { + throw new Error( + "need perms! Like v-has-perm=\"['sys:user:add','sys:user:edit']\"" + ); } + }, }; /** - * 角色权限校验 + * 角色权限 */ export const hasRole: Directive = { - mounted(el: HTMLElement, binding: DirectiveBinding) { - const { value } = binding; - - if (value) { - const requiredRoles = value; // DOM绑定需要的角色编码 - const { user } = useStore() - const hasRole = user.roles.some(perm => { - return requiredRoles.includes(perm) - }) + mounted(el: HTMLElement, binding: DirectiveBinding) { + const { value } = binding; + + if (value) { + const requiredRoles = value; // DOM绑定需要的角色编码 + const { roles } = useUserStoreHook(); + const hasRole = roles.some((perm) => { + return requiredRoles.includes(perm); + }); - if (!hasRole) { - el.parentNode && el.parentNode.removeChild(el); - } - } else { - throw new Error("need roles! Like v-has-role=\"['admin','test']\""); - } + if (!hasRole) { + el.parentNode && el.parentNode.removeChild(el); + } + } else { + throw new Error("need roles! Like v-has-role=\"['admin','test']\""); } + }, }; - diff --git a/src/enums/MenuTypeEnum.ts b/src/enums/MenuTypeEnum.ts new file mode 100644 index 0000000000000000000000000000000000000000..65e591db0a1c8cd5c4a0bf91244de20d10cbc252 --- /dev/null +++ b/src/enums/MenuTypeEnum.ts @@ -0,0 +1,19 @@ +export enum MenuTypeEnum { + /** + * 目录 + */ + CATALOG = "CATALOG", + /** + * 菜单 + */ + MENU = "MENU", + + /** + * 按钮 + */ + BUTTON = "BUTTON", + /** + * 外链 + */ + EXTLINK = "EXTLINK", +} diff --git a/src/lang/en.ts b/src/lang/en.ts deleted file mode 100644 index 535a45ba882e28ef5df6b7e1cd97c143bfad5d76..0000000000000000000000000000000000000000 --- a/src/lang/en.ts +++ /dev/null @@ -1,24 +0,0 @@ -export default { - // 路由国际化 - route: { - dashboard: 'Dashboard', - document: 'Document' - }, - // 登录页面国际化 - login: { - title: 'vue3-element-admin', - username: 'Username', - password: 'Password', - login: 'Login', - code: 'Verification Code', - copyright: '', - icp: '' - }, - // 导航栏国际化 - navbar:{ - dashboard: 'Dashboard', - logout:'Logout', - document:'Document', - gitee:'Gitee' - } -} \ No newline at end of file diff --git a/src/lang/index.ts b/src/lang/index.ts index b56f979db6c0f5966bb9e70b5badabf2a4c1dceb..18c0231690481f1204637dabde7b2f9fab04bedf 100644 --- a/src/lang/index.ts +++ b/src/lang/index.ts @@ -1,46 +1,25 @@ - -// 自定义国际化配置 -import {createI18n} from 'vue-i18n' -import {localStorage} from '@/utils/storage' - +import { createI18n } from "vue-i18n"; +import { useAppStore } from "@/store/modules/app"; // 本地语言包 -import enLocale from './en' -import zhCnLocale from './zh-cn' +import enLocale from "./package/en"; +import zhCnLocale from "./package/zh-cn"; -const messages = { - 'zh-cn': { - ...zhCnLocale - }, - en: { - ...enLocale - } -} +const appStore = useAppStore(); -/** - * 获取当前系统使用语言字符串 - * - * @returns zh-cn|en ... - */ -export const getLanguage = () => { - // 本地缓存获取 - let language = localStorage.get('language') - if (language) { - return language - } - // 浏览器使用语言 - language = navigator.language.toLowerCase() - const locales = Object.keys(messages) - for (const locale of locales) { - if (language.indexOf(locale) > -1) { - return locale - } - } - return 'zh-cn' -} +const messages = { + "zh-cn": { + ...zhCnLocale, + }, + en: { + ...enLocale, + }, +}; const i18n = createI18n({ - locale: getLanguage(), - messages: messages -}) + legacy: false, + locale: appStore.language, + messages: messages, + globalInjection: true, +}); -export default i18n \ No newline at end of file +export default i18n; diff --git a/src/lang/package/en.ts b/src/lang/package/en.ts new file mode 100644 index 0000000000000000000000000000000000000000..3e15041614c99aa782297bedc616269174a4fec6 --- /dev/null +++ b/src/lang/package/en.ts @@ -0,0 +1,23 @@ +export default { + // 路由国际化 + route: { + dashboard: "Dashboard", + document: "Document", + }, + // 登录页面国际化 + login: { + title: "vue3-element-admin", + username: "Username", + password: "Password", + login: "Login", + verifyCode: "Verify Code", + }, + // 导航栏国际化 + navbar: { + dashboard: "Dashboard", + profile: 'Profile', + logout: "Logout", + document: "Document", + gitee: "Gitee", + }, +}; diff --git a/src/lang/package/zh-cn.ts b/src/lang/package/zh-cn.ts new file mode 100644 index 0000000000000000000000000000000000000000..79da86243daf50388fe1672b0987610fd26f54d9 --- /dev/null +++ b/src/lang/package/zh-cn.ts @@ -0,0 +1,23 @@ +export default { + // 路由国际化 + route: { + dashboard: "首页", + document: "项目文档", + }, + // 登录页面国际化 + login: { + title: "vue3-element-admin", + username: "用户名", + password: "密码", + login: "登 录", + verifyCode: "验证码", + }, + // 导航栏国际化 + navbar: { + dashboard: "首页", + profile: '个人中心', + logout: "注销", + document: "项目文档", + gitee: "码云", + }, +}; diff --git a/src/lang/zh-cn.ts b/src/lang/zh-cn.ts deleted file mode 100644 index f0b0017e413c87c7500e977ed41696d8b3a47226..0000000000000000000000000000000000000000 --- a/src/lang/zh-cn.ts +++ /dev/null @@ -1,23 +0,0 @@ -export default { - // 路由国际化 - route: { - dashboard: '首页', - document: '项目文档' - }, - // 登录页面国际化 - login:{ - title: 'vue3-element-admin', - username:'用户名', - password:'密码', - login:'登 录', - code:'请输入验证码', - copyright:'', - icp:'' - }, - navbar:{ - dashboard: '首页', - logout:'注销', - document:'项目文档', - gitee:'码云' - } -} \ No newline at end of file diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index b5ec9bc2729361cda94bf602ce124784be203bc4..0de8378a5b8d1f82eb5ae8b1c7d4f5b9f1606536 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -1,32 +1,30 @@ + + - - - - - diff --git a/src/layout/components/NavBar/NavRight.vue b/src/layout/components/NavBar/NavRight.vue new file mode 100644 index 0000000000000000000000000000000000000000..8cc4ef5e71e61ecd756c6689b3740a9784792983 --- /dev/null +++ b/src/layout/components/NavBar/NavRight.vue @@ -0,0 +1,120 @@ + + + diff --git a/src/layout/components/NavBar/index.vue b/src/layout/components/NavBar/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..1f6b70e8e31838353af20692118161e933f5f690 --- /dev/null +++ b/src/layout/components/NavBar/index.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue deleted file mode 100644 index 3e4780db70af560d916e758148ee3a634d192aaf..0000000000000000000000000000000000000000 --- a/src/layout/components/Navbar.vue +++ /dev/null @@ -1,181 +0,0 @@ - - - - diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index 5e5f5588c2d961c58a2b1d739f3b07a562c679d5..4818ecd57996a0d76ca705ae3b943fab2cdb9ee6 100644 --- a/src/layout/components/Settings/index.vue +++ b/src/layout/components/Settings/index.vue @@ -1,103 +1,199 @@ + + - - diff --git a/src/layout/components/Sidebar/Link.vue b/src/layout/components/Sidebar/Link.vue index 0254b59a8d1a8856872583f84c3fa8e5e294e212..fb1516dab3efaabc7f791c15334c01884989292f 100644 --- a/src/layout/components/Sidebar/Link.vue +++ b/src/layout/components/Sidebar/Link.vue @@ -1,53 +1,38 @@ - - - \ No newline at end of file + router.push(props.to).catch((err) => { + console.error(err); + }); +} + + + diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue index b22edb9517e16bd5c4a3de2f569e996123d8320e..3f4c640171e8f80aecba3b1e0472631c3cf7f82a 100644 --- a/src/layout/components/Sidebar/Logo.vue +++ b/src/layout/components/Sidebar/Logo.vue @@ -1,77 +1,59 @@ + + - - diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index 2e48bb45758bc66a25e23aee509129877802fa89..06ebf71d2d9d81334eef82800de15a060060212f 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -1,102 +1,121 @@ - - + diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 5609acb78cf70491176262705c42968042e61881..3eb734aea033daefbeb5fbd2d89955fb1d03b7f9 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -1,51 +1,68 @@ + + - - +} + diff --git a/src/layout/components/TagsView/ScrollPane.vue b/src/layout/components/TagsView/ScrollPane.vue index 44207c1e046831933107fe587b76f9768bca5c88..cc0bb130b39e1ac0d1ebbbe481b4ec1c8737477e 100644 --- a/src/layout/components/TagsView/ScrollPane.vue +++ b/src/layout/components/TagsView/ScrollPane.vue @@ -1,49 +1,25 @@ - - + + diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index f59b966def646c29a3d307294136ed7380e4c6ef..717c6c91638bf323b52565ecae24de44304b5a1e 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -1,122 +1,54 @@ - - - - - \ No newline at end of file + +.tag-menu { + position: absolute; + z-index: 99; + font-size: 12px; + background: var(--el-bg-color-overlay); + border-radius: 4px; + box-shadow: var(--el-box-shadow-light); + + li { + padding: 8px 16px; + cursor: pointer; + + &:hover { + background: var(--el-fill-color-light); + } + } +} + diff --git a/src/layout/components/index.ts b/src/layout/components/index.ts index 6fea3b874d6f6df5d421770d62030bf813f9aef2..616c59b0373d1648ec805a975fba5f39ca8741df 100644 --- a/src/layout/components/index.ts +++ b/src/layout/components/index.ts @@ -1,4 +1,4 @@ -export { default as Navbar } from './Navbar.vue' -export { default as AppMain } from './AppMain.vue' -export { default as Settings } from './Settings/index.vue' -export { default as TagsView } from './TagsView/index.vue' +export { default as Navbar } from "./NavBar/index.vue"; +export { default as AppMain } from "./AppMain.vue"; +export { default as Settings } from "./Settings/index.vue"; +export { default as TagsView } from "./TagsView/index.vue"; diff --git a/src/layout/index.vue b/src/layout/index.vue index 54f727f8d903a972b7acb532b668d1f3efd02d03..0d2e4589b3168f3b59f03f687d1ceedfbac0c513 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,24 +1,3 @@ - - - diff --git a/src/main.ts b/src/main.ts index e5c254a149e93eeaac35851d7c91a86410d6617c..3b57f7c4e9335a7ba318010e2c8231e28e9b7d7e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,43 +1,26 @@ -import {createApp, Directive} from 'vue' -import App from './App.vue' +import { createApp } from "vue"; +import App from "./App.vue"; import router from "@/router"; +import { setupStore } from "@/store"; +import { setupDirective } from "@/directive"; -import { createPinia } from "pinia" -import {localStorage} from "@/utils/storage"; +import "@/permission"; -import ElementPlus from 'element-plus' -import 'element-plus/theme-chalk/index.css' -import Pagination from '@/components/Pagination/index.vue' -import '@/permission' - -// 引入svg注册脚本 -import 'virtual:svg-icons-register'; +// 本地SVG图标 +import "virtual:svg-icons-register"; // 国际化 import i18n from "@/lang/index"; -// 自定义样式 -import '@/styles/index.scss' - -// 全局方法 -import {listDictsByCode} from '@/api/system/dict' - -const app = createApp(App) - -// 自定义指令 -import * as directive from "@/directive"; - -Object.keys(directive).forEach(key => { - app.directive(key, (directive as { [key: string]: Directive })[key]); -}); +// 样式 +import "element-plus/theme-chalk/dark/css-vars.css"; +import "@/styles/index.scss"; +import "uno.css"; -// 全局方法 -app.config.globalProperties.$listDictsByCode = listDictsByCode +const app = createApp(App); +// 全局注册 自定义指令(directive) +setupDirective(app); +// 全局注册 状态管理(store) +setupStore(app); -// 注册全局组件 -app.component('Pagination', Pagination) - .use(createPinia()) - .use(router) - .use(ElementPlus, {size: localStorage.get('size') || 'default'}) - .use(i18n) - .mount('#app') +app.use(router).use(i18n).mount("#app"); diff --git a/src/permission.ts b/src/permission.ts index 10ffbdee5ac6cd8aee4f2fe41a5ec3a495487c10..f8b8c811388779f21ae63957e0516027c4fa82ba 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -1,56 +1,62 @@ import router from "@/router"; -import { ElMessage } from "element-plus"; -import useStore from "@/store"; -import NProgress from 'nprogress'; -import 'nprogress/nprogress.css' -NProgress.configure({ showSpinner: false }) // 进度环显示/隐藏 +import { useUserStoreHook } from "@/store/modules/user"; +import { usePermissionStoreHook } from "@/store/modules/permission"; +import NProgress from "nprogress"; +import "nprogress/nprogress.css"; + +NProgress.configure({ showSpinner: false }); // 进度条 + +const permissionStore = usePermissionStoreHook(); // 白名单路由 -const whiteList = ['/login', '/auth-redirect'] +const whiteList = ["/login"]; -router.beforeEach(async (to, form, next) => { - NProgress.start() - const { user, permission } = useStore() - const hasToken = user.token - if (hasToken) { - // 登录成功,跳转到首页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() - } else { - const hasGetUserInfo = user.roles.length > 0 - if (hasGetUserInfo) { - next() - } else { - try { - await user.getUserInfo() - const roles = user.roles - const accessRoutes: any = await permission.generateRoutes(roles) - accessRoutes.forEach((route: any) => { - router.addRoute(route) - }) - next({ ...to, replace: true }) - } catch (error) { - // 移除 token 并跳转登录页 - await user.resetToken() - ElMessage.error(error as any || 'Has Error') - next(`/login?redirect=${to.path}`) - NProgress.done() - } - } - } +router.beforeEach(async (to, from, next) => { + NProgress.start(); + const hasToken = localStorage.getItem("accessToken"); + if (hasToken) { + if (to.path === "/login") { + // 如果已登录,跳转首页 + next({ path: "/" }); + NProgress.done(); } else { - // 未登录可以访问白名单页面(登录页面) - if (whiteList.indexOf(to.path) !== -1) { - next() + const userStore = useUserStoreHook(); + const hasRoles = userStore.roles && userStore.roles.length > 0; + if (hasRoles) { + // 未匹配到任何路由,跳转404 + if (to.matched.length === 0) { + from.name ? next({ name: from.name }) : next("/404"); } else { - next(`/login?redirect=${to.path}`) - NProgress.done() + next(); } + } else { + try { + const { roles } = await userStore.getInfo(); + const accessRoutes = await permissionStore.generateRoutes(roles); + accessRoutes.forEach((route) => { + router.addRoute(route); + }); + next({ ...to, replace: true }); + } catch (error) { + // 移除 token 并跳转登录页 + await userStore.resetToken(); + next(`/login?redirect=${to.path}`); + NProgress.done(); + } + } + } + } else { + // 未登录可以访问白名单页面 + if (whiteList.indexOf(to.path) !== -1) { + next(); + } else { + next(`/login?redirect=${to.path}`); + NProgress.done(); } -}) + } +}); router.afterEach(() => { - NProgress.done() -}) + NProgress.done(); +}); diff --git a/src/router/index.ts b/src/router/index.ts index 730fbbef90b49153d7f26af2ac9fe74ee8f07285..07a8302ba0664a3bd07908e4df04f65cec8632a3 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,64 +1,76 @@ -import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' -import useStore from "@/store"; +import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"; -export const Layout = () => import('@/layout/index.vue') +export const Layout = () => import("@/layout/index.vue"); -// 参数说明: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html // 静态路由 -export const constantRoutes: Array = [ - { - path: '/redirect', - component: Layout, +export const constantRoutes: RouteRecordRaw[] = [ + { + path: "/redirect", + component: Layout, + meta: { hidden: true }, + children: [ + { + path: "/redirect/:path(.*)", + component: () => import("@/views/redirect/index.vue"), + }, + ], + }, + + { + path: "/login", + component: () => import("@/views/login/index.vue"), + meta: { hidden: true }, + }, + + { + path: "/", + component: Layout, + redirect: "/dashboard", + children: [ + { + path: "dashboard", + component: () => import("@/views/dashboard/index.vue"), + name: "Dashboard", // 用于 keep-alive, 必须与SFC自动推导或者显示声明的组件name一致 + // https://cn.vuejs.org/guide/built-ins/keep-alive.html#include-exclude + meta: { + title: "dashboard", + icon: "homepage", + affix: true, + keepAlive: true, + }, + }, + { + path: "profile", + component: () => import("@/views/profile/index.vue"), + name: "Profile", + meta: { hidden: true, title: "个人中心" }, + }, + { + path: "401", + component: () => import("@/views/error-page/401.vue"), + meta: { hidden: true }, + }, + { + path: "404", + component: () => import("@/views/error-page/404.vue"), meta: { hidden: true }, - children: [ - { - path: '/redirect/:path(.*)', - component: () => import('@/views/redirect/index.vue') - } - ] - }, - { - path: '/login', - component: () => import('@/views/login/index.vue'), - meta: { hidden: true } - }, - { - path: '/404', - component: () => import('@/views/error-page/404.vue'), - meta: { hidden: true } - }, - { - path: '/401', - component: () => import('@/views/error-page/401.vue'), - meta: { hidden: true } - }, - { - path: '/', - component: Layout, - redirect: '/dashboard', - children: [ - { - path: 'dashboard', - component: () => import('@/views/dashboard/index.vue'), - name: 'Dashboard', - meta: { title: 'dashboard', icon: 'dashboard', affix: true } - } - ] - } + }, + ], + }, - // 外部链接 - /*{ - path: '/external-link', - component: Layout, - children: [ - { - path: 'https://www.cnblogs.com/haoxianrui/', - meta: { title: '外部链接', icon: 'link' } - } - ] - }*/ - // 多级嵌套路由 - /* { + // 外部链接 + // { + // path: "/external-link", + // component: Layout, + // children: [ { + // component: () => import("@/views/external-link/index.vue"), + // path: "https://www.cnblogs.com/haoxianrui/", + // meta: { title: "外部链接", icon: "link" }, + // }, + // ], + // }, + // 多级嵌套路由 + /* { path: '/nested', component: Layout, redirect: '/nested/level1/level2', @@ -97,25 +109,23 @@ export const constantRoutes: Array = [ }, ] }*/ -] +]; -// 创建路由 +/** + * 创建路由 + */ const router = createRouter({ - history: createWebHashHistory(), - routes: constantRoutes as RouteRecordRaw[], - // 刷新时,滚动条位置还原 - scrollBehavior: () => ({ left: 0, top: 0 }) -}) + history: createWebHashHistory(), + routes: constantRoutes as RouteRecordRaw[], + // 刷新时,滚动条位置还原 + scrollBehavior: () => ({ left: 0, top: 0 }), +}); -// 重置路由 +/** + * 重置路由 + */ export function resetRouter() { - const { permission } = useStore() - permission.routes.forEach((route) => { - const name = route.name - if (name && router.hasRoute(name)) { - router.removeRoute(name) - } - }) + router.replace({ path: "/login" }); } -export default router \ No newline at end of file +export default router; diff --git a/src/settings.ts b/src/settings.ts index cbff21f2a38bddab386b967431fe0ac900878a50..e5ed4d783ce28169c19fcabc422787dada5c8c1c 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -1,21 +1,62 @@ +// 系统设置 interface DefaultSettings { - title: string, - showSettings: boolean, - tagsView: boolean, - fixedHeader: boolean, - sidebarLogo: boolean, - errorLog: string -} + /** + * 系统title + */ + title: string; + /** + * 是否显示设置 + */ + showSettings: boolean; + /** + * 是否显示多标签导航 + */ + tagsView: boolean; + /** + *是否固定头部 + */ + fixedHeader: boolean; + /** + * 是否显示侧边栏Logo + */ + sidebarLogo: boolean; + /** + * 导航栏布局 + */ + layout: string; + /** + * 主题模式 + */ + theme: string; -const defaultSettings: DefaultSettings = { - title: 'vue3-element-admin', - showSettings: true, - tagsView: true, - fixedHeader: false, - // 是否显示Logo - sidebarLogo: true, - errorLog: 'production' + /** + * 布局大小 + */ + size: string; + + /** + * 语言 + */ + language: string; } -export default defaultSettings \ No newline at end of file +const defaultSettings: DefaultSettings = { + title: "vue3-element-admin", + showSettings: true, + tagsView: true, + fixedHeader: false, + sidebarLogo: true, + layout: "left", + /** + * 主题模式 + * + * dark:暗黑模式 + * light: 明亮模式 + */ + theme: "dark", + size: "default", // default |large |small + language: "zh-cn", // zh-cn| en +}; + +export default defaultSettings; diff --git a/src/store/index.ts b/src/store/index.ts index 184ebbdc0fb8a31176a774ef715d3bd90ab63e6c..e22b67c4e657d0d3b62d4c22418e772e3eae0db2 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,15 +1,11 @@ -import useUserStore from './modules/user' -import useAppStore from './modules/app' -import usePermissionStore from './modules/permission' -import useSettingStore from './modules/settings' -import useTagsViewStore from './modules/tagsView' +import type { App } from "vue"; +import { createPinia } from "pinia"; -const useStore = () => ({ - user: useUserStore(), - app: useAppStore(), - permission: usePermissionStore(), - setting: useSettingStore(), - tagsView: useTagsViewStore() -}) +const store = createPinia(); -export default useStore \ No newline at end of file +// 全局注册 store +export function setupStore(app: App) { + app.use(store); +} + +export { store }; diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts index c4f532073976b1f1435afb1ced25fe4f2ed03b05..cd1c1860f37691cdb9517da7cee096cbafd23c68 100644 --- a/src/store/modules/app.ts +++ b/src/store/modules/app.ts @@ -1,46 +1,85 @@ -import { AppState } from "@/types"; -import { localStorage } from "@/utils/storage"; import { defineStore } from "pinia"; -import { getLanguage } from '@/lang/index' - -const useAppStore = defineStore({ - id: "app", - state: (): AppState => ({ - device: 'desktop', - sidebar: { - opened: localStorage.get('sidebarStatus') ? !!+localStorage.get('sidebarStatus') : true, - withoutAnimation: false - }, - language: getLanguage(), - size: localStorage.get('size') || 'default' - }), - actions: { - toggleSidebar() { - this.sidebar.opened = !this.sidebar.opened - this.sidebar.withoutAnimation = false - if (this.sidebar.opened) { - localStorage.set('sidebarStatus', 1) - } else { - localStorage.set('sidebarStatus', 0) - } - }, - closeSideBar(withoutAnimation: any) { - localStorage.set('sidebarStatus', 0) - this.sidebar.opened = false - this.sidebar.withoutAnimation = withoutAnimation - }, - toggleDevice(device: string) { - this.device = device - }, - setSize(size: string) { - this.size = size - localStorage.set('size', size) - }, - setLanguage(language: string) { - this.language = language - localStorage.set('language', language) - } +import { useStorage } from "@vueuse/core"; +import defaultSettings from "@/settings"; + +// 导入 Element Plus 中英文语言包 +import zhCn from "element-plus/es/locale/lang/zh-cn"; +import en from "element-plus/es/locale/lang/en"; + +// setup +export const useAppStore = defineStore("app", () => { + // state + const device = useStorage("device", "desktop"); + const size = useStorage("size", defaultSettings.size); + const language = useStorage("language", defaultSettings.language); + + const sidebarStatus = useStorage("sidebarStatus", "closed"); + const sidebar = reactive({ + opened: sidebarStatus.value !== "closed", + withoutAnimation: false, + }); + + /** + * 根据语言标识读取对应的语言包 + */ + const locale = computed(() => { + if (language?.value == "en") { + return en; + } else { + return zhCn; + } + }); + + // actions + function toggleSidebar(withoutAnimation: boolean) { + sidebar.opened = !sidebar.opened; + sidebar.withoutAnimation = withoutAnimation; + if (sidebar.opened) { + sidebarStatus.value = "opened"; + } else { + sidebarStatus.value = "closed"; } -}) + } + + function closeSideBar(withoutAnimation: boolean) { + sidebar.opened = false; + sidebar.withoutAnimation = withoutAnimation; + sidebarStatus.value = "closed"; + } + + function openSideBar(withoutAnimation: boolean) { + sidebar.opened = true; + sidebar.withoutAnimation = withoutAnimation; + sidebarStatus.value = "opened"; + } + + function toggleDevice(val: string) { + device.value = val; + } + + function changeSize(val: string) { + size.value = val; + } + /** + * 切换语言 + * + * @param val + */ + function changeLanguage(val: string) { + language.value = val; + } -export default useAppStore; \ No newline at end of file + return { + device, + sidebar, + language, + locale, + size, + toggleDevice, + changeSize, + changeLanguage, + toggleSidebar, + closeSideBar, + openSideBar, + }; +}); diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 2a4ece30a674a9635867090641be9ec1ee666dbd..8a69655d5522006b185b27dbab5503969aef525d 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -1,76 +1,106 @@ -import { PermissionState } from "@/types"; -import { RouteRecordRaw } from 'vue-router' +import { RouteRecordRaw } from "vue-router"; import { defineStore } from "pinia"; -import { constantRoutes } from '@/router' -import { listRoutes } from "@/api/system/menu"; +import { constantRoutes } from "@/router"; +import { store } from "@/store"; +import { listRoutes } from "@/api/menu"; const modules = import.meta.glob("../../views/**/**.vue"); -export const Layout = () => import('@/layout/index.vue') +const Layout = () => import("@/layout/index.vue"); +/** + * Use meta.role to determine if the current user has permission + * + * @param roles 用户角色集合 + * @param route 路由 + * @returns + */ const hasPermission = (roles: string[], route: RouteRecordRaw) => { - if (route.meta && route.meta.roles) { - if (roles.includes('ROOT')) { - return true - } - return roles.some(role => { - if (route.meta?.roles !== undefined) { - return (route.meta.roles as string[]).includes(role); - } - }) + if (route.meta && route.meta.roles) { + // 角色【超级管理员】拥有所有权限,忽略校验 + if (roles.includes("ROOT")) { + return true; } - return false -} + return roles.some((role) => { + if (route.meta?.roles !== undefined) { + return (route.meta.roles as string[]).includes(role); + } + }); + } + return false; +}; -export const filterAsyncRoutes = (routes: RouteRecordRaw[], roles: string[]) => { - const res: RouteRecordRaw[] = [] - routes.forEach(route => { - const tmp = { ...route } as any - if (hasPermission(roles, tmp)) { - if (tmp.component == 'Layout') { - tmp.component = Layout - } else { - const component = modules[`../../views/${tmp.component}.vue`] as any; - if (component) { - tmp.component = modules[`../../views/${tmp.component}.vue`]; - } else { - tmp.component = modules[`../../views/error-page/404.vue`]; - } - } - res.push(tmp) +/** + * 递归过滤有权限的异步(动态)路由 + * + * @param routes 接口返回的异步(动态)路由 + * @param roles 用户角色集合 + * @returns 返回用户有权限的异步(动态)路由 + */ +const filterAsyncRoutes = (routes: RouteRecordRaw[], roles: string[]) => { + const asyncRoutes: RouteRecordRaw[] = []; - if (tmp.children) { - tmp.children = filterAsyncRoutes(tmp.children, roles) - } + routes.forEach((route) => { + const tmpRoute = { ...route }; // ES6扩展运算符复制新对象 + + // 判断用户(角色)是否有该路由的访问权限 + if (hasPermission(roles, tmpRoute)) { + if (tmpRoute.component?.toString() == "Layout") { + tmpRoute.component = Layout; + console.log(); + } else { + const component = modules[`../../views/${tmpRoute.component}.vue`]; + if (component) { + tmpRoute.component = component; + } else { + tmpRoute.component = modules[`../../views/error-page/404.vue`]; } - }) - return res -} + } + if (tmpRoute.children) { + tmpRoute.children = filterAsyncRoutes(tmpRoute.children, roles); + } -const usePermissionStore = defineStore({ - id: "permission", - state: (): PermissionState => ({ - routes: [], - addRoutes: [] - }), - actions: { - setRoutes(routes: RouteRecordRaw[]) { - this.addRoutes = routes - this.routes = constantRoutes.concat(routes) - }, - generateRoutes(roles: string[]) { - return new Promise((resolve, reject) => { - listRoutes().then(response => { - const asyncRoutes = response.data - let accessedRoutes = filterAsyncRoutes(asyncRoutes, roles) - this.setRoutes(accessedRoutes) - resolve(accessedRoutes) - }).catch(error => { - reject(error) - }) - }) - } + asyncRoutes.push(tmpRoute); } -}) + }); -export default usePermissionStore; + return asyncRoutes; +}; + +// setup +export const usePermissionStore = defineStore("permission", () => { + // state + const routes = ref([]); + + // actions + function setRoutes(newRoutes: RouteRecordRaw[]) { + routes.value = constantRoutes.concat(newRoutes); + } + /** + * 生成动态路由 + * + * @param roles 用户角色集合 + * @returns + */ + function generateRoutes(roles: string[]) { + return new Promise((resolve, reject) => { + // 接口获取所有路由 + listRoutes() + .then(({ data: asyncRoutes }) => { + // 根据角色获取有访问权限的路由 + const accessedRoutes = filterAsyncRoutes(asyncRoutes, roles); + setRoutes(accessedRoutes); + resolve(accessedRoutes); + }) + .catch((error) => { + reject(error); + }); + }); + } + return { routes, setRoutes, generateRoutes }; +}); + +// 非setup +export function usePermissionStoreHook() { + return usePermissionStore(store); +} diff --git a/src/store/modules/settings.ts b/src/store/modules/settings.ts index 069c75ca2f9fd86389b84cf13432a5870205cbea..908359c3e1b3238e8a05d5594109396623e65f2b 100644 --- a/src/store/modules/settings.ts +++ b/src/store/modules/settings.ts @@ -1,45 +1,47 @@ import { defineStore } from "pinia"; -import { SettingState } from "@/types"; -import defaultSettings from '../../settings' -import { localStorage } from "@/utils/storage"; +import defaultSettings from "@/settings"; +import { useStorage } from "@vueuse/core"; -const { showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings -import variables from '@/styles/element-variables.module.scss' +export const useSettingsStore = defineStore("setting", () => { + // state + const tagsView = useStorage("tagsView", defaultSettings.tagsView); -export const useSettingStore = defineStore({ - id: "setting", - state: (): SettingState => ({ - theme: localStorage.get("theme") || variables.theme, - showSettings: showSettings, - tagsView: localStorage.get("tagsView") != null ? localStorage.get("tagsView") : tagsView, - fixedHeader: fixedHeader, - sidebarLogo: sidebarLogo, - }), - actions: { - async changeSetting(payload: { key: string, value: any }) { - const { key, value } = payload - switch (key) { - case 'theme': - this.theme = value - break - case 'showSettings': - this.showSettings = value - break - case 'fixedHeader': - this.fixedHeader = value - break - case 'tagsView': - this.tagsView = value - localStorage.set("tagsView", value) - break - case 'sidebarLogo': - this.sidebarLogo = value - break - default: - break - } - } + const showSettings = ref(defaultSettings.showSettings); + const fixedHeader = ref(defaultSettings.fixedHeader); + const sidebarLogo = ref(defaultSettings.sidebarLogo); + + const layout = useStorage("layout", defaultSettings.layout); + + // actions + function changeSetting(param: { key: string; value: any }) { + const { key, value } = param; + switch (key) { + case "showSettings": + showSettings.value = value; + break; + case "fixedHeader": + fixedHeader.value = value; + break; + case "tagsView": + tagsView.value = value; + break; + case "sidevarLogo": + sidebarLogo.value = value; + break; + case "layout": + layout.value = value; + break; + default: + break; } -}) + } -export default useSettingStore; + return { + showSettings, + tagsView, + fixedHeader, + sidebarLogo, + layout, + changeSetting, + }; +}); diff --git a/src/store/modules/tagsView.ts b/src/store/modules/tagsView.ts index d40849ccf6eb063e645eeb72f3228d3ed68ad66b..971e6a748054e72cb735c947abc784ff7ee6b693 100644 --- a/src/store/modules/tagsView.ts +++ b/src/store/modules/tagsView.ts @@ -1,175 +1,217 @@ import { defineStore } from "pinia"; -import { TagsViewState } from "@/types"; - -const useTagsViewStore = defineStore({ - id: "tagsView", - state: (): TagsViewState => ({ - visitedViews: [], - cachedViews: [] - }), - actions: { - addVisitedView(view: any) { - if (this.visitedViews.some(v => v.path === view.path)) return - this.visitedViews.push( - Object.assign({}, view, { - title: view.meta?.title || 'no-name' - }) - ) - }, - addCachedView(view: any) { - if (this.cachedViews.includes(view.name)) return - if (!view.meta.noCache) { - this.cachedViews.push(view.name) - } - }, - - delVisitedView(view: any) { - return new Promise(resolve => { - for (const [i, v] of this.visitedViews.entries()) { - if (v.path === view.path) { - this.visitedViews.splice(i, 1) - break - } - } - resolve([...this.visitedViews]) - }) - - }, - delCachedView(view: any) { - return new Promise(resolve => { - const index = this.cachedViews.indexOf(view.name) - index > -1 && this.cachedViews.splice(index, 1) - resolve([...this.cachedViews]) - }) - - }, - - delOtherVisitedViews(view: any) { - return new Promise(resolve => { - this.visitedViews = this.visitedViews.filter(v => { - return v.meta?.affix || v.path === view.path - }) - resolve([...this.visitedViews]) - }) - - }, - delOtherCachedViews(view: any) { - return new Promise(resolve => { - const index = this.cachedViews.indexOf(view.name) - if (index > -1) { - this.cachedViews = this.cachedViews.slice(index, index + 1) - } else { - // if index = -1, there is no cached tags - this.cachedViews = [] - } - resolve([...this.cachedViews]) - }) - - }, - - updateVisitedView(view: any) { - for (let v of this.visitedViews) { - if (v.path === view.path) { - v = Object.assign(v, view) - break - } - } - }, - addView(view: any) { - this.addVisitedView(view) - this.addCachedView(view) - }, - delView(view: any) { - return new Promise(resolve => { - this.delVisitedView(view) - this.delCachedView(view) - resolve({ - visitedViews: [...this.visitedViews], - cachedViews: [...this.cachedViews] - }) - }) - }, - delOtherViews(view: any) { - return new Promise(resolve => { - this.delOtherVisitedViews(view) - this.delOtherCachedViews(view) - resolve({ - visitedViews: [...this.visitedViews], - cachedViews: [...this.cachedViews] - }) - }) - }, - delLeftViews(view: any) { - return new Promise(resolve => { - const currIndex = this.visitedViews.findIndex(v => v.path === view.path) - if (currIndex === -1) { - return - } - this.visitedViews = this.visitedViews.filter((item, index) => { - // affix:true 固定tag,例如“首页” - if (index >= currIndex || (item.meta && item.meta.affix)) { - return true - } - - const cacheIndex = this.cachedViews.indexOf(item.name as string) - if (cacheIndex > -1) { - this.cachedViews.splice(cacheIndex, 1) - } - return false - }) - resolve({ - visitedViews: [...this.visitedViews] - }) - }) - }, - delRightViews(view: any) { - return new Promise(resolve => { - const currIndex = this.visitedViews.findIndex(v => v.path === view.path) - if (currIndex === -1) { - return - } - this.visitedViews = this.visitedViews.filter((item, index) => { - // affix:true 固定tag,例如“首页” - if (index <= currIndex || (item.meta && item.meta.affix)) { - return true - } - - const cacheIndex = this.cachedViews.indexOf(item.name as string) - if (cacheIndex > -1) { - this.cachedViews.splice(cacheIndex, 1) - } - return false - }) - resolve({ - visitedViews: [...this.visitedViews] - }) - }) - }, - delAllViews(view: any) { - return new Promise(resolve => { - const affixTags = this.visitedViews.filter(tag => tag.meta?.affix) - this.visitedViews = affixTags - this.cachedViews = [] - resolve({ - visitedViews: [...this.visitedViews], - cachedViews: [...this.cachedViews] - }) - }) - }, - delAllVisitedViews() { - return new Promise(resolve => { - const affixTags = this.visitedViews.filter(tag => tag.meta?.affix) - this.visitedViews = affixTags - resolve([...this.visitedViews]) - }) - }, - delAllCachedViews() { - return new Promise(resolve => { - this.cachedViews = [] - resolve([...this.cachedViews]) - }) - }, +import { RouteLocationNormalized } from "vue-router"; + +export interface TagView extends Partial { + title?: string; +} + +// setup +export const useTagsViewStore = defineStore("tagsView", () => { + // state + const visitedViews = ref([]); + const cachedViews = ref([]); + + // actions + function addVisitedView(view: TagView) { + if (visitedViews.value.some((v) => v.path === view.path)) return; + if (view.meta && view.meta.affix) { + visitedViews.value.unshift( + Object.assign({}, view, { + title: view.meta?.title || "no-name", + }) + ); + } else { + visitedViews.value.push( + Object.assign({}, view, { + title: view.meta?.title || "no-name", + }) + ); + } + } + + function addCachedView(view: TagView) { + const viewName = view.name as string; + if (cachedViews.value.includes(viewName)) return; + if (view.meta?.keepAlive) { + cachedViews.value.push(viewName); + } + } + + function delVisitedView(view: TagView) { + return new Promise((resolve) => { + for (const [i, v] of visitedViews.value.entries()) { + if (v.path === view.path) { + visitedViews.value.splice(i, 1); + break; + } + } + resolve([...visitedViews.value]); + }); + } + + function delCachedView(view: TagView) { + const viewName = view.name as string; + return new Promise((resolve) => { + const index = cachedViews.value.indexOf(viewName); + index > -1 && cachedViews.value.splice(index, 1); + resolve([...cachedViews.value]); + }); + } + + function delOtherVisitedViews(view: TagView) { + return new Promise((resolve) => { + visitedViews.value = visitedViews.value.filter((v) => { + return v.meta?.affix || v.path === view.path; + }); + resolve([...visitedViews.value]); + }); + } + + function delOtherCachedViews(view: TagView) { + const viewName = view.name as string; + return new Promise((resolve) => { + const index = cachedViews.value.indexOf(viewName); + if (index > -1) { + cachedViews.value = cachedViews.value.slice(index, index + 1); + } else { + // if index = -1, there is no cached tags + cachedViews.value = []; + } + resolve([...cachedViews.value]); + }); + } + + function updateVisitedView(view: TagView) { + for (let v of visitedViews.value) { + if (v.path === view.path) { + v = Object.assign(v, view); + break; + } } -}) + } + + function addView(view: TagView) { + addVisitedView(view); + addCachedView(view); + } + + function delView(view: TagView) { + return new Promise((resolve) => { + delVisitedView(view); + delCachedView(view); + resolve({ + visitedViews: [...visitedViews.value], + cachedViews: [...cachedViews.value], + }); + }); + } + + function delOtherViews(view: TagView) { + return new Promise((resolve) => { + delOtherVisitedViews(view); + delOtherCachedViews(view); + resolve({ + visitedViews: [...visitedViews.value], + cachedViews: [...cachedViews.value], + }); + }); + } + + function delLeftViews(view: TagView) { + return new Promise((resolve) => { + const currIndex = visitedViews.value.findIndex( + (v) => v.path === view.path + ); + if (currIndex === -1) { + return; + } + visitedViews.value = visitedViews.value.filter((item, index) => { + // affix:true 固定tag,例如“首页” + if (index >= currIndex || (item.meta && item.meta.affix)) { + return true; + } + + const cacheIndex = cachedViews.value.indexOf(item.name as string); + if (cacheIndex > -1) { + cachedViews.value.splice(cacheIndex, 1); + } + return false; + }); + resolve({ + visitedViews: [...visitedViews.value], + }); + }); + } + function delRightViews(view: TagView) { + return new Promise((resolve) => { + const currIndex = visitedViews.value.findIndex( + (v) => v.path === view.path + ); + if (currIndex === -1) { + return; + } + visitedViews.value = visitedViews.value.filter((item, index) => { + // affix:true 固定tag,例如“首页” + if (index <= currIndex || (item.meta && item.meta.affix)) { + return true; + } + + const cacheIndex = cachedViews.value.indexOf(item.name as string); + if (cacheIndex > -1) { + cachedViews.value.splice(cacheIndex, 1); + } + return false; + }); + resolve({ + visitedViews: [...visitedViews.value], + }); + }); + } + + function delAllViews() { + return new Promise((resolve) => { + const affixTags = visitedViews.value.filter((tag) => tag.meta?.affix); + visitedViews.value = affixTags; + cachedViews.value = []; + resolve({ + visitedViews: [...visitedViews.value], + cachedViews: [...cachedViews.value], + }); + }); + } + + function delAllVisitedViews() { + return new Promise((resolve) => { + const affixTags = visitedViews.value.filter((tag) => tag.meta?.affix); + visitedViews.value = affixTags; + resolve([...visitedViews.value]); + }); + } + + function delAllCachedViews() { + return new Promise((resolve) => { + cachedViews.value = []; + resolve([...cachedViews.value]); + }); + } -export default useTagsViewStore; + return { + visitedViews, + cachedViews, + addVisitedView, + addCachedView, + delVisitedView, + delCachedView, + delOtherVisitedViews, + delOtherCachedViews, + updateVisitedView, + addView, + delView, + delOtherViews, + delLeftViews, + delRightViews, + delAllViews, + delAllVisitedViews, + delAllCachedViews, + }; +}); diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 4b5f9556b584068dc96095a934437d339e3c0dd2..d30fee09d5fc0c086999d61d9c6645c162dcaa63 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,105 +1,110 @@ import { defineStore } from "pinia"; -import { LoginFormData, UserState } from "@/types"; -import { localStorage } from "@/utils/storage"; -import { login, logout } from "@/api/login"; -import { getUserInfo } from "@/api/system/user"; + +import { loginApi, logoutApi } from "@/api/auth"; +import { getUserInfo } from "@/api/user"; import { resetRouter } from "@/router"; +import { store } from "@/store"; + +import { LoginData } from "@/api/auth/types"; +import { UserInfo } from "@/api/user/types"; + +import { useStorage } from "@vueuse/core"; + +export const useUserStore = defineStore("user", () => { + // state + const userId = ref(); + const token = useStorage("accessToken", ""); + const nickname = ref(""); + const avatar = ref(""); + const roles = ref>([]); // 用户角色编码集合 → 判断路由权限 + const perms = ref>([]); // 用户权限编码集合 → 判断按钮权限 + + /** + * 登录调用 + * + * @param {LoginData} + * @returns + */ + function login(loginData: LoginData) { + return new Promise((resolve, reject) => { + loginApi(loginData) + .then((response) => { + const { tokenType, accessToken } = response.data; + token.value = tokenType + " " + accessToken; // Bearer eyJhbGciOiJIUzI1NiJ9.xxx.xxx + resolve(); + }) + .catch((error) => { + reject(error); + }); + }); + } -const useUserStore = defineStore({ - id: "user", - state: (): UserState => ({ - token: localStorage.get('token') || '', - nickname: '', - avatar: '', - roles: [], - perms: [] - }), - actions: { - async RESET_STATE() { - this.$reset() - }, - /** - * 用户登录请求 - * @param userInfo 登录用户信息 - * username: 用户名 - * password: 密码 - * code: 验证码 - * uuid: 匹配正确验证码的 key - */ - login(userInfo: LoginFormData) { - const { username, password, code, uuid } = userInfo - return new Promise((resolve, reject) => { - login( - { - username: username.trim(), - password: password, - grant_type: 'captcha', - code: code, - uuid: uuid - } - ).then(response => { - const { access_token, token_type } = response.data - const accessToken = token_type + " " + access_token - localStorage.set("token", accessToken) - this.token = accessToken - resolve(access_token) - }).catch(error => { - reject(error) - }) - }) - }, - /** - * 获取用户信息(昵称、头像、角色集合、权限集合) - */ - getUserInfo() { - return new Promise(((resolve, reject) => { - getUserInfo().then(({data}) => { - if (!data) { - return reject('Verification failed, please Login again.') - } - const { nickname, avatar, roles, perms } = data - if (!roles || roles.length <= 0) { - reject('getUserInfo: roles must be a non-null array!') - } - this.nickname = nickname - this.avatar = avatar - this.roles = roles - this.perms = perms - resolve(data) - }).catch(error => { - reject(error) - }) - }) - ) - }, + // 获取信息(用户昵称、头像、角色集合、权限集合) + function getInfo() { + return new Promise((resolve, reject) => { + getUserInfo() + .then(({ data }) => { + if (!data) { + return reject("Verification failed, please Login again."); + } + if (!data.roles || data.roles.length <= 0) { + reject("getUserInfo: roles must be a non-null array!"); + } + userId.value = data.userId; + nickname.value = data.nickname; + avatar.value = data.avatar; + roles.value = data.roles; + perms.value = data.perms; + resolve(data); + }) + .catch((error) => { + reject(error); + }); + }); + } - /** - * 注销 - */ - logout() { - return new Promise(((resolve, reject) => { - logout().then(() => { - localStorage.remove('token') - this.RESET_STATE() - resetRouter() - resolve(null) - }).catch(error => { - reject(error) - }) - })) - }, + // 注销 + function logout() { + return new Promise((resolve, reject) => { + logoutApi() + .then(() => { + resetRouter(); + resetToken(); + location.reload(); // 清空路由 + resolve(); + }) + .catch((error) => { + reject(error); + }); + }); + } - /** - * 清除 Token - */ - resetToken() { - return new Promise(resolve => { - localStorage.remove('token') - this.RESET_STATE() - resolve(null) - }) - } - } -}) + // 重置 + function resetToken() { + token.value = ""; + nickname.value = ""; + avatar.value = ""; + roles.value = []; + perms.value = []; + } + return { + token, + nickname, + avatar, + roles, + perms, + login, + getInfo, + logout, + resetToken, + /** + * 当前登录用户ID + */ + userId, + }; +}); -export default useUserStore; \ No newline at end of file +// 非setup +export function useUserStoreHook() { + return useUserStore(store); +} diff --git a/src/styles/dark.scss b/src/styles/dark.scss new file mode 100644 index 0000000000000000000000000000000000000000..2025ceb669995d0014312b9c6bbcda849a9884c1 --- /dev/null +++ b/src/styles/dark.scss @@ -0,0 +1,52 @@ +html.dark { + --menuBg: var(--el-bg-color-overlay); + --menuText: #fff; + --menuActiveText: var(--el-menu-active-color); + --menuHover: rgb(0 0 0 / 20%); + --subMenuBg: var(--el-menu-bg-color); + --subMenuActiveText: var(--el-menu-active-color); + --subMenuHover: rgb(0 0 0 / 20%); + + // wang-editor toolbar + --w-e-toolbar-bg-color: var(--el-bg-color-overlay); + --w-e-toolbar-color: var(--el-text-color-regulary); + --w-e-toolbar-active-bg-color: var(--el-bg-color-page); + --w-e-toolbar-active-color: var(--el-color-info-dark-2); + --w-e-toolbar-disabled-color: var(--el-disabled-text-color); + --w-e-toolbar-border-color: var(--el-color-info-light-8); + + // wang-editor textarea + --w-e-textarea-bg-color: var(--el-bg-color-overlay); + --w-e-textarea-color: var(--el-text-color-regulary); + --w-e-textarea-slight-border-color: var(--el-color-primary); + --w-e-textarea-slight-bg-color: rgb(var(--el-color-primary-rgb) 0.1); + --w-e-textarea-selected-border-color: var(--el-color-primary); + --w-e-textarea-border-color: var(--el-color-info-light-5); + + // // wang-editor modal + --w-e-modal-button-bg-color: var(--el-button-bg-color); + --w-e-modal-button-border-color: var(--el-color-info-light-3); + + .navbar { + background-color: var(--el-bg-color); + + .setting-container .setting-item:hover { + background: var(--el-fill-color-light); + } + } + + .right-panel-btn { + background-color: var(--el-color-primary-dark); + } + + .svg-icon, + svg { + fill: var(--el-text-color-regular); + } + + .sidebar-container { + .el-menu-item.is-active .svg-icon { + fill: var(--el-color-primary); + } + } +} diff --git a/src/styles/element-plus.scss b/src/styles/element-plus.scss deleted file mode 100644 index a6ca2a9b6961d14c461b0e60db0e2acd3a02471f..0000000000000000000000000000000000000000 --- a/src/styles/element-plus.scss +++ /dev/null @@ -1,96 +0,0 @@ -:root { - // 这里可以设置你自定义的颜色变量 - // 这个是element主要按钮:active的颜色,当主题更改后此变量的值也随之更改 - --el-color-primary-dark: #0d84ff; - // element plus 2.1.0 禁用文本色值和正常文本色值无法区分问题 - --el-text-color-disabled: #ccc; -} - -/* 核心组件的变量,下面这些样式是必须要写的 */ - -.el-link.el-link--primary:hover { - color: var(--el-color-primary-light-2) !important; -} - -.el-tag { - --el-tag-bg-color: var(--el-color-primary-light-9); - --el-tag-border-color: var(--el-color-primary-light-8); - --el-tag-text-color: var(--el-color-primary); - --el-tag-hover-color: var(--el-color-primary); -} - -.el-button--primary { - --el-button-text-color: var(--el-color-white) !important; - --el-button-bg-color: var(--el-color-primary) !important; - --el-button-border-color: var(--el-color-primary) !important; - --el-button-hover-bg-color: var(--el-color-primary-light-2) !important; - --el-button-hover-border-color: var(--el-color-primary-light-2) !important; - --el-button-active-bg-color: var(--el-color-primary-dark) !important; - --el-button-active-border-color: var(--el-color-primary-dark) !important; -} - -.el-button--primary.is-plain{ - --el-button-text-color: var(--el-color-primary)!important; - --el-button-bg-color: var(--el-color-primary-light-9)!important; - --el-button-border-color: var(--el-color-primary-light-5)!important; - --el-button-hover-text-color: var(--el-color-white)!important; - --el-button-hover-bg-color: var(--el-color-primary)!important; - --el-button-hover-border-color: var(--el-color-primary)!important; - --el-button-active-text-color: var(--el-color-white)!important; - --el-button-active-border-color: var(--el-color-primary)!important; -} - -// 覆盖 element-plus 的样式 -.el-breadcrumb__inner, -.el-breadcrumb__inner a { - font-weight: 400 !important; -} - -.el-upload { - input[type="file"] { - display: none !important; - } -} - -.el-upload__input { - display: none; -} - - -// refine element ui upload -.upload-container { - .el-upload { - width: 100%; - .el-upload-dragger { - width: 100%; - height: 200px; - } - } -} - -// dropdown -.el-dropdown-menu { - a { - display: block - } -} - -// to fix el-date-picker css style -.el-range-separator { - box-sizing: content-box; -} - -// 选中行背景色值 -.el-table__body tr.current-row td { - background-color: #e1f3d8b5 !important; -} - -// card 的header统一高度 -.el-card__header{ - height: 60px!important; -} - -// 表格表头和表体未对齐 -.el-table__header col[name="gutter"] { - display: table-cell !important; -} \ No newline at end of file diff --git a/src/styles/element-variables.module.scss b/src/styles/element-variables.module.scss deleted file mode 100644 index 2fe9a2b56884c16523ccb5b69fdd5e98c3d619c0..0000000000000000000000000000000000000000 --- a/src/styles/element-variables.module.scss +++ /dev/null @@ -1,29 +0,0 @@ -/** -* I think element default theme color is too light for long-term use. -* So I modified the default color and you can modify it to your liking. -* https://vitejs.cn/guide/features.html#postcss -**/ - -/* theme color */ -$--color-primary: #1890ff; -$--color-success: #13ce66; -$--color-warning: #ffba00; -$--color-danger: #ff4949; -// $--color-info: #1E1E1E; - -$--button-font-weight: 400; - -// $--color-text-regular: #1f2d3d; - -$--border-color-light: #dfe4ed; -$--border-color-lighter: #e6ebf5; - -$--table-border: 1px solid #dfe6ec; - -$--font-path: "~element-plus/theme-chalk/fonts"; - -// the :export directive is the magic sauce for webpack -// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass -:export { - theme: $--color-primary; -} diff --git a/src/styles/index.scss b/src/styles/index.scss index 1416e9dcb4d99830fa11b902113d8b408dac3859..6b635af27ae4685c802c08ef1547703ced65b4f1 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,67 +1,26 @@ -@import 'src/styles/variables.module'; -@import './mixin.scss'; -@import './transition.scss'; -@import 'src/styles/element-plus'; -@import './sidebar.scss'; +@import "./sidebar"; +@import "./reset"; +@import "./dark"; -body { - margin: 0; - padding: 0; - height: 100%; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - text-rendering: optimizeLegibility; - font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; -} - -label { - font-weight: 700; -} - -html { - height: 100%; - box-sizing: border-box; -} - -#app { - height: 100%; -} - -*, -*:before, -*:after { - box-sizing: inherit; +.app-container { + padding: 10px; } -a:focus, -a:active { - outline: none; +.search-container { + padding: 18px 0 0 10px; + margin-bottom: 10px; + background-color: var(--el-bg-color-overlay); + border: 1px solid var(--el-border-color-light); + border-radius: 4px; + box-shadow: var(--el-box-shadow-light); } -a, -a:focus, -a:hover { +.link-type, +.link-type:focus { + color: #337ab7; cursor: pointer; - color: inherit; - text-decoration: none; -} - -div:focus { - outline: none; -} -.clearfix { - &:after { - visibility: hidden; - display: block; - font-size: 0; - content: " "; - clear: both; - height: 0; + &:hover { + color: rgb(32 160 255); } } - -// main-container global css -.app-container { - padding: 20px; -} diff --git a/src/styles/mixin.scss b/src/styles/mixin.scss deleted file mode 100644 index 36b74bbd995e7cc5c6baab1ce6808ecfda8c27ae..0000000000000000000000000000000000000000 --- a/src/styles/mixin.scss +++ /dev/null @@ -1,28 +0,0 @@ -@mixin clearfix { - &:after { - content: ""; - display: table; - clear: both; - } -} - -@mixin scrollBar { - &::-webkit-scrollbar-track-piece { - background: #d3dce6; - } - - &::-webkit-scrollbar { - width: 6px; - } - - &::-webkit-scrollbar-thumb { - background: #99a9bf; - border-radius: 20px; - } -} - -@mixin relative { - position: relative; - width: 100%; - height: 100%; -} diff --git a/src/styles/reset.scss b/src/styles/reset.scss new file mode 100644 index 0000000000000000000000000000000000000000..9b19e4c45e7979f46fe8f577ff94603305f4bdaa --- /dev/null +++ b/src/styles/reset.scss @@ -0,0 +1,75 @@ +*, +::before, +::after { + box-sizing: border-box; + border-color: currentcolor; + border-style: solid; + border-width: 0; +} + +#app { + width: 100%; + height: 100%; +} + +html { + box-sizing: border-box; + width: 100%; + height: 100%; + line-height: 1.5; + tab-size: 4; + text-size-adjust: 100%; +} + +body { + width: 100%; + height: 100%; + margin: 0; + font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", + "Microsoft YaHei", "微软雅黑", Arial, sans-serif; + line-height: inherit; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + text-rendering: optimizelegibility; +} + +a { + color: inherit; + text-decoration: inherit; +} + +img, +svg { + display: inline-block; +} + +svg { + vertical-align: -0.15em; //因icon大小被设置为和字体大小一致,而span等标签的下边缘会和字体的基线对齐,故需设置一个往下的偏移比例,来纠正视觉上的未对齐效果 +} + +ul, +li { + padding: 0; + margin: 0; + list-style: none; +} + +*, +*::before, +*::after { + box-sizing: inherit; +} + +a, +a:focus, +a:hover { + color: inherit; + text-decoration: none; + cursor: pointer; +} + +a:focus, +a:active, +div:focus { + outline: none; +} diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss index b53e82c065eb3eca65d638ab33fa6b3b1bba1244..eb7e679e99eca3eb91cde17b7005b39e15cc543d 100644 --- a/src/styles/sidebar.scss +++ b/src/styles/sidebar.scss @@ -1,27 +1,27 @@ -#app { +.app { .main-container { + position: relative; min-height: 100%; - transition: margin-left .28s; margin-left: $sideBarWidth; - position: relative; + transition: margin-left 0.28s; } .sidebar-container { - transition: width 0.28s; - width: $sideBarWidth !important; - background-color: $menuBg; - height: 100%; position: fixed; - font-size: 0px; top: 0; bottom: 0; left: 0; z-index: 1001; + width: $sideBarWidth !important; + height: 100%; overflow: hidden; + background-color: $menuBg; + transition: width 0.28s; // reset element-ui css .horizontal-collapse-transition { - transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; + transition: 0s width ease-in-out, 0s padding-left ease-in-out, + 0s padding-right ease-in-out; } .scrollbar-wrapper { @@ -29,7 +29,7 @@ } .el-scrollbar__bar.is-vertical { - right: 0px; + right: 0; } .el-scrollbar { @@ -46,12 +46,6 @@ display: none; } - a { - display: inline-block; - width: 100%; - overflow: hidden; - } - .svg-icon { margin-right: 16px; } @@ -62,24 +56,23 @@ } .el-menu { - border: none; - height: 100%; width: 100% !important; + height: 100%; + border: none; } // menu hover - .submenu-title-noDropdown, .el-sub-menu__title { &:hover { background-color: $menuHover !important; } } - .is-active>.el-sub-menu__title { + .is-active > .el-sub-menu__title { color: $subMenuActiveText !important; } - & .nest-menu .el-sub-menu>.el-sub-menu__title, + & .nest-menu .el-sub-menu > .el-sub-menu__title, & .el-sub-menu .el-menu-item { min-width: $sideBarWidth !important; background-color: $subMenuBg !important; @@ -93,8 +86,9 @@ .hideSidebar { .sidebar-container { width: 54px !important; + .svg-icon { - margin-right: 0px; + margin-right: 0; } } @@ -102,27 +96,10 @@ margin-left: 54px; } - .submenu-title-noDropdown { - padding: 0 !important; - position: relative; - - .el-tooltip { - padding: 0 !important; - - .svg-icon { - margin-left: 20px; - } - - .sub-el-icon { - margin-left: 19px; - } - } - } - .el-sub-menu { overflow: hidden; - &>.el-sub-menu__title { + & > .el-sub-menu__title { padding: 0 !important; .svg-icon { @@ -141,13 +118,13 @@ .el-menu--collapse { .el-sub-menu { - &>.el-sub-menu__title { - &>span { - height: 0; + & > .el-sub-menu__title { + & > span { + display: inline-block; width: 0; + height: 0; overflow: hidden; visibility: hidden; - display: inline-block; } } } @@ -161,12 +138,12 @@ // mobile responsive .mobile { .main-container { - margin-left: 0px; + margin-left: 0; } .sidebar-container { - transition: transform .28s; width: $sideBarWidth !important; + transition: transform 0.28s; } &.hideSidebar { @@ -179,7 +156,6 @@ } .withoutAnimation { - .main-container, .sidebar-container { transition: none; @@ -189,17 +165,18 @@ // when menu collapsed .el-menu--vertical { - &>.el-menu { + & > .el-menu { .svg-icon { margin-right: 16px; } + .sub-el-icon { margin-right: 12px; margin-left: -2px; } } - .nest-menu .el-sub-menu>.el-sub-menu__title, + .nest-menu .el-sub-menu > .el-sub-menu__title, .el-menu-item { &:hover { // you can use $subMenuHover @@ -208,7 +185,7 @@ } // the scroll bar appears when the subMenu is too long - >.el-menu--popup { + > .el-menu--popup { max-height: 100vh; overflow-y: auto; diff --git a/src/styles/transition.scss b/src/styles/transition.scss deleted file mode 100644 index 4cb27cc811e28605bb6d0657a6257f0c901f6809..0000000000000000000000000000000000000000 --- a/src/styles/transition.scss +++ /dev/null @@ -1,48 +0,0 @@ -// global transition css - -/* fade */ -.fade-enter-active, -.fade-leave-active { - transition: opacity 0.28s; -} - -.fade-enter, -.fade-leave-active { - opacity: 0; -} - -/* fade-transform */ -.fade-transform-leave-active, -.fade-transform-enter-active { - transition: all .5s; -} - -.fade-transform-enter { - opacity: 0; - transform: translateX(-30px); -} - -.fade-transform-leave-to { - opacity: 0; - transform: translateX(30px); -} - -/* breadcrumb transition */ -.breadcrumb-enter-active, -.breadcrumb-leave-active { - transition: all .5s; -} - -.breadcrumb-enter, -.breadcrumb-leave-active { - opacity: 0; - transform: translateX(20px); -} - -.breadcrumb-move { - transition: all .5s; -} - -.breadcrumb-leave-active { - position: absolute; -} diff --git a/src/styles/variables.module.scss b/src/styles/variables.module.scss index be5577263874f458b69364b492fd1dd6f26247fa..7feccc40271432279dddef90deedbc11faabfcea 100644 --- a/src/styles/variables.module.scss +++ b/src/styles/variables.module.scss @@ -1,25 +1,6 @@ -// sidebar -$menuText:#bfcbd9; -$menuActiveText:#409EFF; -$subMenuActiveText:#f4f4f5; //https://github.com/ElemeFE/element/issues/12951 - -$menuBg:#304156; -$menuHover:#263445; - -$subMenuBg:#1f2d3d; -$subMenuHover:#001528; - -$sideBarWidth: 210px; - -// the :export directive is the magic sauce for webpack -// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass +// 导出 variables.module.scss 变量提供给TypeScript使用 :export { + menuBg: $menuBg; menuText: $menuText; menuActiveText: $menuActiveText; - subMenuActiveText: $subMenuActiveText; - menuBg: $menuBg; - menuHover: $menuHover; - subMenuBg: $subMenuBg; - subMenuHover: $subMenuHover; - sideBarWidth: $sideBarWidth; } diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000000000000000000000000000000000000..dd36f4e044c1cbd5e3516efef9bd56095dfc8093 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,27 @@ +// 全局SCSS变量 + +:root { + --menuBg: #304156; + --menuText: #bfcbd9; + --menuActiveText: #409eff; + --menuHover: #263445; + --subMenuBg: #1f2d3d; + --subMenuActiveText: #f4f4f5; + --subMenuHover: #001528; + + // wang-editor textarea + --w-e-textarea-slight-border-color: var(--el-color-primary); + --w-e-textarea-slight-bg-color: rgb(var(--el-color-primary-rgb) 0.1); + --w-e-textarea-selected-border-color: var(--el-color-primary); +} + +$menuBg: var(--menuBg); +$menuText: var(--menuText); +$menuActiveText: var(--menuActiveText); +$menuHover: var(--menuHover); + +$subMenuBg: var(--subMenuBg); +$subMenuActiveText: var(--subMenuActiveText); +$subMenuHover: var(--subMenuHover); + +$sideBarWidth: 210px; diff --git a/src/types/api/base.d.ts b/src/types/api/base.d.ts deleted file mode 100644 index d934383c1334ac11590945e7080128584366c2dc..0000000000000000000000000000000000000000 --- a/src/types/api/base.d.ts +++ /dev/null @@ -1,11 +0,0 @@ - -export interface PageQueryParam { - pageNum: number, - pageSize: number -} - -export interface PageResult { - list: T, - total: number -} - diff --git a/src/types/api/oms/order.d.ts b/src/types/api/oms/order.d.ts deleted file mode 100644 index 98432373b298ebfff17e6d7748142742046010f9..0000000000000000000000000000000000000000 --- a/src/types/api/oms/order.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { PageQueryParam, PageResult } from "../base" - -/** - * 订单查询参数类型声明 - */ -export interface OrderQueryParam extends PageQueryParam { - orderSn: string | undefined; - status: number | undefined; -} - -/** - * 订单分页列表项声明 - */ -export interface Order { - id: string; - orderSn: string; - totalAmount: string; - payAmount: string; - payType: number; - status: number; - totalQuantity: number; - gmtCreate: string; - memberId: string; - sourceType: number; - orderItems: OrderItem[]; -} -export interface OrderItem { - id: string; - orderId: string; - skuId: string; - skuName: string; - picUrl: string; - price: string; - count: number; - totalAmount: number; -} - -/** - * 订单分页项类型声明 - */ -export interface OrderPageResult extends PageResult { - -} - -/** - * 订单表单类型声明 - */ -export interface OrderDetail { - id: number | undefined; - title: string; - picUrl: string; - beginTime: string; - endTime: string; - status: number; - sort: number; - url: string; - remark: string; -} \ No newline at end of file diff --git a/src/types/api/pms/brand.d.ts b/src/types/api/pms/brand.d.ts deleted file mode 100644 index d9730cad639bfe780ec4975ba3a1b73ba337647c..0000000000000000000000000000000000000000 --- a/src/types/api/pms/brand.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { PageQueryParam, PageResult } from "../base" - -/** - * 品牌查询参数类型声明 - */ -export interface BrandQueryParam extends PageQueryParam { - name: String | undefined -} - - -/** - * 品牌分页列表项声明 - */ -export interface BrandItem { - id: string; - name: string; - logoUrl: string; - sort: number; -} - -/** - * 品牌分页项类型声明 - */ -export interface BrandPageResult extends PageResult { - -} - -/** - * 品牌表单类型声明 - */ -export interface BrandFormData { - id: number | undefined, - name: string, - logoUrl: string, - sort: number -} \ No newline at end of file diff --git a/src/types/api/pms/goods.d.ts b/src/types/api/pms/goods.d.ts deleted file mode 100644 index 39ef7501848decbd40fefb3f947a9e2436ff2ffa..0000000000000000000000000000000000000000 --- a/src/types/api/pms/goods.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { PageQueryParam, PageResult } from "../base" - - -/** - * 商品查询参数类型声明 - */ -export interface GoodsQueryParam extends PageQueryParam { - name: stirng | undefined, - categoryId: number | undefined -} - -/** - * 商品列表项类型声明 - */ -export interface GoodsItem { - id: string; - name: string; - categoryId?: any; - brandId?: any; - originPrice: string; - price: string; - sales: number; - picUrl?: any; - album?: any; - unit?: any; - description: string; - detail: string; - status?: any; - categoryName: string; - brandName: string; - skuList: SkuItem[]; -} - -/** - * 商品规格项类型声明 - */ -export interface SkuItem { - id: string; - skuSn?: any; - name: string; - spuId?: any; - specIds: string; - price: string; - stockNum: number; - lockedStockNum?: any; - picUrl?: any; -} - -/** - * 商品分页项类型声明 - */ -export interface GoodsPageResult extends PageResult { - -} - -/** - * 商品表单数据类型声明 - */ -export interface GoodsFormData { - id: number|undefined, - deptId: number, - username: string, - nickname: string, - password: string, - mobile: string, - email: string, - gender: number, - status: number, - remark: string, - roleIds: number[] -} - - diff --git a/src/types/api/sms/advert.d.ts b/src/types/api/sms/advert.d.ts deleted file mode 100644 index 1b23eb4507cb08a540db09a775f90246acb63ba9..0000000000000000000000000000000000000000 --- a/src/types/api/sms/advert.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { PageQueryParam, PageResult } from "../base" - -/** - * 广告查询参数类型声明 - */ -export interface AdvertQueryParam extends PageQueryParam { - title: String | undefined -} - -/** - * 广告分页列表项声明 - */ -export interface AdvertItem { - id: string; - name: string; - logoUrl: string; - sort: number; -} - -/** - * 广告分页项类型声明 - */ -export interface AdvertPageResult extends PageResult { - -} - -/** - * 广告表单类型声明 - */ -export interface AdvertFormData { - id: number | undefined; - title: string; - picUrl: string; - beginTime: string; - endTime: string; - status: number; - sort: number; - url: string; - remark: string; -} \ No newline at end of file diff --git a/src/types/api/system/client.d.ts b/src/types/api/system/client.d.ts deleted file mode 100644 index efd4ca0c38970a4c7a61ffdb01390d5779a5f82c..0000000000000000000000000000000000000000 --- a/src/types/api/system/client.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { PageQueryParam, PageResult } from "../base" - -/** - * 客户端查询参数类型声明 - */ -export interface ClientQueryParam extends PageQueryParam { - /** - * 客户端名称 - */ - clientId: string | undefined -} - - -/** - * 客户端分页列表项声明 - */ -export interface ClientItem { - clientId: string; - clientSecret: string; - resourceIds: string; - scope: string; - authorizedGrantTypes: string; - webServerRedirectUri?: any; - authorities?: any; - accessTokenValidity: number; - refreshTokenValidity: number; - additionalInformation?: any; - autoapprove: string; -} - -/** - * 客户端分页项类型声明 - */ -export interface ClientPageResult extends PageResult { - -} - -/** - * 客户端表单类型声明 - */ -export interface ClientFormData { - authorizedGrantTypes: string; - clientId: string; - clientSecret: string; - accessTokenValidity: string; - refreshTokenValidity: string; - webServerRedirectUri: string; - authorities: string; - additionalInformation: string; - autoapprove: string; - scope:string; -} \ No newline at end of file diff --git a/src/types/api/system/dept.d.ts b/src/types/api/system/dept.d.ts deleted file mode 100644 index ae0bf3e3b577d15b5a1056d852062883f596446d..0000000000000000000000000000000000000000 --- a/src/types/api/system/dept.d.ts +++ /dev/null @@ -1,36 +0,0 @@ - -/** - * 部门查询参数类型声明 - */ -export interface DeptQueryParam { - name: string | undefined, - status: number | undefined -} - -/** - * 部门列表项声明 - */ - -export interface DeptItem { - id: number; - name: string; - parentId: number; - treePath: string; - sort: number; - status: number; - leader?: string; - mobile?: string; - email?: string; - children: DeptItem[]; -} - -/** - * 部门表单类型声明 - */ -export interface DeptFormData { - id: number|undefined, - parentId: number, - name: string, - sort: number, - status: number -} \ No newline at end of file diff --git a/src/types/api/system/dict.d.ts b/src/types/api/system/dict.d.ts deleted file mode 100644 index e5b48e792338e22d10ad5bc63e2d0f38a91a7d71..0000000000000000000000000000000000000000 --- a/src/types/api/system/dict.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { PageQueryParam, PageResult } from "../base" - -/** - * 字典查询参数类型声明 - */ -export interface DictQueryParam extends PageQueryParam { - /** - * 字典名称 - */ - name: string | undefined -} - - -/** - * 字典分页列表项声明 - */ -export interface Dict { - id: number; - code: string; - name: string; - status: number; - remark: string; -} - -/** - * 字典分页项类型声明 - */ -export interface DictPageResult extends PageResult { - -} - -/** - * 字典表单类型声明 - */ -export interface DictFormData { - id: number | undefined, - name: string, - code: string, - status: number, - remark: string -} - -/** - * 字典项查询参数类型声明 - */ -export interface DictItemQueryParam extends PageQueryParam { - /** - * 字典项名称 - */ - name: string | undefined; - /** - * 字典编码 - */ - dictCode: string | undefined; -} - -/** - * 字典分页列表项声明 - */ -export interface DictItem { - id: number; - name: string; - value: string; - dictCode: string; - sort: number; - status: number; - defaulted: number; - remark?: string; -} - -/** - * 字典分页项类型声明 - */ -export interface DictItemPageResult extends PageResult { - -} - -/** - * 字典表单类型声明 - */ -export interface DictItemFormData { - id: number | undefined; - dictCode:string, - name: string; - code: string; - value: string; - status: number; - sort: number; - remark: string; -} \ No newline at end of file diff --git a/src/types/api/system/login.d.ts b/src/types/api/system/login.d.ts deleted file mode 100644 index bbc3a33c6daf0c53c86667ca8706334c6cc3eb17..0000000000000000000000000000000000000000 --- a/src/types/api/system/login.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 登录表单类型声明 - */ -export interface LoginFormData { - username: string, - password: string, - grant_type: string, - code: string, - uuid: string, -} - -/** - * 登录响应类型声明 - */ -export interface LoginResponseData { - access_token: string, - token_type: string -} - -/** - * 验证码类型声明 - */ -export interface Captcha { - img: string, - uuid: string -} - diff --git a/src/types/api/system/menu.ts b/src/types/api/system/menu.ts deleted file mode 100644 index ed97a24914cb11cb5f8b2df8f1ca2ee2e7df7e72..0000000000000000000000000000000000000000 --- a/src/types/api/system/menu.ts +++ /dev/null @@ -1,63 +0,0 @@ - -/** - * 菜单查询参数类型声明 - */ -export interface MenuQueryParam { - name: String | undefined -} - -/** - * 菜单分页列表项声明 - */ - -export interface MenuItem { - id: number; - parentId: number; - gmtCreate: string; - gmtModified: string; - name: string; - icon: string; - component: string; - sort: number; - visible: number; - children: MenuItem[]; -} - -/** - * 菜单表单类型声明 - */ -export interface MenuFormData { - /** - * 菜单ID - */ - id: number | undefined, - /** - * 父菜单ID - */ - parentId: number, - /** - * 菜单名称 - */ - name: string, - /** - * 菜单是否可见(1:是;0:否;) - */ - visible: number, - icon: string, - /** - * 排序 - */ - sort: number, - /** - * 组件路径 - */ - component: string, - /** - * 路由路径 - */ - path: string, - /** - * 跳转路由路径 - */ - redirect: string, -} \ No newline at end of file diff --git a/src/types/api/system/perm.d.ts b/src/types/api/system/perm.d.ts deleted file mode 100644 index 36d5da6f675735a700e29ade413e38cafb95d377..0000000000000000000000000000000000000000 --- a/src/types/api/system/perm.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { PageQueryParam, PageResult } from "../base" - -/** - * 权限查询参数类型声明 - */ -export interface PermQueryParam extends PageQueryParam { - menuId: any; - name: string | undefined; -} - -/** - * 权限分页列表项声明 - */ -export interface PermItem { - id: number; - name: string; - menuId: string; - urlPerm: string; - btnPerm: string; - roles?: string[]; -} - -/** - * 权限分页项类型声明 - */ -export interface PermPageResult extends PageResult { - -} - -/** - * 权限表单类型声明 - */ -export interface PermFormData { - id: number|undefined, - name: string, - urlPerm: string, - btnPerm: string, - menuId: string -} \ No newline at end of file diff --git a/src/types/api/system/role.d.ts b/src/types/api/system/role.d.ts deleted file mode 100644 index 8585628ed900face16845f68ed8d4f351a9be100..0000000000000000000000000000000000000000 --- a/src/types/api/system/role.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { PageQueryParam, PageResult } from "../base" - -/** - * 角色查询参数类型声明 - */ -export interface RoleQueryParam extends PageQueryParam { - name: String | undefined -} - -/** - * 角色分页列表项声明 - */ -export interface RoleItem { - id: string; - name: string; - code: string; - sort: number; - status: number; - deleted: number; - menuIds?: any; - permissionIds?: any; -} - - -/** - * 角色分页项类型声明 - */ -export interface RolePageResult extends PageResult { - -} - -/** - * 角色表单类型声明 - */ -export interface RoleFormData { - id: number|undefined, - name: string, - code: string, - sort: number, - status: number -} \ No newline at end of file diff --git a/src/types/api/system/user.d.ts b/src/types/api/system/user.d.ts deleted file mode 100644 index 337eef02f4000158fbc5b4c99c7c5e7de2801994..0000000000000000000000000000000000000000 --- a/src/types/api/system/user.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { PageQueryParam, PageResult } from "../base" - -/** - * 登录用户类型声明 - */ -export interface UserInfo { - nickname: string, - avatar: string, - roles: string[], - perms: string[] -} - -/** - * 用户查询参数类型声明 - */ -export interface UserQueryParam extends PageQueryParam { - keywords: String | undefined, - status: number | undefined, - deptId: number | undefined -} - -/** - * 用户分页列表项声明 - */ -export interface UserItem { - id: string; - username: string; - nickname: string; - mobile: string; - gender: number; - avatar: string; - email: string; - status: number; - deptName: string; - roleNames: string; - gmtCreate: string; -} - -/** - * 用户分页项类型声明 - */ -export interface UserPageResult extends PageResult { - -} - -/** - * 用户表单类型声明 - */ -export interface UserFormData { - id: number | undefined, - deptId: number, - username: string, - nickname: string, - password: string, - mobile: string, - email: string, - gender: number, - status: number, - remark: string, - roleIds: number[] -} - - -/** - * 用户导入表单类型声明 - */ - export interface UserImportFormData { - deptId: number, - roleIds: number[] -} \ No newline at end of file diff --git a/src/types/api/ums/member.d.ts b/src/types/api/ums/member.d.ts deleted file mode 100644 index dc1ca6cea6bb82d4987c50e08cc884ba8765b58a..0000000000000000000000000000000000000000 --- a/src/types/api/ums/member.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { PageQueryParam, PageResult } from "../base" - -/** - * 会员查询参数类型声明 - */ -export interface MemberQueryParam extends PageQueryParam { - nickName: String | undefined -} - -/** - * 会员分页列表项声明 - */ -export interface MemberItem { - id: string; - gender: number; - nickName: string; - mobile: string; - birthday?: any; - avatarUrl: string; - openid: string; - sessionKey?: any; - city: string; - country: string; - language: string; - province: string; - status: number; - balance: string; - deleted: number; - point: number; - addressList: AddressItem[]; -} - -export interface AddressItem { - id: string; - memberId: string; - consigneeName: string; - consigneeMobile: string; - province: string; - city: string; - area: string; - detailAddress: string; - zipCode?: any; - defaulted: number; -} - -/** - * 会员分页项类型声明 - */ -export interface MemberPageResult extends PageResult { - -} - -/** - * 会员表单类型声明 - */ -export interface MemberFormData { - id: number | undefined; - title: string; - picUrl: string; - beginTime: string; - endTime: string; - status: number; - sort: number; - url: string; - remark: string; -} \ No newline at end of file diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b191a3fda8007c0b7d6a2abeb22352c28010cf90 --- /dev/null +++ b/src/types/auto-imports.d.ts @@ -0,0 +1,1589 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// Generated by unplugin-auto-import +export {} +declare global { + const EffectScope: typeof import("vue")["EffectScope"]; + const ElForm: typeof import("element-plus/es")["ElForm"]; + const ElMessage: typeof import("element-plus/es")["ElMessage"]; + const ElNotification: typeof import("element-plus/es")["ElNotification"]; + const ElMessageBox: typeof import("element-plus/es")["ElMessageBox"]; + const ElTree: typeof import("element-plus/es")["ElTree"]; + const asyncComputed: typeof import("@vueuse/core")["asyncComputed"]; + const autoResetRef: typeof import("@vueuse/core")["autoResetRef"]; + const computed: typeof import("vue")["computed"]; + const computedAsync: typeof import("@vueuse/core")["computedAsync"]; + const computedEager: typeof import("@vueuse/core")["computedEager"]; + const computedInject: typeof import("@vueuse/core")["computedInject"]; + const computedWithControl: typeof import("@vueuse/core")["computedWithControl"]; + const controlledComputed: typeof import("@vueuse/core")["controlledComputed"]; + const controlledRef: typeof import("@vueuse/core")["controlledRef"]; + const createApp: typeof import("vue")["createApp"]; + const createEventHook: typeof import("@vueuse/core")["createEventHook"]; + const createGlobalState: typeof import("@vueuse/core")["createGlobalState"]; + const createInjectionState: typeof import("@vueuse/core")["createInjectionState"]; + const createReactiveFn: typeof import("@vueuse/core")["createReactiveFn"]; + const createReusableTemplate: typeof import("@vueuse/core")["createReusableTemplate"]; + const createSharedComposable: typeof import("@vueuse/core")["createSharedComposable"]; + const createTemplatePromise: typeof import("@vueuse/core")["createTemplatePromise"]; + const createUnrefFn: typeof import("@vueuse/core")["createUnrefFn"]; + const customRef: typeof import("vue")["customRef"]; + const debouncedRef: typeof import("@vueuse/core")["debouncedRef"]; + const debouncedWatch: typeof import("@vueuse/core")["debouncedWatch"]; + const defineAsyncComponent: typeof import("vue")["defineAsyncComponent"]; + const defineComponent: typeof import("vue")["defineComponent"]; + const eagerComputed: typeof import("@vueuse/core")["eagerComputed"]; + const effectScope: typeof import("vue")["effectScope"]; + const extendRef: typeof import("@vueuse/core")["extendRef"]; + const getCurrentInstance: typeof import("vue")["getCurrentInstance"]; + const getCurrentScope: typeof import("vue")["getCurrentScope"]; + const h: typeof import("vue")["h"]; + const ignorableWatch: typeof import("@vueuse/core")["ignorableWatch"]; + const inject: typeof import("vue")["inject"]; + const isDefined: typeof import("@vueuse/core")["isDefined"]; + const isProxy: typeof import("vue")["isProxy"]; + const isReactive: typeof import("vue")["isReactive"]; + const isReadonly: typeof import("vue")["isReadonly"]; + const isRef: typeof import("vue")["isRef"]; + const makeDestructurable: typeof import("@vueuse/core")["makeDestructurable"]; + const markRaw: typeof import("vue")["markRaw"]; + const nextTick: typeof import("vue")["nextTick"]; + const onActivated: typeof import("vue")["onActivated"]; + const onBeforeMount: typeof import("vue")["onBeforeMount"]; + const onBeforeUnmount: typeof import("vue")["onBeforeUnmount"]; + const onBeforeUpdate: typeof import("vue")["onBeforeUpdate"]; + const onClickOutside: typeof import("@vueuse/core")["onClickOutside"]; + const onDeactivated: typeof import("vue")["onDeactivated"]; + const onErrorCaptured: typeof import("vue")["onErrorCaptured"]; + const onKeyStroke: typeof import("@vueuse/core")["onKeyStroke"]; + const onLongPress: typeof import("@vueuse/core")["onLongPress"]; + const onMounted: typeof import("vue")["onMounted"]; + const onRenderTracked: typeof import("vue")["onRenderTracked"]; + const onRenderTriggered: typeof import("vue")["onRenderTriggered"]; + const onScopeDispose: typeof import("vue")["onScopeDispose"]; + const onServerPrefetch: typeof import("vue")["onServerPrefetch"]; + const onStartTyping: typeof import("@vueuse/core")["onStartTyping"]; + const onUnmounted: typeof import("vue")["onUnmounted"]; + const onUpdated: typeof import("vue")["onUpdated"]; + const pausableWatch: typeof import("@vueuse/core")["pausableWatch"]; + const provide: typeof import("vue")["provide"]; + const reactify: typeof import("@vueuse/core")["reactify"]; + const reactifyObject: typeof import("@vueuse/core")["reactifyObject"]; + const reactive: typeof import("vue")["reactive"]; + const reactiveComputed: typeof import("@vueuse/core")["reactiveComputed"]; + const reactiveOmit: typeof import("@vueuse/core")["reactiveOmit"]; + const reactivePick: typeof import("@vueuse/core")["reactivePick"]; + const readonly: typeof import("vue")["readonly"]; + const ref: typeof import("vue")["ref"]; + const refAutoReset: typeof import("@vueuse/core")["refAutoReset"]; + const refDebounced: typeof import("@vueuse/core")["refDebounced"]; + const refDefault: typeof import("@vueuse/core")["refDefault"]; + const refThrottled: typeof import("@vueuse/core")["refThrottled"]; + const refWithControl: typeof import("@vueuse/core")["refWithControl"]; + const resolveComponent: typeof import("vue")["resolveComponent"]; + const resolveRef: typeof import("@vueuse/core")["resolveRef"]; + const resolveUnref: typeof import("@vueuse/core")["resolveUnref"]; + const shallowReactive: typeof import("vue")["shallowReactive"]; + const shallowReadonly: typeof import("vue")["shallowReadonly"]; + const shallowRef: typeof import("vue")["shallowRef"]; + const syncRef: typeof import("@vueuse/core")["syncRef"]; + const syncRefs: typeof import("@vueuse/core")["syncRefs"]; + const templateRef: typeof import("@vueuse/core")["templateRef"]; + const throttledRef: typeof import("@vueuse/core")["throttledRef"]; + const throttledWatch: typeof import("@vueuse/core")["throttledWatch"]; + const toRaw: typeof import("vue")["toRaw"]; + const toReactive: typeof import("@vueuse/core")["toReactive"]; + const toRef: typeof import("vue")["toRef"]; + const toRefs: typeof import("vue")["toRefs"]; + const toValue: typeof import("vue")["toValue"]; + const triggerRef: typeof import("vue")["triggerRef"]; + const tryOnBeforeMount: typeof import("@vueuse/core")["tryOnBeforeMount"]; + const tryOnBeforeUnmount: typeof import("@vueuse/core")["tryOnBeforeUnmount"]; + const tryOnMounted: typeof import("@vueuse/core")["tryOnMounted"]; + const tryOnScopeDispose: typeof import("@vueuse/core")["tryOnScopeDispose"]; + const tryOnUnmounted: typeof import("@vueuse/core")["tryOnUnmounted"]; + const unref: typeof import("vue")["unref"]; + const unrefElement: typeof import("@vueuse/core")["unrefElement"]; + const until: typeof import("@vueuse/core")["until"]; + const useActiveElement: typeof import("@vueuse/core")["useActiveElement"]; + const useAnimate: typeof import("@vueuse/core")["useAnimate"]; + const useArrayDifference: typeof import("@vueuse/core")["useArrayDifference"]; + const useArrayEvery: typeof import("@vueuse/core")["useArrayEvery"]; + const useArrayFilter: typeof import("@vueuse/core")["useArrayFilter"]; + const useArrayFind: typeof import("@vueuse/core")["useArrayFind"]; + const useArrayFindIndex: typeof import("@vueuse/core")["useArrayFindIndex"]; + const useArrayFindLast: typeof import("@vueuse/core")["useArrayFindLast"]; + const useArrayIncludes: typeof import("@vueuse/core")["useArrayIncludes"]; + const useArrayJoin: typeof import("@vueuse/core")["useArrayJoin"]; + const useArrayMap: typeof import("@vueuse/core")["useArrayMap"]; + const useArrayReduce: typeof import("@vueuse/core")["useArrayReduce"]; + const useArraySome: typeof import("@vueuse/core")["useArraySome"]; + const useArrayUnique: typeof import("@vueuse/core")["useArrayUnique"]; + const useAsyncQueue: typeof import("@vueuse/core")["useAsyncQueue"]; + const useAsyncState: typeof import("@vueuse/core")["useAsyncState"]; + const useAttrs: typeof import("vue")["useAttrs"]; + const useBase64: typeof import("@vueuse/core")["useBase64"]; + const useBattery: typeof import("@vueuse/core")["useBattery"]; + const useBluetooth: typeof import("@vueuse/core")["useBluetooth"]; + const useBreakpoints: typeof import("@vueuse/core")["useBreakpoints"]; + const useBroadcastChannel: typeof import("@vueuse/core")["useBroadcastChannel"]; + const useBrowserLocation: typeof import("@vueuse/core")["useBrowserLocation"]; + const useCached: typeof import("@vueuse/core")["useCached"]; + const useClipboard: typeof import("@vueuse/core")["useClipboard"]; + const useCloned: typeof import("@vueuse/core")["useCloned"]; + const useColorMode: typeof import("@vueuse/core")["useColorMode"]; + const useConfirmDialog: typeof import("@vueuse/core")["useConfirmDialog"]; + const useCounter: typeof import("@vueuse/core")["useCounter"]; + const useCssModule: typeof import("vue")["useCssModule"]; + const useCssVar: typeof import("@vueuse/core")["useCssVar"]; + const useCssVars: typeof import("vue")["useCssVars"]; + const useCurrentElement: typeof import("@vueuse/core")["useCurrentElement"]; + const useCycleList: typeof import("@vueuse/core")["useCycleList"]; + const useDark: typeof import("@vueuse/core")["useDark"]; + const useDateFormat: typeof import("@vueuse/core")["useDateFormat"]; + const useDebounce: typeof import("@vueuse/core")["useDebounce"]; + const useDebounceFn: typeof import("@vueuse/core")["useDebounceFn"]; + const useDebouncedRefHistory: typeof import("@vueuse/core")["useDebouncedRefHistory"]; + const useDeviceMotion: typeof import("@vueuse/core")["useDeviceMotion"]; + const useDeviceOrientation: typeof import("@vueuse/core")["useDeviceOrientation"]; + const useDevicePixelRatio: typeof import("@vueuse/core")["useDevicePixelRatio"]; + const useDevicesList: typeof import("@vueuse/core")["useDevicesList"]; + const useDisplayMedia: typeof import("@vueuse/core")["useDisplayMedia"]; + const useDocumentVisibility: typeof import("@vueuse/core")["useDocumentVisibility"]; + const useDraggable: typeof import("@vueuse/core")["useDraggable"]; + const useDropZone: typeof import("@vueuse/core")["useDropZone"]; + const useElementBounding: typeof import("@vueuse/core")["useElementBounding"]; + const useElementByPoint: typeof import("@vueuse/core")["useElementByPoint"]; + const useElementHover: typeof import("@vueuse/core")["useElementHover"]; + const useElementSize: typeof import("@vueuse/core")["useElementSize"]; + const useElementVisibility: typeof import("@vueuse/core")["useElementVisibility"]; + const useEventBus: typeof import("@vueuse/core")["useEventBus"]; + const useEventListener: typeof import("@vueuse/core")["useEventListener"]; + const useEventSource: typeof import("@vueuse/core")["useEventSource"]; + const useEyeDropper: typeof import("@vueuse/core")["useEyeDropper"]; + const useFavicon: typeof import("@vueuse/core")["useFavicon"]; + const useFetch: typeof import("@vueuse/core")["useFetch"]; + const useFileDialog: typeof import("@vueuse/core")["useFileDialog"]; + const useFileSystemAccess: typeof import("@vueuse/core")["useFileSystemAccess"]; + const useFocus: typeof import("@vueuse/core")["useFocus"]; + const useFocusWithin: typeof import("@vueuse/core")["useFocusWithin"]; + const useFps: typeof import("@vueuse/core")["useFps"]; + const useFullscreen: typeof import("@vueuse/core")["useFullscreen"]; + const useGamepad: typeof import("@vueuse/core")["useGamepad"]; + const useGeolocation: typeof import("@vueuse/core")["useGeolocation"]; + const useIdle: typeof import("@vueuse/core")["useIdle"]; + const useImage: typeof import("@vueuse/core")["useImage"]; + const useInfiniteScroll: typeof import("@vueuse/core")["useInfiniteScroll"]; + const useIntersectionObserver: typeof import("@vueuse/core")["useIntersectionObserver"]; + const useInterval: typeof import("@vueuse/core")["useInterval"]; + const useIntervalFn: typeof import("@vueuse/core")["useIntervalFn"]; + const useKeyModifier: typeof import("@vueuse/core")["useKeyModifier"]; + const useLastChanged: typeof import("@vueuse/core")["useLastChanged"]; + const useLocalStorage: typeof import("@vueuse/core")["useLocalStorage"]; + const useMagicKeys: typeof import("@vueuse/core")["useMagicKeys"]; + const useManualRefHistory: typeof import("@vueuse/core")["useManualRefHistory"]; + const useMediaControls: typeof import("@vueuse/core")["useMediaControls"]; + const useMediaQuery: typeof import("@vueuse/core")["useMediaQuery"]; + const useMemoize: typeof import("@vueuse/core")["useMemoize"]; + const useMemory: typeof import("@vueuse/core")["useMemory"]; + const useMounted: typeof import("@vueuse/core")["useMounted"]; + const useMouse: typeof import("@vueuse/core")["useMouse"]; + const useMouseInElement: typeof import("@vueuse/core")["useMouseInElement"]; + const useMousePressed: typeof import("@vueuse/core")["useMousePressed"]; + const useMutationObserver: typeof import("@vueuse/core")["useMutationObserver"]; + const useNavigatorLanguage: typeof import("@vueuse/core")["useNavigatorLanguage"]; + const useNetwork: typeof import("@vueuse/core")["useNetwork"]; + const useNow: typeof import("@vueuse/core")["useNow"]; + const useObjectUrl: typeof import("@vueuse/core")["useObjectUrl"]; + const useOffsetPagination: typeof import("@vueuse/core")["useOffsetPagination"]; + const useOnline: typeof import("@vueuse/core")["useOnline"]; + const usePageLeave: typeof import("@vueuse/core")["usePageLeave"]; + const useParallax: typeof import("@vueuse/core")["useParallax"]; + const useParentElement: typeof import("@vueuse/core")["useParentElement"]; + const usePerformanceObserver: typeof import("@vueuse/core")["usePerformanceObserver"]; + const usePermission: typeof import("@vueuse/core")["usePermission"]; + const usePointer: typeof import("@vueuse/core")["usePointer"]; + const usePointerLock: typeof import("@vueuse/core")["usePointerLock"]; + const usePointerSwipe: typeof import("@vueuse/core")["usePointerSwipe"]; + const usePreferredColorScheme: typeof import("@vueuse/core")["usePreferredColorScheme"]; + const usePreferredContrast: typeof import("@vueuse/core")["usePreferredContrast"]; + const usePreferredDark: typeof import("@vueuse/core")["usePreferredDark"]; + const usePreferredLanguages: typeof import("@vueuse/core")["usePreferredLanguages"]; + const usePreferredReducedMotion: typeof import("@vueuse/core")["usePreferredReducedMotion"]; + const usePrevious: typeof import("@vueuse/core")["usePrevious"]; + const useRafFn: typeof import("@vueuse/core")["useRafFn"]; + const useRefHistory: typeof import("@vueuse/core")["useRefHistory"]; + const useResizeObserver: typeof import("@vueuse/core")["useResizeObserver"]; + const useScreenOrientation: typeof import("@vueuse/core")["useScreenOrientation"]; + const useScreenSafeArea: typeof import("@vueuse/core")["useScreenSafeArea"]; + const useScriptTag: typeof import("@vueuse/core")["useScriptTag"]; + const useScroll: typeof import("@vueuse/core")["useScroll"]; + const useScrollLock: typeof import("@vueuse/core")["useScrollLock"]; + const useSessionStorage: typeof import("@vueuse/core")["useSessionStorage"]; + const useShare: typeof import("@vueuse/core")["useShare"]; + const useSlots: typeof import("vue")["useSlots"]; + const useSorted: typeof import("@vueuse/core")["useSorted"]; + const useSpeechRecognition: typeof import("@vueuse/core")["useSpeechRecognition"]; + const useSpeechSynthesis: typeof import("@vueuse/core")["useSpeechSynthesis"]; + const useStepper: typeof import("@vueuse/core")["useStepper"]; + const useStorage: typeof import("@vueuse/core")["useStorage"]; + const useStorageAsync: typeof import("@vueuse/core")["useStorageAsync"]; + const useStyleTag: typeof import("@vueuse/core")["useStyleTag"]; + const useSupported: typeof import("@vueuse/core")["useSupported"]; + const useSwipe: typeof import("@vueuse/core")["useSwipe"]; + const useTemplateRefsList: typeof import("@vueuse/core")["useTemplateRefsList"]; + const useTextDirection: typeof import("@vueuse/core")["useTextDirection"]; + const useTextSelection: typeof import("@vueuse/core")["useTextSelection"]; + const useTextareaAutosize: typeof import("@vueuse/core")["useTextareaAutosize"]; + const useThrottle: typeof import("@vueuse/core")["useThrottle"]; + const useThrottleFn: typeof import("@vueuse/core")["useThrottleFn"]; + const useThrottledRefHistory: typeof import("@vueuse/core")["useThrottledRefHistory"]; + const useTimeAgo: typeof import("@vueuse/core")["useTimeAgo"]; + const useTimeout: typeof import("@vueuse/core")["useTimeout"]; + const useTimeoutFn: typeof import("@vueuse/core")["useTimeoutFn"]; + const useTimeoutPoll: typeof import("@vueuse/core")["useTimeoutPoll"]; + const useTimestamp: typeof import("@vueuse/core")["useTimestamp"]; + const useTitle: typeof import("@vueuse/core")["useTitle"]; + const useToNumber: typeof import("@vueuse/core")["useToNumber"]; + const useToString: typeof import("@vueuse/core")["useToString"]; + const useToggle: typeof import("@vueuse/core")["useToggle"]; + const useTransition: typeof import("@vueuse/core")["useTransition"]; + const useUrlSearchParams: typeof import("@vueuse/core")["useUrlSearchParams"]; + const useUserMedia: typeof import("@vueuse/core")["useUserMedia"]; + const useVModel: typeof import("@vueuse/core")["useVModel"]; + const useVModels: typeof import("@vueuse/core")["useVModels"]; + const useVibrate: typeof import("@vueuse/core")["useVibrate"]; + const useVirtualList: typeof import("@vueuse/core")["useVirtualList"]; + const useWakeLock: typeof import("@vueuse/core")["useWakeLock"]; + const useWebNotification: typeof import("@vueuse/core")["useWebNotification"]; + const useWebSocket: typeof import("@vueuse/core")["useWebSocket"]; + const useWebWorker: typeof import("@vueuse/core")["useWebWorker"]; + const useWebWorkerFn: typeof import("@vueuse/core")["useWebWorkerFn"]; + const useWindowFocus: typeof import("@vueuse/core")["useWindowFocus"]; + const useWindowScroll: typeof import("@vueuse/core")["useWindowScroll"]; + const useWindowSize: typeof import("@vueuse/core")["useWindowSize"]; + const watch: typeof import("vue")["watch"]; + const watchArray: typeof import("@vueuse/core")["watchArray"]; + const watchAtMost: typeof import("@vueuse/core")["watchAtMost"]; + const watchDebounced: typeof import("@vueuse/core")["watchDebounced"]; + const watchDeep: typeof import("@vueuse/core")["watchDeep"]; + const watchEffect: typeof import("vue")["watchEffect"]; + const watchIgnorable: typeof import("@vueuse/core")["watchIgnorable"]; + const watchImmediate: typeof import("@vueuse/core")["watchImmediate"]; + const watchOnce: typeof import("@vueuse/core")["watchOnce"]; + const watchPausable: typeof import("@vueuse/core")["watchPausable"]; + const watchPostEffect: typeof import("vue")["watchPostEffect"]; + const watchSyncEffect: typeof import("vue")["watchSyncEffect"]; + const watchThrottled: typeof import("@vueuse/core")["watchThrottled"]; + const watchTriggerable: typeof import("@vueuse/core")["watchTriggerable"]; + const watchWithFilter: typeof import("@vueuse/core")["watchWithFilter"]; + const whenever: typeof import("@vueuse/core")["whenever"]; +} +// for type re-export +declare global { + // @ts-ignore + export type { + Component, + ComponentPublicInstance, + ComputedRef, + InjectionKey, + PropType, + Ref, + VNode, + } from "vue"; +} +// for vue template auto import +import { UnwrapRef } from "vue"; +declare module "vue" { + interface ComponentCustomProperties { + readonly EffectScope: UnwrapRef; + readonly ElForm: UnwrapRef; + readonly ElMessage: UnwrapRef< + typeof import("element-plus/es")["ElMessage"] + >; + readonly ElMessageBox: UnwrapRef< + typeof import("element-plus/es")["ElMessageBox"] + >; + readonly ElTree: UnwrapRef; + readonly asyncComputed: UnwrapRef< + typeof import("@vueuse/core")["asyncComputed"] + >; + readonly autoResetRef: UnwrapRef< + typeof import("@vueuse/core")["autoResetRef"] + >; + readonly computed: UnwrapRef; + readonly computedAsync: UnwrapRef< + typeof import("@vueuse/core")["computedAsync"] + >; + readonly computedEager: UnwrapRef< + typeof import("@vueuse/core")["computedEager"] + >; + readonly computedInject: UnwrapRef< + typeof import("@vueuse/core")["computedInject"] + >; + readonly computedWithControl: UnwrapRef< + typeof import("@vueuse/core")["computedWithControl"] + >; + readonly controlledComputed: UnwrapRef< + typeof import("@vueuse/core")["controlledComputed"] + >; + readonly controlledRef: UnwrapRef< + typeof import("@vueuse/core")["controlledRef"] + >; + readonly createApp: UnwrapRef; + readonly createEventHook: UnwrapRef< + typeof import("@vueuse/core")["createEventHook"] + >; + readonly createGlobalState: UnwrapRef< + typeof import("@vueuse/core")["createGlobalState"] + >; + readonly createInjectionState: UnwrapRef< + typeof import("@vueuse/core")["createInjectionState"] + >; + readonly createReactiveFn: UnwrapRef< + typeof import("@vueuse/core")["createReactiveFn"] + >; + readonly createReusableTemplate: UnwrapRef< + typeof import("@vueuse/core")["createReusableTemplate"] + >; + readonly createSharedComposable: UnwrapRef< + typeof import("@vueuse/core")["createSharedComposable"] + >; + readonly createTemplatePromise: UnwrapRef< + typeof import("@vueuse/core")["createTemplatePromise"] + >; + readonly createUnrefFn: UnwrapRef< + typeof import("@vueuse/core")["createUnrefFn"] + >; + readonly customRef: UnwrapRef; + readonly debouncedRef: UnwrapRef< + typeof import("@vueuse/core")["debouncedRef"] + >; + readonly debouncedWatch: UnwrapRef< + typeof import("@vueuse/core")["debouncedWatch"] + >; + readonly defineAsyncComponent: UnwrapRef< + typeof import("vue")["defineAsyncComponent"] + >; + readonly defineComponent: UnwrapRef< + typeof import("vue")["defineComponent"] + >; + readonly eagerComputed: UnwrapRef< + typeof import("@vueuse/core")["eagerComputed"] + >; + readonly effectScope: UnwrapRef; + readonly extendRef: UnwrapRef; + readonly getCurrentInstance: UnwrapRef< + typeof import("vue")["getCurrentInstance"] + >; + readonly getCurrentScope: UnwrapRef< + typeof import("vue")["getCurrentScope"] + >; + readonly h: UnwrapRef; + readonly ignorableWatch: UnwrapRef< + typeof import("@vueuse/core")["ignorableWatch"] + >; + readonly inject: UnwrapRef; + readonly isDefined: UnwrapRef; + readonly isProxy: UnwrapRef; + readonly isReactive: UnwrapRef; + readonly isReadonly: UnwrapRef; + readonly isRef: UnwrapRef; + readonly makeDestructurable: UnwrapRef< + typeof import("@vueuse/core")["makeDestructurable"] + >; + readonly markRaw: UnwrapRef; + readonly nextTick: UnwrapRef; + readonly onActivated: UnwrapRef; + readonly onBeforeMount: UnwrapRef; + readonly onBeforeUnmount: UnwrapRef< + typeof import("vue")["onBeforeUnmount"] + >; + readonly onBeforeUpdate: UnwrapRef; + readonly onClickOutside: UnwrapRef< + typeof import("@vueuse/core")["onClickOutside"] + >; + readonly onDeactivated: UnwrapRef; + readonly onErrorCaptured: UnwrapRef< + typeof import("vue")["onErrorCaptured"] + >; + readonly onKeyStroke: UnwrapRef< + typeof import("@vueuse/core")["onKeyStroke"] + >; + readonly onLongPress: UnwrapRef< + typeof import("@vueuse/core")["onLongPress"] + >; + readonly onMounted: UnwrapRef; + readonly onRenderTracked: UnwrapRef< + typeof import("vue")["onRenderTracked"] + >; + readonly onRenderTriggered: UnwrapRef< + typeof import("vue")["onRenderTriggered"] + >; + readonly onScopeDispose: UnwrapRef; + readonly onServerPrefetch: UnwrapRef< + typeof import("vue")["onServerPrefetch"] + >; + readonly onStartTyping: UnwrapRef< + typeof import("@vueuse/core")["onStartTyping"] + >; + readonly onUnmounted: UnwrapRef; + readonly onUpdated: UnwrapRef; + readonly pausableWatch: UnwrapRef< + typeof import("@vueuse/core")["pausableWatch"] + >; + readonly provide: UnwrapRef; + readonly reactify: UnwrapRef; + readonly reactifyObject: UnwrapRef< + typeof import("@vueuse/core")["reactifyObject"] + >; + readonly reactive: UnwrapRef; + readonly reactiveComputed: UnwrapRef< + typeof import("@vueuse/core")["reactiveComputed"] + >; + readonly reactiveOmit: UnwrapRef< + typeof import("@vueuse/core")["reactiveOmit"] + >; + readonly reactivePick: UnwrapRef< + typeof import("@vueuse/core")["reactivePick"] + >; + readonly readonly: UnwrapRef; + readonly ref: UnwrapRef; + readonly refAutoReset: UnwrapRef< + typeof import("@vueuse/core")["refAutoReset"] + >; + readonly refDebounced: UnwrapRef< + typeof import("@vueuse/core")["refDebounced"] + >; + readonly refDefault: UnwrapRef; + readonly refThrottled: UnwrapRef< + typeof import("@vueuse/core")["refThrottled"] + >; + readonly refWithControl: UnwrapRef< + typeof import("@vueuse/core")["refWithControl"] + >; + readonly resolveComponent: UnwrapRef< + typeof import("vue")["resolveComponent"] + >; + readonly resolveRef: UnwrapRef; + readonly resolveUnref: UnwrapRef< + typeof import("@vueuse/core")["resolveUnref"] + >; + readonly shallowReactive: UnwrapRef< + typeof import("vue")["shallowReactive"] + >; + readonly shallowReadonly: UnwrapRef< + typeof import("vue")["shallowReadonly"] + >; + readonly shallowRef: UnwrapRef; + readonly syncRef: UnwrapRef; + readonly syncRefs: UnwrapRef; + readonly templateRef: UnwrapRef< + typeof import("@vueuse/core")["templateRef"] + >; + readonly throttledRef: UnwrapRef< + typeof import("@vueuse/core")["throttledRef"] + >; + readonly throttledWatch: UnwrapRef< + typeof import("@vueuse/core")["throttledWatch"] + >; + readonly toRaw: UnwrapRef; + readonly toReactive: UnwrapRef; + readonly toRef: UnwrapRef; + readonly toRefs: UnwrapRef; + readonly toValue: UnwrapRef; + readonly triggerRef: UnwrapRef; + readonly tryOnBeforeMount: UnwrapRef< + typeof import("@vueuse/core")["tryOnBeforeMount"] + >; + readonly tryOnBeforeUnmount: UnwrapRef< + typeof import("@vueuse/core")["tryOnBeforeUnmount"] + >; + readonly tryOnMounted: UnwrapRef< + typeof import("@vueuse/core")["tryOnMounted"] + >; + readonly tryOnScopeDispose: UnwrapRef< + typeof import("@vueuse/core")["tryOnScopeDispose"] + >; + readonly tryOnUnmounted: UnwrapRef< + typeof import("@vueuse/core")["tryOnUnmounted"] + >; + readonly unref: UnwrapRef; + readonly unrefElement: UnwrapRef< + typeof import("@vueuse/core")["unrefElement"] + >; + readonly until: UnwrapRef; + readonly useActiveElement: UnwrapRef< + typeof import("@vueuse/core")["useActiveElement"] + >; + readonly useAnimate: UnwrapRef; + readonly useArrayDifference: UnwrapRef< + typeof import("@vueuse/core")["useArrayDifference"] + >; + readonly useArrayEvery: UnwrapRef< + typeof import("@vueuse/core")["useArrayEvery"] + >; + readonly useArrayFilter: UnwrapRef< + typeof import("@vueuse/core")["useArrayFilter"] + >; + readonly useArrayFind: UnwrapRef< + typeof import("@vueuse/core")["useArrayFind"] + >; + readonly useArrayFindIndex: UnwrapRef< + typeof import("@vueuse/core")["useArrayFindIndex"] + >; + readonly useArrayFindLast: UnwrapRef< + typeof import("@vueuse/core")["useArrayFindLast"] + >; + readonly useArrayIncludes: UnwrapRef< + typeof import("@vueuse/core")["useArrayIncludes"] + >; + readonly useArrayJoin: UnwrapRef< + typeof import("@vueuse/core")["useArrayJoin"] + >; + readonly useArrayMap: UnwrapRef< + typeof import("@vueuse/core")["useArrayMap"] + >; + readonly useArrayReduce: UnwrapRef< + typeof import("@vueuse/core")["useArrayReduce"] + >; + readonly useArraySome: UnwrapRef< + typeof import("@vueuse/core")["useArraySome"] + >; + readonly useArrayUnique: UnwrapRef< + typeof import("@vueuse/core")["useArrayUnique"] + >; + readonly useAsyncQueue: UnwrapRef< + typeof import("@vueuse/core")["useAsyncQueue"] + >; + readonly useAsyncState: UnwrapRef< + typeof import("@vueuse/core")["useAsyncState"] + >; + readonly useAttrs: UnwrapRef; + readonly useBase64: UnwrapRef; + readonly useBattery: UnwrapRef; + readonly useBluetooth: UnwrapRef< + typeof import("@vueuse/core")["useBluetooth"] + >; + readonly useBreakpoints: UnwrapRef< + typeof import("@vueuse/core")["useBreakpoints"] + >; + readonly useBroadcastChannel: UnwrapRef< + typeof import("@vueuse/core")["useBroadcastChannel"] + >; + readonly useBrowserLocation: UnwrapRef< + typeof import("@vueuse/core")["useBrowserLocation"] + >; + readonly useCached: UnwrapRef; + readonly useClipboard: UnwrapRef< + typeof import("@vueuse/core")["useClipboard"] + >; + readonly useCloned: UnwrapRef; + readonly useColorMode: UnwrapRef< + typeof import("@vueuse/core")["useColorMode"] + >; + readonly useConfirmDialog: UnwrapRef< + typeof import("@vueuse/core")["useConfirmDialog"] + >; + readonly useCounter: UnwrapRef; + readonly useCssModule: UnwrapRef; + readonly useCssVar: UnwrapRef; + readonly useCssVars: UnwrapRef; + readonly useCurrentElement: UnwrapRef< + typeof import("@vueuse/core")["useCurrentElement"] + >; + readonly useCycleList: UnwrapRef< + typeof import("@vueuse/core")["useCycleList"] + >; + readonly useDark: UnwrapRef; + readonly useDateFormat: UnwrapRef< + typeof import("@vueuse/core")["useDateFormat"] + >; + readonly useDebounce: UnwrapRef< + typeof import("@vueuse/core")["useDebounce"] + >; + readonly useDebounceFn: UnwrapRef< + typeof import("@vueuse/core")["useDebounceFn"] + >; + readonly useDebouncedRefHistory: UnwrapRef< + typeof import("@vueuse/core")["useDebouncedRefHistory"] + >; + readonly useDeviceMotion: UnwrapRef< + typeof import("@vueuse/core")["useDeviceMotion"] + >; + readonly useDeviceOrientation: UnwrapRef< + typeof import("@vueuse/core")["useDeviceOrientation"] + >; + readonly useDevicePixelRatio: UnwrapRef< + typeof import("@vueuse/core")["useDevicePixelRatio"] + >; + readonly useDevicesList: UnwrapRef< + typeof import("@vueuse/core")["useDevicesList"] + >; + readonly useDisplayMedia: UnwrapRef< + typeof import("@vueuse/core")["useDisplayMedia"] + >; + readonly useDocumentVisibility: UnwrapRef< + typeof import("@vueuse/core")["useDocumentVisibility"] + >; + readonly useDraggable: UnwrapRef< + typeof import("@vueuse/core")["useDraggable"] + >; + readonly useDropZone: UnwrapRef< + typeof import("@vueuse/core")["useDropZone"] + >; + readonly useElementBounding: UnwrapRef< + typeof import("@vueuse/core")["useElementBounding"] + >; + readonly useElementByPoint: UnwrapRef< + typeof import("@vueuse/core")["useElementByPoint"] + >; + readonly useElementHover: UnwrapRef< + typeof import("@vueuse/core")["useElementHover"] + >; + readonly useElementSize: UnwrapRef< + typeof import("@vueuse/core")["useElementSize"] + >; + readonly useElementVisibility: UnwrapRef< + typeof import("@vueuse/core")["useElementVisibility"] + >; + readonly useEventBus: UnwrapRef< + typeof import("@vueuse/core")["useEventBus"] + >; + readonly useEventListener: UnwrapRef< + typeof import("@vueuse/core")["useEventListener"] + >; + readonly useEventSource: UnwrapRef< + typeof import("@vueuse/core")["useEventSource"] + >; + readonly useEyeDropper: UnwrapRef< + typeof import("@vueuse/core")["useEyeDropper"] + >; + readonly useFavicon: UnwrapRef; + readonly useFetch: UnwrapRef; + readonly useFileDialog: UnwrapRef< + typeof import("@vueuse/core")["useFileDialog"] + >; + readonly useFileSystemAccess: UnwrapRef< + typeof import("@vueuse/core")["useFileSystemAccess"] + >; + readonly useFocus: UnwrapRef; + readonly useFocusWithin: UnwrapRef< + typeof import("@vueuse/core")["useFocusWithin"] + >; + readonly useFps: UnwrapRef; + readonly useFullscreen: UnwrapRef< + typeof import("@vueuse/core")["useFullscreen"] + >; + readonly useGamepad: UnwrapRef; + readonly useGeolocation: UnwrapRef< + typeof import("@vueuse/core")["useGeolocation"] + >; + readonly useIdle: UnwrapRef; + readonly useImage: UnwrapRef; + readonly useInfiniteScroll: UnwrapRef< + typeof import("@vueuse/core")["useInfiniteScroll"] + >; + readonly useIntersectionObserver: UnwrapRef< + typeof import("@vueuse/core")["useIntersectionObserver"] + >; + readonly useInterval: UnwrapRef< + typeof import("@vueuse/core")["useInterval"] + >; + readonly useIntervalFn: UnwrapRef< + typeof import("@vueuse/core")["useIntervalFn"] + >; + readonly useKeyModifier: UnwrapRef< + typeof import("@vueuse/core")["useKeyModifier"] + >; + readonly useLastChanged: UnwrapRef< + typeof import("@vueuse/core")["useLastChanged"] + >; + readonly useLocalStorage: UnwrapRef< + typeof import("@vueuse/core")["useLocalStorage"] + >; + readonly useMagicKeys: UnwrapRef< + typeof import("@vueuse/core")["useMagicKeys"] + >; + readonly useManualRefHistory: UnwrapRef< + typeof import("@vueuse/core")["useManualRefHistory"] + >; + readonly useMediaControls: UnwrapRef< + typeof import("@vueuse/core")["useMediaControls"] + >; + readonly useMediaQuery: UnwrapRef< + typeof import("@vueuse/core")["useMediaQuery"] + >; + readonly useMemoize: UnwrapRef; + readonly useMemory: UnwrapRef; + readonly useMounted: UnwrapRef; + readonly useMouse: UnwrapRef; + readonly useMouseInElement: UnwrapRef< + typeof import("@vueuse/core")["useMouseInElement"] + >; + readonly useMousePressed: UnwrapRef< + typeof import("@vueuse/core")["useMousePressed"] + >; + readonly useMutationObserver: UnwrapRef< + typeof import("@vueuse/core")["useMutationObserver"] + >; + readonly useNavigatorLanguage: UnwrapRef< + typeof import("@vueuse/core")["useNavigatorLanguage"] + >; + readonly useNetwork: UnwrapRef; + readonly useNow: UnwrapRef; + readonly useObjectUrl: UnwrapRef< + typeof import("@vueuse/core")["useObjectUrl"] + >; + readonly useOffsetPagination: UnwrapRef< + typeof import("@vueuse/core")["useOffsetPagination"] + >; + readonly useOnline: UnwrapRef; + readonly usePageLeave: UnwrapRef< + typeof import("@vueuse/core")["usePageLeave"] + >; + readonly useParallax: UnwrapRef< + typeof import("@vueuse/core")["useParallax"] + >; + readonly useParentElement: UnwrapRef< + typeof import("@vueuse/core")["useParentElement"] + >; + readonly usePerformanceObserver: UnwrapRef< + typeof import("@vueuse/core")["usePerformanceObserver"] + >; + readonly usePermission: UnwrapRef< + typeof import("@vueuse/core")["usePermission"] + >; + readonly usePointer: UnwrapRef; + readonly usePointerLock: UnwrapRef< + typeof import("@vueuse/core")["usePointerLock"] + >; + readonly usePointerSwipe: UnwrapRef< + typeof import("@vueuse/core")["usePointerSwipe"] + >; + readonly usePreferredColorScheme: UnwrapRef< + typeof import("@vueuse/core")["usePreferredColorScheme"] + >; + readonly usePreferredContrast: UnwrapRef< + typeof import("@vueuse/core")["usePreferredContrast"] + >; + readonly usePreferredDark: UnwrapRef< + typeof import("@vueuse/core")["usePreferredDark"] + >; + readonly usePreferredLanguages: UnwrapRef< + typeof import("@vueuse/core")["usePreferredLanguages"] + >; + readonly usePreferredReducedMotion: UnwrapRef< + typeof import("@vueuse/core")["usePreferredReducedMotion"] + >; + readonly usePrevious: UnwrapRef< + typeof import("@vueuse/core")["usePrevious"] + >; + readonly useRafFn: UnwrapRef; + readonly useRefHistory: UnwrapRef< + typeof import("@vueuse/core")["useRefHistory"] + >; + readonly useResizeObserver: UnwrapRef< + typeof import("@vueuse/core")["useResizeObserver"] + >; + readonly useScreenOrientation: UnwrapRef< + typeof import("@vueuse/core")["useScreenOrientation"] + >; + readonly useScreenSafeArea: UnwrapRef< + typeof import("@vueuse/core")["useScreenSafeArea"] + >; + readonly useScriptTag: UnwrapRef< + typeof import("@vueuse/core")["useScriptTag"] + >; + readonly useScroll: UnwrapRef; + readonly useScrollLock: UnwrapRef< + typeof import("@vueuse/core")["useScrollLock"] + >; + readonly useSessionStorage: UnwrapRef< + typeof import("@vueuse/core")["useSessionStorage"] + >; + readonly useShare: UnwrapRef; + readonly useSlots: UnwrapRef; + readonly useSorted: UnwrapRef; + readonly useSpeechRecognition: UnwrapRef< + typeof import("@vueuse/core")["useSpeechRecognition"] + >; + readonly useSpeechSynthesis: UnwrapRef< + typeof import("@vueuse/core")["useSpeechSynthesis"] + >; + readonly useStepper: UnwrapRef; + readonly useStorage: UnwrapRef; + readonly useStorageAsync: UnwrapRef< + typeof import("@vueuse/core")["useStorageAsync"] + >; + readonly useStyleTag: UnwrapRef< + typeof import("@vueuse/core")["useStyleTag"] + >; + readonly useSupported: UnwrapRef< + typeof import("@vueuse/core")["useSupported"] + >; + readonly useSwipe: UnwrapRef; + readonly useTemplateRefsList: UnwrapRef< + typeof import("@vueuse/core")["useTemplateRefsList"] + >; + readonly useTextDirection: UnwrapRef< + typeof import("@vueuse/core")["useTextDirection"] + >; + readonly useTextSelection: UnwrapRef< + typeof import("@vueuse/core")["useTextSelection"] + >; + readonly useTextareaAutosize: UnwrapRef< + typeof import("@vueuse/core")["useTextareaAutosize"] + >; + readonly useThrottle: UnwrapRef< + typeof import("@vueuse/core")["useThrottle"] + >; + readonly useThrottleFn: UnwrapRef< + typeof import("@vueuse/core")["useThrottleFn"] + >; + readonly useThrottledRefHistory: UnwrapRef< + typeof import("@vueuse/core")["useThrottledRefHistory"] + >; + readonly useTimeAgo: UnwrapRef; + readonly useTimeout: UnwrapRef; + readonly useTimeoutFn: UnwrapRef< + typeof import("@vueuse/core")["useTimeoutFn"] + >; + readonly useTimeoutPoll: UnwrapRef< + typeof import("@vueuse/core")["useTimeoutPoll"] + >; + readonly useTimestamp: UnwrapRef< + typeof import("@vueuse/core")["useTimestamp"] + >; + readonly useTitle: UnwrapRef; + readonly useToNumber: UnwrapRef< + typeof import("@vueuse/core")["useToNumber"] + >; + readonly useToString: UnwrapRef< + typeof import("@vueuse/core")["useToString"] + >; + readonly useToggle: UnwrapRef; + readonly useTransition: UnwrapRef< + typeof import("@vueuse/core")["useTransition"] + >; + readonly useUrlSearchParams: UnwrapRef< + typeof import("@vueuse/core")["useUrlSearchParams"] + >; + readonly useUserMedia: UnwrapRef< + typeof import("@vueuse/core")["useUserMedia"] + >; + readonly useVModel: UnwrapRef; + readonly useVModels: UnwrapRef; + readonly useVibrate: UnwrapRef; + readonly useVirtualList: UnwrapRef< + typeof import("@vueuse/core")["useVirtualList"] + >; + readonly useWakeLock: UnwrapRef< + typeof import("@vueuse/core")["useWakeLock"] + >; + readonly useWebNotification: UnwrapRef< + typeof import("@vueuse/core")["useWebNotification"] + >; + readonly useWebSocket: UnwrapRef< + typeof import("@vueuse/core")["useWebSocket"] + >; + readonly useWebWorker: UnwrapRef< + typeof import("@vueuse/core")["useWebWorker"] + >; + readonly useWebWorkerFn: UnwrapRef< + typeof import("@vueuse/core")["useWebWorkerFn"] + >; + readonly useWindowFocus: UnwrapRef< + typeof import("@vueuse/core")["useWindowFocus"] + >; + readonly useWindowScroll: UnwrapRef< + typeof import("@vueuse/core")["useWindowScroll"] + >; + readonly useWindowSize: UnwrapRef< + typeof import("@vueuse/core")["useWindowSize"] + >; + readonly watch: UnwrapRef; + readonly watchArray: UnwrapRef; + readonly watchAtMost: UnwrapRef< + typeof import("@vueuse/core")["watchAtMost"] + >; + readonly watchDebounced: UnwrapRef< + typeof import("@vueuse/core")["watchDebounced"] + >; + readonly watchDeep: UnwrapRef; + readonly watchEffect: UnwrapRef; + readonly watchIgnorable: UnwrapRef< + typeof import("@vueuse/core")["watchIgnorable"] + >; + readonly watchImmediate: UnwrapRef< + typeof import("@vueuse/core")["watchImmediate"] + >; + readonly watchOnce: UnwrapRef; + readonly watchPausable: UnwrapRef< + typeof import("@vueuse/core")["watchPausable"] + >; + readonly watchPostEffect: UnwrapRef< + typeof import("vue")["watchPostEffect"] + >; + readonly watchSyncEffect: UnwrapRef< + typeof import("vue")["watchSyncEffect"] + >; + readonly watchThrottled: UnwrapRef< + typeof import("@vueuse/core")["watchThrottled"] + >; + readonly watchTriggerable: UnwrapRef< + typeof import("@vueuse/core")["watchTriggerable"] + >; + readonly watchWithFilter: UnwrapRef< + typeof import("@vueuse/core")["watchWithFilter"] + >; + readonly whenever: UnwrapRef; + } +} +declare module "@vue/runtime-core" { + interface ComponentCustomProperties { + readonly EffectScope: UnwrapRef; + readonly ElForm: UnwrapRef; + readonly ElMessage: UnwrapRef< + typeof import("element-plus/es")["ElMessage"] + >; + readonly ElMessageBox: UnwrapRef< + typeof import("element-plus/es")["ElMessageBox"] + >; + readonly ElTree: UnwrapRef; + readonly asyncComputed: UnwrapRef< + typeof import("@vueuse/core")["asyncComputed"] + >; + readonly autoResetRef: UnwrapRef< + typeof import("@vueuse/core")["autoResetRef"] + >; + readonly computed: UnwrapRef; + readonly computedAsync: UnwrapRef< + typeof import("@vueuse/core")["computedAsync"] + >; + readonly computedEager: UnwrapRef< + typeof import("@vueuse/core")["computedEager"] + >; + readonly computedInject: UnwrapRef< + typeof import("@vueuse/core")["computedInject"] + >; + readonly computedWithControl: UnwrapRef< + typeof import("@vueuse/core")["computedWithControl"] + >; + readonly controlledComputed: UnwrapRef< + typeof import("@vueuse/core")["controlledComputed"] + >; + readonly controlledRef: UnwrapRef< + typeof import("@vueuse/core")["controlledRef"] + >; + readonly createApp: UnwrapRef; + readonly createEventHook: UnwrapRef< + typeof import("@vueuse/core")["createEventHook"] + >; + readonly createGlobalState: UnwrapRef< + typeof import("@vueuse/core")["createGlobalState"] + >; + readonly createInjectionState: UnwrapRef< + typeof import("@vueuse/core")["createInjectionState"] + >; + readonly createReactiveFn: UnwrapRef< + typeof import("@vueuse/core")["createReactiveFn"] + >; + readonly createReusableTemplate: UnwrapRef< + typeof import("@vueuse/core")["createReusableTemplate"] + >; + readonly createSharedComposable: UnwrapRef< + typeof import("@vueuse/core")["createSharedComposable"] + >; + readonly createTemplatePromise: UnwrapRef< + typeof import("@vueuse/core")["createTemplatePromise"] + >; + readonly createUnrefFn: UnwrapRef< + typeof import("@vueuse/core")["createUnrefFn"] + >; + readonly customRef: UnwrapRef; + readonly debouncedRef: UnwrapRef< + typeof import("@vueuse/core")["debouncedRef"] + >; + readonly debouncedWatch: UnwrapRef< + typeof import("@vueuse/core")["debouncedWatch"] + >; + readonly defineAsyncComponent: UnwrapRef< + typeof import("vue")["defineAsyncComponent"] + >; + readonly defineComponent: UnwrapRef< + typeof import("vue")["defineComponent"] + >; + readonly eagerComputed: UnwrapRef< + typeof import("@vueuse/core")["eagerComputed"] + >; + readonly effectScope: UnwrapRef; + readonly extendRef: UnwrapRef; + readonly getCurrentInstance: UnwrapRef< + typeof import("vue")["getCurrentInstance"] + >; + readonly getCurrentScope: UnwrapRef< + typeof import("vue")["getCurrentScope"] + >; + readonly h: UnwrapRef; + readonly ignorableWatch: UnwrapRef< + typeof import("@vueuse/core")["ignorableWatch"] + >; + readonly inject: UnwrapRef; + readonly isDefined: UnwrapRef; + readonly isProxy: UnwrapRef; + readonly isReactive: UnwrapRef; + readonly isReadonly: UnwrapRef; + readonly isRef: UnwrapRef; + readonly makeDestructurable: UnwrapRef< + typeof import("@vueuse/core")["makeDestructurable"] + >; + readonly markRaw: UnwrapRef; + readonly nextTick: UnwrapRef; + readonly onActivated: UnwrapRef; + readonly onBeforeMount: UnwrapRef; + readonly onBeforeUnmount: UnwrapRef< + typeof import("vue")["onBeforeUnmount"] + >; + readonly onBeforeUpdate: UnwrapRef; + readonly onClickOutside: UnwrapRef< + typeof import("@vueuse/core")["onClickOutside"] + >; + readonly onDeactivated: UnwrapRef; + readonly onErrorCaptured: UnwrapRef< + typeof import("vue")["onErrorCaptured"] + >; + readonly onKeyStroke: UnwrapRef< + typeof import("@vueuse/core")["onKeyStroke"] + >; + readonly onLongPress: UnwrapRef< + typeof import("@vueuse/core")["onLongPress"] + >; + readonly onMounted: UnwrapRef; + readonly onRenderTracked: UnwrapRef< + typeof import("vue")["onRenderTracked"] + >; + readonly onRenderTriggered: UnwrapRef< + typeof import("vue")["onRenderTriggered"] + >; + readonly onScopeDispose: UnwrapRef; + readonly onServerPrefetch: UnwrapRef< + typeof import("vue")["onServerPrefetch"] + >; + readonly onStartTyping: UnwrapRef< + typeof import("@vueuse/core")["onStartTyping"] + >; + readonly onUnmounted: UnwrapRef; + readonly onUpdated: UnwrapRef; + readonly pausableWatch: UnwrapRef< + typeof import("@vueuse/core")["pausableWatch"] + >; + readonly provide: UnwrapRef; + readonly reactify: UnwrapRef; + readonly reactifyObject: UnwrapRef< + typeof import("@vueuse/core")["reactifyObject"] + >; + readonly reactive: UnwrapRef; + readonly reactiveComputed: UnwrapRef< + typeof import("@vueuse/core")["reactiveComputed"] + >; + readonly reactiveOmit: UnwrapRef< + typeof import("@vueuse/core")["reactiveOmit"] + >; + readonly reactivePick: UnwrapRef< + typeof import("@vueuse/core")["reactivePick"] + >; + readonly readonly: UnwrapRef; + readonly ref: UnwrapRef; + readonly refAutoReset: UnwrapRef< + typeof import("@vueuse/core")["refAutoReset"] + >; + readonly refDebounced: UnwrapRef< + typeof import("@vueuse/core")["refDebounced"] + >; + readonly refDefault: UnwrapRef; + readonly refThrottled: UnwrapRef< + typeof import("@vueuse/core")["refThrottled"] + >; + readonly refWithControl: UnwrapRef< + typeof import("@vueuse/core")["refWithControl"] + >; + readonly resolveComponent: UnwrapRef< + typeof import("vue")["resolveComponent"] + >; + readonly resolveRef: UnwrapRef; + readonly resolveUnref: UnwrapRef< + typeof import("@vueuse/core")["resolveUnref"] + >; + readonly shallowReactive: UnwrapRef< + typeof import("vue")["shallowReactive"] + >; + readonly shallowReadonly: UnwrapRef< + typeof import("vue")["shallowReadonly"] + >; + readonly shallowRef: UnwrapRef; + readonly syncRef: UnwrapRef; + readonly syncRefs: UnwrapRef; + readonly templateRef: UnwrapRef< + typeof import("@vueuse/core")["templateRef"] + >; + readonly throttledRef: UnwrapRef< + typeof import("@vueuse/core")["throttledRef"] + >; + readonly throttledWatch: UnwrapRef< + typeof import("@vueuse/core")["throttledWatch"] + >; + readonly toRaw: UnwrapRef; + readonly toReactive: UnwrapRef; + readonly toRef: UnwrapRef; + readonly toRefs: UnwrapRef; + readonly toValue: UnwrapRef; + readonly triggerRef: UnwrapRef; + readonly tryOnBeforeMount: UnwrapRef< + typeof import("@vueuse/core")["tryOnBeforeMount"] + >; + readonly tryOnBeforeUnmount: UnwrapRef< + typeof import("@vueuse/core")["tryOnBeforeUnmount"] + >; + readonly tryOnMounted: UnwrapRef< + typeof import("@vueuse/core")["tryOnMounted"] + >; + readonly tryOnScopeDispose: UnwrapRef< + typeof import("@vueuse/core")["tryOnScopeDispose"] + >; + readonly tryOnUnmounted: UnwrapRef< + typeof import("@vueuse/core")["tryOnUnmounted"] + >; + readonly unref: UnwrapRef; + readonly unrefElement: UnwrapRef< + typeof import("@vueuse/core")["unrefElement"] + >; + readonly until: UnwrapRef; + readonly useActiveElement: UnwrapRef< + typeof import("@vueuse/core")["useActiveElement"] + >; + readonly useAnimate: UnwrapRef; + readonly useArrayDifference: UnwrapRef< + typeof import("@vueuse/core")["useArrayDifference"] + >; + readonly useArrayEvery: UnwrapRef< + typeof import("@vueuse/core")["useArrayEvery"] + >; + readonly useArrayFilter: UnwrapRef< + typeof import("@vueuse/core")["useArrayFilter"] + >; + readonly useArrayFind: UnwrapRef< + typeof import("@vueuse/core")["useArrayFind"] + >; + readonly useArrayFindIndex: UnwrapRef< + typeof import("@vueuse/core")["useArrayFindIndex"] + >; + readonly useArrayFindLast: UnwrapRef< + typeof import("@vueuse/core")["useArrayFindLast"] + >; + readonly useArrayIncludes: UnwrapRef< + typeof import("@vueuse/core")["useArrayIncludes"] + >; + readonly useArrayJoin: UnwrapRef< + typeof import("@vueuse/core")["useArrayJoin"] + >; + readonly useArrayMap: UnwrapRef< + typeof import("@vueuse/core")["useArrayMap"] + >; + readonly useArrayReduce: UnwrapRef< + typeof import("@vueuse/core")["useArrayReduce"] + >; + readonly useArraySome: UnwrapRef< + typeof import("@vueuse/core")["useArraySome"] + >; + readonly useArrayUnique: UnwrapRef< + typeof import("@vueuse/core")["useArrayUnique"] + >; + readonly useAsyncQueue: UnwrapRef< + typeof import("@vueuse/core")["useAsyncQueue"] + >; + readonly useAsyncState: UnwrapRef< + typeof import("@vueuse/core")["useAsyncState"] + >; + readonly useAttrs: UnwrapRef; + readonly useBase64: UnwrapRef; + readonly useBattery: UnwrapRef; + readonly useBluetooth: UnwrapRef< + typeof import("@vueuse/core")["useBluetooth"] + >; + readonly useBreakpoints: UnwrapRef< + typeof import("@vueuse/core")["useBreakpoints"] + >; + readonly useBroadcastChannel: UnwrapRef< + typeof import("@vueuse/core")["useBroadcastChannel"] + >; + readonly useBrowserLocation: UnwrapRef< + typeof import("@vueuse/core")["useBrowserLocation"] + >; + readonly useCached: UnwrapRef; + readonly useClipboard: UnwrapRef< + typeof import("@vueuse/core")["useClipboard"] + >; + readonly useCloned: UnwrapRef; + readonly useColorMode: UnwrapRef< + typeof import("@vueuse/core")["useColorMode"] + >; + readonly useConfirmDialog: UnwrapRef< + typeof import("@vueuse/core")["useConfirmDialog"] + >; + readonly useCounter: UnwrapRef; + readonly useCssModule: UnwrapRef; + readonly useCssVar: UnwrapRef; + readonly useCssVars: UnwrapRef; + readonly useCurrentElement: UnwrapRef< + typeof import("@vueuse/core")["useCurrentElement"] + >; + readonly useCycleList: UnwrapRef< + typeof import("@vueuse/core")["useCycleList"] + >; + readonly useDark: UnwrapRef; + readonly useDateFormat: UnwrapRef< + typeof import("@vueuse/core")["useDateFormat"] + >; + readonly useDebounce: UnwrapRef< + typeof import("@vueuse/core")["useDebounce"] + >; + readonly useDebounceFn: UnwrapRef< + typeof import("@vueuse/core")["useDebounceFn"] + >; + readonly useDebouncedRefHistory: UnwrapRef< + typeof import("@vueuse/core")["useDebouncedRefHistory"] + >; + readonly useDeviceMotion: UnwrapRef< + typeof import("@vueuse/core")["useDeviceMotion"] + >; + readonly useDeviceOrientation: UnwrapRef< + typeof import("@vueuse/core")["useDeviceOrientation"] + >; + readonly useDevicePixelRatio: UnwrapRef< + typeof import("@vueuse/core")["useDevicePixelRatio"] + >; + readonly useDevicesList: UnwrapRef< + typeof import("@vueuse/core")["useDevicesList"] + >; + readonly useDisplayMedia: UnwrapRef< + typeof import("@vueuse/core")["useDisplayMedia"] + >; + readonly useDocumentVisibility: UnwrapRef< + typeof import("@vueuse/core")["useDocumentVisibility"] + >; + readonly useDraggable: UnwrapRef< + typeof import("@vueuse/core")["useDraggable"] + >; + readonly useDropZone: UnwrapRef< + typeof import("@vueuse/core")["useDropZone"] + >; + readonly useElementBounding: UnwrapRef< + typeof import("@vueuse/core")["useElementBounding"] + >; + readonly useElementByPoint: UnwrapRef< + typeof import("@vueuse/core")["useElementByPoint"] + >; + readonly useElementHover: UnwrapRef< + typeof import("@vueuse/core")["useElementHover"] + >; + readonly useElementSize: UnwrapRef< + typeof import("@vueuse/core")["useElementSize"] + >; + readonly useElementVisibility: UnwrapRef< + typeof import("@vueuse/core")["useElementVisibility"] + >; + readonly useEventBus: UnwrapRef< + typeof import("@vueuse/core")["useEventBus"] + >; + readonly useEventListener: UnwrapRef< + typeof import("@vueuse/core")["useEventListener"] + >; + readonly useEventSource: UnwrapRef< + typeof import("@vueuse/core")["useEventSource"] + >; + readonly useEyeDropper: UnwrapRef< + typeof import("@vueuse/core")["useEyeDropper"] + >; + readonly useFavicon: UnwrapRef; + readonly useFetch: UnwrapRef; + readonly useFileDialog: UnwrapRef< + typeof import("@vueuse/core")["useFileDialog"] + >; + readonly useFileSystemAccess: UnwrapRef< + typeof import("@vueuse/core")["useFileSystemAccess"] + >; + readonly useFocus: UnwrapRef; + readonly useFocusWithin: UnwrapRef< + typeof import("@vueuse/core")["useFocusWithin"] + >; + readonly useFps: UnwrapRef; + readonly useFullscreen: UnwrapRef< + typeof import("@vueuse/core")["useFullscreen"] + >; + readonly useGamepad: UnwrapRef; + readonly useGeolocation: UnwrapRef< + typeof import("@vueuse/core")["useGeolocation"] + >; + readonly useIdle: UnwrapRef; + readonly useImage: UnwrapRef; + readonly useInfiniteScroll: UnwrapRef< + typeof import("@vueuse/core")["useInfiniteScroll"] + >; + readonly useIntersectionObserver: UnwrapRef< + typeof import("@vueuse/core")["useIntersectionObserver"] + >; + readonly useInterval: UnwrapRef< + typeof import("@vueuse/core")["useInterval"] + >; + readonly useIntervalFn: UnwrapRef< + typeof import("@vueuse/core")["useIntervalFn"] + >; + readonly useKeyModifier: UnwrapRef< + typeof import("@vueuse/core")["useKeyModifier"] + >; + readonly useLastChanged: UnwrapRef< + typeof import("@vueuse/core")["useLastChanged"] + >; + readonly useLocalStorage: UnwrapRef< + typeof import("@vueuse/core")["useLocalStorage"] + >; + readonly useMagicKeys: UnwrapRef< + typeof import("@vueuse/core")["useMagicKeys"] + >; + readonly useManualRefHistory: UnwrapRef< + typeof import("@vueuse/core")["useManualRefHistory"] + >; + readonly useMediaControls: UnwrapRef< + typeof import("@vueuse/core")["useMediaControls"] + >; + readonly useMediaQuery: UnwrapRef< + typeof import("@vueuse/core")["useMediaQuery"] + >; + readonly useMemoize: UnwrapRef; + readonly useMemory: UnwrapRef; + readonly useMounted: UnwrapRef; + readonly useMouse: UnwrapRef; + readonly useMouseInElement: UnwrapRef< + typeof import("@vueuse/core")["useMouseInElement"] + >; + readonly useMousePressed: UnwrapRef< + typeof import("@vueuse/core")["useMousePressed"] + >; + readonly useMutationObserver: UnwrapRef< + typeof import("@vueuse/core")["useMutationObserver"] + >; + readonly useNavigatorLanguage: UnwrapRef< + typeof import("@vueuse/core")["useNavigatorLanguage"] + >; + readonly useNetwork: UnwrapRef; + readonly useNow: UnwrapRef; + readonly useObjectUrl: UnwrapRef< + typeof import("@vueuse/core")["useObjectUrl"] + >; + readonly useOffsetPagination: UnwrapRef< + typeof import("@vueuse/core")["useOffsetPagination"] + >; + readonly useOnline: UnwrapRef; + readonly usePageLeave: UnwrapRef< + typeof import("@vueuse/core")["usePageLeave"] + >; + readonly useParallax: UnwrapRef< + typeof import("@vueuse/core")["useParallax"] + >; + readonly useParentElement: UnwrapRef< + typeof import("@vueuse/core")["useParentElement"] + >; + readonly usePerformanceObserver: UnwrapRef< + typeof import("@vueuse/core")["usePerformanceObserver"] + >; + readonly usePermission: UnwrapRef< + typeof import("@vueuse/core")["usePermission"] + >; + readonly usePointer: UnwrapRef; + readonly usePointerLock: UnwrapRef< + typeof import("@vueuse/core")["usePointerLock"] + >; + readonly usePointerSwipe: UnwrapRef< + typeof import("@vueuse/core")["usePointerSwipe"] + >; + readonly usePreferredColorScheme: UnwrapRef< + typeof import("@vueuse/core")["usePreferredColorScheme"] + >; + readonly usePreferredContrast: UnwrapRef< + typeof import("@vueuse/core")["usePreferredContrast"] + >; + readonly usePreferredDark: UnwrapRef< + typeof import("@vueuse/core")["usePreferredDark"] + >; + readonly usePreferredLanguages: UnwrapRef< + typeof import("@vueuse/core")["usePreferredLanguages"] + >; + readonly usePreferredReducedMotion: UnwrapRef< + typeof import("@vueuse/core")["usePreferredReducedMotion"] + >; + readonly usePrevious: UnwrapRef< + typeof import("@vueuse/core")["usePrevious"] + >; + readonly useRafFn: UnwrapRef; + readonly useRefHistory: UnwrapRef< + typeof import("@vueuse/core")["useRefHistory"] + >; + readonly useResizeObserver: UnwrapRef< + typeof import("@vueuse/core")["useResizeObserver"] + >; + readonly useScreenOrientation: UnwrapRef< + typeof import("@vueuse/core")["useScreenOrientation"] + >; + readonly useScreenSafeArea: UnwrapRef< + typeof import("@vueuse/core")["useScreenSafeArea"] + >; + readonly useScriptTag: UnwrapRef< + typeof import("@vueuse/core")["useScriptTag"] + >; + readonly useScroll: UnwrapRef; + readonly useScrollLock: UnwrapRef< + typeof import("@vueuse/core")["useScrollLock"] + >; + readonly useSessionStorage: UnwrapRef< + typeof import("@vueuse/core")["useSessionStorage"] + >; + readonly useShare: UnwrapRef; + readonly useSlots: UnwrapRef; + readonly useSorted: UnwrapRef; + readonly useSpeechRecognition: UnwrapRef< + typeof import("@vueuse/core")["useSpeechRecognition"] + >; + readonly useSpeechSynthesis: UnwrapRef< + typeof import("@vueuse/core")["useSpeechSynthesis"] + >; + readonly useStepper: UnwrapRef; + readonly useStorage: UnwrapRef; + readonly useStorageAsync: UnwrapRef< + typeof import("@vueuse/core")["useStorageAsync"] + >; + readonly useStyleTag: UnwrapRef< + typeof import("@vueuse/core")["useStyleTag"] + >; + readonly useSupported: UnwrapRef< + typeof import("@vueuse/core")["useSupported"] + >; + readonly useSwipe: UnwrapRef; + readonly useTemplateRefsList: UnwrapRef< + typeof import("@vueuse/core")["useTemplateRefsList"] + >; + readonly useTextDirection: UnwrapRef< + typeof import("@vueuse/core")["useTextDirection"] + >; + readonly useTextSelection: UnwrapRef< + typeof import("@vueuse/core")["useTextSelection"] + >; + readonly useTextareaAutosize: UnwrapRef< + typeof import("@vueuse/core")["useTextareaAutosize"] + >; + readonly useThrottle: UnwrapRef< + typeof import("@vueuse/core")["useThrottle"] + >; + readonly useThrottleFn: UnwrapRef< + typeof import("@vueuse/core")["useThrottleFn"] + >; + readonly useThrottledRefHistory: UnwrapRef< + typeof import("@vueuse/core")["useThrottledRefHistory"] + >; + readonly useTimeAgo: UnwrapRef; + readonly useTimeout: UnwrapRef; + readonly useTimeoutFn: UnwrapRef< + typeof import("@vueuse/core")["useTimeoutFn"] + >; + readonly useTimeoutPoll: UnwrapRef< + typeof import("@vueuse/core")["useTimeoutPoll"] + >; + readonly useTimestamp: UnwrapRef< + typeof import("@vueuse/core")["useTimestamp"] + >; + readonly useTitle: UnwrapRef; + readonly useToNumber: UnwrapRef< + typeof import("@vueuse/core")["useToNumber"] + >; + readonly useToString: UnwrapRef< + typeof import("@vueuse/core")["useToString"] + >; + readonly useToggle: UnwrapRef; + readonly useTransition: UnwrapRef< + typeof import("@vueuse/core")["useTransition"] + >; + readonly useUrlSearchParams: UnwrapRef< + typeof import("@vueuse/core")["useUrlSearchParams"] + >; + readonly useUserMedia: UnwrapRef< + typeof import("@vueuse/core")["useUserMedia"] + >; + readonly useVModel: UnwrapRef; + readonly useVModels: UnwrapRef; + readonly useVibrate: UnwrapRef; + readonly useVirtualList: UnwrapRef< + typeof import("@vueuse/core")["useVirtualList"] + >; + readonly useWakeLock: UnwrapRef< + typeof import("@vueuse/core")["useWakeLock"] + >; + readonly useWebNotification: UnwrapRef< + typeof import("@vueuse/core")["useWebNotification"] + >; + readonly useWebSocket: UnwrapRef< + typeof import("@vueuse/core")["useWebSocket"] + >; + readonly useWebWorker: UnwrapRef< + typeof import("@vueuse/core")["useWebWorker"] + >; + readonly useWebWorkerFn: UnwrapRef< + typeof import("@vueuse/core")["useWebWorkerFn"] + >; + readonly useWindowFocus: UnwrapRef< + typeof import("@vueuse/core")["useWindowFocus"] + >; + readonly useWindowScroll: UnwrapRef< + typeof import("@vueuse/core")["useWindowScroll"] + >; + readonly useWindowSize: UnwrapRef< + typeof import("@vueuse/core")["useWindowSize"] + >; + readonly watch: UnwrapRef; + readonly watchArray: UnwrapRef; + readonly watchAtMost: UnwrapRef< + typeof import("@vueuse/core")["watchAtMost"] + >; + readonly watchDebounced: UnwrapRef< + typeof import("@vueuse/core")["watchDebounced"] + >; + readonly watchDeep: UnwrapRef; + readonly watchEffect: UnwrapRef; + readonly watchIgnorable: UnwrapRef< + typeof import("@vueuse/core")["watchIgnorable"] + >; + readonly watchImmediate: UnwrapRef< + typeof import("@vueuse/core")["watchImmediate"] + >; + readonly watchOnce: UnwrapRef; + readonly watchPausable: UnwrapRef< + typeof import("@vueuse/core")["watchPausable"] + >; + readonly watchPostEffect: UnwrapRef< + typeof import("vue")["watchPostEffect"] + >; + readonly watchSyncEffect: UnwrapRef< + typeof import("vue")["watchSyncEffect"] + >; + readonly watchThrottled: UnwrapRef< + typeof import("@vueuse/core")["watchThrottled"] + >; + readonly watchTriggerable: UnwrapRef< + typeof import("@vueuse/core")["watchTriggerable"] + >; + readonly watchWithFilter: UnwrapRef< + typeof import("@vueuse/core")["watchWithFilter"] + >; + readonly whenever: UnwrapRef; + } +} diff --git a/src/types/common.d.ts b/src/types/common.d.ts deleted file mode 100644 index 1aeff93f57f1b5aec93b1ae4444d5c4370073586..0000000000000000000000000000000000000000 --- a/src/types/common.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * 组件类型声明 - */ - -/** - * 弹窗属性类型声明 - */ -export interface Dialog { - title: string, - visible: boolean -} - -/** - * 通用组件选择项类型声明 - */ -export interface Option { - value: string, - label: string - children?: Option[] -} - diff --git a/src/types/components.d.ts b/src/types/components.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2d6a64852e51da91c7083430be0481f706cbdc04 --- /dev/null +++ b/src/types/components.d.ts @@ -0,0 +1,108 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// Generated by unplugin-vue-components +// Read more: https://github.com/vuejs/core/pull/3399 +import '@vue/runtime-core' + +export { }; + +declare module "@vue/runtime-core" { + export interface GlobalComponents { + AppMain: typeof import("./../layout/components/AppMain.vue")["default"]; + BarChart: typeof import("./../views/dashboard/components/BarChart.vue")["default"]; + Breadcrumb: typeof import("./../components/Breadcrumb/index.vue")["default"]; + Dictionary: typeof import("./../components/Dictionary/index.vue")["default"]; + ElAlert: typeof import("element-plus/es")["ElAlert"]; + ElBreadcrumb: typeof import("element-plus/es")["ElBreadcrumb"]; + ElBreadcrumbItem: typeof import("element-plus/es")["ElBreadcrumbItem"]; + ElButton: typeof import("element-plus/es")["ElButton"]; + ElCard: typeof import("element-plus/es")["ElCard"]; + ElCheckbox: typeof import("element-plus/es")["ElCheckbox"]; + ElCheckboxGroup: typeof import("element-plus/es")["ElCheckboxGroup"]; + ElCol: typeof import("element-plus/es")["ElCol"]; + ElDatePicker: typeof import("element-plus/es")["ElDatePicker"]; + ElDialog: typeof import("element-plus/es")["ElDialog"]; + ElDivider: typeof import("element-plus/es")["ElDivider"]; + ElDropdown: typeof import("element-plus/es")["ElDropdown"]; + ElDropdownItem: typeof import("element-plus/es")["ElDropdownItem"]; + ElDropdownMenu: typeof import("element-plus/es")["ElDropdownMenu"]; + ElForm: typeof import("element-plus/es")["ElForm"]; + ElFormItem: typeof import("element-plus/es")["ElFormItem"]; + ElIcon: typeof import("element-plus/es")["ElIcon"]; + ElInput: typeof import("element-plus/es")["ElInput"]; + ElInputNumber: typeof import("element-plus/es")["ElInputNumber"]; + ElLink: typeof import("element-plus/es")["ElLink"]; + ElMenu: typeof import("element-plus/es")["ElMenu"]; + ElMenuItem: typeof import("element-plus/es")["ElMenuItem"]; + ElOption: typeof import("element-plus/es")["ElOption"]; + ElPagination: typeof import("element-plus/es")["ElPagination"]; + ElPopover: typeof import("element-plus/es")["ElPopover"]; + ElRadio: typeof import("element-plus/es")["ElRadio"]; + ElRadioButton: typeof import("element-plus/es")["ElRadioButton"]; + ElRadioGroup: typeof import("element-plus/es")["ElRadioGroup"]; + ElRate: typeof import("element-plus/es")["ElRate"]; + ElRow: typeof import("element-plus/es")["ElRow"]; + ElScrollbar: typeof import("element-plus/es")["ElScrollbar"]; + ElSelect: typeof import("element-plus/es")["ElSelect"]; + ElSubMenu: typeof import("element-plus/es")["ElSubMenu"]; + ElSwitch: typeof import("element-plus/es")["ElSwitch"]; + ElTable: typeof import("element-plus/es")["ElTable"]; + ElTableColumn: typeof import("element-plus/es")["ElTableColumn"]; + ElTabPane: typeof import("element-plus/es")["ElTabPane"]; + ElTabs: typeof import("element-plus/es")["ElTabs"]; + ElTag: typeof import("element-plus/es")["ElTag"]; + ElTooltip: typeof import("element-plus/es")["ElTooltip"]; + ElTree: typeof import("element-plus/es")["ElTree"]; + ElTreeSelect: typeof import("element-plus/es")["ElTreeSelect"]; + ElUpload: typeof import("element-plus/es")["ElUpload"]; + FixedThead: typeof import("./../views/table/dynamic-table/components/FixedThead.vue")["default"]; + FunnelChart: typeof import("./../views/dashboard/components/FunnelChart.vue")["default"]; + GithubCorner: typeof import("./../components/GithubCorner/index.vue")["default"]; + Hamburger: typeof import("./../components/Hamburger/index.vue")["default"]; + IconSelect: typeof import("./../components/IconSelect/index.vue")["default"]; + IEpArrowDown: typeof import("~icons/ep/arrow-down")["default"]; + IEpCaretBottom: typeof import("~icons/ep/caret-bottom")["default"]; + IEpCaretTop: typeof import("~icons/ep/caret-top")["default"]; + IEpClose: typeof import("~icons/ep/close")["default"]; + IEpCollection: typeof import("~icons/ep/collection")["default"]; + IEpDelete: typeof import("~icons/ep/delete")["default"]; + IEpDownload: typeof import("~icons/ep/download")["default"]; + IEpEdit: typeof import("~icons/ep/edit")["default"]; + IEpPlus: typeof import("~icons/ep/plus")["default"]; + IEpPosition: typeof import("~icons/ep/position")["default"]; + IEpRefresh: typeof import("~icons/ep/refresh")["default"]; + IEpRefreshLeft: typeof import("~icons/ep/refresh-left")["default"]; + IEpSearch: typeof import("~icons/ep/search")["default"]; + IEpSetting: typeof import("~icons/ep/setting")["default"]; + IEpSortDown: typeof import("~icons/ep/sort-down")["default"]; + IEpSortUp: typeof import("~icons/ep/sort-up")["default"]; + IEpTop: typeof import("~icons/ep/top")["default"]; + IEpUploadFilled: typeof import("~icons/ep/upload-filled")["default"]; + LangSelect: typeof import("./../components/LangSelect/index.vue")["default"]; + Link: typeof import("./../layout/components/Sidebar/Link.vue")["default"]; + Logo: typeof import("./../layout/components/Sidebar/Logo.vue")["default"]; + MultiUpload: typeof import("./../components/Upload/MultiUpload.vue")["default"]; + Pagination: typeof import("./../components/Pagination/index.vue")["default"]; + PieChart: typeof import("./../views/dashboard/components/PieChart.vue")["default"]; + RadarChart: typeof import("./../views/dashboard/components/RadarChart.vue")["default"]; + RightPanel: typeof import("./../components/RightPanel/index.vue")["default"]; + RouterLink: typeof import("vue-router")["RouterLink"]; + RouterView: typeof import("vue-router")["RouterView"]; + ScrollPane: typeof import("./../layout/components/TagsView/ScrollPane.vue")["default"]; + Settings: typeof import("./../layout/components/Settings/index.vue")["default"]; + Sidebar: typeof import("./../layout/components/Sidebar/index.vue")["default"]; + SidebarItem: typeof import("./../layout/components/Sidebar/SidebarItem.vue")["default"]; + SingleUpload: typeof import("./../components/Upload/SingleUpload.vue")["default"]; + SizeSelect: typeof import("./../components/SizeSelect/index.vue")["default"]; + SvgIcon: typeof import("./../components/SvgIcon/index.vue")["default"]; + SwitchRoles: typeof import("./../views/permission/components/SwitchRoles.vue")["default"]; + TagInput: typeof import("./../components/TagInput/index.vue")["default"]; + TagsView: typeof import("./../layout/components/TagsView/index.vue")["default"]; + UnfixedThead: typeof import("./../views/table/dynamic-table/components/UnfixedThead.vue")["default"]; + WangEditor: typeof import("./../components/WangEditor/index.vue")["default"]; + } + export interface ComponentCustomProperties { + vLoading: typeof import("element-plus/es")["ElLoadingDirective"]; + } +} diff --git a/src/env.d.ts b/src/types/env.d.ts similarity index 44% rename from src/env.d.ts rename to src/types/env.d.ts index 272014dc806fa29c7893ed56693ee09403e0a9bf..d9cdd46b0fc130d8976b201a23868a370ef856e9 100644 --- a/src/env.d.ts +++ b/src/types/env.d.ts @@ -1,19 +1,21 @@ /// -declare module '*.vue' { - import { DefineComponent } from 'vue' +declare module "*.vue" { + import { DefineComponent } from "vue"; // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types - const component: DefineComponent<{}, {}, any> - export default component + const component: DefineComponent<{}, {}, any>; + export default component; } // 环境变量 TypeScript的智能提示 interface ImportMetaEnv { - VITE_APP_TITLE: string, - VITE_APP_PORT: string, - VITE_APP_BASE_API: string + VITE_APP_TITLE: string; + VITE_APP_PORT: string; + VITE_APP_BASE_API: string; } interface ImportMeta { - readonly env: ImportMetaEnv -} \ No newline at end of file + readonly env: ImportMetaEnv; +} + +declare module "lodash-es"; diff --git a/src/types/global.d.ts b/src/types/global.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3555345de04397ac48eb88e207d43c842108b97b --- /dev/null +++ b/src/types/global.d.ts @@ -0,0 +1,55 @@ +declare global { + /** + * 分页查询参数 + */ + interface PageQuery { + pageNum: number; + pageSize: number; + } + + /** + * 分页响应对象 + */ + interface PageResult { + /** + * 数据列表 + */ + list: T; + /** + * 数据总数 + */ + total: number; + } + + /** + * 弹窗属性 + */ + interface DialogOption { + /** + * 弹窗标题 + */ + title?: string; + /** + * 是否显示 + */ + visible: boolean; + } + /** + * 组件数据源 + */ + interface OptionType { + /** + * 值 + */ + value: string | number; + /** + * 文本 + */ + label: string; + /** + * 子列表 + */ + children?: OptionType[]; + } +} +export {}; diff --git a/src/types/index.d.ts b/src/types/index.d.ts deleted file mode 100644 index c5840fada27553b94894bb406bc28977408d5c1b..0000000000000000000000000000000000000000 --- a/src/types/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ - -export * from './api/system/login' -export * from './api/system/user' -export * from './api/system/role' -export * from './api/system/menu' -export * from './api/system/dept' -export * from './api/system/dict' -export * from './api/system/perm' -export * from './api/system/client' - - -export * from './api/pms/goods' -export * from './api/pms/brand' -export * from './api/sms/advert' -export * from './api/oms/order' -export * from './api/ums/member' - -export * from './store' - -export * from './common' - diff --git a/src/types/shims-vue.d.ts b/src/types/shims-vue.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..abbc9312cec44ae07d3ebf700458e3934bd72e97 --- /dev/null +++ b/src/types/shims-vue.d.ts @@ -0,0 +1 @@ +declare module "xlsx/xlsx.mjs"; diff --git a/src/types/store.d.ts b/src/types/store.d.ts deleted file mode 100644 index 5ac33d679f13d722546195703cefe9faf575c9af..0000000000000000000000000000000000000000 --- a/src/types/store.d.ts +++ /dev/null @@ -1,57 +0,0 @@ - -import {RouteRecordRaw,RouteLocationNormalized} from "vue-router"; -/** - * 用户状态类型声明 - */ - export interface AppState { - device: string, - sidebar: { - opened: boolean, - withoutAnimation: boolean - }, - language:string, - size:string -} - - -/** - * 权限类型声明 - */ -export interface PermissionState{ - routes:RouteRecordRaw[] - addRoutes: RouteRecordRaw[] -} - -/** - * 设置状态类型声明 - */ - export interface SettingState { - theme: string, - tagsView: boolean, - fixedHeader: boolean, - showSettings: boolean, - sidebarLogo: boolean -} - -/** - * 标签状态类型声明 - */ - export interface TagView extends Partial { - title?: string -} - -export interface TagsViewState{ - visitedViews: TagView[], - cachedViews: (string)[] -} - -/** - * 用户状态类型声明 - */ - export interface UserState { - token: string, - nickname: string, - avatar: string, - roles: string[], - perms: string[] -} diff --git a/src/utils/filter.ts b/src/utils/filter.ts deleted file mode 100644 index b5c9871b1fe5b6b504735ac0c52916e3c0ee9700..0000000000000000000000000000000000000000 --- a/src/utils/filter.ts +++ /dev/null @@ -1,76 +0,0 @@ - -/** - * Show plural label if time is plural number - * @param {number} time - * @param {string} label - * @return {string} - */ -function pluralize(time:number, label:string) { - if (time === 1) { - return time + label - } - return time + label + 's' -} - -/** - * @param {number} time - */ -export function timeAgo(time:number) { - const between = Date.now() / 1000 - Number(time) - if (between < 3600) { - return pluralize(~~(between / 60), ' minute') - } else if (between < 86400) { - return pluralize(~~(between / 3600), ' hour') - } else { - return pluralize(~~(between / 86400), ' day') - } -} - -/** - * Number formatting - * like 10000 => 10k - * @param {number} num - * @param {number} digits - */ -export function numberFormatter(num:number, digits:number) { - const si = [ - {value: 1E18, symbol: 'E'}, - {value: 1E15, symbol: 'P'}, - {value: 1E12, symbol: 'T'}, - {value: 1E9, symbol: 'G'}, - {value: 1E6, symbol: 'M'}, - {value: 1E3, symbol: 'k'} - ] - for (let i = 0; i < si.length; i++) { - if (num >= si[i].value) { - return (num / si[i].value).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol - } - } - return num.toString() -} - -/** - * 10000 => "10,000" - * @param {number} num - */ -export function toThousandFilter(num:number) { - return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ',')) -} - -/** - * Upper case first char - * @param {String} string - */ -export function uppercaseFirst(string:string) { - return string.charAt(0).toUpperCase() + string.slice(1) -} - - -/** - * 金额转换(分->元) - * 100 => 1 - * @param {number} num - */ -export function moneyFormatter(num:number) { - return '¥'+(isNaN(num) ? 0.00 : parseFloat((num / 100).toFixed(2))) -} diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts index 06d8dede0165276afb44b2ea51074c1d572c05a9..a2d094d3b828af5e0542b20a417b71b4dbf8e401 100644 --- a/src/utils/i18n.ts +++ b/src/utils/i18n.ts @@ -1,12 +1,12 @@ // translate router.meta.title, be used in breadcrumb sidebar tagsview import i18n from "@/lang/index"; -export function generateTitle(title: any) { - // 判断是否存在国际化配置,如果没有原生返回 - const hasKey = i18n.global.te('route.' + title) - if (hasKey) { - const translatedTitle = i18n.global.t('route.' + title) - return translatedTitle - } - return title -} \ No newline at end of file +export function translateRouteTitleI18n(title: any) { + // 判断是否存在国际化配置,如果没有原生返回 + const hasKey = i18n.global.te("route." + title); + if (hasKey) { + const translatedTitle = i18n.global.t("route." + title); + return translatedTitle; + } + return title; +} diff --git a/src/utils/index.ts b/src/utils/index.ts index a29e5006d02204355732b1f2d030f2823c17c05f..0d6266087d60dcd5b3ff399a9f9f994e59cf1786 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,47 +1,39 @@ /** * Check if an element has a class - * @param {HTMLElement} elm + * @param {HTMLElement} ele * @param {string} cls * @returns {boolean} */ export function hasClass(ele: HTMLElement, cls: string) { - return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')) + return !!ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)")); } /** * Add class to element - * @param {HTMLElement} elm + * @param {HTMLElement} ele * @param {string} cls */ export function addClass(ele: HTMLElement, cls: string) { - if (!hasClass(ele, cls)) ele.className += ' ' + cls + if (!hasClass(ele, cls)) ele.className += " " + cls; } /** * Remove class from element - * @param {HTMLElement} elm + * @param {HTMLElement} ele * @param {string} cls */ export function removeClass(ele: HTMLElement, cls: string) { - if (hasClass(ele, cls)) { - const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)') - ele.className = ele.className.replace(reg, ' ') - } + if (hasClass(ele, cls)) { + const reg = new RegExp("(\\s|^)" + cls + "(\\s|$)"); + ele.className = ele.className.replace(reg, " "); + } } -export function mix(color1: string, color2: string, weight: number) { - weight = Math.max(Math.min(Number(weight), 1), 0); - let r1 = parseInt(color1.substring(1, 3), 16); - let g1 = parseInt(color1.substring(3, 5), 16); - let b1 = parseInt(color1.substring(5, 7), 16); - let r2 = parseInt(color2.substring(1, 3), 16); - let g2 = parseInt(color2.substring(3, 5), 16); - let b2 = parseInt(color2.substring(5, 7), 16); - let r = Math.round(r1 * (1 - weight) + r2 * weight); - let g = Math.round(g1 * (1 - weight) + g2 * weight); - let b = Math.round(b1 * (1 - weight) + b2 * weight); - const rStr = ("0" + (r || 0).toString(16)).slice(-2); - const gStr = ("0" + (g || 0).toString(16)).slice(-2); - const bStr = ("0" + (b || 0).toString(16)).slice(-2); - return "#" + rStr + gStr + bStr; -}; +/** + * @param {string} path + * @returns {Boolean} + */ +export function isExternal(path: string) { + const isExternal = /^(https?:|http?:|mailto:|tel:)/.test(path); + return isExternal; +} diff --git a/src/utils/request.ts b/src/utils/request.ts index edf75d0574f6237f4671fd435ae2c0f51b541306..8cc63931355fa6589f5b00a383e970900d537546 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -1,70 +1,61 @@ -import axios, { AxiosRequestConfig, AxiosResponse } from "axios"; -import { ElMessage, ElMessageBox } from "element-plus"; -import { localStorage } from "@/utils/storage"; -import useStore from "@/store"; +import axios, { InternalAxiosRequestConfig, AxiosResponse } from "axios"; +import { useUserStoreHook } from "@/store/modules/user"; // 创建 axios 实例 const service = axios.create({ - baseURL: import.meta.env.VITE_APP_BASE_API, - timeout: 50000, - headers: { 'Content-Type': 'application/json;charset=utf-8' } -}) + baseURL: import.meta.env.VITE_APP_BASE_API, + timeout: 50000, + headers: { "Content-Type": "application/json;charset=utf-8" }, +}); // 请求拦截器 service.interceptors.request.use( - (config: AxiosRequestConfig) => { - if (!config.headers) { - throw new Error(`Expected 'config' and 'config.headers' not to be undefined`); - } - const { user } = useStore() - if (user.token) { - config.headers.Authorization = `${localStorage.get('token')}`; - } - return config - }, (error) => { - return Promise.reject(error); + (config: InternalAxiosRequestConfig) => { + const userStore = useUserStoreHook(); + if (userStore.token) { + config.headers.Authorization = userStore.token; } -) + return config; + }, + (error: any) => { + return Promise.reject(error); + } +); // 响应拦截器 service.interceptors.response.use( - (response: AxiosResponse) => { - const { code, msg } = response.data; - if (code === '00000') { - return response.data; - } else { - - // 响应数据为二进制流处理(Excel导出) - if (response.data instanceof ArrayBuffer) { - return response - } + (response: AxiosResponse) => { + const { code, msg } = response.data; + if (code === "00000") { + return response.data; + } + // 响应数据为二进制流处理(Excel导出) + if (response.data instanceof ArrayBuffer) { + return response; + } - ElMessage({ - message: msg || '系统出错', - type: 'error' - }) - return Promise.reject(new Error(msg || 'Error')) - } - }, - (error) => { - const { code, msg } = error.response.data - if (code === 'A0230') { // token 过期 - localStorage.clear(); // 清除浏览器全部缓存 - window.location.href = '/'; // 跳转登录页 - ElMessageBox.alert('当前页面已失效,请重新登录', '提示', {}) - .then(() => { - }) - .catch(() => { - }); - } else { - ElMessage({ - message: msg || '系统出错', - type: 'error' - }) - } - return Promise.reject(new Error(msg || 'Error')) + ElMessage.error(msg || "系统出错"); + return Promise.reject(new Error(msg || "Error")); + }, + (error: any) => { + if (error.response.data) { + const { code, msg } = error.response.data; + // token 过期,重新登录 + if (code === "A0230") { + ElMessageBox.confirm("当前页面已失效,请重新登录", "提示", { + confirmButtonText: "确定", + type: "warning", + }).then(() => { + localStorage.clear(); + window.location.href = "/"; + }); + } else { + ElMessage.error(msg || "系统出错"); + } } + return Promise.reject(error.message); + } ); // 导出 axios 实例 -export default service +export default service; diff --git a/src/utils/resize.ts b/src/utils/resize.ts deleted file mode 100644 index 7b87e539d8070ffc50e17c5f656ca6a56350670e..0000000000000000000000000000000000000000 --- a/src/utils/resize.ts +++ /dev/null @@ -1,67 +0,0 @@ - -import { ref } from 'vue' -export default function() { - const chart = ref() - const sidebarElm = ref() - - const chartResizeHandler = () => { - if (chart.value) { - chart.value.resize() - } - } - - const sidebarResizeHandler = (e: TransitionEvent) => { - if (e.propertyName === 'width') { - chartResizeHandler() - } - } - - const initResizeEvent = () => { - window.addEventListener('resize', chartResizeHandler) - } - - const destroyResizeEvent = () => { - window.removeEventListener('resize', chartResizeHandler) - } - - const initSidebarResizeEvent = () => { - sidebarElm.value = document.getElementsByClassName('sidebar-container')[0] - if (sidebarElm.value) { - sidebarElm.value.addEventListener('transitionend', sidebarResizeHandler as EventListener) - } - } - - const destroySidebarResizeEvent = () => { - if (sidebarElm.value) { - sidebarElm.value.removeEventListener('transitionend', sidebarResizeHandler as EventListener) - } - } - - const mounted = () => { - initResizeEvent() - initSidebarResizeEvent() - } - - const beforeDestroy = () => { - destroyResizeEvent() - destroySidebarResizeEvent() - } - - const activated = () => { - initResizeEvent() - initSidebarResizeEvent() - } - - const deactivated = () => { - destroyResizeEvent() - destroySidebarResizeEvent() - } - - return { - chart, - mounted, - beforeDestroy, - activated, - deactivated - } -} diff --git a/src/utils/scroll-to.ts b/src/utils/scroll-to.ts index 9c24d8d958db6cf9995c046da1d167679300485e..c4e48fc27483c3df1b5e2333a4e599ef62f49d57 100644 --- a/src/utils/scroll-to.ts +++ b/src/utils/scroll-to.ts @@ -1,61 +1,69 @@ const easeInOutQuad = (t: number, b: number, c: number, d: number) => { - t /= d / 2 - if (t < 1) { - return c / 2 * t * t + b - } - t-- - return -c / 2 * (t * (t - 2) - 1) + b -} - + t /= d / 2; + if (t < 1) { + return (c / 2) * t * t + b; + } + t--; + return (-c / 2) * (t * (t - 2) - 1) + b; +}; // requestAnimationFrame for Smart Animating http://goo.gl/sx5sts const requestAnimFrame = (function () { - return window.requestAnimationFrame || (window as any).webkitRequestAnimationFrame || (window as any).mozRequestAnimationFrame || function (callback) { - window.setTimeout(callback, 1000 / 60) + return ( + window.requestAnimationFrame || + (window as any).webkitRequestAnimationFrame || + (window as any).mozRequestAnimationFrame || + function (callback) { + window.setTimeout(callback, 1000 / 60); } -})() + ); +})(); /** * Because it's so fucking difficult to detect the scrolling element, just move them all * @param {number} amount */ const move = (amount: number) => { - document.documentElement.scrollTop = amount; - (document.body.parentNode as HTMLElement).scrollTop = amount - document.body.scrollTop = amount -} + document.documentElement.scrollTop = amount; + (document.body.parentNode as HTMLElement).scrollTop = amount; + document.body.scrollTop = amount; +}; const position = () => { - return document.documentElement.scrollTop || (document.body.parentNode as HTMLElement).scrollTop || document.body.scrollTop -} + return ( + document.documentElement.scrollTop || + (document.body.parentNode as HTMLElement).scrollTop || + document.body.scrollTop + ); +}; /** * @param {number} to * @param {number} duration * @param {Function} callback */ -export const scrollTo = (to: number, duration: number, callback?: Function) => { - const start = position() - const change = to - start - const increment = 20 - let currentTime = 0 - duration = (typeof (duration) === 'undefined') ? 500 : duration - const animateScroll = function () { - // increment the time - currentTime += increment - // find the value with the quadratic in-out easing function - const val = easeInOutQuad(currentTime, start, change, duration) - // move the document.body - move(val) - // do the animation unless its over - if (currentTime < duration) { - requestAnimFrame(animateScroll) - } else { - if (callback && typeof (callback) === 'function') { - // the animation is done so lets callback - callback() - } - } +export const scrollTo = (to: number, duration: number, callback?: any) => { + const start = position(); + const change = to - start; + const increment = 20; + let currentTime = 0; + duration = typeof duration === "undefined" ? 500 : duration; + const animateScroll = function () { + // increment the time + currentTime += increment; + // find the value with the quadratic in-out easing function + const val = easeInOutQuad(currentTime, start, change, duration); + // move the document.body + move(val); + // do the animation unless its over + if (currentTime < duration) { + requestAnimFrame(animateScroll); + } else { + if (callback && typeof callback === "function") { + // the animation is done so lets callback + callback(); + } } - animateScroll() -} + }; + animateScroll(); +}; diff --git a/src/utils/storage.ts b/src/utils/storage.ts deleted file mode 100644 index 29aac5fecae3bc4ea73b5291462b2e420f9e9a9b..0000000000000000000000000000000000000000 --- a/src/utils/storage.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * window.localStorage 浏览器永久缓存 - */ -export const localStorage = { - // 设置永久缓存 - set(key: string, val: any) { - window.localStorage.setItem(key, JSON.stringify(val)); - }, - // 获取永久缓存 - get(key: string) { - let json: any = window.localStorage.getItem(key); - return JSON.parse(json); - }, - // 移除永久缓存 - remove(key: string) { - window.localStorage.removeItem(key); - }, - // 移除全部永久缓存 - clear() { - window.localStorage.clear(); - } -}; - -/** - * window.sessionStorage 浏览器临时缓存 - */ -export const sessionStorage = { - // 设置临时缓存 - set(key: string, val: any) { - window.sessionStorage.setItem(key, JSON.stringify(val)); - }, - // 获取临时缓存 - get(key: string) { - let json: any = window.sessionStorage.getItem(key); - return JSON.parse(json); - }, - // 移除临时缓存 - remove(key: string) { - window.sessionStorage.removeItem(key); - }, - // 移除全部临时缓存 - clear() { - window.sessionStorage.clear(); - } -}; diff --git a/src/utils/validate.ts b/src/utils/validate.ts deleted file mode 100644 index 19e070509f2342590dfc148f36d586d50f2e1df4..0000000000000000000000000000000000000000 --- a/src/utils/validate.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Created by PanJiaChen on 16/11/18. - */ - -/** - * @param {string} path - * @returns {Boolean} - */ -export function isExternal(path: string) { - const isExternal = /^(https?:|http?:|mailto:|tel:)/.test(path) - return isExternal -} - diff --git a/src/views/dashboard/components/BarChart.vue b/src/views/dashboard/components/BarChart.vue new file mode 100644 index 0000000000000000000000000000000000000000..dc089b1c7cf032d4da305f6d61431d1106290a38 --- /dev/null +++ b/src/views/dashboard/components/BarChart.vue @@ -0,0 +1,194 @@ + + + + + diff --git a/src/views/dashboard/components/Chart/BarChart.vue b/src/views/dashboard/components/Chart/BarChart.vue deleted file mode 100644 index 29634fd12e9237feefa70a7c6e582b17807dc3a4..0000000000000000000000000000000000000000 --- a/src/views/dashboard/components/Chart/BarChart.vue +++ /dev/null @@ -1,183 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/views/dashboard/components/Chart/FunnelChart.vue b/src/views/dashboard/components/Chart/FunnelChart.vue deleted file mode 100644 index 3234d9922e8bf757f892475873454c6933b4ae6e..0000000000000000000000000000000000000000 --- a/src/views/dashboard/components/Chart/FunnelChart.vue +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/views/dashboard/components/Chart/PieChart.vue b/src/views/dashboard/components/Chart/PieChart.vue deleted file mode 100644 index d648d393795ead15ae5d1052bfb249c4b354b955..0000000000000000000000000000000000000000 --- a/src/views/dashboard/components/Chart/PieChart.vue +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/views/dashboard/components/Chart/RadarChart.vue b/src/views/dashboard/components/Chart/RadarChart.vue deleted file mode 100644 index a49372159e076123dd55f0f4216dd3e49d032d10..0000000000000000000000000000000000000000 --- a/src/views/dashboard/components/Chart/RadarChart.vue +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/views/dashboard/components/FunnelChart.vue b/src/views/dashboard/components/FunnelChart.vue new file mode 100644 index 0000000000000000000000000000000000000000..30fedb97717fb30faaf4ab0e3ac67db40daf65b0 --- /dev/null +++ b/src/views/dashboard/components/FunnelChart.vue @@ -0,0 +1,106 @@ + + + + diff --git a/src/views/dashboard/components/PieChart.vue b/src/views/dashboard/components/PieChart.vue new file mode 100644 index 0000000000000000000000000000000000000000..e8dd67026f47267f9aadf46f7385b045a4480bff --- /dev/null +++ b/src/views/dashboard/components/PieChart.vue @@ -0,0 +1,79 @@ + + + + diff --git a/src/views/dashboard/components/Project/index.vue b/src/views/dashboard/components/Project/index.vue deleted file mode 100644 index 6d5598f71d29cc59ff0a61efa837e0477b0d2a9e..0000000000000000000000000000000000000000 --- a/src/views/dashboard/components/Project/index.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/dashboard/components/RadarChart.vue b/src/views/dashboard/components/RadarChart.vue new file mode 100644 index 0000000000000000000000000000000000000000..2081bf2418d8427830aa71fef494d6aae0971c8c --- /dev/null +++ b/src/views/dashboard/components/RadarChart.vue @@ -0,0 +1,100 @@ + + + + diff --git a/src/views/dashboard/components/Team/index.vue b/src/views/dashboard/components/Team/index.vue deleted file mode 100644 index 1cf120c5ecf61cb337dc936256460b24faa6fd5d..0000000000000000000000000000000000000000 --- a/src/views/dashboard/components/Team/index.vue +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index ea3d08fa16bbed1a20df2de4124beb5c57bc9dec..0c892e681c619614a9fc2d5bce82c74315a18c69 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -1,307 +1,247 @@ + + - - - diff --git a/src/views/demo/api-doc.vue b/src/views/demo/api-doc.vue new file mode 100644 index 0000000000000000000000000000000000000000..e625213a98fb0a986f8e97eef5aa7b72144da69d --- /dev/null +++ b/src/views/demo/api-doc.vue @@ -0,0 +1,27 @@ + + + + diff --git a/src/views/demo/dict.vue b/src/views/demo/dict.vue new file mode 100644 index 0000000000000000000000000000000000000000..bcd594da4f925d529a93e24323ced73c0f2b487b --- /dev/null +++ b/src/views/demo/dict.vue @@ -0,0 +1,32 @@ + + + + diff --git a/src/views/demo/icon-selector.vue b/src/views/demo/icon-selector.vue new file mode 100644 index 0000000000000000000000000000000000000000..6a419e2fb8538f93ec606518b11652efaaa2cb7b --- /dev/null +++ b/src/views/demo/icon-selector.vue @@ -0,0 +1,17 @@ + + + + diff --git a/src/views/demo/icons.vue b/src/views/demo/icons.vue new file mode 100644 index 0000000000000000000000000000000000000000..06e917ebdeaf1593b64c5506b0a3857e51ad289f --- /dev/null +++ b/src/views/demo/icons.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/src/views/nested/level1/level2/level3/index1.vue b/src/views/demo/multi-level/children/children/level3-1.vue similarity index 77% rename from src/views/nested/level1/level2/level3/index1.vue rename to src/views/demo/multi-level/children/children/level3-1.vue index 94de1f0d8c6409d60889683e553e986d290eb462..888f58e96d6c0083d00cd5b3f4ad2365eb9a0696 100644 --- a/src/views/nested/level1/level2/level3/index1.vue +++ b/src/views/demo/multi-level/children/children/level3-1.vue @@ -1,5 +1,5 @@ diff --git a/src/views/nested/level1/level2/level3/index2.vue b/src/views/demo/multi-level/children/children/level3-2.vue similarity index 77% rename from src/views/nested/level1/level2/level3/index2.vue rename to src/views/demo/multi-level/children/children/level3-2.vue index e933503ad6c789c95e30585a80882433514f3908..a99c98e98c285314bc98f88405fe98cf4cda60f9 100644 --- a/src/views/nested/level1/level2/level3/index2.vue +++ b/src/views/demo/multi-level/children/children/level3-2.vue @@ -1,5 +1,5 @@ diff --git a/src/views/nested/level1/level2/index.vue b/src/views/demo/multi-level/children/level2.vue similarity index 82% rename from src/views/nested/level1/level2/index.vue rename to src/views/demo/multi-level/children/level2.vue index a9f31caa1b1d7a82cffac3766ff69955947eadf6..abcc3a7e462e8a14b83feda70e45cc95058df1fa 100644 --- a/src/views/nested/level1/level2/index.vue +++ b/src/views/demo/multi-level/children/level2.vue @@ -1,5 +1,5 @@ diff --git a/src/views/system/role/components/Menu.vue b/src/views/system/role/components/Menu.vue deleted file mode 100644 index 8091c74cce1011e12e22e1254602b4d14cac4edd..0000000000000000000000000000000000000000 --- a/src/views/system/role/components/Menu.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - - - diff --git a/src/views/system/role/components/Perm.vue b/src/views/system/role/components/Perm.vue deleted file mode 100644 index 943261ede4be364c9a24f7764e5a743b204aa7ca..0000000000000000000000000000000000000000 --- a/src/views/system/role/components/Perm.vue +++ /dev/null @@ -1,159 +0,0 @@ - - - - - diff --git a/src/views/system/role/components/Role.vue b/src/views/system/role/components/Role.vue deleted file mode 100644 index 6e49c2a310bd8b6fdbe4fde8ae20b996b07c8d65..0000000000000000000000000000000000000000 --- a/src/views/system/role/components/Role.vue +++ /dev/null @@ -1,282 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 1b43a5dd793cc5b2594f43ebe48a93e3af0e7f4a..c9979466525dc856f285b5c14b0787ce91415922 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -1,117 +1,402 @@ -