Skip to content

Commit 06c77d5

Browse files
committed
release: update 5.8.0
1 parent c94c3dd commit 06c77d5

File tree

23 files changed

+1662
-1294
lines changed

23 files changed

+1662
-1294
lines changed

mock/asyncRoutes.ts

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,34 @@ const permissionRouter = {
2323
}
2424
},
2525
{
26-
path: "/permission/button/index",
27-
name: "PermissionButton",
26+
path: "/permission/button",
2827
meta: {
2928
title: "按钮权限",
30-
roles: ["admin", "common"],
31-
auths: [
32-
"permission:btn:add",
33-
"permission:btn:edit",
34-
"permission:btn:delete"
35-
]
36-
}
29+
roles: ["admin", "common"]
30+
},
31+
children: [
32+
{
33+
path: "/permission/button/router",
34+
component: "permission/button/index",
35+
name: "PermissionButtonRouter",
36+
meta: {
37+
title: "路由返回按钮权限",
38+
auths: [
39+
"permission:btn:add",
40+
"permission:btn:edit",
41+
"permission:btn:delete"
42+
]
43+
}
44+
},
45+
{
46+
path: "/permission/button/login",
47+
component: "permission/button/perms",
48+
name: "PermissionButtonLogin",
49+
meta: {
50+
title: "登录接口返回按钮权限"
51+
}
52+
}
53+
]
3754
}
3855
]
3956
};

