var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(x,F,P){x instanceof String&&(x=String(x));for(var T=x.length,f=0;f<T;f++){var ja=x[f];if(F.call(P,ja,f,x))return{i:f,v:ja}}return{i:-1,v:void 0}};$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,F,P){if(x==Array.prototype||x==Object.prototype)return x;x[F]=P.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 F=0;F<x.length;++F){var P=x[F];if(P&&P.Math==Math)return P}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,F){var P=$jscomp.propertyToPolyfillSymbol[F];if(null==P)return x[F];P=x[P];return void 0!==P?P:x[F]};
$jscomp.polyfill=function(x,F,P,T){F&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(x,F,P,T):$jscomp.polyfillUnisolated(x,F,P,T))};$jscomp.polyfillUnisolated=function(x,F,P,T){P=$jscomp.global;x=x.split(".");for(T=0;T<x.length-1;T++){var f=x[T];if(!(f in P))return;P=P[f]}x=x[x.length-1];T=P[x];F=F(T);F!=T&&null!=F&&$jscomp.defineProperty(P,x,{configurable:!0,writable:!0,value:F})};
$jscomp.polyfillIsolated=function(x,F,P,T){var f=x.split(".");x=1===f.length;T=f[0];T=!x&&T in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var ja=0;ja<f.length-1;ja++){var G=f[ja];if(!(G in T))return;T=T[G]}f=f[f.length-1];P=$jscomp.IS_SYMBOL_NATIVE&&"es6"===P?T[f]:null;F=F(P);null!=F&&(x?$jscomp.defineProperty($jscomp.polyfills,f,{configurable:!0,writable:!0,value:F}):F!==P&&(void 0===$jscomp.propertyToPolyfillSymbol[f]&&(P=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[f]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(f):$jscomp.POLYFILL_PREFIX+P+"$"+f),$jscomp.defineProperty(T,$jscomp.propertyToPolyfillSymbol[f],{configurable:!0,writable:!0,value:F})))};$jscomp.polyfill("Array.prototype.find",function(x){return x?x:function(F,P){return $jscomp.findInternal(this,F,P).v}},"es6","es3");$jscomp.arrayIteratorImpl=function(x){var F=0;return function(){return F<x.length?{done:!1,value:x[F++]}:{done:!0}}};$jscomp.arrayIterator=function(x){return{next:$jscomp.arrayIteratorImpl(x)}};
$jscomp.initSymbol=function(){};$jscomp.polyfill("Symbol",function(x){if(x)return x;var F=function(ja,G){this.$jscomp$symbol$id_=ja;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:G})};F.prototype.toString=function(){return this.$jscomp$symbol$id_};var P="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",T=0,f=function(ja){if(this instanceof f)throw new TypeError("Symbol is not a constructor");return new F(P+(ja||"")+"_"+T++,ja)};return f},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(x){if(x)return x;x=Symbol("Symbol.iterator");for(var F="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),P=0;P<F.length;P++){var T=$jscomp.global[F[P]];"function"===typeof T&&"function"!=typeof T.prototype[x]&&$jscomp.defineProperty(T.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,F){x instanceof String&&(x+="");var P=0,T=!1,f={next:function(){if(!T&&P<x.length){var ja=P++;return{value:F(ja,x[ja]),done:!1}}T=!0;return{done:!0,value:void 0}}};f[Symbol.iterator]=function(){return f};return f};
$jscomp.polyfill("Array.prototype.keys",function(x){return x?x:function(){return $jscomp.iteratorFromArray(this,function(F){return F})}},"es6","es3");
(function(){"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.macro&&(com.kingdee.bos.qing.macro={});"undefined"==typeof com.kingdee.bos.qing.macro.model&&(com.kingdee.bos.qing.macro.model={});var x=com.kingdee.bos.qing.macro.model;x.ImportResult=function(){var F=!1,P=[],T=[];this.getSuccessUids=function(){return P};
this.getSuccessCount=function(){return P.length};this.getConflictUids=function(){return T};this.isAllSuccess=function(){return F};this.fromJsonObject=function(f){P=f.successUids;T=f.conflictUids;F=f.allSuccess?!0:!1}};x.AbstractMacroTypeItem=function(F,P){this.getTypeName=function(){return P};this.getMacroType=function(){return F};this.showCreateDialog=function(T){throw Error("override me");};this.showEditDialog=function(T){throw Error("override me");}}})();(function(){function x(){F.Macro.call(this,ja);var G=this,xa,Y,ha,w,C,U,z=!0,B=!0;this.isAuthorizedDBCenter=function(){return z};this.setDbCenterAuthorized=function(g){z=g};this.isAuthorizedSchema=function(){return U};this.setSchemaAuthorized=function(g){U=g};this.isConnAuthorized=function(){return C};this.setConnAuthorized=function(g){C=g};this.getSQLType=function(){return xa};this.setSQLType=function(g){xa=g};this.getDBInfo=function(){return Y};this.setDBInfo=function(g){Y=g};this.getContent=function(){return ha};
this.setContent=function(g){ha=g};this.getRefDBHashCode=function(){return w};this.setRefDBHashCode=function(g){w=g};this.getUiDisplay=function(){return B};this.setUiDisplay=function(g){B=g};this.getTypeText=function(){return f.get("sqlMacro","SQL\u5b8f")};this.getContentText=function(){var g=J(!1)+"; SQL: ";ha&&T.getImpl(T.SYS_VAR_HELPER).switchSQLToDisplayMode(ha,function(Z){g+=Z});return g};this.getTipsText=function(){var g=J(!0)+"\r\nSQL:\r\n    ";ha&&T.getImpl(T.SYS_VAR_HELPER).switchSQLToDisplayMode(ha,
function(Z){var la=g;var u="";Z=Z?Z.trim():"";if(0!=Z.length){for(var ia=0,d=0,oa="";d<Z.length&&ia<F.SQLMacroConstant.SQL_LINE_MAX_NUM;){var na=Z[d];if("\r\n"==na||"\r"==na||"\n"==na)0<oa.length&&(u+=oa+"\r\n    ",ia++,oa="");else{na=na.trim();for(var H="";0!=na.length;){H+=na;if(++d>=Z.length)break;na=Z[d].trim()}0<H.length&&(oa+=H+" ");oa.length-1>=F.SQLMacroConstant.LINE_SQL_CHAR_MAX_NUM&&(u+=oa+"\r\n    ",ia++,oa="")}d++}oa=oa.trim();d<Z.length?u=u.trim()+" ...":0<oa.length&&(u+=oa)}g=la+u});
return g};this.validateModelForType=function(){if(!Y)return f.get("noDBConnection","\u8bf7\u9009\u62e9\u6570\u636e\u5e93\u8fde\u63a5\u3002");if(ha&&""!=$.trim(ha)){if(0!=ha.trim().toLowerCase().indexOf("select"))return f.get("onlyAllowSelection","\u53ea\u5141\u8bb8\u67e5\u8be2\u64cd\u4f5c\u3002");if(-1==ha.indexOf("from")&&-1==ha.indexOf("FROM"))return f.get("sqlError","sql\u6267\u884c\u51fa\u9519\uff0c\u8bf7\u68c0\u67e5sql\u8bed\u53e5\u3002")}else return f.get("noQuery","\u8bf7\u8f93\u5165\u67e5\u8be2\u8bed\u53e5\u3002")};
this.getStatusWarning=function(){switch(G.getMacroStatus()){case F.MacroStatusEnum.DB_NOT_EXIST:var g=f.get("macroDeletedTips","\u516c\u5171\u6570\u636e\u6e90\u4e2d\u7684\u6570\u636e\u5e93\u8fde\u63a5\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");break;case F.MacroStatusEnum.WITHOUT_DB_PERMISSION:g=f.get("macroNoPermissionTips",'\u516c\u5171\u6570\u636e\u6e90\u4e2d\u7684\u6570\u636e\u5e93\u8fde\u63a5\u5df2\u53d6\u6d88\u6388\u6743\u7ed9\u5b8f\u53d8\u91cf\u7684\u6700\u540e\u4fee\u6539\u4eba"#1"\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002').replace("#1",
G.getModifierName());break;case F.MacroStatusEnum.WITHOUT_DB_CENTER_PERMISSION:g=f.get("macroNoDBCenterPermissionTips",'\u5b8f\u53d8\u91cf\u7684\u6700\u540e\u4fee\u6539\u4eba"#1"\u6ca1\u6709\u6570\u636e\u4e2d\u5fc3\u6743\u9650\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002').replace("#1",G.getModifierName());break;case F.MacroStatusEnum.WITHOUT_SCHEMA_PERMISSION:g=f.get("macroNoSchemaTips",'\u8be5\u53d8\u91cf\u4f7f\u7528\u7684\u8d85\u7ea7\u67e5\u8be2\u6a21\u5f0f\u5df2\u88ab\u5220\u9664\u6216\u53d6\u6d88\u6388\u6743\u7ed9\u6700\u540e\u4fee\u6539\u4eba"#1"\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002').replace("#1",
G.getModifierName());break;case F.MacroStatusEnum.DB_CENTER_NO_APP_METADATA:g=f.get("macroNoAppMetadataTips",'\u8be5\u53d8\u91cf\u4f7f\u7528\u7684\u5e94\u7528"#1"\u5143\u6570\u636e\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002').replace("#1",D);break;case F.MacroStatusEnum.DB_CENTER_APP_CLOUD_DISABLED:g=f.get("macroCloudDisabledTips",'\u8be5\u53d8\u91cf\u4f7f\u7528\u7684\u5e94\u7528"#1"\u6240\u5728\u4e91\u88ab\u7981\u7528\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002').replace("#1",
D);break;case F.MacroStatusEnum.DB_CENTER_APP_DISABLED:g=f.get("macroAppDisabledTips",'\u8be5\u53d8\u91cf\u4f7f\u7528\u7684\u5e94\u7528"#1"\u88ab\u7981\u7528\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002').replace("#1",D);break;case F.MacroStatusEnum.DB_CENTER_NO_APP:g=f.get("macroNoAppTips",'\u8be5\u53d8\u91cf\u4f7f\u7528\u7684\u5e94\u7528"#1"\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002').replace("#1",D);break;case F.MacroStatusEnum.MACRO_REJECT:g=
f.get("macroReject","\u8be5\u5b8f\u53d8\u91cf\u56e0\u5b58\u5728\u6162\u67e5\u8be2\uff0c\u5df2\u88ab\u4e34\u65f6\u7981\u7528\u3002\u8bf7\u4f18\u5316\u67e5\u8be2\u8bed\u53e5\u540e\uff0c\u63d0\u4ea4\u5de5\u5355\u8054\u7cfb\u8fd0\u7ef4\u56e2\u961f\u5904\u7406\u3002")}return g};var D=function(){var g="",Z=Y?Y.getDBSource():null;Z&&Z.getAppNumber&&(g=Z.getAppNumber());return g},E=G.toJsonObject;this.toJsonObject=function(){var g=E();g.sqlType=xa;Y&&(g.dbInfo=Y.toJsonObject());g.content=ha;g.refDBHashCode=
w;g.bConnAuthorized=C;g.schemaAuthorized=U;g.dbCenterAuthorized=z;return g};var aa=G.fromJsonObject;this.fromJsonObject=function(g){aa(g);xa=g.sqlType;if(g.dbInfo){Y=new P;Y.fromJsonObject(g.dbInfo);var Z=G.getMacroStatus();Y.setAuthError(Z==F.MacroStatusEnum.WITHOUT_DB_PERMISSION||Z==F.MacroStatusEnum.WITHOUT_DB_CENTER_PERMISSION||Z==F.MacroStatusEnum.WITHOUT_SCHEMA_PERMISSION)}U=g.schemaAuthorized;C=g.bConnAuthorized;ha=g.content;w=g.refDBHashCode;z=g.dbCenterAuthorized};this.copy=function(){var g=
new x;g.setUid(G.getUid());g.setFid(G.getFid());g.setName(G.getName());g.setDesc(G.getDesc());g.setMultiValued(G.isMultiValued());g.setType(G.getType());g.setMacroStatus(G.getMacroStatus());g.setCreatorId(G.getCreatorId());g.setCreatorName(G.getCreatorName());g.setCreateTime(G.getCreateTime());g.setModifierId(G.getModifierId());g.setModifyTime(G.getModifyTime());g.setModifierName(G.getModifierName());g.setSQLType(xa);g.setDBInfo(Y);g.setContent(ha);g.setRefDBHashCode(w);g.setConnAuthorized(G.isConnAuthorized());
g.setSchemaAuthorized(G.isAuthorizedSchema());g.setDbCenterAuthorized(G.isAuthorizedDBCenter());g.setUiDisplay(B);var Z=G.getReference();Z&&g.setReference(Z.copy());return g};var J=function(g){var Z=f.get("dataBase","\u6570\u636e\u5e93")+": ";g&&(Z+="\r\n    ");return Z=G.getMacroStatus()!=F.MacroStatusEnum.AVAILABLE?Z+f.get("dbConnectionUnset","\u672a\u8bbe\u7f6e\u6570\u636e\u5e93\u8fde\u63a5"):Z+Y.getName()}}"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.macro&&(com.kingdee.bos.qing.macro={});"undefined"==typeof com.kingdee.bos.qing.macro.model&&(com.kingdee.bos.qing.macro.model={});var F=com.kingdee.bos.qing.macro.model;F.SQLMacro=x;var P,T,f;(function(){var G=com.kingdee.bos.qing.data;T=G.VariateHelperFactory;G=com.kingdee.bos.qing.dbmanage;P=G.DBConnection;G=com.kingdee.bos.qing.framework.common;
f=G.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.macro)})();var ja="SQL";F.DataCenterAuthChecker=new function(){var G=!1;this.setAuthority=function(xa){G=xa};this.hasAuthority=function(){return G}};F.SQLMacroConstant={LINE_SQL_CHAR_MAX_NUM:100,SQL_LINE_MAX_NUM:7};F.SqlTypeEnum={SQL_TYPE_KSQL:"KSQL",SQL_TYPE_SQL:"SQL"}})();(function(){function x(){ha.call(this);var C=this,U,z,B,D,E,aa,J,g,Z=!0;this.setType(xa);this.setEntityNumber=function(d){g=d};this.getEntityNumber=function(){return g};this.setMasterAppId=function(d){J=d};this.getMasterAppId=function(){return J};this.getNoPermPropertyNames=function(){return aa};this.setNoPermPropertyNames=function(d){aa=d};this.getNotExistPropertyNames=function(){return E};this.setNotExistPropertyNames=function(d){E=d};this.setSelectedProperties=function(d){B=d};this.getSelectedProperties=
function(){return B};this.getSelectedPropertyNames=function(){return D};this.setSelectedPropertyNames=function(d){D=d};this.getEntityFullName=function(){return z};this.setEntityFullName=function(d){z=d};this.getEntityPath=function(){return U};this.setEntityPath=function(d){U=d};this.getUiDisplay=function(){return Z};this.setUiDisplay=function(d){Z=d};this.getTypeText=function(){return w.get("entityMacro","\u57fa\u7840\u6570\u636e\u5b8f")};this.getContentText=function(){var d=w.get("entity","\u57fa\u7840\u8d44\u6599")+
": ";d+=(z?z:w.get("entityNotSet","\u672a\u8bbe\u7f6e\u57fa\u7840\u8d44\u6599"))+"; ";d+=w.get("returnProperty","\u8fd4\u56de\u5b57\u6bb5")+": ";return d=D&&0<D.length?d+ia(D,B,3,!1):d+w.get("propertyNotSet","\u672a\u9009\u62e9\u5b57\u6bb5")};this.getTipsText=function(){var d=w.get("entity","\u57fa\u7840\u8d44\u6599")+":\r\n    ";d=z?d+(z+"("+g+")"):d+w.get("entityNotSet","\u672a\u8bbe\u7f6e\u57fa\u7840\u8d44\u6599");d+="\r\n"+w.get("returnProperty","\u8fd4\u56de\u5b57\u6bb5")+":\r\n    ";return d=
D&&0<D.length?3<D.length?d+ia(D,B,-1,!0):d+ia(D,B,3,!1):d+w.get("propertyNotSet","\u672a\u9009\u62e9\u5b57\u6bb5")};this.validateModelForType=function(){if(!U)return w.get("noEntity","\u8bf7\u9009\u62e9\u57fa\u7840\u8d44\u6599\u3002");if(!D||0==D.length)return w.get("noReturnProperty","\u8bf7\u9009\u62e9\u8fd4\u56de\u5b57\u6bb5\u3002")};this.getStatusWarning=function(){switch(this.getMacroStatus()){case Y.ENTITY_NOT_EXIST:var d=w.get("macroEntityNotExist",'\u57fa\u7840\u8d44\u6599"#1"\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002').replace("#1",
z);break;case Y.PROPERTY_ABNORMAL:d=E;var oa=d?d.length:0;if(0<oa&&3>=oa)var na=w.get("macroFieldDeleteTips",'\u5b8f\u53d8\u91cf\u4f7f\u7528\u7684"#1" \u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002').replace("#1",d.join("\u3001"));else if(3<oa){na=w.get("manyMacroFieldDeleteTips","\u4ee5\u4e0b\u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");for(var H=0;H<oa;H++)0==H%3&&(na+="\n"),na+=d[H]+
"\u3001";na=na.substring(0,na.length-1)}d=na}return d};this.copy=function(){var d=new x;d.setUid(C.getUid());d.setFid(C.getFid());d.setName(C.getName());d.setDesc(C.getDesc());d.setMultiValued(C.isMultiValued());d.setType(C.getType());d.setMacroStatus(C.getMacroStatus());d.setCreatorId(C.getCreatorId());d.setCreatorName(C.getCreatorName());d.setCreateTime(C.getCreateTime());d.setModifierId(C.getModifierId());d.setModifyTime(C.getModifyTime());d.setModifierName(C.getModifierName());d.setMasterAppId(C.getMasterAppId());
d.setSelectedProperties(C.getSelectedProperties());d.setSelectedPropertyNames(C.getSelectedPropertyNames());d.setEntityPath(C.getEntityPath());d.setEntityFullName(C.getEntityFullName());d.setNotExistPropertyNames(C.getNotExistPropertyNames());d.setNoPermPropertyNames(C.getNoPermPropertyNames());d.setEntityNumber(C.getEntityNumber());d.setUiDisplay(Z);var oa=C.getReference();oa&&d.setReference(oa.copy());return d};var la=C.toJsonObject;this.toJsonObject=function(){var d=la();d.masterAppId=J;d.entityPath=
U;d.entityFullName=z;d.notExistPropertyNames=E;d.selectedProperties=B;d.selectedPropertyNames=D;d.noPermPropertyNames=aa;d.entityNumber=g;return d};var u=C.fromJsonObject;this.fromJsonObject=function(d){u(d);J=d.masterAppId;U=d.entityPath;z=d.entityFullName;E=d.notExistPropertyNames;D=d.selectedPropertyNames;aa=d.noPermPropertyNames;g=d.entityNumber;d=d.selectedProperties;B=[];if(d)for(var oa in d){var na=new F;na.fromJsonObject(d[oa]);B.push(na)}};var ia=function(d,oa,na,H){if(!d||0==d.length)return"";
for(var Na={},R=0;R<oa.length;R++)Na[oa[R].getName()]=oa[R];var fa=0<na?Math.min(na,d.length):d.length,ba="";for(R=0;R<fa;R++){H&&5<=R&&0==R%5&&(ba+="\r\n    ");var q=Na[d[R]];q=q?q.getAlias():d[R];ba+=q+w.get("commaChar","\u3001")}ba=ba.substring(0,ba.length-1);0<na&&oa.length>na&&(ba+=w.get("moreReturnProperty","\u7b49#1\u4e2a\u5b57\u6bb5").replace("#1",d.length));return ba}}function F(){var C,U;this.getName=function(){return C};this.setName=function(z){C=z};this.getAlias=function(){return U};this.setAlias=
function(z){U=z};this.copy=function(){var z=new F;z.setName(_this.getName());z.setAlias(_this.getAlias());return z};this.toJsonObject=function(){var z={};z.name=C;z.alias=U;return z};this.fromJsonObject=function(z){C=z.name;U=z.alias}}function P(){var C,U,z,B,D;this.setName=function(E){C=E};this.getName=function(){return C};this.setDisplayName=function(E){U=E};this.getDisplayName=function(){return U};this.setCommentInfo=function(E){z=E};this.getCommentInfo=function(){return z};this.setModelId=function(E){B=
E};this.getModelId=function(){return B};this.setParentNode=function(E){D=E};this.getParentNode=function(){return D};this.getSubNodeLevel=function(){for(var E=-1,aa=D;aa;)E++,aa=aa.getParentNode();return E}}function T(){P.call(this);var C=this,U=[];this.setChildren=function(z){U=z};this.getChildren=function(){return U};this.fromJsonObject=function(z){C.setName(z.name);C.setDisplayName(z.displayName);C.setCommentInfo(z.commentInfo);if(z=z.children)for(var B=0;B<z.length;B++){var D=z[B];if("app"===D.type){var E=
new f;E.fromJsonObject(D);E.setParentNode(C);U.push(E)}else E=new T,E.fromJsonObject(D),E.setParentNode(C),U.push(E)}}}function f(){P.call(this);var C=this,U,z=[];this.setType=function(B){U=B};this.getType=function(){return U};this.getEntities=function(){return z};this.setEntities=function(B){z=B};this.fromJsonObject=function(B){C.setType(B.type);C.setName(B.name);C.setDisplayName(B.displayName);C.setCommentInfo(B.commentInfo);C.setModelId(B.id);var D=[];B=B.entities;if(D)for(var E=0;E<B.length;E++){var aa=
B[E],J=new ja;J.fromJsonObject(aa);D.push(J)}C.setEntities(D)}}function ja(){var C=this,U,z,B,D;this.getName=function(){return U};this.setName=function(E){U=E};this.getNumber=function(){return z};this.setNumber=function(E){z=E};this.getAppId=function(){return B};this.setAppId=function(E){B=E};this.getCloudId=function(){return D};this.setCloudId=function(E){D=E};this.fromJsonObject=function(E){C.setName(E.name);C.setNumber(E.number);C.setCloudId(E.cloudId);C.setAppId(E.appId)}}"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.macro&&(com.kingdee.bos.qing.macro={});"undefined"==typeof com.kingdee.bos.qing.macro.model&&(com.kingdee.bos.qing.macro.model={});var G=com.kingdee.bos.qing.macro.model;G.EntityMacro=x;G.EntityAssociate=function(){var C,U,z,B,D,E;this.getEntityPath=function(){return C};this.setEntityPath=
function(aa){C=aa};this.setCloudId=function(aa){U=aa};this.getCloudId=function(){return U};this.setAppId=function(aa){z=aa};this.getAppId=function(){return z};this.setEntityNumber=function(aa){B=aa};this.getEntityNumber=function(){return B};this.setEntityFullName=function(aa){D=aa};this.getEntityFullName=function(){return D};this.setMasterAppId=function(aa){E=aa};this.getMasterAppId=function(){return E}};G.DesignTimeEntity=function(){var C,U;this.setProperties=function(z){C=z};this.getProperties=
function(){return C};this.setPkName=function(z){U=z};this.getPkName=function(){return U};this.fromJsonObject=function(z){U=z.pkName;z=z.properties;C=[];if(z)for(var B in z){var D=new F;D.fromJsonObject(z[B]);C.push(D)}}};G.AbstractNode=P;G.FolderNode=T;G.AppLeafNode=f;var xa="ENTITY",Y=G.MacroStatusEnum,ha=G.Macro;var w=com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.macro)})();(function(){"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.macro&&(com.kingdee.bos.qing.macro={});var x=com.kingdee.bos.qing.macro;x.Toolbar=function(){var ja,G=$("<div>"),xa=$("<div>"),Y=$("<div>");this.getJqUi=function(){ja||(ja=$("<div>"),ja.addClass("macro-toolbar"),G.addClass("macro-toolbar-sub"),
G.appendTo(ja),xa.addClass("macro-toolbar-sub"),xa.appendTo(ja),Y.addClass("macro-toolbar-sub"),Y.appendTo(ja));return ja};this.addSeperator=function(){ha(xa)};this.addSeperatorForHeadCustom=function(){ha(G)};this.addButton=function(U,z,B,D){return w(xa,!1,U,z,B,D)};this.addButtonForHeadCustom=function(U,z,B,D){return w(G,!1,U,z,B,D)};this.addButtonForTailCustom=function(U,z,B,D){return w(Y,!1,U,z,B,D)};this.addMenuButton=function(U,z,B,D){return w(xa,!0,U,z,B,D)};this.addMenuButtonForHeadCustom=
function(U,z,B,D){return w(G,!0,U,z,B,D)};this.addMenuButtonForTailCustom=function(U,z,B,D){return w(Y,!0,U,z,B,D)};var ha=function(U){var z=$("<div>");z.addClass("macro-toolbar-seperator");z.appendTo(U)},w=function(U,z,B,D,E,aa){var J=new P;J.setIconSetter(function(g,Z){x.Icons.background(g,Z)});J.setIconName(D);J.setText(E);J.setTooltips(aa);z&&J.setShowDropdownArrow(!0);J.addActionListener(function(g,Z){z?C(g.getJqUi(),Z,B,U):B(g)});J.getJqUi().appendTo(U);return J},C=function(U,z,B,D){var E=U.data("menu");
if(E&&E.isShowing())U.data("menu",null),E.hide();else{E=new F;E.setModel(B());E.setHideListener(function(){U.data("menu",null)});U.data("menu",E);B=null==D?xa:D;D=U.prop("offsetLeft");var aa=U.prop("offsetHeight")+U.prop("offsetTop");E.show(B,D,aa,z,!0)}}};x.MacroFacade=function(ja,G,xa,Y){T.call(this,ja,G,xa,Y);var ha=this.protectedMethod;this.checkMacroPermission=function(){var w={};f(w);ha.remote("checkMacroPermission",w)};this.getDesignTimeEntity=function(w){w={entityPath:w};f(w);ha.remote("getDesignTimeEntity",
w)};this.saveMacro=function(w,C){w={model:JSON.stringify(w.toJsonObject()),macroType:C};f(w);ha.remote("saveMacro",w)};this.checkPermissionBeforeEdit=function(w,C){w={model:JSON.stringify(w.toJsonObject()),macroType:C};f(w);ha.remote("checkPermissionBeforeEdit",w)};this.updateMacro=function(w,C){w={model:JSON.stringify(w.toJsonObject()),macroType:C};f(w);ha.remote("updateMacro",w)};this.loadMacros=function(w,C,U){ha.remote("loadMacros",{targetPage:w,pageSize:C,searchText:U})};this.checkMacroPermissionBeforePreview=
function(w,C){ha.remote("checkMacroPermissionBeforePreview",{macroType:w,macroUid:C})};this.loadAllMacroIds=function(w){ha.remote("loadAllMacroIds",{searchText:w})};this.loadMacrosRefTimeByFIds=function(w){w={macroIds:JSON.stringify(w)};ha.remote("loadMacrosRefTimeByFIds",w)};this.checkDataCenterPermission=function(w){ha.remote("checkDataCenterPermission",{macroType:w})};this.loadMacro=function(w,C){ha.remote("loadMacro",{macroId:w,macroType:C})};this.loadSharedMacros=function(w){ha.remote("loadSharedMacros",
{macroType:w})};this.deleteMacros=function(w){w={macroIds:JSON.stringify(w)};f(w);ha.remote("deleteMacros",w)};this.exportMacros=function(w){w={macroIds:JSON.stringify(w)};f(w);ha.remote("exportMacros",w)};this.loadDBConnections=function(){ha.remote("loadDBConnections",{})};this.getSupportedSystemVarType=function(){ha.remote("getSupportedSystemVarType",{})};this.getOptionalImportMacro=function(w){w={filePath:w};f(w);ha.remote("getOptionalImportMacro",w)};this.importMacros=function(w,C){for(var U=
[],z=0,B=w.length;z<B;z++)U.push(JSON.stringify(w[z].toJsonObject()));w={models:JSON.stringify(U),strategy:C};f(w);ha.remote("importMacros",w)}};var F,P,T=x.MacroRuntimeFacade;(function(){var ja=com.kingdee.bos.qing.ui.component;P=ja.ToolbarButton;F=ja.Menu})();var f=function(ja){var G=x.MacroAppendSceneParams.getFunAppendMoreParams();G&&G(ja)};x.DataCenterInfoHelper=new function(){var ja;this.registerInfoGetter=function(G){ja=G};this.loadDataCenterDBType=function(G,xa,Y){ja.loadDataCenterDBType(G,
xa,Y)}};x.MacroAppendSceneParams=new function(){var ja;this.addFunAppendMoreParams=function(G){ja=G};this.getFunAppendMoreParams=function(){return ja}};x.MacroFactory=new function(){var ja={};this.registerConstructor=function(G,xa){ja[G]=xa};this.getMacroInstance=function(G){return new ja[G]}};x.DraggableAdjustingCustomExpandor=function(){KTableUIDraggableAdjustingHandler.CustomExpendor.call(this);this.getTailBlankForDragging=function(){return 0}}})();(function(){"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.macro&&(com.kingdee.bos.qing.macro={});var x=com.kingdee.bos.qing.macro;x.MacroEntityFacade=function(f,ja,G,xa){F.call(this,f,ja,G,xa);var Y=this.protectedMethod;this.getUsableEntities=function(ha,w){ha={cloudOrAppSearchText:ha,entitySearchText:w};
(w=x.MacroAppendSceneParams.getFunAppendMoreParams())&&w(ha);Y.remote("getUsableEntities",ha)};this.getDesignTimeEntity=function(ha){ha={entityPath:ha};var w=x.MacroAppendSceneParams.getFunAppendMoreParams();w&&w(ha);Y.remote("getDesignTimeEntity",ha)}};var F,P=x.RemoteImpl,T;(function(){var f=com.kingdee.bos.qing.framework.common;F=f.AbstractFacade;f=com.kingdee.bos.qing.macro.model;T=f.EntityAssociate})();x.MacroRemoteHelper=new function(){this.getMacroEntityRemote=function(){var f=com.kingdee.bos.qing.common.Util.decodeParamFromUrl(window.location.search,
"path");f=(f?f:"/ierp")+"/qing/macroEntity.do";var ja=new P;ja.setRemoteUrl(f);return ja}};x.EntityHelper=new function(){this.getEntityNumber=function(f){if(f&&(f=f.split("\u0001"),3<=f.length))return f[2]};this.appendEntityPath=function(f,ja){return f?ja?f+"\u0001"+ja:f:ja};this.buildEntityAssociate=function(f,ja,G){if(f){var xa=f.split("\u0001");if(3<=xa.length){var Y=new T;Y.setEntityPath(f);Y.setCloudId(xa[0]);Y.setAppId(xa[1]);Y.setEntityNumber(xa[2]);Y.setEntityFullName(ja);Y.setMasterAppId(G);
return Y}}}}})();(function(){function x(v){xa.call(this);var m=this,I=this.protectedMethod,K,L,A,c;(function(){I.setTitle(H.get("createSQLMacro","\u65b0\u5efaSQL\u5b8f"));m.setSize(450,590);I.setSelectable(!0);I.setContentPaneCreator(function(){K||(K=new P(v),K.setOuterMessageCurtain(I.getMessageCurtain()),K.registerDataCenterSelectorConstructor(A),K.registerSuperQuerySelectorConstructor(c));return K.createJqUi()});I.setClosingChecker2(function(n){var l=K.getModel();if(n=l.validateModel())return I.getMessageCurtain().showPrompt(n),
!1;(new J(v,function(k){l.fromJsonObject(k);l.setConnAuthorized(!0);L&&L(l);I.destroy();return!0},function(k,a){return"1200001"==k?(I.getMessageCurtain().showPrompt(H.get("duplicateName","\u540d\u79f0\u91cd\u590d\u3002")),!0):"1200002"==k?(k=new Y,k.setDetail(a),k.setOptionType(Y.OPTION_OK),k.setTitle(H.get("macroCreateFailed","\u65b0\u5efa\u5931\u8d25")),k.setMessage(H.get("macroCannotExe","\u8be5\u5b8f\u65e0\u6cd5\u6b63\u5e38\u6267\u884c\uff0c\u8bf7\u68c0\u67e5SQL\u8bed\u53e5\u662f\u5426\u6b63\u786e\u3001\u6570\u636e\u5e93\u8fde\u63a5\u662f\u5426\u6b63\u5e38\u3002")),
k.showDialog(),!0):"1200005"==k?(I.getMessageCurtain().showPrompt(H.get("duplicateUid","\u7f16\u7801\u91cd\u590d\u3002")),!0):"1200009"==k?(I.getMessageCurtain().showPrompt(H.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):"1200004"==k?(I.getMessageCurtain().showPrompt(H.get("macroNoDbConnPermission","\u60a8\u6ca1\u6709\u9009\u62e9\u7684\u6570\u636e\u5e93\u8fde\u63a5\u7684\u6743\u9650\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002")),!0):"1200010"==k?(I.getMessageCurtain().showPrompt(H.get("macroDbConnDeleted",
"\u9009\u62e9\u7684\u6570\u636e\u5e93\u8fde\u63a5\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002")),!0):!1})).saveMacro(l,G)},function(n){I.destroy();return!0});I.setClosingAction(function(n){})})();this.setCreateSuccessCallback=function(n){L=n};this.registerDataCenterSelectorConstructor=function(n){A=n;K&&K.registerDataCenterSelectorConstructor(A)};this.registerSuperQuerySelectorConstructor=function(n){c=n;K&&K.registerSuperQuerySelectorConstructor(c)}}function F(v,m){xa.call(this);
var I=this,K=this.protectedMethod,L,A,c,n;(function(){K.setTitle(H.get("editMacro","\u7f16\u8f91SQL\u5b8f"));I.setSize(450,590);K.setSelectable(!0);K.setContentPaneCreator(function(){L||(L=new P(v),L.setUpdateMode(!0),L.setModel(m),L.setOuterMessageCurtain(K.getMessageCurtain()),L.registerDataCenterSelectorConstructor(c),L.registerSuperQuerySelectorConstructor(n));return L.createJqUi()});K.setClosingChecker2(function(k){k=L.getModel();var a=k.validateModel();if(a)return K.getMessageCurtain().showPrompt(a),
!1;l(k)},function(k){K.destroy();return!0});K.setClosingAction(function(k){})})();this.setUpdateSuccessCallback=function(k){A=k};this.registerDataCenterSelectorConstructor=function(k){c=k;L&&L.registerDataCenterSelectorConstructor(c)};this.registerSuperQuerySelectorConstructor=function(k){n=k;L&&L.registerSuperQuerySelectorConstructor(n)};var l=function(k){(new J(v,function(a){A&&A();K.destroy()},function(a,b){return"1200001"==a?(K.getMessageCurtain().showPrompt(H.get("duplicateName","\u540d\u79f0\u91cd\u590d\u3002")),
!0):"1200002"==a?(a=new Y,a.setDetail(b),a.setOptionType(Y.OPTION_OK),a.setTitle(H.get("macroUpdateFailed","\u7f16\u8f91\u5931\u8d25")),a.setMessage(H.get("macroCannotExe","\u8be5\u5b8f\u65e0\u6cd5\u6b63\u5e38\u6267\u884c\uff0c\u8bf7\u68c0\u67e5SQL\u8bed\u53e5\u662f\u5426\u6b63\u786e\u3001\u6570\u636e\u5e93\u8fde\u63a5\u662f\u5426\u6b63\u5e38\u3002")),a.showDialog(),!0):"1200003"==a?(K.getMessageCurtain().showPrompt(H.get("macroNotFound","\u5b8f\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),
!0):"1200009"==a?(K.getMessageCurtain().showPrompt(H.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):"1200004"==a?(K.getMessageCurtain().showPrompt(H.get("macroNoDbConnPermission","\u60a8\u6ca1\u6709\u9009\u62e9\u7684\u6570\u636e\u5e93\u8fde\u63a5\u7684\u6743\u9650\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002")),!0):"1200010"==a?(K.getMessageCurtain().showPrompt(H.get("macroDbConnDeleted","\u9009\u62e9\u7684\u6570\u636e\u5e93\u8fde\u63a5\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002")),
!0):!1})).updateMacro(k,G)}}function P(v){var m,I,K,L,A,c,n,l,k,a,b,t,r,M,X,za,ra=!1,Ca=!0,Aa=!1,Ba=!0;this.setUpdateMode=function(e){ra=e};this.createJqUi=function(){var e=$("<div>");K||Ma();var h=new ha(H.get("code","\u7f16\u7801"));h.setRequired(!0);h=h.getJqUi();var da=I.getJqUi(),N=new ha,S=N.getJqUi();N.setRequired(!0);N.setText(H.get("name","\u540d\u79f0"));N=K.getJqUi();var pa=new ha,va=pa.getJqUi();pa.setText(H.get("desc","\u63cf\u8ff0"));pa=L.getJqUi();var sa=new ha,Ea=sa.getJqUi();sa.setRequired(!0);
sa.setText(H.get("returnValueType","\u8fd4\u56de\u503c"));sa=A.getJqUi();var La=new ha,Ra=La.getJqUi();La.setRequired(!0);La.setText(H.get("DBConnection","\u6570\u636e\u5e93\u8fde\u63a5"));La=c.getJqUi();var Ga=new ha,Qa=Ga.getJqUi();Ga.setRequired(!0);Ga.setText(H.get("content","\u5185\u5bb9"));t=$("<textarea spellcheck='false'>");t.addClass("macro-sql-text-area");Ga=ba.getImpl(ba.SYS_VAR_HELPER);m&&Ga.switchSQLToDisplayMode(m.getContent(),function(Xa){t.text(Xa)});if(Na.isIEBrowser())t.on("beforedeactivate",
function(){r=t[0].selectionStart});b=n.getJqUi();Ga=l.getJqUi();var Da=k.getJqUi(),ya=8,Ha=0;R.layoutCtrl(h,ya,Ha,80,23);R.layoutCtrl(S,ya,Ha+=43,80,23);R.layoutCtrl(va,ya,Ha+=43,80,23);R.layoutCtrl(Ea,ya,Ha+=43,80,23);R.layoutCtrl(Ra,ya,Ha+=43,80,23);R.layoutCtrl(Qa,ya,Ha+=43,80,23);R.layoutCtrl(a,ya,Ha+=224,50,23);a.css("line-height","23px");ya+=90;Ha=0;R.layoutCtrl(da,ya,Ha,300-(ra?0:23),23);R.layoutCtrl(N,ya,Ha+=43,300,23);R.layoutCtrl(pa,ya,Ha+=43,300,23);R.layoutCtrl(sa,ya,Ha+=43,300,23);R.layoutCtrl(La,
ya,Ha+=43,300,23);R.layoutCtrl(Ga,ya,Ha+=43,114,23);R.layoutCtrl(b,ya+114+10,Ha,114,23);R.layoutCtrl(t,ya,Ha+=43,300,138);R.layoutCtrlWithLRTB(Da,null,14,"auto",Ha+=148,null,23);Da.addClass("macro-system-var-selector");h.appendTo(e);S.appendTo(e);va.appendTo(e);Ea.appendTo(e);Ra.appendTo(e);Qa.appendTo(e);da.appendTo(e);N.appendTo(e);pa.appendTo(e);sa.appendTo(e);La.appendTo(e);t.appendTo(e);b.appendTo(e);Ga.appendTo(e);Da.appendTo(e);a.appendTo(e);Ca?b.show():(b.hide(),n.setChecked(!1));ra||(h=new w,
h.setIconType(w.ICON_TYPE_QUESTION),h.setTipsText(H.get("uidTips","\u7f16\u7801\u5fc5\u987b\u7531\u5c0f\u5199\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e14\u521b\u5efa\u540e\u65e0\u6cd5\u66f4\u6539\uff01")),h=h.getJqUi(),R.layoutCtrlWithLRTB(h,null,10,16,2,null,16),h.appendTo(e));return e};this.setOuterMessageCurtain=function(e){M=e};this.setModel=function(e){m=e;Ia()};this.getModel=function(){return Oa()};this.registerDataCenterSelectorConstructor=function(e){X=e};
this.registerSuperQuerySelectorConstructor=function(e){za=e};var Ma=function(){I=new C;ra&&I.setEnabled(!1);K=new C;L=new C;A=new U;A.setItemModels([!0,!1]);A.setSelected(!0);A.setCustomPainter(function(h,da,N){h=N?H.get("multiValued","\u591a\u503c"):H.get("singleValued","\u5355\u503c");da.text(h)});c=new f;c.addActionListener(Ja);c.setCustomPainter(function(h){if(h){var da=$("<div>");da.addClass("sa-ctrl-f7selector-text");da.addClass("macro-db-f7selector-text");da.text(h.getName());if(h.isAuthError()){var N=
h.getAbstractSource();var S=N.getConnectionType();N=S!=V.DBCONNECTION_TYPE_SUPERQUERY||N.getDbAddress()?S==V.DBCONNECTION_TYPE_DBCENTER?H.get("abnormalDbCenterAuth","\u5f53\u524d\u6570\u636e\u4e2d\u5fc3\u6743\u9650\u5f02\u5e38\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u6570\u636e\u5e93\u8fde\u63a5\u3002"):S==V.DBCONNECTION_TYPE_DB||S==V.DBCONNECTION_TYPE_SUPERQUERY&&N.getDbAddress()?H.get("abnormalSource","\u516c\u5171\u6570\u636e\u6e90\u201c#1\u201d\u5f02\u5e38\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u6570\u636e\u5e93\u8fde\u63a5\u3002").replace("#1",
h.getName()):void 0:H.get("abnormalSchema","\u8d85\u7ea7\u67e5\u8be2\u6a21\u5f0f\u5f02\u5e38\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u6570\u636e\u5e93\u8fde\u63a5\u3002")}else{if(h=Ba)h=!1,m&&(h=m.getMacroStatus(),h=h==d.DB_CENTER_NO_APP_METADATA||h==d.DB_CENTER_APP_CLOUD_DISABLED||h==d.DB_CENTER_APP_DISABLED||h==d.DB_CENTER_NO_APP);h&&(N=H.get("abnormalDbCenter","\u5f53\u524d\u6570\u636e\u4e2d\u5fc3\u8fde\u63a5\u5f02\u5e38\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u6570\u636e\u5e93\u8fde\u63a5\u3002"))}Ba=
!1;return N?(da.css({color:"red"}),h=z.createWarning(),h.attr("title",N),N=$("<div>"),R.layoutCtrl(h,0,3,12,12),N.append(h),R.layoutCtrl(da,20,10,240,20),N.append(da),N):da}return Aa?(da=$("<div>"),N=z.createWarning(),N.attr("title",H.get("sourceDeleted","\u516c\u5171\u6570\u636e\u6e90\u8fde\u63a5\u5f02\u5e38\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u6570\u636e\u5e93\u8fde\u63a5\u3002")),R.layoutCtrl(N,0,3,12,12),da.append(N),da):$("<div>")});var e=new D;n=new B;n.setText(u.SQL_TYPE_KSQL);n.setUserObject(u.SQL_TYPE_KSQL);
e.addElement(n);l=new B;l.setText(u.SQL_TYPE_SQL);l.setUserObject(u.SQL_TYPE_SQL);e.addElement(l);l.setChecked(!0);k=new O;k.setText(H.get("insertSystemVar","\u63d2\u5165\u7cfb\u7edf\u53d8\u91cf"));k.setItemModels(q.SUPPORTED_VAR_TYPE);k.setItemsWidth(285);k.addPressedListener(Pa);k.setCustomPainter(function(h,da,N){h?(h=$("<div>"),h.text(N)):(N=fa.get(N.getI18nKey(),N.getDefaultDesc()),da.attr("title",N),h=$("<div>"),h.text(N));h.appendTo(da)});a=$("<div>");a.text(H.get("preview","\u9884\u89c8"));
a.addClass("macro-preview-btn");a.on("click",function(){var h=Oa(),da;h.getDBInfo()||(da=H.get("noDBConnection","\u8bf7\u9009\u62e9\u6570\u636e\u5e93\u8fde\u63a5\u3002"));var N=h.getContent();N&&""!=$.trim(N)?0!=N.trim().toLowerCase().indexOf("select")?da=H.get("onlyAllowSelection","\u53ea\u5141\u8bb8\u67e5\u8be2\u64cd\u4f5c\u3002"):-1==N.indexOf("from")&&-1==N.indexOf("FROM")&&(da=H.get("sqlError","sql\u6267\u884c\u51fa\u9519\uff0c\u8bf7\u68c0\u67e5sql\u8bed\u53e5\u3002")):da=H.get("noQuery","\u8bf7\u8f93\u5165\u67e5\u8be2\u8bed\u53e5\u3002");
da?M.showPrompt(da):(h=new oa(v,h),h.setEditMacro(!0),h.showDialog())})},Pa=function(e,h,da){e=ba.getImpl(ba.SYS_VAR_HELPER).getFormatText(h);var N=t[0];h=N.value;if(Na.isIEBrowser())N.value=h.substring(0,r)+e+h.substring(r,h.length),r+=e.length,N.setSelectionRange(r,r),N.focus();else{if("number"===typeof N.selectionStart&&"number"===typeof N.selectionEnd){da=N.selectionStart;var S=N.selectionEnd;var pa=da;N.value=h.substring(0,da)+e+h.substring(S,h.length);pa+=e.length}else N.value+=e;setTimeout(function(){pa&&
N.setSelectionRange(pa,pa);N.focus()},100)}},Ja=function(e){(new J(v,function(h){Z.setAuthority(!!h);h=new T(v,!!h);h.registerDataCenterSelectorConstructor(X);h.registerSuperQuerySelectorConstructor(za);h.setDBSelectedCallback(function(N){c.setModel(N);var S=N.getDBSource();S&&(N.getDBSourceType()==y.SOURCE_TYPE_BIZMETA?S.getConnectionType()==V.DBCONNECTION_TYPE_DBCENTER?na.loadDataCenterDBType(S,function(pa){(Ca=W.isNeedShowKSql(pa))?b&&b.show():(b&&b.hide(),n.setChecked(!1))},function(pa,va){return!0}):
S.getConnectionType()==V.DBCONNECTION_TYPE_SUPERQUERY&&(Ca=!1,b&&b.hide(),n.setChecked(!1)):(Ca=W.isNeedShowKSql(S.getTypeName()))?b&&b.show():(b&&b.hide(),n.setChecked(!1)))});var da=c.getModel();da&&h.setModel(da);h.setConnectionDeleted(Aa);m&&h.setMacroStatus(m.getMacroStatus());h.showDialog()})).checkDataCenterPermission(G)},Ia=function(){K||Ma();I.setText(m.getUid());K.setText(m.getName());L.setText(m.getDesc());A.setSelected(m.isMultiValued());m.getSQLType()==u.SQL_TYPE_KSQL?n.setChecked(!0):
l.setChecked(!0);ba.getImpl(ba.SYS_VAR_HELPER).switchSQLToDisplayMode(m.getContent(),function(N){t&&t.text(N)});var e=m.getDBInfo();if(e){var h=e.getDBSource();if(h)if(e.getDBSourceType()==y.SOURCE_TYPE_BIZMETA)if(h.getConnectionType()==V.DBCONNECTION_TYPE_DBCENTER){var da=m.getMacroStatus();da!=d.DB_CENTER_NO_APP_METADATA&&da!=d.DB_CENTER_APP_CLOUD_DISABLED&&da!=d.DB_CENTER_APP_DISABLED&&da!=d.DB_CENTER_NO_APP&&na.loadDataCenterDBType(h,function(N){(Ca=W.isNeedShowKSql(N))?b&&b.show():(b&&b.hide(),
n.setChecked(!1))},function(N,S){return!0})}else h.getConnectionType()==V.DBCONNECTION_TYPE_SUPERQUERY&&(Ca=!1,b&&b.hide(),n.setChecked(!1));else(Ca=W.isNeedShowKSql(h.getTypeName()))?b&&b.show():(b&&b.hide(),n.setChecked(!1))}else Aa=!0;c.setModel(e)},Oa=function(){var e=m?m.copy():new g;var h=$.trim(I.getText());h=h.toLowerCase();var da=$.trim(L.getText()),N=t.val();N=ba.getImpl(ba.SYS_VAR_HELPER).switchSQLToPersistentMode(N);var S=c.getModel();e.setUid(h);e.setName($.trim(K.getText()));e.setDesc(da);
e.setMultiValued(A.getSelected());e.setContent(N);e.setDBInfo(S);h=l.isChecked()?l.getUserObject():n.getUserObject();e.setSQLType(h);return e}}function T(v,m){xa.call(this);var I=this,K=this.protectedMethod,L,A,c,n,l,k=!1,a;(function(){K.setTitle(H.get("selectDBConnection","\u9009\u62e9\u6570\u636e\u5e93\u8fde\u63a5"));I.setSize(800,590);K.setSelectable(!0);K.setContentPaneCreator(function(){L||(L=new ja(v,m),n&&L.registerDataCenterSelectorConstructor(n),l&&L.registerSuperQuerySelectorConstructor(l),
c&&L.setModel(c),L.setConnectionDeleted(k),L.setMsgCurtain(K.getMessageCurtain()),L.setMacroStatus(a));return L.getJqUi()});K.setClosingChecker2(function(b){b=L.getSelectedDBConnection();var t=Z.hasAuthority();if(!b)return K.getMessageCurtain().showPrompt(H.get("noDBConnection","\u8bf7\u9009\u62e9\u6570\u636e\u5e93\u8fde\u63a5\u3002")),!1;var r=b.getDBSource();if(t||r.getConnectionType()!=V.DBCONNECTION_TYPE_DBCENTER)return A(b),K.destroy(),!0;K.getMessageCurtain().showPrompt(H.get("noDBCenterPermission",
"\u6ca1\u6709\u6570\u636e\u4e2d\u5fc3\u6743\u9650\uff0c\u8bf7\u5148\u8054\u7cfb\u7ba1\u7406\u5458\u5206\u914d\u6743\u9650\u3002"));return!1},function(b){K.destroy();return!0});K.setClosingAction(function(b){})})();this.setDBSelectedCallback=function(b){A=b};this.setModel=function(b){c=b;L&&L.setModel(b)};this.setMacroStatus=function(b){a=b};this.setConnectionDeleted=function(b){k=b};this.registerDataCenterSelectorConstructor=function(b){n=b;L&&L.registerDataCenterSelectorConstructor(n)};this.registerSuperQuerySelectorConstructor=
function(b){l=b;L&&L.registerSuperQuerySelectorConstructor(l)}}function f(){var v=this,m,I,K,L,A=[];this.setModel=function(k){K=k;l()};this.getModel=function(){return K};this.setCustomPainter=function(k){L=k;l()};this.addActionListener=function(k){A.push(k)};this.getJqUi=function(){if(!m){I=$("<div>");I.addClass("sa-ctrl-f7selector-textcontainer");var k=$("<div>");k.addClass("sa-ctrl-f7selector-btn");k.addClass("sa-ctrl-f7selector-btn_enabled");k.addClass("sa-ctrl-f7selector-btnedit");k.on("click",
c);aa.background(k,"editor");m=$("<div>");m.addClass("sa-ctrl-f7selector");m.addClass("sa-ctrl-common-singlelineborder");m.append(I);m.append(k);l()}return m};var c=function(){for(var k=A.length,a=0;a<k;a++)(0,A[a])(v)},n=function(k){return $("<div>")},l=function(){if(I){var k=(L?L:n)(K);I.empty();k&&k.appendTo(I)}}}function ja(v,m){function I(){var Q=[];this.addElement=function(ua){Q.push(ua);ua.addCheckedListener(ca)};var ca=function(ua,qa){if(ua.isChecked())for(qa=0;qa<Q.length;qa++){var wa=Q[qa];
wa!=ua&&wa.setChecked(!1)}else if(qa){wa=!0;for(qa=0;qa<Q.length;qa++)if(Q[qa].isChecked()){wa=!1;break}wa&&ua.setChecked(!0)}}}function K(Q){KTDefaultCellRender.call(this,Q);var ca=this,ua=this.paintCellUI;this.paintCellUI=function(qa,wa){var Fa=ca.getCurrentRow(),Ta=ca.getCurrentColIdx();Fa=Fa.getUserObject();if(ca.getCurrentRowIdx()<E.getHeadRowCount())ua(qa,wa);else if(0==Ta){var Va=new B;A&&A.getId()==Fa.getId()&&(c=Va,Va.setChecked(!0));Va.setUserObject(Fa);Va.addCheckedListener(function(db,
cb){cb&&(Ba&&Ba.setChecked(!0),c=Va,r&&r.hide())});Fa=Va.getJqUi();R.layoutCtrl(Fa,22,4,23,23);Fa.appendTo(qa);n[ca.getCurrentRowIdx()]=Va}else 1==Ta?(wa=$("<div>"),wa.text(Fa.getName()),wa.attr("title",Fa.getName()),wa.css("line-height","28px"),wa.css("padding-left","2px"),wa.css("padding-right","2px"),wa.appendTo(qa)):2==Ta?(wa=$("<div>"),Fa=Fa.getDBSource(),wa.text(Fa.getTypeName()),wa.attr("title",Fa.getTypeName()),Fa.getConnectionType()==V.DBCONNECTION_TYPE_SUPERQUERY&&(wa.text(Fa.getShortDisplay()),
wa.attr("title",Fa.getShortDisplay())),wa.css("line-height","28px"),wa.css("padding-left","2px"),wa.css("padding-right","2px"),wa.appendTo(qa)):3==Ta?(wa=$("<div>"),Fa=Fa.getDBSource(),Ta=Fa.getShortDisplay(),Fa.getConnectionType()==V.DBCONNECTION_TYPE_SUPERQUERY&&(Ta=Fa.getDbAddress()+" "+Fa.getDbName()),wa.text(Ta),wa.attr("title",Ta),wa.css("line-height","28px"),wa.css("padding-left","2px"),wa.css("padding-right","2px"),wa.appendTo(qa)):4==Ta&&(wa=$("<div>"),Fa=Fa.getDBSource(),Fa=Fa.getUserName(),
wa.text(Fa),wa.attr("title",Fa),wa.css("line-height","28px"),wa.css("padding-left","2px"),wa.css("padding-right","2px"),wa.appendTo(qa))}}var L,A,c,n,l,k,a,b,t,r,M,X,za,ra,Ca,Aa,Ba,Ma,Pa,Ja,Ia=[],Oa,e=[],h,da,N,S,pa=!!m,va=!1,sa=!1,Ea=!1,La;this.setMacroStatus=function(Q){La=Q};this.getJqUi=function(){L||(L=$("<div>"),Ha(Ra));return L};this.getSelectedDBConnection=function(){if(pa&&Ma.isChecked()){var Q=N.getSource();if(Q){var ca=new y;ca.setDBSource(Q);ca.setDBSourceType(y.SOURCE_TYPE_BIZMETA);ca.setName("");
return ca}}else if(Pa.isChecked()){if(Q=S.getSource())return ca=new y,ca.setDBSource(Q),ca.setDBSourceType(y.SOURCE_TYPE_BIZMETA),ca.setName(""),ca}else for(ca=0;ca<e.length;ca++)if(Q=e[ca],Q.isChecked())return Q.getUserObject()};this.setModel=function(Q){A=Q};this.setConnectionDeleted=function(Q){sa=Q};this.setMsgCurtain=function(Q){za=Q};this.registerDataCenterSelectorConstructor=function(Q){h=Q};this.registerSuperQuerySelectorConstructor=function(Q){da=Q};var Ra=function(){var Q=0,ca=new D;ca.addChangedListener(function(qa,
wa){if(qa!==Ba){if(e)for(qa=0;qa<e.length;qa++)e[qa].setChecked(!1);r&&r.hide()}});Ma=new B;var ua=H.get("dataCenter","\u5f53\u524d\u6570\u636e\u4e2d\u5fc3");pa||(ua+=H.get("dataCenterNoPermission","\uff08\u6ca1\u6709\u5f53\u524d\u6570\u636e\u4e2d\u5fc3\u6743\u9650\uff09"));Ma.setText(ua);ua=Ma.getJqUi();Ma.setCustomStyle("position","relative");ua.addClass("macro-radio-button");k=$("<div>");ua.appendTo(k);R.layoutCtrl(k,0,Q,500,23);k.appendTo(L);ca.addElement(Ma);h&&(N=new h,N.setFunSelectedChangeListener(function(qa){if(A){var wa=
A.getDBSource();wa=wa?wa.getAppNumber():"";if(qa.value==wa)return}M&&M.hide()}),Ca=N.getJqUi(),R.layoutCtrl(Ca,0,Q+=43,300,23),Ca.appendTo(L),A&&A.getDBSourceType()==y.SOURCE_TYPE_BIZMETA&&(ua=A.getDBSource())&&ua.getConnectionType()==V.DBCONNECTION_TYPE_DBCENTER&&N.setSource(ua),pa?Ca.css("pointer-events","auto"):Ca.css("pointer-events","none"));Pa=new B;Pa.setText(H.get("superQuery","\u8d85\u7ea7\u67e5\u8be2"));ua=Pa.getJqUi();Pa.setCustomStyle("position","relative");ua.addClass("macro-radio-button");
a=$("<div>");ua.appendTo(a);R.layoutCtrl(a,0,Q+=43,500,23);a.appendTo(L);ca.addElement(Pa);da&&(S=new da,Aa=S.getJqUi(),R.layoutCtrl(Aa,0,Q+=43,300,23),Aa.appendTo(L),A&&A.getDBSourceType()==y.SOURCE_TYPE_BIZMETA&&(ua=A.getDBSource())&&ua.getConnectionType()==V.DBCONNECTION_TYPE_SUPERQUERY&&!ua.getDbAddress()&&S.setSource(ua),Aa.css("pointer-events","auto"));Pa.addCheckedListener(Xa);Ba=new B;Ba.setText(H.get("publicDBConnection","\u516c\u5171\u6570\u636e\u6e90"));ua=Ba.getJqUi();Ba.setCustomStyle("position",
"relative");ua.addClass("macro-radio-button");b=$("<div>");ua.appendTo(b);R.layoutCtrl(b,0,Q+=43,500,23);b.appendTo(L);ca.addElement(Ba);Ba.addCheckedListener(Ya);A&&A.isAuthError()?Qa():A?Da(A):sa&&(ca=H.get("publicSourceDeleted","\u8be5\u5b8f\u53d8\u91cf\u6700\u540e\u4fee\u6539\u4eba\u9009\u62e9\u7684\u516c\u5171\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\u3002"),ya(ca));l&&(R.layoutCtrl(l,0,Q+=43,765,258),l.appendTo(L),X&&eb());Ma.setEnabled(pa);Ga(A)},Ga=function(Q){if(!Q)return sa?Ba.setChecked(!0):
pa?Ma.setChecked(!0):Pa.setChecked(!0),!0;Q=Q.getAbstractSource();var ca=Q.getConnectionType();ca!=V.DBCONNECTION_TYPE_SUPERQUERY||Q.getDbAddress()?ca==V.DBCONNECTION_TYPE_DBCENTER?Ma.setChecked(!0):(ca==V.DBCONNECTION_TYPE_DB||ca==V.DBCONNECTION_TYPE_SUPERQUERY&&Q.getDbAddress())&&Ba.setChecked(!0):Pa.setChecked(!0)},Qa=function(){var Q=A.getAbstractSource(),ca=Q.getConnectionType();if(ca==V.DBCONNECTION_TYPE_SUPERQUERY&&!Q.getDbAddress())ca=z.createWarning(),ca.addClass("macro-radio-button-warning"),
ca.attr("title",H.get("modifierUnauthorizedSchema","\u6a21\u5f0f\u201c#1\u201d\u5df2\u88ab\u5220\u9664\u6216\u53d6\u6d88\u6388\u6743\u7ed9\u8be5\u5b8f\u53d8\u91cf\u7684\u6700\u540e\u4fee\u6539\u4eba\u3002").replace("#1",Q.getSchemaName())),ca.appendTo(a),t=ca;else if(ca==V.DBCONNECTION_TYPE_DBCENTER)ca=z.createWarning(),ca.addClass("macro-radio-button-warning"),ca.attr("title",H.get("modifierUnauthorizedDbCenter","\u5f53\u524d\u6570\u636e\u4e2d\u5fc3\u5df2\u53d6\u6d88\u6388\u6743\u7ed9\u8be5\u5b8f\u53d8\u91cf\u7684\u6700\u540e\u4fee\u6539\u4eba\u3002")),
ca.appendTo(k);else if(ca==V.DBCONNECTION_TYPE_DB||ca==V.DBCONNECTION_TYPE_SUPERQUERY&&Q.getDbAddress())Q=H.get("modifierUnauthorizedSource","\u516c\u5171\u6570\u636e\u6e90\u201c#1\u201d\u5df2\u53d6\u6d88\u6388\u6743\u7ed9\u8be5\u5b8f\u53d8\u91cf\u7684\u6700\u540e\u4fee\u6539\u4eba\u3002").replace("#1",A.getName()),ya(Q)},Da=function(Q){var ca=Q.getAbstractSource(),ua=ca.getConnectionType(),qa=ca.getAppNumber?ca.getAppNumber():"";if(ua==V.DBCONNECTION_TYPE_DBCENTER)if(pa){switch(La){case d.DB_CENTER_NO_APP_METADATA:qa=
H.get("appMetadataNotExist",'\u5e94\u7528"#1"\u5143\u6570\u636e\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002').replace("#1",qa);break;case d.DB_CENTER_APP_CLOUD_DISABLED:qa=H.get("appCloudDisabled",'\u5e94\u7528"#1"\u6240\u5728\u4e91\u88ab\u7981\u7528\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002').replace("#1",qa);break;case d.DB_CENTER_APP_DISABLED:qa=H.get("appDisabled",'\u5e94\u7528"#1"\u88ab\u7981\u7528\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002').replace("#1",
qa);break;case d.DB_CENTER_NO_APP:qa=H.get("appNotExist",'\u5e94\u7528"#1"\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002').replace("#1",qa);break;default:qa=""}M=z.createWarning();M.addClass("macro-radio-button-warning");M.attr("title",qa);qa?M.show():M.hide();M.appendTo(k)}else Q=z.createWarning(),Q.addClass("macro-radio-button-warning"),Q.attr("title",H.get("userUnauthorizedDbCenter","\u5b8f\u7684\u6700\u540e\u4fee\u6539\u4eba\u9009\u62e9\u7684\u662f\u201c#1\u201d\u5e94\u7528\u3002\n\u7531\u4e8e\u60a8\u6ca1\u6709\u5f53\u524d\u6570\u636e\u4e2d\u5fc3\u7684\u6743\u9650\uff0c\u6240\u4ee5\u4e0d\u80fd\u4fee\u6539\u5e94\u7528\u3002").replace("#1",
qa)),Q.appendTo(k);else(ua==V.DBCONNECTION_TYPE_DB||ua==V.DBCONNECTION_TYPE_SUPERQUERY&&ca.getDbAddress())&&!Ea&&(qa=H.get("userUnauthorizedSource","\u5b8f\u7684\u6700\u540e\u4fee\u6539\u4eba\u9009\u62e9\u7684\u662f\u201c#1\u201d\u6570\u636e\u6e90\u3002\n\u7531\u4e8e\u60a8\u6ca1\u6709\u8be5\u516c\u5171\u6570\u636e\u6e90\u7684\u6743\u9650\uff0c\u6240\u4ee5\u516c\u5171\u6570\u636e\u6e90\u5217\u8868\u4e2d\u6ca1\u6709\u663e\u793a\u6b64\u6570\u636e\u6e90\u3002").replace("#1",Q.getName()),ya(qa))},ya=function(Q){r||
(r=z.createWarning(),r.addClass("macro-radio-button-warning"),b.append(r));r.show();r.attr("title",Q)},Ha=function(Q){(new J(v,function(ca){l=$("<div>");l.css("border","1px solid #ccc");Ja=[];if(ca&&0!=ca.length){for(var ua=0;ua<ca.length;ua++){var qa=new y;qa.fromJsonObject(ca[ua]);Ja.push(qa);A&&A.getId()==qa.getId()&&(Ea=!0)}Za();ra.appendTo(l)}else ca=$("<div>"),ca.addClass("macro-no-db-prompt"),ca.text(H.get("neverCreateDB","\u6682\u672a\u521b\u5efa\u6570\u636e\u5e93\u8fde\u63a5")),ca.appendTo(l);
Q()},function(ca,ua){za.showPrompt(ua);return!0})).loadDBConnections()},Xa=function(){Ia&&0!=Ia.length||va||!da||(va=!0,da.loadUsableSchemas(function(Q){Ia=Q;S.setSchemas(Ia);if(A){var ca=A.getAbstractSource();if(ca.getConnectionType()==V.DBCONNECTION_TYPE_SUPERQUERY&&!ca.getDbAddress()){var ua=!1;ca=ca.getSchemaName();for(var qa=0;qa<Q.length;qa++)if(Q[qa].getName()==ca){ua=!0;break}ua||(t&&t.remove(),Q=z.createWarning(),Q.addClass("macro-radio-button-warning"),Q.attr("title",H.get("userUnauthorizedSchema",
"\u5b8f\u7684\u6700\u540e\u4fee\u6539\u4eba\u9009\u62e9\u7684\u662f\u201c#1\u201d\u6a21\u5f0f\u3002\n\u7531\u4e8e\u60a8\u6ca1\u6709\u8be5\u6a21\u5f0f\u7684\u6743\u9650\uff0c\u6240\u4ee5\u201c\u6a21\u5f0f\u201d\u4e0b\u62c9\u5217\u8868\u4e2d\u4e0d\u4f1a\u663e\u793a\u6b64\u6a21\u5f0f\u3002").replace("#1",ca)),Q.appendTo(a))}}},za))},Ya=function(Q,ca){ca&&(e&&0<e.length&&(c||(c=e[0]),c.setChecked(!0)),r&&r.hide())},Za=function(){X=E.createTable();X.setColumnFitVisibleWidth(!0);var Q=new K(X);Q.setOutsideVisible(!0);
X.setCellRender(Q);X.setSyncUIWhenModelChanged(!0);ra=$(X.getUI());R.layoutCtrlWithLRTB(ra,0,0,null,0,0,null)},eb=function(){X||Za();E.clear(X);n={};X.addColumns(5);X.getColumn(0).setWidth(50);X.getColumn(1).setWidth(140);X.getColumn(2).setWidth(120);X.getColumn(3).setWidth(220);X.getColumn(4).setWidth(160);var Q=E.createHeadRow(X);Q.getCell(1).setValue(H.get("name","\u540d\u79f0"));Q.getCell(2).setValue(H.get("type","\u7c7b\u578b"));Q.getCell(3).setValue(H.get("dbAddress","\u5730\u5740"));Q.getCell(4).setValue(H.get("user",
"\u7528\u6237"));Q=0;for(var ca=Ja.length;Q<ca;Q++){var ua=Ja[Q];E.createRow(X).setUserObject(ua)}E.refresh(X);Oa||(Oa=new I);for(var qa in n)Q=n[qa],Oa.addElement(Q),e.push(Q);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.macro&&(com.kingdee.bos.qing.macro={});"undefined"==typeof com.kingdee.bos.qing.macro.sql&&
(com.kingdee.bos.qing.macro.sql={});com.kingdee.bos.qing.macro.sql.SQLMacroTypeItem=function(){ia.call(this,G,H.get("sqlMacro","SQL\u5b8f"));var v,m,I;this.setRemoteImpl=function(K){v=K};this.setDataCenterSelector=function(K){m=K};this.setSuperQuerySelector=function(K){I=K};this.showCreateDialog=function(K){var L=new x(v);L.registerDataCenterSelectorConstructor(m);L.registerSuperQuerySelectorConstructor(I);L.setCreateSuccessCallback(K);L.showDialog()};this.showEditDialog=function(K,L){L=new F(v,L);
L.registerDataCenterSelectorConstructor(m);L.registerSuperQuerySelectorConstructor(I);L.setUpdateSuccessCallback(K);L.showDialog()}};var G="SQL",xa,Y,ha,w,C,U,z,B,D,E,aa,J,g,Z,la,u,ia,d,oa,na,H,Na,R,fa,ba,q,O,W,V,y;(function(){var v=com.kingdee.bos.qing.macro;oa=v.PreviewDialog;na=v.DataCenterInfoHelper;J=v.MacroFacade;la=v.MacroFactory;v=com.kingdee.bos.qing.macro.model;g=v.SQLMacro;Z=v.DataCenterAuthChecker;u=v.SqlTypeEnum;ia=v.AbstractMacroTypeItem;d=v.MacroStatusEnum;v=com.kingdee.bos.qing.framework.common;
H=v.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.macro);fa=v.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.data);v=com.kingdee.bos.qing.ui.component;xa=v.AbstractModalDialog;Y=v.MessageDialog;ha=v.Label;w=v.HelpIcon;C=v.TextField;U=v.ComboBox;B=v.RadioButton;D=v.RadioButtonGroup;aa=v.Icons;v=com.kingdee.bos.qing.common;Na=v.Util;R=v.DomUtil;v=com.kingdee.bos.qing.data;ba=v.VariateHelperFactory;q=v.SystemVarType;O=v.DropdownItemListPane;W=v.DBSource;V=v.AbstractSource;
v=com.kingdee.bos.qing.common.ui;z=v.CommonIconUtil;E=v.TableUtil;v=com.kingdee.bos.qing.dbmanage;y=v.DBConnection})();la.registerConstructor(G,g)})();(function(){function x(c){d.call(this);var n=this,l=this.protectedMethod,k=this.showDialog,a,b;(function(){l.setTitle(u.get("createEntityMacro","\u65b0\u5efa\u57fa\u7840\u6570\u636e\u5b8f"));n.setSize(450,400);l.setSelectable(!0);l.setContentPaneCreator(function(){a=new P(c);a.setOuterMessageCurtain(l.getMessageCurtain());return a.createJqUi()});l.setClosingChecker2(function(t){var r=a.getModel();if(t=r.validateModel())return l.getMessageCurtain().showPrompt(t),!1;(new C(c,function(M){r.fromJsonObject(M);
b&&b(r);l.destroy();return!0},function(M,X){return"1200001"==M?(l.getMessageCurtain().showPrompt(u.get("duplicateName","\u540d\u79f0\u91cd\u590d\u3002")),!0):"1200002"==M?(M=new oa,M.setDetail(X),M.setOptionType(oa.OPTION_OK),M.setTitle(u.get("macroCreateFailed","\u65b0\u5efa\u5931\u8d25")),M.setMessage(u.get("macroCannotExe","\u8be5\u5b8f\u65e0\u6cd5\u6b63\u5e38\u6267\u884c\uff0c\u8bf7\u68c0\u67e5\u5b8f\u4fe1\u606f\u662f\u5426\u6b63\u786e\u3002")),M.showDialog(),!0):"1200005"==M?(l.getMessageCurtain().showPrompt(u.get("duplicateUid",
"\u7f16\u7801\u91cd\u590d\u3002")),!0):"1200009"==M?(l.getMessageCurtain().showPrompt(u.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):!1})).saveMacro(r,xa)},function(t){l.destroy();return!0});l.setClosingAction(function(t){})})();this.setCreateSuccessCallback=function(t){b=t};this.showDialog=function(){k();L()}}function F(c,n,l){d.call(this);var k=this,a=this.protectedMethod,b=this.showDialog,t,r;(function(){a.setTitle(u.get("editEntityMacro","\u7f16\u8f91\u57fa\u7840\u6570\u636e\u5b8f"));
k.setSize(450,400);a.setSelectable(!0);a.setContentPaneCreator(function(){t=new P(c);t.setUpdateMode(!0);t.setModel(n);t.setOuterMessageCurtain(a.getMessageCurtain());t.setDesignTimeEntity(l);return t.createJqUi()});a.setClosingChecker2(function(X){X=t.getModel();var za=X.validateModel();if(za)return a.getMessageCurtain().showPrompt(za),!1;M(X)},function(X){a.destroy();return!0});a.setClosingAction(function(X){})})();this.setUpdateSuccessCallback=function(X){r=X};this.showDialog=function(){b();L()};
var M=function(X){(new C(c,function(za){r&&r();a.destroy()},function(za,ra){return"1200001"==za?(a.getMessageCurtain().showPrompt(u.get("duplicateName","\u540d\u79f0\u91cd\u590d\u3002")),!0):"1200002"==za?(za=new oa,za.setDetail(ra),za.setOptionType(oa.OPTION_OK),za.setTitle(u.get("macroUpdateFailed","\u7f16\u8f91\u5931\u8d25")),za.setMessage(u.get("macroCannotExe","\u8be5\u5b8f\u65e0\u6cd5\u6b63\u5e38\u6267\u884c\uff0c\u8bf7\u68c0\u67e5\u5b8f\u4fe1\u606f\u662f\u5426\u6b63\u786e\u3002")),za.showDialog(),
!0):"1200003"==za?(a.getMessageCurtain().showPrompt(u.get("macroNotFound","\u5b8f\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),!0):"1200009"==za?(a.getMessageCurtain().showPrompt(u.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):!1})).updateMacro(X,xa)}}function P(c){var n,l,k,a,b,t,r,M,X,za,ra,Ca,Aa,Ba;this.setUpdateMode=function(e){za=e};this.createJqUi=function(){var e=$("<div>");l||Pa();var h=new na(u.get("code","\u7f16\u7801"));h.setRequired(!0);
h=h.getJqUi();var da=n.getJqUi(),N=new na,S=N.getJqUi();N.setRequired(!0);N.setText(u.get("name","\u540d\u79f0"));N=l.getJqUi();var pa=new na,va=pa.getJqUi();pa.setText(u.get("desc","\u63cf\u8ff0"));pa=k.getJqUi();var sa=new na,Ea=sa.getJqUi();sa.setText(u.get("returnValueType","\u8fd4\u56de\u503c"));sa=a.getJqUi();var La=new na,Ra=La.getJqUi();La.setText(u.get("entity","\u57fa\u7840\u8d44\u6599"));La=b.getJqUi();var Ga=new na,Qa=Ga.getJqUi();Ga.setText(u.get("returnProperty","\u8fd4\u56de\u5b57\u6bb5"));
Ga=t.getJqUi();var Da=8,ya=0;m.layoutCtrl(h,Da,ya,80,23);m.layoutCtrl(S,Da,ya+=43,80,23);m.layoutCtrl(va,Da,ya+=43,80,23);m.layoutCtrl(Ea,Da,ya+=43,80,23);m.layoutCtrl(Ra,Da,ya+=43,80,23);m.layoutCtrl(Qa,Da,ya+=43,80,23);m.layoutCtrl(X,Da,ya+43,50,23);X.css("line-height","23px");Da+=90;ya=0;m.layoutCtrl(da,Da,ya,300,23);m.layoutCtrl(N,Da,ya+=43,300,23);m.layoutCtrl(pa,Da,ya+=43,300,23);m.layoutCtrl(sa,Da,ya+=43,300,23);m.layoutCtrl(La,Da,ya+=43,300,23);r&&(m.layoutCtrl(r,Da-12-3,ya,12,12),r.appendTo(e));
m.layoutCtrl(Ga,Da,ya+=43,300,23);M&&(m.layoutCtrl(M,Da-12-3,ya,12,12),M.appendTo(e));h.appendTo(e);S.appendTo(e);va.appendTo(e);Ea.appendTo(e);Ra.appendTo(e);Qa.appendTo(e);da.appendTo(e);N.appendTo(e);pa.appendTo(e);sa.appendTo(e);La.appendTo(e);Ga.appendTo(e);X.appendTo(e);za||(h=new H,h.setIconType(H.ICON_TYPE_QUESTION),h.setTipsText(u.get("uidTips","\u7f16\u7801\u5fc5\u987b\u7531\u5c0f\u5199\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e14\u521b\u5efa\u540e\u65e0\u6cd5\u66f4\u6539\uff01")),
h=h.getJqUi(),m.layoutCtrlWithLRTB(h,null,10,16,2,null,16),h.appendTo(e));return e};this.setOuterMessageCurtain=function(e){ra=e};this.setDesignTimeEntity=function(e){Aa=e};this.setModel=function(e){Ca=e;Ba=e.getNotExistPropertyNames();l||Pa();n.setText(Ca.getUid());l.setText(Ca.getName());k.setText(Ca.getDesc());a.setSelected(Ca.isMultiValued());var h=z.buildEntityAssociate(e.getEntityPath(),e.getEntityFullName(),e.getMasterAppId());b.setModel(h);e=e.getSelectedPropertyNames();t.setModel(e);e=Ca.getMacroStatus();
h=Ca.getStatusWarning();e==aa.ENTITY_NOT_EXIST?(r=Oa(h),M=Oa(h)):e==aa.PROPERTY_ABNORMAL&&h&&(M=Oa(h))};this.getModel=function(){return Ma()};var Ma=function(){var e=Ca?Ca.copy():new D;e.setUid($.trim(n.getText()).toLowerCase());e.setName($.trim(l.getText()));e.setDesc($.trim(k.getText()));e.setMultiValued(a.getSelected());var h=b.getModel();h=h?h.getEntityPath():null;e.setEntityPath(h);h=t.getModel();e.setSelectedPropertyNames(h);return e},Pa=function(){n=new Na;za&&n.setEnabled(!1);l=new Na;k=new Na;
a=new R;a.setItemModels([!0,!1]);a.setSelected(!0);a.setCustomPainter(function(e,h,da){e=da?u.get("multiValued","\u591a\u503c"):u.get("singleValued","\u5355\u503c");h.text(e)});a.setEnabled(!1);b=new fa;b.addActionListener(Ia);b.setCustomPainter(function(e){e&&e.getEntityFullName()?(e=e.getEntityFullName()+"("+e.getEntityNumber()+")",b.setTooltips(e)):e=u.get("selectEntityF7Tips","\u8bf7\u9009\u62e9\u57fa\u7840\u8d44\u6599");return e});t=new fa;t.addActionListener(Ja);t.setCustomPainter(function(e){return e&&
0<e.length?(e=u.get("selectedPropertyNum","\u5df2\u9009\u62e9#1\u4e2a\u5b57\u6bb5").replace("#1",e.length),Ba&&0<Ba.length&&(e+=u.get("deletedPropertyNum","\uff0c\u5176\u4e2d#1\u4e2a\u5b57\u6bb5\u4e0d\u5b58\u5728").replace("#1",Ba.length)),e):u.get("selectPropertyF7Tips","\u8bf7\u9009\u62e9\u8fd4\u56de\u5b57\u6bb5")});X=$("<div>");X.text(u.get("preview","\u9884\u89c8"));X.addClass("macro-preview-btn");X.on("click",function(){var e=Ma(),h;!r&&e&&e.getEntityPath()?e.getSelectedPropertyNames()&&0!=e.getSelectedPropertyNames().length||
(h=u.get("noReturnProperty","\u8bf7\u9009\u62e9\u8fd4\u56de\u5b57\u6bb5\u3002")):h=u.get("noEntity","\u8bf7\u9009\u62e9\u57fa\u7840\u8d44\u6599\u3002");h?ra.showPrompt(h):(e=new ha(c,e),e.setEditMacro(!0),e.showDialog())})},Ja=function(){if(Aa){var e=new T(c,Aa),h=[],da=t.getModel();if(da&&0<da.length)for(var N in da)Ba&&-1!=Ba.indexOf(da[N])||h.push(da[N]);e.setSelectedPropertyName(h);e.setPropertySelectedCallback(function(S){Ba=null;t.setModel(S);M&&(M.remove(),M=null)});e.showDialog();return!0}e=
u.get("noEntity","\u8bf7\u9009\u62e9\u57fa\u7840\u8d44\u6599\u3002");ra.showPrompt(e)},Ia=function(){var e=new f(c),h=b.getModel();h&&!r&&e.setEntityAssociate(h);e.setEntitySelectedCallback(function(da,N){da&&h&&da.getEntityPath()==h.getEntityPath()||(Aa=N,b.setModel(da),t.setModel(null),Ba=null,r&&(r.remove(),r=null),M&&(M.remove(),M=null))});e.showDialog()},Oa=function(e){var h=$("<span class='macro-db-connection-warning'>");h.text("!");h.attr("title",e);return h}}function T(c,n){d.call(this);var l=
this,k=this.protectedMethod,a,b,t;(function(){k.setTitle(u.get("selectProperty","\u9009\u62e9\u5b57\u6bb5"));l.setSize(600,550);k.setSelectable(!0);k.setContentPaneCreator(function(){a=new G(c);a.setSelectedFieldName(t);a.setDesignTimeEntity(n);return a.getJqUi()});k.setClosingChecker2(function(r){if((r=a.getSelectedField())&&20<r.length)return r=u.get("overMaxPropertyNum","\u5b57\u6bb5\u4e2a\u6570\u4e0d\u80fd\u8d85\u8fc7#1\u4e2a\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002").replace("#1",20),k.getMessageCurtain().showPrompt(r),
!1;b(r);k.destroy();return!0},function(r){k.destroy();return!0});k.setClosingAction(function(r){})})();this.setPropertySelectedCallback=function(r){b=r};this.setSelectedPropertyName=function(r){t=r}}function f(c){d.call(this);var n=this,l=this.protectedMethod,k,a,b;(function(){l.setTitle(u.get("selectEntity","\u9009\u62e9\u57fa\u7840\u8d44\u6599"));n.setSize(750,550);l.setSelectable(!0);l.setContentPaneCreator(function(){k||(k=new ja(c),k.setMessageCurtain(l.getMessageCurtain()),b&&k.setEntityAssociate(b));
return k.getJqUi()});l.setClosingChecker2(function(t){var r=k.getEntityAssociate();if(r)(new w(U.getMacroEntityRemote(),function(M){if(M){var X=new E;X.fromJsonObject(M);a(r,X);l.destroy();return!0}M=u.get("noDesignTimeEntity","\u60a8\u9009\u62e9\u7684\u57fa\u7840\u8d44\u6599\u7684\u5143\u6570\u636e\u4e0d\u5b8c\u6574\uff0c\u65e0\u6cd5\u4f7f\u7528\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");l.getMessageCurtain().showPrompt(M);return!1},function(M,X){M=new oa;M.setOptionType(oa.RETURN_OK);M.setTitle(u.get("noDesignTimeEntity",
"\u60a8\u9009\u62e9\u7684\u57fa\u7840\u8d44\u6599\u7684\u5143\u6570\u636e\u4e0d\u5b8c\u6574\uff0c\u65e0\u6cd5\u4f7f\u7528\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002"));M.setClosedAction(function(){l.destroy()});M.setMessage(X);M.showDialog();return!1})).getDesignTimeEntity(r.getEntityPath());else return t=u.get("selectEntityTips","\u8bf7\u9009\u62e9\u4e00\u4e2a\u57fa\u7840\u8d44\u6599\u3002\u5207\u6362\u76ee\u5f55\u3001\u9875\u7801\uff0c\u66f4\u6539\u641c\u7d22\u6761\u4ef6\u4f1a\u6e05\u9664\u57fa\u7840\u8d44\u6599\u7684\u9009\u62e9\u72b6\u6001\u3002"),
l.getMessageCurtain().showPrompt(t),!1},function(t){l.destroy();return!0});l.setClosingAction(function(t){})})();this.setEntitySelectedCallback=function(t){a=t};this.setEntityAssociate=function(t){b=t}}function ja(c){function n(p){KTDefaultCellRender.call(this,p);var ka=this,ea=this.paintCellUI;this.paintCellUI=function(ma,ta){var Ka=ka.getCurrentRow(),Sa=ka.getCurrentColIdx(),Ua=ka.getCurrentRowIdx();Ka=Ka.getUserObject();var Wa=K.getHeadRowCount();Ua<Wa?ea(ma,ta):0==Sa?(ta=new O,ta.setUserObject(Ka),
va&&va.getNumber()==Ka.getNumber()&&ta.setChecked(!0),ta.addCheckedListener(Va),Ka=ta.getJqUi(),m.layoutCtrl(Ka,12,2,23,23),Ka.appendTo(ma),ya.addElement(ta)):1==Sa?(ta=Ua-Wa+1,Ka=$("<div>"),Ka.text(ta),Ka.attr("title",ta),Ka.addClass("macro-tabel-cell-content"),ta=$(ma).width()/2-7.5,Ka.css("padding-left",4<ta?ta+"px":"4px"),Ka.appendTo(ma)):2==Sa?(ta=$("<div>"),ta.attr("title",Ka.getName()),ta.addClass("macro-tabel-cell-content"),A(ta,X,Ka.getName()),ta.appendTo(ma)):3==Sa&&(ta=$("<div>"),ta.attr("title",
Ka.getNumber()),ta.addClass("macro-tabel-cell-content"),A(ta,X,Ka.getNumber()),ta.appendTo(ma))}}function l(p){KTDefaultCellRender.call(this,p);var ka=this;this.paintCellUI=function(ea,ma){var ta=ka.getCell().getValue(),Ka=ta.getName(),Sa=ta.getDisplayName();$(ea).css("width","100%");ea=$("<div>");ea.addClass("macro-entity-app-list-item");ea.attr("app-id",I.encode(Ka));ea.attr("title",Sa);var Ua=$("<div>");Ua.addClass("macro-entity-app-list-item-text");A(Ua,ra,Sa);ea.append(Ua);ma=$(ma);ma.addClass("macro-app-tree-text-area");
ma.append(ea);ta instanceof g&&(X&&(ma=ta.getEntities())&&0<ma.length&&(ma="("+ma.length+")",Sa=$("<span>"),Sa.addClass("macro-app-tree-entity-count"),Sa.text(ma),ea.append(Sa),Ua.css("width","calc(100% - 50px)")),ea.on("click",{cellNode:ta},jb),sa&&sa.getName()==Ka&&ea.addClass("macro-entity-app-list-item_selected"))}}function k(p){KTDefaultTreeHandlerRender.call(this,p);var ka=this;this.create=function(ea,ma,ta,Ka,Sa,Ua,Wa){var bb=17*ea.getLevel();var $a=bb+14;var ab=null;if(ka.protectedMethod.isTreeNodeHasChildren(ea,
ma,ta)||ea.isHaveHandlerAlways())ab=ka.protectedMethod.createAbsoluteHtmlElement("div",bb,Sa,14,Wa),ab.style.cursor="pointer",ma=$(ab),ma.css("width","100%"),ta=$("<div>"),ma.append(ta),ea.isExpanded()?(ta.addClass("lower-triangle"),ta.removeClass("right-triangle")):(ta.addClass("right-triangle"),ta.removeClass("lower-triangle"));ma=[ab,$a,Sa,null];ea=ma[0];$a=ma[1];ab=ma[2];ma=ma[3];Ka=ka.protectedMethod.createAbsoluteHtmlElement("span",$a,ab,Ka+Ua-$a,Sa+Wa-ab);return[ea,Ka,ma]}}var a,b,t,r,M,X,
za,ra,Ca,Aa,Ba,Ma,Pa,Ja,Ia,Oa,e,h,da=new v,N,S,pa,va,sa,Ea=[],La={},Ra={},Ga=0,Qa=0,Da,ya,Ha,Xa={},Ya=!1,Za;this.getJqUi=function(){a||eb();return a};this.setMessageCurtain=function(p){pa=p};this.setEntityAssociate=function(p){N=p};this.getEntityAssociate=function(){if(va){for(var p=va.getNumber(),ka=va.getName(),ea=sa;ea&&-1!=ea.getSubNodeLevel();)ka=ea.getDisplayName()+"/"+ka,p=z.appendEntityPath(ea.getName(),p),ea=ea.getParentNode();return z.buildEntityAssociate(p,ka,sa.getName())}};var eb=function(){a=
$("<div>");a.css("top","6px");b=$("<div>");Q();t=$("<div>");t.addClass("macro-entity-content-panel");Ba=$("<div>");Ba.addClass("macro-entity-tabel-panel");kb();Ma=$("<div>");Ba.append(Ma);t.append(Ba);Ca=$("<div>");ca();Aa=$("<div>");Ca.append(Aa);t.append(Ca);qa();S&&S.unobserve();S=new ia;S.setDelay(50);S.setCallback(function(){Ea&&0<Ea.length&&cb();Ha&&0<Ha.length&&Ta()});S.observe();wa()},Q=function(){r=new y;r.setPlaceholder(u.get("entitySearchBoxPlaceholder","\u641c\u7d22\u57fa\u7840\u8d44\u6599\u540d\u79f0/\u7f16\u7801"));
r.setShowSearchIcon(!0);var p=r.getJqUi();p.addClass("macro-entity-search-box");r.addEnterEventListener(function(){ua()});r.addClearIconListener(function(){ua()});b.append(p)},ca=function(){M=new y;M.setPlaceholder(u.get("appSearchBoxPlaceholder","\u641c\u7d22\u4e91/\u5e94\u7528\u540d\u79f0"));M.setShowSearchIcon(!0);Pa=M.getJqUi();Pa.find("input");Pa.addClass("macro-app-search-box");M.addEnterEventListener(function(){ra=M.getText().trim();za&&za===ra?(Qa>=Da.length&&(Qa=0),Fa(),db(),fb()):ua()});
M.addClearIconListener(function(){M.hideText();ua()});Ca.append(Pa)},ua=function(){ra=M.getText().trim();X=r.getText().trim();wa()},qa=function(){var p=new q;p.setHorizontalSplit(!0);p.setEnabled(!0);p.setFirstSize(180,140,250);p.setSecondSize(530,-1,-1);p.setResizeMode(q.RESIZE_MODE_FIRST_FIXED);p.setFirstChild(q.createChildWrapper(Ca,function(){setTimeout(function(){Ea&&0<Ea.length&&Ia&&Ia.updateUI();Ha&&0<Ha.length&&Ja&&Ja.updateUI()},500)}));p.setSecondChild(q.createChildWrapper(Ba));t.append(p.getJqUi());
p=new q;p.setHorizontalSplit(!1);p.setEnabled(!1);p.setFirstSize(25,-1,-1);p.setSecondSize(475,0,-1);p.setResizeMode(q.RESIZE_MODE_FIRST_FIXED);p.setFirstChild(q.createChildWrapper(b));p.setSecondChild(q.createChildWrapper(t));a.append(p.getJqUi())},wa=function(){h&&h.hide();Oa&&Oa.hide();Aa&&lb(u.get("loading","\u52a0\u8f7d\u4e2d..."),Aa,30);(new w(U.getMacroEntityRemote(),function(p){Aa&&gb(Aa);Ea=[];Da=[];Qa=0;La={};Ga=0;Xa={};za=ra;var ka=new J;ka.fromJsonObject(p);p=ka.getChildren();for(ka=0;ka<
p.length;ka++)hb(p[ka]);Fa();db();fb()},function(p,ka){Aa&&gb(Aa);p=u.get("appLoadFailTips","\u52a0\u8f7d\u5e94\u7528\u5217\u8868\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5\u3002");pa.showPrompt(p)})).getUsableEntities(ra,X)},Fa=function(){if(!Ea||0>=Ea.length)va=sa=null;else if(ra){var p=Da[Qa++];if(p instanceof g)sa=p;else{var ka=Da.length>Qa?Da[Qa]:null;if(ka instanceof g&&ka.getParentNode().getName()==p.getName())sa=ka,Qa++;else if((p=p?p.getChildren():[])&&0<p.length){for(p=p[0];p instanceof
J;)p=p.getChildren()[0];sa=p}}}else if(N&&!Ya){a:{p=Ea;ka=N.getMasterAppId();if(p&&0<p.length)for(var ea=0;ea<p.length;ea++)if(p[ea]instanceof g&&p[ea].getName()==ka){sa=p[ea];break a}sa=void 0}if((p=sa?sa.getEntities():null)&&0<p.length)for(ka=N.getEntityNumber(),ea=0;ea<p.length;ea++)if(ka==p[ea].getNumber()){va=p[ea];break}}else for(ea=0;ea<Ea.length;ea++)if(Ea[ea]instanceof g){sa=Ea[ea];break}},Ta=function(){Ma.empty();ya=new W;if(Ha&&0<Ha.length){if(!Ja){Ja=K.createTable();Ja.setColumnFitVisibleWidth(!0);
var p=new n(Ja);p.setOutsideVisible(!1);Ja.setCellRender(p);Ja.setSyncUIWhenModelChanged(!1);Ja.setDraggableAdjusting(!0,K.getHeadRowCount(),0,new B);Ja.addColumns(4);Ja.getColumn(0).setWidth(35);Ja.getColumn(1).setWidth(35);Ja.getColumn(2).setWidth(175);Ja.getColumn(3).setWidth(175);p=K.createHeadRow(Ja);p.getCell(1).setValue("#");p.getCell(2).setValue(u.get("name","\u540d\u79f0"));p.getCell(3).setValue(u.get("code","\u7f16\u7801"))}if(0!=document.body.clientHeight||0!=document.body.clientWidth){p=
$(Ja.getUI());m.layoutCtrlWithLRTB(p,0,0,null,33,0,null);p.appendTo(Ma);K.clearWithoutHead(Ja);for(var ka in Ha)K.createRow(Ja).setUserObject(Ha[ka]);K.refresh(Ja)}}else{ka=X||ra?new na(u.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")):new na(u.get("emptyEntity","\u6682\u65e0\u57fa\u7840\u8d44\u6599"));ka.setAlign(na.ALIGN_CENTER);ka=ka.getJqUi();ka.addClass("macro-entity-no-data-text");p=$("<div>");Z.background(p,"nodata");p.addClass("macro-entity-no-data-icon");
var ea=$("<div>");ea.css("padding-top","50px");ea.append(p);ea.append(ka);Ma.append(ea)}},Va=function(p,ka){ka&&p.isChecked()&&(va=p.getUserObject())},db=function(){if(Ea&&0<Ea.length)h&&h.hide(),Oa&&Oa.show(),cb(),ra?0>=Ga||M.appendText("("+Qa+"/"+Ga+")"):M.hideText();else{M.hideText();Oa&&Oa.hide();h&&h.show();var p=X||ra?u.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"):u.get("emptyApp","\u6682\u65e0\u5e94\u7528");e?e.setText(p):(e=new na(p),e.setAlign(na.ALIGN_CENTER),
h=e.getJqUi(),h.addClass("macro-app-no-data"),Aa.append(h))}},cb=function(){Ia||(Ia=new KTable,Ia.setColumnFitVisibleWidth(!0),Ia.setCellRender(new l(Ia)),Ia.setTreeHandlerRender(new k(Ia)),Ia.setSyncUIWhenModelChanged(!1),Ia.addColumns(1),Oa=$(Ia.getUI()),Oa.addClass("macro-app-tree-tabel"),Aa.append(Oa));if(0!=document.body.clientHeight||0!=document.body.clientWidth){Ia.removeAllRows();Xa={};var p=X||ra;if(Ea){var ka=sa.getParentNode(),ea=[];if(sa)for(var ma=ka.getChildren(),ta=0;ta<ma.length;ta++)ea.push(ma[ta].getName());
for(ta=0;ta<Ea.length;ta++){ma=Ea[ta];var Ka=Ia.addRow();Ka.setHeight(23);var Sa=Ka.getCell(0);Sa.setValue(ma);var Ua=ma.getSubNodeLevel(),Wa=new KTCellTreeModel(Ua);Wa.setExpanded(!1);var bb=p||0==Ua||-1<ea.indexOf(ma.getName()),$a=p||ka&&ka.getName()==ma.getName();ra&&!X&&(0==Ua?$a=ka.getName()==ma.getName()||0<Ra[ma.getName()]:bb=-1<ea.indexOf(ma.getName())||0<Ra[ma.getParentNode().getName()]);Ka.setHide(!bb);Wa.setExpanded($a);Sa.setTreeModel(Wa);Xa[ma.getName()]=Ka}}Ia.updateUI();sa&&(p=Xa[sa.getName()],
Ia.scrollCellVisible(Ia.getRowIndex(p),0,!1),p=Ia.keepScrollStatus(),p.h=0,Ia.restoreScrollStatus(p))}},jb=function(p){var ka=$(p.currentTarget);p=p.data.cellNode;if(!sa||sa.getName()!=p.getName()){ra&&(Qa=La[p.getName()],M.appendText("("+Qa+"/"+Ga+")"));sa=p;p=$(".macro-entity-app-list-item_selected");for(var ea in p)p.eq(ea).removeClass("macro-entity-app-list-item_selected");ka.addClass("macro-entity-app-list-item_selected");fb()}},hb=function(p){ra&&(-1!=p.getDisplayName().toUpperCase().indexOf(ra.toUpperCase())&&
(Ga++,Da.push(p)),La[p.getName()]=Ga);Ea.push(p);if(p instanceof J){for(var ka=Ga,ea=p.getChildren(),ma=0;ma<ea.length;ma++)hb(ea[ma]);Ra[p.getName()]=Ga-ka}},lb=function(p,ka,ea){gb(ka);var ma=$("<div>");ma.text(p);ma.addClass("macro-entity-app-selection-waiting");ma.css("top",ea);ma.appendTo(ka);return(new Date).getTime()},gb=function(p){p.find(".macro-entity-app-selection-waiting").remove()},kb=function(){da.protectedMethod.setTotalSelectedRowAndSelectedAllVisual(!1,!1);da.setJumpToPageListener(function(ka,
ea,ma){if(Ya){N=va=null;var ta=sa?sa.getEntities():[];Za=ta?ta.length:0;Ha=ib(ka,ea,ta);Ta()}ma?ma(Za):da.refreshPagination()});da.setComboBoxItemModelsAndSelectedItem([5,10,20,50,100,500,1E3],2);var p=da.getJqUi();p.css("display","block");Ba.append(p)},fb=function(){Ya&&(N=va=null);var p=sa?sa.getEntities():[];Za=p?p.length:0;da.resetPaginationAndJumpToFirstPage(Za);var ka=1,ea=da.getPageSize();if(!Ya&&va){for(var ma=0;ma<Za;ma++)if(p[ma].getNumber()==va.getNumber()){ma+=1;ka=parseInt(ma/ea);0!=
ma%ea&&ka++;break}1!=ka&&da.jumpToPage(ka)}Ha=ib(ka,ea,p);Ta();Ya||(Ya=!0)},ib=function(p,ka,ea){return ea&&0<ea.length?(p=(p-1)*ka,p+ka>=ea.length?ea.slice(p,ea.length):ea.slice(p,p+ka)):null}}function G(c){var n,l,k,a,b,t,r,M,X,za,ra=[],Ca,Aa,Ba,Ma=!1;this.setSelectedFieldName=function(S){S&&0<S.length&&(ra=S)};this.setDesignTimeEntity=function(S){S&&(za=S.getProperties(),Ba=S.getPkName())};this.getSelectedField=function(){return ra};this.getJqUi=function(){if(!n){n=$("<div>");t=new ba;t.addSearchListener(N);
t.setPlaceholder(u.get("fieldSearchBoxPlaceholder","\u641c\u7d22\u5b57\u6bb5\u540d\u79f0/\u5b57\u6bb5\u6807\u8bc6"));t.setShowSearchIcon(!0);b=t.getJqUi();b.css("width","230px");n.append(b);m.layoutCtrlWithLRTB(b,17,0,null,0,null,23);var S=new V;S.setText(u.get("showOnlySelected","\u4ec5\u663e\u793a\u9009\u4e2d\u9879"));S.addCheckedListener(da);S=S.getJqUi();n.append(S);m.layoutCtrlWithLRTB(S,325,null,140,0,null,23);r=new V;r.setText(u.get("selectAll","\u5168\u9009"));r.addCheckedListener(h);M=r.getJqUi();
m.layoutCtrlWithLRTB(M,17,0,null,33,0,23);n.append(M);k=new na;a=k.getJqUi();n.append(a);m.layoutCtrlWithLRTB(a,90,0,null,33,null,21);l=$("<div>");n.append(l);0>ra.indexOf(Ba)&&ra.push(Ba);e();Pa()}return n};var Pa=function(){l.empty();l.css("overflow","scroll");m.layoutCtrlWithLRTB(l,17,0,null,57,0,385);Aa=t.getText().trim()?Ca:za;Ma&&(Aa=Aa.filter(function(ya){return-1<ra.indexOf(ya.getName())}));var S=!1;if(Aa&&0==Aa.length)l.append(Ja());else{S=0;for(var pa in Aa){var va=Aa[pa],sa=va.getAlias(),
Ea=va.getName(),La=$("<div>");La.addClass("macro-entity-field-checkbox");var Ra=new V;Ra.setUserObject(va);va=Ra.getJqUi();va.addClass("macro-entity-field-checkbox-icon");va.attr("field-name-checkbox",I.encode(Ea));va.data("model",Ra);Ea==Ba?Ra.setEnabled(!1):(Ra.setEnabled(!0),Ra.addCheckedListener(Ia));var Ga=$("<div>"),Qa=$("<span>");Qa.text(sa);sa="("+Ea+")";var Da=$("<span>");Da.addClass("macro-entity-field-code-text");Da.text(sa);Ga.append(Qa);Ga.append(Da);Ga.addClass("macro-entity-field-checkbox-text");
La.append(va);La.append(Ga);Ea==Ba&&(va=new H,va.setIconType(H.ICON_TYPE_QUESTION),va.setTipsText(u.get("pkTips","PK\u4e3a\u57fa\u7840\u6570\u636e\u5b8f\u7684\u53d6\u503c\u5b57\u6bb5\uff0c\u5fc5\u987b\u52fe\u9009\u3002")),va=va.getJqUi(),va.addClass("macro-value-field-icon"),La.append(va));ra&&0<=ra.indexOf(Ea)&&(Ra.setChecked(!0),S++);l.append(La)}S=S==Aa.length}r.setChecked(S)},Ja=function(){if(!X){var S=(new na(u.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"))).getJqUi();
S.addClass("macro-property-no-data");var pa=$("<div>");Z.background(pa,"nodata");pa.addClass("macro-entity-no-data-icon");X=$("<div>");X.append(pa);X.append(S)}return X},Ia=function(S,pa){if(pa){pa=S.getUserObject();if(S.isChecked())ra||(ra=[]),ra.push(pa.getName());else for(var va in ra)ra[va]==pa.getName()&&ra.splice(va,1);if(S=S.isChecked())for(var sa in Aa)if(!Oa(Aa[sa]).isChecked()){S=!1;break}r.setChecked(S);e()}},Oa=function(S){return n.find("[field-name-checkbox='"+I.encode(S.getName())+"']").data("model")},
e=function(){var S=ra?ra.length:0;S=u.get("selectedCount","(\u5df2\u9009\u62e9 #1 \u9879)").replace("#1",S);k.setText(S)},h=function(S,pa){if(pa){for(var va in Aa)if(pa=Aa[va],pa.getName()!=Ba){Oa(pa).setChecked(S.isChecked());pa=pa.getName();var sa=0<=ra.indexOf(pa);S.isChecked()&&!sa?ra.push(pa):!S.isChecked()&&sa&&ra.splice(ra.indexOf(pa),1)}e()}},da=function(S,pa){Ma=S.isChecked();pa&&Pa()},N=function(S){S=t.getText().trim();Ca=[];if(S)for(var pa in za){var va=za[pa];(-1<va.getAlias().toUpperCase().indexOf(S.toUpperCase())||
-1<va.getName().toUpperCase().indexOf(S.toUpperCase()))&&Ca.push(za[pa])}Pa()}}"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.macro&&(com.kingdee.bos.qing.macro={});"undefined"==typeof com.kingdee.bos.qing.macro.entity&&(com.kingdee.bos.qing.macro.entity={});com.kingdee.bos.qing.macro.entity.EntityMacroTypeItem=
function(){Y.call(this,xa,u.get("entityMacro","\u57fa\u7840\u6570\u636e\u5b8f"));var c;this.setRemoteImpl=function(n){c=n};this.showCreateDialog=function(n){var l=new x(c);l.setCreateSuccessCallback(n);l.showDialog()};this.showEditDialog=function(n,l){var k=function(a){a=new F(c,l,a);a.setUpdateSuccessCallback(n);a.showDialog()};(new w(U.getMacroEntityRemote(),function(a){if(a){var b=new E;b.fromJsonObject(a)}k(b);return!0},function(a,b){k(null);return!1})).getDesignTimeEntity(l.getEntityPath())}};
var xa="ENTITY",Y,ha,w,C,U,z,B,D,E,aa,J,g,Z,la,u,ia,d,oa,na,H,Na,R,fa,ba,q,O,W,V,y,v,m,I,K;(function(){var c=com.kingdee.bos.qing.macro;ha=c.PreviewDialog;C=c.MacroFacade;w=c.MacroEntityFacade;U=c.MacroRemoteHelper;Z=c.Icons;la=c.MacroFactory;z=c.EntityHelper;B=c.DraggableAdjustingCustomExpandor;c=com.kingdee.bos.qing.macro.model;D=c.EntityMacro;E=c.DesignTimeEntity;aa=c.MacroStatusEnum;J=c.FolderNode;g=c.AppLeafNode;Y=c.AbstractMacroTypeItem;c=com.kingdee.bos.qing.framework.common;u=c.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.macro);
ia=c.WindowResizeObserver;c=com.kingdee.bos.qing.ui.component;d=c.AbstractModalDialog;oa=c.MessageDialog;na=c.Label;H=c.HelpIcon;Na=c.TextField;R=c.ComboBox;fa=c.F7Selector;ba=c.SearchBox;q=c.SplitPane;O=c.RadioButton;W=c.RadioButtonGroup;V=c.CheckBox;c=com.kingdee.bos.qing.common;m=c.DomUtil;I=c.Base32Util;c=com.kingdee.bos.qing.biz.common;v=c.ComplexPaginationBar;y=c.KeyBoardSearchBox;c=com.kingdee.bos.qing.common.ui;K=c.TableUtil})();la.registerConstructor(xa,D);var L=function(){var c=new H;c.setIconType(H.ICON_TYPE_QUESTION);
c.setTipsText(u.get("entityMacroTips","\u4f7f\u7528\u4e00\u4e2a\u57fa\u7840\u8d44\u6599\u4f5c\u4e3a\u57fa\u7840\u6570\u636e\u5b8f\u7684\u6570\u636e\u6765\u6e90\u3002\n\u57fa\u7840\u6570\u636e\u5b8f\u7684\u6570\u636e\u67e5\u8be2\u8303\u56f4\u53d7\u5b57\u6bb5\u6743\u9650\u3001\u6570\u636e\u89c4\u5219\u3001\u7279\u6b8a\u6570\u636e\u6743\u9650\u3001\u57fa\u7840\u6570\u636e\u7ba1\u63a7\u7b56\u7565\u5171\u540c\u63a7\u5236\u3002"));c=c.getJqUi();c.addClass("macro-entity-tips-icon");$(".sa-ctrl-dialog-title:first").append(c)},
A=function(c,n,l){if(n&&l){n=n.toUpperCase();var k=l.toUpperCase(),a=k.split(n),b=n.length,t;for(t in a){var r=k.indexOf(a[t]),M=l.substr(za,a[t].length);r+=a[t].length;var X=k.length-r;k=k.substr(r,X);l=l.substr(r,X);r=$("<span>");r.text(M);r.appendTo(c);if(t!=a.length-1&&1<a.length){var za=k.indexOf(n);M=l.substr(za,b);r=za+b;X=k.length-r;k=k.substr(r,X);l=l.substr(r,X);r=$("<span>");r.text(M);r.css("color","red");r.clone().appendTo(c)}}}else c.text(l)}})();(function(){"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.macro&&(com.kingdee.bos.qing.macro={});var x=com.kingdee.bos.qing.macro;x.MacroInfoPanel=function(){function B(q){KTDefaultCellRender.call(this,q);var O=this;C.getImpl(C.SYS_VAR_HELPER);var W=this.paintCellUI;this.paintCellUI=function(V,y){var v=
O.getCurrentRowIdx(),m=O.getCurrentRow(),I=O.getCurrentColIdx();m=m.getUserObject();if(v<T.getHeadRowCount())W(V,y),0==I&&1==v&&(I=u&&u.isChecked()?!0:!1,u=new Y,u.setChecked(I),u.addCheckedListener(function(A,c){if(c){if(c=A.isChecked())for(var n in ia)d[n]=1,ia[n].setChecked(c);else for(n in ia)delete d[n],ia[n].setChecked(c);ba(A)}}),u.addCheckedListener(ba),m=u.getJqUi(),P.layoutCtrl(m,12,2,23,23),m.appendTo(V));else if(0==I){y=m.getFid();v=new Y;I=!1;if(fa)for(var K=Object.keys(d),L=0;L<K.length;L++){if(y===
K[L]){I=!0;break}}else I=(I=ia[y])&&I.isChecked();v.setChecked(I);v.setUserObject(m);v.addCheckedListener(ba);v.addCheckedListener(function(A,c){if(c){c=A.isChecked();var n=A.getUserObject().getFid();ia[n].setChecked(c);if(c){d[n]=1;ba(A);for(var l in ia)if(!ia[l].isChecked())return}else delete d[n],ba(A);u.setChecked(c)}});ia[y]=v;m=v.getJqUi();P.layoutCtrl(m,12,4,23,23);m.appendTo(V)}else 1==I?(v=$("<div>"),v.addClass("macro-tabel-cell-content"),I=$("<span class='macro-db-connection-warning'>"),
I.text("!"),y=m.getStatusWarning(),I.attr("title",y),K=$("<span>"),m=m.getUid(),K.attr("title",m),z(K,la,m),y&&v.append(I),v.append(K),v.appendTo(V)):2==I?(y=$("<div>"),m=m.getName(),y.attr("title",m),y.addClass("macro-tabel-cell-content"),z(y,la,m),y.appendTo(V)):3==I?(y=$("<div>"),y.text(m.getTypeText()),y.addClass("macro-tabel-cell-content"),y.appendTo(V)):5==I?(y=$("<div>"),m=m.getDesc()?m.getDesc():f.get("noDesc","\u6682\u65e0\u63cf\u8ff0"),y.attr("title",m),y.addClass("macro-tabel-cell-content"),
z(y,la,m),y.appendTo(V)):4==I?(y=$("<div>"),v=m.isMultiValued()?f.get("multiValued","\u591a\u503c"):f.get("singleValued","\u5355\u503c"),y.text(v),y.attr("title",v),y.addClass("macro-tabel-cell-content"),y.appendTo(V)):6==I?(I=$("<div>"),v=m.getContentText(),y=m.getTipsText(),I.text(v),I.attr("title",y),I.addClass("macro-tabel-cell-content"),I.appendTo(V)):7==I?(y=$("<div>"),m=m.getCreatorName(),y.text(m),y.attr("title",m),y.addClass("macro-tabel-cell-content"),y.appendTo(V)):8==I?(y=$("<div>"),v=
m.getCreateFormatTime(),y.text(v),y.attr("title",v),y.addClass("macro-tabel-cell-content"),y.appendTo(V)):9==I?(y=$("<div>"),m=m.getModifierName(),y.text(m),y.attr("title",m),y.addClass("macro-tabel-cell-content"),y.appendTo(V)):10==I&&(y=$("<div>"),v=m.getModifyFormatTime(),y.text(v),y.attr("title",v),y.addClass("macro-tabel-cell-content"),y.appendTo(V))}}var D=this,E,aa,J,g=[],Z,la,u,ia={},d={},oa,na;this.setItemCheckedCallback=function(q){na=q};this.setSelectedMacroId=function(q){d={};if(void 0!==
q&&null!==q&&0<q.length)for(var O=0;O<q.length;O++)d[q[O]]=1;D.updateUi()};this.getJqUi=function(){E||(E=$("<div>"),P.layoutCtrlWithLRTB(E,0,0,null,32,0,null),H()?R():Na());return E};this.resize=function(){aa&&D.updateUi()};this.updateUi=function(){if(H()){J&&J.show();aa||R();if(0!=document.body.clientHeight&&0!=document.body.clientWidth){fa=!0;ia={};T.clearWithoutHead(aa);W=0;for(len=g.length;W<len;W++){var q=g[W];q.getUiDisplay()&&T.createRow(aa).setUserObject(q)}T.refresh(aa);q=0;for(var O=Object.keys(ia),
W=0;W<O.length;W++)ia[O[W]].isChecked()&&q++;W=0<q&&q===Object.keys(ia).length;O=Object.keys(d).length;na&&na(q,O);u&&u.setChecked(W);fa=!1}Z&&Z.hide()}else Z||Na(),q=("undefined"===typeof la||null===la||0===la.length?g&&0<g.length:1)?f.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"):f.get("neverCreateMacro","\u6682\u672a\u521b\u5efa\u5b8f\uff0c\u8bf7\u70b9\u51fb\u65b0\u5efa\u6309\u94ae\u8fdb\u884c\u521b\u5efa\u3002"),oa.text(q),Z.show(),J&&J.hide()};this.setRemoteImpl=
function(q){};this.setMacroModels=function(q){g=q;D.updateUi()};this.removeMacroModel=function(q){for(var O=[],W=0;W<g.length;W++){for(var V=!1,y=g[W],v=0;v<q.length;v++)if(y.getFid()==q[v].getFid()){V=!0;break}V||O.push(y)}g=O;D.updateUi()};this.addMacroModel=function(q){g.unshift(q);D.updateUi()};this.getSelectedMacroIds=function(){return Object.keys(d)};this.getSelectedMacrosOnCurrentPage=function(){for(var q=[],O=Object.keys(ia),W=0,V=O.length;W<V;W++){var y=O[W];if(ia[y].isChecked())for(var v=
0;v<g.length;v++){var m=g[v];y===m.getFid()&&q.push(m)}}return q};this.unsetDBConnection=function(q){q=q.getId();for(var O=0;O<g.length;O++){var W=g[O],V=W.getDBInfo();V&&V.getId()===q&&W.setDBInfo(null)}D.updateUi()};var H=function(){for(var q=0;q<g.length;q++)if(g[q].getUiDisplay())return!0;return!1},Na=function(){Z=$("<div>");oa=$("<div>");oa.text(f.get("neverCreateMacro","\u6682\u672a\u521b\u5efa\u5b8f\uff0c\u8bf7\u70b9\u51fb\u65b0\u5efa\u6309\u94ae\u8fdb\u884c\u521b\u5efa\u3002"));oa.appendTo(Z);
P.layoutCtrlCenterAlign(oa,500);oa.addClass("macro-no-data-prompt");var q=$("<div>");x.Icons.background(q,"nodata");q.appendTo(Z);P.layoutCtrlCenterAlign(q,220);q.addClass("macro-no-data-icon");Z.appendTo(E)};this.searchKeyAndUpdateUi=function(q){la=q};var R=function(){if(E){aa=T.createTable();aa.setColumnFitVisibleWidth(!0);aa.setDraggableAdjusting(!0,T.getHeadRowCount(),0,new F);var q=new B(aa);q.setOutsideVisible(!1);aa.setCellRender(q);aa.setSyncUIWhenModelChanged(!0);aa.addColumns(11);aa.getColumn(0).setWidth(40);
aa.getColumn(1).setWidth(60);aa.getColumn(2).setWidth(100);aa.getColumn(5).setWidth(150);aa.getColumn(4).setWidth(60);aa.getColumn(6).setWidth(360);aa.getColumn(7).setWidth(60);aa.getColumn(8).setWidth(120);aa.getColumn(9).setWidth(60);aa.getColumn(10).setWidth(120);aa.getColumn(3).setWidth(60);q=T.createHeadRow(aa);q.getCell(1).setValue(f.get("code","\u7f16\u7801"));q.getCell(2).setValue(f.get("name","\u540d\u79f0"));q.getCell(5).setValue(f.get("desc","\u63cf\u8ff0"));q.getCell(4).setValue(f.get("returnValueType",
"\u8fd4\u56de\u503c"));q.getCell(6).setValue(f.get("content","\u5185\u5bb9"));q.getCell(7).setValue(f.get("creator","\u521b\u5efa\u4eba"));q.getCell(8).setValue(f.get("createtime","\u521b\u5efa\u65f6\u95f4"));q.getCell(9).setValue(f.get("modifier","\u6700\u540e\u4fee\u6539\u4eba"));q.getCell(10).setValue(f.get("modifytime","\u6700\u540e\u4fee\u6539\u65f6\u95f4"));q.getCell(3).setValue(f.get("type","\u7c7b\u578b"));J=$(aa.getUI());P.layoutCtrlWithLRTB(J,0,0,null,0,0,null);J.appendTo(E)}},fa=!1,ba=
function(q){q=0;for(var O=Object.keys(ia),W=0;W<O.length;W++)if(ia[O[W]].isChecked()){q++;break}O=Object.keys(d).length;na&&na(q,O)}};x.UploadPane=function(B){function D(R){ha.call(this);var fa=this,ba=this.protectedMethod,q,O,W,V;(function(){ba.setTitle(f.get("importMacro","\u5bfc\u5165\u5b8f"));fa.setSize(640,480);ba.setContentPaneCreator(function(){q||(q=new E,O&&q.setModel(O),W&&q.setImportResult(W));return q.getJqUi()});ba.setClosingChecker2(function(y){(y=q.getOverwriteMacro())&&0<y.length&&
(new U(R,function(v){V()},function(v,m){return"1200009"==v?(g.showPrompt(f.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):!1})).importMacros(y,"overwrite");ba.destroy();return!0},function(y){ba.destroy();return!0});ba.setClosingAction(function(y){})})();this.setModel=function(y){O=y;q&&q.setModel(y)};this.setImportResult=function(y){W=y;q&&q.setImportResult(W)};this.setImportSuccessCallback=function(y){V=y};this.resize=function(){q&&q.resize()}}function E(){function R(A){KTDefaultCellRender.call(this,
A);var c=this,n=this.paintCellUI;this.paintCellUI=function(l,k){var a=c.getCurrentRowIdx(),b=c.getCurrentRow(),t=c.getCurrentColIdx();b=b.getUserObject();a<T.getHeadRowCount()?n(l,k):0==t?(k=$("<div>"),b=b.getUid(),k.text(b),k.attr("title",b),k.addClass("macro-tabel-cell-content"),k.appendTo(l)):1==t?(k=$("<div>"),k.text(b.getName()),k.attr("title",b.getName()),k.addClass("macro-tabel-cell-content"),k.appendTo(l)):2==t?(k=$("<div>"),b=b.getDesc()?b.getDesc():f.get("noDesc","\u6682\u65e0\u63cf\u8ff0"),
k.text(b),k.attr("title",b),k.addClass("macro-tabel-cell-content"),k.appendTo(l)):3==t&&(k=a-T.getHeadRowCount(),a=y[k],l=T.createCtrlInCell(l,c.getCellWidth(),c.getCellHeight(),xa),l.setItemModels(["ignore","overwrite"]),a?l.setSelected(a.getSelected()):l.setSelected("ignore"),l.setUserObject(b),l.setCustomPainter(function(r,M,X){switch(X){case "ignore":r=f.get("ignore","\u5ffd\u7565");break;case "overwrite":r=f.get("overwrite","\u8986\u76d6");break;default:r=""}X=$("<div>");X.text(r);X.appendTo(M)}),
y[k]=l)}}var fa,ba,q,O,W,V,y=[];this.getJqUi=function(){fa||m();return fa};this.setModel=function(A){q=A;I()};this.setImportResult=function(A){O=A};this.getOverwriteMacro=function(){for(var A=[],c=0,n=y.length;c<n;c++){var l=y[c];"overwrite"==l.getSelected()&&A.push(l.getUserObject())}return A};this.resize=function(){K()};var v=function(A,c,n){var l=$("<div>");l.text(A);l.addClass("macro-import-conflict-all-operate");l.on("click",n);c&&(A=$("<div>"),A.addClass("macro-import-conflict-btn-split-line"),
A.appendTo(l));return l},m=function(){fa=$("<div>");V=new G;var A=v(f.get("allIgnore","\u5168\u90e8\u5ffd\u7565"),!0,function(){for(var c=0,n=y.length;c<n;c++)y[c].setSelected("ignore")});P.layoutCtrl(A,0,30,50,23);A.appendTo(fa);A=v(f.get("allOverwrite","\u5168\u90e8\u8986\u76d6"),!1,function(){for(var c=0,n=y.length;c<n;c++)y[c].setSelected("overwrite")});P.layoutCtrl(A,80,30,50,23);A.appendTo(fa);ba||L();I()},I=function(){if(q&&O){var A=V.getJqUi();P.layoutCtrl(A,0,0,400,20);A.appendTo(fa);A=f.get("conflictHandlePrompt",
"\u6210\u529f\u5bfc\u5165#1\u4e2a\u5b8f\u3002\u4ee5\u4e0b\u5b8f\u7f16\u7801\u51b2\u7a81\uff0c\u8bf7\u5904\u7406\u3002").replace("#1",O.getSuccessCount());V.setText(A);K()}},K=function(){W||L();if(0!=document.body.clientHeight&&0!=document.body.clientWidth){T.clearWithoutHead(W);for(var A=0,c=q.length;A<c;A++){var n=q[A];T.createRow(W).setUserObject(n)}T.refresh(W)}},L=function(){W=T.createTable();T.bindTableListenerForCtrl(W);W.setColumnFitVisibleWidth(!1);W.setDraggableAdjusting(!0,T.getHeadRowCount(),
0,new F);var A=new R(W);A.setOutsideVisible(!1);W.setCellRender(A);W.setSyncUIWhenModelChanged(!0);W.addColumns(4);W.getColumn(0).setWidth(110);W.getColumn(1).setWidth(140);W.getColumn(2).setWidth(250);W.getColumn(3).setWidth(100);A=T.createHeadRow(W);A.getCell(0).setValue(f.get("code","\u7f16\u7801"));A.getCell(1).setValue(f.get("name","\u540d\u79f0"));A.getCell(2).setValue(f.get("desc","\u63cf\u8ff0"));A.getCell(3).setValue(f.get("handleStrategy","\u5904\u7406\u7b56\u7565"));ba=$(W.getUI());P.layoutCtrlWithLRTB(ba,
0,0,null,64,0,null);ba.appendTo(fa)}}function aa(R){ha.call(this);var fa=this,ba=this.protectedMethod,q,O,W,V;(function(){ba.setTitle(f.get("importMacro","\u5bfc\u5165\u5b8f"));fa.setSize(640,480);ba.setContentPaneCreator(function(){q||(q=new J,O&&q.setModel(O));return q.getJqUi()});ba.setClosingChecker2(function(y){y=q.getSelectedModel();0==y.length?ba.getMessageCurtain().showPrompt(f.get("noImportMacroSelected","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b8f\u3002")):(new U(R,function(v){var m=
new w;m.fromJsonObject(v);if(m.isAllSuccess())W();else{v=m.getConflictUids();for(var I=[],K=0,L=v.length;K<L;K++)for(var A=v[K],c=0,n=O.length;c<n;c++){var l=O[c];l.getUid()==A&&I.push(l)}V=new D(R);V.setImportResult(m);V.showDialog();V.setModel(I);V.setImportSuccessCallback(W)}ba.destroy();return!0},function(v,m){return"1200009"==v?(g.showPrompt(f.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):!1})).importMacros(y)},function(y){ba.destroy();return!0});
ba.setClosingAction(function(y){})})();this.setModel=function(y){O=y;q&&q.setModel(y)};this.setOuterMessageCurtain=function(y){};this.setImportSuccessCallback=function(y){W=y};this.resize=function(){q&&q.resize();V&&V.resize()}}function J(){function R(m){KTDefaultCellRender.call(this,m);var I=this;C.getImpl(C.SYS_VAR_HELPER);var K=this.paintCellUI;this.paintCellUI=function(L,A){var c=I.getCurrentRowIdx(),n=I.getCurrentRow(),l=I.getCurrentColIdx();n=n.getUserObject();c<T.getHeadRowCount()?(K(L,A),
0==l&&1==c&&(l=V&&V.isChecked()?!0:!1,V=new Y,V.setChecked(l),V.addCheckedListener(function(k,a){if(a){a=0;for(var b=W.length;a<b;a++)W[a].setChecked(k.isChecked())}}),n=V.getJqUi(),P.layoutCtrl(n,12,2,23,23),n.appendTo(L))):0==l?(A=new Y,c-=T.getHeadRowCount(),l=(l=W[c])&&l.isChecked(),W[c]=A,A.setChecked(l),A.setUserObject(n),A.addCheckedListener(function(k,a){if(a)if(k.isChecked()){k=0;for(a=W.length;k<a;k++)if(!W[k].isChecked())return;V.setChecked(!0)}else V.setChecked(!1)}),n=A.getJqUi(),P.layoutCtrl(n,
12,4,23,23),n.appendTo(L)):1==l?(c=$("<div>"),n=n.getUid(),c.text(n),c.attr("title",n),c.addClass("macro-tabel-cell-content"),c.appendTo(L)):2==l?(c=$("<div>"),c.text(n.getName()),c.attr("title",n.getName()),c.addClass("macro-tabel-cell-content"),c.appendTo(L)):4==l?(c=$("<div>"),n=n.getDesc()?n.getDesc():f.get("noDesc","\u6682\u65e0\u63cf\u8ff0"),c.text(n),c.attr("title",n),c.addClass("macro-tabel-cell-content"),c.appendTo(L)):5==l?(c=$("<div>"),n=n.isMultiValued()?f.get("multiValued","\u591a\u503c"):
f.get("singleValued","\u5355\u503c"),c.text(n),c.attr("title",n),c.addClass("macro-tabel-cell-content"),c.appendTo(L)):3==l&&(c=$("<div>"),n=n.getTypeText(),c.text(n),c.addClass("macro-tabel-cell-content"),c.appendTo(L))}}var fa,ba,q,O,W=[],V;this.getJqUi=function(){fa||(fa=$("<div>"),ba||v(),ba.appendTo(fa));return fa};this.setModel=function(m){q=m;y()};this.getSelectedModel=function(){for(var m=[],I=0,K=W.length;I<K;I++){var L=W[I];L.isChecked()&&m.push(L.getUserObject())}return m};this.resize=
function(){y()};var y=function(){O||v();if(0!=document.body.clientHeight&&0!=document.body.clientWidth){T.clearWithoutHead(O);for(var m=0,I=q.length;m<I;m++){var K=q[m];T.createRow(O).setUserObject(K)}T.refresh(O)}},v=function(){O=T.createTable();O.setColumnFitVisibleWidth(!0);O.setDraggableAdjusting(!0,T.getHeadRowCount(),0,new F);var m=new R(O);m.setOutsideVisible(!1);O.setCellRender(m);O.setSyncUIWhenModelChanged(!0);O.addColumns(6);O.getColumn(0).setWidth(40);O.getColumn(1).setWidth(60);O.getColumn(2).setWidth(80);
O.getColumn(4).setWidth(120);O.getColumn(5).setWidth(80);O.getColumn(3).setWidth(80);m=T.createHeadRow(O);m.getCell(1).setValue(f.get("code","\u7f16\u7801"));m.getCell(2).setValue(f.get("name","\u540d\u79f0"));m.getCell(4).setValue(f.get("desc","\u63cf\u8ff0"));m.getCell(5).setValue(f.get("returnValueType","\u8fd4\u56de\u503c"));m.getCell(3).setValue(f.get("type","\u7c7b\u578b"));ba=$(O.getUI());P.layoutCtrlWithLRTB(ba,0,0,null,0,0,null);ba.appendTo(fa)}}var g,Z,la,u,ia,d;this.createJqUi=function(R,
fa){g=fa;fa=$("<div>");fa.addClass("macro-importing-exporting-main");var ba=$(document.body),q=$("<div class='sa-ctrl-modallayer'>");q.appendTo(ba);Z=$("<progress value='0' max='100'>");Z.addClass("macro-importing-upload-progress");var O=$("<div>");O.addClass("macro-importing-exporting-text");O.text(f.get("uploading","\u6b63\u5728\u4e0a\u4f20\u4e2d\uff0c\u8bf7\u7a0d\u5019"));fa.append(Z);fa.append(O);ba.append(fa);d&&d.unobserve();d=new ja;d.setDelay(50);d.setCallback(function(){ia&&ia.resize()});
d.observe();oa(R,fa,q)};this.setUploadSuccessCallback=function(R){la=R};this.setUploadFailedCallback=function(R){u=R};var oa=function(R,fa,ba){var q=new FormData;q.append("filename",R);R=new XMLHttpRequest;R.upload.addEventListener("progress",na,!1);R.addEventListener("error",H,!1);var O=com.kingdee.bos.qing.framework.common.RemoteFrameworkRegister.getUploadUrl();R.open("post",O,!0);R.onload=function(W){200==this.status&&(W=JSON.parse(this.response),"number"==typeof W.errorCode&&3099003==W.errorCode?
g.showError(W.errorMessage):Na(W.data),fa.remove(),ba.remove())};R.send(q)},na=function(R){var fa=Z.get(0);R.lengthComputable&&(fa.max=R.total,fa.value=R.loaded)},H=function(R){u&&u(f.get("uploadFail","\u4e0a\u4f20\u5931\u8d25"))},Na=function(R){var fa=new U(B,function(ba){for(var q=[],O=0,W=ba.length;O<W;O++){var V=x.MacroFactory.getMacroInstance(ba[O].type);V.fromJsonObject(ba[O]);q.push(V)}0==q.length?g.showPrompt(f.get("noOptionalMacro","\u672a\u627e\u5230\u53ef\u5bfc\u5165\u5b8f\u3002")):(ia=
new aa(B),ia.showDialog(),ia.setModel(q),ia.setImportSuccessCallback(la))},function(ba,q){return 1200009==ba?(g.showPrompt(f.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):!1});fa.setShowBlocking(!0);fa.getOptionalImportMacro(R)}};var F=x.DraggableAdjustingCustomExpandor,P,T,f,ja,G,xa,Y,ha,w,C,U;(function(){var B=com.kingdee.bos.qing.common;P=B.DomUtil;B=com.kingdee.bos.qing.ui.component;G=B.Label;Y=B.CheckBox;xa=B.ComboBox;ha=B.AbstractModalDialog;B=com.kingdee.bos.qing.framework.common;
f=B.MultilanguageManager.createPackageAccessor(x);ja=B.WindowResizeObserver;B=com.kingdee.bos.qing.common.ui;T=B.TableUtil;B=com.kingdee.bos.qing.macro.model;w=B.ImportResult;B=com.kingdee.bos.qing.data;C=B.VariateHelperFactory;B=com.kingdee.bos.qing.macro;U=B.MacroFacade})();var z=function(B,D,E){if(D&&E){D=D.toUpperCase();var aa=E.toUpperCase(),J=aa.split(D),g=D.length,Z;for(Z in J){var la=aa.indexOf(J[Z]),u=E.substr(d,J[Z].length);la+=J[Z].length;var ia=aa.length-la;aa=aa.substr(la,ia);E=E.substr(la,
ia);la=$("<span>");la.text(u);la.appendTo(B);if(Z!=J.length-1&&1<J.length){var d=aa.indexOf(D);u=E.substr(d,g);la=d+g;ia=aa.length-la;aa=aa.substr(la,ia);E=E.substr(la,ia);la=$("<span>");la.text(u);la.css("color","red");la.clone().appendTo(B)}}}else B.text(E)}})();(function(){function x(J){var g,Z,la,u=new ja,ia=new B,d,oa,na,H,Na,R,fa=new aa,ba=[];this.createJqUi=function(){g=$("<div class='macro-main'>");ia.addMenuButton(m,"btn_create",Y.get("create","\u65b0\u5efa"));H=ia.addButton(L,"btn_edit",Y.get("edit","\u7f16\u8f91"));Na=ia.addButton(A,"btn_preview",Y.get("preview","\u9884\u89c8"));na=ia.addButton(K,"btn_delete",Y.get("del","\u5220\u9664"));ia.addButton(n,"btn_import",Y.get("import","\u5bfc\u5165"));R=ia.addButton(c,"btn_export",Y.get("export","\u5bfc\u51fa"));
ia.addButton(I,"btn_refresh",Y.get("refresh","\u5237\u65b0"));na.setEnabled(!1);H.setEnabled(!1);Na.setEnabled(!1);R.setEnabled(!1);W();g.append(ia.getJqUi());Z=$("<div class='macro-main-panel'>");g.append(Z);q();y();v();u.getJqUi().appendTo(g);return g};this.registerDataCenterSelectorConstructor=function(a){};this.registerSuperQuerySelectorConstructor=function(a){};this.registerMacroTypeItem=function(a){ba.push(a)};this.resize=function(){la&&la.resize()};this.addToolbarButton=function(a,b,t){return ia.addButtonForTailCustom(a,
b,t)};var q=function(){fa.setJumpToPageListener(function(a,b,t){(new D(J,function(r){O(r,t)})).loadMacros(a,b,oa)});fa.setSelectedAllOrNotListener(function(a,b){a?(new D(J,function(t){la.setSelectedMacroId(t);b(t.length)})).loadAllMacroIds(oa):la.setSelectedMacroId(null)});fa.setComboBoxItemModelsAndSelectedItem([5,10,20,50,100,500,1E3],2);Z.append(fa.getJqUi())},O=function(a,b){la.getJqUi().appendTo(Z);b?b(a.totalRow):fa.refreshPagination();a=a.macros;b=fa.getJqUi();a&&0<a.length?b.show():b.hide();
b=[];for(var t=0,r=a.length;t<r;t++){var M=F.MacroFactory.getMacroInstance(a[t].type);M.fromJsonObject(a[t]);b.push(M)}la.setMacroModels(b)},W=function(a){d=new xa;d.addSearchListener(V);d.setSearchListenerDelay(1E3);d.setPlaceholder(Y.get("searchBoxPlaceholder","\u641c\u7d22\u7f16\u7801/\u540d\u79f0/\u63cf\u8ff0"));d.setShowSearchIcon(!0);var b=d.getJqUi();b.addClass("macro-search-box");a=b.find(":input");a.focus(function(){b.css({width:"360px"})});a.blur(function(){b.css({width:"180px"})});b.appendTo(ia.getJqUi())},
V=function(a){a=new D(J,function(b){la.setSelectedMacroId(null);fa.refreshSelectedRowTotal(0);O(b,fa.resetPaginationAndJumpToFirstPage)});oa=d.getText().trim();la.searchKeyAndUpdateUi(oa);a.loadMacros(1,fa.getPageSize(),oa)},y=function(){la=new z;la.setItemCheckedCallback(function(a,b){fa.refreshSelectedRowTotal(b);na&&H&&Na&&R&&(0>=a&&0>=b?(na.setEnabled(!1),R.setEnabled(!1),H.setEnabled(!1),Na.setEnabled(!1)):1===a&&1===b?(na.setEnabled(!0),R.setEnabled(!0),H.setEnabled(!0),Na.setEnabled(!0)):(na.setEnabled(!0),
R.setEnabled(!0),H.setEnabled(!1),Na.setEnabled(!1)))});(new D(J,function(a){O(a,fa.resetPaginationAndJumpToFirstPage)})).loadMacros(1,fa.getPageSize())},v=function(){0==C.SUPPORTED_VAR_TYPE.length&&(new D(J,function(a){0<a.length&&C.VARIANTTYPEENUM.forEach(function(b){a.forEach(function(t){b.getTypeID()==t&&C.SUPPORTED_VAR_TYPE.push(b)})})})).getSupportedSystemVarType()},m=function(){var a=new T,b=function(){(new D(J,function(M){O(M,fa.resetPaginationAndJumpToFirstPage)})).loadMacros(1,fa.getPageSize());
u.showSuccess(Y.get("saveSuccess","\u4fdd\u5b58\u6210\u529f\u3002"))};if(ba&&0<ba.length)for(var t=0;t<ba.length;t++){var r=new f(function(M){var X=M.getUserObject();k(function(){X.showCreateDialog(b)})});r.setText(ba[t].getTypeName());r.setUserObject(ba[t]);a.addItemModel(r)}return a},I=function(){(new D(J,function(a){la.setSelectedMacroId(null);fa.refreshSelectedRowTotal(0);O(a)})).loadMacros(fa.getCurrentPage(),fa.getPageSize(),oa)},K=function(){var a=la.getSelectedMacroIds();a&&0!=a.length&&(new D(J,
function(b){var t=Y.get("confirmDelMacro","\u6240\u9009\u5b8f\u5220\u9664\u540e\u65e0\u6cd5\u6062\u590d\uff0c\u786e\u5b9a\u5220\u9664\uff1f");0<b&&(t+=Y.get("selectedMacroReferred","\u6240\u9009\u5b8f\u5df2\u88ab\u5f15\u7528#1\u6b21\u3002").replace("#1",b));b=G.createFeedbackDialog();b.setOptionType(G.OPTION_OK_CANCEL);b.setMsgImageType(G.MSG_DELETE);b.setMessage(t);b.setClosingChecker(function(r){r==G.RETURN_OK&&(new D(J,function(){u.showSuccess(Y.get("deleteSuccess","\u5220\u9664\u6210\u529f\u3002"));
(new D(J,function(M){la.setSelectedMacroId(null);fa.refreshSelectedRowTotal(0);O(M,fa.resetPaginationAndJumpToFirstPage)})).loadMacros(1,fa.getPageSize(),oa)},function(M,X){return"1200009"===M?(u.showPrompt(Y.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):!1})).deleteMacros(a);return!0});b.showDialog()})).loadMacrosRefTimeByFIds(a)},L=function(){k(function(a){var b=la.getSelectedMacrosOnCurrentPage();if(b&&0!=b.length)if(1<b.length)u.showPrompt(Y.get("singleRowAllowed",
"\u8bf7\u9009\u62e9\u5355\u4e2a\u5b8f\u8fdb\u884c#1\u3002").replace("#1",Y.get("edit","\u7f16\u8f91")));else{var t=function(){u.showSuccess(Y.get("editSuccess","\u7f16\u8f91\u6210\u529f\u3002"));I()};a=new D(J,function(r){var M=F.MacroFactory.getMacroInstance(r.type);M.fromJsonObject(r);a:{r=M.getType();if(ba&&0<ba.length)for(var X=0;X<ba.length;X++)if(r===ba[X].getMacroType()){r=ba[X];break a}r=void 0}r.showEditDialog(t,M)});b=b[0];a.checkPermissionBeforeEdit(b,b.getType())}})},A=function(){var a=
la.getSelectedMacrosOnCurrentPage();a&&0!=a.length&&(1<a.length?u.showPrompt(Y.get("singleRowAllowed","\u8bf7\u9009\u62e9\u5355\u4e2a\u5b8f\u8fdb\u884c#1\u3002").replace("#1",Y.get("preview","\u9884\u89c8"))):(a=a[0])&&a.isUsable()?(new U(J,a)).showDialog():(a=new G,a.setTitle(Y.get("previewFailed","\u9884\u89c8\u5931\u8d25")),a.setOptionType(G.RETURN_OK),a.setMessage(Y.get("macroCannotExe","\u8be5\u5b8f\u65e0\u6cd5\u6b63\u5e38\u6267\u884c\uff0c\u8bf7\u68c0\u67e5\u5b8f\u4fe1\u606f\u662f\u5426\u6b63\u786e\u3002")),
a.showDialog()))},c=function(){var a=la.getSelectedMacroIds();a&&0!==a.length&&(new D(J,function(b){var t="Qing-"+(new Date).getTime()+".qing-macro";w.downloadFile(t,b)},function(b){return"1200003"==b?(u.showPrompt(Y.get("macroNotFound","\u5b8f\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),I(),!0):"1200009"==b?(u.showPrompt(Y.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):!1})).exportMacros(a)},n=function(){var a=$("<input type='file' id='uploadBtn'>");
a.addClass("import-theme-file");a.attr("accept",[".qing-macro"]);a.on("change",function(b){if(b=b.currentTarget.files[0]){var t=b.name,r=b.size,M=t.lastIndexOf(".");t=t.substring(M+1,t.length).toLowerCase();g.find("#uploadBtn").val("");"qing-macro"!==t?u.showPrompt(Y.get("fileTypeIncorrect","\u6587\u4ef6\u7c7b\u578b\u4e0d\u6b63\u786e\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002"),2E3):0===r?u.showPrompt(Y.get("uploadFileIsNull","\u4e0a\u4f20\u7684\u6587\u4ef6\u4e3a\u7a7a\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002"),
2E3):104857600<=r?u.showPrompt(Y.get("fileTooLarge","\u6587\u4ef6\u592a\u5927\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002"),2E3):(r=new E(J),r.createJqUi(b,u),r.setUploadSuccessCallback(l))}a.val("")});a.click()},l=function(){u.showSuccess(Y.get("importSuccess","\u5bfc\u5165\u6210\u529f\u3002"));(new D(J,function(a){oa="";la.setSelectedMacroId(null);fa.refreshSelectedRowTotal(0);O(a,fa.resetPaginationAndJumpToFirstPage)})).loadMacros(1,fa.getPageSize())};this.insertToolbarButton=function(a,b,t,r){return ia.addButtonForHeadCustom(a,
b,t,r)};this.appendToolbarButton=function(a,b,t,r){return ia.addButtonForTailCustom(a,b,t,r)};var k=function(a){(new D(J,function(b){1==b&&a();0==b&&u.showPrompt(Y.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002"))},function(b,t){return!1})).checkMacroPermission()}}"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.macro&&(com.kingdee.bos.qing.macro={});var F=com.kingdee.bos.qing.macro;F.MacroDesigner=x;F.AbstractModalMacroDesignerScene=function(){var J=this,g,Z,la;this.show=function(){g||(g=new x(J.protectedGetRemoteImpl()),g.registerDataCenterSelectorConstructor(J.protectedGetDataCenterSelectorConstructor()),g.registerSuperQuerySelectorConstructor(J.protectedGetSuperQuerySelectorConstructor()));Z=$("<div>");Z.css("z-index",256);Z.css("background-color","rgba(0,0,0,0.4");
Z.appendTo($(document.body));P.layoutCtrlWithLRTB(Z,0,0,null,0,0,null);var u=$("<div>");u.css("border-radius","4px");u.css("overflow","hidden");u.appendTo(Z);P.layoutCtrlWithLRTB(u,20,20,null,20,20,null);var ia=Y.get("macro","\u5b8f"),d=$("<div>");d.text(ia);d.addClass("sa-ctrl-dialog-title");d.css("z-index",1);d.appendTo(u);ia=$("<div>");ia.css("z-index",1);ia.appendTo(u);P.layoutCtrlWithLRTB(ia,0,0,null,d.outerHeight(),0,null);d=$("<div>");d.css("z-index",2);d.addClass("sa-ctrl-dialog-close");d.text("\u00d7");
d.appendTo(u);d.on("click",function(oa){J.hide()});g.createJqUi().appendTo(ia);la=new ha;la.setDelay(250);la.setCallback(function(){g.resize()});la.observe()};this.hide=function(){la.unobserve();Z.remove()};this.protectedGetRemoteImpl=function(){throw Error("override me");};this.protectedGetDataCenterSelectorConstructor=function(){throw Error("override me");};this.protectedGetSuperQuerySelectorConstructor=function(){throw Error("override me");}};var P,T,f,ja,G,xa,Y,ha,w,C,U,z,B,D,E,aa;(function(){var J=
com.kingdee.bos.qing.common;P=J.DomUtil;J=com.kingdee.bos.qing.ui.component;T=J.MenuModel;f=J.MenuItemModel;ja=J.MessageCurtain;G=J.MessageDialog;xa=J.SearchBox;J=com.kingdee.bos.qing.framework.common;Y=J.MultilanguageManager.createPackageAccessor(F);ha=J.WindowResizeObserver;w=J.RemoteFramework;J=com.kingdee.bos.qing.data;C=J.SystemVarType;J=com.kingdee.bos.qing.macro;B=J.Toolbar;D=J.MacroFacade;U=J.PreviewDialog;z=J.MacroInfoPanel;E=J.UploadPane;J=com.kingdee.bos.qing.biz.common;aa=J.ComplexPaginationBar})()})();
//qingVersionTag: 20250807