feat: 初始化项目

This commit is contained in:
皓月归尘 2025-02-13 02:29:50 +08:00
commit b573a80574
299 changed files with 58773 additions and 0 deletions

4
.browserslistrc Normal file
View File

@ -0,0 +1,4 @@
> 1%
last 2 versions
not dead
not ie 11

21
.dockerignore Normal file
View File

@ -0,0 +1,21 @@
node_modules
.DS_Store
dist
dist-ssr
*.local
.eslintcache
report.html
yarn.lock
npm-debug.log*
.pnpm-error.log*
.pnpm-debug.log
tests/**/coverage/
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
tsconfig.tsbuildinfo

14
.editorconfig Normal file
View 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

5
.env Normal file
View File

@ -0,0 +1,5 @@
# 平台本地运行端口号
VITE_PORT = 8848
# 是否隐藏首页 隐藏 true 不隐藏 false 勿删除VITE_HIDE_HOME只需在.env文件配置
VITE_HIDE_HOME = false

8
.env.development Normal file
View File

@ -0,0 +1,8 @@
# 平台本地运行端口号
VITE_PORT = 8848
# 开发环境读取配置文件路径
VITE_PUBLIC_PATH = /
# 开发环境路由历史模式Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数"
VITE_ROUTER_HISTORY = "hash"

13
.env.production Normal file
View File

@ -0,0 +1,13 @@
# 线上环境平台打包路径
VITE_PUBLIC_PATH = /
# 线上环境路由历史模式Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数"
VITE_ROUTER_HISTORY = "hash"
# 是否在打包时使用cdn替换本地库 替换 true 不替换 false
VITE_CDN = false
# 是否启用gzip压缩或brotli压缩分两种情况删除原始文件和不删除原始文件
# 压缩时不删除原始文件的配置gzip、brotli、both同时开启 gzip 与 brotli 压缩、none不开启压缩默认
# 压缩时删除原始文件的配置gzip-clear、brotli-clear、both-clear同时开启 gzip 与 brotli 压缩、none不开启压缩默认
VITE_COMPRESSION = "none"

16
.env.staging Normal file
View File

@ -0,0 +1,16 @@
# 预发布也需要生产环境的行为
# https://cn.vitejs.dev/guide/env-and-mode.html#modes
# NODE_ENV = development
VITE_PUBLIC_PATH = /
# 预发布环境路由历史模式Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数"
VITE_ROUTER_HISTORY = "hash"
# 是否在打包时使用cdn替换本地库 替换 true 不替换 false
VITE_CDN = false
# 是否启用gzip压缩或brotli压缩分两种情况删除原始文件和不删除原始文件
# 压缩时不删除原始文件的配置gzip、brotli、both同时开启 gzip 与 brotli 压缩、none不开启压缩默认
# 压缩时删除原始文件的配置gzip-clear、brotli-clear、both-clear同时开启 gzip 与 brotli 压缩、none不开启压缩默认
VITE_COMPRESSION = "none"

11
.eslintignore Normal file
View File

@ -0,0 +1,11 @@
public
dist
*.d.ts
/src/assets
package.json
eslint.config.js
.prettierrc.js
commitlint.config.js
postcss.config.js
tailwind.config.ts
stylelint.config.js

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
public/wasm/capture.worker.js linguist-language=Vue
public/wasm/index.js linguist-language=Vue

22
.gitignore vendored Normal file
View File

@ -0,0 +1,22 @@
node_modules
.DS_Store
dist
dist-ssr
*.local
.eslintcache
report.html
vite.config.*.timestamp*
yarn.lock
npm-debug.log*
.pnpm-error.log*
.pnpm-debug.log
tests/**/coverage/
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
tsconfig.tsbuildinfo

5
.gitpod.yml Normal file
View File

@ -0,0 +1,5 @@
ports:
- port: 3344
onOpen: open-preview
tasks:
- init: pnpm install && pnpm serve

9
.hintrc Normal file
View File

@ -0,0 +1,9 @@
{
"extends": [
"development"
],
"hints": {
"no-inline-styles": "off",
"typescript-config/strict": "off"
}
}

20
.lintstagedrc Normal file
View File

@ -0,0 +1,20 @@
{
"*.{js,jsx,ts,tsx}": [
"prettier --cache --ignore-unknown --write",
"eslint --cache --fix"
],
"{!(package)*.json,*.code-snippets,.!({browserslist,npm,nvm})*rc}": [
"prettier --cache --write--parser json"
],
"package.json": ["prettier --cache --write"],
"*.vue": [
"prettier --write",
"eslint --cache --fix",
"stylelint --fix --allow-empty-input"
],
"*.{css,scss,html}": [
"prettier --cache --ignore-unknown --write",
"stylelint --fix --allow-empty-input"
],
"*.md": ["prettier --cache --ignore-unknown --write"]
}

11
.markdownlint.json Normal file
View File

@ -0,0 +1,11 @@
{
"default": true,
"MD003": false,
"MD033": false,
"MD013": false,
"MD001": false,
"MD025": false,
"MD024": false,
"MD007": { "indent": 4 },
"no-hard-tabs": false
}

4
.npmrc Normal file
View File

@ -0,0 +1,4 @@
shell-emulator=true
shamefully-hoist=true
enable-pre-post-scripts=false
strict-peer-dependencies=false

1
.nvmrc Normal file
View File

@ -0,0 +1 @@
v22.12.0

1
.prettierignore Normal file
View File

@ -0,0 +1 @@
src/views/system/menu/README.md

9
.prettierrc.js Normal file
View File

@ -0,0 +1,9 @@
// @ts-check
/** @type {import("prettier").Config} */
export default {
bracketSpacing: true,
singleQuote: false,
arrowParens: "avoid",
trailingComma: "none"
};

4
.stylelintignore Normal file
View File

