mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c8f855d86 | ||
|
|
2ebb584ec8 | ||
|
|
791224b381 | ||
|
|
9e0518319b | ||
|
|
2dac3f193b | ||
|
|
696a347b61 | ||
|
|
206df3828e | ||
|
|
2367eedc5d | ||
|
|
f0a80c680e | ||
|
|
bf128f183f | ||
|
|
17d36f6b9a | ||
|
|
e46d3e57fe | ||
|
|
dbfd014209 | ||
|
|
d0d77bef21 | ||
|
|
26a940c030 | ||
|
|
c0005b4bc9 | ||
|
|
6270ec712f | ||
|
|
e1432d7af8 | ||
|
|
9400fe3eaf | ||
|
|
359ccdd85b | ||
|
|
0be8c963ba | ||
|
|
be5798987f | ||
|
|
e6302b0f38 | ||
|
|
0b9fcaca4a | ||
|
|
5e5169817c | ||
|
|
d1f0a3fd36 | ||
|
|
593fc1bb26 | ||
|
|
0a67d1ab76 | ||
|
|
adae01fdc2 | ||
|
|
ac0d75cbdf | ||
|
|
6288e81130 | ||
|
|
7a59999dc7 | ||
|
|
5c4fd951bc | ||
|
|
45a359017e | ||
|
|
0f0fbdac51 | ||
|
|
d83f28dbd3 | ||
|
|
ccf3a6f917 | ||
|
|
91bebdae94 | ||
|
|
131d1e8ada | ||
|
|
c4d5e3bfcd | ||
|
|
c219f315b2 | ||
|
|
16122aec17 | ||
|
|
b5645b19e1 | ||
|
|
19ccd378f5 | ||
|
|
2b71e8bd54 | ||
|
|
51809546ed | ||
|
|
760eac1c4d | ||
|
|
7009a16180 |
@@ -7,10 +7,14 @@
|
||||
"prettier --cache --write--parser json"
|
||||
],
|
||||
"package.json": ["prettier --cache --write"],
|
||||
"*.vue": ["prettier --write", "eslint --cache --fix", "stylelint --fix"],
|
||||
"*.vue": [
|
||||
"prettier --write",
|
||||
"eslint --cache --fix",
|
||||
"stylelint --fix --allow-empty-input"
|
||||
],
|
||||
"*.{css,scss,html}": [
|
||||
"prettier --cache --ignore-unknown --write",
|
||||
"stylelint --fix"
|
||||
"stylelint --fix --allow-empty-input"
|
||||
],
|
||||
"*.md": ["prettier --cache --ignore-unknown --write"]
|
||||
}
|
||||
|
||||
@@ -1,8 +1,64 @@
|
||||
# 5.2.0 (2024-03-22)
|
||||
|
||||
### ✔️ refactor
|
||||
|
||||
- Place the full screen button at the top to make it visible and easy to operate
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- Added `v-ripple` command (water ripple effect)
|
||||
- Add global `Stretch` configuration to the content area to customize compact pages and easily find the required information
|
||||
- Added roaming guidance based on `ElTour`
|
||||
- Improve role management-menu permission function, novel interactive experience
|
||||
- Add system monitoring-online users
|
||||
- Add system monitoring-login log
|
||||
- Add system monitoring-operation log
|
||||
- Add system monitoring-system log
|
||||
- Add more more convenient `pure-admin-table` editable table examples (overall editing, single row editing, cell editing)
|
||||
- The `ReSegmented` component has a new `block` attribute to make it fit the width of the parent element
|
||||
- Add [vue-flow](https://vueflow.dev/) flow chart example
|
||||
- Add virtual table example
|
||||
- Added Gantt chart example
|
||||
- Add graphic verification code example
|
||||
- Add form examples, which can be generated through `JSON` format configuration (basic form, pop-up form, drawer form, step-by-step form, search form)
|
||||
- Add a folding and expanding menu function on the middle right side of the left menu
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- Fixed the scroll bar issue when clicking on the registration page under `windwos`
|
||||
- Fixed the problem of scroll bars appearing in the content area when switching pages under `windows`
|
||||
- Fixed the problem of status style disappearing in `pure-table` with status table under dark overall style
|
||||
- Fixed the problem of turning on the gray mode and dark overall style in the project configuration and refreshing the overall style of the page.
|
||||
|
||||
### 🍏 Perf
|
||||
|
||||
- All pages of system management and system monitoring are compatible with mobile terminals
|
||||
|
||||
# 5.1.0 (2024-03-02)
|
||||
|
||||
### ✔️ refactor
|
||||
|
||||
- Reconstruct the tab page `UI` to make it more convenient to click the close button
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- Added multi-select card example
|
||||
- The menu supports all browser behaviors of right-clicking on the `a` tag (opening links in new tabs, new windows, dragging and dropping to open in new tabs, etc.)
|
||||
- Added search history and collection functions to menu search
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- Fixed the problem of scroll bars appearing on the login page under `windows` system
|
||||
|
||||
### 🍏 Perf
|
||||
|
||||
- Standardize the naming rules when registering local icons to better match the icon selector
|
||||
|
||||
# 5.0.0 (2024-02-26)
|
||||
|
||||
Totally `ESM` version
|
||||
|
||||
### ✔️refactor
|
||||
### ✔️ refactor
|
||||
|
||||
- Upgrade `vite` to `v5` version, specify `node` version `>18.18.0`, `pnpm` version `>=8.6.10`
|
||||
- Use [vite-plugin-fake-server](https://www.npmjs.com/package/vite-plugin-fake-server) to replace [vite-plugin-mock](https://www.npmjs.com/package/vite-plugin-mock), use [@faker-js/faker](https://www.npmjs.com/package/@faker-js/faker) to replace [mockjs](https://www.npmjs.com/package/mockjs)
|
||||
@@ -18,7 +74,7 @@ Totally `ESM` version
|
||||
- Cleaner and neater pop-up panel on the right side of project configuration
|
||||
- Restructure the About page to make it more compact and key information more prominent
|
||||
|
||||
### 🎫Feat
|
||||
### 🎫 Feat
|
||||
|
||||
- Add system management-menu management
|
||||
- Improve system management-user management
|
||||
@@ -59,7 +115,7 @@ Totally `ESM` version
|
||||
- Fixed the problem that the right-click tab page panel cannot be closed when clicking on the `iframe` page and the right-click tab page panel is blocked when on the `iframe` page
|
||||
- Fixed the problem of missing parameters when clicking on breadcrumbs to jump to the page in routing `query` and `params` modes
|
||||
|
||||
### 🍏Perf
|
||||
### 🍏 Perf
|
||||
|
||||
- Optimize theme color
|
||||
- Tabs can be slid left or right according to the sliding force
|
||||
|
||||
62
CHANGELOG.md
62
CHANGELOG.md
@@ -1,8 +1,64 @@
|
||||
# 5.2.0 (2024-03-22)
|
||||
|
||||
### ✔️ refactor
|
||||
|
||||
- Place the full screen button at the top to make it visible and easy to operate
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- Added `v-ripple` command (water ripple effect)
|
||||
- Add global `Stretch` configuration to the content area to customize compact pages and easily find the required information
|
||||
- Added roaming guidance based on `ElTour`
|
||||
- Improve role management-menu permission function, novel interactive experience
|
||||
- Add system monitoring-online users
|
||||
- Add system monitoring-login log
|
||||
- Add system monitoring-operation log
|
||||
- Add system monitoring-system log
|
||||
- Add more more convenient `pure-admin-table` editable table examples (overall editing, single row editing, cell editing)
|
||||
- The `ReSegmented` component has a new `block` attribute to make it fit the width of the parent element
|
||||
- Add [vue-flow](https://vueflow.dev/) flow chart example
|
||||
- Add virtual table example
|
||||
- Added Gantt chart example
|
||||
- Add graphic verification code example
|
||||
- Add form examples, which can be generated through `JSON` format configuration (basic form, pop-up form, drawer form, step-by-step form, search form)
|
||||
- Add a folding and expanding menu function on the middle right side of the left menu
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- Fixed the scroll bar issue when clicking on the registration page under `windwos`
|
||||
- Fixed the problem of scroll bars appearing in the content area when switching pages under `windows`
|
||||
- Fixed the problem of status style disappearing in `pure-table` with status table under dark overall style
|
||||
- Fixed the problem of turning on the gray mode and dark overall style in the project configuration and refreshing the overall style of the page.
|
||||
|
||||
### 🍏 Perf
|
||||
|
||||
- All pages of system management and system monitoring are compatible with mobile terminals
|
||||
|
||||
# 5.1.0 (2024-03-02)
|
||||
|
||||
### ✔️ refactor
|
||||
|
||||
- Reconstruct the tab page `UI` to make it more convenient to click the close button
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- Added multi-select card example
|
||||
- The menu supports all browser behaviors of right-clicking on the `a` tag (opening links in new tabs, new windows, dragging and dropping to open in new tabs, etc.)
|
||||
- Added search history and collection functions to menu search
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- Fixed the problem of scroll bars appearing on the login page under `windows` system
|
||||
|
||||
### 🍏 Perf
|
||||
|
||||
- Standardize the naming rules when registering local icons to better match the icon selector
|
||||
|
||||
# 5.0.0 (2024-02-26)
|
||||
|
||||
Totally `ESM` version
|
||||
|
||||
### ✔️refactor
|
||||
### ✔️ refactor
|
||||
|
||||
- Upgrade `vite` to `v5` version, specify `node` version `>18.18.0`, `pnpm` version `>=8.6.10`
|
||||
- Use [vite-plugin-fake-server](https://www.npmjs.com/package/vite-plugin-fake-server) to replace [vite-plugin-mock](https://www.npmjs.com/package/vite-plugin-mock), use [@faker-js/faker](https://www.npmjs.com/package/@faker-js/faker) to replace [mockjs](https://www.npmjs.com/package/mockjs)
|
||||
@@ -18,7 +74,7 @@ Totally `ESM` version
|
||||
- Cleaner and neater pop-up panel on the right side of project configuration
|
||||
- Restructure the About page to make it more compact and key information more prominent
|
||||
|
||||
### 🎫Feat
|
||||
### 🎫 Feat
|
||||
|
||||
- Add system management-menu management
|
||||
- Improve system management-user management
|
||||
@@ -59,7 +115,7 @@ Totally `ESM` version
|
||||
- Fixed the problem that the right-click tab page panel cannot be closed when clicking on the `iframe` page and the right-click tab page panel is blocked when on the `iframe` page
|
||||
- Fixed the problem of missing parameters when clicking on breadcrumbs to jump to the page in routing `query` and `params` modes
|
||||
|
||||
### 🍏Perf
|
||||
### 🍏 Perf
|
||||
|
||||
- Optimize theme color
|
||||
- Tabs can be slid left or right according to the sliding force
|
||||
|
||||
@@ -1,3 +1,59 @@
|
||||
# 5.2.0 (2024-03-22)
|
||||
|
||||
### ✔️ refactor
|
||||
|
||||
- 将全屏按钮置于顶部,使其显眼且易于操作
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- 新增`v-ripple`指令(水波纹效果)
|
||||
- 内容区添加全局`Stretch`配置,可自定义紧凑页面,轻松找到所需信息
|
||||
- 添加基于`ElTour`实现的漫游式引导
|
||||
- 完善角色管理-菜单权限功能,新颖的交互体验
|
||||
- 添加系统监控-在线用户
|
||||
- 添加系统监控-登录日志
|
||||
- 添加系统监控-操作日志
|
||||
- 添加系统监控-系统日志
|
||||
- 添加更多更方便的`pure-admin-table`可编辑表格示例(整体编辑、单行编辑、单元格编辑)
|
||||
- `ReSegmented`组件新增`block`属性,可使其适合父元素宽度
|
||||
- 添加 [vue-flow](https://vueflow.dev/) 流程图示例
|
||||
- 添加虚拟表格示例
|
||||
- 添加甘特图示例
|
||||
- 添加图形验证码示例
|
||||
- 添加表单示例,可通过`JSON`格式配置生成(基础表单、弹框表单、抽屉表单、分步表单、搜索表单)
|
||||
- 在左侧菜单右中侧再加一个折叠展开菜单的功能
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- 修复`windwos`下点击注册页面会出现滚动条问题
|
||||
- 修复`windows`下页面切换,内容区会出现滚动条问题
|
||||
- 修复`pure-table`带状态表格在深色整体风格下状态样式消失的问题
|
||||
- 修复项目配置中开启灰色模式和深色整体风格,刷新页面整体风格异常
|
||||
|
||||
### 🍏 Perf
|
||||
|
||||
- 系统管理、系统监控的所有页面兼容移动端
|
||||
|
||||
# 5.1.0 (2024-03-02)
|
||||
|
||||
### ✔️ refactor
|
||||
|
||||
- 重构标签页`UI`,点击关闭按钮更方便
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- 添加多选卡片示例
|
||||
- 菜单支持`a`标签右键的所有浏览器行为(在新标签页中、新窗口中打开链接,拖拽到新标签页打开等)
|
||||
- 菜单搜索新增搜索历史和收藏功能
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- 修复`windows`系统下登录页出现滚动条的问题
|
||||
|
||||
### 🍏 Perf
|
||||
|
||||
- 规范注册本地图标时的命名规则,使其更好地配合图标选择器
|
||||
|
||||
# 5.0.0 (2024-02-26)
|
||||
|
||||
全面`ESM`版本
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
|
||||
`vue-pure-admin` is an open source, free and out-of-the-box middle and backend management system template. Completely adopts `ECMAScript` module (`ESM`) specifications to write and organize code, using the latest `Vue3`, `Vite`, `Element-Plus`, `TypeScript`, `Pinia`, `Tailwindcss` and other mainstream technologies develop
|
||||
|
||||
## Sponsors
|
||||
|
||||
<a class="logo" href="https://ai-tools.cn/resume/start" target="_blank" rel="sponsored noopener">
|
||||
<img src="./public/sponsors/aitools.svg" alt="aitools">
|
||||
</a>
|
||||
|
||||
## Thin version (offering non-internationalized and internationalized versions)
|
||||
|
||||
The simplified version is based on the shelf extracted from [vue-pure-admin](https://github.com/pure-admin/vue-pure-admin), which contains main functions and is more suitable for actual project development. The packaged size is introduced globally [element-plus](https://element-plus.org) is still below `2.3MB`, and the full version of the code will be permanently synchronized. After enabling `brotli` compression and `cdn` to replace the local library mode, the package size is less than `350kb`
|
||||
@@ -27,6 +33,10 @@ The simplified version is based on the shelf extracted from [vue-pure-admin](htt
|
||||
[View vue-pure-admin documentation](https://yiming_chang.gitee.io/pure-admin-doc)
|
||||
[View @pureadmin/utils documentation](https://pure-admin-utils.netlify.app)
|
||||
|
||||
## Quality service, software outsourcing, sponsorship support
|
||||
|
||||
[Click me for details](https://yiming_chang.gitee.io/pure-admin-doc/pages/service/)
|
||||
|
||||
## Tauri
|
||||
|
||||
[Click Watch Tauri](https://github.com/pure-admin/tauri-pure-admin)
|
||||
@@ -160,6 +170,19 @@ You are very welcome to join | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=hb0730) |
|
||||
| [o-cc](https://github.com/o-cc) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=o-cc) |
|
||||
| [yj-liuzepeng](https://github.com/yj-liuzepeng) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=yj-liuzepeng) |
|
||||
| [skyline523](https://github.com/skyline523) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=skyline523) |
|
||||
| [shark-lajiao](https://github.com/shark-lajiao) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=shark-lajiao) |
|
||||
| [WitMiao](https://github.com/WitMiao) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=WitMiao) |
|
||||
|
||||
## Git Contribution submission specification
|
||||
|
||||
reference [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) specification ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular))
|
||||
|
||||
32
README.md
32
README.md
@@ -8,7 +8,14 @@
|
||||
|
||||
## 简介
|
||||
|
||||
`vue-pure-admin` 是一款开源免费且开箱即用的中后台管理系统模版。完全采用 `ECMAScript` 模块(`ESM`)规范来编写和组织代码,使用了最新的 `Vue3`、`Vite`、`Element-Plus`、`TypeScript`、`Pinia`、`Tailwindcss` 等主流技术开发
|
||||
`vue-pure-admin` 是一款开源免费且开箱即用的中后台管理系统模版。完全采用 `ECMAScript` 模块(`ESM`)规范来编写和组织代码,使用了最新的 `Vue3`、
|
||||
`Vite`、`Element-Plus`、`TypeScript`、`Pinia`、`Tailwindcss` 等主流技术开发
|
||||
|
||||
## 赞助商
|
||||
|
||||
<a class="logo" href="https://ai-tools.cn/resume/start" target="_blank" rel="sponsored noopener">
|
||||
<img src="./public/sponsors/aitools.svg" alt="aitools">
|
||||
</a>
|
||||
|
||||
## 精简版本(实际项目开发请用精简版本,提供 `非国际化` 、`国际化` 两个版本选择)
|
||||
|
||||
@@ -24,8 +31,12 @@
|
||||
|
||||
## 配套保姆级文档
|
||||
|
||||
[查看 vue-pure-admin 文档](https://yiming_chang.gitee.io/pure-admin-doc)
|
||||
[查看 @pureadmin/utils 文档](https://pure-admin-utils.netlify.app)
|
||||
[点我查看 vue-pure-admin 文档](https://yiming_chang.gitee.io/pure-admin-doc)
|
||||
[点我查看 @pureadmin/utils 文档](https://pure-admin-utils.netlify.app)
|
||||
|
||||
## 优质服务、软件外包、赞助支持
|
||||
|
||||
[点我查看详情](https://yiming_chang.gitee.io/pure-admin-doc/pages/service/)
|
||||
|
||||
## `Tauri` 版本
|
||||
|
||||
@@ -37,7 +48,7 @@
|
||||
|
||||
## 预览
|
||||
|
||||
[查看预览](https://yiming_chang.gitee.io/vue-pure-admin)
|
||||
[点我查看预览](https://yiming_chang.gitee.io/vue-pure-admin)
|
||||
|
||||
`PC` 端
|
||||
|
||||
@@ -160,6 +171,19 @@ docker run -dp 8080:80 --name pure-admin vue-pure-admin
|
||||
4. 推送您的分支: `git push origin feat/xxxx`
|
||||
5. 提交`pull request`
|
||||
|
||||
## 特别代码贡献
|
||||
|
||||
非常感谢你们能深入了解源码并对 `pure-admin` 组织作出优秀贡献 ❤️
|
||||
|
||||
| **贡献人** | **具体代码** |
|
||||
| :---------------------------------------------: | :------------------------------------------------------------------------------: |
|
||||
| [hb0730](https://github.com/hb0730) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=hb0730) |
|
||||
| [o-cc](https://github.com/o-cc) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=o-cc) |
|
||||
| [yj-liuzepeng](https://github.com/yj-liuzepeng) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=yj-liuzepeng) |
|
||||
| [skyline523](https://github.com/skyline523) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=skyline523) |
|
||||
| [shark-lajiao](https://github.com/shark-lajiao) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=shark-lajiao) |
|
||||
| [WitMiao](https://github.com/WitMiao) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=WitMiao) |
|
||||
|
||||
## `Git` 贡献提交规范
|
||||
|
||||
参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 规范 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular))
|
||||
|
||||
@@ -7,7 +7,7 @@ import boxen, { type Options as BoxenOptions } from "boxen";
|
||||
dayjs.extend(duration);
|
||||
|
||||
const welcomeMessage = gradientString("cyan", "magenta").multiline(
|
||||
`Hello! 欢迎使用 vue-pure-admin\n我们为您精心准备了下面两个贴心的保姆级文档\nhttps://yiming_chang.gitee.io/pure-admin-doc\nhttps://pure-admin-utils.netlify.app`
|
||||
`您好! 欢迎使用 pure-admin 开源项目\n我们为您精心准备了下面两个贴心的保姆级文档\nhttps://yiming_chang.gitee.io/pure-admin-doc\nhttps://pure-admin-utils.netlify.app`
|
||||
);
|
||||
|
||||
const boxenOptions: BoxenOptions = {
|
||||
|
||||
@@ -16,6 +16,7 @@ const include = [
|
||||
"qrcode",
|
||||
"intro.js",
|
||||
"vue-i18n",
|
||||
"vxe-table",
|
||||
"vue-types",
|
||||
"js-cookie",
|
||||
"vue-tippy",
|
||||
@@ -37,12 +38,14 @@ const include = [
|
||||
"@pureadmin/utils",
|
||||
"@wangeditor/editor",
|
||||
"responsive-storage",
|
||||
"plus-pro-components",
|
||||
"@howdyjs/mouse-menu",
|
||||
"@logicflow/extension",
|
||||
"vue-virtual-scroller",
|
||||
"@amap/amap-jsapi-loader",
|
||||
"el-table-infinite-scroll",
|
||||
"vue-waterfall-plugin-next",
|
||||
"@infectoone/vue-ganttastic",
|
||||
"@wangeditor/editor-for-vue",
|
||||
"vuedraggable/src/vuedraggable"
|
||||
];
|
||||
|
||||
@@ -26,11 +26,17 @@ menus:
|
||||
hshome: Home
|
||||
hslogin: Login
|
||||
hsempty: Empty Page
|
||||
hstable: Table
|
||||
hssysManagement: System Manage
|
||||
hsUser: User Manage
|
||||
hsRole: Role Manage
|
||||
hsSystemMenu: Menu Manage
|
||||
hsDept: Dept Manage
|
||||
hssysMonitor: System Monitor
|
||||
hsOnlineUser: Online User
|
||||
hsLoginLog: Login Log
|
||||
hsOperationLog: Operation Log
|
||||
hsSystemLog: System Log
|
||||
hseditor: Editor
|
||||
hsabnormal: Abnormal Page
|
||||
hsfourZeroFour: "404"
|
||||
@@ -65,8 +71,10 @@ menus:
|
||||
hsTag: Tag
|
||||
hsStatistic: Statistic
|
||||
hsCollapse: Collapse
|
||||
hsGanttastic: Gantt Chart
|
||||
hsProgress: Progress
|
||||
hsUpload: File Upload
|
||||
hsCheckCard: CheckCard
|
||||
hsmenus: MultiLevel Menu
|
||||
hsmenu1: Menu1
|
||||
hsmenu1-1: Menu1-1
|
||||
@@ -84,7 +92,9 @@ menus:
|
||||
hsMenuTree: Menu Tree
|
||||
hsVideoFrame: Video Frame Capture
|
||||
hsWavesurfer: Audio Visualization
|
||||
hsRipple: Ripple
|
||||
hsOptimize: Debounce、Throttle、Copy、Longpress Directives
|
||||
hsVerify: Captcha
|
||||
hsWatermark: Water Mark
|
||||
hsPrint: Print
|
||||
hsDownload: Download
|
||||
@@ -121,8 +131,11 @@ menus:
|
||||
hsSensitive: Sensitive Filter
|
||||
hsPinyin: PinYin
|
||||
hsdanmaku: Danmaku
|
||||
hsSchemaForm: Form
|
||||
hsPureTableBase: Base Usage
|
||||
hsPureTableHigh: High Usage
|
||||
hsPureTableEdit: Edit Usage
|
||||
hsVxeTable: Virtual Usage
|
||||
hsboard: Paint Board
|
||||
hsMenuoverflow: Menu Overflow Show Tooltip Text
|
||||
hsChildMenuoverflow: Child Menu Overflow Show Tooltip Text
|
||||
|
||||
@@ -26,11 +26,17 @@ menus:
|
||||
hshome: 首页
|
||||
hslogin: 登录
|
||||
hsempty: 无Layout页
|
||||
hstable: 表格
|
||||
hssysManagement: 系统管理
|
||||
hsUser: 用户管理
|
||||
hsRole: 角色管理
|
||||
hsSystemMenu: 菜单管理
|
||||
hsDept: 部门管理
|
||||
hssysMonitor: 系统监控
|
||||
hsOnlineUser: 在线用户
|
||||
hsLoginLog: 登录日志
|
||||
hsOperationLog: 操作日志
|
||||
hsSystemLog: 系统日志
|
||||
hseditor: 编辑器
|
||||
hsabnormal: 异常页面
|
||||
hsfourZeroFour: "404"
|
||||
@@ -65,8 +71,10 @@ menus:
|
||||
hsTag: 标签
|
||||
hsStatistic: 统计组件
|
||||
hsCollapse: 折叠面板
|
||||
hsGanttastic: 甘特图
|
||||
hsProgress: 进度条
|
||||
hsUpload: 文件上传
|
||||
hsCheckCard: 多选卡片
|
||||
hsmenus: 多级菜单
|
||||
hsmenu1: 菜单1
|
||||
hsmenu1-1: 菜单1-1
|
||||
@@ -84,7 +92,9 @@ menus:
|
||||
hsMenuTree: 菜单树结构
|
||||
hsVideoFrame: 视频帧截取-wasm版
|
||||
hsWavesurfer: 音频可视化
|
||||
hsRipple: 波纹(Ripple)
|
||||
hsOptimize: 防抖、截流、复制、长按指令
|
||||
hsVerify: 图形验证码
|
||||
hsWatermark: 水印
|
||||
hsPrint: 打印
|
||||
hsDownload: 下载
|
||||
@@ -106,7 +116,7 @@ menus:
|
||||
hsIconSelect: 图标选择器
|
||||
hsTimeline: 时间线
|
||||
hsLineTree: 树形连接线
|
||||
hsList: 列表页
|
||||
hsList: 列表页面
|
||||
hsListCard: 卡片列表页
|
||||
hsDebounce: 防抖节流
|
||||
hsFormDesign: 表单设计器
|
||||
@@ -121,8 +131,11 @@ menus:
|
||||
hsSensitive: 敏感词过滤
|
||||
hsPinyin: 汉语拼音
|
||||
hsdanmaku: 弹幕
|
||||
hsPureTableBase: 基础用法(23个示例)
|
||||
hsPureTableHigh: 高级用法(11个示例)
|
||||
hsSchemaForm: 表单
|
||||
hsPureTableBase: 基础用法
|
||||
hsPureTableHigh: 高级用法
|
||||
hsPureTableEdit: 可编辑用法
|
||||
hsVxeTable: 虚拟滚动
|
||||
hsboard: 艺术画板
|
||||
hsMenuoverflow: 目录超出显示 Tooltip 文字提示
|
||||
hsChildMenuoverflow: 菜单超出显示 Tooltip 文字提示
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 模拟后端动态生成路由
|
||||
import { defineFakeRoute } from "vite-plugin-fake-server/client";
|
||||
import { system, permission, frame, tabs } from "@/router/enums";
|
||||
import { system, monitor, permission, frame, tabs } from "@/router/enums";
|
||||
|
||||
/**
|
||||
* roles:页面级别权限,这里模拟二种 "admin"、"common"
|
||||
@@ -8,7 +8,7 @@ import { system, permission, frame, tabs } from "@/router/enums";
|
||||
* common:普通角色
|
||||
*/
|
||||
|
||||
const systemRouter = {
|
||||
const systemManagementRouter = {
|
||||
path: "/system",
|
||||
meta: {
|
||||
icon: "ri:settings-3-line",
|
||||
@@ -55,6 +55,57 @@ const systemRouter = {
|
||||
]
|
||||
};
|
||||
|
||||
const systemMonitorRouter = {
|
||||
path: "/monitor",
|
||||
meta: {
|
||||
icon: "ep:monitor",
|
||||
title: "menus.hssysMonitor",
|
||||
rank: monitor
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/monitor/online-user",
|
||||
component: "monitor/online/index",
|
||||
name: "OnlineUser",
|
||||
meta: {
|
||||
icon: "ri:user-voice-line",
|
||||
title: "menus.hsOnlineUser",
|
||||
roles: ["admin"]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/monitor/login-logs",
|
||||
component: "monitor/logs/login/index",
|
||||
name: "LoginLog",
|
||||
meta: {
|
||||
icon: "ri:window-line",
|
||||
title: "menus.hsLoginLog",
|
||||
roles: ["admin"]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/monitor/operation-logs",
|
||||
component: "monitor/logs/operation/index",
|
||||
name: "OperationLog",
|
||||
meta: {
|
||||
icon: "ri:history-fill",
|
||||
title: "menus.hsOperationLog",
|
||||
roles: ["admin"]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/monitor/system-logs",
|
||||
component: "monitor/logs/system/index",
|
||||
name: "SystemLog",
|
||||
meta: {
|
||||
icon: "ri:file-search-line",
|
||||
title: "menus.hsSystemLog",
|
||||
roles: ["admin"]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const permissionRouter = {
|
||||
path: "/permission",
|
||||
meta: {
|
||||
@@ -90,7 +141,7 @@ const permissionRouter = {
|
||||
const frameRouter = {
|
||||
path: "/iframe",
|
||||
meta: {
|
||||
icon: "ep:monitor",
|
||||
icon: "ri:links-fill",
|
||||
title: "menus.hsExternalPage",
|
||||
rank: frame
|
||||
},
|
||||
@@ -239,7 +290,13 @@ export default defineFakeRoute([
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
data: [systemRouter, permissionRouter, frameRouter, tabsRouter]
|
||||
data: [
|
||||
systemManagementRouter,
|
||||
systemMonitorRouter,
|
||||
permissionRouter,
|
||||
frameRouter,
|
||||
tabsRouter
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
766
mock/system.ts
766
mock/system.ts
@@ -74,7 +74,7 @@ export default defineFakeRoute([
|
||||
};
|
||||
}
|
||||
},
|
||||
// 用户管理-根据userId,获取对应角色id列表(userId:用户id)
|
||||
// 用户管理-根据 userId 获取对应角色 id 列表(userId:用户id)
|
||||
{
|
||||
url: "/list-role-ids",
|
||||
method: "post",
|
||||
@@ -140,6 +140,234 @@ export default defineFakeRoute([
|
||||
};
|
||||
}
|
||||
},
|
||||
// 角色管理-权限-菜单权限
|
||||
{
|
||||
url: "/role-menu",
|
||||
method: "post",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
data: [
|
||||
// 外部页面
|
||||
{
|
||||
parentId: 0,
|
||||
id: 100,
|
||||
menuType: 0, // 菜单类型(0代表菜单、1代表iframe、2代表外链、3代表按钮)
|
||||
title: "menus.hsExternalPage"
|
||||
},
|
||||
{
|
||||
parentId: 100,
|
||||
id: 101,
|
||||
menuType: 0,
|
||||
title: "menus.hsExternalDoc"
|
||||
},
|
||||
{
|
||||
parentId: 101,
|
||||
id: 102,
|
||||
menuType: 2,
|
||||
title: "menus.externalLink"
|
||||
},
|
||||
{
|
||||
parentId: 101,
|
||||
id: 103,
|
||||
menuType: 2,
|
||||
title: "menus.pureutilsLink"
|
||||
},
|
||||
{
|
||||
parentId: 100,
|
||||
id: 104,
|
||||
menuType: 1,
|
||||
title: "menus.hsEmbeddedDoc"
|
||||
},
|
||||
{
|
||||
parentId: 104,
|
||||
id: 105,
|
||||
menuType: 1,
|
||||
title: "menus.hsEpDocument"
|
||||
},
|
||||
{
|
||||
parentId: 104,
|
||||
id: 106,
|
||||
menuType: 1,
|
||||
title: "menus.hsTailwindcssDocument"
|
||||
},
|
||||
{
|
||||
parentId: 104,
|
||||
id: 107,
|
||||
menuType: 1,
|
||||
title: "menus.hsVueDocument"
|
||||
},
|
||||
{
|
||||
parentId: 104,
|
||||
id: 108,
|
||||
menuType: 1,
|
||||
title: "menus.hsViteDocument"
|
||||
},
|
||||
{
|
||||
parentId: 104,
|
||||
id: 109,
|
||||
menuType: 1,
|
||||
title: "menus.hsPiniaDocument"
|
||||
},
|
||||
{
|
||||
parentId: 104,
|
||||
id: 110,
|
||||
menuType: 1,
|
||||
title: "menus.hsRouterDocument"
|
||||
},
|
||||
// 权限管理
|
||||
{
|
||||
parentId: 0,
|
||||
id: 200,
|
||||
menuType: 0,
|
||||
title: "menus.permission"
|
||||
},
|
||||
{
|
||||
parentId: 200,
|
||||
id: 201,
|
||||
menuType: 0,
|
||||
title: "menus.permissionPage"
|
||||
},
|
||||
{
|
||||
parentId: 200,
|
||||
id: 202,
|
||||
menuType: 0,
|
||||
title: "menus.permissionButton"
|
||||
},
|
||||
{
|
||||
parentId: 202,
|
||||
id: 203,
|
||||
menuType: 3,
|
||||
title: "添加"
|
||||
},
|
||||
{
|
||||
parentId: 202,
|
||||
id: 204,
|
||||
menuType: 3,
|
||||
title: "修改"
|
||||
},
|
||||
{
|
||||
parentId: 202,
|
||||
id: 205,
|
||||
menuType: 3,
|
||||
title: "删除"
|
||||
},
|
||||
// 系统管理
|
||||
{
|
||||
parentId: 0,
|
||||
id: 300,
|
||||
menuType: 0,
|
||||
title: "menus.hssysManagement"
|
||||
},
|
||||
{
|
||||
parentId: 300,
|
||||
id: 301,
|
||||
menuType: 0,
|
||||
title: "menus.hsUser"
|
||||
},
|
||||
{
|
||||
parentId: 300,
|
||||
id: 302,
|
||||
menuType: 0,
|
||||
title: "menus.hsRole"
|
||||
},
|
||||
{
|
||||
parentId: 300,
|
||||
id: 303,
|
||||
menuType: 0,
|
||||
title: "menus.hsSystemMenu"
|
||||
},
|
||||
{
|
||||
parentId: 300,
|
||||
id: 304,
|
||||
menuType: 0,
|
||||
title: "menus.hsDept"
|
||||
},
|
||||
// 系统监控
|
||||
{
|
||||
parentId: 0,
|
||||
id: 400,
|
||||
menuType: 0,
|
||||
title: "menus.hssysMonitor"
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 401,
|
||||
menuType: 0,
|
||||
title: "menus.hsOnlineUser"
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 402,
|
||||
menuType: 0,
|
||||
title: "menus.hsLoginLog"
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 403,
|
||||
menuType: 0,
|
||||
title: "menus.hsOperationLog"
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 404,
|
||||
menuType: 0,
|
||||
title: "menus.hsSystemLog"
|
||||
},
|
||||
// 标签页操作
|
||||
{
|
||||
parentId: 0,
|
||||
id: 500,
|
||||
menuType: 0,
|
||||
title: "menus.hstabs"
|
||||
},
|
||||
{
|
||||
parentId: 500,
|
||||
id: 501,
|
||||
menuType: 0,
|
||||
title: "menus.hstabs"
|
||||
},
|
||||
{
|
||||
parentId: 500,
|
||||
id: 502,
|
||||
menuType: 0,
|
||||
title: "query传参模式"
|
||||
},
|
||||
{
|
||||
parentId: 500,
|
||||
id: 503,
|
||||
menuType: 0,
|
||||
title: "params传参模式"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
// 角色管理-权限-菜单权限-根据角色 id 查对应菜单
|
||||
{
|
||||
url: "/role-menu-ids",
|
||||
method: "post",
|
||||
response: ({ body }) => {
|
||||
if (body.id == 1) {
|
||||
return {
|
||||
success: true,
|
||||
data: [
|
||||
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 200, 201,
|
||||
202, 203, 204, 205, 300, 301, 302, 303, 304, 400, 401, 402, 403,
|
||||
404, 500, 501, 502, 503
|
||||
]
|
||||
};
|
||||
} else if (body.id == 2) {
|
||||
return {
|
||||
success: true,
|
||||
data: [
|
||||
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 404, 500,
|
||||
501, 502, 503
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
// 菜单管理
|
||||
{
|
||||
url: "/menu",
|
||||
@@ -159,7 +387,7 @@ export default defineFakeRoute([
|
||||
component: "",
|
||||
rank: 7,
|
||||
redirect: "",
|
||||
icon: "ep:monitor",
|
||||
icon: "ri:links-fill",
|
||||
extraIcon: "",
|
||||
enterTransition: "",
|
||||
leaveTransition: "",
|
||||
@@ -657,18 +885,18 @@ export default defineFakeRoute([
|
||||
showLink: true,
|
||||
showParent: false
|
||||
},
|
||||
// 标签页操作
|
||||
// 系统监控
|
||||
{
|
||||
parentId: 0,
|
||||
id: 400,
|
||||
menuType: 0,
|
||||
title: "menus.hstabs",
|
||||
name: "PureTabs",
|
||||
path: "/tabs",
|
||||
title: "menus.hssysMonitor",
|
||||
name: "PureMonitor",
|
||||
path: "/monitor",
|
||||
component: "",
|
||||
rank: 11,
|
||||
redirect: "",
|
||||
icon: "ri:bookmark-2-line",
|
||||
icon: "ep:monitor",
|
||||
extraIcon: "",
|
||||
enterTransition: "",
|
||||
leaveTransition: "",
|
||||
@@ -685,6 +913,122 @@ export default defineFakeRoute([
|
||||
parentId: 400,
|
||||
id: 401,
|
||||
menuType: 0,
|
||||
title: "menus.hsOnlineUser",
|
||||
name: "OnlineUser",
|
||||
path: "/monitor/online-user",
|
||||
component: "monitor/online/index",
|
||||
rank: null,
|
||||
redirect: "",
|
||||
icon: "ri:user-voice-line",
|
||||
extraIcon: "",
|
||||
enterTransition: "",
|
||||
leaveTransition: "",
|
||||
activePath: "",
|
||||
auths: "",
|
||||
frameSrc: "",
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
showLink: true,
|
||||
showParent: false
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 402,
|
||||
menuType: 0,
|
||||
title: "menus.hsLoginLog",
|
||||
name: "LoginLog",
|
||||
path: "/monitor/login-logs",
|
||||
component: "monitor/logs/login/index",
|
||||
rank: null,
|
||||
redirect: "",
|
||||
icon: "ri:window-line",
|
||||
extraIcon: "",
|
||||
enterTransition: "",
|
||||
leaveTransition: "",
|
||||
activePath: "",
|
||||
auths: "",
|
||||
frameSrc: "",
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
showLink: true,
|
||||
showParent: false
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 403,
|
||||
menuType: 0,
|
||||
title: "menus.hsOperationLog",
|
||||
name: "OperationLog",
|
||||
path: "/monitor/operation-logs",
|
||||
component: "monitor/logs/operation/index",
|
||||
rank: null,
|
||||
redirect: "",
|
||||
icon: "ri:history-fill",
|
||||
extraIcon: "",
|
||||
enterTransition: "",
|
||||
leaveTransition: "",
|
||||
activePath: "",
|
||||
auths: "",
|
||||
frameSrc: "",
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
showLink: true,
|
||||
showParent: false
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 404,
|
||||
menuType: 0,
|
||||
title: "menus.hsSystemLog",
|
||||
name: "SystemLog",
|
||||
path: "/monitor/system-logs",
|
||||
component: "monitor/logs/system/index",
|
||||
rank: null,
|
||||
redirect: "",
|
||||
icon: "ri:file-search-line",
|
||||
extraIcon: "",
|
||||
enterTransition: "",
|
||||
leaveTransition: "",
|
||||
activePath: "",
|
||||
auths: "",
|
||||
frameSrc: "",
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
showLink: true,
|
||||
showParent: false
|
||||
},
|
||||
// 标签页操作
|
||||
{
|
||||
parentId: 0,
|
||||
id: 500,
|
||||
menuType: 0,
|
||||
title: "menus.hstabs",
|
||||
name: "PureTabs",
|
||||
path: "/tabs",
|
||||
component: "",
|
||||
rank: 12,
|
||||
redirect: "",
|
||||
icon: "ri:bookmark-2-line",
|
||||
extraIcon: "",
|
||||
enterTransition: "",
|
||||
leaveTransition: "",
|
||||
activePath: "",
|
||||
auths: "",
|
||||
frameSrc: "",
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
showLink: true,
|
||||
showParent: false
|
||||
},
|
||||
{
|
||||
parentId: 500,
|
||||
id: 501,
|
||||
menuType: 0,
|
||||
title: "menus.hstabs",
|
||||
name: "Tabs",
|
||||
path: "/tabs/index",
|
||||
@@ -705,8 +1049,8 @@ export default defineFakeRoute([
|
||||
showParent: false
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 402,
|
||||
parentId: 500,
|
||||
id: 502,
|
||||
menuType: 0,
|
||||
title: "query传参模式",
|
||||
name: "TabQueryDetail",
|
||||
@@ -728,8 +1072,8 @@ export default defineFakeRoute([
|
||||
showParent: false
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 403,
|
||||
parentId: 500,
|
||||
id: 503,
|
||||
menuType: 0,
|
||||
title: "params传参模式",
|
||||
name: "TabParamsDetail",
|
||||
@@ -895,5 +1239,405 @@ export default defineFakeRoute([
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
// 在线用户
|
||||
{
|
||||
url: "/online-logs",
|
||||
method: "post",
|
||||
response: ({ body }) => {
|
||||
let list = [
|
||||
{
|
||||
id: 1,
|
||||
username: "admin",
|
||||
ip: faker.internet.ipv4(),
|
||||
address: "中国河南省信阳市",
|
||||
system: "macOS",
|
||||
browser: "Chrome",
|
||||
loginTime: new Date()
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
username: "common",
|
||||
ip: faker.internet.ipv4(),
|
||||
address: "中国广东省深圳市",
|
||||
system: "Windows",
|
||||
browser: "Firefox",
|
||||
loginTime: new Date()
|
||||
}
|
||||
];
|
||||
list = list.filter(item => item.username.includes(body?.username));
|
||||
return {
|
||||
success: true,
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
pageSize: 10, // 每页显示条目个数
|
||||
currentPage: 1 // 当前页数
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
// 登录日志
|
||||
{
|
||||
url: "/login-logs",
|
||||
method: "post",
|
||||
response: ({ body }) => {
|
||||
let list = [
|
||||
{
|
||||
id: 1,
|
||||
username: "admin",
|
||||
ip: faker.internet.ipv4(),
|
||||
address: "中国河南省信阳市",
|
||||
system: "macOS",
|
||||
browser: "Chrome",
|
||||
status: 1, // 登录状态 1 成功 0 失败
|
||||
behavior: "账号登录",
|
||||
loginTime: new Date()
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
username: "common",
|
||||
ip: faker.internet.ipv4(),
|
||||
address: "中国广东省深圳市",
|
||||
system: "Windows",
|
||||
browser: "Firefox",
|
||||
status: 0,
|
||||
behavior: "第三方登录",
|
||||
loginTime: new Date()
|
||||
}
|
||||
];
|
||||
list = list.filter(item => item.username.includes(body?.username));
|
||||
list = list.filter(item =>
|
||||
String(item.status).includes(String(body?.status))
|
||||
);
|
||||
return {
|
||||
success: true,
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
pageSize: 10, // 每页显示条目个数
|
||||
currentPage: 1 // 当前页数
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
// 操作日志
|
||||
{
|
||||
url: "/operation-logs",
|
||||
method: "post",
|
||||
response: ({ body }) => {
|
||||
let list = [
|
||||
{
|
||||
id: 1,
|
||||
username: "admin",
|
||||
ip: faker.internet.ipv4(),
|
||||
address: "中国河南省信阳市",
|
||||
system: "macOS",
|
||||
browser: "Chrome",
|
||||
status: 1, // 操作状态 1 成功 0 失败
|
||||
summary: "菜单管理-添加菜单", // 操作概要
|
||||
module: "系统管理", // 所属模块
|
||||
operatingTime: new Date() // 操作时间
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
username: "common",
|
||||
ip: faker.internet.ipv4(),
|
||||
address: "中国广东省深圳市",
|
||||
system: "Windows",
|
||||
browser: "Firefox",
|
||||
status: 0,
|
||||
summary: "列表分页查询",
|
||||
module: "在线用户",
|
||||
operatingTime: new Date()
|
||||
}
|
||||
];
|
||||
list = list.filter(item => item.module.includes(body?.module));
|
||||
list = list.filter(item =>
|
||||
String(item.status).includes(String(body?.status))
|
||||
);
|
||||
return {
|
||||
success: true,
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
pageSize: 10, // 每页显示条目个数
|
||||
currentPage: 1 // 当前页数
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
// 系统日志
|
||||
{
|
||||
url: "/system-logs",
|
||||
method: "post",
|
||||
response: ({ body }) => {
|
||||
let list = [
|
||||
{
|
||||
id: 1, // 日志ID
|
||||
/**
|
||||
* 日志级别
|
||||
* 0 debug调试(最低级别的日志,用于调试和开发阶段)
|
||||
* 1 info信息(默认级别,用于记录一般的信息)
|
||||
* 2 warn警告(表示可能出现的问题或潜在的错误,但不会影响系统的正常运行)
|
||||
* 3 error错误(表示发生了错误,但不会导致系统崩溃)
|
||||
* 4 fatal致命(最高级别的日志,表示发生了严重错误,导致系统无法继续运行)
|
||||
*/
|
||||
level: 1,
|
||||
module: "菜单管理", // 所属模块
|
||||
url: "/menu", // 请求接口
|
||||
method: "post", // 请求方法
|
||||
ip: faker.internet.ipv4(),
|
||||
address: "中国河南省信阳市",
|
||||
system: "macOS",
|
||||
browser: "Chrome",
|
||||
/**
|
||||
* 请求耗时(单位:ms 毫秒)
|
||||
* 正常耗时:一般认为在几百毫秒(0.1-0.5秒)范围内的请求耗时较为正常
|
||||
* 较慢耗时:在1秒以上的耗时可以被认为是较慢的请求,但具体是否较慢还需要根据具体业务场景和性能要求来判断
|
||||
*/
|
||||
takesTime: 10,
|
||||
requestTime: new Date() // 请求时间
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
level: 0,
|
||||
module: "地图",
|
||||
url: "/get-map-info",
|
||||
method: "get",
|
||||
ip: faker.internet.ipv4(),
|
||||
address: "中国广东省深圳市",
|
||||
system: "Windows",
|
||||
browser: "Firefox",
|
||||
takesTime: 1200,
|
||||
requestTime: new Date()
|
||||
}
|
||||
];
|
||||
list = list.filter(item => item.module.includes(body?.module));
|
||||
return {
|
||||
success: true,
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
pageSize: 10, // 每页显示条目个数
|
||||
currentPage: 1 // 当前页数
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
// 系统日志-根据 id 查日志详情
|
||||
{
|
||||
url: "/system-logs-detail",
|
||||
method: "post",
|
||||
response: ({ body }) => {
|
||||
if (body.id == 1) {
|
||||
return {
|
||||
id: 1,
|
||||
level: 1,
|
||||
module: "菜单管理",
|
||||
url: "/menu",
|
||||
method: "post",
|
||||
ip: faker.internet.ipv4(),
|
||||
address: "中国河南省信阳市",
|
||||
system: "macOS",
|
||||
browser: "Chrome",
|
||||
takesTime: 10,
|
||||
responseHeaders: {
|
||||
traceId: "1495502411171032",
|
||||
"Content-Type": "application/json",
|
||||
Connection: "keep-alive",
|
||||
"Keep-Alive": "timeout=5",
|
||||
"Content-Length": 17019
|
||||
},
|
||||
responseBody: {
|
||||
success: true,
|
||||
data: [
|
||||
{
|
||||
parentId: 0,
|
||||
id: 400,
|
||||
menuType: 0,
|
||||
title: "menus.hssysMonitor",
|
||||
name: "PureMonitor",
|
||||
path: "/monitor",
|
||||
component: "",
|
||||
rank: 11,
|
||||
redirect: "",
|
||||
icon: "ep:monitor",
|
||||
extraIcon: "",
|
||||
enterTransition: "",
|
||||
leaveTransition: "",
|
||||
activePath: "",
|
||||
auths: "",
|
||||
frameSrc: "",
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
showLink: true,
|
||||
showParent: false
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 401,
|
||||
menuType: 0,
|
||||
title: "menus.hsOnlineUser",
|
||||
name: "OnlineUser",
|
||||
path: "/monitor/online-user",
|
||||
component: "monitor/online/index",
|
||||
rank: null,
|
||||
redirect: "",
|
||||
icon: "ri:user-voice-line",
|
||||
extraIcon: "",
|
||||
enterTransition: "",
|
||||
leaveTransition: "",
|
||||
activePath: "",
|
||||
auths: "",
|
||||
frameSrc: "",
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
showLink: true,
|
||||
showParent: false
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 402,
|
||||
menuType: 0,
|
||||
title: "menus.hsLoginLog",
|
||||
name: "LoginLog",
|
||||
path: "/monitor/login-logs",
|
||||
component: "monitor/logs/login/index",
|
||||
rank: null,
|
||||
redirect: "",
|
||||
icon: "ri:window-line",
|
||||
extraIcon: "",
|
||||
enterTransition: "",
|
||||
leaveTransition: "",
|
||||
activePath: "",
|
||||
auths: "",
|
||||
frameSrc: "",
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
showLink: true,
|
||||
showParent: false
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 403,
|
||||
menuType: 0,
|
||||
title: "menus.hsOperationLog",
|
||||
name: "OperationLog",
|
||||
path: "/monitor/operation-logs",
|
||||
component: "monitor/logs/operation/index",
|
||||
rank: null,
|
||||
redirect: "",
|
||||
icon: "ri:history-fill",
|
||||
extraIcon: "",
|
||||
enterTransition: "",
|
||||
leaveTransition: "",
|
||||
activePath: "",
|
||||
auths: "",
|
||||
frameSrc: "",
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
showLink: true,
|
||||
showParent: false
|
||||
},
|
||||
{
|
||||
parentId: 400,
|
||||
id: 404,
|
||||
menuType: 0,
|
||||
title: "menus.hsSystemLog",
|
||||
name: "SystemLog",
|
||||
path: "/monitor/system-logs",
|
||||
component: "monitor/logs/system/index",
|
||||
rank: null,
|
||||
redirect: "",
|
||||
icon: "ri:file-search-line",
|
||||
extraIcon: "",
|
||||
enterTransition: "",
|
||||
leaveTransition: "",
|
||||
activePath: "",
|
||||
auths: "",
|
||||
frameSrc: "",
|
||||
frameLoading: true,
|
||||
keepAlive: false,
|
||||
hiddenTag: false,
|
||||
showLink: true,
|
||||
showParent: false
|
||||
}
|
||||
]
|
||||
},
|
||||
requestHeaders: {
|
||||
Accept: "application/json, text/plain, */*",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,eo;q=0.7",
|
||||
Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.admin",
|
||||
Connection: "keep-alive",
|
||||
"Content-Length": 0,
|
||||
Cookie:
|
||||
"_ga=GA1.1.231800979.1704562367; _ga_M74ZHEQ1M1=GS1.1.1709299375.7.1.1709299476.0.0.0; Hm_lvt_6a7dac00248d3b6ad8479d7249bb29c5=1709032753,1709359575; Hm_lvt_23a157b7d0d9867f7a51e42628f052f5=1708960489,1709485849,1709879672; authorized-token={%22accessToken%22:%22eyJhbGciOiJIUzUxMiJ9.admin%22%2C%22expires%22:1919520000000}; multiple-tabs=true",
|
||||
Host: "192.168.2.121:8848",
|
||||
Origin: "http://192.168.2.121:8848",
|
||||
Referer: "http://192.168.2.121:8848/",
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
},
|
||||
requestBody: {
|
||||
title: "系统监控"
|
||||
},
|
||||
traceId: "1495502411171032",
|
||||
requestTime: new Date()
|
||||
};
|
||||
} else if (body.id == 2) {
|
||||
return {
|
||||
id: 2,
|
||||
level: 0,
|
||||
module: "地图",
|
||||
url: "/get-map-info?plateNumber=豫A59778U",
|
||||
method: "get",
|
||||
ip: faker.internet.ipv4(),
|
||||
address: "中国广东省深圳市",
|
||||
system: "Windows",
|
||||
browser: "Firefox",
|
||||
takesTime: 1200,
|
||||
responseHeaders: {
|
||||
traceId: "2280443117103208",
|
||||
"Content-Type": "application/json",
|
||||
Connection: "keep-alive",
|
||||
"Keep-Alive": "timeout=5",
|
||||
"Content-Length": 28693
|
||||
},
|
||||
responseBody: {
|
||||
plateNumber: "豫A59778U",
|
||||
driver: "子骞",
|
||||
orientation: 289,
|
||||
lng: 113.8564,
|
||||
lat: 34.373
|
||||
},
|
||||
requestHeaders: {
|
||||
Accept: "application/json, text/plain, */*",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,eo;q=0.7",
|
||||
Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.admin",
|
||||
Connection: "keep-alive",
|
||||
"Content-Length": 0,
|
||||
Cookie:
|
||||
"_ga=GA1.1.231800979.1704562367; _ga_M74ZHEQ1M1=GS1.1.1709299375.7.1.1709299476.0.0.0; Hm_lvt_6a7dac00248d3b6ad8479d7249bb29c5=1709032753,1709359575; Hm_lvt_23a157b7d0d9867f7a51e42628f052f5=1708960489,1709485849,1709879672; authorized-token={%22accessToken%22:%22eyJhbGciOiJIUzUxMiJ9.admin%22%2C%22expires%22:1919520000000}; multiple-tabs=true",
|
||||
Host: "192.168.2.121:8848",
|
||||
Origin: "http://192.168.2.121:8848",
|
||||
Referer: "http://192.168.2.121:8848/",
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
},
|
||||
requestBody: null,
|
||||
traceId: "2280443117103208",
|
||||
requestTime: new Date()
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
80
package.json
80
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vue-pure-admin",
|
||||
"version": "5.0.0",
|
||||
"version": "5.2.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -49,25 +49,28 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@amap/amap-jsapi-loader": "^1.0.1",
|
||||
"@howdyjs/mouse-menu": "2.0.9",
|
||||
"@logicflow/core": "^1.2.22",
|
||||
"@logicflow/extension": "^1.2.22",
|
||||
"@pureadmin/descriptions": "^1.2.0",
|
||||
"@pureadmin/table": "^3.0.2",
|
||||
"@pureadmin/utils": "^2.4.4",
|
||||
"@vueuse/core": "^10.8.0",
|
||||
"@howdyjs/mouse-menu": "^2.1.3",
|
||||
"@infectoone/vue-ganttastic": "^2.3.1",
|
||||
"@logicflow/core": "^1.2.23",
|
||||
"@logicflow/extension": "^1.2.23",
|
||||
"@pureadmin/descriptions": "^1.2.1",
|
||||
"@pureadmin/table": "^3.1.2",
|
||||
"@pureadmin/utils": "^2.4.7",
|
||||
"@vue-flow/background": "^1.3.0",
|
||||
"@vue-flow/core": "^1.33.4",
|
||||
"@vueuse/core": "^10.9.0",
|
||||
"@vueuse/motion": "^2.1.0",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"@zxcvbn-ts/core": "^3.0.4",
|
||||
"animate.css": "^4.1.1",
|
||||
"axios": "^1.6.7",
|
||||
"axios": "^1.6.8",
|
||||
"china-area-data": "^5.0.1",
|
||||
"cropperjs": "^1.6.1",
|
||||
"dayjs": "^1.11.10",
|
||||
"echarts": "^5.5.0",
|
||||
"el-table-infinite-scroll": "^3.0.3",
|
||||
"element-plus": "^2.5.6",
|
||||
"element-plus": "^2.6.1",
|
||||
"intro.js": "^7.2.0",
|
||||
"js-cookie": "^3.0.5",
|
||||
"jsbarcode": "^3.11.6",
|
||||
@@ -78,34 +81,37 @@
|
||||
"path": "^0.12.7",
|
||||
"pinia": "^2.1.7",
|
||||
"pinyin-pro": "^3.19.6",
|
||||
"plus-pro-components": "^0.0.5",
|
||||
"qrcode": "^1.5.3",
|
||||
"qs": "^6.11.2",
|
||||
"qs": "^6.12.0",
|
||||
"responsive-storage": "^2.2.0",
|
||||
"sortablejs": "^1.15.2",
|
||||
"swiper": "^11.0.6",
|
||||
"typeit": "8.7.1",
|
||||
"swiper": "^11.0.7",
|
||||
"typeit": "^8.8.3",
|
||||
"v-contextmenu": "^3.2.0",
|
||||
"v3-infinite-loading": "^1.3.1",
|
||||
"version-rocket": "^1.7.1",
|
||||
"vue": "3.4.14",
|
||||
"vue-i18n": "^9.9.1",
|
||||
"vue-json-pretty": "^2.3.0",
|
||||
"vue-pdf-embed": "1.2.1",
|
||||
"vue": "^3.4.21",
|
||||
"vue-i18n": "^9.10.2",
|
||||
"vue-json-pretty": "^2.4.0",
|
||||
"vue-pdf-embed": "^2.0.3",
|
||||
"vue-router": "^4.3.0",
|
||||
"vue-tippy": "^6.4.1",
|
||||
"vue-types": "^5.1.1",
|
||||
"vue-virtual-scroller": "2.0.0-beta.8",
|
||||
"vue-waterfall-plugin-next": "^2.3.1",
|
||||
"vue-waterfall-plugin-next": "^2.4.3",
|
||||
"vue3-danmaku": "^1.6.0",
|
||||
"vue3-puzzle-vcode": "^1.1.7",
|
||||
"vuedraggable": "^4.1.0",
|
||||
"wavesurfer.js": "^7.7.3",
|
||||
"xgplayer": "^3.0.13",
|
||||
"vxe-table": "^4.5.21",
|
||||
"wavesurfer.js": "^7.7.5",
|
||||
"xgplayer": "^3.0.14",
|
||||
"xlsx": "^0.18.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^18.6.1",
|
||||
"@commitlint/config-conventional": "^18.6.2",
|
||||
"@commitlint/types": "^18.6.1",
|
||||
"@commitlint/cli": "^19.2.1",
|
||||
"@commitlint/config-conventional": "^19.1.0",
|
||||
"@commitlint/types": "^19.0.3",
|
||||
"@eslint/js": "^8.57.0",
|
||||
"@faker-js/faker": "^8.4.1",
|
||||
"@iconify-icons/ep": "^1.2.12",
|
||||
@@ -113,47 +119,49 @@
|
||||
"@iconify/vue": "^4.1.1",
|
||||
"@intlify/unplugin-vue-i18n": "^2.0.0",
|
||||
"@pureadmin/theme": "^3.2.0",
|
||||
"@types/dagre": "^0.7.52",
|
||||
"@types/gradient-string": "^1.1.5",
|
||||
"@types/intro.js": "^5.1.5",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@types/node": "^20.11.20",
|
||||
"@types/node": "^20.11.30",
|
||||
"@types/nprogress": "^0.2.3",
|
||||
"@types/qrcode": "^1.5.5",
|
||||
"@types/qs": "^6.9.11",
|
||||
"@types/qs": "^6.9.14",
|
||||
"@types/sortablejs": "^1.15.8",
|
||||
"@typescript-eslint/eslint-plugin": "^7.0.2",
|
||||
"@typescript-eslint/parser": "^7.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.3.1",
|
||||
"@typescript-eslint/parser": "^7.3.1",
|
||||
"@vitejs/plugin-vue": "^5.0.4",
|
||||
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
||||
"autoprefixer": "^10.4.17",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"boxen": "^7.1.1",
|
||||
"cloc": "^2.11.0",
|
||||
"cssnano": "^6.0.5",
|
||||
"cssnano": "^6.1.1",
|
||||
"dagre": "^0.8.5",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-define-config": "^2.1.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"eslint-plugin-vue": "^9.22.0",
|
||||
"eslint-plugin-vue": "^9.23.0",
|
||||
"gradient-string": "^2.0.2",
|
||||
"husky": "^9.0.11",
|
||||
"lint-staged": "^15.2.2",
|
||||
"postcss": "^8.4.35",
|
||||
"postcss": "^8.4.38",
|
||||
"postcss-html": "^1.6.0",
|
||||
"postcss-import": "^16.0.1",
|
||||
"postcss-import": "^16.1.0",
|
||||
"postcss-scss": "^4.0.9",
|
||||
"prettier": "^3.2.5",
|
||||
"rimraf": "^5.0.5",
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
"sass": "^1.71.1",
|
||||
"sass": "^1.72.0",
|
||||
"stylelint": "^16.2.1",
|
||||
"stylelint-config-recess-order": "^4.6.0",
|
||||
"stylelint-config-recess-order": "^5.0.0",
|
||||
"stylelint-config-recommended-vue": "^1.5.0",
|
||||
"stylelint-config-standard-scss": "^13.0.0",
|
||||
"stylelint-prettier": "^5.0.0",
|
||||
"svgo": "^3.2.0",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^5.1.4",
|
||||
"typescript": "^5.4.3",
|
||||
"vite": "^5.2.2",
|
||||
"vite-plugin-cdn-import": "^0.3.5",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-fake-server": "^2.1.1",
|
||||
|
||||
3417
pnpm-lock.yaml
generated
3417
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"Version": "5.0.0",
|
||||
"Version": "5.2.0",
|
||||
"Title": "PureAdmin",
|
||||
"FixedHeader": true,
|
||||
"HiddenSideBar": false,
|
||||
@@ -14,6 +14,7 @@
|
||||
"Weak": false,
|
||||
"HideTabs": false,
|
||||
"HideFooter": false,
|
||||
"Stretch": false,
|
||||
"SidebarStatus": true,
|
||||
"EpThemeColor": "#409EFF",
|
||||
"ShowLogo": true,
|
||||
@@ -22,8 +23,9 @@
|
||||
"CachingAsyncRoutes": false,
|
||||
"TooltipEffect": "light",
|
||||
"ResponsiveStorageNameSpace": "responsive-",
|
||||
"MenuSearchHistory": 6,
|
||||
"MapConfigure": {
|
||||
"amapKey": "97b3248d1553172e81f168cf94ea667e",
|
||||
"amapKey": "adc139d56406f3844c8f1cf1c6b65c41",
|
||||
"options": {
|
||||
"resizeEnable": true,
|
||||
"center": [113.6401, 34.72468],
|
||||
|
||||
1
public/sponsors/aitools.svg
Normal file
1
public/sponsors/aitools.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 80 KiB |
@@ -9,9 +9,11 @@
|
||||
import { defineComponent } from "vue";
|
||||
import { checkVersion } from "version-rocket";
|
||||
import { ElConfigProvider } from "element-plus";
|
||||
import en from "element-plus/dist/locale/en.mjs";
|
||||
import { ReDialog } from "@/components/ReDialog";
|
||||
import en from "element-plus/dist/locale/en.mjs";
|
||||
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
|
||||
import plusEn from "plus-pro-components/locale/en.mjs";
|
||||
import plusZhCn from "plus-pro-components/locale/zh-cn.mjs";
|
||||
|
||||
export default defineComponent({
|
||||
name: "app",
|
||||
@@ -21,7 +23,9 @@ export default defineComponent({
|
||||
},
|
||||
computed: {
|
||||
currentLocale() {
|
||||
return this.$storage.locale?.locale === "zh" ? zhCn : en;
|
||||
return this.$storage.locale?.locale === "zh"
|
||||
? { ...zhCn, ...plusZhCn }
|
||||
: { ...en, ...plusEn };
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
|
||||
@@ -19,32 +19,67 @@ type ResultTable = {
|
||||
};
|
||||
};
|
||||
|
||||
/** 获取用户管理列表 */
|
||||
/** 获取系统管理-用户管理列表 */
|
||||
export const getUserList = (data?: object) => {
|
||||
return http.request<ResultTable>("post", "/user", { data });
|
||||
};
|
||||
|
||||
/** 用户管理-获取所有角色列表 */
|
||||
/** 系统管理-用户管理-获取所有角色列表 */
|
||||
export const getAllRoleList = () => {
|
||||
return http.request<Result>("get", "/list-all-role");
|
||||
};
|
||||
|
||||
/** 用户管理-根据userId,获取对应角色id列表(userId:用户id) */
|
||||
/** 系统管理-用户管理-根据userId,获取对应角色id列表(userId:用户id) */
|
||||
export const getRoleIds = (data?: object) => {
|
||||
return http.request<Result>("post", "/list-role-ids", { data });
|
||||
};
|
||||
|
||||
/** 获取角色管理列表 */
|
||||
/** 获取系统管理-角色管理列表 */
|
||||
export const getRoleList = (data?: object) => {
|
||||
return http.request<ResultTable>("post", "/role", { data });
|
||||
};
|
||||
|
||||
/** 获取部门管理列表 */
|
||||
/** 获取系统管理-菜单管理列表 */
|
||||
export const getMenuList = (data?: object) => {
|
||||
return http.request<Result>("post", "/menu", { data });
|
||||
};
|
||||
|
||||
/** 获取系统管理-部门管理列表 */
|
||||
export const getDeptList = (data?: object) => {
|
||||
return http.request<Result>("post", "/dept", { data });
|
||||
};
|
||||
|
||||
/** 获取菜单管理列表 */
|
||||
export const getMenuList = (data?: object) => {
|
||||
return http.request<Result>("post", "/menu", { data });
|
||||
/** 获取系统监控-在线用户列表 */
|
||||
export const getOnlineLogsList = (data?: object) => {
|
||||
return http.request<ResultTable>("post", "/online-logs", { data });
|
||||
};
|
||||
|
||||
/** 获取系统监控-登录日志列表 */
|
||||
export const getLoginLogsList = (data?: object) => {
|
||||
return http.request<ResultTable>("post", "/login-logs", { data });
|
||||
};
|
||||
|
||||
/** 获取系统监控-操作日志列表 */
|
||||
export const getOperationLogsList = (data?: object) => {
|
||||
return http.request<ResultTable>("post", "/operation-logs", { data });
|
||||
};
|
||||
|
||||
/** 获取系统监控-系统日志列表 */
|
||||
export const getSystemLogsList = (data?: object) => {
|
||||
return http.request<ResultTable>("post", "/system-logs", { data });
|
||||
};
|
||||
|
||||
/** 获取系统监控-系统日志-根据 id 查日志详情 */
|
||||
export const getSystemLogsDetail = (data?: object) => {
|
||||
return http.request<Result>("post", "/system-logs-detail", { data });
|
||||
};
|
||||
|
||||
/** 获取角色管理-权限-菜单权限 */
|
||||
export const getRoleMenu = (data?: object) => {
|
||||
return http.request<Result>("post", "/role-menu", { data });
|
||||
};
|
||||
|
||||
/** 获取角色管理-权限-菜单权限-根据角色 id 查对应菜单 */
|
||||
export const getRoleMenuIds = (data?: object) => {
|
||||
return http.request<Result>("post", "/role-menu-ids", { data });
|
||||
};
|
||||
|
||||
@@ -389,7 +389,6 @@ export default defineComponent({
|
||||
interactive: true,
|
||||
appendTo: "parent",
|
||||
// hideOnClick: false,
|
||||
animation: "perspective",
|
||||
placement: "bottom-end"
|
||||
});
|
||||
|
||||
|
||||
@@ -64,9 +64,10 @@ const fullscreenClass = computed(() => {
|
||||
function eventsCallBack(
|
||||
event: EventType,
|
||||
options: DialogOptions,
|
||||
index: number
|
||||
index: number,
|
||||
isClickFullScreen = false
|
||||
) {
|
||||
fullscreen.value = options?.fullscreen ?? false;
|
||||
if (!isClickFullScreen) fullscreen.value = options?.fullscreen ?? false;
|
||||
if (options?.[event] && isFunction(options?.[event])) {
|
||||
return options?.[event]({ options, index });
|
||||
}
|
||||
@@ -108,7 +109,17 @@ function handleClose(
|
||||
<i
|
||||
v-if="!options?.fullscreen"
|
||||
:class="fullscreenClass"
|
||||
@click="fullscreen = !fullscreen"
|
||||
@click="
|
||||
() => {
|
||||
fullscreen = !fullscreen;
|
||||
eventsCallBack(
|
||||
'fullscreenCallBack',
|
||||
{ ...options, fullscreen },
|
||||
index,
|
||||
true
|
||||
);
|
||||
}
|
||||
"
|
||||
>
|
||||
<IconifyIconOffline
|
||||
class="pure-dialog-svg"
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import type { CSSProperties, VNode, Component } from "vue";
|
||||
|
||||
type DoneFn = (cancel?: boolean) => void;
|
||||
type EventType = "open" | "close" | "openAutoFocus" | "closeAutoFocus";
|
||||
type EventType =
|
||||
| "open"
|
||||
| "close"
|
||||
| "openAutoFocus"
|
||||
| "closeAutoFocus"
|
||||
| "fullscreenCallBack";
|
||||
type ArgsType = {
|
||||
/** `cancel` 点击取消按钮、`sure` 点击确定按钮、`close` 点击右上角关闭按钮或空白页或按下了esc键 */
|
||||
command: "cancel" | "sure" | "close";
|
||||
@@ -175,6 +180,14 @@ interface DialogOptions extends DialogProps {
|
||||
index: number;
|
||||
args: any;
|
||||
}) => void;
|
||||
/** 点击全屏按钮时的回调 */
|
||||
fullscreenCallBack?: ({
|
||||
options,
|
||||
index
|
||||
}: {
|
||||
options: DialogOptions;
|
||||
index: number;
|
||||
}) => void;
|
||||
/** 输入焦点聚焦在 `Dialog` 内容时的回调 */
|
||||
openAutoFocus?: ({
|
||||
options,
|
||||
|
||||
@@ -1,55 +1,68 @@
|
||||
// 这里存放本地图标,在 src/layout/index.vue 文件中加载,避免在首启动加载
|
||||
import { addIcon } from "@iconify/vue/dist/offline";
|
||||
|
||||
/**
|
||||
* 这里存放本地图标,在 src/layout/index.vue 文件中加载,避免在首启动加载
|
||||
*/
|
||||
|
||||
// 本地菜单图标,后端在路由的icon中返回对应的图标字符串并且前端在此处使用addIcon添加即可渲染菜单图标
|
||||
import UbuntuFill from "@iconify-icons/ri/ubuntu-fill";
|
||||
// 本地菜单图标,后端在路由的 icon 中返回对应的图标字符串并且前端在此处使用 addIcon 添加即可渲染菜单图标
|
||||
// @iconify-icons/ep
|
||||
import Menu from "@iconify-icons/ep/menu";
|
||||
import Edit from "@iconify-icons/ep/edit";
|
||||
import InformationLine from "@iconify-icons/ri/information-line";
|
||||
import SetUp from "@iconify-icons/ep/set-up";
|
||||
import TerminalWindowLine from "@iconify-icons/ri/terminal-window-line";
|
||||
import Guide from "@iconify-icons/ep/guide";
|
||||
import HomeFilled from "@iconify-icons/ep/home-filled";
|
||||
import Card from "@iconify-icons/ri/bank-card-line";
|
||||
import ListCheck from "@iconify-icons/ri/list-check";
|
||||
import Histogram from "@iconify-icons/ep/histogram";
|
||||
import Ppt from "@iconify-icons/ri/file-ppt-2-line";
|
||||
import CheckboxCircleLine from "@iconify-icons/ri/checkbox-circle-line";
|
||||
import FlUser from "@iconify-icons/ri/admin-line";
|
||||
import Role from "@iconify-icons/ri/admin-fill";
|
||||
import Setting from "@iconify-icons/ri/settings-3-line";
|
||||
import Dept from "@iconify-icons/ri/git-branch-line";
|
||||
import Search from "@iconify-icons/ri/search-line";
|
||||
import Lollipop from "@iconify-icons/ep/lollipop";
|
||||
import Monitor from "@iconify-icons/ep/monitor";
|
||||
import Tag from "@iconify-icons/ri/bookmark-2-line";
|
||||
import Table from "@iconify-icons/ri/table-line";
|
||||
import Info from "@iconify-icons/ri/file-info-line";
|
||||
import Artboard from "@iconify-icons/ri/artboard-line";
|
||||
addIcon("ubuntuFill", UbuntuFill);
|
||||
import Lollipop from "@iconify-icons/ep/lollipop";
|
||||
import Histogram from "@iconify-icons/ep/histogram";
|
||||
import HomeFilled from "@iconify-icons/ep/home-filled";
|
||||
addIcon("ep:menu", Menu);
|
||||
addIcon("edit", Edit);
|
||||
addIcon("informationLine", InformationLine);
|
||||
addIcon("setUp", SetUp);
|
||||
addIcon("terminalWindowLine", TerminalWindowLine);
|
||||
addIcon("guide", Guide);
|
||||
addIcon("homeFilled", HomeFilled);
|
||||
addIcon("card", Card);
|
||||
addIcon("listCheck", ListCheck);
|
||||
addIcon("histogram", Histogram);
|
||||
addIcon("ppt", Ppt);
|
||||
addIcon("checkboxCircleLine", CheckboxCircleLine);
|
||||
addIcon("ri:admin-line", FlUser);
|
||||
addIcon("ri:admin-fill", Role);
|
||||
addIcon("ri:settings-3-line", Setting);
|
||||
addIcon("ri:git-branch-line", Dept);
|
||||
addIcon("search", Search);
|
||||
addIcon("ep:lollipop", Lollipop);
|
||||
addIcon("ep:edit", Edit);
|
||||
addIcon("ep:set-up", SetUp);
|
||||
addIcon("ep:guide", Guide);
|
||||
addIcon("ep:monitor", Monitor);
|
||||
addIcon("ep:lollipop", Lollipop);
|
||||
addIcon("ep:histogram", Histogram);
|
||||
addIcon("ep:home-filled", HomeFilled);
|
||||
// @iconify-icons/ri
|
||||
import Tag from "@iconify-icons/ri/bookmark-2-line";
|
||||
import Ppt from "@iconify-icons/ri/file-ppt-2-line";
|
||||
import Card from "@iconify-icons/ri/bank-card-line";
|
||||
import Role from "@iconify-icons/ri/admin-fill";
|
||||
import Info from "@iconify-icons/ri/file-info-line";
|
||||
import Dept from "@iconify-icons/ri/git-branch-line";
|
||||
import Table from "@iconify-icons/ri/table-line";
|
||||
import Links from "@iconify-icons/ri/links-fill";
|
||||
import Search from "@iconify-icons/ri/search-line";
|
||||
import FlUser from "@iconify-icons/ri/admin-line";
|
||||
import Setting from "@iconify-icons/ri/settings-3-line";
|
||||
import BarChart from "@iconify-icons/ri/bar-chart-horizontal-line";
|
||||
import LoginLog from "@iconify-icons/ri/window-line";
|
||||
import Artboard from "@iconify-icons/ri/artboard-line";
|
||||
import SystemLog from "@iconify-icons/ri/file-search-line";
|
||||
import ListCheck from "@iconify-icons/ri/list-check";
|
||||
import UbuntuFill from "@iconify-icons/ri/ubuntu-fill";
|
||||
import OnlineUser from "@iconify-icons/ri/user-voice-line";
|
||||
import EditBoxLine from "@iconify-icons/ri/edit-box-line";
|
||||
import OperationLog from "@iconify-icons/ri/history-fill";
|
||||
import InformationLine from "@iconify-icons/ri/information-line";
|
||||
import TerminalWindowLine from "@iconify-icons/ri/terminal-window-line";
|
||||
import CheckboxCircleLine from "@iconify-icons/ri/checkbox-circle-line";
|
||||
addIcon("ri:bookmark-2-line", Tag);
|
||||
addIcon("table", Table);
|
||||
addIcon("info", Info);
|
||||
addIcon("artboard", Artboard);
|
||||
addIcon("ri:file-ppt-2-line", Ppt);
|
||||
addIcon("ri:bank-card-line", Card);
|
||||
addIcon("ri:admin-fill", Role);
|
||||
addIcon("ri:file-info-line", Info);
|
||||
addIcon("ri:git-branch-line", Dept);
|
||||
addIcon("ri:links-fill", Links);
|
||||
addIcon("ri:table-line", Table);
|
||||
addIcon("ri:search-line", Search);
|
||||
addIcon("ri:admin-line", FlUser);
|
||||
addIcon("ri:settings-3-line", Setting);
|
||||
addIcon("ri:bar-chart-horizontal-line", BarChart);
|
||||
addIcon("ri:window-line", LoginLog);
|
||||
addIcon("ri:file-search-line", SystemLog);
|
||||
addIcon("ri:artboard-line", Artboard);
|
||||
addIcon("ri:list-check", ListCheck);
|
||||
addIcon("ri:ubuntu-fill", UbuntuFill);
|
||||
addIcon("ri:user-voice-line", OnlineUser);
|
||||
addIcon("ri:edit-box-line", EditBoxLine);
|
||||
addIcon("ri:history-fill", OperationLog);
|
||||
addIcon("ri:information-line", InformationLine);
|
||||
addIcon("ri:terminal-window-line", TerminalWindowLine);
|
||||
addIcon("ri:checkbox-circle-line", CheckboxCircleLine);
|
||||
|
||||
@@ -317,7 +317,7 @@ export default defineComponent({
|
||||
/>
|
||||
<el-checkbox
|
||||
key={item}
|
||||
label={item}
|
||||
value={item}
|
||||
onChange={value =>
|
||||
handleCheckColumnListChange(value, item)
|
||||
}
|
||||
|
||||
@@ -8,6 +8,21 @@
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.pure-segmented-block {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.pure-segmented-block .pure-segmented-item {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.pure-segmented-block .pure-segmented-item > .pure-segmented-item-label > span {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.pure-segmented-group {
|
||||
position: relative;
|
||||
display: flex;
|
||||
@@ -67,6 +82,7 @@
|
||||
.pure-segmented-item-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.pure-segmented-item-icon svg {
|
||||
|
||||
@@ -10,7 +10,12 @@ import {
|
||||
} from "vue";
|
||||
import type { OptionsType } from "./type";
|
||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||
import { isFunction, isNumber, useDark } from "@pureadmin/utils";
|
||||
import {
|
||||
isFunction,
|
||||
isNumber,
|
||||
useDark,
|
||||
useResizeObserver
|
||||
} from "@pureadmin/utils";
|
||||
|
||||
const props = {
|
||||
options: {
|
||||
@@ -22,6 +27,11 @@ const props = {
|
||||
type: undefined,
|
||||
require: false,
|
||||
default: "0"
|
||||
},
|
||||
/** 将宽度调整为父元素宽度 */
|
||||
block: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
};
|
||||
|
||||
@@ -77,6 +87,14 @@ export default defineComponent({
|
||||
});
|
||||
}
|
||||
|
||||
if (props.block) {
|
||||
useResizeObserver(".pure-segmented", () => {
|
||||
nextTick(() => {
|
||||
handleInit(curIndex.value);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
watch(
|
||||
() => curIndex.value,
|
||||
index => {
|
||||
@@ -148,7 +166,9 @@ export default defineComponent({
|
||||
};
|
||||
|
||||
return () => (
|
||||
<div class="pure-segmented">
|
||||
<div
|
||||
class={["pure-segmented", props.block ? "pure-segmented-block" : ""]}
|
||||
>
|
||||
<div class="pure-segmented-group">
|
||||
<div
|
||||
class="pure-segmented-item-selected"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import typeIt from "./src/index";
|
||||
import type { TypeItOptions } from "typeit";
|
||||
import type { Options as TypeItOptions } from "typeit";
|
||||
|
||||
const TypeIt = typeIt;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { El } from "typeit/dist/types";
|
||||
import TypeIt, { type TypeItOptions } from "typeit";
|
||||
import TypeIt, { type Options as TypeItOptions } from "typeit";
|
||||
import { ref, defineComponent, onMounted, type PropType } from "vue";
|
||||
|
||||
// 打字机效果组件(配置项详情请查阅 https://www.typeitjs.com/docs/vanilla/usage#options)
|
||||
|
||||
@@ -2,3 +2,4 @@ export * from "./auth";
|
||||
export * from "./copy";
|
||||
export * from "./longpress";
|
||||
export * from "./optimize";
|
||||
export * from "./ripple";
|
||||
|
||||
48
src/directives/ripple/index.scss
Normal file
48
src/directives/ripple/index.scss
Normal file
@@ -0,0 +1,48 @@
|
||||
/* stylelint-disable-next-line scss/dollar-variable-colon-space-after */
|
||||
$ripple-animation-transition-in:
|
||||
transform 0.4s cubic-bezier(0, 0, 0.2, 1),
|
||||
opacity 0.2s cubic-bezier(0, 0, 0.2, 1) !default;
|
||||
$ripple-animation-transition-out: opacity 0.5s cubic-bezier(0, 0, 0.2, 1) !default;
|
||||
$ripple-animation-visible-opacity: 0.25 !default;
|
||||
|
||||
.v-ripple {
|
||||
&__container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
border-radius: inherit;
|
||||
contain: strict;
|
||||
}
|
||||
|
||||
&__animation {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
background: currentcolor;
|
||||
border-radius: 50%;
|
||||
opacity: 0;
|
||||
will-change: transform, opacity;
|
||||
|
||||
&--enter {
|
||||
opacity: 0;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
&--in {
|
||||
opacity: $ripple-animation-visible-opacity;
|
||||
transition: $ripple-animation-transition-in;
|
||||
}
|
||||
|
||||
&--out {
|
||||
opacity: 0;
|
||||
transition: $ripple-animation-transition-out;
|
||||
}
|
||||
}
|
||||
}
|
||||
234
src/directives/ripple/index.ts
Normal file
234
src/directives/ripple/index.ts
Normal file
@@ -0,0 +1,234 @@
|
||||
import "./index.scss";
|
||||
import { isObject } from "@pureadmin/utils";
|
||||
import type { Directive, DirectiveBinding } from "vue";
|
||||
|
||||
interface RippleOptions {
|
||||
class?: string;
|
||||
center?: boolean;
|
||||
circle?: boolean;
|
||||
}
|
||||
|
||||
export interface RippleDirectiveBinding
|
||||
extends Omit<DirectiveBinding, "modifiers" | "value"> {
|
||||
value?: boolean | { class: string };
|
||||
modifiers: {
|
||||
center?: boolean;
|
||||
circle?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
function transform(el: HTMLElement, value: string) {
|
||||
el.style.transform = value;
|
||||
el.style.webkitTransform = value;
|
||||
}
|
||||
|
||||
const calculate = (
|
||||
e: PointerEvent,
|
||||
el: HTMLElement,
|
||||
value: RippleOptions = {}
|
||||
) => {
|
||||
const offset = el.getBoundingClientRect();
|
||||
|
||||
// 获取点击位置距离 el 的垂直和水平距离
|
||||
let localX = e.clientX - offset.left;
|
||||
let localY = e.clientY - offset.top;
|
||||
|
||||
let radius = 0;
|
||||
let scale = 0.3;
|
||||
// 计算点击位置到 el 顶点最远距离,即为圆的最大半径(勾股定理)
|
||||
if (el._ripple?.circle) {
|
||||
scale = 0.15;
|
||||
radius = el.clientWidth / 2;
|
||||
radius = value.center
|
||||
? radius
|
||||
: radius + Math.sqrt((localX - radius) ** 2 + (localY - radius) ** 2) / 4;
|
||||
} else {
|
||||
radius = Math.sqrt(el.clientWidth ** 2 + el.clientHeight ** 2) / 2;
|
||||
}
|
||||
|
||||
// 中心点坐标
|
||||
const centerX = `${(el.clientWidth - radius * 2) / 2}px`;
|
||||
const centerY = `${(el.clientHeight - radius * 2) / 2}px`;
|
||||
|
||||
// 点击位置坐标
|
||||
const x = value.center ? centerX : `${localX - radius}px`;
|
||||
const y = value.center ? centerY : `${localY - radius}px`;
|
||||
|
||||
return { radius, scale, x, y, centerX, centerY };
|
||||
};
|
||||
|
||||
const ripples = {
|
||||
show(e: PointerEvent, el: HTMLElement, value: RippleOptions = {}) {
|
||||
if (!el?._ripple?.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 创建 ripple 元素和 ripple 父元素
|
||||
const container = document.createElement("span");
|
||||
const animation = document.createElement("span");
|
||||
|
||||
container.appendChild(animation);
|
||||
container.className = "v-ripple__container";
|
||||
|
||||
if (value.class) {
|
||||
container.className += ` ${value.class}`;
|
||||
}
|
||||
|
||||
const { radius, scale, x, y, centerX, centerY } = calculate(e, el, value);
|
||||
|
||||
// ripple 圆大小
|
||||
const size = `${radius * 2}px`;
|
||||
|
||||
animation.className = "v-ripple__animation";
|
||||
animation.style.width = size;
|
||||
animation.style.height = size;
|
||||
|
||||
el.appendChild(container);
|
||||
|
||||
// 获取目标元素样式表
|
||||
const computed = window.getComputedStyle(el);
|
||||
// 防止 position 被覆盖导致 ripple 位置有问题
|
||||
if (computed && computed.position === "static") {
|
||||
el.style.position = "relative";
|
||||
el.dataset.previousPosition = "static";
|
||||
}
|
||||
|
||||
animation.classList.add("v-ripple__animation--enter");
|
||||
animation.classList.add("v-ripple__animation--visible");
|
||||
transform(
|
||||
animation,
|
||||
`translate(${x}, ${y}) scale3d(${scale},${scale},${scale})`
|
||||
);
|
||||
animation.dataset.activated = String(performance.now());
|
||||
|
||||
setTimeout(() => {
|
||||
animation.classList.remove("v-ripple__animation--enter");
|
||||
animation.classList.add("v-ripple__animation--in");
|
||||
transform(animation, `translate(${centerX}, ${centerY}) scale3d(1,1,1)`);
|
||||
}, 0);
|
||||
},
|
||||
|
||||
hide(el: HTMLElement | null) {
|
||||
if (!el?._ripple?.enabled) return;
|
||||
|
||||
const ripples = el.getElementsByClassName("v-ripple__animation");
|
||||
|
||||
if (ripples.length === 0) return;
|
||||
const animation = ripples[ripples.length - 1] as HTMLElement;
|
||||
|
||||
if (animation.dataset.isHiding) return;
|
||||
else animation.dataset.isHiding = "true";
|
||||
|
||||
const diff = performance.now() - Number(animation.dataset.activated);
|
||||
const delay = Math.max(250 - diff, 0);
|
||||
|
||||
setTimeout(() => {
|
||||
animation.classList.remove("v-ripple__animation--in");
|
||||
animation.classList.add("v-ripple__animation--out");
|
||||
|
||||
setTimeout(() => {
|
||||
const ripples = el.getElementsByClassName("v-ripple__animation");
|
||||
if (ripples.length === 1 && el.dataset.previousPosition) {
|
||||
el.style.position = el.dataset.previousPosition;
|
||||
delete el.dataset.previousPosition;
|
||||
}
|
||||
|
||||
if (animation.parentNode?.parentNode === el)
|
||||
el.removeChild(animation.parentNode);
|
||||
}, 300);
|
||||
}, delay);
|
||||
}
|
||||
};
|
||||
|
||||
function isRippleEnabled(value: any): value is true {
|
||||
return typeof value === "undefined" || !!value;
|
||||
}
|
||||
|
||||
function rippleShow(e: PointerEvent) {
|
||||
const value: RippleOptions = {};
|
||||
const element = e.currentTarget as HTMLElement | undefined;
|
||||
|
||||
if (!element?._ripple || element._ripple.touched) return;
|
||||
|
||||
value.center = element._ripple.centered;
|
||||
if (element._ripple.class) {
|
||||
value.class = element._ripple.class;
|
||||
}
|
||||
|
||||
ripples.show(e, element, value);
|
||||
}
|
||||
|
||||
function rippleHide(e: Event) {
|
||||
const element = e.currentTarget as HTMLElement | null;
|
||||
if (!element?._ripple) return;
|
||||
|
||||
window.setTimeout(() => {
|
||||
if (element._ripple) {
|
||||
element._ripple.touched = false;
|
||||
}
|
||||
});
|
||||
ripples.hide(element);
|
||||
}
|
||||
|
||||
function updateRipple(
|
||||
el: HTMLElement,
|
||||
binding: RippleDirectiveBinding,
|
||||
wasEnabled: boolean
|
||||
) {
|
||||
const { value, modifiers } = binding;
|
||||
const enabled = isRippleEnabled(value);
|
||||
if (!enabled) {
|
||||
ripples.hide(el);
|
||||
}
|
||||
|
||||
el._ripple = el._ripple ?? {};
|
||||
el._ripple.enabled = enabled;
|
||||
el._ripple.centered = modifiers.center;
|
||||
el._ripple.circle = modifiers.circle;
|
||||
if (isObject(value) && value.class) {
|
||||
el._ripple.class = value.class;
|
||||
}
|
||||
|
||||
if (enabled && !wasEnabled) {
|
||||
el.addEventListener("pointerdown", rippleShow);
|
||||
el.addEventListener("pointerup", rippleHide);
|
||||
} else if (!enabled && wasEnabled) {
|
||||
removeListeners(el);
|
||||
}
|
||||
}
|
||||
|
||||
function removeListeners(el: HTMLElement) {
|
||||
el.removeEventListener("pointerdown", rippleShow);
|
||||
el.removeEventListener("pointerup", rippleHide);
|
||||
}
|
||||
|
||||
function mounted(el: HTMLElement, binding: RippleDirectiveBinding) {
|
||||
updateRipple(el, binding, false);
|
||||
}
|
||||
|
||||
function unmounted(el: HTMLElement) {
|
||||
delete el._ripple;
|
||||
removeListeners(el);
|
||||
}
|
||||
|
||||
function updated(el: HTMLElement, binding: RippleDirectiveBinding) {
|
||||
if (binding.value === binding.oldValue) {
|
||||
return;
|
||||
}
|
||||
|
||||
const wasEnabled = isRippleEnabled(binding.oldValue);
|
||||
updateRipple(el, binding, wasEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 指令 v-ripple
|
||||
* @use 用法如下
|
||||
* 1. v-ripple 代表启用基本的 ripple 功能
|
||||
* 2. v-ripple="{ class: 'text-red' }" 代表自定义 ripple 颜色,支持 tailwindcss,生效样式是 color
|
||||
* 3. v-ripple.center 代表从中心扩散
|
||||
*/
|
||||
export const Ripple: Directive = {
|
||||
mounted,
|
||||
unmounted,
|
||||
updated
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import Footer from "./footer/index.vue";
|
||||
import { useGlobal } from "@pureadmin/utils";
|
||||
import { useGlobal, isNumber } from "@pureadmin/utils";
|
||||
import KeepAliveFrame from "./keepAliveFrame/index.vue";
|
||||
import backTop from "@/assets/svg/back_top.svg?component";
|
||||
import { h, computed, Transition, defineComponent } from "vue";
|
||||
@@ -30,16 +30,28 @@ const hideFooter = computed(() => {
|
||||
return $storage?.configure.hideFooter;
|
||||
});
|
||||
|
||||
const stretch = computed(() => {
|
||||
return $storage?.configure.stretch;
|
||||
});
|
||||
|
||||
const layout = computed(() => {
|
||||
return $storage?.layout.layout === "vertical";
|
||||
});
|
||||
|
||||
const getMainWidth = computed(() => {
|
||||
return isNumber(stretch.value)
|
||||
? stretch.value + "px"
|
||||
: stretch.value
|
||||
? "1440px"
|
||||
: "100%";
|
||||
});
|
||||
|
||||
const getSectionStyle = computed(() => {
|
||||
return [
|
||||
hideTabs.value && layout ? "padding-top: 48px;" : "",
|
||||
!hideTabs.value && layout ? "padding-top: 85px;" : "",
|
||||
!hideTabs.value && layout ? "padding-top: 81px;" : "",
|
||||
hideTabs.value && !layout.value ? "padding-top: 48px;" : "",
|
||||
!hideTabs.value && !layout.value ? "padding-top: 85px;" : "",
|
||||
!hideTabs.value && !layout.value ? "padding-top: 81px;" : "",
|
||||
props.fixedHeader
|
||||
? ""
|
||||
: `padding-top: 0;${
|
||||
@@ -96,12 +108,15 @@ const transitionMain = defineComponent({
|
||||
v-if="props.fixedHeader"
|
||||
:wrap-style="{
|
||||
display: 'flex',
|
||||
'flex-wrap': 'wrap'
|
||||
'flex-wrap': 'wrap',
|
||||
'max-width': getMainWidth,
|
||||
margin: '0 auto',
|
||||
transition: 'all 300ms cubic-bezier(0.4, 0, 0.2, 1)'
|
||||
}"
|
||||
:view-style="{
|
||||
display: 'flex',
|
||||
flex: 'auto',
|
||||
overflow: 'auto',
|
||||
overflow: 'hidden',
|
||||
'flex-direction': 'column'
|
||||
}"
|
||||
>
|
||||
|
||||
@@ -3,6 +3,7 @@ import Search from "./search/index.vue";
|
||||
import Notice from "./notice/index.vue";
|
||||
import mixNav from "./sidebar/mixNav.vue";
|
||||
import { useNav } from "@/layout/hooks/useNav";
|
||||
import FullScreen from "./sidebar/fullScreen.vue";
|
||||
import Breadcrumb from "./sidebar/breadCrumb.vue";
|
||||
import topCollapse from "./sidebar/topCollapse.vue";
|
||||
import { useTranslationLang } from "../hooks/useTranslationLang";
|
||||
@@ -10,7 +11,6 @@ import globalization from "@/assets/svg/globalization.svg?component";
|
||||
import LogoutCircleRLine from "@iconify-icons/ri/logout-circle-r-line";
|
||||
import Setting from "@iconify-icons/ri/settings-3-line";
|
||||
import Check from "@iconify-icons/ep/check";
|
||||
|
||||
const {
|
||||
layout,
|
||||
device,
|
||||
@@ -47,8 +47,6 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
|
||||
<div v-if="layout === 'vertical'" class="vertical-header-right">
|
||||
<!-- 菜单搜索 -->
|
||||
<Search id="header-search" />
|
||||
<!-- 通知 -->
|
||||
<Notice id="header-notice" />
|
||||
<!-- 国际化 -->
|
||||
<el-dropdown id="header-translation" trigger="click">
|
||||
<globalization
|
||||
@@ -81,6 +79,10 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<!-- 全屏 -->
|
||||
<FullScreen id="full-screen" />
|
||||
<!-- 消息通知 -->
|
||||
<Notice id="header-notice" />
|
||||
<!-- 退出登录 -->
|
||||
<el-dropdown trigger="click">
|
||||
<span class="el-dropdown-link navbar-bg-hover select-none">
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import ArrowUpLine from "@iconify-icons/ri/arrow-up-line";
|
||||
import ArrowDownLine from "@iconify-icons/ri/arrow-down-line";
|
||||
import { useNav } from "@/layout/hooks/useNav";
|
||||
import mdiKeyboardEsc from "@/assets/svg/keyboard_esc.svg?component";
|
||||
import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
|
||||
import ArrowUpLine from "@iconify-icons/ri/arrow-up-line";
|
||||
import ArrowDownLine from "@iconify-icons/ri/arrow-down-line";
|
||||
|
||||
const props = withDefaults(defineProps<{ total: number }>(), {
|
||||
total: 0
|
||||
|
||||
198
src/layout/components/search/components/SearchHistory.vue
Normal file
198
src/layout/components/search/components/SearchHistory.vue
Normal file
@@ -0,0 +1,198 @@
|
||||
<script setup lang="ts">
|
||||
import Sortable from "sortablejs";
|
||||
import SearchHistoryItem from "./SearchHistoryItem.vue";
|
||||
import type { optionsItem, dragItem, Props } from "../types";
|
||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||
import { useResizeObserver, isArray, delay } from "@pureadmin/utils";
|
||||
import { ref, watch, nextTick, computed, getCurrentInstance } from "vue";
|
||||
|
||||
interface Emits {
|
||||
(e: "update:value", val: string): void;
|
||||
(e: "enter"): void;
|
||||
(e: "collect", val: optionsItem): void;
|
||||
(e: "delete", val: optionsItem): void;
|
||||
(e: "drag", val: dragItem): void;
|
||||
}
|
||||
|
||||
const historyRef = ref();
|
||||
const innerHeight = ref();
|
||||
/** 判断是否停止鼠标移入事件处理 */
|
||||
const stopMouseEvent = ref(false);
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
const instance = getCurrentInstance()!;
|
||||
const props = withDefaults(defineProps<Props>(), {});
|
||||
|
||||
const itemStyle = computed(() => {
|
||||
return item => {
|
||||
return {
|
||||
background:
|
||||
item?.path === active.value ? useEpThemeStoreHook().epThemeColor : "",
|
||||
color: item.path === active.value ? "#fff" : "",
|
||||
fontSize: item.path === active.value ? "16px" : "14px"
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
const titleStyle = computed(() => {
|
||||
return {
|
||||
color: useEpThemeStoreHook().epThemeColor,
|
||||
fontWeight: 500
|
||||
};
|
||||
});
|
||||
|
||||
const active = computed({
|
||||
get() {
|
||||
return props.value;
|
||||
},
|
||||
set(val: string) {
|
||||
emit("update:value", val);
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
newValue => {
|
||||
if (newValue) {
|
||||
if (stopMouseEvent.value) {
|
||||
delay(100).then(() => (stopMouseEvent.value = false));
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const historyList = computed(() => {
|
||||
return props.options.filter(item => item.type === "history");
|
||||
});
|
||||
|
||||
const collectList = computed(() => {
|
||||
return props.options.filter(item => item.type === "collect");
|
||||
});
|
||||
|
||||
function handleCollect(item) {
|
||||
emit("collect", item);
|
||||
}
|
||||
|
||||
function handleDelete(item) {
|
||||
stopMouseEvent.value = true;
|
||||
emit("delete", item);
|
||||
}
|
||||
|
||||
/** 鼠标移入 */
|
||||
async function handleMouse(item) {
|
||||
if (!stopMouseEvent.value) active.value = item.path;
|
||||
}
|
||||
|
||||
function handleTo() {
|
||||
emit("enter");
|
||||
}
|
||||
|
||||
function resizeResult() {
|
||||
// el-scrollbar max-height="calc(90vh - 140px)"
|
||||
innerHeight.value = window.innerHeight - window.innerHeight / 10 - 140;
|
||||
}
|
||||
|
||||
useResizeObserver(historyRef, resizeResult);
|
||||
|
||||
function handleScroll(index: number) {
|
||||
const curInstance = instance?.proxy?.$refs[`historyItemRef${index}`];
|
||||
if (!curInstance) return 0;
|
||||
const curRef = isArray(curInstance)
|
||||
? (curInstance[0] as ElRef)
|
||||
: (curInstance as ElRef);
|
||||
const scrollTop = curRef.offsetTop + 128; // 128 两个history-item(56px+56px=112px)高度加上下margin(8px+8px=16px)
|
||||
return scrollTop > innerHeight.value ? scrollTop - innerHeight.value : 0;
|
||||
}
|
||||
|
||||
const handleChangeIndex = (evt): void => {
|
||||
emit("drag", { oldIndex: evt.oldIndex, newIndex: evt.newIndex });
|
||||
};
|
||||
|
||||
let sortableInstance = null;
|
||||
|
||||
watch(
|
||||
collectList,
|
||||
val => {
|
||||
if (val.length > 1) {
|
||||
nextTick(() => {
|
||||
const wrapper: HTMLElement =
|
||||
document.querySelector(".collect-container");
|
||||
if (!wrapper || sortableInstance) return;
|
||||
sortableInstance = Sortable.create(wrapper, {
|
||||
animation: 160,
|
||||
onStart: event => {
|
||||
event.item.style.cursor = "move";
|
||||
},
|
||||
onEnd: event => {
|
||||
event.item.style.cursor = "pointer";
|
||||
},
|
||||
onUpdate: handleChangeIndex
|
||||
});
|
||||
resizeResult();
|
||||
});
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
defineExpose({ handleScroll });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="historyRef" class="history">
|
||||
<template v-if="historyList.length">
|
||||
<div :style="titleStyle">搜索历史</div>
|
||||
<div
|
||||
v-for="(item, index) in historyList"
|
||||
:key="item.path"
|
||||
:ref="'historyItemRef' + index"
|
||||
class="history-item dark:bg-[#1d1d1d]"
|
||||
:style="itemStyle(item)"
|
||||
@click="handleTo"
|
||||
@mouseenter="handleMouse(item)"
|
||||
>
|
||||
<SearchHistoryItem
|
||||
:item="item"
|
||||
@delete-item="handleDelete"
|
||||
@collect-item="handleCollect"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="collectList.length">
|
||||
<div :style="titleStyle">
|
||||
收藏{{ collectList.length > 1 ? "(可拖拽排序)" : "" }}
|
||||
</div>
|
||||
<div class="collect-container">
|
||||
<div
|
||||
v-for="(item, index) in collectList"
|
||||
:key="item.path"
|
||||
:ref="'historyItemRef' + (index + historyList.length)"
|
||||
class="history-item dark:bg-[#1d1d1d]"
|
||||
:style="itemStyle(item)"
|
||||
@click="handleTo"
|
||||
@mouseenter="handleMouse(item)"
|
||||
>
|
||||
<SearchHistoryItem :item="item" @delete-item="handleDelete" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.history {
|
||||
padding-bottom: 12px;
|
||||
|
||||
&-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 56px;
|
||||
padding: 14px;
|
||||
margin: 8px auto 10px;
|
||||
cursor: pointer;
|
||||
border: 0.1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
transition: font-size 0.16s;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,53 @@
|
||||
<script setup lang="ts">
|
||||
import type { optionsItem } from "../types";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||
import Star from "@iconify-icons/ep/star";
|
||||
import Close from "@iconify-icons/ep/close";
|
||||
|
||||
interface Props {
|
||||
item: optionsItem;
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: "collectItem", val: optionsItem): void;
|
||||
(e: "deleteItem", val: optionsItem): void;
|
||||
}
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
withDefaults(defineProps<Props>(), {});
|
||||
|
||||
function handleCollect(item) {
|
||||
emit("collectItem", item);
|
||||
}
|
||||
|
||||
function handleDelete(item) {
|
||||
emit("deleteItem", item);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component :is="useRenderIcon(item.meta?.icon)" />
|
||||
<span class="history-item-title">
|
||||
{{ transformI18n(item.meta?.title) }}
|
||||
</span>
|
||||
<IconifyIconOffline
|
||||
v-show="item.type === 'history'"
|
||||
:icon="Star"
|
||||
class="w-[18px] h-[18px] mr-2 hover:text-[#d7d5d4]"
|
||||
@click.stop="handleCollect(item)"
|
||||
/>
|
||||
<IconifyIconOffline
|
||||
:icon="Close"
|
||||
class="w-[18px] h-[18px] hover:text-[#d7d5d4] cursor-pointer"
|
||||
@click.stop="handleDelete(item)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.history-item-title {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,15 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import { match } from "pinyin-pro";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { getConfig } from "@/config";
|
||||
import { useRouter } from "vue-router";
|
||||
import SearchResult from "./SearchResult.vue";
|
||||
import SearchFooter from "./SearchFooter.vue";
|
||||
import { useNav } from "@/layout/hooks/useNav";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
import { ref, computed, shallowRef } from "vue";
|
||||
import { cloneDeep, isAllEmpty } from "@pureadmin/utils";
|
||||
import SearchHistory from "./SearchHistory.vue";
|
||||
import type { optionsItem, dragItem } from "../types";
|
||||
import { ref, computed, shallowRef, watch } from "vue";
|
||||
import { useDebounceFn, onKeyStroke } from "@vueuse/core";
|
||||
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||
import { cloneDeep, isAllEmpty, storageLocal } from "@pureadmin/utils";
|
||||
import Search from "@iconify-icons/ri/search-line";
|
||||
|
||||
interface Props {
|
||||
@@ -24,16 +27,26 @@ interface Emits {
|
||||
const { device } = useNav();
|
||||
const emit = defineEmits<Emits>();
|
||||
const props = withDefaults(defineProps<Props>(), {});
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = useI18n();
|
||||
|
||||
const HISTORY_TYPE = "history";
|
||||
const COLLECT_TYPE = "collect";
|
||||
const LOCALEHISTORYKEY = "menu-search-history";
|
||||
const LOCALECOLLECTKEY = "menu-search-collect";
|
||||
|
||||
const keyword = ref("");
|
||||
const scrollbarRef = ref();
|
||||
const resultRef = ref();
|
||||
const historyRef = ref();
|
||||
const scrollbarRef = ref();
|
||||
const activePath = ref("");
|
||||
const inputRef = ref<HTMLInputElement | null>(null);
|
||||
const historyPath = ref("");
|
||||
const resultOptions = shallowRef([]);
|
||||
const historyOptions = shallowRef([]);
|
||||
const handleSearch = useDebounceFn(search, 300);
|
||||
const historyNum = getConfig().MenuSearchHistory;
|
||||
const inputRef = ref<HTMLInputElement | null>(null);
|
||||
|
||||
/** 菜单树形结构 */
|
||||
const menusData = computed(() => {
|
||||
@@ -49,6 +62,36 @@ const show = computed({
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
newValue => {
|
||||
if (newValue) getHistory();
|
||||
}
|
||||
);
|
||||
|
||||
const showSearchResult = computed(() => {
|
||||
return keyword.value && resultOptions.value.length > 0;
|
||||
});
|
||||
|
||||
const showSearchHistory = computed(() => {
|
||||
return !keyword.value && historyOptions.value.length > 0;
|
||||
});
|
||||
|
||||
const showEmpty = computed(() => {
|
||||
return (
|
||||
(!keyword.value && historyOptions.value.length === 0) ||
|
||||
(keyword.value && resultOptions.value.length === 0)
|
||||
);
|
||||
});
|
||||
|
||||
function getStorageItem(key) {
|
||||
return storageLocal().getItem<optionsItem[]>(key) || [];
|
||||
}
|
||||
|
||||
function setStorageItem(key, value) {
|
||||
storageLocal().setItem(key, value);
|
||||
}
|
||||
|
||||
/** 将菜单树形结构扁平化为一维数组,用于菜单查询 */
|
||||
function flatTree(arr) {
|
||||
const res = [];
|
||||
@@ -79,11 +122,8 @@ function search() {
|
||||
))
|
||||
: false
|
||||
);
|
||||
if (resultOptions.value?.length > 0) {
|
||||
activePath.value = resultOptions.value[0].path;
|
||||
} else {
|
||||
activePath.value = "";
|
||||
}
|
||||
activePath.value =
|
||||
resultOptions.value?.length > 0 ? resultOptions.value[0].path : "";
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
@@ -91,54 +131,143 @@ function handleClose() {
|
||||
/** 延时处理防止用户看到某些操作 */
|
||||
setTimeout(() => {
|
||||
resultOptions.value = [];
|
||||
historyPath.value = "";
|
||||
keyword.value = "";
|
||||
}, 200);
|
||||
}
|
||||
|
||||
function scrollTo(index) {
|
||||
const scrollTop = resultRef.value.handleScroll(index);
|
||||
const ref = resultOptions.value.length ? resultRef.value : historyRef.value;
|
||||
const scrollTop = ref.handleScroll(index);
|
||||
scrollbarRef.value.setScrollTop(scrollTop);
|
||||
}
|
||||
|
||||
/** 获取当前选项和路径 */
|
||||
function getCurrentOptionsAndPath() {
|
||||
const isResultOptions = resultOptions.value.length > 0;
|
||||
const options = isResultOptions ? resultOptions.value : historyOptions.value;
|
||||
const currentPath = isResultOptions ? activePath.value : historyPath.value;
|
||||
return { options, currentPath, isResultOptions };
|
||||
}
|
||||
|
||||
/** 更新路径并滚动到指定项 */
|
||||
function updatePathAndScroll(newIndex, isResultOptions) {
|
||||
if (isResultOptions) {
|
||||
activePath.value = resultOptions.value[newIndex].path;
|
||||
} else {
|
||||
historyPath.value = historyOptions.value[newIndex].path;
|
||||
}
|
||||
scrollTo(newIndex);
|
||||
}
|
||||
|
||||
/** key up */
|
||||
function handleUp() {
|
||||
const { length } = resultOptions.value;
|
||||
if (length === 0) return;
|
||||
const index = resultOptions.value.findIndex(
|
||||
item => item.path === activePath.value
|
||||
);
|
||||
if (index === 0) {
|
||||
activePath.value = resultOptions.value[length - 1].path;
|
||||
scrollTo(resultOptions.value.length - 1);
|
||||
} else {
|
||||
activePath.value = resultOptions.value[index - 1].path;
|
||||
scrollTo(index - 1);
|
||||
}
|
||||
const { options, currentPath, isResultOptions } = getCurrentOptionsAndPath();
|
||||
if (options.length === 0) return;
|
||||
const index = options.findIndex(item => item.path === currentPath);
|
||||
const prevIndex = (index - 1 + options.length) % options.length;
|
||||
updatePathAndScroll(prevIndex, isResultOptions);
|
||||
}
|
||||
|
||||
/** key down */
|
||||
function handleDown() {
|
||||
const { length } = resultOptions.value;
|
||||
if (length === 0) return;
|
||||
const index = resultOptions.value.findIndex(
|
||||
item => item.path === activePath.value
|
||||
);
|
||||
if (index + 1 === length) {
|
||||
activePath.value = resultOptions.value[0].path;
|
||||
} else {
|
||||
activePath.value = resultOptions.value[index + 1].path;
|
||||
}
|
||||
scrollTo(index + 1);
|
||||
const { options, currentPath, isResultOptions } = getCurrentOptionsAndPath();
|
||||
if (options.length === 0) return;
|
||||
const index = options.findIndex(item => item.path === currentPath);
|
||||
const nextIndex = (index + 1) % options.length;
|
||||
updatePathAndScroll(nextIndex, isResultOptions);
|
||||
}
|
||||
|
||||
/** key enter */
|
||||
function handleEnter() {
|
||||
const { length } = resultOptions.value;
|
||||
if (length === 0 || activePath.value === "") return;
|
||||
router.push(activePath.value);
|
||||
const { options, currentPath, isResultOptions } = getCurrentOptionsAndPath();
|
||||
if (options.length === 0 || currentPath === "") return;
|
||||
const index = options.findIndex(item => item.path === currentPath);
|
||||
if (index === -1) return;
|
||||
if (isResultOptions) {
|
||||
saveHistory();
|
||||
} else {
|
||||
updateHistory();
|
||||
}
|
||||
router.push(options[index].path);
|
||||
handleClose();
|
||||
}
|
||||
|
||||
/** 删除历史记录 */
|
||||
function handleDelete(item) {
|
||||
const key = item.type === HISTORY_TYPE ? LOCALEHISTORYKEY : LOCALECOLLECTKEY;
|
||||
let list = getStorageItem(key);
|
||||
list = list.filter(listItem => listItem.path !== item.path);
|
||||
setStorageItem(key, list);
|
||||
getHistory();
|
||||
}
|
||||
|
||||
/** 收藏历史记录 */
|
||||
function handleCollect(item) {
|
||||
let searchHistoryList = getStorageItem(LOCALEHISTORYKEY);
|
||||
let searchCollectList = getStorageItem(LOCALECOLLECTKEY);
|
||||
searchHistoryList = searchHistoryList.filter(
|
||||
historyItem => historyItem.path !== item.path
|
||||
);
|
||||
setStorageItem(LOCALEHISTORYKEY, searchHistoryList);
|
||||
if (!searchCollectList.some(collectItem => collectItem.path === item.path)) {
|
||||
searchCollectList.unshift({ ...item, type: COLLECT_TYPE });
|
||||
setStorageItem(LOCALECOLLECTKEY, searchCollectList);
|
||||
}
|
||||
getHistory();
|
||||
}
|
||||
|
||||
/** 存储搜索记录 */
|
||||
function saveHistory() {
|
||||
const { path, meta } = resultOptions.value.find(
|
||||
item => item.path === activePath.value
|
||||
);
|
||||
const searchHistoryList = getStorageItem(LOCALEHISTORYKEY);
|
||||
const searchCollectList = getStorageItem(LOCALECOLLECTKEY);
|
||||
const isCollected = searchCollectList.some(item => item.path === path);
|
||||
const existingIndex = searchHistoryList.findIndex(item => item.path === path);
|
||||
if (!isCollected) {
|
||||
if (existingIndex !== -1) searchHistoryList.splice(existingIndex, 1);
|
||||
if (searchHistoryList.length >= historyNum) searchHistoryList.pop();
|
||||
searchHistoryList.unshift({ path, meta, type: HISTORY_TYPE });
|
||||
storageLocal().setItem(LOCALEHISTORYKEY, searchHistoryList);
|
||||
}
|
||||
}
|
||||
|
||||
/** 更新存储的搜索记录 */
|
||||
function updateHistory() {
|
||||
let searchHistoryList = getStorageItem(LOCALEHISTORYKEY);
|
||||
const historyIndex = searchHistoryList.findIndex(
|
||||
item => item.path === historyPath.value
|
||||
);
|
||||
if (historyIndex !== -1) {
|
||||
const [historyItem] = searchHistoryList.splice(historyIndex, 1);
|
||||
searchHistoryList.unshift(historyItem);
|
||||
setStorageItem(LOCALEHISTORYKEY, searchHistoryList);
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取本地历史记录 */
|
||||
function getHistory() {
|
||||
const searchHistoryList = getStorageItem(LOCALEHISTORYKEY);
|
||||
const searchCollectList = getStorageItem(LOCALECOLLECTKEY);
|
||||
historyOptions.value = [...searchHistoryList, ...searchCollectList];
|
||||
historyPath.value = historyOptions.value[0]?.path;
|
||||
}
|
||||
|
||||
/** 拖拽改变收藏顺序 */
|
||||
function handleDrag(item: dragItem) {
|
||||
const searchCollectList = getStorageItem(LOCALECOLLECTKEY);
|
||||
const [reorderedItem] = searchCollectList.splice(item.oldIndex, 1);
|
||||
searchCollectList.splice(item.newIndex, 0, reorderedItem);
|
||||
storageLocal().setItem(LOCALECOLLECTKEY, searchCollectList);
|
||||
historyOptions.value = [
|
||||
...getStorageItem(LOCALEHISTORYKEY),
|
||||
...getStorageItem(LOCALECOLLECTKEY)
|
||||
];
|
||||
historyPath.value = reorderedItem.path;
|
||||
}
|
||||
|
||||
onKeyStroke("Enter", handleEnter);
|
||||
onKeyStroke("ArrowUp", handleUp);
|
||||
onKeyStroke("ArrowDown", handleDown);
|
||||
@@ -174,14 +303,21 @@ onKeyStroke("ArrowDown", handleDown);
|
||||
/>
|
||||
</template>
|
||||
</el-input>
|
||||
<div class="search-result-container">
|
||||
<div class="search-content">
|
||||
<el-scrollbar ref="scrollbarRef" max-height="calc(90vh - 140px)">
|
||||
<el-empty
|
||||
v-if="resultOptions.length === 0"
|
||||
description="暂无搜索结果"
|
||||
<el-empty v-if="showEmpty" description="暂无搜索结果" />
|
||||
<SearchHistory
|
||||
v-if="showSearchHistory"
|
||||
ref="historyRef"
|
||||
v-model:value="historyPath"
|
||||
:options="historyOptions"
|
||||
@click="handleEnter"
|
||||
@delete="handleDelete"
|
||||
@collect="handleCollect"
|
||||
@drag="handleDrag"
|
||||
/>
|
||||
<SearchResult
|
||||
v-else
|
||||
v-if="showSearchResult"
|
||||
ref="resultRef"
|
||||
v-model:value="activePath"
|
||||
:options="resultOptions"
|
||||
@@ -196,7 +332,7 @@ onKeyStroke("ArrowDown", handleDown);
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.search-result-container {
|
||||
.search-content {
|
||||
margin-top: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,24 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { Props } from "../types";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
import { useResizeObserver } from "@pureadmin/utils";
|
||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||
import { ref, computed, getCurrentInstance, onMounted } from "vue";
|
||||
import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
|
||||
import Bookmark2Line from "@iconify-icons/ri/bookmark-2-line";
|
||||
|
||||
interface optionsItem {
|
||||
path: string;
|
||||
meta?: {
|
||||
icon?: string;
|
||||
title?: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface Props {
|
||||
value: string;
|
||||
options: Array<optionsItem>;
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: "update:value", val: string): void;
|
||||
@@ -27,9 +14,9 @@ interface Emits {
|
||||
|
||||
const resultRef = ref();
|
||||
const innerHeight = ref();
|
||||
const props = withDefaults(defineProps<Props>(), {});
|
||||
const emit = defineEmits<Emits>();
|
||||
const instance = getCurrentInstance()!;
|
||||
const props = withDefaults(defineProps<Props>(), {});
|
||||
|
||||
const itemStyle = computed(() => {
|
||||
return item => {
|
||||
@@ -93,7 +80,7 @@ defineExpose({ handleScroll });
|
||||
@click="handleTo"
|
||||
@mouseenter="handleMouse(item)"
|
||||
>
|
||||
<component :is="useRenderIcon(item.meta?.icon ?? Bookmark2Line)" />
|
||||
<component :is="useRenderIcon(item.meta?.icon)" />
|
||||
<span class="result-item-title">
|
||||
{{ transformI18n(item.meta?.title) }}
|
||||
</span>
|
||||
|
||||
@@ -14,7 +14,7 @@ function handleSearch() {
|
||||
class="search-container w-[40px] h-[48px] flex-c cursor-pointer navbar-bg-hover"
|
||||
@click="handleSearch"
|
||||
>
|
||||
<IconifyIconOffline icon="search" />
|
||||
<IconifyIconOffline icon="ri:search-line" />
|
||||
</div>
|
||||
<SearchModal v-model:value="show" />
|
||||
</div>
|
||||
|
||||
20
src/layout/components/search/types.ts
Normal file
20
src/layout/components/search/types.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
interface optionsItem {
|
||||
path: string;
|
||||
type: "history" | "collect";
|
||||
meta: {
|
||||
icon?: string;
|
||||
title?: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface dragItem {
|
||||
oldIndex: number;
|
||||
newIndex: number;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
value: string;
|
||||
options: Array<optionsItem>;
|
||||
}
|
||||
|
||||
export type { optionsItem, dragItem, Props };
|
||||
@@ -13,13 +13,15 @@ import panel from "../panel/index.vue";
|
||||
import { emitter } from "@/utils/mitt";
|
||||
import { useNav } from "@/layout/hooks/useNav";
|
||||
import { useAppStoreHook } from "@/store/modules/app";
|
||||
import { useDark, debounce, useGlobal } from "@pureadmin/utils";
|
||||
import { toggleTheme } from "@pureadmin/theme/dist/browser-utils";
|
||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||
import Segmented, { type OptionsType } from "@/components/ReSegmented";
|
||||
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
|
||||
import { useDark, useGlobal, debounce, isNumber } from "@pureadmin/utils";
|
||||
|
||||
import Check from "@iconify-icons/ep/check";
|
||||
import LeftArrow from "@iconify-icons/ri/arrow-left-s-line";
|
||||
import RightArrow from "@iconify-icons/ri/arrow-right-s-line";
|
||||
import dayIcon from "@/assets/svg/day.svg?component";
|
||||
import darkIcon from "@/assets/svg/dark.svg?component";
|
||||
import systemIcon from "@/assets/svg/system.svg?component";
|
||||
@@ -64,7 +66,8 @@ const settings = reactive({
|
||||
showLogo: $storage.configure.showLogo,
|
||||
showModel: $storage.configure.showModel,
|
||||
hideFooter: $storage.configure.hideFooter,
|
||||
multiTagsCache: $storage.configure.multiTagsCache
|
||||
multiTagsCache: $storage.configure.multiTagsCache,
|
||||
stretch: $storage.configure.stretch
|
||||
});
|
||||
|
||||
const getThemeColorStyle = computed(() => {
|
||||
@@ -88,17 +91,15 @@ function storageConfigureChange<T>(key: string, val: T): void {
|
||||
|
||||
/** 灰色模式设置 */
|
||||
const greyChange = (value): void => {
|
||||
toggleClass(settings.greyVal, "html-grey", document.querySelector("html"));
|
||||
const htmlEl = document.querySelector("html");
|
||||
toggleClass(settings.greyVal, "html-grey", htmlEl);
|
||||
storageConfigureChange("grey", value);
|
||||
};
|
||||
|
||||
/** 色弱模式设置 */
|
||||
const weekChange = (value): void => {
|
||||
toggleClass(
|
||||
settings.weakVal,
|
||||
"html-weakness",
|
||||
document.querySelector("html")
|
||||
);
|
||||
const htmlEl = document.querySelector("html");
|
||||
toggleClass(settings.weakVal, "html-weakness", htmlEl);
|
||||
storageConfigureChange("weak", value);
|
||||
};
|
||||
|
||||
@@ -143,6 +144,30 @@ function setFalse(Doms): any {
|
||||
});
|
||||
}
|
||||
|
||||
/** 页宽 */
|
||||
const stretchTypeOptions: Array<OptionsType> = [
|
||||
{
|
||||
label: "固定",
|
||||
tip: "紧凑页面,轻松找到所需信息",
|
||||
value: "fixed"
|
||||
},
|
||||
{
|
||||
label: "自定义",
|
||||
tip: "最小1280、最大1600",
|
||||
value: "custom"
|
||||
}
|
||||
];
|
||||
|
||||
const setStretch = value => {
|
||||
settings.stretch = value;
|
||||
storageConfigureChange("stretch", value);
|
||||
};
|
||||
|
||||
const stretchTypeChange = ({ option }) => {
|
||||
const { value } = option;
|
||||
value === "custom" ? setStretch(1440) : setStretch(false);
|
||||
};
|
||||
|
||||
/** 主题色 激活选择项 */
|
||||
const getThemeColor = computed(() => {
|
||||
return current => {
|
||||
@@ -162,6 +187,10 @@ const getThemeColor = computed(() => {
|
||||
};
|
||||
});
|
||||
|
||||
const pClass = computed(() => {
|
||||
return ["mb-[12px]", "font-medium", "text-sm", "dark:text-white"];
|
||||
});
|
||||
|
||||
const themeOptions = computed<Array<OptionsType>>(() => {
|
||||
return [
|
||||
{
|
||||
@@ -266,9 +295,9 @@ onBeforeMount(() => {
|
||||
nextTick(() => {
|
||||
watchSystemThemeChange();
|
||||
settings.greyVal &&
|
||||
document.querySelector("html")?.setAttribute("class", "html-grey");
|
||||
document.querySelector("html")?.classList.add("html-grey");
|
||||
settings.weakVal &&
|
||||
document.querySelector("html")?.setAttribute("class", "html-weakness");
|
||||
document.querySelector("html")?.classList.add("html-weakness");
|
||||
settings.tabsVal && tagsChange();
|
||||
settings.hideFooter && hideFooterChange();
|
||||
});
|
||||
@@ -279,8 +308,8 @@ onUnmounted(() => removeMatchMedia);
|
||||
|
||||
<template>
|
||||
<panel>
|
||||
<div class="p-6">
|
||||
<p class="mb-3 font-medium text-sm dark:text-white">整体风格</p>
|
||||
<div class="p-5">
|
||||
<p :class="pClass">整体风格</p>
|
||||
<Segmented
|
||||
class="select-none"
|
||||
:modelValue="overallStyle === 'system' ? 2 : dataTheme ? 1 : 0"
|
||||
@@ -297,7 +326,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
"
|
||||
/>
|
||||
|
||||
<p class="mt-5 mb-3 font-medium text-sm dark:text-white">主题色</p>
|
||||
<p :class="['mt-5', pClass]">主题色</p>
|
||||
<ul class="theme-color">
|
||||
<li
|
||||
v-for="(item, index) in themeColors"
|
||||
@@ -316,7 +345,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p class="mt-5 mb-3 font-medium text-sm dark:text-white">导航模式</p>
|
||||
<p :class="['mt-5', pClass]">导航模式</p>
|
||||
<ul class="pure-theme">
|
||||
<li
|
||||
ref="verticalRef"
|
||||
@@ -358,7 +387,50 @@ onUnmounted(() => removeMatchMedia);
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p class="mt-5 mb-3 font-medium text-base dark:text-white">页签风格</p>
|
||||
<span v-if="device !== 'mobile'">
|
||||
<p :class="['mt-5', pClass]">页宽</p>
|
||||
<Segmented
|
||||
class="mb-2 select-none"
|
||||
:modelValue="isNumber(settings.stretch) ? 1 : 0"
|
||||
:options="stretchTypeOptions"
|
||||
@change="stretchTypeChange"
|
||||
/>
|
||||
<el-input-number
|
||||
v-if="isNumber(settings.stretch)"
|
||||
v-model="settings.stretch as number"
|
||||
:min="1280"
|
||||
:max="1600"
|
||||
controls-position="right"
|
||||
@change="value => setStretch(value)"
|
||||
/>
|
||||
<button
|
||||
v-else
|
||||
v-ripple="{ class: 'text-gray-300' }"
|
||||
class="bg-transparent flex-c w-full h-20 rounded-md border border-gray-100"
|
||||
@click="setStretch(!settings.stretch)"
|
||||
>
|
||||
<div
|
||||
class="flex-bc transition-all duration-300"
|
||||
:class="[settings.stretch ? 'w-[24%]' : 'w-[50%]']"
|
||||
style="color: var(--el-color-primary)"
|
||||
>
|
||||
<IconifyIconOffline
|
||||
:icon="settings.stretch ? RightArrow : LeftArrow"
|
||||
height="20"
|
||||
/>
|
||||
<div
|
||||
class="flex-grow border-b border-dashed"
|
||||
style="border-color: var(--el-color-primary)"
|
||||
/>
|
||||
<IconifyIconOffline
|
||||
:icon="settings.stretch ? LeftArrow : RightArrow"
|
||||
height="20"
|
||||
/>
|
||||
</div>
|
||||
</button>
|
||||
</span>
|
||||
|
||||
<p :class="['mt-4', pClass]">页签风格</p>
|
||||
<Segmented
|
||||
class="select-none"
|
||||
:modelValue="markValue === 'smart' ? 0 : 1"
|
||||
@@ -366,7 +438,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
@change="onChange"
|
||||
/>
|
||||
|
||||
<p class="mt-5 mb-1 font-medium text-sm dark:text-white">界面显示</p>
|
||||
<p class="mt-5 font-medium text-sm dark:text-white">界面显示</p>
|
||||
<ul class="setting">
|
||||
<li>
|
||||
<span class="dark:text-white">灰色模式</span>
|
||||
@@ -545,7 +617,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 4px 0;
|
||||
padding: 3px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
70
src/layout/components/sidebar/centerCollapse.vue
Normal file
70
src/layout/components/sidebar/centerCollapse.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { useGlobal } from "@pureadmin/utils";
|
||||
import { useNav } from "@/layout/hooks/useNav";
|
||||
|
||||
import ArrowLeft from "@iconify-icons/ri/arrow-left-double-fill";
|
||||
|
||||
interface Props {
|
||||
isActive: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
isActive: false
|
||||
});
|
||||
|
||||
const { tooltipEffect } = useNav();
|
||||
|
||||
const iconClass = computed(() => {
|
||||
return ["w-[16px]", "h-[16px]"];
|
||||
});
|
||||
|
||||
const { $storage } = useGlobal<GlobalPropertiesApi>();
|
||||
const themeColor = computed(() => $storage.layout?.themeColor);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "toggleClick"): void;
|
||||
}>();
|
||||
|
||||
const toggleClick = () => {
|
||||
emit("toggleClick");
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
v-tippy="{
|
||||
content: props.isActive ? '点击折叠' : '点击展开',
|
||||
theme: tooltipEffect,
|
||||
hideOnClick: 'toggle',
|
||||
placement: 'right'
|
||||
}"
|
||||
class="center-collapse"
|
||||
@click="toggleClick"
|
||||
>
|
||||
<IconifyIconOffline
|
||||
:icon="ArrowLeft"
|
||||
:class="[iconClass, themeColor === 'light' ? '' : 'text-primary']"
|
||||
:style="{ transform: props.isActive ? 'none' : 'rotateY(180deg)' }"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.center-collapse {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 2px;
|
||||
z-index: 1002;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 34px;
|
||||
cursor: pointer;
|
||||
background: var(--el-bg-color);
|
||||
border: 1px solid var(--pure-border-color);
|
||||
border-radius: 4px;
|
||||
transform: translate(12px, -50%);
|
||||
}
|
||||
</style>
|
||||
30
src/layout/components/sidebar/fullScreen.vue
Normal file
30
src/layout/components/sidebar/fullScreen.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { useNav } from "@/layout/hooks/useNav";
|
||||
|
||||
const screenIcon = ref();
|
||||
const { toggle, isFullscreen, Fullscreen, ExitFullscreen } = useNav();
|
||||
|
||||
isFullscreen.value = !!(
|
||||
document.fullscreenElement ||
|
||||
document.webkitFullscreenElement ||
|
||||
document.mozFullScreenElement ||
|
||||
document.msFullscreenElement
|
||||
);
|
||||
|
||||
watch(
|
||||
isFullscreen,
|
||||
full => {
|
||||
screenIcon.value = full ? ExitFullscreen : Fullscreen;
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span class="fullscreen-icon navbar-bg-hover" @click="toggle">
|
||||
<IconifyIconOffline :icon="screenIcon" />
|
||||
</span>
|
||||
</template>
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import Search from "../search/index.vue";
|
||||
import Notice from "../notice/index.vue";
|
||||
import FullScreen from "./fullScreen.vue";
|
||||
import SidebarItem from "./sidebarItem.vue";
|
||||
import { isAllEmpty } from "@pureadmin/utils";
|
||||
import { ref, nextTick, computed } from "vue";
|
||||
@@ -65,8 +66,6 @@ nextTick(() => {
|
||||
<div class="horizontal-header-right">
|
||||
<!-- 菜单搜索 -->
|
||||
<Search id="header-search" />
|
||||
<!-- 通知 -->
|
||||
<Notice id="header-notice" />
|
||||
<!-- 国际化 -->
|
||||
<el-dropdown id="header-translation" trigger="click">
|
||||
<globalization
|
||||
@@ -97,6 +96,10 @@ nextTick(() => {
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<!-- 全屏 -->
|
||||
<FullScreen id="full-screen" />
|
||||
<!-- 消息通知 -->
|
||||
<Notice id="header-notice" />
|
||||
<!-- 退出登录 -->
|
||||
<el-dropdown trigger="click">
|
||||
<span class="el-dropdown-link navbar-bg-hover">
|
||||
|
||||
@@ -41,7 +41,7 @@ const toggleClick = () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="collapse-container">
|
||||
<div class="left-collapse">
|
||||
<IconifyIconOffline
|
||||
v-tippy="{
|
||||
content: props.isActive ? '点击折叠' : '点击展开',
|
||||
@@ -58,7 +58,7 @@ const toggleClick = () => {
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.collapse-container {
|
||||
.left-collapse {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
|
||||
36
src/layout/components/sidebar/linkItem.vue
Normal file
36
src/layout/components/sidebar/linkItem.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { isUrl } from "@pureadmin/utils";
|
||||
import { menuType } from "@/layout/types";
|
||||
|
||||
defineOptions({
|
||||
name: "LinkItem"
|
||||
});
|
||||
|
||||
const props = defineProps<{
|
||||
to: menuType;
|
||||
}>();
|
||||
|
||||
const isExternalLink = computed(() => isUrl(props.to.name));
|
||||
const getLinkProps = (item: menuType) => {
|
||||
if (isExternalLink.value) {
|
||||
return {
|
||||
href: item.name,
|
||||
target: "_blank",
|
||||
rel: "noopener"
|
||||
};
|
||||
}
|
||||
return {
|
||||
to: item
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component
|
||||
:is="isExternalLink ? 'a' : 'router-link'"
|
||||
v-bind="getLinkProps(to)"
|
||||
>
|
||||
<slot />
|
||||
</component>
|
||||
</template>
|
||||
@@ -48,6 +48,7 @@ const { title, getLogo } = useNav();
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
padding-left: 10px;
|
||||
|
||||
img {
|
||||
display: inline-block;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import extraIcon from "./extraIcon.vue";
|
||||
import Search from "../search/index.vue";
|
||||
import Notice from "../notice/index.vue";
|
||||
import FullScreen from "./fullScreen.vue";
|
||||
import { isAllEmpty } from "@pureadmin/utils";
|
||||
import { useNav } from "@/layout/hooks/useNav";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
@@ -98,8 +99,6 @@ watch(
|
||||
<div class="horizontal-header-right">
|
||||
<!-- 菜单搜索 -->
|
||||
<Search id="header-search" />
|
||||
<!-- 通知 -->
|
||||
<Notice id="header-notice" />
|
||||
<!-- 国际化 -->
|
||||
<el-dropdown id="header-translation" trigger="click">
|
||||
<globalization
|
||||
@@ -130,6 +129,10 @@ watch(
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<!-- 全屏 -->
|
||||
<FullScreen id="full-screen" />
|
||||
<!-- 消息通知 -->
|
||||
<Notice id="header-notice" />
|
||||
<!-- 退出登录 -->
|
||||
<el-dropdown trigger="click">
|
||||
<span class="el-dropdown-link navbar-bg-hover select-none">
|
||||
|
||||
@@ -1,19 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import path from "path";
|
||||
import { getConfig } from "@/config";
|
||||
import LinkItem from "./linkItem.vue";
|
||||
import { menuType } from "../../types";
|
||||
import extraIcon from "./extraIcon.vue";
|
||||
import { ReText } from "@/components/ReText";
|
||||
import { useNav } from "@/layout/hooks/useNav";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||
import { type CSSProperties, type PropType, computed, ref, toRaw } from "vue";
|
||||
import {
|
||||
type PropType,
|
||||
type CSSProperties,
|
||||
ref,
|
||||
toRaw,
|
||||
computed,
|
||||
useAttrs
|
||||
} from "vue";
|
||||
|
||||
import ArrowUp from "@iconify-icons/ep/arrow-up-bold";
|
||||
import EpArrowDown from "@iconify-icons/ep/arrow-down-bold";
|
||||
import ArrowLeft from "@iconify-icons/ep/arrow-left-bold";
|
||||
import ArrowRight from "@iconify-icons/ep/arrow-right-bold";
|
||||
|
||||
const attrs = useAttrs();
|
||||
const { layout, isCollapse, tooltipEffect, getDivStyle } = useNav();
|
||||
|
||||
const props = defineProps({
|
||||
@@ -32,6 +41,7 @@ const props = defineProps({
|
||||
|
||||
const getNoDropdownStyle = computed((): CSSProperties => {
|
||||
return {
|
||||
width: "100%",
|
||||
display: "flex",
|
||||
alignItems: "center"
|
||||
};
|
||||
@@ -96,61 +106,66 @@ function resolvePath(routePath) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-menu-item
|
||||
<link-item
|
||||
v-if="
|
||||
hasOneShowingChild(props.item.children, props.item) &&
|
||||
(!onlyOneChild.children || onlyOneChild.noShowingChildren)
|
||||
"
|
||||
:index="resolvePath(onlyOneChild.path)"
|
||||
:class="{ 'submenu-title-noDropdown': !isNest }"
|
||||
:style="getNoDropdownStyle"
|
||||
:to="item"
|
||||
>
|
||||
<div
|
||||
v-if="toRaw(props.item.meta.icon)"
|
||||
class="sub-menu-icon"
|
||||
:style="getSubMenuIconStyle"
|
||||
<el-menu-item
|
||||
:index="resolvePath(onlyOneChild.path)"
|
||||
:class="{ 'submenu-title-noDropdown': !isNest }"
|
||||
:style="getNoDropdownStyle"
|
||||
v-bind="attrs"
|
||||
>
|
||||
<component
|
||||
:is="
|
||||
useRenderIcon(
|
||||
toRaw(onlyOneChild.meta.icon) ||
|
||||
(props.item.meta && toRaw(props.item.meta.icon))
|
||||
)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<el-text
|
||||
v-if="
|
||||
(!props.item?.meta.icon &&
|
||||
isCollapse &&
|
||||
layout === 'vertical' &&
|
||||
props.item?.pathList?.length === 1) ||
|
||||
(!onlyOneChild.meta.icon &&
|
||||
isCollapse &&
|
||||
layout === 'mix' &&
|
||||
props.item?.pathList?.length === 2)
|
||||
"
|
||||
truncated
|
||||
class="!px-4 !text-inherit"
|
||||
>
|
||||
{{ transformI18n(onlyOneChild.meta.title) }}
|
||||
</el-text>
|
||||
|
||||
<template #title>
|
||||
<div :style="getDivStyle">
|
||||
<ReText
|
||||
:tippyProps="{
|
||||
offset: [0, -10],
|
||||
theme: tooltipEffect
|
||||
}"
|
||||
class="!text-inherit"
|
||||
>
|
||||
{{ transformI18n(onlyOneChild.meta.title) }}
|
||||
</ReText>
|
||||
<extraIcon :extraIcon="onlyOneChild.meta.extraIcon" />
|
||||
<div
|
||||
v-if="toRaw(props.item.meta.icon)"
|
||||
class="sub-menu-icon"
|
||||
:style="getSubMenuIconStyle"
|
||||
>
|
||||
<component
|
||||
:is="
|
||||
useRenderIcon(
|
||||
toRaw(onlyOneChild.meta.icon) ||
|
||||
(props.item.meta && toRaw(props.item.meta.icon))
|
||||
)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
<el-text
|
||||
v-if="
|
||||
(!props.item?.meta.icon &&
|
||||
isCollapse &&
|
||||
layout === 'vertical' &&
|
||||
props.item?.pathList?.length === 1) ||
|
||||
(!onlyOneChild.meta.icon &&
|
||||
isCollapse &&
|
||||
layout === 'mix' &&
|
||||
props.item?.pathList?.length === 2)
|
||||
"
|
||||
truncated
|
||||
class="!px-4 !text-inherit"
|
||||
>
|
||||
{{ transformI18n(onlyOneChild.meta.title) }}
|
||||
</el-text>
|
||||
|
||||
<template #title>
|
||||
<div :style="getDivStyle">
|
||||
<ReText
|
||||
:tippyProps="{
|
||||
offset: [0, -10],
|
||||
theme: tooltipEffect
|
||||
}"
|
||||
class="!text-inherit"
|
||||
>
|
||||
{{ transformI18n(onlyOneChild.meta.title) }}
|
||||
</ReText>
|
||||
<extraIcon :extraIcon="onlyOneChild.meta.extraIcon" />
|
||||
</div>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
</link-item>
|
||||
<el-sub-menu
|
||||
v-else
|
||||
ref="subMenu"
|
||||
|
||||
@@ -3,8 +3,9 @@ import Logo from "./logo.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { emitter } from "@/utils/mitt";
|
||||
import SidebarItem from "./sidebarItem.vue";
|
||||
import leftCollapse from "./leftCollapse.vue";
|
||||
import LeftCollapse from "./leftCollapse.vue";
|
||||
import { useNav } from "@/layout/hooks/useNav";
|
||||
import CenterCollapse from "./centerCollapse.vue";
|
||||
import { responsiveStorageNameSpace } from "@/config";
|
||||
import { storageLocal, isAllEmpty } from "@pureadmin/utils";
|
||||
import { findRouteByPath, getParentPaths } from "@/router/utils";
|
||||
@@ -12,6 +13,7 @@ import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||
import { ref, computed, watch, onMounted, onBeforeUnmount } from "vue";
|
||||
|
||||
const route = useRoute();
|
||||
const isShow = ref(false);
|
||||
const showLogo = ref(
|
||||
storageLocal().getItem<StorageConfigs>(
|
||||
`${responsiveStorageNameSpace()}configure`
|
||||
@@ -88,6 +90,8 @@ onBeforeUnmount(() => {
|
||||
<div
|
||||
v-loading="loading"
|
||||
:class="['sidebar-container', showLogo ? 'has-logo' : 'no-logo']"
|
||||
@mouseenter.prevent="isShow = true"
|
||||
@mouseleave.prevent="isShow = false"
|
||||
>
|
||||
<Logo v-if="showLogo" :collapse="isCollapse" />
|
||||
<el-scrollbar
|
||||
@@ -114,7 +118,12 @@ onBeforeUnmount(() => {
|
||||
/>
|
||||
</el-menu>
|
||||
</el-scrollbar>
|
||||
<leftCollapse
|
||||
<CenterCollapse
|
||||
v-if="device !== 'mobile' && (isShow || isCollapse)"
|
||||
:is-active="pureApp.sidebar.opened"
|
||||
@toggleClick="toggleSideBar"
|
||||
/>
|
||||
<LeftCollapse
|
||||
v-if="device !== 'mobile'"
|
||||
:is-active="pureApp.sidebar.opened"
|
||||
@toggleClick="toggleSideBar"
|
||||
|
||||
@@ -18,26 +18,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotate {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes close {
|
||||
from {
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
}
|
||||
|
||||
.tags-view {
|
||||
position: relative;
|
||||
display: flex;
|
||||
@@ -51,41 +31,35 @@
|
||||
.scroll-item {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
height: 28px;
|
||||
padding: 0 6px;
|
||||
margin-right: 4px;
|
||||
line-height: 28px;
|
||||
height: 34px;
|
||||
padding-left: 6px;
|
||||
line-height: 34px;
|
||||
cursor: pointer;
|
||||
border-radius: 3px 3px 0 0;
|
||||
box-shadow: 0 0 1px #888;
|
||||
transition: all 0.4s;
|
||||
|
||||
&:not(:first-child) {
|
||||
padding-right: 24px;
|
||||
}
|
||||
|
||||
.el-icon-close {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
font-size: 10px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
color: var(--el-color-primary);
|
||||
cursor: pointer;
|
||||
transition: font-size 0.2s;
|
||||
transform: translate(-50%, -50%);
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
background-color 0.12s,
|
||||
color 0.12s;
|
||||
transform: translate(0, -50%);
|
||||
|
||||
&:hover {
|
||||
font-size: 13px;
|
||||
color: #fff;
|
||||
background: #b4bccc;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
&.is-closable:not(:first-child) {
|
||||
&:hover {
|
||||
padding-right: 18px;
|
||||
|
||||
&:not(.is-active) {
|
||||
.el-icon-close {
|
||||
animation: close 200ms ease-in forwards;
|
||||
}
|
||||
}
|
||||
color: rgb(0 0 0 / 88%) !important;
|
||||
background-color: rgb(0 0 0 / 6%);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,7 +73,6 @@
|
||||
.scroll-container {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
padding: 5px 0;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -114,7 +87,7 @@
|
||||
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
||||
|
||||
&:nth-child(1) {
|
||||
margin-left: 5px;
|
||||
padding: 0 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -194,14 +167,7 @@
|
||||
.scroll-item.is-active {
|
||||
position: relative;
|
||||
color: #fff;
|
||||
|
||||
&:not(:first-child) {
|
||||
padding-right: 18px;
|
||||
}
|
||||
|
||||
.el-icon-close {
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
box-shadow: 0 0 0.7px #888;
|
||||
|
||||
.tag-title {
|
||||
color: var(--el-color-primary) !important;
|
||||
@@ -212,16 +178,16 @@
|
||||
.arrow-right,
|
||||
.arrow-down {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 38px;
|
||||
height: 34px;
|
||||
color: var(--el-text-color-primary);
|
||||
|
||||
svg {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
transform: translate(-50%, 50%);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { emitter } from "@/utils/mitt";
|
||||
import { RouteConfigs } from "../../types";
|
||||
import { useTags } from "../../hooks/useTag";
|
||||
import { routerArrays } from "@/layout/types";
|
||||
import { useFullscreen, onClickOutside } from "@vueuse/core";
|
||||
import { onClickOutside } from "@vueuse/core";
|
||||
import { handleAliveRoute, getTopMenu } from "@/router/utils";
|
||||
import { useSettingStoreHook } from "@/store/modules/settings";
|
||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||
@@ -21,9 +21,9 @@ import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
|
||||
import ArrowDown from "@iconify-icons/ri/arrow-down-s-line";
|
||||
import ArrowRightSLine from "@iconify-icons/ri/arrow-right-s-line";
|
||||
import ArrowLeftSLine from "@iconify-icons/ri/arrow-left-s-line";
|
||||
import CloseBold from "@iconify-icons/ep/close-bold";
|
||||
|
||||
const {
|
||||
Close,
|
||||
route,
|
||||
router,
|
||||
visible,
|
||||
@@ -59,7 +59,6 @@ const contextmenuRef = ref();
|
||||
const isShowArrow = ref(false);
|
||||
const topPath = getTopMenu()?.path;
|
||||
const { VITE_HIDE_HOME } = import.meta.env;
|
||||
const { isFullscreen, toggle } = useFullscreen();
|
||||
|
||||
const dynamicTagView = async () => {
|
||||
await nextTick();
|
||||
@@ -156,7 +155,8 @@ const handleWheel = (event: WheelEvent): void => {
|
||||
};
|
||||
|
||||
const smoothScroll = (offset: number): void => {
|
||||
const scrollAmount = 20; // 每帧滚动的距离
|
||||
// 每帧滚动的距离
|
||||
const scrollAmount = 20;
|
||||
let remaining = Math.abs(offset);
|
||||
|
||||
const scrollStep = () => {
|
||||
@@ -328,28 +328,15 @@ function onClickDrop(key, item, selectRoute?: RouteConfigs) {
|
||||
handleAliveRoute(route as ToRouteType);
|
||||
break;
|
||||
case 6:
|
||||
// 整体页面全屏
|
||||
toggle();
|
||||
setTimeout(() => {
|
||||
if (isFullscreen.value) {
|
||||
tagsViews[6].icon = ExitFullscreen;
|
||||
tagsViews[6].text = $t("buttons.hswholeExitFullScreen");
|
||||
} else {
|
||||
tagsViews[6].icon = Fullscreen;
|
||||
tagsViews[6].text = $t("buttons.hswholeFullScreen");
|
||||
}
|
||||
}, 100);
|
||||
break;
|
||||
case 7:
|
||||
// 内容区全屏
|
||||
onContentFullScreen();
|
||||
setTimeout(() => {
|
||||
if (pureSetting.hiddenSideBar) {
|
||||
tagsViews[7].icon = ExitFullscreen;
|
||||
tagsViews[7].text = $t("buttons.hscontentExitFullScreen");
|
||||
tagsViews[6].icon = ExitFullscreen;
|
||||
tagsViews[6].text = $t("buttons.hscontentExitFullScreen");
|
||||
} else {
|
||||
tagsViews[7].icon = Fullscreen;
|
||||
tagsViews[7].text = $t("buttons.hscontentFullScreen");
|
||||
tagsViews[6].icon = Fullscreen;
|
||||
tagsViews[6].text = $t("buttons.hscontentFullScreen");
|
||||
}
|
||||
}, 100);
|
||||
break;
|
||||
@@ -510,11 +497,6 @@ watch(route, () => {
|
||||
dynamicTagView();
|
||||
});
|
||||
|
||||
watch(isFullscreen, () => {
|
||||
tagsViews[6].icon = Fullscreen;
|
||||
tagsViews[6].text = $t("buttons.hswholeFullScreen");
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
if (!instance) return;
|
||||
|
||||
@@ -586,7 +568,7 @@ onBeforeUnmount(() => {
|
||||
class="el-icon-close"
|
||||
@click.stop="deleteMenu(item)"
|
||||
>
|
||||
<IconifyIconOffline :icon="CloseBold" />
|
||||
<IconifyIconOffline :icon="Close" />
|
||||
</span>
|
||||
<span
|
||||
v-if="showModel !== 'card'"
|
||||
|
||||
@@ -45,7 +45,7 @@ export function useDataThemeChange() {
|
||||
const targetEl = target || document.body;
|
||||
let { className } = targetEl;
|
||||
className = className.replace(clsName, "").trim();
|
||||
targetEl.className = flag ? `${className} ${clsName} ` : className;
|
||||
targetEl.className = flag ? `${className} ${clsName}` : className;
|
||||
}
|
||||
|
||||
/** 设置导航主题色 */
|
||||
|
||||
@@ -41,7 +41,8 @@ export function useLayout() {
|
||||
hideFooter: $config.HideFooter ?? true,
|
||||
showLogo: $config?.ShowLogo ?? true,
|
||||
showModel: $config?.ShowModel ?? "smart",
|
||||
multiTagsCache: $config?.MultiTagsCache ?? false
|
||||
multiTagsCache: $config?.MultiTagsCache ?? false,
|
||||
stretch: $config?.Stretch ?? false
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useRouter } from "vue-router";
|
||||
import { emitter } from "@/utils/mitt";
|
||||
import userAvatar from "@/assets/user.jpg";
|
||||
import { getTopMenu } from "@/router/utils";
|
||||
import { useFullscreen } from "@vueuse/core";
|
||||
import { useGlobal } from "@pureadmin/utils";
|
||||
import type { routeMetaType } from "../types";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
@@ -13,12 +14,15 @@ import { useAppStoreHook } from "@/store/modules/app";
|
||||
import { useUserStoreHook } from "@/store/modules/user";
|
||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||
import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill";
|
||||
import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
|
||||
|
||||
const errorInfo = "当前路由配置不正确,请检查配置";
|
||||
|
||||
export function useNav() {
|
||||
const pureApp = useAppStoreHook();
|
||||
const routers = useRouter().options.routes;
|
||||
const { isFullscreen, toggle } = useFullscreen();
|
||||
const { wholeMenus } = storeToRefs(usePermissionStoreHook());
|
||||
/** 平台`layout`中所有`el-tooltip`的`effect`配置,默认`light` */
|
||||
const tooltipEffect = getConfig()?.TooltipEffect ?? "light";
|
||||
@@ -136,6 +140,10 @@ export function useNav() {
|
||||
logout,
|
||||
routers,
|
||||
$storage,
|
||||
isFullscreen,
|
||||
Fullscreen,
|
||||
ExitFullscreen,
|
||||
toggle,
|
||||
backTopMenu,
|
||||
onPanel,
|
||||
getDivStyle,
|
||||
|
||||
@@ -104,17 +104,10 @@ export function useTags() {
|
||||
disabled: multiTags.value.length > 1 ? false : true,
|
||||
show: true
|
||||
},
|
||||
{
|
||||
icon: Fullscreen,
|
||||
text: $t("buttons.hswholeFullScreen"),
|
||||
divided: true,
|
||||
disabled: false,
|
||||
show: true
|
||||
},
|
||||
{
|
||||
icon: Fullscreen,
|
||||
text: $t("buttons.hscontentFullScreen"),
|
||||
divided: false,
|
||||
divided: true,
|
||||
disabled: false,
|
||||
show: true
|
||||
}
|
||||
@@ -216,6 +209,7 @@ export function useTags() {
|
||||
});
|
||||
|
||||
return {
|
||||
Close,
|
||||
route,
|
||||
router,
|
||||
visible,
|
||||
|
||||
@@ -8,7 +8,7 @@ export const routerArrays: Array<RouteConfigs> =
|
||||
path: "/welcome",
|
||||
meta: {
|
||||
title: "menus.hshome",
|
||||
icon: "homeFilled"
|
||||
icon: "ep:home-filled"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -62,6 +62,7 @@ export interface setType {
|
||||
|
||||
export type menuType = {
|
||||
id?: number;
|
||||
name?: string;
|
||||
path?: string;
|
||||
noShowingChildren?: boolean;
|
||||
children?: menuType[];
|
||||
|
||||
@@ -6,6 +6,7 @@ import { getPlatformConfig } from "./config";
|
||||
import { MotionPlugin } from "@vueuse/motion";
|
||||
import { useEcharts } from "@/plugins/echarts";
|
||||
import { createApp, type Directive } from "vue";
|
||||
import { useVxeTable } from "@/plugins/vxeTable";
|
||||
import { useElementPlus } from "@/plugins/elementPlus";
|
||||
import { injectResponsiveStorage } from "@/utils/responsive";
|
||||
|
||||
@@ -61,6 +62,7 @@ getPlatformConfig(app).then(async config => {
|
||||
.use(useI18n)
|
||||
.use(useElementPlus)
|
||||
.use(Table)
|
||||
.use(useVxeTable)
|
||||
.use(PureDescriptions)
|
||||
.use(useEcharts);
|
||||
app.mount("#app");
|
||||
|
||||
102
src/plugins/vxeTable.ts
Normal file
102
src/plugins/vxeTable.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
import "vxe-table/lib/style.css";
|
||||
// import "xe-utils";
|
||||
// import XEUtils from "xe-utils";
|
||||
import type { App } from "vue";
|
||||
// import { i18n } from "@/plugins/i18n";
|
||||
// import zh from "vxe-table/lib/locale/lang/zh-CN";
|
||||
// import en from "vxe-table/lib/locale/lang/en-US";
|
||||
|
||||
import {
|
||||
// 全局对象
|
||||
VXETable,
|
||||
// 表格功能
|
||||
// Filter,
|
||||
// Edit,
|
||||
// Menu,
|
||||
// Export,
|
||||
// Keyboard,
|
||||
// Validator,
|
||||
// 可选组件
|
||||
Icon,
|
||||
Column,
|
||||
// Colgroup,
|
||||
// Grid,
|
||||
// Tooltip,
|
||||
// Toolbar,
|
||||
// Pager,
|
||||
// Form,
|
||||
// FormItem,
|
||||
// FormGather,
|
||||
// Checkbox,
|
||||
// CheckboxGroup,
|
||||
// Radio,
|
||||
// RadioGroup,
|
||||
// RadioButton,
|
||||
// Switch,
|
||||
// Input,
|
||||
// Select,
|
||||
// Optgroup,
|
||||
// Option,
|
||||
// Textarea,
|
||||
// Button,
|
||||
// Modal,
|
||||
// List,
|
||||
// Pulldown,
|
||||
// 表格
|
||||
Table
|
||||
} from "vxe-table";
|
||||
|
||||
// 全局默认参数
|
||||
VXETable.config({
|
||||
// i18n: (key, args) => {
|
||||
// return unref(i18n.global.locale) === "zh"
|
||||
// ? XEUtils.toFormatString(XEUtils.get(zh, key), args)
|
||||
// : XEUtils.toFormatString(XEUtils.get(en, key), args);
|
||||
// },
|
||||
// translate(key) {
|
||||
// const NAMESPACED = ["el.", "buttons."];
|
||||
// if (key && NAMESPACED.findIndex(v => key.includes(v)) !== -1) {
|
||||
// return i18n.global.t.call(i18n.global.locale, key);
|
||||
// }
|
||||
// return key;
|
||||
// }
|
||||
});
|
||||
|
||||
export function useVxeTable(app: App) {
|
||||
// 表格功能
|
||||
// app.use(Filter)
|
||||
// .use(Edit)
|
||||
// .use(Menu)
|
||||
// .use(Export)
|
||||
// .use(Keyboard)
|
||||
// .use(Validator)
|
||||
// 可选组件
|
||||
app
|
||||
.use(Icon)
|
||||
.use(Column)
|
||||
// .use(Colgroup)
|
||||
// .use(Grid)
|
||||
// .use(Tooltip)
|
||||
// .use(Toolbar)
|
||||
// .use(Pager)
|
||||
// .use(Form)
|
||||
// .use(FormItem)
|
||||
// .use(FormGather)
|
||||
// .use(Checkbox)
|
||||
// .use(CheckboxGroup)
|
||||
// .use(Radio)
|
||||
// .use(RadioGroup)
|
||||
// .use(RadioButton)
|
||||
// .use(Switch)
|
||||
// .use(Input)
|
||||
// .use(Select)
|
||||
// .use(Optgroup)
|
||||
// .use(Option)
|
||||
// .use(Textarea)
|
||||
// .use(Button)
|
||||
// .use(Modal)
|
||||
// .use(List)
|
||||
// .use(Pulldown)
|
||||
// 安装表格
|
||||
.use(Table);
|
||||
}
|
||||
@@ -1,31 +1,38 @@
|
||||
// 完整版菜单比较多,将 rank 抽离出来,在此方便维护
|
||||
|
||||
const home = 0, // 平台规定只有 home 路由的 rank 才能为 0 ,所以后端在返回 rank 的时候需要从非 0 开始
|
||||
components = 1,
|
||||
able = 2,
|
||||
table = 3,
|
||||
list = 4,
|
||||
result = 5,
|
||||
error = 6,
|
||||
frame = 7,
|
||||
nested = 8,
|
||||
permission = 9,
|
||||
system = 10,
|
||||
tabs = 11,
|
||||
about = 12,
|
||||
editor = 13,
|
||||
flowchart = 14,
|
||||
formdesign = 15,
|
||||
board = 16,
|
||||
ppt = 17,
|
||||
guide = 18,
|
||||
menuoverflow = 19;
|
||||
vueflow = 1,
|
||||
ganttastic = 2,
|
||||
components = 3,
|
||||
able = 4,
|
||||
table = 5,
|
||||
form = 6,
|
||||
list = 7,
|
||||
result = 8,
|
||||
error = 9,
|
||||
frame = 10,
|
||||
nested = 11,
|
||||
permission = 12,
|
||||
system = 13,
|
||||
monitor = 14,
|
||||
tabs = 15,
|
||||
about = 16,
|
||||
editor = 17,
|
||||
flowchart = 18,
|
||||
formdesign = 19,
|
||||
board = 20,
|
||||
ppt = 21,
|
||||
guide = 22,
|
||||
menuoverflow = 23;
|
||||
|
||||
export {
|
||||
home,
|
||||
vueflow,
|
||||
ganttastic,
|
||||
components,
|
||||
able,
|
||||
table,
|
||||
form,
|
||||
list,
|
||||
result,
|
||||
error,
|
||||
@@ -33,6 +40,7 @@ export {
|
||||
nested,
|
||||
permission,
|
||||
system,
|
||||
monitor,
|
||||
tabs,
|
||||
about,
|
||||
editor,
|
||||
|
||||
@@ -5,11 +5,20 @@ export default {
|
||||
path: "/able",
|
||||
redirect: "/able/watermark",
|
||||
meta: {
|
||||
icon: "ubuntuFill",
|
||||
icon: "ri:ubuntu-fill",
|
||||
title: $t("menus.hsAble"),
|
||||
rank: able
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/able/verify",
|
||||
name: "Verify",
|
||||
component: () => import("@/views/able/verify.vue"),
|
||||
meta: {
|
||||
title: $t("menus.hsVerify"),
|
||||
extraIcon: "IF-pure-iconfont-new svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/able/watermark",
|
||||
name: "WaterMark",
|
||||
@@ -42,6 +51,15 @@ export default {
|
||||
title: $t("menus.hsExcel")
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/components/ripple",
|
||||
name: "Ripple",
|
||||
component: () => import("@/views/able/ripple.vue"),
|
||||
meta: {
|
||||
title: $t("menus.hsRipple"),
|
||||
extraIcon: "IF-pure-iconfont-new svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/able/debounce",
|
||||
name: "Debounce",
|
||||
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
path: "/about",
|
||||
redirect: "/about/index",
|
||||
meta: {
|
||||
icon: "info",
|
||||
icon: "ri:file-info-line",
|
||||
title: $t("menus.hsAbout"),
|
||||
rank: about
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@ export default {
|
||||
path: "/board",
|
||||
redirect: "/board/index",
|
||||
meta: {
|
||||
icon: "artboard",
|
||||
icon: "ri:artboard-line",
|
||||
title: $t("menus.hsboard"),
|
||||
rank: board
|
||||
},
|
||||
@@ -17,8 +17,7 @@ export default {
|
||||
component: IFrame,
|
||||
meta: {
|
||||
title: $t("menus.hsboard"),
|
||||
frameSrc: "https://songlh.top/paint-board/",
|
||||
extraIcon: "IF-pure-iconfont-new svg"
|
||||
frameSrc: "https://songlh.top/paint-board/"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -31,7 +31,15 @@ export default {
|
||||
name: "PureUpload",
|
||||
component: () => import("@/views/components/upload/index.vue"),
|
||||
meta: {
|
||||
title: $t("menus.hsUpload"),
|
||||
title: $t("menus.hsUpload")
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/components/check-card",
|
||||
name: "CheckCard",
|
||||
component: () => import("@/views/components/check-card.vue"),
|
||||
meta: {
|
||||
title: $t("menus.hsCheckCard"),
|
||||
extraIcon: "IF-pure-iconfont-new svg"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
path: "/editor",
|
||||
redirect: "/editor/index",
|
||||
meta: {
|
||||
icon: "edit",
|
||||
icon: "ep:edit",
|
||||
title: $t("menus.hseditor"),
|
||||
rank: editor
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
path: "/error",
|
||||
redirect: "/error/403",
|
||||
meta: {
|
||||
icon: "informationLine",
|
||||
icon: "ri:information-line",
|
||||
// showLink: false,
|
||||
title: $t("menus.hsabnormal"),
|
||||
rank: error
|
||||
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
path: "/flow-chart",
|
||||
redirect: "/flow-chart/index",
|
||||
meta: {
|
||||
icon: "setUp",
|
||||
icon: "ep:set-up",
|
||||
title: $t("menus.hsflowChart"),
|
||||
rank: flowchart
|
||||
},
|
||||
|
||||
23
src/router/modules/form.ts
Normal file
23
src/router/modules/form.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { $t } from "@/plugins/i18n";
|
||||
import { form } from "@/router/enums";
|
||||
|
||||
export default {
|
||||
path: "/form",
|
||||
redirect: "/form/index",
|
||||
meta: {
|
||||
icon: "ri:edit-box-line",
|
||||
title: $t("menus.hsSchemaForm"),
|
||||
rank: form
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/form/index",
|
||||
name: "SchemaForm",
|
||||
component: () => import("@/views/schema-form/index.vue"),
|
||||
meta: {
|
||||
title: $t("menus.hsSchemaForm"),
|
||||
extraIcon: "IF-pure-iconfont-new svg"
|
||||
}
|
||||
}
|
||||
]
|
||||
} satisfies RouteConfigsTable;
|
||||
@@ -6,7 +6,7 @@ export default {
|
||||
path: "/form-design",
|
||||
redirect: "/form-design/index",
|
||||
meta: {
|
||||
icon: "terminalWindowLine",
|
||||
icon: "ri:terminal-window-line",
|
||||
title: $t("menus.hsFormDesign"),
|
||||
rank: formdesign
|
||||
},
|
||||
|
||||
23
src/router/modules/ganttastic.ts
Normal file
23
src/router/modules/ganttastic.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { $t } from "@/plugins/i18n";
|
||||
import { ganttastic } from "@/router/enums";
|
||||
|
||||
export default {
|
||||
path: "/ganttastic",
|
||||
redirect: "/ganttastic/index",
|
||||
meta: {
|
||||
icon: "ri:bar-chart-horizontal-line",
|
||||
title: $t("menus.hsGanttastic"),
|
||||
rank: ganttastic
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/ganttastic/index",
|
||||
name: "Ganttastic",
|
||||
component: () => import("@/views/ganttastic/index.vue"),
|
||||
meta: {
|
||||
title: $t("menus.hsGanttastic"),
|
||||
extraIcon: "IF-pure-iconfont-new svg"
|
||||
}
|
||||
}
|
||||
]
|
||||
} satisfies RouteConfigsTable;
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
path: "/guide",
|
||||
redirect: "/guide/index",
|
||||
meta: {
|
||||
icon: "guide",
|
||||
icon: "ep:guide",
|
||||
title: $t("menus.hsguide"),
|
||||
rank: guide
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ export default {
|
||||
component: Layout,
|
||||
redirect: "/welcome",
|
||||
meta: {
|
||||
icon: "homeFilled",
|
||||
icon: "ep:home-filled",
|
||||
title: $t("menus.hshome"),
|
||||
rank: home
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
path: "/list",
|
||||
redirect: "/list/card",
|
||||
meta: {
|
||||
icon: "listCheck",
|
||||
icon: "ri:list-check",
|
||||
title: $t("menus.hsList"),
|
||||
rank: list
|
||||
},
|
||||
@@ -15,7 +15,7 @@ export default {
|
||||
name: "ListCard",
|
||||
component: () => import("@/views/list/card/index.vue"),
|
||||
meta: {
|
||||
icon: "card",
|
||||
icon: "ri:bank-card-line",
|
||||
title: $t("menus.hsListCard"),
|
||||
showParent: true
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ export default {
|
||||
redirect: "/nested/menu1/menu1-1",
|
||||
meta: {
|
||||
title: $t("menus.hsmenus"),
|
||||
icon: "histogram",
|
||||
icon: "ep:histogram",
|
||||
rank: nested
|
||||
},
|
||||
children: [
|
||||
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
path: "/ppt",
|
||||
redirect: "/ppt/index",
|
||||
meta: {
|
||||
icon: "ppt",
|
||||
icon: "ri:file-ppt-2-line",
|
||||
title: "PPT",
|
||||
rank: ppt
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
path: "/result",
|
||||
redirect: "/result/success",
|
||||
meta: {
|
||||
icon: "checkboxCircleLine",
|
||||
icon: "ri:checkbox-circle-line",
|
||||
title: $t("menus.hsResult"),
|
||||
rank: result
|
||||
},
|
||||
|
||||
@@ -2,29 +2,47 @@ import { $t } from "@/plugins/i18n";
|
||||
import { table } from "@/router/enums";
|
||||
|
||||
export default {
|
||||
path: "/pure-table",
|
||||
redirect: "/pure-table/index",
|
||||
path: "/table",
|
||||
redirect: "/table/index",
|
||||
meta: {
|
||||
icon: "table",
|
||||
title: "pure-admin-table",
|
||||
icon: "ri:table-line",
|
||||
title: $t("menus.hstable"),
|
||||
rank: table
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/pure-table/index",
|
||||
path: "/table/index",
|
||||
name: "PureTable",
|
||||
component: () => import("@/views/pure-table/index.vue"),
|
||||
component: () => import("@/views/table/index.vue"),
|
||||
meta: {
|
||||
title: $t("menus.hsPureTableBase")
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/pure-table/high",
|
||||
path: "/table/high",
|
||||
name: "PureTableHigh",
|
||||
component: () => import("@/views/pure-table/high.vue"),
|
||||
component: () => import("@/views/table/high.vue"),
|
||||
meta: {
|
||||
title: $t("menus.hsPureTableHigh")
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/table/edit",
|
||||
name: "PureTableEdit",
|
||||
component: () => import("@/views/table/edit.vue"),
|
||||
meta: {
|
||||
title: $t("menus.hsPureTableEdit"),
|
||||
extraIcon: "IF-pure-iconfont-new svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/table/virtual",
|
||||
name: "VxeTable",
|
||||
component: () => import("@/views/table/virtual.vue"),
|
||||
meta: {
|
||||
title: $t("menus.hsVxeTable"),
|
||||
extraIcon: "IF-pure-iconfont-new svg"
|
||||
}
|
||||
}
|
||||
]
|
||||
} satisfies RouteConfigsTable;
|
||||
|
||||
22
src/router/modules/vueflow.ts
Normal file
22
src/router/modules/vueflow.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { vueflow } from "@/router/enums";
|
||||
|
||||
export default {
|
||||
path: "/vue-flow",
|
||||
redirect: "/vue-flow/index",
|
||||
meta: {
|
||||
icon: "ep:set-up",
|
||||
title: "vue-flow",
|
||||
rank: vueflow
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/vue-flow/index",
|
||||
name: "VueFlow",
|
||||
component: () => import("@/views/vue-flow/layouting/index.vue"),
|
||||
meta: {
|
||||
title: "vue-flow",
|
||||
extraIcon: "IF-pure-iconfont-new svg"
|
||||
}
|
||||
}
|
||||
]
|
||||
} satisfies RouteConfigsTable;
|
||||
@@ -14,6 +14,67 @@ html.dark {
|
||||
/* switch关闭状态下的color 需要时可取用 */
|
||||
--pure-switch-off-color: #ffffff3f;
|
||||
|
||||
/* vxe-table */
|
||||
--vxe-form-background-color: #151515;
|
||||
--vxe-toolbar-background-color: #151515;
|
||||
--vxe-pager-background-color: #151515;
|
||||
--vxe-button-default-background-color: color.adjust(#151515, $lightness: 15%);
|
||||
--vxe-table-header-background-color: color.adjust(#151515, $lightness: 5%);
|
||||
--vxe-font-color: color.adjust(#c9d1d9, $lightness: -12%);
|
||||
--vxe-table-header-font-color: #c9d1d9;
|
||||
--vxe-table-footer-font-color: #c9d1d9;
|
||||
--vxe-table-body-background-color: #151515;
|
||||
--vxe-table-footer-background-color: #151515;
|
||||
--vxe-table-row-striped-background-color: #1e1e1e;
|
||||
--vxe-table-border-color: #303030;
|
||||
--vxe-table-row-hover-background-color: #1e1e1e;
|
||||
--vxe-table-row-hover-striped-background-color: color.adjust(
|
||||
#1e1e1e,
|
||||
$lightness: -10%
|
||||
);
|
||||
--vxe-table-row-current-background-color: fade(#1e1e1e, 20%);
|
||||
--vxe-table-row-hover-current-background-color: fade(#1e1e1e, 20%);
|
||||
--vxe-table-column-hover-background-color: fade(#1e1e1e, 20%);
|
||||
--vxe-table-column-current-background-color: fade(#1e1e1e, 20%);
|
||||
--vxe-table-row-checkbox-checked-background-color: fade(#1e1e1e, 15%);
|
||||
--vxe-table-row-hover-checkbox-checked-background-color: fade(#1e1e1e, 20%);
|
||||
--vxe-table-menu-background-color: color.adjust(#303133, $lightness: 10%);
|
||||
--vxe-table-filter-panel-background-color: color.adjust(
|
||||
#151515,
|
||||
$lightness: 5%
|
||||
);
|
||||
--vxe-grid-maximize-background-color: #151515;
|
||||
--vxe-pager-perfect-background-color: #151515;
|
||||
--vxe-pager-perfect-button-background-color: color.adjust(
|
||||
#151515,
|
||||
$lightness: 15%
|
||||
);
|
||||
--vxe-input-background-color: #151515;
|
||||
--vxe-input-border-color: #303030;
|
||||
--vxe-select-panel-background-color: #151515;
|
||||
--vxe-table-popup-border-color: #303030;
|
||||
--vxe-select-option-hover-background-color: color.adjust(
|
||||
#1e1e1e,
|
||||
$lightness: 15%
|
||||
);
|
||||
--vxe-pulldown-panel-background-color: #151515;
|
||||
--vxe-table-fixed-left-scrolling-box-shadow: 8px 0px 10px -5px #43464c;
|
||||
--vxe-table-fixed-right-scrolling-box-shadow: -8px 0px 10px -5px #43464c;
|
||||
--vxe-loading-background-color: rgb(0 0 0 / 50%);
|
||||
--vxe-tooltip-dark-background-color: color.adjust(#303133, $lightness: 25%);
|
||||
--vxe-modal-header-background-color: #1e1e1e;
|
||||
--vxe-modal-body-background-color: #303133;
|
||||
--vxe-modal-border-color: #303030;
|
||||
--vxe-toolbar-panel-background-color: #151515;
|
||||
--vxe-input-disabled-color: color.adjust(#1e1e1e, $lightness: 20%);
|
||||
--vxe-input-disabled-background-color: color.adjust(#1e1e1e, $lightness: 25%);
|
||||
--vxe-checkbox-icon-background-color: color.adjust(#1e1e1e, $lightness: 15%);
|
||||
--vxe-checkbox-checked-icon-border-color: #303030;
|
||||
--vxe-checkbox-indeterminate-icon-background-color: color.adjust(
|
||||
#1e1e1e,
|
||||
$lightness: 15%
|
||||
);
|
||||
|
||||
.navbar,
|
||||
.tags-view,
|
||||
.contextmenu,
|
||||
@@ -45,6 +106,15 @@ html.dark {
|
||||
.arrow-right {
|
||||
border-left: 1px solid $border-style;
|
||||
}
|
||||
|
||||
.scroll-item {
|
||||
.el-icon-close {
|
||||
&:hover {
|
||||
color: rgb(255 255 255 / 85%) !important;
|
||||
background-color: rgb(255 255 255 / 12%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 项目配置面板 */
|
||||
@@ -87,15 +157,8 @@ html.dark {
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
/* element-plus */
|
||||
.el-table__cell {
|
||||
background: var(--el-bg-color);
|
||||
}
|
||||
|
||||
.el-card {
|
||||
--el-card-bg-color: var(--el-bg-color);
|
||||
|
||||
// border: none !important;
|
||||
}
|
||||
|
||||
.el-backtop {
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* 全局覆盖element-plus的el-dialog、el-drawer、el-message-box、el-notification组件右上角关闭图标和el-upload上传文件列表右侧关闭图标的样式,表现更鲜明 */
|
||||
/* 全局覆盖element-plus的el-tour、el-dialog、el-drawer、el-message-box、el-notification组件右上角关闭图标和el-upload上传文件列表右侧关闭图标的样式,表现更鲜明 */
|
||||
.el-dialog__headerbtn,
|
||||
.el-message-box__headerbtn {
|
||||
&:hover {
|
||||
@@ -75,6 +75,7 @@
|
||||
}
|
||||
|
||||
.el-icon {
|
||||
&.el-tour__close,
|
||||
&.el-dialog__close,
|
||||
&.el-drawer__close,
|
||||
&.el-message-box__close,
|
||||
@@ -102,7 +103,6 @@
|
||||
|
||||
/* 克隆并自定义 ElMessage 样式,不会影响 ElMessage 原本样式,在 src/utils/message.ts 中调用自定义样式 ElMessage 方法即可,整体暗色风格在 src/style/dark.scss 文件进行了适配 */
|
||||
.pure-message {
|
||||
padding: 10px 13px !important;
|
||||
background: #fff !important;
|
||||
border-width: 0 !important;
|
||||
box-shadow:
|
||||
@@ -110,22 +110,13 @@
|
||||
0 6px 16px #00000014,
|
||||
0 9px 28px 8px #0000000d !important;
|
||||
|
||||
&.el-message.is-closable .el-message__content {
|
||||
padding-right: 17px !important;
|
||||
}
|
||||
|
||||
& .el-message__content {
|
||||
color: #000000d9 !important;
|
||||
pointer-events: all !important;
|
||||
background-image: initial !important;
|
||||
}
|
||||
|
||||
& .el-message__icon {
|
||||
margin-right: 8px !important;
|
||||
}
|
||||
|
||||
& .el-message__closeBtn {
|
||||
right: 9px !important;
|
||||
border-radius: 4px;
|
||||
outline: none;
|
||||
transition:
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
.login-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
max-width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-gap: 18rem;
|
||||
@@ -30,6 +31,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.login-form {
|
||||
|
||||
@@ -194,7 +194,6 @@ button,
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
img,
|
||||
svg,
|
||||
video,
|
||||
canvas,
|
||||
|
||||
@@ -14,6 +14,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* 修复 windows 下双滚动条问题 https://github.com/pure-admin/vue-pure-admin/pull/936#issuecomment-1968125992 */
|
||||
.el-popper.pure-scrollbar {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* popper menu 超出内容区可滚动 */
|
||||
.pure-scrollbar {
|
||||
max-height: calc(100vh - calc(50px * 2.5));
|
||||
@@ -30,7 +35,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
.set-icon {
|
||||
.set-icon,
|
||||
.fullscreen-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -86,7 +92,7 @@
|
||||
z-index: 1001;
|
||||
width: $sideBarWidth !important;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
overflow: visible;
|
||||
font-size: 0;
|
||||
background: $menuBg;
|
||||
border-right: 1px solid var(--pure-border-color);
|
||||
@@ -130,11 +136,9 @@
|
||||
}
|
||||
|
||||
a {
|
||||
display: inline-block;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.el-menu {
|
||||
@@ -331,9 +335,18 @@
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* 无子菜单时激活 border-bottom */
|
||||
a > .is-active.submenu-title-noDropdown {
|
||||
border-bottom: 2px solid var(--el-menu-active-color);
|
||||
}
|
||||
|
||||
.el-menu--popup {
|
||||
background-color: $subMenuBg !important;
|
||||
|
||||
a > .is-active.submenu-title-noDropdown {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.el-menu-item {
|
||||
color: $menuText;
|
||||
background-color: $subMenuBg;
|
||||
@@ -348,12 +361,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* 无子菜单时激活 border-bottom */
|
||||
.router-link-exact-active > .submenu-title-noDropdown {
|
||||
height: 60px;
|
||||
border-bottom: 2px solid var(--el-menu-active-color);
|
||||
}
|
||||
|
||||
/* 子菜单中还有子菜单 */
|
||||
.el-menu .el-sub-menu__title {
|
||||
min-width: $sideBarWidth !important;
|
||||
@@ -454,10 +461,12 @@
|
||||
|
||||
/* 搜索 */
|
||||
.search-container,
|
||||
/* 告警 */
|
||||
.dropdown-badge,
|
||||
/* 国际化 */
|
||||
.globalization,
|
||||
/* 全屏 */
|
||||
.fullscreen-icon,
|
||||
/* 消息通知 */
|
||||
.dropdown-badge,
|
||||
/* 用户名 */
|
||||
.el-dropdown-link,
|
||||
/* 设置 */
|
||||
@@ -636,10 +645,12 @@ body[layout="vertical"] {
|
||||
|
||||
/* 搜索 */
|
||||
.search-container,
|
||||
/* 告警 */
|
||||
.dropdown-badge,
|
||||
/* 国际化 */
|
||||
.globalization,
|
||||
/* 全屏 */
|
||||
.fullscreen-icon,
|
||||
/* 消息通知 */
|
||||
.dropdown-badge,
|
||||
/* 用户名 */
|
||||
.el-dropdown-link,
|
||||
/* 设置 */
|
||||
|
||||
@@ -85,6 +85,22 @@ class StorageProxy implements ProxyStorage {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取数据仓库中所有的key
|
||||
*/
|
||||
public async keys() {
|
||||
return new Promise<string[]>((resolve, reject) => {
|
||||
this.storage
|
||||
.keys()
|
||||
.then(keys => {
|
||||
resolve(keys);
|
||||
})
|
||||
.catch(err => {
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,8 @@ export const injectResponsiveStorage = (app: App, config: PlatformConfigs) => {
|
||||
hideFooter: config.HideFooter ?? true,
|
||||
showLogo: config.ShowLogo ?? true,
|
||||
showModel: config.ShowModel ?? "smart",
|
||||
multiTagsCache: config.MultiTagsCache ?? false
|
||||
multiTagsCache: config.MultiTagsCache ?? false,
|
||||
stretch: config.Stretch ?? false
|
||||
}
|
||||
},
|
||||
config.MultiTagsCache
|
||||
|
||||
@@ -21,7 +21,7 @@ const source =
|
||||
|
||||
const handleDocumentRender = () => {
|
||||
loading.value = false;
|
||||
pageCount.value = pdfRef.value.pageCount;
|
||||
pageCount.value = pdfRef.value.doc.numPages;
|
||||
};
|
||||
|
||||
const showAllPagesChange = () => {
|
||||
@@ -29,6 +29,7 @@ const showAllPagesChange = () => {
|
||||
};
|
||||
|
||||
const onPrint = () => {
|
||||
// 如果在打印时,打印页面是本身的两倍,在打印配置 页面 设置 仅限页码为奇数的页面 即可
|
||||
pdfRef.value.print();
|
||||
};
|
||||
</script>
|
||||
|
||||
71
src/views/able/ripple.vue
Normal file
71
src/views/able/ripple.vue
Normal file
@@ -0,0 +1,71 @@
|
||||
<script setup lang="ts">
|
||||
defineOptions({
|
||||
name: "Ripple"
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<div class="font-medium">波纹(Ripple)</div>
|
||||
</template>
|
||||
<div class="mb-5">组件中的波纹</div>
|
||||
<el-alert
|
||||
title="v-ripple在某些组件中使用波纹特效会异常,这是因为v-ripple指令只能作用于当前元素,某些组件有多层元素嵌套,且目标元素没在顶层,所以会导致特效异常"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
/>
|
||||
<el-space wrap class="my-5">
|
||||
<el-button v-ripple>Default</el-button>
|
||||
<el-button v-ripple type="primary">Primary</el-button>
|
||||
<el-button v-ripple type="success">Success</el-button>
|
||||
<el-button v-ripple type="info">Info</el-button>
|
||||
<el-button v-ripple type="warning">Warning</el-button>
|
||||
<el-button v-ripple type="danger">Danger</el-button>
|
||||
</el-space>
|
||||
<el-card v-ripple class="mb-5 w-[510px] select-none" shadow="hover">
|
||||
卡片
|
||||
</el-card>
|
||||
|
||||
<div class="mb-5">
|
||||
只要在组件或HTML元素上使用v-ripple指令,就可以启用基本的ripple功能
|
||||
</div>
|
||||
<div
|
||||
v-ripple
|
||||
class="mb-5 text-center shadow-md rounded-md p-8 text-lg select-none"
|
||||
>
|
||||
HTML元素
|
||||
</div>
|
||||
<span
|
||||
v-ripple
|
||||
class="inline-block shadow-md rounded-md p-8 text-lg select-none"
|
||||
>
|
||||
行内元素需要添加display: block或display: inline-block才能生效
|
||||
</span>
|
||||
|
||||
<div class="my-5">
|
||||
当使用v-ripple.center时,将始终从目标的中心处产生波纹
|
||||
</div>
|
||||
<div
|
||||
v-ripple.center
|
||||
class="mb-5 text-center shadow-md rounded-md p-8 text-lg select-none"
|
||||
>
|
||||
始终从中心触发波纹
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
使用v-ripple="{ class: '' }"添加类来自定义波纹颜色,支持tailwindcss
|
||||
</div>
|
||||
<el-alert
|
||||
title="自定义样式生效为文字颜色,例如:color: 'red';"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
/>
|
||||
<div
|
||||
v-ripple="{ class: 'text-red-500' }"
|
||||
class="my-5 text-center shadow-md rounded-md p-4 text-lg select-none"
|
||||
>
|
||||
自定义波纹颜色
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
35
src/views/able/verify.vue
Normal file
35
src/views/able/verify.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Vcode from "vue3-puzzle-vcode";
|
||||
|
||||
const isShow = ref(true);
|
||||
|
||||
function onSuccess() {
|
||||
console.log("验证成功");
|
||||
}
|
||||
|
||||
function onFail() {
|
||||
console.log("验证失败");
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<div class="font-medium">
|
||||
拼图人机验证、右滑拼图验证(
|
||||
<el-link
|
||||
href="https://github.com/javaLuo/vue-puzzle-vcode/tree/vue3"
|
||||
target="_blank"
|
||||
style="margin: 0 5px 4px 0; font-size: 16px"
|
||||
>
|
||||
github地址
|
||||
</el-link>
|
||||
)
|
||||
</div>
|
||||
</template>
|
||||
<div class="bg-[rgba(15,23,42,0.2)] p-6 w-[360px]">
|
||||
<Vcode :show="isShow" type="inside" @fail="onFail" @success="onSuccess" />
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
@@ -4,6 +4,7 @@ export function useColumns() {
|
||||
const columns = [
|
||||
{
|
||||
label: "当前版本",
|
||||
minWidth: 100,
|
||||
cellRenderer: () => {
|
||||
return (
|
||||
<el-tag size="large" class="!text-base">
|
||||
@@ -14,6 +15,7 @@ export function useColumns() {
|
||||
},
|
||||
{
|
||||
label: "最后编译时间",
|
||||
minWidth: 120,
|
||||
cellRenderer: () => {
|
||||
return (
|
||||
<el-tag size="large" class="!text-base">
|
||||
@@ -24,6 +26,7 @@ export function useColumns() {
|
||||
},
|
||||
{
|
||||
label: "推荐 node 版本",
|
||||
minWidth: 140,
|
||||
cellRenderer: () => {
|
||||
return (
|
||||
<el-tag size="large" class="!text-base">
|
||||
@@ -34,6 +37,7 @@ export function useColumns() {
|
||||
},
|
||||
{
|
||||
label: "推荐 pnpm 版本",
|
||||
minWidth: 140,
|
||||
cellRenderer: () => {
|
||||
return (
|
||||
<el-tag size="large" class="!text-base">
|
||||
@@ -44,6 +48,7 @@ export function useColumns() {
|
||||
},
|
||||
{
|
||||
label: "完整版代码地址",
|
||||
minWidth: 140,
|
||||
className: "pure-version",
|
||||
cellRenderer: () => {
|
||||
return (
|
||||
@@ -58,6 +63,7 @@ export function useColumns() {
|
||||
},
|
||||
{
|
||||
label: "精简版代码地址",
|
||||
minWidth: 140,
|
||||
className: "pure-version",
|
||||
cellRenderer: () => {
|
||||
return (
|
||||
@@ -72,6 +78,7 @@ export function useColumns() {
|
||||
},
|
||||
{
|
||||
label: "文档地址",
|
||||
minWidth: 100,
|
||||
className: "pure-version",
|
||||
cellRenderer: () => {
|
||||
return (
|
||||
@@ -86,6 +93,7 @@ export function useColumns() {
|
||||
},
|
||||
{
|
||||
label: "预览地址",
|
||||
minWidth: 100,
|
||||
className: "pure-version",
|
||||
cellRenderer: () => {
|
||||
return (
|
||||
|
||||
@@ -75,67 +75,79 @@ Object.keys(devDependencies).forEach(key => {
|
||||
<span class="font-medium">平台信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<PureDescriptions border :columns="columns" :column="4" />
|
||||
<el-scrollbar>
|
||||
<PureDescriptions border :columns="columns" :column="4" />
|
||||
</el-scrollbar>
|
||||
</el-card>
|
||||
|
||||
<el-card class="m-4 box-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<div class="card-header flex items-center">
|
||||
<span class="font-medium">生产环境依赖</span>
|
||||
<el-tag type="primary" effect="dark" size="small" round class="ml-1">
|
||||
{{ schema.length }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions border size="small" :column="6">
|
||||
<el-descriptions-item
|
||||
v-for="(item, index) in schema"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:label-class-name="getMainLabel(item.label)"
|
||||
class-name="pure-version"
|
||||
label-align="right"
|
||||
>
|
||||
<a
|
||||
:href="'https://www.npmjs.com/package/' + item.label"
|
||||
target="_blank"
|
||||
<el-scrollbar>
|
||||
<el-descriptions border size="small" :column="6">
|
||||
<el-descriptions-item
|
||||
v-for="(item, index) in schema"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:label-class-name="getMainLabel(item.label)"
|
||||
class-name="pure-version"
|
||||
label-align="right"
|
||||
>
|
||||
<span
|
||||
:class="getMainLabel(item.label)"
|
||||
style="color: var(--el-color-primary)"
|
||||
<a
|
||||
:href="'https://www.npmjs.com/package/' + item.label"
|
||||
target="_blank"
|
||||
>
|
||||
{{ item.field }}
|
||||
</span>
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<span
|
||||
:class="getMainLabel(item.label)"
|
||||
style="color: var(--el-color-primary)"
|
||||
>
|
||||
{{ item.field }}
|
||||
</span>
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-scrollbar>
|
||||
</el-card>
|
||||
|
||||
<el-card class="m-4 box-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<div class="card-header flex items-center">
|
||||
<span class="font-medium">开发环境依赖</span>
|
||||
<el-tag type="primary" effect="dark" size="small" round class="ml-1">
|
||||
{{ devSchema.length }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions border size="small" :column="5">
|
||||
<el-descriptions-item
|
||||
v-for="(item, index) in devSchema"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:label-class-name="getMainLabel(item.label)"
|
||||
class-name="pure-version"
|
||||
label-align="right"
|
||||
>
|
||||
<a
|
||||
:href="'https://www.npmjs.com/package/' + item.label"
|
||||
target="_blank"
|
||||
<el-scrollbar>
|
||||
<el-descriptions border size="small" :column="5">
|
||||
<el-descriptions-item
|
||||
v-for="(item, index) in devSchema"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:label-class-name="getMainLabel(item.label)"
|
||||
class-name="pure-version"
|
||||
label-align="right"
|
||||
>
|
||||
<span
|
||||
:class="getMainLabel(item.label)"
|
||||
style="color: var(--el-color-primary)"
|
||||
<a
|
||||
:href="'https://www.npmjs.com/package/' + item.label"
|
||||
target="_blank"
|
||||
>
|
||||
{{ item.field }}
|
||||
</span>
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<span
|
||||
:class="getMainLabel(item.label)"
|
||||
style="color: var(--el-color-primary)"
|
||||
>
|
||||
{{ item.field }}
|
||||
</span>
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-scrollbar>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -94,10 +94,10 @@ watch(size, val =>
|
||||
<el-space wrap :size="40">
|
||||
<span style="font-size: 16px; font-weight: 800"> 可选按钮 </span>
|
||||
<el-radio-group v-model="size" size="small">
|
||||
<el-radio label="large">大尺寸</el-radio>
|
||||
<el-radio label="default">默认尺寸</el-radio>
|
||||
<el-radio label="small">小尺寸</el-radio>
|
||||
<el-radio label="disabled">禁用</el-radio>
|
||||
<el-radio value="large">大尺寸</el-radio>
|
||||
<el-radio value="default">默认尺寸</el-radio>
|
||||
<el-radio value="small">小尺寸</el-radio>
|
||||
<el-radio value="disabled">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-space>
|
||||
</div>
|
||||
@@ -108,9 +108,9 @@ watch(size, val =>
|
||||
:size="dynamicSize"
|
||||
:disabled="size === 'disabled'"
|
||||
>
|
||||
<el-radio-button label="wait">等待中</el-radio-button>
|
||||
<el-radio-button label="progress">进行中</el-radio-button>
|
||||
<el-radio-button label="complete">已完成</el-radio-button>
|
||||
<el-radio-button value="wait">等待中</el-radio-button>
|
||||
<el-radio-button value="progress">进行中</el-radio-button>
|
||||
<el-radio-button value="complete">已完成</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-divider />
|
||||
|
||||
@@ -120,9 +120,9 @@ watch(size, val =>
|
||||
:size="dynamicSize"
|
||||
:disabled="size === 'disabled'"
|
||||
>
|
||||
<el-radio label="wait" border>等待中</el-radio>
|
||||
<el-radio label="progress" border>进行中</el-radio>
|
||||
<el-radio label="complete" border>已完成</el-radio>
|
||||
<el-radio value="wait" border>等待中</el-radio>
|
||||
<el-radio value="progress" border>进行中</el-radio>
|
||||
<el-radio value="complete" border>已完成</el-radio>
|
||||
</el-radio-group>
|
||||
<el-divider />
|
||||
|
||||
@@ -132,19 +132,19 @@ watch(size, val =>
|
||||
:size="dynamicSize"
|
||||
:disabled="size === 'disabled'"
|
||||
>
|
||||
<el-radio-button label="wait">
|
||||
<el-radio-button value="wait">
|
||||
<span class="flex">
|
||||
<IconifyIconOnline icon="ri:progress-8-fill" class="mr-1" />
|
||||
等待中
|
||||
</span>
|
||||
</el-radio-button>
|
||||
<el-radio-button label="progress">
|
||||
<el-radio-button value="progress">
|
||||
<span class="flex">
|
||||
<IconifyIconOnline icon="ri:progress-6-line" class="mr-1" />
|
||||
进行中
|
||||
</span>
|
||||
</el-radio-button>
|
||||
<el-radio-button label="complete">
|
||||
<el-radio-button value="complete">
|
||||
<span class="flex">
|
||||
<IconifyIconOnline icon="ri:progress-8-line" class="mr-1" />
|
||||
已完成
|
||||
@@ -159,9 +159,9 @@ watch(size, val =>
|
||||
:size="dynamicSize"
|
||||
:disabled="size === 'disabled'"
|
||||
>
|
||||
<el-checkbox-button label="apple">苹果</el-checkbox-button>
|
||||
<el-checkbox-button label="tomato">西红柿</el-checkbox-button>
|
||||
<el-checkbox-button label="banana">香蕉</el-checkbox-button>
|
||||
<el-checkbox-button value="apple">苹果</el-checkbox-button>
|
||||
<el-checkbox-button value="tomato">西红柿</el-checkbox-button>
|
||||
<el-checkbox-button value="banana">香蕉</el-checkbox-button>
|
||||
</el-checkbox-group>
|
||||
<el-divider />
|
||||
|
||||
@@ -171,9 +171,9 @@ watch(size, val =>
|
||||
:size="dynamicSize"
|
||||
:disabled="size === 'disabled'"
|
||||
>
|
||||
<el-checkbox label="cucumber" border>黄瓜</el-checkbox>
|
||||
<el-checkbox label="onion" border>洋葱</el-checkbox>
|
||||
<el-checkbox label="blueberry" border>蓝莓</el-checkbox>
|
||||
<el-checkbox value="cucumber" border>黄瓜</el-checkbox>
|
||||
<el-checkbox value="onion" border>洋葱</el-checkbox>
|
||||
<el-checkbox value="blueberry" border>蓝莓</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
<el-divider />
|
||||
|
||||
@@ -184,13 +184,13 @@ watch(size, val =>
|
||||
:size="dynamicSize"
|
||||
:disabled="size === 'disabled'"
|
||||
>
|
||||
<el-checkbox-button label="tomato">
|
||||
<el-checkbox-button value="tomato">
|
||||
<span class="flex">
|
||||
<IconifyIconOnline icon="streamline-emojis:tomato" class="mr-1" />
|
||||
番茄
|
||||
</span>
|
||||
</el-checkbox-button>
|
||||
<el-checkbox-button label="watermelon">
|
||||
<el-checkbox-button value="watermelon">
|
||||
<span class="flex">
|
||||
<IconifyIconOnline
|
||||
icon="streamline-emojis:watermelon-1"
|
||||
@@ -199,7 +199,7 @@ watch(size, val =>
|
||||
西瓜
|
||||
</span>
|
||||
</el-checkbox-button>
|
||||
<el-checkbox-button label="strawberry">
|
||||
<el-checkbox-button value="strawberry">
|
||||
<span class="flex">
|
||||
<IconifyIconOnline
|
||||
icon="streamline-emojis:strawberry-1"
|
||||
|
||||
82
src/views/components/check-card.vue
Normal file
82
src/views/components/check-card.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
// https://plus-pro-components.com/components/check-card-group.html
|
||||
import "plus-pro-components/es/components/check-card-group/style/css";
|
||||
import { PlusCheckCardGroup } from "plus-pro-components";
|
||||
|
||||
defineOptions({
|
||||
name: "CheckCard"
|
||||
});
|
||||
|
||||
const size = ref("default");
|
||||
const dynamicSize = ref();
|
||||
const list = ref("0");
|
||||
const list1 = ref([]);
|
||||
|
||||
const options = [
|
||||
{
|
||||
title: "标题一",
|
||||
value: "0",
|
||||
description: "坚持梦想,成就不凡的自己",
|
||||
avatar:
|
||||
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
|
||||
},
|
||||
{
|
||||
title: "标题二",
|
||||
value: "1",
|
||||
description: "每一次努力,都是成长的契机",
|
||||
avatar:
|
||||
"https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg"
|
||||
}
|
||||
];
|
||||
|
||||
watch(size, val =>
|
||||
val === "disabled"
|
||||
? (dynamicSize.value = "default")
|
||||
: (dynamicSize.value = size.value)
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<el-space wrap :size="40">
|
||||
<el-link
|
||||
v-tippy="{
|
||||
content: '点击查看详细文档'
|
||||
}"
|
||||
href="https://plus-pro-components.com/components/check-card-group.html"
|
||||
target="_blank"
|
||||
style="font-size: 16px; font-weight: 800"
|
||||
>
|
||||
多选卡片组
|
||||
</el-link>
|
||||
<el-radio-group v-model="size" size="small">
|
||||
<el-radio value="large">大尺寸</el-radio>
|
||||
<el-radio value="default">默认尺寸</el-radio>
|
||||
<el-radio value="small">小尺寸</el-radio>
|
||||
<el-radio value="disabled">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<p class="mb-2 mt-4">单选</p>
|
||||
<PlusCheckCardGroup
|
||||
v-model="list"
|
||||
:options="options"
|
||||
:size="dynamicSize"
|
||||
:disabled="size === 'disabled'"
|
||||
/>
|
||||
|
||||
<p class="mb-2 mt-4">多选</p>
|
||||
<PlusCheckCardGroup
|
||||
v-model="list1"
|
||||
:options="options"
|
||||
:size="dynamicSize"
|
||||
:disabled="size === 'disabled'"
|
||||
multiple
|
||||
/>
|
||||
</el-card>
|
||||
</template>
|
||||
@@ -45,8 +45,8 @@ const handleChange = (val: string[]) => {
|
||||
|
||||
<p class="mb-2">基础用法</p>
|
||||
<el-radio-group v-model="radio" class="mb-3">
|
||||
<el-radio label="">可同时展开多个面板</el-radio>
|
||||
<el-radio label="accordion">每次只能展开一个面板</el-radio>
|
||||
<el-radio value="">可同时展开多个面板</el-radio>
|
||||
<el-radio value="accordion">每次只能展开一个面板</el-radio>
|
||||
</el-radio-group>
|
||||
<el-button size="small" text bg class="ml-8 mb-1" @click="onClick">
|
||||
外部触发打开、关闭
|
||||
|
||||
@@ -57,10 +57,10 @@ function onClick() {
|
||||
颜色选择器
|
||||
</el-link>
|
||||
<el-radio-group v-model="size" size="small">
|
||||
<el-radio label="large">大尺寸</el-radio>
|
||||
<el-radio label="default">默认尺寸</el-radio>
|
||||
<el-radio label="small">小尺寸</el-radio>
|
||||
<el-radio label="disabled">禁用</el-radio>
|
||||
<el-radio value="large">大尺寸</el-radio>
|
||||
<el-radio value="default">默认尺寸</el-radio>
|
||||
<el-radio value="small">小尺寸</el-radio>
|
||||
<el-radio value="disabled">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-space>
|
||||
</div>
|
||||
|
||||
@@ -144,10 +144,10 @@ watch(size, val =>
|
||||
日期选择器
|
||||
</el-link>
|
||||
<el-radio-group v-model="size" size="small">
|
||||
<el-radio label="large">大尺寸</el-radio>
|
||||
<el-radio label="default">默认尺寸</el-radio>
|
||||
<el-radio label="small">小尺寸</el-radio>
|
||||
<el-radio label="disabled">禁用</el-radio>
|
||||
<el-radio value="large">大尺寸</el-radio>
|
||||
<el-radio value="default">默认尺寸</el-radio>
|
||||
<el-radio value="small">小尺寸</el-radio>
|
||||
<el-radio value="disabled">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-space>
|
||||
</div>
|
||||
@@ -245,9 +245,9 @@ watch(size, val =>
|
||||
:disabled="size === 'disabled'"
|
||||
@change="value7 = ''"
|
||||
>
|
||||
<el-radio label="">Date</el-radio>
|
||||
<el-radio label="YYYY-MM-DD">年月日</el-radio>
|
||||
<el-radio label="x">时间戳</el-radio>
|
||||
<el-radio value="">Date</el-radio>
|
||||
<el-radio value="YYYY-MM-DD">年月日</el-radio>
|
||||
<el-radio value="x">时间戳</el-radio>
|
||||
</el-radio-group>
|
||||
<br />
|
||||
<el-space wrap>
|
||||
|
||||
@@ -170,10 +170,10 @@ watch(size, val =>
|
||||
日期时间选择器
|
||||
</el-link>
|
||||
<el-radio-group v-model="size" size="small">
|
||||
<el-radio label="large">大尺寸</el-radio>
|
||||
<el-radio label="default">默认尺寸</el-radio>
|
||||
<el-radio label="small">小尺寸</el-radio>
|
||||
<el-radio label="disabled">禁用</el-radio>
|
||||
<el-radio value="large">大尺寸</el-radio>
|
||||
<el-radio value="default">默认尺寸</el-radio>
|
||||
<el-radio value="small">小尺寸</el-radio>
|
||||
<el-radio value="disabled">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-space>
|
||||
</div>
|
||||
@@ -197,9 +197,9 @@ watch(size, val =>
|
||||
:disabled="size === 'disabled'"
|
||||
@change="value1 = ''"
|
||||
>
|
||||
<el-radio label="">Date</el-radio>
|
||||
<el-radio label="YYYY-MM-DD HH:mm:ss">年月日 时分秒</el-radio>
|
||||
<el-radio label="x">时间戳</el-radio>
|
||||
<el-radio value="">Date</el-radio>
|
||||
<el-radio value="YYYY-MM-DD HH:mm:ss">年月日 时分秒</el-radio>
|
||||
<el-radio value="x">时间戳</el-radio>
|
||||
</el-radio-group>
|
||||
<br />
|
||||
<el-space wrap>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
import { useRouter } from "vue-router";
|
||||
import { h, createVNode, ref } from "vue";
|
||||
import { message } from "@/utils/message";
|
||||
import forms, { type FormProps } from "./form.vue";
|
||||
import formPrimitive from "./formPrimitive.vue";
|
||||
import forms, { type FormProps } from "./form.vue";
|
||||
import { cloneDeep, debounce } from "@pureadmin/utils";
|
||||
import {
|
||||
addDialog,
|
||||
@@ -43,9 +43,11 @@ function onFullscreenClick() {
|
||||
|
||||
function onFullscreenIconClick() {
|
||||
addDialog({
|
||||
title: "全屏按钮",
|
||||
title: "全屏按钮和全屏事件",
|
||||
fullscreenIcon: true,
|
||||
contentRenderer: () => <p>弹框内容-全屏按钮</p>
|
||||
fullscreenCallBack: ({ options, index }) =>
|
||||
message(options.fullscreen ? "全屏" : "非全屏"),
|
||||
contentRenderer: () => <p>弹框内容-全屏按钮和全屏事件</p>
|
||||
});
|
||||
}
|
||||
|
||||
@@ -468,7 +470,7 @@ function onBeforeSureClick() {
|
||||
<el-button @click="onBaseClick"> 基础用法 </el-button>
|
||||
<el-button @click="onDraggableClick"> 可拖拽 </el-button>
|
||||
<el-button @click="onFullscreenClick"> 全屏 </el-button>
|
||||
<el-button @click="onFullscreenIconClick"> 全屏按钮 </el-button>
|
||||
<el-button @click="onFullscreenIconClick"> 全屏按钮和全屏事件 </el-button>
|
||||
<el-button @click="onModalClick"> 无背景遮罩层 </el-button>
|
||||
<el-button @click="onStyleClick"> 自定义弹出位置 </el-button>
|
||||
<el-button @click="onoOpenDelayClick"> 延时2秒打开弹框 </el-button>
|
||||
|
||||
@@ -68,10 +68,10 @@ watch(size, val =>
|
||||
Button 按钮
|
||||
</el-link>
|
||||
<el-radio-group v-model="size" size="small">
|
||||
<el-radio label="large">大尺寸</el-radio>
|
||||
<el-radio label="default">默认尺寸</el-radio>
|
||||
<el-radio label="small">小尺寸</el-radio>
|
||||
<el-radio label="disabled">禁用</el-radio>
|
||||
<el-radio value="large">大尺寸</el-radio>
|
||||
<el-radio value="default">默认尺寸</el-radio>
|
||||
<el-radio value="small">小尺寸</el-radio>
|
||||
<el-radio value="disabled">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-space>
|
||||
</div>
|
||||
@@ -79,13 +79,13 @@ watch(size, val =>
|
||||
|
||||
<p class="mb-2">基础按钮</p>
|
||||
<el-radio-group v-model="baseRadio" class="mb-3">
|
||||
<el-radio label="default" />
|
||||
<el-radio label="plain" />
|
||||
<el-radio label="round" />
|
||||
<el-radio label="circle" />
|
||||
<el-radio label="link" />
|
||||
<el-radio label="text" />
|
||||
<el-radio label="text-bg" />
|
||||
<el-radio label="default" value="default" />
|
||||
<el-radio label="plain" value="plain" />
|
||||
<el-radio label="round" value="round" />
|
||||
<el-radio label="circle" value="circle" />
|
||||
<el-radio label="link" value="link" />
|
||||
<el-radio label="text" value="text" />
|
||||
<el-radio label="text-bg" value="text-bg" />
|
||||
</el-radio-group>
|
||||
<br />
|
||||
<el-space wrap>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, watch } from "vue";
|
||||
import VueJsonPretty from "vue-json-pretty";
|
||||
import "vue-json-pretty/lib/styles.css";
|
||||
import VueJsonPretty from "vue-json-pretty";
|
||||
|
||||
defineOptions({
|
||||
name: "JsonEditor"
|
||||
|
||||
@@ -75,6 +75,26 @@ const optionsDisabled: Array<OptionsType> = [
|
||||
}
|
||||
];
|
||||
|
||||
/** block */
|
||||
const optionsBlock: Array<OptionsType> = [
|
||||
{
|
||||
label: "周一"
|
||||
},
|
||||
{
|
||||
label: "周二"
|
||||
},
|
||||
{
|
||||
label: "周三"
|
||||
},
|
||||
{
|
||||
label: "周四"
|
||||
},
|
||||
{
|
||||
label: "周五喜悦,收尾归档,周末倒计时",
|
||||
tip: "周五喜悦,收尾归档,周末倒计时"
|
||||
}
|
||||
];
|
||||
|
||||
/** 可设置图标 */
|
||||
const optionsIcon: Array<OptionsType> = [
|
||||
{
|
||||
@@ -86,7 +106,7 @@ const optionsIcon: Array<OptionsType> = [
|
||||
},
|
||||
{
|
||||
label: "周三",
|
||||
icon: "terminalWindowLine"
|
||||
icon: "ri:terminal-window-line"
|
||||
},
|
||||
{
|
||||
label: "周四"
|
||||
@@ -103,7 +123,7 @@ const optionsOnlyIcon: Array<OptionsType> = [
|
||||
icon: HomeFilled
|
||||
},
|
||||
{
|
||||
icon: "terminalWindowLine"
|
||||
icon: "ri:terminal-window-line"
|
||||
},
|
||||
{
|
||||
icon: "streamline-emojis:cow-face"
|
||||
@@ -131,7 +151,7 @@ const optionsLabel: Array<OptionsType> = [
|
||||
{
|
||||
label: () => (
|
||||
<div>
|
||||
{h(useRenderIcon("terminalWindowLine"), {
|
||||
{h(useRenderIcon("ri:terminal-window-line"), {
|
||||
class: "m-auto mt-1 w-[18px] h-[18px]"
|
||||
})}
|
||||
<p>周二</p>
|
||||
@@ -198,6 +218,9 @@ function onChange({ index, option }) {
|
||||
<p class="mb-2">禁用</p>
|
||||
<Segmented :options="optionsDisabled" />
|
||||
<el-divider />
|
||||
<p class="mb-2">block 属性(将宽度调整为父元素宽度)</p>
|
||||
<Segmented :options="optionsBlock" block />
|
||||
<el-divider />
|
||||
<p class="mb-2">可设置图标</p>
|
||||
<Segmented :options="optionsIcon" />
|
||||
<el-divider />
|
||||
|
||||
@@ -79,9 +79,9 @@ const handleInputConfirm = () => {
|
||||
Tag 标签
|
||||
</el-link>
|
||||
<el-radio-group v-model="size" size="small">
|
||||
<el-radio label="large">大尺寸</el-radio>
|
||||
<el-radio label="default">默认尺寸</el-radio>
|
||||
<el-radio label="small">小尺寸</el-radio>
|
||||
<el-radio value="large">大尺寸</el-radio>
|
||||
<el-radio value="default">默认尺寸</el-radio>
|
||||
<el-radio value="small">小尺寸</el-radio>
|
||||
</el-radio-group>
|
||||
</el-space>
|
||||
</div>
|
||||
@@ -89,9 +89,9 @@ const handleInputConfirm = () => {
|
||||
|
||||
<p class="mb-2">基础按钮</p>
|
||||
<el-radio-group v-model="baseTag" class="mb-3">
|
||||
<el-radio label="dark" />
|
||||
<el-radio label="light" />
|
||||
<el-radio label="plain" />
|
||||
<el-radio label="dark" value="dark" />
|
||||
<el-radio label="light" value="light" />
|
||||
<el-radio label="plain" value="plain" />
|
||||
</el-radio-group>
|
||||
<br />
|
||||
<el-space class="mb-3">
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user