mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-20 20:39:55 +00:00
refactor(dict): 重构字典数据管理模块,优化代码结构和可维护性
- 将字典类型和字典数据的获取、存储逻辑统一管理,减少重复代码 - 使用 `pinia-plugin-persistedstate` 实现字典数据的持久化存储 - 优化字典数据的展示逻辑,统一使用字典标签进行显示 - 修复字典数据查询接口的权限控制和参数传递问题 - 更新字典数据相关的测试用例,确保功能稳定
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
"dict_label": "男",
|
||||
"dict_value": "0",
|
||||
"dict_type": "sys_user_sex",
|
||||
"css_class": "",
|
||||
"list_class": "",
|
||||
"css_class": "blue",
|
||||
"list_class": null,
|
||||
"is_default": true,
|
||||
"available": true,
|
||||
"description": "性别男",
|
||||
@@ -18,8 +18,8 @@
|
||||
"dict_label": "女",
|
||||
"dict_value": "1",
|
||||
"dict_type": "sys_user_sex",
|
||||
"css_class": "",
|
||||
"list_class": "",
|
||||
"css_class": "pink",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "性别女",
|
||||
@@ -31,8 +31,8 @@
|
||||
"dict_label": "未知",
|
||||
"dict_value": "2",
|
||||
"dict_type": "sys_user_sex",
|
||||
"css_class": "",
|
||||
"list_class": "",
|
||||
"css_class": "red",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "性别未知",
|
||||
@@ -119,11 +119,11 @@
|
||||
{
|
||||
"id": 10,
|
||||
"dict_sort": 1,
|
||||
"dict_label": "默认",
|
||||
"dict_label": "默认(Memory)",
|
||||
"dict_value": "default",
|
||||
"dict_type": "sys_job_group",
|
||||
"css_class": "",
|
||||
"list_class": "",
|
||||
"list_class": null,
|
||||
"is_default": true,
|
||||
"available": true,
|
||||
"description": "默认分组",
|
||||
@@ -136,7 +136,7 @@
|
||||
"dict_value": "sqlalchemy",
|
||||
"dict_type": "sys_job_group",
|
||||
"css_class": "",
|
||||
"list_class": "",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "数据库分组",
|
||||
@@ -149,7 +149,7 @@
|
||||
"dict_value": "redis",
|
||||
"dict_type": "sys_job_group",
|
||||
"css_class": "",
|
||||
"list_class": "",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "reids分组",
|
||||
@@ -162,7 +162,7 @@
|
||||
"dict_value": "default",
|
||||
"dict_type": "sys_job_executor",
|
||||
"css_class": "",
|
||||
"list_class": "",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "线程池",
|
||||
@@ -175,7 +175,7 @@
|
||||
"dict_value": "processpool",
|
||||
"dict_type": "sys_job_executor",
|
||||
"css_class": "",
|
||||
"list_class": "",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "进程池",
|
||||
@@ -185,7 +185,7 @@
|
||||
"id": 15,
|
||||
"dict_sort": 1,
|
||||
"dict_label": "是",
|
||||
"dict_value": "Y",
|
||||
"dict_value": "true",
|
||||
"dict_type": "sys_yes_no",
|
||||
"css_class": "",
|
||||
"list_class": "primary",
|
||||
@@ -198,7 +198,7 @@
|
||||
"id": 16,
|
||||
"dict_sort": 2,
|
||||
"dict_label": "否",
|
||||
"dict_value": "N",
|
||||
"dict_value": "false",
|
||||
"dict_type": "sys_yes_no",
|
||||
"css_class": "",
|
||||
"list_class": "danger",
|
||||
@@ -213,7 +213,7 @@
|
||||
"dict_label": "通知",
|
||||
"dict_value": "1",
|
||||
"dict_type": "sys_notice_type",
|
||||
"css_class": "",
|
||||
"css_class": "blue",
|
||||
"list_class": "warning",
|
||||
"is_default": true,
|
||||
"available": true,
|
||||
@@ -226,7 +226,7 @@
|
||||
"dict_label": "公告",
|
||||
"dict_value": "2",
|
||||
"dict_type": "sys_notice_type",
|
||||
"css_class": "",
|
||||
"css_class": "orange",
|
||||
"list_class": "success",
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
@@ -414,5 +414,135 @@
|
||||
"available": true,
|
||||
"description": "停用状态",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 33,
|
||||
"dict_sort": 1,
|
||||
"dict_label": "初始化演示函数",
|
||||
"dict_value": "scheduler_test.job",
|
||||
"dict_type": "sys_job_function",
|
||||
"css_class": "",
|
||||
"list_class": null,
|
||||
"is_default": true,
|
||||
"available": true,
|
||||
"description": "演示函数",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 34,
|
||||
"dict_sort": 1,
|
||||
"dict_label": "指定日期(date)",
|
||||
"dict_value": "date",
|
||||
"dict_type": "sys_job_trigger",
|
||||
"css_class": "",
|
||||
"list_class": null,
|
||||
"is_default": true,
|
||||
"available": true,
|
||||
"description": "指定日期任务触发器",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 35,
|
||||
"dict_sort": 2,
|
||||
"dict_label": "间隔触发器(interval)",
|
||||
"dict_value": "interval",
|
||||
"dict_type": "sys_job_trigger",
|
||||
"css_class": "",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "间隔触发器任务触发器",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 36,
|
||||
"dict_sort": 3,
|
||||
"dict_label": "cron表达式",
|
||||
"dict_value": "cron",
|
||||
"dict_type": "sys_job_trigger",
|
||||
"css_class": "",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "间隔触发器任务触发器",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 37,
|
||||
"dict_sort": 1,
|
||||
"dict_label": "默认(default)",
|
||||
"dict_value": "default",
|
||||
"dict_type": "sys_dictdata_list_class",
|
||||
"css_class": "",
|
||||
"list_class": null,
|
||||
"is_default": true,
|
||||
"available": true,
|
||||
"description": "默认表格回显样式",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 38,
|
||||
"dict_sort": 2,
|
||||
"dict_label": "主要(primary)",
|
||||
"dict_value": "primary",
|
||||
"dict_type": "sys_dictdata_list_class",
|
||||
"css_class": "",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "主要表格回显样式",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 39,
|
||||
"dict_sort": 3,
|
||||
"dict_label": "成功(success)",
|
||||
"dict_value": "success",
|
||||
"dict_type": "sys_dictdata_list_class",
|
||||
"css_class": "",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "成功表格回显样式",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 40,
|
||||
"dict_sort": 4,
|
||||
"dict_label": "信息(info)",
|
||||
"dict_value": "info",
|
||||
"dict_type": "sys_dictdata_list_class",
|
||||
"css_class": "",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "信息表格回显样式",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 41,
|
||||
"dict_sort": 5,
|
||||
"dict_label": "警告(warning)",
|
||||
"dict_value": "warning",
|
||||
"dict_type": "sys_dictdata_list_class",
|
||||
"css_class": "",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "警告表格回显样式",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 42,
|
||||
"dict_sort": 6,
|
||||
"dict_label": "危险(danger)",
|
||||
"dict_value": "danger",
|
||||
"dict_type": "sys_dictdata_list_class",
|
||||
"css_class": "",
|
||||
"list_class": null,
|
||||
"is_default": false,
|
||||
"available": true,
|
||||
"description": "危险表格回显样式",
|
||||
"creator_id": 1
|
||||
}
|
||||
]
|
||||
@@ -86,5 +86,29 @@
|
||||
"available": true,
|
||||
"description": "登录状态列表",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"dict_name": "任务函数",
|
||||
"dict_type": "sys_job_function",
|
||||
"available": true,
|
||||
"description": "任务函数列表",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"dict_name": "任务触发器",
|
||||
"dict_type": "sys_job_trigger",
|
||||
"available": true,
|
||||
"description": "任务触发器列表",
|
||||
"creator_id": 1
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"dict_name": "字典配置表格回显样式",
|
||||
"dict_type": "sys_dictdata_list_class",
|
||||
"available": true,
|
||||
"description": "字典配置表格回显样式列表",
|
||||
"creator_id": 1
|
||||
}
|
||||
]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"id": 1,
|
||||
"notice_title": "系统更新",
|
||||
"notice_type": 1,
|
||||
"notice_type": "1",
|
||||
"notice_content": "2099年9月9日,晚上12:00,系统更新",
|
||||
"available": true,
|
||||
"description": "系统更新",
|
||||
@@ -11,7 +11,7 @@
|
||||
{
|
||||
"id": 2,
|
||||
"notice_title": "系统维护",
|
||||
"notice_type": 2,
|
||||
"notice_type": "2",
|
||||
"notice_content": "2099年9月9日,晚上12:00,系统维护",
|
||||
"available": true,
|
||||
"description": "系统维护",
|
||||
@@ -20,7 +20,7 @@
|
||||
{
|
||||
"id": 3,
|
||||
"notice_title": "系统更新完成",
|
||||
"notice_type": 1,
|
||||
"notice_type": "1",
|
||||
"notice_content": "2099年9月9日,晚上12:00,系统更新完成",
|
||||
"available": false,
|
||||
"description": "系统更新完成",
|
||||
@@ -29,7 +29,7 @@
|
||||
{
|
||||
"id": 4,
|
||||
"notice_title": "系统维护完成",
|
||||
"notice_type": 2,
|
||||
"notice_type": "2",
|
||||
"notice_content": "2099年9月9日,晚上12:00,系统维护完成",
|
||||
"available": false,
|
||||
"description": "系统维护完成",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"name": "管理员",
|
||||
"mobile": "15382112222",
|
||||
"email": "admin@qq.com",
|
||||
"gender": 1,
|
||||
"gender": "0",
|
||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
||||
"available": true,
|
||||
"is_superuser": true,
|
||||
@@ -22,7 +22,7 @@
|
||||
"name": "演示用户",
|
||||
"mobile": "15382112121",
|
||||
"email": "demo@qq.com",
|
||||
"gender": 1,
|
||||
"gender": "1",
|
||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
||||
"available": true,
|
||||
"is_superuser": false,
|
||||
|
||||
Reference in New Issue
Block a user