@ -0,0 +1,4 @@
/dist/*
/public/*
public/*
src/style/reset.scss

20
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,20 @@
{
"recommendations": [
"christian-kohler.path-intellisense",
"warmthsea.vscode-custom-code-color",
"vscode-icons-team.vscode-icons",
"davidanson.vscode-markdownlint",
"ms-azuretools.vscode-docker",
"stylelint.vscode-stylelint",
"bradlc.vscode-tailwindcss",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"lokalise.i18n-ally",
"redhat.vscode-yaml",
"csstools.postcss",
"mikestead.dotenv",
"eamodio.gitlens",
"antfu.iconify",
"Vue.volar"
]
}

56
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,56 @@
{
"editor.formatOnType": true,
"editor.formatOnSave": true,
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.tabSize": 2,
"editor.formatOnPaste": true,
"editor.guides.bracketPairs": "active",
"files.autoSave": "afterDelay",
"git.confirmSync": false,
"workbench.startupEditor": "newUntitledFile",
"editor.suggestSelection": "first",
"editor.acceptSuggestionOnCommitCharacter": false,
"css.lint.propertyIgnoredDueToDisplay": "ignore",
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
},
"files.associations": {
"editor.snippetSuggestions": "top"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"i18n-ally.localesPaths": "locales",
"i18n-ally.keystyle": "nested",
"i18n-ally.sortKeys": true,
"i18n-ally.namespace": true,
"i18n-ally.enabledParsers": [
"yaml",
"js"
],
"i18n-ally.sourceLanguage": "en",
"i18n-ally.displayLanguage": "zh-CN",
"i18n-ally.enabledFrameworks": [
"vue"
],
"iconify.excludes": [
"el"
],
"vscodeCustomCodeColor.highlightValue": [
"v-loading",
"v-auth",
"v-copy",
"v-longpress",
"v-optimize",
"v-perms",
"v-ripple"
],
"vscodeCustomCodeColor.highlightValueColor": "#b392f0",
}

22
.vscode/vue3.0.code-snippets vendored Normal file
View File

@ -0,0 +1,22 @@
{
"Vue3.0快速生成模板": {
"scope": "vue",
"prefix": "Vue3.0",
"body": [
"<template>",
"\t<div>test</div>",
"</template>\n",
"<script lang='ts'>",
"export default {",
"\tsetup() {",
"\t\treturn {}",
"\t}",
"}",
"</script>\n",
"<style lang='scss' scoped>\n",
"</style>",
"$2"
],
"description": "Vue3.0"
}
}

17
.vscode/vue3.2.code-snippets vendored Normal file
View File

@ -0,0 +1,17 @@
{
"Vue3.2+快速生成模板": {
"scope": "vue",
"prefix": "Vue3.2+",
"body": [
"<script setup lang='ts'>",
"</script>\n",
"<template>",
"\t<div>test</div>",
"</template>\n",
"<style lang='scss' scoped>\n",
"</style>",
"$2"
],
"description": "Vue3.2+"
}
}

20
.vscode/vue3.3.code-snippets vendored Normal file
View File

@ -0,0 +1,20 @@
{
"Vue3.3+defineOptions快速生成模板": {
"scope": "vue",
"prefix": "Vue3.3+",
"body": [
"<script setup lang='ts'>",
"defineOptions({",
"\tname: ''",
"})",
"</script>\n",
"<template>",
"\t<div>test</div>",
"</template>\n",
"<style lang='scss' scoped>\n",
"</style>",
"$2"
],
"description": "Vue3.3+defineOptions快速生成模板"
}
}

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM node:20-alpine as build-stage
WORKDIR /app
RUN corepack enable
RUN corepack prepare pnpm@latest --activate
RUN npm config set registry https://registry.npmmirror.com
COPY .npmrc package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

406
README.md Normal file
View File

@ -0,0 +1,406 @@
## 安装
- 1.安装pnpm
```shell
npm install -g pnpm
```
- 2.安装依赖
```shell
pnpm i
```
## 运行
- 1.开发环境启动
```shell
pnpm dev
```
## 打包
```shell
pnpm build
```
## 提交代码前先格式代码
```shell
pnpm lint
```
## 目录结构
```
├── .vscode # IDE 工具推荐配置文件
│ │ ├── extensions.json # 一键安装 vscode 插件
│ │ ├── settings.json # 设置扩展程序或 vscode 编辑器的一些属性
│ │ ├── vue3.0.code-snippets # vue3.0 代码片段
│ │ └── vue3.2.code-snippets # vue3.2 代码片段
│ │ └── vue3.3.code-snippets # vue3.3 代码片段
├── build # 构建工具
│ │ ├── cdn.ts # 打包时采用 cdn 模式
│ │ ├── compress.ts # 打包时启用 gzip 压缩或 brotli 压缩
│ │ ├── info.ts # 输出打包信息(大小、用时)
│ │ ├── optimize.ts # vite 依赖预构建配置项
│ │ ├── plugins.ts # vite 相关插件存放处
│ │ ├── utils.ts # 构建工具常用方法抽离
├── locales # 国际化文件存放处
│ │ ├── en.yaml # 英文配置
│ │ ├── zh-CN.yaml # 中文配置
├── node_modules # 模块依赖
├── public # 静态资源
│ │ ├── audio # 音频文件
│ │ ├── html # 静态 iframe 页面
│ │ ├── wasm # wasm 文件以及胶水代码
│ │ ├── favicon.ico # favicon
│ │ ├── logo.svg # logo
│ │ ├── platform-config.json # 全局配置文件(打包后修改也可生效)
├── src
│ ├── api # 接口请求统一管理
│ ├── assets # 字体、图片等静态资源
│ ├── components # 自定义通用组件
│ │ ├── ReAnimateSelector # [animate.css](https://animate.style/) 选择器组件
│ │ ├── ReAuth # 按钮级别权限组件
│ │ ├── ReCol # 封装 element-plus 的 el-col 组件
│ │ ├── ReCountTo # 数字动画组件
│ │ ├── ReCropper # 图片裁剪组件
│ │ ├── ReDialog # 基于 element-plus 中 el-dialog 组件开发的函数式弹框
│ │ ├── ReIcon # 图标组件
│ │ ├── ReImageVerify # 图形验证码组件
│ │ ├── RePureTableBar # 配合 `@pureadmin/table` 实现快速便捷的表格操作 https://github.com/pure-admin/pure-admin-table */
│ │ ├── ReSegmented # 分段控制器组件
│ │ ├── ReText # 支持 Tooltip 提示的文本省略组件
│ │ ├── ReTypeit # 打字机效果组件
│ ├── config # 获取平台动态全局配置
│ ├── directives # 自定义指令
│ │ ├── auth # 按钮级别权限指令
│ │ ├── copy # 文本复制指令(默认双击复制)
│ │ ├── longpress # 长按指令
│ │ ├── optimize # 防抖、节流指令
│ ├── layout # 主要页面布局
│ ├── plugins # 处理一些库或插件,导出更方便的 api
│ ├── router # 路由配置
│ ├── store # pinia 状态管理
│ ├── style # 全局样式
│ │ ├── dark.scss # 暗黑模式样式适配文件
│ │ ├── element-plus.scss # 全局覆盖 element-plus 样式文件
│ │ ├── reset.scss # 全局重置样式文件
│ │ ├── sidebar.scss # layout 布局样式文件
│ │ ├── tailwind.css # tailwindcss 自定义样式配置文件
│ │ ├── ...
│ ├── utils # 全局工具方法
│ │ ├── http # 封装 axios 文件
│ │ ├── localforage # 二次封装 localforage (https://localforage.docschina.org/) 支持设置过期时间,提供完整的类型提示
│ │ ├── progress # 封装 nprogress
│ │ └── auth.ts # 处理用户信息和 token 相关
│ │ └── chinaArea.ts # 汉字转区域码
│ │ └── globalPolyfills.ts # 解决项目可能因为安装某个依赖出现 `global is not defined` 报错
│ │ └── message.ts # 消息提示函数
│ │ ├── mitt.ts # 触发公共事件,类似 EventBus
│ │ ├── preventDefault.ts # 阻止键盘F12、浏览器默认右键菜单、页面元素选中、图片默认可拖动的方法
│ │ ├── print.ts # 打印函数
│ │ ├── propTypes.ts # 二次封装 vue 的 propTypes
│ │ ├── responsive.ts # 全局响应式 storage 配置
│ │ ├── sso.ts # 前端单点登录逻辑处理
│ │ ├── tree.ts # 树结构相关处理函数
│ ├── views # 存放编写业务代码页面
│ ├── App.vue # 入口页面
│ ├── main.ts # 入口文件
├── types # 全局 TS 类型配置
│ │ ├── global-components.d.ts # 自定义全局组件获得 Volar 提示(自定义的全局组件需要在这里声明下才能获得 Volar 类型提示哦)
│ │ ├── global.d.ts # 全局类型声明,无需引入直接在 `.vue``.ts``.tsx` 文件使用即可获得类型提示
│ │ ├── index.d.ts # 此文件跟同级目录的 global.d.ts 文件一样也是全局类型声明,只不过这里存放一些零散的全局类型,无需引入直接在 .vue 、.ts 、.tsx 文件使用即可获得类型提示
│ │ ├── router.d.ts # 全局路由类型声明
│ │ ├── shims-tsx.d.ts # 该文件是为了给 .tsx 文件提供类型支持,在编写时能正确识别语法
│ │ └── shims-vue.d.ts # .vue、.scss 文件不是常规的文件类型typescript 无法识别,所以我们需要通过下图的代码告诉 typescript 这些文件的类型,防止类型报错
├── .browserslistrc # 配置目标浏览器的环境
├── .dockerignore # 排除不需要上传到 docker 服务端的文件或目录
├── .editorconfig # 编辑器读取文件格式及样式定义配置 https://editorconfig.org/
├── .env # 全局环境变量配置(当 .env 文件与 .env.development、.env.production、.env.staging 这三个文件之一存在相同的配置 key 时,.env 优先级更低)
├── .env.development # 开发环境变量配置
├── .env.production # 生产环境变量配置
├── .env.staging # 预发布环境变量配置
├── .eslintignore # eslint 语法检查忽略文件
├── .gitattributes # 自定义指定文件属性
├── .gitignore # git 提交忽略文件
├── .gitpod.yml # gitpod 部署配置
├── .lintstagedrc # lint-staged 配置
├── .markdownlint.json # markdown 格式检查配置
├── .npmrc # npm 配置文件
├── .nvmrc # 用于指定在使用 Node Version ManagerNVM时要使用的特定 Node.js 版本
├── .prettierignore # prettier 语法检查忽略文件
├── .prettierrc.js # prettier 插件配置
├── .stylelintignore # stylelint 语法检查忽略文件
├── commitlint.config.js # git 提交前检查配置
├── Dockerfile # 用来构建 docker 镜像
├── eslint.config.js # eslint 语法检查配置
├── index.html # html 主入口
├── LICENSE # 证书
├── package.json # 依赖包管理以及命令配置
├── pnpm-lock.yaml # 依赖包版本锁定文件
├── postcss.config.js # postcss 插件配置
├── README.md # README
├── stylelint.config.js # stylelint 配置
├── tailwind.config.ts # tailwindcss 配置
├── tsconfig.json # typescript 配置
└── vite.config.ts # vite 配置
```
## 程序员必备技能之 `Git`
### 常用命令
#### 拉取代码
```sh
git clone xxx.git
```
#### 创建分支
```sh
git branch dev
# or
git checkout -b dev
# or
git switch -c dev
```
#### 切换本地分支
```sh
git checkout dev
# or
git switch dev
```
#### 切换分支并关联远程分支
```sh
git checkout -b dev origin/dev
# or
git checkout --track origin/dev
```
#### 查看本地所有分支
```sh
git branch
```
#### 查看远程所有分支
```sh
git branch -r
```
#### 删除本地分支
```sh
git branch -d dev
```
#### 删除远程分支
```sh
git push origin -d dev
```
#### 将代码从工作区添加暂存区
```sh
git add .
```
#### 查看尚未暂存的更新
```sh
git diff
```
#### 添加提交信息(`commit` 注释写错,执行 `git commit --amend` 此时会进入默认 `vim` 编辑器,修改注释后保存)
```sh
git commit -m 'xxxx'
```
#### 推送代码到远程分支
```sh
git push origin dev
# 强制推送(常在 git rebase 或 git reset 后使用)
git push -f origin dev
```
#### 拉取远程分支代码
```sh
git pull origin dev
```
#### 合并分支
```sh
git merge dev
```
#### 查看 `git` 状态
```sh
git status
```
#### 查看提交历史
```sh
git log
```
#### 查看可引用的历史版本记录
```sh
git reflog
```
#### 把本地未 `push` 的分叉提交历史整理成直线
```sh
git rebase origin/dev
```
#### 回到 `rebase` 执行之前的状态
```sh
git rebase --abort
```
#### 回退版本
```sh
# 回退指定 commit_id 版本
git reset --hard commit_id
# 回退上一个版本
git reset --soft HEAD^
# or
git reset --soft HEAD~1
```
#### 撤销代码
```sh
git revert commit_id
```
#### 修改分支名
```sh
# 第一步
git branch -m oldBranchName newBranchName
# 第二步
git push origin :oldBranchName
# 第三步
git push --set-upstream origin newBranchName
```
#### 查看 `git` 配置
```sh
# 查看全局配置
git config --global --list
# 查看用户名
git config --global user.name
```
#### 添加用户名
```sh
git config --global --add user.name newName
```
#### 删除用户名
```sh
git config --global --unset user.name
```
#### 修改用户名
```sh
git config --global user.name newName
```
#### 配置 `Git` 用户名和邮箱
```sh
# 用户名
git config --global user.name "Your Name"
# 邮箱
git config --global user.email "email@example.com"
```
#### 统计代码行数
```sh
git ls-files | xargs wc -l
```
#### 文件或文件夹重命名
`Git``Windows``macOS` 的默认文件系统中对文件大小写修改是不敏感的。可能你会先删除文件并提交,然后再新建文件再提交,这样做很麻烦,下面的 `git mv` 就简化了繁琐的操作
比如文件 `filename.ts` 或文件夹 `jsutils`,它们的相对路径分别是 `src/filename.ts``src/jsutils`
```sh
# 将 filename.ts 文件重命名为 fileName.ts分下面两步
# 第一步(注意下面的 name.ts 与 filename.ts 是不同的,如果你把 name.ts 改为 fileName.ts 是不行的,因为上面讲了仅大小写不同是不行的)
git mv src/filename.ts src/name.ts
# 第二步
git mv src/name.ts src/fileName.ts
# 将 jsutils 文件夹重命名为 jsUtils分下面两步
# 第一步
git mv src/jsutils src/utils
# 第二步
git mv src/utils src/jsUtils
```
## 提交规范
[相关参考](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: 开发中`
## `CodeReview` 常用缩写
`PR`Pull Request拉取请求给其他项目提交代码
`LGTM`Looks Good To Me代码已经过 review可以合并
`SGTM`Sounds Good To Me和上面那句意思差不多也是已经通过了 review 的意思
`WIP`Work In Progress如果有个改动很大的 PR可以在写了一部分的情况下先提交但需在标题写上 WIP以告诉项目维护者这个功能还未完成方便维护者提前 review 部分提交的代码
`PTAL`Please Take A Look提示别人来看一下
`TBR`To Be Reviewed提示维护者进行 review
`TL;DR`Too Long; Didn't Read太长懒得看
`TBD`To Be Done(or Defined/Discussed/Decided/Determined) 一般表示还没搞定
[简单易懂的 Git](https://www.bilibili.com/video/BV1KZ4y1o7gr/?p=1&vd_source=5a992808de6229d78e7810536c5f9ab3)<Badge text="视频教程推荐"/>

60
build/cdn.ts Normal file
View File

@ -0,0 +1,60 @@
import { Plugin as importToCDN } from "vite-plugin-cdn-import";
/**
* @description `cdn`使cdn模式 .env.production VITE_CDN true
* cdnhttps://www.bootcdn.cn当然你也可以选择 https://unpkg.com 或者 https://www.jsdelivr.com
* 使jscss文件cdn
*/
export const cdn = importToCDN({
//prodUrl解释 name: 对应下面modules的nameversion: 自动读取本地package.json中dependencies依赖中对应包的版本号path: 对应下面modules的path当然也可写完整路径会替换prodUrl
prodUrl: "https://cdn.bootcdn.net/ajax/libs/{name}/{version}/{path}",
modules: [
{
name: "vue",
var: "Vue",
path: "vue.global.prod.min.js"
},
{
name: "vue-router",
var: "VueRouter",
path: "vue-router.global.min.js"
},
{
name: "vue-i18n",
var: "VueI18n",
path: "vue-i18n.runtime.global.prod.min.js"
},
// 项目中没有直接安装vue-demi但是pinia用到了所以需要在引入pinia前引入vue-demihttps://github.com/vuejs/pinia/blob/v2/packages/pinia/package.json#L77
{
name: "vue-demi",
var: "VueDemi",
path: "index.iife.min.js"
},
{
name: "pinia",
var: "Pinia",
path: "pinia.iife.min.js"
},
{
name: "element-plus",
var: "ElementPlus",
path: "index.full.min.js",
css: "index.min.css"
},
{
name: "axios",
var: "axios",
path: "axios.min.js"
},
{
name: "dayjs",
var: "dayjs",
path: "dayjs.min.js"
},
{
name: "echarts",
var: "echarts",
path: "echarts.min.js"
}
]
});

63
build/compress.ts Normal file
View File

@ -0,0 +1,63 @@
import type { Plugin } from "vite";
import { isArray } from "@pureadmin/utils";
import compressPlugin from "vite-plugin-compression";
export const configCompressPlugin = (
compress: ViteCompression
): Plugin | Plugin[] => {
if (compress === "none") return null;
const gz = {
// 生成的压缩包后缀
ext: ".gz",
// 体积大于threshold才会被压缩
threshold: 0,
// 默认压缩.js|mjs|json|css|html后缀文件设置成true压缩全部文件
filter: () => true,
// 压缩后是否删除原始文件
deleteOriginFile: false
};
const br = {
ext: ".br",
algorithm: "brotliCompress",
threshold: 0,
filter: () => true,
deleteOriginFile: false
};
const codeList = [
{ k: "gzip", v: gz },
{ k: "brotli", v: br },
{ k: "both", v: [gz, br] }
];
const plugins: Plugin[] = [];
codeList.forEach(item => {
if (compress.includes(item.k)) {
if (compress.includes("clear")) {
if (isArray(item.v)) {
item.v.forEach(vItem => {
plugins.push(
compressPlugin(Object.assign(vItem, { deleteOriginFile: true }))
);
});
} else {
plugins.push(
compressPlugin(Object.assign(item.v, { deleteOriginFile: true }))
);
}
} else {
if (isArray(item.v)) {
item.v.forEach(vItem => {
plugins.push(compressPlugin(vItem));
});
} else {
plugins.push(compressPlugin(item.v));
}
}
}
});
return plugins;
};

52
build/info.ts Normal file
View File

@ -0,0 +1,52 @@
import type { Plugin } from "vite";
import gradient from "gradient-string";
import { getPackageSize } from "./utils";
import dayjs, { type Dayjs } from "dayjs";
import duration from "dayjs/plugin/duration";
import boxen, { type Options as BoxenOptions } from "boxen";
dayjs.extend(duration);
const boxenOptions: BoxenOptions = {
padding: 0.5,
borderColor: "cyan",
borderStyle: "round"
};
export function viteBuildInfo(): Plugin {
let config: { command: string };
let startTime: Dayjs;
let endTime: Dayjs;
let outDir: string;
return {
name: "vite:buildInfo",
configResolved(resolvedConfig) {
config = resolvedConfig;
outDir = resolvedConfig.build?.outDir ?? "dist";
},
buildStart() {
if (config.command === "build") {
startTime = dayjs(new Date());
}
},
closeBundle() {
if (config.command === "build") {
endTime = dayjs(new Date());
getPackageSize({
folder: outDir,
callback: (size: string) => {
console.log(
boxen(
gradient(["cyan", "magenta"]).multiline(
`🎉 恭喜打包完成(总用时${dayjs
.duration(endTime.diff(startTime))
.format("mm分ss秒")}${size}`
),
boxenOptions
)
);
}
});
}
}
};
}

30
build/optimize.ts Normal file
View File

@ -0,0 +1,30 @@
/**
* `vite.config.ts` `optimizeDeps.include`
* `vite` include esm node_modules/.vite
* include里vite 使 node_modules/.vite
* 使 src/main.ts include vite node_modules/.vite
*/
const include = [
"qs",
"mitt",
"dayjs",
"axios",
"pinia",
"vue-i18n",
"vue-types",
"js-cookie",
"vue-tippy",
"pinyin-pro",
"sortablejs",
"@vueuse/core",
"@pureadmin/utils",
"responsive-storage"
];
/**
*
* `@iconify-icons/` `exclude` 使
*/
const exclude = ["@iconify-icons/ep", "@iconify-icons/ri"];
export { include, exclude };

55
build/plugins.ts Normal file
View File

@ -0,0 +1,55 @@
import { cdn } from "./cdn";
import vue from "@vitejs/plugin-vue";
import { pathResolve } from "./utils";
import { viteBuildInfo } from "./info";
import svgLoader from "vite-svg-loader";
import type { PluginOption } from "vite";
import vueJsx from "@vitejs/plugin-vue-jsx";
import { configCompressPlugin } from "./compress";
import removeNoMatch from "vite-plugin-router-warn";
import { visualizer } from "rollup-plugin-visualizer";
import removeConsole from "vite-plugin-remove-console";
import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite";
import { codeInspectorPlugin } from "code-inspector-plugin";
export function getPluginsList(
VITE_CDN: boolean,
VITE_COMPRESSION: ViteCompression
): PluginOption[] {
const lifecycle = process.env.npm_lifecycle_event;
return [
vue(),
// jsx、tsx语法支持
vueJsx(),
VueI18nPlugin({
include: [pathResolve("../locales/**")]
}),
/**
* DOM IDE
* Mac Option + Shift
* Windows Alt + Shift
* https://inspector.fe-dev.cn/guide/start.html
*/
codeInspectorPlugin({
bundler: "vite",
hideConsole: true
}),
viteBuildInfo(),
/**
* vue-router动态路由警告No match found for location with path
* https://github.com/vuejs/router/issues/521 和 https://github.com/vuejs/router/issues/359
* vite-plugin-router-warn只在开发环境下启用vue-router文件并且只在服务启动或重启时运行一次
*/
removeNoMatch(),
// svg组件化支持
svgLoader(),
VITE_CDN ? cdn : null,
configCompressPlugin(VITE_COMPRESSION),
// 线上环境删除console
removeConsole({ external: ["src/assets/iconfont/iconfont.js"] }),
// 打包分析
lifecycle === "report"
? visualizer({ open: true, brotliSize: true, filename: "report.html" })
: (null as any)
];
}

110
build/utils.ts Normal file
View File

@ -0,0 +1,110 @@
import dayjs from "dayjs";
import { readdir, stat } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, resolve } from "node:path";
import { sum, formatBytes } from "@pureadmin/utils";
import {
name,
version,
engines,
dependencies,
devDependencies
} from "../package.json";
/** 启动`node`进程时所在工作目录的绝对路径 */
const root: string = process.cwd();
/**
* @description
* @param dir `build`
* @param metaUrl `url``build``import.meta.url`
*/
const pathResolve = (dir = ".", metaUrl = import.meta.url) => {
// 当前文件目录的绝对路径
const currentFileDir = dirname(fileURLToPath(metaUrl));
// build 目录的绝对路径
const buildDir = resolve(currentFileDir, "build");
// 解析的绝对路径
const resolvedPath = resolve(currentFileDir, dir);
// 检查解析的绝对路径是否在 build 目录内
if (resolvedPath.startsWith(buildDir)) {
// 在 build 目录内,返回当前文件路径
return fileURLToPath(metaUrl);
}
// 不在 build 目录内,返回解析后的绝对路径
return resolvedPath;
};
/** 设置别名 */
const alias: Record<string, string> = {
"@": pathResolve("../src"),
"@build": pathResolve()
};
/** 平台的名称、版本、运行所需的`node`和`pnpm`版本、依赖、最后构建时间的类型提示 */
const __APP_INFO__ = {
pkg: { name, version, engines, dependencies, devDependencies },
lastBuildTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
};
/** 处理环境变量 */
const wrapperEnv = (envConf: Recordable): ViteEnv => {
// 默认值
const ret: ViteEnv = {
VITE_PORT: 8848,
VITE_PUBLIC_PATH: "",
VITE_ROUTER_HISTORY: "",
VITE_CDN: false,
VITE_HIDE_HOME: "false",
VITE_COMPRESSION: "none"
};
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);
}
ret[envName] = realName;
if (typeof realName === "string") {
process.env[envName] = realName;
} else if (typeof realName === "object") {
process.env[envName] = JSON.stringify(realName);
}
}
return ret;
};
const fileListTotal: number[] = [];
/** 获取指定文件夹中所有文件的总大小 */
const getPackageSize = options => {
const { folder = "dist", callback, format = true } = options;
readdir(folder, (err, files: string[]) => {
if (err) throw err;
let count = 0;
const checkEnd = () => {
++count == files.length &&
callback(format ? formatBytes(sum(fileListTotal)) : sum(fileListTotal));
};
files.forEach((item: string) => {
stat(`${folder}/${item}`, async (err, stats) => {
if (err) throw err;
if (stats.isFile()) {
fileListTotal.push(stats.size);
checkEnd();
} else if (stats.isDirectory()) {
getPackageSize({
folder: `${folder}/${item}/`,
callback: checkEnd
});
}
});
});
files.length === 0 && callback(0);
});
};
export { root, pathResolve, alias, __APP_INFO__, wrapperEnv, getPackageSize };

