mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98b97b9f88 | ||
|
|
3629a66535 | ||
|
|
95940312a9 | ||
|
|
f13faf0788 | ||
|
|
8e2b174e09 | ||
|
|
b5839d6398 | ||
|
|
b14f41c8d7 | ||
|
|
9ab3fd19ef | ||
|
|
fa5c97ffa4 | ||
|
|
b4a566b2bf |
@@ -1,3 +1,27 @@
|
|||||||
|
# 3.9.4 (2022-12-05)
|
||||||
|
|
||||||
|
### ✔️ refactor
|
||||||
|
|
||||||
|
- Completely removed `vxe-table`, after removal, the overall package size of the full version is reduced by `1.82MB`, and the initial startup time is basically the same as the lite version 🐮
|
||||||
|
[Click here to see Why Removed? How to integrate it yourself?](https://xiaoxian521.github.io/pure-admin-doc/pages/FAQ/#%E5%B9%B3%E5%8F%B0%E5%9C%A8-v3-9-4-%E7%89%88%E6%9C%AC%E5%AE%8C%E5%85%A8%E7%A7%BB%E9%99%A4%E4%BA%86-vxe-table-%E4%B8%BA%E4%BB%80%E4%B9%88%E7%A7%BB%E9%99%A4-%E5%A6%82%E4%BD%95%E8%87%AA%E8%A1%8C%E9%9B%86%E6%88%90)
|
||||||
|
|
||||||
|
# 3.9.3 (2022-12-04)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- Add `@pureadmin/table` pagination and loading animation example
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- Fixed the problem that the refresh page would be blank due to changes in dynamic routes stored in local storage after enabling `CachingAsyncRoutes`
|
||||||
|
- Fixed `Tooltip` displayed abnormally after the menu is collapsed
|
||||||
|
|
||||||
|
### 🍏 Perf
|
||||||
|
|
||||||
|
- Expand the use of local icons, the first launch of the full version reduces `13` requests again
|
||||||
|
- When the menu loading is slow, add `loading` animation to optimize user experience
|
||||||
|
- Theme initialization is placed in `onBeforeMount` to avoid flashing of the initialization page
|
||||||
|
|
||||||
# 3.9.2 (2022-12-03)
|
# 3.9.2 (2022-12-03)
|
||||||
|
|
||||||
### 🍏 Perf
|
### 🍏 Perf
|
||||||
|
|||||||
24
CHANGELOG.md
24
CHANGELOG.md
@@ -1,3 +1,27 @@
|
|||||||
|
# 3.9.4 (2022-12-05)
|
||||||
|
|
||||||
|
### ✔️ refactor
|
||||||
|
|
||||||
|
- Completely removed `vxe-table`, after removal, the overall package size of the full version is reduced by `1.82MB`, and the initial startup time is basically the same as the lite version 🐮
|
||||||
|
[Click here to see Why Removed? How to integrate it yourself?](https://xiaoxian521.github.io/pure-admin-doc/pages/FAQ/#%E5%B9%B3%E5%8F%B0%E5%9C%A8-v3-9-4-%E7%89%88%E6%9C%AC%E5%AE%8C%E5%85%A8%E7%A7%BB%E9%99%A4%E4%BA%86-vxe-table-%E4%B8%BA%E4%BB%80%E4%B9%88%E7%A7%BB%E9%99%A4-%E5%A6%82%E4%BD%95%E8%87%AA%E8%A1%8C%E9%9B%86%E6%88%90)
|
||||||
|
|
||||||
|
# 3.9.3 (2022-12-04)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- Add `@pureadmin/table` pagination and loading animation example
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- Fixed the problem that the refresh page would be blank due to changes in dynamic routes stored in local storage after enabling `CachingAsyncRoutes`
|
||||||
|
- Fixed `Tooltip` displayed abnormally after the menu is collapsed
|
||||||
|
|
||||||
|
### 🍏 Perf
|
||||||
|
|
||||||
|
- Expand the use of local icons, the first launch of the full version reduces `13` requests again
|
||||||
|
- When the menu loading is slow, add `loading` animation to optimize user experience
|
||||||
|
- Theme initialization is placed in `onBeforeMount` to avoid flashing of the initialization page
|
||||||
|
|
||||||
# 3.9.2 (2022-12-03)
|
# 3.9.2 (2022-12-03)
|
||||||
|
|
||||||
### 🍏 Perf
|
### 🍏 Perf
|
||||||
|
|||||||
@@ -1,3 +1,27 @@
|
|||||||
|
# 3.9.4 (2022-12-05)
|
||||||
|
|
||||||
|
### ✔️ refactor
|
||||||
|
|
||||||
|
- 完全移除了 `vxe-table`,移除后,完整版整体打包大小减少 `1.82MB`,首启动时长基本和精简版持平 🐮
|
||||||
|
[点击此处查看为什么移除?如何自行集成?](https://yiming_chang.gitee.io/pure-admin-doc/pages/FAQ/#%E5%B9%B3%E5%8F%B0%E5%9C%A8-v3-9-4-%E7%89%88%E6%9C%AC%E5%AE%8C%E5%85%A8%E7%A7%BB%E9%99%A4%E4%BA%86-vxe-table-%E4%B8%BA%E4%BB%80%E4%B9%88%E7%A7%BB%E9%99%A4-%E5%A6%82%E4%BD%95%E8%87%AA%E8%A1%8C%E9%9B%86%E6%88%90)
|
||||||
|
|
||||||
|
# 3.9.3 (2022-12-04)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- 添加 `@pureadmin/table` 分页和加载动画示例
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- 修复开启 `CachingAsyncRoutes` 后,存入本地存储的动态路由改变造成刷新页面空白的问题
|
||||||
|
- 修复菜单折叠后 `Tooltip` 显示异常
|
||||||
|
|
||||||
|
### 🍏 Perf
|
||||||
|
|
||||||
|
- 扩展本地图标使用方式,完整版首启动再次减少 `13` 个请求
|
||||||
|
- 当菜单加载慢时,添加 `loading` 动画,优化用户体验
|
||||||
|
- 主题初始化放在 `onBeforeMount` 里,避免初始化页面闪烁
|
||||||
|
|
||||||
# 3.9.2 (2022-12-03)
|
# 3.9.2 (2022-12-03)
|
||||||
|
|
||||||
### 🍏 Perf
|
### 🍏 Perf
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ const include = [
|
|||||||
"echarts",
|
"echarts",
|
||||||
"intro.js",
|
"intro.js",
|
||||||
"vue-i18n",
|
"vue-i18n",
|
||||||
"xe-utils",
|
|
||||||
"vxe-table",
|
|
||||||
"js-cookie",
|
"js-cookie",
|
||||||
"lodash-es",
|
"lodash-es",
|
||||||
"cropperjs",
|
"cropperjs",
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ menus:
|
|||||||
hsempty: Empty Page
|
hsempty: Empty Page
|
||||||
hssysManagement: System Manage
|
hssysManagement: System Manage
|
||||||
hsUser: User Manage
|
hsUser: User Manage
|
||||||
hsDict: Dict Manage
|
|
||||||
hsRole: Role Manage
|
hsRole: Role Manage
|
||||||
hsDept: Dept Manage
|
hsDept: Dept Manage
|
||||||
hseditor: Editor
|
hseditor: Editor
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ menus:
|
|||||||
hsempty: 无Layout页
|
hsempty: 无Layout页
|
||||||
hssysManagement: 系统管理
|
hssysManagement: 系统管理
|
||||||
hsUser: 用户管理
|
hsUser: 用户管理
|
||||||
hsDict: 字典管理
|
|
||||||
hsRole: 角色管理
|
hsRole: 角色管理
|
||||||
hsDept: 部门管理
|
hsDept: 部门管理
|
||||||
hseditor: 编辑器
|
hseditor: 编辑器
|
||||||
@@ -99,7 +98,7 @@ menus:
|
|||||||
hsInfiniteScroll: 表格无限滚动
|
hsInfiniteScroll: 表格无限滚动
|
||||||
hsdanmaku: 弹幕组件
|
hsdanmaku: 弹幕组件
|
||||||
hsPureTableBase: 基础用法(23个示例)
|
hsPureTableBase: 基础用法(23个示例)
|
||||||
hsPureTableHigh: 高级用法(8个示例)
|
hsPureTableHigh: 高级用法(10个示例)
|
||||||
hsTree: 大数据树业务组件
|
hsTree: 大数据树业务组件
|
||||||
hsMenuoverflow: 目录超出显示 Tooltip 文字提示
|
hsMenuoverflow: 目录超出显示 Tooltip 文字提示
|
||||||
hsChildMenuoverflow: 菜单超出显示 Tooltip 文字提示
|
hsChildMenuoverflow: 菜单超出显示 Tooltip 文字提示
|
||||||
|
|||||||
@@ -2,14 +2,6 @@
|
|||||||
import { MockMethod } from "vite-plugin-mock";
|
import { MockMethod } from "vite-plugin-mock";
|
||||||
import { system, permission, frame, tabs } from "@/router/enums";
|
import { system, permission, frame, tabs } from "@/router/enums";
|
||||||
|
|
||||||
import FlUser from "@iconify-icons/ri/admin-line";
|
|
||||||
import Role from "@iconify-icons/ri/admin-fill";
|
|
||||||
import Dict from "@iconify-icons/ri/git-repository-line";
|
|
||||||
import Setting from "@iconify-icons/ri/settings-3-line";
|
|
||||||
import Dept from "@iconify-icons/ri/git-branch-line";
|
|
||||||
import Lollipop from "@iconify-icons/ep/lollipop";
|
|
||||||
import Monitor from "@iconify-icons/ep/monitor";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* roles:页面级别权限,这里模拟二种 "admin"、"common"
|
* roles:页面级别权限,这里模拟二种 "admin"、"common"
|
||||||
* admin:管理员角色
|
* admin:管理员角色
|
||||||
@@ -19,7 +11,7 @@ import Monitor from "@iconify-icons/ep/monitor";
|
|||||||
const systemRouter = {
|
const systemRouter = {
|
||||||
path: "/system",
|
path: "/system",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Setting,
|
icon: "setting",
|
||||||
title: "menus.hssysManagement",
|
title: "menus.hssysManagement",
|
||||||
rank: system
|
rank: system
|
||||||
},
|
},
|
||||||
@@ -28,7 +20,7 @@ const systemRouter = {
|
|||||||
path: "/system/user/index",
|
path: "/system/user/index",
|
||||||
name: "User",
|
name: "User",
|
||||||
meta: {
|
meta: {
|
||||||
icon: FlUser,
|
icon: "flUser",
|
||||||
title: "menus.hsUser",
|
title: "menus.hsUser",
|
||||||
roles: ["admin"]
|
roles: ["admin"]
|
||||||
}
|
}
|
||||||
@@ -37,7 +29,7 @@ const systemRouter = {
|
|||||||
path: "/system/role/index",
|
path: "/system/role/index",
|
||||||
name: "Role",
|
name: "Role",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Role,
|
icon: "role",
|
||||||
title: "menus.hsRole",
|
title: "menus.hsRole",
|
||||||
roles: ["admin"]
|
roles: ["admin"]
|
||||||
}
|
}
|
||||||
@@ -46,21 +38,10 @@ const systemRouter = {
|
|||||||
path: "/system/dept/index",
|
path: "/system/dept/index",
|
||||||
name: "Dept",
|
name: "Dept",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Dept,
|
icon: "dept",
|
||||||
title: "menus.hsDept",
|
title: "menus.hsDept",
|
||||||
roles: ["admin"]
|
roles: ["admin"]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "/system/dict",
|
|
||||||
component: "/system/dict/index",
|
|
||||||
name: "Dict",
|
|
||||||
meta: {
|
|
||||||
icon: Dict,
|
|
||||||
title: "menus.hsDict",
|
|
||||||
keepAlive: true,
|
|
||||||
roles: ["admin"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
@@ -69,7 +50,7 @@ const permissionRouter = {
|
|||||||
path: "/permission",
|
path: "/permission",
|
||||||
meta: {
|
meta: {
|
||||||
title: "menus.permission",
|
title: "menus.permission",
|
||||||
icon: Lollipop,
|
icon: "lollipop",
|
||||||
rank: permission
|
rank: permission
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
@@ -96,7 +77,7 @@ const permissionRouter = {
|
|||||||
const frameRouter = {
|
const frameRouter = {
|
||||||
path: "/iframe",
|
path: "/iframe",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Monitor,
|
icon: "monitor",
|
||||||
title: "menus.hsExternalPage",
|
title: "menus.hsExternalPage",
|
||||||
rank: frame
|
rank: frame
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-pure-admin",
|
"name": "vue-pure-admin",
|
||||||
"version": "3.9.2",
|
"version": "3.9.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",
|
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",
|
||||||
@@ -35,8 +35,8 @@
|
|||||||
"@logicflow/core": "^1.1.30",
|
"@logicflow/core": "^1.1.30",
|
||||||
"@logicflow/extension": "^1.1.30",
|
"@logicflow/extension": "^1.1.30",
|
||||||
"@pureadmin/descriptions": "^1.1.0",
|
"@pureadmin/descriptions": "^1.1.0",
|
||||||
"@pureadmin/table": "^1.8.2",
|
"@pureadmin/table": "^1.8.3",
|
||||||
"@pureadmin/utils": "^1.7.2",
|
"@pureadmin/utils": "^1.7.4",
|
||||||
"@vueuse/core": "^9.6.0",
|
"@vueuse/core": "^9.6.0",
|
||||||
"@vueuse/motion": "2.0.0-beta.12",
|
"@vueuse/motion": "2.0.0-beta.12",
|
||||||
"@wangeditor/editor": "^5.1.21",
|
"@wangeditor/editor": "^5.1.21",
|
||||||
@@ -78,8 +78,6 @@
|
|||||||
"vue-virtual-scroller": "^2.0.0-alpha.1",
|
"vue-virtual-scroller": "^2.0.0-alpha.1",
|
||||||
"vue3-danmaku": "^1.1.0",
|
"vue3-danmaku": "^1.1.0",
|
||||||
"vuedraggable": "^4.1.0",
|
"vuedraggable": "^4.1.0",
|
||||||
"vxe-table": "^4.3.6",
|
|
||||||
"xe-utils": "^3.5.7",
|
|
||||||
"xgplayer": "^2.32.1",
|
"xgplayer": "^2.32.1",
|
||||||
"xlsx": "^0.18.5"
|
"xlsx": "^0.18.5"
|
||||||
},
|
},
|
||||||
@@ -115,7 +113,6 @@
|
|||||||
"eslint": "^8.8.0",
|
"eslint": "^8.8.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"eslint-plugin-vue": "^9.7.0",
|
"eslint-plugin-vue": "^9.7.0",
|
||||||
"font-awesome": "^4.7.0",
|
|
||||||
"husky": "^7.0.4",
|
"husky": "^7.0.4",
|
||||||
"lint-staged": "11.1.2",
|
"lint-staged": "11.1.2",
|
||||||
"picocolors": "^1.0.0",
|
"picocolors": "^1.0.0",
|
||||||
|
|||||||
50
pnpm-lock.yaml
generated
50
pnpm-lock.yaml
generated
@@ -14,9 +14,9 @@ specifiers:
|
|||||||
"@logicflow/core": ^1.1.30
|
"@logicflow/core": ^1.1.30
|
||||||
"@logicflow/extension": ^1.1.30
|
"@logicflow/extension": ^1.1.30
|
||||||
"@pureadmin/descriptions": ^1.1.0
|
"@pureadmin/descriptions": ^1.1.0
|
||||||
"@pureadmin/table": ^1.8.2
|
"@pureadmin/table": ^1.8.3
|
||||||
"@pureadmin/theme": ^2.4.0
|
"@pureadmin/theme": ^2.4.0
|
||||||
"@pureadmin/utils": ^1.7.2
|
"@pureadmin/utils": ^1.7.4
|
||||||
"@types/element-resize-detector": 1.1.3
|
"@types/element-resize-detector": 1.1.3
|
||||||
"@types/intro.js": ^5.1.0
|
"@types/intro.js": ^5.1.0
|
||||||
"@types/js-cookie": ^3.0.1
|
"@types/js-cookie": ^3.0.1
|
||||||
@@ -53,7 +53,6 @@ specifiers:
|
|||||||
eslint: ^8.8.0
|
eslint: ^8.8.0
|
||||||
eslint-plugin-prettier: ^4.0.0
|
eslint-plugin-prettier: ^4.0.0
|
||||||
eslint-plugin-vue: ^9.7.0
|
eslint-plugin-vue: ^9.7.0
|
||||||
font-awesome: ^4.7.0
|
|
||||||
husky: ^7.0.4
|
husky: ^7.0.4
|
||||||
intro.js: ^6.0.0
|
intro.js: ^6.0.0
|
||||||
js-cookie: ^3.0.1
|
js-cookie: ^3.0.1
|
||||||
@@ -114,8 +113,6 @@ specifiers:
|
|||||||
vue-virtual-scroller: ^2.0.0-alpha.1
|
vue-virtual-scroller: ^2.0.0-alpha.1
|
||||||
vue3-danmaku: ^1.1.0
|
vue3-danmaku: ^1.1.0
|
||||||
vuedraggable: ^4.1.0
|
vuedraggable: ^4.1.0
|
||||||
vxe-table: ^4.3.6
|
|
||||||
xe-utils: ^3.5.7
|
|
||||||
xgplayer: ^2.32.1
|
xgplayer: ^2.32.1
|
||||||
xlsx: ^0.18.5
|
xlsx: ^0.18.5
|
||||||
|
|
||||||
@@ -126,8 +123,8 @@ dependencies:
|
|||||||
"@logicflow/core": 1.1.31
|
"@logicflow/core": 1.1.31
|
||||||
"@logicflow/extension": 1.1.31
|
"@logicflow/extension": 1.1.31
|
||||||
"@pureadmin/descriptions": 1.1.1_element-plus@2.2.26
|
"@pureadmin/descriptions": 1.1.1_element-plus@2.2.26
|
||||||
"@pureadmin/table": 1.8.2_element-plus@2.2.26
|
"@pureadmin/table": 1.8.3_element-plus@2.2.26
|
||||||
"@pureadmin/utils": 1.7.2_aotapuqn7htzdjltsyimavekky
|
"@pureadmin/utils": 1.7.4_aotapuqn7htzdjltsyimavekky
|
||||||
"@vueuse/core": 9.6.0_vue@3.2.45
|
"@vueuse/core": 9.6.0_vue@3.2.45
|
||||||
"@vueuse/motion": 2.0.0-beta.12_vue@3.2.45
|
"@vueuse/motion": 2.0.0-beta.12_vue@3.2.45
|
||||||
"@wangeditor/editor": 5.1.23
|
"@wangeditor/editor": 5.1.23
|
||||||
@@ -169,8 +166,6 @@ dependencies:
|
|||||||
vue-virtual-scroller: 2.0.0-beta.3_vue@3.2.45
|
vue-virtual-scroller: 2.0.0-beta.3_vue@3.2.45
|
||||||
vue3-danmaku: 1.1.0_vue@3.2.45
|
vue3-danmaku: 1.1.0_vue@3.2.45
|
||||||
vuedraggable: 4.1.0_vue@3.2.45
|
vuedraggable: 4.1.0_vue@3.2.45
|
||||||
vxe-table: 4.3.6_vue@3.2.45+xe-utils@3.5.7
|
|
||||||
xe-utils: 3.5.7
|
|
||||||
xgplayer: 2.32.2
|
xgplayer: 2.32.2
|
||||||
xlsx: 0.18.5
|
xlsx: 0.18.5
|
||||||
|
|
||||||
@@ -206,7 +201,6 @@ devDependencies:
|
|||||||
eslint: 8.28.0
|
eslint: 8.28.0
|
||||||
eslint-plugin-prettier: 4.2.1_5qrnzwqb344w6up62gv3safeoi
|
eslint-plugin-prettier: 4.2.1_5qrnzwqb344w6up62gv3safeoi
|
||||||
eslint-plugin-vue: 9.8.0_eslint@8.28.0
|
eslint-plugin-vue: 9.8.0_eslint@8.28.0
|
||||||
font-awesome: 4.7.0
|
|
||||||
husky: 7.0.4
|
husky: 7.0.4
|
||||||
lint-staged: 11.1.2
|
lint-staged: 11.1.2
|
||||||
picocolors: 1.0.0
|
picocolors: 1.0.0
|
||||||
@@ -1277,10 +1271,10 @@ packages:
|
|||||||
vue: 3.2.45
|
vue: 3.2.45
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@pureadmin/table/1.8.2_element-plus@2.2.26:
|
/@pureadmin/table/1.8.3_element-plus@2.2.26:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-FGh1aOfgQtX16pCnP+bxg49TetcZDhdykIue0m5d8NIj6zkvJP53JU+DkUpvqvKmUiMsvIwme6e17BLZMmMiOw==
|
integrity: sha512-M+I+CDu74s/ffNybbDg0rHhiMHTdkgVIaksfmmrEwjuLB2nEaz7R0tob2qC5rKE96U2Z246meDHBidyQNx2z9w==
|
||||||
}
|
}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
element-plus: ^2.0.0
|
element-plus: ^2.0.0
|
||||||
@@ -1300,10 +1294,10 @@ packages:
|
|||||||
string-hash: 1.1.3
|
string-hash: 1.1.3
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@pureadmin/utils/1.7.2_aotapuqn7htzdjltsyimavekky:
|
/@pureadmin/utils/1.7.4_aotapuqn7htzdjltsyimavekky:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-L8tmogs9HCX6nuga1g79DcZr3KXNoWnIFcyP2z4zpmUmdBBAmMpXXz3Z+emI6HELmZu8DFx+v1MfKxccgsODRQ==
|
integrity: sha512-uJNHcb2sO7R2avALf+v4TGyuZtJix0Wpw/kMb6eO4C003ZQImuGGi9WlxHaOlESrMyFHZ1AjWm5AqLwJLnpVlw==
|
||||||
}
|
}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
dayjs: "*"
|
dayjs: "*"
|
||||||
@@ -4717,14 +4711,6 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/font-awesome/4.7.0:
|
|
||||||
resolution:
|
|
||||||
{
|
|
||||||
integrity: sha512-U6kGnykA/6bFmg1M/oT9EkFeIYv7JlX3bozwQJWiiLz6L0w3F5vBVPxHlwyX/vtNq1ckcpRKOB9f2Qal/VtFpg==
|
|
||||||
}
|
|
||||||
engines: { node: ">=0.10.3" }
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/form-data/4.0.0:
|
/form-data/4.0.0:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
@@ -8885,19 +8871,6 @@ packages:
|
|||||||
vue: 3.2.45
|
vue: 3.2.45
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/vxe-table/4.3.6_vue@3.2.45+xe-utils@3.5.7:
|
|
||||||
resolution:
|
|
||||||
{
|
|
||||||
integrity: sha512-SZ+ocVoOFc1PSzvpz6q5n7YvWvPSXUV+raet0zaSbQy3g8Dj7jKNlFbcsSoWZm8Uys9ufAQxeqYO5rRwOB2m7A==
|
|
||||||
}
|
|
||||||
peerDependencies:
|
|
||||||
vue: ^3.2.28
|
|
||||||
xe-utils: ^3.5.0
|
|
||||||
dependencies:
|
|
||||||
vue: 3.2.45
|
|
||||||
xe-utils: 3.5.7
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/webpack-sources/3.2.3:
|
/webpack-sources/3.2.3:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
@@ -9013,13 +8986,6 @@ packages:
|
|||||||
signal-exit: 3.0.7
|
signal-exit: 3.0.7
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/xe-utils/3.5.7:
|
|
||||||
resolution:
|
|
||||||
{
|
|
||||||
integrity: sha512-3H+fDBKBR2wLJgyA7k9C/w1Xljx6Maml5ukV0WDY06HjYyGs2FEz6XhcwRCLIDXX4pBP3Gu0nX9DbCeuuRA2Ew==
|
|
||||||
}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/xgplayer-subtitles/1.0.22:
|
/xgplayer-subtitles/1.0.22:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Version": "3.9.2",
|
"Version": "3.9.4",
|
||||||
"Title": "PureAdmin",
|
"Title": "PureAdmin",
|
||||||
"FixedHeader": true,
|
"FixedHeader": true,
|
||||||
"HiddenSideBar": false,
|
"HiddenSideBar": false,
|
||||||
|
|||||||
49
src/components/ReIcon/src/offlineIcon.ts
Normal file
49
src/components/ReIcon/src/offlineIcon.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import { addIcon } from "@iconify/vue/dist/offline";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 这里存放本地图标,在 src/layout/index.vue 文件中加载,避免在首启动加载
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 本地菜单图标,后端在路由的icon中返回对应的图标字符串并且前端在此处使用addIcon添加即可渲染菜单图标
|
||||||
|
import UbuntuFill from "@iconify-icons/ri/ubuntu-fill";
|
||||||
|
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 Lollipop from "@iconify-icons/ep/lollipop";
|
||||||
|
import Monitor from "@iconify-icons/ep/monitor";
|
||||||
|
addIcon("ubuntuFill", UbuntuFill);
|
||||||
|
addIcon("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("flUser", FlUser);
|
||||||
|
addIcon("role", Role);
|
||||||
|
addIcon("setting", Setting);
|
||||||
|
addIcon("dept", Dept);
|
||||||
|
addIcon("lollipop", Lollipop);
|
||||||
|
addIcon("monitor", Monitor);
|
||||||
|
|
||||||
|
// 非菜单图标
|
||||||
|
import RefreshRight from "@iconify-icons/ep/refresh-right";
|
||||||
|
addIcon("refreshRight", RefreshRight);
|
||||||
@@ -13,7 +13,6 @@ import { isString } from "@pureadmin/utils";
|
|||||||
import { propTypes } from "@/utils/propTypes";
|
import { propTypes } from "@/utils/propTypes";
|
||||||
import { IconifyIconOffline } from "../../ReIcon";
|
import { IconifyIconOffline } from "../../ReIcon";
|
||||||
import QRCode, { QRCodeRenderersOptions } from "qrcode";
|
import QRCode, { QRCodeRenderersOptions } from "qrcode";
|
||||||
import RefreshRight from "@iconify-icons/ep/refresh-right";
|
|
||||||
|
|
||||||
interface QrcodeLogo {
|
interface QrcodeLogo {
|
||||||
src?: string;
|
src?: string;
|
||||||
@@ -248,7 +247,7 @@ export default defineComponent({
|
|||||||
<div class="absolute top-[50%] left-[50%] font-bold">
|
<div class="absolute top-[50%] left-[50%] font-bold">
|
||||||
<IconifyIconOffline
|
<IconifyIconOffline
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
icon={RefreshRight}
|
icon="refreshRight"
|
||||||
width="30"
|
width="30"
|
||||||
color="var(--el-color-primary)"
|
color="var(--el-color-primary)"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { IconifyIconOffline } from "../../ReIcon";
|
|||||||
import Expand from "@iconify-icons/mdi/arrow-expand-down";
|
import Expand from "@iconify-icons/mdi/arrow-expand-down";
|
||||||
import ArrowCollapse from "@iconify-icons/mdi/arrow-collapse-vertical";
|
import ArrowCollapse from "@iconify-icons/mdi/arrow-collapse-vertical";
|
||||||
import Setting from "@iconify-icons/ri/settings-3-line";
|
import Setting from "@iconify-icons/ri/settings-3-line";
|
||||||
import RefreshRight from "@iconify-icons/ep/refresh-right";
|
|
||||||
|
|
||||||
export const loadingSvg = `
|
export const loadingSvg = `
|
||||||
<path class="path" d="
|
<path class="path" d="
|
||||||
@@ -153,7 +152,7 @@ export default defineComponent({
|
|||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
<IconifyIconOffline
|
<IconifyIconOffline
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
icon={RefreshRight}
|
icon="refreshRight"
|
||||||
width="16"
|
width="16"
|
||||||
color="text_color_regular"
|
color="text_color_regular"
|
||||||
onClick={() => emit("refresh")}
|
onClick={() => emit("refresh")}
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
unref,
|
||||||
|
watch,
|
||||||
|
reactive,
|
||||||
|
computed,
|
||||||
|
nextTick,
|
||||||
|
onBeforeMount
|
||||||
|
} from "vue";
|
||||||
import {
|
import {
|
||||||
useDark,
|
useDark,
|
||||||
debounce,
|
debounce,
|
||||||
@@ -17,7 +26,6 @@ import { useNav } from "@/layout/hooks/useNav";
|
|||||||
import { useAppStoreHook } from "@/store/modules/app";
|
import { useAppStoreHook } from "@/store/modules/app";
|
||||||
import { toggleTheme } from "@pureadmin/theme/dist/browser-utils";
|
import { toggleTheme } from "@pureadmin/theme/dist/browser-utils";
|
||||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||||
import { ref, unref, watch, reactive, computed, nextTick } from "vue";
|
|
||||||
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
|
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
|
||||||
|
|
||||||
import dayIcon from "@/assets/svg/day.svg?component";
|
import dayIcon from "@/assets/svg/day.svg?component";
|
||||||
@@ -189,16 +197,6 @@ function setLayoutModel(layout: string) {
|
|||||||
useAppStoreHook().setLayout(layout);
|
useAppStoreHook().setLayout(layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 初始化项目配置 */
|
|
||||||
nextTick(() => {
|
|
||||||
settings.greyVal &&
|
|
||||||
document.querySelector("html")?.setAttribute("class", "html-grey");
|
|
||||||
settings.weakVal &&
|
|
||||||
document.querySelector("html")?.setAttribute("class", "html-weakness");
|
|
||||||
settings.tabsVal && tagsChange();
|
|
||||||
dataThemeChange();
|
|
||||||
});
|
|
||||||
|
|
||||||
watch($storage, ({ layout }) => {
|
watch($storage, ({ layout }) => {
|
||||||
switch (layout["layout"]) {
|
switch (layout["layout"]) {
|
||||||
case "vertical":
|
case "vertical":
|
||||||
@@ -218,6 +216,18 @@ watch($storage, ({ layout }) => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onBeforeMount(() => {
|
||||||
|
dataThemeChange();
|
||||||
|
/* 初始化项目配置 */
|
||||||
|
nextTick(() => {
|
||||||
|
settings.greyVal &&
|
||||||
|
document.querySelector("html")?.setAttribute("class", "html-grey");
|
||||||
|
settings.weakVal &&
|
||||||
|
document.querySelector("html")?.setAttribute("class", "html-weakness");
|
||||||
|
settings.tabsVal && tagsChange();
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -41,7 +41,10 @@ watch(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="horizontal-header">
|
<div
|
||||||
|
v-loading="usePermissionStoreHook().wholeMenus.length === 0"
|
||||||
|
class="horizontal-header"
|
||||||
|
>
|
||||||
<div class="horizontal-header-left" @click="backHome">
|
<div class="horizontal-header-left" @click="backHome">
|
||||||
<FontIcon icon="team-iconlogo" svg style="width: 35px; height: 35px" />
|
<FontIcon icon="team-iconlogo" svg style="width: 35px; height: 35px" />
|
||||||
<h4>{{ title }}</h4>
|
<h4>{{ title }}</h4>
|
||||||
@@ -129,6 +132,10 @@ watch(
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-loading-mask) {
|
||||||
|
opacity: 0.45;
|
||||||
|
}
|
||||||
|
|
||||||
.translation {
|
.translation {
|
||||||
::v-deep(.el-dropdown-menu__item) {
|
::v-deep(.el-dropdown-menu__item) {
|
||||||
padding: 5px 40px;
|
padding: 5px 40px;
|
||||||
|
|||||||
@@ -58,7 +58,11 @@ watch(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="device !== 'mobile'" class="horizontal-header">
|
<div
|
||||||
|
v-if="device !== 'mobile'"
|
||||||
|
class="horizontal-header"
|
||||||
|
v-loading="usePermissionStoreHook().wholeMenus.length === 0"
|
||||||
|
>
|
||||||
<el-menu
|
<el-menu
|
||||||
router
|
router
|
||||||
ref="menuRef"
|
ref="menuRef"
|
||||||
@@ -161,6 +165,10 @@ watch(
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-loading-mask) {
|
||||||
|
opacity: 0.45;
|
||||||
|
}
|
||||||
|
|
||||||
.translation {
|
.translation {
|
||||||
::v-deep(.el-dropdown-menu__item) {
|
::v-deep(.el-dropdown-menu__item) {
|
||||||
padding: 5px 40px;
|
padding: 5px 40px;
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ function resolvePath(routePath) {
|
|||||||
placement="top"
|
placement="top"
|
||||||
:effect="tooltipEffect"
|
:effect="tooltipEffect"
|
||||||
:offset="-10"
|
:offset="-10"
|
||||||
:disabled="!isCollapse && !onlyOneChild.showTooltip"
|
:disabled="!onlyOneChild.showTooltip"
|
||||||
>
|
>
|
||||||
<template #content>
|
<template #content>
|
||||||
{{ transformI18n(onlyOneChild.meta.title) }}
|
{{ transformI18n(onlyOneChild.meta.title) }}
|
||||||
|
|||||||
@@ -59,7 +59,10 @@ watch(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :class="['sidebar-container', showLogo ? 'has-logo' : '']">
|
<div
|
||||||
|
v-loading="menuData.length === 0"
|
||||||
|
:class="['sidebar-container', showLogo ? 'has-logo' : '']"
|
||||||
|
>
|
||||||
<Logo v-if="showLogo" :collapse="isCollapse" />
|
<Logo v-if="showLogo" :collapse="isCollapse" />
|
||||||
<el-scrollbar
|
<el-scrollbar
|
||||||
wrap-class="scrollbar-wrapper"
|
wrap-class="scrollbar-wrapper"
|
||||||
@@ -91,3 +94,9 @@ watch(
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
:deep(.el-loading-mask) {
|
||||||
|
opacity: 0.45;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import "animate.css";
|
import "animate.css";
|
||||||
// vxe-table的所有icon不支持component模式,间接依赖了font-awesome
|
// 引入 src/components/ReIcon/src/offlineIcon.ts 文件中所有使用addIcon添加过的本地图标
|
||||||
import "font-awesome/css/font-awesome.min.css";
|
import "@/components/ReIcon/src/offlineIcon";
|
||||||
import { setType } from "./types";
|
import { setType } from "./types";
|
||||||
import { emitter } from "@/utils/mitt";
|
import { emitter } from "@/utils/mitt";
|
||||||
import { useLayout } from "./hooks/useLayout";
|
import { useLayout } from "./hooks/useLayout";
|
||||||
|
|||||||
@@ -2,19 +2,14 @@
|
|||||||
* @description ⚠️:此文件仅供主题插件使用,请不要在此文件中导出别的工具函数(仅在页面加载前运行)
|
* @description ⚠️:此文件仅供主题插件使用,请不要在此文件中导出别的工具函数(仅在页面加载前运行)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { EpThemeColor } from "../../../public/serverConfig.json";
|
|
||||||
|
|
||||||
type MultipleScopeVarsItem = {
|
type MultipleScopeVarsItem = {
|
||||||
scopeName: string;
|
scopeName: string;
|
||||||
varsContent: string;
|
varsContent: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 将vxe默认主题色和ep默认主题色保持一致 */
|
|
||||||
const vxeColor = EpThemeColor;
|
|
||||||
/** 预设主题色 */
|
/** 预设主题色 */
|
||||||
const themeColors = {
|
const themeColors = {
|
||||||
default: {
|
default: {
|
||||||
vxeColor,
|
|
||||||
subMenuActiveText: "#fff",
|
subMenuActiveText: "#fff",
|
||||||
menuBg: "#001529",
|
menuBg: "#001529",
|
||||||
menuHover: "#4091f7",
|
menuHover: "#4091f7",
|
||||||
@@ -26,7 +21,6 @@ const themeColors = {
|
|||||||
menuActiveBefore: "#4091f7"
|
menuActiveBefore: "#4091f7"
|
||||||
},
|
},
|
||||||
light: {
|
light: {
|
||||||
vxeColor,
|
|
||||||
subMenuActiveText: "#409eff",
|
subMenuActiveText: "#409eff",
|
||||||
menuBg: "#fff",
|
menuBg: "#fff",
|
||||||
menuHover: "#e0ebf6",
|
menuHover: "#e0ebf6",
|
||||||
@@ -38,7 +32,6 @@ const themeColors = {
|
|||||||
menuActiveBefore: "#4091f7"
|
menuActiveBefore: "#4091f7"
|
||||||
},
|
},
|
||||||
dusk: {
|
dusk: {
|
||||||
vxeColor: "#f5222d",
|
|
||||||
subMenuActiveText: "#fff",
|
subMenuActiveText: "#fff",
|
||||||
menuBg: "#2a0608",
|
menuBg: "#2a0608",
|
||||||
menuHover: "#e13c39",
|
menuHover: "#e13c39",
|
||||||
@@ -50,7 +43,6 @@ const themeColors = {
|
|||||||
menuActiveBefore: "#e13c39"
|
menuActiveBefore: "#e13c39"
|
||||||
},
|
},
|
||||||
volcano: {
|
volcano: {
|
||||||
vxeColor: "#fa541c",
|
|
||||||
subMenuActiveText: "#fff",
|
subMenuActiveText: "#fff",
|
||||||
menuBg: "#2b0e05",
|
menuBg: "#2b0e05",
|
||||||
menuHover: "#e85f33",
|
menuHover: "#e85f33",
|
||||||
@@ -62,7 +54,6 @@ const themeColors = {
|
|||||||
menuActiveBefore: "#e85f33"
|
menuActiveBefore: "#e85f33"
|
||||||
},
|
},
|
||||||
yellow: {
|
yellow: {
|
||||||
vxeColor: "#fadb14",
|
|
||||||
subMenuActiveText: "#d25f00",
|
subMenuActiveText: "#d25f00",
|
||||||
menuBg: "#2b2503",
|
menuBg: "#2b2503",
|
||||||
menuHover: "#f6da4d",
|
menuHover: "#f6da4d",
|
||||||
@@ -74,7 +65,6 @@ const themeColors = {
|
|||||||
menuActiveBefore: "#f6da4d"
|
menuActiveBefore: "#f6da4d"
|
||||||
},
|
},
|
||||||
mingQing: {
|
mingQing: {
|
||||||
vxeColor: "#13c2c2",
|
|
||||||
subMenuActiveText: "#fff",
|
subMenuActiveText: "#fff",
|
||||||
menuBg: "#032121",
|
menuBg: "#032121",
|
||||||
menuHover: "#59bfc1",
|
menuHover: "#59bfc1",
|
||||||
@@ -86,7 +76,6 @@ const themeColors = {
|
|||||||
menuActiveBefore: "#59bfc1"
|
menuActiveBefore: "#59bfc1"
|
||||||
},
|
},
|
||||||
auroraGreen: {
|
auroraGreen: {
|
||||||
vxeColor: "#52c41a",
|
|
||||||
subMenuActiveText: "#fff",
|
subMenuActiveText: "#fff",
|
||||||
menuBg: "#0b1e15",
|
menuBg: "#0b1e15",
|
||||||
menuHover: "#60ac80",
|
menuHover: "#60ac80",
|
||||||
@@ -98,7 +87,6 @@ const themeColors = {
|
|||||||
menuActiveBefore: "#60ac80"
|
menuActiveBefore: "#60ac80"
|
||||||
},
|
},
|
||||||
pink: {
|
pink: {
|
||||||
vxeColor: "#eb2f96",
|
|
||||||
subMenuActiveText: "#fff",
|
subMenuActiveText: "#fff",
|
||||||
menuBg: "#28081a",
|
menuBg: "#28081a",
|
||||||
menuHover: "#d84493",
|
menuHover: "#d84493",
|
||||||
@@ -110,7 +98,6 @@ const themeColors = {
|
|||||||
menuActiveBefore: "#d84493"
|
menuActiveBefore: "#d84493"
|
||||||
},
|
},
|
||||||
saucePurple: {
|
saucePurple: {
|
||||||
vxeColor: "#722ed1",
|
|
||||||
subMenuActiveText: "#fff",
|
subMenuActiveText: "#fff",
|
||||||
menuBg: "#130824",
|
menuBg: "#130824",
|
||||||
menuHover: "#693ac9",
|
menuHover: "#693ac9",
|
||||||
@@ -132,7 +119,6 @@ export const genScssMultipleScopeVars = (): MultipleScopeVarsItem[] => {
|
|||||||
result.push({
|
result.push({
|
||||||
scopeName: `layout-theme-${key}`,
|
scopeName: `layout-theme-${key}`,
|
||||||
varsContent: `
|
varsContent: `
|
||||||
$vxe-primary-color: ${themeColors[key].vxeColor} !default;
|
|
||||||
$subMenuActiveText: ${themeColors[key].subMenuActiveText} !default;
|
$subMenuActiveText: ${themeColors[key].subMenuActiveText} !default;
|
||||||
$menuBg: ${themeColors[key].menuBg} !default;
|
$menuBg: ${themeColors[key].menuBg} !default;
|
||||||
$menuHover: ${themeColors[key].menuHover} !default;
|
$menuHover: ${themeColors[key].menuHover} !default;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import type { IconifyIcon } from "@iconify/vue";
|
import type { IconifyIcon } from "@iconify/vue";
|
||||||
import HomeFilled from "@iconify-icons/ep/home-filled";
|
|
||||||
|
|
||||||
export const routerArrays: Array<RouteConfigs> = [
|
export const routerArrays: Array<RouteConfigs> = [
|
||||||
{
|
{
|
||||||
@@ -7,7 +6,7 @@ export const routerArrays: Array<RouteConfigs> = [
|
|||||||
parentPath: "/",
|
parentPath: "/",
|
||||||
meta: {
|
meta: {
|
||||||
title: "menus.hshome",
|
title: "menus.hshome",
|
||||||
icon: HomeFilled
|
icon: "homeFilled"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { getServerConfig } from "./config";
|
|||||||
import { createApp, Directive } from "vue";
|
import { createApp, Directive } from "vue";
|
||||||
import { MotionPlugin } from "@vueuse/motion";
|
import { MotionPlugin } from "@vueuse/motion";
|
||||||
import { useEcharts } from "@/plugins/echarts";
|
import { useEcharts } from "@/plugins/echarts";
|
||||||
import { useTable } from "@/plugins/vxe-table";
|
|
||||||
import { injectResponsiveStorage } from "@/utils/responsive";
|
import { injectResponsiveStorage } from "@/utils/responsive";
|
||||||
|
|
||||||
import Table from "@pureadmin/table";
|
import Table from "@pureadmin/table";
|
||||||
@@ -55,7 +54,6 @@ getServerConfig(app).then(async config => {
|
|||||||
.use(ElementPlus)
|
.use(ElementPlus)
|
||||||
.use(Table)
|
.use(Table)
|
||||||
.use(PureDescriptions)
|
.use(PureDescriptions)
|
||||||
.use(useTable)
|
|
||||||
.use(useEcharts);
|
.use(useEcharts);
|
||||||
app.mount("#app");
|
app.mount("#app");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
@import "vxe-table/styles/variable.scss";
|
|
||||||
@import "vxe-table/styles/modules.scss";
|
|
||||||
|
|
||||||
i {
|
|
||||||
border-color: initial;
|
|
||||||
}
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
import "xe-utils";
|
|
||||||
import "./index.scss";
|
|
||||||
import XEUtils from "xe-utils";
|
|
||||||
import { App, unref } 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,
|
|
||||||
// 表格功能
|
|
||||||
Icon,
|
|
||||||
Filter,
|
|
||||||
Edit,
|
|
||||||
Menu,
|
|
||||||
Export,
|
|
||||||
Keyboard,
|
|
||||||
Validator,
|
|
||||||
// 可选组件
|
|
||||||
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.setup({
|
|
||||||
size: "medium",
|
|
||||||
version: 0,
|
|
||||||
zIndex: 1002,
|
|
||||||
table: {
|
|
||||||
// 自动监听父元素的变化去重新计算表格
|
|
||||||
autoResize: true,
|
|
||||||
// 鼠标移到行是否要高亮显示
|
|
||||||
highlightHoverRow: true
|
|
||||||
},
|
|
||||||
input: {
|
|
||||||
clearable: true
|
|
||||||
},
|
|
||||||
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 useTable(app: App) {
|
|
||||||
app
|
|
||||||
.use(Icon)
|
|
||||||
.use(Filter)
|
|
||||||
.use(Edit)
|
|
||||||
.use(Menu)
|
|
||||||
.use(Export)
|
|
||||||
.use(Keyboard)
|
|
||||||
.use(Validator)
|
|
||||||
// 可选组件
|
|
||||||
.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,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { able } from "@/router/enums";
|
import { able } from "@/router/enums";
|
||||||
import UbuntuFill from "@iconify-icons/ri/ubuntu-fill";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/able",
|
path: "/able",
|
||||||
redirect: "/able/watermark",
|
redirect: "/able/watermark",
|
||||||
meta: {
|
meta: {
|
||||||
icon: UbuntuFill,
|
icon: "ubuntuFill",
|
||||||
title: $t("menus.hsAble"),
|
title: $t("menus.hsAble"),
|
||||||
rank: able
|
rank: able
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { components } from "@/router/enums";
|
import { components } from "@/router/enums";
|
||||||
import Menu from "@iconify-icons/ep/menu";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/components",
|
path: "/components",
|
||||||
redirect: "/components/video",
|
redirect: "/components/video",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Menu,
|
icon: "menu",
|
||||||
title: $t("menus.hscomponents"),
|
title: $t("menus.hscomponents"),
|
||||||
rank: components
|
rank: components
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { editor } from "@/router/enums";
|
import { editor } from "@/router/enums";
|
||||||
import Edit from "@iconify-icons/ep/edit";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/editor",
|
path: "/editor",
|
||||||
redirect: "/editor/index",
|
redirect: "/editor/index",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Edit,
|
icon: "edit",
|
||||||
title: $t("menus.hseditor"),
|
title: $t("menus.hseditor"),
|
||||||
rank: editor
|
rank: editor
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { error } from "@/router/enums";
|
import { error } from "@/router/enums";
|
||||||
import InformationLine from "@iconify-icons/ri/information-line";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/error",
|
path: "/error",
|
||||||
redirect: "/error/403",
|
redirect: "/error/403",
|
||||||
meta: {
|
meta: {
|
||||||
icon: InformationLine,
|
icon: "informationLine",
|
||||||
title: $t("menus.hsabnormal"),
|
title: $t("menus.hsabnormal"),
|
||||||
rank: error
|
rank: error
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { flowchart } from "@/router/enums";
|
import { flowchart } from "@/router/enums";
|
||||||
import SetUp from "@iconify-icons/ep/set-up";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/flowChart",
|
path: "/flowChart",
|
||||||
redirect: "/flowChart/index",
|
redirect: "/flowChart/index",
|
||||||
meta: {
|
meta: {
|
||||||
icon: SetUp,
|
icon: "setUp",
|
||||||
title: $t("menus.hsflowChart"),
|
title: $t("menus.hsflowChart"),
|
||||||
rank: flowchart
|
rank: flowchart
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,13 +2,11 @@ import { $t } from "@/plugins/i18n";
|
|||||||
import { formdesign } from "@/router/enums";
|
import { formdesign } from "@/router/enums";
|
||||||
const IFrame = () => import("@/layout/frameView.vue");
|
const IFrame = () => import("@/layout/frameView.vue");
|
||||||
|
|
||||||
import TerminalWindowLine from "@iconify-icons/ri/terminal-window-line";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/formDesign",
|
path: "/formDesign",
|
||||||
redirect: "/formDesign/index",
|
redirect: "/formDesign/index",
|
||||||
meta: {
|
meta: {
|
||||||
icon: TerminalWindowLine,
|
icon: "terminalWindowLine",
|
||||||
title: $t("menus.hsFormDesign"),
|
title: $t("menus.hsFormDesign"),
|
||||||
rank: formdesign
|
rank: formdesign
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { guide } from "@/router/enums";
|
import { guide } from "@/router/enums";
|
||||||
import Guide from "@iconify-icons/ep/guide";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/guide",
|
path: "/guide",
|
||||||
redirect: "/guide/index",
|
redirect: "/guide/index",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Guide,
|
icon: "guide",
|
||||||
title: $t("menus.hsguide"),
|
title: $t("menus.hsguide"),
|
||||||
rank: guide
|
rank: guide
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { home } from "@/router/enums";
|
import { home } from "@/router/enums";
|
||||||
const Layout = () => import("@/layout/index.vue");
|
const Layout = () => import("@/layout/index.vue");
|
||||||
import HomeFilled from "@iconify-icons/ep/home-filled";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/",
|
path: "/",
|
||||||
@@ -9,7 +8,7 @@ export default {
|
|||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: "/welcome",
|
redirect: "/welcome",
|
||||||
meta: {
|
meta: {
|
||||||
icon: HomeFilled,
|
icon: "homeFilled",
|
||||||
title: $t("menus.hshome"),
|
title: $t("menus.hshome"),
|
||||||
rank: home
|
rank: home
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { list } from "@/router/enums";
|
import { list } from "@/router/enums";
|
||||||
import ListCheck from "@iconify-icons/ri/list-check";
|
|
||||||
import Card from "@iconify-icons/ri/bank-card-line";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/list",
|
path: "/list",
|
||||||
redirect: "/list/card",
|
redirect: "/list/card",
|
||||||
meta: {
|
meta: {
|
||||||
icon: ListCheck,
|
icon: "listCheck",
|
||||||
title: $t("menus.hsList"),
|
title: $t("menus.hsList"),
|
||||||
rank: list
|
rank: list
|
||||||
},
|
},
|
||||||
@@ -17,7 +15,7 @@ export default {
|
|||||||
name: "ListCard",
|
name: "ListCard",
|
||||||
component: () => import("@/views/list/card/index.vue"),
|
component: () => import("@/views/list/card/index.vue"),
|
||||||
meta: {
|
meta: {
|
||||||
icon: Card,
|
icon: "card",
|
||||||
title: $t("menus.hsListCard"),
|
title: $t("menus.hsListCard"),
|
||||||
showParent: true
|
showParent: true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { nested } from "@/router/enums";
|
import { nested } from "@/router/enums";
|
||||||
import Histogram from "@iconify-icons/ep/histogram";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/nested",
|
path: "/nested",
|
||||||
redirect: "/nested/menu1/menu1-1",
|
redirect: "/nested/menu1/menu1-1",
|
||||||
meta: {
|
meta: {
|
||||||
title: $t("menus.hsmenus"),
|
title: $t("menus.hsmenus"),
|
||||||
icon: Histogram,
|
icon: "histogram",
|
||||||
rank: nested
|
rank: nested
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { ppt } from "@/router/enums";
|
import { ppt } from "@/router/enums";
|
||||||
const IFrame = () => import("@/layout/frameView.vue");
|
const IFrame = () => import("@/layout/frameView.vue");
|
||||||
import Ppt from "@iconify-icons/ri/file-ppt-2-line";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/ppt",
|
path: "/ppt",
|
||||||
redirect: "/ppt/index",
|
redirect: "/ppt/index",
|
||||||
meta: {
|
meta: {
|
||||||
icon: Ppt,
|
icon: "ppt",
|
||||||
title: "PPT",
|
title: "PPT",
|
||||||
rank: ppt
|
rank: ppt
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
const Layout = () => import("@/layout/index.vue");
|
const Layout = () => import("@/layout/index.vue");
|
||||||
import HomeFilled from "@iconify-icons/ep/home-filled";
|
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
@@ -17,7 +16,7 @@ export default [
|
|||||||
path: "/redirect",
|
path: "/redirect",
|
||||||
component: Layout,
|
component: Layout,
|
||||||
meta: {
|
meta: {
|
||||||
icon: HomeFilled,
|
icon: "homeFilled",
|
||||||
title: $t("menus.hshome"),
|
title: $t("menus.hshome"),
|
||||||
showLink: false,
|
showLink: false,
|
||||||
rank: 102
|
rank: 102
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { $t } from "@/plugins/i18n";
|
import { $t } from "@/plugins/i18n";
|
||||||
import { result } from "@/router/enums";
|
import { result } from "@/router/enums";
|
||||||
import CheckboxCircleLine from "@iconify-icons/ri/checkbox-circle-line";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/result",
|
path: "/result",
|
||||||
redirect: "/result/success",
|
redirect: "/result/success",
|
||||||
meta: {
|
meta: {
|
||||||
icon: CheckboxCircleLine,
|
icon: "checkboxCircleLine",
|
||||||
title: $t("menus.hsResult"),
|
title: $t("menus.hsResult"),
|
||||||
rank: result
|
rank: result
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ function initRouter() {
|
|||||||
} else {
|
} else {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
getAsyncRoutes().then(({ data }) => {
|
getAsyncRoutes().then(({ data }) => {
|
||||||
handleAsyncRoutes(data);
|
handleAsyncRoutes(cloneDeep(data));
|
||||||
storageSession.setItem(key, data);
|
storageSession.setItem(key, data);
|
||||||
resolve(router);
|
resolve(router);
|
||||||
});
|
});
|
||||||
@@ -207,7 +207,7 @@ function initRouter() {
|
|||||||
} else {
|
} else {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
getAsyncRoutes().then(({ data }) => {
|
getAsyncRoutes().then(({ data }) => {
|
||||||
handleAsyncRoutes(data);
|
handleAsyncRoutes(cloneDeep(data));
|
||||||
resolve(router);
|
resolve(router);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -41,97 +41,6 @@ html.dark {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vxe-table */
|
|
||||||
.vxe-table--header-wrapper,
|
|
||||||
.vxe-table--body-wrapper {
|
|
||||||
color: var(--el-text-color-primary);
|
|
||||||
background: var(--el-bg-color) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-table--render-default.border--full .vxe-header--column,
|
|
||||||
.vxe-table--render-default.border--full .vxe-body--column,
|
|
||||||
.vxe-table--render-default.border--full .vxe-footer--column {
|
|
||||||
background-image: linear-gradient(
|
|
||||||
var(--el-border-color-lighter),
|
|
||||||
var(--el-border-color-lighter)
|
|
||||||
),
|
|
||||||
linear-gradient(
|
|
||||||
var(--el-border-color-lighter),
|
|
||||||
var(--el-border-color-lighter)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 表头 */
|
|
||||||
.vxe-table--header-wrapper {
|
|
||||||
background: #262727 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-table--render-wrapper,
|
|
||||||
.vxe-table--main-wrapper {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-pager.is--perfect,
|
|
||||||
.vxe-table--render-default .vxe-table--border-line {
|
|
||||||
border: 1px solid var(--el-border-color-lighter);
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-table--header-border-line {
|
|
||||||
border-bottom: 1px solid var(--el-border-color-lighter) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-body--row.row--hover,
|
|
||||||
.vxe-pager {
|
|
||||||
background-color: #262727;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-input--inner,
|
|
||||||
.vxe-pager .vxe-pager--jump-prev,
|
|
||||||
.vxe-pager .vxe-pager--prev-btn,
|
|
||||||
.vxe-pager .vxe-pager--next-btn,
|
|
||||||
.vxe-pager .vxe-pager--jump-next,
|
|
||||||
.vxe-pager .vxe-pager--num-btn,
|
|
||||||
.vxe-pager .vxe-pager--jump .vxe-pager--goto {
|
|
||||||
background-color: transparent;
|
|
||||||
color: var(--el-text-color-primary);
|
|
||||||
// outline: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-select-option--wrapper {
|
|
||||||
background: var(--el-bg-color) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-select-option:not(.is--disabled).is--hover {
|
|
||||||
background: var(--el-color-primary-light-6) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-modal--wrapper.type--modal .vxe-modal--box,
|
|
||||||
.vxe-modal--wrapper.type--alert .vxe-modal--box,
|
|
||||||
.vxe-modal--wrapper.type--confirm .vxe-modal--box,
|
|
||||||
.vxe-form {
|
|
||||||
background: var(--el-bg-color) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-modal--box,
|
|
||||||
.vxe-modal--header {
|
|
||||||
border: none;
|
|
||||||
background: var(--el-bg-color) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-modal--title,
|
|
||||||
.vxe-button--content,
|
|
||||||
.vxe-modal--header-title {
|
|
||||||
color: var(--el-text-color-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-button.type--button:hover {
|
|
||||||
background: var(--el-color-primary) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-button {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 项目配置面板 */
|
/* 项目配置面板 */
|
||||||
.right-panel-items {
|
.right-panel-items {
|
||||||
.el-divider__text {
|
.el-divider__text {
|
||||||
|
|||||||
@@ -19,9 +19,3 @@
|
|||||||
.html-weakness {
|
.html-weakness {
|
||||||
filter: invert(80%);
|
filter: invert(80%);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 重置 vxe-table 样式 */
|
|
||||||
.vxe-button.type--button.theme--primary:hover,
|
|
||||||
.vxe-pager .vxe-pager--num-btn:not(.is--disabled).is--active {
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
import Print from "@/utils/print";
|
import Print from "@/utils/print";
|
||||||
import { reactive, ref } from "vue";
|
|
||||||
import { VxeTablePropTypes } from "vxe-table";
|
|
||||||
import Line from "../welcome/components/Line.vue";
|
import Line from "../welcome/components/Line.vue";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@@ -14,43 +13,6 @@ interface User {
|
|||||||
address: string;
|
address: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const demo1 = reactive({
|
|
||||||
tableData: [
|
|
||||||
{
|
|
||||||
id: 10001,
|
|
||||||
name: "Test1",
|
|
||||||
role: "Develop",
|
|
||||||
sex: "Man",
|
|
||||||
age: 28,
|
|
||||||
address: "test abc"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 10002,
|
|
||||||
name: "Test2",
|
|
||||||
role: "Test",
|
|
||||||
sex: "Women",
|
|
||||||
age: 22,
|
|
||||||
address: "Guangzhou"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 10003,
|
|
||||||
name: "Test3",
|
|
||||||
role: "PM",
|
|
||||||
sex: "Man",
|
|
||||||
age: 32,
|
|
||||||
address: "Shanghai"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 10004,
|
|
||||||
name: "Test4",
|
|
||||||
role: "Designer",
|
|
||||||
sex: "Women",
|
|
||||||
age: 24,
|
|
||||||
address: "Shanghai"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const value = ref("1");
|
const value = ref("1");
|
||||||
|
|
||||||
const options = [
|
const options = [
|
||||||
@@ -59,11 +21,6 @@ const options = [
|
|||||||
el: ".el-table",
|
el: ".el-table",
|
||||||
label: "Element-Plus Table"
|
label: "Element-Plus Table"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
value: "2",
|
|
||||||
el: ".vxe-table",
|
|
||||||
label: "Vxe Table"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
value: "3",
|
value: "3",
|
||||||
el: ".echart",
|
el: ".echart",
|
||||||
@@ -81,38 +38,6 @@ function onPrint() {
|
|||||||
Print(el).toPrint;
|
Print(el).toPrint;
|
||||||
}
|
}
|
||||||
|
|
||||||
const headerCellStyle: VxeTablePropTypes.HeaderCellStyle = ({ column }) => {
|
|
||||||
if (column.property === "name") {
|
|
||||||
return {
|
|
||||||
backgroundColor: "#f60",
|
|
||||||
color: "#ffffff"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const rowStyle: VxeTablePropTypes.RowStyle = ({ rowIndex }) => {
|
|
||||||
if ([2, 3, 5].includes(rowIndex)) {
|
|
||||||
return {
|
|
||||||
backgroundColor: "red",
|
|
||||||
color: "#ffffff"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const cellStyle: VxeTablePropTypes.CellStyle = ({ row, column }) => {
|
|
||||||
if (column.property === "sex") {
|
|
||||||
if (row.sex >= "1") {
|
|
||||||
return {
|
|
||||||
backgroundColor: "#187"
|
|
||||||
};
|
|
||||||
} else if (row.age === 26) {
|
|
||||||
return {
|
|
||||||
backgroundColor: "#2db7f5"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const tableRowClassName = ({ rowIndex }: { row: User; rowIndex: number }) => {
|
const tableRowClassName = ({ rowIndex }: { row: User; rowIndex: number }) => {
|
||||||
if (rowIndex === 1) {
|
if (rowIndex === 1) {
|
||||||
return "warning-row";
|
return "warning-row";
|
||||||
@@ -205,45 +130,6 @@ const tableData: User[] = [
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col
|
|
||||||
:xs="22"
|
|
||||||
:sm="22"
|
|
||||||
:md="11"
|
|
||||||
:lg="11"
|
|
||||||
:xl="11"
|
|
||||||
style="margin: 10px; border: 0.01rem solid var(--el-color-primary)"
|
|
||||||
v-motion
|
|
||||||
:initial="{
|
|
||||||
opacity: 0,
|
|
||||||
y: 100
|
|
||||||
}"
|
|
||||||
:enter="{
|
|
||||||
opacity: 1,
|
|
||||||
y: 0,
|
|
||||||
transition: {
|
|
||||||
delay: 200
|
|
||||||
}
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<p class="font-medium pt-1">Vxe Table</p>
|
|
||||||
<vxe-table
|
|
||||||
class="vxe-table"
|
|
||||||
border
|
|
||||||
style="margin: 40px auto"
|
|
||||||
:header-cell-style="headerCellStyle"
|
|
||||||
:row-style="rowStyle"
|
|
||||||
:cell-style="cellStyle"
|
|
||||||
:data="demo1.tableData"
|
|
||||||
>
|
|
||||||
<vxe-column type="seq" width="60" />
|
|
||||||
<vxe-column field="name" title="Name" />
|
|
||||||
<vxe-column field="sex" title="Sex" />
|
|
||||||
<vxe-column field="age" title="Age" />
|
|
||||||
<vxe-column field="attr1" title="Attr1" />
|
|
||||||
<vxe-column field="address" title="Address" show-overflow />
|
|
||||||
</vxe-table>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col
|
<el-col
|
||||||
:xs="22"
|
:xs="22"
|
||||||
:sm="22"
|
:sm="22"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import Page from "./page/index.vue";
|
||||||
import RowDrag from "./drag/row/index.vue";
|
import RowDrag from "./drag/row/index.vue";
|
||||||
import ColumnDrag from "./drag/column/index.vue";
|
import ColumnDrag from "./drag/column/index.vue";
|
||||||
import Contextmenu from "./contextmenu/index.vue";
|
import Contextmenu from "./contextmenu/index.vue";
|
||||||
@@ -6,11 +7,24 @@ import Edit from "./edit/index.vue";
|
|||||||
import Watermark from "./watermark/index.vue";
|
import Watermark from "./watermark/index.vue";
|
||||||
import Print from "./prints/index.vue";
|
import Print from "./prints/index.vue";
|
||||||
import Echarts from "./echarts/index.vue";
|
import Echarts from "./echarts/index.vue";
|
||||||
|
import TableSelect from "./table-select/index.vue";
|
||||||
|
|
||||||
const rendContent = (val: string) =>
|
const rendContent = (val: string) =>
|
||||||
`代码位置:src/views/pure-table/high/${val}/index.vue`;
|
`代码位置:src/views/pure-table/high/${val}/index.vue`;
|
||||||
|
|
||||||
export const list = [
|
export const list = [
|
||||||
|
{
|
||||||
|
key: "page",
|
||||||
|
content: rendContent("page"),
|
||||||
|
title: "分页、加载动画",
|
||||||
|
component: Page
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "tableSelect",
|
||||||
|
content: rendContent("table-select"),
|
||||||
|
title: "表格选择器",
|
||||||
|
component: TableSelect
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: "rowDrag",
|
key: "rowDrag",
|
||||||
content: rendContent("drag/row"),
|
content: rendContent("drag/row"),
|
||||||
|
|||||||
91
src/views/pure-table/high/page/columns.tsx
Normal file
91
src/views/pure-table/high/page/columns.tsx
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
import { tableData } from "../data";
|
||||||
|
import { clone, delay } from "@pureadmin/utils";
|
||||||
|
import { ref, onMounted, reactive, watchEffect } from "vue";
|
||||||
|
import type { PaginationProps, LoadingConfig, Align } from "@pureadmin/table";
|
||||||
|
|
||||||
|
export function useColumns() {
|
||||||
|
const dataList = ref([]);
|
||||||
|
const loading = ref(true);
|
||||||
|
const paginationAlign = ref("right");
|
||||||
|
const columns: TableColumnList = [
|
||||||
|
{
|
||||||
|
label: "日期",
|
||||||
|
prop: "date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "姓名",
|
||||||
|
prop: "name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "地址",
|
||||||
|
prop: "address"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
/** 分页配置 */
|
||||||
|
const pagination = reactive<PaginationProps>({
|
||||||
|
pageSize: 10,
|
||||||
|
currentPage: 1,
|
||||||
|
pageSizes: [10, 15, 20],
|
||||||
|
total: 0,
|
||||||
|
align: "right",
|
||||||
|
background: true
|
||||||
|
});
|
||||||
|
|
||||||
|
/** 加载动画配置 */
|
||||||
|
const loadingConfig = reactive<LoadingConfig>({
|
||||||
|
text: "正在加载第一页...",
|
||||||
|
viewBox: "-10, -10, 50, 50",
|
||||||
|
spinner: `
|
||||||
|
<path class="path" d="
|
||||||
|
M 30 15
|
||||||
|
L 28 17
|
||||||
|
M 25.61 25.61
|
||||||
|
A 15 15, 0, 0, 1, 15 30
|
||||||
|
A 15 15, 0, 1, 1, 27.99 7.5
|
||||||
|
L 15 15
|
||||||
|
" style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
|
||||||
|
`
|
||||||
|
// svg: "",
|
||||||
|
// background: rgba()
|
||||||
|
});
|
||||||
|
|
||||||
|
function onSizeChange(val) {
|
||||||
|
console.log("onSizeChange", val);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onCurrentChange(val) {
|
||||||
|
loadingConfig.text = `正在加载第${val}页...`;
|
||||||
|
loading.value = true;
|
||||||
|
delay(600).then(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
watchEffect(() => {
|
||||||
|
pagination.align = paginationAlign.value as Align;
|
||||||
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
delay(600).then(() => {
|
||||||
|
const newList = [];
|
||||||
|
Array.from({ length: 6 }).forEach(() => {
|
||||||
|
newList.push(clone(tableData, true));
|
||||||
|
});
|
||||||
|
dataList.value = newList.flat(Infinity);
|
||||||
|
pagination.total = dataList.value.length;
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
loading,
|
||||||
|
columns,
|
||||||
|
dataList,
|
||||||
|
pagination,
|
||||||
|
loadingConfig,
|
||||||
|
paginationAlign,
|
||||||
|
onSizeChange,
|
||||||
|
onCurrentChange
|
||||||
|
};
|
||||||
|
}
|
||||||
46
src/views/pure-table/high/page/index.vue
Normal file
46
src/views/pure-table/high/page/index.vue
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { useColumns } from "./columns";
|
||||||
|
|
||||||
|
const {
|
||||||
|
loading,
|
||||||
|
columns,
|
||||||
|
dataList,
|
||||||
|
pagination,
|
||||||
|
loadingConfig,
|
||||||
|
paginationAlign,
|
||||||
|
onSizeChange,
|
||||||
|
onCurrentChange
|
||||||
|
} = useColumns();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-space class="float-right mb-2">
|
||||||
|
<p>分页的对齐方式:</p>
|
||||||
|
<el-radio-group v-model="paginationAlign">
|
||||||
|
<el-radio-button label="right">right</el-radio-button>
|
||||||
|
<el-radio-button label="center">center</el-radio-button>
|
||||||
|
<el-radio-button label="left">left</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-space>
|
||||||
|
<pure-table
|
||||||
|
border
|
||||||
|
row-key="id"
|
||||||
|
alignWhole="center"
|
||||||
|
showOverflowTooltip
|
||||||
|
:loading="loading"
|
||||||
|
:loading-config="loadingConfig"
|
||||||
|
:height="440"
|
||||||
|
:data="
|
||||||
|
dataList.slice(
|
||||||
|
(pagination.currentPage - 1) * pagination.pageSize,
|
||||||
|
pagination.currentPage * pagination.pageSize
|
||||||
|
)
|
||||||
|
"
|
||||||
|
:columns="columns"
|
||||||
|
:pagination="pagination"
|
||||||
|
@size-change="onSizeChange"
|
||||||
|
@current-change="onCurrentChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
20
src/views/pure-table/high/table-select/index.vue
Normal file
20
src/views/pure-table/high/table-select/index.vue
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
import radioSelectTable from "./radio/index.vue";
|
||||||
|
import multipleSelectTable from "./multiple/index.vue";
|
||||||
|
|
||||||
|
const model = ref("radio");
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-space>
|
||||||
|
<el-radio-group v-model="model">
|
||||||
|
<el-radio-button label="radio">单选</el-radio-button>
|
||||||
|
<el-radio-button label="multiple">多选</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
<el-divider direction="vertical" />
|
||||||
|
<component
|
||||||
|
:is="model === 'radio' ? radioSelectTable : multipleSelectTable"
|
||||||
|
/>
|
||||||
|
</el-space>
|
||||||
|
</template>
|
||||||
74
src/views/pure-table/high/table-select/multiple/columns.tsx
Normal file
74
src/views/pure-table/high/table-select/multiple/columns.tsx
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
import { tableDataEdit } from "../../data";
|
||||||
|
import { ref, reactive, type Ref } from "vue";
|
||||||
|
import type { PaginationProps } from "@pureadmin/table";
|
||||||
|
|
||||||
|
export function useColumns(selectRef: Ref, tableRef: Ref) {
|
||||||
|
const selectValue = ref([]);
|
||||||
|
const columns: TableColumnList = [
|
||||||
|
{
|
||||||
|
type: "selection",
|
||||||
|
align: "left"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "ID",
|
||||||
|
prop: "id",
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "日期",
|
||||||
|
prop: "date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "姓名",
|
||||||
|
prop: "name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "地址",
|
||||||
|
prop: "address"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
/** 分页配置 */
|
||||||
|
const pagination = reactive<PaginationProps>({
|
||||||
|
pageSize: 10,
|
||||||
|
currentPage: 1,
|
||||||
|
layout: "prev, pager, next",
|
||||||
|
total: tableDataEdit.length,
|
||||||
|
background: true,
|
||||||
|
small: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleSelectionChange = val => {
|
||||||
|
const arr = [];
|
||||||
|
val.forEach(v => {
|
||||||
|
arr.push(v.name);
|
||||||
|
});
|
||||||
|
selectValue.value = arr;
|
||||||
|
};
|
||||||
|
|
||||||
|
const removeTag = val => {
|
||||||
|
// TODO optimize el-select add formatter
|
||||||
|
const { toggleRowSelection } = tableRef.value.getTableRef();
|
||||||
|
toggleRowSelection(tableDataEdit.filter(v => v.name === val)[0], false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onClear = () => {
|
||||||
|
const { clearSelection } = tableRef.value.getTableRef();
|
||||||
|
clearSelection();
|
||||||
|
};
|
||||||
|
|
||||||
|
const onSure = () => {
|
||||||
|
selectRef.value.blur();
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
pagination,
|
||||||
|
selectValue,
|
||||||
|
tableDataEdit,
|
||||||
|
onSure,
|
||||||
|
onClear,
|
||||||
|
removeTag,
|
||||||
|
handleSelectionChange
|
||||||
|
};
|
||||||
|
}
|
||||||
65
src/views/pure-table/high/table-select/multiple/index.vue
Normal file
65
src/views/pure-table/high/table-select/multiple/index.vue
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
import { useColumns } from "./columns";
|
||||||
|
|
||||||
|
const selectRef = ref();
|
||||||
|
const tableRef = ref();
|
||||||
|
const {
|
||||||
|
columns,
|
||||||
|
pagination,
|
||||||
|
selectValue,
|
||||||
|
tableDataEdit,
|
||||||
|
onClear,
|
||||||
|
onSure,
|
||||||
|
removeTag,
|
||||||
|
handleSelectionChange
|
||||||
|
} = useColumns(selectRef, tableRef);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-select
|
||||||
|
class="w-[160px]"
|
||||||
|
ref="selectRef"
|
||||||
|
v-model="selectValue"
|
||||||
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
collapse-tags-tooltip
|
||||||
|
@remove-tag="removeTag"
|
||||||
|
@clear="onClear"
|
||||||
|
>
|
||||||
|
<template #empty>
|
||||||
|
<div class="w-[600px] m-4">
|
||||||
|
<pure-table
|
||||||
|
ref="tableRef"
|
||||||
|
height="355"
|
||||||
|
row-key="id"
|
||||||
|
:header-cell-style="{
|
||||||
|
background: '#f5f7fa',
|
||||||
|
color: '#303133'
|
||||||
|
}"
|
||||||
|
:data="
|
||||||
|
tableDataEdit.slice(
|
||||||
|
(pagination.currentPage - 1) * pagination.pageSize,
|
||||||
|
pagination.currentPage * pagination.pageSize
|
||||||
|
)
|
||||||
|
"
|
||||||
|
:columns="columns"
|
||||||
|
:pagination="pagination"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="absolute bottom-[17px]"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
text
|
||||||
|
bg
|
||||||
|
@click="onSure"
|
||||||
|
>
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
61
src/views/pure-table/high/table-select/radio/columns.tsx
Normal file
61
src/views/pure-table/high/table-select/radio/columns.tsx
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import { message } from "@/utils/message";
|
||||||
|
import { tableDataEdit } from "../../data";
|
||||||
|
import { ref, reactive, type Ref } from "vue";
|
||||||
|
import type { PaginationProps } from "@pureadmin/table";
|
||||||
|
|
||||||
|
export function useColumns(selectRef: Ref) {
|
||||||
|
const selectValue = ref("");
|
||||||
|
const columns: TableColumnList = [
|
||||||
|
{
|
||||||
|
label: "ID",
|
||||||
|
prop: "id",
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "日期",
|
||||||
|
prop: "date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "姓名",
|
||||||
|
prop: "name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "地址",
|
||||||
|
prop: "address"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
/** 分页配置 */
|
||||||
|
const pagination = reactive<PaginationProps>({
|
||||||
|
pageSize: 5,
|
||||||
|
currentPage: 1,
|
||||||
|
layout: "prev, pager, next",
|
||||||
|
total: tableDataEdit.length,
|
||||||
|
background: true,
|
||||||
|
small: true
|
||||||
|
});
|
||||||
|
|
||||||
|
/** 高亮当前选中行 */
|
||||||
|
function rowStyle({ row: { name } }) {
|
||||||
|
return {
|
||||||
|
cursor: "pointer",
|
||||||
|
background: name === selectValue.value ? "#f5f7fa" : ""
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 行点击 */
|
||||||
|
function onRowClick(row) {
|
||||||
|
selectValue.value = row.name;
|
||||||
|
selectRef.value.blur();
|
||||||
|
message(`当前选中行的数据为:${JSON.stringify(row)}`, { type: "success" });
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
pagination,
|
||||||
|
selectValue,
|
||||||
|
tableDataEdit,
|
||||||
|
rowStyle,
|
||||||
|
onRowClick
|
||||||
|
};
|
||||||
|
}
|
||||||
46
src/views/pure-table/high/table-select/radio/index.vue
Normal file
46
src/views/pure-table/high/table-select/radio/index.vue
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
import { useColumns } from "./columns";
|
||||||
|
|
||||||
|
const selectRef = ref();
|
||||||
|
const {
|
||||||
|
columns,
|
||||||
|
pagination,
|
||||||
|
selectValue,
|
||||||
|
tableDataEdit,
|
||||||
|
rowStyle,
|
||||||
|
onRowClick
|
||||||
|
} = useColumns(selectRef);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-select
|
||||||
|
ref="selectRef"
|
||||||
|
v-model="selectValue"
|
||||||
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<template #empty>
|
||||||
|
<div class="w-[600px] m-4">
|
||||||
|
<pure-table
|
||||||
|
height="355"
|
||||||
|
row-key="id"
|
||||||
|
:header-cell-style="{
|
||||||
|
background: '#f5f7fa',
|
||||||
|
color: '#303133'
|
||||||
|
}"
|
||||||
|
:row-style="rowStyle"
|
||||||
|
:data="
|
||||||
|
tableDataEdit.slice(
|
||||||
|
(pagination.currentPage - 1) * pagination.pageSize,
|
||||||
|
pagination.currentPage * pagination.pageSize
|
||||||
|
)
|
||||||
|
"
|
||||||
|
:columns="columns"
|
||||||
|
:pagination="pagination"
|
||||||
|
@row-click="onRowClick"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
@@ -1,176 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import { useI18n } from "vue-i18n";
|
|
||||||
import { ref, reactive } from "vue";
|
|
||||||
import { type Direction } from "element-plus";
|
|
||||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
|
||||||
import { type VxeTableEvents, type VxeTableInstance } from "vxe-table";
|
|
||||||
import Delete from "@iconify-icons/ep/delete";
|
|
||||||
import EditPen from "@iconify-icons/ep/edit-pen";
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
drawer: boolean;
|
|
||||||
drawTitle?: string;
|
|
||||||
direction?: Direction;
|
|
||||||
}
|
|
||||||
|
|
||||||
withDefaults(defineProps<Props>(), {
|
|
||||||
drawer: false,
|
|
||||||
drawTitle: "",
|
|
||||||
direction: "rtl"
|
|
||||||
});
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
|
||||||
(e: "handleClose"): void;
|
|
||||||
}>();
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
const xTable = ref({} as VxeTableInstance);
|
|
||||||
|
|
||||||
const configData = reactive({
|
|
||||||
tableData: [
|
|
||||||
{
|
|
||||||
name: "禁用",
|
|
||||||
dataval: "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "启用",
|
|
||||||
dataval: "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
isAllChecked: false,
|
|
||||||
isIndeterminate: false,
|
|
||||||
selectRecords: [] as any[],
|
|
||||||
tablePage: {
|
|
||||||
total: 0,
|
|
||||||
currentPage: 1,
|
|
||||||
pageSize: 10
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 抽屉关闭
|
|
||||||
function handleClose() {
|
|
||||||
configData.isAllChecked = false;
|
|
||||||
configData.isIndeterminate = false;
|
|
||||||
emit("handleClose");
|
|
||||||
}
|
|
||||||
|
|
||||||
function editConfig(row) {
|
|
||||||
console.log("editConfig", row);
|
|
||||||
}
|
|
||||||
|
|
||||||
function delConfig(row) {
|
|
||||||
console.log("delConfig", row);
|
|
||||||
}
|
|
||||||
|
|
||||||
const changeAllEvent = () => {
|
|
||||||
setTimeout(() => {
|
|
||||||
console.log(xTable);
|
|
||||||
}, 1000);
|
|
||||||
const $table = xTable.value;
|
|
||||||
$table.setAllCheckboxRow(configData.isAllChecked);
|
|
||||||
configData.selectRecords = $table.getCheckboxRecords();
|
|
||||||
};
|
|
||||||
|
|
||||||
const checkboxChangeEvent: VxeTableEvents.CheckboxChange = ({ records }) => {
|
|
||||||
const $table = xTable.value;
|
|
||||||
configData.isAllChecked = $table.isAllCheckboxChecked();
|
|
||||||
configData.isIndeterminate = $table.isAllCheckboxIndeterminate();
|
|
||||||
configData.selectRecords = records;
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="config">
|
|
||||||
<el-drawer
|
|
||||||
:model-value="drawer"
|
|
||||||
:direction="direction"
|
|
||||||
:before-close="handleClose"
|
|
||||||
destroy-on-close
|
|
||||||
size="680px"
|
|
||||||
>
|
|
||||||
<template #header>
|
|
||||||
<span class="text-black dark:text-white">{{ drawTitle }}</span>
|
|
||||||
</template>
|
|
||||||
<el-divider />
|
|
||||||
<!-- 列表 -->
|
|
||||||
<div class="p-2">
|
|
||||||
<vxe-table
|
|
||||||
ref="xTable"
|
|
||||||
border
|
|
||||||
:data="configData.tableData"
|
|
||||||
@checkbox-change="checkboxChangeEvent"
|
|
||||||
@checkbox-all="checkboxChangeEvent"
|
|
||||||
>
|
|
||||||
<vxe-table-column type="checkbox" width="60" />
|
|
||||||
<vxe-table-column field="name" title="名称" />
|
|
||||||
<vxe-table-column field="dataval" title="数据值" />
|
|
||||||
<vxe-table-column title="操作" fixed="right">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
:icon="useRenderIcon(EditPen)"
|
|
||||||
@click="editConfig(row)"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
:icon="useRenderIcon(Delete)"
|
|
||||||
@click="delConfig(row)"
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</vxe-table-column>
|
|
||||||
</vxe-table>
|
|
||||||
<vxe-pager
|
|
||||||
perfect
|
|
||||||
v-model:current-page="configData.tablePage.currentPage"
|
|
||||||
v-model:page-size="configData.tablePage.pageSize"
|
|
||||||
:total="configData.tablePage.total"
|
|
||||||
:layouts="[
|
|
||||||
'PrevJump',
|
|
||||||
'PrevPage',
|
|
||||||
'Number',
|
|
||||||
'NextPage',
|
|
||||||
'NextJump',
|
|
||||||
'Sizes',
|
|
||||||
'FullJump',
|
|
||||||
'Total'
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<template #left>
|
|
||||||
<span class="absolute left-3 flex items-center">
|
|
||||||
<vxe-checkbox
|
|
||||||
v-model="configData.isAllChecked"
|
|
||||||
:indeterminate="configData.isIndeterminate"
|
|
||||||
@change="changeAllEvent"
|
|
||||||
/>
|
|
||||||
<p>已选中{{ configData.selectRecords.length }}条</p>
|
|
||||||
<el-button link type="danger" class="ml-1">
|
|
||||||
{{ t("buttons.hsdelete") }}
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</vxe-pager>
|
|
||||||
</div>
|
|
||||||
</el-drawer>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
:deep(.el-drawer__header) {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-drawer__body) {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-divider--horizontal) {
|
|
||||||
margin: 13px 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,386 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import XEUtils from "xe-utils";
|
|
||||||
import Config from "./config.vue";
|
|
||||||
import { useI18n } from "vue-i18n";
|
|
||||||
import { clone } from "@pureadmin/utils";
|
|
||||||
import { reactive, ref, unref, nextTick } from "vue";
|
|
||||||
import { useCopyToClipboard } from "@pureadmin/utils";
|
|
||||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
|
||||||
import {
|
|
||||||
VXETable,
|
|
||||||
type TablePublicMethods,
|
|
||||||
type VxeTableInstance,
|
|
||||||
type VxeFormPropTypes,
|
|
||||||
type VxeTableEvents,
|
|
||||||
type FormMethods
|
|
||||||
} from "vxe-table";
|
|
||||||
import Delete from "@iconify-icons/ep/delete";
|
|
||||||
import EditPen from "@iconify-icons/ep/edit-pen";
|
|
||||||
|
|
||||||
type onEditNRow = {
|
|
||||||
name: string;
|
|
||||||
model: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
defineOptions({
|
|
||||||
name: "Dict"
|
|
||||||
});
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
const dictData = reactive({
|
|
||||||
submitLoading: false,
|
|
||||||
showEdit: false,
|
|
||||||
selectRow: null,
|
|
||||||
filterName: "",
|
|
||||||
tableData: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: "状态",
|
|
||||||
model: "",
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
id: "1-1",
|
|
||||||
name: "服务状态",
|
|
||||||
model: "serviceStatus"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "1-2",
|
|
||||||
name: "在线状态",
|
|
||||||
model: "onlienStatus"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{ id: 2, name: "操作系统", model: "operatingSystem" }
|
|
||||||
],
|
|
||||||
formData: {
|
|
||||||
name: "",
|
|
||||||
model: ""
|
|
||||||
},
|
|
||||||
formItems: [
|
|
||||||
{
|
|
||||||
field: "name",
|
|
||||||
title: "字典名称",
|
|
||||||
span: 24,
|
|
||||||
itemRender: {
|
|
||||||
name: "$input",
|
|
||||||
props: { placeholder: "请输入字典名称" }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "model",
|
|
||||||
title: "字典类型",
|
|
||||||
span: 24,
|
|
||||||
itemRender: {
|
|
||||||
name: "$input",
|
|
||||||
props: {
|
|
||||||
placeholder: "请输入字典类型",
|
|
||||||
//这里vxe-table文档并没有提到,可以配置所选组件的所有属性,比如这里可以配置关于vxe-input的所有属性
|
|
||||||
disabled: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "right",
|
|
||||||
span: 24,
|
|
||||||
itemRender: {
|
|
||||||
name: "$buttons",
|
|
||||||
children: [
|
|
||||||
{ props: { type: "submit", content: "提交", status: "primary" } },
|
|
||||||
{ props: { type: "reset", content: "重置" } }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
] as VxeFormPropTypes.Items
|
|
||||||
});
|
|
||||||
|
|
||||||
const originData = clone(dictData.tableData, true);
|
|
||||||
|
|
||||||
const xTree = ref<TablePublicMethods>();
|
|
||||||
const xForm = ref<FormMethods>();
|
|
||||||
|
|
||||||
const handleSearch = () => {
|
|
||||||
const filterName = XEUtils.toValueString(dictData.filterName).trim();
|
|
||||||
|
|
||||||
if (filterName) {
|
|
||||||
const options = { children: "children" };
|
|
||||||
const searchProps = ["name"];
|
|
||||||
|
|
||||||
dictData.tableData = XEUtils.searchTree(
|
|
||||||
originData,
|
|
||||||
item =>
|
|
||||||
searchProps.some(
|
|
||||||
key => XEUtils.toValueString(item[key]).indexOf(filterName) > -1
|
|
||||||
),
|
|
||||||
options
|
|
||||||
);
|
|
||||||
|
|
||||||
// 搜索之后默认展开所有子节点
|
|
||||||
nextTick(() => {
|
|
||||||
const $table = xTree.value;
|
|
||||||
$table.setAllTreeExpand(true);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
dictData.tableData = originData;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 创建一个防防抖函数,调用频率间隔 100 毫秒
|
|
||||||
const searchEvent = XEUtils.debounce(
|
|
||||||
function () {
|
|
||||||
handleSearch();
|
|
||||||
},
|
|
||||||
100,
|
|
||||||
{ leading: false, trailing: true }
|
|
||||||
);
|
|
||||||
|
|
||||||
const confirmEvent = async () => {
|
|
||||||
const type = await VXETable.modal.confirm("您确定要删除吗?");
|
|
||||||
(await type) === "confirm" &&
|
|
||||||
VXETable.modal.message({
|
|
||||||
content: "测试数据,不可删除",
|
|
||||||
status: "error"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
function commonFn(value, disabled) {
|
|
||||||
dictData.selectRow = value;
|
|
||||||
dictData.showEdit = true;
|
|
||||||
dictData.formItems[1].itemRender.props.disabled = disabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增
|
|
||||||
function onAdd() {
|
|
||||||
commonFn(null, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增子类型
|
|
||||||
function onAddChild(row?: object) {
|
|
||||||
console.log("onAddChild", row);
|
|
||||||
commonFn(null, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 编辑
|
|
||||||
function onEdit(row?: onEditNRow) {
|
|
||||||
dictData.formData = {
|
|
||||||
name: row.name,
|
|
||||||
model: row.model ? row.model : "暂无字典类型"
|
|
||||||
};
|
|
||||||
commonFn(row, true);
|
|
||||||
// VXETable.modal.message({
|
|
||||||
// content: "测试数据,不可编辑",
|
|
||||||
// status: "error"
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
|
|
||||||
// 拷贝当前列表项的数据(字典类型)
|
|
||||||
const { clipboardValue } = useCopyToClipboard();
|
|
||||||
const cellDBLClickEvent: VxeTableEvents.CellDblclick = ({ row }) => {
|
|
||||||
clipboardValue.value = unref(row).model;
|
|
||||||
};
|
|
||||||
|
|
||||||
const xTable = ref({} as VxeTableInstance);
|
|
||||||
|
|
||||||
const submitEvent = () => {
|
|
||||||
dictData.submitLoading = true;
|
|
||||||
setTimeout(() => {
|
|
||||||
const $table = xTable.value;
|
|
||||||
dictData.submitLoading = false;
|
|
||||||
dictData.showEdit = false;
|
|
||||||
if (dictData.selectRow) {
|
|
||||||
VXETable.modal.message({ content: "保存成功", status: "success" });
|
|
||||||
Object.assign(dictData.selectRow, dictData.formData);
|
|
||||||
} else {
|
|
||||||
VXETable.modal.message({ content: "新增成功", status: "success" });
|
|
||||||
$table.insert(dictData.formData);
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
};
|
|
||||||
|
|
||||||
const drawer = ref(false);
|
|
||||||
|
|
||||||
function onDeploy(value?: object) {
|
|
||||||
console.log("onDeploy", value);
|
|
||||||
drawer.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleClose() {
|
|
||||||
drawer.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function onExpand() {
|
|
||||||
xTree.value.setAllTreeExpand(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onUnExpand() {
|
|
||||||
xTree.value.clearTreeExpand();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onHide() {
|
|
||||||
xForm.value.reset();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!-- 工具栏 -->
|
|
||||||
<vxe-toolbar class="bg-bg_color">
|
|
||||||
<template #buttons>
|
|
||||||
<div class="ml-[20px]">
|
|
||||||
<label class="dark:text-text_color_regular">字典名称: </label>
|
|
||||||
<el-input
|
|
||||||
class="!w-[200px]"
|
|
||||||
v-model="dictData.filterName"
|
|
||||||
:placeholder="t('buttons.hssearch')"
|
|
||||||
@keyup.prevent="searchEvent"
|
|
||||||
@input="searchEvent"
|
|
||||||
clearable
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template #tools>
|
|
||||||
<el-button-group>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
:icon="useRenderIcon('fa:plus-square-o')"
|
|
||||||
@click="onAdd"
|
|
||||||
>
|
|
||||||
{{ t("buttons.hsadd") }}
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
:icon="useRenderIcon('fa:folder-open-o')"
|
|
||||||
@click="onExpand"
|
|
||||||
>
|
|
||||||
{{ t("buttons.hsexpendAll") }}
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
:icon="useRenderIcon('fa:folder-o')"
|
|
||||||
@click="onUnExpand"
|
|
||||||
>
|
|
||||||
{{ t("buttons.hscollapseAll") }}
|
|
||||||
</el-button>
|
|
||||||
</el-button-group>
|
|
||||||
</template>
|
|
||||||
</vxe-toolbar>
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<vxe-table
|
|
||||||
ref="xTree"
|
|
||||||
border
|
|
||||||
resizable
|
|
||||||
:tree-config="{
|
|
||||||
children: 'children',
|
|
||||||
iconOpen: 'fa fa-minus-square-o',
|
|
||||||
iconClose: 'fa fa-plus-square-o'
|
|
||||||
}"
|
|
||||||
:data="dictData.tableData"
|
|
||||||
@cell-dblclick="cellDBLClickEvent"
|
|
||||||
>
|
|
||||||
<vxe-table-column tree-node field="name" title="字典名称" />
|
|
||||||
<vxe-table-column title="字典类型">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-tooltip
|
|
||||||
effect="dark"
|
|
||||||
:content="'双击复制:' + row.model"
|
|
||||||
placement="right"
|
|
||||||
>
|
|
||||||
<span class="text-model">{{ row.model }}</span>
|
|
||||||
</el-tooltip>
|
|
||||||
</template>
|
|
||||||
</vxe-table-column>
|
|
||||||
<vxe-table-column title="操作" width="360" fixed="right">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
:icon="useRenderIcon(EditPen)"
|
|
||||||
@click="onEdit(row)"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
:icon="useRenderIcon('fa:plus-square-o')"
|
|
||||||
@click="onAddChild(row)"
|
|
||||||
>
|
|
||||||
新增子类型
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-show="row.model"
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
:icon="useRenderIcon('fa:cog')"
|
|
||||||
@click="onDeploy(row)"
|
|
||||||
>
|
|
||||||
字典配置
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
:icon="useRenderIcon(Delete)"
|
|
||||||
@click="confirmEvent"
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</vxe-table-column>
|
|
||||||
</vxe-table>
|
|
||||||
|
|
||||||
<!-- 修改、添加弹框 -->
|
|
||||||
<vxe-modal
|
|
||||||
resize
|
|
||||||
width="450"
|
|
||||||
v-model="dictData.showEdit"
|
|
||||||
:title="dictData.selectRow ? '编辑' : '新增'"
|
|
||||||
:loading="dictData.submitLoading"
|
|
||||||
@hide="onHide"
|
|
||||||
>
|
|
||||||
<template #default>
|
|
||||||
<vxe-form
|
|
||||||
ref="xForm"
|
|
||||||
:data="dictData.formData"
|
|
||||||
:items="dictData.formItems"
|
|
||||||
title-align="right"
|
|
||||||
title-width="100"
|
|
||||||
@submit="submitEvent"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-modal>
|
|
||||||
|
|
||||||
<Config :drawer="drawer" drawTitle="字典列表" @handleClose="handleClose" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.vxe-input + .vxe-button,
|
|
||||||
.vxe-input + .vxe-button--dropdown,
|
|
||||||
.vxe-button + .vxe-button,
|
|
||||||
.vxe-button + .vxe-button--dropdown {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-button.type--button:not(.is--round) {
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-toolbar.size--medium {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-table--render-default.size--medium {
|
|
||||||
margin-top: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vxe-button.size--medium.type--button {
|
|
||||||
margin-right: 0.07em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-model {
|
|
||||||
&:hover {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
1
types/global.d.ts
vendored
1
types/global.d.ts
vendored
@@ -4,6 +4,7 @@ import type {
|
|||||||
PropType as VuePropType,
|
PropType as VuePropType,
|
||||||
ComponentPublicInstance
|
ComponentPublicInstance
|
||||||
} from "vue";
|
} from "vue";
|
||||||
|
import type { ECharts } from "echarts";
|
||||||
import type { IconifyIcon } from "@iconify/vue";
|
import type { IconifyIcon } from "@iconify/vue";
|
||||||
import type { TableColumns } from "@pureadmin/table";
|
import type { TableColumns } from "@pureadmin/table";
|
||||||
import { type RouteComponent, type RouteLocationNormalized } from "vue-router";
|
import { type RouteComponent, type RouteLocationNormalized } from "vue-router";
|
||||||
|
|||||||
Reference in New Issue
Block a user