From de13b103c9887fd3cc437ab0219179f4adbe1c32 Mon Sep 17 00:00:00 2001 From: izory <791736813@qq.com> Date: Thu, 30 Sep 2021 14:55:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=B3=BB=E7=BB=9F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Model/System/Dto/SysConfigDto.cs | 32 +++ ZR.Model/System/SysConfig.cs | 44 +++ ZR.Repository/System/SysConfigRepository.cs | 21 ++ .../Business/IBusService/ISysConfigService.cs | 16 ++ ZR.Service/System/SysConfigService.cs | 35 +++ ZR.Vue/src/api/system/config.js | 69 +++++ ZR.Vue/src/assets/image/dark.svg | 39 +++ ZR.Vue/src/assets/image/light.svg | 39 +++ ZR.Vue/src/components/DictData/index.js | 21 ++ ZR.Vue/src/components/DictTag/index.vue | 39 +++ ZR.Vue/src/views/system/config/index.vue | 269 ++++++++++++++++++ 11 files changed, 624 insertions(+) create mode 100644 ZR.Model/System/Dto/SysConfigDto.cs create mode 100644 ZR.Model/System/SysConfig.cs create mode 100644 ZR.Repository/System/SysConfigRepository.cs create mode 100644 ZR.Service/Business/IBusService/ISysConfigService.cs create mode 100644 ZR.Service/System/SysConfigService.cs create mode 100644 ZR.Vue/src/api/system/config.js create mode 100644 ZR.Vue/src/assets/image/dark.svg create mode 100644 ZR.Vue/src/assets/image/light.svg create mode 100644 ZR.Vue/src/components/DictData/index.js create mode 100644 ZR.Vue/src/components/DictTag/index.vue create mode 100644 ZR.Vue/src/views/system/config/index.vue diff --git a/ZR.Model/System/Dto/SysConfigDto.cs b/ZR.Model/System/Dto/SysConfigDto.cs new file mode 100644 index 0000000..02ecefc --- /dev/null +++ b/ZR.Model/System/Dto/SysConfigDto.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using ZR.Model.Dto; +using ZR.Model.Models; + +namespace ZR.Model.Dto +{ + /// + /// 参数配置输入对象模型 + /// + public class SysConfigDto + { + public int ConfigId { get; set; } + public string ConfigName { get; set; } + public string ConfigKey { get; set; } + public string ConfigValue { get; set; } + public string ConfigType { get; set; } + } + + /// + /// 参数配置查询对象模型 + /// + public class SysConfigQueryDto: PagerInfo + { + public string ConfigName { get; set; } + public string ConfigKey { get; set; } + public string ConfigValue { get; set; } + public string ConfigType { get; set; } + public DateTime? BeginTime { get; set; } + public DateTime? EndTime { get; set; } + } +} diff --git a/ZR.Model/System/SysConfig.cs b/ZR.Model/System/SysConfig.cs new file mode 100644 index 0000000..073feb4 --- /dev/null +++ b/ZR.Model/System/SysConfig.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ZR.Model.System +{ + /// + /// 参数配置,数据实体对象 + /// + /// @author zhaorui + /// @date 2021-09-29 + /// + [SqlSugar.SugarTable("sys_config")] + public class SysConfig: SysBase + { + /// + /// 描述 : + /// 空值 :False + /// + [SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int ConfigId { get; set; } + /// + /// 描述 : + /// 空值 :True + /// + public string ConfigName { get; set; } + /// + /// 描述 : + /// 空值 :True + /// + public string ConfigKey { get; set; } + /// + /// 描述 : + /// 空值 :True + /// + public string ConfigValue { get; set; } + /// + /// 描述 : + /// 空值 :True + /// + public string ConfigType { get; set; } + + } +} diff --git a/ZR.Repository/System/SysConfigRepository.cs b/ZR.Repository/System/SysConfigRepository.cs new file mode 100644 index 0000000..4f391e0 --- /dev/null +++ b/ZR.Repository/System/SysConfigRepository.cs @@ -0,0 +1,21 @@ +using System; +using Infrastructure.Attribute; +using ZR.Repository.System; +using ZR.Model.Models; +using ZR.Model.System; + +namespace ZR.Repository +{ + /// + /// 参数配置仓储接口的实现 + /// + /// @author zhaorui + /// @date 2021-09-29 + /// + [AppService(ServiceLifetime = LifeTime.Transient)] + public class SysConfigRepository : BaseRepository + { + #region 业务逻辑代码 + #endregion + } +} \ No newline at end of file diff --git a/ZR.Service/Business/IBusService/ISysConfigService.cs b/ZR.Service/Business/IBusService/ISysConfigService.cs new file mode 100644 index 0000000..182b403 --- /dev/null +++ b/ZR.Service/Business/IBusService/ISysConfigService.cs @@ -0,0 +1,16 @@ +using System; +using ZR.Model.Models; +using ZR.Model.System; + +namespace ZR.Service.System +{ + /// + /// 参数配置service接口 + /// + /// @author zhaorui + /// @date 2021-09-29 + /// + public interface ISysConfigService: IBaseService + { + } +} diff --git a/ZR.Service/System/SysConfigService.cs b/ZR.Service/System/SysConfigService.cs new file mode 100644 index 0000000..8684572 --- /dev/null +++ b/ZR.Service/System/SysConfigService.cs @@ -0,0 +1,35 @@ +using Infrastructure; +using Infrastructure.Attribute; +using Infrastructure.Extensions; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ZR.Common; +using ZR.Model.Models; +using ZR.Model.System; +using ZR.Repository; + +namespace ZR.Service.System +{ + /// + /// 参数配置Service业务层处理 + /// + /// @author zhaorui + /// @date 2021-09-29 + /// + [AppService(ServiceType = typeof(ISysConfigService), ServiceLifetime = LifeTime.Transient)] + public class SysConfigService: BaseService, ISysConfigService + { + private readonly SysConfigRepository _SysConfigrepository; + public SysConfigService(SysConfigRepository repository) + { + _SysConfigrepository = repository; + } + + #region 业务逻辑代码 + + #endregion + } +} \ No newline at end of file diff --git a/ZR.Vue/src/api/system/config.js b/ZR.Vue/src/api/system/config.js new file mode 100644 index 0000000..3633ba1 --- /dev/null +++ b/ZR.Vue/src/api/system/config.js @@ -0,0 +1,69 @@ +import request from '@/utils/request' + +// 查询参数列表 +export function listConfig(query) { + return request({ + url: '/system/config/list', + method: 'get', + params: query + }) +} + +// 查询参数详细 +export function getConfig(configId) { + return request({ + url: '/system/config/' + configId, + method: 'get' + }) +} + +// 根据参数键名查询参数值 +export function getConfigKey(configKey) { + return request({ + url: '/system/config/configKey/' + configKey, + method: 'get' + }) +} + +// 新增参数配置 +export function addConfig(data) { + return request({ + url: '/system/config', + method: 'post', + data: data + }) +} + +// 修改参数配置 +export function updateConfig(data) { + return request({ + url: '/system/config', + method: 'put', + data: data + }) +} + +// 删除参数配置 +export function delConfig(configId) { + return request({ + url: '/system/config/' + configId, + method: 'delete' + }) +} + +// 刷新参数缓存 +export function refreshCache() { + return request({ + url: '/system/config/refreshCache', + method: 'delete' + }) +} + +// 导出参数 +// export function exportConfig(query) { +// return request({ +// url: '/system/config/export', +// method: 'get', +// params: query +// }) +// } diff --git a/ZR.Vue/src/assets/image/dark.svg b/ZR.Vue/src/assets/image/dark.svg new file mode 100644 index 0000000..f646bd7 --- /dev/null +++ b/ZR.Vue/src/assets/image/dark.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ZR.Vue/src/assets/image/light.svg b/ZR.Vue/src/assets/image/light.svg new file mode 100644 index 0000000..ab7cc08 --- /dev/null +++ b/ZR.Vue/src/assets/image/light.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ZR.Vue/src/components/DictData/index.js b/ZR.Vue/src/components/DictData/index.js new file mode 100644 index 0000000..c2a0359 --- /dev/null +++ b/ZR.Vue/src/components/DictData/index.js @@ -0,0 +1,21 @@ +import Vue from 'vue' +import DataDict from '@/utils/dict' +import { getDicts as getDicts } from '@/api/system/dict/data' + +function install() { + Vue.use(DataDict, { + metas: { + '*': { + labelField: 'dictLabel', + valueField: 'dictValue', + request(dictMeta) { + return getDicts(dictMeta.type).then(res => res.data) + }, + }, + }, + }) +} + +export default { + install, +} \ No newline at end of file diff --git a/ZR.Vue/src/components/DictTag/index.vue b/ZR.Vue/src/components/DictTag/index.vue new file mode 100644 index 0000000..ed4712d --- /dev/null +++ b/ZR.Vue/src/components/DictTag/index.vue @@ -0,0 +1,39 @@ + + + + diff --git a/ZR.Vue/src/views/system/config/index.vue b/ZR.Vue/src/views/system/config/index.vue new file mode 100644 index 0000000..d3aa42c --- /dev/null +++ b/ZR.Vue/src/views/system/config/index.vue @@ -0,0 +1,269 @@ + + +