35
commitlint.config.js Normal file
View File

@ -0,0 +1,35 @@
// @ts-check
/** @type {import("@commitlint/types").UserConfig} */
export default {
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"
]
]
}
};

184
eslint.config.js Normal file
View File

@ -0,0 +1,184 @@
import js from "@eslint/js";
import pluginVue from "eslint-plugin-vue";
import * as parserVue from "vue-eslint-parser";
import configPrettier from "eslint-config-prettier";
import pluginPrettier from "eslint-plugin-prettier";
import { defineFlatConfig } from "eslint-define-config";
import * as parserTypeScript from "@typescript-eslint/parser";
import pluginTypeScript from "@typescript-eslint/eslint-plugin";
export default defineFlatConfig([
{
...js.configs.recommended,
ignores: [
"**/.*",
"dist/*",
"*.d.ts",
"public/*",
"src/assets/**",
"src/**/iconfont/**"
],
languageOptions: {
globals: {
// index.d.ts
RefType: "readonly",
EmitType: "readonly",
TargetContext: "readonly",
ComponentRef: "readonly",
ElRef: "readonly",
ForDataType: "readonly",
AnyFunction: "readonly",
PropType: "readonly",
Writable: "readonly",
Nullable: "readonly",
NonNullable: "readonly",
Recordable: "readonly",
ReadonlyRecordable: "readonly",
Indexable: "readonly",
DeepPartial: "readonly",
Without: "readonly",
Exclusive: "readonly",
TimeoutHandle: "readonly",
IntervalHandle: "readonly",
Effect: "readonly",
ChangeEvent: "readonly",
WheelEvent: "readonly",
ImportMetaEnv: "readonly",
Fn: "readonly",
PromiseFn: "readonly",
ComponentElRef: "readonly",
parseInt: "readonly",
parseFloat: "readonly"
}
},
plugins: {
prettier: pluginPrettier
},
rules: {
...configPrettier.rules,
...pluginPrettier.configs.recommended.rules,
"no-debugger": "off",
"no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_"
}
],
"prettier/prettier": [
"error",
{
endOfLine: "auto"
}
]
}
},
{
files: ["**/*.?([cm])ts", "**/*.?([cm])tsx"],
languageOptions: {
parser: parserTypeScript,
parserOptions: {
sourceType: "module",
warnOnUnsupportedTypeScriptVersion: false
}
},
plugins: {
"@typescript-eslint": pluginTypeScript
},
rules: {
...pluginTypeScript.configs.strict.rules,
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-redeclare": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/prefer-as-const": "warn",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-unsafe-function-type": "off",
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/consistent-type-imports": [
"error",
{ disallowTypeAnnotations: false, fixStyle: "inline-type-imports" }
],
"@typescript-eslint/prefer-literal-enum-member": [
"error",
{ allowBitwiseExpressions: true }
],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_"
}
]
}
},
{
files: ["**/*.d.ts"],
rules: {
"eslint-comments/no-unlimited-disable": "off",
"import/no-duplicates": "off",
"unused-imports/no-unused-vars": "off"
}
},
{
files: ["**/*.?([cm])js"],
rules: {
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-var-requires": "off"
}
},
{
files: ["**/*.vue"],
languageOptions: {
globals: {
$: "readonly",
$$: "readonly",
$computed: "readonly",
$customRef: "readonly",
$ref: "readonly",
$shallowRef: "readonly",
$toRef: "readonly"
},
parser: parserVue,
parserOptions: {
ecmaFeatures: {
jsx: true
},
extraFileExtensions: [".vue"],
parser: "@typescript-eslint/parser",
sourceType: "module"
}
},
plugins: {
vue: pluginVue
},
processor: pluginVue.processors[".vue"],
rules: {
...pluginVue.configs.base.rules,
...pluginVue.configs["vue3-essential"].rules,
...pluginVue.configs["vue3-recommended"].rules,
"no-undef": "off",
"no-unused-vars": "off",
"vue/no-v-html": "off",
"vue/require-default-prop": "off",
"vue/require-explicit-emits": "off",
"vue/multi-word-component-names": "off",
"vue/no-setup-props-reactivity-loss": "off",
"vue/html-self-closing": [
"error",
{
html: {
void: "always",
normal: "always",
component: "always"
},
svg: "always",
math: "always"
}
]
}
}
]);

84
index.html Normal file
View File

@ -0,0 +1,84 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"/>
<title>海关编码查询系统</title>
<link rel="icon" href="./favicon.ico" />
<script>
window.process = {};
</script>
</head>
<body>
<div id="app">
<style>
html,
body,
#app {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
overflow: hidden;
}
.loader,
.loader::before,
.loader::after {
width: 2.5em;
height: 2.5em;
border-radius: 50%;
animation: load-animation 1.8s infinite ease-in-out;
animation-fill-mode: both;
}
.loader {
position: relative;
top: 0;
margin: 80px auto;
font-size: 10px;
color: #406eeb;
text-indent: -9999em;
transform: translateZ(0);
transform: translate(-50%, 0);
animation-delay: -0.16s;
}
.loader::before,
.loader::after {
position: absolute;
top: 0;
content: "";
}
.loader::before {
left: -3.5em;
animation-delay: -0.32s;
}
.loader::after {
left: 3.5em;
}
@keyframes load-animation {
0%,
80%,
100% {
box-shadow: 0 2.5em 0 -1.3em;
}
40% {
box-shadow: 0 2.5em 0 0;
}
}
</style>
<div class="loader"></div>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

164
locales/en.yaml Normal file
View File

@ -0,0 +1,164 @@
title: System Title
buttons:AccountSettings: Account
buttons:LoginOut: LoginOut
buttons:Login: Login
buttons:OpenSystemSet: Open System Configs
buttons:Reload: Reload
buttons:CloseCurrentTab: Close CurrentTab
buttons:CloseLeftTabs: Close LeftTabs
buttons:CloseRightTabs: Close RightTabs
buttons:CloseOtherTabs: Close OtherTabs
buttons:CloseAllTabs: Close AllTabs
buttons:ContentFullScreen: Content FullScreen
buttons:ContentExitFullScreen: Content ExitFullScreen
buttons:ClickCollapse: Collapse
buttons:ClickExpand: Expand
buttons:Confirm: Confirm
buttons:Cancel: Cancel
buttons:Switch: Switch
buttons:Close: Close
buttons:BackTop: BackTop
buttons:OpenText: Open
buttons:CloseText: Close
buttons:Search: Search
buttons:Reset: Reset
buttons:Add: Add
buttons:Update: Update
buttons:Delete: Delete
buttons:Export: Export
buttons:Save: Save
buttons:Permission: Permission
buttons:ExpandOrCollapse: Expand Or Collapse
buttons:CheckAllOrCheckOutAll: Check All Or Check Out All
buttons:Linked: Linked
buttons:More: More
buttons:Deselect: Deselect
buttons:DeleteInBatches: Delete In Batches
buttons:UploadAvatar: Upload Avatar
buttons:ResetPassword: Reset Password
buttons:RoleAllocation: Role Allocation
buttons:PermissionDetails: Permission Details
buttons:ForceToExit: Force Exit
buttons:Details: Details
search:Total: Total
search:History: History
search:Collect: Collect
search:DragSort: Drag Sort
search:Empty: Empty
search:Placeholder: Search Menu
panel:SystemSet: System Configs
panel:CloseSystemSet: Close System Configs
panel:ClearCacheAndToLogin: Clear cache and return to login page
panel:ClearCache: Clear Cache
panel:OverallStyle: Overall Style
panel:OverallStyleLight: Light
panel:OverallStyleLightTip: Set sail freshly and light up the comfortable work interface
panel:OverallStyleDark: Dark
panel:OverallStyleDarkTip: Moonlight Overture, indulge in the tranquility and elegance of the night
panel:OverallStyleSystem: Auto
panel:OverallStyleSystemTip: Synchronize time, the interface naturally responds to morning and dusk
panel:ThemeColor: Theme Color
panel:LayoutModel: Layout Model
panel:VerticalTip: The menu on the left is familiar and friendly
panel:HorizontalTip: Top menu, concise overview
panel:MixTip: Mixed menu, flexible
panel:Stretch: Stretch Page
panel:StretchFixed: Fixed
panel:StretchFixedTip: Compact pages make it easy to find the information you need
panel:StretchCustom: Custom
panel:StretchCustomTip: Minimum 1280, maximum 1600
panel:TagsStyle: Tags Style
panel:TagsStyleSmart: Smart
panel:TagsStyleSmartTip: Smart tags add fun and brilliance
panel:TagsStyleCard: Card
panel:TagsStyleCardTip: Card tags for efficient browsing
panel:TagsStyleChrome: Chrome
panel:TagsStyleChromeTip: Chrome style is classic and elegant
panel:InterfaceDisplay: Interface Display
panel:GreyModel: Grey Model
panel:WeakModel: Weak Model
panel:HiddenTags: Hidden Tags
panel:HiddenFooter: Hidden Footer
panel:MultiTagsCache: MultiTags Cache
menus:Home: Home
menus:Login: Login
menus:Empty: Empty Page
menus:SystemManagement: System Manage
menus:SystemUser: User Manage
menus:SystemRole: Role Manage
menus:SystemPermission: Permission Manage
menus:SystemDepartment: Department Manage
menus:SystemI18n: i18n Manage
menus:SystemI18nLocale: Locale Manage
menus:SystemI18nLanguage: Language Manage
menus:SystemMonitor: System Monitor
menus:OnlineUser: Online User
menus:LoginLog: Login Log
menus:OperationLog: Operation Log
menus:CacheMonitor: Cache Monitor
menus:CacheList: Cache List
menus:ServerMonitor: Server Monitor
menus:Abnormal: Abnormal Page
menus:FourZeroFour: "404"
menus:FourZeroOne: "403"
menus:Five: "500"
menus:SystemConfig: System Config
status:Load: Loading...
status:Message: Message
status:Notify: Notify
status:Todo: Todo
status:NoMessage: No Message
status:NoNotify: No Notify
status:NoTodo: No Todo
login:Username: Username
login:Nickname: Nickname
login:Password: Password
login:VerifyCode: VerifyCode
login:Remember: days no need to login
login:RememberInfo: After checking and logging in, will automatically log in to the system without entering your username and password within the specified number of days.
login:Sure: Sure Password
login:Forget: Forget Password?
login:Login: Login
login:Nextstep: Nextstep
login:Laststep: Laststep
login:ThirdLogin: Third Login
login:PhoneLogin: Phone Login
login:QRCodeLogin: QRCode Login
login:Register: Register
login:WeChatLogin: WeChat Login
login:AlipayLogin: Alipay Login
login:QQLogin: QQ Login
login:WeiBoLogin: Weibo Login
login:Phone: Phone
login:Email: Email
login:SmsVerifyCode: SMS VerifyCode
login:EmailVerifyCode: Email VerifyCode
login:Back: Back
login:Test: Mock Test
login:Tip: After scanning the code, click "Confirm" to complete the login
login:Definite: Definite
login:LoginSuccess: Login Success
login:LoginFail: Login Fail
login:RegisterSuccess: Regist Success
login:TickPrivacy: Please tick Privacy Policy
login:ReadAccept: I have read it carefully and accept
login:PrivacyPolicy: Privacy Policy
login:GetVerifyCode: Get VerifyCode
login:Info: Seconds
login:UsernameReg: Please enter username
login:NicknameReg: Please enter nickname
login:PassWordReg: Please enter password
login:VerifyCodeReg: Please enter verify code
login:EamilReg: Please enter email
login:VerifyCodeCorrectReg: Please enter correct verify code
login:VerifyCodeSixReg: Please enter a 6-digit verify code
login:PhoneReg: Please enter the phone
login:PhoneCorrectReg: Please enter the correct phone number format
login:PassWordRuleReg: The password format should be any combination of 8-18 digits
login:PassWordSureReg: Please enter confirm password
login:PassWordDifferentReg: The two passwords do not match!
login:PassWordUpdateReg: Password has been updated
logout:message: Whether to exit the system?
logout:success: Logout Success
logout:fail: Logout Fail
logout:cancel: Logout Cancel