mock/login.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export default defineFakeRoute([
1515
nickname: "小铭",
1616
// 一个用户可能有多个角色
1717
roles: ["admin"],
18+
// 按钮级别权限
19+
permissions: ["*:*:*"],
1820
accessToken: "eyJhbGciOiJIUzUxMiJ9.admin",
1921
refreshToken: "eyJhbGciOiJIUzUxMiJ9.adminRefresh",
2022
expires: "2030/10/30 00:00:00"
@@ -28,6 +30,7 @@ export default defineFakeRoute([
2830
username: "common",
2931
nickname: "小林",
3032
roles: ["common"],
33+
permissions: ["permission:btn:add", "permission:btn:edit"],
3134
accessToken: "eyJhbGciOiJIUzUxMiJ9.common",
3235
refreshToken: "eyJhbGciOiJIUzUxMiJ9.commonRefresh",
3336
expires: "2030/10/30 00:00:00"

package.json

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "electron-pure-admin",
3-
"version": "5.7.0",
3+
"version": "5.8.0",
44
"description": "electron-pure-admin",
55
"private": true,
66
"type": "module",
@@ -54,35 +54,35 @@
5454
},
5555
"dependencies": {
5656
"@pureadmin/descriptions": "^1.2.1",
57-
"@pureadmin/table": "^3.1.2",
58-
"@pureadmin/utils": "^2.4.7",
59-
"@vueuse/core": "^10.11.0",
57+
"@pureadmin/table": "^3.2.0",
58+
"@pureadmin/utils": "^2.4.8",
59+
"@vueuse/core": "^11.0.1",
6060
"@vueuse/motion": "^2.2.3",
6161
"animate.css": "^4.1.1",
62-
"axios": "^1.7.2",
63-
"dayjs": "^1.11.11",
62+
"axios": "^1.7.4",
63+
"dayjs": "^1.11.12",
6464
"echarts": "^5.5.1",
65-
"element-plus": "^2.7.6",
65+
"element-plus": "^2.8.0",
6666
"js-cookie": "^3.0.5",
6767
"localforage": "^1.10.0",
6868
"mitt": "^3.0.1",
6969
"nprogress": "^0.2.0",
7070
"path": "^0.12.7",
71-
"pinia": "^2.1.7",
72-
"pinyin-pro": "^3.23.0",
73-
"qs": "^6.12.2",
71+
"pinia": "^2.2.2",
72+
"pinyin-pro": "^3.24.2",
73+
"qs": "^6.13.0",
7474
"responsive-storage": "^2.2.0",
7575
"sortablejs": "^1.15.2",
76-
"vue": "^3.4.31",
77-
"vue-router": "^4.4.0",
76+
"vue": "^3.4.38",
77+
"vue-router": "^4.4.3",
7878
"vue-tippy": "^6.4.4",
79-
"vue-types": "^5.1.2"
79+
"vue-types": "^5.1.3"
8080
},
8181
"devDependencies": {
82-
"@commitlint/cli": "^19.3.0",
82+
"@commitlint/cli": "^19.4.0",
8383
"@commitlint/config-conventional": "^19.2.2",
8484
"@commitlint/types": "^19.0.3",
85-
"@eslint/js": "^9.6.0",
85+
"@eslint/js": "^9.9.0",
8686
"@faker-js/faker": "^8.4.1",
8787
"@iconify-icons/ep": "^1.2.12",
8888
"@iconify-icons/ri": "^1.2.10",
@@ -91,61 +91,61 @@
9191
"@types/args": "^5.0.3",
9292
"@types/gradient-string": "^1.1.6",
9393
"@types/js-cookie": "^3.0.6",
94-
"@types/node": "^20.14.9",
94+
"@types/node": "^22.4.1",
9595
"@types/nprogress": "^0.2.3",
9696
"@types/qs": "^6.9.15",
9797
"@types/sortablejs": "^1.15.8",
98-
"@typescript-eslint/eslint-plugin": "^7.15.0",
99-
"@typescript-eslint/parser": "^7.15.0",
100-
"@vitejs/plugin-vue": "^5.0.5",
101-
"@vitejs/plugin-vue-jsx": "^4.0.0",
98+
"@typescript-eslint/eslint-plugin": "^7.18.0",
99+
"@typescript-eslint/parser": "^7.18.0",
100+
"@vitejs/plugin-vue": "^5.1.2",
101+
"@vitejs/plugin-vue-jsx": "^4.0.1",
102102
"args": "^5.0.3",
103-
"autoprefixer": "^10.4.19",
104-
"boxen": "^7.1.1",
103+
"autoprefixer": "^10.4.20",
104+
"boxen": "^8.0.1",
105105
"cross-env": "^7.0.3",
106-
"cssnano": "^7.0.3",
106+
"cssnano": "^7.0.5",
107107
"electron": "^31.1.0",
108108
"electron-builder": "^24.13.3",
109-
"eslint": "^9.6.0",
109+
"eslint": "^9.9.0",
110110
"eslint-config-prettier": "^9.1.0",
111111
"eslint-define-config": "^2.1.0",
112-
"eslint-plugin-prettier": "^5.1.3",
112+
"eslint-plugin-prettier": "^5.2.1",
113113
"eslint-plugin-vue": "^9.27.0",
114114
"esno": "^4.7.0",
115115
"gradient-string": "^2.0.2",
116-
"husky": "^9.0.11",
117-
"icon-gen": "^4.0.0",
116+
"husky": "^9.1.4",
117+
"icon-gen": "^5.0.0",
118118
"jimp": "^0.22.12",
119-
"lint-staged": "^15.2.7",
120-
"postcss": "^8.4.39",
119+
"lint-staged": "^15.2.9",
120+
"postcss": "^8.4.41",
121121
"postcss-html": "^1.7.0",
122122
"postcss-import": "^16.1.0",
123123
"postcss-scss": "^4.0.9",
124-
"prettier": "^3.3.2",
125-
"rimraf": "^5.0.7",
124+
"prettier": "^3.3.3",
125+
"rimraf": "^6.0.1",
126126
"rollup-plugin-visualizer": "^5.12.0",
127-
"sass": "^1.77.6",
128-
"stylelint": "^16.6.1",
127+
"sass": "^1.77.8",
128+
"stylelint": "^16.8.2",
129129
"stylelint-config-recess-order": "^5.0.1",
130130
"stylelint-config-recommended-vue": "^1.5.0",
131131
"stylelint-config-standard-scss": "^13.1.0",
132-
"stylelint-prettier": "^5.0.0",
132+
"stylelint-prettier": "^5.0.2",
133133
"svgo": "^3.3.2",
134-
"tailwindcss": "^3.4.4",
135-
"typescript": "^5.5.3",
136-
"vite": "^5.3.2",
134+
"tailwindcss": "^3.4.10",
135+
"typescript": "^5.5.4",
136+
"vite": "^5.4.1",
137137
"vite-plugin-cdn-import": "^1.0.1",
138-
"vite-plugin-checker": "^0.7.0",
138+
"vite-plugin-checker": "^0.7.2",
139139
"vite-plugin-compression": "^0.5.1",
140140
"vite-plugin-electron": "^0.28.7",
141141
"vite-plugin-electron-renderer": "^0.14.5",
142142
"vite-plugin-fake-server": "^2.1.1",
143143
"vite-plugin-remove-console": "^2.2.0",
144144
"vite-plugin-router-warn": "^1.0.0",
145-
"vite-plugin-vue-inspector": "^5.1.2",
145+
"vite-plugin-vue-inspector": "^5.1.3",
146146
"vite-svg-loader": "^5.1.0",
147147
"vue-eslint-parser": "^9.4.3",
148-
"vue-tsc": "^2.0.24"
148+
"vue-tsc": "^2.0.29"
149149
},
150150
"engines": {
151151
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"

public/platform-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Version": "5.7.0",
2+
"Version": "5.8.0",
33
"Title": "PureAdmin",
44
"FixedHeader": true,
55
"HiddenSideBar": false,

src/api/user.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export type UserResult = {
1111
nickname: string;
1212
/** 当前登录用户的角色 */
1313
roles: Array<string>;
14+
/** 按钮级别权限 */
15+
permissions: Array<string>;
1416
/** `token` */
1517
accessToken: string;
1618
/** 用于调用刷新`accessToken`的接口时所需的`token` */

src/components/ReDialog/index.vue

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ defineOptions({
1515
name: "ReDialog"
1616
});
1717
18+
const sureBtnMap = ref({});
1819
const fullscreen = ref(false);
1920
2021
const footerButtons = computed(() => {
@@ -43,10 +44,26 @@ const footerButtons = computed(() => {
4344
bg: true,
4445
popconfirm: options?.popconfirm,
4546
btnClick: ({ dialog: { options, index } }) => {
46-
const done = () =>
47+
if (options?.sureBtnLoading) {
48+
sureBtnMap.value[index] = Object.assign(
49+
{},
50+
sureBtnMap.value[index],
51+
{
52+
loading: true
53+
}
54+
);
55+
}
56+
const closeLoading = () => {
57+
if (options?.sureBtnLoading) {
58+
sureBtnMap.value[index].loading = false;
59+
}
60+
};
61+
const done = () => {
62+
closeLoading();
4763
closeDialog(options, index, { command: "sure" });
64+
};
4865
if (options?.beforeSure && isFunction(options?.beforeSure)) {
49-
options.beforeSure(done, { options, index });
66+
options.beforeSure(done, { options, index, closeLoading });
5067
} else {
5168
done();
5269
}
@@ -172,6 +189,7 @@ function handleClose(
172189
<el-button
173190
v-else
174191
v-bind="btn"
192+
:loading="key === 1 && sureBtnMap[index]?.loading"
175193
@click="
176194
btn.btnClick({
177195
dialog: { options, index },

src/components/ReDialog/type.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ type DialogProps = {
6969
type Popconfirm = {
7070
/** 标题 */
7171
title?: string;
72-
/** 确认按钮文字 */
72+
/** 确定按钮文字 */
7373
confirmButtonText?: string;
7474
/** 取消按钮文字 */
7575
cancelButtonText?: string;
76-
/** 确认按钮类型,默认 `primary` */
76+
/** 确定按钮类型,默认 `primary` */
7777
confirmButtonType?: ButtonType;
7878
/** 取消按钮类型,默认 `text` */
7979
cancelButtonType?: ButtonType;
@@ -121,7 +121,7 @@ type ButtonProps = {
121121
round?: boolean;
122122
/** 是否为圆形按钮,默认 `false` */
123123
circle?: boolean;
124-
/** 确认按钮的 `Popconfirm` 气泡确认框相关配置 */
124+
/** 确定按钮的 `Popconfirm` 气泡确认框相关配置 */
125125
popconfirm?: Popconfirm;
126126
/** 是否为加载中状态,默认 `false` */
127127
loading?: boolean;
@@ -160,8 +160,10 @@ interface DialogOptions extends DialogProps {
160160
props?: any;
161161
/** 是否隐藏 `Dialog` 按钮操作区的内容 */
162162
hideFooter?: boolean;
163-
/** 确认按钮的 `Popconfirm` 气泡确认框相关配置 */
163+
/** 确定按钮的 `Popconfirm` 气泡确认框相关配置 */
164164
popconfirm?: Popconfirm;
165+
/** 点击确定按钮后是否开启 `loading` 加载动画 */
166+
sureBtnLoading?: boolean;
165167
/**
166168
* @description 自定义对话框标题的内容渲染器
167169
* @see {@link https://element-plus.org/zh-CN/component/dialog.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%A4%B4%E9%83%A8}
@@ -259,10 +261,13 @@ interface DialogOptions extends DialogProps {
259261
done: Function,
260262
{
261263
options,
262-
index
264+
index,
265+
closeLoading
263266
}: {
264267
options: DialogOptions;
265268
index: number;
269+
/** 关闭确定按钮的 `loading` 加载动画 */
270+
closeLoading: Function;
266271
}
267272
) => void;
268273
}

src/components/RePerms/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import perms from "./src/perms";
2+
3+
const Perms = perms;
4+
5+
export { Perms };

src/components/RePerms/src/perms.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { defineComponent, Fragment } from "vue";
2+
import { hasPerms } from "@/utils/auth";
3+
4+
export default defineComponent({
5+
name: "Perms",
6+
props: {
7+
value: {
8+
type: undefined,
9+
default: []
10+
}
11+
},
12+
setup(props, { slots }) {
13+
return () => {
14+
if (!slots) return null;
15+
return hasPerms(props.value) ? (
16+
<Fragment>{slots.default?.()}</Fragment>
17+
) : null;
18+
};
19+
}
20+
});

src/components/RePureTableBar/src/bar.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import {
1717
getKeyList
1818
} from "@pureadmin/utils";
1919

20+
import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
21+
import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill";
2022
import DragIcon from "@/assets/table-bar/drag.svg?component";
2123
import ExpandIcon from "@/assets/table-bar/expand.svg?component";
2224
import RefreshIcon from "@/assets/table-bar/refresh.svg?component";
@@ -56,6 +58,7 @@ export default defineComponent({
5658
const size = ref("default");
5759
const loading = ref(false);
5860
const checkAll = ref(true);
61+
const isFullscreen = ref(false);
5962
const isIndeterminate = ref(false);
6063
const instance = getCurrentInstance()!;
6164
const isExpandAll = ref(props.isExpandAll);
@@ -239,7 +242,18 @@ export default defineComponent({
239242

240243
return () => (
241244
<>
242-
<div {...attrs} class="w-[99/100] mt-2 px-2 pb-2 bg-bg_color">
245+
<div
246+
{...attrs}
247+
class={[
248+
"w-[99/100]",
249+
"px-2",
250+
"pb-2",
251+
"bg-bg_color",
252+
isFullscreen.value
253+
? ["!w-full", "!h-full", "z-[2002]", "fixed", "inset-0"]
254+
: "mt-2"
255+
]}
256+
>
243257
<div class="flex justify-between w-full h-[60px] p-4">
244258
{slots?.title ? (
245259
slots.title()
@@ -353,6 +367,14 @@ export default defineComponent({
353367
</el-scrollbar>
354368
</div>
355369
</el-popover>
370+
<el-divider direction="vertical" />
371+
372+
<iconifyIconOffline
373+
class={["w-[16px]", iconClass.value]}
374+
icon={isFullscreen.value ? ExitFullscreen : Fullscreen}
375+
v-tippy={isFullscreen.value ? "退出全屏" : "全屏"}
376+
onClick={() => (isFullscreen.value = !isFullscreen.value)}
377+
/>
356378
</div>
357379
</div>
358380
{slots.default({

0 commit comments

Comments
 (0)