From d30a93ef34ff983415cd52f6c9203405c354cb37 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Wed, 16 Nov 2022 23:11:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=A2=E9=98=9F=E6=A8=A1=E6=9D=BF=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/teamTemplate/teamTemplateAdd.js | 68 ++++++++++ .../js/teamTemplate/teamTemplateEdit.js | 86 +++++++++++++ .../js/teamTemplate/teamTemplateList.js | 116 ++++++++++++++++++ .../tpl/teamTemplate/teamTemplateAdd.html | 96 +++++++++++++++ .../tpl/teamTemplate/teamTemplateEdit.html | 65 ++++++++++ .../tpl/teamTemplate/teamTemplateList.html | 34 +++++ .../template/json/skyeyeClassEnum.json | 43 ++----- .../template/json/teamObjectLink.json | 5 + 8 files changed, 480 insertions(+), 33 deletions(-) create mode 100644 common/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js create mode 100644 common/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js create mode 100644 common/src/main/resources/template/js/teamTemplate/teamTemplateList.js create mode 100644 common/src/main/resources/template/tpl/teamTemplate/teamTemplateAdd.html create mode 100644 common/src/main/resources/template/tpl/teamTemplate/teamTemplateEdit.html create mode 100644 common/src/main/resources/template/tpl/teamTemplate/teamTemplateList.html create mode 100644 web/src/main/resources/template/json/teamObjectLink.json diff --git a/common/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js b/common/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js new file mode 100644 index 000000000..245e728f7 --- /dev/null +++ b/common/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js @@ -0,0 +1,68 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'jquery', 'winui', 'textool'], function (exports) { + winui.renderColor(); + layui.use(['form'], function (form) { + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$, + textool = layui.textool; + textool.init({eleId: 'remark', maxlength: 200}); + + skyeyeClassEnumUtil.showEnumDataListByClassName("teamObjectType", 'select', "objectType", '', form); + skyeyeClassEnumUtil.showEnumDataListByClassName("commonEnable", 'radio', "enabled", '', form); + + loadAuthList(); + form.on('select(objectType)', function(data) { + loadAuthList(); + }); + + matchingLanguage(); + form.render(); + form.on('submit(formAddBean)', function (data) { + if (winui.verifyForm(data.elem)) { + var params = { + dictName: $("#dictName").val(), + dictCode: $("#dictCode").val(), + enabled: $("#enabled input:radio:checked").val(), + remark: $("#remark").val(), + }; + AjaxPostUtil.request({url: reqBasePath + "writeDictTypeMation", params: params, type: 'json', method: "POST", callback: function (json) { + parent.layer.close(index); + parent.refreshCode = '0'; + }}); + } + return false; + }); + + function loadAuthList() { + var objectType = $('#objectType').val(); + if (isNull(objectType)) { + $('#authList').html(''); + } else { + jsGetJsonFile("../../json/teamObjectLink.json", function(data) { + var authStrList = data[objectType]; + var str = ``; + $.each(authStrList, function(i, item) { + var bean = { + key: item, + name: skyeyeClassEnum[item].name + }; + var authBtnJson = skyeyeClassEnumUtil.getEnumDataListByClassName(item); + authBtnJson["bean"] = bean; + str += getDataUseHandlebars($('#authTableTemplate').html(), {json: authBtnJson}); + }); + $('#authList').html(str); + }); + } + form.render(); + } + + $("body").on("click", "#cancle", function() { + parent.layer.close(index); + }); + }); +}); \ No newline at end of file diff --git a/common/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js b/common/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js new file mode 100644 index 000000000..55b2a8097 --- /dev/null +++ b/common/src/main/resources/template/js/teamTemplate/teamTemplateEdit.js @@ -0,0 +1,86 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'jquery', 'winui', 'textool'], function (exports) { + winui.renderColor(); + layui.use(['form'], function (form) { + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$, + textool = layui.textool; + + showGrid({ + id: "showForm", + url: reqBasePath + "queryDictTypeMationById", + params: {id: parent.rowId}, + pagination: false, + method: "GET", + template: $("#showTemplate").html(), + ajaxSendLoadBefore: function(hdb, json){ + json.bean.remark = stringManipulation.textAreaShow(json.bean.remark); + }, + ajaxSendAfter: function (json) { + + skyeyeClassEnumUtil.showEnumDataListByClassName("commonEnable", 'radio', "enabled", json.bean.enabled, form); + + form.on('radio(dictType)', function (data) { + var val = data.value; + if (val == 1) { + $("#chooseLevel").parent().parent().remove(); + } else if (val == 2) { + $("#dictTypeBox").after( + `
+ +
+ +
例如:多级字典为三级,这里设置为2,那么只有二级和二级的所有子层级可以选择
+
+
`); + } + }); + + if (json.bean.dictType == 2) { + $("#dictTypeBox").after( + `
+ +
+ +
例如:多级字典为三级,这里设置为2,那么只有二级和二级的所有子层级可以选择
+
+
`); + } + $("input:radio[name=dictType][value=" + json.bean.dictType + "]").attr("checked", true); + + textool.init({eleId: 'remark', maxlength: 200}); + + matchingLanguage(); + form.render(); + form.on('submit(formEditBean)', function (data) { + if (winui.verifyForm(data.elem)) { + var dictType = $("input[name='dictType']:checked").val(); + var params = { + id: parent.rowId, + dictName: $("#dictName").val(), + dictCode: $("#dictCode").val(), + enabled: $("#enabled input:radio:checked").val(), + dictType: dictType, + chooseLevel: dictType == 1 ? 1 : $('#chooseLevel').val(), + remark: $("#remark").val(), + }; + AjaxPostUtil.request({url: reqBasePath + "writeDictTypeMation", params: params, type: 'json', method: "POST", callback: function (json) { + parent.layer.close(index); + parent.refreshCode = '0'; + }}); + } + return false; + }); + } + }); + + $("body").on("click", "#cancle", function() { + parent.layer.close(index); + }); + }); +}); \ No newline at end of file diff --git a/common/src/main/resources/template/js/teamTemplate/teamTemplateList.js b/common/src/main/resources/template/js/teamTemplate/teamTemplateList.js new file mode 100644 index 000000000..e75f255e5 --- /dev/null +++ b/common/src/main/resources/template/js/teamTemplate/teamTemplateList.js @@ -0,0 +1,116 @@ + +var rowId = ""; + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) { + winui.renderColor(); + var $ = layui.$, + form = layui.form, + table = layui.table; + + authBtn('1656731571539'); + + table.render({ + id: 'messageTable', + elem: '#messageTable', + method: 'post', + url: reqBasePath + 'queryTeamTemplate', + where: getTableParams(), + even: true, + page: true, + limits: getLimits(), + limit: getLimit(), + cols: [[ + { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, + { field: 'name', title: '名称', width: 200 }, + { field: 'objectType', title: '适用类型', width: 150, templet: function (d) { + return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("teamObjectType", 'id', d.objectType, 'name'); + }}, + { field: 'enabled', title: '状态', align: 'center', width: 100, templet: function (d) { + return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("commonEnable", 'id', d.enabled, 'name'); + }}, + { field: 'isUsed', title: '使用状态', align: 'center', width: 100, templet: function (d) { + return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("isUsed", 'id', d.isUsed, 'name'); + }}, + { field: 'remark', title: '备注', width: 300 }, + { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 }, + { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, + { field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 }, + { field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 }, + { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 180, toolbar: '#tableBar' } + ]], + done: function(json) { + matchingLanguage(); + initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入名称,编码", function () { + table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); + }); + } + }); + + table.on('tool(messageTable)', function (obj) { + var data = obj.data; + var layEvent = obj.event; + if (layEvent === 'del') { // 删除 + del(data, obj); + } else if (layEvent === 'edit') { // 编辑 + edit(data); + } + }); + + // 删除 + function del(data, obj) { + layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) { + layer.close(index); + AjaxPostUtil.request({url: reqBasePath + "deleteTeamTemplateById", params: {id: data.id}, type: 'json', method: "DELETE", callback: function (json) { + winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); + loadTable(); + }}); + }); + } + + // 编辑 + function edit(data) { + rowId = data.id; + _openNewWindows({ + url: "../../tpl/teamTemplate/teamTemplateEdit.html", + title: systemLanguage["com.skyeye.editPageTitle"][languageType], + pageId: "teamTemplateEdit", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); + loadTable(); + }}); + } + + // 新增 + $("body").on("click", "#addBean", function() { + _openNewWindows({ + url: "../../tpl/teamTemplate/teamTemplateAdd.html", + title: systemLanguage["com.skyeye.addPageTitle"][languageType], + pageId: "teamTemplateAdd", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); + loadTable(); + }}); + }); + + form.render(); + $("body").on("click", "#reloadTable", function() { + loadTable(); + }); + + function loadTable() { + table.reloadData("messageTable", {where: getTableParams()}); + } + + function getTableParams() { + return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable")); + } + + exports('teamTemplateList', {}); +}); diff --git a/common/src/main/resources/template/tpl/teamTemplate/teamTemplateAdd.html b/common/src/main/resources/template/tpl/teamTemplate/teamTemplateAdd.html new file mode 100644 index 000000000..749857db8 --- /dev/null +++ b/common/src/main/resources/template/tpl/teamTemplate/teamTemplateAdd.html @@ -0,0 +1,96 @@ + + + + + + + + + +
+
+
+ 基本信息
+
+
+ +
+ +
团队名称不能重复。
+
+
+
+ +
+ +
+
+
+ +
+
+
+
+ +
+ +
+
+
+ 成员信息
+
+ +
+ 权限信息
+
+
+ +
+
+
+ + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/common/src/main/resources/template/tpl/teamTemplate/teamTemplateEdit.html b/common/src/main/resources/template/tpl/teamTemplate/teamTemplateEdit.html new file mode 100644 index 000000000..a57fbbbe6 --- /dev/null +++ b/common/src/main/resources/template/tpl/teamTemplate/teamTemplateEdit.html @@ -0,0 +1,65 @@ + + + + + + + + + +
+
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/common/src/main/resources/template/tpl/teamTemplate/teamTemplateList.html b/common/src/main/resources/template/tpl/teamTemplate/teamTemplateList.html new file mode 100644 index 000000000..fcadb379b --- /dev/null +++ b/common/src/main/resources/template/tpl/teamTemplate/teamTemplateList.html @@ -0,0 +1,34 @@ + + + + + + + + + +
+
+ + +
+
+
+
+ +
+ + + + + + \ No newline at end of file diff --git a/web/src/main/resources/template/json/skyeyeClassEnum.json b/web/src/main/resources/template/json/skyeyeClassEnum.json index b61099ddc..272a7f56e 100644 --- a/web/src/main/resources/template/json/skyeyeClassEnum.json +++ b/web/src/main/resources/template/json/skyeyeClassEnum.json @@ -1,22 +1,10 @@ { - "commonEnable": { - "name": "启用/禁用", - "className": "skyeye-pro#com.skyeye.common.enumeration.EnableEnum" - }, - "commonIsDefault": { - "name": "是否默认", - "className": "skyeye-pro#com.skyeye.common.enumeration.IsDefaultEnum" - }, - - "verificationParams": { - "name": "字段校验枚举", - "className": "skyeye-pro#com.skyeye.common.enumeration.VerificationParamsEnum" - }, + "commonEnable": {"name": "启用/禁用", "className": "skyeye-pro#com.skyeye.common.enumeration.EnableEnum"}, + "commonIsDefault": {"name": "是否默认", "className": "skyeye-pro#com.skyeye.common.enumeration.IsDefaultEnum"}, + "verificationParams": {"name": "字段校验枚举", "className": "skyeye-pro#com.skyeye.common.enumeration.VerificationParamsEnum"}, + "isUsed": {"name": "是否使用的枚举", "className": "skyeye-pro#com.skyeye.common.enumeration.IsUsedEnum"}, - "bossInterviewArrangementState": { - "name": "面试安排状态枚举类", - "className": "skyeye-flowable#com.skyeye.service.enumclass.BossInterviewArrangementState" - }, + "bossInterviewArrangementState": {"name": "面试安排状态枚举类", "className": "skyeye-flowable#com.skyeye.service.enumclass.BossInterviewArrangementState"}, "bossInterviewArrangementState1": { "name": "面试安排状态枚举类-获取我录入的人员需求关联的面试者信息列表", "className": "skyeye-flowable#com.skyeye.service.enumclass.BossInterviewArrangementState", @@ -30,23 +18,12 @@ "filterValue": "3,4,5" }, - "materialFromType": { - "name": "商品来源类型枚举类", - "className": "skyeye-flowable#com.skyeye.material.enumclass.MaterialFromType" - }, - "materialType": { - "name": "商品类型枚举类", - "className": "skyeye-flowable#com.skyeye.material.enumclass.MaterialType" - }, + "materialFromType": {"name": "商品来源类型枚举类", "className": "skyeye-flowable#com.skyeye.material.enumclass.MaterialFromType"}, + "materialType": {"name": "商品类型枚举类", "className": "skyeye-flowable#com.skyeye.material.enumclass.MaterialType"}, - "skyeyeView": { - "name": "视图枚举", - "className": "skyeye-pro#com.skyeye.common.SkyeyeViewEnum" - }, + "skyeyeView": {"name": "视图枚举", "className": "skyeye-pro#com.skyeye.common.SkyeyeViewEnum"}, - "teamObjectType": { - "name": "团队适用对象枚举", - "className": "skyeye-pro#com.skyeye.team.classenum.TeamObjectTypeEnum" - } + "teamObjectType": {"name": "团队适用对象枚举", "className": "skyeye-pro#com.skyeye.team.classenum.TeamObjectTypeEnum"}, + "contactsAuthEnum": {"name": "联系人", "className": "skyeye-pro#com.skyeye.contacts.classenum.ContactsAuthEnum"} } \ No newline at end of file diff --git a/web/src/main/resources/template/json/teamObjectLink.json b/web/src/main/resources/template/json/teamObjectLink.json new file mode 100644 index 000000000..c47c11401 --- /dev/null +++ b/web/src/main/resources/template/json/teamObjectLink.json @@ -0,0 +1,5 @@ +{ + "1": ["contactsAuthEnum"], + "2": ["contactsAuthEnum"], + "3": [] +} \ No newline at end of file -- GitLab