165
locales/zh-CN.yaml Normal file
View File

@ -0,0 +1,165 @@
title: 系统标题
buttons:AccountSettings: 账户设置
buttons:LoginOut: 退出系统
buttons:Login: 登录
buttons:OpenSystemSet: 打开系统配置
buttons:Reload: 重新加载
buttons:CloseCurrentTab: 关闭当前标签页
buttons:CloseLeftTabs: 关闭左侧标签页
buttons:CloseRightTabs: 关闭右侧标签页
buttons:CloseOtherTabs: 关闭其他标签页
buttons:CloseAllTabs: 关闭全部标签页
buttons:ContentFullScreen: 内容区全屏
buttons:ContentExitFullScreen: 内容区退出全屏
buttons:ClickCollapse: 点击折叠
buttons:ClickExpand: 点击展开
buttons:Confirm: 确认
buttons:Switch: 切换
buttons:Close: 关闭
buttons:Cancel: 取消
buttons:BackTop: 回到顶部
buttons:OpenText:
buttons:CloseText:
buttons:Search: 搜索
buttons:Reset: 重置
buttons:Add: 添加
buttons:Update: 修改
buttons:Delete: 删除
buttons:Export: 导出
buttons:Save: 保存
buttons:Permission: 权限
buttons:ExpandOrCollapse: 展开或折叠
buttons:CheckAllOrCheckOutAll: 全选或者全不选
buttons:Linked: 联动
buttons:More: 更多
buttons:Deselect: 取消选择
buttons:DeleteInBatches: 批量删除
buttons:UploadAvatar: 上传头像
buttons:ResetPassword: 重置密码
buttons:RoleAllocation: 角色分配
buttons:PermissionDetails: 权限详情
buttons:ForceToExit: 强制退出
buttons:Details: 详情
search:Total:
search:History: 搜索历史
search:Collect: 收藏
search:DragSort: (可拖拽排序)
search:Empty: 暂无搜索结果
search:Placeholder: 搜索菜单(支持拼音搜索)
panel:SystemSet: 系统配置
panel:CloseSystemSet: 关闭配置
panel:ClearCacheAndToLogin: 清空缓存并返回登录页
panel:ClearCache: 清空缓存
panel:OverallStyle: 整体风格
panel:OverallStyleLight: 浅色
panel:OverallStyleLightTip: 清新启航,点亮舒适的工作界面
panel:OverallStyleDark: 深色
panel:OverallStyleDarkTip: 月光序曲,沉醉于夜的静谧雅致
panel:OverallStyleSystem: 自动
panel:OverallStyleSystemTip: 同步时光,界面随晨昏自然呼应
panel:ThemeColor: 主题色
panel:LayoutModel: 导航模式
panel:VerticalTip: 左侧菜单,亲切熟悉
panel:HorizontalTip: 顶部菜单,简洁概览
panel:MixTip: 混合菜单,灵活多变
panel:Stretch: 页宽
panel:StretchFixed: 固定
panel:StretchFixedTip: 紧凑页面,轻松找到所需信息
panel:StretchCustom: 自定义
panel:StretchCustomTip: 最小1280、最大1600
panel:TagsStyle: 页签风格
panel:TagsStyleSmart: 灵动
panel:TagsStyleSmartTip: 灵动标签,添趣生辉
panel:TagsStyleCard: 卡片
panel:TagsStyleCardTip: 卡片标签,高效浏览
panel:TagsStyleChrome: 谷歌
panel:TagsStyleChromeTip: 谷歌风格,经典美观
panel:InterfaceDisplay: 界面显示
panel:GreyModel: 灰色模式
panel:WeakModel: 色弱模式
panel:HiddenTags: 隐藏标签页
panel:HiddenFooter: 隐藏页脚
panel:MultiTagsCache: 页签持久化
menus:Home: 首页
menus:Login: 登录
menus:Empty: 无Layout页
menus:SystemManagement: 系统管理
menus:SystemUser: 用户管理
menus:SystemRole: 角色管理
menus:SystemPermission: 权限管理
menus:SystemDepartment: 部门管理
menus:SystemI18n: 国际化管理
menus:SystemI18nLocale: 类型管理
menus:SystemI18nLanguage: 语言管理
menus:SystemMonitor: 系统监控
menus:OnlineUser: 在线用户
menus:LoginLog: 登录日志
menus:OperationLog: 操作日志
menus:CacheMonitor: 缓存监控
menus:CacheList: 缓存列表
menus:ServerMonitor: 服务监控
menus:Abnormal: 异常页面
menus:FourZeroFour: "404"
menus:FourZeroOne: "403"
menus:Five: "500"
menus:SystemConfig: 系统配置
status:Load: 加载中...
status:Message: 消息
status:Notify: 通知
status:Todo: 待办
status:NoMessage: 暂无消息
status:NoNotify: 暂无通知
status:NoTodo: 暂无待办
login:Username: 账号
login:Nickname: 昵称
login:Password: 密码
login:VerifyCode: 验证码
login:Remember: 天内免登录
login:RememberInfo: 勾选并登录后,规定天数内无需输入用户名和密码会自动登入系统
login:Sure: 确认密码
login:Forget: 忘记密码?
login:Login: 登录
login:Nextstep: 下一步
login:Laststep: 上一步
login:ThirdLogin: 第三方登录
login:PhoneLogin: 手机登录
login:QRCodeLogin: 二维码登录
login:Register: 注册
login:WeChatLogin: 微信登录
login:AlipayLogin: 支付宝登录
login:QQLogin: QQ登录
login:WeiBoLogin: 微博登录
login:Phone: 手机号码
login:Email: 邮箱
login:SmsVerifyCode: 短信验证码
login:EmailVerifyCode: 邮箱验证码
login:Back: 返回
login:Test: 模拟测试
login:Tip: 扫码后点击"确认",即可完成登录
login:Definite: 确定
login:LoginSuccess: 登录成功
login:LoginFail: 登录失败
login:RegisterSuccess: 注册成功
login:TickPrivacy: 请勾选隐私政策
login:ReadAccept: 我已仔细阅读并接受
login:PrivacyPolicy: 《隐私政策》
login:GetVerifyCode: 获取验证码
login:Info: 秒后重新获取
login:UsernameReg: 请输入账号
login:NicknameReg: 请输入昵称
login:PassWordReg: 请输入密码
login:EmailReg: 请输入邮箱
login:VerifyCodeReg: 请输入验证码
login:VerifyCodeCorrectReg: 请输入正确的验证码
login:VerifyCodeSixReg: 请输入6位数字验证码
login:PhoneReg: 请输入手机号码
login:PhoneCorrectReg: 请输入正确的手机号码格式
login:PassWordRuleReg: 密码格式应为8-18位数字、字母、符号的任意两种组合
login:PassWordSureReg: 请输入确认密码
login:PassWordDifferentReg: 两次密码不一致!
login:PassWordUpdateReg: 修改密码成功
logout:message: 是否退出当前系统?
logout:success: 退出成功
logout:fail: 退出失败
logout:cancel: 退出取消

163
package.json Normal file
View File

@ -0,0 +1,163 @@
{
"name": "pure-admin-thin",
"version": "5.9.0",
"private": true,
"type": "module",
"scripts": {
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",
"serve": "pnpm dev",
"build": "rimraf dist && NODE_OPTIONS=--max-old-space-size=8192 vite build",
"build:staging": "rimraf dist && vite build --mode staging",
"report": "rimraf dist && vite build",
"preview": "vite preview",
"preview:build": "pnpm build && vite preview",
"typecheck": "tsc --noEmit && vue-tsc --noEmit --skipLibCheck",
"svgo": "svgo -f . -r",
"clean:cache": "rimraf .eslintcache && rimraf pnpm-lock.yaml && rimraf node_modules && pnpm store prune && pnpm install",
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock,build}/**/*.{vue,js,ts,tsx}\" --fix",
"lint:prettier": "prettier --write \"src/**/*.{js,ts,json,tsx,css,scss,vue,html,md}\"",
"lint:stylelint": "stylelint --cache --fix \"**/*.{html,vue,css,scss}\" --cache-location node_modules/.cache/stylelint/",
"lint": "pnpm lint:eslint && pnpm lint:prettier && pnpm lint:stylelint",
"prepare": "husky",
"preinstall": "npx only-allow pnpm"
},
"keywords": [
"pure-admin-thin",
"vue-pure-admin",
"element-plus",
"tailwindcss",
"pure-admin",
"typescript",
"pinia",
"vue3",
"vite",
"esm"
],
"homepage": "https://github.com/pure-admin/pure-admin-thin/tree/i18n",
"repository": {
"type": "git",
"url": "git+https://github.com/pure-admin/pure-admin-thin.git"
},
"bugs": {
"url": "https://github.com/pure-admin/vue-pure-admin/issues"
},
"license": "MIT",
"author": {
"name": "xiaoxian521",
"email": "pureadmin@163.com",
"url": "https://github.com/xiaoxian521"
},
"dependencies": {
"@pureadmin/descriptions": "^1.2.1",
"@pureadmin/table": "^3.2.1",
"@pureadmin/utils": "^2.5.0",
"@vueuse/core": "^12.0.0",
"@vueuse/motion": "^2.2.6",
"@zxcvbn-ts/core": "^3.0.4",
"animate.css": "^4.1.1",
"axios": "^1.7.9",
"cropperjs": "^1.6.2",
"dayjs": "^1.11.13",
"echarts": "^5.5.1",
"element-plus": "^2.9.0",
"js-cookie": "^3.0.5",
"localforage": "^1.10.0",
"mitt": "^3.0.1",
"nprogress": "^0.2.0",
"path-browserify": "^1.0.1",
"pinia": "^2.3.0",
"pinyin-pro": "^3.26.0",
"qrcode": "^1.5.4",
"qs": "^6.13.1",
"responsive-storage": "^2.2.0",
"sortablejs": "^1.15.6",
"typeit": "^8.8.7",
"vue": "^3.5.13",
"vue-i18n": "^10.0.5",
"vue-json-pretty": "^2.4.0",
"vue-router": "^4.5.0",
"vue-tippy": "^6.5.0",
"vue-types": "^5.1.3"
},
"devDependencies": {
"@commitlint/cli": "^19.6.0",
"@commitlint/config-conventional": "^19.6.0",
"@commitlint/types": "^19.5.0",
"@eslint/js": "^9.16.0",
"@faker-js/faker": "^9.3.0",
"@iconify-icons/ep": "^1.2.12",
"@iconify-icons/ri": "^1.2.10",
"@iconify/vue": "^4.2.0",
"@intlify/unplugin-vue-i18n": "^6.0.1",
"@types/js-cookie": "^3.0.6",
"@types/node": "^20.17.9",
"@types/nprogress": "^0.2.3",
"@types/path-browserify": "^1.0.3",
"@types/qs": "^6.9.17",
"@types/sortablejs": "^1.15.8",
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.18.0",
"@vitejs/plugin-vue": "^5.2.1",
"@vitejs/plugin-vue-jsx": "^4.1.1",
"autoprefixer": "^10.4.20",
"boxen": "^8.0.1",
"code-inspector-plugin": "^0.18.2",
"cssnano": "^7.0.6",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-define-config": "^2.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-vue": "^9.32.0",
"gradient-string": "^3.0.0",
"husky": "^9.1.7",
"lint-staged": "^15.2.10",
"postcss": "^8.4.49",
"postcss-html": "^1.7.0",
"postcss-import": "^16.1.0",
"postcss-scss": "^4.0.9",
"prettier": "^3.4.2",
"rimraf": "^6.0.1",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.82.0",
"stylelint": "^16.11.0",
"stylelint-config-recess-order": "^5.1.1",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard-scss": "^13.1.0",
"stylelint-prettier": "^5.0.2",
"svgo": "^3.3.2",
"tailwindcss": "^3.4.16",
"typescript": "5.6.3",
"vite": "^6.0.3",
"vite-plugin-cdn-import": "^1.0.1",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-remove-console": "^2.2.0",
"vite-plugin-router-warn": "^1.0.0",
"vite-svg-loader": "^5.1.0",
"vue-eslint-parser": "^9.4.3",
"vue-tsc": "^2.1.10"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=22.0.0",
"pnpm": ">=9"
},
"pnpm": {
"allowedDeprecatedVersions": {
"are-we-there-yet": "*",
"sourcemap-codec": "*",
"domexception": "*",
"w3c-hr-time": "*",
"inflight": "*",
"npmlog": "*",
"rimraf": "*",
"stable": "*",
"gauge": "*",
"abab": "*",
"glob": "*"
},
"peerDependencyRules": {
"allowedVersions": {
"eslint": "9"
}
}
}
}

7347
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

12
postcss.config.js Normal file
View File

@ -0,0 +1,12 @@
// @ts-check
/** @type {import('postcss-load-config').Config} */
export default {
plugins: {
"postcss-import": {},
"tailwindcss/nesting": {},
tailwindcss: {},
autoprefixer: {},
...(process.env.NODE_ENV === "production" ? { cssnano: {} } : {})
}
};

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

1
public/logo.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@ -0,0 +1,27 @@
{
"Version": "1.0.0",
"Period": "2024-present",
"FixedHeader": true,
"HiddenSideBar": false,
"MultiTagsCache": true,
"KeepAlive": true,
"Locale": "zh",
"Layout": "vertical",
"Theme": "light",
"DarkMode": false,
"OverallStyle": "light",
"Grey": false,
"Weak": false,
"HideTabs": false,
"HideFooter": false,
"Stretch": false,
"SidebarStatus": true,
"EpThemeColor": "#409EFF",
"ShowLogo": true,
"ShowModel": "chrome",
"MenuArrowIconNoTransition": false,
"CachingAsyncRoutes": false,
"TooltipEffect": "light",
"ResponsiveStorageNameSpace": "responsive-",
"MenuSearchHistory": 6
}

