From cc15723acb7bc2910bbc93de4ff846407a2a36f2 Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Tue, 26 Jan 2021 17:36:21 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90dict=E3=80=91=E3=80=90config=E3=80=91?= =?UTF-8?q?=E3=80=90organization=E3=80=91=E4=BF=AE=E6=94=B9=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=A0=87=E9=A2=98=20=E8=B0=83=E6=95=B4=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E9=85=8D=E7=BD=AE=E6=96=B0=E5=A2=9E=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/config/ConfigViewController.java | 12 ---- .../system/dict/DictViewController.java | 24 ++++++++ ...V1.0_20210126_0001__update_translation.sql | 11 ++++ .../assets/modular/system/config/config.js | 2 +- .../config_add.js => dict/dict_add_config.js} | 0 .../system/dict/dict_add_translation.js | 25 ++++++++ .../pages/modular/system/config/config.html | 2 - .../pages/modular/system/dict/dictType.html | 2 - .../dict_add_config.html} | 2 +- .../system/dict/dict_add_translation.html | 57 +++++++++++++++++++ .../system/organization/organization.html | 2 - .../pages/modular/system/user/user.html | 2 - 12 files changed, 119 insertions(+), 22 deletions(-) create mode 100644 src/main/resources/db/migration/V1.0_20210126_0001__update_translation.sql rename src/main/webapp/assets/modular/system/{config/config_add.js => dict/dict_add_config.js} (100%) create mode 100644 src/main/webapp/assets/modular/system/dict/dict_add_translation.js rename src/main/webapp/pages/modular/system/{config/config_add.html => dict/dict_add_config.html} (97%) create mode 100644 src/main/webapp/pages/modular/system/dict/dict_add_translation.html diff --git a/src/main/java/cn/stylefeng/guns/modular/system/config/ConfigViewController.java b/src/main/java/cn/stylefeng/guns/modular/system/config/ConfigViewController.java index ef87ad8d..f4649106 100644 --- a/src/main/java/cn/stylefeng/guns/modular/system/config/ConfigViewController.java +++ b/src/main/java/cn/stylefeng/guns/modular/system/config/ConfigViewController.java @@ -23,7 +23,6 @@ public class ConfigViewController { @GetResource(name = "系统配置-列表-视图", path = "/view/config") public String indexView() { return "/modular/system/config/config.html"; - //return "/modular/system/config/sysConfig.html"; } /** @@ -37,17 +36,6 @@ public class ConfigViewController { return "/modular/system/config/sysConfig_add.html"; } - /** - * 系统配置—新增-视图 - * - * @author jiawei - * @date 2021/1/4 13:34 - */ - @GetResource(name = "系统配置—新增-视图", path = "/view/config/addConfigDictView") - public String addConfigDictView() { - return "/modular/system/config/config_add.html"; - } - /** * 系统配置-修改-视图 * diff --git a/src/main/java/cn/stylefeng/guns/modular/system/dict/DictViewController.java b/src/main/java/cn/stylefeng/guns/modular/system/dict/DictViewController.java index d9cbc130..bb03ba01 100644 --- a/src/main/java/cn/stylefeng/guns/modular/system/dict/DictViewController.java +++ b/src/main/java/cn/stylefeng/guns/modular/system/dict/DictViewController.java @@ -36,6 +36,30 @@ public class DictViewController { return "/modular/system/dict/dict_add.html"; } + + /** + * 字典管理-添加翻译字典-视图 + * + * @author chenjinlong + * @date 2021/1/22 16:09 + */ + @GetResource(name = "字典管理-添加翻译字典-视图", path = "/view/dict/addTranslationView") + public String addTranslationView() { + return "/modular/system/dict/dict_add_translation.html"; + } + + /** + * 字典管理-添加系统配置字典-视图 + * + * @author chenjinlong + * @date 2021/1/22 16:09 + */ + @GetResource(name = "字典管理-添加系统配置字典-视图", path = "/view/dict/addConfigView") + public String addConfigView() { + return "/modular/system/dict/dict_add_config.html"; + } + + /** * 字典管理-编辑-视图 * diff --git a/src/main/resources/db/migration/V1.0_20210126_0001__update_translation.sql b/src/main/resources/db/migration/V1.0_20210126_0001__update_translation.sql new file mode 100644 index 00000000..b1131dcf --- /dev/null +++ b/src/main/resources/db/migration/V1.0_20210126_0001__update_translation.sql @@ -0,0 +1,11 @@ +INSERT INTO `guns_beetl_dev`.`sys_dict` (`dict_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_type_code`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `status_flag`, `dict_sort`, `dict_pids`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1353998066804658177, 'chinese', '中文', 'zw', NULL, 'languages', '', '', -1, 1, 1.00, '-1', 'N', '2021-01-26 17:27:50', 1339550467939639299, NULL, NULL); +INSERT INTO `guns_beetl_dev`.`sys_dict` (`dict_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_type_code`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `status_flag`, `dict_sort`, `dict_pids`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1353998106784763906, 'english', '英文', 'yw', NULL, 'languages', '', '', -1, 1, 2.00, '-1', 'N', '2021-01-26 17:27:59', 1339550467939639299, NULL, NULL); +INSERT INTO `guns_beetl_dev`.`sys_dict_type` (`dict_type_id`, `dict_type_class`, `dict_type_bus_code`, `dict_type_code`, `dict_type_name`, `dict_type_name_pinyin`, `dict_type_desc`, `status_flag`, `dict_type_sort`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1353997993299480577, 2, '', 'languages', '语种', 'yz', 'i18n 多语言', 1, 7.00, 'N', '2021-01-26 17:27:32', 1339550467939639299, NULL, NULL); + + +ALTER TABLE `sys_translation` CHANGE COLUMN `language` `tran_language_code` varchar(255) NOT NULL COMMENT '语种字典'; + +update sys_translation set tran_language_code='chinese' where tran_language_code='1'; +update sys_translation set tran_language_code='english' where tran_language_code='2'; + + diff --git a/src/main/webapp/assets/modular/system/config/config.js b/src/main/webapp/assets/modular/system/config/config.js index 363f70e0..ff31cf11 100644 --- a/src/main/webapp/assets/modular/system/config/config.js +++ b/src/main/webapp/assets/modular/system/config/config.js @@ -107,7 +107,7 @@ layui.use(['layer', 'form', 'table', 'util', 'admin', 'func', 'HttpRequest'], fu func.open({ height: 680, title: '添加字典', - content: Feng.ctxPath + '/view/config/addConfigDictView', + content: Feng.ctxPath + '/view/dict/addConfigView', tableId: DictType.tableId }); }; diff --git a/src/main/webapp/assets/modular/system/config/config_add.js b/src/main/webapp/assets/modular/system/dict/dict_add_config.js similarity index 100% rename from src/main/webapp/assets/modular/system/config/config_add.js rename to src/main/webapp/assets/modular/system/dict/dict_add_config.js diff --git a/src/main/webapp/assets/modular/system/dict/dict_add_translation.js b/src/main/webapp/assets/modular/system/dict/dict_add_translation.js new file mode 100644 index 00000000..d40c3d69 --- /dev/null +++ b/src/main/webapp/assets/modular/system/dict/dict_add_translation.js @@ -0,0 +1,25 @@ +layui.use(['form', 'admin', 'HttpRequest'], function () { + var $ = layui.jquery; + var form = layui.form; + var admin = layui.admin; + var HttpRequest = layui.HttpRequest; + + //获取信息详情填充表单 + var request = new HttpRequest(Feng.ctxPath + '/dictType/getTranslationDetail', 'get'); + var result = request.start(); + form.val('dictForm', result.data); + + //表单提交事件 + form.on('submit(btnSubmit)', function (data) { + var request = new HttpRequest(Feng.ctxPath + "/dict/addDict", 'post', function (data) { + admin.closeThisDialog(); + Feng.success("添加成功!"); + admin.putTempData('formOk', true); + }, function (data) { + admin.closeThisDialog(); + Feng.error("添加失败!" + data.message); + }); + request.set(data.field); + request.start(true); + }); +}); \ No newline at end of file diff --git a/src/main/webapp/pages/modular/system/config/config.html b/src/main/webapp/pages/modular/system/config/config.html index 49ebdb68..8c65946b 100644 --- a/src/main/webapp/pages/modular/system/config/config.html +++ b/src/main/webapp/pages/modular/system/config/config.html @@ -57,13 +57,11 @@