From c783f0f2ef455f44f0576cf74a47209f1e640ea7 Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Thu, 7 Jan 2021 18:37:08 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E3=80=90application-dev.yml=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E6=94=B9beetl=E7=89=88=E6=9C=ACdev=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index daf3f3ea..347699a2 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -2,9 +2,9 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://114.215.203.183:3306/guns?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT - username: guest - password: p8HMTBEapAPPmXB8 + url: jdbc:mysql://114.215.203.183:3306/guns_beetl_dev?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT + username: beetl_dev + password: sksTykzfZeMFbwJf # 连接池大小根据实际情况调整 max-active: 100 From 811610364177932ba89fab9139837ee0649478a9 Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Thu, 7 Jan 2021 19:08:10 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E3=80=90hr=5Forganization=E3=80=91?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E8=B0=83=E6=95=B4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/organization/organization.js | 51 +++++++++++++++---- .../system/organization/organization_add.js | 30 ++++++++++- .../system/organization/organization_edit.js | 33 +++++++++++- .../modular/system/position/position.js | 3 +- .../system/organization/organization.html | 26 +++++----- .../system/organization/organization_add.html | 12 +++-- .../organization/organization_edit.html | 12 +++-- 7 files changed, 133 insertions(+), 34 deletions(-) diff --git a/src/main/webapp/assets/modular/system/organization/organization.js b/src/main/webapp/assets/modular/system/organization/organization.js index 8a51ac65..e7dc22fe 100644 --- a/src/main/webapp/assets/modular/system/organization/organization.js +++ b/src/main/webapp/assets/modular/system/organization/organization.js @@ -1,16 +1,40 @@ -layui.use(['table', 'form', 'func', 'HttpRequest', 'xmSelect', 'util'], function () { +layui.use(['table', 'form', 'func', 'HttpRequest', 'tree', 'util'], function () { var $ = layui.$; var table = layui.table; var form = layui.form; var func = layui.func; var HttpRequest = layui.HttpRequest; var xmSelect = layui.xmSelect; + var tree = layui.tree; // 职位表管理 var Organization = { tableId: "organizationTable" }; + + /* 渲染树形 */ + function renderTree() { + $.get(Feng.ctxPath + '/hrOrganization/treeLayui', function (data) { + tree.render({ + elem: '#organizationTree', + onlyIconControl: true, + data: data.data, + click: function (rest) { + $('#organizationTree').find('.ew-tree-click').removeClass('ew-tree-click'); + $(rest.elem).children('.layui-tree-entry').addClass('ew-tree-click'); + table.reload(Organization.tableId, { + where: {organizationId: rest.data.id}, + page: {curr: 1} + }); + } + }); + $('#organizationTree').find('.layui-tree-entry:first>.layui-tree-main>.layui-tree-txt').trigger('click'); + }); + } + + renderTree(); + // 初始化表格的列 Organization.initColumn = function () { return [[ @@ -40,7 +64,7 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'xmSelect', 'util'], function func.open({ height: 800, title: '添加机构', - content: Feng.ctxPath + '/hrOrganization/addView', + content: Feng.ctxPath + '/organization/addView', tableId: Organization.tableId }); }; @@ -68,24 +92,29 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'xmSelect', 'util'], function // 点击删除 Organization.delete = function (data) { var operation = function () { - ajaxUtil.post(Feng.ctxPath + "/hrOrganization/delete", {"orgId":data.positionId},function (data) { + var httpRequest = new HttpRequest(Feng.ctxPath + "/hrOrganization/delete", 'post', function (data) { Feng.success("删除成功!"); table.reload(Organization.tableId); - },function (data) { + }, function (data) { Feng.error("删除失败!" + data.responseJSON.message + "!"); }); + httpRequest.set(data); + httpRequest.start(true); }; Feng.confirm("是否删除?", operation); }; // 修改职位状态 - Organization.updateStatus = function (positionId, checked) { - ajaxUtil.post(Feng.ctxPath + "/hrOrganization/updateStatus", {"orgId":positionId,"statusFlag":checked},function (data) { - Feng.success("修改成功!"); - },function (data) { - Feng.error("修改失败!" + data.responseJSON.message); + Organization.updateStatus = function (orgId, checked) { + var httpRequest = new HttpRequest(Feng.ctxPath + "/hrOrganization/updateStatus", 'post', function (data) { table.reload(Organization.tableId); + Feng.success("修改成功!"); + }, function (data) { + table.reload(Organization.tableId); + Feng.error("修改失败!" + data.responseJSON.message); }); + httpRequest.set({"orgId": orgId, "statusFlag": checked}); + httpRequest.start(true); }; // 渲染表格 @@ -128,8 +157,8 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'xmSelect', 'util'], function // 修改状态 form.on('switch(status)', function (obj) { - var positionId = obj.elem.value; + var orgId = obj.elem.value; var checked = obj.elem.checked ? 1 : 2; - Organization.updateStatus(positionId, checked); + Organization.updateStatus(orgId, checked); }); }); diff --git a/src/main/webapp/assets/modular/system/organization/organization_add.js b/src/main/webapp/assets/modular/system/organization/organization_add.js index c20142be..dd47fac2 100644 --- a/src/main/webapp/assets/modular/system/organization/organization_add.js +++ b/src/main/webapp/assets/modular/system/organization/organization_add.js @@ -1,10 +1,38 @@ -layui.use(['form', 'admin', 'HttpRequest'], function () { +layui.use(['form', 'admin', 'HttpRequest', 'xmSelect'], function () { + var $ = layui.$; var form = layui.form; var admin = layui.admin; var HttpRequest = layui.HttpRequest; + var xmSelect = layui.xmSelect; + var insXmSel; + + /* 渲染树形 */ + function renderTree() { + $.get(Feng.ctxPath + '/hrOrganization/treeLayui', function (data) { + insXmSel = xmSelect.render({ + el: '#organizationEditParentSel', + height: '250px', + data: data.data, + model: {label: {type: 'text'}}, + prop: {name: 'title', value: 'id'}, + radio: true, + clickClose: true, + tree: { + show: true, + indent: 15, + strict: false, + expandedKeys: true + } + }); + }); + } + + renderTree(); //表单提交事件 form.on('submit(btnSubmit)', function (data) { + //获取机构id + data.field.orgParentId = insXmSel.getValue('valueStr'); var request = new HttpRequest(Feng.ctxPath + "/hrOrganization/add", 'post', function (data) { admin.closeThisDialog(); Feng.success("添加成功!"); diff --git a/src/main/webapp/assets/modular/system/organization/organization_edit.js b/src/main/webapp/assets/modular/system/organization/organization_edit.js index 07d57bf9..1ace2dda 100644 --- a/src/main/webapp/assets/modular/system/organization/organization_edit.js +++ b/src/main/webapp/assets/modular/system/organization/organization_edit.js @@ -1,16 +1,45 @@ -layui.use(['form', 'admin', 'HttpRequest'], function () { +layui.use(['form', 'admin', 'HttpRequest', 'xmSelect'], function () { + var $ = layui.$; var form = layui.form; var admin = layui.admin; var HttpRequest = layui.HttpRequest; + var xmSelect = layui.xmSelect; + var insXmSel; //获取信息详情填充表单 var request = new HttpRequest(Feng.ctxPath + "/hrOrganization/detail?orgId=" + Feng.getUrlParam("orgId"), 'get'); var result = request.start(); - console.log(result); + form.val('organizationForm', result.data); + renderTree(result.data.orgParentId); + + /* 渲染树形 */ + function renderTree(orgParentId) { + $.get(Feng.ctxPath + '/hrOrganization/treeLayui', function (data) { + insXmSel = xmSelect.render({ + el: '#organizationEditParentSel', + height: '250px', + data: data.data, + initValue: [orgParentId], + model: {label: {type: 'text'}}, + prop: {name: 'title', value: 'id'}, + radio: true, + clickClose: true, + tree: { + show: true, + indent: 15, + strict: false, + expandedKeys: true + } + }); + }); + } //表单提交事件 form.on('submit(btnSubmit)', function (data) { + //获取机构id + data.field.orgParentId = insXmSel.getValue('valueStr'); + var request = new HttpRequest(Feng.ctxPath + "/hrOrganization/edit", 'post', function (data) { admin.closeThisDialog(); Feng.success("修改成功!"); diff --git a/src/main/webapp/assets/modular/system/position/position.js b/src/main/webapp/assets/modular/system/position/position.js index 6825c352..e8a7bc01 100644 --- a/src/main/webapp/assets/modular/system/position/position.js +++ b/src/main/webapp/assets/modular/system/position/position.js @@ -93,10 +93,11 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'util'], function () { // 修改职位状态 Position.updateStatus = function (positionId, checked) { var httpRequest = new HttpRequest(Feng.ctxPath + "/hrPosition/updateStatus", 'post', function (data) { + table.reload(Position.tableId); Feng.success("修改成功!"); }, function (data) { - Feng.error("修改失败!" + data.responseJSON.message); table.reload(Position.tableId); + Feng.error("修改失败!" + data.responseJSON.message); }); httpRequest.set({"positionId": positionId, "statusFlag": checked}); httpRequest.start(true); diff --git a/src/main/webapp/pages/modular/system/organization/organization.html b/src/main/webapp/pages/modular/system/organization/organization.html index 991bcd18..e3312a37 100644 --- a/src/main/webapp/pages/modular/system/organization/organization.html +++ b/src/main/webapp/pages/modular/system/organization/organization.html @@ -10,18 +10,18 @@
- - - - - - - - - - - - + + + + + + + + + + + +
@@ -56,6 +56,6 @@ @} \ No newline at end of file diff --git a/src/main/webapp/pages/modular/system/organization/organization_add.html b/src/main/webapp/pages/modular/system/organization/organization_add.html index a10f3988..84a301ce 100644 --- a/src/main/webapp/pages/modular/system/organization/organization_add.html +++ b/src/main/webapp/pages/modular/system/organization/organization_add.html @@ -6,8 +6,14 @@
基本信息
- + +
+ +
+
+
+
@@ -27,9 +33,9 @@
- +
- +
diff --git a/src/main/webapp/pages/modular/system/organization/organization_edit.html b/src/main/webapp/pages/modular/system/organization/organization_edit.html index 50f692c0..dac43016 100644 --- a/src/main/webapp/pages/modular/system/organization/organization_edit.html +++ b/src/main/webapp/pages/modular/system/organization/organization_edit.html @@ -6,8 +6,14 @@
基本信息
- + +
+ +
+
+
+
@@ -27,9 +33,9 @@
- +
- +
From dc3c6888689a3a8b78ea762df2424cdaa1e13061 Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Thu, 7 Jan 2021 19:27:11 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E3=80=90hr=5Forganization=E3=80=91?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E8=B0=83=E6=95=B4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OrganizationViewController.java | 8 ++--- .../position/PositionViewController.java | 8 ++--- .../system/organization/organization.js | 4 +-- .../modular/system/position/position.js | 5 ++-- .../system/organization/organization.html | 2 +- .../modular/system/position/position.html | 29 +------------------ 6 files changed, 14 insertions(+), 42 deletions(-) diff --git a/src/main/java/cn/stylefeng/guns/modular/organization/OrganizationViewController.java b/src/main/java/cn/stylefeng/guns/modular/organization/OrganizationViewController.java index 3a8ff30b..07ff9598 100644 --- a/src/main/java/cn/stylefeng/guns/modular/organization/OrganizationViewController.java +++ b/src/main/java/cn/stylefeng/guns/modular/organization/OrganizationViewController.java @@ -13,7 +13,7 @@ import org.springframework.stereotype.Controller; */ @Controller @Slf4j -@ApiResource(name = "职位管理相关的界面渲染", path = "organization") +@ApiResource(name = "职位管理相关的界面渲染", path = "/view/organization") public class OrganizationViewController { private String PREFIX = "/modular/system/organization"; @@ -24,7 +24,7 @@ public class OrganizationViewController { * @author chenjinlong * @date 2020/11/04 11:07 */ - @GetResource(name = "机构管理-首页-视图", path = "", requiredPermission = false, requiredLogin = false) + @GetResource(name = "机构管理-首页-视图", path = "") public String indexView() { return PREFIX + "/organization.html"; } @@ -35,7 +35,7 @@ public class OrganizationViewController { * @author chenjinlong * @date 2020/11/04 11:07 */ - @GetResource(name = "机构管理—新增-视图", path = "/addView", requiredPermission = false, requiredLogin = false) + @GetResource(name = "机构管理—新增-视图", path = "/addView") public String addView() { return PREFIX + "/organization_add.html"; } @@ -46,7 +46,7 @@ public class OrganizationViewController { * @author chenjinlong * @date 2020/11/04 11:07 */ - @GetResource(name = "机构管理-修改-视图", path = "editView", requiredPermission = false, requiredLogin = false) + @GetResource(name = "机构管理-修改-视图", path = "editView") public String editView() { return PREFIX + "/organization_edit.html"; } diff --git a/src/main/java/cn/stylefeng/guns/modular/position/PositionViewController.java b/src/main/java/cn/stylefeng/guns/modular/position/PositionViewController.java index 77d12452..b733de82 100644 --- a/src/main/java/cn/stylefeng/guns/modular/position/PositionViewController.java +++ b/src/main/java/cn/stylefeng/guns/modular/position/PositionViewController.java @@ -13,7 +13,7 @@ import org.springframework.stereotype.Controller; */ @Controller @Slf4j -@ApiResource(name = "职位管理相关的界面渲染", path = "position") +@ApiResource(name = "职位管理相关的界面渲染", path = "/view/position") public class PositionViewController { private String PREFIX = "/modular/system/position"; @@ -24,7 +24,7 @@ public class PositionViewController { * @author chenjinlong * @date 2020/11/04 11:07 */ - @GetResource(name = "职位管理-首页-视图", path = "", requiredPermission = false, requiredLogin = false) + @GetResource(name = "职位管理-首页-视图", path = "") public String indexView() { return PREFIX + "/position.html"; } @@ -35,7 +35,7 @@ public class PositionViewController { * @author chenjinlong * @date 2020/11/04 11:07 */ - @GetResource(name = "职位管理-首页-视图", path = "/addView", requiredPermission = false, requiredLogin = false) + @GetResource(name = "职位管理-首页-视图", path = "/addView") public String addView() { return PREFIX + "/position_add.html"; } @@ -46,7 +46,7 @@ public class PositionViewController { * @author chenjinlong * @date 2020/11/04 11:07 */ - @GetResource(name = "职位管理-首页-视图", path = "editView", requiredPermission = false, requiredLogin = false) + @GetResource(name = "职位管理-首页-视图", path = "editView") public String editView() { return PREFIX + "/position_edit.html"; } diff --git a/src/main/webapp/assets/modular/system/organization/organization.js b/src/main/webapp/assets/modular/system/organization/organization.js index e7dc22fe..624c6510 100644 --- a/src/main/webapp/assets/modular/system/organization/organization.js +++ b/src/main/webapp/assets/modular/system/organization/organization.js @@ -64,7 +64,7 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'tree', 'util'], function () func.open({ height: 800, title: '添加机构', - content: Feng.ctxPath + '/organization/addView', + content: Feng.ctxPath + '/view/organization/addView', tableId: Organization.tableId }); }; @@ -74,7 +74,7 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'tree', 'util'], function () func.open({ height: 800, title: '修改机构', - content: Feng.ctxPath + '/organization/editView?orgId=' + data.orgId, + content: Feng.ctxPath + '/view/organization/editView?orgId=' + data.orgId, tableId: Organization.tableId }); }; diff --git a/src/main/webapp/assets/modular/system/position/position.js b/src/main/webapp/assets/modular/system/position/position.js index e8a7bc01..b6456195 100644 --- a/src/main/webapp/assets/modular/system/position/position.js +++ b/src/main/webapp/assets/modular/system/position/position.js @@ -50,7 +50,7 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'util'], function () { func.open({ height: 800, title: '添加职位', - content: Feng.ctxPath + '/position/addView', + content: Feng.ctxPath + '/view/position/addView', tableId: Position.tableId }); }; @@ -60,7 +60,7 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'util'], function () { func.open({ height: 800, title: '修改职位', - content: Feng.ctxPath + '/position/editView?positionId=' + data.positionId, + content: Feng.ctxPath + '/view/position/editView?positionId=' + data.positionId, tableId: Position.tableId }); }; @@ -139,7 +139,6 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'util'], function () { } else if (event === 'delete') { Position.delete(data); } - dropdown.hideAll(); }); // 修改状态 diff --git a/src/main/webapp/pages/modular/system/organization/organization.html b/src/main/webapp/pages/modular/system/organization/organization.html index e3312a37..5c941eeb 100644 --- a/src/main/webapp/pages/modular/system/organization/organization.html +++ b/src/main/webapp/pages/modular/system/organization/organization.html @@ -1,7 +1,7 @@ @layout("/layout/_container.html",{js:["/assets/modular/system/organization/organization.js"]}){
- 职位表管理 + 机构管理
diff --git a/src/main/webapp/pages/modular/system/position/position.html b/src/main/webapp/pages/modular/system/position/position.html index 8af25b38..7730cb59 100644 --- a/src/main/webapp/pages/modular/system/position/position.html +++ b/src/main/webapp/pages/modular/system/position/position.html @@ -1,7 +1,7 @@ @layout("/layout/_container.html",{js:["/assets/modular/system/position/position.js"]}){
- 职位表管理 + 职位管理
@@ -14,23 +14,10 @@
- - -
- - - - - - - - - -
@@ -44,20 +31,6 @@ @} \ No newline at end of file diff --git a/src/main/webapp/pages/modular/system/user/user_add.html b/src/main/webapp/pages/modular/system/user/user_add.html index 8a84550b..d6e4347c 100644 --- a/src/main/webapp/pages/modular/system/user/user_add.html +++ b/src/main/webapp/pages/modular/system/user/user_add.html @@ -3,55 +3,55 @@
-
${lang.get("TITLE_BASE_INFO","基本信息")}
+
基本信息
- +
- +
- +
- +
- +
- +
- +
- +
@@ -60,18 +60,18 @@
-
${lang.get("TITLE_DUTY_INFO","职务信息")}
+
职务信息
- +
- +
-
- +
+
- + +
+
+
+ +
+
- +
- +
- +
- +
@@ -42,18 +48,18 @@
-
${lang.get("TITLE_DUTY_INFO","职务信息")}
+
职务信息
- +
- +
@@ -64,8 +70,8 @@
- - + +