11349
public/wasm/capture.worker.js Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

5477
public/wasm/index.js Normal file

File diff suppressed because it is too large Load Diff

27
src/App.vue Normal file
View File

@ -0,0 +1,27 @@
<template>
<el-config-provider :locale="currentLocale">
<router-view />
<ReDialog />
</el-config-provider>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { ElConfigProvider } from "element-plus";
import { ReDialog } from "@/components/ReDialog";
import en from "element-plus/es/locale/lang/en";
import zhCn from "element-plus/es/locale/lang/zh-cn";
export default defineComponent({
name: "app",
components: {
[ElConfigProvider.name]: ElConfigProvider,
ReDialog
},
computed: {
currentLocale() {
return this.$storage.locale?.locale === "zh" ? zhCn : en;
}
}
});
</script>

201
src/api/i18n.ts Normal file
View File

@ -0,0 +1,201 @@
import { http } from "@/utils/http";
import type { LanguageInfo, TranslationInfo } from "types/system";
/**
*
*/
type AddLocaleParams = {
/**编码 */
code: string;
/**名称 */
name: string;
};
/**
*
* @param data
* @returns
*/
export const postAddLocaleAPI = (data: AddLocaleParams) => {
return http.request<null>("post", "/api/i18n/addLocale", {
data
});
};
/**
*
* @param id
* @returns
*/
export const deleteLocaleAPI = (id: string) => {
return http.request<null>("post", `/api/i18n/deleteLocale/${id}`);
};
/**
*
*/
export const putUpdateLocaleAPI = (data: AddLocaleParams, id: string) => {
return http.request<null>("post", `/api/i18n/updateLocale/${id}`, {
data
});
};
/**
*
*/
export const getLocaleInfoAPI = (id: string) => {
return http.request<LanguageInfo>("get", `/api/i18n/locale/info/${id}`);
};
type GetLoacleListParams = {
/**页码 */
page: number;
/**每页条数 */
pageSize: number;
/**语言名称 */
name?: string;
/**语言编码 */
code?: string;
};
type GetLocaleListResult = {
/**语言列表 */
result: LanguageInfo[];
/**总条数 */
total: number;
/**页码 */
page: number;
};
export const getLocaleListAPI = (params: GetLoacleListParams) => {
return http.request<GetLocaleListResult>("get", "/api/i18n/locale/list", {
params
});
};
/**
*
*/
type AddI18nParams = {
/**键值 */
key: string;
/**翻译内容 */
translation: string;
/**语言ID */
locale_id: string;
};
/**
*
* @param data
* @returns
*/
export const postAddI18nAPI = (data: AddI18nParams) => {
return http.request<null>("post", "/api/i18n/addI18n", {
data
});
};
/**
*
*/
type GetI18nListParams = {
/**页码 */
page: number;
/**每页条数 */
pageSize: number;
/**语言ID */
locale_id?: string;
/**键值 */
key?: string;
/**翻译内容 */
translation?: string;
};
/**
*
*/
type GetI18nListResult = {
/**翻译列表 */
result: TranslationInfo[];
/**总条数 */
total: number;
/**页码 */
page: number;
};
/**
*
* @param params
* @returns
*/
export const getI18nListAPI = (params: GetI18nListParams) => {
return http.request<GetI18nListResult>("get", "/api/i18n/list", {
params
});
};
/**
*
*/
export const getI18nInfoAPI = (id: string) => {
return http.request<TranslationInfo>("get", `/api/i18n/info/${id}`);
};
/**
*
* @param id
* @returns
*/
export const deleteI18nAPI = (id: string) => {
return http.request<null>("post", `/api/i18n/deleteI18n/${id}`);
};
/**
*
* @param data
* @param id
* @returns
*/
export const putUpdateI18nAPI = (data: AddI18nParams, id: string) => {
return http.request<null>("post", `/api/i18n/updateI18n/${id}`, {
data
});
};
/**
*
*/
type GetI18nHandleListResult = {
/**
*
*/
data: object;
/**
*
*/
name: string;
/**
*
*/
locale: string;
};
/**
*
* @param id
* @returns
*/
export const getI18nHandleListAPI = (id: string) => {
return http.request<GetI18nHandleListResult>(
"get",
`/api/i18n/infoList/${id}`
);
};
/**
*
* @param locale
* @returns
*/
export const getLocaleI18nAPI = (locale: string) => {
return http.request<Record<string, any>>("get", `/api/i18n/data/${locale}`);
};

158
src/api/login.ts Normal file
View File

@ -0,0 +1,158 @@
import type { UserInfo } from "@/utils/auth";
import { http } from "@/utils/http";
export type LoginResult = {
/** `token` */
accessToken: string;
/** 用于调用刷新`accessToken`的接口时所需的`token` */
refreshToken: string;
/** `accessToken`的过期时间戳(毫秒) */
expiresTime: number;
};
/**
*
* @param data
* @returns
*/
export const getLogin = (data?: object) => {
return http.request<LoginResult>("post", "/api/login", {
headers: {
"content-type": "application/x-www-form-urlencoded"
},
data
});
};
/** 刷新token */
export const refreshTokenApi = (data: { refreshToken: string }) => {
return http.request<LoginResult>("post", "/api/refreshToken", {
headers: {
"content-type": "application/x-www-form-urlencoded"
},
data
});
};
export type CaptchaResponse = {
/**验证码ID */
uuid: string | null;
/**验证码 */
captcha: string | null;
/**是否开启验证码 */
captcha_enabled: boolean;
/**是否开启注册 */
register_enabled: boolean;
};
/** 获取验证码 */
export const GetCaptchaAPI = () => {
return http.request<CaptchaResponse>("get", "/api/captcha");
};
/**
*
* @returns
*/
export const getUserRoutesAPI = () => {
return http.request<any[]>("GET", "/api/getRoutes");
};
/**
*
*/
export const getUserInfoAPI = () => {
return http.request<UserInfo>("get", `/api/info`);
};
/**
* 退
*/
export const logoutAPI = () => {
return http.request<null>("post", `/api/logout`);
};
/**获取验证码参数 */
type GetCodeParams = {
/**用户账号 */
username: string;
/**验证码类型 */
title: string;
/**收件邮箱 */
mail: string;
};
/**
*
* @param data
* @returns
*/
export const postGetCodeAPI = (data: GetCodeParams) => {
return http.request<null>("post", `/api/code`, {
data
});
};
/**
*
*/
type RegisterParams = {
/**用户名 */
username: string;
/**密码 */
password: string;
/**邮箱 */
email: string;
/**验证码 */
code: string;
/**性别 */
gender: number;
/**昵称 */
nickname: string;
/**手机号 */
phone: string;
/**部门ID */
department_id: string;
};
/**
*
* @param data
* @returns
*/
export const postRegisterAPI = (data: RegisterParams) => {
return http.request<null>("post", `/api/register`, {
data
});
};
/**
*
*/
type ResetPasswordParams = {
/**
*
*/
username: string;
/**
*
*/
mail: string;
/**
*
*/
code: string;
/**
*
*/
password: string;
};
/**
*
* @param data
* @returns
*/
export const postResetPasswordAPI = (data: ResetPasswordParams) => {
return http.request<null>("post", `/api/resetPassword`, {
data
});
};

109
src/api/monitor.ts Normal file
View File

@ -0,0 +1,109 @@
import { http } from "@/utils/http";
import type {
CacheItem,
CacheList,
OperationLogInfo,
RedisMonitorInfo,
SystemMonitorInfo,
UserLoginLogInfo
} from "types/monitor";
import { filterEmptyObject } from "./utils";
// --------------------------登录日志相关--------------------------------------
/**
*
*/
export const getUserLoginLogAPI = (params: {
page: number;
pageSize: number;
}) => {
return http.request<QueryListResult<UserLoginLogInfo>>(
"get",
"/api/log/login",
{
params: filterEmptyObject(params)
}
);
};
/**
* 退
* @param id
* @returns
*/
export const deleteUserOnlineAPI = (id: string) => {
return http.request<null>("delete", `/api/log/logout/${id}`);
};
// ------------------------操作日志相关----------------------------------------
/**
*
*/
export const getUserOperationsAPI = (params: {
page: number;
pageSize: number;
}) => {
return http.request<QueryListResult<OperationLogInfo>>(
"GET",
"/api/log/operation",
{
params
}
);
};
// ------------------------服务相关----------------------------------------
/**
*
*/
export const getSystemMonitorInfoAPI = () => {
return http.request<SystemMonitorInfo>("get", "/api/server");
};
// --------------------------缓存相关--------------------------------------
/**
*
* @returns
*/
export const getCachedMonitorInfoAPI = () => {
return http.request<RedisMonitorInfo>("get", "/api/cache/monitor");
};
/**
*
*/
export const getCachedNamesAPI = () => {
return http.request<CacheList>("get", "/api/cache/names");
};
/**获取缓存键名列表 */
export const getCachedKeysAPI = (cacheName: string) => {
return http.request<string[]>("get", `/api/cache/keys/${cacheName}`);
};
/**获取缓存详细信息 */
export const getCachedInfoAPI = (cacheName: string, cacheKey: string) => {
return http.request<CacheItem>(
"get",
`/api/cache/info/${cacheName}/${cacheKey}`
);
};
/**通过键名删除缓存 */
export const deleteCachedAPI = (name: string) => {
return http.request<null>("delete", `/api/cache/cacheName/${name}`);
};
/**通过键值删除缓存 */
export const deleteCachedKeyAPI = (key: string) => {
return http.request<null>("delete", `/api/cache/cacheKey/${key}`);
};
/**删除所有缓存 */
export const deleteAllCachedAPI = () => {
return http.request<null>("delete", `/api/cache/clearAll`);
};

10
src/api/routes.ts Normal file
View File

@ -0,0 +1,10 @@
import { http } from "@/utils/http";
type Result = {
success: boolean;
data: Array<any>;
};
export const getAsyncRoutes = () => {
return http.request<Result>("get", "/get-async-routes");
};

596
src/api/system.ts Normal file
View File

