From 8f413ebbf67bf4642a3aa51017feed9c615cfab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sun, 19 Dec 2021 19:52:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E5=85=B8=E7=B1=BB=E5=9E=8B=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=98=AF=E5=90=A6=E7=B3=BB=E7=BB=9F=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../System/SysDictTypeController.cs | 3 +- ZR.Model/System/SysDictType.cs | 7 +++- ZR.Repository/System/SysDictRepository.cs | 1 + ZR.Vue/src/views/system/dict/index.vue | 37 ++++++++++++++---- document/admin-mysql.sql | 23 +++++------ document/admin-sqlserver.sql | Bin 117700 -> 117938 bytes 6 files changed, 49 insertions(+), 22 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/System/SysDictTypeController.cs b/ZR.Admin.WebApi/Controllers/System/SysDictTypeController.cs index 1e66890..f3b3ecc 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysDictTypeController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysDictTypeController.cs @@ -3,6 +3,7 @@ using Infrastructure.Enums; using Infrastructure.Model; using Microsoft.AspNetCore.Mvc; using System; +using ZR.Admin.WebApi.Extensions; using ZR.Admin.WebApi.Filters; using ZR.Common; using ZR.Model; @@ -89,7 +90,7 @@ namespace ZR.Admin.WebApi.Controllers.System return ToResponse(ApiResult.Error($"修改字典'{dict.DictName}'失败,字典类型已存在")); } //设置添加人 - dict.Update_by = HttpContext.User.Identity.Name; + dict.Update_by = HttpContext.GetName(); return SUCCESS(SysDictService.UpdateDictType(dict)); } diff --git a/ZR.Model/System/SysDictType.cs b/ZR.Model/System/SysDictType.cs index 4b240b5..744f0a4 100644 --- a/ZR.Model/System/SysDictType.cs +++ b/ZR.Model/System/SysDictType.cs @@ -6,7 +6,7 @@ namespace ZR.Model.System /// /// 字典类型表 /// - [SugarTable("sys_dict_type")]//当和数据库名称不一样可以设置别名 + [SugarTable("sys_dict_type")] [Tenant("0")] public class SysDictType : SysBase { @@ -14,7 +14,6 @@ namespace ZR.Model.System /// 字典主键 /// [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]//主键并且自增 (string不能设置自增) - //[Key] public long DictId { get; set; } /// /// 字典名称 @@ -29,5 +28,9 @@ namespace ZR.Model.System /// [EpplusIgnore] public string Status { get; set; } + /// + /// 系统内置 Y是 N否 + /// + public string Type { get; set; } } } diff --git a/ZR.Repository/System/SysDictRepository.cs b/ZR.Repository/System/SysDictRepository.cs index cf61fde..a315c7c 100644 --- a/ZR.Repository/System/SysDictRepository.cs +++ b/ZR.Repository/System/SysDictRepository.cs @@ -28,6 +28,7 @@ namespace ZR.Repository.System exp.AndIF(!string.IsNullOrEmpty(dictType.DictName), it => it.DictName.Contains(dictType.DictName)); exp.AndIF(!string.IsNullOrEmpty(dictType.Status), it => it.Status == dictType.Status); exp.AndIF(!string.IsNullOrEmpty(dictType.DictType), it => it.DictType.Contains(dictType.DictType)); + exp.AndIF(!string.IsNullOrEmpty(dictType.Type), it => it.Type.Equals(dictType.Type)); return GetPages(exp.ToExpression(), pager, f => f.DictId, OrderByType.Desc); } diff --git a/ZR.Vue/src/views/system/dict/index.vue b/ZR.Vue/src/views/system/dict/index.vue index e3d7ef5..e0771b9 100644 --- a/ZR.Vue/src/views/system/dict/index.vue +++ b/ZR.Vue/src/views/system/dict/index.vue @@ -2,18 +2,26 @@
- + - + + + + + + - + 搜索 @@ -26,10 +34,12 @@ 新增 - 修改 + 修改 + - 删除 + 删除 导出 @@ -76,11 +86,16 @@ - + {{dict.dictLabel}} + + + {{dict.dictLabel}} + + @@ -136,6 +151,8 @@ export default { dictDataVisible: false, // 状态数据字典 statusOptions: [], + // 是否内置 + typeOptions: [], // 日期范围 dateRange: [], // 查询参数 @@ -166,16 +183,19 @@ export default { this.getDicts("sys_normal_disable").then((response) => { this.statusOptions = response.data; }); + this.getDicts("sys_yes_no").then((response) => { + this.typeOptions = response.data; + }); }, methods: { /** 查询字典类型列表 */ getList() { - // this.loading = true; + this.loading = true; listType(this.addDateRange(this.queryParams, this.dateRange)).then( (response) => { this.typeList = response.data.result; this.total = response.data.totalNum; - // this.loading = false; + this.loading = false; } ); }, @@ -195,6 +215,7 @@ export default { dictName: undefined, dictType: undefined, status: "0", + type: "N", remark: undefined, }; this.resetForm("form"); diff --git a/document/admin-mysql.sql b/document/admin-mysql.sql index 57ad226..33a53b0 100644 --- a/document/admin-mysql.sql +++ b/document/admin-mysql.sql @@ -184,6 +184,7 @@ CREATE TABLE `sys_dict_type` ( `dictName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典名称', `dictType` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型', `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', + `type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '系统内置(Y是 N否)', `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者', `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者', @@ -196,17 +197,17 @@ CREATE TABLE `sys_dict_type` ( -- ---------------------------- -- Records of sys_dict_type -- ---------------------------- -INSERT INTO `sys_dict_type` VALUES (1, '用户性别', 'sys_user_sex', '0', 'admin', '2021-02-24 10:55:26', '', NULL, '用户性别列表'); -INSERT INTO `sys_dict_type` VALUES (2, '菜单状态', 'sys_show_hide', '0', 'admin', '2021-02-24 10:55:26', '', NULL, '菜单状态列表'); -INSERT INTO `sys_dict_type` VALUES (3, '系统开关', 'sys_normal_disable', '0', 'admin', '2021-02-24 10:55:26', '', NULL, '系统开关列表'); -INSERT INTO `sys_dict_type` VALUES (4, '任务状态', 'sys_job_status', '0', 'admin', '2021-02-24 10:55:26', '', NULL, '任务状态列表'); -INSERT INTO `sys_dict_type` VALUES (5, '任务分组', 'sys_job_group', '0', 'admin', '2021-02-24 10:55:26', '', NULL, '任务分组列表'); -INSERT INTO `sys_dict_type` VALUES (6, '系统是否', 'sys_yes_no', '0', 'admin', '2021-02-24 10:55:26', '', NULL, '系统是否列表'); -INSERT INTO `sys_dict_type` VALUES (7, '通知类型', 'sys_notice_type', '0', 'admin', '2021-02-24 10:55:26', '', NULL, '通知类型列表'); -INSERT INTO `sys_dict_type` VALUES (8, '通知状态', 'sys_notice_status', '0', 'admin', '2021-02-24 10:55:26', '', NULL, '通知状态列表'); -INSERT INTO `sys_dict_type` VALUES (9, '操作类型', 'sys_oper_type', '0', 'admin', '2021-02-24 10:55:26', '', NULL, '操作类型列表'); -INSERT INTO `sys_dict_type` VALUES (10, '系统状态', 'sys_common_status', '0', 'admin', '2021-02-24 10:55:27', '', NULL, '登录状态列表'); -INSERT INTO `sys_dict_type` VALUES (11, '文章状态', 'sys_article_status', '0', 'admin', '2021-08-19 10:34:33', '', NULL, NULL); +INSERT INTO `sys_dict_type` VALUES (1, '用户性别', 'sys_user_sex', '0', 'Y', 'admin', '2021-02-24 10:55:26', '', NULL, '用户性别列表'); +INSERT INTO `sys_dict_type` VALUES (2, '菜单状态', 'sys_show_hide', '0', 'Y', 'admin', '2021-02-24 10:55:26', '', NULL, '菜单状态列表'); +INSERT INTO `sys_dict_type` VALUES (3, '系统开关', 'sys_normal_disable', '0', 'Y', 'admin', '2021-02-24 10:55:26', '', NULL, '系统开关列表'); +INSERT INTO `sys_dict_type` VALUES (4, '任务状态', 'sys_job_status', '0', 'Y', 'admin', '2021-02-24 10:55:26', '', NULL, '任务状态列表'); +INSERT INTO `sys_dict_type` VALUES (5, '任务分组', 'sys_job_group', '0', 'Y', 'admin', '2021-02-24 10:55:26', '', NULL, '任务分组列表'); +INSERT INTO `sys_dict_type` VALUES (6, '系统是否', 'sys_yes_no', '0', 'Y', 'admin', '2021-02-24 10:55:26', '', NULL, '系统是否列表'); +INSERT INTO `sys_dict_type` VALUES (7, '通知类型', 'sys_notice_type', '0', 'Y', 'admin', '2021-02-24 10:55:26', '', NULL, '通知类型列表'); +INSERT INTO `sys_dict_type` VALUES (8, '通知状态', 'sys_notice_status', '0', 'Y', 'admin', '2021-02-24 10:55:26', '', NULL, '通知状态列表'); +INSERT INTO `sys_dict_type` VALUES (9, '操作类型', 'sys_oper_type', '0', 'Y', 'admin', '2021-02-24 10:55:26', '', NULL, '操作类型列表'); +INSERT INTO `sys_dict_type` VALUES (10, '系统状态', 'sys_common_status', '0', 'Y', 'admin', '2021-02-24 10:55:27', '', NULL, '登录状态列表'); +INSERT INTO `sys_dict_type` VALUES (11, '文章状态', 'sys_article_status', '0', 'Y', 'admin', '2021-08-19 10:34:33', '', NULL, NULL); SET FOREIGN_KEY_CHECKS = 1; diff --git a/document/admin-sqlserver.sql b/document/admin-sqlserver.sql index 2dfd456320a16e5cb76231eb0280a2d2613f1393..acfc61c306d42b562bc7eed1fb1c1cd04105d8cf 100644 GIT binary patch delta 259 zcmX>yoqf|x_6-u+(_OYP3QV`~W>jJ?VW?y%U`U-VxP(!B@&rkt=|wvj<)(XWW8|8? zX$Pa(WCuH!&FgHBF;2Eg@h^sR$(*=RRu^}l5yW;4hI*YMH-WXOy(df*n`YbnXG5F03q==y0H~9fS T%jAxDq2?dv+kcodo|y~)np`6luvsB@0psKanIhBI>|vCeelLQNZ}JD-ACnK5 zgiLnRp8=+A3>HCX!&zY3#0Vm;WjqPYmok|&d4U-hko^USBPNTPO#zE@m@fd*W|Lo- S9{|#F%@-`TU$9_&G#LP;Vms6T