创建仓库
0
.editorconfig
Normal file
6
.env.build
Normal file
|
@ -0,0 +1,6 @@
|
|||
VITE_APP_ENV = 'prod'
|
||||
#自动获取地址推荐
|
||||
VITE_APP_BASE_URL = 'https://github.jzfai.top/micro-service-api'
|
||||
|
||||
#image or oss address
|
||||
VITE_APP_IMAGE_URL = 'https://github.jzfai.top/gofast-image'
|
8
.env.build-test
Normal file
|
@ -0,0 +1,8 @@
|
|||
VITE_APP_ENV = 'test'
|
||||
#自动获取地址推荐
|
||||
#VITE_APP_BASE_URL = '/micro-service-api'
|
||||
VITE_APP_BASE_URL = 'https://github.jzfai.top/micro-service-api'
|
||||
VITE_APP_BASE_WS_URL = ''
|
||||
|
||||
#image or oss address
|
||||
VITE_APP_IMAGE_URL = 'https://github.jzfai.top/gofast-image'
|
10
.env.serve-dev
Normal file
|
@ -0,0 +1,10 @@
|
|||
#The defined variable must start with VITE_APP_
|
||||
VITE_APP_ENV = 'dev'
|
||||
VITE_APP_BASE_URL = 'https://github.jzfai.top/micro-service-api'
|
||||
|
||||
#image or oss address
|
||||
VITE_APP_IMAGE_URL = 'https://github.jzfai.top/gofast-image'
|
||||
|
||||
#proxy, use this to test proxy
|
||||
#VITE_APP_BASE_URL = '/api'
|
||||
#VITE_APP_PROXY_URL = 'https://github.jzfai.top/micro-service-api'
|
10
.env.serve-test
Normal file
|
@ -0,0 +1,10 @@
|
|||
#The defined variable must start with VITE_APP_
|
||||
VITE_APP_ENV = 'test'
|
||||
VITE_APP_BASE_URL = 'https://github.jzfai.top/micro-service-api'
|
||||
|
||||
#image or oss address
|
||||
VITE_APP_IMAGE_URL = 'https://github.jzfai.top/gofast-image'
|
||||
|
||||
#proxy, use this to test proxy
|
||||
#VITE_APP_BASE_URL = '/api'
|
||||
#VITE_APP_PROXY_URL = 'https://github.jzfai.top/micro-service-api'
|
6
.eslintignore
Normal file
|
@ -0,0 +1,6 @@
|
|||
public
|
||||
node_modules
|
||||
.history
|
||||
.husky
|
||||
dist
|
||||
*.d.ts
|
4
.eslintrc.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"root": true,
|
||||
"extends": ["./eslintrc/eslint-config.js", "./eslintrc/.eslintrc-auto-import.json"]
|
||||
}
|
51
.gitignore
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
# compiled output
|
||||
/dist
|
||||
/dist-ssr
|
||||
/node_modules
|
||||
|
||||
#lock
|
||||
pnpm-lock.yaml
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
pnpm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
|
||||
# Tests
|
||||
/coverage
|
||||
/.nyc_output
|
||||
|
||||
# IDEs and editors
|
||||
/.idea
|
||||
.project
|
||||
.classpath
|
||||
.c9/
|
||||
*.launch
|
||||
.settings/
|
||||
*.sublime-workspace
|
||||
|
||||
# IDE - VSCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
# Other
|
||||
.history
|
||||
*.local
|
||||
yarn*
|
||||
pnpm*
|
||||
|
||||
|
||||
#.eslintrc-auto-import.json
|
||||
#auto-imports.d.ts
|
||||
#components.d.ts
|
||||
stats.html
|
5
.husky/commit-msg
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
#. "$(dirname "$0")/_/husky.sh"
|
||||
#在项目中我们会使用commit-msg这个git hook来校验我们commit时添加的备注信息是否符合规范。在以前的我们通常是这样配置:
|
||||
#--no-install 参数表示强制npx使用项目中node_modules目录中的commitlint包(如果需要开启,注意:需要安装npx)
|
||||
#npx --no-install commitlint --edit $1
|
8
.husky/pre-commit
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
#推送之前运行eslint检查
|
||||
npm run lint
|
||||
#推送之前运行单元测试检查
|
||||
#npm run test:unit
|
||||
|
7
.npmrc
Normal file
|
@ -0,0 +1,7 @@
|
|||
shamefully-hoist=true
|
||||
strict-peer-dependencies=false
|
||||
|
||||
###aliyun address
|
||||
registry = https://registry.npmmirror.com
|
||||
|
||||
|
10
.prettierrc
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"useTabs": false,
|
||||
"tabWidth": 2,
|
||||
"printWidth": 120,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"bracketSpacing": true,
|
||||
"semi": false,
|
||||
"htmlWhitespaceSensitivity": "ignore"
|
||||
}
|
3
.vscode/extensions.json
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"recommendations": ["johnsoncodehk.volar", "esbenp.prettier-vscode","dbaeumer.vscode-eslint"]
|
||||
}
|
4
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"npm.packageManager": "yarn"
|
||||
}
|
85
README.md
Normal file
|
@ -0,0 +1,85 @@
|
|||
# vue3-admin-plus
|
||||
|
||||
The plus version of vue3-admin-ts , provide enterprise-class using demo
|
||||
|
||||
suggestion the Node.js >= 16.0.0。
|
||||
|
||||
|
||||
|
||||
## Documents
|
||||
|
||||
- [Official Documentation](https://github.jzfai.top/vue3-admin-doc/)
|
||||
|
||||
- [中文官网](https://github.jzfai.top/vue3-admin-cn-doc/)
|
||||
|
||||
|
||||
|
||||
## Online experience
|
||||
|
||||
[Access address](https://github.jzfai.top/vue3-admin-plus)
|
||||
|
||||
[国内体验地址](https://github.jzfai.top/vue3-admin-plus)
|
||||
|
||||
|
||||
|
||||
## Related items
|
||||
|
||||
The framework is available in js,ts, plus and electron versions
|
||||
- js version:[vue3-admin-template](https://github.com/jzfai/vue3-admin-template.git) -- basic version
|
||||
- ts version:[vue3-element-ts](https://github.com/jzfai/vue3-admin-ts.git)
|
||||
- ts version for plus:[vue3-element-plus](https://github.com/jzfai/vue3-admin-plus.git)
|
||||
- ts version for electron:[vue3-element-electron](https://github.com/jzfai/vue3-admin-electron.git)
|
||||
- java Micro-service background data:[micro-service-plus](https://github.com/jzfai/micro-service-plus)
|
||||
|
||||
|
||||
## Build Setup
|
||||
|
||||
```bash
|
||||
# clone the project
|
||||
git clone https://github.com/jzfai/vue3-admin-plus.git
|
||||
|
||||
# enter the project directory
|
||||
cd vue3-admin-plus
|
||||
|
||||
# pnpm address https://pnpm.io/zh/motivation
|
||||
# install dependency(Recommend use pnpm)
|
||||
# you can use "npm -g i pnpm@7.9.0" to install pnpm
|
||||
pnpm i
|
||||
|
||||
# develop
|
||||
pnpm run dev
|
||||
```
|
||||
|
||||
|
||||
## Build
|
||||
|
||||
```bash
|
||||
# build for test environment
|
||||
pnpm run build-test
|
||||
|
||||
# build for production environment
|
||||
pnpm run build
|
||||
```
|
||||
|
||||
## Others
|
||||
|
||||
```bash
|
||||
# preview the release environment effect
|
||||
pnpm run preview
|
||||
|
||||
# code format check
|
||||
pnpm run lint
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Browsers support
|
||||
|
||||
Note: Vue3 is not supported the Internet Explorer
|
||||
|
||||
|
||||
## Discussion and Communication
|
||||
[WeChat group](https://github.jzfai.top/file/images/wx-groud.png)
|
||||
|
||||
|
||||
|
116
eslintrc/.eslintrc-auto-import.json
Normal file
|
@ -0,0 +1,116 @@
|
|||
{
|
||||
"globals": {
|
||||
"EffectScope": true,
|
||||
"axiosReq": true,
|
||||
"bus": true,
|
||||
"buttonCodes": true,
|
||||
"casHandleChange": true,
|
||||
"clickoutside": true,
|
||||
"cloneDeep": true,
|
||||
"closeElLoading": true,
|
||||
"codesPermission": true,
|
||||
"commonUtil": true,
|
||||
"computed": true,
|
||||
"copy": true,
|
||||
"copyValueToClipboard": true,
|
||||
"createApp": true,
|
||||
"customRef": true,
|
||||
"debounce": true,
|
||||
"defineAsyncComponent": true,
|
||||
"defineComponent": true,
|
||||
"directives": true,
|
||||
"effectScope": true,
|
||||
"elConfirm": true,
|
||||
"elConfirmNoCancelBtn": true,
|
||||
"elLoading": true,
|
||||
"elMessage": true,
|
||||
"elNotify": true,
|
||||
"filterAsyncRouter": true,
|
||||
"filterAsyncRouterByCodes": true,
|
||||
"filterAsyncRoutesByMenuList": true,
|
||||
"filterAsyncRoutesByRoles": true,
|
||||
"freshRouter": true,
|
||||
"getCurrentInstance": true,
|
||||
"getCurrentScope": true,
|
||||
"getLangInstance": true,
|
||||
"getQueryParam": true,
|
||||
"h": true,
|
||||
"inject": true,
|
||||
"isExternal": true,
|
||||
"isProxy": true,
|
||||
"isReactive": true,
|
||||
"isReadonly": true,
|
||||
"isRef": true,
|
||||
"lang": true,
|
||||
"langTitle": true,
|
||||
"loginOutReq": true,
|
||||
"loginReq": true,
|
||||
"longpress": true,
|
||||
"markRaw": true,
|
||||
"mockAxiosReq": true,
|
||||
"nextTick": true,
|
||||
"onActivated": true,
|
||||
"onBeforeMount": true,
|
||||
"onBeforeRouteLeave": true,
|
||||
"onBeforeRouteUpdate": true,
|
||||
"onBeforeUnmount": true,
|
||||
"onBeforeUpdate": true,
|
||||
"onDeactivated": true,
|
||||
"onErrorCaptured": true,
|
||||
"onMounted": true,
|
||||
"onRenderTracked": true,
|
||||
"onRenderTriggered": true,
|
||||
"onScopeDispose": true,
|
||||
"onServerPrefetch": true,
|
||||
"onUnmounted": true,
|
||||
"onUpdated": true,
|
||||
"progressClose": true,
|
||||
"progressStart": true,
|
||||
"provide": true,
|
||||
"reactive": true,
|
||||
"readonly": true,
|
||||
"ref": true,
|
||||
"resetRouter": true,
|
||||
"resetState": true,
|
||||
"resizeHandler": true,
|
||||
"resolveComponent": true,
|
||||
"resolveDirective": true,
|
||||
"rolesPermission": true,
|
||||
"routeInfo": true,
|
||||
"routerBack": true,
|
||||
"routerPush": true,
|
||||
"routerReplace": true,
|
||||
"searchUser": true,
|
||||
"shallowReactive": true,
|
||||
"shallowReadonly": true,
|
||||
"shallowRef": true,
|
||||
"sleepTimeout": true,
|
||||
"storeToRefs": true,
|
||||
"toRaw": true,
|
||||
"toRef": true,
|
||||
"toRefs": true,
|
||||
"transactionList": true,
|
||||
"triggerRef": true,
|
||||
"unref": true,
|
||||
"useAttrs": true,
|
||||
"useBasicStore": true,
|
||||
"useConfigStore": true,
|
||||
"useCssModule": true,
|
||||
"useCssVars": true,
|
||||
"useElement": true,
|
||||
"useErrorLog": true,
|
||||
"useLink": true,
|
||||
"useRoute": true,
|
||||
"useRouter": true,
|
||||
"useSlots": true,
|
||||
"useTable": true,
|
||||
"useTagsViewStore": true,
|
||||
"userInfoReq": true,
|
||||
"watch": true,
|
||||
"watchEffect": true,
|
||||
"watchPostEffect": true,
|
||||
"watchSyncEffect": true,
|
||||
"watermark": true,
|
||||
"waves": true
|
||||
}
|
||||
}
|
200
eslintrc/eslint-config.js
Normal file
|
@ -0,0 +1,200 @@
|
|||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const { defineConfig } = require('eslint-define-config')
|
||||
module.exports = defineConfig({
|
||||
env: {
|
||||
es6: true,
|
||||
browser: true,
|
||||
node: true
|
||||
},
|
||||
globals: {
|
||||
defineOptions: true,
|
||||
$ref: true
|
||||
},
|
||||
plugins: ['@typescript-eslint', 'prettier', 'unicorn'],
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:import/recommended',
|
||||
'plugin:eslint-comments/recommended',
|
||||
'plugin:jsonc/recommended-with-jsonc',
|
||||
'plugin:markdown/recommended',
|
||||
'plugin:vue/vue3-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier'
|
||||
],
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
node: { extensions: ['.js', '.mjs', '.ts', '.d.ts', '.tsx'] }
|
||||
}
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts', '*.vue'],
|
||||
rules: {
|
||||
'no-undef': 'off',
|
||||
'@typescript-eslint/ban-types': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['*.js'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-var-requires': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['*.vue'],
|
||||
parser: 'vue-eslint-parser',
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser',
|
||||
extraFileExtensions: ['.vue'],
|
||||
ecmaVersion: 'latest',
|
||||
ecmaFeatures: {
|
||||
jsx: true
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'no-undef': 'off',
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off'
|
||||
}
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
// js/ts
|
||||
camelcase: ['error', { properties: 'never' }],
|
||||
'no-console': ['warn', { allow: ['error'] }],
|
||||
'no-debugger': 'warn',
|
||||
'no-constant-condition': ['error', { checkLoops: false }],
|
||||
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
|
||||
'no-return-await': 'error',
|
||||
'no-var': 'error',
|
||||
'no-empty': ['error', { allowEmptyCatch: true }],
|
||||
'prefer-const': ['warn', { destructuring: 'all', ignoreReadBeforeAssign: true }],
|
||||
'prefer-arrow-callback': ['error', { allowNamedFunctions: false, allowUnboundThis: true }],
|
||||
'object-shorthand': ['error', 'always', { ignoreConstructors: false, avoidQuotes: true }],
|
||||
'prefer-rest-params': 'error',
|
||||
'prefer-spread': 'error',
|
||||
'prefer-template': 'error',
|
||||
|
||||
'no-redeclare': 'off',
|
||||
'@typescript-eslint/no-redeclare': 'error',
|
||||
// best-practice
|
||||
'array-callback-return': 'error',
|
||||
'block-scoped-var': 'error',
|
||||
'no-alert': 'warn',
|
||||
'no-case-declarations': 'error',
|
||||
'no-multi-str': 'error',
|
||||
'no-with': 'error',
|
||||
'no-void': 'error',
|
||||
|
||||
'sort-imports': [
|
||||
'warn',
|
||||
{
|
||||
ignoreCase: false,
|
||||
ignoreDeclarationSort: true,
|
||||
ignoreMemberSort: false,
|
||||
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
||||
allowSeparatedGroups: false
|
||||
}
|
||||
],
|
||||
// stylistic-issues
|
||||
'prefer-exponentiation-operator': 'error',
|
||||
|
||||
// ts
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
|
||||
'@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }],
|
||||
'@typescript-eslint/ban-ts-comment': ['off', { 'ts-ignore': false }],
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
// vue
|
||||
'vue/no-v-html': 'off',
|
||||
'vue/require-default-prop': 'off',
|
||||
'vue/require-explicit-emits': 'off',
|
||||
'vue/multi-word-component-names': 'off',
|
||||
'vue/prefer-import-from-vue': 'off',
|
||||
'vue/no-v-text-v-html-on-component': 'off',
|
||||
'vue/html-self-closing': [
|
||||
'error',
|
||||
{
|
||||
html: {
|
||||
void: 'always',
|
||||
normal: 'always',
|
||||
component: 'always'
|
||||
},
|
||||
svg: 'always',
|
||||
math: 'always'
|
||||
}
|
||||
],
|
||||
|
||||
// prettier
|
||||
//fix lf error
|
||||
'prettier/prettier': 'off',
|
||||
// import
|
||||
// 'import/first': 'error',
|
||||
// 'import/no-duplicates': 'error',
|
||||
// 'import/order': [
|
||||
// 'error',
|
||||
// {
|
||||
// groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
|
||||
//
|
||||
// pathGroups: [
|
||||
// {
|
||||
// pattern: 'vue',
|
||||
// group: 'external',
|
||||
// position: 'before'
|
||||
// }
|
||||
// ],
|
||||
// pathGroupsExcludedImportTypes: ['type']
|
||||
// }
|
||||
// ],
|
||||
'import/no-unresolved': 'off',
|
||||
'import/namespace': 'off',
|
||||
'import/default': 'off',
|
||||
'import/no-named-as-default': 'off',
|
||||
'import/no-named-as-default-member': 'off',
|
||||
'import/named': 'off',
|
||||
|
||||
// eslint-plugin-eslint-comments
|
||||
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
|
||||
|
||||
// unicorn
|
||||
'unicorn/custom-error-definition': 'error',
|
||||
'unicorn/error-message': 'error',
|
||||
'unicorn/escape-case': 'error',
|
||||
'unicorn/import-index': 'error',
|
||||
'unicorn/new-for-builtins': 'error',
|
||||
'unicorn/no-array-method-this-argument': 'error',
|
||||
'unicorn/no-array-push-push': 'error',
|
||||
'unicorn/no-console-spaces': 'error',
|
||||
'unicorn/no-for-loop': 'error',
|
||||
'unicorn/no-hex-escape': 'error',
|
||||
'unicorn/no-instanceof-array': 'error',
|
||||
'unicorn/no-invalid-remove-event-listener': 'error',
|
||||
'unicorn/no-new-array': 'error',
|
||||
'unicorn/no-new-buffer': 'error',
|
||||
'unicorn/no-unsafe-regex': 'off',
|
||||
'unicorn/number-literal-case': 'error',
|
||||
'unicorn/prefer-array-find': 'error',
|
||||
'unicorn/prefer-array-flat-map': 'error',
|
||||
'unicorn/prefer-array-index-of': 'error',
|
||||
'unicorn/prefer-array-some': 'error',
|
||||
'unicorn/prefer-date-now': 'error',
|
||||
'unicorn/prefer-dom-node-dataset': 'error',
|
||||
'unicorn/prefer-includes': 'error',
|
||||
'unicorn/prefer-keyboard-event-key': 'error',
|
||||
'unicorn/prefer-math-trunc': 'error',
|
||||
'unicorn/prefer-modern-dom-apis': 'error',
|
||||
'unicorn/prefer-negative-index': 'error',
|
||||
'unicorn/prefer-number-properties': 'error',
|
||||
'unicorn/prefer-optional-catch-binding': 'error',
|
||||
'unicorn/prefer-prototype-methods': 'error',
|
||||
'unicorn/prefer-query-selector': 'error',
|
||||
'unicorn/prefer-reflect-apply': 'error',
|
||||
'unicorn/prefer-string-slice': 'error',
|
||||
'unicorn/prefer-string-starts-ends-with': 'error',
|
||||
'unicorn/prefer-string-trim-start-end': 'error',
|
||||
'unicorn/prefer-type-error': 'error',
|
||||
'unicorn/throw-new-error': 'error'
|
||||
}
|
||||
})
|
13
index.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" class="base-theme">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title><%= title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
12
mock-prod-server.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer'
|
||||
//https://cn.vitejs.dev/guide/features.html#glob-import
|
||||
const modulesFiles = import.meta.glob('../mock/*', { eager: true })
|
||||
let modules = []
|
||||
for (const filePath in modulesFiles) {
|
||||
//读取文件内容到 modules
|
||||
modules = modules.concat(modulesFiles[filePath].default)
|
||||
}
|
||||
export function setupProdMockServer() {
|
||||
//创建prod mock server
|
||||
createProdMockServer([...modules])
|
||||
}
|
12
mock/example.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
export default [
|
||||
{
|
||||
url: '/getMapInfo',
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return {
|
||||
code: 200,
|
||||
title: 'mock请求测试'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
56
mock/excel.ts
Normal file
|
@ -0,0 +1,56 @@
|
|||
import Mock from 'mockjs'
|
||||
|
||||
const NameList: any = []
|
||||
const count = 100
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
NameList.push(
|
||||
Mock.mock({
|
||||
name: '@first'
|
||||
})
|
||||
)
|
||||
}
|
||||
NameList.push({ name: 'mock-Pan' })
|
||||
|
||||
export default [
|
||||
// username search
|
||||
{
|
||||
url: '/vue3-admin-plus/search/user',
|
||||
method: 'get',
|
||||
response: (config) => {
|
||||
const { name } = config.query
|
||||
const mockNameList = NameList.filter((item) => {
|
||||
// @ts-ignore
|
||||
const lowerCaseName = item.name.toLowerCase()
|
||||
return !(name && !lowerCaseName.includes(name.toLowerCase()))
|
||||
})
|
||||
return {
|
||||
code: 20000,
|
||||
data: { items: mockNameList }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// transaction list
|
||||
{
|
||||
url: '/vue3-admin-plus/transaction/list',
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return {
|
||||
code: 20000,
|
||||
data: {
|
||||
total: 20,
|
||||
'items|20': [
|
||||
{
|
||||
order_no: '@guid()',
|
||||
timestamp: +Mock.Random.date('T'),
|
||||
username: '@name()',
|
||||
price: '@float(1000, 15000, 0, 2)',
|
||||
'status|1': ['success', 'pending']
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
31
mock/table.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import Mock from 'mockjs'
|
||||
|
||||
const data = Mock.mock({
|
||||
'items|30': [
|
||||
{
|
||||
id: '@id',
|
||||
title: '@sentence(10, 20)',
|
||||
'status|1': ['published', 'draft', 'deleted'],
|
||||
author: 'name',
|
||||
display_time: '@datetime',
|
||||
pageviews: '@integer(300, 5000)'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
export default [
|
||||
{
|
||||
url: '/vue3-admin-template/table/list',
|
||||
method: 'get',
|
||||
response: () => {
|
||||
const items = data.items
|
||||
return {
|
||||
code: 20000,
|
||||
data: {
|
||||
total: items.length,
|
||||
items
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
133
optimize-include.ts
Normal file
|
@ -0,0 +1,133 @@
|
|||
// const fs = require('fs')
|
||||
// const files = fs.readdirSync(
|
||||
// 'D:\\github\\vue3-admin-ts\\node_modules\\.pnpm\\element-plus@2.2.9_vue@3.2.37\\node_modules\\element-plus\\es\\components\\'
|
||||
// )
|
||||
// console.log(111, JSON.stringify(files))
|
||||
// console.log(console.dir(files))
|
||||
// console.log(console.dir(files.slice(20)))
|
||||
|
||||
import { resolve } from 'path'
|
||||
|
||||
const elementPlusComponentNameArr = [
|
||||
'affix',
|
||||
'alert',
|
||||
'aside',
|
||||
'autocomplete',
|
||||
'avatar',
|
||||
'backtop',
|
||||
'badge',
|
||||
'base',
|
||||
'breadcrumb',
|
||||
'breadcrumb-item',
|
||||
'button',
|
||||
'button-group',
|
||||
'calendar',
|
||||
'card',
|
||||
'carousel',
|
||||
'carousel-item',
|
||||
'cascader',
|
||||
'cascader-panel',
|
||||
'check-tag',
|
||||
'checkbox',
|
||||
'checkbox-button',
|
||||
'checkbox-group',
|
||||
'col',
|
||||
'collapse',
|
||||
'collapse-item',
|
||||
'collapse-transition',
|
||||
'color-picker',
|
||||
'config-provider',
|
||||
'container',
|
||||
'date-picker',
|
||||
'descriptions',
|
||||
'descriptions-item',
|
||||
'dialog',
|
||||
'divider',
|
||||
'drawer',
|
||||
'dropdown',
|
||||
'dropdown-item',
|
||||
'dropdown-menu',
|
||||
'empty',
|
||||
'footer',
|
||||
'form',
|
||||
'form-item',
|
||||
'header',
|
||||
'icon',
|
||||
'image',
|
||||
'image-viewer',
|
||||
'infinite-scroll',
|
||||
'input',
|
||||
'input-number',
|
||||
'link',
|
||||
'loading',
|
||||
'main',
|
||||
'menu',
|
||||
'menu-item',
|
||||
'menu-item-group',
|
||||
'message',
|
||||
'message-box',
|
||||
'notification',
|
||||
'option',
|
||||
'option-group',
|
||||
'overlay',
|
||||
'page-header',
|
||||
'pagination',
|
||||
'popconfirm',
|
||||
'popover',
|
||||
'popper',
|
||||
'progress',
|
||||
'radio',
|
||||
'radio-button',
|
||||
'radio-group',
|
||||
'rate',
|
||||
'result',
|
||||
'row',
|
||||
'scrollbar',
|
||||
'select',
|
||||
'select-v2',
|
||||
'skeleton',
|
||||
'skeleton-item',
|
||||
'slider',
|
||||
'space',
|
||||
'step',
|
||||
'steps',
|
||||
'sub-menu',
|
||||
'switch',
|
||||
'tab-pane',
|
||||
'table',
|
||||
'table-column',
|
||||
'table-v2',
|
||||
'tabs',
|
||||
'tag',
|
||||
'teleport',
|
||||
'time-picker',
|
||||
'time-select',
|
||||
'timeline',
|
||||
'timeline-item',
|
||||
'tooltip',
|
||||
'transfer',
|
||||
'tree',
|
||||
'tree-select',
|
||||
'tree-v2',
|
||||
'upload',
|
||||
'virtual-list'
|
||||
]
|
||||
|
||||
export const pkgPath = resolve(__dirname, './package.json')
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
let { dependencies } = require(pkgPath)
|
||||
dependencies = Object.keys(dependencies).filter((dep) => !dep.startsWith('@types/'))
|
||||
|
||||
const EPDepsArr = () => {
|
||||
const depsArr = [] as string[]
|
||||
elementPlusComponentNameArr.forEach((feItem) => {
|
||||
depsArr.push(`element-plus/es/components/${feItem}/style/index`)
|
||||
})
|
||||
return depsArr
|
||||
}
|
||||
|
||||
export const optimizeElementPlus = EPDepsArr()
|
||||
export const optimizeDependencies = dependencies
|
||||
|
||||
export default []
|
129
package.json
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"name": "vue3-admin-plus",
|
||||
"version": "2.0.2",
|
||||
"license": "MIT",
|
||||
"author": "kuanghua",
|
||||
"packageManager": "pnpm@7.9.0",
|
||||
"scripts": {
|
||||
"dev": "vite --mode serve-dev",
|
||||
"test": "vite --mode serve-test",
|
||||
"build:test": "vite build --mode build-test",
|
||||
"build": "vite build --mode build",
|
||||
"preview:build": "npm run build && vite preview ",
|
||||
"preview": "vite preview ",
|
||||
"lint": "eslint --ext .js,.jsx,.vue,.ts,.tsx src --fix",
|
||||
"prepare": "husky install",
|
||||
"test:unit": "vue-cli-service test:unit",
|
||||
"test:watchAll": "vue-cli-service test:unit --watchAll",
|
||||
"test:cov": "vue-cli-service test:unit --coverage",
|
||||
"test:majestic": "majestic",
|
||||
"vitest": "vitest --ui",
|
||||
"tsc-check": "tsc",
|
||||
"coverage": "vitest run --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.0.4",
|
||||
"screenfull": "^6.0.2",
|
||||
"axios": "^1.1.3",
|
||||
"echarts": "^5.4.0",
|
||||
"element-plus": "^2.2.9",
|
||||
"js-error-collection": "^1.0.7",
|
||||
"mitt": "3.0.0",
|
||||
"moment-mini": "2.22.1",
|
||||
"nprogress": "0.2.0",
|
||||
"path-browserify": "^1.0.1",
|
||||
"path-to-regexp": "^6.2.1",
|
||||
"pinia": "^2.0.16",
|
||||
"pinia-plugin-persistedstate": "2.3.0",
|
||||
"vue": "^3.2.37",
|
||||
"vue-clipboard3": "^2.0.0",
|
||||
"vue-i18n": "9.1.10",
|
||||
"vue-router": "^4.1.5",
|
||||
"xlsx": "^0.18.5",
|
||||
"d3": "7.2.1",
|
||||
"splitpanes": "^3.1.1",
|
||||
"vxe-table": "^4.3.5",
|
||||
"xe-utils": "^3.5.6",
|
||||
"tinymce": "^6.1.0",
|
||||
"driver.js": "^0.9.8",
|
||||
"sortablejs": "1.15.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "7.16.3",
|
||||
"@tinymce/tinymce-vue": "^5.0.0",
|
||||
"@types/mockjs": "1.0.6",
|
||||
"@types/node": "^17.0.35",
|
||||
"@types/path-browserify": "^1.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "5.30.0",
|
||||
"@typescript-eslint/parser": "5.30.0",
|
||||
"@vitejs/plugin-legacy": "^2.2.0",
|
||||
"@vitejs/plugin-vue": "^2.3.3",
|
||||
"@vitejs/plugin-vue-jsx": "^2.0.1",
|
||||
"@vitest/coverage-c8": "^0.22.1",
|
||||
"@vitest/ui": "^0.22.1",
|
||||
"@vue/cli-plugin-unit-jest": "4.5.17",
|
||||
"@vue/cli-service": "4.5.17",
|
||||
"@vue/test-utils": "^2.0.2",
|
||||
"@vueuse/core": "^8.7.5",
|
||||
"eslint": "8.18.0",
|
||||
"eslint-config-prettier": "8.5.0",
|
||||
"eslint-define-config": "1.5.1",
|
||||
"eslint-plugin-eslint-comments": "3.2.0",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
"eslint-plugin-jsonc": "^2.3.0",
|
||||
"eslint-plugin-markdown": "^3.0.0",
|
||||
"eslint-plugin-prettier": "4.1.0",
|
||||
"eslint-plugin-unicorn": "^43.0.2",
|
||||
"eslint-plugin-vue": "9.1.1",
|
||||
"husky": "7.0.2",
|
||||
"jsdom": "16.4.0",
|
||||
"jsonc-eslint-parser": "^2.1.0",
|
||||
"majestic": "1.8.1",
|
||||
"mockjs": "1.1.0",
|
||||
"prettier": "2.2.1",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"rollup-plugin-visualizer": "^5.8.3",
|
||||
"sass": "^1.52.1",
|
||||
"svg-sprite-loader": "6.0.11",
|
||||
"typescript": "^4.7.2",
|
||||
"unocss": "^0.33.5",
|
||||
"unplugin-auto-import": "^0.11.2",
|
||||
"unplugin-vue-components": "^0.22.8",
|
||||
"vite": "^4.0.2",
|
||||
"vite-plugin-mkcert": "^1.7.2",
|
||||
"vite-plugin-mock": "^2.9.6",
|
||||
"vite-plugin-svg-icons": "^2.0.1",
|
||||
"vitest": "^0.22.1",
|
||||
"vue-tsc": "^0.34.16"
|
||||
},
|
||||
"pnpm": {
|
||||
"peerDependencyRules": {
|
||||
"ignoreMissing": [
|
||||
"vite-plugin-mock",
|
||||
"unplugin-auto-import",
|
||||
"unplugin-vue-components",
|
||||
"unocss",
|
||||
"unplugin",
|
||||
"vite-plugin-mock",
|
||||
"@vitejs/plugin-legacy",
|
||||
"@vitejs/plugin-vue",
|
||||
"@vitejs/*",
|
||||
"@babel/*",
|
||||
"vite",
|
||||
"vue",
|
||||
"@unocss/vite",
|
||||
"rollup",
|
||||
"vue-jest"
|
||||
]
|
||||
}
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"not ie 11",
|
||||
"not op_mini all"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 16 <18",
|
||||
"pnpm": ">= 6 <8"
|
||||
}
|
||||
}
|
BIN
public/favicon.ico
Normal file
After Width: | Height: | Size: 204 KiB |
45
src/App.vue
Normal file
|
@ -0,0 +1,45 @@
|
|||
<template>
|
||||
<el-config-provider :locale="lang[language]" namespace="el" :size="size">
|
||||
<router-view />
|
||||
</el-config-provider>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onBeforeMount, onMounted } from 'vue'
|
||||
//element-plus lang
|
||||
import zh from 'element-plus/lib/locale/lang/zh-cn'
|
||||
import en from 'element-plus/es/locale/lang/en'
|
||||
import { storeToRefs } from 'pinia/dist/pinia'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useBasicStore } from '@/store/basic'
|
||||
import { useConfigStore } from '@/store/config'
|
||||
import { useErrorLog } from '@/hooks/use-error-log'
|
||||
|
||||
//reshow default setting
|
||||
import { toggleHtmlClass } from '@/theme/utils'
|
||||
const lang = { zh, en }
|
||||
|
||||
const { settings } = storeToRefs(useBasicStore())
|
||||
const { size, language } = storeToRefs(useConfigStore())
|
||||
onBeforeMount(() => {
|
||||
//set tmp token when setting isNeedLogin false
|
||||
if (!settings.value.isNeedLogin) useBasicStore().setToken(settings.value.tmpToken)
|
||||
})
|
||||
onMounted(() => {
|
||||
//lanch the errorLog collection
|
||||
useErrorLog()
|
||||
})
|
||||
const route = useRoute()
|
||||
onMounted(() => {
|
||||
const { setTheme, theme, setSize, size, setLanguage, language } = useConfigStore()
|
||||
setTheme(theme)
|
||||
setLanguage(language, route.meta?.title)
|
||||
setSize(size)
|
||||
toggleHtmlClass(theme)
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
//修改进度条样式
|
||||
#nprogress .bar {
|
||||
background: var(--pregress-bar-color) !important;
|
||||
}
|
||||
</style>
|
17
src/api/remote-search.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import request from '@/utils/mock-axios-req'
|
||||
|
||||
export function searchUser(name) {
|
||||
return request({
|
||||
url: '/vue3-admin-plus/search/user',
|
||||
method: 'get',
|
||||
params: { name }
|
||||
})
|
||||
}
|
||||
|
||||
export function transactionList(query) {
|
||||
return request({
|
||||
url: '/vue3-admin-plus/transaction/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
31
src/api/user.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
//获取用户信息
|
||||
import axiosReq from '@/utils/axios-req'
|
||||
export const userInfoReq = (): Promise<any> => {
|
||||
return new Promise((resolve) => {
|
||||
const reqConfig = {
|
||||
url: '/basis-func/user/getUserInfo',
|
||||
params: { plateFormId: 2 },
|
||||
method: 'post'
|
||||
}
|
||||
axiosReq(reqConfig).then(({ data }) => {
|
||||
resolve(data)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
//登录
|
||||
export const loginReq = (subForm) => {
|
||||
return axiosReq({
|
||||
url: '/basis-func/user/loginValid',
|
||||
params: subForm,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
//退出登录
|
||||
export const loginOutReq = () => {
|
||||
return axiosReq({
|
||||
url: '/basis-func/user/loginValid',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
BIN
src/assets/401_images/401.gif
Normal file
After Width: | Height: | Size: 160 KiB |
BIN
src/assets/404_images/404.png
Normal file
After Width: | Height: | Size: 96 KiB |
BIN
src/assets/404_images/404_cloud.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
src/assets/layout/animation-image.gif
Normal file
After Width: | Height: | Size: 6.2 KiB |
1
src/assets/layout/login-bg.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080"><g fill="none" fill-rule="evenodd"><rect width="1920" height="1080" fill="#FFE4B5"/><rect width="1308" height="987" x="306" fill="#FFE7AB" fill-rule="nonzero"/><polygon fill="#FFF0C0" fill-rule="nonzero" points="305.817 656 1614.18 656 1920 874.654 1920 1080 0 1080 0 874.654"/></g></svg>
|
After Width: | Height: | Size: 379 B |
6
src/assets/layout/login-front.svg
Normal file
|
@ -0,0 +1,6 @@
|
|||
<svg width="62" height="36" viewBox="0 0 62 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M22.6999 3.77259C24.4356 4.78081 25.1291 6.93732 24.3066 8.76833L15.2836 28.8545C13.7715 32.2205 9.67789 33.5371 6.48705 31.6837C3.29622 29.8302 2.41184 25.622 4.58664 22.6409L17.5643 4.85188C18.7473 3.23027 20.9642 2.76437 22.6999 3.77259Z" fill="#FBC22F"/>
|
||||
<path d="M22.0103 3.37208C23.5437 4.26278 24.1526 6.17057 23.4186 7.78487L14.8214 26.6943C13.4686 29.6699 9.84252 30.8271 7.0161 29.1853C4.18967 27.5435 3.39846 23.8204 5.31296 21.1711L10.5232 13.961L14.9162 7.88203L17.4795 4.33496C18.5181 2.89766 20.477 2.48138 22.0103 3.37208Z" fill="#FDD044"/>
|
||||
<path d="M39.3003 3.77259C37.5646 4.78081 36.871 6.93732 37.6935 8.76833L46.7166 28.8545C48.2287 32.2205 52.3222 33.5371 55.5131 31.6837C58.7039 29.8302 59.5883 25.622 57.4135 22.6409L44.4359 4.85188C43.2528 3.23027 41.036 2.76437 39.3003 3.77259Z" fill="#FBC22F"/>
|
||||
<path d="M39.9898 3.37208C38.4564 4.26278 37.8476 6.17057 38.5815 7.78487L47.1787 26.6943C48.5315 29.6699 52.1576 30.8271 54.984 29.1853C57.8105 27.5435 58.6017 23.8204 56.6872 21.1711L44.5207 4.33496C43.482 2.89766 41.5232 2.48138 39.9898 3.37208Z" fill="#FDD044"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
21
src/assets/layout/login-top.svg
Normal file
|
@ -0,0 +1,21 @@
|
|||
<svg width="100" height="105" viewBox="0 0 100 105" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M44.9026 4.10289L44.0859 3.28615C42.271 1.47129 39.3285 1.47129 37.5137 3.28615V3.28615C35.6988 5.10102 35.6988 8.04351 37.5136 9.85837L44.8163 17.161L47.4635 19.8082" stroke="#FBC22F" stroke-linecap="round"/>
|
||||
<path d="M51.4099 4.10289L52.2266 3.28615C54.0415 1.47129 56.984 1.47129 58.7988 3.28615V3.28615C60.6137 5.10102 60.6137 8.04351 58.7989 9.85837L51.4962 17.161L48.849 19.8082" stroke="#FBC22F" stroke-linecap="round"/>
|
||||
<path d="M21.4817 71.7269C30.8872 67.0325 34.0705 71.5997 37.1049 77.6791C40.1392 83.7586 41.8755 89.048 32.4699 93.7425C20.8821 99.5261 9.02847 99.2864 5.99414 93.2069C2.95981 87.1275 9.89381 77.5106 21.4817 71.7269Z" fill="#CADA7D"/>
|
||||
<path d="M75.1552 71.7269C65.7496 67.0325 62.5663 71.5997 59.532 77.6791C56.4976 83.7586 54.7613 89.048 64.1669 93.7425C75.7548 99.5261 87.6084 99.2864 90.6427 93.2069C93.677 87.1275 86.743 77.5106 75.1552 71.7269Z" fill="#CADA7D"/>
|
||||
<path d="M99.5 59.5581C99.5 81.3256 77.7858 83 51 83C24.2142 83 2.5 81.3256 2.5 59.5581C2.5 32.7402 24.2142 11 51 11C77.7858 11 99.5 32.7402 99.5 59.5581Z" fill="#FBC22F"/>
|
||||
<path d="M96.5 56.186C96.5 76.4419 76.129 78 51 78C25.871 78 5.5 76.4419 5.5 56.186C5.5 31.2305 25.871 11 51 11C76.129 11 96.5 31.2305 96.5 56.186Z" fill="#FDD044"/>
|
||||
<path d="M37.5 81H59.5V89.6483C50.788 90.1172 45.9812 90.1172 37.5 89.6483V81Z" fill="#FBC22F"/>
|
||||
<path d="M17.925 35.678C19.5745 34.3952 21.5415 33.89 23.4789 34.431" stroke="black" stroke-linecap="round"/>
|
||||
<path d="M81.0109 35.678C79.3614 34.3952 77.3944 33.89 75.4571 34.431" stroke="black" stroke-linecap="round"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M49.8501 58.1823C48.0174 58.0354 47.0884 56.381 46.7204 55.2771C46.2244 53.7891 47.3286 53.9148 48.7061 54.0716C49.0625 54.1122 49.4372 54.1548 49.8072 54.1722C50.2681 54.1698 50.7353 54.1172 51.1682 54.0684C52.4967 53.9187 53.5014 53.8055 53.0047 55.2955C52.6255 56.4329 51.9337 58.2187 49.8516 58.1953C49.8511 58.1909 49.8506 58.1866 49.8501 58.1823Z" fill="#60362D"/>
|
||||
<ellipse cx="26" cy="49" rx="9.5" ry="10" fill="#FBC22F"/>
|
||||
<ellipse cx="25.5" cy="49.5" rx="8" ry="8.5" fill="white"/>
|
||||
<path d="M30.5 51C29.953 48.5536 28.5084 47 26.0231 47C23.5378 47 21.8257 48.5536 21.5 51" stroke="#60362D" stroke-width="1.5" stroke-linecap="round"/>
|
||||
<circle cx="74.5" cy="49" r="10" fill="#FBC22F"/>
|
||||
<ellipse cx="74.5" cy="49.5" rx="9" ry="8.5" fill="white"/>
|
||||
<path d="M79.5 51C78.953 48.5536 77.5084 47 75.0231 47C72.5378 47 70.8257 48.5536 70.5 51" stroke="#60362D" stroke-width="1.5" stroke-linecap="round"/>
|
||||
<ellipse cx="15.4268" cy="66.6714" rx="2.3468" ry="1.41242" transform="rotate(-13.6387 15.4268 66.6714)" fill="#FFBA98"/>
|
||||
<path d="M44 69H56L54.5 72L49.5 72.5L44.5 71.5L44 69Z" fill="#FFBA98"/>
|
||||
<path d="M57 68C56.1491 70.6914 53.8649 72.9999 49.9989 72.9999C46.1329 72.9999 43.5066 70.6914 43 68" stroke="#DC5E16" stroke-width="2" stroke-linecap="round"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.9 KiB |
1
src/assets/layout/login.svg
Normal file
After Width: | Height: | Size: 158 KiB |
BIN
src/assets/layout/logo.png
Normal file
After Width: | Height: | Size: 10 KiB |
36
src/components/ElSvgIcon.vue
Normal file
|
@ -0,0 +1,36 @@
|
|||
<template>
|
||||
<el-icon :size="size" :color="color">
|
||||
<component :is="ElSvg[name]" />
|
||||
</el-icon>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import * as ElSvg from '@element-plus/icons-vue'
|
||||
const props = defineProps({
|
||||
name: {
|
||||
require: true,
|
||||
default: 'Fold',
|
||||
type: String
|
||||
},
|
||||
size: {
|
||||
require: false,
|
||||
default: 18,
|
||||
type: Number
|
||||
},
|
||||
color: {
|
||||
require: false,
|
||||
default: '',
|
||||
type: String
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
//.el-svg-icon {
|
||||
// width: 1em;
|
||||
// height: 1em;
|
||||
// margin-left: -2px; //el-svg-icon has some margin
|
||||
// font-size: 20px !important;
|
||||
// text-align: left !important;
|
||||
//}
|
||||
</style>
|
15
src/components/TestUnit.vue
Normal file
|
@ -0,0 +1,15 @@
|
|||
<template>
|
||||
<div>TestUnit.vue</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const props = defineProps({
|
||||
msg: {
|
||||
require: true,
|
||||
default: 'fai',
|
||||
type: String
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
236
src/components/__tests__/el-svgIcon.test.jsx
Normal file
|
@ -0,0 +1,236 @@
|
|||
import { markRaw, nextTick, ref } from 'vue'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { describe, expect, it, test } from 'vitest'
|
||||
import { Loading, Search } from '@element-plus/icons-vue'
|
||||
|
||||
import ElSvgIcon from '../ElSvgIcon.vue'
|
||||
|
||||
// const AXIOM = 'Rem is the best girl'
|
||||
|
||||
describe('ElSvgIcon.vue', () => {
|
||||
it('create', () => {
|
||||
const wrapper = mount(() => <ElSvgIcon name="Edit" size={30} color={'red'} />)
|
||||
// console.log(111111, wrapper.classes())
|
||||
// expect(wrapper.classes()).toContain('el-icon')
|
||||
})
|
||||
|
||||
// it('icon', () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon icon={markRaw(Search)} />)
|
||||
// expect(wrapper.findAll('Search11222')).toBeTruthy()
|
||||
// })
|
||||
//
|
||||
// it('size', () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon size="20px" />)
|
||||
// expect(wrapper.findAll('20px')).toBeTruthy()
|
||||
// })
|
||||
//
|
||||
// it('color', () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon color={'red'} />)
|
||||
// expect(wrapper.findAll('red')).toBeTruthy()
|
||||
// })
|
||||
//
|
||||
// it('nativeType', () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon nativeType="submit" />)
|
||||
//
|
||||
// expect(wrapper.attributes('type')).toBe('submit')
|
||||
// })
|
||||
//
|
||||
// it('loading', () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon loading />)
|
||||
//
|
||||
// expect(wrapper.classes()).toContain('is-loading')
|
||||
// expect(wrapper.findComponent(Loading).exists()).toBeTruthy()
|
||||
// })
|
||||
//
|
||||
// it('size', () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon size="large" />)
|
||||
//
|
||||
// expect(wrapper.classes()).toContain('el-button--large')
|
||||
// })
|
||||
//
|
||||
// it('plain', () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon plain />)
|
||||
//
|
||||
// expect(wrapper.classes()).toContain('is-plain')
|
||||
// })
|
||||
//
|
||||
// it('round', () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon round />)
|
||||
// expect(wrapper.classes()).toContain('is-round')
|
||||
// })
|
||||
//
|
||||
// it('circle', () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon circle />)
|
||||
//
|
||||
// expect(wrapper.classes()).toContain('is-circle')
|
||||
// })
|
||||
|
||||
// it('text', async () => {
|
||||
// const bg = ref(false)
|
||||
//
|
||||
// const wrapper = mount(() => <ElSvgIcon text bg={bg.value} />)
|
||||
//
|
||||
// expect(wrapper.classes()).toContain('is-text')
|
||||
//
|
||||
// bg.value = true
|
||||
//
|
||||
// await nextTick()
|
||||
//
|
||||
// expect(wrapper.classes()).toContain('is-has-bg')
|
||||
// })
|
||||
|
||||
// it('link', async () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon link />)
|
||||
//
|
||||
// expect(wrapper.classes()).toContain('is-link')
|
||||
// })
|
||||
|
||||
// test('render text', () => {
|
||||
// const wrapper = mount(() => (
|
||||
// <ElSvgIcon
|
||||
// v-slots={{
|
||||
// default: () => AXIOM
|
||||
// }}
|
||||
// />
|
||||
// ))
|
||||
//
|
||||
// expect(wrapper.text()).toEqual(AXIOM)
|
||||
// })
|
||||
//
|
||||
// test('handle click', async () => {
|
||||
// const wrapper = mount(() => (
|
||||
// <ElSvgIcon
|
||||
// v-slots={{
|
||||
// default: () => AXIOM
|
||||
// }}
|
||||
// />
|
||||
// ))
|
||||
//
|
||||
// await wrapper.trigger('click')
|
||||
// expect(wrapper.emitted()).toBeDefined()
|
||||
// })
|
||||
//
|
||||
// test('handle click inside', async () => {
|
||||
// const wrapper = mount(() => (
|
||||
// <ElSvgIcon
|
||||
// v-slots={{
|
||||
// default: () => <span class="inner-slot"></span>
|
||||
// }}
|
||||
// />
|
||||
// ))
|
||||
//
|
||||
// wrapper.find('.inner-slot').trigger('click')
|
||||
// expect(wrapper.emitted()).toBeDefined()
|
||||
// })
|
||||
//
|
||||
// test('loading implies disabled', async () => {
|
||||
// const wrapper = mount(() => (
|
||||
// <ElSvgIcon
|
||||
// v-slots={{
|
||||
// default: () => AXIOM
|
||||
// }}
|
||||
// loading
|
||||
// />
|
||||
// ))
|
||||
//
|
||||
// await wrapper.trigger('click')
|
||||
// expect(wrapper.emitted('click')).toBeUndefined()
|
||||
// })
|
||||
//
|
||||
// it('disabled', async () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon disabled />)
|
||||
//
|
||||
// expect(wrapper.classes()).toContain('is-disabled')
|
||||
// await wrapper.trigger('click')
|
||||
// expect(wrapper.emitted('click')).toBeUndefined()
|
||||
// })
|
||||
//
|
||||
// it('loading icon', () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon loadingIcon={markRaw(Search)} loading />)
|
||||
//
|
||||
// expect(wrapper.findComponent(Search).exists()).toBeTruthy()
|
||||
// })
|
||||
//
|
||||
// it('loading slot', () => {
|
||||
// const wrapper = mount({
|
||||
// setup: () => () => (
|
||||
// <ElSvgIcon v-slots={{ loading: () => <span class="custom-loading">111</span> }} loading={true}>
|
||||
// Loading
|
||||
// </ElSvgIcon>
|
||||
// )
|
||||
// })
|
||||
//
|
||||
// expect(wrapper.find('.custom-loading').exists()).toBeTruthy()
|
||||
// })
|
||||
})
|
||||
// describe('ElSvgIcon Group', () => {
|
||||
// it('create', () => {
|
||||
// const wrapper = mount({
|
||||
// setup: () => () =>
|
||||
// (
|
||||
// <ButtonGroup>
|
||||
// <ElSvgIcon type="primary">Prev</ElSvgIcon>
|
||||
// <ElSvgIcon type="primary">Next</ElSvgIcon>
|
||||
// </ButtonGroup>
|
||||
// )
|
||||
// })
|
||||
// expect(wrapper.classes()).toContain('el-button-group')
|
||||
// expect(wrapper.findAll('button').length).toBe(2)
|
||||
// })
|
||||
//
|
||||
// it('button group reactive size', async () => {
|
||||
// const size = ref<ComponentSize>('small')
|
||||
// const wrapper = mount({
|
||||
// setup: () => () =>
|
||||
// (
|
||||
// <ButtonGroup size={size.value}>
|
||||
// <ElSvgIcon type="primary">Prev</ElSvgIcon>
|
||||
// <ElSvgIcon type="primary">Next</ElSvgIcon>
|
||||
// </ButtonGroup>
|
||||
// )
|
||||
// })
|
||||
// expect(wrapper.classes()).toContain('el-button-group')
|
||||
// expect(wrapper.findAll('.el-button-group button.el-button--small').length).toBe(2)
|
||||
//
|
||||
// size.value = 'large'
|
||||
// await nextTick()
|
||||
//
|
||||
// expect(wrapper.findAll('.el-button-group button.el-button--large').length).toBe(2)
|
||||
// })
|
||||
//
|
||||
// it('button group type', async () => {
|
||||
// const wrapper = mount({
|
||||
// setup: () => () =>
|
||||
// (
|
||||
// <ButtonGroup type="warning">
|
||||
// <ElSvgIcon type="primary">Prev</ElSvgIcon>
|
||||
// <ElSvgIcon>Next</ElSvgIcon>
|
||||
// </ButtonGroup>
|
||||
// )
|
||||
// })
|
||||
// expect(wrapper.classes()).toContain('el-button-group')
|
||||
// expect(wrapper.findAll('.el-button-group button.el-button--primary').length).toBe(1)
|
||||
// expect(wrapper.findAll('.el-button-group button.el-button--warning').length).toBe(1)
|
||||
// })
|
||||
//
|
||||
// it('add space in two Chinese characters', async () => {
|
||||
// const wrapper = mount(() => (
|
||||
// <ElSvgIcon
|
||||
// v-slots={{
|
||||
// default: () => '中文'
|
||||
// }}
|
||||
// autoInsertSpace
|
||||
// />
|
||||
// ))
|
||||
//
|
||||
// expect(wrapper.find('.el-button span').text()).toBe('中文')
|
||||
// expect(wrapper.find('.el-button span').classes()).toContain('el-button__text--expand')
|
||||
// })
|
||||
//
|
||||
// it('add space between two Chinese characters even if there is whitespace at both ends', async () => {
|
||||
// const wrapper = mount(() => <ElSvgIcon autoInsertSpace> 中文 </ElSvgIcon>)
|
||||
//
|
||||
// expect(wrapper.find('.el-button span').text()).toBe('中文')
|
||||
// expect(wrapper.find('.el-button span').classes()).toContain('el-button__text--expand')
|
||||
// })
|
||||
// })
|
21
src/directives/button-codes.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { useBasicStore } from '@/store/basic'
|
||||
|
||||
function checkPermission(el, { value }) {
|
||||
if (value && Array.isArray(value)) {
|
||||
if (value.length) {
|
||||
const permissionRoles = value
|
||||
const hasPermission = useBasicStore().buttonCodes?.some((code) => permissionRoles.includes(code))
|
||||
if (!hasPermission) el.parentNode && el.parentNode.removeChild(el)
|
||||
}
|
||||
} else {
|
||||
throw new Error(`need roles! Like v-permission="['admin','editor']"`)
|
||||
}
|
||||
}
|
||||
export default {
|
||||
mounted(el, binding) {
|
||||
checkPermission(el, binding)
|
||||
},
|
||||
componentUpdated(el, binding) {
|
||||
checkPermission(el, binding)
|
||||
}
|
||||
}
|
20
src/directives/codes-permission.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { useBasicStore } from '@/store/basic'
|
||||
function checkPermission(el, { value }) {
|
||||
if (value && Array.isArray(value)) {
|
||||
if (value.length > 0) {
|
||||
const permissionRoles = value
|
||||
const hasPermission = useBasicStore().codes?.some((role) => permissionRoles.includes(role))
|
||||
if (!hasPermission) el.parentNode && el.parentNode.removeChild(el)
|
||||
}
|
||||
} else {
|
||||
throw new Error(`need codes! Like v-codes-permission="['admin','editor']"`)
|
||||
}
|
||||
}
|
||||
export default {
|
||||
mounted(el, binding) {
|
||||
checkPermission(el, binding)
|
||||
},
|
||||
componentUpdated(el, binding) {
|
||||
checkPermission(el, binding)
|
||||
}
|
||||
}
|
21
src/directives/example/clickoutside.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
|
||||
export default {
|
||||
mounted(el, binding) {
|
||||
if (typeof binding.value !== 'function') {
|
||||
throw 'callback must be a function';
|
||||
}
|
||||
el.__handleClick__ = function (e) {
|
||||
if (el.contains(e.target)) {
|
||||
binding.value(false);
|
||||
}
|
||||
else {
|
||||
binding.value(true);
|
||||
}
|
||||
};
|
||||
document.addEventListener('click', el.__handleClick__);
|
||||
},
|
||||
beforeUnmount(el) {
|
||||
document.removeEventListener('click', el.__handleClick__);
|
||||
}
|
||||
|
||||
}
|
31
src/directives/example/copy.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
/**
|
||||
* v-copy
|
||||
* 复制某个值至剪贴板
|
||||
* 接收参数:string类型/Ref<string>类型/Reactive<string>类型
|
||||
*/
|
||||
import { ElMessage } from 'element-plus';
|
||||
function handleClick(ev) {
|
||||
const input = document.createElement('input');
|
||||
input.value = this.copyData.toLocaleString();
|
||||
document.body.appendChild(input);
|
||||
input.select();
|
||||
document.execCommand('Copy');
|
||||
document.body.removeChild(input);
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '复制成功'
|
||||
});
|
||||
}
|
||||
export default {
|
||||
mounted(el, binding) {
|
||||
el.copyData = binding.value;
|
||||
el.addEventListener('click', handleClick);
|
||||
},
|
||||
updated(el, binding) {
|
||||
el.copyData = binding.value;
|
||||
},
|
||||
beforeUnmount(el) {
|
||||
el.removeEventListener('click', el.__handleClick__);
|
||||
}
|
||||
};
|
||||
|
26
src/directives/example/debounce.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* v-debounce
|
||||
* 按钮防抖指令,可自行扩展至input
|
||||
* 接收参数:function类型
|
||||
*/
|
||||
export default {
|
||||
mounted(el, binding) {
|
||||
if (typeof binding.value !== 'function') {
|
||||
console.error('callback must be a function');
|
||||
return;
|
||||
}
|
||||
let timer = null;
|
||||
el.__handleClick__ = function (e) {
|
||||
if (timer) {
|
||||
clearInterval(timer);
|
||||
}
|
||||
timer = setTimeout(() => {
|
||||
binding.value();
|
||||
}, 200);
|
||||
};
|
||||
el.addEventListener('click', el.__handleClick__);
|
||||
},
|
||||
beforeUnmount(el) {
|
||||
el.removeEventListener('click', el.__handleClick__);
|
||||
}
|
||||
};
|
45
src/directives/example/longpress.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
* v-longpress
|
||||
* 长按指令,长按时触发事件
|
||||
*/
|
||||
export default {
|
||||
mounted(el, binding) {
|
||||
if (typeof binding.value !== 'function') {
|
||||
throw 'callback must be a function';
|
||||
}
|
||||
// 定义变量
|
||||
let pressTimer = null;
|
||||
// 创建计时器( 2秒后执行函数 )
|
||||
const start = (e) => {
|
||||
if (e.button) {
|
||||
if (e.type === 'click' && e.button !== 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (pressTimer === null) {
|
||||
pressTimer = setTimeout(() => {
|
||||
handler(e);
|
||||
}, 1000);
|
||||
}
|
||||
};
|
||||
// 取消计时器
|
||||
const cancel = (e) => {
|
||||
if (pressTimer !== null) {
|
||||
clearTimeout(pressTimer);
|
||||
pressTimer = null;
|
||||
}
|
||||
};
|
||||
// 运行函数
|
||||
const handler = (e) => {
|
||||
binding.value(e);
|
||||
};
|
||||
// 添加事件监听器
|
||||
el.addEventListener('mousedown', start);
|
||||
el.addEventListener('touchstart', start);
|
||||
// 取消计时器
|
||||
el.addEventListener('click', cancel);
|
||||
el.addEventListener('mouseout', cancel);
|
||||
el.addEventListener('touchend', cancel);
|
||||
el.addEventListener('touchcancel', cancel);
|
||||
},
|
||||
};
|
28
src/directives/example/watermark.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* v-watermark可接收参数,均为非必填
|
||||
* { text: 'vue-admin-box', font: '16px Microsoft JhengHei', textColor: '#000' }
|
||||
*/
|
||||
function addWaterMark(str, parentNode, font, textColor) {
|
||||
// 水印文字,父元素,字体,文字颜色
|
||||
const can = document.createElement('canvas');
|
||||
parentNode.appendChild(can);
|
||||
can.width = 200;
|
||||
can.height = 150;
|
||||
can.style.display = 'none';
|
||||
const cans = can.getContext('2d');
|
||||
cans.rotate((-20 * Math.PI) / 180);
|
||||
cans.font = font || '16px Microsoft JhengHei';
|
||||
cans.fillStyle = textColor || 'rgba(180, 180, 180, 0.3)';
|
||||
cans.textAlign = 'left';
|
||||
cans.textBaseline = 'middle';
|
||||
cans.fillText(str || 'vue3-admin-plus', can.width / 10, can.height / 2);
|
||||
parentNode.style.backgroundImage = `url(${ can.toDataURL('image/png') })`;
|
||||
}
|
||||
export default {
|
||||
mounted(el, binding) {
|
||||
binding.value ? binding.value : binding.value = {};
|
||||
addWaterMark(binding.value.text, el, binding.value.font, binding.value.textColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
26
src/directives/example/waves.css
Normal file
|
@ -0,0 +1,26 @@
|
|||
.waves-ripple {
|
||||
position: absolute;
|
||||
border-radius: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.15);
|
||||
background-clip: padding-box;
|
||||
pointer-events: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-transform: scale(0);
|
||||
-ms-transform: scale(0);
|
||||
transform: scale(0);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.waves-ripple.z-active {
|
||||
opacity: 0;
|
||||
-webkit-transform: scale(2);
|
||||
-ms-transform: scale(2);
|
||||
transform: scale(2);
|
||||
-webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
|
||||
transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
|
||||
transition: opacity 1.2s ease-out, transform 0.6s ease-out;
|
||||
transition: opacity 1.2s ease-out, transform 0.6s ease-out, -webkit-transform 0.6s ease-out;
|
||||
}
|
72
src/directives/example/waves.js
Normal file
|
@ -0,0 +1,72 @@
|
|||
import './waves.css'
|
||||
|
||||
const context = '@@wavesContext'
|
||||
|
||||
function handleClick(el, binding) {
|
||||
function handle(e) {
|
||||
const customOpts = Object.assign({}, binding.value)
|
||||
const opts = Object.assign({
|
||||
ele: el, // 波纹作用元素
|
||||
type: 'hit', // hit 点击位置扩散 center中心点扩展
|
||||
color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
|
||||
},
|
||||
customOpts
|
||||
)
|
||||
const target = opts.ele
|
||||
if (target) {
|
||||
target.style.position = 'relative'
|
||||
target.style.overflow = 'hidden'
|
||||
const rect = target.getBoundingClientRect()
|
||||
let ripple = target.querySelector('.waves-ripple')
|
||||
if (!ripple) {
|
||||
ripple = document.createElement('span')
|
||||
ripple.className = 'waves-ripple'
|
||||
ripple.style.height = ripple.style.width = `${Math.max(rect.width, rect.height) }px`
|
||||
target.appendChild(ripple)
|
||||
} else {
|
||||
ripple.className = 'waves-ripple'
|
||||
}
|
||||
switch (opts.type) {
|
||||
case 'center':
|
||||
ripple.style.top = `${rect.height / 2 - ripple.offsetHeight / 2 }px`
|
||||
ripple.style.left = `${rect.width / 2 - ripple.offsetWidth / 2 }px`
|
||||
break
|
||||
default:
|
||||
ripple.style.top =
|
||||
`${e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop ||
|
||||
document.body.scrollTop }px`
|
||||
ripple.style.left =
|
||||
`${e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft ||
|
||||
document.body.scrollLeft }px`
|
||||
}
|
||||
ripple.style.backgroundColor = opts.color
|
||||
ripple.className = 'waves-ripple z-active'
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if (!el[context]) {
|
||||
el[context] = {
|
||||
removeHandle: handle
|
||||
}
|
||||
} else {
|
||||
el[context].removeHandle = handle
|
||||
}
|
||||
|
||||
return handle
|
||||
}
|
||||
|
||||
export default {
|
||||
mounted(el, binding) {
|
||||
el.addEventListener('click', handleClick(el, binding), false)
|
||||
},
|
||||
updated(el, binding) {
|
||||
el.removeEventListener('click', el[context].removeHandle, false)
|
||||
el.addEventListener('click', handleClick(el, binding), false)
|
||||
},
|
||||
beforeUnmount(el) {
|
||||
el.removeEventListener('click', el[context].removeHandle, false)
|
||||
el[context] = null
|
||||
delete el[context]
|
||||
}
|
||||
}
|
26
src/directives/index.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import buttonCodes from './button-codes'
|
||||
import codesPermission from './codes-permission'
|
||||
import rolesPermission from './roles-permission'
|
||||
import lang from './lang'
|
||||
|
||||
import copy from './example/copy'
|
||||
import longpress from './example/longpress'
|
||||
import debounce from './example/debounce'
|
||||
import watermark from './example/watermark'
|
||||
import waves from './example/waves.js'
|
||||
import clickoutside from './example/clickoutside'
|
||||
|
||||
export default function (app) {
|
||||
app.directive('ButtonCodes', buttonCodes)
|
||||
app.directive('CodesPermission', codesPermission)
|
||||
app.directive('RolesPermission', rolesPermission)
|
||||
app.directive('lang', lang)
|
||||
|
||||
//example
|
||||
app.directive('copy', copy)
|
||||
app.directive('longpress', longpress)
|
||||
app.directive('debounce', debounce)
|
||||
app.directive('watermark', watermark)
|
||||
app.directive('waves', waves)
|
||||
app.directive('clickoutside', clickoutside)
|
||||
}
|
44
src/directives/lang.ts
Normal file
|
@ -0,0 +1,44 @@
|
|||
import { watch } from 'vue'
|
||||
import { storeToRefs } from 'pinia/dist/pinia'
|
||||
import { langTitle } from '@/hooks/use-common'
|
||||
import { useConfigStore } from '@/store/config'
|
||||
//element-plus
|
||||
const componentToProps = {
|
||||
ElInput: 'placeholder',
|
||||
ElTableColumn: 'label'
|
||||
}
|
||||
|
||||
function checkPermission(el, { value }) {
|
||||
let saveOriginTitle = ''
|
||||
const { language } = storeToRefs(useConfigStore())
|
||||
//save the original title
|
||||
const name = el.__vueParentComponent?.type?.name
|
||||
const nameTitle = el.__vueParentComponent?.props[componentToProps[name]]
|
||||
saveOriginTitle = nameTitle || el.innerText
|
||||
watch(
|
||||
() => language.value,
|
||||
() => {
|
||||
//element tag or component
|
||||
if (name?.startsWith('EL')) {
|
||||
//self cunstrom
|
||||
if (Object.keys(componentToProps).includes(name)) {
|
||||
const props = el.__vueParentComponent.props
|
||||
props[componentToProps[name]] = langTitle(saveOriginTitle)
|
||||
} else {
|
||||
el.innerText = langTitle(saveOriginTitle)
|
||||
}
|
||||
} else {
|
||||
//common tag such as div span output so on;
|
||||
if (el.__vnode?.type) {
|
||||
el.innerText = langTitle(saveOriginTitle)
|
||||
}
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
}
|
||||
export default {
|
||||
mounted(el, binding) {
|
||||
checkPermission(el, binding)
|
||||
}
|
||||
}
|
20
src/directives/roles-permission.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { useBasicStore } from '@/store/basic'
|
||||
function checkPermission(el, { value }) {
|
||||
if (value && Array.isArray(value)) {
|
||||
if (value.length > 0) {
|
||||
const permissionRoles = value
|
||||
const hasPermission = useBasicStore().roles?.some((role) => permissionRoles.includes(role))
|
||||
if (!hasPermission) el.parentNode && el.parentNode.removeChild(el)
|
||||
}
|
||||
} else {
|
||||
throw new Error(`need roles! Like v-roles-permission="['admin','editor']"`)
|
||||
}
|
||||
}
|
||||
export default {
|
||||
mounted(el, binding) {
|
||||
checkPermission(el, binding)
|
||||
},
|
||||
componentUpdated(el, binding) {
|
||||
checkPermission(el, binding)
|
||||
}
|
||||
}
|
47
src/hooks/use-common.ts
Normal file
|
@ -0,0 +1,47 @@
|
|||
//复制文本
|
||||
import useClipboard from 'vue-clipboard3'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
// i18n language match title
|
||||
import { i18n } from '@/lang'
|
||||
// the keys using zh file
|
||||
import langEn from '@/lang/zh'
|
||||
import settings from '@/settings'
|
||||
|
||||
export const sleepTimeout = (time: number) => {
|
||||
return new Promise((resolve) => {
|
||||
const timer = setTimeout(() => {
|
||||
clearTimeout(timer)
|
||||
resolve(null)
|
||||
}, time)
|
||||
})
|
||||
}
|
||||
|
||||
//深拷贝
|
||||
export function cloneDeep(value) {
|
||||
return JSON.parse(JSON.stringify(value))
|
||||
}
|
||||
|
||||
//copyValueToClipboard
|
||||
const { toClipboard } = useClipboard()
|
||||
export const copyValueToClipboard = (value: any) => {
|
||||
toClipboard(JSON.stringify(value))
|
||||
ElMessage.success('复制成功')
|
||||
}
|
||||
const { t, te } = i18n.global
|
||||
export const langTitle = (title) => {
|
||||
if (!title) {
|
||||
return settings.title
|
||||
}
|
||||
for (const key of Object.keys(langEn)) {
|
||||
if (te(`${key}.${title}`) && t(`${key}.${title}`)) {
|
||||
return t(`${key}.${title}`)
|
||||
}
|
||||
}
|
||||
return title
|
||||
}
|
||||
|
||||
//get i18n instance
|
||||
export const getLangInstance = () => {
|
||||
return i18n.global as ObjKeys
|
||||
}
|
214
src/hooks/use-element.ts
Normal file
|
@ -0,0 +1,214 @@
|
|||
import { reactive, ref, toRefs } from 'vue'
|
||||
import { ElLoading, ElMessage, ElMessageBox, ElNotification } from 'element-plus'
|
||||
import type { EpPropMergeType } from 'element-plus/es/utils'
|
||||
export const useElement = () => {
|
||||
// 正整数
|
||||
const upZeroInt = (rule, value, callback, msg) => {
|
||||
if (!value) {
|
||||
callback(new Error(`${msg}不能为空`))
|
||||
}
|
||||
if (/^\+?[1-9]\d*$/.test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error(`${msg}输入有误`))
|
||||
}
|
||||
}
|
||||
|
||||
// 正整数(包括0)
|
||||
const zeroInt = (rule, value, callback, msg) => {
|
||||
if (!value) {
|
||||
callback(new Error(`${msg}不能为空`))
|
||||
}
|
||||
if (/^\+?[0-9]\d*$/.test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error(`${msg}输入有误`))
|
||||
}
|
||||
}
|
||||
|
||||
// 金额
|
||||
const money = (rule, value, callback, msg) => {
|
||||
if (!value) {
|
||||
callback(new Error(`${msg}不能为空`))
|
||||
}
|
||||
if (/((^[1-9]\d*)|^0)(\.\d{0,2}){0,1}$/.test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error(`${msg}输入有误`))
|
||||
}
|
||||
}
|
||||
|
||||
// 手机号
|
||||
const phone = (rule, value, callback, msg) => {
|
||||
if (!value) {
|
||||
callback(new Error(`${msg}不能为空`))
|
||||
}
|
||||
if (/^0?1[0-9]{10}$/.test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error(`${msg}输入有误`))
|
||||
}
|
||||
}
|
||||
|
||||
// 邮箱
|
||||
const email = (rule, value, callback, msg) => {
|
||||
if (!value) {
|
||||
callback(new Error(`${msg}不能为空`))
|
||||
}
|
||||
if (/(^([a-zA-Z]|[0-9])(\w|-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4}))$/.test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error(`${msg}`))
|
||||
}
|
||||
}
|
||||
const state = reactive({
|
||||
/* table*/
|
||||
tableData: [],
|
||||
rowDeleteIdArr: [],
|
||||
loadingId: null,
|
||||
/* 表单*/
|
||||
formModel: {},
|
||||
subForm: {},
|
||||
searchForm: {},
|
||||
/* 表单校验*/
|
||||
formRules: {
|
||||
//非空
|
||||
isNull: (msg: string) => [{ required: false, message: `${msg}`, trigger: 'blur' }],
|
||||
isNotNull: (msg: string) => [{ required: true, message: `${msg}`, trigger: 'blur' }],
|
||||
// 正整数
|
||||
upZeroInt: (msg: string) => [
|
||||
{ required: true, validator: (rule, value, callback) => upZeroInt(rule, value, callback, msg), trigger: 'blur' }
|
||||
],
|
||||
// 正整数(包括0)
|
||||
zeroInt: (msg: string) => [
|
||||
{ required: true, validator: (rule, value, callback) => zeroInt(rule, value, callback, msg), trigger: 'blur' }
|
||||
],
|
||||
// 金额
|
||||
money: (msg: string) => [
|
||||
{ required: true, validator: (rule, value, callback) => money(rule, value, callback, msg), trigger: 'blur' }
|
||||
],
|
||||
// 手机号
|
||||
phone: (msg: string) => [
|
||||
{ required: true, validator: (rule, value, callback) => phone(rule, value, callback, msg), trigger: 'blur' }
|
||||
],
|
||||
// 邮箱
|
||||
email: (msg: string) => [
|
||||
{ required: true, validator: (rule, value, callback) => email(rule, value, callback, msg), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
/* 时间packing相关*/
|
||||
datePickerOptions: {
|
||||
//选择今天以后的日期,包括今天
|
||||
disabledDate: (time: any) => {
|
||||
return time.getTime() < Date.now() - 86400000
|
||||
}
|
||||
},
|
||||
startEndArr: [],
|
||||
/* dialog相关*/
|
||||
dialogTitle: '添加',
|
||||
detailDialog: false,
|
||||
isDialogEdit: false,
|
||||
dialogVisible: false,
|
||||
tableLoading: false,
|
||||
/* 树相关*/
|
||||
treeData: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
}
|
||||
})
|
||||
return {
|
||||
...toRefs(state)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 通知弹框
|
||||
* message:通知的内容
|
||||
* type:通知类型
|
||||
* duration:通知显示时长(ms)
|
||||
* */
|
||||
export const elMessage = (message: string, type?) => {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: message || '成功',
|
||||
type: type || ('success' as string),
|
||||
center: false
|
||||
})
|
||||
}
|
||||
/*
|
||||
* loading加载框
|
||||
* 调用后通过 loadingId.close() 进行关闭
|
||||
* */
|
||||
let loadingId: any = null
|
||||
export const elLoading = (msg?: string) => {
|
||||
loadingId = ElLoading.service({
|
||||
lock: true,
|
||||
text: msg || '数据载入中',
|
||||
// spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.1)'
|
||||
})
|
||||
}
|
||||
export const closeElLoading = () => {
|
||||
loadingId.close()
|
||||
}
|
||||
/*
|
||||
* 提示
|
||||
* message: 提示内容
|
||||
* type:提示类型
|
||||
* title:提示标题
|
||||
* duration:提示时长(ms)
|
||||
* */
|
||||
export const elNotify = (
|
||||
message: string,
|
||||
type: EpPropMergeType<any, any, any> | undefined,
|
||||
title: string,
|
||||
duration: number
|
||||
) => {
|
||||
ElNotification({
|
||||
title: title || '提示',
|
||||
type: type || 'success',
|
||||
message: message || '请传入提示消息',
|
||||
position: 'top-right',
|
||||
duration: duration || 2500,
|
||||
offset: 40
|
||||
})
|
||||
}
|
||||
/*
|
||||
确认弹框(没有取消按钮)
|
||||
* title:提示的标题
|
||||
* message:提示的内容
|
||||
* return Promise
|
||||
* */
|
||||
export const elConfirmNoCancelBtn = (title: string, message: string) => {
|
||||
return ElMessageBox({
|
||||
message: message || '你确定要删除吗',
|
||||
title: title || '确认框',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
showCancelButton: false,
|
||||
type: 'warning'
|
||||
})
|
||||
}
|
||||
/*
|
||||
* 确认弹框
|
||||
* title:提示的标题
|
||||
* message:提示的内容
|
||||
* return Promise
|
||||
* */
|
||||
export const elConfirm = (title: string, message: string) => {
|
||||
return ElMessageBox({
|
||||
message: message || '你确定要删除吗',
|
||||
title: title || '确认框',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
}
|
||||
|
||||
/* 级联*/
|
||||
const cascaderKey = ref()
|
||||
export const casHandleChange = () => {
|
||||
// 解决目前级联选择器搜索输入报错问题
|
||||
cascaderKey.value += cascaderKey.value
|
||||
}
|
32
src/hooks/use-error-log.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*js 错误日志收集*/
|
||||
import { jsErrorCollection } from 'js-error-collection'
|
||||
import pack from '../../package.json'
|
||||
import settings from '@/settings'
|
||||
import bus from '@/utils/bus'
|
||||
import axiosReq from '@/utils/axios-req'
|
||||
const reqUrl = '/integration-front/errorCollection/insert'
|
||||
const errorLogReq = (errLog: string) => {
|
||||
axiosReq({
|
||||
url: reqUrl,
|
||||
data: {
|
||||
pageUrl: window.location.href,
|
||||
errorLog: errLog,
|
||||
browserType: navigator.userAgent,
|
||||
version: pack.version
|
||||
},
|
||||
method: 'post'
|
||||
}).then(() => {
|
||||
//通知错误列表页面更新数据
|
||||
bus.emit('reloadErrorPage', {})
|
||||
})
|
||||
}
|
||||
|
||||
export const useErrorLog = () => {
|
||||
//判断该环境是否需要收集错误日志,由settings配置决定
|
||||
if (settings.errorLog?.includes(import.meta.env.VITE_APP_ENV)) {
|
||||
jsErrorCollection({ runtimeError: true, rejectError: true, consoleError: true }, (errLog) => {
|
||||
//判断是否是reqUrl错误,避免死循环
|
||||
if (!errLog.includes(reqUrl)) errorLogReq(errLog)
|
||||
})
|
||||
}
|
||||
}
|
44
src/hooks/use-layout.ts
Normal file
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* 判断是否是外链
|
||||
* @param {string} path
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
import { onBeforeMount, onBeforeUnmount, onMounted } from 'vue'
|
||||
import { useBasicStore } from '@/store/basic'
|
||||
export function isExternal(path) {
|
||||
return /^(https?:|mailto:|tel:)/.test(path)
|
||||
}
|
||||
|
||||
/*判断窗口变化控制侧边栏收起或展开*/
|
||||
export function resizeHandler() {
|
||||
const { body } = document
|
||||
const WIDTH = 992
|
||||
const basicStore = useBasicStore()
|
||||
const isMobile = () => {
|
||||
const rect = body.getBoundingClientRect()
|
||||
return rect.width - 1 < WIDTH
|
||||
}
|
||||
const resizeHandler = () => {
|
||||
if (!document.hidden) {
|
||||
if (isMobile()) {
|
||||
/*此处只做根据window尺寸关闭sideBar功能*/
|
||||
basicStore.setSidebarOpen(false)
|
||||
} else {
|
||||
basicStore.setSidebarOpen(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
onBeforeMount(() => {
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
onMounted(() => {
|
||||
if (isMobile()) {
|
||||
basicStore.setSidebarOpen(false)
|
||||
} else {
|
||||
basicStore.setSidebarOpen(true)
|
||||
}
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
})
|
||||
}
|
184
src/hooks/use-permission.ts
Normal file
|
@ -0,0 +1,184 @@
|
|||
import NProgress from 'nprogress'
|
||||
import type { RouteRawConfig, RouterTypes, rawConfig } from '~/basic'
|
||||
import type { RouteRecordName } from 'vue-router'
|
||||
/**
|
||||
* 根据请求,过滤异步路由
|
||||
* @param:menuList 异步路由数组
|
||||
* return 过滤后的异步路由
|
||||
*/
|
||||
// @ts-ignore
|
||||
import Layout from '@/layout/index.vue'
|
||||
/*
|
||||
* 路由操作
|
||||
* */
|
||||
import router, { asyncRoutes, constantRoutes, roleCodeRoutes } from '@/router'
|
||||
//进度条
|
||||
import 'nprogress/nprogress.css'
|
||||
import { useBasicStore } from '@/store/basic'
|
||||
|
||||
const buttonCodes: Array<Number> = [] //按钮权限
|
||||
interface menuRow {
|
||||
category: number
|
||||
code: number
|
||||
children: RouterTypes
|
||||
}
|
||||
export const filterAsyncRoutesByMenuList = (menuList) => {
|
||||
const filterRouter: RouterTypes = []
|
||||
menuList.forEach((route: menuRow) => {
|
||||
//button permission
|
||||
if (route.category === 3) {
|
||||
buttonCodes.push(route.code)
|
||||
} else {
|
||||
//generator every router item by menuList
|
||||
const itemFromReqRouter = getRouteItemFromReqRouter(route)
|
||||
if (route.children?.length) {
|
||||
//judge the type is router or button
|
||||
itemFromReqRouter.children = filterAsyncRoutesByMenuList(route.children)
|
||||
}
|
||||
filterRouter.push(itemFromReqRouter)
|
||||
}
|
||||
})
|
||||
return filterRouter
|
||||
}
|
||||
const getRouteItemFromReqRouter = (route): RouteRawConfig => {
|
||||
const tmp: rawConfig = { meta: { title: '' } }
|
||||
const routeKeyArr = ['path', 'component', 'redirect', 'alwaysShow', 'name', 'hidden']
|
||||
const metaKeyArr = ['title', 'activeMenu', 'elSvgIcon', 'icon']
|
||||
// @ts-ignore
|
||||
const modules = import.meta.glob('../views/**/**.vue')
|
||||
//generator routeKey
|
||||
routeKeyArr.forEach((fItem) => {
|
||||
if (fItem === 'component') {
|
||||
if (route[fItem] === 'Layout') {
|
||||
tmp[fItem] = Layout
|
||||
} else {
|
||||
//has error , i will fix it through plugins
|
||||
//tmp[fItem] = () => import(`@/views/permission-center/test/TestTableQuery.vue`)
|
||||
tmp[fItem] = modules[`../views/${route[fItem]}`]
|
||||
}
|
||||
} else if (fItem === 'path' && route.parentId === 0) {
|
||||
tmp[fItem] = `/${route[fItem]}`
|
||||
} else if (['hidden', 'alwaysShow'].includes(fItem)) {
|
||||
tmp[fItem] = !!route[fItem]
|
||||
} else if (['name'].includes(fItem)) {
|
||||
tmp[fItem] = route['code']
|
||||
} else if (route[fItem]) {
|
||||
tmp[fItem] = route[fItem]
|
||||
}
|
||||
})
|
||||
//generator metaKey
|
||||
metaKeyArr.forEach((fItem) => {
|
||||
if (route[fItem] && tmp.meta) tmp.meta[fItem] = route[fItem]
|
||||
})
|
||||
//route extra insert
|
||||
if (route.extra) {
|
||||
Object.entries(route.extra.parse(route.extra)).forEach(([key, value]) => {
|
||||
if (key === 'meta' && tmp.meta) {
|
||||
tmp.meta[key] = value
|
||||
} else {
|
||||
tmp[key] = value
|
||||
}
|
||||
})
|
||||
}
|
||||
return tmp as RouteRawConfig
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色数组过滤异步路由
|
||||
* @param routes asyncRoutes 未过滤的异步路由
|
||||
* @param roles 角色数组
|
||||
* return 过滤后的异步路由
|
||||
*/
|
||||
export function filterAsyncRoutesByRoles(routes, roles) {
|
||||
const res: RouterTypes = []
|
||||
routes.forEach((route) => {
|
||||
const tmp: RouteRawConfig = { ...route }
|
||||
if (hasPermission(roles, tmp)) {
|
||||
if (tmp.children) {
|
||||
tmp.children = filterAsyncRoutesByRoles(tmp.children, roles)
|
||||
}
|
||||
res.push(tmp)
|
||||
}
|
||||
})
|
||||
return res
|
||||
}
|
||||
function hasPermission(roles, route) {
|
||||
if (route?.meta?.roles) {
|
||||
return roles?.some((role) => route.meta.roles.includes(role))
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code数组,过滤异步路由
|
||||
* @param codes code数组
|
||||
* @param codesRoutes 未过滤的异步路由
|
||||
* return 过滤后的异步路由
|
||||
*/
|
||||
export function filterAsyncRouterByCodes(codesRoutes, codes) {
|
||||
const filterRouter: RouterTypes = []
|
||||
codesRoutes.forEach((routeItem: RouteRawConfig) => {
|
||||
if (hasCodePermission(codes, routeItem)) {
|
||||
if (routeItem.children) routeItem.children = filterAsyncRouterByCodes(routeItem.children, codes)
|
||||
filterRouter.push(routeItem)
|
||||
}
|
||||
})
|
||||
return filterRouter
|
||||
}
|
||||
function hasCodePermission(codes, routeItem) {
|
||||
if (routeItem.meta?.code) {
|
||||
return codes.includes(routeItem.meta.code) || routeItem.hidden
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
//过滤异步路由
|
||||
export function filterAsyncRouter({ menuList, roles, codes }) {
|
||||
const basicStore = useBasicStore()
|
||||
let accessRoutes: RouterTypes = []
|
||||
const permissionMode = basicStore.settings?.permissionMode
|
||||
if (permissionMode === 'rbac') {
|
||||
accessRoutes = filterAsyncRoutesByMenuList(menuList) //by menuList
|
||||
} else if (permissionMode === 'roles') {
|
||||
accessRoutes = filterAsyncRoutesByRoles(roleCodeRoutes, roles) //by roles
|
||||
} else {
|
||||
accessRoutes = filterAsyncRouterByCodes(roleCodeRoutes, codes) //by codes
|
||||
}
|
||||
accessRoutes.forEach((route) => router.addRoute(route))
|
||||
asyncRoutes.forEach((item) => router.addRoute(item))
|
||||
basicStore.setFilterAsyncRoutes(accessRoutes)
|
||||
}
|
||||
//重置路由
|
||||
export function resetRouter() {
|
||||
//移除之前存在的路由
|
||||
const routeNameSet: Set<RouteRecordName> = new Set()
|
||||
router.getRoutes().forEach((fItem) => {
|
||||
if (fItem.name) routeNameSet.add(fItem.name)
|
||||
})
|
||||
routeNameSet.forEach((setItem) => router.removeRoute(setItem))
|
||||
//新增constantRoutes
|
||||
constantRoutes.forEach((feItem) => router.addRoute(feItem))
|
||||
}
|
||||
//重置登录状态
|
||||
export function resetState() {
|
||||
resetRouter()
|
||||
useBasicStore().resetState()
|
||||
}
|
||||
|
||||
//刷新路由
|
||||
export function freshRouter(data) {
|
||||
resetRouter()
|
||||
filterAsyncRouter(data)
|
||||
// location.reload()
|
||||
}
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
//开始进度条
|
||||
export const progressStart = () => {
|
||||
NProgress.start()
|
||||
}
|
||||
//关闭进度条
|
||||
export const progressClose = () => {
|
||||
NProgress.done()
|
||||
}
|
43
src/hooks/use-self-router.ts
Normal file
|
@ -0,0 +1,43 @@
|
|||
import router from '@/router'
|
||||
export const getQueryParam = () => {
|
||||
const route: any = router.currentRoute
|
||||
if (route.value?.query.params) {
|
||||
return JSON.parse(route.value.query.params)
|
||||
}
|
||||
}
|
||||
// vue router
|
||||
export const routerPush = (name, params) => {
|
||||
let data = {}
|
||||
if (params) {
|
||||
data = {
|
||||
params: JSON.stringify(params)
|
||||
}
|
||||
} else {
|
||||
data = {}
|
||||
}
|
||||
router.push({
|
||||
name,
|
||||
query: data
|
||||
})
|
||||
}
|
||||
export const routerReplace = (name, params) => {
|
||||
let data = {}
|
||||
if (params) {
|
||||
data = {
|
||||
params: JSON.stringify(params)
|
||||
}
|
||||
} else {
|
||||
data = {}
|
||||
}
|
||||
router.replace({
|
||||
name,
|
||||
query: data
|
||||
})
|
||||
}
|
||||
|
||||
export const routeInfo = () => {
|
||||
return router.currentRoute
|
||||
}
|
||||
export const routerBack = () => {
|
||||
router.go(-1)
|
||||
}
|
122
src/hooks/use-table.ts
Normal file
|
@ -0,0 +1,122 @@
|
|||
import { ref } from 'vue'
|
||||
import momentMini from 'moment-mini'
|
||||
import { elConfirm, elMessage } from './use-element'
|
||||
export const useTable = (searchForm, selectPageReq) => {
|
||||
/*define ref*/
|
||||
const tableListData = ref([])
|
||||
const totalPage = ref(0)
|
||||
const pageNum = ref(1)
|
||||
const pageSize = ref(20)
|
||||
|
||||
//列表请求
|
||||
const tableListReq = (config) => {
|
||||
const data = Object.assign(
|
||||
{
|
||||
pageNum: pageNum.value,
|
||||
pageSize: pageSize.value
|
||||
},
|
||||
JSON.parse(JSON.stringify(searchForm))
|
||||
)
|
||||
Object.keys(data).forEach((fItem) => {
|
||||
if (['', null, undefined, Number.NaN].includes(data[fItem])) delete data[fItem]
|
||||
if (config.method === 'get') {
|
||||
if (Array.isArray(data[fItem])) delete data[fItem]
|
||||
if (data[fItem] instanceof Object) delete data[fItem]
|
||||
}
|
||||
})
|
||||
const reqConfig = {
|
||||
data,
|
||||
...config
|
||||
}
|
||||
return axiosReq(reqConfig)
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期范围选择处理
|
||||
* @param timeArr choose the time
|
||||
* @author 熊猫哥
|
||||
* @date 2022/9/25 14:02
|
||||
*/
|
||||
const dateRangePacking = (timeArr) => {
|
||||
if (timeArr && timeArr.length === 2) {
|
||||
searchForm.startTime = timeArr[0]
|
||||
//取今天23点
|
||||
if (searchForm.endTime) {
|
||||
searchForm.endTime = momentMini(timeArr[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
} else {
|
||||
searchForm.startTime = ''
|
||||
searchForm.endTime = ''
|
||||
}
|
||||
}
|
||||
//当前页
|
||||
const handleCurrentChange = (val) => {
|
||||
pageNum.value = val
|
||||
selectPageReq()
|
||||
}
|
||||
const handleSizeChange = (val) => {
|
||||
pageSize.value = val
|
||||
selectPageReq()
|
||||
}
|
||||
const resetPageReq = () => {
|
||||
pageNum.value = 1
|
||||
selectPageReq()
|
||||
}
|
||||
|
||||
/*多选*/
|
||||
const multipleSelection = ref<Array<ObjKeys>>([])
|
||||
const handleSelectionChange = (val) => {
|
||||
multipleSelection.value = val
|
||||
}
|
||||
/*批量删除*/
|
||||
const multiDelBtnDill = (reqConfig) => {
|
||||
let rowDeleteIdArr: Array<string> = []
|
||||
let deleteNameTitle = ''
|
||||
rowDeleteIdArr = multipleSelection.value.map((mItem) => {
|
||||
deleteNameTitle = `${deleteNameTitle + mItem.id},`
|
||||
return mItem.id
|
||||
})
|
||||
if (rowDeleteIdArr.length === 0) {
|
||||
elMessage('表格选项不能为空', 'warning')
|
||||
return
|
||||
}
|
||||
const stringLength = deleteNameTitle.length - 1
|
||||
elConfirm('删除', `您确定要删除【${deleteNameTitle.slice(0, stringLength)}】吗`).then(() => {
|
||||
const data = rowDeleteIdArr
|
||||
axiosReq({
|
||||
data,
|
||||
method: 'DELETE',
|
||||
bfLoading: true,
|
||||
...reqConfig
|
||||
}).then(() => {
|
||||
elMessage('删除成功')
|
||||
resetPageReq()
|
||||
})
|
||||
})
|
||||
}
|
||||
//单个删除
|
||||
const tableDelDill = (row, reqConfig) => {
|
||||
elConfirm('确定', `您确定要删除【${row.id}】吗?`).then(() => {
|
||||
axiosReq(reqConfig).then(() => {
|
||||
resetPageReq()
|
||||
elMessage(`【${row.id}】删除成功`)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
pageNum,
|
||||
pageSize,
|
||||
totalPage,
|
||||
tableListData,
|
||||
tableListReq,
|
||||
dateRangePacking,
|
||||
multipleSelection,
|
||||
handleSelectionChange,
|
||||
handleCurrentChange,
|
||||
handleSizeChange,
|
||||
resetPageReq,
|
||||
multiDelBtnDill,
|
||||
tableDelDill
|
||||
}
|
||||
}
|
45
src/icons/SvgIcon.vue
Normal file
|
@ -0,0 +1,45 @@
|
|||
<template>
|
||||
<svg :class="svgClass" aria-hidden="true">
|
||||
<use :xlink:href="iconName" />
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, defineComponent } from 'vue'
|
||||
const props = defineProps({
|
||||
iconClass: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
className: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
const iconName = computed(() => `#icon-${props.iconClass}`)
|
||||
const svgClass = computed(() => {
|
||||
if (props.className) {
|
||||
return `svg-icon ${props.className}`
|
||||
}
|
||||
return 'svg-icon'
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.sub-el-icon,
|
||||
.nav-icon {
|
||||
display: inline-block;
|
||||
font-size: 15px;
|
||||
margin-right: 12px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.svg-icon {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
position: relative;
|
||||
fill: currentColor;
|
||||
vertical-align: -2px;
|
||||
}
|
||||
</style>
|
0
src/icons/common/404.svg
Normal file
1
src/icons/common/bug.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M127.88 73.143c0 1.412-.506 2.635-1.518 3.669-1.011 1.033-2.209 1.55-3.592 1.55h-17.887c0 9.296-1.783 17.178-5.35 23.645l16.609 17.044c1.011 1.034 1.517 2.257 1.517 3.67 0 1.412-.506 2.635-1.517 3.668-.958 1.033-2.155 1.55-3.593 1.55-1.438 0-2.635-.517-3.593-1.55l-15.811-16.063a15.49 15.49 0 0 1-1.196 1.06c-.532.434-1.65 1.208-3.353 2.322a50.104 50.104 0 0 1-5.192 2.974c-1.758.87-3.94 1.658-6.546 2.364-2.607.706-5.189 1.06-7.748 1.06V47.044H58.89v73.062c-2.716 0-5.417-.367-8.106-1.102-2.688-.734-5.003-1.631-6.945-2.692a66.769 66.769 0 0 1-5.268-3.179c-1.571-1.057-2.73-1.94-3.476-2.65L33.9 109.34l-14.611 16.877c-1.066 1.14-2.344 1.711-3.833 1.711-1.277 0-2.422-.434-3.434-1.304-1.012-.978-1.557-2.187-1.635-3.627-.079-1.44.333-2.705 1.236-3.794l16.129-18.51c-3.087-6.197-4.63-13.644-4.63-22.342H5.235c-1.383 0-2.58-.517-3.592-1.55S.125 74.545.125 73.132c0-1.412.506-2.635 1.518-3.668 1.012-1.034 2.21-1.55 3.592-1.55h17.887V43.939L9.308 29.833c-1.012-1.033-1.517-2.256-1.517-3.669 0-1.412.505-2.635 1.517-3.668 1.012-1.034 2.21-1.55 3.593-1.55s2.58.516 3.593 1.55l13.813 14.106h67.396l13.814-14.106c1.012-1.034 2.21-1.55 3.592-1.55 1.384 0 2.581.516 3.593 1.55 1.012 1.033 1.518 2.256 1.518 3.668 0 1.413-.506 2.636-1.518 3.67l-13.814 14.105v23.975h17.887c1.383 0 2.58.516 3.593 1.55 1.011 1.033 1.517 2.256 1.517 3.668l-.005.01zM89.552 26.175H38.448c0-7.23 2.489-13.386 7.466-18.469C50.892 2.623 56.92.082 64 .082c7.08 0 13.108 2.541 18.086 7.624 4.977 5.083 7.466 11.24 7.466 18.469z"/></svg>
|
After Width: | Height: | Size: 1.5 KiB |
1
src/icons/common/chart.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 54.857h36.571V128H0V54.857zM91.429 27.43H128V128H91.429V27.429zM45.714 0h36.572v128H45.714V0z"/></svg>
|
After Width: | Height: | Size: 179 B |
1
src/icons/common/clipboard.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M54.857 118.857h64V73.143H89.143c-1.902 0-3.52-.668-4.855-2.002-1.335-1.335-2.002-2.954-2.002-4.855V36.57H54.857v82.286zM73.143 16v-4.571a2.2 2.2 0 0 0-.677-1.61 2.198 2.198 0 0 0-1.609-.676H20.571c-.621 0-1.158.225-1.609.676a2.198 2.198 0 0 0-.676 1.61V16a2.2 2.2 0 0 0 .676 1.61c.451.45.988.676 1.61.676h50.285c.622 0 1.158-.226 1.61-.677.45-.45.676-.987.676-1.609zm18.286 48h21.357L91.43 42.642V64zM128 73.143v48c0 1.902-.667 3.52-2.002 4.855-1.335 1.335-2.953 2.002-4.855 2.002H52.57c-1.901 0-3.52-.667-4.854-2.002-1.335-1.335-2.003-2.953-2.003-4.855v-11.429H6.857c-1.902 0-3.52-.667-4.855-2.002C.667 106.377 0 104.759 0 102.857v-96c0-1.902.667-3.52 2.002-4.855C3.337.667 4.955 0 6.857 0h77.714c1.902 0 3.52.667 4.855 2.002 1.335 1.335 2.003 2.953 2.003 4.855V30.29c1 .622 1.856 1.29 2.569 2.003l29.147 29.147c1.335 1.335 2.478 3.145 3.429 5.43.95 2.287 1.426 4.383 1.426 6.291v-.018z"/></svg>
|
After Width: | Height: | Size: 971 B |
1
src/icons/common/component.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h54.857v54.857H0V0zm0 73.143h54.857V128H0V73.143zm73.143 0H128V128H73.143V73.143zm27.428-18.286C115.72 54.857 128 42.577 128 27.43 128 12.28 115.72 0 100.571 0 85.423 0 73.143 12.28 73.143 27.429c0 15.148 12.28 27.428 27.428 27.428z"/></svg>
|
After Width: | Height: | Size: 319 B |
1
src/icons/common/dashboard.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M27.429 63.638c0-2.508-.893-4.65-2.679-6.424-1.786-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.465 2.662-1.785 1.774-2.678 3.916-2.678 6.424 0 2.508.893 4.65 2.678 6.424 1.786 1.775 3.94 2.662 6.465 2.662 2.524 0 4.678-.887 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zm13.714-31.801c0-2.508-.893-4.65-2.679-6.424-1.785-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zM71.714 65.98l7.215-27.116c.285-1.23.107-2.378-.536-3.443-.643-1.064-1.56-1.762-2.75-2.094-1.19-.33-2.333-.177-3.429.462-1.095.639-1.81 1.573-2.143 2.804l-7.214 27.116c-2.857.237-5.405 1.266-7.643 3.088-2.238 1.822-3.738 4.152-4.5 6.992-.952 3.644-.476 7.098 1.429 10.364 1.905 3.265 4.69 5.37 8.357 6.317 3.667.947 7.143.474 10.429-1.42 3.285-1.892 5.404-4.66 6.357-8.305.762-2.84.619-5.607-.429-8.305-1.047-2.697-2.762-4.85-5.143-6.46zm47.143-2.342c0-2.508-.893-4.65-2.678-6.424-1.786-1.775-3.94-2.662-6.465-2.662-2.524 0-4.678.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.786 1.775 3.94 2.662 6.464 2.662 2.524 0 4.679-.887 6.465-2.662 1.785-1.775 2.678-3.916 2.678-6.424zm-45.714-45.43c0-2.509-.893-4.65-2.679-6.425C68.68 10.01 66.524 9.122 64 9.122c-2.524 0-4.679.887-6.464 2.661-1.786 1.775-2.679 3.916-2.679 6.425 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zm32 13.629c0-2.508-.893-4.65-2.679-6.424-1.785-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zM128 63.638c0 12.351-3.357 23.78-10.071 34.286-.905 1.372-2.19 2.058-3.858 2.058H13.93c-1.667 0-2.953-.686-3.858-2.058C3.357 87.465 0 76.037 0 63.638c0-8.613 1.69-16.847 5.071-24.703C8.452 31.08 13 24.312 18.714 18.634c5.715-5.68 12.524-10.199 20.429-13.559C47.048 1.715 55.333.035 64 .035c8.667 0 16.952 1.68 24.857 5.04 7.905 3.36 14.714 7.88 20.429 13.559 5.714 5.678 10.262 12.446 13.643 20.301 3.38 7.856 5.071 16.09 5.071 24.703z"/></svg>
|
After Width: | Height: | Size: 2.3 KiB |
1
src/icons/common/demo.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M127.88 73.143c0 1.412-.506 2.635-1.518 3.669-1.011 1.033-2.209 1.55-3.592 1.55h-17.887c0 9.296-1.783 17.178-5.35 23.645l16.609 17.044c1.011 1.034 1.517 2.257 1.517 3.67 0 1.412-.506 2.635-1.517 3.668-.958 1.033-2.155 1.55-3.593 1.55-1.438 0-2.635-.517-3.593-1.55l-15.811-16.063a15.49 15.49 0 0 1-1.196 1.06c-.532.434-1.65 1.208-3.353 2.322a50.104 50.104 0 0 1-5.192 2.974c-1.758.87-3.94 1.658-6.546 2.364-2.607.706-5.189 1.06-7.748 1.06V47.044H58.89v73.062c-2.716 0-5.417-.367-8.106-1.102-2.688-.734-5.003-1.631-6.945-2.692a66.769 66.769 0 0 1-5.268-3.179c-1.571-1.057-2.73-1.94-3.476-2.65L33.9 109.34l-14.611 16.877c-1.066 1.14-2.344 1.711-3.833 1.711-1.277 0-2.422-.434-3.434-1.304-1.012-.978-1.557-2.187-1.635-3.627-.079-1.44.333-2.705 1.236-3.794l16.129-18.51c-3.087-6.197-4.63-13.644-4.63-22.342H5.235c-1.383 0-2.58-.517-3.592-1.55S.125 74.545.125 73.132c0-1.412.506-2.635 1.518-3.668 1.012-1.034 2.21-1.55 3.592-1.55h17.887V43.939L9.308 29.833c-1.012-1.033-1.517-2.256-1.517-3.669 0-1.412.505-2.635 1.517-3.668 1.012-1.034 2.21-1.55 3.593-1.55s2.58.516 3.593 1.55l13.813 14.106h67.396l13.814-14.106c1.012-1.034 2.21-1.55 3.592-1.55 1.384 0 2.581.516 3.593 1.55 1.012 1.033 1.518 2.256 1.518 3.668 0 1.413-.506 2.636-1.518 3.67l-13.814 14.105v23.975h17.887c1.383 0 2.58.516 3.593 1.55 1.011 1.033 1.517 2.256 1.517 3.668l-.005.01zM89.552 26.175H38.448c0-7.23 2.489-13.386 7.466-18.469C50.892 2.623 56.92.082 64 .082c7.08 0 13.108 2.541 18.086 7.624 4.977 5.083 7.466 11.24 7.466 18.469z"/></svg>
|
After Width: | Height: | Size: 1.5 KiB |
1
src/icons/common/documentation.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M71.984 44.815H115.9L71.984 9.642v35.173zM16.094.05h63.875l47.906 38.37v76.74c0 3.392-1.682 6.645-4.677 9.044-2.995 2.399-7.056 3.746-11.292 3.746H16.094c-4.236 0-8.297-1.347-11.292-3.746-2.995-2.399-4.677-5.652-4.677-9.044V12.84C.125 5.742 7.23.05 16.094.05zm71.86 102.32V89.58h-71.86v12.79h71.86zm23.952-25.58V64H16.094v12.79h95.812z"/></svg>
|
After Width: | Height: | Size: 418 B |
1
src/icons/common/drag.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M73.137 29.08h-9.209 29.7L63.886.093 34.373 29.08h20.49v27.035H27.238v17.948h27.625v27.133h18.274V74.063h27.41V56.115h-27.41V29.08zm-9.245 98.827l27.518-26.711H36.59l27.302 26.71zM.042 64.982l27.196 27.029V38.167L.042 64.982zm100.505-26.815V92.01l27.41-27.029-27.41-26.815z"/></svg>
|
After Width: | Height: | Size: 356 B |
1
src/icons/common/edit.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M106.133 67.2a4.797 4.797 0 0 0-4.8 4.8c0 .187.014.36.027.533h-.027V118.4H9.6V26.667h50.133c2.654 0 4.8-2.147 4.8-4.8 0-2.654-2.146-4.8-4.8-4.8H9.6a9.594 9.594 0 0 0-9.6 9.6V118.4c0 5.307 4.293 9.6 9.6 9.6h91.733c5.307 0 9.6-4.293 9.6-9.6V72.533h-.026c.013-.173.026-.346.026-.533 0-2.653-2.146-4.8-4.8-4.8z"/><path d="M125.16 13.373L114.587 2.8c-3.747-3.747-9.854-3.72-13.6.027l-52.96 52.96a4.264 4.264 0 0 0-.907 1.36L33.813 88.533c-.746 1.76-.226 3.534.907 4.68 1.133 1.147 2.92 1.667 4.693.92l31.4-13.293c.507-.213.96-.52 1.36-.907l52.96-52.96c3.747-3.746 3.774-9.853.027-13.6zM66.107 72.4l-18.32 7.76 7.76-18.32L92.72 24.667l10.56 10.56L66.107 72.4zm52.226-52.227l-8.266 8.267-10.56-10.56 8.266-8.267.027-.026 10.56 10.56-.027.026z"/></svg>
|
After Width: | Height: | Size: 818 B |
1
src/icons/common/education.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M88.883 119.565c-7.284 0-19.434 2.495-21.333 8.25v.127c-4.232.13-5.222 0-7.108 0-1.895-5.76-14.045-8.256-21.333-8.256H0V0h42.523c9.179 0 17.109 5.47 21.47 13.551C68.352 5.475 76.295 0 85.478 0H128v119.57l-39.113-.005h-.004zM60.442 24.763c0-9.651-8.978-16.507-17.777-16.507H7.108V111.43H39.11c7.054-.14 18.177.082 21.333 6.12v-4.628c-.134-5.722-.004-13.522 0-13.832V27.413l.004-2.655-.004.005zm60.442-16.517h-35.55c-8.802 0-17.78 6.856-17.78 16.493v74.259c.004.32.138 8.115 0 13.813v4.627c3.155-6.022 14.279-6.26 21.333-6.114h32V8.25l-.003-.005z"/></svg>
|
After Width: | Height: | Size: 627 B |
1
src/icons/common/email.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="96" xmlns="http://www.w3.org/2000/svg"><path d="M64.125 56.975L120.188.912A12.476 12.476 0 0 0 115.5 0h-103c-1.588 0-3.113.3-4.513.838l56.138 56.137z"/><path d="M64.125 68.287l-62.3-62.3A12.42 12.42 0 0 0 0 12.5v71C0 90.4 5.6 96 12.5 96h103c6.9 0 12.5-5.6 12.5-12.5v-71a12.47 12.47 0 0 0-1.737-6.35L64.125 68.287z"/></svg>
|
After Width: | Height: | Size: 347 B |
1
src/icons/common/example.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M96.258 57.462h31.421C124.794 27.323 100.426 2.956 70.287.07v31.422a32.856 32.856 0 0 1 25.971 25.97zm-38.796-25.97V.07C27.323 2.956 2.956 27.323.07 57.462h31.422a32.856 32.856 0 0 1 25.97-25.97zm12.825 64.766v31.421c30.46-2.885 54.507-27.253 57.713-57.712H96.579c-2.886 13.466-13.146 23.726-26.292 26.291zM31.492 70.287H.07c2.886 30.46 27.253 54.507 57.713 57.713V96.579c-13.466-2.886-23.726-13.146-26.291-26.292z"/></svg>
|
After Width: | Height: | Size: 497 B |
1
src/icons/common/excel.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M78.208 16.576v8.384h38.72v5.376h-38.72v8.704h38.72v5.376h-38.72v8.576h38.72v5.376h-38.72v8.576h38.72v5.376h-38.72v8.576h38.72v5.376h-38.72v8.512h38.72v5.376h-38.72v11.136H128v-94.72H78.208zM0 114.368L72.128 128V0L0 13.632v100.736z"/><path d="M28.672 82.56h-11.2l14.784-23.488-14.08-22.592h11.52l8.192 14.976 8.448-14.976h11.136l-14.08 22.208L58.368 82.56H46.656l-8.768-15.68z"/></svg>
|
After Width: | Height: | Size: 459 B |
1
src/icons/common/exit-fullscreen.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M49.217 41.329l-.136-35.24c-.06-2.715-2.302-4.345-5.022-4.405h-3.65c-2.712-.06-4.866 2.303-4.806 5.016l.152 19.164-24.151-23.79a6.698 6.698 0 0 0-9.499 0 6.76 6.76 0 0 0 0 9.526l23.93 23.713-18.345.074c-2.712-.069-5.228 1.813-5.64 5.02v3.462c.069 2.721 2.31 4.97 5.022 5.03l35.028-.207c.052.005.087.025.133.025l2.457.054a4.626 4.626 0 0 0 3.436-1.38c.88-.874 1.205-2.096 1.169-3.462l-.262-2.465c0-.048.182-.081.182-.136h.002zm52.523 51.212l18.32-.073c2.713.06 5.224-1.609 5.64-4.815v-3.462c-.068-2.722-2.317-4.97-5.021-5.04l-34.58.21c-.053 0-.086-.021-.138-.021l-2.451-.06a4.64 4.64 0 0 0-3.445 1.381c-.885.868-1.201 2.094-1.174 3.46l.27 2.46c.005.06-.177.095-.177.141l.141 34.697c.069 2.713 2.31 4.338 5.022 4.397l3.45.006c2.705.062 4.867-2.31 4.8-5.026l-.153-18.752 24.151 23.946a6.69 6.69 0 0 0 9.494 0 6.747 6.747 0 0 0 0-9.523L101.74 92.54v.001zM48.125 80.662a4.636 4.636 0 0 0-3.437-1.382l-2.457.06c-.05 0-.082.022-.137.022l-35.025-.21c-2.712.07-4.957 2.318-5.022 5.04v3.462c.409 3.206 2.925 4.874 5.633 4.814l18.554.06-24.132 23.928c-2.62 2.626-2.62 6.89 0 9.524a6.694 6.694 0 0 0 9.496 0l24.155-23.79-.155 18.866c-.06 2.722 2.094 5.093 4.801 5.025h3.65c2.72-.069 4.962-1.685 5.022-4.406l.141-34.956c0-.05-.182-.082-.182-.136l.262-2.46c.03-1.366-.286-2.592-1.166-3.46h-.001zM80.08 47.397a4.62 4.62 0 0 0 3.443 1.374l2.45-.054c.055 0 .088-.02.143-.028l35.08.21c2.712-.062 4.953-2.312 5.021-5.033l.009-3.463c-.417-3.211-2.937-5.084-5.64-5.025l-18.615-.073 23.917-23.715c2.63-2.623 2.63-6.879.008-9.513a6.691 6.691 0 0 0-9.494 0L92.251 26.016l.155-19.312c.065-2.713-2.097-5.085-4.802-5.025h-3.45c-2.713.069-4.954 1.693-5.022 4.406l-.139 35.247c0 .054.18.088.18.136l-.267 2.465c-.028 1.366.288 2.588 1.174 3.463v.001z"/></svg>
|
After Width: | Height: | Size: 1.8 KiB |
1
src/icons/common/eye-open.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><defs><style/></defs><path d="M512 128q69.675 0 135.51 21.163t115.498 54.997 93.483 74.837 73.685 82.006 51.67 74.837 32.17 54.827L1024 512q-2.347 4.992-6.315 13.483T998.87 560.17t-31.658 51.669-44.331 59.99-56.832 64.34-69.504 60.16-82.347 51.5-94.848 34.687T512 896q-69.675 0-135.51-21.163t-115.498-54.826-93.483-74.326-73.685-81.493-51.67-74.496-32.17-54.997L0 513.707q2.347-4.992 6.315-13.483t18.816-34.816 31.658-51.84 44.331-60.33 56.832-64.683 69.504-60.331 82.347-51.84 94.848-34.816T512 128.085zm0 85.333q-46.677 0-91.648 12.331t-81.152 31.83-70.656 47.146-59.648 54.485-48.853 57.686-37.675 52.821-26.325 43.99q12.33 21.674 26.325 43.52t37.675 52.351 48.853 57.003 59.648 53.845T339.2 767.02t81.152 31.488T512 810.667t91.648-12.331 81.152-31.659 70.656-46.848 59.648-54.186 48.853-57.344 37.675-52.651T927.957 512q-12.33-21.675-26.325-43.648t-37.675-52.65-48.853-57.345-59.648-54.186-70.656-46.848-81.152-31.659T512 213.334zm0 128q70.656 0 120.661 50.006T682.667 512 632.66 632.661 512 682.667 391.339 632.66 341.333 512t50.006-120.661T512 341.333zm0 85.334q-35.328 0-60.33 25.002T426.666 512t25.002 60.33T512 597.334t60.33-25.002T597.334 512t-25.002-60.33T512 426.666z"/></svg>
|
After Width: | Height: | Size: 1.3 KiB |
1
src/icons/common/eye.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="64" xmlns="http://www.w3.org/2000/svg"><path d="M127.072 7.994c1.37-2.208.914-5.152-.914-6.87-2.056-1.717-4.797-1.226-6.396.982-.229.245-25.586 32.382-55.74 32.382-29.24 0-55.74-32.382-55.968-32.627-1.6-1.963-4.57-2.208-6.397-.49C-.17 3.086-.399 6.275 1.2 8.238c.457.736 5.94 7.36 14.62 14.72L4.17 35.96c-1.828 1.963-1.6 5.152.228 6.87.457.98 1.6 1.471 2.742 1.471s2.284-.49 3.198-1.472l12.564-13.983c5.94 4.416 13.021 8.587 20.788 11.53l-4.797 17.418c-.685 2.699.686 5.397 3.198 6.133h1.37c2.057 0 3.884-1.472 4.341-3.68L52.6 42.83c3.655.736 7.538 1.227 11.422 1.227 3.883 0 7.767-.49 11.422-1.227l4.797 17.173c.457 2.208 2.513 3.68 4.34 3.68.457 0 .914 0 1.143-.246 2.513-.736 3.883-3.434 3.198-6.133l-4.797-17.172c7.767-2.944 14.848-7.114 20.788-11.53l12.336 13.738c.913.981 2.056 1.472 3.198 1.472s2.284-.49 3.198-1.472c1.828-1.963 1.828-4.906.228-6.87l-11.65-13.001c9.366-7.36 14.849-14.474 14.849-14.474z"/></svg>
|
After Width: | Height: | Size: 944 B |
1
src/icons/common/form.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M84.068 23.784c-1.02 0-1.877-.32-2.572-.96a8.588 8.588 0 0 1-1.738-2.237 11.524 11.524 0 0 1-1.042-2.621c-.232-.895-.348-1.641-.348-2.238V0h.278c.834 0 1.622.085 2.363.256.742.17 1.645.575 2.711 1.214 1.066.64 2.363 1.535 3.892 2.686 1.53 1.15 3.453 2.664 5.77 4.54 2.502 2.045 4.494 3.771 5.977 5.178 1.483 1.406 2.618 2.6 3.406 3.58.787.98 1.274 1.812 1.46 2.494.185.682.277 1.278.277 1.79v2.046H84.068zM127.3 84.01c.278.682.464 1.535.556 2.558.093 1.023-.37 2.003-1.39 2.94-.463.427-.88.832-1.25 1.215-.372.384-.696.704-.974.96a6.69 6.69 0 0 1-.973.767l-11.816-10.741a44.331 44.331 0 0 0 1.877-1.535 31.028 31.028 0 0 1 1.737-1.406c1.112-.938 2.317-1.343 3.615-1.215 1.297.128 2.363.405 3.197.83.927.427 1.923 1.173 2.989 2.239 1.065 1.065 1.876 2.195 2.432 3.388zM78.23 95.902c2.038 0 3.752-.511 5.143-1.534l-26.969 25.83H18.037c-1.761 0-3.684-.47-5.77-1.407a24.549 24.549 0 0 1-5.838-3.709 21.373 21.373 0 0 1-4.518-5.306c-1.204-2.003-1.807-4.07-1.807-6.202V16.495c0-1.79.44-3.665 1.32-5.626A18.41 18.41 0 0 1 5.04 5.562a21.798 21.798 0 0 1 5.213-3.964C12.198.533 14.237 0 16.37 0h53.24v15.984c0 1.62.278 3.367.834 5.242a16.704 16.704 0 0 0 2.572 5.179c1.159 1.577 2.665 2.898 4.518 3.964 1.853 1.066 4.078 1.598 6.673 1.598h20.295v42.325L85.458 92.45c1.02-1.364 1.529-2.856 1.529-4.476 0-2.216-.857-4.113-2.572-5.69-1.714-1.577-3.776-2.366-6.186-2.366H26.1c-2.409 0-4.448.789-6.116 2.366-1.668 1.577-2.502 3.474-2.502 5.69 0 2.217.834 4.092 2.502 5.626 1.668 1.535 3.707 2.302 6.117 2.302h52.13zM26.1 47.951c-2.41 0-4.449.789-6.117 2.366-1.668 1.577-2.502 3.473-2.502 5.69 0 2.216.834 4.092 2.502 5.626 1.668 1.534 3.707 2.302 6.117 2.302h52.13c2.409 0 4.47-.768 6.185-2.302 1.715-1.534 2.572-3.41 2.572-5.626 0-2.217-.857-4.113-2.572-5.69-1.714-1.577-3.776-2.366-6.186-2.366H26.1zm52.407 64.063l1.807-1.663 3.476-3.196a479.75 479.75 0 0 0 4.587-4.284 500.757 500.757 0 0 1 5.004-4.667c3.985-3.666 8.48-7.758 13.485-12.276l11.677 10.741-13.485 12.404-5.004 4.603-4.587 4.22a179.46 179.46 0 0 0-3.267 3.068c-.88.853-1.367 1.322-1.46 1.407-.463.341-.973.703-1.529 1.087-.556.383-1.112.703-1.668.959-.556.256-1.413.575-2.572.959a83.5 83.5 0 0 1-3.545 1.087 72.2 72.2 0 0 1-3.475.895c-1.112.256-1.946.426-2.502.511-1.112.17-1.854.043-2.224-.383-.371-.426-.464-1.151-.278-2.174.092-.511.278-1.279.556-2.302.278-1.023.602-2.067.973-3.132l1.042-3.005c.325-.938.58-1.577.765-1.918a10.157 10.157 0 0 1 2.224-2.941z"/></svg>
|
After Width: | Height: | Size: 2.4 KiB |
1
src/icons/common/fullscreen.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M38.47 52L52 38.462l-23.648-23.67L43.209 0H.035L0 43.137l14.757-14.865L38.47 52zm74.773 47.726L89.526 76 76 89.536l23.648 23.672L84.795 128h43.174L128 84.863l-14.757 14.863zM89.538 52l23.668-23.648L128 43.207V.038L84.866 0 99.73 14.76 76 38.472 89.538 52zM38.46 76L14.792 99.651 0 84.794v43.173l43.137.033-14.865-14.757L52 89.53 38.46 76z"/></svg>
|
After Width: | Height: | Size: 421 B |
1
src/icons/common/guide.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M1.482 70.131l36.204 16.18 69.932-65.485-61.38 70.594 46.435 18.735c1.119.425 2.397-.17 2.797-1.363v-.085L127.998.047 1.322 65.874c-1.12.597-1.519 1.959-1.04 3.151.32.511.72.937 1.2 1.107zm44.676 57.821L64.22 107.26l-18.062-7.834v28.527z"/></svg>
|
After Width: | Height: | Size: 320 B |
2
src/icons/common/hamburger.svg
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1658048166307" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1878" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
|
||||
</style></defs><path d="M408 442h480a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8H408a8 8 0 0 0-8 8v56a8 8 0 0 0 8 8z m-8 204a8 8 0 0 0 8 8h480a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8H408a8 8 0 0 0-8 8v56z m504-486H120a8 8 0 0 0-8 8v56a8 8 0 0 0 8 8h784a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z m0 632H120a8 8 0 0 0-8 8v56a8 8 0 0 0 8 8h784a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8zM142.4 642.1L298.7 519a8.8 8.8 0 0 0 0-13.9L142.4 381.9a8.9 8.9 0 0 0-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" p-id="1879"></path></svg>
|
After Width: | Height: | Size: 1.1 KiB |
1
src/icons/common/icon.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M115.147.062a13 13 0 0 1 4.94.945c1.55.63 2.907 1.526 4.069 2.688a13.148 13.148 0 0 1 2.761 4.069c.678 1.55 1.017 3.245 1.017 5.086v102.3c0 3.681-1.187 6.733-3.56 9.155-2.373 2.422-5.352 3.633-8.937 3.633H12.992c-3.875 0-7-1.26-9.373-3.779-2.373-2.518-3.56-5.667-3.56-9.445V12.704c0-3.39 1.163-6.345 3.488-8.863C5.872 1.32 8.972.062 12.847.062h102.3zM81.434 109.047c1.744 0 3.003-.412 3.778-1.235.775-.824 1.163-1.914 1.163-3.27 0-1.26-.388-2.325-1.163-3.197-.775-.872-2.034-1.307-3.778-1.307H72.57c.097-.194.145-.485.145-.872V27.09h9.01c1.743 0 2.954-.436 3.633-1.308.678-.872 1.017-1.938 1.017-3.197 0-1.26-.34-2.325-1.017-3.197-.679-.872-1.89-1.308-3.633-1.308H46.268c-1.743 0-2.954.436-3.632 1.308-.678.872-1.018 1.938-1.018 3.197 0 1.26.34 2.325 1.018 3.197.678.872 1.889 1.308 3.632 1.308h8.138v72.075c0 .193.024.339.073.436.048.096.072.242.072.436H46.56c-1.744 0-3.003.435-3.778 1.307-.775.872-1.163 1.938-1.163 3.197 0 1.356.388 2.446 1.163 3.27.775.823 2.034 1.235 3.778 1.235h34.875z"/></svg>
|
After Width: | Height: | Size: 1.1 KiB |
1
src/icons/common/international.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M83.287 103.01c-1.57-3.84-6.778-10.414-15.447-19.548-2.327-2.444-2.182-4.306-1.338-9.862v-.64c.553-3.81 1.513-6.05 14.313-8.087 6.516-1.018 8.203 1.57 10.589 5.178l.785 1.193a12.625 12.625 0 0 0 6.43 5.207c1.134.524 2.53 1.164 4.421 2.24 4.596 2.53 4.596 5.41 4.596 11.753v.727a26.91 26.91 0 0 1-5.178 17.454 59.055 59.055 0 0 1-19.025 11.026c3.49-6.546.814-14.313 0-16.553l-.146-.087zM64 5.12a58.502 58.502 0 0 1 25.484 5.818 54.313 54.313 0 0 0-12.859 10.327c-.93 1.28-1.716 2.473-2.472 3.579-2.444 3.694-3.637 5.352-5.818 5.614a25.105 25.105 0 0 1-4.219 0c-4.276-.29-10.094-.64-11.956 4.422-1.193 3.23-1.396 11.956 2.444 16.495.66 1.077.778 2.4.32 3.578a7.01 7.01 0 0 1-2.066 3.229 18.938 18.938 0 0 1-2.909-2.91 18.91 18.91 0 0 0-8.32-6.603c-1.25-.349-2.647-.64-3.985-.93-3.782-.786-8.03-1.688-9.019-3.812a14.895 14.895 0 0 1-.727-5.818 21.935 21.935 0 0 0-1.396-9.25 8.873 8.873 0 0 0-5.557-4.946A58.705 58.705 0 0 1 64 5.12zM0 64c0 35.346 28.654 64 64 64 35.346 0 64-28.654 64-64 0-35.346-28.654-64-64-64C28.654 0 0 28.654 0 64z"/></svg>
|
After Width: | Height: | Size: 1.1 KiB |
1
src/icons/common/language.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M84.742 36.8c2.398 7.2 5.595 12.8 11.19 18.4 4.795-4.8 7.992-11.2 10.39-18.4h-21.58zm-52.748 40h20.78l-10.39-28-10.39 28z"/><path d="M111.916 0H16.009C7.218 0 .025 7.2.025 16v96c0 8.8 7.193 16 15.984 16h95.907c8.791 0 15.984-7.2 15.984-16V16c0-8.8-6.394-16-15.984-16zM72.754 103.2c-1.598 1.6-3.197 1.6-4.795 1.6-.8 0-2.398 0-3.197-.8-.8-.8-1.599 0-1.599-.8s-.799-1.6-1.598-3.2c-.8-1.6-.8-2.4-1.599-4l-3.196-8.8H28.797L25.6 96c-1.598 3.2-2.398 5.6-3.197 7.2-.8 1.6-2.398 1.6-4.795 1.6-1.599 0-3.197-.8-4.796-1.6-1.598-1.6-2.397-2.4-2.397-4 0-.8 0-1.6.799-3.2.8-1.6.8-2.4 1.598-4l17.583-44.8c.8-1.6.8-3.2 1.599-4.8.799-1.6 1.598-3.2 2.397-4 .8-.8 1.599-2.4 3.197-3.2 1.599-.8 3.197-.8 4.796-.8 1.598 0 3.196 0 4.795.8 1.598.8 2.398 1.6 3.197 3.2.799.8 1.598 2.4 2.397 4 .8 1.6 1.599 3.2 2.398 5.6l17.583 44c1.598 3.2 2.398 5.6 2.398 7.2-.8.8-1.599 2.4-2.398 4zM116.711 72c-8.791-3.2-15.185-7.2-20.78-12-5.594 5.6-12.787 9.6-21.579 12l-2.397-4c8.791-2.4 15.984-5.6 21.579-11.2C87.939 51.2 83.144 44 81.545 36h-7.992v-3.2h21.58c-1.6-2.4-3.198-5.6-4.796-8l2.397-.8c1.599 2.4 3.997 5.6 5.595 8.8h19.98v4h-7.992c-2.397 8-6.393 15.2-11.189 20 5.595 4.8 11.988 8.8 20.78 11.2l-3.197 4z"/></svg>
|
After Width: | Height: | Size: 1.2 KiB |
1
src/icons/common/link.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M115.625 127.937H.063V12.375h57.781v12.374H12.438v90.813h90.813V70.156h12.374z"/><path d="M116.426 2.821l8.753 8.753-56.734 56.734-8.753-8.745z"/><path d="M127.893 37.982h-12.375V12.375H88.706V0h39.187z"/></svg>
|
After Width: | Height: | Size: 285 B |
1
src/icons/common/list.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M1.585 12.087c0 6.616 3.974 11.98 8.877 11.98 4.902 0 8.877-5.364 8.877-11.98 0-6.616-3.975-11.98-8.877-11.98-4.903 0-8.877 5.364-8.877 11.98zM125.86.107H35.613c-1.268 0-2.114 1.426-2.114 2.852v18.255c0 1.712 1.057 2.853 2.114 2.853h90.247c1.268 0 2.114-1.426 2.114-2.853V2.96c0-1.711-1.057-2.852-2.114-2.852zM.106 62.86c0 6.615 3.974 11.979 8.876 11.979 4.903 0 8.877-5.364 8.877-11.98 0-6.616-3.974-11.98-8.877-11.98-4.902 0-8.876 5.364-8.876 11.98zM124.17 50.88H33.921c-1.268 0-2.114 1.425-2.114 2.851v18.256c0 1.711 1.057 2.852 2.114 2.852h90.247c1.268 0 2.114-1.426 2.114-2.852V53.73c0-1.426-.846-2.852-2.114-2.852zM.106 115.913c0 6.616 3.974 11.98 8.876 11.98 4.903 0 8.877-5.364 8.877-11.98 0-6.616-3.974-11.98-8.877-11.98-4.902 0-8.876 5.364-8.876 11.98zm124.064-11.98H33.921c-1.268 0-2.114 1.426-2.114 2.853v18.255c0 1.711 1.057 2.852 2.114 2.852h90.247c1.268 0 2.114-1.426 2.114-2.852v-18.255c0-1.427-.846-2.853-2.114-2.853z"/></svg>
|
After Width: | Height: | Size: 1017 B |
1
src/icons/common/lock.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M119.88 49.674h-7.987V39.52C111.893 17.738 90.45.08 63.996.08 37.543.08 16.1 17.738 16.1 39.52v10.154H8.113c-4.408 0-7.987 2.94-7.987 6.577v65.13c0 3.637 3.57 6.577 7.987 6.577H119.88c4.407 0 7.987-2.94 7.987-6.577v-65.13c-.008-3.636-3.58-6.577-7.987-6.577zm-23.953 0H32.065V39.52c0-14.524 14.301-26.295 31.931-26.295 17.63 0 31.932 11.777 31.932 26.295v10.153z"/></svg>
|
After Width: | Height: | Size: 444 B |
1
src/icons/common/message.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 20.967v59.59c0 11.59 8.537 20.966 19.075 20.966h28.613l1 26.477L76.8 101.523h32.125c10.538 0 19.075-9.377 19.075-20.966v-59.59C128 9.377 119.463 0 108.925 0h-89.85C8.538 0 0 9.377 0 20.967zm82.325 33.1c0-5.524 4.013-9.935 9.037-9.935 5.026 0 9.038 4.41 9.038 9.934 0 5.524-4.025 9.934-9.038 9.934-5.024 0-9.037-4.41-9.037-9.934zm-27.613 0c0-5.524 4.013-9.935 9.038-9.935s9.037 4.41 9.037 9.934c0 5.524-4.025 9.934-9.037 9.934-5.025 0-9.038-4.41-9.038-9.934zm-27.1 0c0-5.524 4.013-9.935 9.038-9.935s9.038 4.41 9.038 9.934c0 5.524-4.026 9.934-9.05 9.934-5.013 0-9.025-4.41-9.025-9.934z"/></svg>
|
After Width: | Height: | Size: 669 B |
1
src/icons/common/money.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M54.122 127.892v-28.68H7.513V87.274h46.609v-12.4H7.513v-12.86h38.003L.099 0h22.6l32.556 45.07c3.617 5.144 6.44 9.611 8.487 13.385 1.788-3.05 4.89-7.779 9.301-14.186L103.93 0h24.01L82.385 62.013h38.34v12.862h-46.41v12.4h46.41v11.937h-46.41v28.68H54.123z"/></svg>
|
After Width: | Height: | Size: 335 B |
1
src/icons/common/nested.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M.002 9.2c0 5.044 3.58 9.133 7.998 9.133 4.417 0 7.997-4.089 7.997-9.133 0-5.043-3.58-9.132-7.997-9.132S.002 4.157.002 9.2zM31.997.066h95.981V18.33H31.997V.066zm0 45.669c0 5.044 3.58 9.132 7.998 9.132 4.417 0 7.997-4.088 7.997-9.132 0-3.263-1.524-6.278-3.998-7.91-2.475-1.63-5.524-1.63-7.998 0-2.475 1.632-4 4.647-4 7.91zM63.992 36.6h63.986v18.265H63.992V36.6zm-31.995 82.2c0 5.043 3.58 9.132 7.998 9.132 4.417 0 7.997-4.089 7.997-9.132 0-5.044-3.58-9.133-7.997-9.133s-7.998 4.089-7.998 9.133zm31.995-9.131h63.986v18.265H63.992V109.67zm0-27.404c0 5.044 3.58 9.133 7.998 9.133 4.417 0 7.997-4.089 7.997-9.133 0-3.263-1.524-6.277-3.998-7.909-2.475-1.631-5.524-1.631-7.998 0-2.475 1.632-4 4.646-4 7.91zm31.995-9.13h31.991V91.4H95.987V73.135z"/></svg>
|
After Width: | Height: | Size: 821 B |
1
src/icons/common/password.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M108.8 44.322H89.6v-5.36c0-9.04-3.308-24.163-25.6-24.163-23.145 0-25.6 16.881-25.6 24.162v5.361H19.2v-5.36C19.2 15.281 36.798 0 64 0c27.202 0 44.8 15.281 44.8 38.961v5.361zm-32 39.356c0-5.44-5.763-9.832-12.8-9.832-7.037 0-12.8 4.392-12.8 9.832 0 3.682 2.567 6.808 6.407 8.477v11.205c0 2.718 2.875 4.962 6.4 4.962 3.524 0 6.4-2.244 6.4-4.962V92.155c3.833-1.669 6.393-4.795 6.393-8.477zM128 64v49.201c0 8.158-8.645 14.799-19.2 14.799H19.2C8.651 128 0 121.359 0 113.201V64c0-8.153 8.645-14.799 19.2-14.799h89.6c10.555 0 19.2 6.646 19.2 14.799z"/></svg>
|
After Width: | Height: | Size: 623 B |
1
src/icons/common/pdf.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><path d="M869.073 277.307H657.111V65.344l211.962 211.963zm-238.232 26.27V65.344l-476.498-.054v416.957h714.73v-178.67H630.841zm-335.836 360.57c-5.07-3.064-10.944-5.133-17.61-6.201-6.67-1.064-13.603-1.6-20.81-1.6h-48.821v85.641h48.822c7.206 0 14.14-.532 20.81-1.6 6.665-1.065 12.54-3.133 17.609-6.202 5.064-3.063 9.134-7.406 12.208-13.007 3.065-5.602 4.6-12.937 4.6-22.011 0-9.07-1.535-16.408-4.6-22.01-3.074-5.603-7.144-9.94-12.208-13.01zM35.82 541.805v416.904h952.358V541.805H35.821zm331.421 191.179c-3.6 11.071-9.343 20.879-17.209 29.413-7.874 8.542-18.078 15.408-30.617 20.61-12.544 5.206-27.747 7.807-45.621 7.807h-66.036v102.45h-62.831V607.517h128.867c17.874 0 33.077 2.6 45.62 7.802 12.541 5.207 22.745 12.076 30.618 20.615 7.866 8.538 13.604 18.277 17.21 29.212 3.6 10.943 5.401 22.278 5.401 34.018 0 11.477-1.8 22.752-5.402 33.819zM644.9 806.417c-5.343 17.61-13.408 32.818-24.212 45.627-10.807 12.803-24.283 22.879-40.423 30.213-16.146 7.343-35.155 11.007-57.03 11.007h-123.26V607.518h123.26c18.41 0 35.552 2.941 51.428 8.808 15.873 5.869 29.618 14.671 41.22 26.412 11.608 11.744 20.674 26.411 27.217 44.02 6.535 17.61 9.803 38.288 9.803 62.035 0 20.81-2.67 40.02-8.003 57.624zm245.362-146.07h-138.07v66.03h119.66v48.829h-119.66v118.058h-62.83V607.518h200.9v52.829h-.001zm-318.2 25.611c-6.402-8.266-14.877-14.604-25.412-19.01-10.544-4.402-23.551-6.602-39.019-6.602h-44.825v180.088h56.029c9.07 0 17.872-1.463 26.415-4.401 8.535-2.932 16.14-7.802 22.812-14.609 6.665-6.8 12.007-15.667 16.007-26.61 4.003-10.94 6.003-24.275 6.003-40.021 0-14.408-1.4-27.416-4.202-39.019-2.8-11.607-7.406-21.542-13.808-29.816zm0 0"/></svg>
|
After Width: | Height: | Size: 1.7 KiB |
1
src/icons/common/people.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M104.185 95.254c8.161 7.574 13.145 17.441 13.145 28.28 0 1.508-.098 2.998-.285 4.466h-10.784c.238-1.465.403-2.948.403-4.465 0-8.983-4.36-17.115-11.419-23.216C86 104.66 75.355 107.162 64 107.162c-11.344 0-21.98-2.495-31.22-6.83-7.064 6.099-11.444 14.218-11.444 23.203 0 1.517.165 3 .403 4.465H10.955a35.444 35.444 0 0 1-.285-4.465c0-10.838 4.974-20.713 13.127-28.291C9.294 85.42.003 70.417.003 53.58.003 23.99 28.656.001 64 .001s63.997 23.988 63.997 53.58c0 16.842-9.299 31.85-23.812 41.673zM64 36.867c-29.454 0-53.33-10.077-53.33 15.342 0 25.418 23.876 46.023 53.33 46.023 29.454 0 53.33-20.605 53.33-46.023 0-25.419-23.876-15.342-53.33-15.342zm24.888 25.644c-3.927 0-7.111-2.665-7.111-5.953 0-3.288 3.184-5.954 7.11-5.954 3.928 0 7.111 2.666 7.111 5.954s-3.183 5.953-7.11 5.953zm-3.556 16.372c0 4.11-9.55 7.442-21.332 7.442-11.781 0-21.332-3.332-21.332-7.442 0-1.06.656-2.064 1.8-2.976 3.295 2.626 10.79 4.465 19.532 4.465 8.743 0 16.237-1.84 19.531-4.465 1.145.912 1.801 1.916 1.801 2.976zm-46.22-16.372c-3.927 0-7.11-2.665-7.11-5.953 0-3.288 3.183-5.954 7.11-5.954 3.927 0 7.111 2.666 7.111 5.954s-3.184 5.953-7.11 5.953z"/></svg>
|
After Width: | Height: | Size: 1.2 KiB |
1
src/icons/common/peoples.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M95.648 118.762c0 5.035-3.563 9.121-7.979 9.121H7.98c-4.416 0-7.979-4.086-7.979-9.121C0 100.519 15.408 83.47 31.152 76.75c-9.099-6.43-15.216-17.863-15.216-30.987v-9.128c0-20.16 14.293-36.518 31.893-36.518s31.894 16.358 31.894 36.518v9.122c0 13.137-6.123 24.556-15.216 30.993 15.738 6.726 31.141 23.769 31.141 42.012z"/><path d="M106.032 118.252h15.867c3.376 0 6.101-3.125 6.101-6.972 0-13.957-11.787-26.984-23.819-32.123 6.955-4.919 11.638-13.66 11.638-23.704v-6.985c0-15.416-10.928-27.926-24.39-27.926-1.674 0-3.306.193-4.89.561 1.936 4.713 3.018 9.974 3.018 15.526v9.121c0 13.137-3.056 23.111-11.066 30.993 14.842 4.41 27.312 23.42 27.541 41.509z"/></svg>
|
After Width: | Height: | Size: 731 B |
1
src/icons/common/qq.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M18.448 57.545l-.244-.744-.198-.968-.132-.53v-2.181l.236-.859.24-.908.317-.953.428-1.06.561-1.103.794-1.104v-.773l.077-.724.123-.984.34-1.106.313-1.194.25-.548.289-.511.371-.569.405-.423v-2.73l.234-1.407.236-1.633.42-1.955.577-2.035.43-1.118.426-1.217.468-1.135.559-1.216.57-1.332.655-1.247.737-1.331.929-1.33.43-.762.457-.624.995-1.406 1.025-1.403 1.163-1.444 1.246-1.405 1.352-1.384 1.41-1.423 1.708-1.536 1.083-.934 1.322-1.008 1.34-.89 1.448-.855 1.392-.76 1.57-.63 1.667-.775 1.657-.532 1.653-.552 1.787-.548 1.785-.417 1.876-.347L59.128.68l1.879-.245 1.876-.252 2.002-.106h5.912l1.97.243 1.981.231 2.019.207 1.874.441 1.979.413 1.857.475 2.035.53 1.862.646 1.782.738 1.904.78 1.736.853 1.689.95 1.655 1.044 1.425.971.662.548.693.401 1.323 1.1 1.115 1.064 1.112 1.1 1.083 1.214.894 1.178 1.064 1.217.74 1.306.752 1.162.798 1.352.661 1.175 1.113 2.489.546 1.286.428 1.192.428 1.294.384 1.217.267 1.047.347 1.231.607 2.198.388 1.924.253 1.861.217 1.497.342 2.28.077.362.274.41.737 1.18.473.8.42.832.534.892.472 1.07.307 1.093.334 1.2.252 1.232.115.605.106.746v.648l-.106.643v.8l-.192.774-.35 1.5-.403.76-.299.852v.213l.142.264.4.623 1.746 2.53 1.377 1.9.66 1.267.889 1.389.774 1.52.893 1.627.894 1.828 1.006 2.069.567 1.268.518 1.239.447 1.307.44 1.175.336 1.235.342 1.16.432 2.261.343 2.31.235 2.05v2.891l-.158 1.025-.226 1.768-.308 1.59-.48 1.44-.18.588-.336.707-.28.493-.375.607-.33.383-.42.494-.375.4-.401.34-.48.207-.432.207-.355.114h-.543l-.346-.114-.66-.32-.302-.212-.317-.223-.347-.304-.35-.342-.579-.63-.684-.89-.539-.917-.538-.734-.526-.855-.741-1.517-.833-1.579-.098-.055h-.138l-.338.247-.196.415-.326.516-.567 1.533-.856 2.182-1.096 2.626-.824 1.308-.864 1.366-1.027 1.536-1.09 1.503-.557.68-.676.743-1.555 1.497.136.135.21.214.777.446 3.235 1.524 1.41.779 1.347.756 1.332.953 1.187.982.574.443.432.511.445.593.367.643.198.533.242.64.105.554.115.647-.115.433v.44l-.105.454-.242.415-.092.325-.22.394-.587.784-.543.627-.42.47-.35.348-.893.638-1.01.556-1.077.532-1.155.511-1.287.495-.693.207-.608.167-1.496.342-1.545.325-1.552.323-1.689.27-1.74.072-1.785.21h-5.539l-1.998-.114-1.86-.168-2.005-.27-1.99-.209-2.095-.286-2.03-.495-1.981-.374-1.968-.552-2.019-.707-1.98-.585-1.044-.342-.927-.323-.586-.223-.582-.12h-1.647l-1.904-.131-.962-.096-1.24-.135-.795.705-1.085.665-1.471.701-1.628.875-.99.475-1.033.376-2.281.914-1.24.305-1.3.343-1.803.344-1.13.086-1.193.1-1.246.135-1.45.053h-5.926l-3.346-.053-3.25-.321-1.644-.23-1.589-.23-1.546-.227-1.547-.305-1.442-.456-1.434-.325-1.294-.51-1.223-.474-1.142-.533-.99-.583-.984-.71-.336-.343-.44-.415-.334-.362-.3-.417-.278-.415-.215-.42-.311-.89-.109-.46-.138-.51v-.473l.138-.533v-.53l.109-.53v-1.069l.052-.564.259-.647.215-.646.39-.779.286-.3.236-.348.615-.738.49-.38.464-.266.428-.338.676-.21.543-.324.676-.341.77-.227.775-.231.897-.192.85-.11 1.008-.13 1.093-.081.284-.092h.063l.137-.115v-.13l-.2-.266-.58-.27-1.45-1.231-.975-.761-1.127-.967-1.136-1.082-1.181-1.382-1.36-1.558-.508-.843-.672-.87-.58-1.007-.522-1.1-.704-1.047-.459-1.194-.547-1.192-.546-1.33-.397-1.273-.378-1.575-.112-.057h-.115l-.059-.113h-.14l-.23.113-.114.057-.158.264-.057.321-.119.286-.206.477-.664 1.157-.345.701-.546.612-.58.736-.641.816-.677.724-.795.701-.734.658-.814.524-.89.546-.855.325-1.008.247-.99.095h-.233l-.228-.095-.18-.384-.29-.188-.38-.912-.237-.493-.255-.707-.21-.734-.113-.724-.313-1.648-.12-.972v-3.185l.12-2.379.196-1.214.23-1.252.21-1.347.374-1.254.42-1.443.431-1.407.578-1.448.545-1.38.754-1.4.699-1.52.855-1.425 1.006-1.538 1.023-1.382 1.069-1.538.891-1.071 1.142-1.227 1.202-1.237.56-.59.678-.662.985-.836 1.012-.853 1.647-1.446 1.242-.889z"/></svg>
|
After Width: | Height: | Size: 3.6 KiB |
1
src/icons/common/search.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M124.884 109.812L94.256 79.166c-.357-.357-.757-.629-1.129-.914a50.366 50.366 0 0 0 8.186-27.59C101.327 22.689 78.656 0 50.67 0 22.685 0 0 22.688 0 50.663c0 27.989 22.685 50.663 50.656 50.663 10.186 0 19.643-3.03 27.6-8.201.286.385.557.771.9 1.114l30.628 30.632a10.633 10.633 0 0 0 7.543 3.129c2.728 0 5.457-1.043 7.543-3.115 4.171-4.157 4.171-10.915.014-15.073M50.671 85.338C31.557 85.338 16 69.78 16 50.663c0-19.102 15.557-34.661 34.67-34.661 19.115 0 34.657 15.559 34.657 34.675 0 19.102-15.557 34.661-34.656 34.661"/></svg>
|
After Width: | Height: | Size: 600 B |
1
src/icons/common/shopping.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M42.913 101.36c1.642 0 3.198.332 4.667.996a12.28 12.28 0 0 1 3.89 2.772c1.123 1.184 1.987 2.582 2.592 4.193.605 1.612.908 3.318.908 5.118 0 1.8-.303 3.507-.908 5.118-.605 1.611-1.469 3.01-2.593 4.194a13.3 13.3 0 0 1-3.889 2.843 10.582 10.582 0 0 1-4.667 1.066c-1.729 0-3.306-.355-4.732-1.066a13.604 13.604 0 0 1-3.825-2.843c-1.123-1.185-1.988-2.583-2.593-4.194a14.437 14.437 0 0 1-.907-5.118c0-1.8.302-3.506.907-5.118.605-1.61 1.47-3.009 2.593-4.193a12.515 12.515 0 0 1 3.825-2.772c1.426-.664 3.003-.996 4.732-.996zm53.932.285c1.643 0 3.22.331 4.733.995a11.386 11.386 0 0 1 3.889 2.772c1.08 1.185 1.945 2.583 2.593 4.194.648 1.61.972 3.317.972 5.118 0 1.8-.324 3.506-.972 5.117-.648 1.611-1.513 3.01-2.593 4.194a12.253 12.253 0 0 1-3.89 2.843 11 11 0 0 1-4.732 1.066 10.58 10.58 0 0 1-4.667-1.066 12.478 12.478 0 0 1-3.824-2.843c-1.08-1.185-1.945-2.583-2.593-4.194a13.581 13.581 0 0 1-.973-5.117c0-1.801.325-3.507.973-5.118.648-1.611 1.512-3.01 2.593-4.194a11.559 11.559 0 0 1 3.824-2.772 11.212 11.212 0 0 1 4.667-.995zm21.781-80.747c2.42 0 4.3.355 5.64 1.066 1.34.71 2.29 1.587 2.852 2.63a6.427 6.427 0 0 1 .778 3.34c-.044 1.185-.195 2.204-.454 3.057-.26.853-.8 2.606-1.62 5.26a589.268 589.268 0 0 1-2.788 8.743 1236.373 1236.373 0 0 0-3.047 9.453c-.994 3.128-1.75 5.592-2.269 7.393-1.123 3.79-2.55 6.42-4.278 7.89-1.728 1.469-3.846 2.203-6.352 2.203H39.023l1.945 12.795h65.342c4.148 0 6.223 1.943 6.223 5.828 0 1.896-.41 3.53-1.232 4.905-.821 1.374-2.442 2.061-4.862 2.061H38.505c-1.729 0-3.176-.426-4.343-1.28-1.167-.852-2.14-1.966-2.917-3.34a21.277 21.277 0 0 1-1.88-4.478 44.128 44.128 0 0 1-1.102-4.55c-.087-.568-.324-1.942-.713-4.122-.39-2.18-.865-4.904-1.426-8.174l-1.88-10.947c-.692-4.027-1.383-8.079-2.075-12.154-1.642-9.572-3.5-20.234-5.574-31.986H6.87c-1.296 0-2.377-.356-3.24-1.067a9.024 9.024 0 0 1-2.14-2.558 10.416 10.416 0 0 1-1.167-3.2C.108 8.53 0 7.488 0 6.54c0-1.896.583-3.46 1.75-4.69C2.917.615 4.494 0 6.482 0h13.095c1.728 0 3.111.284 4.148.853 1.037.569 1.858 1.28 2.463 2.132a8.548 8.548 0 0 1 1.297 2.701c.26.948.475 1.754.648 2.417.173.758.346 1.825.519 3.199.173 1.374.345 2.772.518 4.193.26 1.706.519 3.507.778 5.403h88.678z"/></svg>
|
After Width: | Height: | Size: 2.2 KiB |
2
src/icons/common/sidebar-logo.svg
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1652520562374" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1623" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
|
||||
</style></defs><path d="M667.2 598.1l24 163.1c21.8 148-143.9 250.6-298.3 184.7l-170.1-72.7c-154.3-65.9-181.6-250.9-49-333l146.1-90.5c132.6-82 325.5 0.4 347.3 148.4z" p-id="1624"></path><path d="M413.084289 314.438892a90 138 24.437 1 0 114.179113-251.275009 90 138 24.437 1 0-114.179113 251.275009Z" p-id="1625"></path><path d="M137.204814 438.494762a90 138 24.437 1 0 114.179112-251.275009 90 138 24.437 1 0-114.179112 251.275009Z" p-id="1626"></path><path d="M690.068583 440.383783a90 138 24.437 1 0 114.179113-251.275009 90 138 24.437 1 0-114.179113 251.275009Z" p-id="1627"></path><path d="M778.727414 730.103856a90 138 24.437 1 0 114.179112-251.275009 90 138 24.437 1 0-114.179112 251.275009Z" p-id="1628"></path></svg>
|
After Width: | Height: | Size: 1.4 KiB |
1
src/icons/common/size.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 54.857h54.796v18.286H36.531V128H18.265V73.143H0V54.857zm127.857-36.571H91.935V128H72.456V18.286H36.534V0h91.326l-.003 18.286z"/></svg>
|
After Width: | Height: | Size: 211 B |
1
src/icons/common/skill.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M31.652 93.206h33.401c1.44 2.418 3.077 4.663 4.93 6.692h-38.33v-6.692zm0-10.586h28.914a44.8 44.8 0 0 1-1.264-6.688h-27.65v6.688zm0-17.27H59.39c.288-2.286.714-4.532 1.34-6.687H31.65v6.687h.003zm53.913 44.84v5.85c0 2.798-2.095 5.075-4.667 5.075h-70.07c-2.576 0-4.663-2.277-4.663-5.075V31.26l23.22-20.96v22.25H17.16v6.688h18.39V6.688h45.348c2.576 0 4.667 2.277 4.667 5.066v20.009c1.987-.675 4.053-1.128 6.17-1.445v-18.56C91.738 5.28 86.874 0 80.902 0H31.15L0 28.118v87.917c0 6.48 4.859 11.759 10.832 11.759h70.07c5.974 0 10.837-5.27 10.837-11.759v-4.41c-2.117-.312-4.183-.765-6.17-1.435h-.004zM23.279 58.667h-7.96v6.688h7.96v-6.688zm-7.956 41.23h7.96v-6.691h-7.96v6.692zm7.956-23.96h-7.96v6.687h7.96v-6.688zm89.718-15.042l-4.896-4.07-12.447 17.613-11.19-9.305-3.762 5.311 16.091 13.38 16.204-22.929zM128 70.978c0-18.632-13.97-33.782-31.147-33.782-17.168 0-31.135 15.155-31.135 33.782 0 18.628 13.97 33.783 31.135 33.783 17.172 0 31.143-15.15 31.143-33.783H128zm-6.17 0c0 14.933-11.203 27.1-24.981 27.1-13.77 0-24.987-12.158-24.987-27.1 0-14.941 11.195-27.099 24.987-27.099 13.778 0 24.982 12.158 24.982 27.1z"/></svg>
|
After Width: | Height: | Size: 1.2 KiB |