@ -0,0 +1,596 @@
import { http } from "@/utils/http";
import type {
ConfigInfo,
DepartmentInfo,
DepartmentRoleInfo,
PermissionInfo,
RoleInfo,
RolePermissionInfo,
UserInfo
} from "types/system";
import { filterEmptyObject } from "./utils";
// ---------------------------部门相关-------------------------------------
/**
*
*/
type GetDepartmentListParams = {
/**当前页 */
page: number;
/**每页数量 */
pageSize: number;
/**部门ID */
id?: string;
/**部门名称 */
name?: string;
/**附属部门ID */
parent_id?: string;
/**部门负责人 */
principal?: string;
/**部门电话 */
phone?: number | string;
/**部门邮件 */
email?: string;
/**备注 */
remark?: string;
/**排序 */
sort?: number | string;
};
/**获取部门列表 */
export const getDepartmentListAPI = (params: GetDepartmentListParams) => {
return http.request<QueryListResult<DepartmentInfo>>(
"get",
`/api/department/list`,
{
params: filterEmptyObject(params)
}
);
};
/**更新部门数据 */
export const putUpdateDepartmentAPI = (
data: AddDepartmentParams,
id: string
) => {
return http.request<null>("post", `/api/department/update/${id}`, {
data
});
};
/**添加部门数据参数 */
type AddDepartmentParams = {
/**部门名称 */
name: string;
/**父部门ID */
parent_id: string;
/**排序 */
sort: number;
/**部门负责人 */
principal: string;
/**部门电话 */
phone: number | string;
/**部门邮件 */
email: string;
/**备注 */
remark: string;
/**状态 */
status: number;
};
/**添加部门数据 */
export const postAddDepartmentAPI = (data: AddDepartmentParams) => {
return http.request<null>("post", `/api/department/add`, {
data
});
};
/**删除部门及其附属部门 */
export const deleteDepartmentAPI = (id: string) => {
return http.request<null>("post", `/api/department/delete/${id}`);
};
// ----------------------------权限相关------------------------------------
/** 获取权限列表参数 */
type GetPermissionListParams = {
/** 当前页码 */
page: number;
/** 每页条数 */
pageSize: number;
/** 主键 */
id?: string;
/** 权限名称 */
name?: string;
/** 父权限ID */
parentId?: string;
/** 权限路径 */
path?: string;
/** 排序权重 */
rank?: number;
/** 菜单类型0菜单、1iframe、2外链、3按钮 */
menuType?: number;
/** 显示菜单 */
showLink?: boolean;
/** 显示父级菜单 */
showParent?: boolean;
/** 激活路径 */
activePath?: string;
/** 组件路径 */
component?: string;
/** 重定向路径 */
redirect?: string;
/** iframe路径 */
frameSrc?: string;
/** iframe加载动画 */
frameLoading?: boolean;
/** 缓存组件 */
keepAlive?: boolean;
/** 权限标识 */
auths?: string;
/** 菜单图标 */
icon?: string;
/** 右侧图标 */
extraIcon?: string;
/** 进场动画 */
enterTransition?: string;
/** 离场动画 */
leaveTransition?: string;
/** 固定标签页 */
fixedTag?: boolean;
/** 隐藏标签页 */
hiddenTag?: boolean;
};
/**获取权限列表 */
export const getPermissionListAPI = (params: GetPermissionListParams) => {
return http.request<QueryListResult<PermissionInfo>>(
"get",
`/api/permission/list`,
{
params: filterEmptyObject(params)
}
);
};
/**添加权限参数 */
type AddPermissionParams = {
/** 路由名称 */
name: string;
/** 路由路径 */
path: string;
/** 菜单名称 */
title: string;
/** 组件路径 */
component?: string;
/** 菜单排序 */
rank: number;
/** 路由重定向 */
redirect?: string;
/** 菜单图标 */
icon?: string;
/** 右侧图标 */
extra_icon?: string;
/** 进场动画 */
enter_transition?: string;
/** 离场动画 */
leave_transition?: string;
/** 菜单激活路径 */
active_path?: string;
/** 权限标识 */
auths?: string;
/** iframe链接地址 */
frame_src?: string;
/** iframe加载动画 */
frame_loading: boolean;
/** 缓存页面 */
keep_alive: boolean;
/** 隐藏标签页 */
hidden_tag: boolean;
/** 固定标签页 */
fixed_tag: boolean;
/** 显示菜单 */
show_link: boolean;
/** 显示父级菜单 */
show_parent: boolean;
/** 父级菜单ID */
parent_id: string;
/** 菜单类型 */
menu_type: number;
};
/**
*
* @param data
* @returns
*/
export const postAddPermissionAPI = (data: AddPermissionParams) => {
return http.request<null>("post", `/api/permission/add`, {
data
});
};
/**
*
* @param id ID
* @returns
*/
export const deletePermissionAPI = (id: string) => {
return http.request<null>("post", `/api/permission/delete/${id}`);
};
/**更新权限信息 */
type UpdatePermissionParams = {} & AddPermissionParams;
/**
*
* @param id ID
* @param data
* @returns
*/
export const putUpdatePermissionAPI = (
id: string,
data: UpdatePermissionParams
) => {
return http.request<null>("post", `/api/permission/update/${id}`, {
data
});
};
/**
*
* @param id ID
* @returns
*/
export const getRolePermissionsAPI = (id: string) => {
return http.request<QueryListResult<RolePermissionInfo>>(
"get",
`/api/role/permissionList/${id}`
);
};
/**
*
* @param id ID
* @param data
* @returns
*/
export const putUpdateRolePermissionsAPI = (
id: string,
data: {
permission_ids: string[];
}
) => {
return http.request<null>("put", `/api/role/updatePermission/${id}`, {
data
});
};
// -----------------------------角色相关-----------------------------------
type GetRoleListParams = {
/**当前页 */
page: number;
/**每页数量 */
pageSize: number;
/**角色名称 */
name?: string;
/**角色标识符 */
code?: string;
/**角色描述 */
description?: string;
/**所属部门ID */
department_id?: string;
};
/**获取角色列表 */
export const getRoleListAPI = (params: GetRoleListParams) => {
return http.request<QueryListResult<RoleInfo>>("get", `/api/role/list`, {
params: filterEmptyObject(params)
});
};
/**添加角色参数 */
type AddRoleParams = {
/**角色姓名 */
name: string;
/**角色标识 */
code: string;
/**角色描述 */
description: string;
/**所属部门ID */
department_id: string;
/**状态 */
status: number | string;
};
/**更新角色数据 */
export const putUpdateRoleAPI = (data: AddRoleParams, id: string) => {
return http.request<null>("post", `/api/role/update/${id}`, {
data
});
};
/**添加角色数据 */
export const postAddRoleAPI = (data: AddRoleParams) => {
return http.request<null>("post", `/api/role/add`, {
data
});
};
/**删除角色 */
export const deleteRoleAPI = (id: string) => {
return http.request<null>("post", `/api/role/delete/${id}`);
};
// --------------------------用户相关--------------------------------------
/**添加用户参数 */
type AddUserParams = {
/**用户账号 */
username: string;
/**用户密码 */
password: string;
/**用户性别 */
gender: number;
/**用户头像 */
avatar: string;
/**用户邮箱 */
email: string;
/**用户姓名 */
nickname: string;
/**用户手机号 */
phone: string;
/**用户状态 */
status: number;
/**用户部门 */
department_id: string;
};
/**
*
* @param data
* @returns
*/
export const postAddUserAPI = (data: AddUserParams) => {
return http.request<null>("post", `/api/user/add`, {
data
});
};
/**获取用户列表参数 */
type GetUserListParams = {
/**当前页 */
page: number;
/**每页数量 */
pageSize: number;
/**部门ID */
department_id?: string;
/**用户账号 */
username?: string;
/**用户姓名 */
nickname?: string;
/**用户ID */
id?: string;
/**用户状态 */
status?: string;
/**用户手机号 */
phone?: string;
/**用户邮箱 */
email?: string;
/**用户性别 */
gender?: number | string;
};
/**获取用户列表 */
export const getUserListAPI = (params: GetUserListParams) => {
return http.request<QueryListResult<UserInfo>>("get", `/api/user/list`, {
params: filterEmptyObject(params)
});
};
/**更新用户参数 */
type UpdateUserParams = {
/**用户账号 */
username: string;
/**用户性别 */
gender: number;
/**用户头像 */
avatar: string;
/**用户邮箱 */
email: string;
/**用户姓名 */
nickname: string;
/**用户手机号 */
phone: string;
/**用户状态 */
status: number;
/**用户部门 */
department_id: string;
};
/**
*
* @param id ID
* @param data
* @returns
*/
export const putUpdateUserAPI = (id: string, data: UpdateUserParams) => {
return http.request<null>("put", `/api/user/update/${id}`, {
data
});
};
/**
*
* @param id ID
* @returns
*/
export const deleteUserAPI = (id: string) => {
return http.request<null>("post", `/api/user/delete/${id}`);
};
/**
*
* @param data ID列表
* @returns
*/
export const deleteUserListAPI = (data: { userIds: string[] }) => {
return http.request<null>("post", `/api/user/deleteUserList`, { data });
};
/**
*
* @param id ID
* @param data
* @returns
*/
export const putUpdateUserPasswordAPI = (
id: string,
data: { password: string }
) => {
return http.request<null>("post", `/api/user/updateUserPassword/${id}`, {
headers: {
"content-type": "application/x-www-form-urlencoded"
},
data
});
};
/**
*
* @param id ID
* @returns
*/
export const getUserRolesAPI = (id: string) => {
return http.request<QueryListResult<DepartmentRoleInfo>>(
"get",
`/api/user/roleList/${id}`
);
};
type UpdateUserRoleParams = {
/**用户ID */
user_id: string;
/**角色ID */
role_ids: string[];
};
/**
*
* @param id ID
* @param data
* @returns
*/
export const putUpdateUserRolesAPI = (data: UpdateUserRoleParams) => {
return http.request<null>("post", `/api/user/updateRole`, {
data
});
};
/**
*
* @param id ID
* @returns
*/
export const getUserPermissionsAPI = (id: string) => {
return http.request<string[]>("get", `/api/user/permissionList/${id}`);
};
/**用户获取部门角色列表 */
export const getUserGetDepartmentRolesAPI = (id: string) => {
return http.request<QueryListResult<DepartmentRoleInfo>>(
"get",
`/api/department/roleList/${id}`
);
};
// ---------------------------配置相关-------------------------------------
/**
*
*/
interface AddConfigParams {
/**配置名称 */
name: string;
/**配置键值 */
key: string;
/**配置值 */
value: string;
/**系统配置 */
type: string;
/**备注 */
remark?: string;
}
/**
*
* @param data
* @returns
*/
export const postAddConfigAPI = (data: AddConfigParams) => {
return http.request<null>("post", `/api/config/add`, {
data
});
};
/**
*
*/
export const deleteConfigAPI = (id: string) => {
return http.request<null>("post", `/api/config/delete/${id}`);
};
/**
*
* @param data ID列表
*/
export const deleteConfigListAPI = (data: { ids: string[] }) => {
return http.request<null>("post", `/api/config/deleteList`, { data });
};
/**
*
*/
export const putUpdateConfigAPI = (data: AddConfigParams, id: string) => {
return http.request<null>("post", `/api/config/update/${id}`, {
data
});
};
/**
*
* @param id ID
*/
export const getConfigAPI = (id: string) => {
return http.request<ConfigInfo>("get", `/api/config/info/${id}`);
};
/**
*
*/
interface GetConfigListParams {
/**
*
*/
page: number;
/**
*
*/
pageSize: number;
/**
*
*/
name?: string;
/**
*
*/
key?: string;
/**
*
*/
type?: string;
}
/**
*
* @param params
*/
export const getConfigListAPI = (params: GetConfigListParams) => {
return http.request<QueryListResult<ConfigInfo>>("get", `/api/config/list`, {
params: filterEmptyObject(params)
});
};

125
src/api/user.ts Normal file
View File

@ -0,0 +1,125 @@
import { http } from "@/utils/http";
import type { FileInfo } from "types/file";
/**
*
*/
export type LoginResponse = {
/**用户Token */
token: string;
};
export type UserResult = {
/**用户ID */
userId: string;
/** 用户名 */
username: string;
/**用户头像 */
avatar: string;
/** 用户角色 */
roles: string[];
/** `token` */
accessToken: string;
/**用户权限 */
permissions: string[];
/** `accessToken`的过期时间戳(毫秒) */
expires: number;
};
/** 登录 */
export const getLogin = (data?: object) => {
return http.request<UserResult>("post", "/api/login", {
// headers: {
// "Content-Type": "application/x-www-form-urlencoded"
// },
data
});
};
/**
*
* @param data
* @returns
*/
export const putUpdateEmailAPI = (data: {
/**密码 */
password: string;
/**邮箱 */
email: string;
}) => {
return http.request<null>("put", `/api/user/updateEmail`, {
headers: {
"content-type": "application/x-www-form-urlencoded"
},
data
});
};
/**
*
* @param data
* @returns
*/
export const putUpdatePasswordAPI = (data: {
/**旧密码 */
oldPassword: string;
/**新密码 */
newPassword: string;
}) => {
return http.request<null>("put", `/api/user/updatePassword`, {
headers: {
"content-type": "application/x-www-form-urlencoded"
},
data
});
};
/**
*
* @param data
* @returns
*/
export const putUpdatePhoneAPI = (data: {
/**密码 */
password: string;
/**手机号 */
phone: string;
}) => {
return http.request<null>("put", `/api/user/updatePhone`, {
headers: {
"content-type": "application/x-www-form-urlencoded"
},
data
});
};
/**更新用户基础信息参数 */
type UpdateBaseUserInfoParams = {
/**姓名 */
name: string;
/**性别 */
gender: number;
};
/**
*
* @param data
* @returns
*/
export const putUpdateBaseUserInfoAPI = (data: UpdateBaseUserInfoParams) => {
return http.request<null>("PUT", "/api/user/updateBaseUserInfo", { data });
};
/**
*
* @param id ID
* @param data
* @returns
*/
export const postUploadAvatarAPI = (id: string, data: { file: Blob }) => {
return http.request<FileInfo>("post", `/api/user/avatar/${id}`, {
headers: {
"content-type": "multipart/form-data"
},
data
});
};

13
src/api/utils.ts Normal file
View File

@ -0,0 +1,13 @@
/**过滤字典中的空值字段 */
export const filterEmptyObject = (data: object): object => {
// 初始化一个空对象用于存储非空值字段
return Object.keys(data).reduce((acc, cur) => {
// 检查当前字段的值是否为空
if (data[cur] !== null && data[cur] !== undefined && data[cur] !== "") {
// 如果不为空,则将其添加到结果对象中
acc[cur] = data[cur];
}
// 返回累积的结果对象
return acc;
}, {});
};

View File

