(function(){"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.modelset&&(com.kingdee.bos.qing.modeler.modelset={});"undefined"==typeof com.kingdee.bos.qing.modeler.modelset.role&&(com.kingdee.bos.qing.modeler.modelset.role=
{});"undefined"==typeof com.kingdee.bos.qing.modeler.modelset.role.model&&(com.kingdee.bos.qing.modeler.modelset.role.model={});var K=com.kingdee.bos.qing.modeler.modelset.role.model;K.ModelSetRoleInfo=function(){var B=this,D,E,F,r;this.setModelSetRoleId=function(l){D=l};this.getModelSetRoleId=function(){return D};this.setModelSetId=function(l){E=l};this.getModelSetId=function(){return E};this.setModelSetRoleName=function(l){F=l};this.getModelSetRoleName=function(){return F};this.setIsCooper=function(l){r=
l};this.isCooper=function(){return r};this.fromJsonObject=function(l){B.setModelSetRoleId(l.modelSetRoleId);B.setModelSetId(l.modelSetId);B.setModelSetRoleName(l.modelSetRoleName)};this.toJsonObject=function(){var l={};l.modelSetRoleId=D;l.modelSetId=E;l.modelSetRoleName=F;return l}};K.ModelSetRoleUserInfo=function(){var B=this,D,E,F,r,l,f,t;this.setModelSetRoleUserId=function(e){D=e};this.getModelSetRoleUserId=function(){return D};this.setUserId=function(e){E=e};this.getUserId=function(){return E};
this.setUserName=function(e){F=e};this.getUserName=function(){return F};this.setModelSetRoleId=function(e){r=e};this.getModelSetRoleId=function(){return r};this.setJobId=function(e){l=e};this.getJobId=function(){return l};this.setIsCooper=function(e){f=e};this.isCooper=function(){return f};this.setColor=function(e){t=e};this.getColor=function(){return t};this.fromJsonObject=function(e){B.setModelSetRoleUserId(e.modelSetRoleUserId);B.setModelSetRoleId(e.modelSetRoleId);B.setUserId(e.userId);B.setUserName(e.userName);
B.setColor(e.color);B.setJobId(e.jobId)};this.toJsonObject=function(){var e={};e.modelSetRoleUserId=D;e.modelSetRoleId=r;e.userId=E;e.userName=F;e.color=t;return e}}})();(function(){function K(){F.call(this);var r;this.getRemoteUrl=function(){return r};this.setRemoteUrl=function(l){r=l}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.modelset&&(com.kingdee.bos.qing.modeler.modelset=
{});"undefined"==typeof com.kingdee.bos.qing.modeler.modelset.role&&(com.kingdee.bos.qing.modeler.modelset.role={});"undefined"==typeof com.kingdee.bos.qing.modeler.modelset.role.common&&(com.kingdee.bos.qing.modeler.modelset.role.common={});var B=com.kingdee.bos.qing.modeler.modelset.role.common;B.Facade=function(r,l,f,t){D.call(this,r,l,f,t);var e=this.protectedMethod;this.loadModelSetRole=function(y){e.remote("loadModelSetRole",{modelSetId:y})};this.saveOrUpdateModelSetRole=function(y,H){y={modelSetRoleInfo:JSON.stringify(y.toJsonObject()),
modelSetId:H};e.remote("saveOrUpdateModelSetRole",y)};this.deleteModelSetRole=function(y,H){e.remote("deleteModelSetRole",{modelSetRoleId:y,modelSetId:H})};this.loadUser=function(y){e.remote("loadUser",{modelSetRoleId:y})};this.addUser=function(y,H,N){y={arrUser:JSON.stringify(y),modelSetRoleId:H,modelSetId:N};e.remote("addUser",y)};this.deleteUser=function(y,H){e.remote("deleteUser",{modelSetRoleUserId:y,modelSetId:H})}};B.RemoteImpl=K;var D,E,F;(function(){var r=com.kingdee.bos.qing.framework.common;
D=r.AbstractFacade;E=r.AbstractIcons;F=r.AbstractRemoteCall})();B.Icons=new function(){E.call(this);var r=this.protectedMethod;this.protectedInit=function(f,t){f=com.kingdee.bos.qing.modeler.modelset.role.ComboIcon;if(!f)throw Error("com.kingdee.bos.qing.modeler.modelset.role.ComboIcon not found.");f.define(t,"model-common");t.setStartPosition(0,117);t.setIconSize(16,16);l(0,0,"btn-new-role");l(0,1,"btn-delete");l(0,2,"btn-edit");l(0,4,"icon-role");t.setStartPosition(0,337);t.setIconSize(56,56);r.registIcon(0,
0,"add-user");t.setStartPosition(5,151);t.setIconSize(170,98);r.registIcon(0,0,"no-role");t.setStartPosition(280,220);t.setIconSize(50,50);r.registIcon(0,0,"user-not-exist")};var l=function(f,t,e){r.registIcon(f+1,t,e);r.registIcon(f,t,e+"_hover")}};B.Integration=new function(){var r=new K,l;this.getRemoteImpl=function(){return r};this.setRemoteUrl=function(f){r.setRemoteUrl(f)};this.registerUserDialogSelector=function(f){l=f};this.getUserDialogSelector=function(){return l}}})();(function(){function K(a){var d,n,v,p,h=!0,c,m,g,q,I;this.getJqUi=function(){d||G();return d};this.setFunShowNoRoleUi=function(b){I=b};this.setUserShowArea=function(b){c=b};this.setFirstLoad=function(b){h=b};this.setArrRoleName=function(b){q=b};var G=function(){d=$("<li>");d.css("cursor","pointer");var b=$("<span>");b.addClass("modelset-role-item-icon");t.background(b,"icon-role");b.appendTo(d);b=a.getModelSetRoleName();n=$("<div>");n.addClass("modelset-role-item-name");n.text(b);n.attr("title",b);
n.appendTo(d);d.on("click",function(){d.hasClass("current-modelset-role-item")||(d.addClass("current-modelset-role-item").siblings().removeClass("current-modelset-role-item"),h?P():c.showUserCard())});a.isCooper()||(m=new N,m.setEnabled(!0),m.addBlurListener(O),m.addAcceptableListener(O),g=m.getJqUi(),g.css({position:"absolute",left:"32px",right:"100px",top:"8px",height:"16px"}),b=g.children(),b.css("vertical-align","top"),b.on("click",function(k){k&&k.stopPropagation()}),g.appendTo(d),g.hide(),b=
$("<div>"),b.attr("display","none"),b.appendTo(d),v=$("<span>"),t.backgroundWithHover(v,"btn-edit"),v.addClass("modelset-role-item-btn-edit"),v.on("click",Q),v.attr("title",f.get("editRole","\u7f16\u8f91\u89d2\u8272")),!M&&v.appendTo(b),v.hide(),p=$("<span>"),t.backgroundWithHover(p,"btn-delete"),p.addClass("modelset-role-item-btn-delete"),p.on("click",w),p.attr("title",f.get("deleteRole","\u5220\u9664\u89d2\u8272")),!M&&p.appendTo(b),p.hide());d.mouseenter(function(){p&&v&&(v.show(),p.show());d.css("background",
"#F6F7F9")}).mouseleave(function(){p&&v&&(v.hide(),p.hide());d.css("background","")})},P=function(){var b=C.createFacade(function(k){if(!M){var u=(new D).getJqUi();c.addCard(u);u.on("click",c.openUserForm)}u=[];for(var z=0;z<k.length;z++){var A=k[z],R=new y;R.fromJsonObject(A);u.push(R);A=new E(R);A.setUserShowArea(c);c.addCard(A.getJqUi())}c.setSelectedUser(u);c.setRoleId(a.getModelSetRoleId());c.showUserCard()});h=!1;b.loadUser(a.getModelSetRoleId())},Q=function(b){b&&b.stopPropagation();n.hide();
g.show();m.setText(n.text());m.requestFocus()},O=function(){var b=!0,k=m.getText().trim(),u=a.getModelSetRoleName();if(k&&50>=k.length){for(var z=0;z<q.length;z++)if(k===q[z]&&k!=u){b=!1;break}!1===b?(b=f.get("modelSetNameHasExist","\u89d2\u8272\u540d\u79f0\u5df2\u5b58\u5728\u3002"),C.getMessageCurtain().showPrompt(b,2E3)):k!=u&&(b=C.createFacade(function(A){if(0!=A){A=f.get("editRoleNameSuccess","\u4fee\u6539\u6a21\u578b\u96c6\u89d2\u8272\u6210\u529f\u3002");C.getMessageCurtain().showSuccess(A,2E3);
n.text(k);for(A=0;A<q.length;A++)if(q[A]===u){q[A]=k;break}n.attr("title",k)}else A=f.get("modelSetNameHasExist","\u89d2\u8272\u540d\u79f0\u5df2\u5b58\u5728\u3002"),C.getMessageCurtain().showPrompt(A,2E3),a.setModelSetRoleName(u)}),a.setModelSetRoleName(k),b.saveOrUpdateModelSetRole(a,L))}else 50<k.length&&(b=f.get("nameTooLong","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"),C.getMessageCurtain().showPrompt(b,2E3));g.hide();n.show()},w=function(b){b&&b.stopPropagation();
x().setClosingChecker(function(k){k===J.RETURN_OK&&C.createFacade(function(){for(var u=q.length;0<=u;u--)if(a.getModelSetRoleName()===q[u]){q.splice(u,1);break}d.hasClass("current-modelset-role-item")&&d.siblings().eq(0).trigger("click");d.remove();c.getJqUi().remove();I&&I();u=f.get("deleteModelSetRoleSuccess","\u5220\u9664\u6a21\u578b\u96c6\u89d2\u8272\u6210\u529f\u3002");C.getMessageCurtain().showSuccess(u,2E3)}).deleteModelSetRole(a.getModelSetRoleId(),L);return!0})},x=function(){var b=J.createFeedbackDialog();
b.setMsgImageType(J.MSG_DELETE);b.setOptionType(J.OPTION_OK_CANCEL);var k=f.get("comfirmToDeleteModelSetRole","\u5220\u9664\u6a21\u578b\u96c6\u89d2\u8272\u201c#1\u201d\u540e\u4f1a\u540c\u65f6\u79fb\u9664\u89d2\u8272\u4e0b\u7684\u7528\u6237\uff0c\u786e\u5b9a\u5220\u9664\u5417\uff1f");k=k.replace("#1",a.getModelSetRoleName());b.setMessage(k);b.showDialog();return b}}function B(){var a,d,n,v=this,p=[];(function(){d=new (l.getUserDialogSelector());d.setSelectedListener(function(c){if(h(c)){for(var m=
[],g=0;g<c.length;g++)c[g].setModelSetRoleId(n),m.push(c[g].toJsonObject());C.createFacade(function(q){a&&a.children(".user-card").remove();for(var I=0;I<q.length;I++){var G=new y;G.fromJsonObject(q[I]);G=new E(G);G.setUserShowArea(v);a.append(G.getJqUi())}q=f.get("addSuccess","\u6dfb\u52a0\u6210\u529f\u3002");C.getMessageCurtain().showSuccess(q,2E3);p=c}).addUser(m,n,L)}})})();this.getJqUi=function(){a||(a=$("<div>"),a.addClass("user-container-show-area"),a.css("display","none"));return a};var h=
function(c){for(var m=0;m<c.length;m++){for(var g=!1,q=0;q<p.length;q++)if(c[m].getUserId()===p[q].getUserId()){g=!0;break}if(!g)return!0}return c.length===p.length?!1:!0};this.addCard=function(c){c.appendTo(a)};this.deleteUserCallBack=function(c){for(var m=d.getSelectedUser(),g=0;g<m.length;g++)if(c==m[g].getUserId()){m.splice(g,1);break}};this.setRoleId=function(c){n=c};this.openUserForm=function(){d.protectedClickEvent()};this.showUserCard=function(){a&&(a.siblings().hide(),a.show())};this.setSelectedUser=
function(c){d.setSelectedUser(c);p=c}}function D(){var a;this.getJqUi=function(){if(!a){a=$("<div class='add-user-card'>");var d=$("<div class='add-user-card-icon'>");t.background(d,"add-user");var n=$("<div>");n.text(f.get("addUser","\u6dfb\u52a0\u7528\u6237"));n.addClass("add-user-card-text");a.append(d);a.append(n)}return a}}function E(a){var d,n;this.getJqUi=function(){if(!d){d=$("<div class='user-card'>");var h=a.getUserName(),c=$("<img class='user-card-head-image'>"),m=$("<div class = 'user-card-name'>");
if(h){m.addClass("user-card-info");var g=T.createHeadImg(h,a.getColor());c.attr("src",g[0]);m.text(h)}else t.background(c,"user-not-exist"),h=f.get("userNotExist","\u627e\u4e0d\u5230\u8be5\u7528\u6237"),m.css({position:"absolute",width:"120px","margin-left":"-60px",left:"50%","text-align":"center"}),g=$("<span>"),g.addClass("user-not-exist-warning"),g.text("!"),g.appendTo(m),g=$("<span>"),g.text(h),g.appendTo(m);d.append(c);m.attr("title",h);d.append(m);h=$("<div class = 'user-card-info user-card-id'>");
h.text(a.getJobId());d.append(h);M||a.isCooper()||(h=$("<div class = 'user-card-delete-area'>"),c=$("<a class = 'user-card-delete-text'>"),c.text(f.get("delete","\u5220\u9664")),c.attr("title",f.get("delete","\u5220\u9664")),c.on("click",v),c.appendTo(h),h.appendTo(d))}return d};this.setUserShowArea=function(h){n=h};var v=function(){p().setClosingChecker(function(h){h===J.RETURN_OK&&C.createFacade(function(){n.deleteUserCallBack(a.getUserId());d.remove();var c=f.get("deleteUserSuccess","\u5220\u9664\u7528\u6237\u6210\u529f\u3002");
C.getMessageCurtain().showSuccess(c,2E3)}).deleteUser(a.getModelSetRoleUserId(),L);return!0})},p=function(){var h=J.createFeedbackDialog();h.setMsgImageType(J.MSG_DELETE);h.setOptionType(J.OPTION_OK_CANCEL);var c=f.get("comfirmToDeleteUser","\u786e\u5b9a\u8981\u79fb\u9664\u7528\u6237\u201c#1\u201d\u5417\uff1f");c=c.replace("#1",a.getUserName());h.setMessage(c);h.showDialog();return h}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&
(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.modelset&&(com.kingdee.bos.qing.modeler.modelset={});"undefined"==typeof com.kingdee.bos.qing.modeler.modelset.role&&(com.kingdee.bos.qing.modeler.modelset.role={});"undefined"==typeof com.kingdee.bos.qing.modeler.modelset.role.ui&&(com.kingdee.bos.qing.modeler.modelset.role.ui=
{});var F=com.kingdee.bos.qing.modeler.modelset.role.ui;F.Main=function(){var a,d,n,v,p,h=[],c,m,g,q;this.createJqUi=function(){a=$("<div>");a.addClass("modelset-role-manage-container");d=$("<div>");d.addClass("modelset-role-container");d.appendTo(a);p=$("<div>");p.addClass("user-container");p.appendTo(a);var w=$("<div>");w.addClass("modelset-role-container-title");var x=$("<div>");x.addClass("modelset-role-container-title-text");x.text(f.get("modelSetRole","\u6a21\u578b\u96c6\u89d2\u8272"));x.appendTo(w);
v=$("<span>");v.addClass("modelset-role-container-title-new-role-icon");v.attr("title",f.get("new","\u65b0\u589e"));t.backgroundWithHover(v,"btn-new-role");!M&&v.appendTo(w);v.on("click",Q);w.appendTo(d);n=$("<ul>");n.addClass("modelset-role-list");I();n.appendTo(d);P();return a};var I=function(){C.createFacade(function(w){for(var x=0;x<w.length;x++){var b=w[x],k=new e;k.fromJsonObject(b);h.push(k.getModelSetRoleName());b=new K(k);k=new B;b.setUserShowArea(k);b.setArrRoleName(h);b.setFunShowNoRoleUi(G);
b.getJqUi().appendTo(n);0==x&&b.getJqUi().trigger("click");k.getJqUi().appendTo(p)}G()}).loadModelSetRole(L)},G=function(){if(!(0<h.length))if(q)q.show();else{q=$("<div>");q.addClass("no-role-view");var w=$("<div>");t.background(w,"no-role");w.addClass("no-role-icon");w.appendTo(q);w=$("<div>");w.text(f.get("noRole","\u8bf7\u5148\u6dfb\u52a0\u89d2\u8272"));w.addClass("no-role-text");w.appendTo(q);q.appendTo(d)}},P=function(){g=$("<div>");g.addClass("new-modelset-role-container");g.mouseenter(function(){g.css("background",
"#F6F7F9")}).mouseleave(function(){g.css("background","")});c=new N;c.setEnabled(!0);c.addBlurListener(O);c.addAcceptableListener(O);m=c.getJqUi();m.css({position:"absolute",left:"32px",right:"100px",top:"3px"});m.appendTo(g);g.appendTo(d);g.hide()},Q=function(){g.show();c.requestFocus()},O=function(){var w=c.getText().trim(),x=!1;if(w&&50>=w.length){for(var b=0;b<h.length;b++)if(w===h[b]){x=!0;break}if(x)x=f.get("modelSetNameHasExist","\u89d2\u8272\u540d\u79f0\u5df2\u5b58\u5728\u3002"),C.getMessageCurtain().showPrompt(x,
2E3);else{var k=new e;k.setModelSetRoleName(w);k.setModelSetId(L);x=C.createFacade(function(u){if(0!=u){k.setModelSetRoleId(u);var z=new K(k);z.setFirstLoad(!1);z.setFunShowNoRoleUi(G);u=new B;z.setUserShowArea(u);z.setArrRoleName(h);u.getJqUi().appendTo(p);var A=f.get("addModelSetRoleSuccess","\u65b0\u589e\u6a21\u578b\u96c6\u89d2\u8272\u6210\u529f\u3002");C.getMessageCurtain().showSuccess(A,2E3);z=z.getJqUi();z.appendTo(n);z.addClass("current-modelset-role-item").siblings().removeClass("current-modelset-role-item");
z=new D;z.getJqUi().on("click",u.openUserForm);u.setRoleId(k.getModelSetRoleId());u.addCard(z.getJqUi());u.showUserCard();h.push(w);0!=h.length&&q&&q.hide()}else A=f.get("modelSetNameHasExist","\u89d2\u8272\u540d\u79f0\u5df2\u5b58\u5728\u3002"),C.getMessageCurtain().showPrompt(A,2E3)});x.setShowBlocking(!0);x.saveOrUpdateModelSetRole(k,L)}}else 50<w.length&&(x=f.get("nameTooLong","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"),C.getMessageCurtain().showPrompt(x,2E3));
c.setText("");g.hide()}};var r,l,f,t,e,y,H,N,S,T,J,L,M=!1;(function(){var a=com.kingdee.bos.qing.framework.common;f=a.MultilanguageManager.createPackageAccessor(F);a=com.kingdee.bos.qing.common;S=a.Util;L=S.decodeParamFromUrl(location.search,"modelSetId");M="true"==S.decodeParamFromUrl(location.search,"isPreset");a=com.kingdee.bos.qing.modeler.modelset.role.common;r=a.Facade;l=a.Integration;t=a.Icons;a=com.kingdee.bos.qing.modeler.common.ui;T=a.HeadImgGenerator;a=com.kingdee.bos.qing.modeler.modelset.role.model;
e=a.ModelSetRoleInfo;y=a.ModelSetRoleUserInfo;a=com.kingdee.bos.qing.ui.component;H=a.MessageCurtain;N=a.TextField;J=a.MessageDialog})();var C=new function(){var a,d=this;this.getMessageCurtain=function(){a||(a=new H,a.getJqUi().appendTo($("body")));return a};this.createFacade=function(v,p){var h=l.getRemoteImpl();return new r(h,v,function(c,m){return n?n(c,m):!1},p)};var n=function(v,p){return 20012001==v?(d.getMessageCurtain().showPrompt(f.get("modelSetNotExist","\u6a21\u578b\u96c6\u5df2\u88ab\u5220\u9664\uff0c\u64cd\u4f5c\u5931\u8d25\u3002"),
2E3),!0):!1}}})();
//qingVersionTag: 20250415