mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2026-02-13 17:30:27 +08:00
Compare commits
23 Commits
v6.2.0
...
f3756089fd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3756089fd | ||
|
|
42076a2247 | ||
|
|
f2616fdfaf | ||
|
|
ebc92ba61c | ||
|
|
fcd28837b2 | ||
|
|
4c07d84463 | ||
|
|
4f59013b61 | ||
|
|
ace4c07590 | ||
|
|
b20323e627 | ||
|
|
30459741d4 | ||
|
|
324caafb10 | ||
|
|
3d86eded69 | ||
|
|
aeb4feb6f9 | ||
|
|
d56211996f | ||
|
|
fb744dbab7 | ||
|
|
080ccae0ff | ||
|
|
c22cafaa1e | ||
|
|
f7bf20af97 | ||
|
|
1b7c0577d9 | ||
|
|
244211c4eb | ||
|
|
e01ad0a5df | ||
|
|
ac61eb807b | ||
|
|
68decd01b8 |
@@ -1,3 +1,27 @@
|
||||
# 6.3.0 (2025-12-10)
|
||||
|
||||
### ✔️ Refactor
|
||||
|
||||
- Renamed "Overall Style" in system configuration to "Theme Mode" and "Navigation Mode" to "Menu Layout" to improve naming professionalism and clarity.
|
||||
- Migrated the deprecated `tseslint.config` configuration method of `typescript-eslint`.
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- Added a color picker panel component.
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- Fixed an issue where the selected/activated state style of the navigation menu was displayed incorrectly when using `iconfont` icons.
|
||||
- Fixed a style issue with the column settings pop-up of the `RePureTableBar` and `ReVxeTableBar` components.
|
||||
|
||||
### 🍏 Perf
|
||||
|
||||
- Adapting the `ReDialog` component to the latest version of `el-dialog` with API changes and supplementary examples
|
||||
- Adapting the `ReDrawer` component to the latest version of `el-drawer` with API changes and supplementary examples
|
||||
- Adapting the `message` utility function to the latest version of `ElMessage` with API changes and supplementary examples
|
||||
- Importing the latest version of `element-plus` components
|
||||
- Optimizing the tab layout and style for Google Chrome mode
|
||||
|
||||
# 6.2.0 (2025-10-16)
|
||||
|
||||
### 🎫 Features
|
||||
|
||||
24
CHANGELOG.md
24
CHANGELOG.md
@@ -1,3 +1,27 @@
|
||||
# 6.3.0 (2025-12-10)
|
||||
|
||||
### ✔️ Refactor
|
||||
|
||||
- Renamed "Overall Style" in system configuration to "Theme Mode" and "Navigation Mode" to "Menu Layout" to improve naming professionalism and clarity.
|
||||
- Migrated the deprecated `tseslint.config` configuration method of `typescript-eslint`.
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- Added a color picker panel component.
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- Fixed an issue where the selected/activated state style of the navigation menu was displayed incorrectly when using `iconfont` icons.
|
||||
- Fixed a style issue with the column settings pop-up of the `RePureTableBar` and `ReVxeTableBar` components.
|
||||
|
||||
### 🍏 Perf
|
||||
|
||||
- Adapting the `ReDialog` component to the latest version of `el-dialog` with API changes and supplementary examples
|
||||
- Adapting the `ReDrawer` component to the latest version of `el-drawer` with API changes and supplementary examples
|
||||
- Adapting the `message` utility function to the latest version of `ElMessage` with API changes and supplementary examples
|
||||
- Importing the latest version of `element-plus` components
|
||||
- Optimizing the tab layout and style for Google Chrome mode
|
||||
|
||||
# 6.2.0 (2025-10-16)
|
||||
|
||||
### 🎫 Features
|
||||
|
||||
@@ -1,8 +1,32 @@
|
||||
# 6.3.0 (2025-12-10)
|
||||
|
||||
### ✔️ Refactor
|
||||
|
||||
- 将系统配置中的“整体风格”更名为“主题模式”,“导航模式”更名为“菜单布局”,以提升命名的专业性与清晰度
|
||||
- 迁移`typescript-eslint`已弃用的`tseslint.config`配置方式
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- 添加颜色选择器面板组件
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- 修复导航菜单在使用`iconfont`图标时,选中/激活状态的样式显示异常问题
|
||||
- 修复`RePureTableBar`和`ReVxeTableBar`组件的列设置弹窗样式问题
|
||||
|
||||
### 🍏 Perf
|
||||
|
||||
- `ReDialog`组件适配`el-dialog`最新版本的`API`变更以及补充相关示例
|
||||
- `ReDrawer`组件适配`el-drawer`最新版本的`API`变更以及补充相关示例
|
||||
- `message`工具函数适配`ElMessage`最新版本的`API`变更以及补充相关示例
|
||||
- 导入`element-plus`最新版本的新组件
|
||||
- 优化页签风格为谷歌模式下的布局和样式
|
||||
|
||||
# 6.2.0 (2025-10-16)
|
||||
|
||||
### 🎫 Feat
|
||||
|
||||
- 添加全屏`403`、`404`、`500`页面,全屏错误页面清晰且安全,提升用户体验
|
||||
- 添加全屏`403`、`404`、`500`页面,全屏错误页面清晰且安全,提升用户体验
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
@@ -26,7 +50,7 @@
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
- 修复`ReSegmented`分段控制器组件在浅色和深色整体风格切换时的闪烁问题
|
||||
- 修复`ReSegmented`分段控制器组件在浅色和深色主题模式切换时的闪烁问题
|
||||
- 修复`resetRouter`未清空全部路由数据问题
|
||||
- 修复标签页-关闭左侧标签页关闭异常问题
|
||||
|
||||
@@ -231,8 +255,8 @@
|
||||
|
||||
- 修复`windwos`下点击注册页面会出现滚动条问题
|
||||
- 修复`windows`下页面切换,内容区会出现滚动条问题
|
||||
- 修复`pure-table`带状态表格在深色整体风格下状态样式消失的问题
|
||||
- 修复系统配置中开启灰色模式和深色整体风格,刷新页面整体风格异常
|
||||
- 修复`pure-table`带状态表格在深色主题模式下状态样式消失的问题
|
||||
- 修复系统配置中开启灰色模式和深色主题模式,刷新页面主题模式异常
|
||||
|
||||
### 🍏 Perf
|
||||
|
||||
@@ -285,7 +309,7 @@
|
||||
- 内嵌`iframe`页支持设置`keepAlive`,保持页面状态
|
||||
- 优化导航,弹出的菜单超出内容区自适应且可滚动
|
||||
- 添加文件上传示例
|
||||
- 添加整体风格自适应操作系统浅色、深色、自动主题功能
|
||||
- 添加主题模式自适应操作系统浅色、深色、自动主题功能
|
||||
- 添加页脚
|
||||
- 支持多标签页打开已经登录的系统后无需再登录并添加内免登录功能(用户可选择免登录的天数)
|
||||
- 带来高级感的终端命令行
|
||||
@@ -485,7 +509,7 @@
|
||||
- 修复菜单搜索功能弹框打开后搜索框未自动聚集的问题
|
||||
- 修复按 `ESC` 退出全屏后,工具栏按钮文案展示问题
|
||||
- 修复移动端通知栏 `tooltip` 点击穿透问题
|
||||
- 修复当左侧菜单收起后,切换到 `horizontal` 导航模式时文字不展示的问题
|
||||
- 修复当左侧菜单收起后,切换到 `horizontal` 菜单布局时文字不展示的问题
|
||||
- 修复导航 `tab` 关闭其他标签页无法重置状态问题
|
||||
- 修复 `getHistoryMode` 函数中环境变量未初始化带来的页面热更新报错
|
||||
- 修复导航 `tab` 过多导致关闭左侧标签页无法正常显示
|
||||
|
||||
@@ -72,8 +72,11 @@ export default defineConfig([
|
||||
]
|
||||
}
|
||||
},
|
||||
...tseslint.config({
|
||||
extends: [...tseslint.configs.recommended],
|
||||
...tseslint.configs.recommended.map(config => ({
|
||||
...config,
|
||||
files: ["**/*.?([cm])ts", "**/*.?([cm])tsx"]
|
||||
})),
|
||||
{
|
||||
files: ["**/*.?([cm])ts", "**/*.?([cm])tsx"],
|
||||
rules: {
|
||||
"@typescript-eslint/no-redeclare": "error",
|
||||
@@ -102,7 +105,7 @@ export default defineConfig([
|
||||
}
|
||||
]
|
||||
}
|
||||
}),
|
||||
},
|
||||
{
|
||||
files: ["**/*.d.ts"],
|
||||
rules: {
|
||||
|
||||
@@ -31,15 +31,15 @@ panel:
|
||||
pureCloseSystemSet: Close System Configs
|
||||
pureClearCacheAndToLogin: Clear cache and return to login page
|
||||
pureClearCache: Clear Cache
|
||||
pureOverallStyle: Overall Style
|
||||
pureOverallStyleLight: Light
|
||||
pureOverallStyleLightTip: Set sail freshly and light up the comfortable work interface
|
||||
pureOverallStyleDark: Dark
|
||||
pureOverallStyleDarkTip: Moonlight Overture, indulge in the tranquility and elegance of the night
|
||||
pureOverallStyleSystem: Auto
|
||||
pureOverallStyleSystemTip: Synchronize time, the interface naturally responds to morning and dusk
|
||||
pureThemeMode: Theme Mode
|
||||
pureThemeModeLight: Light
|
||||
pureThemeModeLightTip: Set sail freshly and light up the comfortable work interface
|
||||
pureThemeModeDark: Dark
|
||||
pureThemeModeDarkTip: Moonlight Overture, indulge in the tranquility and elegance of the night
|
||||
pureThemeModeSystem: Auto
|
||||
pureThemeModeSystemTip: Synchronize time, the interface naturally responds to morning and dusk
|
||||
pureThemeColor: Theme Color
|
||||
pureLayoutModel: Layout Model
|
||||
pureMenuLayout: Menu Layout
|
||||
pureVerticalTip: The menu on the left is familiar and friendly
|
||||
pureHorizontalTip: Top menu, concise overview
|
||||
pureMixTip: Mixed menu, flexible
|
||||
@@ -108,6 +108,7 @@ menus:
|
||||
pureTypeit: Typeit
|
||||
pureJsonEditor: JSON Editor
|
||||
pureColorPicker: Color Picker
|
||||
pureColorPickerPanel: Color PickerPanel
|
||||
pureDatePicker: Date Picker
|
||||
pureDateTimePicker: DateTimePicker
|
||||
pureTimePicker: TimePicker
|
||||
@@ -237,4 +238,19 @@ login:
|
||||
purePassWordRuleReg: The password format should be any combination of 8-18 digits
|
||||
purePassWordSureReg: Please enter confirm password
|
||||
purePassWordDifferentReg: The two passwords do not match!
|
||||
purePassWordUpdateReg: Password has been updated
|
||||
purePassWordUpdateReg: Password has been updated
|
||||
pureLoginExpired: Login expired, please login again
|
||||
tableBar:
|
||||
pureList: List
|
||||
pureLarge: Large
|
||||
pureDefault: Default
|
||||
pureSmall: Small
|
||||
pureColumnSettings: ColumnSettings
|
||||
pureCollapse: Collapse
|
||||
pureExpand: Expand
|
||||
pureRefresh: Refresh
|
||||
pureDensity: Density
|
||||
pureColumnDisplay: ColumnDisplay
|
||||
pureReset: Reset
|
||||
pureExitFullScreen: ExitFullScreen
|
||||
pureFullScreen: FullScreen
|
||||
@@ -31,15 +31,15 @@ panel:
|
||||
pureCloseSystemSet: 关闭配置
|
||||
pureClearCacheAndToLogin: 清空缓存并返回登录页
|
||||
pureClearCache: 清空缓存
|
||||
pureOverallStyle: 整体风格
|
||||
pureOverallStyleLight: 浅色
|
||||
pureOverallStyleLightTip: 清新启航,点亮舒适的工作界面
|
||||
pureOverallStyleDark: 深色
|
||||
pureOverallStyleDarkTip: 月光序曲,沉醉于夜的静谧雅致
|
||||
pureOverallStyleSystem: 自动
|
||||
pureOverallStyleSystemTip: 同步时光,界面随晨昏自然呼应
|
||||
pureThemeMode: 主题模式
|
||||
pureThemeModeLight: 浅色
|
||||
pureThemeModeLightTip: 清新启航,点亮舒适的工作界面
|
||||
pureThemeModeDark: 深色
|
||||
pureThemeModeDarkTip: 月光序曲,沉醉于夜的静谧雅致
|
||||
pureThemeModeSystem: 自动
|
||||
pureThemeModeSystemTip: 同步时光,界面随晨昏自然呼应
|
||||
pureThemeColor: 主题色
|
||||
pureLayoutModel: 导航模式
|
||||
pureMenuLayout: 菜单布局
|
||||
pureVerticalTip: 左侧菜单,亲切熟悉
|
||||
pureHorizontalTip: 顶部菜单,简洁概览
|
||||
pureMixTip: 混合菜单,灵活多变
|
||||
@@ -108,6 +108,7 @@ menus:
|
||||
pureTypeit: 打字机
|
||||
pureJsonEditor: JSON编辑器
|
||||
pureColorPicker: 颜色选择器
|
||||
pureColorPickerPanel: 颜色选择器面板
|
||||
pureDatePicker: 日期选择器
|
||||
pureDateTimePicker: 日期时间选择器
|
||||
pureTimePicker: 时间选择器
|
||||
@@ -237,4 +238,19 @@ login:
|
||||
purePassWordRuleReg: 密码格式应为8-18位数字、字母、符号的任意两种组合
|
||||
purePassWordSureReg: 请输入确认密码
|
||||
purePassWordDifferentReg: 两次密码不一致!
|
||||
purePassWordUpdateReg: 修改密码成功
|
||||
purePassWordUpdateReg: 修改密码成功
|
||||
pureLoginExpired: 登录已过期,请重新登录
|
||||
tableBar:
|
||||
pureList: 列表
|
||||
pureLarge: 宽松
|
||||
pureDefault: 默认
|
||||
pureSmall: 紧凑
|
||||
pureColumnSettings: 列设置
|
||||
pureCollapse: 折叠
|
||||
pureExpand: 展开
|
||||
pureRefresh: 刷新
|
||||
pureDensity: 密度
|
||||
pureColumnDisplay: 列展示
|
||||
pureReset: 重置
|
||||
pureExitFullScreen: 退出全屏
|
||||
pureFullScreen: 全屏
|
||||
@@ -326,7 +326,8 @@ export default defineFakeRoute([
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
systemManagementRouter,
|
||||
systemMonitorRouter,
|
||||
|
||||
@@ -6,7 +6,8 @@ export default defineFakeRoute([
|
||||
method: "post",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,8 @@ export default defineFakeRoute([
|
||||
response: ({ body }) => {
|
||||
if (body.username === "admin") {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
avatar: "https://avatars.githubusercontent.com/u/44761321",
|
||||
username: "admin",
|
||||
@@ -24,7 +25,8 @@ export default defineFakeRoute([
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
avatar: "https://avatars.githubusercontent.com/u/52823142",
|
||||
username: "common",
|
||||
|
||||
@@ -33,7 +33,8 @@ export default defineFakeRoute([
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: mapList()
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ export default defineFakeRoute([
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
avatar: "https://avatars.githubusercontent.com/u/44761321",
|
||||
username: "admin",
|
||||
@@ -46,7 +47,8 @@ export default defineFakeRoute([
|
||||
}
|
||||
];
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
|
||||
@@ -8,7 +8,8 @@ export default defineFakeRoute([
|
||||
response: ({ body }) => {
|
||||
if (body.refreshToken) {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
accessToken: "eyJhbGciOiJIUzUxMiJ9.newAdmin",
|
||||
refreshToken: "eyJhbGciOiJIUzUxMiJ9.newAdminRefresh",
|
||||
@@ -18,7 +19,8 @@ export default defineFakeRoute([
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
success: false,
|
||||
code: 10001,
|
||||
message: "请求参数缺失或格式不正确",
|
||||
data: {}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -50,7 +50,8 @@ export default defineFakeRoute([
|
||||
if (body.phone) list = list.filter(item => item.phone === body.phone);
|
||||
if (body.deptId) list = list.filter(item => item.dept.id === body.deptId);
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
@@ -66,7 +67,8 @@ export default defineFakeRoute([
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
{ id: 1, name: "超级管理员" },
|
||||
{ id: 2, name: "普通角色" }
|
||||
@@ -82,18 +84,21 @@ export default defineFakeRoute([
|
||||
if (body.userId) {
|
||||
if (body.userId == 1) {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [1]
|
||||
};
|
||||
} else if (body.userId == 2) {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [2]
|
||||
};
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
success: false,
|
||||
code: 10001,
|
||||
message: "请求参数缺失或格式不正确",
|
||||
data: []
|
||||
};
|
||||
}
|
||||
@@ -130,7 +135,8 @@ export default defineFakeRoute([
|
||||
);
|
||||
if (body.code) list = list.filter(item => item.code === body.code);
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
@@ -146,7 +152,8 @@ export default defineFakeRoute([
|
||||
method: "post",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
// 外部页面
|
||||
{
|
||||
@@ -350,7 +357,8 @@ export default defineFakeRoute([
|
||||
response: ({ body }) => {
|
||||
if (body.id == 1) {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 200, 201,
|
||||
202, 203, 204, 205, 300, 301, 302, 303, 304, 400, 401, 402, 403,
|
||||
@@ -359,7 +367,8 @@ export default defineFakeRoute([
|
||||
};
|
||||
} else if (body.id == 2) {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 404, 500,
|
||||
501, 502, 503
|
||||
@@ -374,7 +383,8 @@ export default defineFakeRoute([
|
||||
method: "post",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
// 外部页面
|
||||
{
|
||||
@@ -1255,7 +1265,8 @@ export default defineFakeRoute([
|
||||
method: "post",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
{
|
||||
name: "杭州总公司",
|
||||
@@ -1418,7 +1429,8 @@ export default defineFakeRoute([
|
||||
];
|
||||
list = list.filter(item => item.username.includes(body?.username));
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
@@ -1462,7 +1474,8 @@ export default defineFakeRoute([
|
||||
String(item.status).includes(String(body?.status))
|
||||
);
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
@@ -1508,7 +1521,8 @@ export default defineFakeRoute([
|
||||
String(item.status).includes(String(body?.status))
|
||||
);
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
@@ -1566,7 +1580,8 @@ export default defineFakeRoute([
|
||||
];
|
||||
list = list.filter(item => item.module.includes(body?.module));
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
@@ -1601,7 +1616,8 @@ export default defineFakeRoute([
|
||||
"Content-Length": 17019
|
||||
},
|
||||
responseBody: {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
{
|
||||
parentId: 0,
|
||||
|
||||
98
package.json
98
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vue-pure-admin",
|
||||
"version": "6.2.0",
|
||||
"version": "6.3.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -54,25 +54,25 @@
|
||||
"@logicflow/extension": "^1.2.28",
|
||||
"@pureadmin/descriptions": "^1.2.1",
|
||||
"@pureadmin/table": "^3.3.0",
|
||||
"@pureadmin/utils": "^2.6.2",
|
||||
"@pureadmin/utils": "^2.6.3",
|
||||
"@vue-flow/background": "^1.3.2",
|
||||
"@vue-flow/core": "^1.47.0",
|
||||
"@vueuse/core": "^13.9.0",
|
||||
"@vue-flow/core": "^1.48.1",
|
||||
"@vueuse/core": "^14.1.0",
|
||||
"@vueuse/motion": "^3.0.3",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"@zxcvbn-ts/core": "^3.0.4",
|
||||
"animate.css": "^4.1.1",
|
||||
"axios": "^1.12.2",
|
||||
"axios": "^1.13.2",
|
||||
"china-area-data": "^5.0.1",
|
||||
"codemirror": "^5.65.20",
|
||||
"codemirror-editor-vue3": "^2.8.0",
|
||||
"cropperjs": "^1.6.2",
|
||||
"dayjs": "^1.11.18",
|
||||
"deep-chat": "^2.2.2",
|
||||
"dayjs": "^1.11.19",
|
||||
"deep-chat": "^2.3.0",
|
||||
"echarts": "^6.0.0",
|
||||
"el-table-infinite-scroll": "^3.0.7",
|
||||
"element-plus": "^2.11.4",
|
||||
"el-table-infinite-scroll": "^3.0.8",
|
||||
"element-plus": "^2.13.0",
|
||||
"highlight.js": "^11.11.1",
|
||||
"intro.js": "^7.2.0",
|
||||
"js-cookie": "^3.0.5",
|
||||
@@ -83,24 +83,24 @@
|
||||
"mqtt": "4.3.7",
|
||||
"nprogress": "^0.2.0",
|
||||
"path-browserify": "^1.0.1",
|
||||
"pinia": "^3.0.3",
|
||||
"pinia": "^3.0.4",
|
||||
"pinyin-pro": "^3.27.0",
|
||||
"plus-pro-components": "^0.1.29",
|
||||
"plus-pro-components": "^0.1.30",
|
||||
"qrcode": "^1.5.4",
|
||||
"qs": "^6.14.0",
|
||||
"responsive-storage": "^2.2.0",
|
||||
"sortablejs": "^1.15.6",
|
||||
"swiper": "^12.0.2",
|
||||
"swiper": "^12.0.3",
|
||||
"typeit": "^8.8.7",
|
||||
"v-contextmenu": "^3.2.0",
|
||||
"v3-infinite-loading": "^1.3.2",
|
||||
"vditor": "^3.11.2",
|
||||
"version-rocket": "^1.7.4",
|
||||
"vue": "^3.5.22",
|
||||
"vue-i18n": "^11.1.12",
|
||||
"vue-json-pretty": "^2.5.0",
|
||||
"vue": "^3.5.26",
|
||||
"vue-i18n": "^11.2.7",
|
||||
"vue-json-pretty": "^2.6.0",
|
||||
"vue-pdf-embed": "^2.1.3",
|
||||
"vue-router": "^4.5.1",
|
||||
"vue-router": "^4.6.4",
|
||||
"vue-tippy": "^6.7.1",
|
||||
"vue-types": "^6.0.0",
|
||||
"vue-virtual-scroller": "2.0.0-beta.8",
|
||||
@@ -109,70 +109,70 @@
|
||||
"vue3-puzzle-vcode": "^1.1.7",
|
||||
"vuedraggable": "^4.1.0",
|
||||
"vxe-table": "4.6.25",
|
||||
"wavesurfer.js": "^7.11.0",
|
||||
"wavesurfer.js": "^7.12.1",
|
||||
"xgplayer": "^3.0.23",
|
||||
"xlsx": "^0.18.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^20.1.0",
|
||||
"@commitlint/config-conventional": "^20.0.0",
|
||||
"@commitlint/types": "^20.0.0",
|
||||
"@eslint/js": "^9.37.0",
|
||||
"@faker-js/faker": "^10.0.0",
|
||||
"@iconify/json": "^2.2.393",
|
||||
"@commitlint/cli": "^20.2.0",
|
||||
"@commitlint/config-conventional": "^20.2.0",
|
||||
"@commitlint/types": "^20.2.0",
|
||||
"@eslint/js": "^9.39.2",
|
||||
"@faker-js/faker": "^10.1.0",
|
||||
"@iconify/json": "^2.2.417",
|
||||
"@iconify/vue": "4.2.0",
|
||||
"@intlify/unplugin-vue-i18n": "^11.0.1",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"@types/codemirror": "^5.60.16",
|
||||
"@intlify/unplugin-vue-i18n": "^11.0.3",
|
||||
"@tailwindcss/vite": "^4.1.18",
|
||||
"@types/codemirror": "^5.60.17",
|
||||
"@types/dagre": "^0.7.53",
|
||||
"@types/intro.js": "^5.1.5",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@types/node": "^20.19.19",
|
||||
"@types/node": "^20.19.27",
|
||||
"@types/nprogress": "^0.2.3",
|
||||
"@types/path-browserify": "^1.0.3",
|
||||
"@types/qrcode": "^1.5.5",
|
||||
"@types/qrcode": "^1.5.6",
|
||||
"@types/qs": "^6.14.0",
|
||||
"@types/sortablejs": "^1.15.8",
|
||||
"@vitejs/plugin-vue": "^6.0.1",
|
||||
"@vitejs/plugin-vue-jsx": "^5.1.1",
|
||||
"@types/sortablejs": "^1.15.9",
|
||||
"@vitejs/plugin-vue": "^6.0.3",
|
||||
"@vitejs/plugin-vue-jsx": "^5.1.2",
|
||||
"boxen": "^8.0.1",
|
||||
"code-inspector-plugin": "^1.2.10",
|
||||
"cssnano": "^7.1.1",
|
||||
"code-inspector-plugin": "^1.3.3",
|
||||
"cssnano": "^7.1.2",
|
||||
"dagre": "^0.8.5",
|
||||
"eslint": "^9.37.0",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"eslint-plugin-vue": "^10.5.0",
|
||||
"eslint-plugin-vue": "^10.6.2",
|
||||
"gradient-string": "^3.0.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.2.3",
|
||||
"lint-staged": "^16.2.7",
|
||||
"postcss": "^8.5.6",
|
||||
"postcss-html": "^1.8.0",
|
||||
"postcss-load-config": "^6.0.1",
|
||||
"postcss-scss": "^4.0.9",
|
||||
"prettier": "^3.6.2",
|
||||
"rimraf": "^6.0.1",
|
||||
"rollup-plugin-visualizer": "^6.0.4",
|
||||
"sass": "^1.93.2",
|
||||
"stylelint": "^16.25.0",
|
||||
"stylelint-config-recess-order": "^7.3.0",
|
||||
"prettier": "^3.7.4",
|
||||
"rimraf": "^6.1.2",
|
||||
"rollup-plugin-visualizer": "^6.0.5",
|
||||
"sass": "^1.97.1",
|
||||
"stylelint": "^16.26.1",
|
||||
"stylelint-config-recess-order": "^7.4.0",
|
||||
"stylelint-config-recommended-vue": "^1.6.1",
|
||||
"stylelint-config-standard-scss": "^14.0.0",
|
||||
"stylelint-prettier": "^5.0.3",
|
||||
"svgo": "^4.0.0",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"tailwindcss": "^4.1.18",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.46.0",
|
||||
"unplugin-icons": "^22.4.2",
|
||||
"vite": "^7.1.9",
|
||||
"typescript-eslint": "^8.50.0",
|
||||
"unplugin-icons": "^22.5.0",
|
||||
"vite": "^7.3.0",
|
||||
"vite-plugin-cdn-import": "^1.0.1",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-fake-server": "^2.2.0",
|
||||
"vite-plugin-fake-server": "^2.2.2",
|
||||
"vite-plugin-remove-console": "^2.2.0",
|
||||
"vite-plugin-router-warn": "^1.0.0",
|
||||
"vite-plugin-router-warn": "^2.0.0",
|
||||
"vite-svg-loader": "^5.1.0",
|
||||
"vue-eslint-parser": "^10.2.0",
|
||||
"vue-tsc": "^3.1.1"
|
||||
"vue-tsc": "^3.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || >=22.13.0",
|
||||
|
||||
3872
pnpm-lock.yaml
generated
3872
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"Version": "6.2.0",
|
||||
"Version": "6.3.0",
|
||||
"Title": "PureAdmin",
|
||||
"FixedHeader": true,
|
||||
"HiddenSideBar": false,
|
||||
@@ -9,7 +9,7 @@
|
||||
"Layout": "vertical",
|
||||
"Theme": "light",
|
||||
"DarkMode": false,
|
||||
"OverallStyle": "light",
|
||||
"ThemeMode": "light",
|
||||
"Grey": false,
|
||||
"Weak": false,
|
||||
"HideTabs": false,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
type Result = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data?: {
|
||||
/** 列表数据 */
|
||||
list: Array<any>;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
type Result = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data: Array<any>;
|
||||
};
|
||||
|
||||
@@ -14,7 +15,7 @@ export const mapJson = (params?: object) => {
|
||||
export const formUpload = data => {
|
||||
return http.request<Result>(
|
||||
"post",
|
||||
"https://run.mocky.io/v3/3aa761d7-b0b3-4a03-96b3-6168d4f7467b",
|
||||
"https://pureadmin.free.beeceptor.com/images",
|
||||
{ data },
|
||||
{
|
||||
headers: {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
type Result = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data: Array<any>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
type Result = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data?: Array<any>;
|
||||
};
|
||||
|
||||
type ResultTable = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data?: {
|
||||
/** 列表数据 */
|
||||
list: Array<any>;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
export type UserResult = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
/** 头像 */
|
||||
avatar: string;
|
||||
@@ -23,7 +24,8 @@ export type UserResult = {
|
||||
};
|
||||
|
||||
export type RefreshTokenResult = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
/** `token` */
|
||||
accessToken: string;
|
||||
@@ -50,12 +52,14 @@ export type UserInfo = {
|
||||
};
|
||||
|
||||
export type UserInfoResult = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data: UserInfo;
|
||||
};
|
||||
|
||||
type ResultTable = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data?: {
|
||||
/** 列表数据 */
|
||||
list: Array<any>;
|
||||
|
||||
@@ -35,8 +35,20 @@ type DialogProps = {
|
||||
top?: string;
|
||||
/** 是否需要遮罩层,默认 `true` */
|
||||
modal?: boolean;
|
||||
/** 是否允许穿透遮罩层,默认 `false`。使用时需将 `modal` 属性设置为 `false` */
|
||||
modalPenetrable?: boolean;
|
||||
/** 遮罩的自定义类名 */
|
||||
modalClass?: string;
|
||||
/** `header` 部分的自定义 `class` 名 */
|
||||
headerClass?: string;
|
||||
/** `body` 部分的自定义 `class` 名 */
|
||||
bodyClass?: string;
|
||||
/** `footer` 部分的自定义 `class` 名 */
|
||||
footerClass?: string;
|
||||
/** `Dialog` 自身是否插入至 `body` 元素上。嵌套的 `Dialog` 必须指定该属性并赋值为 `true`,默认 `false` */
|
||||
appendToBody?: boolean;
|
||||
/** `Dialog` 挂载到哪个 `DOM` 元素,该属性会覆盖 `append-to-body` 属性,默认 `body` */
|
||||
appendTo?: string | HTMLElement;
|
||||
/** 是否在 `Dialog` 出现时将 `body` 滚动锁定,默认 `true` */
|
||||
lockScroll?: boolean;
|
||||
/** `Dialog` 的自定义类名 */
|
||||
@@ -57,12 +69,22 @@ type DialogProps = {
|
||||
beforeClose?: (done: DoneFn) => void;
|
||||
/** 为 `Dialog` 启用可拖拽功能,默认 `false` */
|
||||
draggable?: boolean;
|
||||
/** 拖动范围可以超出可视区,默认 `false` */
|
||||
overflow?: boolean;
|
||||
/** 是否让 `Dialog` 的 `header` 和 `footer` 部分居中排列,默认 `false` */
|
||||
center?: boolean;
|
||||
/** 是否水平垂直对齐对话框,默认 `false` */
|
||||
alignCenter?: boolean;
|
||||
/** 当关闭 `Dialog` 时,销毁其中的元素,默认 `false` */
|
||||
destroyOnClose?: boolean;
|
||||
/** 自定义关闭图标,默认 `Close` */
|
||||
closeIcon?: string | Component;
|
||||
/** 和原生的 `CSS` 的 `z-index` 相同,改变 `z` 轴的顺序 */
|
||||
zIndex?: number;
|
||||
/** `header` 的 `aria-level` 属性 */
|
||||
headerAriaLevel?: string;
|
||||
/** 对话框动画的自定义过渡配置。可以是一个字符串(过渡名称),也可以是一个包含 `Vue` 过渡属性的对象,默认 `dialog-fade` */
|
||||
transition?: string | object;
|
||||
};
|
||||
|
||||
//element-plus.org/zh-CN/component/popconfirm.html#attributes
|
||||
|
||||
@@ -6,7 +6,6 @@ type ArgsType = {
|
||||
/** `cancel` 点击取消按钮、`sure` 点击确定按钮、`close` 点击右上角关闭按钮或空白页或按下了 `esc` 键 */
|
||||
command: "cancel" | "sure" | "close";
|
||||
};
|
||||
|
||||
type ButtonType =
|
||||
| "primary"
|
||||
| "success"
|
||||
@@ -20,11 +19,11 @@ type DrawerProps = {
|
||||
visible?: boolean;
|
||||
/** `Drawer` 自身是否插入至 `body` 元素上。嵌套的 `Drawer` 必须指定该属性并赋值为 `true`,默认 `false` */
|
||||
appendToBody?: boolean;
|
||||
/** 挂载到哪个 `DOM` 元素 将覆盖 `appendToBody` */
|
||||
/** 挂载到哪个 `DOM` 元素,会覆盖 `appendToBody` 属性,默认 `body` */
|
||||
appendTo?: string;
|
||||
/** 是否在 `Drawer` 出现时将 `body` 滚动锁定,默认 `true` */
|
||||
lockScroll?: boolean;
|
||||
/** 关闭前的回调,会暂停 `Drawer` 的关闭 回调函数内执行 `done` 参数方法的时候才是真正关闭对话框的时候 */
|
||||
/** 关闭前的回调,会暂停 `Drawer` 的关闭,回调函数内执行 `done` 参数方法的时候才是真正关闭对话框的时候 */
|
||||
beforeClose?: (done: DoneFn) => void;
|
||||
/** 是否可以通过点击 `modal` 关闭 `Drawer` ,默认 `true` */
|
||||
closeOnClickModal?: boolean;
|
||||
@@ -44,9 +43,13 @@ type DrawerProps = {
|
||||
destroyOnClose?: boolean;
|
||||
/** 是否需要遮罩层,默认 `true` */
|
||||
modal?: boolean;
|
||||
/** 是否允许穿透遮罩层,默认 `false`。使用时需将 `modal` 属性设置为 `false` */
|
||||
modalPenetrable?: boolean;
|
||||
/** `Drawer` 打开的方向,默认 `rtl` */
|
||||
direction?: "rtl" | "ltr" | "ttb" | "btt";
|
||||
/** `Drawer` 窗体的大小, 当使用 `number` 类型时, 以像素为单位, 当使用 `string` 类型时, 请传入 `'x%'`, 否则便会以 `number` 类型解释 */
|
||||
/** 是否启用可调整大小的功能,默认 `false` */
|
||||
resizable?: boolean;
|
||||
/** `Drawer` 窗体的大小, 当使用 `number` 类型时, 以像素为单位, 当使用 `string` 类型时, 请传入 `'x%'`, 否则便会以 `number` 类型解释,默认 `30%` */
|
||||
size?: string | number;
|
||||
/** `Drawer` 的标题 */
|
||||
title?: string;
|
||||
@@ -54,6 +57,12 @@ type DrawerProps = {
|
||||
withHeader?: boolean;
|
||||
/** 遮罩层的自定义类名 */
|
||||
modalClass?: string;
|
||||
/** `header` 部分的自定义 `class` 名 */
|
||||
headerClass?: string;
|
||||
/** `body` 部分的自定义 `class` 名 */
|
||||
bodyClass?: string;
|
||||
/** `footer` 部分的自定义 `class` 名 */
|
||||
footerClass?: string;
|
||||
/** 设置 `z-index` */
|
||||
zIndex?: number;
|
||||
/** `header` 的 `aria-level` 属性,默认 `2` */
|
||||
|
||||
@@ -92,14 +92,16 @@ onBeforeMount(() => {
|
||||
|
||||
// 获取模拟车辆信息
|
||||
mapJson()
|
||||
.then(({ data }) => {
|
||||
const points: object = data.map(v => {
|
||||
return {
|
||||
lnglat: [v.lng, v.lat],
|
||||
...v
|
||||
};
|
||||
});
|
||||
if (MarkerCluster) MarkerCluster.setData(points);
|
||||
.then(({ code, data }) => {
|
||||
if (code === 0) {
|
||||
const points: object = data.map(v => {
|
||||
return {
|
||||
lnglat: [v.lng, v.lat],
|
||||
...v
|
||||
};
|
||||
});
|
||||
if (MarkerCluster) MarkerCluster.setData(points);
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log("err:", err);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Sortable from "sortablejs";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
import { $t, transformI18n } from "@/plugins/i18n";
|
||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||
import {
|
||||
type PropType,
|
||||
@@ -30,7 +30,7 @@ const props = {
|
||||
/** 头部最左边的标题 */
|
||||
title: {
|
||||
type: String,
|
||||
default: "列表"
|
||||
default: $t("tableBar.pureList")
|
||||
},
|
||||
/** 对于树形表格,如果想启用展开和折叠功能,传入当前表格的ref即可 */
|
||||
tableRef: {
|
||||
@@ -100,7 +100,7 @@ export default defineComponent({
|
||||
"pt-[3px]",
|
||||
"px-[11px]",
|
||||
"border-b-[1px]",
|
||||
"border-solid",
|
||||
"border-b-solid",
|
||||
"border-[#dcdfe6]",
|
||||
"dark:border-[#303030]"
|
||||
];
|
||||
@@ -169,19 +169,19 @@ export default defineComponent({
|
||||
style={getDropdownItemStyle.value("large")}
|
||||
onClick={() => (size.value = "large")}
|
||||
>
|
||||
宽松
|
||||
{transformI18n($t("tableBar.pureLarge"))}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
style={getDropdownItemStyle.value("default")}
|
||||
onClick={() => (size.value = "default")}
|
||||
>
|
||||
默认
|
||||
{transformI18n($t("tableBar.pureDefault"))}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
style={getDropdownItemStyle.value("small")}
|
||||
onClick={() => (size.value = "small")}
|
||||
>
|
||||
紧凑
|
||||
{transformI18n($t("tableBar.pureSmall"))}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
)
|
||||
@@ -245,7 +245,9 @@ export default defineComponent({
|
||||
reference: () => (
|
||||
<SettingIcon
|
||||
class={["w-[16px]", iconClass.value]}
|
||||
v-tippy={rendTippyProps("列设置")}
|
||||
v-tippy={rendTippyProps(
|
||||
transformI18n($t("tableBar.pureColumnSettings"))
|
||||
)}
|
||||
/>
|
||||
)
|
||||
};
|
||||
@@ -268,7 +270,7 @@ export default defineComponent({
|
||||
{slots?.title ? (
|
||||
slots.title()
|
||||
) : (
|
||||
<p class="font-bold truncate">{props.title}</p>
|
||||
<p class="font-bold truncate">{transformI18n(props.title)}</p>
|
||||
)}
|
||||
<div class="flex items-center justify-around">
|
||||
{slots?.buttons ? (
|
||||
@@ -282,7 +284,9 @@ export default defineComponent({
|
||||
transform: isExpandAll.value ? "none" : "rotate(-90deg)"
|
||||
}}
|
||||
v-tippy={rendTippyProps(
|
||||
isExpandAll.value ? "折叠" : "展开"
|
||||
isExpandAll.value
|
||||
? transformI18n($t("tableBar.pureCollapse"))
|
||||
: transformI18n($t("tableBar.pureExpand"))
|
||||
)}
|
||||
onClick={() => onExpand()}
|
||||
/>
|
||||
@@ -295,14 +299,18 @@ export default defineComponent({
|
||||
iconClass.value,
|
||||
loading.value ? "animate-spin" : ""
|
||||
]}
|
||||
v-tippy={rendTippyProps("刷新")}
|
||||
v-tippy={rendTippyProps(
|
||||
transformI18n($t("tableBar.pureRefresh"))
|
||||
)}
|
||||
onClick={() => onReFresh()}
|
||||
/>
|
||||
<el-divider direction="vertical" />
|
||||
<el-dropdown
|
||||
v-slots={dropdown}
|
||||
trigger="click"
|
||||
v-tippy={rendTippyProps("密度")}
|
||||
v-tippy={rendTippyProps(
|
||||
transformI18n($t("tableBar.pureDensity"))
|
||||
)}
|
||||
>
|
||||
<CollapseIcon class={["w-[16px]", iconClass.value]} />
|
||||
</el-dropdown>
|
||||
@@ -318,13 +326,13 @@ export default defineComponent({
|
||||
<div class={[topClass.value]}>
|
||||
<el-checkbox
|
||||
class="-mr-1!"
|
||||
label="列展示"
|
||||
label={transformI18n($t("tableBar.pureColumnDisplay"))}
|
||||
v-model={checkAll.value}
|
||||
indeterminate={isIndeterminate.value}
|
||||
onChange={value => handleCheckAllChange(value)}
|
||||
/>
|
||||
<el-button type="primary" link onClick={() => onReset()}>
|
||||
重置
|
||||
{transformI18n($t("tableBar.pureReset"))}
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
@@ -382,7 +390,11 @@ export default defineComponent({
|
||||
<iconifyIconOffline
|
||||
class={["w-[16px]", iconClass.value]}
|
||||
icon={isFullscreen.value ? ExitFullscreen : Fullscreen}
|
||||
v-tippy={isFullscreen.value ? "退出全屏" : "全屏"}
|
||||
v-tippy={
|
||||
isFullscreen.value
|
||||
? transformI18n($t("tableBar.pureExitFullScreen"))
|
||||
: transformI18n($t("tableBar.pureFullScreen"))
|
||||
}
|
||||
onClick={() => onFullscreen()}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Sortable from "sortablejs";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
import { $t, transformI18n } from "@/plugins/i18n";
|
||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||
import { delay, cloneDeep, getKeyList } from "@pureadmin/utils";
|
||||
import {
|
||||
@@ -24,7 +24,7 @@ const props = {
|
||||
/** 头部最左边的标题 */
|
||||
title: {
|
||||
type: String,
|
||||
default: "列表"
|
||||
default: $t("tableBar.pureList")
|
||||
},
|
||||
vxeTableRef: {
|
||||
type: Object as PropType<any>
|
||||
@@ -93,7 +93,7 @@ export default defineComponent({
|
||||
"pt-[3px]",
|
||||
"px-[11px]",
|
||||
"border-b-[1px]",
|
||||
"border-solid",
|
||||
"border-b-solid",
|
||||
"border-[#dcdfe6]",
|
||||
"dark:border-[#303030]"
|
||||
];
|
||||
@@ -161,19 +161,19 @@ export default defineComponent({
|
||||
style={getDropdownItemStyle.value("medium")}
|
||||
onClick={() => changeSize("medium")}
|
||||
>
|
||||
宽松
|
||||
{transformI18n($t("tableBar.pureLarge"))}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
style={getDropdownItemStyle.value("small")}
|
||||
onClick={() => changeSize("small")}
|
||||
>
|
||||
默认
|
||||
{transformI18n($t("tableBar.pureDefault"))}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
style={getDropdownItemStyle.value("mini")}
|
||||
onClick={() => changeSize("mini")}
|
||||
>
|
||||
紧凑
|
||||
{transformI18n($t("tableBar.pureSmall"))}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
)
|
||||
@@ -238,7 +238,9 @@ export default defineComponent({
|
||||
reference: () => (
|
||||
<SettingIcon
|
||||
class={["w-[16px]", iconClass.value]}
|
||||
v-tippy={rendTippyProps("列设置")}
|
||||
v-tippy={rendTippyProps(
|
||||
transformI18n($t("tableBar.pureColumnSettings"))
|
||||
)}
|
||||
/>
|
||||
)
|
||||
};
|
||||
@@ -261,7 +263,7 @@ export default defineComponent({
|
||||
{slots?.title ? (
|
||||
slots.title()
|
||||
) : (
|
||||
<p class="font-bold truncate">{props.title}</p>
|
||||
<p class="font-bold truncate">{transformI18n(props.title)}</p>
|
||||
)}
|
||||
<div class="flex items-center justify-around">
|
||||
{slots?.buttons ? (
|
||||
@@ -275,7 +277,9 @@ export default defineComponent({
|
||||
transform: isExpandAll.value ? "none" : "rotate(-90deg)"
|
||||
}}
|
||||
v-tippy={rendTippyProps(
|
||||
isExpandAll.value ? "折叠" : "展开"
|
||||
isExpandAll.value
|
||||
? transformI18n($t("tableBar.pureCollapse"))
|
||||
: transformI18n($t("tableBar.pureExpand"))
|
||||
)}
|
||||
onClick={() => onExpand()}
|
||||
/>
|
||||
@@ -288,14 +292,18 @@ export default defineComponent({
|
||||
iconClass.value,
|
||||
loading.value ? "animate-spin" : ""
|
||||
]}
|
||||
v-tippy={rendTippyProps("刷新")}
|
||||
v-tippy={rendTippyProps(
|
||||
transformI18n($t("tableBar.pureRefresh"))
|
||||
)}
|
||||
onClick={() => onReFresh()}
|
||||
/>
|
||||
<el-divider direction="vertical" />
|
||||
<el-dropdown
|
||||
v-slots={dropdown}
|
||||
trigger="click"
|
||||
v-tippy={rendTippyProps("密度")}
|
||||
v-tippy={rendTippyProps(
|
||||
transformI18n($t("tableBar.pureDensity"))
|
||||
)}
|
||||
>
|
||||
<CollapseIcon class={["w-[16px]", iconClass.value]} />
|
||||
</el-dropdown>
|
||||
@@ -311,13 +319,13 @@ export default defineComponent({
|
||||
<div class={[topClass.value]}>
|
||||
<el-checkbox
|
||||
class="-mr-1!"
|
||||
label="列展示"
|
||||
label={transformI18n($t("tableBar.pureColumnDisplay"))}
|
||||
v-model={checkAll.value}
|
||||
indeterminate={isIndeterminate.value}
|
||||
onChange={value => handleCheckAllChange(value)}
|
||||
/>
|
||||
<el-button type="primary" link onClick={() => onReset()}>
|
||||
重置
|
||||
{transformI18n($t("tableBar.pureReset"))}
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
@@ -373,7 +381,11 @@ export default defineComponent({
|
||||
<iconifyIconOffline
|
||||
class={["w-[16px]", iconClass.value]}
|
||||
icon={isFullscreen.value ? ExitFullscreen : Fullscreen}
|
||||
v-tippy={isFullscreen.value ? "退出全屏" : "全屏"}
|
||||
v-tippy={
|
||||
isFullscreen.value
|
||||
? transformI18n($t("tableBar.pureExitFullScreen"))
|
||||
: transformI18n($t("tableBar.pureFullScreen"))
|
||||
}
|
||||
onClick={() => onFullscreen()}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -10,8 +10,10 @@ export interface RippleOptions {
|
||||
circle?: boolean;
|
||||
}
|
||||
|
||||
export interface RippleDirectiveBinding
|
||||
extends Omit<DirectiveBinding, "modifiers" | "value"> {
|
||||
export interface RippleDirectiveBinding extends Omit<
|
||||
DirectiveBinding,
|
||||
"modifiers" | "value"
|
||||
> {
|
||||
value?: boolean | { class: string };
|
||||
modifiers: {
|
||||
center?: boolean;
|
||||
|
||||
@@ -53,9 +53,11 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
|
||||
<LaySearch id="header-search" />
|
||||
<!-- 国际化 -->
|
||||
<el-dropdown id="header-translation" trigger="click">
|
||||
<GlobalizationIcon
|
||||
class="navbar-bg-hover w-[40px] h-[48px] p-[11px] cursor-pointer outline-hidden"
|
||||
/>
|
||||
<div
|
||||
class="globalization-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
>
|
||||
<IconifyIconOffline :icon="GlobalizationIcon" />
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu class="translation">
|
||||
<el-dropdown-item
|
||||
@@ -113,7 +115,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<span
|
||||
class="set-icon navbar-bg-hover"
|
||||
class="set-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
:title="t('buttons.pureOpenSystemSet')"
|
||||
@click="onPanel"
|
||||
>
|
||||
|
||||
@@ -3,15 +3,12 @@ import { useI18n } from "vue-i18n";
|
||||
import { ref, computed } from "vue";
|
||||
import { noticesData } from "./data";
|
||||
import NoticeList from "./components/NoticeList.vue";
|
||||
import BellIcon from "~icons/ep/bell";
|
||||
import BellIcon from "~icons/lucide/bell";
|
||||
|
||||
const { t } = useI18n();
|
||||
const noticesNum = ref(0);
|
||||
const notices = ref(noticesData);
|
||||
const activeKey = ref(noticesData[0]?.key);
|
||||
|
||||
notices.value.map(v => (noticesNum.value += v.list.length));
|
||||
|
||||
const getLabel = computed(
|
||||
() => item =>
|
||||
t(item.name) + (item.list.length > 0 ? `(${item.list.length})` : "")
|
||||
@@ -21,14 +18,9 @@ const getLabel = computed(
|
||||
<template>
|
||||
<el-dropdown trigger="click" placement="bottom-end">
|
||||
<span
|
||||
:class="[
|
||||
'dropdown-badge',
|
||||
'navbar-bg-hover',
|
||||
'select-none',
|
||||
Number(noticesNum) !== 0 && 'mr-[10px]'
|
||||
]"
|
||||
:class="['dropdown-badge', 'navbar-bg-hover', 'select-none', 'mr-[7px]']"
|
||||
>
|
||||
<el-badge :value="Number(noticesNum) === 0 ? '' : noticesNum" :max="99">
|
||||
<el-badge is-dot>
|
||||
<span class="header-notice-icon">
|
||||
<IconifyIconOffline :icon="BellIcon" />
|
||||
</span>
|
||||
@@ -65,6 +57,34 @@ const getLabel = computed(
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* ”铃铛“摇晃衰减动画 */
|
||||
@keyframes pure-bell-ring {
|
||||
0%,
|
||||
100% {
|
||||
transform-origin: top;
|
||||
}
|
||||
|
||||
15% {
|
||||
transform: rotateZ(10deg);
|
||||
}
|
||||
|
||||
30% {
|
||||
transform: rotateZ(-10deg);
|
||||
}
|
||||
|
||||
45% {
|
||||
transform: rotateZ(5deg);
|
||||
}
|
||||
|
||||
60% {
|
||||
transform: rotateZ(-5deg);
|
||||
}
|
||||
|
||||
75% {
|
||||
transform: rotateZ(2deg);
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -74,7 +94,13 @@ const getLabel = computed(
|
||||
cursor: pointer;
|
||||
|
||||
.header-notice-icon {
|
||||
font-size: 18px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.header-notice-icon svg {
|
||||
animation: pure-bell-ring 1s both;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ onBeforeUnmount(() => {
|
||||
<div class="right-panel-background" />
|
||||
<div ref="target" class="right-panel bg-bg_color">
|
||||
<div
|
||||
class="project-configuration border-0 border-b-[1px] border-solid border-[var(--pure-border-color)]"
|
||||
class="flex-bc py-3 px-5 border-0 border-l border-solid border-(--pure-border-color)"
|
||||
>
|
||||
<h4 class="dark:text-white">
|
||||
{{ t("panel.pureSystemSet") }}
|
||||
@@ -73,12 +73,14 @@ onBeforeUnmount(() => {
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<el-scrollbar>
|
||||
<el-scrollbar
|
||||
class="border-y border-l border-r-0 border-solid border-(--pure-border-color) h-[calc(100vh-104px)]!"
|
||||
>
|
||||
<slot />
|
||||
</el-scrollbar>
|
||||
|
||||
<div
|
||||
class="flex justify-end p-3 border-0 border-t-[1px] border-solid border-[var(--pure-border-color)]"
|
||||
class="flex justify-end p-3 border-0 border-l border-solid border-(--pure-border-color)"
|
||||
>
|
||||
<el-button
|
||||
v-tippy="{
|
||||
@@ -99,10 +101,6 @@ onBeforeUnmount(() => {
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-scrollbar) {
|
||||
height: calc(100vh - 110px);
|
||||
}
|
||||
|
||||
.right-panel-background {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
@@ -139,11 +137,4 @@ onBeforeUnmount(() => {
|
||||
transform: translate(0);
|
||||
}
|
||||
}
|
||||
|
||||
.project-configuration {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 14px 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -11,7 +11,7 @@ function handleSearch() {
|
||||
<template>
|
||||
<div>
|
||||
<div
|
||||
class="search-container w-[40px] h-[48px] flex-c cursor-pointer navbar-bg-hover"
|
||||
class="search-container w-[40px] h-[48px] flex-c cursor-pointer navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
@click="handleSearch"
|
||||
>
|
||||
<IconifyIconOffline icon="ri/search-line" />
|
||||
|
||||
@@ -37,7 +37,7 @@ const horizontalRef = ref();
|
||||
|
||||
const {
|
||||
dataTheme,
|
||||
overallStyle,
|
||||
themeMode,
|
||||
layoutTheme,
|
||||
themeColors,
|
||||
toggleClass,
|
||||
@@ -50,7 +50,7 @@ if (unref(layoutTheme)) {
|
||||
const layout = unref(layoutTheme).layout;
|
||||
const theme = unref(layoutTheme).theme;
|
||||
document.documentElement.setAttribute("data-theme", theme);
|
||||
setLayoutModel(layout);
|
||||
setMenuLayout(layout);
|
||||
}
|
||||
|
||||
/** 默认灵动模式 */
|
||||
@@ -195,24 +195,24 @@ const pClass = computed(() => {
|
||||
const themeOptions = computed<Array<OptionsType>>(() => {
|
||||
return [
|
||||
{
|
||||
label: t("panel.pureOverallStyleLight"),
|
||||
label: t("panel.pureThemeModeLight"),
|
||||
icon: DayIcon,
|
||||
theme: "light",
|
||||
tip: t("panel.pureOverallStyleLightTip"),
|
||||
tip: t("panel.pureThemeModeLightTip"),
|
||||
iconAttrs: { fill: isDark.value ? "#fff" : "#000" }
|
||||
},
|
||||
{
|
||||
label: t("panel.pureOverallStyleDark"),
|
||||
label: t("panel.pureThemeModeDark"),
|
||||
icon: DarkIcon,
|
||||
theme: "dark",
|
||||
tip: t("panel.pureOverallStyleDarkTip"),
|
||||
tip: t("panel.pureThemeModeDarkTip"),
|
||||
iconAttrs: { fill: isDark.value ? "#fff" : "#000" }
|
||||
},
|
||||
{
|
||||
label: t("panel.pureOverallStyleSystem"),
|
||||
label: t("panel.pureThemeModeSystem"),
|
||||
icon: SystemIcon,
|
||||
theme: "system",
|
||||
tip: t("panel.pureOverallStyleSystemTip"),
|
||||
tip: t("panel.pureThemeModeSystemTip"),
|
||||
iconAttrs: { fill: isDark.value ? "#fff" : "#000" }
|
||||
}
|
||||
];
|
||||
@@ -238,8 +238,8 @@ const markOptions = computed<Array<OptionsType>>(() => {
|
||||
];
|
||||
});
|
||||
|
||||
/** 设置导航模式 */
|
||||
function setLayoutModel(layout: string) {
|
||||
/** 设置菜单布局 */
|
||||
function setMenuLayout(layout: string) {
|
||||
layoutTheme.value.layout = layout;
|
||||
window.document.body.setAttribute("layout", layout);
|
||||
$storage.layout = {
|
||||
@@ -249,7 +249,7 @@ function setLayoutModel(layout: string) {
|
||||
sidebarStatus: $storage.layout?.sidebarStatus,
|
||||
epThemeColor: $storage.layout?.epThemeColor,
|
||||
themeColor: $storage.layout?.themeColor,
|
||||
overallStyle: $storage.layout?.overallStyle
|
||||
themeMode: $storage.layout?.themeMode
|
||||
};
|
||||
useAppStoreHook().setLayout(layout);
|
||||
}
|
||||
@@ -276,15 +276,15 @@ watch($storage, ({ layout }) => {
|
||||
|
||||
const mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)");
|
||||
|
||||
/** 根据操作系统主题设置平台整体风格 */
|
||||
/** 根据操作系统主题设置平台主题模式 */
|
||||
function updateTheme() {
|
||||
if (overallStyle.value !== "system") return;
|
||||
if (themeMode.value !== "system") return;
|
||||
if (mediaQueryList.matches) {
|
||||
dataTheme.value = true;
|
||||
} else {
|
||||
dataTheme.value = false;
|
||||
}
|
||||
dataThemeChange(overallStyle.value);
|
||||
dataThemeChange(themeMode.value);
|
||||
}
|
||||
|
||||
function removeMatchMedia() {
|
||||
@@ -317,18 +317,18 @@ onUnmounted(() => removeMatchMedia);
|
||||
<template>
|
||||
<LayPanel>
|
||||
<div class="p-5">
|
||||
<p :class="pClass">{{ t("panel.pureOverallStyle") }}</p>
|
||||
<p :class="pClass">{{ t("panel.pureThemeMode") }}</p>
|
||||
<Segmented
|
||||
resize
|
||||
class="select-none"
|
||||
:modelValue="overallStyle === 'system' ? 2 : dataTheme ? 1 : 0"
|
||||
:modelValue="themeMode === 'system' ? 2 : dataTheme ? 1 : 0"
|
||||
:options="themeOptions"
|
||||
@change="
|
||||
theme => {
|
||||
theme.index === 1 && theme.index !== 2
|
||||
? (dataTheme = true)
|
||||
: (dataTheme = false);
|
||||
overallStyle = theme.option.theme;
|
||||
themeMode = theme.option.theme;
|
||||
dataThemeChange(theme.option.theme);
|
||||
theme.index === 2 && watchSystemThemeChange();
|
||||
}
|
||||
@@ -345,8 +345,8 @@ onUnmounted(() => removeMatchMedia);
|
||||
@click="setLayoutThemeColor(item.themeColor)"
|
||||
>
|
||||
<el-icon
|
||||
style="margin: 0.1em 0.1em 0 0"
|
||||
:size="17"
|
||||
class="mt-px"
|
||||
:size="20"
|
||||
:color="getThemeColor(item.themeColor)"
|
||||
>
|
||||
<IconifyIconOffline :icon="Check" />
|
||||
@@ -354,7 +354,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p :class="['mt-5!', pClass]">{{ t("panel.pureLayoutModel") }}</p>
|
||||
<p :class="['mt-5!', pClass]">{{ t("panel.pureMenuLayout") }}</p>
|
||||
<ul class="pure-theme">
|
||||
<li
|
||||
ref="verticalRef"
|
||||
@@ -363,7 +363,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
zIndex: 41000
|
||||
}"
|
||||
:class="layoutTheme.layout === 'vertical' ? 'is-select' : ''"
|
||||
@click="setLayoutModel('vertical')"
|
||||
@click="setMenuLayout('vertical')"
|
||||
>
|
||||
<div />
|
||||
<div />
|
||||
@@ -376,7 +376,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
zIndex: 41000
|
||||
}"
|
||||
:class="layoutTheme.layout === 'horizontal' ? 'is-select' : ''"
|
||||
@click="setLayoutModel('horizontal')"
|
||||
@click="setMenuLayout('horizontal')"
|
||||
>
|
||||
<div />
|
||||
<div />
|
||||
@@ -389,7 +389,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
zIndex: 41000
|
||||
}"
|
||||
:class="layoutTheme.layout === 'mix' ? 'is-select' : ''"
|
||||
@click="setLayoutModel('mix')"
|
||||
@click="setMenuLayout('mix')"
|
||||
>
|
||||
<div />
|
||||
<div />
|
||||
@@ -538,17 +538,24 @@ onUnmounted(() => removeMatchMedia);
|
||||
}
|
||||
|
||||
.theme-color {
|
||||
height: 20px;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
|
||||
li {
|
||||
float: left;
|
||||
height: 20px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
box-shadow: rgb(0 0 0 / 15%) 0 0 0 1px inset;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:nth-child(1) {
|
||||
border: 1px solid #ddd;
|
||||
&:hover {
|
||||
box-shadow:
|
||||
rgb(0 0 0 / 25%) 0 0 0 1px inset,
|
||||
0 2px 4px rgb(0 0 0 / 15%);
|
||||
transform: scale(1.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,9 +83,11 @@ onMounted(() => {
|
||||
<LaySearch id="header-search" />
|
||||
<!-- 国际化 -->
|
||||
<el-dropdown id="header-translation" trigger="click">
|
||||
<GlobalizationIcon
|
||||
class="navbar-bg-hover w-[40px] h-[48px] p-[11px] cursor-pointer outline-hidden"
|
||||
/>
|
||||
<div
|
||||
class="globalization-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
>
|
||||
<IconifyIconOffline :icon="GlobalizationIcon" />
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu class="translation">
|
||||
<el-dropdown-item
|
||||
@@ -141,7 +143,7 @@ onMounted(() => {
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<span
|
||||
class="set-icon navbar-bg-hover"
|
||||
class="set-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
:title="t('buttons.pureOpenSystemSet')"
|
||||
@click="onPanel"
|
||||
>
|
||||
|
||||
@@ -104,9 +104,11 @@ watch(
|
||||
<LaySearch id="header-search" />
|
||||
<!-- 国际化 -->
|
||||
<el-dropdown id="header-translation" trigger="click">
|
||||
<GlobalizationIcon
|
||||
class="navbar-bg-hover w-[40px] h-[48px] p-[11px] cursor-pointer outline-hidden"
|
||||
/>
|
||||
<div
|
||||
class="globalization-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
>
|
||||
<IconifyIconOffline :icon="GlobalizationIcon" />
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu class="translation">
|
||||
<el-dropdown-item
|
||||
@@ -162,7 +164,7 @@ watch(
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<span
|
||||
class="set-icon navbar-bg-hover"
|
||||
class="set-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
:title="t('buttons.pureOpenSystemSet')"
|
||||
@click="onPanel"
|
||||
>
|
||||
|
||||
@@ -24,7 +24,10 @@ watch(
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span class="fullscreen-icon navbar-bg-hover" @click="toggle">
|
||||
<span
|
||||
class="fullscreen-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
@click="toggle"
|
||||
>
|
||||
<IconifyIconOffline :icon="screenIcon" />
|
||||
</span>
|
||||
</template>
|
||||
|
||||
@@ -321,10 +321,9 @@
|
||||
|
||||
.chrome-tab-divider {
|
||||
position: absolute;
|
||||
right: 7px;
|
||||
left: 7px;
|
||||
width: 1px;
|
||||
height: 14px;
|
||||
background-color: #2b2d2f;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
||||
@@ -618,6 +618,10 @@ onBeforeUnmount(() => {
|
||||
/>
|
||||
</template>
|
||||
<div v-else class="chrome-tab">
|
||||
<span
|
||||
v-if="index !== 0 && index !== activeIndex"
|
||||
class="chrome-tab-divider bg-[#e2e2e2] dark:bg-[#2d2d2d]"
|
||||
/>
|
||||
<div class="chrome-tab__bg">
|
||||
<TagChrome />
|
||||
</div>
|
||||
@@ -631,7 +635,6 @@ onBeforeUnmount(() => {
|
||||
>
|
||||
<IconifyIconOffline :icon="Close" />
|
||||
</span>
|
||||
<span class="chrome-tab-divider" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@ export function useDataThemeChange() {
|
||||
|
||||
const { $storage } = useGlobal<GlobalPropertiesApi>();
|
||||
const dataTheme = ref<boolean>($storage?.layout?.darkMode);
|
||||
const overallStyle = ref<string>($storage?.layout?.overallStyle);
|
||||
const themeMode = ref<string>($storage?.layout?.themeMode);
|
||||
const body = document.documentElement as HTMLElement;
|
||||
|
||||
function toggleClass(flag: boolean, clsName: string, target?: HTMLElement) {
|
||||
@@ -59,7 +59,7 @@ export function useDataThemeChange() {
|
||||
sidebarStatus: $storage.layout?.sidebarStatus,
|
||||
epThemeColor: $storage.layout?.epThemeColor,
|
||||
themeColor: isClick ? theme : storageThemeColor,
|
||||
overallStyle: overallStyle.value
|
||||
themeMode: themeMode.value
|
||||
};
|
||||
|
||||
if (theme === "default" || theme === "light") {
|
||||
@@ -89,9 +89,9 @@ export function useDataThemeChange() {
|
||||
}
|
||||
};
|
||||
|
||||
/** 浅色、深色整体风格切换 */
|
||||
function dataThemeChange(overall?: string) {
|
||||
overallStyle.value = overall;
|
||||
/** 浅色、深色主题模式切换 */
|
||||
function dataThemeChange(mode?: string) {
|
||||
themeMode.value = mode;
|
||||
if (useEpThemeStoreHook().epTheme === "light" && dataTheme.value) {
|
||||
setLayoutThemeColor("default", false);
|
||||
} else {
|
||||
@@ -126,7 +126,7 @@ export function useDataThemeChange() {
|
||||
return {
|
||||
body,
|
||||
dataTheme,
|
||||
overallStyle,
|
||||
themeMode,
|
||||
layoutTheme,
|
||||
themeColors,
|
||||
onReset,
|
||||
|
||||
@@ -29,7 +29,7 @@ export function useLayout() {
|
||||
sidebarStatus: $config?.SidebarStatus ?? true,
|
||||
epThemeColor: $config?.EpThemeColor ?? "#409EFF",
|
||||
themeColor: $config?.Theme ?? "light",
|
||||
overallStyle: $config?.OverallStyle ?? "light"
|
||||
themeMode: $config?.ThemeMode ?? "light"
|
||||
};
|
||||
}
|
||||
/** 灰色模式、色弱模式、隐藏标签页 */
|
||||
|
||||
@@ -67,16 +67,16 @@ const set: setType = reactive({
|
||||
})
|
||||
});
|
||||
|
||||
function setTheme(layoutModel: string) {
|
||||
window.document.body.setAttribute("layout", layoutModel);
|
||||
function setTheme(menuLayout: string) {
|
||||
window.document.body.setAttribute("layout", menuLayout);
|
||||
$storage.layout = {
|
||||
layout: `${layoutModel}`,
|
||||
layout: `${menuLayout}`,
|
||||
theme: $storage.layout?.theme,
|
||||
darkMode: $storage.layout?.darkMode,
|
||||
sidebarStatus: $storage.layout?.sidebarStatus,
|
||||
epThemeColor: $storage.layout?.epThemeColor,
|
||||
themeColor: $storage.layout?.themeColor,
|
||||
overallStyle: $storage.layout?.overallStyle
|
||||
themeMode: $storage.layout?.themeMode
|
||||
};
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
onBeforeMount(() => {
|
||||
useDataThemeChange().dataThemeChange($storage.layout?.overallStyle);
|
||||
useDataThemeChange().dataThemeChange($storage.layout?.themeMode);
|
||||
});
|
||||
|
||||
const LayHeader = defineComponent({
|
||||
|
||||
@@ -3,15 +3,13 @@ import type { App, Component } from "vue";
|
||||
import {
|
||||
/**
|
||||
* 为了方便演示平台将 element-plus 导出的所有组件引入,实际使用中如果你没用到哪个组件,将其注释掉就行
|
||||
* 导出来源:https://github.com/element-plus/element-plus/blob/dev/packages/element-plus/component.ts#L111-L211
|
||||
* 导出来源:https://github.com/element-plus/element-plus/blob/dev/packages/element-plus/component.ts#L116-L226
|
||||
* */
|
||||
ElAffix,
|
||||
ElAlert,
|
||||
ElAutocomplete,
|
||||
ElAutoResizer,
|
||||
ElAvatar,
|
||||
ElAnchor,
|
||||
ElAnchorLink,
|
||||
ElBacktop,
|
||||
ElBadge,
|
||||
ElBreadcrumb,
|
||||
@@ -32,6 +30,7 @@ import {
|
||||
ElCollapse,
|
||||
ElCollapseItem,
|
||||
ElCollapseTransition,
|
||||
ElColorPickerPanel,
|
||||
ElColorPicker,
|
||||
ElConfigProvider,
|
||||
ElContainer,
|
||||
@@ -40,6 +39,7 @@ import {
|
||||
ElHeader,
|
||||
ElMain,
|
||||
ElDatePicker,
|
||||
ElDatePickerPanel,
|
||||
ElDescriptions,
|
||||
ElDescriptionsItem,
|
||||
ElDialog,
|
||||
@@ -56,6 +56,7 @@ import {
|
||||
ElImageViewer,
|
||||
ElInput,
|
||||
ElInputNumber,
|
||||
ElInputTag,
|
||||
ElLink,
|
||||
ElMenu,
|
||||
ElMenuItem,
|
||||
@@ -107,17 +108,22 @@ import {
|
||||
ElWatermark,
|
||||
ElTour,
|
||||
ElTourStep,
|
||||
ElAnchor,
|
||||
ElAnchorLink,
|
||||
ElSegmented,
|
||||
ElMention,
|
||||
ElSplitter,
|
||||
ElSplitterPanel,
|
||||
/**
|
||||
* 为了方便演示平台将 element-plus 导出的所有插件引入,实际使用中如果你没用到哪个插件,将其注释掉就行
|
||||
* 导出来源:https://github.com/element-plus/element-plus/blob/dev/packages/element-plus/plugin.ts#L11-L16
|
||||
* */
|
||||
ElLoading, // v-loading 指令
|
||||
ElInfiniteScroll, // v-infinite-scroll 指令
|
||||
ElPopoverDirective, // v-popover 指令
|
||||
ElLoading, // v-loading 指令
|
||||
ElMessage, // $message 全局属性对象globalProperties
|
||||
ElMessageBox, // $msgbox、$alert、$confirm、$prompt 全局属性对象globalProperties
|
||||
ElNotification // $notify 全局属性对象globalProperties
|
||||
ElNotification, // $notify 全局属性对象globalProperties
|
||||
ElPopoverDirective // v-popover 指令
|
||||
} from "element-plus";
|
||||
|
||||
const components = [
|
||||
@@ -126,8 +132,6 @@ const components = [
|
||||
ElAutocomplete,
|
||||
ElAutoResizer,
|
||||
ElAvatar,
|
||||
ElAnchor,
|
||||
ElAnchorLink,
|
||||
ElBacktop,
|
||||
ElBadge,
|
||||
ElBreadcrumb,
|
||||
@@ -148,6 +152,7 @@ const components = [
|
||||
ElCollapse,
|
||||
ElCollapseItem,
|
||||
ElCollapseTransition,
|
||||
ElColorPickerPanel,
|
||||
ElColorPicker,
|
||||
ElConfigProvider,
|
||||
ElContainer,
|
||||
@@ -156,6 +161,7 @@ const components = [
|
||||
ElHeader,
|
||||
ElMain,
|
||||
ElDatePicker,
|
||||
ElDatePickerPanel,
|
||||
ElDescriptions,
|
||||
ElDescriptionsItem,
|
||||
ElDialog,
|
||||
@@ -172,6 +178,7 @@ const components = [
|
||||
ElImageViewer,
|
||||
ElInput,
|
||||
ElInputNumber,
|
||||
ElInputTag,
|
||||
ElLink,
|
||||
ElMenu,
|
||||
ElMenuItem,
|
||||
@@ -223,16 +230,21 @@ const components = [
|
||||
ElWatermark,
|
||||
ElTour,
|
||||
ElTourStep,
|
||||
ElSegmented
|
||||
ElAnchor,
|
||||
ElAnchorLink,
|
||||
ElSegmented,
|
||||
ElMention,
|
||||
ElSplitter,
|
||||
ElSplitterPanel
|
||||
];
|
||||
|
||||
const plugins = [
|
||||
ElLoading,
|
||||
ElInfiniteScroll,
|
||||
ElPopoverDirective,
|
||||
ElLoading,
|
||||
ElMessage,
|
||||
ElMessageBox,
|
||||
ElNotification
|
||||
ElNotification,
|
||||
ElPopoverDirective
|
||||
];
|
||||
|
||||
/** 按需引入`element-plus` */
|
||||
|
||||
@@ -119,8 +119,7 @@ export default {
|
||||
name: "PureSlider",
|
||||
component: () => import("@/views/components/slider/index.vue"),
|
||||
meta: {
|
||||
title: $t("menus.pureSlider"),
|
||||
extraIcon: "IF-pure-iconfont-new svg"
|
||||
title: $t("menus.pureSlider")
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -195,6 +194,15 @@ export default {
|
||||
title: $t("menus.pureColorPicker")
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/components/color-picker-panel",
|
||||
name: "ColorPickerPanel",
|
||||
component: () => import("@/views/components/color-picker-panel.vue"),
|
||||
meta: {
|
||||
title: $t("menus.pureColorPickerPanel"),
|
||||
extraIcon: "IF-pure-iconfont-new svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/components/selector",
|
||||
name: "Selector",
|
||||
|
||||
@@ -209,18 +209,26 @@ function initRouter() {
|
||||
});
|
||||
} else {
|
||||
return new Promise(resolve => {
|
||||
getAsyncRoutes().then(({ data }) => {
|
||||
handleAsyncRoutes(cloneDeep(data));
|
||||
storageLocal().setItem(key, data);
|
||||
resolve(router);
|
||||
getAsyncRoutes().then(({ code, data }) => {
|
||||
if (code === 0) {
|
||||
handleAsyncRoutes(cloneDeep(data));
|
||||
storageLocal().setItem(key, data);
|
||||
resolve(router);
|
||||
} else {
|
||||
resolve(router);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return new Promise(resolve => {
|
||||
getAsyncRoutes().then(({ data }) => {
|
||||
handleAsyncRoutes(cloneDeep(data));
|
||||
resolve(router);
|
||||
getAsyncRoutes().then(({ code, data }) => {
|
||||
if (code === 0) {
|
||||
handleAsyncRoutes(cloneDeep(data));
|
||||
resolve(router);
|
||||
} else {
|
||||
resolve(router);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export const useAppStore = defineStore("pure-app", {
|
||||
withoutAnimation: false,
|
||||
isClickCollapse: false
|
||||
},
|
||||
// 这里的layout用于监听容器拖拉后恢复对应的导航模式
|
||||
// 这里的layout用于监听容器拖拉后恢复对应的菜单布局
|
||||
layout:
|
||||
storageLocal().getItem<StorageConfigs>(
|
||||
`${responsiveStorageNameSpace()}layout`
|
||||
|
||||
@@ -21,7 +21,7 @@ export const useEpThemeStore = defineStore("pure-epTheme", {
|
||||
getEpThemeColor(state) {
|
||||
return state.epThemeColor;
|
||||
},
|
||||
/** 用于mix导航模式下hamburger-svg的fill属性 */
|
||||
/** 用于mix菜单布局下hamburger-svg的fill属性 */
|
||||
fill(state) {
|
||||
if (state.epTheme === "light") {
|
||||
return "#409eff";
|
||||
|
||||
@@ -80,8 +80,12 @@ export const useUserStore = defineStore("pure-user", {
|
||||
return new Promise<UserResult>((resolve, reject) => {
|
||||
getLogin(data)
|
||||
.then(data => {
|
||||
if (data?.success) setToken(data.data);
|
||||
resolve(data);
|
||||
if (data.code === 0) {
|
||||
setToken(data.data);
|
||||
resolve(data);
|
||||
} else {
|
||||
reject(data.message);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error);
|
||||
@@ -103,9 +107,11 @@ export const useUserStore = defineStore("pure-user", {
|
||||
return new Promise<RefreshTokenResult>((resolve, reject) => {
|
||||
refreshTokenApi(data)
|
||||
.then(data => {
|
||||
if (data) {
|
||||
if (data.code === 0) {
|
||||
setToken(data.data);
|
||||
resolve(data);
|
||||
} else {
|
||||
reject(data.message);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
@@ -135,17 +135,6 @@ html.dark {
|
||||
}
|
||||
}
|
||||
|
||||
/* 系统配置面板 */
|
||||
.right-panel-items {
|
||||
.el-divider__text {
|
||||
--el-bg-color: var(--el-bg-color);
|
||||
}
|
||||
|
||||
.el-divider--horizontal {
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表单设计器 */
|
||||
.design-form {
|
||||
.el-main.config-content,
|
||||
|
||||
@@ -35,3 +35,18 @@
|
||||
.html-weakness {
|
||||
filter: invert(80%);
|
||||
}
|
||||
|
||||
/* 轻微缩小,再恢复原状的平滑缩放动画 */
|
||||
@keyframes pure-scale-bounce {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: scale(0.9);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,12 +34,14 @@
|
||||
}
|
||||
|
||||
.set-icon,
|
||||
.fullscreen-icon {
|
||||
.fullscreen-icon,
|
||||
.globalization-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 48px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -172,10 +174,6 @@
|
||||
.is-active > .el-sub-menu__title,
|
||||
.is-active.submenu-title-noDropdown {
|
||||
color: var(--pure-theme-sub-menu-active-text) !important;
|
||||
|
||||
i {
|
||||
color: var(--pure-theme-sub-menu-active-text) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.is-active {
|
||||
@@ -270,10 +268,6 @@
|
||||
.is-active > .el-sub-menu__title,
|
||||
.is-active.submenu-title-noDropdown {
|
||||
color: var(--pure-theme-sub-menu-active-text) !important;
|
||||
|
||||
i {
|
||||
color: var(--pure-theme-sub-menu-active-text) !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 子菜单中还有子菜单 */
|
||||
@@ -374,10 +368,6 @@
|
||||
.is-active > .el-sub-menu__title,
|
||||
.is-active.submenu-title-noDropdown {
|
||||
color: var(--pure-theme-sub-menu-active-text) !important;
|
||||
|
||||
i {
|
||||
color: var(--pure-theme-sub-menu-active-text) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.nest-menu .el-sub-menu > .el-sub-menu__title,
|
||||
@@ -461,7 +451,7 @@
|
||||
/* 搜索 */
|
||||
.search-container,
|
||||
/* 国际化 */
|
||||
.globalization,
|
||||
.globalization-icon,
|
||||
/* 全屏 */
|
||||
.fullscreen-icon,
|
||||
/* 消息通知 */
|
||||
@@ -480,15 +470,6 @@
|
||||
color: var(--pure-theme-sub-menu-active-text);
|
||||
}
|
||||
|
||||
.globalization {
|
||||
width: 40px;
|
||||
height: 48px;
|
||||
padding: 11px;
|
||||
color: var(--pure-theme-sub-menu-active-text);
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.el-dropdown-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -541,10 +522,6 @@
|
||||
.is-active > .el-sub-menu__title,
|
||||
.is-active.submenu-title-noDropdown {
|
||||
color: var(--pure-theme-sub-menu-active-text) !important;
|
||||
|
||||
i {
|
||||
color: var(--pure-theme-sub-menu-active-text) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.is-active {
|
||||
@@ -646,7 +623,7 @@ body[layout="vertical"] {
|
||||
/* 搜索 */
|
||||
.search-container,
|
||||
/* 国际化 */
|
||||
.globalization,
|
||||
.globalization-icon,
|
||||
/* 全屏 */
|
||||
.fullscreen-icon,
|
||||
/* 消息通知 */
|
||||
|
||||
@@ -44,3 +44,7 @@
|
||||
@utility navbar-bg-hover {
|
||||
@apply dark:text-white dark:hover:bg-[#242424]!;
|
||||
}
|
||||
|
||||
@utility animate-scale-bounce {
|
||||
animation: pure-scale-bounce 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import type {
|
||||
PureHttpRequestConfig
|
||||
} from "./types.d";
|
||||
import { stringify } from "qs";
|
||||
import { message } from "@/utils/message";
|
||||
import { $t, transformI18n } from "@/plugins/i18n";
|
||||
import { getToken, formatToken } from "@/utils/auth";
|
||||
import { useUserStoreHook } from "@/store/modules/user";
|
||||
|
||||
@@ -90,6 +92,13 @@ class PureHttp {
|
||||
PureHttp.requests.forEach(cb => cb(token));
|
||||
PureHttp.requests = [];
|
||||
})
|
||||
.catch(_err => {
|
||||
PureHttp.requests = [];
|
||||
useUserStoreHook().logOut();
|
||||
message(transformI18n($t("login.pureLoginExpired")), {
|
||||
type: "warning"
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
PureHttp.isRefreshing = false;
|
||||
});
|
||||
|
||||
6
src/utils/localforage/types.d.ts
vendored
6
src/utils/localforage/types.d.ts
vendored
@@ -65,8 +65,7 @@ interface LocalForageDbMethodsOptional {
|
||||
}
|
||||
|
||||
interface LocalForageDriverDbMethods
|
||||
extends LocalForageDbMethodsCore,
|
||||
LocalForageDriverMethodsOptional {}
|
||||
extends LocalForageDbMethodsCore, LocalForageDriverMethodsOptional {}
|
||||
|
||||
interface LocalForageDriverSupportFunc {
|
||||
(): Promise<boolean>;
|
||||
@@ -94,8 +93,7 @@ interface LocalForageSerializer {
|
||||
}
|
||||
|
||||
interface LocalForageDbMethods
|
||||
extends LocalForageDbMethodsCore,
|
||||
LocalForageDbMethodsOptional {}
|
||||
extends LocalForageDbMethodsCore, LocalForageDbMethodsOptional {}
|
||||
|
||||
export interface LocalForage extends LocalForageDbMethods {
|
||||
LOCALSTORAGE: string;
|
||||
|
||||
@@ -4,6 +4,13 @@ import { type MessageHandler, ElMessage } from "element-plus";
|
||||
|
||||
type messageStyle = "el" | "antd";
|
||||
type messageTypes = "info" | "success" | "warning" | "error";
|
||||
type messagePlacement =
|
||||
| "top"
|
||||
| "top-left"
|
||||
| "top-right"
|
||||
| "bottom"
|
||||
| "bottom-left"
|
||||
| "bottom-right";
|
||||
|
||||
interface MessageParams {
|
||||
/** 消息类型,可选 `info` 、`success` 、`warning` 、`error` ,默认 `info` */
|
||||
@@ -20,8 +27,10 @@ interface MessageParams {
|
||||
duration?: number;
|
||||
/** 是否显示关闭按钮,默认值 `false` */
|
||||
showClose?: boolean;
|
||||
/** `Message` 距离窗口顶部的偏移量,默认 `16` */
|
||||
/** `Message` 消息距离窗口边缘的偏移量,默认 `16` */
|
||||
offset?: number;
|
||||
/** `Message` 消息放置位置,默认 `top` */
|
||||
placement?: messagePlacement;
|
||||
/** 设置组件的根元素,默认 `document.body` */
|
||||
appendTo?: string | HTMLElement;
|
||||
/** 合并内容相同的消息,不支持 `VNode` 类型的消息,默认值 `false` */
|
||||
@@ -56,6 +65,7 @@ const message = (
|
||||
duration = 2000,
|
||||
showClose = false,
|
||||
offset = 16,
|
||||
placement = "top",
|
||||
appendTo = document.body,
|
||||
grouping = false,
|
||||
repeatNum = 1,
|
||||
@@ -71,6 +81,7 @@ const message = (
|
||||
duration,
|
||||
showClose,
|
||||
offset,
|
||||
placement,
|
||||
appendTo,
|
||||
grouping,
|
||||
repeatNum,
|
||||
|
||||
@@ -19,8 +19,8 @@ export const injectResponsiveStorage = (app: App, config: PlatformConfigs) => {
|
||||
darkMode: config.DarkMode ?? false,
|
||||
sidebarStatus: config.SidebarStatus ?? true,
|
||||
epThemeColor: config.EpThemeColor ?? "#409EFF",
|
||||
themeColor: config.Theme ?? "light", // 主题色(对应系统配置中的主题色,与theme不同的是它不会受到浅色、深色整体风格切换的影响,只会在手动点击主题色时改变)
|
||||
overallStyle: config.OverallStyle ?? "light" // 整体风格(浅色:light、深色:dark、自动:system)
|
||||
themeColor: config.Theme ?? "light", // 主题色(对应系统配置中的主题色,与theme不同的是它不会受到浅色、深色主题模式切换的影响,只会在手动点击主题色时改变)
|
||||
themeMode: config.ThemeMode ?? "light" // 主题模式(浅色:light、深色:dark、自动:system)
|
||||
},
|
||||
// 系统配置-界面显示
|
||||
configure: Storage.getData("configure", nameSpace) ?? {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref } from "vue";
|
||||
import { formUpload } from "@/api/mock";
|
||||
import { message } from "@/utils/message";
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import { type UserInfo, getMine } from "@/api/user";
|
||||
import type { FormInstance, FormRules } from "element-plus";
|
||||
import ReCropperPreview from "@/components/ReCropperPreview";
|
||||
@@ -73,8 +73,8 @@ const handleSubmitImage = () => {
|
||||
files: new File([cropperBlob.value], "avatar")
|
||||
});
|
||||
formUpload(formData)
|
||||
.then(({ success, data }) => {
|
||||
if (success) {
|
||||
.then(({ code }) => {
|
||||
if (code === 0) {
|
||||
message("更新头像成功", { type: "success" });
|
||||
handleClose();
|
||||
} else {
|
||||
@@ -98,8 +98,11 @@ const onSubmit = async (formEl: FormInstance) => {
|
||||
});
|
||||
};
|
||||
|
||||
getMine().then(res => {
|
||||
Object.assign(userInfos, res.data);
|
||||
onMounted(async () => {
|
||||
const { code, data } = await getMine();
|
||||
if (code === 0) {
|
||||
Object.assign(userInfos, data);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -55,11 +55,13 @@ const columns: TableColumnList = [
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getMineLogs();
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getMineLogs();
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { getMine } from "@/api/user";
|
||||
import { useRouter } from "vue-router";
|
||||
import { ref, onBeforeMount } from "vue";
|
||||
import { ReText } from "@/components/ReText";
|
||||
import Profile from "./components/Profile.vue";
|
||||
import { ref, onMounted, onBeforeMount } from "vue";
|
||||
import Preferences from "./components/Preferences.vue";
|
||||
import SecurityLog from "./components/SecurityLog.vue";
|
||||
import { useGlobal, deviceDetection } from "@pureadmin/utils";
|
||||
@@ -25,7 +25,7 @@ const router = useRouter();
|
||||
const isOpen = ref(deviceDetection() ? false : true);
|
||||
const { $storage } = useGlobal<GlobalPropertiesApi>();
|
||||
onBeforeMount(() => {
|
||||
useDataThemeChange().dataThemeChange($storage.layout?.overallStyle);
|
||||
useDataThemeChange().dataThemeChange($storage.layout?.themeMode);
|
||||
});
|
||||
|
||||
const userInfo = ref({
|
||||
@@ -61,8 +61,11 @@ const panes = [
|
||||
];
|
||||
const witchPane = ref("profile");
|
||||
|
||||
getMine().then(res => {
|
||||
userInfo.value = res.data;
|
||||
onMounted(async () => {
|
||||
const { code, data } = await getMine();
|
||||
if (code === 0) {
|
||||
userInfo.value = data;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
68
src/views/components/color-picker-panel.vue
Normal file
68
src/views/components/color-picker-panel.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
|
||||
defineOptions({
|
||||
name: "ColorPickerPanel"
|
||||
});
|
||||
|
||||
const disabled = ref(false);
|
||||
const color = ref("rgba(255, 69, 0, 0.68)");
|
||||
const predefineColors = [
|
||||
"#ff4500",
|
||||
"#ff8c00",
|
||||
"#ffd700",
|
||||
"#90ee90",
|
||||
"#00ced1",
|
||||
"#1e90ff",
|
||||
"#c71585",
|
||||
"rgba(255, 69, 0, 0.68)",
|
||||
"rgb(255, 120, 0)",
|
||||
"hsv(51, 100, 98)",
|
||||
"hsva(120, 40, 94, 0.5)",
|
||||
"hsl(181, 100%, 37%)",
|
||||
"hsla(209, 100%, 56%, 0.73)",
|
||||
"#c7158577"
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<el-space wrap :size="40">
|
||||
<el-link
|
||||
v-tippy="{
|
||||
content: '点击查看详细文档'
|
||||
}"
|
||||
href="https://element-plus.org/zh-CN/component/color-picker-panel.html"
|
||||
target="_blank"
|
||||
style="font-size: 16px; font-weight: 800"
|
||||
>
|
||||
颜色选择器面板
|
||||
</el-link>
|
||||
<el-radio-group v-model="disabled">
|
||||
<el-radio :value="false">启用</el-radio>
|
||||
<el-radio :value="true">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-space>
|
||||
</div>
|
||||
<el-link
|
||||
class="mt-2"
|
||||
href="https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/components/color-picker-panel.vue"
|
||||
target="_blank"
|
||||
>
|
||||
代码位置 src/views/components/color-picker-panel.vue
|
||||
</el-link>
|
||||
</template>
|
||||
|
||||
<div class="mb-2">选择透明度、预定义颜色、无边框</div>
|
||||
<el-color-picker-panel
|
||||
v-model="color"
|
||||
show-alpha
|
||||
:border="false"
|
||||
:disabled="disabled"
|
||||
:predefine="predefineColors"
|
||||
/>
|
||||
<el-divider />
|
||||
</el-card>
|
||||
</template>
|
||||
@@ -463,6 +463,16 @@ function onSureBtnLoading() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 自定义动画
|
||||
function onTransitionClick(title, transition) {
|
||||
addDialog({
|
||||
width: "30%",
|
||||
title,
|
||||
transition,
|
||||
contentRenderer: () => <p>{JSON.stringify(transition)}</p>
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -551,5 +561,112 @@ function onSureBtnLoading() {
|
||||
点击底部确定按钮可开启按钮动画
|
||||
</el-button>
|
||||
</el-space>
|
||||
<el-divider />
|
||||
<el-space wrap>
|
||||
<el-button
|
||||
@click="onTransitionClick('淡入淡出动画(默认)', 'dialog-fade')"
|
||||
>
|
||||
淡入淡出动画(默认)
|
||||
</el-button>
|
||||
<el-button @click="onTransitionClick('缩放动画', 'dialog-scale')">
|
||||
缩放动画
|
||||
</el-button>
|
||||
<el-button @click="onTransitionClick('滑动动画', 'dialog-slide')">
|
||||
滑动动画
|
||||
</el-button>
|
||||
<el-button @click="onTransitionClick('弹跳动画', 'dialog-bounce')">
|
||||
弹跳动画
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="
|
||||
onTransitionClick('自定义动画事件处理器(可配置对象)', {
|
||||
name: 'dialog-custom-object',
|
||||
appear: true,
|
||||
mode: 'out-in',
|
||||
duration: 500
|
||||
})
|
||||
"
|
||||
>
|
||||
自定义动画事件处理器(可配置对象)
|
||||
</el-button>
|
||||
</el-space>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
/* Scale Animation */
|
||||
.dialog-scale-enter-active,
|
||||
.dialog-scale-leave-active,
|
||||
.dialog-scale-enter-active .el-dialog,
|
||||
.dialog-scale-leave-active .el-dialog {
|
||||
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
||||
}
|
||||
|
||||
.dialog-scale-enter-from,
|
||||
.dialog-scale-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.dialog-scale-enter-from .el-dialog,
|
||||
.dialog-scale-leave-to .el-dialog {
|
||||
opacity: 0;
|
||||
transform: scale(0.5);
|
||||
}
|
||||
|
||||
/* Slide Animation */
|
||||
.dialog-slide-enter-active,
|
||||
.dialog-slide-leave-active,
|
||||
.dialog-slide-enter-active .el-dialog,
|
||||
.dialog-slide-leave-active .el-dialog {
|
||||
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
||||
}
|
||||
|
||||
.dialog-slide-enter-from,
|
||||
.dialog-slide-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.dialog-slide-enter-from .el-dialog,
|
||||
.dialog-slide-leave-to .el-dialog {
|
||||
opacity: 0;
|
||||
transform: translateY(-100px);
|
||||
}
|
||||
|
||||
/* Bounce Animation */
|
||||
.dialog-bounce-enter-active,
|
||||
.dialog-bounce-leave-active,
|
||||
.dialog-bounce-enter-active .el-dialog,
|
||||
.dialog-bounce-leave-active .el-dialog {
|
||||
transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||
}
|
||||
|
||||
.dialog-bounce-enter-from,
|
||||
.dialog-bounce-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.dialog-bounce-enter-from .el-dialog,
|
||||
.dialog-bounce-leave-to .el-dialog {
|
||||
opacity: 0;
|
||||
transform: scale(0.3) translateY(-50px);
|
||||
}
|
||||
|
||||
/* Object Configuration Animation */
|
||||
.dialog-custom-object-enter-active,
|
||||
.dialog-custom-object-leave-active,
|
||||
.dialog-custom-object-enter-active .el-dialog,
|
||||
.dialog-custom-object-leave-active .el-dialog {
|
||||
transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
|
||||
}
|
||||
|
||||
.dialog-custom-object-enter-from,
|
||||
.dialog-custom-object-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.dialog-custom-object-enter-from .el-dialog,
|
||||
.dialog-custom-object-leave-to .el-dialog {
|
||||
opacity: 0;
|
||||
transform: rotate(180deg) scale(0.5);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -422,6 +422,17 @@ function onSureBtnLoading() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function onResizableClick(title, content, direction) {
|
||||
addDrawer({
|
||||
title,
|
||||
direction,
|
||||
resizable: true, // 启用可调整大小的功能
|
||||
contentRenderer: () => (
|
||||
<p class="text-[var(--el-color-primary)]">{content}</p> // jsx 语法 (注意在.vue文件启用jsx语法,需要在script开启lang="tsx")
|
||||
)
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -498,5 +509,28 @@ function onSureBtnLoading() {
|
||||
点击底部确定按钮可开启按钮动画
|
||||
</el-button>
|
||||
</el-space>
|
||||
<el-divider />
|
||||
<el-space wrap>
|
||||
<el-button
|
||||
@click="onResizableClick('从左侧打开', '拖动抽屉右侧边缘', 'ltr')"
|
||||
>
|
||||
拖拽调整大小(从左侧打开)
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="onResizableClick('从右侧打开', '拖动抽屉左侧边缘', 'rtl')"
|
||||
>
|
||||
拖拽调整大小(从右侧打开)
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="onResizableClick('从顶部打开', '拖动抽屉底部边缘', 'ttb')"
|
||||
>
|
||||
拖拽调整大小(从顶部打开)
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="onResizableClick('从底部打开', '拖动抽屉顶部边缘', 'btt')"
|
||||
>
|
||||
拖拽调整大小(从底部打开)
|
||||
</el-button>
|
||||
</el-space>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
@@ -199,6 +199,31 @@ defineOptions({
|
||||
|
||||
<el-divider />
|
||||
|
||||
<h4 class="mb-4!">
|
||||
控制消息出现的位置,消息可以显示在窗口的顶部(默认) 或其他位置
|
||||
</h4>
|
||||
|
||||
<el-space wrap>
|
||||
<el-button @click="message('顶部中间')"> 顶部中间 </el-button>
|
||||
<el-button @click="message('顶部左侧', { placement: 'top-left' })">
|
||||
顶部左侧
|
||||
</el-button>
|
||||
<el-button @click="message('顶部右侧', { placement: 'top-right' })">
|
||||
顶部右侧
|
||||
</el-button>
|
||||
<el-button @click="message('底部中间', { placement: 'bottom' })">
|
||||
底部中间
|
||||
</el-button>
|
||||
<el-button @click="message('底部左侧', { placement: 'bottom-left' })">
|
||||
底部左侧
|
||||
</el-button>
|
||||
<el-button @click="message('底部右侧', { placement: 'bottom-right' })">
|
||||
底部右侧
|
||||
</el-button>
|
||||
</el-space>
|
||||
|
||||
<el-divider />
|
||||
|
||||
<el-button @click="closeAllMessage"> 关闭所有消息提示 </el-button>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
@@ -23,8 +23,8 @@ const submitForm = formEl => {
|
||||
date: validateForm.date // 别的字段
|
||||
});
|
||||
formUpload(formData)
|
||||
.then(({ success }) => {
|
||||
if (success) {
|
||||
.then(({ code }) => {
|
||||
if (code === 0) {
|
||||
message("提交成功", { type: "success" });
|
||||
} else {
|
||||
message("提交失败");
|
||||
|
||||
@@ -143,7 +143,7 @@ const onDownload = () => {
|
||||
class="pure-upload"
|
||||
list-type="picture-card"
|
||||
accept="image/jpeg,image/png,image/gif"
|
||||
action="https://run.mocky.io/v3/3aa761d7-b0b3-4a03-96b3-6168d4f7467b"
|
||||
action="https://pureadmin.free.beeceptor.com/images"
|
||||
:limit="3"
|
||||
:headers="{ Authorization: 'eyJhbGciOiJIUzUxMiJ9.admin' }"
|
||||
:on-exceed="onExceed"
|
||||
@@ -264,13 +264,13 @@ const onDownload = () => {
|
||||
表格操作栏中的上传头像功能
|
||||
</p>
|
||||
<p class="text-[red] text-[12px] flex flex-auto items-center justify-end">
|
||||
免责声明:上传接口使用免费开源的
|
||||
免责声明:上传接口使用
|
||||
<el-link
|
||||
href="https://designer.mocky.io/"
|
||||
href="https://beeceptor.com/"
|
||||
target="_blank"
|
||||
style="font-size: 16px; font-weight: 800"
|
||||
>
|
||||
Mocky
|
||||
Beeceptor
|
||||
</el-link>
|
||||
<span class="font-bold text-[18x]"> 请不要上传重要信息 </span
|
||||
>,如果造成任何损失,我们概不负责
|
||||
|
||||
@@ -38,12 +38,14 @@ const dataLoading = ref(true);
|
||||
|
||||
const getCardListData = async () => {
|
||||
try {
|
||||
const { data } = await getCardList();
|
||||
productList.value = data.list;
|
||||
pagination.value = {
|
||||
...pagination.value,
|
||||
total: data.list.length
|
||||
};
|
||||
const { code, data } = await getCardList();
|
||||
if (code === 0) {
|
||||
productList.value = data.list;
|
||||
pagination.value = {
|
||||
...pagination.value,
|
||||
total: data.list.length
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
} finally {
|
||||
|
||||
@@ -52,8 +52,8 @@ const currentPage = computed(() => {
|
||||
const { t } = useI18n();
|
||||
const { initStorage } = useLayout();
|
||||
initStorage();
|
||||
const { dataTheme, overallStyle, dataThemeChange } = useDataThemeChange();
|
||||
dataThemeChange(overallStyle.value);
|
||||
const { dataTheme, themeMode, dataThemeChange } = useDataThemeChange();
|
||||
dataThemeChange(themeMode.value);
|
||||
const { title, getDropdownItemStyle, getDropdownItemClass } = useNav();
|
||||
const { locale, translationCh, translationEn } = useTranslationLang();
|
||||
|
||||
@@ -73,23 +73,21 @@ const onLogin = async (formEl: FormInstance | undefined) => {
|
||||
username: ruleForm.username,
|
||||
password: ruleForm.password
|
||||
})
|
||||
.then(res => {
|
||||
if (res.success) {
|
||||
// 获取后端路由
|
||||
return initRouter().then(() => {
|
||||
disabled.value = true;
|
||||
router
|
||||
.push(getTopMenu(true).path)
|
||||
.then(() => {
|
||||
message(t("login.pureLoginSuccess"), { type: "success" });
|
||||
})
|
||||
.finally(() => (disabled.value = false));
|
||||
});
|
||||
} else {
|
||||
message(t("login.pureLoginFail"), { type: "error" });
|
||||
}
|
||||
.then(async () => {
|
||||
// 获取后端路由
|
||||
await initRouter();
|
||||
disabled.value = true;
|
||||
router.push(getTopMenu(true).path).then(() => {
|
||||
message(t("login.pureLoginSuccess"), { type: "success" });
|
||||
});
|
||||
})
|
||||
.finally(() => (loading.value = false));
|
||||
.catch(_err => {
|
||||
message(t("login.pureLoginFail"), { type: "error" });
|
||||
})
|
||||
.finally(() => {
|
||||
disabled.value = false;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -129,11 +129,13 @@ export function useRole(tableRef: Ref) {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getLoginLogsList(toRaw(form));
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getLoginLogsList(toRaw(form));
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
|
||||
@@ -134,11 +134,13 @@ export function useRole(tableRef: Ref) {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getOperationLogsList(toRaw(form));
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getOperationLogsList(toRaw(form));
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
|
||||
@@ -204,11 +204,13 @@ export function useRole(tableRef: Ref) {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getSystemLogsList(toRaw(form));
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getSystemLogsList(toRaw(form));
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
|
||||
@@ -80,11 +80,13 @@ export function useRole() {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getOnlineLogsList(toRaw(form));
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getOnlineLogsList(toRaw(form));
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { message } from "@/utils/message";
|
||||
import { initRouter } from "@/router/utils";
|
||||
import { storageLocal } from "@pureadmin/utils";
|
||||
import { type CSSProperties, ref, computed } from "vue";
|
||||
@@ -32,12 +33,13 @@ const options = [
|
||||
function onChange() {
|
||||
useUserStoreHook()
|
||||
.loginByUsername({ username: username.value, password: "admin123" })
|
||||
.then(res => {
|
||||
if (res.success) {
|
||||
storageLocal().removeItem("async-routes");
|
||||
usePermissionStoreHook().clearAllCachePage();
|
||||
initRouter();
|
||||
}
|
||||
.then(() => {
|
||||
storageLocal().removeItem("async-routes");
|
||||
usePermissionStoreHook().clearAllCachePage();
|
||||
initRouter();
|
||||
})
|
||||
.catch(err => {
|
||||
message(err, { type: "error" });
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -74,17 +74,20 @@ export function useDept() {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getDeptList(); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id
|
||||
let newData = data;
|
||||
if (!isAllEmpty(form.name)) {
|
||||
// 前端搜索部门名称
|
||||
newData = newData.filter(item => item.name.includes(form.name));
|
||||
const { code, data } = await getDeptList(); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id
|
||||
if (code === 0) {
|
||||
let newData = data;
|
||||
if (!isAllEmpty(form.name)) {
|
||||
// 前端搜索部门名称
|
||||
newData = newData.filter(item => item.name.includes(form.name));
|
||||
}
|
||||
if (!isAllEmpty(form.status)) {
|
||||
// 前端搜索状态
|
||||
newData = newData.filter(item => item.status === form.status);
|
||||
}
|
||||
dataList.value = handleTree(newData); // 处理成树结构
|
||||
}
|
||||
if (!isAllEmpty(form.status)) {
|
||||
// 前端搜索状态
|
||||
newData = newData.filter(item => item.status === form.status);
|
||||
}
|
||||
dataList.value = handleTree(newData); // 处理成树结构
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
}, 500);
|
||||
|
||||
@@ -106,15 +106,18 @@ export function useMenu() {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getMenuList(); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id
|
||||
let newData = data;
|
||||
if (!isAllEmpty(form.title)) {
|
||||
// 前端搜索菜单名称
|
||||
newData = newData.filter(item =>
|
||||
transformI18n(item.title).includes(form.title)
|
||||
);
|
||||
const { code, data } = await getMenuList(); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id
|
||||
if (code === 0) {
|
||||
let newData = data;
|
||||
if (!isAllEmpty(form.title)) {
|
||||
// 前端搜索菜单名称
|
||||
newData = newData.filter(item =>
|
||||
transformI18n(item.title).includes(form.title)
|
||||
);
|
||||
}
|
||||
dataList.value = handleTree(newData); // 处理成树结构
|
||||
}
|
||||
dataList.value = handleTree(newData); // 处理成树结构
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
}, 500);
|
||||
|
||||
@@ -163,11 +163,13 @@ export function useRole(treeRef: Ref) {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getRoleList(toRaw(form));
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getRoleList(toRaw(form));
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
@@ -229,8 +231,10 @@ export function useRole(treeRef: Ref) {
|
||||
if (id) {
|
||||
curRow.value = row;
|
||||
isShow.value = true;
|
||||
const { data } = await getRoleMenuIds({ id });
|
||||
treeRef.value.setCheckedKeys(data);
|
||||
const { code, data } = await getRoleMenuIds({ id });
|
||||
if (code === 0) {
|
||||
treeRef.value.setCheckedKeys(data);
|
||||
}
|
||||
} else {
|
||||
curRow.value = null;
|
||||
isShow.value = false;
|
||||
@@ -268,9 +272,11 @@ export function useRole(treeRef: Ref) {
|
||||
|
||||
onMounted(async () => {
|
||||
onSearch();
|
||||
const { data } = await getRoleMenu();
|
||||
treeIds.value = getKeyList(data, "id");
|
||||
treeData.value = handleTree(data);
|
||||
const { code, data } = await getRoleMenu();
|
||||
if (code === 0) {
|
||||
treeIds.value = getKeyList(data, "id");
|
||||
treeData.value = handleTree(data);
|
||||
}
|
||||
});
|
||||
|
||||
watch(isExpandAll, val => {
|
||||
|
||||
@@ -272,11 +272,13 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getUserList(toRaw(form));
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getUserList(toRaw(form));
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
@@ -497,13 +499,16 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
|
||||
onSearch();
|
||||
|
||||
// 归属部门
|
||||
const { data } = await getDeptList();
|
||||
higherDeptOptions.value = handleTree(data);
|
||||
treeData.value = handleTree(data);
|
||||
const { code, data } = await getDeptList();
|
||||
if (code === 0) {
|
||||
higherDeptOptions.value = handleTree(data);
|
||||
treeData.value = handleTree(data);
|
||||
}
|
||||
|
||||
treeLoading.value = false;
|
||||
|
||||
// 角色列表
|
||||
roleOptions.value = (await getAllRoleList()).data;
|
||||
roleOptions.value = (await getAllRoleList()).data ?? [];
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@@ -102,7 +102,6 @@ function onCloseTags() {
|
||||
default-expand-all
|
||||
:props="{
|
||||
label: data => transformI18n(data.meta.title),
|
||||
value: 'uniqueId',
|
||||
children: 'children',
|
||||
disabled: 'disabled'
|
||||
}"
|
||||
|
||||
6
types/global.d.ts
vendored
6
types/global.d.ts
vendored
@@ -93,7 +93,7 @@ declare global {
|
||||
Layout?: string;
|
||||
Theme?: string;
|
||||
DarkMode?: boolean;
|
||||
OverallStyle?: string;
|
||||
ThemeMode?: string;
|
||||
Grey?: boolean;
|
||||
Weak?: boolean;
|
||||
HideTabs?: boolean;
|
||||
@@ -140,7 +140,7 @@ declare global {
|
||||
sidebarStatus?: boolean;
|
||||
epThemeColor?: string;
|
||||
themeColor?: string;
|
||||
overallStyle?: string;
|
||||
themeMode?: string;
|
||||
showLogo?: boolean;
|
||||
showModel?: string;
|
||||
menuSearchHistory?: number;
|
||||
@@ -169,7 +169,7 @@ declare global {
|
||||
sidebarStatus?: boolean;
|
||||
epThemeColor?: string;
|
||||
themeColor?: string;
|
||||
overallStyle?: string;
|
||||
themeMode?: string;
|
||||
};
|
||||
configure: {
|
||||
grey?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user