@ -0,0 +1,27 @@
@font-face {
font-family: "iconfont"; /* Project id 2208059 */
src:
url("iconfont.woff2?t=1671895108120") format("woff2"),
url("iconfont.woff?t=1671895108120") format("woff"),
url("iconfont.ttf?t=1671895108120") format("truetype");
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.pure-iconfont-tabs:before {
content: "\e63e";
}
.pure-iconfont-logo:before {
content: "\e620";
}
.pure-iconfont-new:before {
content: "\e615";
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,30 @@
{
"id": "2208059",
"name": "pure-admin",
"font_family": "iconfont",
"css_prefix_text": "pure-iconfont-",
"description": "pure-admin-iconfont",
"glyphs": [
{
"icon_id": "20594647",
"name": "Tabs",
"font_class": "tabs",
"unicode": "e63e",
"unicode_decimal": 58942
},
{
"icon_id": "22129506",
"name": "PureLogo",
"font_class": "logo",
"unicode": "e620",
"unicode_decimal": 58912
},
{
"icon_id": "7795615",
"name": "New",
"font_class": "new",
"unicode": "e615",
"unicode_decimal": 58901
}
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" class="icon" viewBox="0 0 1024 1024"><path fill="#386BF3" d="M410.558.109c0 210.974-300.876 361.752-300.876 633.548 0 174.943 134.704 316.787 300.876 316.787s300.877-141.817 300.877-316.787C711.408 361.752 410.558 210.974 410.558.109"/><path fill="#C3D2FB" d="M613.469 73.665c0 211.055-300.877 361.914-300.877 633.547C312.592 882.156 447.296 1024 613.47 1024s300.876-141.817 300.876-316.788C914.29 435.58 613.469 284.72 613.469 73.665"/><path fill="#303F5B" d="M312.592 707.212c0-183.713 137.636-312.171 226.723-441.39 81.702 106.112 172.12 218.74 172.12 367.726A309.755 309.755 0 0 1 420.36 950.064a323.1 323.1 0 0 1-107.769-242.852z"/></svg>

After

Width:  |  Height:  |  Size: 706 B

BIN
src/assets/login/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.7 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 10 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M2.88 18.054a35.9 35.9 0 0 1 8.531-16.32.8.8 0 0 1 1.178 0q.25.27.413.455a35.9 35.9 0 0 1 8.118 15.865c-2.141.451-4.34.747-6.584.874l-2.089 4.178a.5.5 0 0 1-.894 0l-2.089-4.178a44 44 0 0 1-6.584-.874m6.698-1.123 1.157.066L12 19.527l1.265-2.53 1.157-.066a42 42 0 0 0 4.227-.454A33.9 33.9 0 0 0 12 4.09a33.9 33.9 0 0 0-6.649 12.387q2.093.334 4.227.454M12 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6m0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>

After

Width:  |  Height:  |  Size: 533 B

1
src/assets/svg/dark.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.38 2.019a7.5 7.5 0 1 0 10.6 10.6C21.662 17.854 17.316 22 12.001 22 6.477 22 2 17.523 2 12c0-5.315 4.146-9.661 9.38-9.981"/></svg>

After

Width:  |  Height:  |  Size: 262 B

1
src/assets/svg/day.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12M11 1h2v3h-2zm0 19h2v3h-2zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414zm2.121-14.85 1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414zM23 11v2h-3v-2zM4 11v2H1v-2z"/></svg>

After

Width:  |  Height:  |  Size: 435 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" aria-hidden="true" class="iconify iconify--ant-design" viewBox="0 0 1024 1024"><path fill="currentColor" d="M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 0 0 0 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8"/></svg>

After

Width:  |  Height:  |  Size: 351 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" aria-hidden="true" class="re-screen" color="#00000073" viewBox="0 0 16 16"><path fill="currentColor" d="M3.5 4H1V3h2V1h1v2.5zM13 3V1h-1v2.5l.5.5H15V3zm-1 9.5V15h1v-2h2v-1h-2.5zM1 12v1h2v2h1v-2.5l-.5-.5zm11-1.5-.5.5h-7l-.5-.5v-5l.5-.5h7l.5.5zM10 7H6v2h4z"/></svg>

After

Width:  |  Height:  |  Size: 327 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" aria-hidden="true" class="re-screen" color="#00000073" viewBox="0 0 16 16"><path fill="currentColor" d="M3 12h10V4H3zm2-6h6v4H5zM2 6H1V2.5l.5-.5H5v1H2zm13-3.5V6h-1V3h-3V2h3.5zM14 10h1v3.5l-.5.5H11v-1h3zM2 13h3v1H1.5l-.5-.5V10h1z"/></svg>

After

Width:  |  Height:  |  Size: 302 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" aria-hidden="true" class="globalization" viewBox="0 0 512 512"><path fill="currentColor" d="m478.33 433.6-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 362 368 281.65 401.17 362zm-66.99-19.08a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73 39.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.36-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.93.92 1.19 1.83 2.35 2.74 3.51-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.59 22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9z"/></svg>

After

Width:  |  Height:  |  Size: 826 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" aria-hidden="true" class="iconify iconify--mdi" viewBox="0 0 24 24"><path fill="currentColor" d="M1 7h6v2H3v2h4v2H3v2h4v2H1zm10 0h4v2h-4v2h2a2 2 0 0 1 2 2v2c0 1.11-.89 2-2 2H9v-2h4v-2h-2a2 2 0 0 1-2-2V9c0-1.1.9-2 2-2m8 0h2a2 2 0 0 1 2 2v1h-2V9h-2v6h2v-1h2v1c0 1.11-.89 2-2 2h-2a2 2 0 0 1-2-2V9c0-1.1.9-2 2-2"/></svg>

After

Width:  |  Height:  |  Size: 379 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" class="icon" viewBox="0 0 1024 1024"><path d="M554 849.574c0 23.365-18.635 42.307-42 42.307s-42-18.941-42-42.307V662.719c0-23.365 18.635-42.307 42-42.307v-7.051c23.365 0 42 25.993 42 49.358z"/><path d="M893 888.5c0 17.397-14.103 31.5-31.5 31.5h-700c-17.397 0-31.5-14.103-31.5-31.5s14.103-31.5 31.5-31.5h700c17.397 0 31.5 14.103 31.5 31.5m33-714.074C926 135.484 894.686 105 855.744 105H168.256C129.314 105 98 135.484 98 174.426V533h828zM98 630.988C98 669.931 129.314 702 168.256 702h687.488C894.686 702 926 669.931 926 630.988V596H98z"/></svg>

After

Width:  |  Height:  |  Size: 605 B

View File

@ -0,0 +1 @@
<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M13.79 10.21a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42l-2.5-2.5a1 1 0 0 0-.33-.21 1 1 0 0 0-.76 0 1 1 0 0 0-.33.21l-2.5 2.5a1 1 0 0 0 1.42 1.42l.79-.8v5.18l-.79-.8a1 1 0 0 0-1.42 1.42l2.5 2.5a1 1 0 0 0 .33.21.94.94 0 0 0 .76 0 1 1 0 0 0 .33-.21l2.5-2.5a1 1 0 0 0-1.42-1.42l-.79.8V9.41ZM7 4h10a1 1 0 0 0 0-2H7a1 1 0 0 0 0 2m10 16H7a1 1 0 0 0 0 2h10a1 1 0 0 0 0-2"/></svg>

After

Width:  |  Height:  |  Size: 439 B

View File

@ -0,0 +1 @@
<svg width="32" height="32" fill="currentColor" aria-hidden="true" data-icon="holder" viewBox="64 64 896 896"><path d="M300 276.5a56 56 0 1 0 56-97 56 56 0 0 0-56 97m0 284a56 56 0 1 0 56-97 56 56 0 0 0-56 97M640 228a56 56 0 1 0 112 0 56 56 0 0 0-112 0m0 284a56 56 0 1 0 112 0 56 56 0 0 0-112 0M300 844.5a56 56 0 1 0 56-97 56 56 0 0 0-56 97M640 796a56 56 0 1 0 112 0 56 56 0 0 0-112 0"/></svg>

After

Width:  |  Height:  |  Size: 392 B

View File

@ -0,0 +1 @@
<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M22 4V2H2v2h9v14.17l-5.5-5.5-1.42 1.41L12 22l7.92-7.92-1.42-1.41-5.5 5.5V4z"/></svg>

After

Width:  |  Height:  |  Size: 161 B

View File

@ -0,0 +1 @@
<svg width="32" height="32" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/></svg>

After

Width:  |  Height:  |  Size: 235 B

View File

@ -0,0 +1 @@
<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M3.34 17a10 10 0 0 1-.978-2.326 3 3 0 0 0 .002-5.347A10 10 0 0 1 4.865 4.99a3 3 0 0 0 4.631-2.674 10 10 0 0 1 5.007.002 3 3 0 0 0 4.632 2.672A10 10 0 0 1 20.66 7c.433.749.757 1.53.978 2.326a3 3 0 0 0-.002 5.347 10 10 0 0 1-2.501 4.337 3 3 0 0 0-4.631 2.674 10 10 0 0 1-5.007-.002 3 3 0 0 0-4.632-2.672A10 10 0 0 1 3.34 17m5.66.196a5 5 0 0 1 2.25 2.77q.75.071 1.499.001A5 5 0 0 1 15 17.197a5 5 0 0 1 3.525-.565q.435-.614.748-1.298A5 5 0 0 1 18 12c0-1.26.47-2.437 1.273-3.334a8 8 0 0 0-.75-1.298A5 5 0 0 1 15 6.804a5 5 0 0 1-2.25-2.77q-.75-.071-1.499-.001A5 5 0 0 1 9 6.803a5 5 0 0 1-3.525.565 8 8 0 0 0-.748 1.298A5 5 0 0 1 6 12a5 5 0 0 1-1.273 3.334 8 8 0 0 0 .75 1.298A5 5 0 0 1 9 17.196M12 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6m0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>

After

Width:  |  Height:  |  Size: 840 B

BIN
src/assets/user.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -0,0 +1,7 @@
import { withInstall } from "@pureadmin/utils";
import reAnimateSelector from "./src/index.vue";
/** [animate.css](https://animate.style/) 选择器组件 */
export const ReAnimateSelector = withInstall(reAnimateSelector);
export default ReAnimateSelector;

View File

@ -0,0 +1,114 @@
export const animates = [
/* Attention seekers */
"bounce",
"flash",
"pulse",
"rubberBand",
"shakeX",
"headShake",
"swing",
"tada",
"wobble",
"jello",
"heartBeat",
/* Back entrances */
"backInDown",
"backInLeft",
"backInRight",
"backInUp",
/* Back exits */
"backOutDown",
"backOutLeft",
"backOutRight",
"backOutUp",
/* Bouncing entrances */
"bounceIn",
"bounceInDown",
"bounceInLeft",
"bounceInRight",
"bounceInUp",
/* Bouncing exits */
"bounceOut",
"bounceOutDown",
"bounceOutLeft",
"bounceOutRight",
"bounceOutUp",
/* Fading entrances */
"fadeIn",
"fadeInDown",
"fadeInDownBig",
"fadeInLeft",
"fadeInLeftBig",
"fadeInRight",
"fadeInRightBig",
"fadeInUp",
"fadeInUpBig",
"fadeInTopLeft",
"fadeInTopRight",
"fadeInBottomLeft",
"fadeInBottomRight",
/* Fading exits */
"fadeOut",
"fadeOutDown",
"fadeOutDownBig",
"fadeOutLeft",
"fadeOutLeftBig",
"fadeOutRight",
"fadeOutRightBig",
"fadeOutUp",
"fadeOutUpBig",
"fadeOutTopLeft",
"fadeOutTopRight",
"fadeOutBottomRight",
"fadeOutBottomLeft",
/* Flippers */
"flip",
"flipInX",
"flipInY",
"flipOutX",
"flipOutY",
/* Lightspeed */
"lightSpeedInRight",
"lightSpeedInLeft",
"lightSpeedOutRight",
"lightSpeedOutLeft",
/* Rotating entrances */
"rotateIn",
"rotateInDownLeft",
"rotateInDownRight",
"rotateInUpLeft",
"rotateInUpRight",
/* Rotating exits */
"rotateOut",
"rotateOutDownLeft",
"rotateOutDownRight",
"rotateOutUpLeft",
"rotateOutUpRight",
/* Specials */
"hinge",
"jackInTheBox",
"rollIn",
"rollOut",
/* Zooming entrances */
"zoomIn",
"zoomInDown",
"zoomInLeft",
"zoomInRight",
"zoomInUp",
/* Zooming exits */
"zoomOut",
"zoomOutDown",
"zoomOutLeft",
"zoomOutRight",
"zoomOutUp",
/* Sliding entrances */
"slideInDown",
"slideInLeft",
"slideInRight",
"slideInUp",
/* Sliding exits */
"slideOutDown",
"slideOutLeft",
"slideOutRight",
"slideOutUp"
];

View File

@ -0,0 +1,136 @@
<script setup lang="ts">
import { ref, computed } from "vue";
import { animates } from "./animate";
import { cloneDeep } from "@pureadmin/utils";
defineOptions({
name: "ReAnimateSelector"
});
defineProps({
placeholder: {
type: String,
default: "请选择动画"
}
});
const inputValue = defineModel({ type: String });
const searchVal = ref();
const animatesList = ref(animates);
const copyAnimatesList = cloneDeep(animatesList);
const animateClass = computed(() => {
return [
"mt-1",
"flex",
"border",
"w-[130px]",
"h-[100px]",
"items-center",
"cursor-pointer",
"transition-all",
"justify-center",
"border-[#e5e7eb]",
"hover:text-primary",
"hover:duration-[700ms]"
];
});
const animateStyle = computed(
() => (i: string) =>
inputValue.value === i
? {
borderColor: "var(--el-color-primary)",
color: "var(--el-color-primary)"
}
: ""
);
function onChangeIcon(animate: string) {
inputValue.value = animate;
}
function onClear() {
inputValue.value = "";
}
function filterMethod(value: any) {
searchVal.value = value;
animatesList.value = copyAnimatesList.value.filter((i: string | any[]) =>
i.includes(value)
);
}
const animateMap = ref({});
function onMouseEnter(index: string | number) {
animateMap.value[index] = animateMap.value[index]?.loading
? Object.assign({}, animateMap.value[index], {
loading: false
})
: Object.assign({}, animateMap.value[index], {
loading: true
});
}
function onMouseleave() {
animateMap.value = {};
}
</script>
<template>
<el-select
clearable
filterable
:placeholder="placeholder"
popper-class="pure-animate-popper"
:model-value="inputValue"
:filter-method="filterMethod"
@clear="onClear"
>
<template #empty>
<div class="w-[280px]">
<el-scrollbar
noresize
height="212px"
:view-style="{ overflow: 'hidden' }"
class="border-t border-[#e5e7eb]"
>
<ul class="flex flex-wrap justify-around mb-1">
<li
v-for="(animate, index) in animatesList"
:key="index"
:class="animateClass"
:style="animateStyle(animate)"
@mouseenter.prevent="onMouseEnter(index)"
@mouseleave.prevent="onMouseleave"
@click="onChangeIcon(animate)"
>
<h4
:class="[
`animate__animated animate__${
animateMap[index]?.loading
? animate + ' animate__infinite'
: ''
} `
]"
>
{{ animate }}
</h4>
</li>
</ul>
<el-empty
v-show="animatesList.length === 0"
:description="`${searchVal} 动画不存在`"
:image-size="60"
/>
</el-scrollbar>
</div>
</template>
</el-select>
</template>
<style>
.pure-animate-popper {
min-width: 0 !important;
}
</style>

View File

@ -0,0 +1,5 @@
import auth from "./src/auth";
const Auth = auth;
export { Auth };

View File

@ -0,0 +1,20 @@
import { defineComponent, Fragment } from "vue";
import { hasAuth } from "@/router/utils";
export default defineComponent({
name: "Auth",
props: {
value: {
type: undefined,
default: []
}
},
setup(props, { slots }) {
return () => {
if (!slots) return null;
return hasAuth(props.value) ? (
<Fragment>{slots.default?.()}</Fragment>
) : null;
};
}
});

View File

@ -0,0 +1,29 @@
import { ElCol } from "element-plus";
import { h, defineComponent } from "vue";
// 封装element-plus的el-col组件
export default defineComponent({
name: "ReCol",
props: {
value: {
type: Number,
default: 24
}
},
render() {
const attrs = this.$attrs;
const val = this.value;
return h(
ElCol,
{
xs: val,
sm: val,
md: val,
lg: val,
xl: val,
...attrs
},
{ default: () => this.$slots.default() }
);
}
});

View File

@ -0,0 +1,7 @@
import reCropper from "./src";
import { withInstall } from "@pureadmin/utils";
/** 图片裁剪组件 */
export const ReCropper = withInstall(reCropper);
export default ReCropper;

View File

@ -0,0 +1,8 @@
@import "cropperjs/dist/cropper.css";
.re-circled {
.cropper-view-box,
.cropper-face {
border-radius: 50%;
}
}

View File

@ -0,0 +1,457 @@
import "./circled.css";
import Cropper from "cropperjs";
import { ElUpload } from "element-plus";
import type { CSSProperties } from "vue";
import { useEventListener } from "@vueuse/core";
import { longpress } from "@/directives/longpress";
import { useTippy, directive as tippy } from "vue-tippy";
import {
type PropType,
ref,
unref,
computed,
onMounted,
onUnmounted,
defineComponent
} from "vue";
import {
delay,
debounce,
isArray,
downloadByBase64,
useResizeObserver
} from "@pureadmin/utils";
import {
Reload,
Upload,
ArrowH,
ArrowV,
ArrowUp,
ArrowDown,
ArrowLeft,
ChangeIcon,
ArrowRight,
RotateLeft,
SearchPlus,
RotateRight,
SearchMinus,
DownloadIcon
} from "./svg";
type Options = Cropper.Options;
const defaultOptions: Options = {
aspectRatio: 1,
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 },
circled: { type: Boolean, default: false },
/** 是否可以通过点击裁剪区域关闭右键弹出的功能菜单,默认 `true` */
isClose: { type: Boolean, default: true },
realTimePreview: { type: Boolean, default: true },
height: { type: [String, Number], default: "360px" },
crossorigin: {
type: String as PropType<"" | "anonymous" | "use-credentials" | undefined>,
default: undefined
},
imageStyle: { type: Object as PropType<CSSProperties>, default: () => ({}) },
options: { type: Object as PropType<Options>, default: () => ({}) }
};
export default defineComponent({
name: "ReCropper",
props,
setup(props, { attrs, emit }) {
const tippyElRef = ref<ElRef<HTMLImageElement>>();
const imgElRef = ref<ElRef<HTMLImageElement>>();
const cropper = ref<Nullable<Cropper>>();
const inCircled = ref(props.circled);
const isInClose = ref(props.isClose);
const inSrc = ref(props.src);
const isReady = ref(false);
const imgBase64 = ref();
let scaleX = 1;
let scaleY = 1;
const debounceRealTimeCroppered = debounce(realTimeCroppered, 80);
const getImageStyle = computed((): CSSProperties => {
return {
height: props.height,
maxWidth: "100%",
...props.imageStyle
};
});
const getClass = computed(() => {
return [
attrs.class,
{
["re-circled"]: inCircled.value
}
];
});
const iconClass = computed(() => {
return [
"p-[6px]",
"h-[30px]",
"w-[30px]",
"outline-none",
"rounded-[4px]",
"cursor-pointer",
"hover:bg-[rgba(0,0,0,0.06)]"
];
});
const getWrapperStyle = computed((): CSSProperties => {
return { height: `${props.height}`.replace(/px/, "") + "px" };
});
onMounted(init);
onUnmounted(() => {
cropper.value?.destroy();
isReady.value = false;
cropper.value = null;
imgBase64.value = "";
scaleX = 1;
scaleY = 1;
});
useResizeObserver(tippyElRef, () => handCropper("reset"));
async function init() {
const imgEl = unref(imgElRef);
if (!imgEl) return;
cropper.value = new Cropper(imgEl, {
...defaultOptions,
ready: () => {
isReady.value = true;
realTimeCroppered();
delay(400).then(() => emit("readied", cropper.value));
},
crop() {
debounceRealTimeCroppered();
},
zoom() {
debounceRealTimeCroppered();
},
cropmove() {
debounceRealTimeCroppered();
},
...props.options
});
}
function realTimeCroppered() {
props.realTimePreview && croppered();
}
function croppered() {
if (!cropper.value) return;
const canvas = inCircled.value
? getRoundedCanvas()
: cropper.value.getCroppedCanvas();
// https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLCanvasElement/toBlob
canvas.toBlob(blob => {
if (!blob) return;
const fileReader: FileReader = new FileReader();
fileReader.readAsDataURL(blob);
fileReader.onloadend = e => {
if (!e.target?.result || !blob) return;
imgBase64.value = e.target.result;
emit("cropper", {
base64: e.target.result,
blob,
info: { size: blob.size, ...cropper.value.getData() }
});
};
fileReader.onerror = () => {
emit("error");
};
});
}
function getRoundedCanvas() {
const sourceCanvas = cropper.value!.getCroppedCanvas();
const canvas = document.createElement("canvas");
const context = canvas.getContext("2d")!;
const width = sourceCanvas.width;
const height = sourceCanvas.height;
canvas.width = width;
canvas.height = height;
context.imageSmoothingEnabled = true;
context.drawImage(sourceCanvas, 0, 0, width, height);
context.globalCompositeOperation = "destination-in";
context.beginPath();
context.arc(
width / 2,
height / 2,
Math.min(width, height) / 2,
0,
2 * Math.PI,
true
);
context.fill();
return canvas;
}
function handCropper(event: string, arg?: number | Array<number>) {
if (event === "scaleX") {
scaleX = arg = scaleX === -1 ? 1 : -1;
}
if (event === "scaleY") {
scaleY = arg = scaleY === -1 ? 1 : -1;
}
arg && isArray(arg)
? cropper.value?.[event]?.(...arg)
: cropper.value?.[event]?.(arg);
}
function beforeUpload(file) {
const reader = new FileReader();
reader.readAsDataURL(file);
inSrc.value = "";
reader.onload = e => {
inSrc.value = e.target?.result as string;
};
reader.onloadend = () => {
init();
};
return false;
}
const menuContent = defineComponent({
directives: {
tippy,
longpress
},
setup() {
return () => (
<div class="flex flex-wrap w-[60px] justify-between">
<ElUpload
accept="image/*"
show-file-list={false}
before-upload={beforeUpload}
>
<Upload
class={iconClass.value}
v-tippy={{
content: "上传",
placement: "left-start"
}}
/>
</ElUpload>
<DownloadIcon
class={iconClass.value}
v-tippy={{
content: "下载",
placement: "right-start"
}}
onClick={() => downloadByBase64(imgBase64.value, "cropping.png")}
/>
<ChangeIcon
class={iconClass.value}
v-tippy={{
content: "圆形、矩形裁剪",
placement: "left-start"
}}
onClick={() => {
inCircled.value = !inCircled.value;
realTimeCroppered();
}}
/>
<Reload
class={iconClass.value}
v-tippy={{
content: "重置",
placement: "right-start"
}}
onClick={() => handCropper("reset")}
/>
<ArrowUp
class={iconClass.value}
v-tippy={{
content: "上移(可长按)",
placement: "left-start"
}}
v-longpress={[() => handCropper("move", [0, -10]), "0:100"]}
/>
<ArrowDown
class={iconClass.value}
v-tippy={{
content: "下移(可长按)",
placement: "right-start"
}}
v-longpress={[() => handCropper("move", [0, 10]), "0:100"]}
/>
<ArrowLeft
class={iconClass.value}
v-tippy={{
content: "左移(可长按)",
placement: "left-start"
}}
v-longpress={[() => handCropper("move", [-10, 0]), "0:100"]}
/>
<ArrowRight
class={iconClass.value}
v-tippy={{
content: "右移(可长按)",
placement: "right-start"
}}
v-longpress={[() => handCropper("move", [10, 0]), "0:100"]}
/>
<ArrowH
class={iconClass.value}
v-tippy={{
content: "水平翻转",
placement: "left-start"
}}
onClick={() => handCropper("scaleX", -1)}
/>
<ArrowV
class={iconClass.value}
v-tippy={{
content: "垂直翻转",
placement: "right-start"
}}
onClick={() => handCropper("scaleY", -1)}
/>
<RotateLeft
class={iconClass.value}
v-tippy={{
content: "逆时针旋转",
placement: "left-start"
}}
onClick={() => handCropper("rotate", -45)}
/>
<RotateRight
class={iconClass.value}
v-tippy={{
content: "顺时针旋转",
placement: "right-start"
}}
onClick={() => handCropper("rotate", 45)}
/>
<SearchPlus
class={iconClass.value}
v-tippy={{
content: "放大(可长按)",
placement: "left-start"
}}
v-longpress={[() => handCropper("zoom", 0.1), "0:100"]}
/>
<SearchMinus
class={iconClass.value}
v-tippy={{
content: "缩小(可长按)",
placement: "right-start"
}}
v-longpress={[() => handCropper("zoom", -0.1), "0:100"]}
/>
</div>
);
}
});
function onContextmenu(event) {
event.preventDefault();
const { show, setProps, destroy, state } = useTippy(tippyElRef, {
content: menuContent,
arrow: false,
theme: "light",
trigger: "manual",
interactive: true,
appendTo: "parent",
// hideOnClick: false,
placement: "bottom-end"
});
setProps({
getReferenceClientRect: () => ({
width: 0,
height: 0,
top: event.clientY,
bottom: event.clientY,
left: event.clientX,
right: event.clientX
})
});
show();
if (isInClose.value) {
if (!state.value.isShown && !state.value.isVisible) return;
useEventListener(tippyElRef, "click", destroy);
}
}
return {
inSrc,
props,
imgElRef,
tippyElRef,
getClass,
getWrapperStyle,
getImageStyle,
isReady,
croppered,
onContextmenu
};
},
render() {
const {
inSrc,
isReady,
getClass,
getImageStyle,
onContextmenu,
getWrapperStyle
} = this;
const { alt, crossorigin } = this.props;
return inSrc ? (
<div
ref="tippyElRef"
class={getClass}
style={getWrapperStyle}
onContextmenu={event => onContextmenu(event)}
>
<img
v-show={isReady}
ref="imgElRef"
style={getImageStyle}
src={inSrc}
alt={alt}
crossorigin={crossorigin}
/>
</div>
) : null;
}
});

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 1024 1024"><path fill="currentColor" d="M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0 0 48.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2"/></svg>

After

Width:  |  Height:  |  Size: 346 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" class="icon" viewBox="0 0 1024 1024"><path d="m296.992 216.992-272 272L3.008 512l21.984 23.008 272 272 46.016-46.016L126.016 544h772L680.992 760.992l46.016 46.016 272-272L1020.992 512l-21.984-23.008-272-272-46.048 46.048L898.016 480h-772l216.96-216.992z"/></svg>

After

Width:  |  Height:  |  Size: 325 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 1024 1024"><path fill="currentColor" d="M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 0 0 0 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8"/></svg>

After

Width:  |  Height:  |  Size: 343 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 1024 1024"><path fill="currentColor" d="M869 487.8 491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 0 0 0-48.4"/></svg>

After

Width:  |  Height:  |  Size: 350 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 1024 1024"><path fill="currentColor" d="M868 545.5 536.1 163a31.96 31.96 0 0 0-48.3 0L156 545.5a7.97 7.97 0 0 0 6 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2"/></svg>

After

Width:  |  Height:  |  Size: 338 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" class="icon" viewBox="0 0 1024 1024"><path d="m512 67.008-23.008 21.984-256 256 46.048 46.048L480 190.016v644L279.008 632.96l-46.048 46.08 256 256 23.008 21.984 23.008-21.984 256-256-46.016-46.016L544 834.016v-644l200.992 200.96 46.016-45.984-256-256z"/></svg>

After

Width:  |  Height:  |  Size: 323 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" class="icon" viewBox="0 0 1024 1024"><path d="M956.8 988.8H585.6c-16 0-25.6-9.6-25.6-28.8V576c0-16 9.6-28.8 25.6-28.8h371.2c16 0 25.6 9.6 25.6 28.8v384c0 16-9.6 28.8-25.6 28.8M608 937.6h326.4V598.4H608zm-121.6 44.8C262.4 982.4 144 848 144 595.2c0-19.2 9.6-28.8 25.6-28.8s25.6 12.8 25.6 28.8c0 220.8 96 326.4 288 326.4 16 0 25.6 12.8 25.6 28.8s-6.4 32-22.4 32"/><path d="M262.4 694.4c-6.4 0-9.6-3.2-16-6.4L160 601.6c-9.6-9.6-9.6-22.4 0-28.8s22.4-9.6 28.8 0l86.4 86.4c9.6 9.6 9.6 22.4 0 28.8-3.2 3.2-6.4 6.4-12.8 6.4"/><path d="M86.4 694.4c-6.4 0-9.6-3.2-16-6.4-9.6-9.6-9.6-22.4 0-28.8l86.4-86.4c9.6-9.6 22.4-9.6 28.8 0 9.6 9.6 9.6 22.4 0 28.8L99.2 688c-3.2 3.2-6.4 6.4-12.8 6.4m790.4-249.6c-16 0-28.8-12.8-28.8-32 0-224-99.2-336-300.8-336-16 0-28.8-12.8-28.8-32s9.6-32 28.8-32c233.6 0 355.2 137.6 355.2 396.8 0 22.4-9.6 35.2-25.6 35.2"/><path d="M876.8 448c-6.4 0-9.6-3.2-16-6.4l-86.4-86.4c-9.6-9.6-9.6-22.4 0-28.8s22.4-9.6 28.8 0l86.4 86.4c9.6 9.6 9.6 22.4 0 28.8 0 3.2-6.4 6.4-12.8 6.4"/><path d="M876.8 448c-6.4 0-9.6-3.2-16-6.4-9.6-9.6-9.6-22.4 0-28.8l86.4-86.4c9.6-9.6 22.4-9.6 28.8 0s9.6 22.4 0 28.8l-86.4 86.4c-3.2 3.2-6.4 6.4-12.8 6.4M288 524.8C156.8 524.8 48 416 48 278.4S156.8 35.2 288 35.2 528 144 528 281.6 419.2 524.8 288 524.8m-3.2-432c-99.2 0-179.2 83.2-179.2 185.6S185.6 464 284.8 464 464 380.8 464 278.4 384 92.8 284.8 92.8"/></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 1024 1024"><path fill="currentColor" d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8"/></svg>

After

Width:  |  Height:  |  Size: 417 B

View File

@ -0,0 +1,31 @@
import Reload from "./reload.svg?component";
import Upload from "./upload.svg?component";
import ArrowH from "./arrow-h.svg?component";
import ArrowV from "./arrow-v.svg?component";
import ArrowUp from "./arrow-up.svg?component";
import ChangeIcon from "./change.svg?component";
import ArrowDown from "./arrow-down.svg?component";
import ArrowLeft from "./arrow-left.svg?component";
import DownloadIcon from "./download.svg?component";
import ArrowRight from "./arrow-right.svg?component";
import RotateLeft from "./rotate-left.svg?component";
import SearchPlus from "./search-plus.svg?component";
import RotateRight from "./rotate-right.svg?component";
import SearchMinus from "./search-minus.svg?component";
export {
Reload,
Upload,
ArrowH,
ArrowV,
ArrowUp,
ArrowDown,
ArrowLeft,
ChangeIcon,
ArrowRight,
RotateLeft,
SearchPlus,
RotateRight,
SearchMinus,
DownloadIcon
};

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 1024 1024"><path fill="currentColor" d="M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 0 1 755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 0 0 3 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8m756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 0 1 512.1 856a342.24 342.24 0 0 1-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 0 0-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 0 0-8-8.2"/></svg>

After

Width:  |  Height:  |  Size: 863 B

Some files were not shown because too many files have changed in this diff Show More