mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-09 13:53:38 +08:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d68d6a220 | ||
|
|
2338dcab1f | ||
|
|
60e33f3782 | ||
|
|
3933f34883 | ||
|
|
49dabd6b36 | ||
|
|
6d697ee19c | ||
|
|
2206b9a9ae | ||
|
|
1419df10d2 | ||
|
|
7987a18c70 | ||
|
|
152a2f8f56 | ||
|
|
3629a66535 | ||
|
|
95940312a9 |
@@ -1,3 +1,34 @@
|
|||||||
|
# 3.9.5 (2022-12-13)
|
||||||
|
|
||||||
|
### ✔️ refactor
|
||||||
|
|
||||||
|
- completely removed `lodash` and its related libraries
|
||||||
|
[Click here to see Why Removed? How to integrate it yourself? ](https://yiming_chang.gitee.io/pure-admin-doc/pages/FAQ/#%E5%B9%B3%E5%8F%B0%E5%9C%A8-v3-9-5-%E7 %89%88%E6%9C%AC%E5%AE%8C%E5%85%A8%E7%A7%BB%E9%99%A4%E4%BA%86-lodash-%E5%92%8C% E5%85%B6%E7%9B%B8%E5%85%B3%E5%BA%93-%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)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- Add `@pureadmin/table` table dynamic column example
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- Fix dynamic route `rank` issue
|
||||||
|
- Fix dark theme styling issues
|
||||||
|
|
||||||
|
### 🍏 Perf
|
||||||
|
|
||||||
|
- optimize the route `rank`, when `rank` does not exist, it will be created automatically according to the order, the home page route will always be the first
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- Add `@pureadmin/table` table selector (single select, multiple select) example
|
||||||
|
|
||||||
# 3.9.3 (2022-12-04)
|
# 3.9.3 (2022-12-04)
|
||||||
|
|
||||||
### 🎫 Feat
|
### 🎫 Feat
|
||||||
|
|||||||
31
CHANGELOG.md
31
CHANGELOG.md
@@ -1,3 +1,34 @@
|
|||||||
|
# 3.9.5 (2022-12-13)
|
||||||
|
|
||||||
|
### ✔️ refactor
|
||||||
|
|
||||||
|
- completely removed `lodash` and its related libraries
|
||||||
|
[Click here to see Why Removed? How to integrate it yourself? ](https://yiming_chang.gitee.io/pure-admin-doc/pages/FAQ/#%E5%B9%B3%E5%8F%B0%E5%9C%A8-v3-9-5-%E7 %89%88%E6%9C%AC%E5%AE%8C%E5%85%A8%E7%A7%BB%E9%99%A4%E4%BA%86-lodash-%E5%92%8C% E5%85%B6%E7%9B%B8%E5%85%B3%E5%BA%93-%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)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- Add `@pureadmin/table` table dynamic column example
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- Fix dynamic route `rank` issue
|
||||||
|
- Fix dark theme styling issues
|
||||||
|
|
||||||
|
### 🍏 Perf
|
||||||
|
|
||||||
|
- optimize the route `rank`, when `rank` does not exist, it will be created automatically according to the order, the home page route will always be the first
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- Add `@pureadmin/table` table selector (single select, multiple select) example
|
||||||
|
|
||||||
# 3.9.3 (2022-12-04)
|
# 3.9.3 (2022-12-04)
|
||||||
|
|
||||||
### 🎫 Feat
|
### 🎫 Feat
|
||||||
|
|||||||
@@ -1,3 +1,34 @@
|
|||||||
|
# 3.9.5 (2022-12-13)
|
||||||
|
|
||||||
|
### ✔️ refactor
|
||||||
|
|
||||||
|
- 完全移除了 `lodash` 和其相关库
|
||||||
|
[点击此处查看为什么移除?如何自行集成?](https://yiming_chang.gitee.io/pure-admin-doc/pages/FAQ/#%E5%B9%B3%E5%8F%B0%E5%9C%A8-v3-9-5-%E7%89%88%E6%9C%AC%E5%AE%8C%E5%85%A8%E7%A7%BB%E9%99%A4%E4%BA%86-lodash-%E5%92%8C%E5%85%B6%E7%9B%B8%E5%85%B3%E5%BA%93-%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)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- 添加 `@pureadmin/table` 表格动态列示例
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- 修复动态路由 `rank` 问题
|
||||||
|
- 修复暗黑主题样式问题
|
||||||
|
|
||||||
|
### 🍏 Perf
|
||||||
|
|
||||||
|
- 优化路由 `rank` ,当 `rank` 不存在时,根据顺序自动创建,首页路由永远在第一位
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- 添加 `@pureadmin/table` 表格选择器(单选、多选)示例
|
||||||
|
|
||||||
# 3.9.3 (2022-12-04)
|
# 3.9.3 (2022-12-04)
|
||||||
|
|
||||||
### 🎫 Feat
|
### 🎫 Feat
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
- [点我查看快速开发教程](https://www.bilibili.com/video/BV1kg411v7QT)
|
- [点我查看快速开发教程](https://www.bilibili.com/video/BV1kg411v7QT)
|
||||||
- [点我查看 UI 设计](https://www.bilibili.com/video/BV17g411T7rq)
|
- [点我查看 UI 设计](https://www.bilibili.com/video/BV17g411T7rq)
|
||||||
|
|
||||||
## 配套文档(支持 `PWA` 快速、离线访问)
|
## 配套保姆级文档(支持 `PWA` 快速、离线访问)
|
||||||
|
|
||||||
- [点我查看国内文档站](https://yiming_chang.gitee.io/pure-admin-doc)
|
- [点我查看国内文档站](https://yiming_chang.gitee.io/pure-admin-doc)
|
||||||
- [点我查看国外文档站](https://xiaoxian521.github.io/pure-admin-doc)
|
- [点我查看国外文档站](https://xiaoxian521.github.io/pure-admin-doc)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { Plugin as importToCDN } from "vite-plugin-cdn-import";
|
|||||||
* 注意:上面提到的仅限外网使用也不是完全肯定的,如果你们公司内网部署的有相关js、css文件,也可以将下面配置对应改一下,整一套内网版cdn
|
* 注意:上面提到的仅限外网使用也不是完全肯定的,如果你们公司内网部署的有相关js、css文件,也可以将下面配置对应改一下,整一套内网版cdn
|
||||||
*/
|
*/
|
||||||
export const cdn = importToCDN({
|
export const cdn = importToCDN({
|
||||||
//(prodUrl解释: name: 对应下面modules的name,version: 自动读取本地package.json中dependencies依赖中对应包的版本号,path: 对应下面modules的path)
|
//(prodUrl解释: name: 对应下面modules的name,version: 自动读取本地package.json中dependencies依赖中对应包的版本号,path: 对应下面modules的path,当然也可写完整路径,会替换prodUrl)
|
||||||
prodUrl: "https://cdn.bootcdn.net/ajax/libs/{name}/{version}/{path}",
|
prodUrl: "https://cdn.bootcdn.net/ajax/libs/{name}/{version}/{path}",
|
||||||
modules: [
|
modules: [
|
||||||
{
|
{
|
||||||
@@ -56,12 +56,6 @@ export const cdn = importToCDN({
|
|||||||
name: "echarts",
|
name: "echarts",
|
||||||
var: "echarts",
|
var: "echarts",
|
||||||
path: "echarts.min.js"
|
path: "echarts.min.js"
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "lodash",
|
|
||||||
var: "lodash",
|
|
||||||
// 可写`完整路径`,会替换`prodUrl`
|
|
||||||
path: "https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.min.js"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,14 +12,10 @@ const include = [
|
|||||||
"axios",
|
"axios",
|
||||||
"pinia",
|
"pinia",
|
||||||
"swiper",
|
"swiper",
|
||||||
"lodash",
|
|
||||||
"echarts",
|
"echarts",
|
||||||
"intro.js",
|
"intro.js",
|
||||||
"vue-i18n",
|
"vue-i18n",
|
||||||
"xe-utils",
|
|
||||||
"vxe-table",
|
|
||||||
"js-cookie",
|
"js-cookie",
|
||||||
"lodash-es",
|
|
||||||
"cropperjs",
|
"cropperjs",
|
||||||
"jsbarcode",
|
"jsbarcode",
|
||||||
"sortablejs",
|
"sortablejs",
|
||||||
@@ -29,8 +25,6 @@ const include = [
|
|||||||
"vue3-danmaku",
|
"vue3-danmaku",
|
||||||
"v-contextmenu",
|
"v-contextmenu",
|
||||||
"vue-pdf-embed",
|
"vue-pdf-embed",
|
||||||
"lodash-unified",
|
|
||||||
"@ctrl/tinycolor",
|
|
||||||
"china-area-data",
|
"china-area-data",
|
||||||
"vue-json-pretty",
|
"vue-json-pretty",
|
||||||
"@logicflow/core",
|
"@logicflow/core",
|
||||||
|
|||||||
@@ -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: 高级用法(9个示例)
|
hsPureTableHigh: 高级用法(10个示例)
|
||||||
hsTree: 大数据树业务组件
|
hsTree: 大数据树业务组件
|
||||||
hsMenuoverflow: 目录超出显示 Tooltip 文字提示
|
hsMenuoverflow: 目录超出显示 Tooltip 文字提示
|
||||||
hsChildMenuoverflow: 菜单超出显示 Tooltip 文字提示
|
hsChildMenuoverflow: 菜单超出显示 Tooltip 文字提示
|
||||||
|
|||||||
@@ -42,17 +42,6 @@ const systemRouter = {
|
|||||||
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"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
15
package.json
15
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-pure-admin",
|
"name": "vue-pure-admin",
|
||||||
"version": "3.9.3",
|
"version": "3.9.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",
|
"dev": "NODE_OPTIONS=--max-old-space-size=4096 vite",
|
||||||
@@ -30,13 +30,12 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@amap/amap-jsapi-loader": "^1.0.1",
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
||||||
"@ctrl/tinycolor": "^3.4.1",
|
|
||||||
"@howdyjs/mouse-menu": "^2.0.5",
|
"@howdyjs/mouse-menu": "^2.0.5",
|
||||||
"@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.3",
|
"@pureadmin/table": "^1.9.0",
|
||||||
"@pureadmin/utils": "^1.7.4",
|
"@pureadmin/utils": "^1.8.5",
|
||||||
"@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",
|
||||||
@@ -53,9 +52,6 @@
|
|||||||
"intro.js": "^6.0.0",
|
"intro.js": "^6.0.0",
|
||||||
"js-cookie": "^3.0.1",
|
"js-cookie": "^3.0.1",
|
||||||
"jsbarcode": "^3.11.5",
|
"jsbarcode": "^3.11.5",
|
||||||
"lodash": "^4.17.21",
|
|
||||||
"lodash-es": "^4.17.21",
|
|
||||||
"lodash-unified": "^1.0.2",
|
|
||||||
"md-editor-v3": "^2.5.0",
|
"md-editor-v3": "^2.5.0",
|
||||||
"mitt": "^3.0.0",
|
"mitt": "^3.0.0",
|
||||||
"mockjs": "^1.1.0",
|
"mockjs": "^1.1.0",
|
||||||
@@ -78,8 +74,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"
|
||||||
},
|
},
|
||||||
@@ -95,8 +89,6 @@
|
|||||||
"@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",
|
||||||
"@types/lodash": "^4.14.180",
|
|
||||||
"@types/lodash-es": "^4.17.6",
|
|
||||||
"@types/mockjs": "^1.0.7",
|
"@types/mockjs": "^1.0.7",
|
||||||
"@types/node": "^18.11.9",
|
"@types/node": "^18.11.9",
|
||||||
"@types/nprogress": "0.2.0",
|
"@types/nprogress": "0.2.0",
|
||||||
@@ -115,7 +107,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",
|
||||||
|
|||||||
6865
pnpm-lock.yaml
generated
6865
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Version": "3.9.3",
|
"Version": "3.9.5",
|
||||||
"Title": "PureAdmin",
|
"Title": "PureAdmin",
|
||||||
"FixedHeader": true,
|
"FixedHeader": true,
|
||||||
"HiddenSideBar": false,
|
"HiddenSideBar": false,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { cloneDeep } from "lodash-unified";
|
import { cloneDeep } from "@pureadmin/utils";
|
||||||
import { IconJson } from "@/components/ReIcon/data";
|
import { IconJson } from "@/components/ReIcon/data";
|
||||||
import { ref, computed, CSSProperties, toRef, watch } from "vue";
|
import { ref, computed, CSSProperties, toRef, watch } from "vue";
|
||||||
type ParameterCSSProperties = (item?: string) => CSSProperties | undefined;
|
type ParameterCSSProperties = (item?: string) => CSSProperties | undefined;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import Ppt from "@iconify-icons/ri/file-ppt-2-line";
|
|||||||
import CheckboxCircleLine from "@iconify-icons/ri/checkbox-circle-line";
|
import CheckboxCircleLine from "@iconify-icons/ri/checkbox-circle-line";
|
||||||
import FlUser from "@iconify-icons/ri/admin-line";
|
import FlUser from "@iconify-icons/ri/admin-line";
|
||||||
import Role from "@iconify-icons/ri/admin-fill";
|
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 Setting from "@iconify-icons/ri/settings-3-line";
|
||||||
import Dept from "@iconify-icons/ri/git-branch-line";
|
import Dept from "@iconify-icons/ri/git-branch-line";
|
||||||
import Lollipop from "@iconify-icons/ep/lollipop";
|
import Lollipop from "@iconify-icons/ep/lollipop";
|
||||||
@@ -40,7 +39,6 @@ addIcon("ppt", Ppt);
|
|||||||
addIcon("checkboxCircleLine", CheckboxCircleLine);
|
addIcon("checkboxCircleLine", CheckboxCircleLine);
|
||||||
addIcon("flUser", FlUser);
|
addIcon("flUser", FlUser);
|
||||||
addIcon("role", Role);
|
addIcon("role", Role);
|
||||||
addIcon("dict", Dict);
|
|
||||||
addIcon("setting", Setting);
|
addIcon("setting", Setting);
|
||||||
addIcon("dept", Dept);
|
addIcon("dept", Dept);
|
||||||
addIcon("lollipop", Lollipop);
|
addIcon("lollipop", Lollipop);
|
||||||
|
|||||||
@@ -8,10 +8,9 @@ import {
|
|||||||
defineComponent
|
defineComponent
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
import { cloneDeep } from "lodash-unified";
|
|
||||||
import { isString } from "@pureadmin/utils";
|
|
||||||
import { propTypes } from "@/utils/propTypes";
|
import { propTypes } from "@/utils/propTypes";
|
||||||
import { IconifyIconOffline } from "../../ReIcon";
|
import { IconifyIconOffline } from "../../ReIcon";
|
||||||
|
import { isString, cloneDeep } from "@pureadmin/utils";
|
||||||
import QRCode, { QRCodeRenderersOptions } from "qrcode";
|
import QRCode, { QRCodeRenderersOptions } from "qrcode";
|
||||||
|
|
||||||
interface QrcodeLogo {
|
interface QrcodeLogo {
|
||||||
@@ -97,7 +96,7 @@ export default defineComponent({
|
|||||||
width: props.width,
|
width: props.width,
|
||||||
...options
|
...options
|
||||||
});
|
});
|
||||||
(unref(wrapRef) as HTMLImageElement).src = url;
|
(unref(wrapRef) as any).src = url;
|
||||||
emit("done", url);
|
emit("done", url);
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export const auth: Directive = {
|
|||||||
mounted(el: HTMLElement, binding: DirectiveBinding) {
|
mounted(el: HTMLElement, binding: DirectiveBinding) {
|
||||||
const { value } = binding;
|
const { value } = binding;
|
||||||
if (value) {
|
if (value) {
|
||||||
!hasAuth(value) && el.parentNode.removeChild(el);
|
!hasAuth(value) && el.parentNode?.removeChild(el);
|
||||||
} else {
|
} else {
|
||||||
throw new Error("need auths! Like v-auth=\"['btn.add','btn.edit']\"");
|
throw new Error("need auths! Like v-auth=\"['btn.add','btn.edit']\"");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { cloneDeep } from "lodash-unified";
|
import { cloneDeep } from "@pureadmin/utils";
|
||||||
import SearchResult from "./SearchResult.vue";
|
import SearchResult from "./SearchResult.vue";
|
||||||
import SearchFooter from "./SearchFooter.vue";
|
import SearchFooter from "./SearchFooter.vue";
|
||||||
import { deleteChildren } from "@/utils/tree";
|
import { deleteChildren } from "@/utils/tree";
|
||||||
|
|||||||
@@ -132,8 +132,8 @@ const multiTagsCacheChange = () => {
|
|||||||
/** 清空缓存并返回登录页 */
|
/** 清空缓存并返回登录页 */
|
||||||
function onReset() {
|
function onReset() {
|
||||||
removeToken();
|
removeToken();
|
||||||
storageLocal.clear();
|
storageLocal().clear();
|
||||||
storageSession.clear();
|
storageSession().clear();
|
||||||
const { Grey, Weak, MultiTagsCache, EpThemeColor, Layout } = getConfig();
|
const { Grey, Weak, MultiTagsCache, EpThemeColor, Layout } = getConfig();
|
||||||
useAppStoreHook().setLayout(Layout);
|
useAppStoreHook().setLayout(Layout);
|
||||||
setEpThemeColor(EpThemeColor);
|
setEpThemeColor(EpThemeColor);
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ import { usePermissionStoreHook } from "@/store/modules/permission";
|
|||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const showLogo = ref(
|
const showLogo = ref(
|
||||||
storageLocal.getItem<StorageConfigs>("responsive-configure")?.showLogo ?? true
|
storageLocal().getItem<StorageConfigs>("responsive-configure")?.showLogo ??
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
const { routers, device, pureApp, isCollapse, menuSelect, toggleSideBar } =
|
const { routers, device, pureApp, isCollapse, menuSelect, toggleSideBar } =
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { emitter } from "@/utils/mitt";
|
|||||||
import { RouteConfigs } from "../../types";
|
import { RouteConfigs } from "../../types";
|
||||||
import { useTags } from "../../hooks/useTag";
|
import { useTags } from "../../hooks/useTag";
|
||||||
import { routerArrays } from "@/layout/types";
|
import { routerArrays } from "@/layout/types";
|
||||||
import { isEqual, isEmpty } from "lodash-unified";
|
import { isEqual, isAllEmpty } from "@pureadmin/utils";
|
||||||
import { useSettingStoreHook } from "@/store/modules/settings";
|
import { useSettingStoreHook } from "@/store/modules/settings";
|
||||||
import { ref, watch, unref, nextTick, onBeforeMount } from "vue";
|
import { ref, watch, unref, nextTick, onBeforeMount } from "vue";
|
||||||
import { handleAliveRoute, delAliveRoutes } from "@/router/utils";
|
import { handleAliveRoute, delAliveRoutes } from "@/router/utils";
|
||||||
@@ -349,7 +349,7 @@ function showMenuModel(
|
|||||||
const allRoute = multiTags.value;
|
const allRoute = multiTags.value;
|
||||||
const routeLength = multiTags.value.length;
|
const routeLength = multiTags.value.length;
|
||||||
let currentIndex = -1;
|
let currentIndex = -1;
|
||||||
if (isEmpty(query)) {
|
if (isAllEmpty(query)) {
|
||||||
currentIndex = allRoute.findIndex(v => v.path === currentPath);
|
currentIndex = allRoute.findIndex(v => v.path === currentPath);
|
||||||
} else {
|
} else {
|
||||||
currentIndex = allRoute.findIndex(v => isEqual(v.query, query));
|
currentIndex = allRoute.findIndex(v => isEqual(v.query, query));
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { getConfig } from "@/config";
|
import { getConfig } from "@/config";
|
||||||
import { find } from "lodash-unified";
|
|
||||||
import { useLayout } from "./useLayout";
|
import { useLayout } from "./useLayout";
|
||||||
import { themeColorsType } from "../types";
|
import { themeColorsType } from "../types";
|
||||||
import { TinyColor } from "@ctrl/tinycolor";
|
|
||||||
import { useGlobal } from "@pureadmin/utils";
|
import { useGlobal } from "@pureadmin/utils";
|
||||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||||
import {
|
import {
|
||||||
@@ -56,35 +54,27 @@ export function useDataThemeChange() {
|
|||||||
if (theme === "default" || theme === "light") {
|
if (theme === "default" || theme === "light") {
|
||||||
setEpThemeColor(getConfig().EpThemeColor);
|
setEpThemeColor(getConfig().EpThemeColor);
|
||||||
} else {
|
} else {
|
||||||
const colors = find(themeColors.value, { themeColor: theme });
|
const colors = themeColors.value.find(v => v.themeColor === theme);
|
||||||
setEpThemeColor(colors.color);
|
setEpThemeColor(colors.color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function setPropertyPrimary(mode: string, i: number, color: string) {
|
||||||
* @description 自动计算hover和active颜色
|
document.documentElement.style.setProperty(
|
||||||
* @see {@link https://element-plus.org/zh-CN/component/button.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E9%A2%9C%E8%89%B2}
|
`--el-color-primary-${mode}-${i}`,
|
||||||
*/
|
dataTheme.value ? darken(color, i / 10) : lighten(color, i / 10)
|
||||||
const shadeBgColor = (color: string): string => {
|
);
|
||||||
return new TinyColor(color).shade(10).toString();
|
}
|
||||||
};
|
|
||||||
|
|
||||||
/** 设置 `element-plus` 主题色 */
|
/** 设置 `element-plus` 主题色 */
|
||||||
const setEpThemeColor = (color: string) => {
|
const setEpThemeColor = (color: string) => {
|
||||||
useEpThemeStoreHook().setEpThemeColor(color);
|
useEpThemeStoreHook().setEpThemeColor(color);
|
||||||
body.style.setProperty("--el-color-primary-active", shadeBgColor(color));
|
|
||||||
document.documentElement.style.setProperty("--el-color-primary", color);
|
document.documentElement.style.setProperty("--el-color-primary", color);
|
||||||
for (let i = 1; i <= 9; i++) {
|
|
||||||
document.documentElement.style.setProperty(
|
|
||||||
`--el-color-primary-light-${i}`,
|
|
||||||
lighten(color, i / 10)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
for (let i = 1; i <= 2; i++) {
|
for (let i = 1; i <= 2; i++) {
|
||||||
document.documentElement.style.setProperty(
|
setPropertyPrimary("dark", i, color);
|
||||||
`--el-color-primary-dark-${i}`,
|
}
|
||||||
darken(color, i / 10)
|
for (let i = 1; i <= 9; i++) {
|
||||||
);
|
setPropertyPrimary("light", i, color);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -41,13 +41,13 @@ export function useTags() {
|
|||||||
|
|
||||||
/** 显示模式,默认灵动模式 */
|
/** 显示模式,默认灵动模式 */
|
||||||
const showModel = ref(
|
const showModel = ref(
|
||||||
storageLocal.getItem<StorageConfigs>("responsive-configure")?.showModel ||
|
storageLocal().getItem<StorageConfigs>("responsive-configure")?.showModel ||
|
||||||
"smart"
|
"smart"
|
||||||
);
|
);
|
||||||
/** 是否隐藏标签页,默认显示 */
|
/** 是否隐藏标签页,默认显示 */
|
||||||
const showTags =
|
const showTags =
|
||||||
ref(
|
ref(
|
||||||
storageLocal.getItem<StorageConfigs>("responsive-configure").hideTabs
|
storageLocal().getItem<StorageConfigs>("responsive-configure").hideTabs
|
||||||
) ?? ref("false");
|
) ?? ref("false");
|
||||||
const multiTags: any = computed(() => {
|
const multiTags: any = computed(() => {
|
||||||
return useMultiTagsStoreHook().multiTags;
|
return useMultiTagsStoreHook().multiTags;
|
||||||
@@ -195,11 +195,11 @@ export function useTags() {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!showModel.value) {
|
if (!showModel.value) {
|
||||||
const configure = storageLocal.getItem<StorageConfigs>(
|
const configure = storageLocal().getItem<StorageConfigs>(
|
||||||
"responsive-configure"
|
"responsive-configure"
|
||||||
);
|
);
|
||||||
configure.showModel = "card";
|
configure.showModel = "card";
|
||||||
storageLocal.setItem("responsive-configure", configure);
|
storageLocal().setItem("responsive-configure", configure);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
import "animate.css";
|
import "animate.css";
|
||||||
// 引入 src/components/ReIcon/src/offlineIcon.ts 文件中所有使用addIcon添加过的本地图标
|
// 引入 src/components/ReIcon/src/offlineIcon.ts 文件中所有使用addIcon添加过的本地图标
|
||||||
import "@/components/ReIcon/src/offlineIcon";
|
import "@/components/ReIcon/src/offlineIcon";
|
||||||
// vxe-table的所有icon不支持component模式,间接依赖了font-awesome
|
|
||||||
import "font-awesome/css/font-awesome.min.css";
|
|
||||||
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;
|
||||||
|
|||||||
@@ -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");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export const $t = (key: string) => key;
|
|||||||
export const i18n: I18n = createI18n({
|
export const i18n: I18n = createI18n({
|
||||||
legacy: false,
|
legacy: false,
|
||||||
locale:
|
locale:
|
||||||
storageLocal.getItem<StorageConfigs>("responsive-locale")?.locale ?? "zh",
|
storageLocal().getItem<StorageConfigs>("responsive-locale")?.locale ?? "zh",
|
||||||
fallbackLocale: "en",
|
fallbackLocale: "en",
|
||||||
messages: localesConfigs
|
messages: localesConfigs
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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,7 +1,6 @@
|
|||||||
import "@/utils/sso";
|
import "@/utils/sso";
|
||||||
import { getConfig } from "@/config";
|
import { getConfig } from "@/config";
|
||||||
import NProgress from "@/utils/progress";
|
import NProgress from "@/utils/progress";
|
||||||
import { findIndex } from "lodash-unified";
|
|
||||||
import { transformI18n } from "@/plugins/i18n";
|
import { transformI18n } from "@/plugins/i18n";
|
||||||
import { sessionKey, type DataInfo } from "@/utils/auth";
|
import { sessionKey, type DataInfo } from "@/utils/auth";
|
||||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||||
@@ -106,7 +105,7 @@ router.beforeEach((to: toRouteType, _from, next) => {
|
|||||||
handleAliveRoute(newMatched);
|
handleAliveRoute(newMatched);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const userInfo = storageSession.getItem<DataInfo<number>>(sessionKey);
|
const userInfo = storageSession().getItem<DataInfo<number>>(sessionKey);
|
||||||
NProgress.start();
|
NProgress.start();
|
||||||
const externalLink = isUrl(to?.name as string);
|
const externalLink = isUrl(to?.name as string);
|
||||||
if (!externalLink) {
|
if (!externalLink) {
|
||||||
@@ -144,14 +143,10 @@ router.beforeEach((to: toRouteType, _from, next) => {
|
|||||||
initRouter().then((router: Router) => {
|
initRouter().then((router: Router) => {
|
||||||
if (!useMultiTagsStoreHook().getMultiTagsCache) {
|
if (!useMultiTagsStoreHook().getMultiTagsCache) {
|
||||||
const { path } = to;
|
const { path } = to;
|
||||||
const index = findIndex(remainingRouter, v => {
|
const route = findRouteByPath(
|
||||||
return v.path == path;
|
path,
|
||||||
});
|
router.options.routes[0].children
|
||||||
const routes: any =
|
);
|
||||||
index === -1
|
|
||||||
? router.options.routes[0].children
|
|
||||||
: router.options.routes;
|
|
||||||
const route = findRouteByPath(path, routes);
|
|
||||||
// query、params模式路由传参数的标签页不在此处处理
|
// query、params模式路由传参数的标签页不在此处处理
|
||||||
if (route && route.meta?.title) {
|
if (route && route.meta?.title) {
|
||||||
useMultiTagsStoreHook().handleTags("push", {
|
useMultiTagsStoreHook().handleTags("push", {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export default {
|
|||||||
redirect: "/error/403",
|
redirect: "/error/403",
|
||||||
meta: {
|
meta: {
|
||||||
icon: "informationLine",
|
icon: "informationLine",
|
||||||
|
// showLink: false,
|
||||||
title: $t("menus.hsabnormal"),
|
title: $t("menus.hsabnormal"),
|
||||||
rank: error
|
rank: error
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,12 +13,14 @@ import { useTimeoutFn } from "@vueuse/core";
|
|||||||
import { RouteConfigs } from "@/layout/types";
|
import { RouteConfigs } from "@/layout/types";
|
||||||
import {
|
import {
|
||||||
isString,
|
isString,
|
||||||
|
cloneDeep,
|
||||||
|
isAllEmpty,
|
||||||
|
intersection,
|
||||||
storageSession,
|
storageSession,
|
||||||
isIncludeAllChildren
|
isIncludeAllChildren
|
||||||
} from "@pureadmin/utils";
|
} from "@pureadmin/utils";
|
||||||
import { getConfig } from "@/config";
|
import { getConfig } from "@/config";
|
||||||
import { buildHierarchyTree } from "@/utils/tree";
|
import { buildHierarchyTree } from "@/utils/tree";
|
||||||
import { cloneDeep, intersection } from "lodash-unified";
|
|
||||||
import { sessionKey, type DataInfo } from "@/utils/auth";
|
import { sessionKey, type DataInfo } from "@/utils/auth";
|
||||||
import { usePermissionStoreHook } from "@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
const IFrame = () => import("@/layout/frameView.vue");
|
const IFrame = () => import("@/layout/frameView.vue");
|
||||||
@@ -28,19 +30,25 @@ const modulesRoutes = import.meta.glob("/src/views/**/*.{vue,tsx}");
|
|||||||
// 动态路由
|
// 动态路由
|
||||||
import { getAsyncRoutes } from "@/api/routes";
|
import { getAsyncRoutes } from "@/api/routes";
|
||||||
|
|
||||||
|
function handRank(routeInfo: any) {
|
||||||
|
const { name, path, parentId, meta } = routeInfo;
|
||||||
|
return isAllEmpty(parentId)
|
||||||
|
? isAllEmpty(meta?.rank) ||
|
||||||
|
(meta?.rank === 0 && name !== "Home" && path !== "/")
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
: false;
|
||||||
|
}
|
||||||
|
|
||||||
/** 按照路由中meta下的rank等级升序来排序路由 */
|
/** 按照路由中meta下的rank等级升序来排序路由 */
|
||||||
function ascending(arr: any[]) {
|
function ascending(arr: any[]) {
|
||||||
arr.forEach(v => {
|
arr.forEach((v, index) => {
|
||||||
if (v?.meta?.rank === null) v.meta.rank = undefined;
|
// 当rank不存在时,根据顺序自动创建,首页路由永远在第一位
|
||||||
if (v?.meta?.rank === 0) {
|
if (handRank(v)) v.meta.rank = index + 2;
|
||||||
if (v.name !== "Home" && v.path !== "/") {
|
|
||||||
console.warn("rank only the home page can be 0");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return arr.sort(
|
return arr.sort(
|
||||||
(a: { meta: { rank: number } }, b: { meta: { rank: number } }) => {
|
(a: { meta: { rank: number } }, b: { meta: { rank: number } }) => {
|
||||||
return a?.meta?.rank - b?.meta?.rank;
|
return a?.meta.rank - b?.meta.rank;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -77,7 +85,7 @@ function isOneOfArray(a: Array<string>, b: Array<string>) {
|
|||||||
/** 从sessionStorage里取出当前登陆用户的角色roles,过滤无权限的菜单 */
|
/** 从sessionStorage里取出当前登陆用户的角色roles,过滤无权限的菜单 */
|
||||||
function filterNoPermissionTree(data: RouteComponent[]) {
|
function filterNoPermissionTree(data: RouteComponent[]) {
|
||||||
const currentRoles =
|
const currentRoles =
|
||||||
storageSession.getItem<DataInfo<number>>(sessionKey)?.roles ?? [];
|
storageSession().getItem<DataInfo<number>>(sessionKey)?.roles ?? [];
|
||||||
const newTree = cloneDeep(data).filter((v: any) =>
|
const newTree = cloneDeep(data).filter((v: any) =>
|
||||||
isOneOfArray(v.meta?.roles, currentRoles)
|
isOneOfArray(v.meta?.roles, currentRoles)
|
||||||
);
|
);
|
||||||
@@ -189,7 +197,7 @@ function initRouter() {
|
|||||||
if (getConfig()?.CachingAsyncRoutes) {
|
if (getConfig()?.CachingAsyncRoutes) {
|
||||||
// 开启动态路由缓存本地sessionStorage
|
// 开启动态路由缓存本地sessionStorage
|
||||||
const key = "async-routes";
|
const key = "async-routes";
|
||||||
const asyncRouteList = storageSession.getItem(key) as any;
|
const asyncRouteList = storageSession().getItem(key) as any;
|
||||||
if (asyncRouteList && asyncRouteList?.length > 0) {
|
if (asyncRouteList && asyncRouteList?.length > 0) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
handleAsyncRoutes(asyncRouteList);
|
handleAsyncRoutes(asyncRouteList);
|
||||||
@@ -199,7 +207,7 @@ function initRouter() {
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
getAsyncRoutes().then(({ data }) => {
|
getAsyncRoutes().then(({ data }) => {
|
||||||
handleAsyncRoutes(cloneDeep(data));
|
handleAsyncRoutes(cloneDeep(data));
|
||||||
storageSession.setItem(key, data);
|
storageSession().setItem(key, data);
|
||||||
resolve(router);
|
resolve(router);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -252,7 +260,7 @@ function formatTwoStageRoutes(routesList: RouteRecordRaw[]) {
|
|||||||
children: []
|
children: []
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
newRoutesList[0].children.push({ ...v });
|
newRoutesList[0]?.children.push({ ...v });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return newRoutesList;
|
return newRoutesList;
|
||||||
@@ -348,6 +356,7 @@ function hasAuth(value: string | Array<string>): boolean {
|
|||||||
if (!value) return false;
|
if (!value) return false;
|
||||||
/** 从当前路由的`meta`字段里获取按钮级别的所有自定义`code`值 */
|
/** 从当前路由的`meta`字段里获取按钮级别的所有自定义`code`值 */
|
||||||
const metaAuths = getAuths();
|
const metaAuths = getAuths();
|
||||||
|
if (!metaAuths) return false;
|
||||||
const isAuths = isString(value)
|
const isAuths = isString(value)
|
||||||
? metaAuths.includes(value)
|
? metaAuths.includes(value)
|
||||||
: isIncludeAllChildren(value, metaAuths);
|
: isIncludeAllChildren(value, metaAuths);
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ export const useAppStore = defineStore({
|
|||||||
state: (): appType => ({
|
state: (): appType => ({
|
||||||
sidebar: {
|
sidebar: {
|
||||||
opened:
|
opened:
|
||||||
storageLocal.getItem<StorageConfigs>("responsive-layout")
|
storageLocal().getItem<StorageConfigs>("responsive-layout")
|
||||||
?.sidebarStatus ?? getConfig().SidebarStatus,
|
?.sidebarStatus ?? getConfig().SidebarStatus,
|
||||||
withoutAnimation: false,
|
withoutAnimation: false,
|
||||||
isClickCollapse: false
|
isClickCollapse: false
|
||||||
},
|
},
|
||||||
// 这里的layout用于监听容器拖拉后恢复对应的导航模式
|
// 这里的layout用于监听容器拖拉后恢复对应的导航模式
|
||||||
layout:
|
layout:
|
||||||
storageLocal.getItem<StorageConfigs>("responsive-layout")?.layout ??
|
storageLocal().getItem<StorageConfigs>("responsive-layout")?.layout ??
|
||||||
getConfig().Layout,
|
getConfig().Layout,
|
||||||
device: deviceDetection() ? "mobile" : "desktop",
|
device: deviceDetection() ? "mobile" : "desktop",
|
||||||
// 作用于 src/views/components/draggable/index.vue 页面,当离开页面并不会销毁 new Swap(),sortablejs 官网也没有提供任何销毁的 api
|
// 作用于 src/views/components/draggable/index.vue 页面,当离开页面并不会销毁 new Swap(),sortablejs 官网也没有提供任何销毁的 api
|
||||||
@@ -32,7 +32,8 @@ export const useAppStore = defineStore({
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
TOGGLE_SIDEBAR(opened?: boolean, resize?: string) {
|
TOGGLE_SIDEBAR(opened?: boolean, resize?: string) {
|
||||||
const layout = storageLocal.getItem<StorageConfigs>("responsive-layout");
|
const layout =
|
||||||
|
storageLocal().getItem<StorageConfigs>("responsive-layout");
|
||||||
if (opened && resize) {
|
if (opened && resize) {
|
||||||
this.sidebar.withoutAnimation = true;
|
this.sidebar.withoutAnimation = true;
|
||||||
this.sidebar.opened = true;
|
this.sidebar.opened = true;
|
||||||
@@ -47,7 +48,7 @@ export const useAppStore = defineStore({
|
|||||||
this.sidebar.isClickCollapse = !this.sidebar.opened;
|
this.sidebar.isClickCollapse = !this.sidebar.opened;
|
||||||
layout.sidebarStatus = this.sidebar.opened;
|
layout.sidebarStatus = this.sidebar.opened;
|
||||||
}
|
}
|
||||||
storageLocal.setItem("responsive-layout", layout);
|
storageLocal().setItem("responsive-layout", layout);
|
||||||
},
|
},
|
||||||
async toggleSideBar(opened?: boolean, resize?: string) {
|
async toggleSideBar(opened?: boolean, resize?: string) {
|
||||||
await this.TOGGLE_SIDEBAR(opened, resize);
|
await this.TOGGLE_SIDEBAR(opened, resize);
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ export const useEpThemeStore = defineStore({
|
|||||||
id: "pure-epTheme",
|
id: "pure-epTheme",
|
||||||
state: () => ({
|
state: () => ({
|
||||||
epThemeColor:
|
epThemeColor:
|
||||||
storageLocal.getItem<StorageConfigs>("responsive-layout")?.epThemeColor ??
|
storageLocal().getItem<StorageConfigs>("responsive-layout")
|
||||||
getConfig().EpThemeColor,
|
?.epThemeColor ?? getConfig().EpThemeColor,
|
||||||
epTheme:
|
epTheme:
|
||||||
storageLocal.getItem<StorageConfigs>("responsive-layout")?.theme ??
|
storageLocal().getItem<StorageConfigs>("responsive-layout")?.theme ??
|
||||||
getConfig().Theme
|
getConfig().Theme
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
@@ -30,12 +30,13 @@ export const useEpThemeStore = defineStore({
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
setEpThemeColor(newColor: string): void {
|
setEpThemeColor(newColor: string): void {
|
||||||
const layout = storageLocal.getItem<StorageConfigs>("responsive-layout");
|
const layout =
|
||||||
|
storageLocal().getItem<StorageConfigs>("responsive-layout");
|
||||||
this.epTheme = layout?.theme;
|
this.epTheme = layout?.theme;
|
||||||
this.epThemeColor = newColor;
|
this.epThemeColor = newColor;
|
||||||
if (!layout) return;
|
if (!layout) return;
|
||||||
layout.epThemeColor = newColor;
|
layout.epThemeColor = newColor;
|
||||||
storageLocal.setItem("responsive-layout", layout);
|
storageLocal().setItem("responsive-layout", layout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,12 +9,13 @@ export const useMultiTagsStore = defineStore({
|
|||||||
id: "pure-multiTags",
|
id: "pure-multiTags",
|
||||||
state: () => ({
|
state: () => ({
|
||||||
// 存储标签页信息(路由信息)
|
// 存储标签页信息(路由信息)
|
||||||
multiTags: storageLocal.getItem<StorageConfigs>("responsive-configure")
|
multiTags: storageLocal().getItem<StorageConfigs>("responsive-configure")
|
||||||
?.multiTagsCache
|
?.multiTagsCache
|
||||||
? storageLocal.getItem<StorageConfigs>("responsive-tags")
|
? storageLocal().getItem<StorageConfigs>("responsive-tags")
|
||||||
: [...routerArrays],
|
: [...routerArrays],
|
||||||
multiTagsCache: storageLocal.getItem<StorageConfigs>("responsive-configure")
|
multiTagsCache: storageLocal().getItem<StorageConfigs>(
|
||||||
?.multiTagsCache
|
"responsive-configure"
|
||||||
|
)?.multiTagsCache
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
getMultiTagsCache() {
|
getMultiTagsCache() {
|
||||||
@@ -25,14 +26,14 @@ export const useMultiTagsStore = defineStore({
|
|||||||
multiTagsCacheChange(multiTagsCache: boolean) {
|
multiTagsCacheChange(multiTagsCache: boolean) {
|
||||||
this.multiTagsCache = multiTagsCache;
|
this.multiTagsCache = multiTagsCache;
|
||||||
if (multiTagsCache) {
|
if (multiTagsCache) {
|
||||||
storageLocal.setItem("responsive-tags", this.multiTags);
|
storageLocal().setItem("responsive-tags", this.multiTags);
|
||||||
} else {
|
} else {
|
||||||
storageLocal.removeItem("responsive-tags");
|
storageLocal().removeItem("responsive-tags");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tagsCache(multiTags) {
|
tagsCache(multiTags) {
|
||||||
this.getMultiTagsCache &&
|
this.getMultiTagsCache &&
|
||||||
storageLocal.setItem("responsive-tags", multiTags);
|
storageLocal().setItem("responsive-tags", multiTags);
|
||||||
},
|
},
|
||||||
handleTags<T>(
|
handleTags<T>(
|
||||||
mode: string,
|
mode: string,
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ export const useUserStore = defineStore({
|
|||||||
state: (): userType => ({
|
state: (): userType => ({
|
||||||
// 用户名
|
// 用户名
|
||||||
username:
|
username:
|
||||||
storageSession.getItem<DataInfo<number>>(sessionKey)?.username ?? "",
|
storageSession().getItem<DataInfo<number>>(sessionKey)?.username ?? "",
|
||||||
// 页面级别权限
|
// 页面级别权限
|
||||||
roles: storageSession.getItem<DataInfo<number>>(sessionKey)?.roles ?? [],
|
roles: storageSession().getItem<DataInfo<number>>(sessionKey)?.roles ?? [],
|
||||||
// 前端生成的验证码(按实际需求替换)
|
// 前端生成的验证码(按实际需求替换)
|
||||||
verifyCode: "",
|
verifyCode: "",
|
||||||
// 判断登录页面显示哪个组件(0:登录(默认)、1:手机登录、2:二维码登录、3:注册、4:忘记密码)
|
// 判断登录页面显示哪个组件(0:登录(默认)、1:手机登录、2:二维码登录、3:注册、4:忘记密码)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@import "element-plus/theme-chalk/src/dark/css-vars.scss";
|
@use "element-plus/theme-chalk/src/dark/css-vars.scss" as *;
|
||||||
|
|
||||||
/* 暗黑模式适配 */
|
/* 暗黑模式适配 */
|
||||||
html.dark {
|
html.dark {
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export function getToken(): DataInfo<number> {
|
|||||||
// 此处与`TokenKey`相同,此写法解决初始化时`Cookies`中不存在`TokenKey`报错
|
// 此处与`TokenKey`相同,此写法解决初始化时`Cookies`中不存在`TokenKey`报错
|
||||||
return Cookies.get(TokenKey)
|
return Cookies.get(TokenKey)
|
||||||
? JSON.parse(Cookies.get(TokenKey))
|
? JSON.parse(Cookies.get(TokenKey))
|
||||||
: storageSession.getItem(sessionKey);
|
: storageSession().getItem(sessionKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,7 +47,7 @@ export function setToken(data: DataInfo<Date>) {
|
|||||||
function setSessionKey(username: string, roles: Array<string>) {
|
function setSessionKey(username: string, roles: Array<string>) {
|
||||||
useUserStoreHook().SET_USERNAME(username);
|
useUserStoreHook().SET_USERNAME(username);
|
||||||
useUserStoreHook().SET_ROLES(roles);
|
useUserStoreHook().SET_ROLES(roles);
|
||||||
storageSession.setItem(sessionKey, {
|
storageSession().setItem(sessionKey, {
|
||||||
refreshToken,
|
refreshToken,
|
||||||
expires,
|
expires,
|
||||||
username,
|
username,
|
||||||
@@ -60,9 +60,9 @@ export function setToken(data: DataInfo<Date>) {
|
|||||||
setSessionKey(username, roles);
|
setSessionKey(username, roles);
|
||||||
} else {
|
} else {
|
||||||
const username =
|
const username =
|
||||||
storageSession.getItem<DataInfo<number>>(sessionKey)?.username ?? "";
|
storageSession().getItem<DataInfo<number>>(sessionKey)?.username ?? "";
|
||||||
const roles =
|
const roles =
|
||||||
storageSession.getItem<DataInfo<number>>(sessionKey)?.roles ?? [];
|
storageSession().getItem<DataInfo<number>>(sessionKey)?.roles ?? [];
|
||||||
setSessionKey(username, roles);
|
setSessionKey(username, roles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import REGION_DATA from "china-area-data";
|
import REGION_DATA from "china-area-data";
|
||||||
import { cloneDeep } from "lodash-unified";
|
import { cloneDeep } from "@pureadmin/utils";
|
||||||
|
|
||||||
interface ProvinceData {
|
interface ProvinceData {
|
||||||
value: string;
|
value: string;
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -7,8 +7,12 @@ defineOptions({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="back" title="返回上一页" @click="$router.go(-1)">
|
<div class="w-full h-full text-center">
|
||||||
<back class="w-[80px] h-[80px]" />
|
<h1>业务内容模块</h1>
|
||||||
|
<p>使用场景:需要外嵌平台某个页面,不需要展示菜单导航以及额外模块</p>
|
||||||
|
<div class="back" title="返回上一页" @click="$router.go(-1)">
|
||||||
|
<back class="w-[80px] h-[80px]" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ 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`;
|
||||||
@@ -15,9 +16,15 @@ export const list = [
|
|||||||
{
|
{
|
||||||
key: "page",
|
key: "page",
|
||||||
content: rendContent("page"),
|
content: rendContent("page"),
|
||||||
title: "分页、加载动画",
|
title: "分页、加载动画、动态列",
|
||||||
component: Page
|
component: Page
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: "tableSelect",
|
||||||
|
content: rendContent("table-select"),
|
||||||
|
title: "表格选择器",
|
||||||
|
component: TableSelect
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: "rowDrag",
|
key: "rowDrag",
|
||||||
content: rendContent("drag/row"),
|
content: rendContent("drag/row"),
|
||||||
|
|||||||
@@ -6,19 +6,25 @@ import type { PaginationProps, LoadingConfig, Align } from "@pureadmin/table";
|
|||||||
export function useColumns() {
|
export function useColumns() {
|
||||||
const dataList = ref([]);
|
const dataList = ref([]);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
const hideVal = ref("nohide");
|
||||||
|
const tableSize = ref("default");
|
||||||
|
const paginationSmall = ref(false);
|
||||||
const paginationAlign = ref("right");
|
const paginationAlign = ref("right");
|
||||||
const columns: TableColumnList = [
|
const columns: TableColumnList = [
|
||||||
{
|
{
|
||||||
label: "日期",
|
label: "日期",
|
||||||
prop: "date"
|
prop: "date",
|
||||||
|
hide: () => (hideVal.value === "hideDate" ? true : false)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "姓名",
|
label: "姓名",
|
||||||
prop: "name"
|
prop: "name",
|
||||||
|
hide: () => (hideVal.value === "hideName" ? true : false)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "地址",
|
label: "地址",
|
||||||
prop: "address"
|
prop: "address",
|
||||||
|
hide: () => (hideVal.value === "hideAddress" ? true : false)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -29,7 +35,8 @@ export function useColumns() {
|
|||||||
pageSizes: [10, 15, 20],
|
pageSizes: [10, 15, 20],
|
||||||
total: 0,
|
total: 0,
|
||||||
align: "right",
|
align: "right",
|
||||||
background: true
|
background: true,
|
||||||
|
small: false
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 加载动画配置 */
|
/** 加载动画配置 */
|
||||||
@@ -50,6 +57,10 @@ export function useColumns() {
|
|||||||
// background: rgba()
|
// background: rgba()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function onChange(val) {
|
||||||
|
pagination.small = val;
|
||||||
|
}
|
||||||
|
|
||||||
function onSizeChange(val) {
|
function onSizeChange(val) {
|
||||||
console.log("onSizeChange", val);
|
console.log("onSizeChange", val);
|
||||||
}
|
}
|
||||||
@@ -82,9 +93,13 @@ export function useColumns() {
|
|||||||
loading,
|
loading,
|
||||||
columns,
|
columns,
|
||||||
dataList,
|
dataList,
|
||||||
|
hideVal,
|
||||||
|
tableSize,
|
||||||
pagination,
|
pagination,
|
||||||
loadingConfig,
|
loadingConfig,
|
||||||
paginationAlign,
|
paginationAlign,
|
||||||
|
paginationSmall,
|
||||||
|
onChange,
|
||||||
onSizeChange,
|
onSizeChange,
|
||||||
onCurrentChange
|
onCurrentChange
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,9 +5,13 @@ const {
|
|||||||
loading,
|
loading,
|
||||||
columns,
|
columns,
|
||||||
dataList,
|
dataList,
|
||||||
|
hideVal,
|
||||||
|
tableSize,
|
||||||
pagination,
|
pagination,
|
||||||
loadingConfig,
|
loadingConfig,
|
||||||
paginationAlign,
|
paginationAlign,
|
||||||
|
paginationSmall,
|
||||||
|
onChange,
|
||||||
onSizeChange,
|
onSizeChange,
|
||||||
onCurrentChange
|
onCurrentChange
|
||||||
} = useColumns();
|
} = useColumns();
|
||||||
@@ -15,22 +19,45 @@ const {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-space class="float-right mb-2">
|
<el-space class="float-right mb-4">
|
||||||
<p>分页的对齐方式:</p>
|
<p class="text-sm">动态列:</p>
|
||||||
<el-radio-group v-model="paginationAlign">
|
<el-radio-group v-model="hideVal" size="small">
|
||||||
|
<el-radio-button label="nohide">不隐藏</el-radio-button>
|
||||||
|
<el-radio-button label="hideDate">隐藏日期</el-radio-button>
|
||||||
|
<el-radio-button label="hideName">隐藏姓名</el-radio-button>
|
||||||
|
<el-radio-button label="hideAddress">隐藏地址</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
<el-divider direction="vertical" />
|
||||||
|
<p class="text-sm">表格大小:</p>
|
||||||
|
<el-radio-group v-model="tableSize" size="small">
|
||||||
|
<el-radio-button label="large">large</el-radio-button>
|
||||||
|
<el-radio-button label="default">default</el-radio-button>
|
||||||
|
<el-radio-button label="small">small</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
<el-divider direction="vertical" />
|
||||||
|
<p class="text-sm">分页大小:</p>
|
||||||
|
<el-radio-group v-model="paginationSmall" size="small" @change="onChange">
|
||||||
|
<el-radio-button :label="false">no small</el-radio-button>
|
||||||
|
<el-radio-button :label="true">small</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
<el-divider direction="vertical" />
|
||||||
|
<p class="text-sm">分页的对齐方式:</p>
|
||||||
|
<el-radio-group v-model="paginationAlign" size="small">
|
||||||
<el-radio-button label="right">right</el-radio-button>
|
<el-radio-button label="right">right</el-radio-button>
|
||||||
<el-radio-button label="center">center</el-radio-button>
|
<el-radio-button label="center">center</el-radio-button>
|
||||||
<el-radio-button label="left">left</el-radio-button>
|
<el-radio-button label="left">left</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-space>
|
</el-space>
|
||||||
|
|
||||||
<pure-table
|
<pure-table
|
||||||
border
|
border
|
||||||
row-key="id"
|
row-key="id"
|
||||||
alignWhole="center"
|
alignWhole="center"
|
||||||
showOverflowTooltip
|
showOverflowTooltip
|
||||||
|
:size="tableSize"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:loading-config="loadingConfig"
|
:loading-config="loadingConfig"
|
||||||
:height="440"
|
:height="tableSize === 'small' ? 352 : 440"
|
||||||
:data="
|
:data="
|
||||||
dataList.slice(
|
dataList.slice(
|
||||||
(pagination.currentPage - 1) * pagination.pageSize,
|
(pagination.currentPage - 1) * pagination.pageSize,
|
||||||
|
|||||||
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>
|
|
||||||
@@ -48,7 +48,7 @@ function onCloseTags() {
|
|||||||
<template>
|
<template>
|
||||||
<el-card>
|
<el-card>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div>标签页复用,超出限制自动关闭(使用场景: 动态路由)</div>
|
<div>标签页复用,超出限制自动关闭</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="flex flex-wrap items-center">
|
<div class="flex flex-wrap items-center">
|
||||||
<p>query传参模式:</p>
|
<p>query传参模式:</p>
|
||||||
|
|||||||
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