From 10f1ccadacf78ecb2aa84a7b9af329abca7f7bc0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Nov 2022 13:27:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=AE=A1=E7=90=86=E7=9A=84?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=88=90=E5=91=98=E5=A2=9E=E5=8A=A0=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E5=80=BC=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../x_component_Org/$List/default/css.wcss | 33 ++++++++ o2web/source/x_component_Org/UnitExplorer.js | 82 ++++++++++++++++++- o2web/source/x_component_Org/lp/en.js | 1 + o2web/source/x_component_Org/lp/zh-cn.js | 1 + 4 files changed, 114 insertions(+), 3 deletions(-) diff --git a/o2web/source/x_component_Org/$List/default/css.wcss b/o2web/source/x_component_Org/$List/default/css.wcss index 8fa911cd33..f2ff6179b7 100644 --- a/o2web/source/x_component_Org/$List/default/css.wcss +++ b/o2web/source/x_component_Org/$List/default/css.wcss @@ -120,5 +120,38 @@ "line-height": "normal", "color":"#333", "border-radius":"3px" + }, + "okActionNode": { + "background": "url(../x_component_Org/$Explorer/default/icon/mainid.png) 5px center no-repeat", + "background-size": "12px", + "float": "right", + "cursor": "pointer", + "margin-top": "0px", + "margin-left": "5px", + "padding": "3px 5px", + "padding-left": "22px", + "font-size": "12px", + "font-weight": "normal", + "border": "1px solid #666", + "background-color": "#FFF", + "line-height": "normal", + "color":"#333", + "border-radius":"3px" + }, + "cancelActionNode": { + // "background": "url(../x_component_Org/$List/default/icon/order.png) 3px center no-repeat", + "float": "right", + "cursor": "pointer", + "margin-top": "0px", + "margin-left": "5px", + "padding": "3px 5px", + // "padding-left": "22px", + "font-size": "12px", + "font-weight": "normal", + "border": "1px solid #666", + "background-color": "#FFF", + "line-height": "normal", + "color":"#333", + "border-radius":"3px" } } \ No newline at end of file diff --git a/o2web/source/x_component_Org/UnitExplorer.js b/o2web/source/x_component_Org/UnitExplorer.js index cb1a30d822..e6cfdbecb7 100644 --- a/o2web/source/x_component_Org/UnitExplorer.js +++ b/o2web/source/x_component_Org/UnitExplorer.js @@ -771,6 +771,12 @@ MWF.xApplication.Org.UnitExplorer.UnitContent = new Class({ }, _listIdentityMembers: function(){ var _self = this; + + if(this.identityMemberList){ + this.identityMemberList.clear(); + } + this.personMemberContentNode.empty(); + this.identityMemberList = new MWF.xApplication.Org.List(this.personMemberContentNode, this, { "action": _self.getIdentityActionPermission(), "canEdit": false, @@ -794,7 +800,7 @@ MWF.xApplication.Org.UnitExplorer.UnitContent = new Class({ "get": function(){return this.woPerson.mail} }, { "getHtml": function(){ - return "
"; }, "events": { @@ -826,6 +832,11 @@ MWF.xApplication.Org.UnitExplorer.UnitContent = new Class({ this.sortAction.addEvent("click", function (e) { _self.sortByPinYin(e) }) + + this.sortByManualAction = new Element("div", {"styles": this.css.sortActionNode, "text": _self.explorer.app.lp.sortByManual}).inject(this.actionNode); + this.sortByManualAction.addEvent("click", function (e) { + _self.sortByManual(e) + }) } } }); @@ -836,13 +847,78 @@ MWF.xApplication.Org.UnitExplorer.UnitContent = new Class({ {"style": "", "text": this.explorer.app.lp.personEmployee}, {"style": "", "text": this.explorer.app.lp.personMobile}, {"style": "", "text": this.explorer.app.lp.personMail}, - {"style": "width: 10px", "text": ""}, - {"style": "width: 10px", "text": ""} + {"style": "width: 100px", "text": ""}, + {"style": "width: 100px", "text": ""} ]); this.data.woSubDirectIdentityList.each(function(id){ var item = this.identityMemberList.push(id); }.bind(this)); }, + sortByManual: function(){ + var _self = this; + if(this.identityMemberList)this.identityMemberList.clear(); + this.identityMemberList = null; + this.personMemberContentNode.empty(); + + this.identitySortList = new MWF.xApplication.Org.List(this.personMemberContentNode, this, { + "action": false, + "canEdit": false, + "attr": [{ + "getHtml": function(){ + var src = _self.explorer.actions.getPersonIcon(this.woPerson.id); + return "
"; + }, + "set": function(){} + }, { + "get": function(){return this.woPerson.name} + }, { + "get": function(){return this.woPerson.employee} + }, { + "get": function(){return this.woPerson.mobile} + }, { + "get": function(){return this.woPerson.mail} + }, { + "getHtml": function(){ + return ""; + } + }] + }); + this.identitySortList.loadAction = function(){ + this.actionAreaNode = new Element("div", {"styles": this.css.actionAreaNode}).inject(this.contentNode, "top"); + this.actionNode = new Element("div", {"styles": this.css.actionNode}).inject(this.actionAreaNode); + this.sortCancelAction = new Element("div", {"styles": this.css.cancelActionNode, "text": _self.explorer.app.lp.cancel}).inject(this.actionNode); + this.sortCancelAction.addEvent("click", function (e) { + _self._listIdentityMembers(e) + }) + + this.sortOkAction = new Element("div", {"styles": this.css.okActionNode, "text": _self.explorer.app.lp.ok}).inject(this.actionNode); + this.sortOkAction.addEvent("click", function (e) { + var pList = []; + _self.identitySortList.items.each(function(item){ + item.data.orderNumber = item.tr.tr.getElement(".orderNumber").get("value").toInt(); + var p = o2.Actions.load("x_organization_assemble_control").IdentityAction.edit(item.data.id, item.data); + pList.push(p); + }) + Promise.all(pList).then(function () { + _self.data.woSubDirectIdentityList.sort(function(a, b){ + return a.orderNumber - b.orderNumber; + }) + _self._listIdentityMembers(e) + }) + }) + }; + this.identitySortList.load([ + {"style": "width: 30px", "text": ""}, + {"style": "width: 20%", "text": this.explorer.app.lp.personName}, + {"style": "", "text": this.explorer.app.lp.personEmployee}, + {"style": "", "text": this.explorer.app.lp.personMobile}, + {"style": "", "text": this.explorer.app.lp.personMail}, + {"style": "", "text": this.explorer.app.lp.orderNumber} + ]); + this.data.woSubDirectIdentityList.each(function(id){ + var item = this.identitySortList.push(id); + }.bind(this)); + }, sortByPinYin : function(e){ var _self = this; this.explorer.app.confirm("infor", e, this.explorer.app.lp.sortByPinYin, {"html": this.explorer.app.lp.sortByPinYinConfirmContent}, 300, 180, function(){ diff --git a/o2web/source/x_component_Org/lp/en.js b/o2web/source/x_component_Org/lp/en.js index 5465b72a6a..0a71e54093 100644 --- a/o2web/source/x_component_Org/lp/en.js +++ b/o2web/source/x_component_Org/lp/en.js @@ -24,6 +24,7 @@ MWF.xApplication.Org.LP = { "no": "No", "sortByPinYin" : "Sort by pinyin", "sortByPinYinConfirmContent" : "This operation will sort the identities in the organization according to pinyin, confirm the operation?", + "sortByManual": "Change the sort number ", "search": "Search", "searchText": "Input search keyword", diff --git a/o2web/source/x_component_Org/lp/zh-cn.js b/o2web/source/x_component_Org/lp/zh-cn.js index 4dead6c648..bc8e36ae78 100644 --- a/o2web/source/x_component_Org/lp/zh-cn.js +++ b/o2web/source/x_component_Org/lp/zh-cn.js @@ -24,6 +24,7 @@ MWF.xApplication.Org.LP = { "no": "否", "sortByPinYin" : "按拼音排序", "sortByPinYinConfirmContent" : "该操作将使本组织内身份按照拼音排序,确定操作?", + "sortByManual": "修改", "search": "搜索", "searchText": "请输入关键字", -- GitLab