mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-18 17:46:38 +08:00
refactor(projects): 抽离格式化相关依赖配置
This commit is contained in:
parent
16dce9a4ce
commit
f4d37cf7f0
@ -1,14 +1,5 @@
|
||||
*.sh
|
||||
node_modules
|
||||
lib
|
||||
*.md
|
||||
*.woff
|
||||
*.ttf
|
||||
.vscode
|
||||
.idea
|
||||
/dist/
|
||||
/public
|
||||
/docs
|
||||
.vscode
|
||||
.local
|
||||
!.env-config.ts
|
||||
|
127
.eslintrc.js
127
.eslintrc.js
@ -1,44 +1,18 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
es2021: true
|
||||
},
|
||||
globals: {
|
||||
PROJECT_BUILD_TIME: 'readonly',
|
||||
AMap: 'readonly',
|
||||
BMap: 'readonly',
|
||||
TMap: 'readonly'
|
||||
},
|
||||
parser: 'vue-eslint-parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: 12,
|
||||
parser: '@typescript-eslint/parser',
|
||||
sourceType: 'module'
|
||||
},
|
||||
plugins: ['vue', '@typescript-eslint'],
|
||||
extends: [
|
||||
'airbnb-base',
|
||||
'eslint:recommended',
|
||||
'plugin:vue/vue3-recommended',
|
||||
'plugin:prettier/recommended',
|
||||
'@vue/eslint-config-typescript/recommended',
|
||||
'@vue/eslint-config-prettier',
|
||||
'@vue/typescript/recommended'
|
||||
extends: ['@soybeanjs'],
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
alias: {
|
||||
map: [
|
||||
['~', '.'],
|
||||
['@', './src']
|
||||
],
|
||||
rules: {
|
||||
'import/extensions': [
|
||||
'warn',
|
||||
'ignorePackages',
|
||||
{
|
||||
js: 'never',
|
||||
jsx: 'never',
|
||||
mjs: 'never',
|
||||
ts: 'never',
|
||||
tsx: 'never',
|
||||
mts: 'never'
|
||||
extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', 'mts', '.d.ts']
|
||||
}
|
||||
],
|
||||
'import/no-extraneous-dependencies': ['error', { devDependencies: true, peerDependencies: true }],
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'import/no-unresolved': ['error', { ignore: ['uno.css', '~icons/*', 'virtual:svg-icons-register'] }],
|
||||
'import/order': [
|
||||
'error',
|
||||
{
|
||||
@ -55,11 +29,6 @@ module.exports = {
|
||||
group: 'external',
|
||||
position: 'before'
|
||||
},
|
||||
{
|
||||
pattern: 'vuex',
|
||||
group: 'external',
|
||||
position: 'before'
|
||||
},
|
||||
{
|
||||
pattern: 'pinia',
|
||||
group: 'external',
|
||||
@ -151,76 +120,8 @@ module.exports = {
|
||||
position: 'before'
|
||||
}
|
||||
],
|
||||
pathGroupsExcludedImportTypes: ['vue', 'vue-router', 'vuex', 'pinia', 'naive-ui']
|
||||
}
|
||||
],
|
||||
'import/no-unresolved': ['error', { ignore: ['uno.css', '~icons/*', 'virtual:svg-icons-register'] }],
|
||||
'import/prefer-default-export': 'off',
|
||||
'max-classes-per-file': 'off',
|
||||
'no-param-reassign': [
|
||||
'error',
|
||||
{
|
||||
props: true,
|
||||
ignorePropertyModificationsFor: ['state', 'acc', 'e']
|
||||
}
|
||||
],
|
||||
'no-shadow': 'off',
|
||||
'no-unused-vars': 'off',
|
||||
'no-use-before-define': 'off',
|
||||
'vue/multi-word-component-names': [
|
||||
'error',
|
||||
{
|
||||
ignores: ['index']
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports', disallowTypeAnnotations: false }],
|
||||
'@typescript-eslint/no-empty-interface': [
|
||||
'error',
|
||||
{
|
||||
allowSingleExtends: true
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-shadow': 'error',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{ vars: 'all', args: 'all', ignoreRestSiblings: false, varsIgnorePattern: '^_', argsIgnorePattern: '^_' }
|
||||
],
|
||||
'@typescript-eslint/no-use-before-define': ['error', { classes: true, functions: false, typedefs: false }]
|
||||
},
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
alias: {
|
||||
map: [
|
||||
['~', '.'],
|
||||
['@', './src']
|
||||
],
|
||||
extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', 'mts', '.d.ts']
|
||||
},
|
||||
node: {
|
||||
extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', 'mts', '.d.ts']
|
||||
}
|
||||
}
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.vue'],
|
||||
rules: {
|
||||
'no-undef': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['*.html'],
|
||||
rules: {
|
||||
'vue/comment-directive': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['*.json'],
|
||||
rules: {
|
||||
'no-unused-expressions': 'off'
|
||||
}
|
||||
pathGroupsExcludedImportTypes: ['vue', 'vue-router', 'pinia', 'naive-ui']
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
1
.vscode/extensions.json
vendored
1
.vscode/extensions.json
vendored
@ -19,7 +19,6 @@
|
||||
"pkief.material-icon-theme",
|
||||
"steoates.autoimport",
|
||||
"vue.volar",
|
||||
"vue.vscode-typescript-vue-plugin",
|
||||
"whtouche.vscode-js-console-utils",
|
||||
"zhuangtongfa.material-theme"
|
||||
]
|
||||
|
17
.vscode/settings.json
vendored
17
.vscode/settings.json
vendored
@ -10,7 +10,20 @@
|
||||
},
|
||||
"editor.tabSize": 2,
|
||||
"eslint.alwaysShowStatus": true,
|
||||
"eslint.validate": ["javascript", "javascriptreact", "vue", "typescript", "typescriptreact", "html", "json", "jsonc"],
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
"html",
|
||||
"json",
|
||||
"jsonc",
|
||||
"json5",
|
||||
"yaml",
|
||||
"yml",
|
||||
"markdown"
|
||||
],
|
||||
"files.associations": {
|
||||
"*.env.*": "dotenv"
|
||||
},
|
||||
@ -37,7 +50,7 @@
|
||||
},
|
||||
"path-intellisense.mappings": {
|
||||
"@": "${workspaceFolder}/src",
|
||||
"~@": "${workspaceFolder}/src",
|
||||
"~@": "${workspaceFolder}/src"
|
||||
},
|
||||
"terminal.integrated.cursorStyle": "line",
|
||||
"terminal.integrated.fontSize": 14,
|
||||
|
14
README.md
14
README.md
@ -29,18 +29,16 @@
|
||||
## 代码仓库
|
||||
|
||||
- [github](https://github.com/honghuangdc/soybean-admin)
|
||||
|
||||
- [gitee](https://gitee.com/honghuangdc/soybean-admin)
|
||||
|
||||
## 更新日志
|
||||
|
||||
[CHANGELOG](./CHANGELOG.md)
|
||||
|
||||
## 后端服务
|
||||
|
||||
- [soybean-admin-java(开发中)](https://github.com/honghuangdc/soybean-admin-java)
|
||||
|
||||
- [soybean-admin-go(开发中)](https://github.com/honghuangdc/soybean-admin-go)
|
||||
|
||||
- [soybean-admin-nestjs(开发中)](https://github.com/honghuangdc/soybean-admin-nestjs)
|
||||
|
||||
## 项目示例图
|
||||
@ -67,10 +65,6 @@
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## 开发计划
|
||||
|
||||
- [x] 引入 ECharts 替换 AntV G2Plot
|
||||
@ -95,10 +89,8 @@
|
||||
## 安装使用
|
||||
|
||||
- 环境配置
|
||||
|
||||
**本地环境需要安装 pnpm 7.x 、Node.js 14.18+ 和 Git**
|
||||
|
||||
|
||||
- 克隆代码
|
||||
|
||||
```bash
|
||||
@ -144,7 +136,7 @@ pnpm i -g commitizen
|
||||
支持现代浏览器, 不支持 IE
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png" alt="IE" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Safari |
|
||||
| :-: | :-: | :-: | :-: | :-: |
|
||||
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
||||
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
|
||||
|
||||
## 开源作者
|
||||
@ -156,7 +148,6 @@ pnpm i -g commitizen
|
||||
`Soybean Admin` 是完全开源免费的项目,在帮助开发者更方便地进行中大型管理系统开发,同时也提供微信和 QQ 交流群,使用问题欢迎在群内提问。
|
||||
|
||||
- 微信交流群(添加本人微信拉进群),欢迎来技术交流,业务咨询。
|
||||
|
||||
<div style="text-align:left">
|
||||
<img src="https://s2.loli.net/2022/05/16/3YGBgXnVPJdslk8.jpg" style="width:200px" />
|
||||
</div>
|
||||
@ -168,6 +159,7 @@ pnpm i -g commitizen
|
||||
</div>
|
||||
|
||||
## 捐赠
|
||||
|
||||
如果你觉得这个项目对你有帮助,可以请 Soybean 喝杯饮料表示支持,Soybean 开源的动力离不开各位的支持和鼓励。
|
||||
|
||||

|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { MockMethod } from 'vite-plugin-mock';
|
||||
import { userModel, routeModel } from '../model';
|
||||
import { routeModel, userModel } from '../model';
|
||||
|
||||
const apis: MockMethod[] = [
|
||||
{
|
||||
|
83
package.json
83
package.json
@ -1,11 +1,39 @@
|
||||
{
|
||||
"name": "soybean-admin",
|
||||
"version": "0.9.6",
|
||||
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
||||
"author": {
|
||||
"name": "Soybean",
|
||||
"email": "honghuangdc@gmail.com",
|
||||
"url": "https://github.com/honghuangdc"
|
||||
},
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/honghuangdc/soybean-admin",
|
||||
"repository": {
|
||||
"url": "https://github.com/honghuangdc/soybean-admin.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/honghuangdc/soybean-admin/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"Vue",
|
||||
"Vue3",
|
||||
"admin",
|
||||
"admin-template",
|
||||
"vue-admin",
|
||||
"vue-admin-template",
|
||||
"Vite3",
|
||||
"Vite",
|
||||
"vite-admin",
|
||||
"TypeScript",
|
||||
"TS",
|
||||
"NaiveUI",
|
||||
"naive-ui",
|
||||
"naive-admin",
|
||||
"NaiveUI-Admin",
|
||||
"naive-ui-admin",
|
||||
"UnoCSS"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "cross-env VITE_SERVICE_ENV=dev vite",
|
||||
"dev:test": "cross-env VITE_SERVICE_ENV=test vite",
|
||||
@ -16,20 +44,12 @@
|
||||
"build:vercel": "cross-env VITE_HASH_ROUTE=Y VITE_VERCEL=Y vite build",
|
||||
"preview": "vite preview",
|
||||
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.json --fix",
|
||||
"lint": "eslint . --fix",
|
||||
"prepare": "husky install",
|
||||
"postinstall": "patch-package",
|
||||
"release": "standard-version",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{vue,js,jsx,ts,tsx,json}": "eslint --fix"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "./node_modules/cz-customizable"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@antv/data-set": "^0.11.8",
|
||||
"@antv/g2": "^4.2.5",
|
||||
@ -64,28 +84,20 @@
|
||||
"@iconify/json": "^2.1.87",
|
||||
"@iconify/vue": "^3.2.1",
|
||||
"@milahu/patch-package": "^6.4.14",
|
||||
"@soybeanjs/eslint-config": "^0.2.4",
|
||||
"@types/bmapgl": "^0.0.5",
|
||||
"@types/crypto-js": "^4.1.1",
|
||||
"@types/node": "^18.6.4",
|
||||
"@types/qs": "^6.9.7",
|
||||
"@types/ua-parser-js": "^0.7.36",
|
||||
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
||||
"@typescript-eslint/parser": "^5.32.0",
|
||||
"@vitejs/plugin-vue": "^3.0.1",
|
||||
"@vitejs/plugin-vue-jsx": "^2.0.0",
|
||||
"@vue/eslint-config-prettier": "^7.0.0",
|
||||
"@vue/eslint-config-typescript": "^11.0.0",
|
||||
"commitizen": "^4.2.5",
|
||||
"cross-env": "^7.0.3",
|
||||
"cz-conventional-changelog": "^3.3.0",
|
||||
"cz-customizable": "^6.9.1",
|
||||
"eslint": "^8.21.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-import-resolver-alias": "^1.1.2",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-vue": "9.3.0",
|
||||
"husky": "^8.0.1",
|
||||
"lint-staged": "^13.0.3",
|
||||
"mockjs": "^1.1.0",
|
||||
@ -104,35 +116,14 @@
|
||||
"vite-plugin-html": "^3.2.0",
|
||||
"vite-plugin-mock": "^2.9.6",
|
||||
"vite-plugin-svg-icons": "^2.0.1",
|
||||
"vue-eslint-parser": "^9.0.3",
|
||||
"vue-tsc": "^0.39.5"
|
||||
},
|
||||
"homepage": "https://github.com/honghuangdc/soybean-admin",
|
||||
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
||||
"keywords": [
|
||||
"Vue",
|
||||
"Vue3",
|
||||
"admin",
|
||||
"admin-template",
|
||||
"vue-admin",
|
||||
"vue-admin-template",
|
||||
"Vite3",
|
||||
"Vite",
|
||||
"vite-admin",
|
||||
"TypeScript",
|
||||
"TS",
|
||||
"NaiveUI",
|
||||
"naive-ui",
|
||||
"naive-admin",
|
||||
"NaiveUI-Admin",
|
||||
"naive-ui-admin",
|
||||
"UnoCSS"
|
||||
],
|
||||
"repository": {
|
||||
"url": "https://github.com/honghuangdc/soybean-admin.git"
|
||||
"lint-staged": {
|
||||
"*.{vue,js,jsx,ts,tsx,json}": "eslint --fix"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/honghuangdc/soybean-admin/issues"
|
||||
},
|
||||
"license": "MIT"
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "./node_modules/cz-customizable"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,8 +13,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { zhCN, dateZhCN } from 'naive-ui';
|
||||
import { useThemeStore, subscribeStore } from '@/store';
|
||||
import { dateZhCN, zhCN } from 'naive-ui';
|
||||
import { subscribeStore, useThemeStore } from '@/store';
|
||||
import { useGlobalEvents } from '@/composables';
|
||||
|
||||
const theme = useThemeStore();
|
||||
|
@ -22,7 +22,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, watch, nextTick, onUnmounted } from 'vue';
|
||||
import { computed, nextTick, onUnmounted, watch } from 'vue';
|
||||
import { NETWORK_ERROR_MSG } from '@/config';
|
||||
import { useBoolean } from '@/hooks';
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineComponent, h } from 'vue';
|
||||
import { useLoadingBar, useDialog, useMessage, useNotification } from 'naive-ui';
|
||||
import { useDialog, useLoadingBar, useMessage, useNotification } from 'naive-ui';
|
||||
|
||||
defineOptions({ name: 'NaiveProvider' });
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { useElementSize } from '@vueuse/core';
|
||||
import BScroll from '@better-scroll/core';
|
||||
import type { Options } from '@better-scroll/core';
|
||||
|
@ -2,8 +2,8 @@
|
||||
<span>{{ value }}</span>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, onMounted, watch, watchEffect } from 'vue';
|
||||
import { useTransition, TransitionPresets } from '@vueuse/core';
|
||||
import { computed, onMounted, ref, watch, watchEffect } from 'vue';
|
||||
import { TransitionPresets, useTransition } from '@vueuse/core';
|
||||
import { isNumber } from '@/utils';
|
||||
|
||||
defineOptions({ name: 'CountTo' });
|
||||
|
@ -25,7 +25,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { Icon } from '@iconify/vue';
|
||||
import { useThemeStore } from '@/store';
|
||||
|
||||
|
@ -1,32 +1,32 @@
|
||||
import { ref, watch, nextTick, onUnmounted } from 'vue';
|
||||
import type { Ref, ComputedRef } from 'vue';
|
||||
import { nextTick, onUnmounted, ref, watch } from 'vue';
|
||||
import type { ComputedRef, Ref } from 'vue';
|
||||
import * as echarts from 'echarts/core';
|
||||
import { BarChart, LineChart, PieChart, ScatterChart, PictorialBarChart, RadarChart, GaugeChart } from 'echarts/charts';
|
||||
import { BarChart, GaugeChart, LineChart, PictorialBarChart, PieChart, RadarChart, ScatterChart } from 'echarts/charts';
|
||||
import type {
|
||||
BarSeriesOption,
|
||||
GaugeSeriesOption,
|
||||
LineSeriesOption,
|
||||
PieSeriesOption,
|
||||
ScatterSeriesOption,
|
||||
PictorialBarSeriesOption,
|
||||
PieSeriesOption,
|
||||
RadarSeriesOption,
|
||||
GaugeSeriesOption
|
||||
ScatterSeriesOption
|
||||
} from 'echarts/charts';
|
||||
import {
|
||||
TitleComponent,
|
||||
LegendComponent,
|
||||
TooltipComponent,
|
||||
GridComponent,
|
||||
DatasetComponent,
|
||||
TransformComponent,
|
||||
ToolboxComponent
|
||||
GridComponent,
|
||||
LegendComponent,
|
||||
TitleComponent,
|
||||
ToolboxComponent,
|
||||
TooltipComponent,
|
||||
TransformComponent
|
||||
} from 'echarts/components';
|
||||
import type {
|
||||
TitleComponentOption,
|
||||
LegendComponentOption,
|
||||
TooltipComponentOption,
|
||||
DatasetComponentOption,
|
||||
GridComponentOption,
|
||||
LegendComponentOption,
|
||||
TitleComponentOption,
|
||||
ToolboxComponentOption,
|
||||
DatasetComponentOption
|
||||
TooltipComponentOption
|
||||
} from 'echarts/components';
|
||||
import { LabelLayout, UniversalTransition } from 'echarts/features';
|
||||
import { CanvasRenderer } from 'echarts/renderers';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useEventListener } from '@vueuse/core';
|
||||
import { useThemeStore, useTabStore } from '@/store';
|
||||
import { useTabStore, useThemeStore } from '@/store';
|
||||
|
||||
/** 全局事件 */
|
||||
export function useGlobalEvents() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { computed } from 'vue';
|
||||
import { useBreakpoints, breakpointsTailwind } from '@vueuse/core';
|
||||
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core';
|
||||
import { useAppStore, useThemeStore } from '@/store';
|
||||
|
||||
type LayoutMode = 'vertical' | 'horizontal';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ref, computed } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useBoolean } from '../common';
|
||||
|
||||
/**
|
||||
@ -7,7 +7,7 @@ import { useBoolean } from '../common';
|
||||
*/
|
||||
export default function useCountDown(second: number) {
|
||||
if (second <= 0 && second % 1 !== 0) {
|
||||
throw Error('倒计时的时间应该为一个正整数!');
|
||||
throw new Error('倒计时的时间应该为一个正整数!');
|
||||
}
|
||||
const { bool: isComplete, setTrue, setFalse } = useBoolean(false);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
||||
/**
|
||||
* 绘制图形验证码
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { provide, inject } from 'vue';
|
||||
import { inject, provide } from 'vue';
|
||||
import type { InjectionKey } from 'vue';
|
||||
|
||||
/** 创建共享上下文状态 */
|
||||
|
@ -38,13 +38,13 @@ import { useAppStore, useThemeStore } from '@/store';
|
||||
import { useBasicLayout } from '@/composables';
|
||||
import { useBoolean } from '@/hooks';
|
||||
import {
|
||||
SettingDrawer,
|
||||
GlobalHeader,
|
||||
GlobalTab,
|
||||
GlobalSider,
|
||||
GlobalBackTop,
|
||||
GlobalContent,
|
||||
GlobalFooter,
|
||||
GlobalBackTop
|
||||
GlobalHeader,
|
||||
GlobalSider,
|
||||
GlobalTab,
|
||||
SettingDrawer
|
||||
} from '../common';
|
||||
|
||||
defineOptions({ name: 'BasicLayout' });
|
||||
|
@ -20,7 +20,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useAppStore, useThemeStore, useRouteStore } from '@/store';
|
||||
import { useAppStore, useRouteStore, useThemeStore } from '@/store';
|
||||
|
||||
defineOptions({ name: 'GlobalContent' });
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { routePath } from '@/router';
|
||||
import { useThemeStore, useRouteStore } from '@/store';
|
||||
import { useRouteStore, useThemeStore } from '@/store';
|
||||
import { useRouterPush } from '@/composables';
|
||||
import { getBreadcrumbByRouteKey } from '@/utils';
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useThemeStore } from '@/store';
|
||||
import { useBoolean } from '@/hooks';
|
||||
import MessageList from './MessageList.vue';
|
||||
|
@ -24,15 +24,15 @@ import { useBasicLayout } from '@/composables';
|
||||
import GlobalLogo from '../GlobalLogo/index.vue';
|
||||
import GlobalSearch from '../GlobalSearch/index.vue';
|
||||
import {
|
||||
MenuCollapse,
|
||||
FullScreen,
|
||||
GithubSite,
|
||||
GlobalBreadcrumb,
|
||||
HeaderMenu,
|
||||
GithubSite,
|
||||
FullScreen,
|
||||
ThemeMode,
|
||||
UserAvatar,
|
||||
MenuCollapse,
|
||||
SettingButton,
|
||||
SystemMessage,
|
||||
SettingButton
|
||||
ThemeMode,
|
||||
UserAvatar
|
||||
} from './components';
|
||||
|
||||
defineOptions({ name: 'GlobalHeader' });
|
||||
|
@ -24,9 +24,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, shallowRef, computed, watch, nextTick } from 'vue';
|
||||
import { computed, nextTick, ref, shallowRef, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useDebounceFn, onKeyStroke } from '@vueuse/core';
|
||||
import { onKeyStroke, useDebounceFn } from '@vueuse/core';
|
||||
import { useRouteStore } from '@/store';
|
||||
import SearchResult from './SearchResult.vue';
|
||||
import SearchFooter from './SearchFooter.vue';
|
||||
|
@ -29,7 +29,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import type { MenuOption } from 'naive-ui';
|
||||
import { useAppStore, useThemeStore } from '@/store';
|
||||
|
@ -23,11 +23,11 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useAppStore, useThemeStore, useRouteStore } from '@/store';
|
||||
import { useAppStore, useRouteStore, useThemeStore } from '@/store';
|
||||
import { useRouterPush } from '@/composables';
|
||||
import { useBoolean } from '@/hooks';
|
||||
import { GlobalLogo } from '@/layouts/common';
|
||||
import { MixMenuDetail, MixMenuDrawer, MixMenuCollapse } from './components';
|
||||
import { MixMenuCollapse, MixMenuDetail, MixMenuDrawer } from './components';
|
||||
|
||||
defineOptions({ name: 'VerticalMixSider' });
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
:collapsed="app.siderCollapse"
|
||||
:collapsed-width="theme.sider.collapsedWidth"
|
||||
:collapsed-icon-size="22"
|
||||
:options="routeStore.menus"
|
||||
:options="menus"
|
||||
:expanded-keys="expandedKeys"
|
||||
:indent="18"
|
||||
:inverted="theme.sider.inverted"
|
||||
@ -19,7 +19,7 @@
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import type { MenuOption } from 'naive-ui';
|
||||
import { useAppStore, useThemeStore, useRouteStore } from '@/store';
|
||||
import { useAppStore, useRouteStore, useThemeStore } from '@/store';
|
||||
import { useRouterPush } from '@/composables';
|
||||
import { getActiveKeyPathsOfMenus } from '@/utils';
|
||||
|
||||
@ -31,6 +31,8 @@ const theme = useThemeStore();
|
||||
const routeStore = useRouteStore();
|
||||
const { routerPush } = useRouterPush();
|
||||
|
||||
const menus = computed(() => routeStore.menus as GlobalMenuOption[]);
|
||||
|
||||
const activeKey = computed(() => (route.meta?.activeMenu ? route.meta.activeMenu : route.name) as string);
|
||||
const expandedKeys = ref<string[]>([]);
|
||||
|
||||
@ -46,7 +48,7 @@ function handleUpdateExpandedKeys(keys: string[]) {
|
||||
watch(
|
||||
() => route.name,
|
||||
() => {
|
||||
expandedKeys.value = getActiveKeyPathsOfMenus(activeKey.value, routeStore.menus);
|
||||
expandedKeys.value = getActiveKeyPathsOfMenus(activeKey.value, menus.value);
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
@ -6,7 +6,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { useThemeStore } from '@/store';
|
||||
import { VerticalSider, VerticalMixSider } from './components';
|
||||
import { VerticalMixSider, VerticalSider } from './components';
|
||||
|
||||
defineOptions({ name: 'GlobalSider' });
|
||||
|
||||
|
@ -26,10 +26,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, nextTick, watch } from 'vue';
|
||||
import { ChromeTab, ButtonTab } from '@soybeanjs/vue-admin-tab';
|
||||
import { computed, nextTick, reactive, ref, watch } from 'vue';
|
||||
import { ButtonTab, ChromeTab } from '@soybeanjs/vue-admin-tab';
|
||||
import { Icon } from '@iconify/vue';
|
||||
import { useThemeStore, useTabStore } from '@/store';
|
||||
import { useTabStore, useThemeStore } from '@/store';
|
||||
import { ContextMenu } from './components';
|
||||
|
||||
defineOptions({ name: 'TabDetail' });
|
||||
|
@ -13,9 +13,9 @@
|
||||
import { ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useElementBounding } from '@vueuse/core';
|
||||
import { useThemeStore, useTabStore } from '@/store';
|
||||
import { useTabStore, useThemeStore } from '@/store';
|
||||
import { useDeviceInfo } from '@/composables';
|
||||
import { TabDetail, ReloadButton } from './components';
|
||||
import { ReloadButton, TabDetail } from './components';
|
||||
|
||||
defineOptions({ name: 'GlobalTab' });
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, onMounted, onUnmounted } from 'vue';
|
||||
import { onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import Clipboard from 'clipboard';
|
||||
import { useThemeStore } from '@/store';
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useAppStore } from '@/store';
|
||||
import { DrawerButton, DarkMode, LayoutMode, ThemeColorSelect, PageFunc, PageView, ThemeConfig } from './components';
|
||||
import { DarkMode, DrawerButton, LayoutMode, PageFunc, PageView, ThemeColorSelect, ThemeConfig } from './components';
|
||||
|
||||
defineOptions({ name: 'SettingDrawer' });
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { createApp } from 'vue';
|
||||
import { setupAssets } from './plugins';
|
||||
import { setupStore } from './store';
|
||||
import App from './App.vue';
|
||||
import { setupDirectives } from './directives';
|
||||
import { setupRouter } from './router';
|
||||
import App from './App.vue';
|
||||
import { setupAssets } from './plugins';
|
||||
import { setupStore } from './store';
|
||||
|
||||
async function setupApp() {
|
||||
// import assets: js、css
|
||||
|
@ -6,6 +6,4 @@ import 'virtual:svg-icons-register';
|
||||
import '../styles/css/global.css';
|
||||
|
||||
/** import static assets: css, js , font and so on. - [引入静态资源,css、js和字体文件等] */
|
||||
export default function setupAssets() {
|
||||
//
|
||||
}
|
||||
export default function setupAssets() {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { RouteLocationNormalized, NavigationGuardNext } from 'vue-router';
|
||||
import type { NavigationGuardNext, RouteLocationNormalized } from 'vue-router';
|
||||
import { routeName } from '@/router';
|
||||
import { useRouteStore } from '@/store';
|
||||
import { getToken } from '@/utils';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { RouteLocationNormalized, NavigationGuardNext } from 'vue-router';
|
||||
import type { NavigationGuardNext, RouteLocationNormalized } from 'vue-router';
|
||||
import { routeName } from '@/router';
|
||||
import { useAuthStore } from '@/store';
|
||||
import { exeStrategyActions, getToken } from '@/utils';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { App } from 'vue';
|
||||
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
|
||||
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';
|
||||
import { transformAuthRoutesToVueRoutes, transformRouteNameToRoutePath } from '@/utils';
|
||||
import { constantRoutes } from './routes';
|
||||
import { scrollBehavior } from './helpers';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { adapter } from '@/utils';
|
||||
import { request, mockRequest } from '../request';
|
||||
import { mockRequest, request } from '../request';
|
||||
import { adapterOfFetchDataWithAdapter } from './demo.adapter';
|
||||
|
||||
/** 带有适配器的请求示例 */
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { AxiosRequestConfig } from 'axios';
|
||||
import { useAuthStore } from '@/store';
|
||||
import { getRefreshToken, setToken, setRefreshToken } from '@/utils';
|
||||
import { getRefreshToken, setRefreshToken, setToken } from '@/utils';
|
||||
import { fetchUpdateToken } from '../api';
|
||||
|
||||
/**
|
||||
|
@ -1,13 +1,13 @@
|
||||
import axios from 'axios';
|
||||
import type { AxiosRequestConfig, AxiosInstance, AxiosError } from 'axios';
|
||||
import type { AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||
import { REFRESH_TOKEN_CODE } from '@/config';
|
||||
import {
|
||||
getToken,
|
||||
transformRequestData,
|
||||
handleAxiosError,
|
||||
handleResponseError,
|
||||
handleBackendError,
|
||||
handleServiceResult
|
||||
handleResponseError,
|
||||
handleServiceResult,
|
||||
transformRequestData
|
||||
} from '@/utils';
|
||||
import { handleRefreshToken } from './helpers';
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { ref } from 'vue';
|
||||
import type { Ref } from 'vue';
|
||||
import type { AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||
import { useLoading, useBoolean } from '@/hooks';
|
||||
import { useBoolean, useLoading } from '@/hooks';
|
||||
import CustomAxiosInstance from './instance';
|
||||
|
||||
type RequestMethod = 'get' | 'post' | 'put' | 'delete';
|
||||
@ -89,12 +89,12 @@ export function createRequest(axiosConfig: AxiosRequestConfig, backendConfig?: S
|
||||
};
|
||||
}
|
||||
|
||||
type RequestResultHook<T = any> = {
|
||||
interface RequestResultHook<T = any> {
|
||||
data: Ref<T | null>;
|
||||
error: Ref<Service.RequestError | null>;
|
||||
loading: Ref<boolean>;
|
||||
network: Ref<boolean>;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建hooks请求
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { EnumThemeLayoutMode, EnumThemeTabMode, EnumThemeHorizontalMenuPosition, EnumThemeAnimateMode } from '@/enum';
|
||||
import { EnumThemeAnimateMode, EnumThemeHorizontalMenuPosition, EnumThemeLayoutMode, EnumThemeTabMode } from '@/enum';
|
||||
import jsonSetting from './theme.json';
|
||||
|
||||
const themeColorList = [
|
||||
|
@ -3,7 +3,7 @@ import { defineStore } from 'pinia';
|
||||
import { router } from '@/router';
|
||||
import { fetchLogin, fetchUserInfo } from '@/service';
|
||||
import { useRouterPush } from '@/composables';
|
||||
import { getUserInfo, getToken, setUserInfo, setToken, setRefreshToken, clearAuthStorage } from '@/utils';
|
||||
import { clearAuthStorage, getToken, getUserInfo, setRefreshToken, setToken, setUserInfo } from '@/utils';
|
||||
import { useTabStore } from '../tab';
|
||||
import { useRouteStore } from '../route';
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { router, ROOT_ROUTE, constantRoutes, routes as staticRoutes } from '@/router';
|
||||
import { ROOT_ROUTE, constantRoutes, router, routes as staticRoutes } from '@/router';
|
||||
import { fetchUserRoutes } from '@/service';
|
||||
import {
|
||||
filterAuthRoutesByUserPermission,
|
||||
getCacheRoutes,
|
||||
getConstantRouteNames,
|
||||
getUserInfo,
|
||||
transformAuthRouteToMenu,
|
||||
transformAuthRoutesToVueRoutes,
|
||||
transformAuthRouteToVueRoute,
|
||||
transformAuthRoutesToSearchMenus,
|
||||
getCacheRoutes,
|
||||
filterAuthRoutesByUserPermission,
|
||||
transformRoutePathToRouteName,
|
||||
transformAuthRoutesToVueRoutes,
|
||||
transformRouteNameToRoutePath,
|
||||
getConstantRouteNames
|
||||
transformRoutePathToRouteName
|
||||
} from '@/utils';
|
||||
import { useAuthStore } from '../auth';
|
||||
import { useTabStore } from '../tab';
|
||||
@ -66,7 +66,7 @@ export const useRouteStore = defineStore('route-store', {
|
||||
* @param routes - 权限路由
|
||||
*/
|
||||
handleAuthRoutes(routes: AuthRoute.Route[]) {
|
||||
this.menus = transformAuthRouteToMenu(routes);
|
||||
(this.menus as GlobalMenuOption[]) = transformAuthRouteToMenu(routes);
|
||||
this.searchMenus = transformAuthRoutesToSearchMenus(routes);
|
||||
|
||||
const vueRoutes = transformAuthRoutesToVueRoutes(routes);
|
||||
@ -80,7 +80,7 @@ export const useRouteStore = defineStore('route-store', {
|
||||
/** 动态路由模式下:更新根路由的重定向 */
|
||||
handleUpdateRootRedirect(routeKey: AuthRoute.RouteKey) {
|
||||
if (routeKey === 'root' || routeKey === 'not-found-page') {
|
||||
throw Error('routeKey的值不能为root或者not-found-page');
|
||||
throw new Error('routeKey的值不能为root或者not-found-page');
|
||||
}
|
||||
const rootRoute: AuthRoute.Route = { ...ROOT_ROUTE, redirect: transformRouteNameToRoutePath(routeKey) };
|
||||
const rootRouteName: AuthRoute.RouteKey = 'root';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { RouteRecordNormalized, RouteLocationNormalizedLoaded } from 'vue-router';
|
||||
import type { RouteLocationNormalizedLoaded, RouteRecordNormalized } from 'vue-router';
|
||||
import { EnumStorageKey } from '@/enum';
|
||||
import { setLocal, getLocal } from '@/utils';
|
||||
import { getLocal, setLocal } from '@/utils';
|
||||
|
||||
/**
|
||||
* 根据vue路由获取tab路由
|
||||
|
@ -1,15 +1,15 @@
|
||||
import type { Router, RouteLocationNormalizedLoaded } from 'vue-router';
|
||||
import type { RouteLocationNormalizedLoaded, Router } from 'vue-router';
|
||||
import { defineStore } from 'pinia';
|
||||
import { useRouterPush } from '@/composables';
|
||||
import { useThemeStore } from '../theme';
|
||||
import {
|
||||
getTabRouteByVueRoute,
|
||||
isInTabRoutes,
|
||||
clearTabRoutes,
|
||||
getIndexInTabRoutes,
|
||||
getIndexInTabRoutesByRouteName,
|
||||
setTabRoutes,
|
||||
getTabRouteByVueRoute,
|
||||
getTabRoutes,
|
||||
clearTabRoutes
|
||||
isInTabRoutes,
|
||||
setTabRoutes
|
||||
} from './helpers';
|
||||
|
||||
interface TabState {
|
||||
|
@ -2,7 +2,7 @@ import type { GlobalThemeOverrides } from 'naive-ui';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { themeSetting } from '@/settings';
|
||||
import { EnumStorageKey } from '@/enum';
|
||||
import { getThemeColor, getColorPalette, addColorAlpha, setLocal, getLocal, removeLocal } from '@/utils';
|
||||
import { addColorAlpha, getColorPalette, getLocal, getThemeColor, removeLocal, setLocal } from '@/utils';
|
||||
|
||||
/** 初始化主题配置 */
|
||||
export function initThemeSettings() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { darkTheme } from 'naive-ui';
|
||||
import { initThemeSettings, getNaiveThemeOverrides, setThemeSettings, clearThemeSettings } from './helpers';
|
||||
import { clearThemeSettings, getNaiveThemeOverrides, initThemeSettings, setThemeSettings } from './helpers';
|
||||
|
||||
type ThemeState = Theme.Setting;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { watch, onUnmounted } from 'vue';
|
||||
import { onUnmounted, watch } from 'vue';
|
||||
import { useOsTheme } from 'naive-ui';
|
||||
import type { GlobalThemeOverrides } from 'naive-ui';
|
||||
import { useElementSize } from '@vueuse/core';
|
||||
|
4
src/typings/route.d.ts
vendored
4
src/typings/route.d.ts
vendored
@ -79,7 +79,7 @@ declare namespace AuthRoute {
|
||||
type RouteComponent = 'basic' | 'blank' | 'multi' | 'self';
|
||||
|
||||
/** 路由描述 */
|
||||
type RouteMeta = {
|
||||
interface RouteMeta {
|
||||
/** 路由标题(可用来作document.title或者菜单的名称) */
|
||||
title: string;
|
||||
/** 路由的动态路径(需要动态路径的页面需要将path添加进范型参数) */
|
||||
@ -111,7 +111,7 @@ declare namespace AuthRoute {
|
||||
activeMenu?: RouteKey;
|
||||
/** 表示是否是多级路由的中间级路由(用于转换路由数据时筛选多级路由的标识,定义路由时不用填写) */
|
||||
multi?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
/** 单个路由的类型结构(动态路由模式:后端返回此类型结构的路由) */
|
||||
interface Route {
|
||||
|
2
src/typings/system.d.ts
vendored
2
src/typings/system.d.ts
vendored
@ -265,7 +265,7 @@ interface GlobalHeaderProps {
|
||||
}
|
||||
|
||||
/** 菜单项配置 */
|
||||
type GlobalMenuOption = {
|
||||
type GlobalMenuOption = import('naive-ui').MenuOption & {
|
||||
key: string;
|
||||
label: string;
|
||||
routeName: string;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { EnumStorageKey } from '@/enum';
|
||||
import { setLocal, getLocal, removeLocal } from '../storage';
|
||||
import { getLocal, removeLocal, setLocal } from '../storage';
|
||||
|
||||
/** 设置token */
|
||||
export function setToken(token: string) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { Ref } from 'vue';
|
||||
import type { FormItemRule } from 'naive-ui';
|
||||
import { REGEXP_PHONE, REGEXP_PWD, REGEXP_CODE_SIX, REGEXP_EMAIL } from '@/config';
|
||||
import { REGEXP_CODE_SIX, REGEXP_EMAIL, REGEXP_PHONE, REGEXP_PWD } from '@/config';
|
||||
|
||||
/** 表单规则 */
|
||||
interface CustomFormRules {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { iconifyRender, customIconRender } from '../common';
|
||||
import { customIconRender, iconifyRender } from '../common';
|
||||
|
||||
/** 路由不转换菜单 */
|
||||
function hideInMenu(route: AuthRoute.Route) {
|
||||
@ -74,7 +74,7 @@ function getActiveKeyPathsOfMenu(activeKey: string, menu: GlobalMenuOption) {
|
||||
keys.push(menu.routeName);
|
||||
}
|
||||
if (menu.children) {
|
||||
keys.push(...menu.children.map(item => getActiveKeyPathsOfMenu(activeKey, item)).flat(1));
|
||||
keys.push(...menu.children.map(item => getActiveKeyPathsOfMenu(activeKey, item as GlobalMenuOption)).flat(1));
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
@ -2,11 +2,11 @@ import type { AxiosError, AxiosResponse } from 'axios';
|
||||
import {
|
||||
DEFAULT_REQUEST_ERROR_CODE,
|
||||
DEFAULT_REQUEST_ERROR_MSG,
|
||||
ERROR_STATUS,
|
||||
NETWORK_ERROR_CODE,
|
||||
NETWORK_ERROR_MSG,
|
||||
REQUEST_TIMEOUT_CODE,
|
||||
REQUEST_TIMEOUT_MSG,
|
||||
ERROR_STATUS
|
||||
REQUEST_TIMEOUT_MSG
|
||||
} from '@/config';
|
||||
import { exeStrategyActions } from '../common';
|
||||
import { showErrorMsg } from './msg';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { NO_ERROR_MSG_CODE, ERROR_MSG_DURATION } from '@/config';
|
||||
import { ERROR_MSG_DURATION, NO_ERROR_MSG_CODE } from '@/config';
|
||||
|
||||
/** 错误消息栈,防止同一错误同时出现 */
|
||||
const errorMsgStack = new Map<string | number, string>([]);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { encrypto, decrypto } from '../crypto';
|
||||
import { decrypto, encrypto } from '../crypto';
|
||||
|
||||
interface StorageData {
|
||||
value: unknown;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { encrypto, decrypto } from '../crypto';
|
||||
import { decrypto, encrypto } from '../crypto';
|
||||
|
||||
export function setSession(key: string, value: unknown) {
|
||||
const json = encrypto(value);
|
||||
|
@ -8,7 +8,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ProjectIntroduction, ProjectInfo, ProDependency, DevDependency } from './components';
|
||||
import { DevDependency, ProDependency, ProjectInfo, ProjectIntroduction } from './components';
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
@ -15,7 +15,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import type { DataTableColumn } from 'naive-ui';
|
||||
import { useLoadingEmpty } from '@/hooks';
|
||||
import { getRandomInteger } from '@/utils';
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts, type ECOption } from '@/composables';
|
||||
import { type ECOption, useEcharts } from '@/composables';
|
||||
|
||||
defineOptions({ name: 'DashboardAnalysisTopCard' });
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { TopChart, DataCard, BottomPart } from './components';
|
||||
import { BottomPart, DataCard, TopChart } from './components';
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
@ -45,7 +45,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { TechnologyCard, ShortcutsCard } from './components';
|
||||
import { ShortcutsCard, TechnologyCard } from './components';
|
||||
|
||||
defineOptions({ name: 'DashboardWorkbenchMain' });
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, computed, watch } from 'vue';
|
||||
import { computed, reactive, watch } from 'vue';
|
||||
|
||||
defineOptions({ name: 'TableActionModal' });
|
||||
|
||||
|
@ -26,11 +26,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="tsx">
|
||||
import { ref, reactive } from 'vue';
|
||||
import { NSwitch, NTag, NSpace, NPopconfirm, NButton } from 'naive-ui';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { NButton, NPopconfirm, NSpace, NSwitch, NTag } from 'naive-ui';
|
||||
import type { DataTableColumns, PaginationProps } from 'naive-ui';
|
||||
import { fetchUserManagementList } from '@/service';
|
||||
import { useLoading, useBoolean } from '@/hooks';
|
||||
import { useBoolean, useLoading } from '@/hooks';
|
||||
import { TableActionModal } from './components';
|
||||
|
||||
const { loading, startLoading, endLoading } = useLoading(false);
|
||||
|
@ -22,7 +22,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import DataSet from '@antv/data-set';
|
||||
import { Chart } from '@antv/g2';
|
||||
|
||||
|
@ -25,9 +25,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onUnmounted } from 'vue';
|
||||
import { onUnmounted, ref } from 'vue';
|
||||
import { graphic } from 'echarts';
|
||||
import { useEcharts, type ECOption } from '@/composables';
|
||||
import { type ECOption, useEcharts } from '@/composables';
|
||||
|
||||
const pieOptions = ref<ECOption>({
|
||||
legend: {},
|
||||
|
@ -10,7 +10,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, onMounted, onUnmounted } from 'vue';
|
||||
import { onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import Vditor from 'vditor';
|
||||
import 'vditor/dist/index.css';
|
||||
import { useThemeStore } from '@/store';
|
||||
|
@ -10,7 +10,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import WangEditor from 'wangeditor';
|
||||
|
||||
const editor = ref<WangEditor>();
|
||||
|
@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useScriptTag } from '@vueuse/core';
|
||||
import { BAIDU_MAP_SDK_URL } from '@/config';
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useScriptTag } from '@vueuse/core';
|
||||
import { GAODE_MAP_SDK_URL } from '@/config';
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useScriptTag } from '@vueuse/core';
|
||||
import { TENCENT_MAP_SDK_URL } from '@/config';
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { Component } from 'vue';
|
||||
import { GaodeMap, TencentMap, BaiduMap } from './components';
|
||||
import { BaiduMap, GaodeMap, TencentMap } from './components';
|
||||
|
||||
interface Map {
|
||||
id: string;
|
||||
|
@ -7,7 +7,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted } from 'vue';
|
||||
import { onMounted, onUnmounted, ref } from 'vue';
|
||||
import Player from 'xgplayer';
|
||||
|
||||
const domRef = ref<HTMLElement>();
|
||||
|
@ -12,7 +12,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import { getColorPalette } from '@/utils';
|
||||
import { CornerTop, CornerBottom } from './components';
|
||||
import { CornerBottom, CornerTop } from './components';
|
||||
|
||||
interface Props {
|
||||
/** 主题颜色 */
|
||||
|
@ -34,7 +34,7 @@ import { EnumLoginModule } from '@/enum';
|
||||
import { useThemeStore } from '@/store';
|
||||
import { useAppInfo } from '@/composables';
|
||||
import { getColorPalette, mixColor } from '@/utils';
|
||||
import { LoginBg, PwdLogin, CodeLogin, Register, ResetPwd, BindWechat } from './components';
|
||||
import { BindWechat, CodeLogin, LoginBg, PwdLogin, Register, ResetPwd } from './components';
|
||||
|
||||
interface Props {
|
||||
/** 登录模块分类 */
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import { getRootPath, getSrcPath, viteDefine, setupVitePlugins, createViteProxy } from './build';
|
||||
import { createViteProxy, getRootPath, getSrcPath, setupVitePlugins, viteDefine } from './build';
|
||||
import { getServiceEnvConfig } from './.env-config';
|
||||
|
||||
export default defineConfig(configEnv => {
|
||||
|
Loading…
Reference in New Issue
Block a user