var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(X){var xa=0;return function(){return xa<X.length?{done:!1,value:X[xa++]}:{done:!0}}};$jscomp.arrayIterator=function(X){return{next:$jscomp.arrayIteratorImpl(X)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(X,xa,ya){if(X==Array.prototype||X==Object.prototype)return X;X[xa]=ya.value;return X};$jscomp.getGlobal=function(X){X=["object"==typeof globalThis&&globalThis,X,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var xa=0;xa<X.length;++xa){var ya=X[xa];if(ya&&ya.Math==Math)return ya}throw Error("Cannot find global object");};
$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(X,xa){var ya=$jscomp.propertyToPolyfillSymbol[xa];if(null==ya)return X[xa];ya=X[ya];return void 0!==ya?ya:X[xa]};
$jscomp.polyfill=function(X,xa,ya,Pa){xa&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(X,xa,ya,Pa):$jscomp.polyfillUnisolated(X,xa,ya,Pa))};$jscomp.polyfillUnisolated=function(X,xa,ya,Pa){ya=$jscomp.global;X=X.split(".");for(Pa=0;Pa<X.length-1;Pa++){var Ka=X[Pa];if(!(Ka in ya))return;ya=ya[Ka]}X=X[X.length-1];Pa=ya[X];xa=xa(Pa);xa!=Pa&&null!=xa&&$jscomp.defineProperty(ya,X,{configurable:!0,writable:!0,value:xa})};
$jscomp.polyfillIsolated=function(X,xa,ya,Pa){var Ka=X.split(".");X=1===Ka.length;Pa=Ka[0];Pa=!X&&Pa in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var Na=0;Na<Ka.length-1;Na++){var Xa=Ka[Na];if(!(Xa in Pa))return;Pa=Pa[Xa]}Ka=Ka[Ka.length-1];ya=$jscomp.IS_SYMBOL_NATIVE&&"es6"===ya?Pa[Ka]:null;xa=xa(ya);null!=xa&&(X?$jscomp.defineProperty($jscomp.polyfills,Ka,{configurable:!0,writable:!0,value:xa}):xa!==ya&&(void 0===$jscomp.propertyToPolyfillSymbol[Ka]&&(ya=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[Ka]=
$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(Ka):$jscomp.POLYFILL_PREFIX+ya+"$"+Ka),$jscomp.defineProperty(Pa,$jscomp.propertyToPolyfillSymbol[Ka],{configurable:!0,writable:!0,value:xa})))};$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(X){if(X)return X;var xa=function(Na,Xa){this.$jscomp$symbol$id_=Na;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:Xa})};xa.prototype.toString=function(){return this.$jscomp$symbol$id_};var ya="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",Pa=0,Ka=function(Na){if(this instanceof Ka)throw new TypeError("Symbol is not a constructor");return new xa(ya+(Na||"")+"_"+Pa++,Na)};return Ka},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(X){if(X)return X;X=Symbol("Symbol.iterator");for(var xa="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),ya=0;ya<xa.length;ya++){var Pa=$jscomp.global[xa[ya]];"function"===typeof Pa&&"function"!=typeof Pa.prototype[X]&&$jscomp.defineProperty(Pa.prototype,X,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return X},
"es6","es3");$jscomp.iteratorPrototype=function(X){X={next:X};X[Symbol.iterator]=function(){return this};return X};$jscomp.iteratorFromArray=function(X,xa){X instanceof String&&(X+="");var ya=0,Pa=!1,Ka={next:function(){if(!Pa&&ya<X.length){var Na=ya++;return{value:xa(Na,X[Na]),done:!1}}Pa=!0;return{done:!0,value:void 0}}};Ka[Symbol.iterator]=function(){return Ka};return Ka};
$jscomp.polyfill("Array.prototype.keys",function(X){return X?X:function(){return $jscomp.iteratorFromArray(this,function(xa){return xa})}},"es6","es3");$jscomp.findInternal=function(X,xa,ya){X instanceof String&&(X=String(X));for(var Pa=X.length,Ka=0;Ka<Pa;Ka++){var Na=X[Ka];if(xa.call(ya,Na,Ka,X))return{i:Ka,v:Na}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(X){return X?X:function(xa,ya){return $jscomp.findInternal(this,xa,ya).v}},"es6","es3");
(function(){function X(){var q,y,a,V,T,M,F,Ra,I,W="",ua,Za,Ya;this.setModelId=function(Ta){q=Ta};this.getModelId=function(){return q};this.setModelType=function(Ta){a=Ta};this.getModelType=function(){return a};this.setModelName=function(Ta){y=Ta};this.getModelName=function(){return y};this.setModelNumber=function(Ta){V=Ta};this.getModelNumber=function(){return V};this.setLevel=function(Ta){T=parseInt(Ta)-1};this.getLevel=function(){return T};this.setSpreadState=function(Ta){M=Ta};this.isSpreadState=
function(){return M};this.setParentId=function(Ta){F=Ta};this.getParentId=function(){return F};this.setInheritPermissions=function(Ta){I=Ta};this.isInheritPermissions=function(){return I};this.setEnable=function(Ta){Ra=Ta};this.isEnable=function(){return Ra};this.setAbstract=function(Ta){W=Ta};this.getAbstract=function(){return W};this.setDataAuthId=function(Ta){Ya=Ta};this.getDataAuthId=function(){return Ya};this.setDataAuth=function(Ta){Za=Ta};this.getQingModelerDataAuth=function(){return Za};this.setErrorCode=
function(Ta){ua=Ta};this.getErrorCode=function(){return ua}}function xa(){X.call(this);var q=this,y=[];this.setChildren=function(a){y=a};this.getChildren=function(){return y};this.toJsonObject=function(){var a={};a.id=q.getModelId();a.type=q.getModelType();a.name=q.getModelName();a.number=q.getModelNumber();a.level=q.getLevel();a.dataAuthId=q.getDataAuthId();a.children=y;void 0!=q.isEnable()&&(a.enable=q.isEnable()?"1":"0");a.inherit=q.isInheritPermissions()?"1":"0";return a};this.fromJsonObject=
function(a){q.setModelId(a.id);q.setModelType(a.type);q.setModelName(a.name);q.setModelNumber(a.number);q.setLevel(a.level);a.dataAuthId&&q.setDataAuthId(a.dataAuthId);q.setSpreadState(!0);var V=a.children;if(V&&0<V.length){for(var T=0;T<V.length;T++){var M=V[T];if(M.children){var F=new xa;F.fromJsonObject(M);y.push(F);F.setParentId(q.getModelId())}}for(T=0;T<V.length;T++)M=V[T],M.children||(F=new ya,F.fromJsonObject(M),y.push(F),F.setParentId(q.getModelId()))}q.setErrorCode(a.code);a.inherit&&q.setInheritPermissions("1"==
a.inherit);a.status&&q.setEnable("1"==a.status);a.dataAuthId&&q.setDataAuthId(a.dataAuthId)}}function ya(){X.call(this);var q=this;this.toJsonObject=function(){var y={};y.id=q.getModelId();y.type=q.getModelType();y.name=q.getModelName();y.number=q.getModelNumber();y.level=q.getLevel();y.inherit=q.isInheritPermissions()?"1":"0";y.enable=q.isEnable()?"1":"0";return y};this.fromJsonObject=function(y){q.setModelId(y.id);q.setModelType(y.type);q.setModelName(y.name);q.setModelNumber(y.number);q.setLevel(y.level);
q.setErrorCode(y.code);q.setSpreadState(!0);y.inherit&&q.setInheritPermissions("1"==y.inherit);y.status&&q.setEnable("1"==y.status);y.dataAuthId&&q.setDataAuthId(y.dataAuthId)}}function Pa(){var q=this,y,a,V,T,M="",F,Ra,I,W;this.setErrorCode=function(ua){F=ua};this.getErrorCode=function(){return F};this.setUserName=function(ua){y=ua};this.getUserName=function(){return y};this.setUserId=function(ua){a=ua};this.getUserId=function(){return a};this.setEnable=function(ua){V=ua};this.isEnable=function(){return V};
this.setInheritPermissions=function(ua){T=ua};this.isInheritPermissions=function(){return T};this.setAbstract=function(ua){M=ua};this.getAbstract=function(){return M};this.setDataAuth=function(ua){Ra=ua};this.getQingModelerDataAuth=function(){return Ra};this.setDataAuthId=function(ua){I=ua};this.getDataAuthId=function(){return I};this.setJobNumber=function(ua){W=ua};this.getJobNumber=function(){return W};this.toJsonObject=function(){var ua={};ua.viewerName=y;ua.viewerId=a;ua.status=V;ua.inherit=T;
return ua};this.fromJsonObject=function(ua){q.setUserId(ua.viewerId);q.setJobNumber(ua.number);q.setUserName(ua.viewerName);q.setEnable(!0);q.setErrorCode(ua.code);"0"===ua.status&&q.setEnable(!1);q.setInheritPermissions(!0);"0"===ua.inherit&&q.setInheritPermissions(!1);q.setDataAuthId(ua.dataAuthId)};this.initialize=function(ua,Za){q.setUserId(ua);q.setUserName(Za);q.setEnable(!1);q.setInheritPermissions(!0)}}function Ka(){var q,y,a,V,T,M=!1;this.setModelId=function(F){q=F};this.getModelId=function(){return q};
this.setRowAuth=function(F){y=F};this.getRowAuth=function(){return y};this.setCellAuth=function(F){a=F};this.getCellAuth=function(){return a};this.setRoleRowAuth=function(F){V=F};this.getRoleRowAuth=function(){return V};this.setRoleCellAuth=function(F){T=F};this.getRoleCellAuth=function(){return T};this.setRoleExist=function(F){M=F};this.isRoleExist=function(){return M};this.toString=function(F){var Ra=y?y.toString():Ga.get("notExistFilterItems","\u884c\u7ea7\u6743\u9650\uff1a\u8fc7\u6ee4\u9879\u672a\u8bbe\u7f6e"),
I=a?a.toString():Ga.get("notExistUnviewableFields","\u5217\u7ea7\u6743\u9650\uff1a\u6240\u6709\u5b57\u6bb5\u53ef\u89c1");return F?y||a?Ra:"":y||a?Ra+"\n"+I:""};this.toJsonObject=function(){var F={};F.modelId=q;a&&(F.columnLevel=a.toJsonObject());T&&(F.roleColumnLevel=T.toJsonObject());y&&(F.rowLevel=y.toJsonObject());V&&(F.roleRowLevel=V.toJsonObject());return F};this.fromJsonObject=function(F){q=F.modelId;M=F.isExistsRoleDataAuth;F.columnLevel&&(a=new Xa,a.fromJsonObject(F.columnLevel));F.rowLevel&&
F.rowLevel.filterItems&&(y=new Na,y.fromJsonObject(F.rowLevel));F.roleRowLevel&&F.roleRowLevel.filterItems&&(V=new Na,V.fromJsonObject(F.roleRowLevel));F.roleColumnLevel&&(T=new Xa,T.fromJsonObject(F.roleColumnLevel))}}function Na(){var q=[],y=!1,a=-1;this.getFilterItems=function(){return q};this.setFilterItems=function(T){q=T};this.setInvalid=function(T){y=T};this.isInvalid=function(){return y};this.setErrorLine=function(T){a=T};this.getErrorLine=function(){return a};this.toString=function(){for(var T=
Ga.get("rowAuth","\u884c\u7ea7\u6743\u9650\uff1a"),M=0;M<q.length;M++){var F=Ba.FilterTypeUtil.getTypeDesc(q[M].getLogicOp())+" ";if(0!==M||M===q.length-1)F="";var Ra=q[M].getProperty().getAlias(),I=Ba.FilterTypeUtil.getTypeDesc(q[M].getCompareOp()),W=q[M].getValue();if(q[M].getProperty().isEnum())for(var ua=Object.keys(q[M].getProperty().getEnumValue()),Za=0;Za<ua.length;Za++){var Ya=ua[Za];W&&W.match(Ya)&&(W=W.replace(Ya,q[M].getProperty().getEnumValue()[Ya]))}q[M].getProperty().getDataType()==
Ea.DT_DATETIME?W=V(W,Ea.DT_DATETIME):q[M].getProperty().getDataType()==Ea.DT_DATE&&(W=V(W,Ea.DT_DATE));ua=Ra+" "+I+" "+W+" "+F;if(q[M].getCompareOp()==n.COMPARE_NULL||q[M].getCompareOp()==n.COMPARE_NOT_NULL)ua=Ra+" "+I+" "+F;if(q[M].getCompareOp()==n.COMPARE_IN||q[M].getCompareOp()==n.COMPARE_NOT_IN)ua=Ra+" "+I.replace("#1",W)+" "+F;T+=ua;if(1<=M)break}2<q.length?T+=Ga.get("filterItems","\u7b49#1\u884c\u8fc7\u6ee4\u9879").replace("#1",q.length):0>=q.length&&(T=Ga.get("notExistFilterItems","\u884c\u7ea7\u6743\u9650\uff1a\u8fc7\u6ee4\u9879\u672a\u8bbe\u7f6e"));
return T};var V=function(T,M){var F=new Date;F.setTime(parseInt(T));var Ra=F.getFullYear(),I=F.getMonth()+1+"";2>I.length&&(I="0"+I);var W=F.getDate()+"";2>W.length&&(W="0"+W);T=F.getHours()+"";2>T.length&&(T="0"+T);var ua=F.getMinutes()+"";2>ua.length&&(ua="0"+ua);F=F.getSeconds()+"";2>F.length&&(F="0"+F);T=Ra+"-"+I+"-"+W+" "+T+":"+ua+":"+F;M===Ea.DT_DATE&&(T=Ra+"-"+I+"-"+W);return T};this.toJsonObject=function(){for(var T={},M=[],F=0;F<q.length;F++)M.push(q[F].toJsonObject());T.filterItems=M;return T};
this.fromJsonObject=function(T){T=T.filterItems;for(var M=0;M<T.length;M++){var F=new n;F.fromJsonObject(T[M]);q.push(F);F.isExist()||y||(y=!0,a=M+1)}}}function Xa(){var q,y=[],a=[];this.getRelation=function(){return q};this.setRelation=function(V){q=V};this.getNoAuthFields=function(){return y};this.setNoAuthFields=function(V){y=V};this.getSelectedFields=function(){return a};this.setSelectedFields=function(V){a=V};this.toString=function(){for(var V=Ga.get("columnAuth","\u5217\u7ea7\u6743\u9650\uff1a\u4e0d\u53ef\u89c1\u5b57\u6bb5\u6709"),
T=0;T<y.length;T++){0!==T&&(V+=Ga.get("comma","\u3001"));var M=y[T].getAlias();V+=M;if(2<=T)break}3<y.length?V+=Ga.get("fields","\u7b49#1\u4e2a\u5b57\u6bb5").replace("#1",y.length):0>=y.length&&(V=Ga.get("notExistUnviewableFields","\u5217\u7ea7\u6743\u9650\uff1a\u6240\u6709\u5b57\u6bb5\u53ef\u89c1"));return V};this.toJsonObject=function(){var V={};V.relation=q;for(var T=[],M=0;M<y.length;M++)T.push(y[M].toJsonObject());V.noAuthFields=T;return V};this.fromJsonObject=function(V){q=V.relation;if(V.noAuthFields&&
(V=V.noAuthFields))for(var T=0;T<V.length;T++){var M=new Ea;M.fromJsonObject(V[T]);y.push(M)}}}function n(){var q,y,a,V=0,T=0,M,F=!1,Ra=!0,I=null;this.setRoleFilter=function(W){F=W};this.isRoleFilter=function(){return F};this.setExist=function(W){Ra=W};this.isExist=function(){return Ra};this.setProperty=function(W){q=W};this.getProperty=function(){return q};this.setCompareOp=function(W){y=W};this.getCompareOp=function(){return y};this.setValue=function(W){a=W};this.getValue=function(){return a};this.setValueMode=
function(W){if(W===n.MODE_CONST||W===n.MODE_SYS_VAR||W===n.MODE_MACRO_VAR)I=W;else throw Error("IllegalArgument: "+W);};this.isSystemVariant=function(){return I==n.MODE_SYS_VAR?!0:!1};this.isMacroVar=function(){return I==n.MODE_MACRO_VAR?!0:!1};this.setLeftBracketCount=function(W){V=W};this.getLeftBracketCount=function(){return V};this.setRightBracketCount=function(W){T=W};this.getRightBracketCount=function(){return T};this.setLogicOp=function(W){M=W};this.getLogicOp=function(){return M};this.isEmpty=
function(){return 0==V&&0==T&&!q&&!y&&!a&&!M};this.copy=function(){var W=new n;W.setProperty(q);W.setCompareOp(y);W.setValue(a);W.setLeftBracketCount(V);W.setRightBracketCount(T);W.setLogicOp(M);W.setExist(Ra);return W};this.toJsonObject=function(){if(!q)return null;var W={};W.field=q.toJsonObject();W.compareOp=y;W.value=a;W.leftBrackets=V;W.rightBrackets=T;W.logicOp=M;I&&(W.mode=I);return W};this.fromJsonObject=function(W){W&&(q=new Ea,q.fromJsonObject(W.field),y=W.compareOp,a=W.value,V=W.leftBrackets,
T=W.rightBrackets,M=W.logicOp,Ra=W.exists,I=W.mode)}}function Ea(){var q=this,y,a,V,T,M,F,Ra,I,W,ua,Za,Ya={};this.setFromNodeId=function(H){y=H};this.getFromNodeId=function(){return y};this.getNumber=function(){return a};this.setNumber=function(H){a=H};this.setName=function(H){V=H};this.getName=function(){return V};this.getFullName=function(){return y+"_"+V};this.setAlias=function(H){T=H};this.getAlias=function(){return T?T:V};this.isDimension=function(){return Ya[sa.IS_DIMENSION]};this.isMetric=
function(){return Ya[sa.IS_METRIC]};var Ta=function(H){if(H!==Ea.DT_STRING&&H!==Ea.DT_INT&&H!==Ea.DT_NUMBER&&H!==Ea.DT_DATE&&H!==Ea.DT_DATETIME&&H!==Ea.DT_BOOLEAN)throw Error("IllegalArgument: "+H);};this.setDataType=function(H){Ta(H);M=H};this.getDataType=function(){return M};this.setAppointedDataType=function(H){H&&Ta(H);F=H==M?null:H};this.getAppointedDataType=function(){return F};this.getOutputDataType=function(){return F?F:M};this.setRoundMode=function(H){I=H};this.getRoundMode=function(){return I};
this.setScale=function(H){Ra=H};this.getScale=function(){return Ra};this.setEnumValue=function(H){W=H};this.getEnumValue=function(){return W};this.setMulBaseData=function(H){ua=H};this.getMulBaseData=function(){return ua};this.isEnum=function(){return ua||q.getOutputDataType()!=Ea.DT_STRING?!1:0!=(W?Object.keys(W):[]).length};this.setExist=function(H){Za=H};this.isExist=function(){return Za};this.setExtensions=function(H){Ya=H};this.getExtensions=function(){return Ya};this.fromJsonObject=function(H){V=
H.name;y=H.fromNode;T=H.alias;a=H.number;F=H.appointedDataType;M=H.dataType;H.scale&&(Ra=H.scale);H.roundMode&&(I=H.roundMode);H.extensions&&(Ya=H.extensions,W=Ya.bizFieldEnumKey,Za=Ya.isExists,ua=Ya.isMulBaseData)};this.toJsonObject=function(){var H={};H.name=V;H.fromNode=y;H.alias=T;H.dataType=M;H.number=a;I&&(H.roundMode=I);void 0!==Ra&&(H.scale=Ra);H.extensions=Ya;return H};this.clone=function(){var H=new Ea;V&&H.setName(V);y&&H.setFromNodeId(y);T&&H.setAlias(T);F&&H.setAppointedDataType(F);M&&
H.setDataType(M);Ra&&H.setScale(Ra);Ya&&H.setExtensions(Ya);I&&H.setRoundMode(I);ua&&H.setMulBaseData(ua);W&&H.setEnumValue(W);a&&H.setNumber(a);return H};this.equals=function(H){return V==H.getName()&&T==H.getAlias()&&F==H.getAppointedDataType()&&Ra==H.getScale()&&I==H.getRoundMode()}}"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.auth&&(com.kingdee.bos.qing.modeler.modelset.auth={});"undefined"==typeof com.kingdee.bos.qing.modeler.modelset.auth.model&&(com.kingdee.bos.qing.modeler.modelset.auth.model={});var Ba=com.kingdee.bos.qing.modeler.modelset.auth.model;Ba.ModelFolderNode=xa;Ba.ModelLeafNode=
ya;Ba.UserDataAuth=Pa;Ba.ModelSetRole=function(){var q,y,a,V=[],T="",M=!1;this.getModelSetRoleId=function(){return q};this.setModelSetRoleId=function(F){q=F};this.getModelSetRoleName=function(){return y};this.setModelSetRoleName=function(F){y=F};this.getModelSetId=function(){return a};this.setModelSetId=function(F){a=F};this.getUserNames=function(){return T};this.setUserNames=function(F){T=F};this.isHide=function(){return M};this.setHide=function(F){M=F};this.fromJsonObject=function(F){q=F.modelSetRoleId;
y=F.modelSetRoleName;a=F.modelSetId;if(F.userNames){F=F.userNames;for(var Ra=0;Ra<F.length;Ra++)V.push(F[Ra]),T=T+F[Ra]+";"}M=!1};this.toJsonObject=function(){var F={};F.modelSetRoleId=q;F.modelSetRoleName=y;F.modelSetId=a;F.userNames=JSON.stringify(V);return F}};Ba.QingModelerDataAuth=function(){var q=[];this.setModels=function(y){q=y};this.getModels=function(){return q};this.toString=function(y){return q[0]?q[0].toString(y):""};this.toJsonObject=function(){for(var y={},a=[],V=0;V<q.length;V++)a.push(q[V].toJsonObject());
y.dataAuthContents=a;return y};this.fromJsonObject=function(y){y=y.dataAuthContents;for(var a=0;a<y.length;a++){var V=new Ka;V.fromJsonObject(y[a]);q.push(V)}}};Ba.DataAuthModeler=Ka;Ba.RowAuth=Na;Ba.CellAuth=Xa;Ba.ModelStatus=function(){var q,y;this.setModelId=function(a){q=a};this.getModelId=function(){return q};this.setStateCode=function(a){y=a};this.getStateCode=function(){return y};this.fromJsonObject=function(a){q=a.modelId;y=a.code}};Ba.FilterItem=n;Ba.Property=Ea;var Ga=com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(Ba);
xa.MODELSET_TYPE="modelset";xa.DIRECTORY_TYPE="directory";ya.DATA_TABLE_MODEL="data_table_model";ya.ENTITY_MODEL="entity_model";ya.RELATION_MODEL="relation_model";ya.METRICS_MODEL="metric_model";ya.METRIC="metric";Pa.USER="0";Pa.ROLE="1";Pa.MODELSET_ROLE="2";n.REG_NUMBER=/^-?\d+(\.\d+)?$/;n.REG_DATETIME=/^-?\d+(\.\d+)?$/;n.COMPARE_EQUAL="EQUAL";n.COMPARE_NOT_EQUAL="NOT_EQUAL";n.COMPARE_GREATER="GREATER";n.COMPARE_GREATER_EQUAL="GREATER_EQUAL";n.COMPARE_LESS="LESS";n.COMPARE_LESS_EQUAL="LESS_EQUAL";
n.COMPARE_INCLUDE="INCLUDE";n.COMPARE_NOT_INCLUDE="NOT_INCLUDE";n.COMPARE_START_WITH="START_WITH";n.COMPARE_END_WITH="END_WITH";n.COMPARE_NULL="NULL";n.COMPARE_NOT_NULL="NOT_NULL";n.COMPARE_IN="IN";n.COMPARE_NOT_IN="NOT_IN";n.COMPARE_VARIABLE="VARIABALE_MATCH";n.LOGIC_AND="AND";n.LOGIC_OR="OR";n.COMPARE_WITH_RAW="RAW";n.COMPARE_WITH_APPOINTED="APPOINTED";n.MODE_CONST="Const";n.MODE_SYS_VAR="SystemVar";n.MODE_MACRO_VAR="MacroVar";n.COMPARES_FOR_STRING=[n.COMPARE_VARIABLE,n.COMPARE_EQUAL,n.COMPARE_NOT_EQUAL,
n.COMPARE_INCLUDE,n.COMPARE_NOT_INCLUDE,n.COMPARE_START_WITH,n.COMPARE_END_WITH,n.COMPARE_NULL,n.COMPARE_NOT_NULL,n.COMPARE_IN,n.COMPARE_NOT_IN];n.COMPARES_FOR_ENUM=[n.COMPARE_EQUAL,n.COMPARE_NOT_EQUAL,n.COMPARE_NULL,n.COMPARE_NOT_NULL,n.COMPARE_IN,n.COMPARE_NOT_IN];n.COMPARES_FOR_NUMBER=[n.COMPARE_VARIABLE,n.COMPARE_EQUAL,n.COMPARE_NOT_EQUAL,n.COMPARE_GREATER,n.COMPARE_GREATER_EQUAL,n.COMPARE_LESS,n.COMPARE_LESS_EQUAL,n.COMPARE_NULL,n.COMPARE_NOT_NULL,n.COMPARE_IN,n.COMPARE_NOT_IN];n.COMPARES_FOR_DATETIME=
[n.COMPARE_EQUAL,n.COMPARE_NOT_EQUAL,n.COMPARE_GREATER,n.COMPARE_GREATER_EQUAL,n.COMPARE_LESS,n.COMPARE_LESS_EQUAL,n.COMPARE_NULL,n.COMPARE_NOT_NULL];n.COMPARES_FOR_BOOLEAN=[n.COMPARE_EQUAL,n.COMPARE_NOT_EQUAL,n.COMPARE_NULL,n.COMPARE_NOT_NULL];n.isCompareOpWithoutValue=function(q){return q==n.COMPARE_NULL||q==n.COMPARE_NOT_NULL};n.isCompareOpWithinOrNotWithinValue=function(q){return q==n.COMPARE_IN||q==n.COMPARE_NOT_IN};n.isCompareOpMatchVariable=function(q){return q==n.COMPARE_VARIABLE};n.getSelectableCompares=
function(q,y){switch(q){case Ea.DT_STRING:return y?n.COMPARES_FOR_ENUM:n.COMPARES_FOR_STRING;case Ea.DT_NUMBER:case Ea.DT_INT:return n.COMPARES_FOR_NUMBER;case Ea.DT_DATE:case Ea.DT_DATETIME:return n.COMPARES_FOR_DATETIME;case Ea.DT_BOOLEAN:return n.COMPARES_FOR_BOOLEAN;default:throw Error("Unknown DataType");}};n.FiltersCheckingResult=function(q,y){var a=y;this.getFiltersErrorRow=function(){return q};this.getPrompt=function(){return a};this.setPrompt=function(V){a=V}};Ba.FilterTypeUtil=new function(){this.getTypeDesc=
function(q){switch(q){case n.COMPARE_EQUAL:return Ga.get("compareEqual","\u7b49\u4e8e");case n.COMPARE_NOT_EQUAL:return Ga.get("compareNotEqual","\u4e0d\u7b49\u4e8e");case n.COMPARE_GREATER:return Ga.get("compareGreater","\u5927\u4e8e");case n.COMPARE_GREATER_EQUAL:return Ga.get("compareGreaterEqual","\u5927\u4e8e\u7b49\u4e8e");case n.COMPARE_LESS:return Ga.get("compareLess","\u5c0f\u4e8e");case n.COMPARE_LESS_EQUAL:return Ga.get("compareLessEqual","\u5c0f\u4e8e\u7b49\u4e8e");case n.COMPARE_INCLUDE:return Ga.get("compareInclude",
"\u5305\u542b");case n.COMPARE_NOT_INCLUDE:return Ga.get("compareNotInclude","\u4e0d\u5305\u542b");case n.COMPARE_START_WITH:return Ga.get("compareStartWith","\u5f00\u5934\u662f");case n.COMPARE_END_WITH:return Ga.get("compareEndWith","\u7ed3\u5c3e\u662f");case n.COMPARE_NULL:return Ga.get("compareNull","\u4e3a\u7a7a");case n.COMPARE_NOT_NULL:return Ga.get("compareNotNull","\u4e0d\u4e3a\u7a7a");case n.COMPARE_IN:return Ga.get("compareIn","\u5728#1\u4e4b\u5185");case n.COMPARE_NOT_IN:return Ga.get("compareNotIn",
"\u4e0d\u5728#1\u4e4b\u5185");case n.LOGIC_AND:return Ga.get("logicAnd","\u5e76\u4e14");case n.LOGIC_OR:return Ga.get("logicOr","\u6216\u8005");case n.COMPARE_VARIABLE:return Ga.get("compareVariable","\u5339\u914d\u53d8\u91cf");default:return""}}};Ea.BOOLEAN_TRUE="true";Ea.BOOLEAN_FALSE="false";Ea.DT_BOOLEAN="BOOLEAN";Ea.DT_DATE="DATE";Ea.DT_DATETIME="DATETIME";Ea.DT_INT="INT";Ea.DT_NUMBER="NUMBER";Ea.DT_STRING="STRING";Ea.ROUND_MODE_DOWN="ROUND_DOWN";Ea.ROUND_MODE_HALF_UP="ROUND_HALF_UP";Ea.ROUND_MODE_UP=
"ROUND_UP";Ba.DataAuthUtil=new function(){this.generateMetricModelId=function(q,y){return ya.METRIC+"-"+q+"-"+y}};var sa={};Ba.FieldExtensionKey=sa;sa.IS_DIMENSION="isDimension";sa.IS_METRIC="isMetric"})();(function(){function X(){Pa.call(this);var Xa;this.getRemoteUrl=function(){return Xa};this.setRemoteUrl=function(n){Xa=n}}"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.auth&&(com.kingdee.bos.qing.modeler.modelset.auth={});"undefined"==typeof com.kingdee.bos.qing.modeler.modelset.auth.common&&(com.kingdee.bos.qing.modeler.modelset.auth.common={});var xa=com.kingdee.bos.qing.modeler.modelset.auth.common;xa.Facade=function(Xa,n,Ea,Ba){ya.call(this,Xa,n,Ea,Ba);var Ga=this.protectedMethod;this.loadUsableModelNode=function(sa){Ga.remote("loadUsableModelNodes",{modelSetId:sa})};this.loadSupportSystemVar=function(){Ga.remote("loadSupportSystemVar",
{})};this.deleteInvalidData=function(){Ga.remote("deleteInvalidData",{})};this.loadUsableUserDataAuth=function(sa,q,y){Ga.remote("loadUsableDataAuthByModel",{type:y,modelId:q,modelSetId:sa})};this.authorizedDataAuth=function(sa,q,y,a,V,T){Ga.remote("authorizedDataAuth",{type:a,modelId:sa,modelType:V,viewerId:q,status:y,modelSetId:T})};this.setInherit=function(sa,q,y,a){Ga.remote("setInherit",{type:a,modelId:sa,viewerId:q,inherit:y})};this.doDeleteUser=function(sa,q,y){sa={type:y,viewerIds:JSON.stringify(q),
modelId:sa};Ga.remote("deleteDataAuth",sa)};this.deleteDataAuthByModelSetId=function(sa,q,y){sa={type:y,viewerIds:JSON.stringify(q),modelSetId:sa};Ga.remote("deleteDataAuthByModelSetId",sa)};this.doAddUser=function(sa,q,y){sa={type:y,modelIds:JSON.stringify(sa),viewerIds:JSON.stringify(q)};Ga.remote("setDataAuth",sa)};this.addUsers=function(sa,q,y){sa={type:y,viewerIds:JSON.stringify(q),modelSetId:sa};Ga.remote("addUsers",sa)};this.deletePermission=function(sa,q,y){Ga.remote("deleteDataAuthContent",
{type:y,modelId:sa,viewerId:q})};this.getModelSetRoles=function(sa){Ga.remote("getModelSetRoles",{modelSetId:sa})};this.loadUsableModelDataAuth=function(sa,q,y){Ga.remote("loadUsableDataAuthByUser",{type:q,modelSetId:sa,viewerId:y})};this.loadModelSetViewer=function(sa,q){Ga.remote("loadModelSetViewer",{type:sa,modelSetId:q})};this.queryDataAuthContent=function(sa,q,y,a){Ga.remote("queryDataAuthContent",{type:y,modelId:q,inherit:sa,viewerId:a})};this.queryDataAuthContents=function(sa){sa={dataAuthIds:JSON.stringify(sa)};
Ga.remote("queryDataAuthContents",sa)};this.getFields=function(sa,q){Ga.remote("getFields",{modelId:sa,includeMetric:q})};this.setDataAuthContent=function(sa,q,y,a,V){sa={type:q,modelId:a,viewerId:sa,inherit:y,content:JSON.stringify(V.toJsonObject())};Ga.remote("setDataAuthContent",sa)};this.checkModel=function(sa){Ga.remote("checkModel",{modelSetId:sa})};this.checkModelExistMV=function(sa){Ga.remote("checkModelExistMV",{modelId:sa})}};var ya,Pa,Ka;(function(){var Xa=com.kingdee.bos.qing.framework.common;
ya=Xa.AbstractFacade;Pa=Xa.AbstractRemoteCall;Ka=Xa.AbstractIcons})();xa.Integration=new function(){var Xa=new X,n,Ea;this.setDataAuthorityManager=function(Ba){n=Ba};this.getDataAuthorityManager=function(){return n};this.setModelDesignerEntrance=function(Ba){Ea=Ba};this.getModelDesignerEntrance=function(){return Ea};this.getRemoteImpl=function(){return Xa};this.setRemoteUrl=function(Ba){Xa.setRemoteUrl(Ba)}};xa.Icons=new function(){Ka.call(this);var Xa=this.protectedMethod;this.protectedInit=function(Ea,
Ba){Ea=com.kingdee.bos.qing.modeler.modelset.auth.ComboIcon;if(!Ea)throw Error("com.kingdee.bos.qing.modeler.modelset.auth.ComboIcon not found.");Ea.define(Ba,"model-auth");Ba.setStartPosition(1,1);Ba.setGap(2);Ba.setIconSize(16,16);n(0,0,"icon-relation-model");n(0,1,"icon-data-table-model");n(0,2,"icon-entity-model");n(0,3,"icon-relation-model_selected");n(0,4,"icon-data-table-model_selected");n(0,5,"icon-entity-model_selected");n(0,6,"icon-metrics-model");n(0,7,"icon-metrics");Ba.setStartPosition(1,
27);Ba.setGap(2,1);Ba.setIconSize(16,16);n(1,0,"btn-delete");n(1,1,"btn-edit");n(1,2,"btn-cooperation");n(1,4,"btn-inherit");n(1,5,"icon-expanded_hover");n(1,6,"icon-collapsed_hover");n(0,0,"btn-delete_hover");n(0,1,"btn-edit_hover");n(0,2,"btn-cooperation_hover");n(0,4,"btn-inherit_hover");n(0,5,"icon-expanded");n(0,6,"icon-collapsed");n(0,10,"btn-refresh");n(0,10,"btn-refresh_hover");n(0,11,"btn-delete_white");Ba.setStartPosition(1,72);Ba.setGap(2);Ba.setIconSize(16,16);n(0,0,"icon-datetime");n(0,
1,"icon-date");n(0,2,"icon-number");n(0,3,"icon-int");n(0,4,"icon-string");n(0,5,"icon-boolean");n(1,0,"icon-datetime_selected");n(1,1,"icon-date_selected");n(1,2,"icon-number_selected");n(1,3,"icon-int_selected");n(1,4,"icon-string_selected");n(1,5,"icon-boolean_selected");Ba.setStartPosition(1,114);Ba.setGap(1);Ba.setIconSize(170,98);n(0,0,"icon-empty");n(0,1,"icon-search_none");Ba.setStartPosition(1,234);Ba.setGap(1);Ba.setIconSize(270,198);n(0,0,"icon-instructions");Ba.setStartPosition(0,498);
Ba.setGap(3);Ba.setIconSize(16,16);n(0,0,"icon-metrics-model_selected");n(0,1,"icon-metrics_selected");Ba.setStartPosition(33,498);Ba.setGap(3);Ba.setIconSize(20,20);n(0,0,"icon-field-visible");n(0,1,"icon-field-novisible")};var n=function(Ea,Ba,Ga){Xa.registIcon(Ea,Ba,Ga)}};var Na=new function(){var Xa;this.hookCollector=function(n){Xa=n};this.occur=function(n,Ea){try{Xa&&Xa(n,Ea)}catch(Ba){window.console&&console.warn(Ba)}};this.getPageShowMethod=function(n){switch(n){case "0":return Na.BY_MODEL;
case "1":return Na.BY_USER_OR_ROLE}};this.getAuthUserOrRoleType=function(n){var Ea=com.kingdee.bos.qing.modeler.modelset.auth.model.UserDataAuth;switch(n){case Ea.USER:return Na.SYSTEM_USER;case Ea.ROLE:return Na.SYSTEM_ROLE;case Ea.MODELSET_ROLE:return Na.MODELSET_ROLE}};this.getAuthInheritMethod=function(n){return n?Na.USER_AND_ROLE:Na.ONLY_USER}};Na.PAGE_SHOW_METHOD="page-show-method";Na.AUTH_USER_ROLE_TYPE="auth-user-role-type";Na.DATA_AUTH_SETTING_SHOW_METHOD="data-auth-setting-show-method";
Na.DATA_AUTH_SETTING_INHERIT_METHOD="data-auth-setting-inherit-method";Na.BY_MODEL="\u6309\u6a21\u578b\u5c55\u793a";Na.BY_USER_OR_ROLE="\u6309\u7528\u6237/\u89d2\u8272\u5c55\u793a";Na.SYSTEM_USER="\u5f53\u524d\u7cfb\u7edf\u7528\u6237";Na.SYSTEM_ROLE="\u5f53\u524d\u7cfb\u7edf\u89d2\u8272";Na.MODELSET_ROLE="\u5f53\u524d\u6a21\u578b\u96c6\u89d2\u8272";Na.ROW_AUTH="\u884c\u7ea7\u6743\u9650";Na.COL_AUTH="\u5217\u7ea7\u6743\u9650";Na.ONLY_USER="\u4ec5\u7528\u6237";Na.USER_AND_ROLE="\u7528\u6237\u52a0\u89d2\u8272";
xa.UserOperationReporter=Na})();(function(){function X(P,J){this.toString=function(){return J};this.getValue=function(){return P}}function xa(P){function J(){var ta,K;this.getLeftToolBarJqUi=function(){null==ta&&(ta=d());return ta};var d=function(){ta=$("<div>");ta.addClass("sbm-left-panel-toolbar");var l=$("<span>");l.addClass("sbm-left-panel-toolbar-text");l.text(a.get("deployedModels","\u5df2\u90e8\u7f72\u7684\u6a21\u578b"));l.appendTo(ta);c().appendTo(ta);l=$("<div>");l.addClass("sbm-left-refresh-btn");M.backgroundWithHover(l,
"btn-refresh");l.on("click",function(){Q="";K.clear();qa.empty();za.checkModel()});l.attr("title",a.get("refreshModels","\u5237\u65b0\u6a21\u578b"));l.appendTo(ta);return ta},c=function(){K=new Ya;K.setSearchListenerDelay(1E3);K.setShowSearchIcon(!0);K.setFoucs();K.setPlaceholder(a.get("searchContent","\u8bf7\u8f93\u5165\u641c\u7d22\u5185\u5bb9"));var l=K.getJqUi();l.removeClass("sa-ctrl-common-singlelineborder");l.addClass("sbm-left-search-box");l.find(".sa-ctrl-searchbox-close").on("click",function(A){Q=
K.getText();ka&&za.initTreeRoot(Q)});var m=l.find(":input");this.searchModel=function(){Q=K.getText();ka&&za.initTreeRoot(Q)};m.attr("oninput","searchModel();");m.hide();l.on("mouseenter",function(A){l.css("width","135px");l.addClass("sa-ctrl-common-singlelineborder");m.show()});l.on("mouseleave",function(A){if(null==K.getText()||0===K.getText().length)l.css("width","20px"),l.removeClass("sa-ctrl-common-singlelineborder"),m.hide()});return l}}function N(){var ta=this,K,d={};d[Ma.DATA_TABLE_MODEL]=
"data-table-model";d[Ma.ENTITY_MODEL]="entity-model";d[Ma.RELATION_MODEL]="relation-model";d[Ma.METRICS_MODEL]="metrics-model";d[Ma.METRIC]="metrics";var c,l,m=0,A=null,v=null,D;this.getLeftTreeTableJqUi=function(){qa||(qa=$("<div>"),qa.addClass("sbm-left-tree-table"),ta.checkModel());return qa};this.checkModel=function(){Y.createFacade(function(k){t=[];if(k)for(var e=0;e<k.length;e++){var x=new vb;x.fromJsonObject(k[e]);20001005===x.getStateCode()&&t.push(x.getModelId())}R&&R(t);da()},function(k,
e){return!1}).checkModel(bb)};var da=function(){Y.createFacade(function(k){k&&k.children?(fa.hide(),ka=new fb,ka.fromJsonObject(k),ka=ka.getChildren()[0],u(),qa.show(),r.hide(),Ca.setText(a.get("operationInstructions","\u8bf7\u70b9\u51fb\u5de6\u4fa7\u6a21\u578b\u8fdb\u884c\u6570\u636e\u6743\u9650\u8bbe\u7f6e")),Ca.updateIcon("icon-instructions",270,198),f.show(),w&&w(!0)):(r.hide(),f.hide(),ka=null,qa.hide(),oa.setText(a.get("noDeployedModel","\u6682\u65e0\u5df2\u90e8\u7f72\u7684\u6a21\u578b")),fa.show(),
w&&w(!1))},function(k,e){return!1}).loadUsableModelNode(bb)},u=function(){v=$("<div>");I.layoutCtrlWithLRTB(v,0,0,null,2,0,null);v.appendTo(qa);c=new lb;A=c.getJqUi();A.appendTo(v);c.setLineHeight(30);c.setRootVisible(!1);c.setNodePainter(p);c.addSelectingListener(b);ta.initTreeRoot(Q);D||(D=new V,D.setCallbackImmediately(function(){ta.resizeHeight()}),D.observe())},b=function(k,e){if(e.getUserObject()instanceof fb&&e.getUserObject().getModelType()!==Ma.METRICS_MODEL)return!1;if(!K||K!==e){f.hide();
r.show();var x=k.searchUiByModel(K);if(x){var C=x.find("#sbm-left-tree"),S=d[K.getUserObject().getModelType()];M.background(C,"icon-"+S);if(C=x.find(".sbm-left-tree-number_selected"))C.removeClass("sbm-left-tree-number_selected"),C.addClass("sbm-left-tree-number");if(x=x.find(".data-auth-preset_selected"))x.removeClass("data-auth-preset_selected"),x.addClass("data-auth-preset")}k=k.searchUiByModel(e);x=k.find("#sbm-left-tree");C=d[e.getUserObject().getModelType()];M.background(x,"icon-"+C+"_selected");
if(x=k.find(".sbm-left-tree-number"))x.removeClass("sbm-left-tree-number"),x.addClass("sbm-left-tree-number_selected");if(k=k.find(".data-auth-preset"))k.removeClass("data-auth-preset"),k.addClass("data-auth-preset_selected");K=e;ca=e.getUserObject();Ja=ia=aa=!0;Da.setCurrentTabPane(Fa)}};this.initTreeRoot=function(k){var e=new lb.BranchNode;e.setUserObject(ka);e.setExpanded(!0);h(e,ka,k,!0);l=e;0===l.getChildCount()?(qa.hide(),oa.setText(a.get("noMatchedResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),
oa.updateIcon("icon-search_none"),fa.show()):(fa.hide(),c.setRoot(l),qa.show(),ta.resizeHeight())};this.resizeHeight=function(){if(v){m=g(l,-1);var k=v.height(),e=31*m+Math.max(10-m,0);e>k&&(e=k);A.css("height",e+"px")}};var h=function(k,e,x,C){x&&(x=x.trim().toLowerCase());var S=function(la){var ma=la.getModelName().toLowerCase();la=la.getModelNumber();return!x||-1!==ma.indexOf(x)||la&&-1!==la.toLowerCase().indexOf(x)?!0:!1};e=e.getChildren();for(var ea=0;ea<e.length;ea++)if(e[ea]instanceof fb){var O=
new lb.BranchNode;O.setUserObject(e[ea]);O.setExpanded(!1);h(O,e[ea],x,!1);x&&0<x.length&&O.setExpanded(!0);x&&""!==x||C&&O.setExpanded(!0);var Z=e[ea].getModelType()==Ma.METRICS_MODEL&&x&&S(e[ea]);(0!==O.getChildCount()||Z)&&k.addChild(O);Z&&O.setExpanded(0!==O.getChildCount())}for(C=0;C<e.length;C++)e[C]instanceof Ma&&(!x||S(e[C]))&&(ea=new lb.LeafNode,ea.setUserObject(e[C]),k.addChild(ea))},p=function(k,e){if(e.getUserObject()instanceof fb&&e.getUserObject().getModelType()!==Ma.METRICS_MODEL)e.setSelectable(!1),
k.text(e.getUserObject().getModelName());else{var x=0,C=e.getUserObject().getModelId();if(-1!==t.indexOf(C)){var S=e.getUserObject().getModelName(),ea=e.getUserObject().getModelType(),O=$("<div id='sModelId'>"),Z=$("<span>");Z.text(a.get("modelException","\u6a21\u578b\u5f02\u5e38\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650"));Z.appendTo(O);Z=$("<span id='"+C+"'>");$(document).on("click","#"+C,function(){y.getModelDesignerEntrance()(bb,C,S,ea)});Z.text(" "+a.get("viewModel","\u67e5\u770b\u8be5\u6a21\u578b"));
Z.css({cursor:"pointer",color:"rgb(14, 95, 216)"});Z.appendTo(O);Z=mb.createWarning();e.getUserObject().getModelType()===Ma.METRICS_MODEL?I.layoutCtrlWithLRTB(Z,x+2,null,12,7,null,12):I.layoutCtrlWithLRTB(Z,x+2,null,12,9,null,12);k.append(Z);var la=new wb;la.mounting(Z);la.setSuggestedSize(265,40);la.setHtml(O);x+=20}z&&(O=$("<div>"),O.addClass("data-auth-preset"),O.text(a.get("preset","\u9884\u7f6e")),I.layoutCtrlWithLRTB(O,x,null,24,9,null,11),k.append(O),x+=30);O=$("<div id='sbm-left-tree'>");
I.layoutCtrlWithLRTB(O,x,null,16,8,null,16);Z=d[e.getUserObject().getModelType()];M.background(O,"icon-"+Z);k.append(O);O=$("<div>");I.layoutCtrlWithLRTB(O,x+20,0,null,0,null,30);x=$("<div>");I.layoutCtrlWithLRTB(x,0,0,null,0,null,30);x.css({display:"flex"});var ma=$("<span class='sbm-left-tree-text'>");ma.css({"white-space":"nowrap","text-overflow":"ellipsis",overflow:"hidden"});x.append(ma);Z=$("<span class='sbm-left-tree-number-container'>");la=$("<span>");la.addClass("sbm-left-tree-number");Z.css({"white-space":"nowrap",
"text-overflow":"ellipsis",overflow:"hidden","padding-left":"5px"});Z.append(la);var $a=e.getUserObject().getModelName(),eb=e.getUserObject().getModelNumber();if(Q){var ab=$a.trim().toLowerCase(),cb=Q.trim().toLowerCase(),jb=ab.indexOf(cb);if(-1!=jb){ab=jb+cb.length;var kb=$("<span>");kb.text($a.slice(0,jb));kb.appendTo(ma);kb=$("<span>");kb.text($a.slice(jb,ab));kb.appendTo(ma);kb.css("color","red");jb=$("<span>");jb.text($a.slice(ab));jb.appendTo(ma)}else ma.text($a);ma="( "+eb+" )";$a=ma.trim().toLowerCase().indexOf(cb);
-1!=$a?(cb=$a+cb.length,ab=$("<span>"),ab.text(ma.slice(0,$a)),ab.appendTo(la),ab=$("<span>"),ab.text(ma.slice($a,cb)),ab.appendTo(la),ab.css("color","red"),$a=$("<span>"),$a.text(ma.slice(cb)),$a.appendTo(la)):la.text("( "+eb+" )")}else ma.text(e.getUserObject().getModelName()),la.text("( "+eb+" )");Z.appendTo(x);x.appendTo(O);k.css({overflow:"visible"});k.append(O)}k.attr("title",e.getUserObject().getModelName()+" ( "+eb+" )");e=parseInt(e.getUserObject().getLevel());k.css({width:290-20*e+"px"})},
g=function(k,e){e+=1;if(k instanceof lb.BranchNode)for(var x=k.getAllChildren(),C=0;C<x.length;C++)e=g(k.getChild(C),e);return e}}function L(){var ta,K=[va.USER,va.ROLE,va.MODELSET_ROLE];La[va.USER]=new function(){var d,c,l,m,A,v=[];this.getTable=function(){return m};this.getJqUi=function(){if(!d){d=$("<div>");c=$("<div>");I.layoutCtrlWithLRTB(c,0,0,null,-35,null,35);var h=$("<div>");h.text(a.get("addUsers","\u6dfb\u52a0\u7528\u6237"));h.addClass("sbm-right-panel-sys-user-add");!z&&h.appendTo(c);
h.on("mousedown",D);l=$("<div>");l.text(a.get("deleteUsers","\u79fb\u9664\u7528\u6237"));l.addClass("sbm-right-panel-sys-user-delete");!z&&l.appendTo(c);l.on("mousedown",u);c.appendTo(d);m=new ba;m.setTabType(va.USER);A=m.getUserTableJqUi();A.appendTo(d)}return d};var D=function(){var h=ua;h.setCallBack(function(k){if(!k||!k.content)return!0;k=k.content;var e=k.selecteds;if("cancel"===k.operation||"undefined"===e)return!0;da(e)});for(var p=[],g=0;g<v.length;g++)p.push(v[g].getUserId());h.openUserForm(p)},
da=function(h){for(var p=[],g=Object.keys(h),k=0;k<v.length;k++){var e=v[k].getUserId();p.push(e)}k=[];for(e=0;e<g.length;e++)-1==p.indexOf(g[e])&&k.push(g[e]);g=k.slice(0);if(0===g.length)return!0;p=ca.getModelId();Y.createFacade(function(x){Y.getMessageCurtain().showSuccess(a.get("successfullyAdded","\u6dfb\u52a0\u6210\u529f\u3002"));for(var C=0;C<g.length;C++){var S=g[C],ea=h[S],O=new va;O.initialize(S,ea);O.setJobNumber(x[S]);v.push(O)}Wa.occur(Wa.AUTH_USER_ROLE_TYPE,Wa.getAuthUserOrRoleType(E));
m.updateTable(v)},function(x,C){return 20007014==x?(Y.getMessageCurtain().showPrompt(a.get("modelNoDeploy","\u6a21\u578b\u5df2\u53d6\u6d88\u90e8\u7f72\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20003102==x?(Y.getMessageCurtain().showPrompt(a.get("modelNoFoundOperFail","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u64cd\u4f5c\u5931\u8d25\u3002")),!0):!1}).doAddUser([p],g,va.USER)},u=function(){var h=m.getSelectedUsers();if(0===h.length)Y.getMessageCurtain().showPrompt(a.get("selectUsersToDelete",
"\u8bf7\u9009\u62e9\u9700\u8981\u79fb\u9664\u7684\u7528\u6237\u3002"));else{for(var p=[],g=0;g<h.length;g++)p.push(h[g].getUserId());g=h[0].getUserName();var k=new Pa,e=a.get("confirmDeleteUsers","\u786e\u5b9a\u8981\u79fb\u9664\u201c#1\u201d\u7b49#2\u4e2a\u7528\u6237\u5417?").replace("#1",g).replace("#2",p.length);1===h.length&&(e=a.get("confirmDeleteUser","\u786e\u5b9a\u8981\u79fb\u9664\u7528\u6237\u201c#1\u201d\u5417\uff1f").replace("#1",g));k.setConfirmMsg(e);k.setConfirmListener(function(){b(p,
!0)});k.createDialog().show()}},b=function(h,p){var g=ca.getModelId();Y.createFacade(function(k){p&&Y.getMessageCurtain().showSuccess(a.get("deleteSucceeded","\u79fb\u9664\u6210\u529f\u3002"));k=[];for(var e=0;e<v.length;e++)-1==h.indexOf(v[e].getUserId())&&k.push(v[e]);v=k;m.updateTable(v)},function(k,e){return 20007014==k?(Y.getMessageCurtain().showPrompt(a.get("modelNoDeploy","\u6a21\u578b\u5df2\u53d6\u6d88\u90e8\u7f72\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20003102==
k?(Y.getMessageCurtain().showPrompt(a.get("modelNoFoundOperFail","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u64cd\u4f5c\u5931\u8d25\u3002")),!0):!1}).doDeleteUser(g,h,E)};this.getTitle=function(){return a.get("currentSysUser","\u5f53\u524d\u7cfb\u7edf\u7528\u6237")};this.into=function(){E=va.USER;ca&&aa?(m.clearTable(),wa(ca.getModelId(),va.USER,function(){v=ha.slice(0);m.updateTable(v);aa=!1},ca.getModelType())):m.updateTable(v)}};La[va.ROLE]=new function(){var d,c,l,m,A,v=[];this.getTable=function(){return m};
this.getJqUi=function(){if(!d){d=$("<div>");c=$("<div>");I.layoutCtrlWithLRTB(c,0,0,null,-35,null,35);var h=$("<div>");h.text(a.get("addRoles","\u6dfb\u52a0\u89d2\u8272"));h.addClass("sbm-right-panel-sys-role-add");!z&&h.appendTo(c);h.on("mousedown",D);l=$("<div>");l.text(a.get("deleteRoles","\u79fb\u9664\u89d2\u8272"));l.addClass("sbm-right-panel-sys-role-delete");!z&&l.appendTo(c);l.on("mousedown",u);c.appendTo(d);m=new ba;m.setTabType(va.ROLE);A=m.getUserTableJqUi();A.appendTo(d)}return d};var D=
function(){var h=ua;h.setCallBack(function(k){if(!k||!k.content)return!0;k=k.content;var e=k.selecteds;if("cancel"===k.operation||"undefined"===e)return!0;da(e)});for(var p=[],g=0;g<v.length;g++)p.push(v[g].getUserId());h.openRoleForm(p)},da=function(h){for(var p=[],g=Object.keys(h),k=0;k<v.length;k++){var e=v[k].getUserId();p.push(e)}k=[];for(e=0;e<g.length;e++)-1==p.indexOf(g[e])&&k.push(g[e]);g=k.slice(0);if(0===g.length)return!0;p=ca.getModelId();Y.createFacade(function(x){Y.getMessageCurtain().showSuccess(a.get("successfullyAdded",
"\u6dfb\u52a0\u6210\u529f\u3002"));for(var C=0;C<g.length;C++){var S=g[C],ea=h[S],O=new va;O.initialize(S,ea);O.setJobNumber(x[S]);v.push(O)}Wa.occur(Wa.AUTH_USER_ROLE_TYPE,Wa.getAuthUserOrRoleType(E));m.updateTable(v)},function(x,C){return 20007014==x?(Y.getMessageCurtain().showPrompt(a.get("modelNoDeploy","\u6a21\u578b\u5df2\u53d6\u6d88\u90e8\u7f72\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20003102==x?(Y.getMessageCurtain().showPrompt(a.get("modelNoFoundOperFail","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u64cd\u4f5c\u5931\u8d25\u3002")),
!0):!1}).doAddUser([p],g,va.ROLE)},u=function(){var h=m.getSelectedUsers();if(0===h.length)Y.getMessageCurtain().showPrompt(a.get("selectRolesToDelete","\u8bf7\u9009\u62e9\u9700\u8981\u79fb\u9664\u7684\u89d2\u8272\u3002"));else{for(var p=[],g=0;g<h.length;g++)p.push(h[g].getUserId());g=h[0].getUserName();var k=new Pa,e=a.get("confirmDeleteRoles","\u786e\u5b9a\u8981\u79fb\u9664\u201c#1\u201d\u7b49#2\u4e2a\u89d2\u8272\u5417?").replace("#1",g).replace("#2",p.length);1===h.length&&(e=a.get("confirmDeleteRole",
"\u786e\u5b9a\u8981\u79fb\u9664\u89d2\u8272\u201c#1\u201d\u5417\uff1f").replace("#1",g));k.setConfirmMsg(e);k.setConfirmListener(function(){b(p,!0)});k.createDialog().show()}},b=function(h,p){var g=ca.getModelId();Y.createFacade(function(k){p&&Y.getMessageCurtain().showSuccess(a.get("deleteSucceeded","\u79fb\u9664\u6210\u529f\u3002"));k=[];for(var e=0;e<v.length;e++)-1==h.indexOf(v[e].getUserId())&&k.push(v[e]);v=k;m.updateTable(v)},function(k,e){return 20007014==k?(Y.getMessageCurtain().showPrompt(a.get("modelNoDeploy",
"\u6a21\u578b\u5df2\u53d6\u6d88\u90e8\u7f72\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20003102==k?(Y.getMessageCurtain().showPrompt(a.get("modelNoFoundOperFail","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u64cd\u4f5c\u5931\u8d25\u5931\u8d25\u3002")),!0):!1}).doDeleteUser(g,h,E)};this.getTitle=function(){return a.get("currentSysRole","\u5f53\u524d\u7cfb\u7edf\u89d2\u8272")};this.into=function(){E=va.ROLE;Ja?(m.clearTable(),wa(ca.getModelId(),va.ROLE,function(){v=ha.slice(0);
m.updateTable(v);Ja=!1},ca.getModelType())):m.updateTable(v)}};La[va.MODELSET_ROLE]=new function(){var d,c,l,m,A,v=[];this.getTable=function(){return m};this.getJqUi=function(){if(!d){d=$("<div>");c=$("<div>");I.layoutCtrlWithLRTB(c,0,0,null,-35,null,35);var p=$("<div>");p.text(a.get("modelSetRoleManage","\u6a21\u578b\u96c6\u89d2\u8272\u7ba1\u7406"));p.addClass("sbm-right-panel-model-role-manage");p.appendTo(c);p.on("mousedown",D);l=$("<div>");l.text(a.get("deleteRoles","\u79fb\u9664\u89d2\u8272"));
l.addClass("sbm-right-panel-model-role-delete");!z&&l.appendTo(c);l.on("mousedown",da);p=$("<div>");p.text(a.get("addRoles","\u6dfb\u52a0\u89d2\u8272"));p.addClass("sbm-right-panel-model-role-add");!z&&p.appendTo(c);p.on("mousedown",b);c.appendTo(d);m=new ba;m.setTabType(va.MODELSET_ROLE);A=m.getUserTableJqUi();A.appendTo(d)}return d};var D=function(){y.getDataAuthorityManager()(bb,xb,z)},da=function(){var p=m.getSelectedUsers();if(0===p.length)Y.getMessageCurtain().showPrompt(a.get("selectRolesToDelete",
"\u8bf7\u9009\u62e9\u9700\u8981\u79fb\u9664\u7684\u89d2\u8272\u3002"));else{for(var g=[],k=0;k<p.length;k++)g.push(p[k].getUserId());k=p[0].getUserName();var e=new Pa,x=a.get("confirmDeleteRoles","\u786e\u5b9a\u8981\u79fb\u9664\u201c#1\u201d\u7b49#2\u4e2a\u89d2\u8272\u5417?").replace("#1",k).replace("#2",g.length);1===p.length&&(x=a.get("confirmDeleteRole","\u786e\u5b9a\u8981\u79fb\u9664\u89d2\u8272\u201c#1\u201d\u5417\uff1f").replace("#1",k));e.setConfirmMsg(x);e.setConfirmListener(function(){u(g,
!0)});e.createDialog().show()}},u=function(p,g){var k=ca.getModelId();Y.createFacade(function(e){g&&Y.getMessageCurtain().showSuccess(a.get("deleteSucceeded","\u79fb\u9664\u6210\u529f\u3002"));e=[];for(var x=0;x<v.length;x++)-1==p.indexOf(v[x].getUserId())&&e.push(v[x]);v=e;m.updateTable(v)},function(e,x){return 20007014==e?(Y.getMessageCurtain().showPrompt(a.get("modelNoDeploy","\u6a21\u578b\u5df2\u53d6\u6d88\u90e8\u7f72\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20003102==
e?(Y.getMessageCurtain().showPrompt(a.get("modelNoFoundOperFail","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u64cd\u4f5c\u5931\u8d25\u5931\u8d25\u3002")),!0):!1}).doDeleteUser(k,p,E)},b=function(){var p=new Na;p.setFunAfterSelect(h);for(var g=[],k=0;k<v.length;k++)20007007!==v[k].getErrorCode()&&g.push(v[k].getUserId());p.setPreSelected(g);p.showDialog()},h=function(p){for(var g=[],k=[],e=[],x=0;x<v.length;x++)e.push(v[x].getUserId());for(x=0;x<p.length;x++){var C=p[x].getModelSetRoleId();k.push(C);
-1==e.indexOf(C)&&g.push(C)}if(0===g.length)return!0;k=ca.getModelId();Y.createFacade(function(S){Y.getMessageCurtain().showSuccess(a.get("successfullyAdded","\u6dfb\u52a0\u6210\u529f\u3002"));for(S=0;S<p.length;S++){var ea=p[S].getModelSetRoleId();if(-1!=g.indexOf(ea)){var O=p[S].getModelSetRoleName(),Z=new va;Z.initialize(ea,O);v.push(Z)}}Wa.occur(Wa.AUTH_USER_ROLE_TYPE,Wa.getAuthUserOrRoleType(E));m.updateTable(v)},function(S,ea){return 20007014==S?(Y.getMessageCurtain().showPrompt(a.get("modelNoDeploy",
"\u6a21\u578b\u5df2\u53d6\u6d88\u90e8\u7f72\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20003102==S?(Y.getMessageCurtain().showPrompt(a.get("modelNoFoundOperFail","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u64cd\u4f5c\u5931\u8d25\u3002")),!0):!1}).doAddUser([k],g,va.MODELSET_ROLE)};this.getTitle=function(){return a.get("currentModelSetRole","\u5f53\u524d\u6a21\u578b\u96c6\u89d2\u8272")};this.into=function(){E=va.MODELSET_ROLE;ia?(m.clearTable(),wa(ca.getModelId(),va.MODELSET_ROLE,
function(){v=ha.slice(0);m.updateTable(v);ia=!1},ca.getModelType())):m.updateTable(v)}};this.getJqUi=function(){if(!ta){ta=$("<div>");I.layoutCtrlWithLRTB(ta,5,0,null,10,0,null);Da=new Ta;Da.setTabLevel(Ta.SECOND_LEVEL);for(var d=!0,c=0;c<K.length;c++){var l=K[c];Da.addTab(La[l],d);d&&(E=l,Fa=Da.getCurrentTabPane());d=!1}Da.getJqUi().appendTo(ta)}return ta}}function ba(){function ta(){KTDefaultCellRender.call(this,c);var u=this,b=this.paintCellUI;this.paintCellUI=function(g,k){var e=u.getCurrentRowIdx(),
x=u.getCurrentColIdx();if(e>=H.getHeadRowCount()){var C=u.getCurrentRow().getUserObject(),S=$(g),ea=$("<div>");if(0==x)g=new gb,g.setChecked(!1),g.setUserObject(C),g.addCheckedListener(function(la,ma){if(!ma)return!0;if(la.isChecked()){la=!0;for(ma=0;ma<m.length;ma++)if(!m[ma].isChecked()){la=!1;break}A.setChecked(la)}else A.setChecked(!1)}),m.push(g),C=$("<div>"),g=g.getJqUi(),g.addClass("sbm-right-panel-viewer-index"),g.appendTo(C),g=$("<div>"),g.text(e-2),g.addClass("sbm-right-panel-viewer-index"),
g.css("top","-6px"),g.appendTo(C),C.addClass("sbm-right-panel-viewer-index-container"),S.append(C);else if(1==x)e=15,C.getErrorCode()&&0!==C.getErrorCode()&&(e=mb.createWarning(),I.layoutCtrlWithLRTB(e,15,null,12,14,null,12),e.appendTo(S),20007012===C.getErrorCode()?e.attr("title",a.get("userDisabled","\u8be5\u7cfb\u7edf\u7528\u6237\u5df2\u88ab\u7981\u7528")):20007013===C.getErrorCode()?e.attr("title",a.get("roleDisabled","\u8be5\u7cfb\u7edf\u89d2\u8272\u5df2\u88ab\u7981\u7528")):100===C.getErrorCode()&&
e.attr("title",a.get("userIsCoop","\u8be5\u7528\u6237\u662f\u672c\u6a21\u578b\u96c6\u7684\u534f\u4f5c\u6210\u5458\uff0c\u62e5\u6709\u6a21\u578b\u96c6\u4e0b\u6240\u6709\u6a21\u578b\u7684\u5168\u90e8\u6570\u636e\u6743\u9650\uff0c\u672c\u6761\u6743\u9650\u8bbe\u7f6e\u65e0\u6548\u3002")),e=32),ea.text(C.getUserName()),ea.attr("title",C.getUserName()),I.layoutCtrlWithLRTB(ea,e,0,null,10,null,23),ea.css("line-height","23px"),S.append(ea);else if(2==x)ea.text(C.getJobNumber()),ea.attr("title",C.getJobNumber()),
I.layoutCtrlWithLRTB(ea,15,0,null,10,null,23),ea.css("line-height","23px"),S.append(ea);else if(3==x)e=new ob,e.setUserObject(C),e.addStateChangeListener(h),e.setOn(C.isEnable()),e.setEnabled(!z),e=e.getJqUi(),e.addClass("sbm-right-panel-enable-button"),z&&e.css("cursor","not-allowed"),C=$("<div>"),C.addClass("sbm-right-panel-enable-button-container"),e.appendTo(C),S.append(C);else if(4==x){var O=$("<div>");M.backgroundWithHover(O,"btn-edit");O.addClass("sbm-right-panel-edit-icon");O.on("click",function(){var la=
parseInt(O.attr("rowIdx")),ma=c.getRow(la).getUserObject().isInheritPermissions(),$a=c.getRow(la).getUserObject().getUserId();ma=E===va.USER?ma:!1;var eb=new Xa(ma,ca,E,$a,z);ca&&(ma=ca.getModelId(),t&&-1!==t.indexOf(ma)&&(K.checkModelExistMV(ma,function(ab){ab&&eb.setErrorPrompt(a.get("onlyShowDataAuth","\u6a21\u578b\u5f02\u5e38\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002\u7531\u4e8e\u5f53\u524d\u6a21\u578b\u5df2\u5b58\u5728\u7269\u5316\u6570\u636e\uff0c\u4ee5\u4e0b\u4ec5\u5c55\u793a\u5bf9\u7269\u5316\u6570\u636e\u751f\u6548\u7684\u6570\u636e\u6743\u9650\u5185\u5bb9\u3002"))}),
eb.setFooterClosingOnly(!0)));eb.setFunAfterSettingAuth(function(ab,cb){m=[];c.getRow(la).getUserObject().setEnable(!0);c.getRow(la).getUserObject().setDataAuth(cb);c.updateUI()});eb.showDialog()});O.attr("title",a.get("editPermission","\u8bbe\u7f6e\u6570\u636e\u6743\u9650"));O.attr("rowIdx",e);g=$("<div>");g.addClass("sbm-right-panel-edit-icon-container");O.appendTo(g);if(E===va.USER&&ca.getModelType()!==Ma.METRIC){var Z=$("<div>");C.isInheritPermissions()?(M.background(Z,"btn-inherit"),Z.attr("title",
a.get("permissionInherited","\u672c\u6761\u6743\u9650\u540c\u65f6\u53d7\u7528\u6237\u6743\u9650\u548c\u89d2\u8272\u6743\u9650\u7684\u5f71\u54cd\u3002\u70b9\u51fb\u56fe\u6807\u53ef\u8c03\u6574\u4e3a\u4ee5\u5355\u72ec\u8bbe\u7f6e\u7684\u7528\u6237\u6743\u9650\u4e3a\u51c6\u3002"))):(M.background(Z,"btn-inherit_hover"),Z.attr("title",a.get("noPermissionInherited","\u672c\u6761\u6743\u9650\u4ee5\u5355\u72ec\u8bbe\u7f6e\u7684\u7528\u6237\u6743\u9650\u4e3a\u51c6\uff0c\u4e0d\u53d7\u89d2\u8272\u6743\u9650\u7684\u5f71\u54cd\u3002\u70b9\u51fb\u56fe\u6807\u53ef\u6062\u590d\u4e3a\u540c\u65f6\u53d7\u7528\u6237\u6743\u9650\u548c\u89d2\u8272\u6743\u9650\u7684\u5f71\u54cd\u3002")));
Z.addClass("sbm-right-panel-edit-icon");Z.css({cursor:"pointer","margin-left":"25px"});!z&&Z.on("click",function(){var la=parseInt(Z.attr("rowIdx"));p(la)});Z.attr("rowIdx",e);Z.css("cursor",z?"not-allowed":"pointer");Z.appendTo(g)}g.appendTo(S)}else 5==x?(g=C.getQingModelerDataAuth(),K.paintSummaryCell(S,g,e,C.isEnable(),ca.getModelType()===Ma.METRIC),ea=C.getDataAuthId(),ja[ea]=S,pa[ea]=C,Oa[ea]=e,!g&&ea&&(S.empty(),e=$("<div>"),e.addClass("sa-common-loading-icon"),e.css("background-image",T.getIconUrl("common",
"loading.gif")),I.layoutCtrlCenterAlign(e,23),I.layoutCtrlMiddleAlign(e,23),e.appendTo(S))):b(g,k)}else b(g,k),0==x&&1==e&&(A=new gb,A.addCheckedListener(function(la,ma){if(ma)for(ma=0;ma<m.length;ma++)m[ma].setChecked(la.isChecked())}),A.setChecked(!1),S=$("<div>"),e=A.getJqUi(),e.addClass("sbm-right-panel-viewer-index"),e.appendTo(S),e=$("<div>"),e.text("#"),e.addClass("sbm-right-panel-viewer-index"),e.css("top","-6px"),e.appendTo(S),S.addClass("sbm-right-panel-viewer-index-container"),S.css("top",
"3px"),S.appendTo(g)),$(g).css("color","#666")};var h=function(g,k,e){if(k){var x=g.getUserObject();k=ca.getModelId();var C=ca.getModelType();x=x.getUserId();Y.createFacade(function(S){m=[];g.getUserObject().setEnable(e);c.updateUI()},function(S,ea){return 20007014==S?(Y.getMessageCurtain().showPrompt(a.get("modelNoDeploy","\u6a21\u578b\u5df2\u53d6\u6d88\u90e8\u7f72\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20007005==S?(Y.getMessageCurtain().showPrompt(a.get("modelNoFound",
"\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20007006==S?(Y.getMessageCurtain().showPrompt(a.get("modelNoDeploy","\u6a21\u578b\u5df2\u53d6\u6d88\u90e8\u7f72\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20003102==S?(Y.getMessageCurtain().showPrompt(a.get("modelNoFound","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):!1}).authorizedDataAuth(k,x,e,E,C,bb)}},p=function(g){var k=
ca.getModelId(),e=c.getRow(g).getUserObject(),x=e.getUserId(),C=!e.isInheritPermissions();Y.createFacade(function(S){m=[];c.getRow(g).getUserObject().setInheritPermissions(C);c.updateUI();Wa.occur(Wa.DATA_AUTH_SETTING_INHERIT_METHOD,Wa.getAuthInheritMethod(C))},function(S,ea){return 20007014==S?(Y.getMessageCurtain().showPrompt(a.get("modelNoDeploy","\u6a21\u578b\u5df2\u53d6\u6d88\u90e8\u7f72\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20003102==S?(Y.getMessageCurtain().showPrompt(a.get("modelNoFound",
"\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):!1}).setInherit(k,x,C,E)}}var K=this,d,c,l,m=[],A,v,D={};D[va.USER]=a.get("sysUserSummary","\u5f53\u524d\u7cfb\u7edf\u7528\u6237\u7684\u6570\u636e\u6743\u9650\u6458\u8981");D[va.ROLE]=a.get("sysRoleSummary","\u5f53\u524d\u7cfb\u7edf\u89d2\u8272\u7684\u6570\u636e\u6743\u9650\u6458\u8981");D[va.MODELSET_ROLE]=a.get("modelSetRoleSummary","\u5f53\u524d\u6a21\u578b\u96c6\u89d2\u8272\u7684\u6570\u636e\u6743\u9650\u6458\u8981");
this.setTabType=function(u){v=u};this.clearTable=function(){H.clearWithoutHead(c);c.updateUI()};this.getSelectedUsers=function(){for(var u=[],b=0;b<m.length;b++)m[b].isChecked()&&u.push(m[b].getUserObject());return u};this.getUserTableJqUi=function(){if(!l){l=$("<div>");I.layoutCtrlWithLRTB(l,0,0,null,0,0,null);c=H.createTable();var u=$(c.getUI());I.layoutCtrlWithLRTB(u,0,0,null,0,0,null);c.setCellRender(new ta);c.setSyncUIWhenModelChanged(!1);c.setDraggableAdjusting(!0,3,0);c.setFrozenRows(3);c.setColumnFitVisibleWidth(!0);
u.appendTo(l)}return l};this.updateTable=function(u){m=[];H.clear(c);c.addColumns(6);var b=H.createHeadRow(c);b.getCell(0).setValue("");b.getCell(1).setValue(a.get("userName","\u7528\u6237\u540d\u79f0"));b.getCell(2).setValue(a.get("userId","\u5de5\u53f7"));E!==va.USER&&(b.getCell(1).setValue(a.get("roleName","\u89d2\u8272\u540d\u79f0")),b.getCell(2).setValue(a.get("code","\u7f16\u7801")));b.getCell(3).setValue(a.get("enable","\u542f\u7528\u72b6\u6001"));b.getCell(4).setValue(a.get("settings","\u6570\u636e\u6743\u9650\u8bbe\u7f6e"));
b.getCell(5).setValue(D[v]);c.getColumn(0).setWidth(122);c.getColumn(1).setWidth(240);c.getColumn(2).setWidth(240);c.getColumn(3).setWidth(240);c.getColumn(4).setWidth(240);c.getColumn(5).setWidth(458);E===va.MODELSET_ROLE&&(c.getColumn(0).setWidth(122),c.getColumn(1).setWidth(240),c.getColumn(2).setHide(!0),c.getColumn(3).setWidth(240),c.getColumn(4).setWidth(240),c.getColumn(5).setWidth(699));b.setHeight(26);for(b=0;b<u.length;b++){var h=u[b],p=H.createRow(c,!0);p.setHeight(40);p.setUserObject(h)}c.updateUI();
d||(d=new V,d.setCallbackImmediately(function(){K.resize()}),d.observe())};this.resize=function(){if(pb&&E===v){var u=m.slice(0);m=[];c.updateUI();if(u.length===m.length)for(var b=0;b<u.length;b++)m[b].setChecked(u[b].isChecked())}};this.checkModelExistMV=function(u,b){Y.createFacade(function(h){b(h)},function(h,p){return!1}).checkModelExistMV(u)};this.paintSummaryCell=function(u,b,h,p,g){u.empty();g=b?b.toString(g):"";var k=g.split("\n"),e=$("<div>");e.text(k[0]);I.layoutCtrlWithLRTB(e,15,80,null,
2,null,16);e.css({overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"});var x=$("<div>");x.text(k[1]);I.layoutCtrlWithLRTB(x,15,80,null,22,null,16);x.css({overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"});p||(e.css("opacity","0.5"),x.css("opacity","0.5"));var C;b&&(C=b.getModels());C&&C[0]&&C[0].getRowAuth();var S=$("<div>");S.css("cursor","pointer");M.backgroundWithHover(S,"btn-delete");I.layoutCtrlWithLRTB(S,null,34,16,14,null,16);S.on("click",function(){var ea=
new sb;ea.setText(a.get("deleteDataPermission","\u6e05\u7a7a\u884c\u7ea7\u548c\u5217\u7ea7\u6570\u636e\u6743\u9650\u8bbe\u7f6e\u540e\u5c06\u65e0\u6cd5\u6062\u590d\uff0c\u786e\u5b9a\u6e05\u7a7a\u5417\uff1f"));ea.setConfirmedListener(function(O){var Z=parseInt(S.attr("rowIdx"));O&&da(Z)});ea.show(S)});S.attr("title",a.get("deleteAllPermissions","\u6e05\u7a7a\u884c\u7ea7\u548c\u5217\u7ea7\u6570\u636e\u6743\u9650\u8bbe\u7f6e"));S.attr("rowIdx",h);!z&&S.appendTo(u);""===g?S.css("display","none"):S.css("display",
"block");!k[1]&&e.css({top:"50%",transform:"translateY(-50%)"});u.append(e);u.append(x);u.attr("title",g)};var da=function(u){var b=ca.getModelId(),h=c.getRow(u).getUserObject().getUserId();Y.createFacade(function(p){Y.getMessageCurtain().showSuccess(a.get("successToDeletePermission","\u5220\u9664\u6210\u529f\u3002"));m=[];c.getRow(u).getUserObject().setDataAuth(new hb);c.updateUI()},function(p,g){return 20007004==p?(Y.getMessageCurtain().showPrompt(a.get("deleteFail","\u8be5\u6761\u6570\u636e\u5df2\u88ab\u5220\u9664\uff0c\u64cd\u4f5c\u5931\u8d25\u3002")),
!0):!1}).deletePermission(b,h,E)}}var z=P,G,B,U,ka,ca,ha=[],Da,Fa,E,Q,oa,fa,za,qa,Ca,f,r,t=[],R,w,aa=!1,Ja=!1,ia=!1,La={},Oa={},ja={},pa={};this.resize=function(){za.resizeHeight();Da.getCurrentTabPane().getTable().resize()};this.setErrorStateListener=function(ta){R=ta};this.setModelStateListener=function(ta){w=ta};this.getModelSetMainAreaJqUi=function(){G||(G=$("<div>"),G.addClass("sbm-container"),B=$("<div>"),B.addClass("sbm-left-panel"),(new J).getLeftToolBarJqUi().appendTo(B),za=new N,qa=za.getLeftTreeTableJqUi(),
qa.appendTo(B),oa=new Ka,fa=oa.getNoDataTableJqUi(),oa.setTopPx(46),fa.appendTo(B),fa.hide(),U=$("<div>"),U.addClass("sbm-right-panel"),r=(new L).getJqUi(),r.appendTo(U),r.hide(),Ca=new Ka,f=Ca.getNoDataTableJqUi(),f.appendTo(U),f.hide(),B.appendTo(G),U.appendTo(G));return G};var wa=function(ta,K,d,c){Y.createFacade(function(l){ha=[];var m=[];if(l)for(var A=0;A<l.length;A++){var v=new va;v.fromJsonObject(l[A]);ha.push(v);m.push(v.getDataAuthId())}d&&d();l=[];for(A=1;A<=m.length;A++)l.push(m[A-1]),
0===A%5&&(Qa(l,K,c),l=[]);0<l.length&&Qa(l,K,c)},function(l,m){d&&d();return 20007003==l?(Y.getMessageCurtain().showPrompt(a.get("modelSetNoFound","\u6a21\u578b\u96c6\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u5148\u5237\u65b0\u754c\u9762\u3002")),!0):21000002==l?(Y.getMessageCurtain().showPrompt(a.get("modelSetNoFound","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u5148\u5237\u65b0\u754c\u9762\u3002")),!0):20003102==l?(Y.getMessageCurtain().showPrompt(a.get("modelNoFoundRefresh","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u5148\u5237\u65b0\u754c\u9762\u3002")),
!0):!1}).loadUsableUserDataAuth(bb,ta,K)},Qa=function(ta,K,d){var c=Y.createFacade(function(l){if(l)for(var m=0;m<ta.length;m++){var A=ta[m],v=new hb;l[A]&&v.fromJsonObject(l[A]);var D=ja[A];if(D){var da=pa[A];da.setDataAuth(v);A=Oa[A];La[K].getTable().paintSummaryCell(D,v,A,da.isEnable(),d===Ma.METRIC)}}},function(l,m){return!0});c.setShowBlocking(!1);c.queryDataAuthContents(ta)}}function ya(P){function J(){var K=this,d,c,l,m,A,v,D,da,u,b,h,p=[],g,k={};k[va.USER]=[];k[va.ROLE]=[];k[va.MODELSET_ROLE]=
[];var e,x;this.updateModelState=function(na){na&&u.show();!na&&u.hide()};this.isCurrentTabModelEmpty=function(){return 0===k[E].length};this.setSearchCallBack=function(na){x=na};this.refreshModel=function(){Y.createFacade(function(na){var Ha=[];if(na)for(var Ia=0;Ia<na.length;Ia++){var Aa=new vb;Aa.fromJsonObject(na[Ia]);20001005===Aa.getStateCode()&&Ha.push(Aa.getModelId())}L.updateModelState(0!==na.length);L.updateErrorModels(Ha);na=C();la(na,!0)},function(na,Ha){return!1}).checkModel(bb)};var C=
function(){switch(E){case va.USER:return c;case va.ROLE:return l;case va.MODELSET_ROLE:return m}};this.getJqUi=function(){d||(d=S());return d};var S=function(){d=$("<div>");I.layoutCtrlWithLRTB(d,0,0,null,0,0,null);c=$("<div>");c.text(a.get("currentSysUser","\u5f53\u524d\u7cfb\u7edf\u7528\u6237"));c.addClass("sbu-left-panel-user-label");c.appendTo(d);c.on("mousedown",function(){if(E===va.USER)return!1;E=va.USER;la(c)});l=$("<div>");l.text(a.get("currentSysRole","\u5f53\u524d\u7cfb\u7edf\u89d2\u8272"));
l.addClass("sbu-left-panel-user-label");l.css("left","100px");l.appendTo(d);l.on("mousedown",function(){if(E===va.ROLE)return!1;E=va.ROLE;la(l)});m=$("<div>");m.text(a.get("currentModelSetRole","\u5f53\u524d\u6a21\u578b\u96c6\u89d2\u8272"));m.addClass("sbu-left-panel-user-label");m.css({left:"200px",width:"120px"});m.appendTo(d);m.on("mousedown",function(){if(E===va.MODELSET_ROLE)return!1;E=va.MODELSET_ROLE;la(m)});da=$("<div>");da.addClass("sbu-left-panel-link-container");da.appendTo(d);da.hide();
var na=$("<div>");na.addClass(" sbu-left-panel-model-role-manage");na.text(a.get("modelSetRoleManage","\u6a21\u578b\u96c6\u89d2\u8272\u7ba1\u7406"));na.appendTo(da);na.on("mousedown",kb);v=new yb;v.setBorderVisible(!1);v.setEnabled(!0);v.addSelectedChangedListener(O);v.addPressedListener(Z);v.setCustomItemPainter(ea);D=v.getJqUi();I.layoutCtrlWithLRTB(D,0,0,null,36,32,null);D.appendTo(d);u=$("<div>");u.text(a.get("addUsers","\u6dfb\u52a0\u7528\u6237"));u.addClass("sbu-left-panel-add-user");!ba&&u.appendTo(d);
u.on("mousedown",eb);!Ca&&u.hide();b=new Ka;h=b.getNoDataTableJqUi();b.setTopPx(100);b.setText(a.get("noUser","\u8bf7\u5148\u6dfb\u52a0\u7528\u6237"));!ba&&h.appendTo(d);h.hide();E=va.USER;la(c);e||(e=new V,e.setCallbackImmediately(function(){K.refreshHeight()}),e.observe());return d},ea=function(na,Ha){na.css({"font-size":"14px",height:"30px"});var Ia=$("<div>");I.layoutCtrlWithLRTB(Ia,0,0,null,0,0,null);Ia.appendTo(na);var Aa=$("<div>");M.background(Aa,"btn-cooperation");I.layoutCtrlWithLRTB(Aa,
2,null,16,7,null,16);Aa.appendTo(Ia);var Va=$("<div>");Va.addClass("sbu-left-panel-list-item-label");Va.text(Ha.getUserName());Va.appendTo(Ia);Va.attr("title",Ha.getUserName());Ha.getErrorCode()&&0!==Ha.getErrorCode()&&(Va.css({left:"35px"}),Aa=mb.createWarning(),I.layoutCtrlWithLRTB(Aa,20,null,12,8,null,12),20007012===Ha.getErrorCode()?Aa.attr("title",a.get("userDisabled","\u8be5\u7cfb\u7edf\u7528\u6237\u5df2\u88ab\u7981\u7528")):20007013===Ha.getErrorCode()?Aa.attr("title",a.get("roleDisabled",
"\u8be5\u7cfb\u7edf\u89d2\u8272\u5df2\u88ab\u7981\u7528")):100===Ha.getErrorCode()&&Aa.attr("title",a.get("userIsCoop","\u8be5\u7528\u6237\u662f\u672c\u6a21\u578b\u96c6\u7684\u534f\u4f5c\u6210\u5458\uff0c\u62e5\u6709\u6a21\u578b\u96c6\u4e0b\u6240\u6709\u6a21\u578b\u7684\u5168\u90e8\u6570\u636e\u6743\u9650\uff0c\u672c\u6761\u6743\u9650\u8bbe\u7f6e\u65e0\u6548\u3002")),Aa.appendTo(Ia));var Ua=$("<div>");M.background(Ua,"btn-delete");Ua.addClass("sbu-left-panel-list-item-delete");!ba&&Ua.appendTo(Ia);
Ua.attr("title",a.get("deleteRoles","\u79fb\u9664\u89d2\u8272"));E===va.USER&&Ua.attr("title",a.get("deleteUsers","\u79fb\u9664\u7528\u6237"));Ua.on("mousedown",function(){var db=new sb;db.setText(a.get("confirmDeleteRole","\u786e\u5b9a\u8981\u79fb\u9664\u89d2\u8272\u201c#1\u201d\u5417\uff1f").replace("#1",Ua.attr("userName")));E===va.USER&&db.setText(a.get("confirmDeleteUser","\u786e\u5b9a\u8981\u79fb\u9664\u7528\u6237\u201c#1\u201d\u5417\uff1f").replace("#1",Ua.attr("userName")));db.setConfirmedListener(function(qb){qb&&
$a([Ua.attr("userId")],!0)});db.show(Ua)});Ua.attr("userId",Ha.getUserId());Ua.attr("userName",Ha.getUserName());Ua.hide();na.on("mouseover",function(){Ha.getUserId()!==fa&&(Ua.show(),Va.css("right","30px"))});na.on("mouseout",function(){Ha.getUserId()!==fa&&(Ua.hide(),Va.css("right","0px"))})},O=function(na,Ha,Ia){var Aa;$("<div>");$("<div>");$("<div>");for(var Va=0;Va<Ha.length;Va++)if(Aa=na.getItemUiByModel(Ha[Va])){var Ua=Aa.find(".sbu-left-panel-list-item-delete");M.background(Ua,"btn-delete");
Ua.hide();Aa=Aa.find(".sbu-left-panel-list-item-label");Aa.css("right","0px")}for(Ha=0;Ha<Ia.length;Ha++)Aa=na.getItemUiByModel(Ia[Ha]),Ua=Aa.find(".sbu-left-panel-list-item-delete"),M.background(Ua,"btn-delete_white"),Ua.show(),Aa=Aa.find(".sbu-left-panel-list-item-label"),Aa.css("right","30px")},Z=function(na,Ha){na=na.getSelecteds();na[0].getUserId()!==fa&&(g=na[0],fa=na[0].getUserId(),ia(fa))},la=function(na,Ha){Y.createFacade(function(Ia){k[E]=[];if(!Ia||0===Ia.length)return ma(na),!0;for(var Aa=
0;Aa<Ia.length;Aa++){var Va=new va;Va.fromJsonObject(Ia[Aa]);k[E].push(Va)}ma(na,Ha)},function(Ia,Aa){return!1}).loadModelSetViewer(E,bb)},ma=function(na,Ha){p=k[E].slice(0);A&&(A.removeClass("sbu-left-panel-user-label-selected"),A.addClass("sbu-left-panel-user-label"));A=na;A.removeClass("sbu-left-panel-user-label");A.addClass("sbu-left-panel-user-label-selected");E===va.USER?(da.hide(),u.text(a.get("addUsers","\u6dfb\u52a0\u7528\u6237")),D.css("top","40px"),b.setText(a.get("noUser","\u8bf7\u5148\u6dfb\u52a0\u7528\u6237"))):
(E===va.MODELSET_ROLE?(da.show(),u.text(a.get("addRoles","\u6dfb\u52a0\u89d2\u8272")),D.css("top","74px")):(da.hide(),u.text(a.get("addRoles","\u6dfb\u52a0\u89d2\u8272")),D.css("top","40px")),b.setText(a.get("noRole","\u8bf7\u5148\u6dfb\u52a0\u89d2\u8272")));K.refreshHeight();v.setItemModels(p);g=null;Ha||(fa=null);v.setSelecteds([]);if(0<p.length){h.hide();if(Ha){for(na=0;na<p.length;na++)if(p[na].getUserId()==fa){g=p[na];break}g?v.setSelecteds([g]):v.setSelecteds([p[0]])}else v.setSelecteds([p[0]]),
fa=p[0].getUserId(),g=p[0];ka.css("display","block");ia(fa)}else Ca&&h.show(),!Ca&&h.hide(),ka.css("display","none"),x&&x()};this.refreshHeight=function(){var na=30*p.length+2,Ha=D.css("top").indexOf("px");Ha=D.css("top").slice(0,Ha);var Ia=parseInt(Ha)+na,Aa=d.height()-parseInt(Ha)-32;Aa<na&&(na=Aa,Ia=parseInt(Ha)+na);D.css("height",na+"px");u.css("top",Ia+"px")};var $a=function(na,Ha){Y.createFacade(function(Ia){Ha&&Y.getMessageCurtain().showSuccess(a.get("deleteSucceeded","\u79fb\u9664\u6210\u529f\u3002"));
Ia=[];for(var Aa=0;Aa<p.length;Aa++)-1==na.indexOf(p[Aa].getUserId())&&Ia.push(p[Aa]);k[E]=Ia;ma(A)},function(Ia,Aa){return 20003102==Ia?(Y.getMessageCurtain().showPrompt(a.get("modelNoFound","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u5220\u9664\u6570\u636e\u6743\u9650\u3002")),!0):20007003==Ia?(Y.getMessageCurtain().showPrompt(a.get("modelSetNoFound","\u6a21\u578b\u96c6\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u5220\u9664\u6570\u636e\u6743\u9650\u3002")),!0):!1}).deleteDataAuthByModelSetId(bb,
na,E)},eb=function(){if(E===va.MODELSET_ROLE)return cb(),!0;var na=ua;na.setCallBack(function(Aa){if(!Aa||!Aa.content)return!0;Aa=Aa.content;var Va=Aa.selecteds;if("cancel"===Aa.operation||"undefined"===Va)return!0;ab(Va)});for(var Ha=[],Ia=0;Ia<p.length;Ia++)Ha.push(p[Ia].getUserId());E===va.USER?na.openUserForm(Ha):E===va.ROLE&&na.openRoleForm(Ha)},ab=function(na){for(var Ha=[],Ia=Object.keys(na),Aa=0;Aa<k[E].length;Aa++){var Va=k[E][Aa].getUserId();Ha.push(Va)}Aa=[];for(Va=0;Va<Ia.length;Va++)-1==
Ha.indexOf(Ia[Va])&&Aa.push(Ia[Va]);Ia=Aa.slice(0);if(0===Ia.length)return!0;Y.createFacade(function(Ua){Y.getMessageCurtain().showSuccess(a.get("successfullyAdded","\u6dfb\u52a0\u6210\u529f\u3002"));for(Ua=0;Ua<Ia.length;Ua++){var db=new va;db.setUserId(Ia[Ua]);db.setUserName(na[Ia[Ua]]);k[E].push(db)}Wa.occur(Wa.AUTH_USER_ROLE_TYPE,Wa.getAuthUserOrRoleType(E));ma(A)},function(Ua,db){"20007006"==Ua&&L.updateModelState(!1);return!0}).addUsers(bb,Ia,E)},cb=function(){var na=new Na;na.setFunAfterSelect(jb);
for(var Ha=[],Ia=0;Ia<p.length;Ia++)20007007!==p[Ia].getErrorCode()&&Ha.push(p[Ia].getUserId());na.setPreSelected(Ha);na.showDialog()},jb=function(na){for(var Ha=[],Ia=[],Aa=[],Va=0;Va<k[E].length;Va++)Aa.push(k[E][Va].getUserId());for(Va=0;Va<na.length;Va++){var Ua=na[Va].getModelSetRoleId();Ia.push(Ua);-1==Aa.indexOf(Ua)&&Ha.push(Ua)}if(0===Ha.length)return!0;Y.createFacade(function(db){Y.getMessageCurtain().showSuccess(a.get("successfullyAdded","\u6dfb\u52a0\u6210\u529f\u3002"));for(db=0;db<na.length;db++){var qb=
na[db].getModelSetRoleId();if(-1!=Ha.indexOf(qb)){var Nb=na[db].getModelSetRoleName(),Db=new va;Db.initialize(qb,Nb);k[E].push(Db)}}Wa.occur(Wa.AUTH_USER_ROLE_TYPE,Wa.getAuthUserOrRoleType(E));ma(A)},function(db,qb){"20007006"==db&&L.updateModelState(!1);return!0}).addUsers(bb,Ha,E)},kb=function(){y.getDataAuthorityManager()(bb,xb,ba)}}function N(){KTDefaultCellRender.call(this,U);var K=this,d=this.paintCellUI,c={};c[Ma.DATA_TABLE_MODEL]="data-table-model";c[Ma.ENTITY_MODEL]="entity-model";c[Ma.RELATION_MODEL]=
"relation-model";c[Ma.METRICS_MODEL]="metrics-model";c[Ma.METRIC]="metrics";this.paintCellUI=function(u,b){var h=K.getCurrentRowIdx(),p=K.getCurrentColIdx();if(h>=H.getHeadRowCount()){var g=K.getCurrentRow().getUserObject(),k=$(u);if(0==p){u=$("<div>");I.layoutCtrlWithLRTB(u,0,0,null,0,0,null);u.appendTo(k);b=4+20*g.getLevel()-20+"px";u.css("left",b);b=0;-1!=qa.indexOf(g.getModelId())&&(m(b,u,g.getModelId(),g.getModelName(),g.getModelType()),b=18);var e=$("<div>");I.layoutCtrlWithLRTB(e,b,null,16,
13,null,16);p=g.getModelName();var x=!1;g instanceof fb&&(e.css("cursor","pointer"),M.backgroundWithHover(e,g.isSpreadState()?"icon-expanded":"icon-collapsed"),u.append(e),e.attr("iRowIdx",h),e.on("mousedown",A),x=!0);if(g.getModelType()===Ma.METRICS_MODEL||g instanceof Ma)g.getModelType()===Ma.METRICS_MODEL&&(b+=20),ba&&(h=$("<div>"),h.addClass("data-auth-preset"),h.text(a.get("preset","\u9884\u7f6e")),I.layoutCtrlWithLRTB(h,b,null,24,13,null,11),u.append(h),b+=34),h=$("<div>"),x=(g.getModelType(),
c[g.getModelType()]),M.background(h,"icon-"+x),u.append(h),x=!1,I.layoutCtrlWithLRTB(h,b,null,16,13,null,16);h=$.trim(Da.getText());e=$("<div>");e.addClass("sbu-right-table-name");e.css("left",b+20+2+"px");h&&0<h.length?l(e,p,h,!1):e.text(p);b=$("<span>");b.css("padding-left","5px");b.css("color","#c0c0c0");h&&0<h.length&&!x?l(b,"( "+g.getModelNumber()+" )",h,!0):b.text("( "+g.getModelNumber()+" )");!x&&b.appendTo(e);u.append(e)}else if(1==p)h=new ob,w[g.getModelId()]=h,h.setUserObject(g),h.setEnabled(!ba),
h.addStateChangeListener(v),g=fa?g.isEnable():!1,h.setOn(g),g=h.getJqUi(),g.addClass("sbm-right-panel-enable-button"),ba&&g.css("cursor","not-allowed"),h=$("<div>"),h.addClass("sbm-right-panel-enable-button-container"),g.appendTo(h),k.append(h);else if(2==p&&(g instanceof Ma||g.getModelType()===Ma.METRICS_MODEL)){var C=$("<div>");M.backgroundWithHover(C,"btn-edit");C.addClass("sbm-right-panel-edit-icon");C.on("click",function(){var O=parseInt(C.attr("rowIdx")),Z=U.getRow(O).getUserObject();O=Z.isInheritPermissions();
O=E===va.USER?O:!1;var la=new Xa(O,Z,E,fa,ba);Z&&(O=Z.getModelId(),qa&&-1!==qa.indexOf(O)&&(L.checkModelExistMV(O,function(ma){ma&&la.setErrorPrompt(a.get("onlyShowDataAuth","\u6a21\u578b\u5f02\u5e38\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002\u7531\u4e8e\u5f53\u524d\u6a21\u578b\u5df2\u5b58\u5728\u7269\u5316\u6570\u636e\uff0c\u4ee5\u4e0b\u4ec5\u5c55\u793a\u5bf9\u7269\u5316\u6570\u636e\u751f\u6548\u7684\u6570\u636e\u6743\u9650\u5185\u5bb9\u3002"))}),la.setFooterClosingOnly(!0)));la.setFunAfterSettingAuth(function(ma,
$a){Z.setEnable(!0);Z.setDataAuth($a);U.updateUI();if(Z.getModelType()===Ma.METRICS_MODEL)if(ma=$a.getModels()[0])if(ma=ma.getCellAuth())if(ma=ma.getNoAuthFields()){$a=[];for(var eb=0;eb<ma.length;eb++){var ab=ma[eb];ab=Eb.generateMetricModelId(Z.getModelId(),ab.getName());var cb=w[ab];cb&&cb.setOn(!1);(cb=cb.getUserObject())&&cb.setEnable(!1);$a.push(ab)}S(Z,$a)}else S(Z);else S(Z);else S(Z)});la.showDialog()});var S=function(O,Z){if(O.getModelType()==Ma.METRICS_MODEL){O=O.getChildren();for(var la=
0;la<O.length;la++){var ma=O[la];Z&&-1!=Z.indexOf(ma.getModelId())||((ma=w[ma.getModelId()])&&ma.setOn(!0),(ma=ma.getUserObject())&&ma.setEnable(!0))}}};C.attr("rowIdx",h);C.attr("title",a.get("editPermission","\u8bbe\u7f6e\u6570\u636e\u6743\u9650"));C.appendTo(k);u=$("<div>");u.addClass("sbm-right-panel-edit-icon-container");C.appendTo(u);if(E===va.USER&&g.getModelType()!==Ma.METRIC){var ea=$("<div>");ea.addClass("sbm-right-panel-edit-icon");ea.css({cursor:"pointer","margin-left":"25px"});!fa||g.isInheritPermissions()?
(M.background(ea,"btn-inherit"),ea.attr("title",a.get("permissionInherited","\u672c\u6761\u6743\u9650\u540c\u65f6\u53d7\u7528\u6237\u6743\u9650\u548c\u89d2\u8272\u6743\u9650\u7684\u5f71\u54cd\u3002\u70b9\u51fb\u56fe\u6807\u53ef\u8c03\u6574\u4e3a\u4ee5\u5355\u72ec\u8bbe\u7f6e\u7684\u7528\u6237\u6743\u9650\u4e3a\u51c6\u3002"))):g.isInheritPermissions()||(M.background(ea,"btn-inherit_hover"),ea.attr("title",a.get("noPermissionInherited","\u672c\u6761\u6743\u9650\u4ee5\u5355\u72ec\u8bbe\u7f6e\u7684\u7528\u6237\u6743\u9650\u4e3a\u51c6\uff0c\u4e0d\u53d7\u89d2\u8272\u6743\u9650\u7684\u5f71\u54cd\u3002\u70b9\u51fb\u56fe\u6807\u53ef\u6062\u590d\u4e3a\u540c\u65f6\u53d7\u7528\u6237\u6743\u9650\u548c\u89d2\u8272\u6743\u9650\u7684\u5f71\u54cd\u3002")));
!ba&&ea.on("click",function(){var O=parseInt(ea.attr("rowIdx"));O=U.getRow(O).getUserObject();da(O)});ea.css("cursor",ba?"not-allowed":"pointer");ea.attr("rowIdx",h);ea.appendTo(u)}u.appendTo(k)}else 3==p?((b=g.getQingModelerDataAuth())||(b=f[g.getDataAuthId()]),u=$("<div>"),I.layoutCtrlWithLRTB(u,0,0,null,0,0,null),u.appendTo(k),Qa(u,b,h,g.isEnable(),g.getModelType()===Ma.METRIC),g.getDataAuthId()&&(p=g.getDataAuthId(),r[p]=u,R[p]=g,t[p]=h),!b&&g.getDataAuthId()&&g.getModelType()!==fb.DIRECTORY_TYPE&&
(u.empty(),g=$("<div>"),g.addClass("sa-common-loading-icon"),g.css("background-image",T.getIconUrl("common","loading.gif")),I.layoutCtrlCenterAlign(g,23),I.layoutCtrlMiddleAlign(g,23),g.appendTo(u))):d(u,b);k.css({"border-right":"1px solid rgb(240, 240, 240)"});k.css({"border-bottom":"1px solid rgb(240, 240, 240)"})}else d(u,b),$(u).css("color","#666")};var l=function(u,b,h,p){if(u&&b&&h){h=h.toUpperCase();for(var g=b.toUpperCase(),k=g.split(h),e=h.length,x=0;x<k.length;x++){var C=g.indexOf(k[x]),
S=b.substr(0,k[x].length);C+=k[x].length;var ea=g.length-C;g=g.substr(C,ea);b=b.substr(C,ea);C=$("<span>");C.text(S);p&&C.css("color","#c0c0c0");C.appendTo(u);x!==k.length-1&&1<k.length&&(C=g.indexOf(h),S=b.substr(C,e),C+=e,ea=g.length-C,g=g.substr(C,ea),b=b.substr(C,ea),C=$("<span>"),C.text(S),C.css("color","red"),C.clone().appendTo(u))}}},m=function(u,b,h,p,g){var k=$("<div>"),e=$("<span>");e.text(a.get("modelException","\u6a21\u578b\u5f02\u5e38\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650"));
e.appendTo(k);e=$("<span id='"+h+"'>");$(document).on("click","#"+h,function(){y.getModelDesignerEntrance()(bb,h,p,g)});e.text(" "+a.get("viewModel","\u67e5\u770b\u8be5\u6a21\u578b"));e.css({cursor:"pointer",color:"rgb(14, 95, 216)"});e.appendTo(k);e=mb.createWarning();I.layoutCtrlWithLRTB(e,u,null,12,14,null,12);b.append(e);u=new wb;u.mounting(e);u.setSuggestedSize(265,40);u.setHtml(k)},A=function(u){var b=$(u.currentTarget).attr("iRowIdx"),h=oa[parseInt(b)-2],p=h.isSpreadState();h.setSpreadState(!p);
u=h.getModelId();var g=h.getLevel();h=U.getRowsCount()-3;b=parseInt(b)-2;if(p)for(u=b;u<h&&!(parseInt(oa[u+1].getLevel())<=parseInt(g));u++)U.getRow(u+3).setHide(!0),oa[u+1].setSpreadState(!1);else for(p=b;p<h;p++)g=oa[p+1],g instanceof fb&&g.getParentId()==u&&U.getRow(p+3).setHide(!1),g instanceof Ma&&g.getParentId()==u&&U.getRow(p+3).setHide(!1);U.updateUI()},v=function(u,b,h){if(b){var p=u.getUserObject();b=p.getModelId();var g=p.getModelType();Y.createFacade(function(k){u.getUserObject().setEnable(h);
D(p,h);if(p instanceof fb&&p.getModelType()!==Ma.METRICS_MODEL&&h){k=$(window).width();var e=$(window).height();k=k-425>>1;e=e-300>>1;var x=Ra.createFeedbackDialog();x.setBounds(425,300,k,e);x.setMsgImageType(Ra.MSG_WARNING);x.setOptionType(Ra.OPTION_OK);x.setTitle(a.get("operatorTips","\u64cd\u4f5c\u63d0\u793a"));x.setMessage(a.get("authorized","\u5f53\u524d\u76ee\u5f55\u53ca\u5176\u5b50\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6a21\u578b\u7684\u542f\u7528\u72b6\u6001\u5df2\u5f00\u542f\uff0c\u8be5\u76ee\u5f55\u4e0b\u672a\u6765\u65b0\u589e\u7684\u6a21\u578b\u7684\u542f\u7528\u72b6\u6001\u4e5f\u5c06\u81ea\u52a8\u5f00\u542f\u3002"));
x.setButtonText(Ra.RETURN_OK,a.get("iKnow","\u6211\u77e5\u9053\u4e86"));x.showDialog()}if(p.getModelType()===Ma.METRIC&&(k=p.getParentId(),e=w[k])){e=e.getUserObject();var C=e.getDataAuthId();e=e.getQingModelerDataAuth();e||(e=f[C])||(e=new hb);x=r[C];C=t[C];var S=e.getModels();S||(S=[]);var ea=S[0];ea||(ea=new tb);(S=ea.getCellAuth())||(S=new rb);S.getNoAuthFields();var O=[],Z;for(Z in w)if(-1!=Z.indexOf("metric-"+k)){var la=w[Z];if(la&&!la.isOn()){la=la.getUserObject();var ma=new Sa;ma.setAlias(la.getModelName());
O.push(ma)}}S.setNoAuthFields(O);ea.setCellAuth(S);S=[];S.push(ea);e.setModels(S);x&&C&&Qa(x,e,C,h,!1)}U.updateUI()},function(k,e){return 20007014==k?(Y.getMessageCurtain().showPrompt(a.get("modelNoDeploy","\u6a21\u578b\u5df2\u53d6\u6d88\u90e8\u7f72\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20007005==k?(Y.getMessageCurtain().showPrompt(a.get("modelNoFound","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20007006==k?
(Y.getMessageCurtain().showPrompt(a.get("modelNoDeploy","\u6a21\u578b\u5df2\u53d6\u6d88\u90e8\u7f72\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20003102==k?(Y.getMessageCurtain().showPrompt(a.get("modelNoFound","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):!1}).authorizedDataAuth(b,fa,h,E,g,bb)}},D=function(u,b){for(var h=0;h<Q.length;h++)Q[h].getModelType()!==Ma.METRIC&&Q[h].getParentId()==u.getModelId()&&(Q[h].setEnable(b),
D(Q[h],b))},da=function(u){var b=u.getModelId(),h=!u.isInheritPermissions();Y.createFacade(function(p){u.setInheritPermissions(h);U.updateUI();Wa.occur(Wa.DATA_AUTH_SETTING_INHERIT_METHOD,Wa.getAuthInheritMethod(h))},function(p,g){return 20007014==p?(Y.getMessageCurtain().showPrompt(a.get("modelNoDeploy","\u6a21\u578b\u5df2\u53d6\u6d88\u90e8\u7f72\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),!0):20003102==p?(Y.getMessageCurtain().showPrompt(a.get("modelNoFound","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650\u3002")),
!0):!1}).setInherit(b,fa,h,E)}}var L=this,ba=P,z,G,B,U,ka,ca,ha,Da,Fa,E,Q=[],oa=[],fa,za,qa=[],Ca=!0,f={},r={},t={},R={},w={},aa={};aa[va.USER]=a.get("sysUserSummary","\u5f53\u524d\u7cfb\u7edf\u7528\u6237\u7684\u6570\u636e\u6743\u9650\u6458\u8981");aa[va.ROLE]=a.get("sysRoleSummary","\u5f53\u524d\u7cfb\u7edf\u89d2\u8272\u7684\u6570\u636e\u6743\u9650\u6458\u8981");aa[va.MODELSET_ROLE]=a.get("modelSetRoleSummary","\u5f53\u524d\u6a21\u578b\u96c6\u89d2\u8272\u7684\u6570\u636e\u6743\u9650\u6458\u8981");
this.resize=function(){ca.refreshHeight();L.resizeTable()};this.updateErrorModels=function(K){qa=K};this.updateModelState=function(K){Ca=K;ca&&ca.updateModelState(Ca);ha&&Ca&&ha.hide();ha&&!Ca&&ha.show()};this.getModelSetMainAreaJqUi=function(){z||(z=$("<div>"),z.addClass("sbu-container"),G=$("<div>"),G.addClass("sbu-left-panel"),ca=new J,ca.setSearchCallBack(ja),ca.getJqUi().appendTo(G),B=Ja(),G.appendTo(z),B.appendTo(z));return z};var Ja=function(){B=$("<div>");B.addClass("sbu-right-panel");var K=
$("<div>");M.backgroundWithHover(K,"btn-refresh");K.css({cursor:"pointer","z-index":"999"});K.attr("title",a.get("refreshModels","\u5237\u65b0\u6a21\u578b"));I.layoutCtrlWithLRTB(K,null,250,16,13,null,16);K.on("click",function(){Da.clear();ca.refreshModel()});K.appendTo(B);Da=new Ya;Da.setSearchListenerDelay(1E3);Da.setShowSearchIcon(!0);Da.setPlaceholder(a.get("searchContent","\u8bf7\u8f93\u5165\u641c\u7d22\u5185\u5bb9"));Da.addSearchListener(ja);K=Da.getJqUi();I.layoutCtrlWithLRTB(K,null,10,230,
8,null,25);K.css({"z-index":"999"});K.appendTo(B);U=H.createTable();ka=$(U.getUI());U.setCellRender(new N);U.setSyncUIWhenModelChanged(!1);U.setLargeDataMode(!0,!1);U.setColumnFitVisibleWidth(!0);U.setDraggableAdjusting(!0,3,0);U.setFrozenRows(3);ka.appendTo(B);I.layoutCtrlWithLRTB(ka,0,0,null,45,0,null);ka.hide();Fa=new Ka;K=Fa.getNoDataTableJqUi();Fa.setTopPx(45);Fa.updateIcon("icon-search_none");Fa.setText(a.get("noMatchedResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"));
K.hide();K.appendTo(B);K=new Ka;ha=K.getNoDataTableJqUi();K.setText(a.get("noDeployedModel","\u6682\u65e0\u5df2\u90e8\u7f72\u7684\u6a21\u578b"));ha.appendTo(B);Ca&&ha.hide();return B},ia=function(K){Y.createFacade(function(d){if(d){var c=new fb;c.fromJsonObject(d);Q=[];Oa(c,Q);d=[];for(c=0;c<Q.length;c++)0<=Q[c].getLevel()&&d.push(Q[c]);oa=Q=d;ja();d=[];for(c=0;c<Q.length;c++)Q[c]instanceof Ma&&Q[c].getDataAuthId()?d.push(Q[c].getDataAuthId()):Q[c].getModelType()===Ma.METRICS_MODEL&&Q[c].getDataAuthId()&&
d.push(Q[c].getDataAuthId());var l=[];for(c=1;c<=d.length;c++)l.push(d[c-1]),0===c%5&&(La(l),l=[]);0<l.length&&La(l)}},function(d,c){return 20007003==d?(Y.getMessageCurtain().showPrompt(a.get("modelSetNoFound","\u6a21\u578b\u96c6\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u5148\u5237\u65b0\u754c\u9762\u3002")),!0):!1}).loadUsableModelDataAuth(bb,E,K)},La=function(K){var d=Y.createFacade(function(c){if(c)for(var l=0;l<K.length;l++){var m=K[l],A=new hb;c[m]&&A.fromJsonObject(c[m]);var v=r[m];f[m]=A;if(v){var D=
R[m];D.setDataAuth(A);var da=t[m];if(D.getModelType()===Ma.METRICS_MODEL){A||(A=f[m])||(A=new hb);var u=A.getModels();u||(u=[]);(m=u[0])||(m=new tb);(u=m.getCellAuth())||(u=new rb);u.getNoAuthFields();var b=[],h;for(h in w)if(-1!=h.indexOf("metric-"+D.getModelId())){var p=w[h];if(p&&!p.isOn()){p=p.getUserObject();var g=new Sa;g.setAlias(p.getModelName());b.push(g)}}u.setNoAuthFields(b);m.setCellAuth(u);u=[];u.push(m);A.setModels(u)}Qa(v,A,da,D.isEnable(),D.getModelType()===Ma.METRIC)}}},function(c,
l){return!0});d.setShowBlocking(!1);d.queryDataAuthContents(K)},Oa=function(K,d){d.push(K);K=K.getChildren();for(var c=0;c<K.length;c++)K[c]instanceof Ma||Oa(K[c],d);for(c=0;c<K.length;c++)K[c]instanceof fb||d.push(K[c])},ja=function(){Ca?ha&&ha.hide():ha&&ha.show();if(ca.isCurrentTabModelEmpty())wa([]);else{var K=$.trim(Da.getText());K&&0<K.length&&0<Q.length?(oa=pa(K),wa(oa)):(oa=Q,wa(Q))}},pa=function(K){var d=function(h,p){for(var g=0;g<Q.length;g++)Q[g]instanceof fb&&Q[g].getModelId()===h&&(-1===
p.indexOf(h)&&p.push(h),Q[g].getParentId()&&d(Q[g].getParentId(),p))},c=function(h){if(!(h instanceof Ma)&&h.getModelType()!=Ma.METRICS_MODEL)return!1;var p=h.getModelName().toLowerCase();v=Q[D].getModelNumber()?"( "+h.getModelNumber()+" )":h.getModelNumber();return-1!==p.indexOf(K)||v&&-1!==v.toLowerCase().indexOf(K)?!0:!1},l=function(h,p){for(var g=0;g<p.length;g++)if(-1<h.indexOf(p[g]))return!0;return!1};K=$.trim(K).toLowerCase();if(0===K.length)return[];for(var m=[],A=[],v,D=0;D<Q.length;D++)c(Q[D])&&
(Q[D]instanceof Ma?(m.push(Q[D]),d(Q[D].getParentId(),A)):d(Q[D].getModelId(),A));c=[];for(var da=0;da<Q.length;da++){var u=Q[da]instanceof fb&&-1<A.indexOf(Q[da].getModelId()),b=Q[da]instanceof Ma&&-1<m.indexOf(Q[da]);if(u||b)Q[da].setSpreadState(!0),c.push(Q[da])}for(m=0;m<c.length;m++)c[m]instanceof Ma||(A=c[m].getChildren(),A=l(c,A),c[m].setSpreadState(A));return c},wa=function(K){if(0<$.trim(Da.getText()).length&&0===K.length)ka.hide(),ha&&ha.hide(),Fa.show();else{ca.isCurrentTabModelEmpty()?
ka.hide():ka.show();Fa.hide();H.clear(U);U.addColumns(4);var d=H.createHeadRow(U);d.getCell(0).setValue(a.get("modelNameAndNumber","\u6a21\u578b\u540d\u79f0(\u7f16\u7801)"));d.getCell(1).setValue(a.get("enable","\u542f\u7528\u72b6\u6001"));d.getCell(2).setValue(a.get("settings","\u6570\u636e\u6743\u9650\u8bbe\u7f6e"));d.getCell(3).setValue(aa[E]);d.setHeight(26);U.getColumn(0).setWidth(360);U.getColumn(1).setWidth(237);U.getColumn(2).setWidth(237);U.getColumn(3).setWidth(683);for(d=0;d<K.length;d++){var c=
K[d];if(0<c.getLevel()){var l=U.addRow();l.setHeight(40);l.setUserObject(c)}}U.updateUI();za||(za=new V,za.setCallbackImmediately(function(){L.resizeTable()}),za.observe())}};this.resizeTable=function(){!pb&&U.updateUI()};this.checkModelExistMV=function(K,d){Y.createFacade(function(c){d(c)},function(c,l){return!1}).checkModelExistMV(K)};var Qa=function(K,d,c,l,m){K.empty();m=d?d.toString(m):"";var A=m.split("\n"),v=$("<div>");v.text(A[0]);I.layoutCtrlWithLRTB(v,15,80,null,2,null,16);v.css({overflow:"hidden",
"white-space":"nowrap","text-overflow":"ellipsis"});v.appendTo(K);var D=$("<div>");D.text(A[1]);I.layoutCtrlWithLRTB(D,15,80,null,22,null,16);D.css({overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"});D.appendTo(K);!A[1]&&v.css({top:"50%",transform:"translateY(-50%)"});l||(v.css("opacity","0.5"),D.css("opacity","0.5"));var da;d&&(da=d.getModels());var u;da&&da[0]&&(u=da[0].getRowAuth());u&&u.isInvalid()&&(d=u.getErrorLine(),v.empty(),l=$("<div>"),l.text(a.get("rowAuth","\u884c\u7ea7\u6743\u9650\uff1a")),
l.css({position:"relative",display:"inline-block","margin-right":"5px"}),l.appendTo(v),l=mb.createWarning(),l.css({position:"relative",display:"inline-block","margin-right":"5px"}),l.appendTo(v),l=$("<div>"),l.text(a.get("notExistFilter","\u8fc7\u6ee4\u6761\u4ef6\u7b2c#1\u884c\u5b57\u6bb5\u4e0d\u5b58\u5728").replace("#1",d)),l.css({position:"relative",display:"inline-block",color:"orange"}),l.appendTo(v));var b=$("<div>");b.css("cursor","pointer");M.backgroundWithHover(b,"btn-delete");I.layoutCtrlWithLRTB(b,
null,34,16,14,null,16);b.on("click",function(){var h=new sb;h.setText(a.get("deleteDataPermission","\u6e05\u7a7a\u884c\u7ea7\u548c\u5217\u7ea7\u6570\u636e\u6743\u9650\u8bbe\u7f6e\u540e\u5c06\u65e0\u6cd5\u6062\u590d\uff0c\u786e\u5b9a\u6e05\u7a7a\u5417\uff1f"));h.setConfirmedListener(function(p){var g=parseInt(b.attr("rowIdx"));g=U.getRow(g).getUserObject();p&&ta(g)});h.show(b)});b.attr("rowIdx",c);b.attr("title",a.get("deleteAllPermissions","\u6e05\u7a7a\u884c\u7ea7\u548c\u5217\u7ea7\u6570\u636e\u6743\u9650\u8bbe\u7f6e"));
!ba&&b.appendTo(K);""===m?b.css("display","none"):b.css("display","block");K.attr("title",m)},ta=function(K){var d=K.getModelId();Y.createFacade(function(c){K.setDataAuth(new hb);Y.getMessageCurtain().showSuccess(a.get("successToDeletePermission","\u5220\u9664\u6210\u529f\u3002"));for(c=0;c<Q.length;c++)Q[c].getModelType()===Ma.METRIC&&Q[c].getParentId()===K.getModelId()&&Q[c].setEnable(!1);U.updateUI()},function(c,l){return 20007004==c?(Y.getMessageCurtain().showPrompt(a.get("deleteFail","\u8be5\u6761\u6570\u636e\u5df2\u88ab\u5220\u9664\uff0c\u64cd\u4f5c\u5931\u8d25\u3002")),
!0):!1}).deletePermission(d,fa,E)}}function Pa(){var P=this,J=[400,300],N,L;this.setConfirmMsg=function(z){N=z};this.setConfirmListener=function(z){L=z};this.createDialog=function(){var z=$("<div>"),G=$(document.body);z.addClass("sa-ctrl-common-modallayer");z.appendTo(G);var B=$(window).width(),U=$(window).height(),ka=J[0],ca=J[1];B=B-ka>>1;U=U-ca>>1;var ha=new Fb(z);ha.setTitle(a.get("operationConfirmation","\u64cd\u4f5c\u786e\u8ba4"));ha.setBounds(B,U,ka,ca);ha.setToolbarVisible(!1);ha.setContent(P.createJqPanel());
ha.addClosingListener(function(Da,Fa){Fa&&L&&L();Da.destroy();z.remove()});ha.showFooterPane();ba(z);z.appendTo(G);return ha};this.createJqPanel=function(){var z=$("<div>"),G=$("<div>");I.layoutCtrl(G,140,20,98,80);Gb.background(G,"msg-delete");G.appendTo(z);G=$("<div>");G.addClass("data-auth-delete-dialog");G.text(N);G.attr("title",N);G.appendTo(z);return z};var ba=function(z){(z=z.children(".sa-ctrl-dialog"))&&0<z.length&&(z=z.children(".sa-ctrl-dialog-title"))&&0<z.length&&z.css("border-bottom",
"0px")}}function Ka(){var P,J,N,L,ba,z,G;this.getNoDataTableJqUi=function(){if(!P){P=$("<div>");I.layoutCtrlWithLRTB(P,0,0,null,0,0,null);P.css("min-height","125px");J=$("<div>");J.addClass("sbm-left-not-data-container");J.appendTo(P);G=$("<div>");G.addClass("sbm-left-not-data-icon");M.background(G,"icon-empty");G.appendTo(J);var B=$("<div>");B.addClass("sbm-left-not-data-text");B.appendTo(J);L=$("<span>");L.text(N);L.appendTo(B);z=$("<span>");z.css({color:"rgb(14, 95, 216)",cursor:"pointer"});z.text(ba);
z.appendTo(B);z.hide()}return P};this.setTopPx=function(B){P.css("top",B+"px")};this.setText=function(B){N=B;L.text(N)};this.setLinkText=function(B,U){ba=B;z.text(B);z.on("click",U);z.show()};this.getText=function(){return N};this.updateIcon=function(B,U,ka){M.background(G,B);U&&ka&&(G.css({width:U+"px",height:ka+"px"}),J.css("height",ka+20+"px"),P.css("min-height",ka+20+"px"))};this.hide=function(){P&&P.hide()};this.show=function(){P&&P.show()}}function Na(){ub.call(this);var P=this,J=this.protectedMethod,
N,L,ba,z,G,B=[],U=[],ka,ca=[],ha,Da,Fa=!1,E,Q,oa=[],fa;(function(){J.setTitle(a.get("selectDataRole","\u9009\u62e9\u6a21\u578b\u96c6\u89d2\u8272"));P.setSize(640,480);J.getDialogCtrl().setMinSize(640,480);J.setContentPaneCreator(function(){N=$("<div>");qa();return N});J.setClosingChecker(function(){if(0===B.length)J.destroy();else if(0!==ca.length)ha&&ha(ca),J.destroy();else{var w=new F,aa=a.get("selectOne","\u8bf7\u9009\u62e9\u4e00\u884c\u6570\u636e\u3002");w.getJqUi().appendTo(N);w.showPrompt(aa)}});
J.setClosingAction(function(){J.destroy()})})();this.setFunAfterSelect=function(w){ha=w};this.setPreSelected=function(w){oa=w};var za=function(){var w=new Ya;w.setSearchListenerDelay(1E3);w.setShowSearchIcon(!0);w.setPlaceholder(a.get("searchRoleName","\u641c\u7d22\u89d2\u8272\u540d\u79f0"));var aa=w.getJqUi();I.layoutCtrlWithLRTB(aa,10,null,230,5,null,25);aa.find(".sa-ctrl-searchbox-close").on("click",function(La){Da=w.getText();Ca(Da,Fa)});var Ja=aa.find(":input");this.searchModelSetRole=function(){Da=
w.getText();Ca(Da,Fa)};Ja.attr("oninput","searchModelSetRole();");aa.appendTo(N);aa=$("<div>");I.layoutCtrlWithLRTB(aa,300,null,180,5,null,25);Ja=new gb;var ia=Ja.getJqUi();Ja.setChecked(Fa);Ja.addCheckedListener(function(La,Oa){Oa&&(Fa=La.isChecked(),Ca(Da,Fa))});Ja.setText(a.get("showSelected","\u4ec5\u663e\u793a\u9009\u4e2d\u9879"));I.layoutCtrlWithLRTB(ia,0,0,null,2,null,23);ia.css("line-height","23px");ia.appendTo(aa);aa.appendTo(N);L=r();I.layoutCtrlWithLRTB(L,10,10,null,45,10,null);L.appendTo(N)},
qa=function(){var w=Y.createFacade(function(aa){za();B=[];if(aa)for(var Ja=0;Ja<aa.length;Ja++){var ia=new Hb;ia.fromJsonObject(aa[Ja]);B.push(ia);-1!=oa.indexOf(ia.getModelSetRoleId())&&ca.push(ia)}z.setItemModels(B);0==B.length&&(fa=$("<div>"),fa.css({position:"absolute",width:"180px",height:"120px",top:"50%","margin-top":"-60px",left:"50%","margin-left":"-90px"}),aa=$("<div>"),aa.css({width:"170px",height:"98px",position:"absolute",left:"50%","margin-left":" -85px"}),M.background(aa,"icon-empty"),
aa.appendTo(fa),aa=$("<div>"),aa.css({position:"absolute",bottom:"0px",width:"150px","text-align":"center",left:"50%","margin-left":"-75px",color:"rgb(153, 153, 153)","font-size":"14px"}),aa.text(a.get("noModelSetRole","\u6682\u65e0\u53ef\u9009\u7684\u6a21\u578b\u96c6\u89d2\u8272")),aa.appendTo(fa),fa.appendTo(L));t()},function(aa,Ja){return!1});w.setBlockingJqUi(N);w.getModelSetRoles(bb)},Ca=function(w,aa){if(0!=B.length||w){var Ja=[];w&&(w=w.trim().toLowerCase());for(var ia=0;ia<B.length;ia++){var La=
B[ia].getModelSetRoleName().toLowerCase();if(!w||-1!==La.indexOf(w)){if(aa){La=!1;for(var Oa=0;Oa<ca.length;Oa++)if(ca[Oa]==B[ia]){La=!0;break}}else La=!0;La&&Ja.push(B[ia])}}if(0===Ja.length)return G.hide(),E.updateIcon("icon-search_none"),E.setText(a.get("noMatchedResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),fa&&fa.hide(),Q.show(),!1;Q.hide();G.show();U=[];z.setItemModels(Ja);w=!0;for(aa=0;aa<U.length;aa++)if(!U[aa].isChecked()){w=!1;break}ka.setChecked(w)}else Q.hide(),
fa&&fa.show()},f=function(w){var aa=w.isChecked();w=w.getUserObject();for(var Ja=!1,ia=-1,La=0;La<ca.length;La++)if(ca[La]==w){Ja=!0;ia=La;break}Ja&&!aa&&ca.splice(ia,1);!Ja&&aa&&ca.push(w)},r=function(){L=$("<div>");ka=new gb;var w=ka.getJqUi();ka.setChecked(!1);ka.addCheckedListener(function(aa,Ja){if(Ja){aa=aa.isChecked();for(Ja=0;Ja<U.length;Ja++)U[Ja].setChecked(aa),f(U[Ja]);ba.setText(a.get("selectedRoles","\uff08\u5df2\u9009\u62e9#1\u9879\uff09").replace("#1",ca.length))}});ka.setText(a.get("selectAll",
"\u5168\u9009"));I.layoutCtrlWithLRTB(w,0,null,80,0,null,23);w.css("line-height","23px");w.appendTo(L);ba=new ib(a.get("selectedRoles","\uff08\u5df2\u9009\u62e9#1\u9879\uff09").replace("#1",oa.length));w=ba.getJqUi();I.layoutCtrlWithLRTB(w,100,null,120,0,null,23);w.appendTo(L);z=new yb;z.setBorderVisible(!1);z.setEnabled(!1);z.setCustomItemPainter(R);G=z.getJqUi();I.layoutCtrlWithLRTB(G,0,0,null,28,0,null);G.appendTo(L);E=new Ka;Q=E.getNoDataTableJqUi();I.layoutCtrlWithLRTB(Q,0,0,null,28,0,null);
Q.appendTo(L);Q.hide();return L},t=function(){for(var w=!0,aa=0;aa<U.length;aa++)if(!U[aa].isChecked()){w=!1;break}ka.setChecked(w)},R=function(w,aa){var Ja=$("<div>");I.layoutCtrlWithLRTB(Ja,0,0,null,0,0,null);Ja.appendTo(w);w.css({"font-size":"12px",height:"25px",color:"#666666"});w=new gb;var ia=w.getJqUi();w.setChecked(!1);for(var La=0;La<ca.length;La++)if(ca[La]==aa){w.setChecked(!0);break}w.addCheckedListener(function(Oa,ja){ja&&(ja=Oa.isChecked(),!ja&&ka.setChecked(ja),f(Oa),ba.setText(a.get("selectedRoles",
"\uff08\u5df2\u9009\u62e9#1\u9879\uff09").replace("#1",ca.length)),ja&&t())});w.setUserObject(aa);U.push(w);I.layoutCtrlWithLRTB(ia,0,null,16,2,null,23);ia.css("line-height","23px");ia.appendTo(Ja);w=$("<div>");M.background(w,"btn-cooperation");I.layoutCtrlWithLRTB(w,25,null,16,6,null,16);w.appendTo(Ja);w=$("<div>");I.layoutCtrlWithLRTB(w,50,0,null,2,null,23);w.css("line-height","23px");w.attr("title",aa.getModelSetRoleName());w.text(aa.getModelSetRoleName());w.appendTo(Ja)}}function Xa(P,J,N,L,ba){ub.call(this);
var z=this,G=this.protectedMethod,B,U,ka,ca,ha=P,Da=0,Fa,E=!1;this.setFunAfterSettingAuth=function(za){Fa=za};this.setFooterClosingOnly=function(za){G.setFooterClosingOnly(za)};this.setErrorPrompt=function(za){za&&G.getMessageCurtain().showError(za)};(function(){G.setTitle(a.get("editPermissionTitle","\u8bbe\u7f6e\u6570\u636e\u6743\u9650"));z.setSize(880,570);G.getDialogCtrl().setMinSize(880,570);G.setContentPaneCreator(function(){B=$("<div>");if(ha){var za=$("<div>");I.layoutCtrlWithLRTB(za,0,0,
null,0,null,20);za.appendTo(B);var qa=$("<div>");qa.text(a.get("inheritRoleAuth","\u663e\u793a\u5168\u90e8\u751f\u6548\u7684\u6743\u9650"));qa.addClass("auth-setting-switch-button-text");qa.appendTo(za);qa=$("<div>");var Ca=$("<span>");Ca.text(a.get("viewAllAuth","\u9ed8\u8ba4\u663e\u793a\u8be5\u7528\u6237\u5355\u72ec\u8bbe\u7f6e\u7684\u6570\u636e\u6743\u9650\uff0c\u5f00\u542f\u540e\u53ef\u67e5\u770b\u8be5\u7528\u6237\u5168\u90e8\u751f\u6548\u7684\u6743\u9650\uff0c\u5305\u62ec\u7528\u6237\u62e5\u6709\u7684\u7cfb\u7edf\u89d2\u8272\u3001\u6a21\u578b\u96c6\u89d2\u8272\u7684\u6570\u636e\u6743\u9650\u3002"));
Ca.appendTo(qa);Ca=new zb;Ca.setIconType(zb.ICON_TYPE_QUESTION);Ca.setTipsHtml(qa);Ca.setTipsSize(300,70);qa=Ca.getJqUi();qa.addClass("auth-setting-switch-button-tips");qa.appendTo(za);qa=new ob;qa.setOn(!1);qa.addStateChangeListener(Q);qa=qa.getJqUi();qa.addClass("auth-setting-switch-button");qa.appendTo(za);Da+=32;za.show()}ca=new n(ha,J,N,L);ca.setTitle(a.get("rowLevelPermission","\u884c\u7ea7\u6743\u9650"));ca.setFunRoleAuth(oa);ka=new Ba(ha,J,N,L);ka.setTitle(a.get("colLevelPermission","\u5217\u7ea7\u6743\u9650"));
ka.setFunRoleAuth(oa);U=new Ta;U.setTabLevel(Ta.SECOND_LEVEL);U.addTab(ca,!0);J.getModelType()!==Ma.METRIC?(U.addTab(ka),za=U.getJqUi()):za=ca.getJqUi();za.appendTo(B);I.layoutCtrlWithLRTB(za,0,0,null,Da,0,null);return B});G.setClosingChecker(function(){if(ba)G.destroy();else if(ca.isCompliant())if(ka.checkLegality()&&ca.checkLegality()){var za=new hb,qa=[];za.setModels(qa);var Ca=new tb;Ca.setModelId(J.getModelId());qa.push(Ca);qa=new Ib;var f=ca.getFilterItem();qa.setFilterItems(f);Ca.setRowAuth(qa);
ka.isInitialized()?(f=new rb,qa=ka.getRelation(),f.setRelation(qa),f.setNoAuthFields(ka.getNoAuth()),Ca.setCellAuth(f)):(qa=ca.getDataAuth())?Ca.setCellAuth(qa.getCellAuth()):(f=new rb,f.setRelation("intersection"),f.setNoAuthFields([]),Ca.setCellAuth(f));fa(za);G.destroy()}else za=new F,Ca=a.get("verificationFailed","\u884c\u7ea7\u6743\u9650\u8bbe\u7f6e\u4e0d\u5b8c\u6574"),za.getJqUi().appendTo(B),za.showPrompt(Ca);else G.destroy()});G.setClosingAction(function(){G.destroy()});G.setFooterClosingOnly(ba)})();
var Q=function(za,qa,Ca){Ca&&!E?(za.setOn(!1),G.getMessageCurtain().showPrompt(a.get("noRoleAuth","\u8be5\u7528\u6237\u4e0d\u5c5e\u4e8e\u4efb\u4f55\u89d2\u8272\u6216\u6240\u5c5e\u89d2\u8272\u5747\u672a\u8bbe\u7f6e\u6743\u9650\u3002"))):qa&&(ha=Ca,ca.setInherit(ha),ka.setInherit(ha),U.getCurrentTabPane().doChangeInherit())},oa=function(za){E=za},fa=function(za){Y.createFacade(function(qa){Fa&&Fa(ha,za)},function(qa,Ca){return 20003102==qa?(Y.getMessageCurtain().showPrompt(a.get("modelNoFoundOperFail",
"\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u64cd\u4f5c\u5931\u8d25\u3002")),!0):!1}).setDataAuthContent(L,N,ha,J.getModelId(),za)}}function n(P,J,N,L){var ba,z,G,B,U=P,ka=!1,ca=!0,ha,Da,Fa,E,Q=[],oa=[],fa=[];this.setRoleExistListener=function(r){ha=r};this.setFunRoleAuth=function(r){Da=r};this.setInherit=function(r){U=r;ka=!0};this.doChangeInherit=function(){z.setRoleFilter(oa);z.changeInherit(U);ka=!1};this.isCompliant=function(){return ca};this.getDataAuth=function(){return Fa};this.getFilterItem=
function(){return z.getFilterItem()};this.checkLegality=function(){return null==z.checkModelValid()};this.getJqUi=function(){if(!ba){ba=$("<div>");var r=$("<div>");I.layoutCtrlWithLRTB(r,0,0,null,0,0,null);r.appendTo(ba);z=new Ea;G=z.getJqUi();I.layoutCtrlWithLRTB(G,0,0,null,0,0,null);G.appendTo(r);var t=new Ka;B=t.getNoDataTableJqUi();t.setText(a.get("modelException","\u6a21\u578b\u5f02\u5e38\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650"));t.setLinkText(" "+a.get("viewModel","\u67e5\u770b\u8be5\u6a21\u578b"),
f);B.appendTo(r);B.hide();za()}return ba};var za=function(r){var t=J.getModelId();r&&console.log("enter...");Y.createFacade(function(R){fa=[];if(R)for(var w=0;w<R.length;w++){var aa=new Sa;aa.fromJsonObject(R[w]);fa.push(aa)}z.setField(fa);qa(t)},function(R,w){ca=!1;G.hide();B.show();return!0}).getFields(t)},qa=function(r){Y.createFacade(function(t){Q=[];oa=[];if(t&&t.dataAuthContents){var R=new hb;R.fromJsonObject(t);(Fa=R.getModels()[0])&&Fa.isRoleExist()&&Da&&Da(Fa.isRoleExist());t=Fa.getRowAuth();
R=Fa.getRoleRowAuth();if(t){var w=t.getFilterItems();for(t=0;t<w.length;t++){t===w.length-1&&w[t].setLogicOp(null);var aa=w[t],Ja=Ca(aa);aa.setProperty(Ja);Q.push(aa)}}if(R)for(R=R.getFilterItems(),t=0;t<R.length;t++)0===t&&(w=R[t].getLeftBracketCount(),R[t].setLeftBracketCount(w+1)),t===R.length-1&&(w=R[t].getRightBracketCount(),R[t].setRightBracketCount(w+1),R[t].setLogicOp(null)),R[t].setRoleFilter(!0),w=R[t],aa=Ca(w),w.setProperty(aa),oa.push(R[t]);U&&ha&&ha()}z.setFilterItem(Q.slice(0))},function(t,
R){return 20003102==t?(Y.getMessageCurtain().showPrompt(a.get("modelNoFoundRefresh","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u5148\u5237\u65b0\u754c\u9762\u3002")),!0):!1}).queryDataAuthContent(U,r,N,L)},Ca=function(r){r=r.getProperty();for(var t=r.getFullName(),R=0;R<fa.length;R++){var w=fa[R].getFullName();if(t==w){r=fa[R].clone();break}}return r},f=function(){y.getModelDesignerEntrance()(bb,J.getModelId(),J.getModelName(),J.getModelType())};this.setTitle=function(r){E=r};this.getTitle=
function(){return E};this.into=function(){ka&&(z.setRoleFilter(oa),z.changeInherit(U),ka=!1);Wa.occur(Wa.DATA_AUTH_SETTING_SHOW_METHOD,Wa.ROW_AUTH)}}function Ea(){function P(f){function r(){var d=[],c,l,m,A,v,D,da=!1,u=!0;this.setItemModel=function(b){d=b};this.setShowFieldNameEnable=function(b){u=b};this.setRawTypeSwitchListener=function(b){};this.setSearchListener=function(b){c=b};this.setListItemPainter=function(b){l=b};this.setShowFieldNameListener=function(b){m=b};this.createJqPopup=function(b,
h,p){A=$("<div>");A.appendTo(b);v=$("<div>");A.addClass("modeler-auth-field-popup");b=a.get("search","\u641c\u7d22");var g=new Ya;g.setSearchListenerDelay(200);g.setPlaceholder(b);g.addSearchListener(function(){c(d,g.getText(),v,h,l,da,D)});b=g.getJqUi();b.addClass("modeler-auth-field-popup-search");b.appendTo(A);v.addClass("modeler-auth-field-popup-list-owner");v.on("click",function(x){var C=$(x.currentTarget);x=$(x.target);if(x=I.upwardSearchHasClass(x,C,"modeler-auth-field-popup-list-item"))x.addClass("modeler-auth-list-item_selected_enabled"),
C=x.data("model"),p(C)});v.appendTo(A);b=A.find(".sa-ctrl-textfield-input");b.css("top","0px");b.css("height","100%");if(ba&&0!==ba.length)for(D&&D.hide(),b=0;b<d.length;b++)l&&l(d[b],v,h,!1);else b=new ib,b.setText(a.get("noSelectField","\u6682\u65e0\u53ef\u9009\u5b57\u6bb5")),b.setEnabled(!1),b.setAlign(ib.ALIGN_CENTER),D=b.getJqUi(),D.addClass("modeler-auth-field-popup-search-result"),D.appendTo(v);if(u){b=new ib;var k=a.get("showFieldName","\u663e\u793a\u539f\u5b57\u6bb5\u540d\u79f0");b.setText(k);
b=b.getJqUi();b.attr("title",k);I.layoutCtrlWithLRTB(b,2,null,84,2,10,23);k=new ob;k.addStateChangeListener(function(x,C,S){(da=S)?m&&m(v,!0):m&&m(v,!1)});k.setOn(!1);k=k.getJqUi();I.layoutCtrlWithLRTB(k,88,null,35,2,10,23);var e=$("<div>");e.addClass("modeler-auth-field-popup-show-field-name");k.appendTo(e);b.appendTo(e);e.appendTo(A)}else v.css("bottom","5px")}}function t(){ub.call(this);var d=this,c=this.protectedMethod,l=new ib,m=new ib,A=new Jb,v,D;this.setCaption=function(b,h){c.setTitle(b);
l.setText(h)};this.setText=function(b,h){A.setText(b);var p=0;b&&(b=b.split("\n").length,p=1E3<b?1E3:b);m.setText(p+"/1000\u9879");D=function(g){var k=g?$.trim(A.getText()):null;h(g,k)};c.setClosingAction(D)};this.showDialogLeftAnchorTo=function(b){b&&(d.setSize(450,405),b=I.upwardCoordinate(document.body,[0,0],document.body),d.setPosition(Math.max(0,b[0]-10),Math.max(6,b[1]-405+40)));A.addEditedListener(u);c.setContentPaneCreator(da);d.showDialog();A.requestFocus()};this.setClosingChecker=function(b){b&&
(v=function(){var h=b($.trim(A.getText()));h&&c.getMessageCurtain().showPrompt(h);return h?!1:!0},c.setClosingChecker(v))};var da=function(){m.setAlign(ib.ALIGN_RIGHT);I.layoutCtrlWithLRTB(l.getJqUi(),0,0,null,0,null,23);I.layoutCtrlWithLRTB(A.getJqUi(),0,0,null,30,null,260);I.layoutCtrlWithLRTB(m.getJqUi(),290,0,null,287,null,23);var b=$("<div>");b.append(l.getJqUi());b.append(A.getJqUi());b.append(m.getJqUi());return b},u=function(b){var h=b.getText(),p=[];h&&(p=h.trim().replace(/(\n\s*)+/g,"\n").split("\n"));
h=p.length;1E3<h&&(b.setText(p.slice(0,1E3).join("\n")),h=1E3);m.setText(h+"/1000\u9879");c.getMessageCurtain().hide()}}function R(){var d=[],c,l,m=[],A=[],v;this.setItemModel=function(b,h){v=h;d=b};this.setListItemPainter=function(b){};this.setSelectedItemModel=function(b){m=b;A=m.slice(0)};this.setLastTimeSelectedModel=function(b){A=b};this.getSelectedItemModel=function(){return m};this.createJqPopup=function(b,h,p,g){c=$("<div>");c.appendTo(b);l=$("<div>");c.addClass("modeler-auth-field-popup");
l.addClass("modeler-auth-enum-popup-list-owner");for(b=0;b<d.length;b++)da(d[b],l,h,!1);h=new Ab;h.setHighlight(!0);h.setText(a.get("ok","\u786e\u5b9a"));h=h.getJqUi();h.css("z-index",3);h.css("margin-left",10);I.layoutCtrlWithLRTB(h,"50%",null,50,null,8,28);h.on("click",function(k){A=m.slice(0);p(m)});b=new Ab(a.get("cancel","\u53d6\u6d88"));b.setHighlight(!1);b=b.getJqUi();b.css("z-index",3);b.css("margin-left",-80);I.layoutCtrlWithLRTB(b,"50%",null,50,null,8,28);b.on("click",function(k){m=A.slice(0);
g()});l.appendTo(c);h.appendTo(c);b.appendTo(c);l.css("height","77%");return[-1,260]};var D=function(b,h){h=b.getUserObject();b=b.isChecked();h&&b?(b=u(h),0>b&&m.push(h)):h&&!b&&(b=u(h),-1<b&&m.splice(b,1))},da=function(b,h,p){var g=u(b);p=$("<div>");p.addClass("modeler-auth-field-popup-list-item");p.data("model",b);var k=$("<div>"),e=new gb;e.setUserObject(b);e.setChecked(-1<g);e.addCheckedListener(D);g=e.getJqUi();g.addClass("modeler-auth-field-selection-checkbox-icon");g.data("model",e);e=$("<div>");
e.text(b.fieldValue);e.addClass("modeler-auth-field-selection-checkbox-text");k.append(g);k.append(e);p.append(k);h.append(p)},u=function(b){for(var h=0;h<m.length;h++)if(v(b,m[h]))return h;return-1}}KTDefaultCellRender.call(this,f);var w=this,aa=this.paintCellUI;this.paintCellUI=function(d,c){if(w.getCurrentRowIdx()<H.getHeadRowCount()||!w.getCell())aa(d,c);else{var l=w.getCellWidth(),m=w.getCellHeight(),A=w.getCurrentRow();if(1==w.getCurrentColIdx()||5==w.getCurrentColIdx()){c=1==w.getCurrentColIdx();
var v=w.getCell().getValue();ta(d,l,m,c,v,A)}else if(2==w.getCurrentColIdx()){var D=w.getCell().getValue();Ja(d,l,m,D,A)}else 3==w.getCurrentColIdx()?(c=w.getCell().getValue(),v=(D=A.getUserObject().getProperty())?D.getOutputDataType():"",D=D?D.isEnum():!1,l=H.createCtrlInCell(d,l,m,Za),l.setSelected(c),l.setItemModels(v?ra.getSelectableCompares(v,D):[]),l.setUserObject(A),l.setCustomPainter(pa),l.addSelectedChangedListener(E)):4==w.getCurrentColIdx()?(c=w.getCell().getValue(),Qa(d,l,m,c,A)):6==w.getCurrentColIdx()?
(c=w.getCell().getValue(),K(d,l,m,c,A)):0==w.getCurrentColIdx()?(l=w.getCell().getValue(),m=$(d),m.find(".modeler-auth-filter-table-prompt").remove(),l&&(c=com.kingdee.bos.qing.common.ui.CommonIconUtil.createWarning(),c.addClass("modeler-auth-filter-table-prompt"),c.attr("title",l),c.appendTo(m))):aa(d,c);A.getUserObject().isRoleFilter()&&$(d).css({"pointer-events":"none",opacity:"0.5"})}};var Ja=function(d,c,l,m,A){var v=new r;v.setItemModel(ba);v.setListItemPainter(Oa);v.setSearchListener(ia);v.setShowFieldNameListener(La);
d=H.createCtrlInCell(d,c,l,Bb);d.setUserObject(A);d.setSelectedModel(m);d.setDropdownCreator(function(D,da,u){return v.createJqPopup(D,da,u)});d.addSelectionListener(function(D){var da=D.getSelectedModel();D=D.getUserObject();var u=D.getUserObject(),b=u.getProperty(),h=b?b.getOutputDataType():"",p=da?da.getOutputDataType():"";u.setProperty(da);D.getCell(2).setValue(da);if(h!=p||b.getEnumValue()!=da.getEnumValue()){b=u.getCompareOp();da=da?da.isEnum():!1;da=ra.getSelectableCompares(p,da);p=!1;for(h=
0;h<da.length;h++)if(b==da[h]){p=!0;break}p||(b=ra.COMPARE_EQUAL);u.setCompareOp(b);Fa(D.getCell(3),b);u.setValue(null);Fa(D.getCell(4)," ")}J.checkModelValid()});d.setCustomPainter(function(D,da){da.text(D?D.getAlias():"")})},ia=function(d,c,l,m,A,v,D){D&&D.hide();c=c.trim().toLowerCase();D=[];for(var da,u=0;u<d.length;u++){var b=d[u];da=b.getAlias().trim().toLowerCase();(b=b.getNumber())&&(b=b.trim().toLowerCase());(da=-1!=da.indexOf(c)?!0:v&&-1!=b.indexOf(c)?!0:!1)&&D.push(d[u])}l.children().remove();
if(0<D.length){for(u=0;u<D.length;u++)A(D[u],l,m);D.length=0}else d=new ib,c?d.setText(a.get("nothingSearched","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")):d.setText(a.get("noSelectField","\u6682\u65e0\u53ef\u9009\u5b57\u6bb5")),d.setEnabled(!1),d.setAlign(ib.ALIGN_CENTER),c=d.getJqUi(),c.addClass("modeler-auth-field-popup-search-result"),c.appendTo(l);La(l,v)},La=function(d,c){if(c)for(d=d.find(".modeler-auth-field-popup-list-item-field-name"),c=0;c<d.length;c++){var l=
d.eq(c);l.css("display","inline-block");var m=l.prev().text()+l.text();l.prev().attr("title",null);l.parent().attr("title",m)}else for(d=d.find(".modeler-auth-field-popup-list-item-field-name"),c=0;c<d.length;c++)l=d.eq(c),l.css("display","none"),l.parent().attr("title",null),l.prev().attr("title",l.prev().text())},Oa=function(d,c,l){var m=$("<div>");m.addClass("modeler-auth-field-popup-list-item");m.data("model",d);var A=d?d.getAlias():"",v=$("<span>");v.text(A);v.attr("title",A);v.addClass("modeler-auth-field-popup-list-item-text");
A=d.getNumber();var D=$("<span>");D.addClass("modeler-auth-field-popup-list-item-field-name");D.text("("+A+")");m.append(v);m.append(D);c.append(m);l&&l.getAlias()==d.getAlias()&&ja(c,m)},ja=function(d,c){var l=null;0<d.height()?(clearTimeout(l),c.addClass("modeler-auth-list-item_selected_enabled"),d.prop("scrollTop",c.prop("offsetTop"))):l=setTimeout(function(){ja(d,c)},0)},pa=function(d,c,l){switch(l){case ra.COMPARE_EQUAL:d=a.get("equal","\u7b49\u4e8e");break;case ra.COMPARE_NOT_EQUAL:d=a.get("notEqual",
"\u4e0d\u7b49\u4e8e");break;case ra.COMPARE_GREATER:d=a.get("greater","\u5927\u4e8e");break;case ra.COMPARE_GREATER_EQUAL:d=a.get("equalOrGreater","\u5927\u4e8e\u7b49\u4e8e");break;case ra.COMPARE_LESS:d=a.get("less","\u5c0f\u4e8e");break;case ra.COMPARE_LESS_EQUAL:d=a.get("equalOrLess","\u5c0f\u4e8e\u7b49\u4e8e");break;case ra.COMPARE_INCLUDE:d=a.get("include","\u5305\u542b");break;case ra.COMPARE_NOT_INCLUDE:d=a.get("notInclude","\u4e0d\u5305\u542b");break;case ra.COMPARE_START_WITH:d=a.get("startWith",
"\u5f00\u5934\u662f");break;case ra.COMPARE_END_WITH:d=a.get("endWith","\u7ed3\u5c3e\u662f");break;case ra.COMPARE_NULL:d=a.get("compareNull","\u4e3a\u7a7a");break;case ra.COMPARE_NOT_NULL:d=a.get("compareNotNull","\u4e0d\u4e3a\u7a7a");break;case ra.COMPARE_IN:d=a.get("compareIn","\u5728......\u4e4b\u5185");break;case ra.COMPARE_NOT_IN:d=a.get("compareNotIn","\u4e0d\u5728......\u4e4b\u5185");break;case ra.COMPARE_VARIABLE:d=a.get("compareVariable","\u5339\u914d\u53d8\u91cf");break;default:d=""}c.text(d)},
wa=function(d,c){var l=a.get("enterSplit","\u7cbe\u786e\u5339\u914d\u591a\u503c\uff0c\u5404\u9879\u4e4b\u95f4\u4f7f\u7528\u56de\u8f66\u4f5c\u4e3a\u5206\u9694\u7b26"),m=d.getCompareOp()==ra.COMPARE_IN?a.get("compareIn","\u5728......\u4e4b\u5185"):a.get("compareNotIn","\u4e0d\u5728......\u4e4b\u5185"),A=JSON.parse(d.getValue());A=A?A.join("\n"):"";var v=new t;v.setCaption(m,l);v.setClosingChecker(function(D){if(D&&5E4<D.length)return a.get("matchTooLong","\u5339\u914d\u9879\u4e0d\u80fd\u8d85\u8fc750000\u4e2a\u5b57\u7b26")});
v.setText(A,function(D,da){D&&za(c,d,da)});v.showDialogLeftAnchorTo(c.getJqUi())},Qa=function(d,c,l,m,A){var v=$(d);v.empty();v.css("cursor","");var D=A.getUserObject(),da=D.getCompareOp(),u=D.getProperty(),b=u?u.getOutputDataType():"",h=u?u.getEnumValue():"",p=u?u.isEnum():!1;if(ra.isCompareOpMatchVariable(da)){var g=H.createCtrlInCell(d,c,l,Za);D.setValueMode(ra.MODE_SYS_VAR);d=Cb.getImpl(Cb.SYS_VAR_HELPER);var k=d.createSysVarAdapters(nb.SUPPORTED_VAR_TYPE);g.setItemModels(k);g.setUserObject(A);
g.addSelectedChangedListener(Da);g.setCustomPainter(function(O,Z,la){la?(O=la.getDisplayName(),Z.text(O)):Z.text("")});d.loadVarModelAdapter(D.getValue(),function(O){O=O?O:k[0];g.setSelected(O);D.setValue(O.getId())})}else if(!ra.isCompareOpWithoutValue(da))if(ra.isCompareOpWithinOrNotWithinValue(da))if(p){var e=[],x;for(x in h)e.push({fieldValue:h[x],fieldName:x});var C=[];(m=JSON.parse(D.getValue()))&&m.forEach(function(O){e.forEach(function(Z){O==Z.fieldName&&C.push({fieldValue:Z.fieldValue,fieldName:Z.fieldName})})});
var S=new R;S.setItemModel(e,function(O,Z){return O&&Z&&O.fieldName==Z.fieldName});S.setSelectedItemModel(C);d=H.createCtrlInCell(d,c,l,Bb);d.setUserObject(A);d.setSelectedModel(C);d.setDropdownCreator(function(O,Z,la,ma){return S.createJqPopup(O,Z,la,ma)});d.addSelectionListener(function(O){var Z=O.getSelectedModel();O=O.getUserObject().getUserObject();if(null==Z||0==Z.length)O.setValue(null);else{JSON.parse(O.getValue());var la=[],ma;for(ma in Z)la.push(Z[ma].fieldName);O.setValue(JSON.stringify(la))}J.checkModelValid()});
d.setCustomPainter(function(O,Z){var la=[],ma;for(ma in O)la.push(O[ma].fieldValue);Z.text(la.join(","))})}else{var ea=H.createCtrlInCell(d,c,l,Kb);ea.setClearable(!0);ea.setUserObject(A);ea.getJqUi().find(".sa-ctrl-f7selector-text").on("click",function(){wa(D,ea)});ea.addActionListener(function(O){wa(D,ea)});null!=m&&""!=m&&" "!=m&&m&&ea.setModel(JSON.parse(m).join(","));ea.setCustomPainter(function(O){return O});ea.addClearListener(function(O){za(O,D,null)})}else if(b==Sa.DT_DATE||b==Sa.DT_DATETIME)v=
new Date,m=m?parseInt(m):null,isNaN(m)||null==m?(D=A.getUserObject(),D.setValue(v.getTime())):v.setTime(m),d=H.createCtrlInCell(d,c,l,b==Sa.DT_DATETIME?Lb:Mb),d.setDateObject(v),d.setUserObject(A),d.addModelChangedListener(qa);else if(b==Sa.DT_BOOLEAN)g=H.createCtrlInCell(d,c,l,Za),g.setSelected(m),g.setItemModels([Sa.BOOLEAN_TRUE,Sa.BOOLEAN_FALSE]),g.setUserObject(A),g.setCustomPainter(function(O,Z,la){O=la==Sa.BOOLEAN_TRUE?a.get("dataTypeTrue","\u771f"):la==Sa.BOOLEAN_FALSE?a.get("dataTypeFalse",
"\u5047"):"";Z.text(O)}),g.addSelectedChangedListener(Ca);else if(ka(u))A=$("<div>"),A.text(m),A.addClass("modeler-auth-common-cell-editable"),A.appendTo(v),v.css("cursor","pointer");else if(p){e=[];for(x in h)e=e.concat(x);g=H.createCtrlInCell(d,c,l,Za);g.setSelected(m);g.setItemModels(e);g.setUserObject(A);g.setCustomPainter(function(O,Z,la){Z.text(h[la])});g.addSelectedChangedListener(Ca)}},ta=function(d,c,l,m,A,v){d=H.createCtrlInCell(d,c,l,Za);d.setSelected(A);d.setItemModels([0,1,2,3,4]);d.setUserObject(v);
d.setCustomPainter(function(D,da,u){D=m?"(":")";for(var b="",h=0;h<u;h++)b+=D;da.text(b)});d.addSelectedChangedListener(m?Q:oa)},K=function(d,c,l,m,A){d=H.createCtrlInCell(d,c,l,Za);d.setSelected(m?m:null);d.setItemModels([null,ra.LOGIC_AND,ra.LOGIC_OR]);d.setUserObject(A);d.setCustomPainter(function(v,D,da){v="";da==ra.LOGIC_AND?v=a.get("and","\u4e14"):da==ra.LOGIC_OR&&(v=a.get("or","\u6216"));D.text(v)});d.addSelectedChangedListener(fa)}}var J=this,N,L,ba=[],z=[],G=[],B;this.setRoleFilter=function(f){z=
f};this.changeInherit=function(f){var r=J.getFilterItem(),t=r[r.length-1];f?(t&&0<z.length?t.setLogicOp(ra.LOGIC_OR):t&&0===z.length&&t.setLogicOp(null),J.setFilterItem(r.concat(z).slice(0))):(t&&t.setLogicOp(null),J.setFilterItem(r.slice(0)))};this.setField=function(f){ba=f};this.setFilterItem=function(f){G=f;J.updateUi()};this.getFilterItem=function(){for(var f=G.slice(0),r=[],t=0;t<f.length;t++)f[t].getProperty()&&!f[t].isRoleFilter()&&r.push(f[t]);return r};this.getJqUi=function(){if(!N){N=$("<div>");
B=H.createTable();B.setDraggableAdjusting(!1);B.setSyncUIWhenModelChanged(!0);B.setColumnFitVisibleWidth(!0);B.setScrollerVisible("hidden","auto");H.bindTextEditor(B,U,ca);H.bindTableListenerForCtrl(B,ha);var f=new P(B);f.setOutsideVisible(!1);B.setCellRender(f);B.addColumns(8);B.getColumn(0).setWidth(20);B.getColumn(1).setWidth(72);B.getColumn(2).setWidth(140);B.getColumn(3).setWidth(72);B.getColumn(4).setWidth(140);B.getColumn(5).setWidth(72);B.getColumn(6).setWidth(72);B.getColumn(7).setWidth(100);
f=H.createHeadRow(B);f.getCell(1).setValue(a.get("leftBracket","\u5de6\u62ec\u53f7"));f.getCell(2).setValue(a.get("field","\u5b57\u6bb5"));f.getCell(3).setValue(a.get("compare","\u6bd4\u8f83"));f.getCell(4).setValue(a.get("value","\u503c"));f.getCell(5).setValue(a.get("rightBracket","\u53f3\u62ec\u53f7"));f.getCell(6).setValue(a.get("logic","\u903b\u8f91"));f=$(B.getUI());I.layoutCtrlWithLRTB(f,0,0,null,0,0,null);f.appendTo(N)}return N};this.locateToErrorRow=function(f,r){for(var t=H.getHeadRowCount();t<
B.getRowsCount();t++)B.getRow(t).getCell(0).setValue("");0<=f&&B.getRow(f+H.getHeadRowCount()).getCell(0).setValue(r)};this.checkModelValid=function(){var f=sa.FilterCheckHelper.checkFilterProperty(G,ba);if(f||(f=sa.FilterCheckHelper.checkFilterLogical(G)))return J.locateToErrorRow(f.getFiltersErrorRow(),f.getPrompt()),f.getPrompt();J.locateToErrorRow(-1);return null};var U=function(f,r){if(4!=r)return!1;f=B.getRow(f).getUserObject();r=f.getCompareOp();if(ra.isCompareOpWithoutValue(r)||ra.isCompareOpWithinOrNotWithinValue(r)||
ra.isCompareOpMatchVariable(r))return!1;f=f.getProperty();return ka(f)},ka=function(f){var r=f?f.getOutputDataType():"";f=f?f.isEnum():!1;return(r==Sa.DT_STRING||r==Sa.DT_NUMBER||r==Sa.DT_INT)&&!f},ca=function(f,r,t,R,w){f=f.getUserObject();f.getValue()!==R&&(f.setValue(R),t.setValue(R),J.checkModelValid());return!0},ha=function(f,r,t,R){f=null;if(r&&!G[t-3].isRoleFilter()){r=KTableUIAbstractView.createCellId(B.getRow(t),B.getColumn(B.getColumnsCount()-1));f=J.getJqUi().find("#"+r);var w=t-3;t=$("<div>");
t.text(a.get("insert","\u63d2\u5165"));t.addClass("modeler-auth-filter-table-op");t.addClass("modeler-auth-filter-table-op-insert");t.appendTo(f);t.on("click",function(aa){aa=new ra;G.splice(w,0,aa);J.updateUi();J.checkModelValid()});t=$("<div>");t.text(a.get("deleteRow","\u5220\u9664"));t.addClass("modeler-auth-filter-table-op");t.addClass("modeler-auth-filter-table-op-delete");t.appendTo(f);t.on("click",function(aa){G.splice(w,1);J.updateUi();J.checkModelValid()});f.css("text-align","center")}else L&&
L.find(".modeler-auth-filter-table-op-insert").remove(),L&&L.find(".modeler-auth-filter-table-op-delete").remove();L=f};this.updateUi=function(){if(B){for(var f=G.length-1;0<=f;f--)if(G[f].isEmpty())G.splice(f,1);else break;H.clearWithoutHead(B);var r=G.length,t=Math.max(7,r+4);for(f=0;f<t;f++){if(f<r)var R=G[f];else R=new ra,G.push(R);var w=H.createRow(B);w.setUserObject(R);w.getCell(0).setValue("");w.getCell(1).setValue(R.getLeftBracketCount());w.getCell(2).setValue(R.getProperty());w.getCell(3).setValue(R.getCompareOp());
w.getCell(4).setValue(R.getValue()?R.getValue():"");w.getCell(5).setValue(R.getRightBracketCount());w.getCell(6).setValue(R.getLogicOp()?R.getLogicOp():"")}H.refresh(B);J.checkModelValid()}};var Da=function(f,r,t){f.getUserObject().getUserObject().setValue(t.getId());J.checkModelValid()},Fa=function(f,r){f.setValue(""===r?" ":"");f.setValue(r)},E=function(f,r,t){f=f.getUserObject();var R=f.getUserObject();R.setCompareOp(t);f.getCell(3).setValue(t);if(ra.isCompareOpWithoutValue(r)!=ra.isCompareOpWithoutValue(t)||
ra.isCompareOpWithinOrNotWithinValue(r)!=ra.isCompareOpWithinOrNotWithinValue(t))R.setValue(null),Fa(f.getCell(4)," ");if(t==ra.COMPARE_VARIABLE||r==ra.COMPARE_VARIABLE)R.setValue(null),R.setValueMode(t==ra.COMPARE_VARIABLE?ra.MODE_SYS_VAR:ra.MODE_CONST),Fa(f.getCell(4)," ");J.checkModelValid()},Q=function(f,r,t){f=f.getUserObject();f.getUserObject().setLeftBracketCount(t);f.getCell(1).setValue(t);J.checkModelValid()},oa=function(f,r,t){f=f.getUserObject();f.getUserObject().setRightBracketCount(t);
f.getCell(5).setValue(t);J.checkModelValid()},fa=function(f,r,t){f=f.getUserObject();f.getUserObject().setLogicOp(t);f.getCell(6).setValue(t);J.checkModelValid()},za=function(f,r,t){null!=t&&f.setModel(t.replace(/(\n\s*)+/g,","));if(null==t||r.getValue()!=JSON.stringify(t.split("\n"))){f=f.getUserObject();if(null!=t&&""!=t){t=JSON.parse(JSON.stringify(t.split("\n")));var R=[];t&&t.forEach(function(w){""!=w.trim()&&R.push(w)});t=JSON.stringify(R);r.setValue(t);f.getCell(4).setValue(t)}else r.setValue(null),
f.getCell(4).setValue(null);J.checkModelValid()}},qa=function(f){var r=""+f.getDateObject().getTime();f=f.getUserObject();f.getUserObject().setValue(r);f.getCell(4).setValue(r);J.checkModelValid()},Ca=function(f,r,t){f=f.getUserObject();f.getUserObject().setValue(t);f.getCell(4).setValue(t);J.checkModelValid()}}function Ba(P,J,N,L){var ba=this,z,G,B,U,ka=P,ca=!1,ha=0,Da=null,Fa=null,E,Q=[],oa,fa=[],za=[],qa,Ca="0",f="",r=!0,t,R=[new X("intersection",a.get("intersection","\u4ea4\u96c6")),new X("union",
a.get("union","\u5e76\u96c6"))],w=[new X("0",a.get("allFields","\u5168\u90e8\u5b57\u6bb5")),new X("1",a.get("viewableField","\u53ef\u67e5\u770b\u5b57\u6bb5")),new X("2",a.get("unViewableField","\u7981\u6b62\u67e5\u770b\u5b57\u6bb5"))];this.isInitialized=function(){return null!=oa};this.setInherit=function(ja){ka=ja;ca=!0};this.setFunRoleAuth=function(ja){t=ja};this.doChangeInherit=function(ja){ka?(ha=45,Da?Da.show():Ja()):(ha=0,Da&&Da.hide());I.layoutCtrlWithLRTB(Fa,0,0,null,0,ha,null);oa.changeInherit(ka,
Ca,f,ja);ca=!1};this.getRelation=function(){return oa.getRelation()};this.getRoleNoAuth=function(){return oa.getRoleNoAuth()};this.getNoAuth=function(){return oa.getNoAuth()};this.getProperty=function(){return Q};this.checkLegality=function(){return!0};this.getJqUi=function(){z||(z=aa());return z};var aa=function(){z=$("<div>");G=$("<div>");I.layoutCtrlWithLRTB(G,0,0,null,-35,null,35);G.appendTo(z);var ja=new Ya;ja.setSearchListenerDelay(1E3);ja.setShowSearchIcon(!0);ja.setPlaceholder(a.get("searchFieldContent",
"\u8bf7\u8f93\u5165\u5b57\u6bb5\u540d\u79f0"));var pa=ja.getJqUi();I.layoutCtrlWithLRTB(pa,null,0,160,0,8,27);var wa=pa.find(":input");this.searchField=function(){f=ja.getText();oa.updateViewable(Ca,f)};wa.attr("oninput","searchField();");pa.find(".sa-ctrl-searchbox-close").on("click",function(Qa){f=ja.getText();oa.updateViewable(Ca,f)});pa.appendTo(G);pa=new Za;pa.setItemModels(w);pa.setSelected(w[0]);pa.addSelectedChangedListener(function(Qa,ta,K){Ca=K.getValue();oa.updateViewable(Ca,f)});pa=pa.getJqUi();
I.layoutCtrlWithLRTB(pa,null,180,100,0,8,27);pa.appendTo(G);Fa=$("<div>");I.layoutCtrlWithLRTB(Fa,0,0,null,0,ha,null);Fa.appendTo(z);oa=new Ga;oa.setDataTable(!0);oa.setInherit(!1);oa.protectedInit(Fa);pa=new Ka;U=pa.getNoDataTableJqUi();pa.setText(a.get("modelException","\u6a21\u578b\u5f02\u5e38\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u6570\u636e\u6743\u9650"));pa.setLinkText(" "+a.get("viewModel","\u67e5\u770b\u8be5\u6a21\u578b"),Oa);U.appendTo(z);U.hide();ia();return z},Ja=function(){Da=$("<div>");I.layoutCtrlWithLRTB(Da,
0,0,null,null,0,45);Da.appendTo(z);var ja=$("<div>");ja.addClass("auth-setting-combo-box-label");ja.appendTo(Da);var pa=$("<span>");pa.text(a.get("effectiveFields","\u751f\u6548\u7684\u53ef\u89c1\u5b57\u6bb5\u96c6\u5408\u662f\u7528\u6237/\u89d2\u8272\u7684"));pa.appendTo(ja);pa=$("<span>");pa.text("*");pa.css("color","red");pa.appendTo(ja);B=new Za;B.setItemModels(R);B.setSelected(R[0]);qa===R[1].getValue()&&B.setSelected(R[1]);B.addSelectedChangedListener(function(wa,Qa,ta){qa=ta.getValue();oa.setRelation(qa);
oa.updateEffective()});ja=B.getJqUi();ja.addClass("auth-setting-combo-box");ja.appendTo(Da);ha=45},ia=function(ja){var pa=J.getModelId();ja&&console.log("enter...");Y.createFacade(function(wa){Q=[];if(wa)for(var Qa=0;Qa<wa.length;Qa++){var ta=new Sa;ta.fromJsonObject(wa[Qa]);Q.push(ta)}oa.setProperty(Q);La(pa)},function(wa,Qa){Fa.hide();U.show();return!0}).getFields(pa,!0)},La=function(ja){Y.createFacade(function(pa){za=[];fa=[];qa=R[0].getValue();if(pa&&pa.dataAuthContents){var wa=new hb;wa.fromJsonObject(pa);
(wa=wa.getModels()[0])&&wa.isRoleExist()&&t&&t(wa.isRoleExist());pa=wa.getCellAuth();wa=wa.getRoleCellAuth();pa&&(za=pa.getNoAuthFields(),qa=pa.getRelation()?pa.getRelation():R[0].getValue());wa&&(fa=wa.getNoAuthFields())}B&&qa==R[1].getValue()&&B.setSelected(R[1]);oa.setRelation(qa);oa.setRoleNoAuth(fa);oa.setNoAuth(za);oa.protectedUpdateUi(Q)},function(pa,wa){return 20003102==pa?(Y.getMessageCurtain().showPrompt(a.get("modelNoFoundRefresh","\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u5148\u5237\u65b0\u754c\u9762\u3002")),
!0):!1}).queryDataAuthContent(ka,ja,N,L)},Oa=function(){y.getModelDesignerEntrance()(bb,J.getModelId(),J.getModelName(),J.getModelType())};this.setTitle=function(ja){E=ja};this.getTitle=function(){return E};this.into=function(){ca&&ba.doChangeInherit(r);r=!1;Wa.occur(Wa.DATA_AUTH_SETTING_SHOW_METHOD,Wa.COL_AUTH)}}function Ga(){function P(f){KTDefaultCellRender.call(this,f);var r=this,t=[Sa.DT_STRING,Sa.DT_NUMBER,Sa.DT_INT,Sa.DT_DATE,Sa.DT_DATETIME,Sa.DT_BOOLEAN],R=this.paintCellUI,w=function(ia){var La=
$("<div>");La.addClass("auth-setting-field-enable");ca=new gb;ca.setChecked(!1);ca.addCheckedListener(function(ja,pa){if(pa){for(pa=0;pa<ha.length;pa++)!ha[pa].getUserObject().isDimension()&&ha[pa].setChecked(ja.isChecked());B&&J.updateEffective()}});var Oa=ca.getJqUi();Oa.addClass("auth-setting-field-enable-combobox");Oa.appendTo(La);Oa=$("<div>");Oa.text(a.get("viewEnable","\u53ef\u67e5\u770b\u5b57\u6bb5"));B&&Oa.text(a.get("userEnable","\u7528\u6237\u7ea7\u522b\u5b57\u6bb5\u53ef\u89c1\u6027"));
Oa.addClass("auth-setting-field-enable-text");Oa.appendTo(La);La.appendTo(ia)},aa=function(ia,La,Oa){var ja=$(La);1==r.getCurrentColIdx()?Ja(La,r.getCellWidth(),r.getCellHeight(),ia,r.getCurrentRow()):(R(La,Oa),ja.css("cursor","default"))};this.paintCellUI=function(ia,La){if(r.getCurrentRowIdx()<H.getHeadRowCount())1===r.getCurrentRowIdx()&&(B&&4===r.getCurrentColIdx()||!B&&3===r.getCurrentColIdx())?w(ia):R(ia,La),$(ia).css("color","#666");else{var Oa=$(ia),ja=$("<div>"),pa=r.getCurrentRow().getUserObject(),
wa=pa.getFullName(),Qa=0,ta=!0;if(0==r.getCurrentColIdx())Oa.empty(),ja.text(r.getCurrentRowIdx()-2),ja.addClass("field-table-cell-editable"),ja.css("text-align","center"),Oa.append(ja);else if(1==r.getCurrentColIdx())aa(pa,ia,La),Oa.css("pointer-events","none");else if(2==r.getCurrentColIdx())Oa.empty(),wa=r.getCell().getValue(),ja.text(wa),ja.addClass("field-table-cell-editable"),ja.attr("title",wa),Oa.append(ja),Oa.css("pointer-events","none");else if(B&&3==r.getCurrentColIdx()){ia=new gb;ia.setEnabled(!1);
for(Qa=0;Qa<ba.length;Qa++)if(ja=ba[Qa].getFullName(),ja==wa){ta=!1;break}ia.setChecked(ta);Da.push(ia);wa=ia.getJqUi();I.layoutCtrlWithLRTB(wa,75,null,23,4,null,23);Oa.append(wa)}else if(B&&4==r.getCurrentColIdx()){ia=new gb;if(0<E.length)ta=E[r.getCurrentRowIdx()-3].isChecked();else for(Qa=0;Qa<z.length;Qa++)if(ja=z[Qa].getFullName(),ja==wa){ta=!1;break}ia.setChecked(ta);ia.setEnabled(!pa.isDimension());ia.setUserObject(pa);ia.addCheckedListener(function(K,d){d&&(fa(),J.updateEffective())});ha.push(ia);
wa=ia.getJqUi();I.layoutCtrlWithLRTB(wa,75,null,23,4,null,23);Oa.append(wa);pa.isDimension()&&Oa.attr("title",a.get("dimensionTips","\u7ef4\u5ea6\u5b57\u6bb5\u5fc5\u9009"))}else if(B&&5==r.getCurrentColIdx()){ta=pa=!0;for(Qa=0;Qa<ba.length;Qa++)if(ja=ba[Qa].getFullName(),ja==wa){pa=!1;break}if(0<E.length)ta=E[r.getCurrentRowIdx()-3].isChecked();else for(Qa=0;Qa<z.length;Qa++)if(ja=z[Qa].getFullName(),ja==wa){ta=!1;break}ta="intersection"==U?ta&&pa:ta||pa;wa=$("<div>");ta?M.background(wa,"icon-field-visible"):
M.background(wa,"icon-field-novisible");Fa.push(wa);I.layoutCtrlWithLRTB(wa,75,null,25,6,null,23);Oa.append(wa)}else if(B||3!=r.getCurrentColIdx())R(ia,La);else{ia=new gb;if(0<E.length)ta=E[r.getCurrentRowIdx()-3].isChecked();else for(Qa=0;Qa<z.length;Qa++)if(ja=z[Qa].getFullName(),ja==wa){ta=!1;break}ia.setEnabled(!pa.isDimension());ia.setChecked(ta);ia.setUserObject(pa);ia.addCheckedListener(function(K,d){d&&fa()});ha.push(ia);wa=ia.getJqUi();I.layoutCtrlWithLRTB(wa,105,null,23,4,null,23);Oa.append(wa);
pa.isDimension()&&Oa.attr("title",a.get("dimensionTips","\u7ef4\u5ea6\u5b57\u6bb5\u5fc5\u9009"))}}};var Ja=function(ia,La,Oa,ja,pa){var wa=ja.getDataType();ja=ja.getOutputDataType();ia=H.createCtrlInCell(ia,La,Oa,Za);ia.setSelected(ja);ia.setItemModels(t);ia.setUserObject(pa);ia.setCustomPainter(function(Qa,ta,K){Qa=Qa?!1:K==wa;var d="icon-"+K.toLowerCase(),c=$("<div>");c.addClass("field-table-datatype-icon");M.background(c,d);c.appendTo(ta);K=sa.PropDataTypeUtil.getDataTypeDesc(K);d=$("<div>");d.text(K+
(Qa?"("+a.get("origin","\u539f\u59cb")+")":""));d.addClass("field-table-datatype-text");d.appendTo(ta)});ia.addSelectedChangedListener(Ca)}}var J=this,N,L=[],ba=[],z=[],G=!1,B=!1,U,ka,ca,ha=[],Da=[],Fa=[],E=[];this.setProperty=function(f){L=f};this.setRelation=function(f){U=f};this.getRelation=function(){return U};this.setRoleNoAuth=function(f){ba=f};this.getRoleNoAuth=function(){return ba};this.setNoAuth=function(f){z=f};this.getNoAuth=function(){Q();for(var f=[],r=0;r<E.length;r++){var t=E[r].getUserObject();
!E[r].isChecked()&&f.push(t)}return z=f};this.setDataTable=function(f){G=f};this.setInherit=function(f){B=f};this.changeInherit=function(f,r,t,R){B=f;N.removeAllRows();N.removeAllColumns();oa();z=J.getNoAuth();J.protectedUpdateUi(L);!R&&J.updateViewable(r,t)};this.updateEffective=function(){for(var f=0;f<ha.length;f++){var r=ha[f].isChecked(),t=Da[f].isChecked();"intersection"==U?r&&t?M.background(Fa[f],"icon-field-visible"):M.background(Fa[f],"icon-field-novisible"):r||t?M.background(Fa[f],"icon-field-visible"):
M.background(Fa[f],"icon-field-novisible")}};this.updateSearchResult=function(f){Q();var r=N.getRowsCount();f=f.trim().toLowerCase();for(var t=3;t<r;t++)-1!==N.getRow(t).getUserObject().getAlias().toLowerCase().indexOf(f)?N.getRow(t).setHide(!1):N.getRow(t).setHide(!0);Da=[];Fa=[];ha=[];N.updateUI()};this.updateViewable=function(f,r){Q();var t=N.getRowsCount();r=r.trim().toLowerCase();for(var R=3;R<t;R++){var w=!0;"0"===f?w=!1:"1"===f?w=!E[R-3].isChecked():"2"===f&&(w=E[R-3].isChecked());var aa=N.getRow(R).getUserObject().getAlias().toLowerCase();
w=!w&&-1!==aa.indexOf(r);N.getRow(R).setHide(!w)}Da=[];Fa=[];ha=[];N.updateUI();fa();0<ha.length?ka.hide():ka.show()};var Q=function(){if(0===E.length)for(var f=0;f<ha.length;f++)E.push(ha[f]);else for(f=0;f<ha.length;f++)for(var r=ha[f].getUserObject(),t=0;t<E.length;t++)if(r==E[t].getUserObject()){E[t].setChecked(ha[f].isChecked());break}};this.protectedInit=function(f){N=new KTable;H.bindTextEditor(N,za,qa);var r=new P(N);r.setOutsideVisible(!1);N.setCellRender(r);N.setSyncUIWhenModelChanged(!1);
N.setColumnFitVisibleWidth(!1);N.setFrozenRows(3);N.setDraggableAdjusting(!0);oa();r=$(N.getUI());I.layoutCtrlWithLRTB(r,0,0,null,0,0,null);r.appendTo(f);r=new Ka;ka=r.getNoDataTableJqUi();r.setTopPx(35);r.updateIcon("icon-search_none");r.setText(a.get("noMatchedResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"));ka.appendTo(f);ka.hide()};var oa=function(){var f=H.createHeadRow(N);if(B){N.addColumns(6);N.getColumn(0).setWidth(80);N.getColumn(1).setWidth(G?120:80);N.getColumn(2).setWidth(G?
120:80);N.getColumn(3).setWidth(G?145:105);N.getColumn(4).setWidth(G?160:100);N.getColumn(5).setWidth(G?145:105);f.getCell(0).setValue("#");f.getCell(1).setValue(a.get("fieldDataType","\u5b57\u6bb5\u7c7b\u578b"));f.getCell(2).setValue(a.get("fieldName","\u5b57\u6bb5\u540d\u79f0"));f.getCell(3).setValue(a.get("roleEnable","\u89d2\u8272\u7ea7\u522b\u5b57\u6bb5\u53ef\u89c1\u6027"));f.getCell(4).setValue(a.get("userEnable","\u7528\u6237\u7ea7\u522b\u5b57\u6bb5\u53ef\u89c1\u6027"));f.getCell(5).setValue(a.get("effectiveEnable",
"\u751f\u6548\u7684\u5b57\u6bb5\u53ef\u89c1\u6027"));var r=new KTStyle;r.setBackgroundColor("#F7D49F");N.getRow(0).getCell(5).setStyle(r);N.getRow(1).getCell(5).setStyle(r);N.getRow(2).getCell(5).setStyle(r)}else N.addColumns(4),N.getColumn(0).setWidth(100),N.getColumn(1).setWidth(G?150:110),N.getColumn(2).setWidth(G?200:160),N.getColumn(3).setWidth(G?220:155),f.getCell(0).setValue("#"),f.getCell(1).setValue(a.get("fieldDataType","\u5b57\u6bb5\u7c7b\u578b")),f.getCell(2).setValue(a.get("fieldName",
"\u5b57\u6bb5\u540d\u79f0")),f.getCell(3).setValue(a.get("viewEnable","\u53ef\u67e5\u770b\u5b57\u6bb5"));r=new KTBorderStyle;r.setLeftBorderWidth(0);f.getCell(0).setBorder(r)};this.protectedUpdateUi=function(f){Da=[];Fa=[];ha=[];H.clearWithoutHead(N);for(var r,t=0;t<f.length;t++){var R=f[t];r=H.createRow(N);r.setUserObject(R);var w=r;w.getCell(1).setValue(R.getOutputDataType());w.getCell(2).setValue(R.getAlias())}r&&(f=(f=r.getBorder())?f.copy():new KTBorderStyle,f.setBottomBorderWidth(1),f.setBottomBorderPen("solid"),
f.setBottomBorderColor("#eee"),r.setBorder(f));N.updateUI();fa()};var fa=function(){for(var f=!0,r=0;r<ha.length;r++)if(!ha[r].isChecked()){f=!1;break}ca.setChecked(f)},za=function(f,r){return 2==r},qa=function(f,r,t,R,w){f=f.getUserObject();r=!1;for(var aa=0;aa<L.length;aa++){var Ja=L[aa];if(f.getName()!=Ja.getName()&&Ja.getAlias()==R){r=!0;break}}if(r)return t=a.get("duplicatedName","\u91cd\u590d\u7684\u5b57\u6bb5\u663e\u793a\u540d\u79f0\uff1a")+R,w||(t+=a.get("abandonModify","\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002")),
Y.getMessageCurtain().showPrompt(t),!1;f.getAlias()!=R&&(t.setValue(R),f.setAlias(R));return!0},Ca=function(f,r,t){f.getUserObject().getUserObject().setAppointedDataType(t)}}"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.auth&&(com.kingdee.bos.qing.modeler.modelset.auth={});"undefined"==typeof com.kingdee.bos.qing.modeler.modelset.auth.ui&&(com.kingdee.bos.qing.modeler.modelset.auth.ui={});var sa=com.kingdee.bos.qing.modeler.modelset.auth.ui;sa.Main=function(){function P(){var E,Q;this.getToolBarJqUi=function(){if(!N){N=$("<div>");N.addClass("modelset-data-auth-toolbar");var fa=$("<div>");fa.addClass("view-type-tab-title");
fa.text(a.get("viewType","\u5c55\u793a\u65b9\u5f0f\uff1a"));fa.appendTo(N);E=$("<div>");E.addClass("view-type-box-checked");fa=ca[0];E.text(fa.toString());E.attr("viewType",fa.getValue());E.attr("title",fa.toString());E.attr("checked","checked");E.on("click",oa);E.appendTo(N);Q=$("<div>");Q.addClass("view-type-box-unchecked");fa=ca[1];Q.text(fa.toString());Q.attr("viewType",fa.getValue());Q.attr("title",fa.toString());Q.on("click",oa);Q.appendTo(N)}return N};var oa=function(fa){fa=$(fa.target);"checked"!==
fa.attr("checked")&&("0"===fa.attr("viewType")?(pb=!0,E.attr("checked","checked"),E.removeClass("view-type-box-unchecked"),E.addClass("view-type-box-checked"),Q.removeAttr("checked"),Q.removeClass("view-type-box-checked"),Q.addClass("view-type-box-unchecked"),ba.hide(),L.show(),z.resize()):(pb=!1,Q.attr("checked","checked"),Q.removeClass("view-type-box-unchecked"),Q.addClass("view-type-box-checked"),E.removeAttr("checked"),E.removeClass("view-type-box-checked"),E.addClass("view-type-box-unchecked"),
G||(G=new ya(ka),G.updateErrorModels(B),G.updateModelState(U),ba=G.getModelSetMainAreaJqUi(),ba.appendTo(J)),L.hide(),ba.show(),G.resize()),Wa.occur(Wa.PAGE_SHOW_METHOD,Wa.getPageShowMethod(fa.attr("viewType"))))}}var J,N,L,ba,z,G,B=[],U=!0,ka=!1,ca=[new X("0",a.get("showByModel","\u6309\u6a21\u578b\u5c55\u793a")),new X("1",a.get("showByUser","\u6309\u7528\u6237\u6216\u89d2\u8272\u5c55\u793a"))];this.createJqUi=function(E){ka=E;J=$("<div>");J.addClass("modelset-data-auth");N=(new P).getToolBarJqUi();
N.appendTo(J);ha();z=new xa(ka);z.setErrorStateListener(Da);z.setModelStateListener(Fa);L=z.getModelSetMainAreaJqUi();L.appendTo(J);var Q=function(oa){oa.altKey&&oa.ctrlKey&&oa.shiftKey&&"KeyL"===oa.code&&(console.log("\u6e05\u7406\u5e9f\u5f03\u7684\u6570\u636e\u6743\u9650"),oa=Y.createFacade(function(){console.log("\u6e05\u7406\u5e9f\u5f03\u7684\u6570\u636e\u6743\u9650\u6210\u529f");document.body.removeEventListener("keydown",Q,!0)},function(){console.log("\u6e05\u7406\u5e9f\u5f03\u7684\u6570\u636e\u6743\u9650\u5931\u8d25");
document.body.removeEventListener("keydown",Q,!0)}),oa.setShowBlocking(!1),oa.deleteInvalidData())};document.body.addEventListener("keydown",Q,!0);return J};var ha=function(){var E=Y.createFacade(function(Q){Q&&0!=Q.length&&nb.VARIANTTYPEENUM.forEach(function(oa){Q.forEach(function(fa){oa.getTypeID()==fa&&nb.SUPPORTED_VAR_TYPE.push(oa)})})},function(){});E.setShowBlocking(!1);E.loadSupportSystemVar()},Da=function(E){B=E;G&&G.updateErrorModels(B)},Fa=function(E){U=E;G&&G.updateModelState(U)}};var q,
y,a,V,T,M,F,Ra,I,W,ua,Za,Ya,Ta,H,gb,ob,lb,sb,ub,yb,ib,Bb,Jb,Ab,Kb,Mb,Lb,mb,wb,zb,Gb,Fb,fb,Ma,va,ra,Sa,Hb,hb,tb,rb,Ib,vb,nb,Cb,bb,xb,pb,Wa,Eb;(function(){var P=com.kingdee.bos.qing.common;I=P.DomUtil;W=P.Util;P=com.kingdee.bos.qing.framework.common;a=P.MultilanguageManager.createPackageAccessor(sa);V=P.WindowResizeObserver;T=P.Resource;P=com.kingdee.bos.qing.ui.component;F=P.MessageCurtain;Ra=P.MessageDialog;Za=P.ComboBox;Ya=P.SearchBox;Ta=P.TabContainer;gb=P.CheckBox;ob=P.SwitchButton;lb=P.Tree;sb=
P.SimpleConfirmer;ub=P.AbstractModalDialog;yb=P.List;ib=P.Label;Bb=P.DropdownSelector;Jb=P.TextArea;Ab=P.Button;Kb=P.F7Selector;Lb=P.DateTimeSelector;Mb=P.DateSelector;wb=P.Tips;zb=P.HelpIcon;Gb=P.Icons;Fb=P.Dialog;P=com.kingdee.bos.qing.integration;ua=P.UserAndRoleForm;P=com.kingdee.bos.qing.modeler.modelset.auth.common;q=P.Facade;y=P.Integration;M=P.Icons;Wa=P.UserOperationReporter;P=com.kingdee.bos.qing.modeler.modelset.auth.model;fb=P.ModelFolderNode;Ma=P.ModelLeafNode;va=P.UserDataAuth;ra=P.FilterItem;
Sa=P.Property;Hb=P.ModelSetRole;hb=P.QingModelerDataAuth;tb=P.DataAuthModeler;Ib=P.RowAuth;rb=P.CellAuth;vb=P.ModelStatus;Eb=P.DataAuthUtil;P=com.kingdee.bos.qing.modeler.common;Cb=P.VariateHelperFactory;P=com.kingdee.bos.qing.modeler.common.model;nb=P.SystemVarType;P=com.kingdee.bos.qing.common.ui;H=P.TableUtil;mb=P.CommonIconUtil;bb=W.decodeParamFromUrl(location.search,"modelSetId");xb=W.decodeParamFromUrl(location.search,"modelSetName");pb=!0})();var Y=new function(){var P;this.getMessageCurtain=
function(){P||(P=new F,P.getJqUi().appendTo($("body")));return P};this.createFacade=function(J,N,L){var ba=y.getRemoteImpl();return new q(ba,J,function(z,G){return N?N(z,G):!1},L)}};ra.COMPARE_WITH_RAW="RAW";ra.COMPARE_WITH_APPOINTED="APPOINTED";ra.MODE_CONST="Const";ra.MODE_SYS_VAR="SystemVar";ra.MODE_MACRO_VAR="MacroVar";sa.PropDataTypeUtil=new function(){var P=this;this.getDataTypeDesc=function(J){switch(J){case Sa.DT_STRING:return a.get("text","\u6587\u672c");case Sa.DT_NUMBER:return a.get("number",
"\u6570\u503c");case Sa.DT_INT:return a.get("integer","\u6574\u6570");case Sa.DT_DATE:return a.get("dataTypeDate","\u65e5\u671f");case Sa.DT_DATETIME:return a.get("dateTime","\u65e5\u671f\u65f6\u95f4");case Sa.DT_BOOLEAN:return a.get("bool","\u5e03\u5c14");default:return""}};this.buildDataTypeInConsistentPrompt=function(J,N){var L=a.get("dataTypeNotMatch","\u5b57\u6bb5\u201c#1\u201d\u7684\u6570\u636e\u7c7b\u578b\u4e3a#2\uff0c\u4e0e\u5b57\u6bb5\u201c#3\u201d\u7684#4\u6570\u636e\u7c7b\u578b\u4e0d\u4e00\u81f4");
L=L.replace("#1",J.getAlias());L=L.replace("#2",P.getDataTypeDesc(J.getOutputDataType()));L=L.replace("#3",N.getAlias);return L=L.replace("#4",P.getDataTypeDesc(N.getOutputDataType()))}};sa.FilterCheckHelper=new function(){this.checkFilterProperty=function(J,N){if(!N)return J=a.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5"),new ra.FiltersCheckingResult(-1,J);for(var L,ba=0;ba<J.length;ba++){var z=J[ba];if(!z.isEmpty()&&!z.isRoleFilter()){a:{L=ba;for(var G=N,B=z.getProperty(),U=0;U<G.length;U++)if(B&&
G[U].getFullName()==B.getFullName()){L=null;break a}G=a.get("lackField","\u7b2c#1\u884c\u5b57\u6bb5\u4e0d\u5b58\u5728\u3002");G=G.replace("#1",L+1);L=new ra.FiltersCheckingResult(L,G)}L||(L=ba,(G=P(z))?(B=a.get("incompleteFilter","\u7b2c#1\u884c\u4e0d\u5b8c\u6574\uff0c"),B=B.replace("#1",L+1),L=new ra.FiltersCheckingResult(L,B+G)):L=null);if(!L)a:{L=z;z=ba;if(L.getCompareOp()==ra.COMPARE_VARIABLE&&L.isSystemVariant()){L=L.getValue();G=!1;for(B=0;B<nb.SUPPORTED_VAR_TYPE.length;B++)if(nb.SUPPORTED_VAR_TYPE[B].getTypeID()==
L){G=!0;break}if(!G){L=a.get("invalidSystemVarType","\u7b2c#1\u884c\u65e0\u6548\u7684\u7cfb\u7edf\u53d8\u91cf\u3002");L=L.replace("#1",z+1);L=new ra.FiltersCheckingResult(z,L);break a}}L=null}if(L)break}}return L};this.checkFilterLogical=function(J){var N=0,L=-1,ba,z=0;for(ba=0;ba<J.length;ba++)J[ba].isEmpty()||(z=ba);ba=z;for(z=0;z<J.length;z++){var G=J[z];if(!G.isEmpty()&&!G.isRoleFilter()){N+=G.getLeftBracketCount();N-=G.getRightBracketCount();0>L&&0!=N&&(L=z);if(0>N)return J=a.get("bracketMismatch",
"\u5de6\u53f3\u62ec\u53f7\u4e0d\u5339\u914d\u3002"),new ra.FiltersCheckingResult(L,J);if(z!=ba&&!G.getLogicOp())return J=a.get("lackLogicalSymbol","\u7b2c#1\u884c\u7f3a\u5c11\u903b\u8f91\u7b26"),J=J.replace("#1",z+1),new ra.FiltersCheckingResult(z,J)}}return 0<N?(J=a.get("bracketMismatch","\u5de6\u53f3\u62ec\u53f7\u4e0d\u5339\u914d\u3002"),new ra.FiltersCheckingResult(L,J)):null};var P=function(J){var N=J.getCompareOp(),L=J.getProperty(),ba=J.getValue(),z=L?L.getOutputDataType():"";L=L?L.isEnum():
!1;L=ra.getSelectableCompares(z,L);if(!ra.isCompareOpWithoutValue(N)){if(!ba)return a.get("lackValue","\u7f3a\u5c11\u503c\u3002");if(z==Sa.DT_NUMBER||z==Sa.DT_INT){if(!ra.REG_NUMBER.test(ba)&&!J.isSystemVariant()&&N!=ra.COMPARE_IN&&N!=ra.COMPARE_NOT_IN)return a.get("valueMustBeNum","\u503c\u5fc5\u987b\u4e3a\u6570\u5b57\u3002")}else if(z==Sa.DT_DATE||z==Sa.DT_DATETIME)ra.REG_DATETIME.test(ba)||ra.isCompareOpWithinOrNotWithinValue(N)||J.setValue((new Date).getTime());else if(z==Sa.DT_BOOLEAN&&ba!=Sa.BOOLEAN_TRUE&&
ba!=Sa.BOOLEAN_FALSE)return a.get("wrongBoolean","\u9519\u8bef\u7684\u5e03\u5c14\u503c\u3002")}if(!N)return a.get("lackComparisonOperator","\u7f3a\u5c11\u6bd4\u8f83\u7b26\u3002");J=!1;for(ba=0;ba<L.length;ba++)if(N==L[ba]){J=!0;break}return J?null:a.get("comparisonMismatch","\u6bd4\u8f83\u7b26\u4e0d\u5339\u914d\u3002")}}})();
//qingVersionTag: 20250415