Compare commits
187 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cafc588e4c | ||
|
|
1687097e63 | ||
|
|
b87183cb75 | ||
|
|
80328d2e20 | ||
|
|
ea97cb20f3 | ||
|
|
262113525d | ||
|
|
e080fe4128 | ||
|
|
b1702ed7fe | ||
|
|
a31d154806 | ||
|
|
0408fa6f96 | ||
|
|
45c2c4a301 | ||
|
|
c8e90b4bd7 | ||
|
|
9c70c5a8dc | ||
|
|
4cf8c215fc | ||
|
|
a139ef80f5 | ||
|
|
11178d8fd5 | ||
|
|
c49fbde0b5 | ||
|
|
86cde31aaa | ||
|
|
fc5cec54b0 | ||
|
|
13749c784d | ||
|
|
37a967942b | ||
|
|
6b16a04229 | ||
|
|
77b7abcbc3 | ||
|
|
34782fe351 | ||
|
|
52dba8a79c | ||
|
|
d4d4157cc4 | ||
|
|
b18654f52e | ||
|
|
28eb447de7 | ||
|
|
e661f60f13 | ||
|
|
6d814316c2 | ||
|
|
973e99169a | ||
|
|
8712985d48 | ||
|
|
fd8de45bff | ||
|
|
e86757e30e | ||
|
|
be4404dcdc | ||
|
|
b3b08b947b | ||
|
|
5abb47df3b | ||
|
|
f47492ea99 | ||
|
|
aebcba4a6f | ||
|
|
53dba5d73a | ||
|
|
d7b4b22bec | ||
|
|
fe6dfb9e3d | ||
|
|
15e751dee8 | ||
|
|
016a5c9f8d | ||
|
|
6d4fe84935 | ||
|
|
9ac28455d2 | ||
|
|
fe2cf22e23 | ||
|
|
75afd44e7a | ||
|
|
feb1498d29 | ||
|
|
8458d5d37b | ||
|
|
ababf2d29e | ||
|
|
880dd3cdba | ||
|
|
c10511b1a0 | ||
|
|
9f8cc651bc | ||
|
|
6993cbc3c1 | ||
|
|
1ea5ad71ce | ||
|
|
57fc56613a | ||
|
|
dd8cc8508e | ||
|
|
8bb67d4a5a | ||
|
|
ed5d87ef3c | ||
|
|
2bbe4ebc75 | ||
|
|
26f62a8c70 | ||
|
|
afff1d677b | ||
|
|
85f4917f26 | ||
|
|
67db3cb1c3 | ||
|
|
ff329b1e8e | ||
|
|
d4302627e8 | ||
|
|
8f6986608d | ||
|
|
aab808d9dd | ||
|
|
1ffe435f69 | ||
|
|
03955f7470 | ||
|
|
173575687d | ||
|
|
0063261fd5 | ||
|
|
113874b6b9 | ||
|
|
d33039dce4 | ||
|
|
3099e51fd3 | ||
|
|
1bf3a6f93b | ||
|
|
8b8491912a | ||
|
|
821242729f | ||
|
|
50687d1505 | ||
|
|
0bd4f4ff68 | ||
|
|
2c28f11baa | ||
|
|
b458a942c9 | ||
|
|
e85f36b76e | ||
|
|
a2b200f5f2 | ||
|
|
47969f4349 | ||
|
|
8187dbff0e | ||
|
|
860433bb22 | ||
|
|
3981c63e24 | ||
|
|
a4d305868f | ||
|
|
a4f126ae7f | ||
|
|
d03a44060f | ||
|
|
0701692461 | ||
|
|
a64b236707 | ||
|
|
1abb6e466f | ||
|
|
666e755ae5 | ||
|
|
429eadd803 | ||
|
|
74ef4e1722 | ||
|
|
c260f88e38 | ||
|
|
9bb4f34707 | ||
|
|
a5172c9476 | ||
|
|
11f5ffd018 | ||
|
|
497b3c404d | ||
|
|
012e5c9225 | ||
|
|
4054be735e | ||
|
|
9044661503 | ||
|
|
62c67a63a3 | ||
|
|
0e97b3df0e | ||
|
|
77a1a47110 | ||
|
|
e1200f2dbe | ||
|
|
0adc256d53 | ||
|
|
f96a2e4d00 | ||
|
|
9fa46c50e2 | ||
|
|
a791786679 | ||
|
|
ad1de9530a | ||
|
|
a8bc76ed9c | ||
|
|
6b36c93779 | ||
|
|
3a69af233f | ||
|
|
0cc4f2660e | ||
|
|
3b86ad6fe8 | ||
|
|
cf141e973a | ||
|
|
2cae675ab6 | ||
|
|
8177de106b | ||
|
|
6a89af382f | ||
|
|
f8fde9107b | ||
|
|
1585606a2f | ||
|
|
808240f91b | ||
|
|
515be309b8 | ||
|
|
ef2aa27a87 | ||
|
|
0a332731a4 | ||
|
|
d9132ffa64 | ||
|
|
3f6c82e475 | ||
|
|
a26f711d83 | ||
|
|
ad0281839f | ||
|
|
07aff1fcfc | ||
|
|
aa2cc33ec9 | ||
|
|
b554356ba1 | ||
|
|
7bec2c7373 | ||
|
|
010ba1a9e1 | ||
|
|
cd872bea83 | ||
|
|
4b4903c880 | ||
|
|
f0e780c48f | ||
|
|
7ed66b321d | ||
|
|
c10e38cdf2 | ||
|
|
105409a278 | ||
|
|
074213c656 | ||
|
|
b1751beab9 | ||
|
|
89162dee1e | ||
|
|
8cb2d896ad | ||
|
|
2d5a82ddc0 | ||
|
|
b79ddfcfbd | ||
|
|
4f873641a5 | ||
|
|
14728b3ed6 | ||
|
|
8fe2b78c87 | ||
|
|
275ee39b0f | ||
|
|
a858448957 | ||
|
|
a21700ee02 | ||
|
|
05b106203c | ||
|
|
a0074411ca | ||
|
|
69d2f82835 | ||
|
|
ddcdeb523d | ||
|
|
7df600bea2 | ||
|
|
f57176dd1d | ||
|
|
488719227a | ||
|
|
679cfae7fb | ||
|
|
62ad9e6f40 | ||
|
|
762833e545 | ||
|
|
dc7a50de6f | ||
|
|
055296ab53 | ||
|
|
9737014c0c | ||
|
|
f9ff87c708 | ||
|
|
fdff569de9 | ||
|
|
d6fcab53b9 | ||
|
|
a8250e718a | ||
|
|
f44804538c | ||
|
|
ba41753d77 | ||
|
|
5ec1f62f8d | ||
|
|
c7f6ff6514 | ||
|
|
f886a38694 | ||
|
|
e09ed0fb47 | ||
|
|
db237d2f51 | ||
|
|
23e14c2ea2 | ||
|
|
9290d56071 | ||
|
|
bd8348b432 | ||
|
|
71181b9d2b | ||
|
|
f4cd720ce8 | ||
|
|
e027fec6dc |
14
.editorconfig
Normal file
@@ -0,0 +1,14 @@
|
||||
# http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
insert_final_newline = false
|
||||
trim_trailing_whitespace = false
|
||||
9
.env
@@ -1,3 +1,12 @@
|
||||
# port
|
||||
VITE_PORT = 8848
|
||||
# title
|
||||
VITE_TITLE = vue-pure-admin
|
||||
# version
|
||||
VITE_VERSION = 2.1.0
|
||||
# open
|
||||
VITE_OPEN = false
|
||||
|
||||
# public path
|
||||
VITE_PUBLIC_PATH = /
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
# port
|
||||
VITE_PORT = 3001
|
||||
|
||||
VITE_PORT = 8848
|
||||
# title
|
||||
VITE_TITLE = vue-pure-admin
|
||||
# version
|
||||
VITE_VERSION = 2.1.0
|
||||
# open
|
||||
VITE_OPEN = false
|
||||
|
||||
|
||||
4
.eslintignore
Normal file
@@ -0,0 +1,4 @@
|
||||
public
|
||||
dist
|
||||
*.d.ts
|
||||
package.json
|
||||
75
.eslintrc.js
Normal file
@@ -0,0 +1,75 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
node: true
|
||||
},
|
||||
globals: {
|
||||
// Ref sugar (take 2)
|
||||
$: "readonly",
|
||||
$$: "readonly",
|
||||
$ref: "readonly",
|
||||
$shallowRef: "readonly",
|
||||
$computed: "readonly",
|
||||
|
||||
// index.d.ts
|
||||
// global.d.ts
|
||||
Fn: "readonly",
|
||||
PromiseFn: "readonly",
|
||||
RefType: "readonly",
|
||||
LabelValueOptions: "readonly",
|
||||
EmitType: "readonly",
|
||||
TargetContext: "readonly",
|
||||
ComponentElRef: "readonly",
|
||||
ComponentRef: "readonly",
|
||||
ElRef: "readonly",
|
||||
global: "readonly",
|
||||
ForDataType: "readonly",
|
||||
ComponentRoutes: "readonly",
|
||||
|
||||
// script setup
|
||||
defineProps: "readonly",
|
||||
defineEmits: "readonly",
|
||||
defineExpose: "readonly",
|
||||
withDefaults: "readonly"
|
||||
},
|
||||
extends: [
|
||||
"plugin:vue/vue3-essential",
|
||||
"eslint:recommended",
|
||||
"@vue/typescript/recommended",
|
||||
"@vue/prettier",
|
||||
"@vue/prettier/@typescript-eslint"
|
||||
],
|
||||
parser: "vue-eslint-parser",
|
||||
parserOptions: {
|
||||
parser: "@typescript-eslint/parser",
|
||||
ecmaVersion: 2020,
|
||||
sourceType: "module",
|
||||
jsxPragma: "React",
|
||||
ecmaFeatures: {
|
||||
jsx: true
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
"@typescript-eslint/no-explicit-any": "off", // any
|
||||
"no-debugger": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off", // setup()
|
||||
"@typescript-eslint/ban-types": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
argsIgnorePattern: "^_",
|
||||
varsIgnorePattern: "^_"
|
||||
}
|
||||
],
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
argsIgnorePattern: "^_",
|
||||
varsIgnorePattern: "^_"
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
56
.github/workflows/linter.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
#################################
|
||||
#################################
|
||||
## Super Linter GitHub Actions ##
|
||||
#################################
|
||||
#################################
|
||||
name: Lint Code Base
|
||||
|
||||
#
|
||||
# Documentation:
|
||||
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
|
||||
#
|
||||
|
||||
#############################
|
||||
# Start the job on all push #
|
||||
#############################
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
###############
|
||||
# Set the Job #
|
||||
###############
|
||||
jobs:
|
||||
build:
|
||||
# Name the Job
|
||||
name: Lint Code Base
|
||||
# Set the agent to run on
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
##################
|
||||
# Load all steps #
|
||||
##################
|
||||
steps:
|
||||
##########################
|
||||
# Checkout the code base #
|
||||
##########################
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# Full git history is needed to get a proper list of changed files within `super-linter`
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
yarn install
|
||||
yarn lint
|
||||
yarn build
|
||||
env:
|
||||
VALIDATE_ALL_CODEBASE: false
|
||||
DEFAULT_BRANCH: main
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
17
.gitignore
vendored
@@ -1,3 +1,18 @@
|
||||
node_modules
|
||||
dist
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
.eslintcache
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
tests/**/coverage/
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
@@ -2,5 +2,4 @@ ports:
|
||||
- port: 3344
|
||||
onOpen: open-preview
|
||||
tasks:
|
||||
- init: npm
|
||||
command: npm serve
|
||||
- init: npm install && npm run serve
|
||||
|
||||
6
.husky/commit-msg
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# shellcheck source=./_/husky.sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx --no-install commitlint --edit "$1"
|
||||
9
.husky/common.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
command_exists () {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Workaround for Windows 10, Git Bash and Yarn
|
||||
if command_exists winpty && test -t 1; then
|
||||
exec < /dev/tty
|
||||
fi
|
||||
10
.husky/lintstagedrc.js
Normal file
@@ -0,0 +1,10 @@
|
||||
module.exports = {
|
||||
"*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"],
|
||||
"{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [
|
||||
"prettier --write--parser json"
|
||||
],
|
||||
"package.json": ["prettier --write"],
|
||||
"*.vue": ["eslint --fix", "prettier --write", "stylelint --fix"],
|
||||
"*.{vue,css,scss,postcss,less}": ["stylelint --fix", "prettier --write"],
|
||||
"*.md": ["prettier --write"]
|
||||
};
|
||||
10
.husky/pre-commit
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
. "$(dirname "$0")/common.sh"
|
||||
|
||||
[ -n "$CI" ] && exit 0
|
||||
|
||||
# Format and submit code according to lintstagedrc.js configuration
|
||||
npm run lint:lint-staged
|
||||
|
||||
npm run lint:pretty
|
||||
7
.prettierrc.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
bracketSpacing: true,
|
||||
jsxBracketSameLine: true,
|
||||
singleQuote: false,
|
||||
arrowParens: 'avoid',
|
||||
trailingComma: 'none'
|
||||
};
|
||||
3
.stylelintignore
Normal file
@@ -0,0 +1,3 @@
|
||||
/dist/*
|
||||
/public/*
|
||||
public/*
|
||||
47
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
// You should install these plugins:
|
||||
// ESLint
|
||||
// Prettier - Code formatter
|
||||
// stylelint
|
||||
// vscode-icons
|
||||
// TypeScript Vue Plugin (Volar)
|
||||
// Vue Language Features (Volar)
|
||||
"terminal.integrated.rendererType": "dom",
|
||||
"editor.formatOnType": true,
|
||||
"editor.formatOnSave": true,
|
||||
"window.zoomLevel": 1,
|
||||
"javascript.updateImportsOnFileMove.enabled": "always",
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||
},
|
||||
"editor.tabSize": 2,
|
||||
"editor.formatOnPaste": true,
|
||||
"files.autoSave": "afterDelay",
|
||||
"git.confirmSync": false,
|
||||
"workbench.startupEditor": "newUntitledFile",
|
||||
"editor.suggestSelection": "first",
|
||||
"editor.acceptSuggestionOnCommitCharacter": false,
|
||||
"css.lint.propertyIgnoredDueToDisplay": "ignore",
|
||||
// Prevent inline styles from being automatically formatted to all lowercase
|
||||
"editor.quickSuggestions": {
|
||||
"other": true,
|
||||
"comments": true,
|
||||
"strings": true
|
||||
},
|
||||
// Automatically fix some syntax errors of ts
|
||||
"tslint.autoFixOnSave": true,
|
||||
"files.associations": {
|
||||
// Specifies the location of snippets in the suggestion widget
|
||||
"editor.snippetSuggestions": "top"
|
||||
},
|
||||
"[css]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"cSpell.userWords": ["sourcemap", "vite"],
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
}
|
||||
}
|
||||
22
.vscode/vue3.0.code-snippets
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"Vue3.0快速生成模板": {
|
||||
"prefix": "Vue3.0",
|
||||
"body": [
|
||||
"<template>",
|
||||
"\t<div>\n",
|
||||
"\t</div>",
|
||||
"</template>\n",
|
||||
"<script lang='ts'>",
|
||||
"export default {",
|
||||
"\tsetup(){",
|
||||
"\t\treturn{\n\n\t\t}",
|
||||
"\t},",
|
||||
"}",
|
||||
"</script>\n",
|
||||
"<style scoped>\n",
|
||||
"</style>",
|
||||
"$2"
|
||||
],
|
||||
"description": "Vue3.0"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,26 @@
|
||||
# 2.1.0(2021-10-14)
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- Route animation (each route can add different animations)
|
||||
- Extra icons (for example, this is a newly added page, a new icon is displayed in the upper right corner of the routing menu)
|
||||
- Extract the default configuration options
|
||||
- Perfect type file
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- Fix the issue of element-plus internationalization
|
||||
- Fix routing issues
|
||||
- Fix navigation adaptation problem
|
||||
|
||||
# 2.0.1(2021-9-29)
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- Feat horizontal nav
|
||||
|
||||
# 2.0.0(2021-4-13)
|
||||
|
||||
### 🎫 Chores
|
||||
|
||||
- Release 2.0.0 version
|
||||
- Release 2.0.0 version
|
||||
|
||||
23
CHANGELOG.md
@@ -1,5 +1,26 @@
|
||||
# 2.1.0(2021-10-14)
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- Route animation (each route can add different animations)
|
||||
- Extra icons (for example, this is a newly added page, a new icon is displayed in the upper right corner of the routing menu)
|
||||
- Extract the default configuration options
|
||||
- Perfect type file
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- Fix the issue of element-plus internationalization
|
||||
- Fix routing issues
|
||||
- Fix navigation adaptation problem
|
||||
|
||||
# 2.0.1(2021-9-29)
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- Feat horizontal nav
|
||||
|
||||
# 2.0.0(2021-4-13)
|
||||
|
||||
### 🎫 Chores
|
||||
|
||||
- Release 2.0.0 version
|
||||
- Release 2.0.0 version
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
# 2.1.0(2021-10-14)
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- 路由动画(每个路由都可添加不同动画)
|
||||
- 额外图标(比如这个是新加的页面,路由菜单右上角显示个新图标)
|
||||
- 抽离默认配置选项
|
||||
- 完善类型文件
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- 修复 element-plus 国际化使用问题
|
||||
- 修复路由问题
|
||||
- 修复导航适配问题
|
||||
|
||||
# 2.0.1(2021-9-29)
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- 添加 horizontal 水平模式导航
|
||||
|
||||
# 2.0.0(2021-4-13)
|
||||
|
||||
### 🎫 Chores
|
||||
|
||||
- 发布2.0.0版本
|
||||
- 发布 2.0.0 版本
|
||||
|
||||
136
README.en-US.md
Normal file
@@ -0,0 +1,136 @@
|
||||
<h1>vue-pure-admin</h1>
|
||||
|
||||
[](LICENSE)
|
||||
|
||||
**English** | [中文](./README.md)
|
||||
|
||||
## Introduction
|
||||
|
||||
vue-pure-admin is a free and open source middle and back-end template. Using the latest `vue3`, `vite2`, `TypeScript`, `Element-Plus` and other mainstream technology development, the out-of-the-box middle and back-end front-end solutions can also be used for learning reference.
|
||||
|
||||
## Preview
|
||||
|
||||
- [vue-pure-admin](http://yiming_chang.gitee.io/manages)
|
||||
|
||||
Click to log in without password
|
||||
|
||||
<p align="center">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f5ee80eee1014fb4a53c5bb37574a5f5~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/dec0672a62e141f3b7f626c22ff6c7ef~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f586f1353de74b1b88cc9f89fce2146e~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/a28fc0af7ac44e3b8f30469cba4a9993~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/a17e54329cda4d76aa9c1c4f2a4715d3~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d884fb611da74ee0bdc17c29014d0260~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/abed44ac1f2744e897c28d1689bcb517~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/cf2f068650f44a0787c699f5a20c75a6~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/73c575dd06474731ad8ab9d853f1ddfd~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/99389b90f5ac4db9b0d61d99dd9a1454~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f1546f1c6014446db6c9983934aedc86~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/cfb0093b77c34e87b094daaa4304bc2d~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/fe133cc6db3245f9b1b37f231d040550~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d3110a12d63e4f6fb314e60bf18bdb66~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/45b93ec453e3406a939affe65ddcc803~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/cdc2dc88c1ef4aafbaaade820442c986~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f4c91b162206485b88cc58a72ff54a01~tplv-k3u1fbpfcp-watermark.image">
|
||||
</p>
|
||||
|
||||
### Use Gitpod
|
||||
|
||||
Open the project in Gitpod (free online dev environment for GitHub) and start coding immediately.
|
||||
|
||||
[](https://gitpod.io/#https://github.com/xiaoxian521/vue-pure-admin)
|
||||
|
||||
## Install and use
|
||||
|
||||
- Get the project code
|
||||
|
||||
```bash
|
||||
git clone https://github.com/xiaoxian521/vue-pure-admin.git
|
||||
or
|
||||
git clone https://github.com.cnpmjs.org/xiaoxian521/vue-pure-admin.git
|
||||
```
|
||||
|
||||
- Installation dependencies
|
||||
|
||||
```bash
|
||||
cd vue-pure-admin
|
||||
|
||||
yarn install
|
||||
|
||||
```
|
||||
|
||||
- run
|
||||
|
||||
```bash
|
||||
yarn serve
|
||||
```
|
||||
|
||||
- build
|
||||
|
||||
```bash
|
||||
yarn build
|
||||
```
|
||||
|
||||
## Change Log
|
||||
|
||||
[CHANGELOG](./CHANGELOG.en_US.md)
|
||||
|
||||
## How to contribute
|
||||
|
||||
You are very welcome to join Or submit a Pull Request
|
||||
|
||||
**Pull Request:**
|
||||
|
||||
1. Fork code!
|
||||
2. Create your own branch: `git checkout -b feat/xxxx`
|
||||
3. Submit your changes: `git commit -am 'feat(function): add xxxxx'`
|
||||
4. Push your branch: `git push origin feat/xxxx`
|
||||
5. submit`pull request`
|
||||
|
||||
## Git Contribution submission specification
|
||||
|
||||
- reference [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) specification ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular))
|
||||
|
||||
- `feat` Add new features
|
||||
- `fix` Fix the problem/BUG
|
||||
- `style` The code style is related and does not affect the running result
|
||||
- `perf` Optimization/performance improvement
|
||||
- `refactor` Refactor
|
||||
- `revert` Undo edit
|
||||
- `test` Test related
|
||||
- `docs` Documentation/notes
|
||||
- `chore` Dependency update/scaffolding configuration modification etc.
|
||||
- `workflow` Workflow improvements
|
||||
- `ci` Continuous integration
|
||||
- `types` Type definition file changes
|
||||
- `wip` In development
|
||||
|
||||
## Browser support
|
||||
|
||||
The `Chrome 80+` browser is recommended for local development
|
||||
|
||||
Support modern browsers, not IE
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
|
||||
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
||||
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
|
||||
|
||||
## Maintainer
|
||||
|
||||
[xiaoxian521](https://github.com/xiaoxian521)
|
||||
|
||||
## Donate
|
||||
|
||||
If you think this project is helpful to you, you can help the author buy a cup of coffee to show your support!
|
||||
|
||||

|
||||
|
||||
## Exchange Group
|
||||
|
||||
Please scan the code to join the WeChat exchange group, if you have any questions, you can communicate in the group!
|
||||
|
||||

|
||||
|
||||
## License
|
||||
|
||||
[MIT © xiaoxian521-2020](./LICENSE)
|
||||
123
README.md
@@ -2,36 +2,47 @@
|
||||
|
||||
[](LICENSE)
|
||||
|
||||
**中文** | [English](./README.en-US.md)
|
||||
|
||||
**English** | [中文](./README.zh-CN.md)
|
||||
## 简介
|
||||
|
||||
## Introduction
|
||||
vue-pure-admin 是一个免费开源的中后台模版。使用了最新的`vue3`,`vite2`,`TypeScript`,`Element-Plus`等主流技术开发,开箱即用的中后台前端解决方案,也可用于学习参考。
|
||||
|
||||
vue-pure-admin is a free and open source middle and back-end template. Using the latest `vue3`, `vite2`, `TypeScript`, `Element-Plus` and other mainstream technology development, the out-of-the-box middle and back-end front-end solutions can also be used for learning reference.
|
||||
## 预览
|
||||
|
||||
## Preview
|
||||
- [vue-pure-admin](http://yiming_chang.gitee.io/manages)
|
||||
|
||||
- [vue-pure-admin](http://yiming_chang.gitee.io/manages)
|
||||
|
||||
Click to log in without password
|
||||
点击免密登录
|
||||
|
||||
<p align="center">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/31d4e268a9554389abb2b691a165f983~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9c81c5348fb2476097dd847e3b050168~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/13749b799727449cbdcb2383f6ea1eb4~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/6745a79321cc40aba4de02aaf11ba4f2~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/cab5f2aa2b58483f8a2cf40fb3aafdb7~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f5ee80eee1014fb4a53c5bb37574a5f5~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/dec0672a62e141f3b7f626c22ff6c7ef~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f586f1353de74b1b88cc9f89fce2146e~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/a28fc0af7ac44e3b8f30469cba4a9993~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/a17e54329cda4d76aa9c1c4f2a4715d3~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d884fb611da74ee0bdc17c29014d0260~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/abed44ac1f2744e897c28d1689bcb517~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/cf2f068650f44a0787c699f5a20c75a6~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/73c575dd06474731ad8ab9d853f1ddfd~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/99389b90f5ac4db9b0d61d99dd9a1454~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f1546f1c6014446db6c9983934aedc86~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/cfb0093b77c34e87b094daaa4304bc2d~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/fe133cc6db3245f9b1b37f231d040550~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d3110a12d63e4f6fb314e60bf18bdb66~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/45b93ec453e3406a939affe65ddcc803~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/cdc2dc88c1ef4aafbaaade820442c986~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="PureAdmin Logo" width="100%" src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f4c91b162206485b88cc58a72ff54a01~tplv-k3u1fbpfcp-watermark.image">
|
||||
</p>
|
||||
|
||||
### Use Gitpod
|
||||
### 使用 Gitpod
|
||||
|
||||
Open the project in Gitpod (free online dev environment for GitHub) and start coding immediately.
|
||||
在 Gitpod(适用于 GitHub 的免费在线开发环境)中打开项目,并立即开始编码.
|
||||
|
||||
[](https://gitpod.io/#https://github.com/xiaoxian521/vue-pure-admin)
|
||||
|
||||
## Install and use
|
||||
## 安装使用
|
||||
|
||||
- Get the project code
|
||||
- 获取项目代码
|
||||
|
||||
```bash
|
||||
git clone https://github.com/xiaoxian521/vue-pure-admin.git
|
||||
@@ -39,81 +50,87 @@ or
|
||||
git clone https://github.com.cnpmjs.org/xiaoxian521/vue-pure-admin.git
|
||||
```
|
||||
|
||||
- Installation dependencies
|
||||
- 安装依赖
|
||||
|
||||
```bash
|
||||
cd vue-pure-admin
|
||||
|
||||
npm install
|
||||
yarn install
|
||||
|
||||
```
|
||||
|
||||
- run
|
||||
- 运行
|
||||
|
||||
```bash
|
||||
yarn serve
|
||||
```
|
||||
|
||||
- build
|
||||
- 打包
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
yarn build
|
||||
```
|
||||
|
||||
## Change Log
|
||||
## 更新日志
|
||||
|
||||
[CHANGELOG](./CHANGELOG.en_US.md)
|
||||
[CHANGELOG](./CHANGELOG.zh_CN.md)
|
||||
|
||||
## How to contribute
|
||||
## 如何贡献
|
||||
|
||||
You are very welcome to join Or submit a Pull Request
|
||||
非常欢迎你的加入 或者提交一个 Pull Request
|
||||
|
||||
**Pull Request:**
|
||||
|
||||
1. Fork code!
|
||||
2. Create your own branch: `git checkout -b feat/xxxx`
|
||||
3. Submit your changes: `git commit -am 'feat(function): add xxxxx'`
|
||||
4. Push your branch: `git push origin feat/xxxx`
|
||||
5. submit`pull request`
|
||||
1. Fork 代码!
|
||||
2. 创建自己的分支: `git checkout -b feat/xxxx`
|
||||
3. 提交你的修改: `git commit -am 'feat(function): add xxxxx'`
|
||||
4. 推送您的分支: `git push origin feat/xxxx`
|
||||
5. 提交`pull request`
|
||||
|
||||
## Git Contribution submission specification
|
||||
## Git 贡献提交规范
|
||||
|
||||
- reference [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) specification ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular))
|
||||
- 参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 规范 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular))
|
||||
|
||||
- `feat` Add new features
|
||||
- `fix` Fix the problem/BUG
|
||||
- `style` The code style is related and does not affect the running result
|
||||
- `perf` Optimization/performance improvement
|
||||
- `refactor` Refactor
|
||||
- `revert` Undo edit
|
||||
- `test` Test related
|
||||
- `docs` Documentation/notes
|
||||
- `chore` Dependency update/scaffolding configuration modification etc.
|
||||
- `workflow` Workflow improvements
|
||||
- `ci` Continuous integration
|
||||
- `types` Type definition file changes
|
||||
- `wip` In development
|
||||
- `feat` 增加新功能
|
||||
- `fix` 修复问题/BUG
|
||||
- `style` 代码风格相关无影响运行结果的
|
||||
- `perf` 优化/性能提升
|
||||
- `refactor` 重构
|
||||
- `revert` 撤销修改
|
||||
- `test` 测试相关
|
||||
- `docs` 文档/注释
|
||||
- `chore` 依赖更新/脚手架配置修改等
|
||||
- `workflow` 工作流改进
|
||||
- `ci` 持续集成
|
||||
- `types` 类型定义文件更改
|
||||
- `wip` 开发中
|
||||
|
||||
## Browser support
|
||||
## 浏览器支持
|
||||
|
||||
The `Chrome 80+` browser is recommended for local development
|
||||
本地开发推荐使用`Chrome 80+` 浏览器
|
||||
|
||||
Support modern browsers, not IE
|
||||
支持现代浏览器, 不支持 IE
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
|
||||
| :-: | :-: | :-: | :-: | :-: |
|
||||
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
|
||||
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
||||
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
|
||||
|
||||
## Maintainer
|
||||
## 维护者
|
||||
|
||||
[xiaoxian521](https://github.com/xiaoxian521)
|
||||
|
||||
## Donate
|
||||
## 捐赠
|
||||
|
||||
If you think this project is helpful to you, you can help the author buy a cup of coffee to show your support!
|
||||
如果你觉得这个项目对你有帮助,你可以帮作者买一杯咖啡表示支持!
|
||||
|
||||

|
||||
|
||||
## 交流群
|
||||
|
||||
请扫码加入微信交流群,有问题可以在群里沟通!
|
||||
|
||||

|
||||
|
||||
## License
|
||||
|
||||
[MIT © xiaoxian521-2020](./LICENSE)
|
||||
|
||||
119
README.zh-CN.md
@@ -1,119 +0,0 @@
|
||||
<h1>vue-pure-admin</h1>
|
||||
|
||||
[](LICENSE)
|
||||
|
||||
|
||||
**中文** | [English](./README.md)
|
||||
|
||||
## 简介
|
||||
|
||||
vue-pure-admin 是一个免费开源的中后台模版。使用了最新的`vue3`,`vite2`,`TypeScript`,`Element-Plus`等主流技术开发,开箱即用的中后台前端解决方案,也可用于学习参考。
|
||||
|
||||
## 预览
|
||||
|
||||
- [vue-pure-admin](http://yiming_chang.gitee.io/manages)
|
||||
|
||||
点击免密登录
|
||||
|
||||
<p align="center">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/31d4e268a9554389abb2b691a165f983~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9c81c5348fb2476097dd847e3b050168~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/13749b799727449cbdcb2383f6ea1eb4~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/6745a79321cc40aba4de02aaf11ba4f2~tplv-k3u1fbpfcp-watermark.image">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/cab5f2aa2b58483f8a2cf40fb3aafdb7~tplv-k3u1fbpfcp-watermark.image">
|
||||
</p>
|
||||
|
||||
### 使用 Gitpod
|
||||
|
||||
在 Gitpod(适用于 GitHub 的免费在线开发环境)中打开项目,并立即开始编码.
|
||||
|
||||
[](https://gitpod.io/#https://github.com/xiaoxian521/vue-pure-admin)
|
||||
|
||||
## 安装使用
|
||||
|
||||
- 获取项目代码
|
||||
|
||||
```bash
|
||||
git clone https://github.com/xiaoxian521/vue-pure-admin.git
|
||||
or
|
||||
git clone https://github.com.cnpmjs.org/xiaoxian521/vue-pure-admin.git
|
||||
```
|
||||
|
||||
- 安装依赖
|
||||
|
||||
```bash
|
||||
cd vue-pure-admin
|
||||
|
||||
npm install
|
||||
|
||||
```
|
||||
|
||||
- 运行
|
||||
|
||||
```bash
|
||||
yarn serve
|
||||
```
|
||||
|
||||
- 打包
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
## 更新日志
|
||||
|
||||
[CHANGELOG](./CHANGELOG.zh_CN.md)
|
||||
|
||||
## 如何贡献
|
||||
|
||||
非常欢迎你的加入 或者提交一个 Pull Request
|
||||
|
||||
**Pull Request:**
|
||||
|
||||
1. Fork 代码!
|
||||
2. 创建自己的分支: `git checkout -b feat/xxxx`
|
||||
3. 提交你的修改: `git commit -am 'feat(function): add xxxxx'`
|
||||
4. 推送您的分支: `git push origin feat/xxxx`
|
||||
5. 提交`pull request`
|
||||
|
||||
## Git 贡献提交规范
|
||||
|
||||
- 参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 规范 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular))
|
||||
|
||||
- `feat` 增加新功能
|
||||
- `fix` 修复问题/BUG
|
||||
- `style` 代码风格相关无影响运行结果的
|
||||
- `perf` 优化/性能提升
|
||||
- `refactor` 重构
|
||||
- `revert` 撤销修改
|
||||
- `test` 测试相关
|
||||
- `docs` 文档/注释
|
||||
- `chore` 依赖更新/脚手架配置修改等
|
||||
- `workflow` 工作流改进
|
||||
- `ci` 持续集成
|
||||
- `types` 类型定义文件更改
|
||||
- `wip` 开发中
|
||||
|
||||
## 浏览器支持
|
||||
|
||||
本地开发推荐使用`Chrome 80+` 浏览器
|
||||
|
||||
支持现代浏览器, 不支持 IE
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
|
||||
| :-: | :-: | :-: | :-: | :-: |
|
||||
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
|
||||
|
||||
## 维护者
|
||||
|
||||
[xiaoxian521](https://github.com/xiaoxian521)
|
||||
|
||||
## 捐赠
|
||||
|
||||
如果你觉得这个项目对你有帮助,你可以帮作者买一杯咖啡表示支持!
|
||||
|
||||

|
||||
|
||||
## License
|
||||
|
||||
[MIT © xiaoxian521-2020](./LICENSE)
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
const productPlugins = []
|
||||
process.env.NODE_ENV === "production" && productPlugins.push("transform-remove-console")
|
||||
const productPlugins = [];
|
||||
process.env.NODE_ENV === "production" &&
|
||||
productPlugins.push("transform-remove-console");
|
||||
module.exports = {
|
||||
plugins: [...productPlugins],
|
||||
}
|
||||
plugins: [...productPlugins]
|
||||
};
|
||||
|
||||
@@ -2,9 +2,9 @@ type ProxyItem = [string, string];
|
||||
|
||||
type ProxyList = ProxyItem[];
|
||||
|
||||
const regExps = (value: string,reg: string): string => {
|
||||
return value.replace(new RegExp(reg, 'g'), '');
|
||||
}
|
||||
const regExps = (value: string, reg: string): string => {
|
||||
return value.replace(new RegExp(reg, "g"), "");
|
||||
};
|
||||
|
||||
export function createProxy(list: ProxyList = []) {
|
||||
const ret: any = {};
|
||||
@@ -12,8 +12,8 @@ export function createProxy(list: ProxyList = []) {
|
||||
ret[prefix] = {
|
||||
target: target,
|
||||
changeOrigin: true,
|
||||
rewrite: (path:string) => regExps(path, prefix)
|
||||
rewrite: (path: string) => regExps(path, prefix)
|
||||
};
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +1,32 @@
|
||||
import dotenv from 'dotenv';
|
||||
|
||||
export interface ViteEnv {
|
||||
VITE_PORT: number;
|
||||
VITE_OPEN: boolean;
|
||||
VITE_USE_MOCK: boolean;
|
||||
VITE_PUBLIC_PATH: string;
|
||||
VITE_PROXY: [string, string][];
|
||||
}
|
||||
|
||||
export function loadEnv(): ViteEnv {
|
||||
const env = process.env.NODE_ENV;
|
||||
const warpperEnv = (envConf: Recordable): ViteEnv => {
|
||||
const ret: any = {};
|
||||
const envList = [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env', ,]
|
||||
envList.forEach((e) => {
|
||||
dotenv.config({
|
||||
path: e,
|
||||
});
|
||||
});
|
||||
for (const envName of Object.keys(process.env)) {
|
||||
let realName = (process.env as any)[envName].replace(/\\n/g, '\n');
|
||||
realName = realName === 'true' ? true : realName === 'false' ? false : realName;
|
||||
if (envName === 'VITE_PORT') {
|
||||
|
||||
for (const envName of Object.keys(envConf)) {
|
||||
let realName = envConf[envName].replace(/\\n/g, "\n");
|
||||
realName =
|
||||
realName === "true" ? true : realName === "false" ? false : realName;
|
||||
|
||||
if (envName === "VITE_PORT") {
|
||||
realName = Number(realName);
|
||||
}
|
||||
if (envName === 'VITE_OPEN') {
|
||||
realName = Boolean(realName);
|
||||
}
|
||||
if (envName === 'VITE_PROXY') {
|
||||
if (envName === "VITE_PROXY" && realName) {
|
||||
try {
|
||||
realName = JSON.parse(realName);
|
||||
} catch (error) { }
|
||||
realName = JSON.parse(realName.replace(/'/g, '"'));
|
||||
} catch (error) {
|
||||
realName = "";
|
||||
}
|
||||
}
|
||||
ret[envName] = realName;
|
||||
process.env[envName] = realName;
|
||||
if (typeof realName === "string") {
|
||||
process.env[envName] = realName;
|
||||
} else if (typeof realName === "object") {
|
||||
process.env[envName] = JSON.stringify(realName);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
const loadEnv = (): ViteEnv => {
|
||||
return import.meta.env;
|
||||
};
|
||||
|
||||
export { loadEnv, warpperEnv };
|
||||
|
||||
32
commitlint.config.js
Normal file
@@ -0,0 +1,32 @@
|
||||
module.exports = {
|
||||
ignores: [commit => commit.includes("init")],
|
||||
extends: ["@commitlint/config-conventional"],
|
||||
rules: {
|
||||
"body-leading-blank": [2, "always"],
|
||||
"footer-leading-blank": [1, "always"],
|
||||
"header-max-length": [2, "always", 108],
|
||||
"subject-empty": [2, "never"],
|
||||
"type-empty": [2, "never"],
|
||||
"type-enum": [
|
||||
2,
|
||||
"always",
|
||||
[
|
||||
"feat",
|
||||
"fix",
|
||||
"perf",
|
||||
"style",
|
||||
"docs",
|
||||
"test",
|
||||
"refactor",
|
||||
"build",
|
||||
"ci",
|
||||
"chore",
|
||||
"revert",
|
||||
"wip",
|
||||
"workflow",
|
||||
"types",
|
||||
"release"
|
||||
]
|
||||
]
|
||||
}
|
||||
};
|
||||
235
index.html
@@ -1,139 +1,120 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<link rel="stylesheet" href="/iconfont.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>后台管理系统</title>
|
||||
<script src="/sortable.min.js"></script>
|
||||
<script>
|
||||
window.process = {};
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<link rel="stylesheet" href="/iconfont.css" />
|
||||
<link rel="stylesheet" href="/animate.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>后台管理系统</title>
|
||||
<script src="https://cdn.bootcdn.net/ajax/libs/Sortable/1.13.0/Sortable.js"></script>
|
||||
<script>
|
||||
window.process = {}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
pad: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
section {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
background: #001d10;
|
||||
animation: animateBackgroundC0olor 10s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes animateBackgroundC0olor {
|
||||
0% {
|
||||
filter: hue-rotate(0deg);
|
||||
<body>
|
||||
<div id="app">
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
filter: hue-rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.loading {
|
||||
position: relative;
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
.loading .blocks {
|
||||
position: absolute;
|
||||
width: 8px;
|
||||
height: 25px;
|
||||
background-color: #050c09;
|
||||
left: 50%;
|
||||
border-radius: 8px;
|
||||
transform: rotate(calc(18deg * var(--i)));
|
||||
transform-origin: 0 125px;
|
||||
animation: animate 1.9s ease-in-out infinite;
|
||||
animation-delay: calc(0.05s * var(--i));
|
||||
}
|
||||
|
||||
@keyframes animate {
|
||||
|
||||
0%,
|
||||
50% {
|
||||
background: #050c09;
|
||||
box-shadow: none;
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #000;
|
||||
overflow: hidden;
|
||||
font-family: "Reggae One", cursive;
|
||||
}
|
||||
|
||||
50.1%,
|
||||
100% {
|
||||
background: #0f0;
|
||||
box-sizing: 0 0 5px #0f0,
|
||||
0 0 15px #0f0,
|
||||
0 0 30px #0f0,
|
||||
0 0 60px #0f0,
|
||||
0 0 90px #0f0;
|
||||
}
|
||||
}
|
||||
|
||||
h3 {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 2em;
|
||||
letter-spacing: 2px;
|
||||
animation: animateText 2s ease-in-out infinite;
|
||||
animation-delay: -1s;
|
||||
}
|
||||
|
||||
@keyframes animateText {
|
||||
|
||||
0%,
|
||||
50% {
|
||||
color: #050c09;
|
||||
text-shadow: none;
|
||||
p {
|
||||
font-size: 8vw;
|
||||
overflow: hidden;
|
||||
-webkit-text-stroke: 3px #7272a5;
|
||||
}
|
||||
|
||||
50.1%,
|
||||
100% {
|
||||
color: #0f0;
|
||||
text-shadow: 0 0 5px #0f0,
|
||||
0 0 15px #0f0;
|
||||
span {
|
||||
display: block;
|
||||
font-size: 20px;
|
||||
overflow: hidden;
|
||||
color: green;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<section>
|
||||
<div class="loading">
|
||||
<div class="blocks" style="--i:1;"></div>
|
||||
<div class="blocks" style="--i:2;"></div>
|
||||
<div class="blocks" style="--i:3;"></div>
|
||||
<div class="blocks" style="--i:4;"></div>
|
||||
<div class="blocks" style="--i:5;"></div>
|
||||
<div class="blocks" style="--i:6;"></div>
|
||||
<div class="blocks" style="--i:7;"></div>
|
||||
<div class="blocks" style="--i:8;"></div>
|
||||
<div class="blocks" style="--i:9;"></div>
|
||||
<div class="blocks" style="--i:10;"></div>
|
||||
<div class="blocks" style="--i:11;"></div>
|
||||
<div class="blocks" style="--i:12;"></div>
|
||||
<div class="blocks" style="--i:13;"></div>
|
||||
<div class="blocks" style="--i:14;"></div>
|
||||
<div class="blocks" style="--i:15;"></div>
|
||||
<div class="blocks" style="--i:16;"></div>
|
||||
<div class="blocks" style="--i:17;"></div>
|
||||
<div class="blocks" style="--i:18;"></div>
|
||||
<div class="blocks" style="--i:19;"></div>
|
||||
<div class="blocks" style="--i:20;"></div>
|
||||
<h3>loading</h3>
|
||||
|
||||
p::before {
|
||||
content: " ";
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background-image: linear-gradient(45deg, #ff269b, #2ab5f5, #ffbf00);
|
||||
mix-blend-mode: multiply;
|
||||
}
|
||||
|
||||
p::after {
|
||||
content: "";
|
||||
background: radial-gradient(circle, #fff, #000 50%);
|
||||
background-size: 25% 25%;
|
||||
position: absolute;
|
||||
top: -100%;
|
||||
left: -100%;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
mix-blend-mode: color-dodge;
|
||||
animation: mix 2s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes mix {
|
||||
to {
|
||||
transform: translate(50%, 50%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="g-container">
|
||||
<p>Pure-Admin</p>
|
||||
<span class="_develop"></span>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</div>
|
||||
<script>
|
||||
// 此代码仅用于开发环境的友好提示,项目打包前请去掉这段js代码 This code is only used as a friendly reminder of the development environment, please remove this js code before packaging the project
|
||||
window.onload = function () {
|
||||
(function () {
|
||||
const ua = navigator.userAgent.toLowerCase();
|
||||
const re = /(msie|firefox|chrome|opera|version).*?([\d.]+)/;
|
||||
const m = ua.match(re);
|
||||
const Sys = {
|
||||
browser: m[1].replace(/version/, "'safari"),
|
||||
version: m[2]
|
||||
};
|
||||
|
||||
</html>
|
||||
const browser = Array.of("chrome", "firefox").includes(Sys.browser);
|
||||
const version = parseFloat(Sys.version);
|
||||
|
||||
const el = document.querySelector("._develop");
|
||||
|
||||
if (el) {
|
||||
if (browser && version >= 90) {
|
||||
let success =
|
||||
document.createTextNode("当前浏览器版本很适合开发!!! 😃");
|
||||
el.appendChild(success);
|
||||
} else {
|
||||
let warn = document.createTextNode(
|
||||
"当前浏览器版本不适合开发,建议使用最新版本的谷歌或者火狐浏览器!!!😯"
|
||||
);
|
||||
el.appendChild(warn);
|
||||
el.style.color = "red";
|
||||
}
|
||||
}
|
||||
return Sys;
|
||||
})();
|
||||
};
|
||||
</script>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
90
mock/asyncRoutes.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
// 根据角色动态生成路由
|
||||
import { MockMethod } from "vite-plugin-mock";
|
||||
|
||||
// http://mockjs.com/examples.html#Object
|
||||
const systemRouter = {
|
||||
path: "/system",
|
||||
name: "system",
|
||||
redirect: "/system/user",
|
||||
meta: {
|
||||
icon: "el-icon-setting",
|
||||
title: "message.hssysManagement",
|
||||
showLink: true,
|
||||
rank: 6
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/system/user",
|
||||
name: "user",
|
||||
meta: {
|
||||
title: "message.hsBaseinfo",
|
||||
showLink: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/system/dict",
|
||||
name: "dict",
|
||||
meta: {
|
||||
title: "message.hsDict",
|
||||
showLink: true
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const permissionRouter = {
|
||||
path: "/permission",
|
||||
name: "permission",
|
||||
redirect: "/permission/page",
|
||||
meta: {
|
||||
title: "message.permission",
|
||||
icon: "el-icon-lollipop",
|
||||
showLink: true,
|
||||
rank: 3
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/permission/page",
|
||||
name: "permissionPage",
|
||||
meta: {
|
||||
title: "message.permissionPage",
|
||||
showLink: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/permission/button",
|
||||
name: "permissionButton",
|
||||
meta: {
|
||||
title: "message.permissionButton",
|
||||
showLink: true,
|
||||
authority: []
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// 添加不同按钮权限到/permission/button页面中
|
||||
function setDifAuthority(authority, routes) {
|
||||
routes.children[1].meta.authority = [authority];
|
||||
return routes;
|
||||
}
|
||||
|
||||
export default [
|
||||
{
|
||||
url: "/getAsyncRoutes",
|
||||
method: "get",
|
||||
response: ({ query }) => {
|
||||
if (query.name === "admin") {
|
||||
return {
|
||||
code: 0,
|
||||
info: [systemRouter, setDifAuthority("v-admin", permissionRouter)]
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
code: 0,
|
||||
info: [setDifAuthority("v-test", permissionRouter)]
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
] as MockMethod[];
|
||||
@@ -1,23 +1,23 @@
|
||||
import { MockMethod } from 'vite-plugin-mock'
|
||||
import { MockMethod } from "vite-plugin-mock";
|
||||
|
||||
// http://mockjs.com/examples.html#Object
|
||||
const echartsList = (): any => {
|
||||
const result: any[] = []
|
||||
const result: any[] = [];
|
||||
for (let index = 0; index < 200; index++) {
|
||||
result.push(['@date', Math.floor(Math.random() * 300)])
|
||||
result.push(["@date", Math.floor(Math.random() * 300)]);
|
||||
}
|
||||
return result
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export default [
|
||||
{
|
||||
url: '/getEchartsInfo',
|
||||
method: 'get',
|
||||
url: "/getEchartsInfo",
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
code: 0,
|
||||
info: echartsList()
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
] as MockMethod[]
|
||||
] as MockMethod[];
|
||||
|
||||
22
mock/map.ts
@@ -1,29 +1,29 @@
|
||||
import { MockMethod } from 'vite-plugin-mock'
|
||||
import { MockMethod } from "vite-plugin-mock";
|
||||
|
||||
// http://mockjs.com/examples.html#Object
|
||||
const mapList = (): any => {
|
||||
const result: any[] = []
|
||||
const result: any[] = [];
|
||||
for (let index = 0; index < 200; index++) {
|
||||
result.push({
|
||||
plateNumber: "豫A@natural(11111, 99999)@character('upper')",
|
||||
driver: '@cname()',
|
||||
driver: "@cname()",
|
||||
"orientation|1-360": 100,
|
||||
"lng|113-114.1-10": 1,
|
||||
"lat|34-35.1-10": 1
|
||||
})
|
||||
});
|
||||
}
|
||||
return result
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export default [
|
||||
{
|
||||
url: '/getMapInfo',
|
||||
method: 'get',
|
||||
url: "/getMapInfo",
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
code: 0,
|
||||
info: mapList()
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
] as MockMethod[]
|
||||
] as MockMethod[];
|
||||
|
||||
2300
package-lock.json
generated
111
package.json
@@ -1,57 +1,104 @@
|
||||
{
|
||||
"name": "vue-ts",
|
||||
"version": "1.0.0",
|
||||
"name": "vue-pure-admin",
|
||||
"version": "2.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vite",
|
||||
"build": "vite build"
|
||||
"dev": "cross-env --max_old_space_size=4096 vite",
|
||||
"serve": "yarn dev",
|
||||
"build": "rimraf dist && cross-env vite build",
|
||||
"preview": "vite preview",
|
||||
"preview:build": "yarn build && vite preview",
|
||||
"clean:cache": "rm -rf node_modules && rm -rf .eslintcache && yarn cache clean && yarn",
|
||||
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix",
|
||||
"lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
|
||||
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,css,scss,postcss,less}\" --cache --cache-location node_modules/.cache/stylelint/",
|
||||
"lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js",
|
||||
"lint:pretty": "pretty-quick --staged",
|
||||
"lint": "yarn lint:eslint && yarn lint:prettier && yarn lint:stylelint && yarn lint:pretty",
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"dependencies": {
|
||||
"@amap/amap-jsapi-loader": "^1.0.1",
|
||||
"@logicflow/core": "^0.2.9",
|
||||
"@vueuse/core": "^4.8.1",
|
||||
"await-to-js": "^2.1.1",
|
||||
"@logicflow/core": "^0.4.6",
|
||||
"@logicflow/extension": "^0.4.6",
|
||||
"@vueuse/core": "^6.5.3",
|
||||
"animate.css": "^4.1.1",
|
||||
"await-to-js": "^3.0.0",
|
||||
"axios": "^0.21.1",
|
||||
"cropperjs": "^1.5.11",
|
||||
"dayjs": "^1.10.4",
|
||||
"dotenv": "^8.2.0",
|
||||
"echarts": "^5.0.2",
|
||||
"element-plus": "^1.0.2-beta.37",
|
||||
"dayjs": "^1.10.7",
|
||||
"echarts": "^5.2.1",
|
||||
"element-plus": "1.1.0-beta.20",
|
||||
"element-resize-detector": "^1.2.3",
|
||||
"font-awesome": "^4.7.0",
|
||||
"mitt": "^2.1.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"lowdb": "^3.0.0",
|
||||
"mitt": "^3.0.0",
|
||||
"mockjs": "^1.1.0",
|
||||
"nprogress": "^0.2.0",
|
||||
"path": "^0.12.7",
|
||||
"path-to-regexp": "^6.2.0",
|
||||
"pinia": "2.0.0-rc.10",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"v-contextmenu": "^3.0.0-alpha.4",
|
||||
"vue": "^3.0.11",
|
||||
"vue-i18n": "^9.1.2",
|
||||
"vue-router": "^4.0.6",
|
||||
"vue-types": "^3.0.2",
|
||||
"vuedraggable": "^4.0.1",
|
||||
"vuex": "^4.0.0",
|
||||
"vxe-table": "^4.0.7-beta.4",
|
||||
"wangeditor": "^4.0.3",
|
||||
"responsive-storage": "^1.0.11",
|
||||
"sortablejs": "1.13.0",
|
||||
"typescript-cookie": "^1.0.0",
|
||||
"v-contextmenu": "^3.0.0",
|
||||
"vue": "^3.2.20",
|
||||
"vue-i18n": "^9.2.0-beta.3",
|
||||
"vue-json-pretty": "^2.0.2",
|
||||
"vue-router": "^4.0.11",
|
||||
"vue-types": "^4.1.0",
|
||||
"vuedraggable": "^4.1.0",
|
||||
"vxe-table": "^4.0.27",
|
||||
"wangeditor": "^4.7.7",
|
||||
"xe-ajax": "^4.0.5",
|
||||
"xe-utils": "^3.1.12",
|
||||
"xgplayer": "^2.18.3"
|
||||
"xe-utils": "^3.3.1",
|
||||
"xgplayer": "^2.28.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^13.1.0",
|
||||
"@commitlint/config-conventional": "^13.1.0",
|
||||
"@types/element-resize-detector": "^1.1.3",
|
||||
"@types/mockjs": "^1.0.3",
|
||||
"@types/node": "^14.14.14",
|
||||
"@types/nprogress": "^0.2.0",
|
||||
"@vitejs/plugin-vue": "^1.2.1",
|
||||
"@vitejs/plugin-vue-jsx": "^1.1.3",
|
||||
"@vue/compiler-sfc": "^3.0.11",
|
||||
"@typescript-eslint/eslint-plugin": "^4.31.0",
|
||||
"@typescript-eslint/parser": "^4.31.0",
|
||||
"@vitejs/plugin-vue": "^1.6.0",
|
||||
"@vitejs/plugin-vue-jsx": "^1.1.7",
|
||||
"@vue/compiler-sfc": "^3.2.20",
|
||||
"@vue/eslint-config-prettier": "^6.0.0",
|
||||
"@vue/eslint-config-typescript": "^7.0.0",
|
||||
"autoprefixer": "^10.2.4",
|
||||
"babel-plugin-transform-remove-console": "^6.9.4",
|
||||
"chalk": "^2.4.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^7.30.0",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"eslint-plugin-vue": "^7.17.0",
|
||||
"husky": "^7.0.2",
|
||||
"lint-staged": "^11.1.2",
|
||||
"postcss": "^8.2.6",
|
||||
"postcss-import": "^14.0.0",
|
||||
"sass": "^1.32.8",
|
||||
"sass-loader": "^11.0.1",
|
||||
"typescript": "^4.2.4",
|
||||
"vite": "^2.1.5",
|
||||
"vite-plugin-mock": "^2.5.0"
|
||||
}
|
||||
"prettier": "^2.3.2",
|
||||
"pretty-quick": "^3.1.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"sass": "^1.38.0",
|
||||
"sass-loader": "^12.1.0",
|
||||
"stylelint": "^13.13.1",
|
||||
"stylelint-config-prettier": "^8.0.2",
|
||||
"stylelint-config-standard": "^22.0.0",
|
||||
"stylelint-order": "^4.1.0",
|
||||
"typescript": "^4.4.2",
|
||||
"unplugin-element-plus": "^0.1.0",
|
||||
"vite": "^2.6.7",
|
||||
"vite-plugin-mock": "^2.9.6",
|
||||
"vite-plugin-style-import": "^1.2.1",
|
||||
"vite-svg-loader": "^2.2.0",
|
||||
"vue-eslint-parser": "^7.10.0"
|
||||
},
|
||||
"repository": "git@github.com:xiaoxian521/vue-pure-admin.git",
|
||||
"author": "xiaoxian521",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module.exports = {
|
||||
plugins: [require('autoprefixer'), require('postcss-import')],
|
||||
};
|
||||
plugins: [require("autoprefixer"), require("postcss-import")]
|
||||
};
|
||||
|
||||
11
public/animate.css
vendored
BIN
public/pay.jpg
|
Before Width: | Height: | Size: 91 KiB |
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"Version": "2.0.0",
|
||||
"KeepAlive": true,
|
||||
"Locale": "zh",
|
||||
"Layout": "vertical-dark",
|
||||
"MapConfigure": {
|
||||
"amapKey": "97b3248d1553172e81f168cf94ea667e",
|
||||
"baiduKey": "wTHbkkEweiFqZLKunMIjcrb2RcqNXkhc",
|
||||
"options": {
|
||||
"resizeEnable": true,
|
||||
"center": [
|
||||
114.085947,
|
||||
22.547
|
||||
],
|
||||
"center": [113.6401, 34.72468],
|
||||
"zoom": 12
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2607
public/sortable.min.js
vendored
Normal file
29
src/App.vue
@@ -1,3 +1,28 @@
|
||||
<template>
|
||||
<router-view />
|
||||
</template>
|
||||
<el-config-provider :locale="currentLocale">
|
||||
<router-view />
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { ElConfigProvider } from "element-plus";
|
||||
import zhCn from "element-plus/lib/locale/lang/zh-cn";
|
||||
import en from "element-plus/lib/locale/lang/en";
|
||||
export default {
|
||||
name: "app",
|
||||
components: {
|
||||
[ElConfigProvider.name]: ElConfigProvider
|
||||
},
|
||||
computed: {
|
||||
// eslint-disable-next-line vue/return-in-computed-property
|
||||
currentLocale() {
|
||||
switch (this.$storage.locale?.locale) {
|
||||
case "zh":
|
||||
return zhCn;
|
||||
case "en":
|
||||
return en;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
|
||||
import { http } from "../utils/http"
|
||||
import { http } from "../utils/http";
|
||||
|
||||
// 地图数据
|
||||
export const mapJson = (data?: object): any => {
|
||||
return http.request("get", "/getMapInfo", data)
|
||||
}
|
||||
export const mapJson = (data?: object) => {
|
||||
return http.request("get", "/getMapInfo", data);
|
||||
};
|
||||
|
||||
// echarts数据
|
||||
export const echartsJson = (data?: object): any => {
|
||||
return http.request("get", "/getEchartsInfo", data)
|
||||
}
|
||||
export const echartsJson = (data?: object) => {
|
||||
return http.request("get", "/getEchartsInfo", data);
|
||||
};
|
||||
|
||||
5
src/api/routes.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { http } from "../utils/http";
|
||||
|
||||
export const getAsyncRoutes = (data?: object) => {
|
||||
return http.request("get", "/getAsyncRoutes", data);
|
||||
};
|
||||
@@ -1,16 +1,16 @@
|
||||
import { http } from "../utils/http"
|
||||
import { http } from "../utils/http";
|
||||
|
||||
// 获取验证码
|
||||
export const getVerify = (): any => {
|
||||
return http.request("get", "/captcha")
|
||||
}
|
||||
export const getVerify = () => {
|
||||
return http.request("get", "/captcha");
|
||||
};
|
||||
|
||||
// 登录
|
||||
export const getLogin = (data: object): any => {
|
||||
return http.request("post", "/login", data)
|
||||
}
|
||||
export const getLogin = (data: object) => {
|
||||
return http.request("post", "/login", data);
|
||||
};
|
||||
|
||||
// 注册
|
||||
export const getRegist = (data: object): any => {
|
||||
return http.request("post", "/register", data)
|
||||
}
|
||||
export const getRegist = (data: object) => {
|
||||
return http.request("post", "/register", data);
|
||||
};
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
@@ -1,10 +1,8 @@
|
||||
@font-face {font-family: "iconfont";
|
||||
src: url('iconfont.eot?t=1607695324289'); /* IE9 */
|
||||
src: url('iconfont.eot?t=1607695324289#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
||||
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAOYAAsAAAAACDQAAANLAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCfgqEFIMzATYCJAMMCwgABCAFhG0HRhsBB8gekiQBgDxM4A0kAIgioN8v3Ud3F2KVqgCpNrIc0GFVJBVVWVtFrBIhOx5JmMaWNar/v/v99nGtOz+KOqLjkL7t7ovvDWum0bJoImRoGiKExrYjC6g2lM6fV4PQ9vCs/c/l9Fp+RWXzA+Uyx9aoF2A0gQIaa2iUaIEk6CkMr13sMM8T0GwbFdns/NQS6pLRaQHhwtl8BnVldHIDMWgoaxVrs3BV0YiX4wdcCb4fftkeGkQloXMXToUp8n2d+DqZLlXbDngI/nSXQUHCFCQT1iptC1qj2JRWzVqszRC0rWGBr5NVxdcJj7fZPzyCSKihha1gDNJ4RXxH5tL4iIu49k3U0IwNvGUIvZ6i9FKZzM04f1vGCnHQizTFjAGXOnGWLmi8LgG9xC1WmK8lB4pOtBX0Kg4xYfE2ry5ey8Q6JbR6iyf7Mjpdw0qVKO8Uzh3pmbbum7XpTGXrUPUu9Y7qR9nckW8NQE7IjYWNjrm3/r2srSk+619wmEI3RohhGW4tZLwr/U/zycbfUpLCGCbLAW6wwYFl9c4IGxVz7/1lNW2pbcz0E4xYib5sbUw75r4GyvsNvC+bMxvPTkWYPDcepPTFWegO8LOcLO8GFpzGjRcnxHJeHkVhSpcJ8bkDkc+BJ8vxGUGffT10F1p7Vsv7gfWxseePRJdRGkL1OL1IM1D1JEWKPb/zN6bCpwOHB3f+brRk8Pn/w63AWz3Ouhs0btge+Hn8jjVZF1J9yirP4ZnJZFH76+GAIzpVqKvb33BFX+dCgoa+BKK6QUgahjCZMAVFi2l/TcPRCmk2KYrNLXpwrUJuwoQDAkGnV4jaPYak0w8mE36h6PcPNZ0hQbO10LNni5FwtnlmHTICKM5u4WKuXmO2UfSExQuQX6tkeFoYUAlwqRjEeo0un4xCDfgUC6T1vEEIhhmvV3GEXAaVSh03eL0EOaEpCNFwaLWs6kWaXL2KeszgQIYAKCxrC1aUU1fDvMZCT+HzC0DemooM3lBVYyUAJyn2julp6DpgorJap6pbGSxZl2cgCIydxHB1VVgEFlCxYnVYo3pUCcgRNAoDIg0OWqYe6yrTLK+ovt8uaEZ/l0IMKWQdJy8WhZqtVSpSjgPUemItQgA=') format('woff2'),
|
||||
url('iconfont.woff?t=1607695324289') format('woff'),
|
||||
url('iconfont.ttf?t=1607695324289') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
|
||||
url('iconfont.svg?t=1607695324289#iconfont') format('svg'); /* iOS 4.1- */
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 2208059 */
|
||||
src: url("iconfont.woff2?t=1634092870259") format("woff2"),
|
||||
url("iconfont.woff?t=1634092870259") format("woff"),
|
||||
url("iconfont.ttf?t=1634092870259") format("truetype");
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
@@ -15,11 +13,38 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.team-iconexit-fullscreen:before {
|
||||
.team-iconzuixinlianzai::before {
|
||||
content: "\e6da";
|
||||
}
|
||||
|
||||
.team-iconxinpin::before {
|
||||
content: "\e614";
|
||||
}
|
||||
|
||||
.team-iconxinpinrenqiwang::before {
|
||||
content: "\e615";
|
||||
}
|
||||
|
||||
.team-iconinternationality::before {
|
||||
content: "\e67a";
|
||||
}
|
||||
|
||||
.team-iconshanchu::before {
|
||||
content: "\e617";
|
||||
}
|
||||
|
||||
.team-iconshow-main-container::before {
|
||||
content: "\e878";
|
||||
}
|
||||
|
||||
.team-iconhidden-main-container::before {
|
||||
content: "\e881";
|
||||
}
|
||||
|
||||
.team-iconexit-fullscreen::before {
|
||||
content: "\e62a";
|
||||
}
|
||||
|
||||
.team-iconfullscreen:before {
|
||||
.team-iconfullscreen::before {
|
||||
content: "\e62b";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,59 @@
|
||||
{
|
||||
"id": "2208059",
|
||||
"name": "CURD-TS",
|
||||
"name": "pure-admin",
|
||||
"font_family": "iconfont",
|
||||
"css_prefix_text": "team-icon",
|
||||
"description": "增删查改xi't",
|
||||
"description": "pure-admin",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "2508809",
|
||||
"name": "最新连载",
|
||||
"font_class": "zuixinlianzai",
|
||||
"unicode": "e6da",
|
||||
"unicode_decimal": 59098
|
||||
},
|
||||
{
|
||||
"icon_id": "7795613",
|
||||
"name": "新品",
|
||||
"font_class": "xinpin",
|
||||
"unicode": "e614",
|
||||
"unicode_decimal": 58900
|
||||
},
|
||||
{
|
||||
"icon_id": "7795615",
|
||||
"name": "新品人气王",
|
||||
"font_class": "xinpinrenqiwang",
|
||||
"unicode": "e615",
|
||||
"unicode_decimal": 58901
|
||||
},
|
||||
{
|
||||
"icon_id": "18367956",
|
||||
"name": "中英文2 中文",
|
||||
"font_class": "internationality",
|
||||
"unicode": "e67a",
|
||||
"unicode_decimal": 59002
|
||||
},
|
||||
{
|
||||
"icon_id": "6184565",
|
||||
"name": "删除",
|
||||
"font_class": "shanchu",
|
||||
"unicode": "e617",
|
||||
"unicode_decimal": 58903
|
||||
},
|
||||
{
|
||||
"icon_id": "9626913",
|
||||
"name": "全屏",
|
||||
"font_class": "show-main-container",
|
||||
"unicode": "e878",
|
||||
"unicode_decimal": 59512
|
||||
},
|
||||
{
|
||||
"icon_id": "9626952",
|
||||
"name": "退出全屏",
|
||||
"font_class": "hidden-main-container",
|
||||
"unicode": "e881",
|
||||
"unicode_decimal": 59521
|
||||
},
|
||||
{
|
||||
"icon_id": "5698509",
|
||||
"name": "全屏缩小",
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<?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" >
|
||||
<!--
|
||||
2013-9-30: Created.
|
||||
-->
|
||||
<svg>
|
||||
<metadata>
|
||||
Created by iconfont
|
||||
</metadata>
|
||||
<defs>
|
||||
|
||||
<font id="iconfont" horiz-adv-x="1024" >
|
||||
<font-face
|
||||
font-family="iconfont"
|
||||
font-weight="500"
|
||||
font-stretch="normal"
|
||||
units-per-em="1024"
|
||||
ascent="896"
|
||||
descent="-128"
|
||||
/>
|
||||
<missing-glyph />
|
||||
|
||||
<glyph glyph-name="exit-fullscreen" unicode="" d="M366.2 714.2c-1 8-10.8 11.4-16.5 5.7l-53.1-53.1L134.2 829c-3.8 3.8-10 3.8-13.7 0L69 777.7c-3.8-3.8-3.8-10 0-13.7l162.4-162.4-53.3-53.3c-5.7-5.7-2.3-15.5 5.7-16.5l194.6-23c6.2-0.7 11.5 4.5 10.8 10.8l-23 194.6z m12.3-453.3l-194.7-23c-8-1-11.4-10.8-5.7-16.5l53.3-53.3L69 5.899999999999977c-3.8-3.8-3.8-10 0-13.7l51.5-51.4c3.8-3.8 10-3.8 13.7 0l162.4 162.3 53.1-53.1c5.7-5.7 15.5-2.3 16.5 5.7l23 194.4c0.7 6.3-4.5 11.5-10.7 10.8z m269.4 248l194.7 23c8 1 11.4 10.8 5.7 16.5L795 601.6l162.4 162.3c3.8 3.8 3.8 10 0 13.7L905.9 829c-3.8 3.8-10 3.8-13.7 0L729.7 666.8l-53.1 53.1c-5.7 5.7-15.6 2.3-16.5-5.7l-23-194.5c-0.6-6.3 4.6-11.5 10.8-10.8zM795 168.20000000000005l53.3 53.3c5.7 5.7 2.3 15.5-5.7 16.5L648 261c-6.2 0.7-11.5-4.5-10.8-10.8l23-194.6c1-8 10.8-11.4 16.5-5.7l53.1 53.1 162.4-162.3c3.8-3.8 10-3.8 13.7 0l51.5 51.4c3.8 3.8 3.8 10 0 13.7L795 168.20000000000005z m0 0" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="fullscreen" unicode="" d="M229.8 733l55.7 55.7c6 6 2.4 16.2-6 17.2l-203.2 24c-6.5 0.8-12-4.7-11.3-11.3l24-203.2c1-8.4 11.3-11.9 17.2-6l55.4 55.4 169.6-169.4c3.9-3.9 10.4-3.9 14.3 0l53.8 53.6c3.9 3.9 3.9 10.4 0 14.3L229.8 733z m447.3-237.6c3.9-3.9 10.4-3.9 14.3 0L861 664.9l55.4-55.4c6-6 16.2-2.4 17.2 6l24 203c0.8 6.5-4.7 12-11.3 11.3l-203.2-24c-8.4-1-11.9-11.3-6-17.2l55.7-55.7-169.5-169.4c-3.9-3.9-3.9-10.4 0-14.3l53.8-53.8z m256.6-343.9c-1 8.4-11.3 11.9-17.2 6L861 102 691.4 271.5c-3.9 3.9-10.4 3.9-14.3 0l-53.8-53.6c-3.9-3.9-3.9-10.4 0-14.3L792.9 34l-55.7-55.7c-6-6-2.4-16.2 6-17.2l203.2-24c6.5-0.8 12 4.7 11.3 11.3l-24 203.1z m-588.1 120c-3.9 3.9-10.4 3.9-14.3 0L161.7 102l-55.4 55.4c-6 6-16.2 2.4-17.2-6l-24-203c-0.8-6.5 4.7-12.1 11.3-11.3l203.2 24c8.4 1 11.9 11.3 6 17.2l-55.7 55.5 169.6 169.4c3.9 3.9 3.9 10.4 0 14.3l-53.9 54z m0 0" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
|
||||
|
||||
</font>
|
||||
</defs></svg>
|
||||
|
Before Width: | Height: | Size: 2.3 KiB |
1
src/assets/svg/close.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 36 36"><path d="M19.41 18l8.29-8.29a1 1 0 0 0-1.41-1.41L18 16.59l-8.29-8.3a1 1 0 0 0-1.42 1.42l8.3 8.29l-8.3 8.29A1 1 0 1 0 9.7 27.7l8.3-8.29l8.29 8.29a1 1 0 0 0 1.41-1.41z" fill="currentColor"></path></svg>
|
||||
|
After Width: | Height: | Size: 395 B |
1
src/assets/svg/close_all.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 36 36"><path d="M26 17H10a1 1 0 0 0 0 2h16a1 1 0 0 0 0-2z" fill="currentColor"></path></svg>
|
||||
|
After Width: | Height: | Size: 279 B |
1
src/assets/svg/close_left.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none"><path d="M7 12l7 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M7 12l7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M21 12H7.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" ></path><path d="M3 3v18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></g></svg>
|
||||
|
After Width: | Height: | Size: 647 B |
1
src/assets/svg/close_other.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 20 20"><path d="M3 5h14V3H3v2zm12 8V7H5v6h10zM3 17h14v-2H3v2z" fill="currentColor"></path></svg>
|
||||
|
After Width: | Height: | Size: 284 B |
1
src/assets/svg/close_right.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g transform="translate(24 0) scale(-1 1)"><g fill="none"><path d="M7 12l7 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M7 12l7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M21 12H7.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path><path d="M3 3v18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></g></g></svg>
|
||||
|
After Width: | Height: | Size: 693 B |
1
src/assets/svg/exit_screen.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" class="re-screen" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"><g fill="currentColor"><path d="M3.5 4H1V3h2V1h1v2.5l-.5.5zM13 3V1h-1v2.5l.5.5H15V3h-2zm-1 9.5V15h1v-2h2v-1h-2.5l-.5.5zM1 12v1h2v2h1v-2.5l-.5-.5H1zm11-1.5l-.5.5h-7l-.5-.5v-5l.5-.5h7l.5.5v5zM10 7H6v2h4V7z"></path></g></svg>
|
||||
|
After Width: | Height: | Size: 434 B |
1
src/assets/svg/full_screen.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" class="re-screen" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"><g fill="currentColor"><path d="M3 12h10V4H3v8zm2-6h6v4H5V6zM2 6H1V2.5l.5-.5H5v1H2v3zm13-3.5V6h-1V3h-3V2h3.5l.5.5zM14 10h1v3.5l-.5.5H11v-1h3v-3zM2 13h3v1H1.5l-.5-.5V10h1v3z"></path></g></svg>
|
||||
|
After Width: | Height: | Size: 403 B |
1
src/assets/svg/globalization.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="globalization" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512"><path d="M478.33 433.6l-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4zM334.83 362L368 281.65L401.17 362z" fill="currentColor"></path><path d="M267.84 342.92a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73c39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 0 0 0-44H214V70a22 22 0 0 0-44 0v20H54a22 22 0 0 0 0 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36c-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 0 0-40.58 17c.58 1.38 14.55 34.23 52.86 83.93c.92 1.19 1.83 2.35 2.74 3.51c-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1 0 21.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59c22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9z" fill="currentColor"></path></svg>
|
||||
|
After Width: | Height: | Size: 965 B |
1
src/assets/svg/refresh.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512"><path d="M400 148l-21.12-24.57A191.43 191.43 0 0 0 240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 0 0 181.07-128" fill="none" stroke="currentColor" stroke-linecap="square" stroke-miterlimit="10" stroke-width="32"></path><path d="M464 68.45V220a4 4 0 0 1-4 4H308.45a4 4 0 0 1-2.83-6.83L457.17 65.62a4 4 0 0 1 6.83 2.83z" fill="currentColor"></path></svg>
|
||||
|
After Width: | Height: | Size: 561 B |
|
Before Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 127 KiB |
36
src/components/ReCharts/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { App } from "vue";
|
||||
import reBar from "./src/Bar.vue";
|
||||
import reGithub from "./src/Github.vue";
|
||||
import reInfinite from "./src/Infinite.vue";
|
||||
import reLine from "./src/Line.vue";
|
||||
import rePie from "./src/Pie.vue";
|
||||
|
||||
export const ReBar = Object.assign(reBar, {
|
||||
install(app: App) {
|
||||
app.component(reBar.name, reBar);
|
||||
}
|
||||
});
|
||||
|
||||
export const ReGithub = Object.assign(reGithub, {
|
||||
install(app: App) {
|
||||
app.component(reGithub.name, reGithub);
|
||||
}
|
||||
});
|
||||
|
||||
export const ReInfinite = Object.assign(reInfinite, {
|
||||
install(app: App) {
|
||||
app.component(reInfinite.name, reInfinite);
|
||||
}
|
||||
});
|
||||
|
||||
export const ReLine = Object.assign(reLine, {
|
||||
install(app: App) {
|
||||
app.component(reLine.name, reLine);
|
||||
}
|
||||
});
|
||||
|
||||
export const RePie = Object.assign(rePie, {
|
||||
install(app: App) {
|
||||
app.component(rePie.name, rePie);
|
||||
}
|
||||
});
|
||||
96
src/components/ReCharts/src/Bar.vue
Normal file
@@ -0,0 +1,96 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "Bar"
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ECharts } from "echarts";
|
||||
import echarts from "/@/plugins/echarts";
|
||||
import { onBeforeMount, onMounted, nextTick } from "vue";
|
||||
import { useEventListener, tryOnUnmounted, useTimeoutFn } from "@vueuse/core";
|
||||
|
||||
let echartInstance: ECharts;
|
||||
|
||||
function initechartInstance() {
|
||||
const echartDom = document.querySelector(".bar");
|
||||
if (!echartDom) return;
|
||||
// @ts-ignore
|
||||
echartInstance = echarts.init(echartDom);
|
||||
echartInstance.clear(); //清除旧画布 重新渲染
|
||||
|
||||
echartInstance.setOption({
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "shadow"
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
bottom: "20%",
|
||||
height: "68%",
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0
|
||||
// width: "70",
|
||||
// overflow: "truncate"
|
||||
},
|
||||
data: ["open_issues", "forks", "watchers", "star"]
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value"
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: "GitHub信息",
|
||||
type: "bar",
|
||||
data: [3, 204, 1079, 1079]
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
nextTick(() => {
|
||||
initechartInstance();
|
||||
});
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
useEventListener("resize", () => {
|
||||
if (!echartInstance) return;
|
||||
useTimeoutFn(() => {
|
||||
echartInstance.resize();
|
||||
}, 180);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
tryOnUnmounted(() => {
|
||||
if (!echartInstance) return;
|
||||
echartInstance.dispose();
|
||||
echartInstance = null;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="bar"></div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.bar {
|
||||
width: 100%;
|
||||
height: 35vh;
|
||||
}
|
||||
</style>
|
||||
93
src/components/ReCharts/src/Github.vue
Normal file
@@ -0,0 +1,93 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
const lists = ref([
|
||||
{ type: "", label: "善良" },
|
||||
{ type: "success", label: "好学" },
|
||||
{ type: "info", label: "幽默" },
|
||||
{ type: "danger", label: "旅游" },
|
||||
{ type: "warning", label: "追剧" }
|
||||
]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
direction="vertical"
|
||||
:column="3"
|
||||
size="medium"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<i class="el-icon-user"></i>
|
||||
用户名
|
||||
</template>
|
||||
xiaoxian
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<i class="el-icon-mobile-phone"></i>
|
||||
手机号
|
||||
</template>
|
||||
123456789
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<i class="el-icon-location-outline"></i>
|
||||
居住地
|
||||
</template>
|
||||
上海
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
direction="vertical"
|
||||
:column="2"
|
||||
size="medium"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<i class="el-icon-tickets"></i>
|
||||
标签
|
||||
</template>
|
||||
<el-tag
|
||||
v-for="item in lists"
|
||||
:key="item.label"
|
||||
:type="item.type"
|
||||
size="mini"
|
||||
effect="dark"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<i class="el-icon-office-building"></i>
|
||||
联系地址
|
||||
</template>
|
||||
上海市徐汇区
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
direction="vertical"
|
||||
:column="1"
|
||||
size="medium"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<i class="el-icon-notebook-1"></i>
|
||||
留言
|
||||
</template>
|
||||
好好学习,天天向上
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.el-tag--mini {
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
</style>
|
||||
134
src/components/ReCharts/src/Infinite.vue
Normal file
@@ -0,0 +1,134 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue";
|
||||
import { templateRef } from "@vueuse/core";
|
||||
import SeamlessScroll from "/@/components/ReSeamlessScroll";
|
||||
|
||||
const scroll = templateRef<ElRef | null>("scroll", null);
|
||||
|
||||
let listData = ref([
|
||||
{
|
||||
date: "2021-09-01",
|
||||
name: "vue-pure-admin",
|
||||
star: "1000"
|
||||
},
|
||||
{
|
||||
date: "2021-09-02",
|
||||
name: "vue-pure-admin",
|
||||
star: "1100"
|
||||
},
|
||||
{
|
||||
date: "2021-09-03",
|
||||
name: "vue-pure-admin",
|
||||
star: "1200"
|
||||
},
|
||||
{
|
||||
date: "2021-09-04",
|
||||
name: "vue-pure-admin",
|
||||
star: "1300"
|
||||
},
|
||||
{
|
||||
date: "2021-09-05",
|
||||
name: "vue-pure-admin",
|
||||
star: "1400"
|
||||
},
|
||||
{
|
||||
date: "2021-09-06",
|
||||
name: "vue-pure-admin",
|
||||
star: "1500"
|
||||
},
|
||||
{
|
||||
date: "2021-09-07",
|
||||
name: "vue-pure-admin",
|
||||
star: "1600"
|
||||
},
|
||||
{
|
||||
date: "2021-09-08",
|
||||
name: "vue-pure-admin",
|
||||
star: "1700"
|
||||
},
|
||||
{
|
||||
date: "2021-09-09",
|
||||
name: "vue-pure-admin",
|
||||
star: "1800"
|
||||
},
|
||||
{
|
||||
date: "2021-09-10",
|
||||
name: "vue-pure-admin",
|
||||
star: "1900"
|
||||
}
|
||||
]);
|
||||
|
||||
let classOption = reactive({
|
||||
direction: "top"
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="infinite">
|
||||
<ul class="top">
|
||||
<li>更新日期</li>
|
||||
<li>项目名称</li>
|
||||
<li>Star数量</li>
|
||||
</ul>
|
||||
<SeamlessScroll
|
||||
ref="scroll"
|
||||
:data="listData"
|
||||
:class-option="classOption"
|
||||
class="warp"
|
||||
>
|
||||
<ul class="item">
|
||||
<li v-for="(item, index) in listData" :key="index">
|
||||
<span v-text="item.date"></span>
|
||||
<span v-text="item.name"></span>
|
||||
<span v-text="item.star"></span>
|
||||
</li>
|
||||
</ul>
|
||||
</SeamlessScroll>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.infinite {
|
||||
.top {
|
||||
width: 95%;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
display: flex;
|
||||
margin: 0 auto;
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
font-weight: 400;
|
||||
background: #fafafa;
|
||||
|
||||
li {
|
||||
width: 34%;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.warp {
|
||||
width: 95%;
|
||||
height: 230px;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
|
||||
li {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
display: flex;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
span {
|
||||
width: 34%;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
84
src/components/ReCharts/src/Line.vue
Normal file
@@ -0,0 +1,84 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "Line"
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ECharts } from "echarts";
|
||||
import echarts from "/@/plugins/echarts";
|
||||
import { onBeforeMount, onMounted, nextTick } from "vue";
|
||||
import { useEventListener, tryOnUnmounted, useTimeoutFn } from "@vueuse/core";
|
||||
|
||||
let echartInstance: ECharts;
|
||||
|
||||
function initechartInstance() {
|
||||
const echartDom = document.querySelector(".line");
|
||||
if (!echartDom) return;
|
||||
// @ts-ignore
|
||||
echartInstance = echarts.init(echartDom);
|
||||
echartInstance.clear(); //清除旧画布 重新渲染
|
||||
|
||||
echartInstance.setOption({
|
||||
grid: {
|
||||
bottom: "20%",
|
||||
height: "68%",
|
||||
containLabel: true
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "item"
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
axisLabel: {
|
||||
interval: 0
|
||||
},
|
||||
data: ["open_issues", "forks", "watchers", "star"]
|
||||
},
|
||||
yAxis: {
|
||||
type: "value"
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: [3, 204, 1079, 1079],
|
||||
type: "line",
|
||||
areaStyle: {}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
nextTick(() => {
|
||||
initechartInstance();
|
||||
});
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
useEventListener("resize", () => {
|
||||
if (!echartInstance) return;
|
||||
useTimeoutFn(() => {
|
||||
echartInstance.resize();
|
||||
}, 180);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
tryOnUnmounted(() => {
|
||||
if (!echartInstance) return;
|
||||
echartInstance.dispose();
|
||||
echartInstance = null;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="line"></div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 35vh;
|
||||
}
|
||||
</style>
|
||||
87
src/components/ReCharts/src/Pie.vue
Normal file
@@ -0,0 +1,87 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "Pie"
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ECharts } from "echarts";
|
||||
import echarts from "/@/plugins/echarts";
|
||||
import { onBeforeMount, onMounted, nextTick } from "vue";
|
||||
import { useEventListener, tryOnUnmounted, useTimeoutFn } from "@vueuse/core";
|
||||
|
||||
let echartInstance: ECharts;
|
||||
|
||||
function initechartInstance() {
|
||||
const echartDom = document.querySelector(".pie");
|
||||
if (!echartDom) return;
|
||||
// @ts-ignore
|
||||
echartInstance = echarts.init(echartDom);
|
||||
echartInstance.clear(); //清除旧画布 重新渲染
|
||||
|
||||
echartInstance.setOption({
|
||||
tooltip: {
|
||||
trigger: "item"
|
||||
},
|
||||
legend: {
|
||||
orient: "vertical",
|
||||
right: true
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "Github信息",
|
||||
type: "pie",
|
||||
radius: "60%",
|
||||
center: ["40%", "50%"],
|
||||
data: [
|
||||
{ value: 1079, name: "watchers" },
|
||||
{ value: 1079, name: "star" },
|
||||
{ value: 204, name: "forks" },
|
||||
{ value: 3, name: "open_issues" }
|
||||
],
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: "rgba(0, 0, 0, 0.5)"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
nextTick(() => {
|
||||
initechartInstance();
|
||||
});
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
useEventListener("resize", () => {
|
||||
if (!echartInstance) return;
|
||||
useTimeoutFn(() => {
|
||||
echartInstance.resize();
|
||||
}, 180);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
tryOnUnmounted(() => {
|
||||
if (!echartInstance) return;
|
||||
echartInstance.dispose();
|
||||
echartInstance = null;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="pie"></div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.pie {
|
||||
width: 100%;
|
||||
height: 35vh;
|
||||
}
|
||||
</style>
|
||||
2
src/components/ReCountTo/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
normal 普通数字动画组件
|
||||
rebound 回弹式数字动画组件
|
||||
15
src/components/ReCountTo/index.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { App } from "vue";
|
||||
import reNormalCountTo from "./src/normal";
|
||||
import reboundCountTo from "./src/rebound";
|
||||
|
||||
export const ReNormalCountTo = Object.assign(reNormalCountTo, {
|
||||
install(app: App) {
|
||||
app.component(reNormalCountTo.name, reNormalCountTo);
|
||||
}
|
||||
});
|
||||
|
||||
export const ReboundCountTo = Object.assign(reboundCountTo, {
|
||||
install(app: App) {
|
||||
app.component(reboundCountTo.name, reboundCountTo);
|
||||
}
|
||||
});
|
||||
@@ -1,20 +1,16 @@
|
||||
<template>
|
||||
<span :style="{color: color}">{{ displayValue }}</span>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import {
|
||||
defineComponent,
|
||||
reactive,
|
||||
computed,
|
||||
watch,
|
||||
onMounted,
|
||||
unref,
|
||||
toRef
|
||||
unref
|
||||
} from "vue";
|
||||
import { countToProps } from "./props";
|
||||
import { isNumber } from "/@/utils/is";
|
||||
|
||||
export default defineComponent({
|
||||
name: "CountTo",
|
||||
name: "Normal",
|
||||
props: countToProps,
|
||||
emits: ["mounted", "callback"],
|
||||
setup(props, { emit }) {
|
||||
@@ -28,7 +24,8 @@ export default defineComponent({
|
||||
timestamp: number | null;
|
||||
rAF: any;
|
||||
remaining: number | null;
|
||||
color: any;
|
||||
color: string;
|
||||
fontSize: string;
|
||||
}>({
|
||||
localStartVal: props.startVal,
|
||||
displayValue: formatNumber(props.startVal),
|
||||
@@ -39,14 +36,8 @@ export default defineComponent({
|
||||
timestamp: null,
|
||||
remaining: null,
|
||||
rAF: null,
|
||||
color: null
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
if (props.autoplay) {
|
||||
start();
|
||||
}
|
||||
emit("mounted");
|
||||
color: null,
|
||||
fontSize: "16px"
|
||||
});
|
||||
|
||||
const getCountDown = computed(() => {
|
||||
@@ -60,15 +51,17 @@ export default defineComponent({
|
||||
});
|
||||
|
||||
function start() {
|
||||
const { startVal, duration, color } = props;
|
||||
const { startVal, duration, color, fontSize } = props;
|
||||
state.localStartVal = startVal;
|
||||
state.startTime = null;
|
||||
state.localDuration = duration;
|
||||
state.paused = false;
|
||||
state.color = color;
|
||||
state.fontSize = fontSize;
|
||||
state.rAF = requestAnimationFrame(count);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-unused-vars
|
||||
function pauseResume() {
|
||||
if (state.paused) {
|
||||
resume();
|
||||
@@ -90,6 +83,7 @@ export default defineComponent({
|
||||
requestAnimationFrame(count);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-unused-vars
|
||||
function reset() {
|
||||
state.startTime = null;
|
||||
cancelAnimationFrame(state.rAF);
|
||||
@@ -162,14 +156,23 @@ export default defineComponent({
|
||||
return prefix + x1 + x2 + suffix;
|
||||
}
|
||||
|
||||
return {
|
||||
count,
|
||||
reset,
|
||||
resume,
|
||||
start,
|
||||
pauseResume,
|
||||
displayValue: toRef(state, "displayValue")
|
||||
};
|
||||
onMounted(() => {
|
||||
if (props.autoplay) {
|
||||
start();
|
||||
}
|
||||
emit("mounted");
|
||||
});
|
||||
|
||||
return () => (
|
||||
<>
|
||||
<span
|
||||
style={{
|
||||
color: props.color,
|
||||
fontSize: props.fontSize
|
||||
}}>
|
||||
{state.displayValue}
|
||||
</span>
|
||||
</>
|
||||
);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -1,6 +1,5 @@
|
||||
import { strict } from 'assert'
|
||||
import { PropType } from 'vue'
|
||||
import { propTypes } from '/@/utils/propTypes'
|
||||
import { PropType } from "vue";
|
||||
import { propTypes } from "/@/utils/propTypes";
|
||||
export const countToProps = {
|
||||
startVal: propTypes.number.def(0),
|
||||
endVal: propTypes.number.def(2020),
|
||||
@@ -11,22 +10,22 @@ export const countToProps = {
|
||||
required: false,
|
||||
default: 0,
|
||||
validator(value: number) {
|
||||
return value >= 0
|
||||
},
|
||||
return value >= 0;
|
||||
}
|
||||
},
|
||||
color: {
|
||||
type: String as PropType<string>,
|
||||
require: false
|
||||
},
|
||||
decimal: propTypes.string.def('.'),
|
||||
separator: propTypes.string.def(','),
|
||||
prefix: propTypes.string.def(''),
|
||||
suffix: propTypes.string.def(''),
|
||||
color: propTypes.string.def(),
|
||||
fontSize: propTypes.string.def(),
|
||||
decimal: propTypes.string.def("."),
|
||||
separator: propTypes.string.def(","),
|
||||
prefix: propTypes.string.def(""),
|
||||
suffix: propTypes.string.def(""),
|
||||
useEasing: propTypes.bool.def(true),
|
||||
easingFn: {
|
||||
type: Function as PropType<(t: number, b: number, c: number, d: number) => number>,
|
||||
type: Function as PropType<
|
||||
(t: number, b: number, c: number, d: number) => number
|
||||
>,
|
||||
default(t: number, b: number, c: number, d: number) {
|
||||
return (c * (-Math.pow(2, (-10 * t) / d) + 1) * 1024) / 1023 + b
|
||||
},
|
||||
},
|
||||
}
|
||||
return (c * (-Math.pow(2, (-10 * t) / d) + 1) * 1024) / 1023 + b;
|
||||
}
|
||||
}
|
||||
};
|
||||
73
src/components/ReCountTo/src/rebound/index.tsx
Normal file
@@ -0,0 +1,73 @@
|
||||
import "./rebound.css";
|
||||
import {
|
||||
defineComponent,
|
||||
ref,
|
||||
unref,
|
||||
onBeforeMount,
|
||||
onBeforeUnmount,
|
||||
getCurrentInstance
|
||||
} from "vue";
|
||||
import { reboundProps } from "./props";
|
||||
|
||||
export default defineComponent({
|
||||
name: "Rebound",
|
||||
props: reboundProps,
|
||||
setup(props) {
|
||||
const timer = ref(null);
|
||||
|
||||
onBeforeMount(() => {
|
||||
const ua = navigator.userAgent.toLowerCase();
|
||||
const testUA = regexp => regexp.test(ua);
|
||||
const isSafari = testUA(/safari/g) && !testUA(/chrome/g);
|
||||
|
||||
// Safari浏览器的兼容代码
|
||||
isSafari &&
|
||||
(timer.value = setTimeout(() => {
|
||||
// @ts-ignore
|
||||
getCurrentInstance().refs["ul"].setAttribute(
|
||||
"style",
|
||||
`
|
||||
animation: none;
|
||||
transform: translateY(calc(var(--i) * -9.09%))
|
||||
`
|
||||
);
|
||||
}, props.delay * 1000));
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
clearTimeout(unref(timer));
|
||||
});
|
||||
|
||||
return () => (
|
||||
<>
|
||||
<div
|
||||
class="scroll-num"
|
||||
// @ts-ignore
|
||||
style={{ "--i": props.i, "--delay": props.delay }}>
|
||||
<ul ref="ul" style={{ fontSize: "32px" }}>
|
||||
<li>0</li>
|
||||
<li>1</li>
|
||||
<li>2</li>
|
||||
<li>3</li>
|
||||
<li>4</li>
|
||||
<li>5</li>
|
||||
<li>6</li>
|
||||
<li>7</li>
|
||||
<li>8</li>
|
||||
<li>9</li>
|
||||
<li>0</li>
|
||||
</ul>
|
||||
|
||||
<svg width="0" height="0">
|
||||
<filter id="blur">
|
||||
<feGaussianBlur
|
||||
in="SourceGraphic"
|
||||
stdDeviation={`0 ${props.blur}`}
|
||||
/>
|
||||
</filter>
|
||||
</svg>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
});
|
||||
14
src/components/ReCountTo/src/rebound/props.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { PropType } from "vue";
|
||||
import { propTypes } from "/@/utils/propTypes";
|
||||
export const reboundProps = {
|
||||
delay: propTypes.number.def(1),
|
||||
blur: propTypes.number.def(2),
|
||||
i: {
|
||||
type: Number as PropType<number>,
|
||||
required: false,
|
||||
default: 0,
|
||||
validator(value: number) {
|
||||
return value < 10 && value >= 0 && Number.isInteger(value);
|
||||
}
|
||||
}
|
||||
};
|
||||
76
src/components/ReCountTo/src/rebound/rebound.css
Normal file
@@ -0,0 +1,76 @@
|
||||
.scroll-num {
|
||||
width: var(--width, 20px);
|
||||
height: var(--height, calc(var(--width, 20px) * 1.8));
|
||||
color: var(--color, #333);
|
||||
font-size: var(--height, calc(var(--width, 20px) * 1.1));
|
||||
line-height: var(--height, calc(var(--width, 20px) * 1.8));
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
animation: enhance-bounce-in-down 1s calc(var(--delay) * 1s) forwards;
|
||||
}
|
||||
|
||||
ul {
|
||||
animation: move 0.3s linear infinite,
|
||||
bounce-in-down 1s calc(var(--delay) * 1s) forwards;
|
||||
}
|
||||
|
||||
@keyframes move {
|
||||
from {
|
||||
transform: translateY(-90%);
|
||||
filter: url(#blur);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translateY(1%);
|
||||
filter: url(#blur);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes bounce-in-down {
|
||||
from {
|
||||
transform: translateY(calc(var(--i) * -9.09% - 7%));
|
||||
filter: none;
|
||||
}
|
||||
|
||||
25% {
|
||||
transform: translateY(calc(var(--i) * -9.09% + 3%));
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: translateY(calc(var(--i) * -9.09% - 1%));
|
||||
}
|
||||
|
||||
70% {
|
||||
transform: translateY(calc(var(--i) * -9.09% + 0.6%));
|
||||
}
|
||||
|
||||
85% {
|
||||
transform: translateY(calc(var(--i) * -9.09% - 0.3%));
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translateY(calc(var(--i) * -9.09%));
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes enhance-bounce-in-down {
|
||||
25% {
|
||||
transform: translateY(8%);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: translateY(-4%);
|
||||
}
|
||||
|
||||
70% {
|
||||
transform: translateY(2%);
|
||||
}
|
||||
|
||||
85% {
|
||||
transform: translateY(-1%);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
10
src/components/ReCropper/index.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { App } from "vue";
|
||||
import reCropper from "./src";
|
||||
|
||||
export const ReCropper = Object.assign(reCropper, {
|
||||
install(app: App) {
|
||||
app.component(reCropper.name, reCropper);
|
||||
}
|
||||
});
|
||||
|
||||
export default ReCropper;
|
||||
148
src/components/ReCropper/src/index.tsx
Normal file
@@ -0,0 +1,148 @@
|
||||
import type { CSSProperties } from "vue";
|
||||
import {
|
||||
defineComponent,
|
||||
onMounted,
|
||||
nextTick,
|
||||
ref,
|
||||
unref,
|
||||
computed,
|
||||
PropType
|
||||
} from "vue";
|
||||
import { templateRef } from "@vueuse/core";
|
||||
import { useAttrs } from "/@/utils/useAttrs";
|
||||
|
||||
import Cropper from "cropperjs";
|
||||
import "cropperjs/dist/cropper.css";
|
||||
|
||||
type Options = Cropper.Options;
|
||||
|
||||
const defaultOptions: Cropper.Options = {
|
||||
aspectRatio: 16 / 9,
|
||||
zoomable: true,
|
||||
zoomOnTouch: true,
|
||||
zoomOnWheel: true,
|
||||
cropBoxMovable: true,
|
||||
cropBoxResizable: true,
|
||||
toggleDragModeOnDblclick: true,
|
||||
autoCrop: true,
|
||||
background: true,
|
||||
highlight: true,
|
||||
center: true,
|
||||
responsive: true,
|
||||
restore: true,
|
||||
checkCrossOrigin: true,
|
||||
checkOrientation: true,
|
||||
scalable: true,
|
||||
modal: true,
|
||||
guides: true,
|
||||
movable: true,
|
||||
rotatable: true
|
||||
};
|
||||
|
||||
const props = {
|
||||
src: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
alt: {
|
||||
type: String
|
||||
},
|
||||
width: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
},
|
||||
height: {
|
||||
type: [String, Number],
|
||||
default: "360px"
|
||||
},
|
||||
crossorigin: {
|
||||
type: String || Object,
|
||||
default: undefined
|
||||
},
|
||||
imageStyle: {
|
||||
type: Object as PropType<CSSProperties>,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
options: {
|
||||
type: Object as PropType<Options>,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default defineComponent({
|
||||
name: "Cropper",
|
||||
props,
|
||||
setup(props) {
|
||||
const cropper: any = ref<Nullable<Cropper>>(null);
|
||||
const imgElRef = templateRef<HTMLImageElement | null>("imgElRef", null);
|
||||
|
||||
const isReady = ref<boolean>(false);
|
||||
|
||||
const getImageStyle = computed((): CSSProperties => {
|
||||
return {
|
||||
height: props.height,
|
||||
width: props.width,
|
||||
maxWidth: "100%",
|
||||
...props.imageStyle
|
||||
};
|
||||
});
|
||||
|
||||
const getWrapperStyle = computed((): CSSProperties => {
|
||||
const { height, width } = props;
|
||||
return {
|
||||
width: `${width}`.replace(/px/, "") + "px",
|
||||
height: `${height}`.replace(/px/, "") + "px"
|
||||
};
|
||||
});
|
||||
|
||||
function init() {
|
||||
const imgEl = unref(imgElRef);
|
||||
if (!imgEl) {
|
||||
return;
|
||||
}
|
||||
cropper.value = new Cropper(imgEl, {
|
||||
...defaultOptions,
|
||||
ready: () => {
|
||||
isReady.value = true;
|
||||
},
|
||||
...props.options
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
init();
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
props,
|
||||
imgElRef,
|
||||
cropper,
|
||||
getWrapperStyle,
|
||||
getImageStyle
|
||||
};
|
||||
},
|
||||
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
class={useAttrs({ excludeListeners: true, excludeKeys: ["class"] })}
|
||||
style={this.getWrapperStyle}>
|
||||
<img
|
||||
ref="imgElRef"
|
||||
src={this.props.src}
|
||||
alt={this.props.alt}
|
||||
crossorigin={this.props.crossorigin}
|
||||
style={this.getImageStyle}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
});
|
||||
10
src/components/ReFlop/index.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { App } from "vue";
|
||||
import reFlop from "./src/index.vue";
|
||||
|
||||
export const ReFlop = Object.assign(reFlop, {
|
||||
install(app: App) {
|
||||
app.component(reFlop.name, reFlop);
|
||||
}
|
||||
});
|
||||
|
||||
export default ReFlop;
|
||||
93
src/components/ReFlop/src/Filpper.tsx
Normal file
@@ -0,0 +1,93 @@
|
||||
import { defineComponent, ref } from "vue";
|
||||
import { propTypes } from "/@/utils/propTypes";
|
||||
import "./filpper.css";
|
||||
|
||||
const props = {
|
||||
// front paper text
|
||||
// 前牌文字
|
||||
frontText: propTypes.number.def(0),
|
||||
// back paper text
|
||||
// 后牌文字
|
||||
backText: propTypes.number.def(1),
|
||||
// flipping duration, please be consistent with the CSS animation-duration value.
|
||||
// 翻牌动画时间,与CSS中设置的animation-duration保持一致
|
||||
duration: propTypes.number.def(600)
|
||||
};
|
||||
|
||||
export default defineComponent({
|
||||
name: "Filpper",
|
||||
props,
|
||||
setup(props) {
|
||||
// eslint-disable-next-line vue/no-setup-props-destructure
|
||||
const { frontText, backText, duration } = props;
|
||||
const isFlipping = ref(false);
|
||||
const flipType = ref("down");
|
||||
const frontTextFromData = ref(frontText);
|
||||
const backTextFromData = ref(backText);
|
||||
|
||||
const textClass = (number: number) => {
|
||||
return "number" + number;
|
||||
};
|
||||
|
||||
const flip = (type: string, front: number, back: number) => {
|
||||
// 如果处于翻转中,则不执行
|
||||
if (isFlipping.value) return false;
|
||||
frontTextFromData.value = front;
|
||||
backTextFromData.value = back;
|
||||
// 根据传递过来的type设置翻转方向
|
||||
flipType.value = type;
|
||||
// 设置翻转状态为true
|
||||
isFlipping.value = true;
|
||||
|
||||
setTimeout(() => {
|
||||
// 设置翻转状态为false
|
||||
isFlipping.value = false;
|
||||
frontTextFromData.value = back;
|
||||
}, duration);
|
||||
};
|
||||
|
||||
// 下翻牌
|
||||
const flipDown = (front: any, back: any): void => {
|
||||
flip("down", front, back);
|
||||
};
|
||||
|
||||
// 上翻牌
|
||||
const flipUp = (front: any, back: any): void => {
|
||||
flip("up", front, back);
|
||||
};
|
||||
|
||||
// 设置前牌文字
|
||||
function setFront(text: number): void {
|
||||
frontTextFromData.value = text;
|
||||
}
|
||||
|
||||
// 设置后牌文字
|
||||
const setBack = (text: number): void => {
|
||||
backTextFromData.value = text;
|
||||
};
|
||||
|
||||
return {
|
||||
flipType,
|
||||
isFlipping,
|
||||
frontTextFromData,
|
||||
backTextFromData,
|
||||
textClass,
|
||||
flipDown,
|
||||
flipUp,
|
||||
setFront,
|
||||
setBack
|
||||
};
|
||||
},
|
||||
|
||||
render() {
|
||||
const main = `m-flipper ${this.flipType} ${this.isFlipping ? "go" : ""}`;
|
||||
const front = `digital front ${this.textClass(this.frontTextFromData)}`;
|
||||
const back = `digital back ${this.textClass(this.backTextFromData)}`;
|
||||
return (
|
||||
<div class={main}>
|
||||
<div class={front} />
|
||||
<div class={back} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
184
src/components/ReFlop/src/filpper.css
Normal file
@@ -0,0 +1,184 @@
|
||||
.m-flipper {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 60px;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
border: solid 1px #000;
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
font-size: 66px;
|
||||
color: #fff;
|
||||
box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
|
||||
text-align: center;
|
||||
font-family: "Helvetica Neue";
|
||||
}
|
||||
|
||||
.m-flipper .digital::before,
|
||||
.m-flipper .digital::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #000;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.m-flipper .digital::before {
|
||||
top: 0;
|
||||
bottom: 50%;
|
||||
border-radius: 10px 10px 0 0;
|
||||
border-bottom: solid 1px #666;
|
||||
}
|
||||
|
||||
.m-flipper .digital::after {
|
||||
top: 50%;
|
||||
bottom: 0;
|
||||
border-radius: 0 0 10px 10px;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
/* 向下翻 */
|
||||
.m-flipper.down .front::before {
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.m-flipper.down .back::after {
|
||||
z-index: 2;
|
||||
transform-origin: 50% 0%;
|
||||
transform: perspective(160px) rotateX(180deg);
|
||||
}
|
||||
|
||||
.m-flipper.down .front::after,
|
||||
.m-flipper.down .back::before {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.m-flipper.down.go .front::before {
|
||||
transform-origin: 50% 100%;
|
||||
animation: frontFlipDown 0.6s ease-in-out both;
|
||||
box-shadow: 0 -2px 6px rgba(255, 255, 255, 0.3);
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
|
||||
.m-flipper.down.go .back::after {
|
||||
animation: backFlipDown 0.6s ease-in-out both;
|
||||
}
|
||||
|
||||
/* 向上翻 */
|
||||
.m-flipper.up .front::after {
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.m-flipper.up .back::before {
|
||||
z-index: 2;
|
||||
transform-origin: 50% 100%;
|
||||
transform: perspective(160px) rotateX(-180deg);
|
||||
}
|
||||
|
||||
.m-flipper.up .front::before,
|
||||
.m-flipper.up .back::after {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.m-flipper.up.go .front::after {
|
||||
transform-origin: 50% 0;
|
||||
animation: frontFlipUp 0.6s ease-in-out both;
|
||||
box-shadow: 0 2px 6px rgba(255, 255, 255, 0.3);
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
|
||||
.m-flipper.up.go .back::before {
|
||||
animation: backFlipUp 0.6s ease-in-out both;
|
||||
}
|
||||
|
||||
@keyframes frontFlipDown {
|
||||
0% {
|
||||
transform: perspective(160px) rotateX(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: perspective(160px) rotateX(-180deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes backFlipDown {
|
||||
0% {
|
||||
transform: perspective(160px) rotateX(180deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: perspective(160px) rotateX(0deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes frontFlipUp {
|
||||
0% {
|
||||
transform: perspective(160px) rotateX(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: perspective(160px) rotateX(180deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes backFlipUp {
|
||||
0% {
|
||||
transform: perspective(160px) rotateX(-180deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: perspective(160px) rotateX(0deg);
|
||||
}
|
||||
}
|
||||
|
||||
.m-flipper .number0::before,
|
||||
.m-flipper .number0::after {
|
||||
content: "0";
|
||||
}
|
||||
|
||||
.m-flipper .number1::before,
|
||||
.m-flipper .number1::after {
|
||||
content: "1";
|
||||
}
|
||||
|
||||
.m-flipper .number2::before,
|
||||
.m-flipper .number2::after {
|
||||
content: "2";
|
||||
}
|
||||
|
||||
.m-flipper .number3::before,
|
||||
.m-flipper .number3::after {
|
||||
content: "3";
|
||||
}
|
||||
|
||||
.m-flipper .number4::before,
|
||||
.m-flipper .number4::after {
|
||||
content: "4";
|
||||
}
|
||||
|
||||
.m-flipper .number5::before,
|
||||
.m-flipper .number5::after {
|
||||
content: "5";
|
||||
}
|
||||
|
||||
.m-flipper .number6::before,
|
||||
.m-flipper .number6::after {
|
||||
content: "6";
|
||||
}
|
||||
|
||||
.m-flipper .number7::before,
|
||||
.m-flipper .number7::after {
|
||||
content: "7";
|
||||
}
|
||||
|
||||
.m-flipper .number8::before,
|
||||
.m-flipper .number8::after {
|
||||
content: "8";
|
||||
}
|
||||
|
||||
.m-flipper .number9::before,
|
||||
.m-flipper .number9::after {
|
||||
content: "9";
|
||||
}
|
||||
132
src/components/ReFlop/src/index.vue
Normal file
@@ -0,0 +1,132 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, unref, nextTick, onUnmounted } from "vue";
|
||||
import { templateRef } from "@vueuse/core";
|
||||
import flippers from "./Filpper";
|
||||
|
||||
let timer = ref(null);
|
||||
let flipObjs = ref([]);
|
||||
|
||||
const flipperHour1 = templateRef<HTMLElement | null>("flipperHour1", null);
|
||||
const flipperHour2 = templateRef<HTMLElement | null>("flipperHour2", null);
|
||||
const flipperMinute1 = templateRef<HTMLElement | null>("flipperMinute1", null);
|
||||
const flipperMinute2 = templateRef<HTMLElement | null>("flipperMinute2", null);
|
||||
const flipperSecond1 = templateRef<HTMLElement | null>("flipperSecond1", null);
|
||||
const flipperSecond2 = templateRef<HTMLElement | null>("flipperSecond2", null);
|
||||
|
||||
// 初始化数字
|
||||
const init = () => {
|
||||
let now = new Date();
|
||||
let nowTimeStr = formatDate(new Date(now.getTime()), "hhiiss");
|
||||
for (let i = 0; i < flipObjs.value.length; i++) {
|
||||
flipObjs?.value[i]?.setFront(nowTimeStr[i]);
|
||||
}
|
||||
};
|
||||
|
||||
// 开始计时
|
||||
const run = () => {
|
||||
timer.value = setInterval(() => {
|
||||
// 获取当前时间
|
||||
let now = new Date();
|
||||
let nowTimeStr = formatDate(new Date(now.getTime() - 1000), "hhiiss");
|
||||
let nextTimeStr = formatDate(now, "hhiiss");
|
||||
for (let i = 0; i < flipObjs.value.length; i++) {
|
||||
if (nowTimeStr[i] === nextTimeStr[i]) {
|
||||
continue;
|
||||
}
|
||||
flipObjs?.value[i]?.flipDown(nowTimeStr[i], nextTimeStr[i]);
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
// 正则格式化日期
|
||||
const formatDate = (date: Date, dateFormat: string) => {
|
||||
/* 单独格式化年份,根据y的字符数量输出年份
|
||||
* 例如:yyyy => 2019
|
||||
yy => 19
|
||||
y => 9
|
||||
*/
|
||||
if (/(y+)/.test(dateFormat)) {
|
||||
dateFormat = dateFormat.replace(
|
||||
RegExp.$1,
|
||||
(date.getFullYear() + "").substr(4 - RegExp.$1.length)
|
||||
);
|
||||
}
|
||||
// 格式化月、日、时、分、秒
|
||||
let o = {
|
||||
"m+": date.getMonth() + 1,
|
||||
"d+": date.getDate(),
|
||||
"h+": date.getHours(),
|
||||
"i+": date.getMinutes(),
|
||||
"s+": date.getSeconds()
|
||||
};
|
||||
for (let k in o) {
|
||||
if (new RegExp(`(${k})`).test(dateFormat)) {
|
||||
// 取出对应的值
|
||||
let str = o[k] + "";
|
||||
/* 根据设置的格式,输出对应的字符
|
||||
* 例如: 早上8时,hh => 08,h => 8
|
||||
* 但是,当数字>=10时,无论格式为一位还是多位,不做截取,这是与年份格式化不一致的地方
|
||||
* 例如: 下午15时,hh => 15, h => 15
|
||||
*/
|
||||
dateFormat = dateFormat.replace(
|
||||
RegExp.$1,
|
||||
RegExp.$1.length === 1 ? str : padLeftZero(str)
|
||||
);
|
||||
}
|
||||
}
|
||||
return dateFormat;
|
||||
};
|
||||
|
||||
// 日期时间补零
|
||||
const padLeftZero = (str: string | any[]) => {
|
||||
return ("00" + str).substr(str.length);
|
||||
};
|
||||
|
||||
nextTick(() => {
|
||||
flipObjs.value = [
|
||||
unref(flipperHour1),
|
||||
unref(flipperHour2),
|
||||
unref(flipperMinute1),
|
||||
unref(flipperMinute2),
|
||||
unref(flipperSecond1),
|
||||
unref(flipperSecond2)
|
||||
];
|
||||
|
||||
init();
|
||||
run();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
if (timer.value) {
|
||||
clearInterval(timer.value);
|
||||
timer.value = null;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flip-clock">
|
||||
<flippers ref="flipperHour1" />
|
||||
<flippers ref="flipperHour2" />
|
||||
<em>:</em>
|
||||
<flippers ref="flipperMinute1" />
|
||||
<flippers ref="flipperMinute2" />
|
||||
<em>:</em>
|
||||
<flippers ref="flipperSecond1" />
|
||||
<flippers ref="flipperSecond2" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.flip-clock .m-flipper {
|
||||
margin: 0 3px;
|
||||
}
|
||||
|
||||
.flip-clock em {
|
||||
display: inline-block;
|
||||
line-height: 102px;
|
||||
font-size: 66px;
|
||||
font-style: normal;
|
||||
vertical-align: top;
|
||||
}
|
||||
</style>
|
||||
22
src/components/ReFlowChart/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { App } from "vue";
|
||||
import control from "./src/Control.vue";
|
||||
import nodePanel from "./src/NodePanel.vue";
|
||||
import dataDialog from "./src/DataDialog.vue";
|
||||
|
||||
export const Control = Object.assign(control, {
|
||||
install(app: App) {
|
||||
app.component(control.name, control);
|
||||
}
|
||||
});
|
||||
|
||||
export const NodePanel = Object.assign(nodePanel, {
|
||||
install(app: App) {
|
||||
app.component(nodePanel.name, nodePanel);
|
||||
}
|
||||
});
|
||||
|
||||
export const DataDialog = Object.assign(dataDialog, {
|
||||
install(app: App) {
|
||||
app.component(dataDialog.name, dataDialog);
|
||||
}
|
||||
});
|
||||
154
src/components/ReFlowChart/src/Control.vue
Normal file
@@ -0,0 +1,154 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, unref, onMounted } from "vue";
|
||||
import { templateRef } from "@vueuse/core";
|
||||
import { LogicFlow } from "@logicflow/core";
|
||||
|
||||
interface Props {
|
||||
lf: LogicFlow;
|
||||
catTurboData?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
lf: null
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "catData"): void;
|
||||
}>();
|
||||
|
||||
const controlButton3 = templateRef<HTMLElement | any>("controlButton3", null);
|
||||
const controlButton4 = templateRef<HTMLElement | any>("controlButton4", null);
|
||||
|
||||
let focusIndex = ref<Number>(-1);
|
||||
let titleLists = ref([
|
||||
{
|
||||
icon: "icon-zoom-out-hs",
|
||||
text: "缩小",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
icon: "icon-enlarge-hs",
|
||||
text: "放大",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
icon: "icon-full-screen-hs",
|
||||
text: "适应",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
icon: "icon-previous-hs",
|
||||
text: "上一步",
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
icon: "icon-next-step-hs",
|
||||
text: "下一步",
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
icon: "icon-download-hs",
|
||||
text: "下载图片",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
icon: "icon-watch-hs",
|
||||
text: "查看数据",
|
||||
disabled: false
|
||||
}
|
||||
]);
|
||||
|
||||
const onControl = (item, key) => {
|
||||
["zoom", "zoom", "resetZoom", "undo", "redo", "getSnapshot"].forEach(
|
||||
(v, i) => {
|
||||
let domControl = props.lf;
|
||||
if (key === 1) {
|
||||
domControl.zoom(true);
|
||||
}
|
||||
if (key === 6) {
|
||||
emit("catData");
|
||||
}
|
||||
if (key === i) {
|
||||
domControl[v]();
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const onEnter = key => {
|
||||
focusIndex.value = key;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
props.lf.on("history:change", ({ data: { undoAble, redoAble } }) => {
|
||||
unref(titleLists)[3].disabled = unref(controlButton3).disabled = !undoAble;
|
||||
unref(titleLists)[4].disabled = unref(controlButton4).disabled = !redoAble;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="control-container">
|
||||
<!-- 功能按钮 -->
|
||||
<ul>
|
||||
<li
|
||||
v-for="(item, key) in titleLists"
|
||||
:key="key"
|
||||
:title="item.text"
|
||||
:style="{ background: focusIndex === key ? '#ccc' : '' }"
|
||||
@mouseenter.prevent="onEnter(key)"
|
||||
@mouseleave.prevent="focusIndex = -1"
|
||||
>
|
||||
<button
|
||||
:ref="'controlButton' + key"
|
||||
:disabled="item.disabled"
|
||||
:style="{
|
||||
cursor: item.disabled === false ? 'pointer' : 'not-allowed'
|
||||
}"
|
||||
@click="onControl(item, key)"
|
||||
>
|
||||
<span :class="'iconfont ' + item.icon"></span>
|
||||
<p>{{ item.text }}</p>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@import "./assets/iconfont/iconfont.css";
|
||||
|
||||
.control-container {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
background: hsla(0, 0%, 100%, 0.8);
|
||||
box-shadow: 0 1px 4px rgb(0 0 0 / 20%);
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.control-container p {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.control-container ul {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.control-container ul li {
|
||||
width: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.control-container ul li button {
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
outline: none;
|
||||
}
|
||||
</style>
|
||||
17
src/components/ReFlowChart/src/DataDialog.vue
Normal file
@@ -0,0 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import VueJsonPretty from "vue-json-pretty";
|
||||
import "vue-json-pretty/lib/styles.css";
|
||||
|
||||
const props = defineProps({
|
||||
graphData: Object
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<vue-json-pretty
|
||||
:path="'res'"
|
||||
:deep="3"
|
||||
:showLength="true"
|
||||
:data="props.graphData"
|
||||
></vue-json-pretty>
|
||||
</template>
|
||||
142
src/components/ReFlowChart/src/NodePanel.vue
Normal file
@@ -0,0 +1,142 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, unref } from "vue";
|
||||
import { LogicFlow } from "@logicflow/core";
|
||||
|
||||
interface Props {
|
||||
lf: LogicFlow;
|
||||
nodeList: ForDataType<undefined>;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
lf: null,
|
||||
nodeList: null
|
||||
});
|
||||
|
||||
let properties = ref({
|
||||
a: "efrwe",
|
||||
b: "wewe"
|
||||
});
|
||||
|
||||
const nodeDragNode = item => {
|
||||
props.lf.dnd.startDrag({
|
||||
type: item.type,
|
||||
properties: unref(properties)
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 左侧bpmn元素选择器 -->
|
||||
<div class="node-panel">
|
||||
<div
|
||||
class="node-item"
|
||||
v-for="item in props.nodeList"
|
||||
:key="item.text"
|
||||
@mousedown="nodeDragNode(item)"
|
||||
>
|
||||
<div class="node-item-icon" :class="item.class">
|
||||
<div
|
||||
v-if="item.type === 'user' || item.type === 'time'"
|
||||
class="shape"
|
||||
></div>
|
||||
</div>
|
||||
<span class="node-label">{{ item.text }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.node-panel {
|
||||
position: absolute;
|
||||
top: 100px;
|
||||
left: 50px;
|
||||
width: 70px;
|
||||
padding: 20px 10px;
|
||||
background-color: white;
|
||||
box-shadow: 0 0 10px 1px rgb(228, 224, 219);
|
||||
border-radius: 6px;
|
||||
text-align: center;
|
||||
z-index: 101;
|
||||
}
|
||||
|
||||
.node-item {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.node-item-icon {
|
||||
height: 30px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.node-label {
|
||||
font-size: 12px;
|
||||
margin-top: 5px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.node-start {
|
||||
background: url("./background/start.png") no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.node-rect {
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
.node-user {
|
||||
background: url("./background/user.png") no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.node-time {
|
||||
background: url("./background/time.png") no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.node-push {
|
||||
background: url("./background/push.png") no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.node-download {
|
||||
background: url("./background/download.png") no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.node-click {
|
||||
background: url("./background/click.png") no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.node-end {
|
||||
background: url("./background/end.png") no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.bpmn-start {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAAH6ji2bAAAABGdBTUEAALGPC/xhBQAAAnBJREFUOBGdVL1rU1EcPfdGBddmaZLiEhdx1MHZQXApraCzQ7GKLgoRBxMfcRELuihWKcXFRcEWF8HBf0DdDCKYRZpnl7p0svLe9Zzbd29eQhTbC8nv+9zf130AT63jvooOGS8Vf9Nt5zxba7sXQwODfkWpkbjTQfCGUd9gIp3uuPP8bZ946g56dYQvnBg+b1HB8VIQmMFrazKcKSvFW2dQTxJnJdQ77urmXWOMBCmXM2Rke4S7UAW+/8ywwFoewmBps2tu7mbTdp8VMOkIRAkKfrVawalJTtIliclFbaOBqa0M2xImHeVIfd/nKAfVq/LGnPss5Kh00VEdSzfwnBXPUpmykNss4lUI9C1ga+8PNrBD5YeqRY2Zz8PhjooIbfJXjowvQJBqkmEkVnktWhwu2SM7SMx7Cj0N9IC0oQXRo8xwAGzQms+xrB/nNSUWVveI48ayrFGyC2+E2C+aWrZHXvOuz+CiV6iycWe1Rd1Q6+QUG07nb5SbPrL4426d+9E1axKjY3AoRrlEeSQo2Eu0T6BWAAr6COhTcWjRaYfKG5csnvytvUr/WY4rrPMB53Uo7jZRjXaG6/CFfNMaXEu75nG47X+oepU7PKJvvzGDY1YLSKHJrK7vFUwXKkaxwhCW3u+sDFMVrIju54RYYbFKpALZAo7sB6wcKyyrd+aBMryMT2gPyD6GsQoRFkGHr14TthZni9ck0z+Pnmee460mHXbRAypKNy3nuMdrWgVKj8YVV8E7PSzp1BZ9SJnJAsXdryw/h5ctboUVi4AFiCd+lQaYMw5z3LGTBKjLQOeUF35k89f58Vv/tGh+l+PE/wG0rgfIUbZK5AAAAABJRU5ErkJggg==)
|
||||
center center no-repeat;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.bpmn-end {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAAH6ji2bAAAABGdBTUEAALGPC/xhBQAAA1BJREFUOBFtVE1IVUEYPXOf+tq40Y3vPcmFIdSjIorWoRG0ERWUgnb5FwVhYQSl72oUoZAboxKNFtWiwKRN0M+jpfSzqJAQclHo001tKkjl3emc8V69igP3znzfnO/M9zcDcKT67azmjYWTwl9Vn7Vumeqzj1DVb6cleQY4oAVnIOPb+mKAGxQmKI5CWNJ2aLPatxWa3aB9K7/fB+/Z0jUF6TmMlFLQqrkECWQzOZxYGjTlOl8eeKaIY5yHnFn486xBustDjWT6dG7pmjHOJd+33t0iitTPkK6tEvjxq4h2MozQ6WFSX/LkDUGfFwfhEZj1Auz/U4pyAi5Sznd7uKzznXeVHlI/Aywmk6j7fsUsEuCGADrWARXXwjxWQsUbIupDHJI7kF5dRktg0eN81IbiZXiTESic50iwS+t1oJgL83jAiBupLDCQqwziaWSoAFSeIR3P5Xv5az00wyIn35QRYTwdSYbz8pH8fxUUAtxnFvYmEmgI0wYXUXcCCSpeEVpXlsRhBnCEATxWylL9+EKCAYhe1NGstUa6356kS9NVvt3DU2fd+Wtbm/+lSbylJqsqkSm9CRhvoJVlvKPvF1RKY/FcPn5j4UfIMLn8D4UYb54BNsilTDXKnF4CfTobA0FpoW/LSp306wkXM+XaOJhZaFkcNM82ASNAWMrhrUbRfmyeI1FvRBTpN06WKxa9BK0o2E4Pd3zfBBEwPsv9sQBnmLVbLEIZ/Xe9LYwJu/Er17W6HYVBc7vmuk0xUQ+pqxdom5Fnp55SiytXLPYoMXNM4u4SNSCFWnrVIzKG3EGyMXo6n/BQOe+bX3FClY4PwydVhthOZ9NnS+ntiLh0fxtlUJHAuGaFoVmttpVMeum0p3WEXbcll94l1wM/gZ0Ccczop77VvN2I7TlsZCsuXf1WHvWEhjO8DPtyOVg2/mvK9QqboEth+7pD6NUQC1HN/TwvydGBARi9MZSzLE4b8Ru3XhX2PBxf8E1er2A6516o0w4sIA+lwURhAON82Kwe2iDAC1Watq4XHaGQ7skLcFOtI5lDxuM2gZe6WFIotPAhbaeYlU4to5cuarF1QrcZ/lwrLaCJl66JBocYZnrNlvm2+MBCTmUymPrYZVbjdlr/BxlMjmNmNI3SAAAAAElFTkSuQmCC)
|
||||
center center no-repeat;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.bpmn-user {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAEFVwZaAAAABGdBTUEAALGPC/xhBQAAAqlJREFUOBF9VM9rE0EUfrMJNUKLihGbpLGtaCOIR8VjQMGDePCgCCIiCNqzCAp2MyYUCXhUtF5E0D+g1t48qAd7CCLqQUQKEWkStcEfVGlLdp/fm3aW2QQdyLzf33zz5m2IsAZ9XhDpyaaIZkTS4ASzK41TFao88GuJ3hsr2pAbipHxuSYyKRugagICGANkfFnNh3HeE2N0b3nN2cgnpcictw5veJIzxmDamSlxxQZicq/mflxhbaH8BLRbuRwNtZp0JAhoplVRUdzmCe/vO27wFuuA3S5qXruGdboy5/PRGFsbFGKo/haRtQHIrM83bVeTrOgNhZReWaYGnE4aUQgTJNvijJFF4jQ8BxJE5xfKatZWmZcTQ+BVgh7s8SgPlCkcec4mGTmieTP4xd7PcpIEg1TX6gdeLW8rTVMVLVvb7ctXoH0Cydl2QOPJBG21STE5OsnbweVYzAnD3A7PVILuY0yiiyDwSm2g441r6rMSgp6iK42yqroI2QoXeJVeA+YeZSa47gZdXaZWQKTrG93rukk/l2Al6Kzh5AZEl7dDQy+JjgFahQjRopSxPbrbvK7GRe9ePWBo1wcU7sYrFZtavXALwGw/7Dnc50urrHJuTPSoO2IMV3gUQGNg87IbSOIY9BpiT9HV7FCZ94nPXb3MSnwHn/FFFE1vG6DTby+r31KAkUktB3Qf6ikUPWxW1BkXSPQeMHHiW0+HAd2GelJsZz1OJegCxqzl+CLVHa/IibuHeJ1HAKzhuDR+ymNaRFM+4jU6UWKXorRmbyqkq/D76FffevwdCp+jN3UAN/C9JRVTDuOxC/oh+EdMnqIOrlYteKSfadVRGLJFJPSB/ti/6K8f0CNymg/iH2gO/f0DwE0yjAFO6l8JaR5j0VPwPwfaYHqOqrCI319WzwhwzNW/aQAAAABJRU5ErkJggg==)
|
||||
center center no-repeat;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.bpmn-exclusiveGateway {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAAHeEJUAAAAABGdBTUEAALGPC/xhBQAAAvVJREFUOBGNVEFrE0EU/mY3bQoiFlOkaUJrQUQoWMGePLX24EH0IIoHKQiCV0G8iE1covgLiqA/QTzVm1JPogc9tIJYFaQtlhQxqYjSpunu+L7JvmUTU3AgmTfvffPNN++9WSA1DO182f6xwILzD5btfAoQmwL5KJEwiQyVbSVZ0IgRyV6PTpIJ81E5ZvqfHQR0HUOBHW4L5Et2kQ6Zf7iAOhTFAA8s0pEP7AXO1uAA52SbqGk6h/6J45LaLhO64ByfcUzM39V7ZiAdS2yCePPEIQYvTUHqM/n7dgQNfBKWPjpF4ISk8q3J4nB11qw6X8l+FsF3EhlkEMfrjIer3wJTLwS2aCNcj4DbGxXTw00JmAuO+Ni6bBxVUCvS5d9aa04+so4pHW5jLTywuXAL7jJ+D06sl82Sgl2JuVBQn498zkc2bGKxULHjCnSMadBKYDYYHAtsby1EQ5lNGrQd4Y3v4Zo0XdGEmDno46yCM9Tk+RiJmUYHS/aXHPNTcjxcbTFna000PFJHIVZ5lFRqRpJWk9/+QtlOUYJj9HG5pVFEU7zqIYDVsw2s+AJaD8wTd2umgSCCyUxgGsS1Y6TBwXQQTFuZaHcd8gAGioE90hlsY+wMcs30RduYtxanjMGal8H5dMW67dmT1JFtYUEe8LiQLRsPZ6IIc7A4J5tqco3T0pnv/4u0kyzrYUq7gASuEyI8VXKvB9Odytv6jS/PNaZBln0nioJG/AVQRZvApOdhjj3Jt8QC8Im09SafwdBdvIpztpxWxpeKCC+EsFdS8DCyuCn2munFpL7ctHKp+Xc5cMybeIyMAN33SPL3ZR9QV1XVwLyzHm6Iv0/yeUuUb7PPlZC4D4HZkeu6dpF4v9j9MreGtMbxMMRLIcjJic9yHi7WQ3yVKzZVWUr5UrViJvn1FfUlwe/KYVfYyWRLSGNu16hR01U9IacajXPei0wx/5BqgInvJN+MMNtNme7ReU9SBbgntovn0kKHpFg7UogZvaZiOue/q1SBo9ktHzQAAAAASUVORK5CYII=)
|
||||
center center no-repeat;
|
||||
cursor: grab;
|
||||
}
|
||||
</style>
|
||||
166
src/components/ReFlowChart/src/adpterForTurbo.ts
Normal file
@@ -0,0 +1,166 @@
|
||||
const TurboType = {
|
||||
SEQUENCE_FLOW: 1,
|
||||
START_EVENT: 2,
|
||||
END_EVENT: 3,
|
||||
USER_TASK: 4,
|
||||
SERVICE_TASK: 5,
|
||||
EXCLUSIVE_GATEWAY: 6
|
||||
};
|
||||
|
||||
function getTurboType(type) {
|
||||
switch (type) {
|
||||
case "bpmn:sequenceFlow":
|
||||
return TurboType.SEQUENCE_FLOW;
|
||||
case "bpmn:startEvent":
|
||||
return TurboType.START_EVENT;
|
||||
case "bpmn:endEvent":
|
||||
return TurboType.END_EVENT;
|
||||
case "bpmn:userTask":
|
||||
return TurboType.USER_TASK;
|
||||
case "bpmn:serviceTask":
|
||||
return TurboType.SERVICE_TASK;
|
||||
case "bpmn:exclusiveGateway":
|
||||
return TurboType.EXCLUSIVE_GATEWAY;
|
||||
default:
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
function convertNodeToTurboElement(node) {
|
||||
const { id, type, x, y, text = "", properties } = node;
|
||||
return {
|
||||
incoming: [],
|
||||
outgoing: [],
|
||||
dockers: [],
|
||||
type: getTurboType(node.type),
|
||||
properties: {
|
||||
...properties,
|
||||
name: (text && text.value) || "",
|
||||
x: x,
|
||||
y: y,
|
||||
text,
|
||||
logicFlowType: type
|
||||
},
|
||||
key: id
|
||||
};
|
||||
}
|
||||
|
||||
function convertEdgeToTurboElement(edge) {
|
||||
const {
|
||||
id,
|
||||
type,
|
||||
sourceNodeId,
|
||||
targetNodeId,
|
||||
startPoint,
|
||||
endPoint,
|
||||
pointsList,
|
||||
text = "",
|
||||
properties
|
||||
} = edge;
|
||||
return {
|
||||
incoming: [sourceNodeId],
|
||||
outgoing: [targetNodeId],
|
||||
type: getTurboType(type),
|
||||
dockers: [],
|
||||
properties: {
|
||||
...properties,
|
||||
name: (text && text.value) || "",
|
||||
text,
|
||||
startPoint,
|
||||
endPoint,
|
||||
pointsList,
|
||||
logicFlowType: type
|
||||
},
|
||||
key: id
|
||||
};
|
||||
}
|
||||
|
||||
export function toTurboData(data) {
|
||||
const nodeMap = new Map();
|
||||
const turboData = {
|
||||
flowElementList: []
|
||||
};
|
||||
data.nodes.forEach(node => {
|
||||
const flowElement = convertNodeToTurboElement(node);
|
||||
turboData.flowElementList.push(flowElement);
|
||||
nodeMap.set(node.id, flowElement);
|
||||
});
|
||||
data.edges.forEach(edge => {
|
||||
const flowElement = convertEdgeToTurboElement(edge);
|
||||
const sourceElement = nodeMap.get(edge.sourceNodeId);
|
||||
sourceElement.outgoing.push(flowElement.key);
|
||||
const targetElement = nodeMap.get(edge.targetNodeId);
|
||||
targetElement.incoming.push(flowElement.key);
|
||||
turboData.flowElementList.push(flowElement);
|
||||
});
|
||||
return turboData;
|
||||
}
|
||||
|
||||
function convertFlowElementToEdge(element) {
|
||||
const { incoming, outgoing, properties, key } = element;
|
||||
const { text, startPoint, endPoint, pointsList, logicFlowType } = properties;
|
||||
const edge = {
|
||||
id: key,
|
||||
type: logicFlowType,
|
||||
sourceNodeId: incoming[0],
|
||||
targetNodeId: outgoing[0],
|
||||
text,
|
||||
startPoint,
|
||||
endPoint,
|
||||
pointsList,
|
||||
properties: {}
|
||||
};
|
||||
const excludeProperties = [
|
||||
"startPoint",
|
||||
"endPoint",
|
||||
"pointsList",
|
||||
"text",
|
||||
"logicFlowType"
|
||||
];
|
||||
Object.keys(element.properties).forEach(property => {
|
||||
if (excludeProperties.indexOf(property) === -1) {
|
||||
edge.properties[property] = element.properties[property];
|
||||
}
|
||||
});
|
||||
return edge;
|
||||
}
|
||||
|
||||
function convertFlowElementToNode(element) {
|
||||
const { properties, key } = element;
|
||||
const { x, y, text, logicFlowType } = properties;
|
||||
const node = {
|
||||
id: key,
|
||||
type: logicFlowType,
|
||||
x,
|
||||
y,
|
||||
text,
|
||||
properties: {}
|
||||
};
|
||||
const excludeProperties = ["x", "y", "text", "logicFlowType"];
|
||||
Object.keys(element.properties).forEach(property => {
|
||||
if (excludeProperties.indexOf(property) === -1) {
|
||||
node.properties[property] = element.properties[property];
|
||||
}
|
||||
});
|
||||
return node;
|
||||
}
|
||||
|
||||
export function toLogicflowData(data) {
|
||||
const lfData = {
|
||||
nodes: [],
|
||||
edges: []
|
||||
};
|
||||
const list = data.flowElementList;
|
||||
list &&
|
||||
list.length > 0 &&
|
||||
list.forEach(element => {
|
||||
if (element.type === TurboType.SEQUENCE_FLOW) {
|
||||
const edge = convertFlowElementToEdge(element);
|
||||
lfData.edges.push(edge);
|
||||
} else {
|
||||
const node = convertFlowElementToNode(element);
|
||||
lfData.nodes.push(node);
|
||||
}
|
||||
});
|
||||
return lfData;
|
||||
}
|
||||
BIN
src/components/ReFlowChart/src/assets/background/click.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/components/ReFlowChart/src/assets/background/download.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
src/components/ReFlowChart/src/assets/background/end.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
src/components/ReFlowChart/src/assets/background/push.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/components/ReFlowChart/src/assets/background/start.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
src/components/ReFlowChart/src/assets/background/time.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src/components/ReFlowChart/src/assets/background/user.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
48
src/components/ReFlowChart/src/assets/iconfont/iconfont.css
Normal file
@@ -0,0 +1,48 @@
|
||||
@font-face {
|
||||
font-family: "iconfont";
|
||||
src: url("iconfont.eot?t=1618544337340"); /* IE9 */
|
||||
src: url("iconfont.eot?t=1618544337340#iefix") format("embedded-opentype"),
|
||||
/* IE6-IE8 */
|
||||
url("data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAZ0AAsAAAAADKgAAAYmAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDZAqLQIldATYCJAMgCxIABCAFhG0HgQkb6ApRlA9Sk+xngd1wXQyjTXRCW7pkEvLB0N9/pZhyo7nvIIK1Nisnipg3omjUREiURDXNNEL/jDRCI5H/riTu/9q0D5OakT05VaM3E4kMJI2QhanZillesmYnVT0pD5+399suTrCEkjDhqLtAxyURhIU6Ser/1tp8aDPgI2g7ex2ah+Q7i0rI+Gy9rSNYOtEEdPFQVkrlj/1c3oZFk6Sv/bYQqWUunsgkk8QRkrgkCJEKpUcO8zx0cFLQr+x6CEiNi0BN2YWV4MwJhmDEqhdU4BwR8oIOEXPCjGMzcoKDuLmnLwLw6vy9vMCFM6ggIW50umRpIbVW14U29L/QmIZgqDs5cD0JDKwCHFIylReQ51yFpO+XKBwDcjHltbq9801mxdeFzX8inbguoAq1yCWzpH95JuRUJIC0EDPH5nNGtIkkA4GgvROBocpEEKLCCBwVj0BRF/CJHFYhEo9WCbF1TCdgEEgF0A0Ee8NxioIeN97QzQqFMd2tdfIJC3KeK0T3eJYu0J07g6BVbCB0IiDVDNsQ1mFcbNxDCTk6IWEb2ShHfHxUlvAjkfj0mHDhC56GAL4CWMUgQXgEywDxuH0TBAD7gDZuRqtx7KWpnyTbushlJUpytdfnUvoS/pXG880npIYe3wueUdIJoa9HlRgdsYiF5QJv8C2zjIbzXERGQmwH0QylmjJfC4evBB8UUKQZMsAMG2aWMU6nc6s9m7X4Thn0gTfomgnm5d0qwX4v0rQH3GZn4Ajp8F2VeUcTTARpA+FfyLcpc+T05bOemT2fny8EH8Vn4LPFh3htyOtB3jDSJj34IpEQ3HNboUdasWNDQifcA8BfPPkTe6YaWp0nF/IrhQHGW2D5HTO7O2zfTH3+gxip/NioTs9VwUXL7T3AbzTxHa3qSu1e4EZTfZl/QiC2c7UI5jZ/ET938pSH8Z8IPBwU0NopeLgB7h6Kvp0GVCOw72KAjKFA71sPKX7/9g+Js/AmNfj8/o28sqNVdSTVI93p08F3v/75zqw8W79vb0RVaCTrw6aNntrQwCtbzzDKosTRFMjp/WFqtpZUEGxsi6P8L09byvlyrrvUJ6/ZFJR/X32mbUmndlduWjbdnwnY2ZBHo8OIKIVDUJah62hi4aKdSoqZsWypN7d0w6nsAzb12tWrqZOl12+W/W7YyLFxDy/7U369cgFF85PUVevYahz8y/HS9ZGrbv7saR0sn5MfEzhinC2Dizcv5xHycyChG33pcskigbRkvXnDaurRjRuIeDdu4rnSgPQ/L196FHQg6FGs7266c82aTtDT1jU0CqzWoG2Ndf91wRo1g/0wo9b4VPtV+2iwl/fjvxq4f83CBZeYgx6njp8mb7jzou9FfPdwBBpffvyUx6XARoc/1umGwtrl034lryLH/YCEwly/XrrckYHsd+/YWY/u3EGI085rV6RD5+Bw7dqnoAvBjzifw3S3zdaNZL/dRnfz7XZup232DX4VtD6Cn+AzkqFgBq6unr/gwtCDuydN51fk76ocHS/nN25Y/WqMe1fzBRgEQHPEjqE0gIbkR1CKM/zYUukn9ItRVMHwLfuO1kaP2mlUivpAUpbb8f5wZS1eib+cs3/qlD9r8DU2NEccqhPVFos3SRGSKtb4hyJEcX6VZhArj8Y+edgVpHICKD9tt8ddsvuYpNLZfQGoyBiY2CzKm1chkFmHUGwbUityTs70kCCSE2DZZADRaSeo0heYTpdQ3vwIAv0+QagzEKTOQnnOzHzoXTMkrCJYy6q7Wb1GNPO6hLi6keVYaDeqpDDFGarGkqy3sLFRMXFPDjZjqYsD5A6BI4RneUk0sdlwM2w0iqxFEtuwhkTpCLHER0fzWQ+I0ogmcLVPgqkQmBZLrdvC1tMQmfGTE66J3y+HCdoZqUgFBd/Y1TCJTL92VqwoMRVQOUxzpYJTiZd1EHAIyXmskS4RmbCySY4ZpVPEsmRv1QbTIKLoGtgt4kVTI74qM2p4tulMzwFS4qPiUDFxCSSUSGJJKJd2ozFS1kgYmyN1snOnimh0brybVuw0G0WV9iF3xeYjFAg4LcEi4Q692C7TUI8omiJRZAN3M+4ikTLBlosAAAA=")
|
||||
format("woff2"),
|
||||
url("iconfont.woff?t=1618544337340") format("woff"),
|
||||
url("iconfont.ttf?t=1618544337340") format("truetype"),
|
||||
/* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
|
||||
url("iconfont.svg?t=1618544337340#iconfont") format("svg"); /* iOS 4.1- */
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-full-screen-hs::before {
|
||||
content: "\e656";
|
||||
}
|
||||
|
||||
.icon-watch-hs::before {
|
||||
content: "\e766";
|
||||
}
|
||||
|
||||
.icon-download-hs::before {
|
||||
content: "\e6af";
|
||||
}
|
||||
|
||||
.icon-enlarge-hs::before {
|
||||
content: "\e765";
|
||||
}
|
||||
|
||||
.icon-previous-hs::before {
|
||||
content: "\e84c";
|
||||
}
|
||||
|
||||
.icon-zoom-out-hs::before {
|
||||
content: "\e744";
|
||||
}
|
||||
|
||||
.icon-next-step-hs::before {
|
||||
content: "\e84b";
|
||||
}
|
||||
BIN
src/components/ReFlowChart/src/assets/iconfont/iconfont.eot
Normal file
63
src/components/ReFlowChart/src/assets/iconfont/iconfont.js
Normal file
58
src/components/ReFlowChart/src/assets/iconfont/iconfont.json
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"id": "2491438",
|
||||
"name": "liu'c'tu",
|
||||
"font_family": "iconfont",
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "755619",
|
||||
"name": "自适应图标",
|
||||
"font_class": "full-screen-hs",
|
||||
"unicode": "e656",
|
||||
"unicode_decimal": 58966
|
||||
},
|
||||
{
|
||||
"icon_id": "14445801",
|
||||
"name": "查看",
|
||||
"font_class": "watch-hs",
|
||||
"unicode": "e766",
|
||||
"unicode_decimal": 59238
|
||||
},
|
||||
{
|
||||
"icon_id": "9712640",
|
||||
"name": "下载",
|
||||
"font_class": "download-hs",
|
||||
"unicode": "e6af",
|
||||
"unicode_decimal": 59055
|
||||
},
|
||||
{
|
||||
"icon_id": "1029099",
|
||||
"name": "放大",
|
||||
"font_class": "enlarge-hs",
|
||||
"unicode": "e765",
|
||||
"unicode_decimal": 59237
|
||||
},
|
||||
{
|
||||
"icon_id": "20017362",
|
||||
"name": "上一步",
|
||||
"font_class": "previous-hs",
|
||||
"unicode": "e84c",
|
||||
"unicode_decimal": 59468
|
||||
},
|
||||
{
|
||||
"icon_id": "1010015",
|
||||
"name": "缩小",
|
||||
"font_class": "zoom-out-hs",
|
||||
"unicode": "e744",
|
||||
"unicode_decimal": 59204
|
||||
},
|
||||
{
|
||||
"icon_id": "20017363",
|
||||
"name": "下一步",
|
||||
"font_class": "next-step-hs",
|
||||
"unicode": "e84b",
|
||||
"unicode_decimal": 59467
|
||||
}
|
||||
]
|
||||
}
|
||||