var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(Ha,Jb,jc){Ha instanceof String&&(Ha=String(Ha));for(var Cb=Ha.length,oc=0;oc<Cb;oc++){var rc=Ha[oc];if(Jb.call(jc,rc,oc,Ha))return{i:oc,v:rc}}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(Ha,Jb,jc){if(Ha==Array.prototype||Ha==Object.prototype)return Ha;Ha[Jb]=jc.value;return Ha};$jscomp.getGlobal=function(Ha){Ha=["object"==typeof globalThis&&globalThis,Ha,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var Jb=0;Jb<Ha.length;++Jb){var jc=Ha[Jb];if(jc&&jc.Math==Math)return jc}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(Ha,Jb){var jc=$jscomp.propertyToPolyfillSymbol[Jb];if(null==jc)return Ha[Jb];jc=Ha[jc];return void 0!==jc?jc:Ha[Jb]};
$jscomp.polyfill=function(Ha,Jb,jc,Cb){Jb&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(Ha,Jb,jc,Cb):$jscomp.polyfillUnisolated(Ha,Jb,jc,Cb))};$jscomp.polyfillUnisolated=function(Ha,Jb,jc,Cb){jc=$jscomp.global;Ha=Ha.split(".");for(Cb=0;Cb<Ha.length-1;Cb++){var oc=Ha[Cb];if(!(oc in jc))return;jc=jc[oc]}Ha=Ha[Ha.length-1];Cb=jc[Ha];Jb=Jb(Cb);Jb!=Cb&&null!=Jb&&$jscomp.defineProperty(jc,Ha,{configurable:!0,writable:!0,value:Jb})};
$jscomp.polyfillIsolated=function(Ha,Jb,jc,Cb){var oc=Ha.split(".");Ha=1===oc.length;Cb=oc[0];Cb=!Ha&&Cb in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var rc=0;rc<oc.length-1;rc++){var Kc=oc[rc];if(!(Kc in Cb))return;Cb=Cb[Kc]}oc=oc[oc.length-1];jc=$jscomp.IS_SYMBOL_NATIVE&&"es6"===jc?Cb[oc]:null;Jb=Jb(jc);null!=Jb&&(Ha?$jscomp.defineProperty($jscomp.polyfills,oc,{configurable:!0,writable:!0,value:Jb}):Jb!==jc&&(void 0===$jscomp.propertyToPolyfillSymbol[oc]&&(jc=1E9*Math.random()>>>0,
$jscomp.propertyToPolyfillSymbol[oc]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(oc):$jscomp.POLYFILL_PREFIX+jc+"$"+oc),$jscomp.defineProperty(Cb,$jscomp.propertyToPolyfillSymbol[oc],{configurable:!0,writable:!0,value:Jb})))};$jscomp.polyfill("Array.prototype.find",function(Ha){return Ha?Ha:function(Jb,jc){return $jscomp.findInternal(this,Jb,jc).v}},"es6","es3");$jscomp.arrayIteratorImpl=function(Ha){var Jb=0;return function(){return Jb<Ha.length?{done:!1,value:Ha[Jb++]}:{done:!0}}};
$jscomp.arrayIterator=function(Ha){return{next:$jscomp.arrayIteratorImpl(Ha)}};$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(Ha){if(Ha)return Ha;var Jb=function(rc,Kc){this.$jscomp$symbol$id_=rc;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:Kc})};Jb.prototype.toString=function(){return this.$jscomp$symbol$id_};var jc="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",Cb=0,oc=function(rc){if(this instanceof oc)throw new TypeError("Symbol is not a constructor");return new Jb(jc+(rc||"")+"_"+Cb++,rc)};return oc},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(Ha){if(Ha)return Ha;Ha=Symbol("Symbol.iterator");for(var Jb="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),jc=0;jc<Jb.length;jc++){var Cb=$jscomp.global[Jb[jc]];"function"===typeof Cb&&"function"!=typeof Cb.prototype[Ha]&&$jscomp.defineProperty(Cb.prototype,Ha,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return Ha},
"es6","es3");$jscomp.iteratorPrototype=function(Ha){Ha={next:Ha};Ha[Symbol.iterator]=function(){return this};return Ha};$jscomp.iteratorFromArray=function(Ha,Jb){Ha instanceof String&&(Ha+="");var jc=0,Cb=!1,oc={next:function(){if(!Cb&&jc<Ha.length){var rc=jc++;return{value:Jb(rc,Ha[rc]),done:!1}}Cb=!0;return{done:!0,value:void 0}}};oc[Symbol.iterator]=function(){return oc};return oc};
$jscomp.polyfill("Array.prototype.keys",function(Ha){return Ha?Ha:function(){return $jscomp.iteratorFromArray(this,function(Jb){return Jb})}},"es6","es3");$jscomp.polyfill("Object.is",function(Ha){return Ha?Ha:function(Jb,jc){return Jb===jc?0!==Jb||1/Jb===1/jc:Jb!==Jb&&jc!==jc}},"es6","es3");
$jscomp.polyfill("Array.prototype.includes",function(Ha){return Ha?Ha:function(Jb,jc){var Cb=this;Cb instanceof String&&(Cb=String(Cb));var oc=Cb.length;jc=jc||0;for(0>jc&&(jc=Math.max(jc+oc,0));jc<oc;jc++){var rc=Cb[jc];if(rc===Jb||Object.is(rc,Jb))return!0}return!1}},"es7","es3");
$jscomp.checkStringArgs=function(Ha,Jb,jc){if(null==Ha)throw new TypeError("The 'this' value for String.prototype."+jc+" must not be null or undefined");if(Jb instanceof RegExp)throw new TypeError("First argument to String.prototype."+jc+" must not be a regular expression");return Ha+""};$jscomp.polyfill("String.prototype.includes",function(Ha){return Ha?Ha:function(Jb,jc){return-1!==$jscomp.checkStringArgs(this,Jb,"includes").indexOf(Jb,jc||0)}},"es6","es3");
(function(){function Ha(){var Kc=this,Cc=[],xc=[],Ub;this.setChangedListener=function(Ka){Ub=Ka};this.isTableIdExist=function(Ka){return null!=Kc.getTableById(Ka)};this.addTable=function(Ka){tc(Ka);Ub&&Ub(Ha.KEY_ADD_TABLE,Ka)};var tc=function(Ka){Ka.setChangedListener(function(Fb){Ub&&Ub(Fb,Ka)});Cc.push(Ka)};this.refreshTable=function(Ka){Ka=Kc.getTableById(Ka);Ub&&Ub(Ha.KEY_REFRESH_TABLE,Ka)};this.removeTable=function(Ka){for(var Fb=0;Fb<Cc.length;Fb++)if(Cc[Fb]==Ka){Ka.setChangedListener(null);
Cc.splice(Fb,1);Ub&&Ub(Ha.KEY_REMOVE_TABLE,Ka);Ka=Kc.searchRelationByTableId(Ka.getId());for(Fb=Ka.length-1;0<=Fb;Fb--)Kc.removeRelation(Ka[Fb]);break}};this.getTableCount=function(){return Cc.length};this.getTable=function(Ka){return Cc[Ka]};this.getTableById=function(Ka){for(var Fb=0;Fb<Cc.length;Fb++){var wb=Cc[Fb];if(wb.getId()==Ka)return wb}return null};this.addRelation=function(Ka){xc.push(Ka);Ub&&Ub(Ha.KEY_ADD_RELATION,Ka)};this.removeRelation=function(Ka){for(var Fb=0;Fb<xc.length;Fb++)if(xc[Fb]==
Ka){xc.splice(Fb,1);Ub&&Ub(Ha.KEY_REMOVE_RELATION,Ka);break}};this.getRelationCount=function(){return xc.length};this.getRelation=function(Ka){return xc[Ka]};this.getRelationByTableId=function(Ka,Fb){for(var wb=0;wb<xc.length;wb++){var bb=xc[wb];if(bb.getFromTableId()==Ka&&bb.getToTableId()==Fb)return bb}return null};this.searchRelationByTableId=function(Ka){for(var Fb=[],wb=0;wb<xc.length;wb++){var bb=xc[wb];bb.getFromTableId()!=Ka&&bb.getToTableId()!=Ka||Fb.push(bb)}return Fb}}function Jb(){var Kc,
Cc,xc,Ub=[],tc;this.setChangedListener=function(Ka){Kc=Ka};this.setId=function(Ka){Cc=Ka};this.getId=function(){return Cc};this.refreshSubEntityDisplayName=function(Ka){for(var Fb in Ub){var wb=Ub[Fb].getSubNodeEntity();if(wb&&wb.getName()==Ka.getName()){Kc&&Kc(Jb.KEY_SUBENTITY_DISPLAYNAME);break}}};this.setDisplayName=function(Ka){xc=Ka;Kc&&Kc(Jb.KEY_DISPLAYNAME)};this.getDisplayName=function(){return xc};this.setFields=function(Ka){Ub=Ka;Kc&&Kc(Jb.KEY_FIELDS)};this.getFieldCount=function(){return Ub.length};
this.getField=function(Ka){return Ub[Ka]};this.setRect=function(Ka){tc=Ka;Kc&&Kc(Jb.KEY_RECT)};this.getRect=function(){return tc}}function jc(){var Kc,Cc,xc,Ub,tc;this.setFromTableId=function(Ka){Kc=Ka};this.getFromTableId=function(){return Kc};this.setFromFieldId=function(Ka){xc=Ka};this.getFromFieldId=function(){return xc};this.setToTableId=function(Ka){Cc=Ka};this.getToTableId=function(){return Cc};this.setToFieldId=function(Ka){Ub=Ka};this.getToFieldId=function(){return Ub};this.setRelated=function(Ka){tc=
Ka};this.isRelatedFromN=function(){return tc==jc.R_N1};this.isRelatedToN=function(){return tc==jc.R_1N}}"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.data&&(com.kingdee.bos.qing.data={});"undefined"==typeof com.kingdee.bos.qing.data.rview&&(com.kingdee.bos.qing.data.rview={});var Cb=com.kingdee.bos.qing.data.rview;
Cb.RelationView=function(){var Kc="RelationView"+rc++,Cc,xc,Ub,tc=[120,160],Ka=[40,30],Fb,wb,bb,$b,Hb=!1,Tb=!0,Za=!0,oa,Kb,hc=100,Lb=0,pb,yc,Nb;this.getDataModel=function(){return Cc};this.setDataModel=function(l){Cc&&Cc.setChangedListener(null);(Cc=l)&&Cc.setChangedListener(Ec);xc&&bd()};this.getJqUi=function(){xc||(xc=$("<div>"),xc.css("overflow","auto"),xc.on("mousedown",ea),Ub=$("<div>"),Ub.addClass("dmrv-placeholder"),Ub.appendTo(xc),Cc&&bd());return xc};this.updateViewBounds=function(){Fb=[xc.innerWidth(),
xc.innerHeight()]};this.setDefaultTableSize=function(l,B){tc=[l,B]};this.setTableSelectable=function(l){Hb=l?!0:!1;Wc(null)};this.setRelationSelectable=function(l){Tb=l?!0:!1;Wc(null)};this.setDeselectable=function(l){Za=l?!0:!1;Wc(null)};this.setSelectedListener=function(l){Kb=l};this.getSelectedTable=function(){return oa instanceof Jb?oa:null};this.setSelectedTable=function(l){Wc(l,!1)};this.getSelectedRelation=function(){return oa instanceof jc?oa:null};this.setSelectedRelation=function(l){Wc(l,
!1)};this.setTableIconSetter=function(l){wb=l};this.setFieldIconSetter=function(l){bb=l};this.setNoFieldPrompt=function(l){$b=l};var Ec=function(l,B){switch(l){case Ha.KEY_REFRESH_TABLE:l=Uc(B).find(".dmrv-table-title-icon");wb&&wb(l,B);break;case Ha.KEY_ADD_TABLE:cc(B,!0);fb();break;case Ha.KEY_REMOVE_TABLE:Ea(B);break;case Ha.KEY_ADD_RELATION:Dc(B);break;case Ha.KEY_REMOVE_RELATION:B==oa&&Wc(null);Wb(B).remove();break;case Jb.KEY_DISPLAYNAME:Uc(B).find(".dmrv-table-title").text(B.getDisplayName());
break;case Jb.KEY_FIELDS:case Jb.KEY_SUBENTITY_DISPLAYNAME:$a(B);break;case Jb.KEY_RECT:l=Uc(B);Ua(B,l);B=Cc.searchRelationByTableId(B.getId());for(l=B.length-1;0<=l;l--)cd(B[l]);fb()}},bd=function(){xc.children(":not(.dmrv-placeholder)").remove();for(var l=0,B=Cc.getTableCount();l<B;l++){var I=Cc.getTable(l);cc(I)}l=0;for(B=Cc.getRelationCount();l<B;l++)I=Cc.getRelation(l),Dc(I);fb()},Uc=function(l){l=Kc+"_"+oc.encode(l.getId());return xc.find("#"+l)},Pc=function(l){return Kc+"_R_"+oc.encode(l.getFromTableId())+
"_I_"+oc.encode(l.getToTableId())},Wb=function(l){l=Pc(l);return $("#"+l)},cc=function(l,B){var I=l.getRect();I||(I=Gc(l),l.setRect(I));var q=qa(l);B?Bc(I,function(G){q.children().fadeIn("slow")}):q.children().css("display","block")},Ea=function(l){var B=Uc(l);B.attr("invalid","true");Bc(l.getRect(),function(I){l==oa&&Wc(null);B.fadeOut(function(){B.remove();fb()})})},qa=function(l){var B=$("<div>");B.attr("id",Kc+"_"+oc.encode(l.getId()));B.addClass("dmrv-table");Ua(l,B);var I=$("<div>");I.addClass("dmrv-table-content");
I.css("display","none");I.appendTo(B);var q=$("<div>");q.addClass("dmrv-table-title");q.text(l.getDisplayName());q.appendTo(I);q=$("<div>");q.addClass("dmrv-table-title-icon");q.appendTo(I);wb&&wb(q,l);q=$("<div>");q.addClass("dmrv-table-fieldlist");q.appendTo(I);$a(l,q);l=$("<div>");l.addClass("dmrv-table-footer");l.appendTo(I);l=$("<div>");l.addClass("dmrv-table-resizer");l.appendTo(I);B.appendTo(xc);return B},$a=function(l,B){B||(B=Uc(l).find(".dmrv-table-fieldlist"));B.empty();var I=l.getFieldCount();
if(0==I)l=$("<div>"),l.addClass("dmrv-table-fieldlist-nofieldprompt"),l.text($b?$b:""),l.appendTo(B);else for(var q=0;q<I;q++){var G=l.getField(q),R=$("<div>");R.addClass("dmrv-table-field");R.attr("my-field-id",oc.encode(G.getId()));R.appendTo(B);var J=$("<div>");J.addClass("dmrv-table-field-icon");bb&&bb(J,l,G);J.appendTo(R);J=$("<div>");J.addClass("dmrv-table-field-text");J.text(G.getDisplayName());J.appendTo(R)}},Ua=function(l,B){l=l.getRect();B.css({left:l[0],top:l[1],width:l[2],height:l[3]})},
fb=function(){for(var l=0,B=0,I=Cc.getTableCount()-1;0<=I;I--){var q=Cc.getTable(I).getRect();if(q){var G=q[1]+q[3];l=Math.max(l,q[0]+q[2]);B=Math.max(B,G)}}Ub.css({left:l+100,top:B+80})},ea=function(l){for(var B=$(l.target);B[0]!=xc[0];){if(B.hasClass("dmrv-table")){var I=B.attr("id");I=oc.decode(I.substring(Kc.length+1));I=Cc.getTableById(I);var q=B.find(".dmrv-table-title"),G=B.find(".dmrv-table-title-icon"),R=B.find(".dmrv-table-resizer");G=l.target==q[0]||l.target==G[0];var J=l.target==R[0];
if(Lb=G?16:J?3:0)xc.css("cursor",(G?q:R).css("cursor")),xc.on("mousemove",da),xc.on("mouseup",L),xc.on("mouseleave",mc),pb=[l.screenX,l.screenY],yc=[parseInt(B.css("left")),parseInt(B.css("top")),parseInt(B.css("width")),parseInt(B.css("height")),I];Wc(I);return}if(B.hasClass("dmrv-relation")){B=B.attr("id").substring((Kc+"_R_").length).split("_I_");l=oc.decode(B[0]);B=oc.decode(B[1]);l=Cc.getRelationByTableId(l,B);Wc(l);return}B=B.parent()}B=$(l.target);l.offsetY>B.prop("clientHeight")||l.offsetX>
B.prop("clientWidth")||Za&&Wc(null)},da=function(l){Nb||(Nb=$("<div>"),Nb.addClass("dmrv-table-standin"),Nb.css("left",yc[0]),Nb.css("top",yc[1]),Nb.css("width",yc[2]),Nb.css("height",yc[3]),Nb.appendTo(xc));var B=l.screenX-pb[0];l=l.screenY-pb[1];16==Lb?Nb.css({left:Math.max(0,yc[0]+B),top:Math.max(0,yc[1]+l)}):3==Lb&&Nb.css({width:Math.max(Ka[0],yc[2]+B),height:Math.max(Ka[1],yc[3]+l)})},L=function(l){wc()},mc=function(l){wc()},wc=function(){xc.off("mousemove",da);xc.off("mouseup",L);xc.off("mouseleave",
mc);xc.css("cursor","default");if(Nb){var l=[parseInt(Nb.css("left")),parseInt(Nb.css("top")),parseInt(Nb.css("width")),parseInt(Nb.css("height"))];yc[4].setRect(l);Nb.remove();pb=yc=Nb=null;Lb=0}},Bc=function(l,B){var I=l[0]-10,q=l[0]+l[2]+10,G=l[1]-10;l=l[1]+l[3]+10;var R=xc.prop("scrollLeft"),J=xc.prop("scrollTop"),M=xc.prop("clientWidth"),cb=xc.prop("clientHeight"),rb=R,Ja=J,kb=!0;I<R&&(rb=I,kb=!1);G<J&&(Ja=G,kb=!1);q>R+M&&(rb=q-M,kb=!1);l>J+cb&&(Ja=l-cb,kb=!1);kb?B&&B(kb):xc.animate({scrollLeft:rb,
scrollTop:Ja},"fast",B)},Gc=function(l){var B=Fb?Fb[0]:parseInt(xc.innerWidth());B=isNaN(B)||0==B?1280:B;for(var I=tc[0],q=tc[1],G=10,R=10,J=!1;!J;){J=G;for(var M=R,cb=G+I,rb=R+q,Ja=!1,kb=0,Ac=Cc.getTableCount();kb<Ac;kb++){var Jc=Cc.getTable(kb),Qc=Jc.getRect();if(Jc!=l&&Qc){Jc=Qc[1]-20;var ab=Qc[0]+Qc[2]+20,ic=Qc[1]+Qc[3]+20;if(!(cb<Qc[0]-20||J>ab||rb<Jc||M>ic)){Ja=!0;break}}}J=!Ja;Ja&&(G+=60,G>B&&(G=10,R+=30))}return[G,R,I,q]},Wc=function(l,B){var I=!0,q=null;if(l instanceof Jb)q=Uc(l),I=Hb;else if(l instanceof
jc){q=Wb(l);I=Tb;var G=Uc(Cc.getTableById(l.getFromTableId())),R=Uc(Cc.getTableById(l.getToTableId()));G.css("z-index",hc+1);R.css("z-index",hc+1)}q&&q.css("z-index",hc++);I&&oa!=l&&(B=void 0===B?!0:B,oa&&(dc(!1),B&&Kb&&Kb(!1,oa)),oa=l)&&(dc(!0),B&&Kb&&Kb(!0,oa))},dc=function(l){if(oa instanceof Jb){var B=Uc(oa).find(".dmrv-table-content");l?B.addClass("dmrv-table-content_selected"):B.removeClass("dmrv-table-content_selected")}else if(oa instanceof jc){B=Wb(oa);var I=B.find(".dmrv-relation-line");
l?(B.addClass("dmrv-relation_selected"),I.addClass("dmrv-relation-line_selected")):(B.removeClass("dmrv-relation_selected"),I.removeClass("dmrv-relation-line_selected"));Hc(oa,l)}},Hc=function(l,B){var I=Cc.getTableById(l.getFromTableId());I&&Sc(I,l.getFromFieldId(),B);var q=Cc.getTableById(l.getToTableId());q&&Sc(q,l.getToFieldId(),B);B&&Bc(I.getRect(),function(G){setTimeout(function(){Bc(q.getRect())},G?0:500)})},Sc=function(l,B,I){l=Uc(l).find("[my-field-id='"+oc.encode(B)+"']");if(I){l.addClass("dmrv-relation-field_selected");
I=l.parent();B=I.prop("scrollTop");var q=I.prop("clientHeight"),G=l.prop("offsetTop");l=l.prop("offsetHeight");(G<B||G+l>B+q)&&I.prop("scrollTop",G)}else l.removeClass("dmrv-relation-field_selected")},Dc=function(l){var B=$("<div>");B.attr("id",Pc(l));B.addClass("dmrv-relation");var I=$("<div>");I.addClass("dmrv-relation-line");I.appendTo(B);I=$("<div>");I.addClass("dmrv-relation-tips-from");I.appendTo(B);I=$("<div>");I.addClass("dmrv-relation-tips-to");I.appendTo(B);cd(l,B);B.appendTo(xc)},cd=function(l,
B){B||(B=Wb(l));var I=Cc.getTableById(l.getFromTableId()),q=Cc.getTableById(l.getToTableId());if(q.getRect())a:{var G=I.getRect(),R=q.getRect();I=G[2];q=G[3];var J=G[0],M=J+I,cb=G[1],rb=cb+q;G=R[2];var Ja=R[3],kb=R[0],Ac=kb+G,Jc=R[1],Qc=Jc+Ja;if(kb>M)var ab=Jc-rb>kb-M?"ud":cb-Qc>kb-M?"du":"lr";else if(Ac<J)ab=Jc-rb>J-Ac?"ud":cb-Qc>J-Ac?"du":"rl";else if(Jc>rb)ab="ud";else if(Qc<cb)ab="du";else{var ic=null;break a}I>>=1;G>>=1;R=q>>1;Ja>>=1;var Eb=cb+R,m=J+I,S=Jc+Ja,ha=kb+G;q=!1;switch(ab){case "lr":ic=
M-4;var Ga=Eb;var sb=kb+4;var p=S;q=!0;var nc=Ga>p?!1:!0;break;case "rl":ic=J+4;Ga=Eb;sb=Ac-4;p=S;q=!0;nc=Ga>p?!0:!1;break;case "ud":ic=m;Ga=rb-4;sb=ha;p=Jc+4;nc=ic>sb?!0:!1;break;case "du":ic=m,Ga=cb+4,sb=ha,p=Qc-4,nc=ic>sb?!1:!0}ic==sb||"ud"!=ab&&"du"!=ab?Ga==p||"lr"!=ab&&"rl"!=ab||(J=Math.abs((p-Ga)/(sb-ic)),J=Math.max(-5,Math.min(5,Math.log(J))),J=(J+5)/10,G=Math.abs(p-Ga),G>R+Ja?(I=R,M=Ja):(I=G*R/(R+Ja),M=G*Ja/(R+Ja)),G=p>Ga?1:-1,Ga+=parseInt(I*J)*G,p+=parseInt(M*J)*-G):(J=Math.abs((sb-ic)/(p-
Ga)),J=Math.max(-5,Math.min(5,Math.log(J))),J=(J+5)/10,R=Math.abs(sb-ic),R>I+G?(M=I,iAdjustableWidth2=G):(M=R*I/(I+G),iAdjustableWidth2=R*G/(I+G)),G=sb>ic?1:-1,ic+=parseInt(M*J)*G,sb+=parseInt(iAdjustableWidth2*J)*-G);ic=[ic,Ga,sb,p,q,nc]}else ic=null;q=ic;null==q?B.css("display","none"):(p=q[0],nc=q[1],ic=q[2]-p,Ga=q[3]-nc,sb=q[4],q=q[5],0==ic?(I=0<Ga?90:-90,G=Math.abs(Ga)):(J=!1,0>ic&&(J=!0,ic=-ic),G=Math.atan(Ga/ic),I=parseInt(180*G/Math.PI),G=parseInt(ic/Math.cos(G)),J&&(I=180-I)),J="rotate("+
I+"deg)",B.css({display:"block",transform:J,"-webkit-transform":J,"-ms-transform":J,"-moz-transform":J,"-o-transform":J,left:p,top:nc-4,width:G}),p=Math.abs(sb?Ga:ic),28>Math.abs(sb?ic:Ga)&&36>p?ld(B):ld(B,l,I,q))},ld=function(l,B,I,q){var G=l.find(".dmrv-relation-tips-from");l=l.find(".dmrv-relation-tips-to");B?(sc(G,B.isRelatedFromN(),I,q),sc(l,B.isRelatedToN(),I,!q)):(G.css("display","none"),l.css("display","none"))},sc=function(l,B,I,q){l.text(B?"*":"1");l.removeClass("dmrv-relation-tips-"+(q?
"underline":"aboveline"));l.addClass("dmrv-relation-tips-"+(q?"aboveline":"underline"));B="rotate("+-I+"deg)";l.css({display:"block",transform:B,"-webkit-transform":B,"-ms-transform":B,"-moz-transform":B,"-o-transform":B})}};Cb.DataModel=Ha;Cb.Table=Jb;Cb.Field=function(){var Kc,Cc,xc,Ub;this.setSubNodeEntity=function(tc){Ub=tc};this.getSubNodeEntity=function(){return Ub};this.setId=function(tc){Kc=tc};this.getId=function(){return Kc};this.setDisplayName=function(tc){Cc=tc};this.getDisplayName=function(){return Ub?
Ub.getAlias()+"."+Cc:Cc};this.setUserObject=function(tc){xc=tc};this.getUserObject=function(){return xc}};Cb.Relation=jc;var oc=com.kingdee.bos.qing.common.Base32Util;Ha.KEY_ADD_TABLE="addTable";Ha.KEY_REFRESH_TABLE="refreshTable";Ha.KEY_REMOVE_TABLE="removeTable";Ha.KEY_ADD_RELATION="addRelation";Ha.KEY_REMOVE_RELATION="removeRelation";Jb.KEY_FIELDS="fields";Jb.KEY_RECT="rect";Jb.KEY_DISPLAYNAME="displayname";Jb.KEY_SUBENTITY_DISPLAYNAME="subentity_displayname";jc.R_11="11";jc.R_N1="n1";jc.R_1N=
"1n";var rc=1})();(function(){function Ha(){var l=this,B=[],I,q=[],G=[],R=[],J=new cd,M;this.addChangedListener=function(m){B.push(m)};this.getAllEntity=function(){return q};this.removeChangedListener=function(m){for(var S=B.length-1;0<=S;S--)B[S]==m&&B.splice(S,1)};this.replaceOrAddUnionInnerEntityRelation=function(m){var S=[],ha=!1;R.forEach(function(Ga){Ga.getRootUnionEntityName()!=m.getRootUnionEntityName()?S.push(Ga):(S.push(m),ha=!0)});ha||S.push(m);R=S};this.addUnionInnerEntityRelation=function(m){R.push(m)};
this.findUnionInnerEntityRelation=function(m){for(var S=0;S<R.length;S++)if(R[S].getRootUnionEntityName()==m)return R[S];S=new Kb;S.setRootUnionEntityName(m);return S};var cb=function(m,S,ha){for(var Ga=m.getName(),sb=1;S[Ga];)Ga=m.getName()+"_"+sb,sb++;m.setName(Ga);S[Ga]=m;sb=1;for(S=m.getAlias();ha[S];)S=m.getAlias()+"_"+sb,sb++;m.setAlias(S);ha[S]=m},rb=function(m,S){for(var ha=0;ha<B.length;ha++)(0,B[ha])(m,S)};this.isTooModern=function(){return I};this.getSources=function(){for(var m={},S=0;S<
q.length;S++)q[S].collectSources(m);S=[];for(var ha in m)S.push(m[ha]);return S};this.batchInsertEntity=function(m,S){var ha={},Ga={};q.forEach(function(Fc){ha[Fc.getName()]=Fc;Ga[Fc.getAlias()]=Fc});for(var sb=0;sb<m.length;sb++){var p=m[sb],nc=p.getName();cb(p,ha,Ga);var jb=p.getName();jb!=nc&&S&&S(nc,jb,p);Ac(p)}rb(Ha.KEY_ADD_ENTITIES,m)};this.addEntitiesByIndex=function(m,S){if(!(0>S))if(S>=q.length)l.addEntities(m);else{var ha={},Ga={};q.forEach(function(Fc){ha[Fc.getName()]=Fc;Ga[Fc.getAlias()]=
Fc});for(var sb=[],p=0;p<q.length;p++){if(S==p)for(var nc=0;nc<m.length;nc++){var jb=m[nc];cb(jb,ha,Ga);ha[jb.getName()]=jb;Ga[jb.getAlias()]=jb;jb.mergeSource(l.getSources());Ja(jb);sb.push(jb)}sb.push(q[p])}q=sb;rb(Ha.KEY_ADD_ENTITIES,m)}};var Ja=function(m){m.setChangedListener(function(S){rb(S,m)})};this.addEntities=function(m){var S={},ha={};q.forEach(function(Fc){S[Fc.getName()]=Fc;ha[Fc.getAlias()]=Fc});for(var Ga=0;Ga<m.length;Ga++){for(var sb=m[Ga],p=sb.getName(),nc=p,jb=1;S[nc];)nc=p+"_"+
jb++;sb.setName(nc);S[nc]=sb;nc=p=sb.getAlias();for(jb=1;ha[nc];)nc=p+"_"+jb++;sb.setAlias(nc);ha[nc]=sb;sb.mergeSource(l.getSources());Jc(sb)}rb(Ha.KEY_ADD_ENTITIES,m)};this.refreshEntity=function(m){l.refreshEntities([m])};this.replaceEntity=function(m,S,ha){var Ga={},sb={},p=m.getAllOldEntity();q.forEach(function(Pb){-1==p.indexOf(Pb)&&(Ga[Pb.getName()]=Pb,sb[Pb.getAlias()]=Pb)});for(var nc=[],jb=!1,Fc=null,kd=[],X=0;X<q.length;X++){var Va=q[X],Ob=m.getNewEntity(Va.getName());if(Ob){jb=!0;nc.push(Ob);
Fc||(Fc=Ob);var Db=Ob.getName();cb(Ob,Ga,sb);var ub=Ob.getName();ub!=Db&&ha&&ha(Db,ub,Ob);Ob.mergeSource(l.getSources());Ja(Ob);kd.push([Va,Ob])}else(Ob=Va.getParentEntity())&&jb&&(Ob=m.getNewEntity(Ob.getName()))&&Va.setParentEntity(Ob),nc.push(Va)}kb(kd);q=nc;S&&Fc&&(rb(Ha.KEY_REFRESH_ENTITY,Fc),rb(rc.KEY_CHANGE_ENTITYALIAS,Fc))};var kb=function(m){for(var S=[],ha=0;ha<G.length;ha++){for(var Ga=G[ha],sb=!1,p=!1,nc=0;nc<m.length;nc++){var jb=m[nc],Fc=jb[0];jb=jb[1];Ga.getFromEntity()==Fc&&(Ga.setFromEntity(jb),
sb=!0);Ga.getToEntity()==Fc&&(Ga.setToEntity(jb),p=!0)}sb&&((sb=Ga.getFromEntity().searchProperty(Ga.getFromProperty()))?Ga.setFromProperty(sb):S.push(Ga));p&&((p=Ga.getToEntity().searchProperty(Ga.getToProperty()))?Ga.setToProperty(p):S.push(Ga))}S.forEach(function(kd){l.removeRelation(kd)})};this.fireEntityRefresh=function(m){m=l.getEntityByName(m);rb(Ha.KEY_REFRESH_ENTITY,m)};this.fireRefreshEntity=function(m){rb(Ha.KEY_REFRESH_ENTITY,m)};this.refreshEntities=function(m){if(0!=m.length){for(var S=
{},ha=0;ha<m.length;ha++){var Ga=m[ha];S[Ga.getName()]=Ga}Ga=[];var sb=[];for(ha in q){var p=q[ha],nc=p.getName(),jb=S[nc];if(jb)delete S[nc],Ga.push(jb),jb.setChangedListener(function(kd){rb(kd,jb)}),sb.push([p,jb]);else{Ga.push(p);var Fc=p.getParentEntity();Fc&&(Fc=S[Fc.getName()])&&p.setParentEntity(Fc)}}kb(sb);q=Ga;ha=[];for(nc in S)ha.push(S[nc]),Ac(S[nc]);0<ha.length&&rb(Ha.KEY_ADD_ENTITIES,ha);rb(Ha.KEY_REFRESH_ENTITY,m[0])}};var Ac=function(m){var S=m.getParentEntity();if(S){var ha=q.indexOf(S);
if(0<=ha){var Ga=-1;S=S.getName();for(ha+=1;ha<q.length;ha++)if(!q[ha].findParentEntityByName(S)){Ga=ha;break}m.setChangedListener(function(sb){rb(sb,m)});-1<Ga?q.splice(Ga,0,m):q.push(m)}}else m.setChangedListener(function(sb){rb(sb,m)}),q.push(m)};this.refreshUploadTypeSourceUrl=function(m){for(var S=l.getSources(),ha=0;ha<S.length;ha++)for(var Ga=S[ha],sb=0;sb<m.length;sb++){var p=m[sb];if(p.getName()==Ga.getName()){Ga.fireChangeUrl(p);break}}};var Jc=function(m){m.setChangedListener(function(S){rb(S,
m)});q.push(m)};this.removeEntityByName=function(m){for(var S=0;S<q.length;S++){var ha=q[S];if(ha.getName()==m){ha.setChangedListener(null);ha.fission();q.splice(S,1);rb(Ha.KEY_REMOVE_ENTITY,ha);m=l.searchRelationsByEntityName(m);for(S=m.length-1;0<=S;S--)l.removeRelation(m[S]);ha instanceof Ub&&ha.getUnionType()==Ub.BIZ_UNION&&(ha.getParentEntity()?(m=ha.getTopParentEntity(),l.removeBizUnionInnerEntityRelations(m.getName(),ha.getChildren())):l.removeBizUnionInnerEntityRelations(ha.getName()));break}}};
this.removeEntity=function(m){for(var S=0;S<q.length;S++)if(q[S]==m){m.setChangedListener(null);m.fission();q.splice(S,1);rb(Ha.KEY_REMOVE_ENTITY,m);S=l.searchRelationsByEntityName(m.getName());for(var ha=S.length-1;0<=ha;ha--)l.removeRelation(S[ha]);m instanceof Ub&&m.getUnionType()==Ub.BIZ_UNION&&(m.getParentEntity()?(S=m.getTopParentEntity(),l.removeBizUnionInnerEntityRelations(S.getName(),m.getChildren())):l.removeBizUnionInnerEntityRelations(m.getName()));break}};this.getEntityCount=function(){return q.length};
this.getEntityIndex=function(m){for(var S=0;S<q.length;S++)if(m.getName()==q[S].getName())return S;return-1};this.getEntityByIndex=function(m){return 0>m?null:m<q.length?q[m]:null};this.getEntityByName=function(m){for(var S=0;S<q.length;S++){var ha=q[S];if(ha.getName()==m)return ha}return null};this.getEntityByAlias=function(m){for(var S=0;S<q.length;S++){var ha=q[S];if(ha.getAlias()==m)return ha}return null};this.copyEntityArray=function(){return q.slice(0)};this.onlyPushEntity=function(m){q.push(m)};
this.isEntityNameExist=function(m){return null!=l.getEntityByName(m)};this.isEntityAliasExist=function(m){return null!=l.getEntityByAlias(m)};this.getEntityWithSubNodes=function(m){return l.getEntityWithSubNodesUtil(m,q)};this.getEntityWithSubNodesUtil=function(m,S){var ha=function(sb,p){for(var nc=0;nc<S.length;nc++){var jb=S[nc];jb.isSubNodeAtView()&&jb.getParentEntity().getName()==sb&&(p.push(jb),ha(jb.getName(),p))}},Ga=[m];ha(m.getName(),Ga);return Ga};this.isEntityWithSubNodes=function(m){for(var S=
0;S<q.length;S++){var ha=q[S];if(ha.isSubNodeAtView()&&ha.getParentEntity().getName()==m.getName())return!0}return!1};this.isRelationInsideSubSystem=function(m){if(m.getFromEntity().getTopParentEntity()!=m.getToEntity().getTopParentEntity())return!1;var S=m.getFromEntity().isSubNodeAtView(),ha=m.getToEntity().isSubNodeAtView();return S&&ha?!0:S||ha?S?l.isEntityWithSubNodes(m.getToEntity()):l.isEntityWithSubNodes(m.getFromEntity()):!1};this.isRelationExist=function(m,S){for(var ha=0;ha<G.length;ha++){var Ga=
G[ha];if(Ga.getFromEntity().getName()==m&&Ga.getToEntity().getName()==S||Ga.getFromEntity().getName()==S&&Ga.getToEntity().getName()==m)return!0}return!1};this.isNewRelationCreatable=function(m,S){var ha={};ha[m]=!0;return Qc(ha,{},S)};var Qc=function(m,S,ha){m[ha]=!0;for(var Ga=l.searchRelationsByEntityName(ha),sb=0;sb<Ga.length;sb++){var p=Ga[sb],nc=p.getFromEntity().getName();p=p.getToEntity().getName();if(!S[nc+"_|_"+p]&&(S[nc+"_|_"+p]=!0,nc!=ha&&(m[nc]||!Qc(m,S,nc))||p!=ha&&(m[p]||!Qc(m,S,p))))return!1}return!0};
this.addRelation=function(m){ab(m);rb(Ha.KEY_ADD_RELATION,m)};var ab=function(m){m.setChangedListener(function(S,ha,Ga){ha=new jc(m,ha,Ga);rb(S,ha)});m.isInnerRelation()?G.splice(0,0,m):G.push(m)};this.fireRelationPropChanged=function(m,S){var ha=l.searchRelationsByEntityName(m);ha&&0!=ha.length&&ha.forEach(function(Ga){Ga.getFromEntity().getName()==m&&Ga.getFromProperty().getName()==S?rb(oa.KEY_FROM_PROPERTY_ALIAS_CHANED,Ga):Ga.getToEntity().getName()==m&&Ga.getToProperty().getName()==S&&rb(oa.KEY_TO_PROPERTY_ALIAS_CHANED,
Ga)})};this.refreshRelationEntity=function(m){l.searchRelationsByEntityName(m.getName()).forEach(function(S){S.getFromEntity().getName()==m.getName()?S.setFromEntity(m):S.getToEntity().getName()==m.getName()&&S.setToEntity(m);rb(Ha.KEY_REFRESH_RELATION,S)})};this.removeRelation=function(m){for(var S=0;S<G.length;S++)if(G[S]==m){m.setChangedListener(null);G.splice(S,1);rb(Ha.KEY_REMOVE_RELATION,m);break}};this.swapRelation=function(m,S){var ha=G[m];G[m]=G[S];G[S]=ha};this.replaceRelation=function(m,
S){G[m]=S};var ic=function(m,S){if(S)for(m+=1;m<G.length;m++){if(!l.isRelationInsideSubSystem(G[m]))return m}else for(--m;0<=m;m--)if(!l.isRelationInsideSubSystem(G[m]))return m;return-1};this.moveUpRelation=function(m){for(var S=0;S<G.length;S++)if(G[S]==m){var ha=ic(S,!1);if(-1<ha){l.swapRelation(S,ha);rb(Ha.KEY_MOVE_UP_RELATION,m);break}}};this.moveDownRelation=function(m){for(var S=0;S<G.length;S++)if(G[S]==m){var ha=ic(S,!0);if(-1<ha){l.swapRelation(S,ha);rb(Ha.KEY_MOVE_DOWN_RELATION,m);break}}};
this.getRelationCount=function(){return G.length};this.getRelationByIndex=function(m){return G[m]};this.getRelationByEntitiesName=function(m,S){for(var ha=0;ha<G.length;ha++){var Ga=G[ha];if(Ga.getFromEntity().getName()==m&&Ga.getToEntity().getName()==S)return Ga}return null};this.removeRelationByProperty=function(m,S){for(var ha=[],Ga=[],sb=0;sb<G.length;sb++)if(G[sb].getFromEntity().getName()==m){var p=G[sb].getFromProperty();var nc=null;p&&(nc=(nc=p.getParent())?nc.getName():p.getName());nc==S?
ha.push(G[sb]):Ga.push(G[sb])}else G[sb].getToEntity().getName()==m?(p=G[sb].getToProperty(),nc=null,p&&(nc=(nc=p.getParent())?nc.getName():p.getName()),nc==S?ha.push(G[sb]):Ga.push(G[sb])):Ga.push(G[sb]);G=Ga;for(sb=0;sb<ha.length;sb++)ha[sb].setChangedListener(null),rb(Ha.KEY_REMOVE_RELATION,ha[sb])};this.searchInnerRelationPropNames=function(m){for(var S=[],ha=0;ha<G.length;ha++){var Ga=G[ha];if(Ga.isInnerRelation()){if(Ga.getFromEntity().getName()==m){var sb=Ga.getFromProperty().getName();0>S.indexOf(sb)&&
S.push(sb)}Ga.getToEntity().getName()==m&&(sb=Ga.getToProperty().getName(),0>S.indexOf(sb)&&S.push(sb))}}return S};this.getLockedPropNames=function(m){var S=l.searchInnerRelationPropNames(m.getName());m=m.getColumnToRowProperties();if(null!=m&&0<m.length)for(var ha in m)for(var Ga=m[ha].getColumnToRowPropertyItems(),sb=0;sb<Ga.length;sb++){var p=Ga[sb];if(p){p=p.getPropertyValues();for(var nc in p){var jb=p[nc];0>S.indexOf(jb)&&S.push(jb)}}}return S};this.searchAllRelationPropNames=function(m){for(var S=
[],ha=0;ha<G.length;ha++){var Ga=G[ha];Ga.getFromEntity().getName()==m&&Ga.getFromProperty()&&(Ga.getFromProperty().getParent()&&S.push(Ga.getFromProperty().getParent().getName()),S.push(Ga.getFromProperty().getName()));Ga.getToEntity().getName()==m&&Ga.getToProperty()&&(Ga.getToProperty().getParent()&&S.push(Ga.getToProperty().getParent().getName()),S.push(Ga.getToProperty().getName()))}return S};this.searchRelationsByEntityName=function(m){for(var S=[],ha=0;ha<G.length;ha++){var Ga=G[ha];Ga.getFromEntity().getName()!=
m&&Ga.getToEntity().getName()!=m||S.push(Ga)}return S};this.removeEntityInnerRelation=function(m,S){for(var ha,Ga=0;Ga<R.length&&(ha=R[Ga],ha.getRootUnionEntityName()!=m);Ga++);ha&&ha.removeRelation(S)};this.getBizUnionInnerEntityRelations=function(m){for(var S,ha=0;ha<R.length;ha++){var Ga=R[ha];if(Ga.getRootUnionEntityName()==m){S=Ga;break}}return S?S.getRelations():[]};this.removeBizUnionInnerEntityRelations=function(m,S){if(S){for(Ga=0;Ga<R.length;Ga++)if(sb=R[Ga],sb.getRootUnionEntityName()==
m){var ha=sb;break}if(ha)for(Ga=0;Ga<S.length;Ga++)ha.removeRelation(S[Ga])}else{S=[];for(var Ga=0;Ga<R.length;Ga++){var sb=R[Ga];sb.getRootUnionEntityName()!=m&&S.push(sb)}R=S}};this.removeInnerRelationByFromAndToEntityName=function(m,S){for(var ha=[],Ga=[],sb=0;sb<G.length;sb++){var p=G[sb];p.isInnerRelation()?m==p.getFromEntity().getName()&&S==p.getToEntity().getName()?ha.push(p):Ga.push(p):Ga.push(p)}G=Ga;return ha};this.removeInnerRelationByEntityName=function(m){for(var S=[],ha=[],Ga=0;Ga<G.length;Ga++){var sb=
G[Ga];sb.isInnerRelation()?m[sb.getFromEntity().getName()]||m[sb.getToEntity().getName()]?S.push(sb):ha.push(sb):ha.push(sb)}G=ha;return S};this.buildToEntityRelationsMap=function(){for(var m={},S=0;S<G.length;S++){var ha=G[S];ha.isInnerRelation()&&(m[ha.getToEntity().getName()]=ha)}return m};this.getExtractSchedule=function(){return J};this.getExtractConfig=function(){return M};this.setExtractConfig=function(m){M=m};this.checkSchedule=function(){if(J.getPeriod())for(var m=0;m<q.length;m++){var S=
q[m];if(S.hasDirectModel())return new Jb("Unsupport schedule setting",0,"["+S.getAlias()+"]"+Dc.get("dataTableUnsupportScheduleSetting","\u6570\u636e\u8868\u4e0d\u652f\u6301\u5b9a\u65f6\u9884\u63d0\u53d6"))}if("Custom"==J.getPeriod()){m=J.getCron();if("undefined"==typeof m||""==m)return m=new Jb("Cron warning",0,Dc.get("cronErrorMessage","\u8bf7\u8f93\u5165\u8868\u8fbe\u5f0f\u3002")),m.setPromptLevel(Jb.LEVEL_WARNING),m;if(!J.getCronFlag())return new Jb("Cron error",0,Dc.get("cornInCheckOrError",
"cron\u8868\u8fbe\u5f0f\u6709\u8bef\u6216cron\u8868\u8fbe\u5f0f\u6b63\u5728\u89e3\u6790\u6821\u9a8c."))}return null};this.toJsonObject=function(){for(var m={},S=l.getSources(),ha=[],Ga=0;Ga<S.length;Ga++)ha.push(S[Ga].toJsonObject());m.sources=ha;S=[];for(Ga=0;Ga<q.length;Ga++)S.push(q[Ga].toJsonObject());m.entities=S;S=[];for(Ga=0;Ga<G.length;Ga++)S.push(G[Ga].toJsonObject());m.relations=S;S=[];for(Ga=0;Ga<R.length;Ga++)S.push(R[Ga].toJsonObject());m.bizUnionInnerEntityRelations=S;m.schedule=J.toJsonObject();
M&&(m.extractConfig=M.toJsonObject());return m};this.fromJsonObject=function(m){I=m.tooMordern;for(var S=l.getSourcesMap(m.sources),ha={},Ga={},sb=m.entities,p=0;p<sb.length;p++){var nc=sb[p];var jb=nc.children;var Fc=!1;"undefined"!=typeof jb&&0<jb.length?(jb=new Ub,Fc=!0):jb=new rc;jb.fromJsonObject(nc,S,ha);Jc(jb);ha[jb.getName()]=jb;Fc&&Eb(jb,Ga)}S=m.relations;for(p=0;p<S.length;p++)sb=S[p],nc=new oa,nc.fromJsonObject(sb,ha),ab(nc);if(ha=m.bizUnionInnerEntityRelations)for(p=0;p<ha.length;p++)S=
ha[p],sb=new Kb,sb.fromJsonObject(S,Ga),R.push(sb);Ga=m.schedule;J=new cd;J.fromJsonObject(Ga);if(m=m.extractConfig)M=new Gc,M.fromJsonObject(m)};var Eb=function(m,S){if(m.isUnion()&&m.getUnionType()==Ub.BIZ_UNION){var ha=m.getTopParentEntity(),Ga=S[ha.getName()];Ga||(Ga={},S[ha.getName()]=Ga);m=m.getChildren();for(S=0;S<m.length;S++)Ga[m[S].getName()]=m[S]}};this.cloneMe=function(){var m=new Ha,S={},ha={},Ga;for(Ga in q){var sb=q[Ga],p=sb.getParentEntity();p=p?S[p.getName()]:null;sb=sb.cloneMe(p);
S[sb.getName()]=sb;m.onlyPushEntity(sb);Eb(sb,ha)}for(Ga in G)sb=G[Ga].toJsonObject(),p=new oa,p.fromJsonObject(sb,S),m.addRelation(p);for(Ga in R)S=new Kb,S.fromJsonObject(R[Ga].toJsonObject(),ha),m.addUnionInnerEntityRelation(S);return m};this.getSourcesMap=function(m){for(var S={},ha=0;ha<m.length;ha++){var Ga=l.getSource(m[ha]);S[Ga.getName()]=Ga}return S};this.getSourcesArr=function(m){for(var S=[],ha=0;ha<m.length;ha++){var Ga=l.getSource(m[ha]);S.push(Ga)}return S};this.getSource=function(m){if(m.dbType)var S=
new pb;else if(m.fileType)S=m.fileType!=Pc.TYPE_EXCEL?new Ea:new Wb;else if(m.openAPIType)S=new qa,"RESTFUL_DATA_SET"==m.openAPIType?S.setOpenAPIType("RESTFUL_DATA_SET"):S.setOpenAPIType("PROGRAM_DATA_SET");else if(S=m.bizMetaType)S=dc.SourceType.createBizMetaSource(S);else throw Error("Modify here when new type of source appended.");S.fromJsonObject(m);return S};this.funClearUserSqlsAndStoredProcedures=function(m){for(var S=l.copyEntityArray(),ha=[],Ga=0;Ga<S.length;Ga++){var sb=S[Ga];sb instanceof
rc?ha.push(sb):sb instanceof Ub&&(ha=ha.concat(sb.getChildren()))}var p=m.getAllUserSqlName();if(p)for(S=0;S<p.length;S++){Ga=!0;for(var nc=p[S],jb=0;jb<ha.length;jb++){sb=ha[jb];var Fc=sb.getSource();if(m.getName()==Fc.getName()&&nc==sb.getName()){Ga=!1;break}}Ga&&m.removeUserSql(nc)}if(p=m.getAllStoredProcedureName())for(S=0;S<p.length;S++){Ga=!0;nc=p[S];for(jb=0;jb<ha.length;jb++)if(sb=ha[jb],Fc=sb.getSource(),m.getName()==Fc.getName()&&nc==sb.getName()){Ga=!1;break}Ga&&m.removeStoredProcedure(nc)}}}
function Jb(l,B,I){var q=I,G=Jb.LEVEL_ERROR,R=2E3;this.showMessageCurtain=function(J){switch(G){case Jb.LEVEL_SUCCESS:J.showSuccess(I,R);break;case Jb.LEVEL_WARNING:J.showPrompt(I,R);break;default:J.showError(I,R)}};this.setPromptLevel=function(J){switch(J){case Jb.LEVEL_SUCCESS:G=Jb.LEVEL_SUCCESS;break;case Jb.LEVEL_WARNING:G=Jb.LEVEL_WARNING;break;default:G=Jb.LEVEL_ERROR}};this.setDelayToClose=function(J){R=J};this.getEntityName=function(){return l};this.getFiltersErrorRow=function(){return B};
this.getPrompt=function(){return q};this.setPrompt=function(J){q=J}}function jc(l,B,I){this.getRelation=function(){return l};this.getOldValue=function(){return B};this.getNewValue=function(){return I}}function Cb(){var l=this,B,I,q,G,R,J,M=[],cb=[],rb=[],Ja,kb,Ac=[],Jc,Qc,ab,ic=!1,Eb,m;this.isUnion=function(){throw Error("Override me.");};this.getTreeRootProps=function(){return cb};this.getErrorDesc=function(){return m?m.getErrorDesc():""};this.setErrorInfo=function(X){m=X};this.getTreeRootProp=function(X){for(var Va=
0;Va<cb.length;Va++)if(X.getName()==cb[Va].getName())return cb[Va];return null};this.setTreeRootProps=function(X){cb=X};this.collectSources=function(X){throw Error("Override me.");};this.collectJsonSource=function(){throw Error("Override me.");};this.getErrorState=function(){return m?m.getErrorState():null};this.isErrorExist=function(){return m?!0:!1};this.mergeSource=function(X){throw Error("Override me.");};this.setFieldVisible=function(X){ic=X};this.getFieldVisible=function(){return ic};this.setChangedListener=
function(X){B=X};var S=function(X){B&&B(X)};this.setName=function(X){I=X};this.getName=function(){return I};this.setAlias=function(X){q=X;S(rc.KEY_CHANGE_ENTITYALIAS)};this.getAlias=function(){return q};this.getPropertyChildren=function(X){for(var Va=0;Va<cb.length;Va++)if(X==cb[Va].getName())return cb[Va].getChildren();return null};this.setAssociateName=function(X){R=X};this.getAssociateName=function(){return R};this.setCommentInfo=function(X){J=X};this.getCommentInfo=function(){return J};this.setColumnToRowProperties=
function(X){Eb=X};this.getColumnToRowProperties=function(){return Eb};this.syncPropertyFrom=function(X){for(var Va={},Ob=0;Ob<X.length;Ob++){var Db=X[Ob];Va[Db.getAssociateName()]=Db}for(Ob=0;Ob<M.length;Ob++)(X=Va[M[Ob].getAssociateName()])&&(M[Ob]=X)};this.refreshNotExistedProperty=function(X){var Va={};X.forEach(function(Db){Va[Db]=Db});for(X=0;X<M.length;X++){var Ob=M[X];Ob.setNotExisted(null!=Va[Ob.getName()])}};this.setProperties=function(X,Va){M=X;if(Ac&&M){if(!Va)for(Va={},X=0;X<M.length;X++){var Ob=
M[X];Va[Ob.getName()]=Ob}for(X=0;X<Ac.length;X++)Ac[X].updateProperty(Va)}};this.getProperties=function(){return M};this.getFilteredProperties=function(X){for(var Va=[],Ob=0;Ob<M.length;Ob++)X(M[Ob])&&Va.push(M[Ob]);return Va};this.getParild=function(){return rb};this.setParild=function(X){rb=X};this.getArrEntitySubView=function(){return Ja};this.getArrViewItem=function(){return kb};this.setFilters=function(X){Ac=X};this.getFilters=function(){return Ac};this.hasDirectModel=function(){return Jc};this.setDirectModel=
function(X){Jc=X};this.setDesign=function(X){Qc=X};this.getDesign=function(X){!Qc&&X&&(Qc=new oc);return Qc};this.setParentEntity=function(X){ab=X};this.getParentEntity=function(){return ab};this.findParentEntityByName=function(X){for(var Va=l;Va.getParentEntity();)if(Va=Va.getParentEntity(),Va.getName()==X)return Va;return null};this.getTopParentEntity=function(){for(var X=l;X.getParentEntity();)X=X.getParentEntity();return X};this.isSubNodeAtView=function(){return ab?!0:!1};this.fission=function(){};
this.getSubNodeLevel=function(){for(var X=0,Va=ab;Va;)X++,Va=Va.getParentEntity();return X};this.searchProperty=function(X){var Va=X.getParent();X=X.getName();if(Va){for(var Ob=0;Ob<cb.length;Ob++)if(Va.getName()==cb[Ob].getName()){var Db=cb[Ob].findProperty(X);if(Db)return Db}return null}for(Va=0;Va<M.length;Va++)if(M[Va].getName()==X)return M[Va];return l.findPropertyFromColumnToRowProperty(X)};this.findProperty=function(X){for(var Va=0;Va<M.length;Va++)if(M[Va].getName()==X)return M[Va];for(Va=
0;Va<cb.length;Va++){var Ob=cb[Va].findProperty(X);if(Ob)return Ob}return l.findPropertyFromColumnToRowProperty(X)};this.findPropertyFromColumnToRowProperty=function(X){var Va=l.getColumnToRowProperties();if(null!=Va&&0<Va.length)for(var Ob in Va){var Db=Va[Ob],ub=Db.getFieldNameProperty();if(X==ub.getName())return ub;var Pb=Db.getFieldValueProperties();for(aa in Pb)if(ub=Pb[aa],X==ub.getName()){X=void 0;Va=ub;Db=Db.getColumnToRowPropertyItems();if(M&&0<M.length){Ob={};for(X in M){var aa=M[X];ub=
aa.getName();Ob[ub]=aa}ub=aa=0;for(X in Db)for(La in Pb=Db[X].getPropertyValues(),Pb)aa++,Ob[Pb[La]]&&ub++;var La=ub==aa?Va:null}else La=void 0;return La}}return null};this.checkFilters=function(X){var Va=0;X=-1;for(var Ob=null,Db=0;Db<Ac.length;Db++){var ub=Ac[Db];if(!ub.isEmpty()&&(Ob=ub,Va+=ub.getLeftBracketCount(),Va-=ub.getRightBracketCount(),0>X&&0!=Va&&(X=Db),0>Va))return Va=Dc.get("bracketMismatch","\u5de6\u53f3\u62ec\u53f7\u4e0d\u5339\u914d\u3002"),new Jb(I,X,Va)}if(0<Va)return Va=Dc.get("bracketMismatch",
"\u5de6\u53f3\u62ec\u53f7\u4e0d\u5339\u914d\u3002"),new Jb(I,X,Va);for(Db=0;Db<Ac.length;Db++)if(ub=Ac[Db],!ub.isEmpty()&&ub!=Ob&&!ub.getLogicOp())return Va=Dc.get("lackLogicalSymbol","\u7b2c#1\u884c\u7f3a\u5c11\u903b\u8f91\u7b26"),Va=Va.replace("#1",Db+1),new Jb(I,Db,Va);return null};this.toExecuteJsonArr=function(X){X.push(l.toExecutableJsonObject());ab&&ab.toExecuteJsonArr(X)};this.toExecutableJsonObject=function(){var X={};X.name=I;X.alias=q;X.associateName=R;ab&&(X.parentName=ab.getName());ha(X);
Ga(X);sb(X);p(X);l.protectedToJsonObject(X);return X};this.toPropertiesJsonObject=function(X){var Va={};ha(Va,X);return Va.properties};this.toOutputPropertiesJsonObject=function(X){for(var Va={},Ob=[],Db=l.getOutputProperties(M),ub=0;ub<Db.length;ub++)if(!X||!X(Db[ub])){var Pb=Db[ub].toJsonObject();Ob.push(Pb)}Va.properties=Ob;return Va.properties};var ha=function(X,Va){for(var Ob=[],Db=0;Db<M.length;Db++)if(!Va||!Va(M[Db])){var ub=M[Db].toJsonObject();Ob.push(ub)}X.properties=Ob},Ga=function(X){for(var Va=
[],Ob=0;Ob<rb.length;Ob++){var Db=rb[Ob].toJsonObject();Va.push(Db)}X.parilds=Va},sb=function(X){for(var Va=[],Ob=0;Ob<Ac.length;Ob++){var Db=Ac[Ob];Db.isEmpty()||(Db=Db.toJsonObject(),Va.push(Db))}X.filters=Va};this.toJsonObject=function(){var X={};X.name=I;X.alias=q;X.associateName=R;X.directModel=Jc;Qc&&(X.design=Qc.toJsonObject());ab&&(X.parentName=ab.getName());ha(X);Ga(X);if(Ja){for(var Va=[],Ob=0;Ob<Ja.length;Ob++){var Db=Ja[Ob].toJsonObject();Va.push(Db)}X.subViews=Va}if(kb){Va=[];for(Ob=
0;Ob<kb.length;Ob++)Va.push(kb[Ob].toJsonObject());X.viewItems=Va}sb(X);p(X);l.protectedToJsonObject(X);return X};var p=function(X){if(Eb){var Va=[],Ob;for(Ob in Eb)Va.push(Eb[Ob].toJsonObject());X.columnToRowProperties=Va}};this.cloneMe=function(){throw Error("override me");};this.getErrorInfo=function(){return m};this.setTitle=function(X){G=X};this.getTitle=function(){return G};this.fromJsonObject=function(X,Va,Ob){I=X.name;q=X.alias;G=X.title;R=X.associateName;J=X.commentInfo;Jc=X.directModel;
var Db=X.design,ub=X.errorInfo;ub&&(m=new Bc,m.fromJsonObject(ub));Db&&(Qc=new oc,Qc.fromJsonObject(Db));ab=(Db=X.parentName)?Ob[Db]:null;Db={};var Pb=X.properties;if(Pb)for(ub=0;ub<Pb.length;ub++){var aa=Pb[ub],La=new bb;La.fromJsonObject(aa);M.push(La);Db[La.getName()]=La}if(Pb=X.treeNodeProperties)for(ub=0;ub<Pb.length;ub++)aa=new xc,aa.fromJsonObject(Pb[ub]),La=Db[aa.getName()],aa.bindProperty(La),cb.push(aa);if(ub=X.parilds)for(Pb=0;Pb<ub.length;Pb++)aa=ub[Pb],La=new $b,La.fromJsonObject(aa,
Db),rb.push(La);if(ub=X.subViews)for(Ja=[],Pb=0;Pb<ub.length;Pb++)aa=ub[Pb],La=new tc(l),La.fromJsonObject(aa,Db),Ja.push(La);if(ub=X.viewItems)for(kb=[],Pb=0;Pb<ub.length;Pb++)aa=ub[Pb],La="undefined"!=typeof aa.alias?new Ka:new Fb,La.fromJsonObject(aa,Db),kb.push(La);if(ub=X.columnToRowProperties){Eb=[];for(var T in ub){Pb=new Kc;Pb.fromJsonObject(ub[T]);aa=Pb.getFieldNameProperty();Db[aa.getName()]=aa;aa=Pb.getFieldValueProperties();if(null!=aa&&0<aa.length)for(var V in aa)La=aa[V],Db[La.getName()]=
La;Eb.push(Pb)}}if(T=X.filters)for(V=0;V<T.length;V++)ub=T[V],Pb=new Za,Pb.fromJsonObject(ub,Db),Ac.push(Pb);l.protectedFromJsonObject(X,Va,Ob)};this.protectedToJsonObject=function(X){throw Error("Override me.");};this.protectedFromJsonObject=function(X,Va,Ob){throw Error("Override me.");};this.getChooseRelationProperties=function(){return nc(M,!0,!0)};this.getOutputProperties=function(X){return nc(X,!0,!0)};var nc=function(X,Va,Ob){var Db=l.getColumnToRowProperties();if(null==Db||0==Db.length||!Va&&
!Ob)return X;var ub=[],Pb=[],aa=[],La;for(La in Db){var T=Db[La];aa.push(T.getFieldNameProperty());aa=aa.concat(T.getFieldValueProperties());T=T.getColumnToRowPropertyItems();for(var V in T)Pb=Pb.concat(T[V].getPropertyValues())}if(Va&&null!=Pb&&0<Pb.length)for(V=0;V<X.length;V++)-1==Pb.indexOf(X[V].getName())&&ub.push(X[V]);if(Ob&&null!=aa&&0<aa.length)for(V in aa)ub.push(aa[V]);return ub};this.getPropertyViewNodes=function(){var X=[],Va=l.getProperties(),Ob=l.getParild();jb(X,Va,Ob);Va=l.getColumnToRowProperties();
if(null!=Va&&0!=Va.length){Ob=[];var Db=[],ub;for(ub in Va){var Pb=Va[ub];Db.push(Pb.getFieldNameProperty());Db=Db.concat(Pb.getFieldValueProperties());Pb=Pb.getColumnToRowPropertyItems();for(var aa in Pb)Ob=Ob.concat(Pb[aa].getPropertyValues())}if(null!=Ob&&0<Ob.length)for(aa=0;aa<X.length;aa++)-1!=Ob.indexOf(X[aa].getUniqueName())&&(X.splice(aa,1),aa--);null!=Db&&0<Db.length&&jb(X,Db,[])}return X};this.isSupportChangeFieldType=function(){return!0};this.isSupportCreateRelation=function(){return!0};
this.isSupportExtractData=function(){return!0};var jb=function(X,Va,Ob){for(var Db={},ub=0;ub<Va.length;ub++){var Pb=Va[ub];Db[Pb.getName()]=Pb}var aa={};for(ub=0;ub<Ob.length;ub++)Pb=Ob[ub],aa[Pb.getName()]=Pb;Fc(l,0,X,Db,aa);for(ub=0;ub<Va.length;ub++)Pb=Va[ub],Db[Pb.getName()]&&kd(Pb,0,X,Db,aa)},Fc=function(X,Va,Ob,Db,ub){var Pb=X.getArrEntitySubView();if(Pb)for(var aa=0;aa<Pb.length;aa++){var La=Pb[aa],T=new $a(La,Va);Ob.push(T);Fc(La,Va+1,Ob,Db,ub)}if(X=X.getArrViewItem())for(aa=0;aa<X.length;aa++){var V=
X[aa];if(V instanceof Ka){var ia=V;Pb=Va;La=Ob;T=Db;V=new $a(ia,Pb);La.push(V);if(V=ia.getItems())for(var ma=0;ma<V.length;ma++){ia=V[ma];var wa=Pb+1,xa=La,Aa=T;ia=ia.getProperty();kd(ia,wa,xa,Aa,void 0)}}else V instanceof Fb&&(Pb=Va,La=Ob,T=Db,ia=ub,V=V.getProperty(),kd(V,Pb,La,T,ia))}},kd=function(X,Va,Ob,Db,ub){if(X.getGroupName()){var Pb=ub[X.getGroupName()];if(Pb){var aa=new $a(Pb,Va);Ob.push(aa);delete ub[Pb.getName()]}Va+=1}aa=new $a(X,Va);Ob.push(aa);delete Db[X.getName()]};this.protectedMethod=
{fireChangedEvent:S}}function oc(){var l,B,I,q;this.setRectangle=function(G){l=G[0];B=G[1];I=G[2];q=G[3]};this.getRectangle=function(){return[l,B,I,q]};this.toJsonObject=function(){var G={};G.x=l;G.y=B;G.width=I;G.height=q;return G};this.fromJsonObject=function(G){l=G.x;B=G.y;I=G.width;q=G.height}}function rc(){Cb.call(this);var l=this,B=this.protectedMethod,I,q,G=-1,R;this.cloneMe=function(J){var M=new rc;M.setName(l.getName());M.setAssociateName(l.getAssociateName());M.setAlias(l.getAlias());M.setUnionLocation(G);
M.setUnionUnit(q);M.setERPCloudEntityType(R);M.setFieldVisible(l.getFieldVisible());M.setErrorInfo(l.getErrorInfo());M.setSource(I);M.setParentEntity(J);M.setCommentInfo(l.getCommentInfo());M.setTitle(l.getTitle());var cb=l.getProperties(),rb=[];J={};for(var Ja in cb){var kb=cb[Ja].cloneMe();rb.push(kb);J[kb.getName()]=kb}M.setProperties(rb);cb=M.getTreeRootProps();rb=l.getTreeRootProps();for(Ja in rb){kb=rb[Ja];var Ac=J[kb.getName()];Ac&&cb.push(kb.cloneMe(Ac))}cb=l.getFilters();rb=M.getFilters();
for(Ja in cb)cb[Ja].isEmpty()||(kb=cb[Ja].cloneMe(J),rb.push(kb));cb=l.getArrEntitySubView();rb=M.getArrEntitySubView();for(Ja in cb)kb=cb[Ja].toJsonObject(),Ac=new tc,Ac.fromJsonObject(kb,J),rb.push(Ac);cb=l.getArrViewItem();rb=M.getArrViewItem();for(Ja in cb)kb=cb[Ja].toJsonObject(),Ac="undefined"!=typeof kb.alias?new Ka:new Fb,Ac.fromJsonObject(kb,J),rb.push(Ac);cb=l.getParild();rb=M.getParild();for(Ja in cb)kb=new $b,kb.fromJsonObject(cb[Ja].toJsonObject(),J),rb.push(kb);return M};this.isUnion=
function(){return!1};this.collectSources=function(J){J[I.getName()]=I};this.collectJsonSource=function(J){J.push(I.toJsonObject())};this.getUnionLocation=function(){return G};this.setUnionLocation=function(J){G=J};this.getERPCloudEntityType=function(){return R};this.setERPCloudEntityType=function(J){R=J};this.fission=function(){I.fissionFor(l)};this.mergeSource=function(J){for(var M=0;M<J.length;M++){var cb=J[M];if(I.isTheSame(cb)){J=I;I=cb;I.mergeFrom(J);I.mergeFromSourceAndEntity(J,l);break}}};
this.setSource=function(J){I=J;B.fireChangedEvent(rc.KEY_CHANGE_SOURCE)};this.getSource=function(){return I};this.setUnionUnit=function(J){q=J};this.protectedToJsonObject=function(J){J.source=I.getName();q&&(J.isUnionUnit=q);J.unionLocation=G;J.erpCloudEntityType=R};this.protectedFromJsonObject=function(J,M,cb){I=M[J.source];J.isUnionUnit&&(q=J.isUnionUnit);G=J.unionLocation;R=J.erpCloudEntityType};this.isSupportChangeFieldType=function(){return I.isSupportChangeFieldType(l.getAssociateName())};this.isSupportCreateRelation=
function(){return I.isSupportCreateRelation(l.getAssociateName())};this.isSupportExtractData=function(){return I.isSupportExtractData(l.getAssociateName())}}function Kc(){var l,B=[],I=[];this.setFieldNameProperty=function(q){l=q};this.getFieldName=function(){return l?l.getName():""};this.getFieldNameProperty=function(){return l};this.getFieldValueProperties=function(){return B};this.getUsedColumnToRowPropertyNames=function(){var q=[];if(I&&0<I.length)for(var G in I){var R=I[G].getPropertyValues(),
J=void 0,M=q;if(R&&0<R.length)for(J in M=M?M:[],R)M.push(R[J])}return q};this.getFieldValueNames=function(){var q=[],G;for(G in B)q.push(B[G].getName());return q};this.getFieldValueName=function(q){return this.getFieldValueNames()[q]};this.setFieldValueProperties=function(q){B=q};this.addFieldNameProperty=function(q){l=new bb;l.setName(q);l.setAssociateName(q);l.setAlias(q);l.setDataType(bb.DT_STRING);l.setAppointedDataType(bb.DT_STRING)};this.setFieldName=function(q){l?(l.setName(q),l.setAlias(q),
l.setAssociateName(q)):this.addFieldNameProperty(q)};this.addFieldValueProperty=function(q,G){var R=new bb;R.setName(G);R.setAssociateName(G);R.setAlias(G);R.setDataType(bb.DT_STRING);R.setAppointedDataType(bb.DT_STRING);B[q]=R};this.addFieldValueName=function(q,G){var R=B[q];R?(R.setName(G),R.setAlias(G),R.setAssociateName(G)):this.addFieldValueProperty(q,G)};this.deleteFieldValueProperty=function(q){if(I&&0<I.length)for(var G=0;G<I.length;G++){var R=I[G];R&&R.getPropertyValues().splice(q,1)}B.splice(q,
1)};this.getFieldValueProperty=function(q){return B[q]};this.setColumnToRowPropertyItems=function(q){I=q};this.addColumnToRowPropertyItem=function(q,G){I[q]=G};this.deleteColumnToRowPropertyItem=function(q){I.splice(q,1)};this.getColumnToRowPropertyItem=function(q){return I[q]};this.getColumnToRowPropertyItems=function(){return I};this.toJsonObject=function(){var q={};q.fieldNameProperty=l.toJsonObject();var G=[],R;for(R in B)G.push(B[R].toJsonObject());q.fieldValueProperties=G;G=[];if(I){for(R=0;R<
I.length;R++)G.push(I[R].toJsonObject());q.columnToRowPropertyItems=G}return q};this.fromJsonObject=function(q){l=new bb;l.fromJsonObject(q.fieldNameProperty);var G=q.columnToRowPropertyItems,R=[];if(G)for(var J=0;J<G.length;J++){var M=new Cc;M.fromJsonObject(G[J]);R.push(M)}I=R;if(q=q.fieldValueProperties)for(J=0;J<q.length;J++)G=q[J],R=new bb,R.fromJsonObject(G),B.push(R)}}function Cc(){var l,B=[];this.setFieldName=function(I){l=I};this.getFieldName=function(){return l};this.setPropertyValues=function(I){B=
I};this.getPropertyValues=function(){return B};this.toJsonObject=function(){var I={};I.fieldName=l;I.propertyValues=B.slice(0);return I};this.fromJsonObject=function(I){I.fieldName&&(l=I.fieldName);I.propertyValues&&(B=I.propertyValues)}}function xc(){var l,B=[],I,q,G={};this.cloneMe=function(R){var J=new xc;J.setVisibleInRelation(I);J.setTreeType(q);var M=J.getChildren();B.forEach(function(Ja){Ja=Ja.cloneMe();M.push(Ja)});var cb={},rb;for(rb in G)cb[rb]=G[rb];J.setPropNameToFlexFieldKeyMap(cb);J.bindProperty(R);
return J};this.getRefProp=function(){return l};this.setPropNameToFlexFieldKeyMap=function(R){G=R};this.getFlexFieldKey=function(R){return G[R]};this.setVisibleInRelation=function(R){I=R};this.setTreeType=function(R){q=R};this.fromJsonObject=function(R){l=new bb;l.fromJsonObject(R.me);I=R.visibleInRelation;q=R.treeType;G=R.propNameToFlexFieldKeyMap;if(R=R.children)for(var J=0;J<R.length;J++){var M=new bb;M.setParent(l);M.fromJsonObject(R[J]);B.push(M)}};this.getTreeType=function(){return q};this.findProperty=
function(R){for(var J=0;J<B.length;J++)if(B[J].getName()==R)return B[J];return null};this.getChildren=function(){return B};this.getName=function(){return l.getName()};this.bindProperty=function(R){l=R;l.setHasChild(!0);l.setTreeType(q);for(R=0;R<B.length;R++)B[R].setParent(l)};this.mergeFrom=function(R){if(R&&R.getTreeType()==q){var J={};for(cb in G){var M=G[cb];J[M]=M}var cb=R.getChildren();for(var rb=0;rb<cb.length;rb++){var Ja=cb[rb],kb=Ja.getName();G[kb]||(M=R.getFlexFieldKey(kb))&&!J[M]&&(J[M]=
M,G[kb]=M,M=Ja.cloneMe(),M.setParent(l),B.push(M))}}};this.getAssociateName=function(){return l.getAssociateName()};this.isVisibleInRelation=function(){return I}}function Ub(){Cb.call(this);var l=[],B=this,I=Ub.NOT_BIZ_UNION;this.getEntityChild=function(q){for(var G=0;G<l.length;G++)if(l[G].getName()==q)return l[G];return null};this.cloneMe=function(q){var G=new Ub;G.setName(B.getName());G.setAssociateName(B.getAssociateName());G.setAlias(B.getAlias());G.setUnionType(B.getUnionType());G.setParentEntity(q);
l.forEach(function(kb){var Ac;if(q){var Jc=kb.getUnionLocation(),Qc=q.getChildren(),ab;for(ab in Qc)Qc[ab].getUnionLocation()==Jc&&(Ac=Qc[ab])}G.getChildren().push(kb.cloneMe(Ac))});var R={};B.getProperties().forEach(function(kb){kb=kb.cloneMe();G.getProperties().push(kb);R[kb.getName()]=kb});var J=G.getTreeRootProps(),M=B.getTreeRootProps(),cb;for(cb in M){var rb=M[cb],Ja=R[rb.getName()];Ja&&J.push(rb.cloneMe(Ja))}J=B.getFilters();M=G.getFilters();for(cb in J)J[cb].isEmpty()||(rb=J[cb].cloneMe(R),
M.push(rb));return G};this.isSupportColumnToRow=function(){var q=!0;if(l)for(var G in l)if(!l[G].getSource().isSupportColumnToRow()){q=!1;break}return q};this.hasDirectModel=function(){for(var q=0;q<l.length;q++)if(l[q].hasDirectModel())return!0;return!1};this.setDirectModel=function(q){};this.isUnion=function(){return!0};this.getChildren=function(){return l};this.fission=function(){for(var q=0;q<l.length;q++)l[q].fission()};this.collectSources=function(q){for(var G=0;G<l.length;G++){var R=l[G].getSource();
q[R.getName()]=R}};this.collectJsonSource=function(q){for(var G=0;G<l.length;G++){var R=l[G].getSource();q.push(R.toJsonObject())}};this.mergeSource=function(q){for(var G=0;G<l.length;G++)for(var R=l[G],J=R.getSource(),M=0;M<q.length;M++){var cb=q[M];if(J.isTheSame(cb)){cb.mergeFrom(J);R.setSource(cb);break}}};this.protectedToJsonObject=function(q){for(var G=[],R=0;R<l.length;R++){var J=l[R].toJsonObject();G.push(J)}q.children=G;q.unionType=I};this.getUnionType=function(){return I};this.setUnionType=
function(q){I=q};this.protectedFromJsonObject=function(q,G,R){var J=q.children;q.unionType&&(I=q.unionType);if(I==Ub.NOT_BIZ_UNION)for(q=0;q<J.length;q++){var M=J[q],cb=new rc;cb.setUnionUnit(!0);cb.fromJsonObject(M,G,R);l.push(cb)}else if(I==Ub.BIZ_UNION){R=B.getParentEntity();var rb={};R&&R.getChildren().forEach(function(Ja){rb[Ja.getName()]=Ja});for(q=0;q<J.length;q++)M=J[q],cb=new rc,cb.setUnionUnit(!0),cb.fromJsonObject(M,G,rb),l.push(cb)}else throw Error("current union entity type is illegal");
};this.removeChild=function(q){for(var G=[],R=0;R<l.length;R++)l[R].getName()!=q.getName()&&G.push(l[R]);l=G};this.resetEntityChildren=function(q){l=q};this.indexOfEntity=function(q){for(var G=0;G<l.length;G++)if(l[G].getName()==q.getName())return G;return-1};this.supportRefreshEntity=function(){var q=!1;if(l)for(var G in l)if(q=l[G].getSource().supportRefreshEntity()){q=!0;break}return q}}function tc(l){var B=this,I,q,G,R;this.getName=function(){return I};this.getAlias=function(){return q};this.getArrEntitySubView=
function(){return G};this.getArrViewItem=function(){return R};this.toJsonObject=function(){var J={};J.name=I;J.alias=q;if(G){for(var M=[],cb=0;cb<G.length;cb++){var rb=G[cb].toJsonObject();M.push(rb)}J.subViews=M}if(R){M=[];for(cb=0;cb<R.length;cb++)M.push(R[cb].toJsonObject());J.viewItems=M}return J};this.fromJsonObject=function(J,M){I=J.name;q=J.alias;var cb=J.subViews;if(cb){G=[];for(var rb=0;rb<cb.length;rb++){var Ja=cb[rb],kb=new tc(B);kb.fromJsonObject(Ja,M);G.push(kb)}}if(J=J.viewItems)for(R=
[],cb=0;cb<J.length;cb++)rb=J[cb],Ja="undefined"!=typeof rb.alias?new Ka:new Fb,Ja.fromJsonObject(rb,M),R.push(Ja)}}function Ka(){var l,B,I;this.getName=function(){return l};this.getAlias=function(){return B};this.getItems=function(){return I};this.toJsonObject=function(){var q={};q.name=l;q.alias=B;if(I){for(var G=[],R=0;R<I.length;R++)G.push(I[R].toJsonObject());q.items=G}return q};this.fromJsonObject=function(q,G){l=q.name;B=q.alias;if(q=q.items){I=[];for(var R=0;R<q.length;R++){var J=q[R],M=new Fb;
M.fromJsonObject(J,G);I.push(M)}}}}function Fb(){var l,B;this.getName=function(){return l};this.getAlias=function(){return B.getAlias()};this.setAlias=function(I){B.setAlias(I)};this.getProperty=function(){return B};this.toJsonObject=function(){var I={};I.name=l;return I};this.fromJsonObject=function(I,q){l=I.name;q[l]&&(B=q[l])}}function wb(){var l,B,I;this.getEntityAssociateName=function(){return l};this.getPkPropertyName=function(){return B};this.getDisplayPropertyName=function(){return I};this.toJsonObject=
function(){var q={};q.entityAssociateName=l;q.pkPropertyName=B;q.displayPropertyName=I;return q};this.fromJsonObject=function(q){l=q.entityAssociateName;B=q.pkPropertyName;I=q.displayPropertyName}}function bb(){var l=this,B,I,q,G,R,J,M,cb,rb,Ja,kb,Ac=!1,Jc,Qc=!1,ab,ic=!1,Eb=!1,m=!1,S,ha,Ga=-1,sb=!1,p=!1;this.isNotExisted=function(){return m};this.setNotExisted=function(jb){m=jb};this.setParent=function(jb){ha=jb};this.setTreeType=function(jb){Ga=jb};this.getTreeType=function(){return Ga};this.getParent=
function(){return ha};this.setFieldVisible=function(jb){ic=jb};this.getFieldVisible=function(){return ic};this.getGroupName=function(){return B};this.setGroupName=function(jb){B=jb};this.setName=function(jb){I=jb};this.getName=function(){return I};this.setRelatedBaseProp=function(jb){ab=jb};this.getRelatedBaseProp=function(){return ab};this.setAssociateName=function(jb){q=jb};this.getAssociateName=function(){return q};this.setAlias=function(jb){G=jb};this.getAlias=function(){return G};this.setCommentInfo=
function(jb){R=jb};this.getCommentInfo=function(){return R};this.hasChild=function(){return S};this.setHasChild=function(jb){S=jb};this.setDataType=function(jb){nc(jb);J=jb};this.getDataType=function(){return J};var nc=function(jb){if(jb!==bb.DT_STRING&&jb!==bb.DT_INT&&jb!==bb.DT_NUMBER&&jb!==bb.DT_DATE&&jb!==bb.DT_DATETIME&&jb!==bb.DT_BOOLEAN)throw Error("IllegalArgument: "+jb);};this.setAppointedDataType=function(jb){jb&&nc(jb);M=jb==J?null:jb};this.getAppointedDataType=function(){return M};this.getOutputDataType=
function(){return M?M:J};this.setEnumValue=function(jb){rb=jb};this.getEnumValue=function(){return rb};this.isEnum=function(){return Ja?!1:rb?!0:!1};this.isVoidEnumProp=function(){return Ja};this.setForeignKey=function(jb){cb=jb};this.getForeignKey=function(){return cb};this.setFormatString=function(jb){kb=jb};this.getFormatString=function(){return kb};this.setHide=function(jb){Ac=jb?!0:!1};this.isHide=function(){return Ac};this.setHideInDataModeling=function(jb){Eb=jb};this.isHideInDataModeling=
function(){return Eb};this.setFormula=function(jb){Jc=jb};this.getFormula=function(){return Jc};this.isCalculatingField=function(){return Jc?!0:!1};this.setCalculatingFieldInvalid=function(jb){Qc=jb};this.isCalculatingFieldInvalid=function(){return Qc};this.setColumnToRowFieldInvalid=function(jb){p=jb};this.isColumnToRowFieldInvalid=function(){return p};this.setColumnToRowField=function(jb){sb=jb};this.isColumnToRowField=function(){return sb};this.toJsonObject=function(){var jb={};jb.group=B;jb.name=
I;jb.associateName=q;jb.alias=G;jb.dataType=J;M&&(jb.appointedDataType=M);kb&&(jb.format=kb);Ac&&(jb.hide=Ac);Jc&&(jb.formula=Jc);cb&&(jb.foreignKey=cb.toJsonObject());rb&&(jb.enumValue=rb);ab&&(jb.relatedBaseProperty=ab);Eb&&(jb.hideInDataModeling=Eb);return jb};this.fromJsonObject=function(jb){B=jb.group;I=jb.name;q=jb.associateName;G=jb.alias;R=jb.commentInfo;J=jb.dataType;M=jb.appointedDataType;kb=jb.format;Ac=jb.hide?!0:!1;Eb=jb.hideInDataModeling?jb.hideInDataModeling:!1;Jc=jb.formula;Qc=jb.isFormulaInvalid?
!0:!1;S=jb.hasChild?jb.hasChild:!1;m=jb.isNotExisted?jb.isNotExisted:!1;jb.foreignKey&&(cb=new wb,cb.fromJsonObject(jb.foreignKey));rb=jb.enumValue;Ja=jb.isVoidEnumProp;jb.relatedBaseProperty&&(ab=jb.relatedBaseProperty)};this.cloneMe=function(){var jb=new bb;jb.fromJsonObject(l.toJsonObject());jb.setColumnToRowField(sb);jb.setColumnToRowFieldInvalid(p);jb.setHasChild(S);jb.setCalculatingFieldInvalid(Qc);jb.setNotExisted(m);jb.setTreeType(Ga);jb.setCommentInfo(R);return jb}}function $b(){var l,B,
I,q,G,R,J,M,cb,rb;this.setName=function(Ja){l=Ja};this.getName=function(){return l};this.getAssociateName=function(){return B};this.setAssociateName=function(Ja){B=Ja};this.setAlias=function(Ja){I=Ja};this.getAlias=function(){return I};this.getNecessary=function(){return M};this.setNecessary=function(Ja){M=Ja};this.setIdFieldName=function(Ja){q=Ja};this.getIdFieldName=function(){return q};this.getIdField=function(){return cb};this.setParentIdFieldName=function(Ja){G=Ja};this.getParentIdFieldName=
function(){return G};this.getParentIdField=function(){return rb};this.setDefaultDisplayFieldName=function(Ja){R=Ja};this.getDefaultDisplayFieldName=function(){return R};this.setSortAccordingFieldName=function(Ja){J=Ja};this.getSortAccordingFieldName=function(){return J};this.toJsonObject=function(){var Ja={};Ja.name=l;Ja.associateName=B;Ja.alias=I;Ja.necessary=M;Ja.idField=q;Ja.parentIdField=G;R&&(Ja.defaultDisplayField=R);J&&(Ja.sortAccordingField=J);return Ja};this.fromJsonObject=function(Ja,kb){l=
Ja.name;B=Ja.associateName;I=Ja.alias;M=Ja.necessary;q=Ja.idField;G=Ja.parentIdField;Ja.defaultDisplayField&&(R=Ja.defaultDisplayField);Ja.sortAccordingField&&(J=Ja.sortAccordingField);cb=kb[q];rb=kb[G]}}function Hb(l,B,I){this.getTypeID=function(){return l};this.getI18nKey=function(){return B};this.getDefaultDesc=function(){return I}}function Tb(){this.getId=function(){throw new Exception("override me");};this.getDisplayName=function(){throw new Exception("override me");};this.getTextInUserSQL=function(){throw new Exception("override me");
};this.getFilterMode=function(){throw new Exception("override me");};this.getVariateType=function(){throw new Exception("override me");}}function Za(){var l=this,B,I,q,G=null,R=0,J=0,M=null,cb=null,rb=Za.COMPARE_WITH_APPOINTED;this.setProperty=function(Ja){B=Ja};this.getProperty=function(){return B};this.updateProperty=function(Ja){B&&(Ja=Ja[B.getName()])&&(B=Ja)};this.setCompareType=function(Ja){rb=Ja};this.setCompareOp=function(Ja){if(Ja===Za.COMPARE_EQUAL||Ja===Za.COMPARE_NOT_EQUAL||Ja===Za.COMPARE_GREATER||
Ja===Za.COMPARE_GREATER_EQUAL||Ja===Za.COMPARE_LESS||Ja===Za.COMPARE_LESS_EQUAL||Ja===Za.COMPARE_INCLUDE||Ja===Za.COMPARE_NOT_INCLUDE||Ja===Za.COMPARE_START_WITH||Ja===Za.COMPARE_END_WITH||Ja===Za.COMPARE_NULL||Ja===Za.COMPARE_NOT_NULL||Ja===Za.COMPARE_RELATIVE_DATE_RANGE||Ja===Za.COMPARE_VARIABLE||Ja===Za.COMPARE_IN||Ja===Za.COMPARE_NOT_IN)I=Ja;else throw Error("IllegalArgument: "+Ja);};this.getCompareOp=function(){return I};this.setValue=function(Ja){q=Ja};this.getValue=function(){return q};this.setValueMode=
function(Ja){if(Ja===Za.MODE_CONST||Ja===Za.MODE_SYS_VAR||Ja===Za.MODE_MACRO_VAR)G=Ja;else throw Error("IllegalArgument: "+Ja);};this.isSystemVariant=function(){return G==Za.MODE_SYS_VAR?!0:!1};this.isMacroVar=function(){return G==Za.MODE_MACRO_VAR?!0:!1};this.setLeftBracketCount=function(Ja){R=Ja};this.getLeftBracketCount=function(){return R};this.setRightBracketCount=function(Ja){J=Ja};this.getRightBracketCount=function(){return J};this.setLogicOp=function(Ja){if(null===Ja||Ja===Za.LOGIC_AND||Ja===
Za.LOGIC_OR)M=Ja;else throw Error("IllegalArgument: "+Ja);};this.getLogicOp=function(){return M};this.setRelativeDateRange=function(Ja){cb=Ja};this.getRelativeDateRange=function(){return cb};this.isEmpty=function(){return B?!1:!0};this.getComparedType=function(){return rb};this.getComparedDataType=function(){return B?rb?rb==Za.COMPARE_WITH_RAW?B.getDataType():B.getOutputDataType():B.isCalculatingField()?B.getOutputDataType():B.getDataType():null};this.checkCompletion=function(){if(!I)return Dc.get("lackComparisonOperator",
"\u7f3a\u5c11\u6bd4\u8f83\u7b26\u3002");for(var Ja=l.getComparedDataType(),kb=Za.getSelectableCompares(Ja,B.isEnum()),Ac=!1,Jc=0;Jc<kb.length;Jc++)if(I==kb[Jc]){Ac=!0;break}if(!Ac&&I!=Za.COMPARE_CUSTOM_VARIABALE)return Dc.get("comparisionMismatch","\u6bd4\u8f83\u7b26\u4e0d\u5339\u914d\u3002");if(!Za.isCompareOpWithoutValue(I)){if(!q&&!cb)return Dc.get("lackValue","\u7f3a\u5c11\u503c\u3002");if(Ja==bb.DT_NUMBER||Ja==bb.DT_INT){if(!Za.REG_NUMBER.test(q)&&G!=Za.MODE_SYS_VAR&&G!=Za.MODE_MACRO_VAR&&I!=
Za.COMPARE_IN&&I!=Za.COMPARE_NOT_IN)return Dc.get("valueMustBeNum","\u503c\u5fc5\u987b\u4e3a\u6570\u5b57\u3002")}else if(Ja==bb.DT_DATE||Ja==bb.DT_DATETIME)if(Za.isCompareOpRelativeDateRangeValue(I)){if(!(cb instanceof Sc))return Dc.get("invalidRelativeDateValue","\u65e0\u6548\u7684\u76f8\u5bf9\u65e5\u671f\u503c\u3002")}else{if(!Za.REG_DATETIME.test(q))return Dc.get("invalidDateValue","\u65e0\u6548\u7684\u65e5\u671f\u503c\u3002")}else if(Ja==bb.DT_BOOLEAN&&q!=bb.BOOLEAN_TRUE&&q!=bb.BOOLEAN_FALSE)return Dc.get("wrongBoolean",
"\u9519\u8bef\u7684\u5e03\u5c14\u503c\u3002")}return null};this.toJsonObject=function(){var Ja={};Ja.property=B.getName();Ja.compare=I;Ja.value=q;G&&(Ja.mode=G);0<R&&(Ja.leftBrackets=R);0<J&&(Ja.rightBrackets=J);M&&(Ja.logic=M);cb&&(Ja.relativeDateRange=cb.toJsonObject());rb&&(Ja.compareType=rb);return Ja};this.fromJsonObject=function(Ja,kb){B=kb[Ja.property];I=Ja.compare;q=Ja.value;G=Ja.mode;R=Ja.leftBrackets;J=Ja.rightBrackets;M=Ja.logic;if(kb=Ja.relativeDateRange)cb=new Sc,cb.fromJsonObject(kb);
rb=Ja.compareType};this.cloneMe=function(Ja){var kb=new Za;kb.setCompareOp(I);kb.setCompareType(rb);kb.setLeftBracketCount(R);kb.setRightBracketCount(J);B&&(Ja=Ja[B.getName()],kb.setProperty(Ja?Ja:B));kb.setLogicOp(M?M:null);kb.setValue(q);G&&kb.setValueMode(G);kb.setRelativeDateRange(cb);return kb}}function oa(){var l,B,I,q,G,R,J=0;this.setChangedListener=function(M){l=M};this.setFromEntity=function(M){var cb=B;B=M;l&&l(oa.KEY_FROM_ENTITY,cb,B)};this.getFromEntity=function(){return B};this.isInnerRelation=
function(){var M=I.getParentEntity();return M&&M==B?!0:!1};this.setToEntity=function(M){var cb=I;I=M;l&&l(oa.KEY_TO_ENTITY,cb,I)};this.getToEntity=function(){return I};this.setFromProperty=function(M){var cb=q;q=M;l&&l(oa.KEY_FROM_PROPERTY,cb,q)};this.getFromProperty=function(){return q};this.setToProperty=function(M){var cb=G;G=M;l&&l(oa.KEY_TO_PROPERTY,cb,G)};this.getToProperty=function(){return G};this.setRelated=function(M){if(M===oa.R_1_1||M===oa.R_1_N||M===oa.R_N_1){var cb=R;R=M;l&&l(oa.KEY_RELATED,
cb,R)}else throw Error("IllegalArgument: "+M);};this.getRelated=function(){return R};this.setFromPointKeepFifthWheel=function(M){J=M?J|oa.KFW_FROM:J&~oa.KFW_FROM};this.isFromPointKeepFifthWheel=function(){return(J&oa.KFW_FROM)==oa.KFW_FROM};this.setToPointKeepFifthWheel=function(M){J=M?J|oa.KFW_TO:J&~oa.KFW_TO};this.isToPointKeepFifthWheel=function(){return(J&oa.KFW_TO)==oa.KFW_TO};this.clone=function(){var M=new oa;M.setFromEntity(B);M.setToEntity(I);M.setFromProperty(q);M.setToProperty(G);M.setRelated(R);
M.setFromPointKeepFifthWheel(this.isFromPointKeepFifthWheel());M.setToPointKeepFifthWheel(this.isToPointKeepFifthWheel());return M};this.toJsonObject=function(){var M={};M.fromEntity=B.getName();M.toEntity=I.getName();M.fromProperty=q.getName();M.toProperty=G.getName();M.related=R;M.keepFifthWheel=J;return M};this.fromJsonObject=function(M,cb){var rb=M.fromEntity,Ja=M.toEntity,kb=M.fromProperty,Ac=M.toProperty;R=M.related;J=M.keepFifthWheel;B=cb[rb];I=cb[Ja];q=B?B.findProperty(kb):null;G=I?I.findProperty(Ac):
null}}function Kb(){var l,B=[];this.removeRelation=function(I){var q=[];B.forEach(function(G){G.getFromEntity()!=I&&G.getToEntity()!=I&&q.push(G)});B=q};this.addRelation=function(I){B.push(I)};this.getRelations=function(){return B};this.setRootUnionEntityName=function(I){l=I};this.getRootUnionEntityName=function(){return l};this.fromJsonObject=function(I,q){l=I.rootUnionEntityName;I=I.relations;q=q[l];for(var G=0;G<I.length;G++){var R=I[G],J=new oa;J.fromJsonObject(R,q);B.push(J)}};this.toJsonObject=
function(){var I={};I.rootUnionEntityName=l;for(var q=[],G=0;G<B.length;G++)q.push(B[G].toJsonObject());I.relations=q;return I}}function hc(){var l=this;this.getName=function(){throw Error("Override me.");};this.getTypeName=function(){throw Error("Override me.");};this.getShortDisplay=function(){throw Error("Override me.");};this.isTheSame=function(B){throw Error("Override me.");};this.mergeFrom=function(B){};this.mergeFromSourceAndEntity=function(B,I){};this.isModifiable=function(){throw Error("Override me.");
};this.fissionFor=function(B){};this.clone=function(){throw Error("Override me.");};this.toJsonObject=function(){throw Error("Override me.");};this.fromJsonObject=function(B){throw Error("Override me.");};this.fireChangeUrl=function(B){};this.isUserSql=function(B){return!1};this.isStoredProcedure=function(B){return!1};this.supportStoredProcedure=function(){return!1};this.getMergeType=function(){return null};this.supportMergeTable=function(){return!1};this.isSupportSelectField=function(){return!0};
this.isSupportFlexModel=function(){return!1};this.isSupportCustomField=function(){return!0};this.isSupportColumnToRow=function(){return!1};this.getEntityIconName=function(B){return l.isUserSql(B)?"custom-sql":l.isStoredProcedure(B)?"stored-procedure":"table"};this.hasUserSql=function(){return!1};this.hasStoredProcedure=function(){return!1};this.isShowChangeSourceTypeButtonInMenu=function(){return!1};this.isBasedOnDB=function(){return!1};this.supportRefreshEntity=function(){return!0};this.isShowEntityMark=
function(){return!1};this.getConnectionType=function(){return hc.DBCONNECTION_TYPE_UNKNOWN};this.isSupportChangeFieldType=function(B){return!0};this.isSupportCreateRelation=function(B){return!0};this.isSupportExtractData=function(B){return!0};this.getDisplayName=function(B){return""}}function Lb(){var l,B,I;this.setTimezone=function(q){l=q};this.getTimezone=function(){return l};this.setCharset=function(q){B=q};this.getCharset=function(){return B};this.getOtherSetting=function(){return I};this.setOtherSetting=
function(q){I=q};this.fromJsonObject=function(q){l=q.timezone;B=q.charset;I=q.otherSetting};this.toJsonObject=function(){var q={};q.timezone=l;q.charset=B;q.otherSetting=I;return q}}function pb(){hc.call(this);var l=this,B,I,q,G,R,J,M,cb,rb,Ja,kb={},Ac={},Jc=!0,Qc=new Lb;this.setName=function(ab){B=ab};this.getName=function(){return B};this.getAdvanceSetting=function(){return Qc};this.setAdvanceSetting=function(ab){Qc=ab};this.getTypeName=function(){return l.getDbType()};this.getDBAddress=function(){return q};
this.getShortDisplay=function(){return q+":"+G+" "+R};this.fireChangeUrl=function(ab){I!=pb.TYPE_ACCESS&&I!=pb.TYPE_SQLITE||l.setDbAddress(ab.getDbAddress())};this.isSupportColumnToRow=function(){return!0};this.getMergeType=function(){return hc.COMMON_MERGE};this.isTheSame=function(ab){return l.getTypeName()==ab.getTypeName()&&l.getDbType()==ab.getDbType()&&l.getDbAddress()==ab.getDbAddress()&&l.getDbPort()==ab.getDbPort()&&l.getDbName()==ab.getDbName()&&l.getUserName()==ab.getUserName()&&l.getPassword()==
ab.getPassword()&&l.getSchema()==ab.getSchema()&&l.getDbVersion()==ab.getDbVersion()&&l.getConnectType()==ab.getConnectType()};this.mergeFrom=function(ab){for(var ic=ab.getAllUserSqlName(),Eb=0;Eb<ic.length;Eb++){var m=ic[Eb];ab.isUserSql(m)&&(m=ab.getUserSql(m),l.addUserSql(m))}ic=ab.getAllStoredProcedureName();for(Eb=0;Eb<ic.length;Eb++)m=ic[Eb],ab.isStoredProcedure(m)&&(m=ab.getStoredProcedure(m),l.addStoredProcedure(m))};this.isBasedOnDB=function(){return!0};this.isModifiable=function(){return!0};
this.supportMergeTable=function(){return!0};this.fissionFor=function(ab){var ic=new pb;ic.setDbType(I);ic.setDbAddress(q);ic.setDbPort(G);ic.setDbName(R);ic.setUserName(J);ic.setPassword(M);ic.setSchema(cb);ic.setDbVersion(rb);ic.setConnectType(Ja);ab=ab.getName();if(l.isUserSql(ab)){var Eb=l.getUserSql(ab);ic.addUserSql(Eb);l.removeUserSql(ab)}l.isStoredProcedure(ab)&&(Eb=l.getStoredProcedure(ab),ic.addStoredProcedure(Eb),l.removeStoredProcedure(ab));return ic};this.clone=function(){var ab=new pb;
ab.setName("s"+(new Date).getTime());ab.setDbType(I);ab.setDbAddress(q);ab.setDbPort(G);ab.setDbName(R);ab.setUserName(J);ab.setPassword(M);ab.setSchema(cb);ab.setDbVersion(rb);ab.setConnectType(Ja);var ic={},Eb;for(Eb in kb)ic[Eb]=kb[Eb];ab.setAllUserSql(ic);ic={};for(var m in Ac)ic[m]=Ac[m];ab.setAllStoredProcedure(ic);return ab};this.setDbType=function(ab){I=ab};this.getDbType=function(){return I};this.setDbAddress=function(ab){q=ab};this.getDbAddress=function(){return q};this.setDbPort=function(ab){G=
ab};this.getDbPort=function(){return G};this.setDbName=function(ab){R=ab};this.getDbName=function(){return R};this.setUserName=function(ab){J=ab};this.getUserName=function(){return J};this.setPassword=function(ab){M=ab};this.getPassword=function(){return M};this.setIsPasswordUpdated=function(ab){Jc=ab};this.isPasswordUpdated=function(){return Jc};this.setSchema=function(ab){cb=ab};this.getSchema=function(){return cb};this.setDbVersion=function(ab){rb=ab};this.getDbVersion=function(){return rb};this.setConnectType=
function(ab){Ja=ab};this.getConnectType=function(){return Ja};this.setAllUserSql=function(ab){kb=ab};this.getAllUserSql=function(){return kb};this.addUserSql=function(ab){var ic=ab.getName();kb[ic]=ab};this.removeUserSql=function(ab){delete kb[ab]};this.getUserSql=function(ab){return kb[ab]};this.getAllUserSqlName=function(){var ab=[],ic;for(ic in kb)ab.push(ic);return ab};this.isUserSql=function(ab){return kb[ab]?!0:!1};this.hasUserSql=function(){return kb&&"{}"!==JSON.stringify(kb)?!0:!1};this.hasStoredProcedure=
function(){return Ac&&"{}"!==JSON.stringify(Ac)?!0:!1};this.setAllStoredProcedure=function(ab){Ac=ab};this.getAllStoredProcedure=function(){return Ac};this.addStoredProcedure=function(ab){var ic=ab.getName();Ac[ic]=ab};this.removeStoredProcedure=function(ab){delete Ac[ab]};this.getStoredProcedure=function(ab){return Ac[ab]};this.getAllStoredProcedureName=function(){var ab=[],ic;for(ic in Ac)ab.push(ic);return ab};this.isStoredProcedure=function(ab){return Ac[ab]?!0:!1};this.supportStoredProcedure=
function(){return pb.PRECEDURE_SUPPORT.some(function(ab){return I==ab})};this.fromJsonObject=function(ab){B=ab.name;I=ab.dbType;q=ab.dbAddress;G=ab.dbPort;R=ab.dbName;J=ab.userName;M=Hc.decode(ab.password);ab.schema&&(cb=ab.schema);ab.dbVersion&&(rb=ab.dbVersion);ab.connectType&&(Ja=ab.connectType);var ic=ab.userSqls;if(ic)for(var Eb=0;Eb<ic.length;Eb++){var m=ic[Eb],S=new yc;S.fromJsonObject(m);l.addUserSql(S)}ab.advanceSetting&&Qc.fromJsonObject(ab.advanceSetting);if(ab=ab.storedProcedures)for(Eb=
0;Eb<ab.length;Eb++)ic=ab[Eb],m=new bd,m.fromJsonObject(ic),l.addStoredProcedure(m)};this.toJsonObject=function(){var ab={};ab.name=B;ab.dbType=I;ab.dbAddress=q;ab.dbPort=G;ab.dbName=R;ab.userName=J;ab.password=Hc.encode(M);cb&&(ab.schema=cb);rb&&(ab.dbVersion=rb);Ja&&(ab.connectType=Ja);for(var ic=[],Eb=l.getAllUserSqlName(),m=0;m<Eb.length;m++){var S=Eb[m];l.isUserSql(S)&&(S=l.getUserSql(S),ic.push(S.toJsonObject()))}ab.userSqls=ic;ic=[];Eb=l.getAllStoredProcedureName();for(m=0;m<Eb.length;m++)S=
Eb[m],l.isStoredProcedure(S)&&(S=l.getStoredProcedure(S),ic.push(S.toJsonObject()));ab.storedProcedures=ic;ab.advanceSetting=Qc.toJsonObject();return ab};this.supportRefreshEntity=function(){return!0};this.getConnectionType=function(){return hc.DBCONNECTION_TYPE_DB}}function yc(){var l,B,I;this.setName=function(q){l=q};this.getName=function(){return l};this.setContent=function(q){B=q};this.getContent=function(){return B};this.setSqlType=function(q){I=q};this.getSqlType=function(){return I};this.fromJsonObject=
function(q){l=q.name;B=q.content;I=q.sqlType};this.toJsonObject=function(){var q={};q.name=l;q.content=B;q.sqlType=I;return q}}function Nb(){var l,B,I,q;this.getName=function(){return l};this.setName=function(G){l=G};this.getValueMode=function(){return B};this.setValueMode=function(G){B=G};this.getDataType=function(){return I};this.setDataType=function(G){I=G};this.getValue=function(){return q};this.setValue=function(G){q=G};this.fromJsonObject=function(G){l=G.name;B=G.valueMode;I=G.dataType;q=G.value};
this.toJsonObject=function(){var G={};G.name=l;G.valueMode=B;G.dataType=I;G.value=q;return G};this.getDataTypeText=function(){switch(I){case Nb.DATA_STRING:var G=Dc.get("text","\u6587\u672c");break;case Nb.DATA_NUMBER:G=Dc.get("number","\u6570\u503c");break;case Nb.DATA_INT:G=Dc.get("integer","\u6574\u6570");break;case Nb.DATA_DATE:G=Dc.get("dataTypeDate","\u65e5\u671f");break;case Nb.DATA_DATETIME:G=Dc.get("dateTime","\u65e5\u671f\u65f6\u95f4");break;case Nb.DATA_BOOLEAN:G=Dc.get("bool","\u5e03\u5c14");
break;case Nb.DATA_CURSOR:G=Dc.get("cursor","\u6e38\u6807");break;default:G=""}return G}}function Ec(){Nb.call(this);var l=this,B;this.getIoType=function(){return B};this.setIoType=function(I){B=I};this.fromJsonObject=function(I){l.setName(I.name);l.setValueMode(I.valueMode);l.setDataType(I.dataType);l.setValue(I.value);l.setIoType(I.ioType)};this.toJsonObject=function(){var I={};I.name=l.getName();I.valueMode=l.getValueMode();I.dataType=l.getDataType();I.value=l.getValue();I.ioType=l.getIoType();
return I};this.getIoTypeText=function(){var I;B==Ec.PROCEDUREIOTYPE_IN?I=Dc.get("inParameter","\u8f93\u5165\u53c2\u6570"):B==Ec.PROCEDUREIOTYPE_OUT?I=Dc.get("outParameter","\u8f93\u51fa\u53c2\u6570"):B==Ec.PROCEDUREIOTYPE_INOUT&&(I=Dc.get("inOutParameter","\u8f93\u5165\u8f93\u51fa\u53c2\u6570"));return I}}function bd(){var l,B,I,q,G=[],R=!1;this.getAssociateName=function(){return l};this.setAssociateName=function(J){l=J};this.getName=function(){return B};this.setName=function(J){B=J};this.getOutResultIdx=
function(){return I};this.setOutResultIdx=function(J){I=J};this.getCursorFieldName=function(){return q};this.setCursorFieldName=function(J){q=J};this.getParameters=function(){return G};this.setParameters=function(J){G=J};this.getIsChange=function(){return R};this.setIsChange=function(J){R=J};this.fromJsonObject=function(J){l=J.associateName;B=J.name;I=J.outResultIdx;q=J.cursorFieldName;J=J.parameters;for(var M=0;M<J.length;M++){var cb=new Ec;cb.fromJsonObject(J[M]);G.push(cb)}};this.toJsonObject=
function(){var J={};J.associateName=l;J.name=B;J.outResultIdx=I;J.cursorFieldName=q;for(var M=[],cb=0;cb<G.length;cb++)M.push(G[cb].toJsonObject());J.parameters=M;return J};this.doCheckParameters=function(){for(var J=0;J<G.length;J++){var M=G[J],cb=M.getValue();if(cb){a:{var rb=void 0;var Ja=cb;for(rb in Hb.VARIANTTYPEENUM){var kb="'@"+Hb.VARIANTTYPEENUM[rb].getTypeID()+"'";if(Ja==kb){rb=!0;break a}}rb=!1}if(rb)break;if(M.getDataType()==bb.DT_NUMBER||M.getDataType()==bb.DT_INT){if(!Za.REG_NUMBER.test(cb))return M=
Dc.get("parametersPrompt","\u5b58\u50a8\u8fc7\u7a0b#1\uff0c\u53c2\u6570\u503c"),M=M.replace("#1",l),M+=Dc.get("incompleteFilter","\u7b2c#1\u884c\u4e0d\u5b8c\u6574\uff0c"),M=M.replace("#1",J+1),M+=Dc.get("valueMustBeNum","\u503c\u5fc5\u987b\u4e3a\u6570\u5b57\u3002"),new Uc(l,J,M)}else if(M.getDataType()==bb.DT_DATE||M.getDataType()==bb.DT_DATETIME){if(!Za.REG_DATETIME.test(cb))return M=Dc.get("parametersPrompt","\u5b58\u50a8\u8fc7\u7a0b#1\uff0c\u53c2\u6570\u503c"),M=M.replace("#1",l),M+=Dc.get("incompleteFilter",
"\u7b2c#1\u884c\u4e0d\u5b8c\u6574\uff0c"),M=M.replace("#1",J+1),M+=Dc.get("invalidDateValue","\u65e0\u6548\u7684\u65e5\u671f\u503c\u3002"),new Uc(l,J,M)}else if(M.getDataType()==bb.DT_BOOLEAN&&cb!=bb.BOOLEAN_TRUE&&cb!=bb.BOOLEAN_FALSE)return M=Dc.get("parametersPrompt","\u5b58\u50a8\u8fc7\u7a0b#1\uff0c\u53c2\u6570\u503c"),M=M.replace("#1",l),M+=Dc.get("incompleteFilter","\u7b2c#1\u884c\u4e0d\u5b8c\u6574\uff0c"),M=M.replace("#1",J+1),M+=Dc.get("wrongBoolean","\u9519\u8bef\u7684\u5e03\u5c14\u503c\u3002"),
new Uc(l,J,M)}}return null}}function Uc(l,B,I){this.getStoredProcedureName=function(){return l};this.getErrorRow=function(){return B};this.getPrompt=function(){return I}}function Pc(){hc.call(this);var l=this,B,I,q,G,R,J;this.setName=function(M){B=M};this.getName=function(){return B};this.setFileName=function(M){I=M};this.getFileName=function(){return I};this.setFileType=function(M){q=M};this.getFileType=function(){return q};this.setFileUrl=function(M){G=M};this.getFileUrl=function(){return G};this.getTypeName=
function(){return q};this.getShortDisplay=function(){return I};this.setCharacterSet=function(M){R=M};this.getCharacterSet=function(){return R};this.setDefineTypeRowCount=function(M){J=M};this.getDefineTypeRowCount=function(){return J};this.fireChangeUrl=function(M){l.setFileUrl(M.getFileUrl())};this.isSupportColumnToRow=function(){return!0};this.isTheSame=function(M){return l.getName()==M.getName()&&l.getFileType()==M.getFileType()&&l.getFileName()==M.getFileName()&&l.getFileUrl()==M.getFileUrl()};
this.isModifiable=function(){return!0};this.supportMergeTable=function(){return!0};this.getMergeType=function(){return hc.COMMON_MERGE};this.clone=function(){var M=new Pc;M.setName("s"+(new Date).getTime());M.setFileType(q);M.setFileName(I);M.setFileUrl(G);return M};this.toJsonObject=function(){var M={};M.name=B;M.fileType=q;M.fileName=I;M.fileUrl=G;M.characterSet=R;M.defineTypeRowCount=J;l.protectedToJsonObject(M);return M};this.fromJsonObject=function(M){B=M.name;q=M.fileType;I=M.fileName;G=M.fileUrl;
R=M.characterSet;J=M.defineTypeRowCount;l.protectedFromJsonObject(M)};this.protectedToJsonObject=function(M){throw Error("Override me.");};this.protectedFromJsonObject=function(M){throw Error("Override me.");};this.supportRefreshEntity=function(){return!1}}function Wb(){Pc.call(this);var l=this;this.clone=function(){var B=new Wb;B.setName("s"+(new Date).getTime());B.setFileType(l.getFileType());B.setFileName(l.getFileName());B.setFileUrl(l.getFileUrl());B.setCharacterSet(l.getCharacterSet());B.setDefineTypeRowCount(l.getDefineTypeRowCount());
return B};this.protectedToJsonObject=function(B){};this.protectedFromJsonObject=function(B){}}function cc(){Pc.call(this);var l=this;this.clone=function(){var B=new cc;B.setName("s"+(new Date).getTime());B.setFileType(l.getFileType());B.setFileName(l.getFileName());B.setFileUrl(l.getFileUrl());B.setCharacterSet(l.getCharacterSet());B.setDefineTypeRowCount(l.getDefineTypeRowCount());return B};this.protectedToJsonObject=function(B){};this.protectedFromJsonObject=function(B){}}function Ea(){Pc.call(this);
var l=this,B,I;this.setSplitSign=function(q){B=q};this.getSplitSign=function(){return B};this.setTextLimitSign=function(q){I=q};this.getTextLimitSign=function(){return I};this.clone=function(){var q=new Ea;q.setName("s"+(new Date).getTime());q.setFileType(l.getFileType());q.setFileName(l.getFileName());q.setFileUrl(l.getFileUrl());q.setCharacterSet(l.getCharacterSet());q.setDefineTypeRowCount(l.getDefineTypeRowCount());q.setSplitSign(B);q.setTextLimitSign(I);return q};this.protectedToJsonObject=function(q){q.splitSign=
B;q.textLimitSign=I};this.protectedFromJsonObject=function(q){B=q.splitSign;I=q.textLimitSign}}function qa(){hc.call(this);var l=this,B,I,q,G;this.setName=function(J){B=J};this.getName=function(){return B};this.isSupportColumnToRow=function(){return!0};this.setUrl=function(J){I=J};this.getUrl=function(){return I};this.setAuthModel=function(J){G=J};this.getAuthModel=function(){return G};this.setOpenAPIType=function(J){q=J};this.getOpenAPIType=function(){return q};this.getTypeName=function(){return l.getOpenAPIType()};
this.getShortDisplay=function(){return I};this.toJsonObject=function(){var J={};J.name=B;J.url=I;J.openAPIType=q;G&&(J.authModel=G);return J};this.fromJsonObject=function(J){B=J.name;I=J.url;q=J.openAPIType;G=J.authModel};this.clone=function(){var J=new qa;J.setName("s"+(new Date).getTime());J.setUrl(I);J.setOpenAPIType(q);J.setAuthModel(G);return J};this.isTheSame=function(J){return l.getTypeName()==J.getTypeName()&&l.getUrl()==J.getUrl()&&l.getOpenAPIType()==J.getOpenAPIType()&&R(J.getAuthModel())};
var R=function(J){var M=l.getAuthModel();if(null==M&&null==J)return!0;if(null!=M&&null!=J){if(M.authType!==J.authType)return!1;var cb=Object.keys(M),rb=Object.keys(J);if(cb.length!==rb.length)return!1;for(var Ja=0;Ja<cb.length;Ja++){var kb=cb[Ja];if(!rb.includes(kb)||M[kb]!==J[kb])return!1}return!0}return!1};this.isModifiable=function(){return!0};this.supportMergeTable=function(){return!0};this.getMergeType=function(){return hc.COMMON_MERGE};this.supportRefreshEntity=function(){return!0}}function $a(l,
B){this.getUniqueName=function(){return l.getName()};this.getDisplayName=function(){return l instanceof $b?"("+l.getAlias()+Dc.get("parentChildDimensionFieldDisplayName","\u7236\u5b50\u7ef4")+")":l instanceof Ka?"("+l.getAlias()+Dc.get("groupingPropertyFieldDisplayName","\u5c5e\u6027\u5206\u7ec4")+")":l instanceof tc?"("+l.getAlias()+Dc.get("subViweFieldDisplayName","\u5c5e\u6027\u5206\u8868")+")":l instanceof bb&&l.isCalculatingField()?"("+Dc.get("customFieldDisplayName","\u8ba1\u7b97\u5b57\u6bb5")+
")":l.getName()};this.getAlias=function(){return l.getAlias()};this.setAlias=function(I){l.setAlias(I)};this.getTreeLevel=function(){return B};this.getModel=function(){return l};this.isProperty=function(){return l instanceof bb}}function Ua(){var l,B,I,q;this.setId=function(G){l=G};this.getId=function(){return l};this.setName=function(G){B=G};this.getName=function(){return B};this.getMacroCheckResult=function(){return I};this.setMacroCheckResult=function(G){I=G};this.setType=function(G){q=G};this.getType=
function(){return q};this.fromJsonObject=function(G){console.log("fromJsonObject");l=G.id;B=G.name;q=G.type;G=G.macroCheckResult;I=new fb;I.fromJsonObject(G)}}function fb(){var l,B,I=[],q=[],G;this.getMacroId=function(){return l};this.setMacroId=function(R){l=R};this.getMacroStatus=function(){return B};this.setMacroStatus=function(R){B=R};this.getNoPermPropertyNames=function(){return I};this.setNoPermPropertyNames=function(R){I=R};this.addNoPermPropertyName=function(R){I.push(R)};this.getNotExistPropertyNames=
function(){return q};this.setNoPermPropertyNames=function(R){q=R};this.addNoPermPropertyName=function(R){q.push(R)};this.getAppNumber=function(){return G};this.setAppNumber=function(R){G=R};this.fromJsonObject=function(R){R&&(l=R.macroId,B=R.macroStatus,I=R.noPermPropertyNames,q=R.notExistPropertyNames,G=R.appNumber)};this.toJsonObject=function(){var R={};R.macroId=l;R.macroStatus=B;R.noPermPropertyNames=I;R.notExistPropertyNames=q;R.appNumber=G;return R}}function ea(){var l;this.getAuthType=function(){return l};
this.setAuthType=function(B){l=B};this.protectedToJsonObject=function(){throw Error("Override me.");};this.protectedFromJsonObject=function(B){throw Error("Override me.");}}function da(){ea.call(this);var l=this,B,I;this.getUserName=function(){return B};this.setUserName=function(q){B=q};this.getPassword=function(){return I};this.setPassword=function(q){I=q};this.protectedToJsonObject=function(){var q={};q.userName=B;q.psw=I;q.authType=sc.BASIC;return q};this.protectedFromJsonObject=function(q){B=
q.userName;I=q.psw;l.setAuthType(q.authType)}}function L(){ea.call(this);var l=this,B,I,q,G;this.getClientId=function(){return B};this.setClientId=function(R){B=R};this.getClientSecret=function(){return I};this.setClientSecret=function(R){I=R};this.getScope=function(){return q};this.setScope=function(R){q=R};this.getAuthURL=function(){return G};this.setAuthURL=function(R){G=R};this.protectedToJsonObject=function(){var R={};R.clientId=B;R.clientSecret=I;q&&(R.scope=q);R.authURL=G;R.authType=sc.BEARER;
return R};this.protectedFromJsonObject=function(R){B=R.clientId;I=R.clientSecret;q=R.scope;G=R.authURL;l.setAuthType(R.authType)}}function mc(){ea.call(this);var l=this,B,I;this.getUserName=function(){return B};this.setUserName=function(q){B=q};this.getPassword=function(){return I};this.setPassword=function(q){I=q};this.protectedToJsonObject=function(){var q={};q.userName=B;q.psw=I;q.authType=sc.DIGEST;return q};this.protectedFromJsonObject=function(q){B=q.userName;I=q.psw;l.setAuthType(q.authType)}}
function wc(){ea.call(this);var l=this,B,I,q,G,R,J,M,cb,rb,Ja;this.getTokenEnhanced=function(){return B};this.setTokenEnhanced=function(kb){B=kb};this.getAppId=function(){return I};this.setAppId=function(kb){I=kb};this.getAppSecret=function(){return q};this.setAppSecret=function(kb){q=kb};this.getUserType=function(){return G};this.setUserType=function(kb){G=kb};this.getUserTypeValue=function(){return R};this.setUserTypeValue=function(kb){R=kb};this.getProxyUser=function(){return J};this.setProxyUser=
function(kb){J=kb};this.getCosmicType=function(){return M};this.setCosmicType=function(kb){M=kb};this.getAccountId=function(){return rb};this.setAccountId=function(kb){rb=kb};this.getTenantId=function(){return Ja};this.setTenantId=function(kb){Ja=kb};this.getCosmicServerAddress=function(){return cb};this.setCosmicServerAddress=function(kb){cb=kb};this.protectedToJsonObject=function(){var kb={};kb.appId=I;kb.appSecret=q;kb.userType=G;kb.userTypeValue=R;kb.proxyUser=J;kb.cosmicType=M;cb&&(kb.accountId=
rb,kb.tenantId=Ja,kb.cosmicServerAddress=cb);kb.authType=sc.COSMIC;kb.tokenEnhanced=B;return kb};this.protectedFromJsonObject=function(kb){B=kb.tokenEnhanced;I=kb.appId;q=kb.appSecret;G=kb.userType;R=kb.userTypeValue;J=kb.proxyUser;M=kb.cosmicType;rb=kb.accountId;Ja=kb.tenantId;cb=kb.cosmicServerAddress;l.setAuthType(kb.authType)}}function Bc(){var l,B,I,q;this.setErrorState=function(G){l=G};this.getErrorState=function(){return l};this.getErrorDesc=function(){return B};this.getEntityName=function(){return I};
this.getCustomInfo=function(G){return q?q[G]:null};this.fromJsonObject=function(G){l=G.errorState;B=G.errorDesc;I=G.entityName;q=G.customInfo}}function Gc(){var l=[],B;this.getExtractUsers=function(){return l};this.setExtractUsers=function(I){l=I};this.getDefaultPolicy=function(){return B};this.setDefaultPolicy=function(I){B=I};this.toJsonObject=function(){for(var I={},q=[],G=0;G<l.length;G++)q.push(l[G].toJsonObject());I.extractUsers=q;I.defaultPolicy=B;return I};this.fromJsonObject=function(I){var q=
I.extractUsers;if(q){l=[];for(var G=0;G<q.length;G++){var R=new ld;R.fromJsonObject(q[G]);l.push(R)}}B=I.defaultPolicy}}function Wc(){}"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.data&&(com.kingdee.bos.qing.data={});var dc=com.kingdee.bos.qing.data;dc.Box=Ha;dc.AbstractEntity=Cb;dc.Entity=rc;dc.EntitySubView=
tc;dc.GroupView=Ka;dc.GroupItemView=Fb;dc.UnionEntity=Ub;dc.Property=bb;dc.Parild=$b;dc.ForeignKey=wb;dc.FilterItem=Za;dc.Relation=oa;dc.DBSource=pb;dc.DBAdvanceSetting=Lb;dc.BizUnionInnerEntityRelations=Kb;dc.AbstractBizMetaSource=function(){hc.call(this);var l=this,B,I;this.setName=function(q){B=q};this.getName=function(){return B};this.getTypeName=function(){return I};this.setTypeName=function(q){I=q};this.getShortDisplay=function(){return I};this.isTheSame=function(q){return l.getTypeName()==
q.getTypeName()&&l.protectedIsTheSame(q)};this.protectedIsTheSame=function(q){throw Error("Override me.");};this.mergeFrom=function(q){};this.isModifiable=function(){return!1};this.fissionFor=function(q){};this.clone=function(){};this.toJsonObject=function(){var q={};q.name=B;q.bizMetaType=I;l.protectedToJsonObject(q);return q};this.fromJsonObject=function(q){B=q.name;I=q.bizMetaType;l.protectedFromJsonObject(q)};this.protectedToJsonObject=function(q){throw Error("Override me.");};this.protectedFromJsonObject=
function(q){throw Error("Override me.");};this.supportRefreshEntity=function(){return!0};this.isPublic=function(){return!1}};dc.AbstractSource=hc;dc.FileSource=Pc;dc.ExcelSource=Wb;dc.TextSource=Ea;dc.XMLSource=cc;dc.SystemVarType=Hb;dc.SysVarAdapter=function(l){Tb.call(this);var B,I;this.getId=function(){return l.getTypeID()};this.getDisplayName=function(){return B?B(l):l.getI18nKey()};this.getTextInUserSQL=function(){return I?I(l):l.getI18nKey()};this.getFilterMode=function(){return Za.MODE_SYS_VAR};
this.getVariateType=function(){return Tb.VAR_TYPE_SYS};this.setDisplayNameFormater=function(q){B=q};this.setUserSQLFormater=function(q){I=q}};dc.AbstractVariateAdapter=Tb;dc.UserSqlObj=yc;dc.ParameterModel=Nb;dc.StoredProcedureParameterModel=Ec;dc.StoredProcedureModel=bd;dc.OpenAPISource=qa;dc.FiltersCheckingResult=Jb;dc.DesigntimeMacro=Ua;dc.MacroCheckResult=fb;dc.EntityErrorInfo=Bc;dc.SchemaInfo=function(){var l,B,I;this.setName=function(q){l=q};this.getName=function(){return l};this.setAlias=function(q){B=
q};this.getAlias=function(){return B};this.setType=function(q){I=q};this.getType=function(){return I}};dc.ExtractConfig=Gc;dc.ExtractPolicy=Wc;dc.PropertyViewNode=$a;dc.TreeProperty=xc;dc.ColumnToRowProperty=Kc;dc.ColumnToRowPropertyItem=Cc;dc.BasicAuthModel=da;dc.BearerAuthModel=L;dc.DigestAuthModel=mc;dc.CosmicAuthModel=wc;var Hc,Sc,Dc,cd,ld;(function(){var l=com.kingdee.bos.qing.common;Hc=l.Base64Util;Sc=l.RelativePeriodModel;l=com.kingdee.bos.qing.framework.common;Dc=l.MultilanguageManager.createPackageAccessor(dc);
l=com.kingdee.bos.qing.schedule;cd=l.QingSchedule;l=com.kingdee.bos.qing.biz.common;ld=l.ValueTextPair})();Ha.KEY_ADD_ENTITIES="addEntities";Ha.KEY_REMOVE_ENTITY="removeEntity";Ha.KEY_ADD_RELATION="addRelation";Ha.KEY_REMOVE_RELATION="removeRelation";Ha.KEY_MOVE_UP_RELATION="moveUpRelation";Ha.KEY_MOVE_DOWN_RELATION="moveDownRelation";Ha.KEY_REFRESH_ENTITY="refreshEntity";Ha.KEY_REFRESH_RELATION="refreshRelation";Jb.LEVEL_SUCCESS=0;Jb.LEVEL_WARNING=1;Jb.LEVEL_ERROR=2;Cb.ERROR_STATE_TABLENOTEXIST=
"TABLENOTEXIST";Cb.ERROR_STATE_MACROERROR="MACROERROR";Cb.ERROR_STATE_DB_CONN_FAILED="DB_CONNECT_FAILED";Cb.ERROR_STATE_FILENOTEXIST="FILENOTEXIST";Cb.ERROR_STATE_OPENAPINOTEXIST="OPENAPINOTEXIST";Cb.ERROR_STATE_NOTEXISTUSERAUTHORITY="NOTEXISTUSERAUTHORITY";Cb.ERROR_STATE_BIZMETANOTSUPPORT="BIZMETANOTSUPPORT";Cb.ERROR_STATE_NO_DB_CENTER_PERMISSION="NO_DBCENTER_PERMISSION";Cb.ERROR_STATE_NO_DPP_PERMISSION="NO_DPP_PERMISSION";Cb.ERROR_STATE_NO_DPP_ENTITY_PERMISSION="NO_DPP_ENTITY_PERMISSION";Cb.ERROR_STATE_DAMAGED_DPP_ENTITY=
"DAMAGED_DPP_ENTITY";Cb.ERROR_STATE_MACRO_NOT_FOUND="MACROERROR_NOTFOUND";Cb.ERROR_STATE_MACRO_DB_UNSET="MACROERROR_DBUNSET";Cb.ERROR_STATE_KSQL_NOT_SUPPORT="KSQL_NOT_SUPPORT";Cb.ERROR_STATE_STORED_PROCEDURE_NOT_SUPPORT="STORED_PROCEDURE_NOT_SUPPORT";Cb.ERROR_STATE_UNIONENTITY_CHILDTABLE_HAVE_PROBLEM="UNIONENTITY_CHILDTABLE_HAVE_PROBLEM";Cb.ERROR_STATE_SQL_EXECUTE_EXCEPTION="SQL_EXECUTE_EXCEPTION";Cb.ERROR_STATE_kSQL_EXECUTE_EXCEPTION="KSQL_EXECUTE_EXCEPTION";Cb.ERROR_STATE_SP_EXECUTE_EXCEPTION="SP_EXECUTE_EXCEPTION";
Cb.NO_QING_MODELER_LICENSE="NO_QING_MODELER_LICENSE";Cb.ENTITY_PARSE_EXCEPTION="ENTITY_PARSE_EXCEPTION";Cb.DATA_CENTER_APP_ERROR="DATA_CENTER_APP_ERROR";Cb.DB_CENTER_MACRO_UNAVAILABLE="DB_CENTER_MACRO_UNAVAILABLE";xc.TREE_TYPE_FLEX=0;xc.TREE_TYPE_CUSTOM=1;rc.KEY_CHANGE_ENTITYALIAS="changeEntityAlias";rc.KEY_CHANGE_SOURCE="changeEntitySource";Ub.BIZ_UNION="BIZ";Ub.NOT_BIZ_UNION="NOT_BIZ";bb.DT_BOOLEAN="BOOLEAN";bb.DT_INT="INT";bb.DT_NUMBER="NUMBER";bb.DT_DATE="DATE";bb.DT_DATETIME="DATETIME";bb.DT_STRING=
"STRING";bb.BOOLEAN_TRUE="true";bb.BOOLEAN_FALSE="false";bb.CUSTOM_BIZ_ENTITY_NAME_FIELD="custom_biz_entity_name";bb.confirmDefaultFormatString=function(l){switch(l.getOutputDataType()){case bb.DT_INT:l.setFormatString("#,##0");break;case bb.DT_NUMBER:l.setFormatString("#,##0.00");break;case bb.DT_STRING:case bb.DT_DATE:case bb.DT_DATETIME:case bb.DT_BOOLEAN:l.setFormatString("");break;default:throw Error("Unsure DataType");}};$b.Necessary={};$b.Necessary.Indispensable="Indispensable";$b.Necessary.RootRepresented=
"RootRepresented";Hb.VARIANTTYPEENUM=[new Hb("USER_ID","currentUserId","\u5f53\u524d\u7528\u6237ID"),new Hb("USER_NAME","currentUserName","\u5f53\u524d\u7528\u6237\u540d\u79f0"),new Hb("ORG_ID","currentGroupID","\u5f53\u524d\u7ec4\u7ec7ID"),new Hb("ORG_NAME","currentGroupNAME","\u5f53\u524d\u7ec4\u7ec7\u540d\u79f0"),new Hb("ORG_RANGE_ID","currentGroupRangeID","\u5f53\u524d\u7528\u6237\u4e1a\u52a1\u7ec4\u7ec7\u8303\u56f4(ID)"),new Hb("DEPARTMENT_IDS","currentDepartmentIds","\u5f53\u524d\u7528\u6237\u6240\u5c5e\u90e8\u95e8(ID)"),
new Hb("DEPARTMENT_AND_SUBORDINATE_IDS","currentDeptAndSubIds","\u5f53\u524d\u7528\u6237\u6240\u5c5e\u90e8\u95e8\u53ca\u4e0b\u7ea7(ID)"),new Hb("CHARGE_DEPARTMENT_IDS","currentChargeDeptId","\u5f53\u524d\u7528\u6237\u8d1f\u8d23\u7684\u90e8\u95e8(ID)"),new Hb("CHARGE_DEPARTMENT_AND_SUBORDINATE_IDS","currentChargeDeptAndSubIds","\u5f53\u524d\u7528\u6237\u8d1f\u8d23\u7684\u90e8\u95e8\u53ca\u4e0b\u7ea7(ID)"),new Hb("BIZ_UNIT_ORGRANG_ID","currentBizUnitOrgRangeIds","\u5f53\u524d\u7528\u6237\u4e1a\u52a1\u5355\u5143\u8303\u56f4(ID)"),
new Hb("ADMIN_ORG_RANGE_ID","currentAdminGroupRangeID","\u5f53\u524d\u4e1a\u52a1\u884c\u653f\u7ec4\u7ec7\u8303\u56f4(ID)"),new Hb("I18N","currentSystemLanguage","\u5f53\u524d\u7cfb\u7edf\u8bed\u8a00")];Hb.SUPPORTED_VAR_TYPE=[];Tb.VAR_TYPE_SYS="sys_var";Tb.VAR_TYPE_MACRO="macro_var";Za.REG_NUMBER=/^-?\d+(\.\d+)?$/;Za.REG_DATETIME=/^-?\d+(\.\d+)?$/;Za.COMPARE_WITH_RAW="RAW";Za.COMPARE_WITH_APPOINTED="APPOINTED";Za.MODE_CONST="Const";Za.MODE_SYS_VAR="SystemVar";Za.MODE_MACRO_VAR="MacroVar";Za.LOGIC_AND=
"AND";Za.LOGIC_OR="OR";Za.COMPARE_EQUAL="EQUAL";Za.COMPARE_NOT_EQUAL="NOT_EQUAL";Za.COMPARE_GREATER="GREATER";Za.COMPARE_GREATER_EQUAL="GREATER_EQUAL";Za.COMPARE_LESS="LESS";Za.COMPARE_LESS_EQUAL="LESS_EQUAL";Za.COMPARE_INCLUDE="INCLUDE";Za.COMPARE_NOT_INCLUDE="NOT_INCLUDE";Za.COMPARE_START_WITH="START_WITH";Za.COMPARE_END_WITH="END_WITH";Za.COMPARE_NULL="NULL";Za.COMPARE_NOT_NULL="NOT_NULL";Za.COMPARE_RELATIVE_DATE_RANGE="RELATIVE_DATE_RANGE";Za.COMPARE_VARIABLE="VARIABALE_MATCH";Za.COMPARE_CUSTOM_VARIABALE=
"CUSTOM_VARIABALE_MATCH";Za.COMPARE_IN="IN";Za.COMPARE_NOT_IN="NOT_IN";Za.COMPARES_FOR_STRING=[Za.COMPARE_VARIABLE,Za.COMPARE_EQUAL,Za.COMPARE_NOT_EQUAL,Za.COMPARE_INCLUDE,Za.COMPARE_NOT_INCLUDE,Za.COMPARE_START_WITH,Za.COMPARE_END_WITH,Za.COMPARE_NULL,Za.COMPARE_NOT_NULL,Za.COMPARE_IN,Za.COMPARE_NOT_IN];Za.COMPARES_FOR_ENUM=[Za.COMPARE_EQUAL,Za.COMPARE_NOT_EQUAL,Za.COMPARE_NULL,Za.COMPARE_NOT_NULL,Za.COMPARE_IN,Za.COMPARE_NOT_IN];Za.COMPARES_FOR_NUMBER=[Za.COMPARE_VARIABLE,Za.COMPARE_EQUAL,Za.COMPARE_NOT_EQUAL,
Za.COMPARE_GREATER,Za.COMPARE_GREATER_EQUAL,Za.COMPARE_LESS,Za.COMPARE_LESS_EQUAL,Za.COMPARE_NULL,Za.COMPARE_NOT_NULL,Za.COMPARE_IN,Za.COMPARE_NOT_IN];Za.COMPARES_FOR_DATETIME=[Za.COMPARE_RELATIVE_DATE_RANGE,Za.COMPARE_EQUAL,Za.COMPARE_NOT_EQUAL,Za.COMPARE_GREATER,Za.COMPARE_GREATER_EQUAL,Za.COMPARE_LESS,Za.COMPARE_LESS_EQUAL,Za.COMPARE_NULL,Za.COMPARE_NOT_NULL];Za.COMPARES_FOR_BOOLEAN=[Za.COMPARE_EQUAL,Za.COMPARE_NOT_EQUAL,Za.COMPARE_NULL,Za.COMPARE_NOT_NULL];Za.getSelectableCompares=function(l,
B){switch(l){case bb.DT_STRING:return B?Za.COMPARES_FOR_ENUM:Za.COMPARES_FOR_STRING;case bb.DT_NUMBER:case bb.DT_INT:return Za.COMPARES_FOR_NUMBER;case bb.DT_DATE:case bb.DT_DATETIME:return Za.COMPARES_FOR_DATETIME;case bb.DT_BOOLEAN:return Za.COMPARES_FOR_BOOLEAN;default:throw Error("Unknown DataType");}};Za.isCompareOpWithoutValue=function(l){return l==Za.COMPARE_NULL||l==Za.COMPARE_NOT_NULL};Za.isCompareOpRelativeDateRangeValue=function(l){return l==Za.COMPARE_RELATIVE_DATE_RANGE};Za.isCompareOpWithinOrNotWithinValue=
function(l){return l==Za.COMPARE_IN||l==Za.COMPARE_NOT_IN};oa.R_1_1="From1To1";oa.R_1_N="From1ToN";oa.R_N_1="FromNTo1";oa.KFW_FROM=1;oa.KFW_TO=2;oa.KEY_FROM_ENTITY="fromEntity";oa.KEY_FROM_PROPERTY="fromProperty";oa.KEY_FROM_PROPERTY_ALIAS_CHANED="fromPropertyAliasChanged";oa.KEY_TO_PROPERTY_ALIAS_CHANED="toPropertyAliasChanged";oa.KEY_TO_ENTITY="toEntity";oa.KEY_TO_PROPERTY="toProperty";oa.KEY_RELATED="related";hc.DBCONNECTION_TYPE_DB="DB";hc.DBCONNECTION_TYPE_DBCENTER="DBCenter";hc.DBCONNECTION_TYPE_SUPERQUERY=
"SuperQuery";hc.DBCONNECTION_TYPE_UNKNOWN="UnKnown";hc.BIZ_MERGE="BIZ_MERGE";hc.COMMON_MERGE="COMMON_MERGE";Lb.TIME_ZONE="timezone";Lb.CHARSET="charset";Lb.OTHER_SETTING="otherSetting";Lb.PREFIX="prefix";pb.TYPE_MYSQL="MYSQL";pb.TYPE_SQLSERVER="SQLSERVER";pb.TYPE_ORACLE="ORACLE";pb.TYPE_POSTGRESQL="POSTGRESQL";pb.TYPE_DB2="DB2";pb.TYPE_ACCESS="ACCESS";pb.TYPE_SQLITE="SQLITE";pb.TYPE_HIVE="HIVE";pb.TYPE_HANA="HANA";pb.TYPE_ODPS="ODPS";pb.TYPE_REDSHIFT="REDSHIFT";pb.TYPE_SYBASE="SYBASE";pb.TYPE_TIDB=
"TIDB";pb.TYPE_DM="DM";pb.TYPE_GREENPLUM="GREENPLUM";pb.TYPE_GAUSSDB="GAUSSDB";pb.TYPE_APACHEDRILL="APACHEDRILL";pb.TYPE_SPARKSQL="SPARKSQL";pb.TYPE_SYBASEIQ="SYBASEIQ";pb.TYPE_IMPALA="IMPALA";pb.TYPE_KYLIN="KYLIN";pb.TYPE_KINGBASE="KINGBASE";pb.TYPE_TDSQL="TDSQL";pb.TYPE_GBASE="GBASE";pb.TYPE_VASTBASE="VASTBASE";pb.TYPE_DORIS="DORIS";pb.TYPE_YASHANDB="YASHANDB";pb.TYPE_OCEANBASE_ORACLE="OCEANBASE_ORACLE";pb.SQLTYPE_SQL="SQL";pb.SQLTYPE_KSQL="KSQL";pb.KSQL_SUPPORT=[pb.TYPE_MYSQL,pb.TYPE_SQLSERVER,
pb.TYPE_ORACLE,pb.TYPE_POSTGRESQL,pb.TYPE_DB2,pb.TYPE_SYBASE,pb.TYPE_DM,pb.TYPE_GREENPLUM,pb.TYPE_KINGBASE,pb.TYPE_TDSQL,pb.TYPE_SYBASEIQ,pb.TYPE_GBASE,pb.TYPE_TIDB,pb.TYPE_VASTBASE,pb.TYPE_YASHANDB,pb.TYPE_GAUSSDB,pb.TYPE_OCEANBASE_ORACLE];pb.PRECEDURE_SUPPORT=[pb.TYPE_MYSQL,pb.TYPE_SQLSERVER,pb.TYPE_ORACLE,pb.TYPE_POSTGRESQL,pb.TYPE_DB2,pb.TYPE_SYBASE,pb.TYPE_DM,pb.TYPE_GREENPLUM,pb.TYPE_GAUSSDB,pb.TYPE_KINGBASE,pb.TYPE_SYBASEIQ,pb.TYPE_GBASE,pb.TYPE_VASTBASE,pb.TYPE_YASHANDB];pb.isNeedShowKSql=
function(l){return pb.KSQL_SUPPORT.some(function(B){return l==B})};pb.isNeedShowPrecedure=function(l){return pb.PRECEDURE_SUPPORT.some(function(B){return l==B})};Nb.DATA_BOOLEAN="BOOLEAN";Nb.DATA_INT="INT";Nb.DATA_NUMBER="NUMBER";Nb.DATA_DATE="DATE";Nb.DATA_DATETIME="DATETIME";Nb.DATA_STRING="STRING";Nb.DATA_CURSOR="CURSOR";Ec.PROCEDUREIOTYPE_IN="IN";Ec.PROCEDUREIOTYPE_OUT="OUT";Ec.PROCEDUREIOTYPE_INOUT="INOUT";Pc.TYPE_EXCEL="EXCEL";Pc.TYPE_CSV="CSV";Pc.TYPE_TXT="TXT";Pc.TYPE_XML="XML";qa.TYPE_RESTFUL_DATA_SET=
"RESTFUL_DATA_SET";qa.TYPE_PROGRAM_DATA_SET="PROGRAM_DATA_SET";qa.TYPE_OPENAPI="OpenAPI";dc.DesigntimeMacroCache=new function(){var l={};this.put=function(B,I){l[B]=I};this.get=function(B){return l[B]};this.clear=function(){l={}};this.convertToDesigntimeModel=function(B){console.log("convertToDesigntimeModel");if(B){var I=B.getRawModel(),q=new Ua;q.setId(B.getId());q.setName(B.getDisplayName());q.setType(I.getType());var G=new fb;G.setMacroId(B.getId());G.setMacroStatus(I.getMacroStatus());q.setMacroCheckResult(G);
return q}}};dc.AuthModelFactory=new function(){var l={};this.getImpl=function(B){if(B=l[B])return new B};this.registImpl=function(B,I){l[B]=I}};var sc=dc.AuthModelFactory;sc.BASIC="BASIC";sc.BEARER="BEARER";sc.DIGEST="DIGEST";sc.COSMIC="COSMIC";sc.registImpl(sc.BASIC,da);sc.registImpl(sc.BEARER,L);sc.registImpl(sc.DIGEST,mc);sc.registImpl(sc.COSMIC,wc);Wc.REAL_TIME=0;Wc.USE_THEME_CREATOR=1})();(function(){function Ha(){var Ub,tc={},Ka={},Fb=[],wb,bb=[];this.getName=function(){return Ub};this.setName=function($b){Ub=$b};this.getEntityAssociateNameMap=function(){return tc};this.getEntityByAssociateName=function($b){return tc[$b]};this.getFisrtEntity=function(){return wb?wb:bb[0]};this.getEntityMap=function(){return Ka};this.getRelations=function(){return Fb};this.getEntities=function(){return bb};this.toJsonObject=function(){var $b={};$b.name=Ub;for(var Hb=[],Tb=0;Tb<bb.length;Tb++)Hb.push(bb[Tb].toJsonObject());
$b.entities=Hb;Hb=[];for(Tb=0;Tb<Fb.length;Tb++)Hb.push(Fb[Tb].toJsonObject());$b.relations=Hb;return $b};this.cloneMe=function(){var $b=new Ha;$b.setName(Ub);for(var Hb=$b.getEntities(),Tb=$b.getEntityMap(),Za=$b.getEntityAssociateNameMap(),oa=0;oa<bb.length;oa++){var Kb=bb[oa];if(Kb.getParentEntity()){var hc=Tb[Kb.getParentEntity().getName()];Kb=Kb.cloneMe(hc)}else Kb=Kb.cloneMe(null);Hb.push(Kb);Tb[Kb.getName()]=Kb;Za[Kb.getAssociateName()]=Kb}Hb=$b.getRelations();for(oa=0;oa<Fb.length;oa++){Za=
Fb[oa];Kb=Za.clone();hc=Tb[Za.getFromEntity().getName()];var Lb=Tb[Za.getToEntity().getName()];Kb.setFromEntity(hc);Kb.setToEntity(Lb);Kb.setFromProperty(hc.findProperty(Za.getFromProperty().getName()));Kb.setToProperty(Lb.findProperty(Za.getToProperty().getName()));Hb.push(Kb)}return $b};this.fromJsonObject=function($b,Hb){Ub=$b.name;tc={};Ka={};Fb=[];bb=[];for(var Tb=$b.entities,Za=0;Za<Tb.length;Za++){var oa=Tb[Za];var Kb=oa.children?new Kc:new Cc;Kb.fromJsonObject(oa,Hb,Ka);wb||(wb=Kb);tc[Kb.getAssociateName()]=
Kb;Ka[Kb.getName()]=Kb;bb.push(Kb)}$b=$b.relations;for(Za=0;Za<$b.length;Za++)Hb=$b[Za],Tb=new rc,Tb.fromJsonObject(Hb,Ka),Fb.push(Tb)}}function Jb(){var Ub,tc,Ka,Fb,wb;this.setName=function(bb){Ub=bb};this.getName=function(){return Ub};this.setDisplayName=function(bb){tc=bb};this.getDisplayName=function(){return tc};this.setCommentInfo=function(bb){Ka=bb};this.getCommentInfo=function(){return Ka};this.setModelId=function(bb){Fb=bb};this.getModelId=function(){return Fb};this.setAssociateName=function(bb){Fb=
bb};this.getAssociateName=function(){return Fb};this.setParentNode=function(bb){wb=bb};this.getParentNode=function(){return wb};this.getSubNodeLevel=function(){for(var bb=-1,$b=wb;$b;)bb++,$b=$b.getParentNode();return bb}}function jc(){Jb.call(this);var Ub=this,tc=[];this.setChildren=function(Ka){tc=Ka};this.getChildren=function(){return tc};this.toJsonObject=function(){var Ka={};Ka.children=tc;return Ka};this.fromJsonObject=function(Ka){Ub.setName(Ka.name);Ub.setDisplayName(Ka.displayName);Ub.setCommentInfo(Ka.commentInfo);
if(Ka=Ka.children)for(var Fb=0;Fb<Ka.length;Fb++){var wb=Ka[Fb];if(wb.type){var bb=new Cb;bb.fromJsonObject(wb);bb.setParentNode(Ub);tc.push(bb)}else bb=new jc,bb.fromJsonObject(wb),bb.setParentNode(Ub),tc.push(bb)}}}function Cb(){Jb.call(this);var Ub=this,tc;this.setType=function(Ka){tc=Ka};this.getType=function(){return tc};this.fromJsonObject=function(Ka){Ub.setType(Ka.type);Ub.setName(Ka.name);Ub.setDisplayName(Ka.displayName);Ub.setCommentInfo(Ka.commentInfo);Ub.setAssociateName(Ka.id)}}"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.data&&(com.kingdee.bos.qing.data={});var oc=com.kingdee.bos.qing.data;oc.NameVO=function(){var Ub,tc;this.getName=function(){return Ub};this.getDisplayName=function(){return tc};this.fromJson=function(Ka){Ub=Ka.name;tc=Ka.displayName}};oc.PreviewDataModel=function(){var Ub,
tc,Ka,Fb,wb,bb=[],$b,Hb;this.getErrorEntityName=function(){return Hb?Hb.getEntityName():null};this.getErrorState=function(){return Hb?Hb.getErrorState():null};this.getErrorPreviewInfo=function(){return Hb?Hb.getErrorDesc():null};this.getErrorInfo=function(){return Hb};this.getSqlContent=function(){return Fb};this.getUnPushdownFilterContent=function(){return wb};this.getData=function(){return Ub};this.getWarmingMessage=function(){return tc};this.getRemovedClumns=function(){return Ka};this.getNotExistedPropNames=
function(){return bb};this.getCalcFieldCheckInfo=function(){return $b?$b.map:null};this.fromJsonObject=function(Tb){Ub=Tb.data;tc=Tb.warmingMessage;Ka=Tb.notExistedColumns;Fb=Tb.sqlContent;wb=Tb.unPushdownFilterContent;bb=Tb.notExistedPropNames;Tb.calcFieldCheckResponse&&($b=Tb.calcFieldCheckResponse);if(Tb=Tb.entityErrorInfo)Hb=new xc,Hb.fromJsonObject(Tb)}};oc.DesigntimeDataObject=Ha;oc.FolderNode=jc;oc.LeafNode=Cb;oc.SystemVarModel=function(){var Ub,tc;this.setName=function(Ka){Ub=Ka};this.setValue=
function(Ka){tc=Ka};this.getName=function(){return Ub};this.getValue=function(){return tc}};var rc=oc.Relation,Kc=oc.UnionEntity,Cc=oc.Entity,xc=oc.EntityErrorInfo})();(function(){function Ha(){var Fb=!1,wb=!1,bb=!1,$b=!1,Hb=!1;this.setEntityLocationChange=function(Tb){$b=Tb};this.setChildEntityChanged=function(Tb){Hb=Tb};this.isEntityLocationChanged=function(){return $b};this.setPropCheckChanged=function(Tb){Fb=Tb};this.setPropMapChanged=function(Tb){wb=Tb};this.setEntityMapChanged=function(Tb){bb=Tb};this.isUnionChanged=function(){return Fb||wb||bb||Hb}}function Jb(Fb,wb){var bb=this,$b=[],Hb,Tb=Fb,Za,oa=[],Kb,hc,Lb,pb,yc=[null,null],Nb,Ec,bd=new Ha;this.getUnionChangeState=
function(){return bd};this.setRelationFromProp=function(Wb){yc[0]=Wb};this.setRelationToProp=function(Wb){yc[1]=Wb};this.getInnerRelationProps=function(){return yc};this.isNeedRebuildUnion=function(){return bd.isUnionChanged()};this.setRowRemoveListener=function(Wb){Ec=Wb};this.setEntityMergeChangeListener=function(Wb){Nb=Wb};this.getEntityChangeListener=function(){return Nb};this.setFinalUnionEntity=function(Wb){hc=Wb};this.getFinalUnionEntity=function(){return hc};this.getCurrentUnionEntity=function(){return pb};
this.setOriginalUnionEntity=function(Wb){Lb=Wb};this.setCurrentUnionEntity=function(Wb){pb=Wb};this.getOriginalUnionEntity=function(){return Lb};this.setPropertyMapModels=function(Wb){Kb=Wb};this.getPropMapModels=function(){return Kb};this.getUnSelectedMapModels=function(){for(var Wb=[],cc=0;cc<Kb.length;cc++){var Ea=Kb[cc];Ea.isSelected()||Wb.push(Ea)}return Wb};this.getChildrenRows=function(){return oa};this.setParentRowModel=function(Wb){Za=Wb};this.getParentRowModel=function(){return Za};this.removeEntityCell=
function(Wb){$b.splice(Wb,1);for(var cc=0;cc<$b.length;cc++)cc<Wb||($b[cc].moveForward(),$b[cc].isNotEmptyCellNode()&&bd.setEntityLocationChange(!0));Tb--};this.findSameAliasRowModel=function(Wb,cc){if(0==oa.length)return null;for(var Ea=0;Ea<oa.length;Ea++){var qa=oa[Ea],$a=cc?qa.getFirstNotEmptyNode().getEntity():qa.getEntityCellNode(0).getEntity();$a=$a?$a.getAlias():"";if($a==Wb.getAlias())return qa;$a=$a.split("_");var Ua=Wb.getAlias().split("_");if(1<$a.length&&1<Ua.length){if($a[0]==Ua[0]&&
Uc($a[1])&&Uc(Ua[1]))return qa}else if(1<$a.length&&1==Ua.length){if($a[0]==Ua[0]&&Uc($a[1]))return qa}else if(1==$a.length&&1<Ua.length&&$a[0]==Ua[0]&&Uc(Ua[1]))return qa}return null};var Uc=function(Wb){return/^[0-9]+.?[0-9]*$/.test(Wb)};this.isEmptyRow=function(){for(var Wb=0;Wb<$b.length;Wb++)if($b[Wb].isNotEmptyCellNode())return!1;return!0};this.getChildRowLocation=function(Wb){for(var cc=0;cc<oa.length;cc++)if(Wb.getRowNum()==oa[cc].getRowNum())return cc;return-1};this.recalcRowNum=function(Wb){this.setRowNum(Wb.getIndex());
console.info("row num:"+Hb);for(var cc=0;cc<oa.length;cc++)oa[cc].recalcRowNum(Wb.increatment())};this.insertChildRowModel=function(Wb,cc){oa.splice(cc,0,Wb);for(var Ea=0;Ea<Tb;Ea++){var qa=$b[Ea],$a=Wb.getEntityCellNode(Ea);qa.insertChildNode(cc,$a);$a.setParentCellNode(qa)}};this.addChildrenRowModel=function(Wb){oa.push(Wb);for(var cc=0;cc<Tb;cc++){var Ea=$b[cc],qa=Wb.getEntityCellNode(cc);Ea.addChildNode(qa);qa.setParentCellNode(Ea)}};this.getChildMaxRowNum=function(){var Wb=oa.length;return 0==
Wb?Hb:oa[Wb-1].getChildMaxRowNum()};this.deepVisitRow=function(Wb){if(Wb){Wb(this);for(var cc=0;cc<oa.length;cc++)oa[cc].deepVisitRow(Wb)}};this.makeLocalCopy=function(Wb,cc,Ea){if(Ea=$b[cc].getEntity()){var qa=new Jb(Tb,wb);qa.initCellNode();qa.setEntityMergeChangeListener(Nb);qa.getEntityCellNode(cc).setEntity(Ea,!0);Wb.addChildrenRowModel(qa);qa.setParentRowModel(Wb)}for(Wb=0;Wb<oa.length;Wb++)oa[Wb].makeLocalCopy(qa,cc,!1)};this.getLastChildrenRow=function(){var Wb=oa.length;return 0==Wb?null:
oa[Wb-1]};this.hasChildren=function(){return 0<oa.length};this.initCellNode=function(){for(var Wb=0;Wb<Tb;Wb++){var cc=new jc(null,this,Wb,wb);cc.setCellNodeDataChangedListener(Pc);$b.push(cc)}};var Pc=function(Wb,cc,Ea){cc!=Ea&&(bd.setEntityMapChanged(!0),Za&&Za.getUnionChangeState().setChildEntityChanged(!0),Nb&&Nb(bb,Wb,cc,Ea))};this.findEntityNode=function(Wb){for(var cc=0;cc<Tb;cc++)if($b[cc].getEntity()==Wb)return $b[cc];return null};this.getColSize=function(){return Tb};this.getEntityCellNode=
function(Wb){return $b[Wb]};this.deepFindRowByEntity=function(Wb,cc,Ea){if(!cc||Wb>=$b.length)return null;var qa=$b[Wb].getEntity();if(qa==cc||qa&&(Ea&&qa.getAssociateName()==cc.getAssociateName()||!Ea&&qa.getName()==cc.getName()))return this;if(0==oa.length)return null;for(Ea=0;Ea<oa.length;Ea++)if(qa=oa[Ea].deepFindRowByEntity(Wb,cc))return qa;return null};this.getFirstNotEmptyNode=function(){for(var Wb=0;Wb<$b.length;Wb++){var cc=$b[Wb];if(cc.isNotEmptyCellNode())return cc}return null};this.getRowNum=
function(){return Hb};this.removeEmptyChildRow=function(){for(var Wb=[],cc=0;cc<oa.length;cc++){var Ea=oa[cc];if(Ea.isEmptyRow()){for(var qa=0;qa<Tb;qa++)$b[qa].removeNode(Ea.getEntityCellNode(qa));Ec&&Ec(Ea)}else Wb.push(Ea);Ea.removeEmptyChildRow()}oa=Wb};this.setRowNum=function(Wb){Hb=Wb};this.getRowLevel=function(){return wb};this.makeFlat=function(Wb){Wb.push(bb);for(var cc=0;cc<oa.length;cc++)oa[cc].makeFlat(Wb);return Wb}}function jc(Fb,wb,bb,$b){var Hb=Fb,Tb=bb,Za,oa=[],Kb,hc;this.setErrorDesc=
function(Lb){hc=Lb};this.getErrorDesc=function(){return hc};this.setCellNodeDataChangedListener=function(Lb){Kb=Lb};this.getRowIndex=function(){return wb.getRowNum()};this.removeNode=function(Lb){for(var pb=[],yc=0;yc<oa.length;yc++)Lb!=oa[yc]&&pb.push(oa[yc]);oa=pb};this.collectEntity=function(Lb){if(Hb){Lb.push(Hb);for(var pb=0;pb<oa.length;pb++)oa[pb].collectEntity(Lb)}};this.getCellNodeLevel=function(){return $b};this.getLastChild=function(){return 0==oa.length?null:oa[oa.length-1]};this.getEndEntityNodeInTree=
function(){var Lb=oa.length;if(0==Lb&&Hb)return this;--Lb;for(var pb;0<=Lb;){var yc=oa[Lb];if(yc.isNotEmptyCellNode()){pb=yc;break}Lb--}return pb?pb.getEndEntityNodeInTree():Hb?this:null};this.getLastNotEmptyChild=function(){if(0==oa.length)return null;for(var Lb=oa.length-1;0<=Lb;){var pb=oa[Lb];if(pb.isNotEmptyCellNode())return pb;Lb--}return null};this.clearChildCellNodeDataIncludeMe=function(){var Lb=Hb;Hb=null;Kb&&Kb(Tb,Lb,null);for(Lb=0;Lb<oa.length;Lb++)oa[Lb].clearChildCellNodeDataIncludeMe()};
this.isLastNotEmptyCellNode=function(Lb){if(0==oa.length)return!1;for(var pb=oa.length-1;0<=pb;){var yc=oa[pb];if(yc.isNotEmptyCellNode())return yc==Lb;pb--}return!1};this.setParentCellNode=function(Lb){Za=Lb};this.getParentCellNode=function(){return Za};this.addChildNode=function(Lb){oa.push(Lb)};this.insertChildNode=function(Lb,pb){oa.splice(Lb,0,pb)};this.hasChildren=function(){return 0<oa.length};this.collectNotEmptyCellNode=function(Lb){for(var pb=0;pb<oa.length;pb++)oa[pb].isNotEmptyCellNode()&&
Lb.push(oa[pb]);return Lb};this.hasNotEmptyChild=function(){if(0==oa.length)return!1;for(var Lb=0;Lb<oa.length;Lb++)if(oa[Lb].isNotEmptyCellNode())return!0;return!1};this.setEntity=function(Lb,pb){var yc=Hb;Hb=Lb;pb&&Kb&&Kb(Tb,yc,Hb)};this.getEntity=function(){return Hb};this.isNotEmptyCellNode=function(){return null!=Hb};this.moveForward=function(){Tb--;Hb&&Hb.setUnionLocation(Tb)};this.getCol=function(){return Tb}}function Cb(){var Fb,wb,bb,$b=!0;this.cloneMe=function(){var Hb=new Cb;wb&&Hb.setProperty(wb.cloneMe());
Hb.setIndex(Fb);Hb.setError(bb);Hb.setSelectable($b);return Hb};this.setSelectable=function(Hb){$b=Hb};this.isSelectable=function(){return $b&&0!=Fb};this.setProperty=function(Hb){wb=Hb};this.getProperty=function(){return wb};this.setError=function(Hb){bb=Hb};this.getError=function(){return bb};this.setIndex=function(Hb){Fb=Hb};this.getIndex=function(){return Fb};this.hasProperty=function(){return null!=wb}}function oc(){var Fb=this,wb=[],bb,$b=!0,Hb=!0,Tb=!1,Za=!0;this.init=function(oa){if(!(0>=
oa))for(var Kb=0;Kb<oa;Kb++){var hc=new Cb;hc.setIndex(Kb);wb.push(hc)}};this.cloneMe=function(){for(var oa=new oc,Kb=[],hc=0;hc<wb.length;hc++)Kb.push(wb[hc].cloneMe());oa.setPropCells(Kb);oa.setSelected($b);oa.setEditable(Hb);oa.setLocked(Tb);oa.setFieldSelectable(Za);oa.setUnionBaseProp(bb.cloneMe());return oa};this.getPropCellSize=function(){return wb.length};this.getPropCell=function(oa){return wb[oa]};this.setPropCells=function(oa){wb=oa};this.isEmpty=function(){for(var oa=0;oa<wb.length;oa++)if(wb[oa].hasProperty())return!1;
return!0};this.setPrompt=function(oa,Kb){wb[oa].setError(Kb)};this.setProperty=function(oa,Kb,hc){wb[oa].setProperty(Kb);hc&&(bb=Kb.cloneMe(),bb.setRelatedBaseProp(""),Kb.setRelatedBaseProp(bb.getName()))};this.setPropCellSelectable=function(oa,Kb){wb[oa].setSelectable(Kb)};this.spliceNewLocation=function(oa){var Kb=new Cb;Kb.setIndex(oa);wb.splice(oa,0,Kb);for(oa+=1;oa<wb.length;oa++)wb[oa].setIndex(oa)};this.deleteProperty=function(oa){var Kb=Fb.findFirstNotNullPropCell();Kb=Kb?Kb.getIndex()==oa:
!1;var hc=[],Lb;for(Lb in wb)Lb<oa&&hc.push(wb[Lb]),Lb>oa&&(wb[Lb].setIndex(Lb-1),hc.push(wb[Lb]));wb=hc;Kb&&(oa=Fb.findFirstNotNullPropCell())&&(bb=oa.getProperty().cloneMe(),bb.setRelatedBaseProp(""),wb.forEach(function(pb){(pb=pb.getProperty())&&pb.setRelatedBaseProp(bb.getName())}))};this.findFirstNotNullPropCell=function(){for(var oa=0;oa<wb.length;oa++)if(wb[oa].hasProperty())return wb[oa];return null};this.resetProperty=function(oa,Kb){var hc=Fb.findFirstNotNullPropCell();wb[oa].setProperty(Kb);
if(Kb)oa<=hc.getIndex()?(bb=Kb.cloneMe(),bb.setRelatedBaseProp(""),wb.forEach(function(Lb){(Lb=Lb.getProperty())&&Lb.setRelatedBaseProp(bb.getName())})):Kb.setRelatedBaseProp(bb.getName());else if(oa==hc.getIndex()&&(hc=Fb.findFirstNotNullPropCell()))for(bb=hc.getProperty().cloneMe(),bb.setRelatedBaseProp(""),oa=hc.getIndex();oa<wb.length;oa++)(Kb=wb[oa].getProperty())&&Kb.setRelatedBaseProp(bb.getName())};this.setUnionBaseProp=function(oa){bb=oa};this.setFieldSelectable=function(oa){Za=oa};this.isFieldSelectable=
function(){return Za};this.setLocked=function(oa){Tb=oa};this.isLocked=function(){return Tb};this.setEditable=function(oa){Hb=oa};this.isEditable=function(){return Hb};this.setSelected=function(oa){$b=oa};this.isSelected=function(){return $b};this.getUnAcceptedError=function(){for(var oa in wb){var Kb=wb[oa].getError();if(Kb&&!Kb.isAcceptable())return Kb}return null};this.getPrompt=function(){for(var oa=0;oa<wb.length;oa++){var Kb=wb[oa].getError();if(Kb)return Kb.getErrorDesc()}return""};this.getBaseFieldProp=
function(){return bb};this.getPropCells=function(){return wb};this.getFieldPropByIndex=function(oa){return wb[oa].getProperty()};this.changeBasePropName=function(oa){bb.setName(oa);for(var Kb=0;Kb<wb.length;Kb++){var hc=wb[Kb].getProperty();hc&&hc.setRelatedBaseProp(oa)}}}function rc(){var Fb=this,wb,bb=[],$b={},Hb,Tb,Za={},oa={},Kb={},hc={},Lb={},pb,yc={},Nb={},Ec={},bd={},Uc={},Pc={};this.getArrSourceEntity=function(){return bb};this.isSourceUnionEntity=function(){return Hb};this.addEntityCompareModel=
function(da,L){Ec[da]=L};this.getEntityCompareModel=function(da){return da?Ec[da]:null};this.isAppendNewEntity=function(){return"APPEND"==wb};this.getSourceEntityRelationProps=function(da){return da?oa[da.getName()]:null};this.getEntityRelationProperties=function(da,L){switch(L){case rc.SOURCE_ENTITY:return oa[da];case rc.TARGET_ENTITY:return Lb[da];case rc.UNION_ENTITY_UNIT:return Kb[da]}return[null,null]};this.getEntityRelationFromProp=function(da,L){return(da=Fb.getEntityRelationProperties(da,
L))?da[0]:null};this.getEntityRelationToProp=function(da,L){return(da=Fb.getEntityRelationProperties(da,L))?da[1]:null};this.isRelationProperty=function(da,L,mc){if(mc=Fb.getEntityRelationProperties(da,mc))if(da=mc[0],mc=mc[1],da&&da.getName()==L.getName()||mc&&mc.getName()==L.getName())return!0;return!1};this.isSourceEntityFromProperty=function(da,L){return(da=oa[da])?(da=da[0])?da.getName()==L.getName():!1:!1};this.isSourceEntityToProperty=function(da,L){return(da=oa[da])?(da=da[1])?da.getName()==
L.getName():!1:!1};this.getSourceUnionEntityOriginalCalcRelatedProps=function(da){return da?Za[da.getName()]:null};this.getTargetEntityRelationProps=function(da){return da?Lb[da.getName()]:null};this.findTargetEntityRelationFromProp=function(da){return(da=Lb[da])?da[0]:null};this.findTargetEntityRelationToProperty=function(da){return(da=Lb[da])?da[1]:null};this.replaceTargetEntityRelationPropMapKey=function(da,L){var mc=Lb[da];delete Lb[da];Lb[L]=mc;mc=$b[da];delete $b[da];$b[L]=mc};this.getInnerRelationByToEntityName=
function(da){return hc[da]};this.getEntityUnitPropAssociateNameMap=function(da){return bd[da]};this.replaceEntityPropAssociateNameMap=function(da,L){bd[da]=L};this.initForModifyMerge=function(da,L,mc){wb="MODIFY";bb=da.getEntityWithSubNodes(L);Hb=!0;ea();cc();qa(L,mc);Ua(da);da.getBizUnionInnerEntityRelations(L.getName()).forEach(function(wc){var Bc=wc.getToEntity().getName();hc[Bc]=wc});Fb.initEntityCompareModel(mc)};var Wb=function(da){da=da.copyEntityArray();for(var L in da)Uc[da[L].getName()]=
da[L],Pc[da[L].getAlias()]=da[L]};this.getBoxEntityAliasMap=function(){return Pc};this.getBoxEntityNameMap=function(){return Uc};var cc=function(){if(Hb)for(var da in bb){var L=bb[da].getChildren(),mc;for(mc in L){var wc=L[mc],Bc={};wc.getProperties().forEach(function(Gc){Bc[Gc.getAssociateName()]=Gc});bd[wc.getName()]=Bc}}else for(da in bb)wc=bb[da],Bc={},wc.getProperties().forEach(function(Gc){Bc[Gc.getAssociateName()]=Gc}),bd[wc.getName()]=Bc};this.initEntityCompareModel=function(da){if(Fb.isSourceUnionEntity())for(var L=
Fb.getArrSourceEntity(),mc=0;mc<L.length;mc++){var wc=L[mc],Bc=wc.getChildren(),Gc={};for(Hc=0;Hc<Bc.length;Hc++){var Wc=Bc[Hc];Sc=Wc.getTopParentEntity().getAssociateName();dc=da[Sc];Gc[Wc.getAssociateName()]=dc.getEntityByAssociateName(Wc.getAssociateName())}dc=new Cc(wc,Gc);dc.compareAndSync();Fb.addEntityCompareModel(wc.getName(),dc)}else{L=Fb.getArrSourceEntity();for(var dc=da[L[0].getAssociateName()],Hc=0;Hc<L.length;Hc++){da=L[Hc];var Sc=da.getAssociateName();mc=dc.getEntityByAssociateName(Sc);
da=new Kc(da,mc);da.compareAndSync();Fb.addEntityCompareModel(Sc,da)}}};this.initForNewMerge=function(da,L,mc,wc,Bc){wb="APPEND";bb=da.getEntityWithSubNodes(L);Tb=(Hb=L instanceof tc)?L.getChildren().length:1;wc.forEach(function(Gc){$b[Gc.getToEntity().getName()]=Gc});pb=da.buildToEntityRelationsMap();ea();cc();fb(L,Bc);Ua(da);Ea(wc);Wb(da);Fb.initEntityCompareModel(Bc)};this.getRelationByToEntityName=function(da,L){switch(L){case rc.SOURCE_ENTITY:return pb[da];case rc.TARGET_ENTITY:return $b[da];
case rc.UNION_ENTITY_UNIT:return hc[da]}return null};this.getSourceEntityToRelation=function(da){return pb[da]};this.getTargetEntityToRelation=function(da){return $b[da]};this.getNewMergeEntityLocation=function(){return Tb};var Ea=function(da){for(var L=0;L<da.length;L++){var mc=da[L],wc=mc.getFromEntity(),Bc=mc.getToEntity(),Gc=Lb[wc.getName()];Gc?Gc[0]||(Gc[0]=mc.getFromProperty()):(Gc=[mc.getFromProperty(),null],Lb[wc.getName()]=Gc);(wc=Lb[Bc.getName()])?wc[1]||(wc[1]=mc.getToProperty()):(wc=[null,
mc.getToProperty()],Lb[Bc.getName()]=wc)}},qa=function(da,L){for(da=0;da<bb.length;da++)for(var mc=bb[da].getChildren(),wc=0;wc<mc.length;wc++){var Bc=mc[wc],Gc=L[Bc.getTopParentEntity().getAssociateName()];Gc&&(Gc=$a(Gc.getRelations(),Bc),Kb[Bc.getName()]=Gc)}},$a=function(da,L){var mc=[null,null],wc=L.getAssociateName();L=bd[L.getName()];for(var Bc in da){var Gc=da[Bc];Gc.getFromEntity().getAssociateName()==wc&&(mc[0]=L[Gc.getFromProperty().getAssociateName()]);Gc.getToEntity().getAssociateName()==
wc&&(mc[1]=L[Gc.getToProperty().getAssociateName()])}return mc},Ua=function(da){if(Hb)for(var L=0;L<bb.length;L++){var mc=bb[L],wc=mc.getName();Za[wc]||(Za[wc]=[null,null]);if(mc=mc.getParentEntity()){mc=mc.getName();var Bc=da.getRelationByEntitiesName(mc,wc);Bc&&(Za[mc][0]=Bc.getFromProperty(),Za[wc][1]=Bc.getToProperty())}}},fb=function(da,L){if(Hb)for(da=0;da<bb.length;da++){for(var mc=[null,null],wc=bb[da],Bc=wc.getChildren(),Gc=!1,Wc=!1,dc=0;dc<Bc.length;dc++){var Hc=Bc[dc],Sc=Hc.getTopParentEntity();
Sc=L[Sc.getAssociateName()];Sc=$a(Sc.getRelations(),Hc);Kb[Hc.getName()]=Sc;!Wc&&Sc[0]&&(Wc=!0,mc[0]=wc.findProperty(Sc[0].getRelatedBaseProp()));!Gc&&Sc[1]&&(Gc=!0,mc[1]=wc.findProperty(Sc[1].getRelatedBaseProp()))}oa[wc.getName()]=mc}else for(Sc=bb[0],Sc=L[Sc.getAssociateName()],da=0;da<bb.length;da++)L=bb[da].getName(),mc=$a(Sc.getRelations(),bb[da]),oa[L]=mc};this.removeInnerEntityUnit=function(da){var L=da.getName();yc[L]=null;Nb[da.getAlias()]=null;bd[L]=null;Kb[L]=null;hc[L]=null};this.addNewInnerEntityUnit=
function(da,L){var mc=da.getName();yc[mc]=da;Nb[da.getAlias()]=da;var wc={};da.getProperties().forEach(function(Gc){wc[Gc.getAssociateName()]=Gc});bd[mc]=wc;var Bc=[null,null];L.forEach(function(Gc){Gc.getToEntity()==da&&(hc[mc]=Gc,Bc[1]=Gc.getToProperty());Gc.getFromEntity()==da&&(Bc[0]=Gc.getFromProperty())});Kb[mc]=Bc};this.getSourceInnerEntityNameMap=function(){return yc};this.getSourceInnerEntityAliasMap=function(){return Nb};var ea=function(){yc={};Nb={};if(Hb)for(var da=0;da<bb.length;da++)bb[da].getChildren().forEach(function(L){yc[L.getName()]=
L;Nb[L.getAlias()]=L});else bb.forEach(function(L){yc[L.getName()]=L;Nb[L.getAlias()]=L})}}function Kc(Fb,wb){var bb=[],$b={},Hb=[];this.setUnionProperties=function(Lb){Hb=Lb};this.getEntity=function(){return Fb};this.compareAndSync=function(){if(wb)Fb.setErrorInfo(wb.getErrorInfo()),oa(Fb),Tb(),hc();else{var Lb=new Ub.EntityErrorInfo;Lb.setErrorState(Ub.AbstractEntity.ERROR_STATE_TABLENOTEXIST);Fb.setErrorInfo(Lb)}};this.getUnSelectedProperty=function(){return bb};this.isUnSelectedProperty=function(Lb){return null!=
$b[Lb.getName()]};var Tb=function(){var Lb={};wb.getProperties().forEach(function(Nb){Lb[Nb.getName()]=Nb});var pb=[],yc=Za(Fb);Fb.getProperties().forEach(function(Nb){var Ec=Lb[Nb.getName()],bd=-1<yc.indexOf(Nb.getName())?!0:!1;if(Nb.isCalculatingField()||Ec||Nb.getName()==Ka.CUSTOM_BIZ_ENTITY_NAME_FIELD||bd)Ec&&Nb.setHide(Ec.isHide()),pb.push(Nb)});Fb.setProperties(pb)},Za=function(Lb){var pb=[];if((Lb=Lb.getColumnToRowProperties())&&0<Lb.length)for(var yc in Lb){var Nb=Lb[yc],Ec=Nb.getFieldName();
Nb=Nb.getFieldValueNames();pb=pb.concat(Ec,Nb)}return pb},oa=function(Lb){var pb=Lb.getColumnToRowProperties();if(pb&&0<pb.length){var yc={};if(Hb&&0<Hb.length){Hb.forEach(function(bd){yc[bd.getName()]=bd});Lb=Lb.getProperties();for(var Nb in pb){var Ec=pb[Nb];Ec&&Kb(yc,Lb,Ec)}}}},Kb=function(Lb,pb,yc){var Nb={};pb.forEach(function(Pc){Nb[Pc.getName()]=Pc});var Ec=yc.getFieldName();yc=yc.getFieldValueNames();yc.push(Ec);for(var bd in yc){Ec=yc[bd];var Uc=Lb[Ec];Uc&&(Uc.setRelatedBaseProp(Ec),Nb[Ec]||
pb.push(Uc))}},hc=function(){var Lb={};Fb.getProperties().forEach(function(pb){Lb[pb.getName()]=pb});wb.getProperties().forEach(function(pb){pb.isHide()||Lb[pb.getName()]||(bb.push(pb),$b[pb.getName()]=pb)})}}function Cc(Fb,wb){xc.call(this,Fb,wb);this.protectedGetRemoteEntityMapKey=function(bb){return bb.getAssociateName()}}function xc(Fb,wb){var bb=this,$b=[],Hb={};this.getEntityRelatedPropMap=function(Kb){return Hb[Kb]};this.compareAndSync=function(){oa();Tb();Za()};var Tb=function(){for(var Kb=
Fb.getChildren(),hc=0;hc<Kb.length;hc++){var Lb=Kb[hc],pb={};Lb.getProperties().forEach(function(yc){pb[yc.getRelatedBaseProp()]=yc});Hb[Lb.getName()]=pb}};this.isUnSelectedProperty=function(Kb){for(var hc=0;hc<$b.length;hc++)if($b[hc].isUnSelectedProperty(Kb))return!0;return!1};this.getUnSelectedProperty=function(Kb){for(var hc=0;hc<$b.length;hc++){var Lb=$b[hc];if(Lb.getEntity().getName()==Kb)return Lb.getUnSelectedProperty()}return null};var Za=function(){for(var Kb=Fb.getProperties(),hc=[],Lb=
0;Lb<Kb.length;Lb++){var pb=Kb[Lb];pb.isCalculatingField()?hc.push(pb):pb.getName()==Ka.CUSTOM_BIZ_ENTITY_NAME_FIELD?hc.push(pb):Fb.getChildren().some(function(yc){var Nb=pb;return null!=Hb[yc.getName()][Nb.getName()]})&&hc.push(pb)}Fb.setProperties(hc)},oa=function(){Fb.getChildren().forEach(function(Kb){var hc=bb.protectedGetRemoteEntityMapKey(Kb);Kb=new Kc(Kb,wb[hc]);Kb.setUnionProperties(Fb.getProperties());Kb.compareAndSync();$b.push(Kb)})};this.protectedGetRemoteEntityMapKey=function(Kb){return Kb.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.data&&(com.kingdee.bos.qing.data={});var Ub=com.kingdee.bos.qing.data;Ub.EntityMergeModel=Jb;Ub.EntityCellNode=jc;Ub.PropRelationMapModel=oc;Ub.BizEntityMergeCtx=rc;Ub.RowNum=function(Fb){var wb=Fb;this.increatment=function(){wb++;return this};this.getIndex=
function(){return wb}};Ub.SingleEntityCompareModel=Kc;Ub.UnionEntityCompareModel=xc;Ub.EntityChangeStatus=function(Fb,wb){this.getChangedIndex=function(){return Fb};this.getOldEntity=function(){return wb}};Ub.UnionChangeState=Ha;Ub.PropertyMapError=function(Fb,wb){this.isAcceptable=function(){return Fb};this.getErrorDesc=function(){return wb}};Ub.EntitySourceChangeSqlModel=function(){var Fb,wb;this.setEntity=function(bb){Fb=bb};this.getEntity=function(){return Fb};this.setUserSql=function(bb){wb=
bb};this.getUserSql=function(){return wb}};var tc=Ub.UnionEntity,Ka=Ub.Property;rc.SOURCE_ENTITY=0;rc.TARGET_ENTITY=1;rc.UNION_ENTITY_UNIT=3})();(function(){function Ha(Ea,qa,$a,Ua){Ub.call(this,Ea,qa,$a,Ua);var fb=this.protectedMethod;this.checkConnection=function(ea){ea={source:JSON.stringify(ea)};fb.remote("checkConnection",ea)};this.guessFileEncoding=function(ea){fb.remote("guessFileEncoding",{filePath:ea})};this.scanAllEntity=function(ea){ea={source:JSON.stringify(ea)};fb.remote("scanAllEntity",ea)};this.getUsableEntities=function(ea){ea={source:JSON.stringify(ea)};fb.remote("getUsableEntities",ea)};this.getUsableSchemas=function(ea){ea=
{source:JSON.stringify(ea)};fb.remote("getUsableSchemas",ea)};this.getUsableEntitiesFromMultiFile=function(ea){ea={sources:JSON.stringify({sources:ea})};fb.remote("getUsableEntitiesFromMultiFile",ea)};this.previewData=function(ea,da,L){ea={entities:JSON.stringify({entities:ea}),sources:JSON.stringify({sources:da}),topRows:L};fb.remote("getPreviewData",ea)};this.getHeadEntityTitle=function(ea){ea={entity:JSON.stringify(ea.toJsonObject()),source:JSON.stringify(ea.getSource().toJsonObject())};fb.remote("getEntityTitle",
ea)};this.getStoredProcedures=function(ea){ea={source:JSON.stringify(ea)};fb.remote("getStoredProcedures",ea)};this.getStoredProcedureParameters=function(ea,da){ea={source:JSON.stringify(ea),storedProcedureName:da};fb.remote("getStoredProcedureParameters",ea)};this.getUnionDesigntimeDataObject=function(ea,da,L){ea={entities:JSON.stringify({entities:ea}),sources:JSON.stringify({sources:da}),isBizUnion:L};fb.remote("getUnionDesigntimeDataObject",ea)};this.getDataCount=function(ea,da){ea={entities:JSON.stringify({entities:ea}),
sources:JSON.stringify({sources:da})};fb.remote("getDataCount",ea)};this.isDataFieldUnique=function(ea,da,L){ea={entities:JSON.stringify({entities:ea}),sources:JSON.stringify({sources:da}),fieldName:L};fb.remote("isDataFieldUnique",ea)};this.importEntity=function(ea,da){ea={source:JSON.stringify(ea),associateNames:da};fb.remote("importEntity",ea)};this.getCatlog=function(ea){ea={source:JSON.stringify(ea)};fb.remote("getCatlog",ea)};this.getDatabaseNameList=function(ea){ea={source:JSON.stringify(ea)};
fb.remote("getDatabaseNameList",ea)};this.getDesigntimeDataObject=function(ea,da){ea={source:JSON.stringify(ea),associateName:da};fb.remote("getDesigntimeDataObject",ea)};this.checkFormula=function(ea,da,L){ea={checking:JSON.stringify({name:ea,formula:da,properties:L})};fb.remote("checkFormula",ea)};this.checkAllFormula=function(ea){ea={checking:JSON.stringify({properties:ea})};fb.remote("checkAllFormula",ea)};this.cronExpression=function(ea){fb.remote("cronExpression",{cron:ea})};this.loadModel=
function(ea){fb.remote("loadModel",{themeID:ea})};this.loadUserRecentUsedSourceList=function(ea,da){ea={needexcludeSources:JSON.stringify({sources:ea}),needShowMoreFlag:da};fb.remote("loadUserRecentUsedSourceList",ea)};this.saveModel=function(ea,da){ea={model:JSON.stringify(da),themeID:ea};fb.remote("saveModel",ea)};this.getExportedData=function(ea,da){da="Qing-"+(new Date).getTime()+da;da=encodeURI(encodeURI(da));xc.downloadFile(da,ea)};this.uploadFile=function(ea){var da=com.kingdee.bos.qing.framework.common.RemoteFrameworkRegister.getUploadUrl();
ea.open("post",da,!0)};this.getFileSize=function(ea){fb.remote("getFileSize",{fileUrl:ea})};this.downloadFile=function(ea){fb.remote("downloadFile",{fileUrl:ea})};this.getDownloadFileData=function(ea,da){var L=com.kingdee.bos.qing.common.Util,mc=L.appendParamToUrl(com.kingdee.bos.qing.framework.common.RemoteFrameworkRegister.getDownloadUrl(),"isExport","true");mc=L.appendParamToUrl(mc,"exportUuid",ea);ea="Qing-"+(new Date).getTime()+da;ea=encodeURI(encodeURI(ea));mc=L.appendParamToUrl(mc,"fileName",
ea);window.open(mc,"_self")};this.openAPIInitialCheck=function(ea){ea={source:JSON.stringify(ea)};fb.remote("openAPIInitialCheck",ea)};this.getPreviewDataSysVars=function(ea,da,L){fb.remote("getPreviewDataSysVars",{})};this.previewRuntimeUserSQL=function(ea){fb.remote("previewRuntimeUserSQL",{sql:ea})};this.getExtractUserLimit=function(){fb.remote("getExtractUserLimit",{})};this.getSelectableMaxFieldNum=function(){fb.remote("getSelectableMaxFieldNum",{})}}function Jb(){Fb.call(this);var Ea;this.getRemoteUrl=
function(qa){return Ea};this.setRemoteUrl=function(qa){Ea=qa}}function jc(){this.switchSQLToDisplayMode=function(Ea,qa){throw new Exception("override me");};this.switchSQLToPersistentMode=function(Ea,qa){throw new Exception("override me");};this.loadVarModelAdapter=function(Ea,qa){throw new Exception("override me");}}function Cb(Ea,qa,$a,Ua){this.getDefaultErrDesc=function(){return Ka.get(qa,$a)};this.getFormattedError=function(fb){var ea=Ka.get(qa,$a);if(!Ua)return ea;fb=fb.getErrorInfo();return Ua(fb,
ea)}}function oc(Ea){var qa=this,$a;this.getJqUi=function(){$a=$("<div>");qa.protectedInitUi($a);Ea&&qa.protectedUpdateModelToUI(Ea);return $a};this.protectedInitUi=function(){throw Error("Override me");};this.protectedUpdateModelToUI=function(Ua){throw Error("Override me");};this.protectedGetModelFromUI=function(){throw Error("Override me");};this.protectedCheckParams=function(){throw Error("Override me");}}"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.data&&(com.kingdee.bos.qing.data={});var rc=com.kingdee.bos.qing.data;rc.Facade=Ha;rc.AbstractVariateHelper=jc;var Kc,Cc,xc,Ub,tc,Ka,Fb,wb,bb,$b,Hb=rc.Property,Tb,Za,oa,Kb=rc.AuthModelFactory,hc,Lb,pb,yc,Nb,Ec,bd,Uc,Pc,Wb;(function(){var Ea=com.kingdee.bos.qing.common;Kc=Ea.NumberFormater;Cc=Ea.DateFormater;Nb=Ea.DomUtil;Uc=Ea.Base64Util;Wb=Ea.Util;
Ea=com.kingdee.bos.qing.framework.common;Ub=Ea.AbstractFacade;tc=Ea.AbstractIcons;xc=Ea.RemoteFramework;Ka=Ea.MultilanguageManager.createPackageAccessor(rc);Fb=Ea.AbstractRemoteCall;Ea=com.kingdee.bos.qing.ui.component;wb=Ea.TextField;bb=Ea.PasswordField;bd=Ea.ComboBox;Ec=Ea.Label;Pc=Ea.HelpIcon;$b=Ea.CheckBox;Ea=com.kingdee.bos.qing.data;Tb=Ea.SystemVarType;Za=Ea.SysVarAdapter;oa=Ea.AbstractEntity;hc=Ea.BasicAuthModel;Lb=Ea.BearerAuthModel;pb=Ea.DigestAuthModel;yc=Ea.CosmicAuthModel})();rc.Icons=
new function(){tc.call(this);var Ea=this.protectedMethod;this.protectedInit=function(fb,ea){fb=com.kingdee.bos.qing.data.ComboIcon;if(!fb)throw Error("com.kingdee.bos.qing.data.ComboIcon not found.");fb.define(ea,"dm");$a(0,0,"btn_add-entity");$a(0,1,"btn_add-union");$a(0,2,"btn_add-relation");$a(0,3,"btn_view-sysvar");Ua(3,0,"table");Ua(3,1,"union");Ua(3,2,"custom-sql");Ua(3,3,"stored-procedure");Ua(3,15,"relation");Ua(0,9,"elastic-dm");Ua(0,10,"string");Ua(0,11,"int");Ua(0,12,"number");Ua(0,13,
"date");Ua(0,14,"datetime");Ua(0,15,"boolean");Ua(6,0,"menu");Ua(6,1,"delete");Ua(6,3,"arrow-down");Ua(6,4,"arrow-up");Ua(8,0,"checked");$a(6,14,"btn_delete");$a(6,15,"btn_edit");Ua(3,0,"excel");Ua(3,0,"csv");Ua(3,0,"txt");Ua(3,0,"xml");Ua(6,7,"upload_error");Ua(6,13,"upload_success");Ua(6,12,"upload_running");Ua(6,11,"upload_fail");Ua(6,10,"upload_pause");Ua(6,9,"upload_again");Ua(6,8,"refresh");Ua(6,2,"upload_icon");Ua(7,3,"download_icon");Ua(8,14,"up_move");Ua(8,15,"down_move");fb.define(ea,"source");
qa(0,0,"source_mysql");qa(1,0,"source_sqlserver");qa(2,0,"source_oracle");qa(3,0,"source_pg");qa(4,0,"source_db2");qa(5,0,"source_access");qa(6,0,"source_sqlite");qa(3,1,"source_hive");qa(4,1,"source_hana");qa(5,1,"source_odps");qa(6,1,"source_unsupported");qa(0,1,"source_excel");qa(1,1,"source_csv");qa(2,1,"source_txt");qa(0,2,"source_sybase");qa(1,2,"source_redshift");qa(2,2,"source_tidb");qa(3,2,"source_dm");qa(4,2,"source_openAPI");qa(5,2,"source_greenplum");qa(6,2,"source_gaussdb");qa(0,3,"source_apachedrill");
qa(1,3,"source_sparksql");qa(2,3,"source_sybaseiq");qa(3,3,"source_impala");qa(4,3,"source_kylin");qa(5,3,"source_xml");qa(6,3,"source_kingbase");qa(5,4,"source_tdsql");qa(6,4,"source_gbase");qa(6,1,"source_vastbase");qa(7,0,"source_yashandb");qa(7,1,"source_doris");fb.define(ea,"file");qa(0,0,"file_txt_middle");qa(0,1,"file_access");qa(0,2,"file_sqlite");qa(0,3,"file_excel_middle");qa(0,4,"file_csv_middle");qa(0,5,"file_xml_middle");ea.setStartPosition(1,37);ea.setIconSize(15,18);qa(0,0,"file_csv");
qa(0,1,"file_excel");qa(0,2,"file_txt");qa(0,3,"file_xml")};var qa=function(fb,ea,da){Ea.registIcon(fb,ea,da)},$a=function(fb,ea,da){qa(fb,ea,da);qa(fb+1,ea,da+"_hover");qa(fb+2,ea,da+"_disabled")},Ua=function(fb,ea,da){qa(fb,ea,da);qa(fb+1,ea,da+"_selected")}};rc.PropDataTypeUtil=new function(){var Ea=this;this.getDataTypeDesc=function(qa){switch(qa){case Hb.DT_STRING:qa=Ka.get("text","\u6587\u672c");break;case Hb.DT_NUMBER:qa=Ka.get("number","\u6570\u503c");break;case Hb.DT_INT:qa=Ka.get("integer",
"\u6574\u6570");break;case Hb.DT_DATE:qa=Ka.get("dataTypeDate","\u65e5\u671f");break;case Hb.DT_DATETIME:qa=Ka.get("dateTime","\u65e5\u671f\u65f6\u95f4");break;case Hb.DT_BOOLEAN:qa=Ka.get("bool","\u5e03\u5c14");break;default:qa=""}return qa};this.buildDataTypeInConsistantPrompt=function(qa,$a){var Ua=Ka.get("dataTypeNotMatch","\u5b57\u6bb5\u201c#1\u201d\u7684\u6570\u636e\u7c7b\u578b\u4e3a#2\uff0c\u4e0e\u5b57\u6bb5\u201c#3\u201d\u7684#4\u6570\u636e\u7c7b\u578b\u4e0d\u4e00\u81f4");Ua=Ua.replace("#1",
qa.getAlias());Ua=Ua.replace("#2",Ea.getDataTypeDesc(qa.getOutputDataType()));Ua=Ua.replace("#3",$a.getAlias);return Ua=Ua.replace("#4",Ea.getDataTypeDesc($a.getOutputDataType()))}};rc.FormatUtil=new function(){this.createFormater=function(Ea,qa){switch(Ea){case Hb.DT_BOOLEAN:Ea=function(fb){return null==fb||void 0==fb?"":fb?"true":"false"};break;case Hb.DT_NUMBER:case Hb.DT_INT:var $a=null;qa&&($a=new Kc,$a.setFormatString(qa));Ea=function(fb){return null==fb||void 0==fb?"":$a?$a.format(fb):fb};
break;case Hb.DT_DATE:var Ua=new Cc;Ua.setFormatString("yyyy-MM-dd");Ea=function(fb){return null==fb||void 0==fb?"":Ua.format(fb)};break;case Hb.DT_DATETIME:Ua=new Cc;Ua.setFormatString("yyyy-MM-dd HH:mm:ss");Ea=function(fb){return null==fb||void 0==fb?"":Ua.format(fb)};break;default:Ea=function(fb){return null==fb||void 0==fb?"":fb}}return Ea}};rc.Integration=new function(){var Ea={};this.addWindowResizeListener=function(qa,$a){Ea[qa]=$a};this.removeWindowResizeListener=function(qa){delete Ea[qa]};
this.fireWindowResizeListener=function(){for(var qa in Ea){var $a=Ea[qa];$a&&$a()}}};rc.CheckFieldNumUtil=new function(){var Ea,qa;this.checkFieldNum=function(fb,ea,da){if(null!=qa)$a(fb,ea,da);else{var L=new Ha(Ua(),function(mc){qa=mc;$a(fb,ea,da)},function(mc,wc){da(!1);return!1});L.setShowBlocking(!1);L.getSelectableMaxFieldNum()}};var $a=function(fb,ea,da){(fb=fb<=qa)||ea.showPrompt(Ka.get("moreThanMaxFieldNum","\u6bcf\u5f20\u6570\u636e\u8868\u6700\u591a\u5141\u8bb8\u9009\u62e9#1\u4e2a\u5b57\u6bb5\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u5b57\u6bb5\u3002").replace("#1",
qa));da(fb)},Ua=function(){if(null==Ea){Ea=new Jb;var fb=Wb.decodeParamFromUrl(window.location.search,"path");Ea.setRemoteUrl((fb?fb:"/ierp")+"/qing/dataModeling.do")}return Ea}};var cc=new function(){var Ea;this.hookCollector=function(qa){Ea=qa};this.occur=function(qa,$a,Ua){try{Ea&&Ea(qa,$a,Ua)}catch(fb){window.console&&console.warn(fb)}}};cc.DM_SOURCE_TYPE="dm-source-type";cc.DM_IMPORT_TYPE="dm-import-type";cc.DM_CREATE_RELATION="dm-create-relation";cc.DM_DATA_EXTRACT_TYPE="dm-data-extract-type";
cc.DM_DATA_TIMING_EXTRACT="\u5b9a\u65f6\u9884\u63d0\u53d6";cc.DM_DATA_DISPOSABLE_EXTRACT="\u5b9e\u65f6\u63d0\u53d6";cc.DM_IMPORT_TYPE_TABLE="TABLE";cc.DM_IMPORT_TYPE_STORED_PROCEDURE="STORED_PROCEDURE";cc.DM_OPERATING_MERGE_TABLE="dm-operating-merge-table";cc.DM_OPERATING_NEW_FIELD="dm-operating-new-field";rc.UserOperationReporter=cc;rc.VariateHelperFactory=new function(){var Ea={};this.getImpl=function(qa){return Ea[qa]};this.getAllImpl=function(){var qa=[],$a;for($a in Ea)qa.push(Ea[$a]);return qa};
this.registImpl=function(qa,$a){Ea[qa]=$a}};rc.VariateHelperFactory.SYS_VAR_HELPER="sysVar";rc.VariateHelperFactory.MACRO_VAR_HELPER="macroVar";rc.EntityErrorStatesUtil=new function(){var Ea={},qa=this;(function(){Ea[oa.ERROR_STATE_FILENOTEXIST]=new Cb(oa.ERROR_STATE_FILENOTEXIST,"fileNotFound","\u6587\u4ef6\u672a\u627e\u5230");Ea[oa.ERROR_STATE_TABLENOTEXIST]=new Cb(oa.ERROR_STATE_TABLENOTEXIST,"entityNotExist","\u6570\u636e\u8868\u4e0d\u5b58\u5728");Ea[oa.ERROR_STATE_DB_CONN_FAILED]=new Cb(oa.ERROR_STATE_DB_CONN_FAILED,
"DBConnectionInfo","\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25");Ea[oa.ERROR_STATE_OPENAPINOTEXIST]=new Cb(oa.ERROR_STATE_OPENAPINOTEXIST,"OpenAPIInfo","OpenAPI\u7684URL\u65e0\u6548");Ea[oa.ERROR_STATE_NOTEXISTUSERAUTHORITY]=new Cb(oa.ERROR_STATE_NOTEXISTUSERAUTHORITY,"SelectAuthorityInfo","\u6ca1\u6709\u8be5\u4e1a\u52a1\u5b9e\u4f53\u7684\u67e5\u770b\u6743\u9650");Ea[oa.ERROR_STATE_BIZMETANOTSUPPORT]=new Cb(oa.ERROR_STATE_BIZMETANOTSUPPORT,"SupportLightAnalysisInfo","\u8be5\u5b9e\u4f53\u672a\u5f00\u542f\u201c\u652f\u6301\u8f7b\u5206\u6790\u201d\u8bbe\u7f6e\u9879");
Ea[oa.ERROR_STATE_NO_DB_CENTER_PERMISSION]=new Cb(oa.ERROR_STATE_NO_DB_CENTER_PERMISSION,"noDBCenterPermission","\u6ca1\u6709\u6570\u636e\u4e2d\u5fc3\u6743\u9650\uff0c\u8bf7\u5148\u8054\u7cfb\u7ba1\u7406\u5458\u5206\u914d\u6743\u9650\u3002");Ea[oa.ERROR_STATE_KSQL_NOT_SUPPORT]=new Cb(oa.ERROR_STATE_KSQL_NOT_SUPPORT,"ksqlNotSupport","\u5f53\u524d\u6570\u636e\u6e90\u4e0d\u652f\u6301\u201c\u81ea\u5b9a\u4e49KSQL\u201d\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u6570\u636e\u6e90\u3002");Ea[oa.ERROR_STATE_STORED_PROCEDURE_NOT_SUPPORT]=
new Cb(oa.ERROR_STATE_STORED_PROCEDURE_NOT_SUPPORT,"storedProcedureNotSupport","\u5f53\u524d\u6570\u636e\u6e90\u4e0d\u652f\u6301\u201c\u5b58\u50a8\u8fc7\u7a0b\u201d\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u6570\u636e\u6e90\u3002");Ea[oa.ERROR_STATE_UNIONENTITY_CHILDTABLE_HAVE_PROBLEM]=new Cb(oa.ERROR_STATE_UNIONENTITY_CHILDTABLE_HAVE_PROBLEM,"childEntityHaveProblem","\u6784\u6210\u8be5\u6570\u636e\u8868\u7684\u5b50\u8868\u5b58\u5728\u5f02\u5e38\u3002");Ea[oa.ERROR_STATE_SQL_EXECUTE_EXCEPTION]=new Cb(oa.ERROR_STATE_SQL_EXECUTE_EXCEPTION,
"sqlExeException","\u81ea\u5b9a\u4e49SQL\u6267\u884c\u5f02\u5e38\u3002");Ea[oa.ERROR_STATE_kSQL_EXECUTE_EXCEPTION]=new Cb(oa.ERROR_STATE_kSQL_EXECUTE_EXCEPTION,"ksqlExeException","\u81ea\u5b9a\u4e49KSQL\u6267\u884c\u5f02\u5e38\u3002");Ea[oa.ERROR_STATE_SP_EXECUTE_EXCEPTION]=new Cb(oa.ERROR_STATE_SP_EXECUTE_EXCEPTION,"spExeException","\u5b58\u50a8\u8fc7\u7a0b\u4e0d\u5b58\u5728\u6216\u6267\u884c\u5f02\u5e38\u3002");Ea[oa.NO_QING_MODELER_LICENSE]=new Cb(oa.NO_QING_MODELER_LICENSE,"noModelerLicense",
"\u5f53\u524d\u7cfb\u7edf\u6ca1\u6709\u3010\u8f7b\u5efa\u6a21\u3011\u6a21\u5757\u7684\u4f7f\u7528\u8bb8\u53ef\uff0c\u8bf7\u4e0e\u7cfb\u7edf\u7ba1\u7406\u5458\u8054\u7cfb\u3002");Ea[oa.ERROR_STATE_MACRO_NOT_FOUND]=new Cb(oa.ERROR_STATE_MACRO_NOT_FOUND,"macroNotFound","\u5f53\u524d\u5b9e\u4f53\u5f15\u7528\u7684\u5b8f\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u5b8fid\u4e3a\uff1a#1\u3002",function(Ua,fb){return fb.replace("#1",Ua.getCustomInfo("MacroId"))});Ea[oa.ERROR_STATE_MACRO_DB_UNSET]=
new Cb(oa.ERROR_STATE_MACRO_DB_UNSET,"macroNotFound","\u5f53\u524d\u5b9e\u4f53\u5f15\u7528\u7684\u5b8f\u672a\u8bbe\u7f6e\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u5b8f\u540d\u79f0\u4e3a\uff1a#1\u3002",function(Ua,fb){return fb.replace("#1",Ua.getCustomInfo("MacroName"))});var $a=function(Ua,fb){return fb.replace("#1",Ua.getCustomInfo("modelType"))};Ea[oa.ERROR_STATE_NO_DPP_PERMISSION]=new Cb(oa.ERROR_STATE_NO_DPP_PERMISSION,"noModelerPermission","\u60a8\u6ca1\u6709\u8be5#1\u7684\u8fd0\u884c\u6743\u9650\u3002",
$a);Ea[oa.ERROR_STATE_NO_DPP_ENTITY_PERMISSION]=new Cb(oa.ERROR_STATE_NO_DPP_ENTITY_PERMISSION,"noModelerEntityPermission","\u8be5#1\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u4f7f\u7528\u3002",$a);Ea[oa.ERROR_STATE_DAMAGED_DPP_ENTITY]=new Cb(oa.ERROR_STATE_DAMAGED_DPP_ENTITY,"damagedDppEntity","\u8be5#1\u5df2\u635f\u574f\uff0c\u65e0\u6cd5\u4f7f\u7528\u3002",$a);$a=function(Ua,fb){return Ka.get("dbTableExecuteError","\u6570\u636e\u8868\u6267\u884c\u5f02\u5e38")};Ea[oa.ENTITY_PARSE_EXCEPTION]=
new Cb(oa.ENTITY_PARSE_EXCEPTION,"","",$a);Ea[oa.DATA_CENTER_APP_ERROR]=new Cb(oa.DATA_CENTER_APP_ERROR,"","",$a);Ea[oa.DB_CENTER_MACRO_UNAVAILABLE]=new Cb(oa.DB_CENTER_MACRO_UNAVAILABLE,"","",$a)})();this.getDefaultErrorDesc=function($a){var Ua=$a.getErrorState(),fb=Ea[Ua];if(fb)return fb.getFormattedError($a);$a=Ka.get("undefinePreviewError","\u9519\u8bef\u7c7b\u578b:#1,\u9519\u8bef\u63cf\u8ff0:\u672a\u5b9a\u4e49");return $a=$a.replace("#1",Ua)};this.getDefaultErrorDescForTips=function($a){return!$a.isUnion()&&
$a.getSource().isBasedOnDB()?Ka.get("dbTableExecuteError","\u6570\u636e\u8868\u6267\u884c\u5f02\u5e38"):qa.getDefaultErrorDesc($a)};this.getErrorDesc=function($a,Ua){var fb=$a.getErrorState(),ea=Ea[fb];if(ea)return Ua?Ua($a,ea.getDefaultErrDesc()):ea.getFormattedError($a);$a=Ka.get("undefinePreviewError","\u9519\u8bef\u7c7b\u578b:#1,\u9519\u8bef\u63cf\u8ff0:\u672a\u5b9a\u4e49");return $a=$a.replace("#1",fb)}};rc.VariateHelperFactory.registImpl(rc.VariateHelperFactory.SYS_VAR_HELPER,new function(){jc.call(this);
var Ea=this;this.switchSQLToDisplayMode=function($a,Ua){$a=qa($a,!0);if(Ua)Ua($a);else return $a};this.switchSQLToPersistentMode=function($a,Ua){$a=qa($a,!1);if(Ua)Ua($a);else return $a};this.getFormatText=function($a){return"'"+"@%s".replace("%s",Ka.get($a.getI18nKey(),$a.getDefaultDesc()))+"'"};this.loadVarModelAdapter=function($a,Ua){for(var fb,ea=0;ea<Tb.SUPPORTED_VAR_TYPE.length;ea++){var da=Tb.SUPPORTED_VAR_TYPE[ea];if(da.getTypeID()==$a){fb=Ea.createSysVarAdapter(da);break}}if(Ua)Ua(fb);else return fb};
this.createSysVarAdapter=function($a){$a=new Za($a);$a.setDisplayNameFormater(function(Ua){return Ka.get(Ua.getI18nKey(),Ua.getDefaultDesc())});$a.setUserSQLFormater(function(Ua){return Ea.getFormatText(Ua)});return $a};this.createSysVarAdapters=function($a){for(var Ua=[],fb=0,ea=$a.length;fb<ea;fb++){var da=Ea.createSysVarAdapter($a[fb]);Ua.push(da)}return Ua};var qa=function($a,Ua){if($a){for(var fb=0;fb<Tb.SUPPORTED_VAR_TYPE.length;fb++){var ea=Tb.SUPPORTED_VAR_TYPE[fb],da=Ka.get(ea.getI18nKey(),
ea.getDefaultDesc()),L=ea.getTypeID();ea="@%s".replace("%s",Ua?L:da);da="@%s".replace("%s",Ua?da:L);ea=new RegExp(ea.replace("(","\\(").replace(")","\\)"),"g");$a=$a.replace(ea,da)}return $a}}});rc.ProductLineEnvironment=new function(){var Ea;this.getEnvironment=function(){return Ea};this.setEnvironment=function(qa){Ea=qa};this.checkEnvironment=function(qa){return qa&&Ea&&Ea==qa?!0:!1}};rc.ProductLineEnvironment.COSMIC="COSMIC";rc.OpenAPIAuthFactory=new function(){var Ea={};this.getImpl=function(qa,
$a){if(qa=Ea[qa])return new qa($a)};this.registImpl=function(qa,$a){Ea[qa]=$a}};cc=rc.OpenAPIAuthFactory;cc.registImpl(Kb.BASIC,function(Ea){oc.call(this,Ea);var qa,$a,Ua=/^[a-zA-Z0-9_]{1,}$/;this.protectedInitUi=function(fb){var ea=new Ec(Ka.get("userName","\u7528\u6237\u540d"));ea.setRequired(!0);ea=ea.getJqUi();Nb.layoutCtrl(ea,10,0,80,23);ea.appendTo(fb);qa=new wb;qa.setTabindex(1);ea=qa.getJqUi();Nb.layoutCtrl(ea,110,0,170,23);ea.appendTo(fb);ea=new Ec(Ka.get("password","\u5bc6\u7801"));ea.setRequired(!0);
ea=ea.getJqUi();Nb.layoutCtrl(ea,10,30,80,23);ea.appendTo(fb);$a=new bb;$a.setTabindex(2);ea=$a.getJqUi();Nb.layoutCtrl(ea,110,30,170,23);ea.appendTo(fb)};this.protectedUpdateModelToUI=function(){qa.setText(Ea.getUserName());$a.setPassword(Uc.decode(Ea.getPassword()))};this.protectedGetModelFromUI=function(){var fb=new hc;fb.setUserName($.trim(qa.getText()));fb.setPassword(Uc.encode($.trim($a.getPassword())));return fb};this.protectedCheckParams=function(){return $.trim(qa.getText())?$.trim($a.getPassword())?
$.trim(qa.getText()).match(Ua)?50<$.trim(qa.getText()).length?Ka.get("userNameTooLong","\u7528\u6237\u540d\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"):100<$.trim($a.getPassword()).length?Ka.get("passwordTooLong","\u5bc6\u7801\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7100\u4e2a\u5b57\u7b26\u3002"):null:Ka.get("userNameNotSpecial","\u7528\u6237\u540d\u53ea\u80fd\u7531\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\u3002"):Ka.get("passwordNotNull","\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a\u3002"):
Ka.get("userNameNotNull","\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\u3002")}});cc.registImpl(Kb.BEARER,function(Ea){oc.call(this,Ea);var qa,$a,Ua,fb;this.protectedInitUi=function(ea){var da=new Ec(Ka.get("clientId","\u5ba2\u6237\u7aef\u7f16\u7801"));da.setRequired(!0);da=da.getJqUi();da.attr("title",Ka.get("clientId","\u5ba2\u6237\u7aef\u7f16\u7801"));Nb.layoutCtrl(da,10,0,68,23);da.appendTo(ea);da=new Pc;da.setIconType(Pc.ICON_TYPE_QUESTION);da.setTipsText("client_id");da=da.getJqUi();da.addClass("dm-notice-icon");
Nb.layoutCtrl(da,78,4,16,16);da.appendTo(ea);qa=new wb;qa.setTabindex(1);da=qa.getJqUi();Nb.layoutCtrl(da,110,0,170,23);da.appendTo(ea);da=new Ec(Ka.get("clientSecret","\u5ba2\u6237\u7aef\u5bc6\u94a5"));da.setRequired(!0);da=da.getJqUi();Nb.layoutCtrl(da,10,30,80,23);da.appendTo(ea);da=new Pc;da.setIconType(Pc.ICON_TYPE_QUESTION);da.setTipsText("client_secret");da=da.getJqUi();da.addClass("dm-notice-icon");Nb.layoutCtrl(da,78,34,16,16);da.appendTo(ea);$a=new bb;$a.setTabindex(2);da=$a.getJqUi();Nb.layoutCtrl(da,
110,30,170,23);da.appendTo(ea);da=(new Ec(Ka.get("scope","\u6743\u9650\u8303\u56f4"))).getJqUi();da.attr("title",Ka.get("scope","\u6743\u9650\u8303\u56f4"));Nb.layoutCtrl(da,10,60,54,23);da.appendTo(ea);da=new Pc;da.setIconType(Pc.ICON_TYPE_QUESTION);da.setTipsText("scope");da=da.getJqUi();da.addClass("dm-notice-icon");Nb.layoutCtrl(da,64,64,16,16);da.appendTo(ea);Ua=new wb;qa.setTabindex(3);da=Ua.getJqUi();Nb.layoutCtrl(da,110,60,170,23);da.appendTo(ea);da=new Ec(Ka.get("authURL","\u8ba4\u8bc1URL"));
da.setRequired(!0);da=da.getJqUi();da.attr("title",Ka.get("authURL","\u8ba4\u8bc1URL"));Nb.layoutCtrl(da,10,90,57,23);da.appendTo(ea);da=new Pc;da.setIconType(Pc.ICON_TYPE_QUESTION);da.setTipsText(Ka.get("tokenURL","\u83b7\u53d6access_token\u7684API\u5730\u5740"));da=da.getJqUi();da.addClass("dm-notice-icon");Nb.layoutCtrl(da,67,94,16,16);da.appendTo(ea);fb=new wb;fb.setTabindex(4);da=fb.getJqUi();Nb.layoutCtrl(da,110,90,470,23);da.appendTo(ea)};this.protectedUpdateModelToUI=function(ea){qa.setText(Ea.getClientId());
$a.setPassword(Uc.decode(Ea.getClientSecret()));Ua.setText(Ea.getScope());fb.setText(Ea.getAuthURL())};this.protectedGetModelFromUI=function(){var ea=new Lb;ea.setClientId($.trim(qa.getText()));ea.setClientSecret(Uc.encode($.trim($a.getPassword())));$.trim(Ua.getText())&&ea.setScope($.trim(Ua.getText()));ea.setAuthURL($.trim(fb.getText()));return ea};this.protectedCheckParams=function(){return $.trim(qa.getText())?$.trim($a.getPassword())?$.trim(fb.getText())?50<$.trim(qa.getText()).length?Ka.get("clientIdTooLong",
"\u5ba2\u6237\u7aef\u7f16\u7801\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"):100<$.trim($a.getPassword()).length?Ka.get("clientSecretTooLong","\u5ba2\u6237\u7aef\u5bc6\u94a5\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7100\u4e2a\u5b57\u7b26\u3002"):50<$.trim(Ua.getText()).length?Ka.get("scopeTooLong","\u6743\u9650\u8303\u56f4\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"):100<$.trim(fb.getText()).length?Ka.get("authURLTooLong","\u8ba4\u8bc1URL\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7100\u4e2a\u5b57\u7b26\u3002"):
null:Ka.get("authURLNotNull","\u8ba4\u8bc1URL\u4e0d\u80fd\u4e3a\u7a7a\u3002"):Ka.get("clientSecretNotNull","\u5ba2\u6237\u7aef\u5bc6\u94a5\u4e0d\u80fd\u4e3a\u7a7a\u3002"):Ka.get("clientIdNotNull","\u5ba2\u6237\u7aef\u7f16\u7801\u4e0d\u80fd\u4e3a\u7a7a\u3002")}});cc.registImpl(Kb.DIGEST,function(Ea){oc.call(this,Ea);var qa,$a,Ua=/^[a-zA-Z0-9_]{1,}$/;this.protectedInitUi=function(fb){var ea=new Ec(Ka.get("userName","\u7528\u6237\u540d"));ea.setRequired(!0);ea=ea.getJqUi();Nb.layoutCtrl(ea,10,0,80,23);
ea.appendTo(fb);qa=new wb;qa.setTabindex(1);ea=qa.getJqUi();Nb.layoutCtrl(ea,110,0,170,23);ea.appendTo(fb);ea=new Ec(Ka.get("password","\u5bc6\u7801"));ea.setRequired(!0);ea=ea.getJqUi();Nb.layoutCtrl(ea,10,30,80,23);ea.appendTo(fb);$a=new bb;$a.setTabindex(2);ea=$a.getJqUi();Nb.layoutCtrl(ea,110,30,170,23);ea.appendTo(fb)};this.protectedUpdateModelToUI=function(){qa.setText(Ea.getUserName());$a.setPassword(Uc.decode(Ea.getPassword()))};this.protectedGetModelFromUI=function(){var fb=new pb;fb.setUserName($.trim(qa.getText()));
fb.setPassword(Uc.encode($.trim($a.getPassword())));return fb};this.protectedCheckParams=function(){return $.trim(qa.getText())?$.trim($a.getPassword())?50<$.trim(qa.getText()).length?Ka.get("userNameTooLong","\u7528\u6237\u540d\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"):$.trim(qa.getText()).match(Ua)?100<$.trim($a.getPassword()).length?Ka.get("passwordTooLong","\u5bc6\u7801\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7100\u4e2a\u5b57\u7b26\u3002"):null:Ka.get("userNameNotSpecial","\u7528\u6237\u540d\u53ea\u80fd\u7531\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\u3002"):
Ka.get("passwordNotNull","\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a\u3002"):Ka.get("userNameNotNull","\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\u3002")}});cc.registImpl(Kb.COSMIC,function(Ea){function qa(R,J){this.getTypeName=function(){return R};this.getTypeCode=function(){return J}}oc.call(this,Ea);var $a=this,Ua=Ea,fb=Ua&&Ua.getTokenEnhanced(),ea=rc.ProductLineEnvironment.checkEnvironment(rc.ProductLineEnvironment.COSMIC),da,L,mc,wc,Bc,Gc,Wc,dc,Hc,Sc,Dc,cd=["Local","Other"],ld=["Mobile","Email","UserName"],
sc=[new qa(Ka.get("local","\u5f53\u524d\u7cfb\u7edf"),cd[0]),new qa(Ka.get("other","\u5176\u4ed6\u7cfb\u7edf"),cd[1])],l=[new qa(Ka.get("mobile","\u624b\u673a\u53f7"),ld[0]),new qa(Ka.get("email","\u90ae\u7bb1"),ld[1]),new qa(Ka.get("userName","\u7528\u6237\u540d"),ld[2])];this.protectedInitUi=function(R){Hc=new $b;var J=Hc.getJqUi();Nb.layoutCtrl(J,310,-27,23,23);J.appendTo(R);J=(new Ec(Ka.get("tokenEnhanced","\u589e\u5f3a\u578bToken\u8ba4\u8bc1"))).getJqUi();J.attr("title",Ka.get("tokenEnhanced",
"\u589e\u5f3a\u578bToken\u8ba4\u8bc1"));Nb.layoutCtrl(J,330,-25,220,16);J.appendTo(R);Hc.addCheckedListener(function(){fb!=Hc.isChecked()&&(fb=Hc.isChecked(),Ua=$a.protectedGetModelFromUI(),R.empty(),$a.protectedInitUi(R),$a.protectedUpdateModelToUI(Ea))});J=new Ec(Ka.get("appId","\u7cfb\u7edf\u7f16\u7801"));J.setRequired(!0);J=J.getJqUi();J.attr("title",Ka.get("appId","\u7cfb\u7edf\u7f16\u7801"));Nb.layoutCtrl(J,10,0,57,23);J.appendTo(R);J=new Pc;J.setIconType(Pc.ICON_TYPE_QUESTION);J.setTipsText("appId");
J=J.getJqUi();J.addClass("dm-notice-icon");Nb.layoutCtrl(J,67,4,16,16);J.appendTo(R);da=new wb;da.setTabindex(1);J=da.getJqUi();Nb.layoutCtrl(J,110,0,170,23);J.appendTo(R);J=new Ec(Ka.get("appSecret","\u8ba4\u8bc1\u5bc6\u94a5"));J.setRequired(!0);J=J.getJqUi();J.attr("title",Ka.get("appSecret","\u8ba4\u8bc1\u5bc6\u94a5"));Nb.layoutCtrl(J,310,0,57,23);J.appendTo(R);J=new Pc;J.setIconType(Pc.ICON_TYPE_QUESTION);J.setTipsText("appSecret");J=J.getJqUi();J.addClass("dm-notice-icon");Nb.layoutCtrl(J,367,
4,16,16);J.appendTo(R);L=new bb;L.setTabindex(2);J=L.getJqUi();Nb.layoutCtrl(J,410,0,170,23);J.appendTo(R);J=B();J.appendTo(R);var M=I();M.appendTo(R);fb?M.hide():J.hide();ea?q().appendTo(R):G().appendTo(R)};var B=function(){var R=$("<div>"),J=new Ec(Ka.get("proxyUser","\u4ee3\u7406\u7528\u6237\u540d"));J.setRequired(!0);J=J.getJqUi();Nb.layoutCtrl(J,10,30,90,23);J.appendTo(R);Bc=new wb;J=Bc.getJqUi();Nb.layoutCtrl(J,110,30,170,23);J.appendTo(R);return R},I=function(){var R=$("<div>"),J=(new Ec(Ka.get("usertype",
"\u7528\u6237\u7c7b\u578b"))).getJqUi();J.attr("title",Ka.get("usertype","\u7528\u6237\u7c7b\u578b"));Nb.layoutCtrl(J,10,30,80,23);J.appendTo(R);J=new bd;J.setItemModels(l);if(Ua&&Ua.getUserType()){var M=ld.indexOf(Ua.getUserType());J.setSelected(l[M]);Dc=Ua.getUserType()}else Dc=ld[0],J.setSelected(l[0]);J.setCustomPainter(function(cb,rb,Ja){rb.text(Ja.getTypeName())});J.addSelectedChangedListener(function(cb,rb,Ja){Dc=Ja.getTypeCode();mc.setText(Ja.getTypeName());wc.setText()});J=J.getJqUi();Nb.layoutCtrl(J,
110,30,170,23);J.appendTo(R);mc=new Ec(Ka.get("mobile","\u624b\u673a\u53f7"));mc.setRequired(!0);J=mc.getJqUi();Nb.layoutCtrl(J,10,60,90,23);J.appendTo(R);wc=new wb;J=wc.getJqUi();Nb.layoutCtrl(J,110,60,170,23);J.appendTo(R);return R},q=function(){var R=$("<div>"),J=fb?-30:0,M=(new Ec(Ka.get("cosmicType","\u8ba4\u8bc1\u670d\u52a1\u5668"))).getJqUi();Nb.layoutCtrl(M,10,J+90,80,23);M.appendTo(R);M=new bd;M.setItemModels(sc);if(!Ua||Ua.getCosmicType()&&Ua.getCosmicType()!=cd[1])Sc=cd[0],M.setSelected(sc[0]);
else{Sc=cd[1];M.setSelected(sc[1]);var cb=G();cb.appendTo(R)}M.setCustomPainter(function(rb,Ja,kb){Ja.text(kb.getTypeName())});M.addSelectedChangedListener(function(rb,Ja,kb){Sc=kb.getTypeCode();Sc===cd[0]?cb.empty():(cb=G(),cb.appendTo(R))});M=M.getJqUi();Nb.layoutCtrl(M,110,J+90,170,23);M.appendTo(R);return R},G=function(){var R=$("<div>");var J=ea?30:0;J+=fb?-30:0;var M=new Ec(Ka.get("accountid","\u6570\u636e\u4e2d\u5fc3id"));M.setRequired(!0);M=M.getJqUi();M.attr("title",Ka.get("accountid","\u6570\u636e\u4e2d\u5fc3id"));
Nb.layoutCtrl(M,10,J+90,68,23);M.appendTo(R);M=new Pc;M.setIconType(Pc.ICON_TYPE_QUESTION);M.setTipsText("accountid");M=M.getJqUi();M.addClass("dm-notice-icon");Nb.layoutCtrl(M,78,J+94,16,16);M.appendTo(R);Gc=new wb;Gc.setTabindex(1);M=Gc.getJqUi();Nb.layoutCtrl(M,110,J+90,170,23);M.appendTo(R);M=(new Ec(Ka.get("tenantid","\u79df\u6237id"))).getJqUi();M.attr("title",Ka.get("tenantid","\u79df\u6237id"));Nb.layoutCtrl(M,310,J+90,42,23);M.appendTo(R);M=new Pc;M.setIconType(Pc.ICON_TYPE_QUESTION);M.setTipsText("tenantid");
M=M.getJqUi();M.addClass("dm-notice-icon");Nb.layoutCtrl(M,352,J+94,16,16);M.appendTo(R);Wc=new bb;Wc.setTabindex(2);M=Wc.getJqUi();Nb.layoutCtrl(M,410,J+90,170,23);M.appendTo(R);M=new Ec(Ka.get("serverAddress","\u670d\u52a1\u5668\u5730\u5740"));M.setRequired(!0);M=M.getJqUi();M.attr("title",Ka.get("serverAddress","\u670d\u52a1\u5668\u5730\u5740"));Nb.layoutCtrl(M,10,J+120,68,23);M.appendTo(R);M=new Pc;M.setIconType(Pc.ICON_TYPE_QUESTION);var cb=Ka.get("forExample","\u4f8b\u5982\uff1a")+"http://localhost:8080/ierp/";
M.setTipsText(cb);M=M.getJqUi();M.addClass("dm-notice-icon");Nb.layoutCtrl(M,78,J+124,16,16);M.appendTo(R);dc=new wb;M=dc.getJqUi();Nb.layoutCtrl(M,110,J+120,470,23);M.appendTo(R);return R};this.protectedUpdateModelToUI=function(){Hc.setChecked(Ua.getTokenEnhanced());da.setText(Ua.getAppId());L.setPassword(Uc.decode(Ua.getAppSecret()));dc&&(dc.setText(Ua.getCosmicServerAddress()),Gc.setText(Ua.getAccountId()),Wc.setPassword(Ua.getTenantId()));if(Ua.getUserType()){for(var R=0;R<l.length;R++)if(l[R].getTypeCode()==
Ua.getUserType()){mc.setText(l[R].getTypeName());break}wc.setText(Ua.getUserTypeValue())}Bc.setText(Ua.getProxyUser())};this.protectedGetModelFromUI=function(){var R=new yc;R.setTokenEnhanced(Hc.isChecked());R.setAppId($.trim(da.getText()));R.setAppSecret(Uc.encode($.trim(L.getPassword())));R.setUserType(Dc);R.setUserTypeValue($.trim(wc.getText()));R.setProxyUser($.trim(Bc.getText()));R.setCosmicType(Sc);ea&&Sc!=cd[1]||(R.setCosmicServerAddress($.trim(dc.getText())),R.setAccountId($.trim(Gc.getText())),
R.setTenantId(Wc.getPassword()));return R};this.protectedCheckParams=function(){if(!$.trim(da.getText()))return Ka.get("appIdNotNull","\u7cfb\u7edf\u7f16\u7801\u4e0d\u80fd\u4e3a\u7a7a\u3002");if(!$.trim(L.getPassword()))return Ka.get("appSecretNotNull","\u8ba4\u8bc1\u5bc6\u94a5\u4e0d\u80fd\u4e3a\u7a7a\u3002");if(fb&&!$.trim(Bc.getText())||!fb&&!$.trim(wc.getText()))return Ka.get("userInfoNotNull","\u7528\u6237\u4fe1\u606f\u4e0d\u80fd\u4e3a\u7a7a\u3002");if(!ea||Sc==cd[1]){if(!$.trim(Gc.getText()))return Ka.get("accountIdNotNull",
"\u6570\u636e\u4e2d\u5fc3id\u4e0d\u80fd\u4e3a\u7a7a\u3002");if(!$.trim(dc.getText()))return Ka.get("serverAddressNotNull","\u670d\u52a1\u5668\u5730\u5740\u4e0d\u80fd\u4e3a\u7a7a\u3002")}if(50<$.trim(da.getText()).length)return Ka.get("appIdTooLong","\u7cfb\u7edf\u7f16\u7801\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002");if(100<$.trim(L.getPassword()).length)return Ka.get("appSecretTooLong","\u8ba4\u8bc1\u5bc6\u94a5\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7100\u4e2a\u5b57\u7b26\u3002");
if(fb&&50<$.trim(Bc.getText()).length||!fb&&50<$.trim(wc.getText()).length)return Ka.get("userInfoTooLong","\u7528\u6237\u4fe1\u606f\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002");if(!ea||Sc==cd[1]){if(50<$.trim(Gc.getText()).length)return Ka.get("accountIdTooLong","\u6570\u636e\u4e2d\u5fc3id\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002");if(50<$.trim(Wc.getPassword()).length)return Ka.get("tenantIdTooLong","\u79df\u6237id\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002");
if(100<$.trim(dc.getText()).length)return Ka.get("serverAddressTooLong","\u670d\u52a1\u5668\u5730\u5740\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7100\u4e2a\u5b57\u7b26\u3002")}return null}})})();(function(){function Ha(h,e,b,f,c){Y[h]=b;f&&(ka[h]=f);var d=!0;0==c&&(d=c);var g;this.setExistSource=function(k){g=k};this.getExistSource=function(){return g};this.getName=function(){return h};this.getText=function(){return e};this.getIconName=function(){return b};this.isVisible=function(){return d}}function Jb(){nc.AbstractWizardStep.call(this);var h=this,e,b,f,c;this.setSource=function(g){e=g};this.getSource=function(){return e};this.setCtxApi=function(g){b=g};this.getCtxApi=function(){return b};
this.getJqUi=function(g){f||(c=g,f=h.protectedCreateUi());return f};this.protectedCreateUi=function(){throw Error("Override me.");};var d=function(){return c.getMessageCurtain()};this.protectedMethod={getTopJqUi:function(){return f},getMessageCurtain:d,checkConnection:function(g,k){g=g.toJsonObject();b.createFacade(function(a){k(!0)},function(a,r){k(!1);a=a.toString();return"20"==a.substr(0,2)&&7==a.length?(d().showPrompt(r),!0):!1}).checkConnection(g)},refreshDesigntimeDataObject:function(g,k){var a=
{};a[k.getName()]=k;var r=b.createFacade(function(y){var x=new ob;x.fromJsonObject(y,a);y=g.getAssociateName();null==x.getEntityByAssociateName(y)?(x=new ra,x.setErrorState(Eb.AbstractEntity.ERROR_STATE_TABLENOTEXIST),g.setErrorInfo(x)):g.setErrorInfo(null);h.getCtxApi().finish(g.getName())},function(y,x){var A=Eb.AbstractEntity.ERROR_STATE_TABLENOTEXIST;2020401==y?A=Eb.AbstractEntity.ERROR_STATE_KSQL_NOT_SUPPORT:2020503==y?A=Eb.AbstractEntity.ERROR_STATE_STORED_PROCEDURE_NOT_SUPPORT:2020501==y&&
(A=Eb.AbstractEntity.ERROR_STATE_SP_EXECUTE_EXCEPTION);var v=new ra;v.setErrorState(A);g.setErrorInfo(v);h.getCtxApi().finish(g.getName());y=y.toString();return"20"==y.substr(0,2)&&7==y.length?(d().showError(x),!0):!1});r.setShowBlocking(!1);r.getDesigntimeDataObject(k.toJsonObject(),g.getAssociateName())}}}function jc(){Jb.call(this);var h=this,e=this.protectedMethod,b=Eb.BizSourceTypeContext,f=[],c,d,g=[],k,a,r,y,x,A,v,H,u,w=!1,n=!1,E=!0,Z=!0,C=!0,ba,K,ca=!1,P=!1,fa;this.setIsPublicSource=function(F){n=
F};this.setIsLoadUserRecentUsedSourceList=function(F){E=F};this.setIsShowFileSource=function(F){Z=F};this.setIsShowOpenAPISource=function(F){C=F};this.setCustomSupportDBSource=function(F){ba=F};this.setCustomNextDbConnectStepCreator=function(F){K=F};this.setChangeSourceType=function(F){P=F};this.setOldEntity=function(F){fa=F};this.getSubTitle=function(){return p.get("selectDataSource","\u9009\u62e9\u6570\u636e\u6e90")};this.setDataSourceDisabled=function(F){ca=F};this.protectedCreateUi=function(){var F=
$("<div>");F.addClass("dm-source-type-main");E||F.addClass("dm-source-type-main-without-recent");var ja=b.getSourceTypes();if(n){if(ja&&0<ja.length){for(var Pa=[],hb=0;hb<ja.length;hb++){var Yb=ja[hb],ec=Yb.getName();ec=Ha.createBizMetaSource(ec);ec.isPublic()&&Pa.push(Yb)}Pa&&0<Pa.length&&f.push(W(Pa,b.getTitle(),F))}}else if(ja&&0<ja.length)if(h.isUsedForMerge()||P)if(h.isUsedForMerge()){Pa=[];for(hb=0;hb<ja.length;hb++)Yb=ja[hb],ec=Yb.getName(),(ec=Ha.createBizMetaSource(ec))&&ec.supportMergeTable()&&
ec.getMergeType()==Sa.COMMON_MERGE&&Pa.push(Yb);Pa&&0<Pa.length&&f.push(W(Pa,b.getTitle(),F))}else{Pa=[];for(hb=0;hb<ja.length;hb++)Yb=ja[hb],ec=Yb.getName(),"SuperQuery"!=ec&&(ec=Ha.createBizMetaSource(ec),fa.getSource().isModifiable()&&ec&&(ec.isModifiable()||ec.isShowChangeSourceTypeButtonInMenu())&&Pa.push(Yb));Pa&&0<Pa.length&&f.push(W(Pa,b.getTitle(),F))}else f.push(W(ja,b.getTitle(),F));ja=ba?ba.length:Ha.DB_SOURCES.length;ja=(E?88*Math.ceil(ja/5)+26:88*Math.ceil(ja/7)+26)+"px";hb=ba?ba:Ha.DB_SOURCES;
ca?(Z&&f.push(W(Ha.FILE_SOURCES,p.get("file","\u6587\u4ef6"),F,!1,"114px")),f.push(W(hb,p.get("database","\u6570\u636e\u5e93"),F,!1,ja,!0)),C&&f.push(W(Ha.OPENAPI_SOURCES,p.get("OpenAPI","OpenAPI"),F,!1,"114px",!0))):(f.push(W(hb,p.get("database","\u6570\u636e\u5e93"),F,!1,ja)),Z&&f.push(W(Ha.FILE_SOURCES,p.get("file","\u6587\u4ef6"),F)),C&&f.push(W(Ha.OPENAPI_SOURCES,p.get("OpenAPI","OpenAPI"),F)));ja=$("<div>");ja.append(F);if(E){v=$("<div>");v.addClass("dm-source-type-exist");hb=z(g);F=[];if(fa&&
!fa.getSource().isModifiable())for(var Vc in hb)hb[Vc].getExistSource().isModifiable()&&F.push(hb[Vc]);else F=hb;0<F.length&&(Vc=86*F.length+40+"px",f.push(W(F,p.get("currentUsed","\u5f53\u524d\u4f7f\u7528"),v,!1,Vc)));ja.append(v);xb()}return ja};var xb=function(){var F=tb(),ja=A(function(Pa){var hb=new Zb;h.setUserRecentUsedSources(hb.getSourcesArr(Pa.sources));hb=z(k);var Yb=[];if(fa&&!fa.getSource().isModifiable())for(var ec in hb)hb[ec].getExistSource().isModifiable()&&Yb.push(hb[ec]);else Yb=
hb;if(0<Yb.length){var Vc=86*Yb.length+40+"px";f.push(W(Yb,p.get("recentlyUsed","\u6700\u8fd1\u4f7f\u7528"),v,!1,Vc))}else 0==g.length?f.push(W(null,p.get("currentUsed","\u5f53\u524d\u4f7f\u7528"),v,!1,40)):0==Yb.length&&f.push(W(null,p.get("recentlyUsed","\u6700\u8fd1\u4f7f\u7528"),v,!1,40));Pa.showMoreFlag&&4<=Yb.length&&(Pa=new ub,Pa.setText(p.get("showMore","\u5c55\u793a\u66f4\u591a")),Pa.addActionListener(U),u=Pa.getJqUi(),m.layoutCtrlWithLRTB(u,null,0,80,Vc+40,null,23),u.appendTo(v))},function(Pa,
hb){return!1});ja.setShowBlocking(!1);ja.loadUserRecentUsedSourceList(F,!1)},tb=function(){var F=[],ja=z(g);Qb(F,ja);ja=z(k);Qb(F,ja);return F},Qb=function(F,ja){for(var Pa=0;Pa<ja.length;Pa++){var hb=ja[Pa].getExistSource().toJsonObject();F.push(hb)}},U=function(){u.hide();if(void 0==a){var F=tb(),ja=A(function(Pa){var hb=new Zb;hb=z(hb.getSourcesArr(Pa.sources));h.setMoreUserRecentUsedSources(hb);Pa=86*hb.length+40+"px";H=$("<div>");H.css("margin-top","-40px");f.push(W(hb,null,H,!1,Pa));hb=new ub;
hb.setText(p.get("collapseHierachy","\u6536\u8d77"));hb.addActionListener(Ca);hb=hb.getJqUi();m.layoutCtrlWithLRTB(hb,null,0,80,Pa+30,null,23);hb.appendTo(H);H.appendTo(v)},function(Pa,hb){return!1});ja.setShowBlocking(!1);ja.loadUserRecentUsedSourceList(F,!0)}else H.show()},Ca=function(){H.hide();u.show()},z=function(F){F=F?F:[];for(var ja=[],Pa=0;Pa<F.length;Pa++){var hb=F[Pa];if(!P||hb.isModifiable())if(!h.isUsedForMerge()||hb.supportMergeTable()&&hb.getMergeType()==Sa.COMMON_MERGE){var Yb=hb.getTypeName(),
ec=hb.getShortDisplay();hb instanceof na&&(hb.getDbType()==na.TYPE_SQLITE||hb.getDbType()==na.TYPE_ACCESS)&&(ec=hb.getDbName());hb instanceof ac&&(Yb="OpenAPI",ec=ha.decode(ec));var Vc=Ha.getIconName(Yb);Yb=new Ha(Yb,ec,Vc);Yb.setExistSource(hb);ja.push(Yb)}}return ja};this.prepareStep=function(F){for(var ja=0;ja<F.length;ja++)F[ja].setCtxApi(h.getCtxApi())};this.intoThisStep=function(F,ja){ja||h.setCtxApi({createFacade:A,isEntityNameExist:y,isEntityAliasExist:x,finish:r,isFinished:t,refreshFinishFlag:N})};
var N=function(){w=!0},t=function(){return w},O=function(){if(n&&K){var F=c.getName(),ja=Ha.createBizMetaSource(F);ja.setTypeName(F);return K(ja)}return b.getStepProvider()(c,e.getMessageCurtain(),h.isUsedForMerge(),P,fa,d)};this.outThisStep=function(F,ja){if(c){if(P&&fa&&(F=za())){e.getMessageCurtain().showPrompt(F);ja(h);return}F=b.getMutexChecker();var Pa=!1;!n&&F&&(Pa=F(d,c,e.getMessageCurtain()));Pa?ja(h):b.getSourceTypes()&&D(b.getSourceTypes())?(F=b.getPermissionChecker())?F(c.getName(),e.getMessageCurtain(),
function(){var hb=O();hb?(h.prepareStep(hb),ja(hb)):ja(h)},function(){ja(h)}):(F=O())?(h.prepareStep(F),ja(F)):ja(h):D(Ha.DB_SOURCES)?(F=c.getExistSource(),F||(F=new na,F.setName("s"+(new Date).getTime()),F.setDbType(c.getName())),F=h.createNextDbConnectStep(F,fa),ja([F])):D(Ha.FILE_SOURCES)?(F=c.getExistSource())?P?(F=h.createNextFileConnectStep(F,fa),ja([F])):(F=h.createNextSelectTableSteps(F),ja(F)):(F=c.getName()==ib.TYPE_EXCEL?new Xa:c.getName()==ib.TYPE_XML?new Xb:new Rb,F.setName("s"+(new Date).getTime()),
F.setFileType(c.getName()),F=h.createNextFileConnectStep(F,fa),ja([F])):la(Ha.OPENAPI_SOURCES)&&((F=c.getExistSource())?P?(F=h.createNextOpenAPIConnectStep(F,fa),ja([F])):(F=h.createNextSelectTableSteps(F),ja(F)):(F=new ac,F.setName("s"+(new Date).getTime()),F=h.createNextOpenAPIConnectStep(F,fa),ja([F])))}else e.getMessageCurtain().showPrompt(p.get("selectADataSource","\u8bf7\u9009\u4e2d\u4e00\u9879\u6570\u636e\u6e90\u3002")),ja(h)};this.createNextFileConnectStep=function(F,ja){var Pa=new ld;Pa.setSource(F);
Pa.setCtxApi(h.getCtxApi());Pa.setChangeSourceType(P);Pa.setOldEntity(ja);Pa.setDModel(d);return Pa};this.createNextOpenAPIConnectStep=function(F,ja){var Pa=new sc;Pa.setSource(F);Pa.setCtxApi(h.getCtxApi());Pa.setChangeSourceType(P);Pa.setOldEntity(ja);Pa.setDModel(d);return Pa};this.createNextSelectTableSteps=function(F){var ja=new L;ja.setCtxApi(h.getCtxApi());ja.setSource(F);var Pa=new Bc;Pa.setCtxApi(h.getCtxApi());Pa.setSource(F);return[ja,Pa]};this.createNextDbConnectStep=function(F,ja){if(n&&
K)return K(F);var Pa=new da;Pa.setSource(F);Pa.setCtxApi(h.getCtxApi());Pa.setChangeSourceType(P);Pa.setOldEntity(ja);Pa.setDModel(d);return Pa};this.isUsedForMerge=function(){return!1};this.setDModel=function(F){d=F;g=F.getSources()};this.setUserRecentUsedSources=function(F){k=F};this.setMoreUserRecentUsedSources=function(F){a=F};this.setFinishedCallback=function(F){r=F};this.setEntityExistChecker=function(F,ja){y=F;x=ja};this.setFacadeCreator=function(F){A=F};var W=function(F,ja,Pa,hb,Yb,ec){hb?
hb=Pa:(hb=$("<div>"),hb.addClass("dm-source-type-typelist"),Yb&&hb.css("height",Yb),hb.appendTo(Pa));if(null!=ja){Pa=$("<div>");Pa.addClass("dm-source-type-typelist-title");Pa.text(ja);if(ec){ja=$("<div>");var Vc=n?p.get("modelerDisabledTypeList","\uff08\u5f53\u524d\u8f7b\u5efa\u6a21\u8bb8\u53ef\u6a21\u5f0f\u4e0b\uff0c\u4ee5\u4e0b\u6570\u636e\u6e90\u7c7b\u578b\u4e0d\u53ef\u7528\uff09"):p.get("disabledTypeList","\uff08\u5f53\u524d\u8f7b\u5206\u6790\u8bb8\u53ef\u6a21\u5f0f\u4e0b\uff0c\u4ee5\u4e0b\u6570\u636e\u6e90\u7c7b\u578b\u4e0d\u53ef\u7528\uff09");
ja.text(Vc);ja.addClass("dm-source-type-typelist-title-prompt");ja.appendTo(Pa)}Pa.appendTo(hb)}ja=new jb;ja.setItemModels(F);ja.setBorderVisible(!1);ja.setCustomItemPainter(Fa);ja.setCustomSelectedsPainter(Wa);F=ja.getJqUi();F.addClass("dm-source-type-typelist-list");F.appendTo(hb);ec&&(ec=$("<div>"),n&&ec.css("width","100%"),ec.addClass("dm-source-type-typelist-list-disabled"),ec.css("height",parseInt(Yb)-26-8),ec.appendTo(F));ja.addPressedListener(ua);return ja},Fa=function(F,ja){ja.isVisible()||
F.hide();F.attr("title",ja.getText());F.addClass("dm-source-type-typelist-item");var Pa=$("<div>");Pa.addClass("dm-source-type-typelist-item-icon");vb.background(Pa,ja.getIconName());Pa.appendTo(F);Pa=$("<div>");Pa.addClass("dm-source-type-typelist-item-text");Pa.text(ja.getText());Pa.appendTo(F)},Wa=function(F,ja){for(var Pa=0;Pa<F.length;Pa++){var hb=F[Pa];hb.removeClass("dm-source-type-typelist-item_selected");hb.find(".dm-source-type-typelist-item_selected-mark").remove();hb.find(".dm-source-type-typelist-item_selected-icon").remove()}for(Pa=
0;Pa<ja.length;Pa++)hb=ja[Pa],hb.addClass("dm-source-type-typelist-item_selected"),F=$("<div>"),F.addClass("dm-source-type-typelist-item_selected-mark"),F.appendTo(hb),F=$("<div>"),vb.background(F,"checked"),F.addClass("dm-source-type-typelist-item_selected-icon"),F.appendTo(hb)},ua=function(F,ja){for(ja=0;ja<f.length;ja++)f[ja]!=F&&f[ja].setSelecteds([]);F=F.getSelecteds();c=0<F.length?F[0]:null},D=function(F){for(var ja=0;ja<F.length;ja++)if(c.getName()==F[ja].getName())return!0;return!1},la=function(F){for(var ja=
0;ja<F.length;ja++)if(c.getName()==F[ja].getName()||"RESTFUL_DATA_SET"==c.getName()||"PROGRAM_DATA_SET"==c.getName())return!0;return!1},za=function(){if(fa&&!fa.isUnion()){var F=c.getName();F=(new Qc).getSupportState(fa,F);if(!F.isSupport()){var ja=p.get("selectedSourceDoNotSupport","\u5f53\u524d\u9009\u62e9\u7684\u6570\u636e\u6e90\u4e0d\u652f\u6301\u201c#1\u201d\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");switch(F.getUnsupportedType()){case ab.UNSUPPORTED_TYPE_SQL:var Pa=p.get("customSql","\u81ea\u5b9a\u4e49")+
na.SQLTYPE_SQL;break;case ab.UNSUPPORTED_TYPE_KSQL:Pa=p.get("customSql","\u81ea\u5b9a\u4e49")+na.SQLTYPE_KSQL;break;case ab.UNSUPPORTED_TYPE_STOREPROCEDURE:Pa=p.get("storedProcedure","\u5b58\u50a8\u8fc7\u7a0b")}if(Pa)return ja.replace("#1",Pa)}}}}function Cb(){var h=this,e,b,f,c,d,g,k=0,a=36,r,y=0,x=3,A=[],v=[];this.getJqUi=function(K){e||(e=$("<div>"),n(e,K),h.protectedInitExtendUi(e),f.setText(b.getUserName()),c.setPassword(b.getPassword()),E());return e};this.setSource=function(K){b=K};this.getSource=
function(){return b};this.collectSource=function(){var K=$.trim(f.getText()),ca=$.trim(c.getPassword());b.setUserName(K);b.setPassword(ca);b.setDbName("");h.protectedCollectExtendSource(b);return b};this.setDownOffset=function(K){k=K};this.getDownOffset=function(){return k};this.setDbConfigRowCount=function(K){x=K};this.getDbConfigRowCount=function(){return x};this.getCurrentHight=function(){return y};this.setDownSpace=function(K){a=K};this.getDownSpace=function(){return a};this.setCtxApi=function(K){g=
K};this.getCtxApi=function(){return g};this.getDbNameList=function(){return r};this.addSuccessCallbackListener=function(K){A.push(K)};var H=function(K){for(var ca=0;ca<A.length;ca++)(0,A[ca])(K)};this.addErrorCallbackListener=function(K){v.push(K)};var u=function(K){for(var ca=0;ca<v.length;ca++)(0,v[ca])(K)};this.protectedCollectExtendSource=function(K){throw Error("Override me.");};this.protectedInitExtendUi=function(){throw Error("Override me.");};this.protectedIsTextFieldNotNull=function(){throw Error("Override me.");
};this.checkTextFields=function(){return null};this.protectedConnectDb=function(){throw Error("Override me.");};var w=function(K){return Ha.DB_SOURCES.concat(Ha.FILE_SOURCES).filter(function(ca){if(ca.getName()==K)return ca})[0]},n=function(K,ca){K.addClass("dm-source-db-table-connection");var P=new X;P.setText(w(b.getDbType()).getText());var fa=new X(p.get("loginInfo","\u670d\u52a1\u5668\u767b\u5f55\u4fe1\u606f\uff1a")),xb=new X(p.get("userName","\u7528\u6237\u540d"));f=new Va;f.setTabindex(4);var tb=
new X(p.get("password","\u5bc6\u7801"));c=new Ob;c.setTabindex(5);P=P.getJqUi();P.css("font-size","14px");fa=fa.getJqUi();xb=xb.getJqUi();var Qb=f.getJqUi();tb=tb.getJqUi();var U=c.getJqUi();d=$("<div>");d.text(p.get("connect","\u8fde\u63a5"));d.addClass("dm-source-db-table-connection-btn");d.css("line-height","23px");m.layoutCtrl(P,0,0,200,23);m.layoutCtrl(fa,20,a*x+k,200,23);m.layoutCtrl(xb,20,a*(x+1)+k,70,23);m.layoutCtrl(Qb,105,a*(x+1)+k,200,23);m.layoutCtrl(tb,20,a*(x+2)+k,70,23);m.layoutCtrl(U,
105,a*(x+2)+k,200,23);m.layoutCtrl(d,20,a*(x+3)+k,50,23);y=a*(x+3)+k;K.append(P);ca||(K.append(fa),K.append(xb),K.append(Qb),K.append(tb),K.append(U),K.append(d));Qb.on("input",function(Ca){E()})},E=function(){var K=h.protectedIsTextFieldNotNull();if(f){var ca=$.trim(f.getText());K=-1==K?K:ca&&K}Z(K)},Z=function(K){d.off("mousedown",C);K?(d.addClass("dm-source-db-table-connection-btn-enable"),d.on("mousedown",C)):d.removeClass("dm-source-db-table-connection-btn-enable")},C=function(){h.collectSource();
h.protectedConnectDb()},ba=function(K,ca){var P=(new Date).getTime();setTimeout(ca,1E3>P-K?1E3:0)};this.protectedMethod={getDatabaseNameList:function(){if(0<b.getDbAddress().indexOf(" "))u(p.get("IPAddressError","\u670d\u52a1\u5668\u5730\u5740\u4e0d\u6b63\u786e\u3002"));else{Z(!1);d.text(p.get("connecting","\u8fde\u63a5\u4e2d..."));var K=(new Date).getTime(),ca=b.toJsonObject();g.createFacade(function(P){r=P;ba(K,function(){H(p.get("connectionSuccessful","\u8fde\u63a5\u6210\u529f\u3002"));Z(!0);d.text(p.get("connect",
"\u8fde\u63a5"))})},function(P,fa){2020105==P&&(fa=p.get("unsupportedJDKVersion","\u5f53\u524dJDB\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u5230JDK1.8\u7248\u672c\u3002"));ba(K,function(){u(fa);Z(!0);d.text(p.get("connect","\u8fde\u63a5"))});P=P.toString();return"20"==P.substr(0,2)&&7==P.length}).getDatabaseNameList(ca)}},checkConnection:function(){if(0<b.getDbAddress().indexOf(" "))u(p.get("IPAddressError","\u670d\u52a1\u5668\u5730\u5740\u4e0d\u6b63\u786e\u3002"));else{Z(!1);d.text(p.get("connecting",
"\u8fde\u63a5\u4e2d..."));var K=(new Date).getTime(),ca=b.toJsonObject();g.createFacade(function(P){ba(K,function(){P&&H(p.get("connectionSuccessful","\u8fde\u63a5\u6210\u529f\u3002"));!P&&u();Z(!0);d.text(p.get("connect","\u8fde\u63a5"))})},function(P,fa){2020105==P&&(fa=p.get("unsupportedJDKVersion","\u5f53\u524dJDB\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u5230JDK1.8\u7248\u672c\u3002"));ba(K,function(){u(fa);Z(!0);d.text(p.get("connect","\u8fde\u63a5"))});P=P.toString();return"20"==
P.substr(0,2)&&7==P.length}).checkConnection(ca)}},checkTextFieldInput:E,fireSuccessCallbackEvent:H,fireErrorCallbackEvent:u}}function oc(){Cb.call(this);var h=this.protectedMethod,e=this,b,f;this.protectedGetDefaultPort=function(){return"3306"};this.protectedInitExtendUi=function(c){var d=e.getDownSpace(),g=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var k=new X(p.get("port","\u7aef\u53e3"));f=new Va;f.setTabindex(2);var a=e.getSource().getDbPort();f.setText(a?a:e.protectedGetDefaultPort());
b.setText(e.getSource().getDbAddress());g=g.getJqUi();a=b.getJqUi();k=k.getJqUi();var r=f.getJqUi();m.layoutCtrl(g,20,d,70,23);m.layoutCtrl(a,105,d,200,23);m.layoutCtrl(k,20,2*d,70,23);m.layoutCtrl(r,105,2*d,200,23);c.append(g);c.append(a);c.append(k);c.append(r);a.on("input",function(y){h.checkTextFieldInput()});r.on("input",function(y){h.checkTextFieldInput()})};this.protectedCollectExtendSource=function(c){var d=$.trim(b.getText()),g=$.trim(f.getText());c.setDbAddress(d);c.setDbPort(g)};this.protectedConnectDb=
function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())&&$.trim(f.getText())}}function rc(){Cb.call(this);var h=this.protectedMethod,e=this,b,f;this.protectedInitExtendUi=function(c){var d=e.getDownSpace(),g=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var k=new X(p.get("ProjectName","\u9879\u76ee\u540d\u79f0"));f=new Va;f.setTabindex(2);var a=e.getSource().getDbName();f.setText(a?a:"");a=e.getSource().getDbAddress();b.setText(a?
a:"https://service.odps.aliyun.com/api");g=g.getJqUi();a=b.getJqUi();k=k.getJqUi();var r=f.getJqUi();m.layoutCtrl(g,20,d,70,23);m.layoutCtrl(a,105,d,200,23);m.layoutCtrl(k,20,2*d,80,23);m.layoutCtrl(r,105,2*d,200,23);c.append(g);c.append(a);c.append(k);c.append(r);a.on("input",function(y){h.checkTextFieldInput()});r.on("input",function(y){h.checkTextFieldInput()})};this.protectedCollectExtendSource=function(c){var d=$.trim(b.getText()),g=$.trim(f.getText());c.setDbAddress(d);c.setDbName(g)};this.protectedConnectDb=
function(){h.checkConnection()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())&&$.trim(f.getText())}}function Kc(){Cb.call(this);this.setDbConfigRowCount(3);var h=this.protectedMethod,e=this,b,f,c,d;this.protectedInitExtendUi=function(g){var k=e.getDownSpace(),a=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var r=new X(p.get("port","\u7aef\u53e3"));c=new Va;c.setTabindex(2);d=new X(p.get("database","\u6570\u636e\u5e93"));f=new Va;f.setTabindex(3);
b.setText(e.getSource().getDbAddress());var y=e.getSource().getDbPort();c.setText(y?y:"1688");f.setText(e.getSource().getDbName());a=a.getJqUi();y=b.getJqUi();r=r.getJqUi();var x=c.getJqUi(),A=d.getJqUi(),v=f.getJqUi();m.layoutCtrl(a,20,k,70,23);m.layoutCtrl(y,105,k,200,23);m.layoutCtrl(r,20,2*k,70,23);m.layoutCtrl(x,105,2*k,200,23);m.layoutCtrl(A,20,3*k,80,23);m.layoutCtrl(v,105,3*k,200,23);g.append(a);g.append(y);g.append(r);g.append(x);g.append(A);g.append(v);y.on("input",function(H){h.checkTextFieldInput()});
x.on("input",function(H){h.checkTextFieldInput()});v.on("input",function(H){h.checkTextFieldInput()})};this.protectedCollectExtendSource=function(g){var k=$.trim(b.getText()),a=$.trim(c.getText()),r=$.trim(f.getText());g.setDbAddress(k);g.setDbPort(a);g.setDbName(r)};this.protectedConnectDb=function(){h.checkConnection()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())&&$.trim(c.getText())&&$.trim(f.getText())}}function Cc(){Cb.call(this);this.setDbConfigRowCount(4);var h=this.protectedMethod,
e=this,b,f,c,d,g;this.protectedInitExtendUi=function(k){var a=e.getDownSpace(),r=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var y=new X(p.get("port","\u7aef\u53e3"));c=new Va;c.setTabindex(2);var x=new X(p.get("connectType","\u8fde\u63a5\u7c7b\u578b"));d=new Pb;d.setItemModels(["SID","Server Name"]);d.addSelectedChangedListener(this.modeSelectEvent);e.getSource().getConnectType()?(d.setSelected("Server Name"),g=new X(p.get("serverName","\u5b9e\u4f8b\u540d"))):(d.setSelected("SID"),
g=new X("SID"));f=new Va;f.setTabindex(3);b.setText(e.getSource().getDbAddress());var A=e.getSource().getDbPort(),v=e.getSource().getDbName();c.setText(A?A:"1521");f.setText(v?v:"ORCL");r=r.getJqUi();A=b.getJqUi();y=y.getJqUi();v=c.getJqUi();x=x.getJqUi();x.attr("title",p.get("connectType","\u8fde\u63a5\u7c7b\u578b"));var H=d.getJqUi(),u=g.getJqUi(),w=f.getJqUi();m.layoutCtrl(r,20,a,70,23);m.layoutCtrl(A,105,a,200,23);m.layoutCtrl(y,20,2*a,70,23);m.layoutCtrl(v,105,2*a,200,23);m.layoutCtrl(x,20,3*
a,70,23);m.layoutCtrl(H,105,3*a,200,23);m.layoutCtrl(u,20,4*a,80,23);m.layoutCtrl(w,105,4*a,200,23);k.append(r);k.append(A);k.append(y);k.append(v);k.append(x);k.append(H);k.append(u);k.append(w);A.on("input",function(n){h.checkTextFieldInput()});v.on("input",function(n){h.checkTextFieldInput()});w.on("input",function(n){h.checkTextFieldInput()})};this.modeSelectEvent=function(k,a,r){0==r.localeCompare("Server Name")?g.setText(p.get("serverName","\u5b9e\u4f8b\u540d")):g.setText("SID")};this.protectedCollectExtendSource=
function(k){var a=$.trim(b.getText()),r=$.trim(c.getText()),y=$.trim(f.getText()),x=d.getSelected();k.setDbAddress(a);k.setDbPort(r);k.setDbName(y);k.setConnectType(x)};this.protectedConnectDb=function(){h.checkConnection()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())&&$.trim(c.getText())&&$.trim(f.getText())}}function xc(){Cb.call(this);var h=this.protectedMethod,e=this,b,f;this.protectedInitExtendUi=function(c){var d=e.getDownSpace(),g=new X(p.get("IPAddress","\u670d\u52a1\u5668"));
b=new Va;b.setTabindex(1);var k=new X(p.get("port","\u7aef\u53e3"));f=new Va;f.setTabindex(2);b.setText(e.getSource().getDbAddress());var a=e.getSource().getDbPort();f.setText(a?a:"1433");g=g.getJqUi();a=b.getJqUi();k=k.getJqUi();var r=f.getJqUi();m.layoutCtrl(g,20,d,70,23);m.layoutCtrl(a,105,d,200,23);m.layoutCtrl(k,20,2*d,70,23);m.layoutCtrl(r,105,2*d,200,23);c.append(g);c.append(a);c.append(k);c.append(r);a.on("input",function(y){h.checkTextFieldInput()});r.on("input",function(y){h.checkTextFieldInput()})};
this.protectedCollectExtendSource=function(c){var d=$.trim(b.getText()),g=$.trim(f.getText());c.setDbAddress(d);c.setDbPort(g)};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())&&$.trim(f.getText())};this.checkTextFields=function(){var c=$.trim(b.getText()),d=$.trim(f.getText());if(""===c)return p.get("dbAddress","\u670d\u52a1\u5668\u5730\u5740\u4e0d\u80fd\u4e3a\u7a7a");if(""===d)return p.get("dbPortNotNull","\u7aef\u53e3\u4e0d\u80fd\u4e3a\u7a7a")}}
function Ub(){Ka.call(this);this.getDefaultPort=function(){return 5E3}}function tc(){Ka.call(this);this.getDefaultPort=function(){return 2638}}function Ka(){Cb.call(this);var h=this.protectedMethod,e=this,b,f;this.getDefaultPort=function(){throw new error("override me");};this.protectedInitExtendUi=function(c){var d=e.getDownSpace(),g=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var k=new X(p.get("port","\u7aef\u53e3"));f=new Va;f.setTabindex(2);b.setText(e.getSource().getDbAddress());
var a=e.getSource().getDbPort();f.setText(a?a:e.getDefaultPort());g=g.getJqUi();a=b.getJqUi();k=k.getJqUi();var r=f.getJqUi();m.layoutCtrl(g,20,d,70,23);m.layoutCtrl(a,105,d,200,23);m.layoutCtrl(k,20,2*d,70,23);m.layoutCtrl(r,105,2*d,200,23);c.append(g);c.append(a);c.append(k);c.append(r);a.on("input",function(y){h.checkTextFieldInput()});r.on("input",function(y){h.checkTextFieldInput()})};this.protectedCollectExtendSource=function(c){var d=$.trim(b.getText()),g=$.trim(f.getText());c.setDbAddress(d);
c.setDbPort(g)};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())&&$.trim(f.getText())}}function Fb(){Cb.call(this);var h=this.protectedMethod,e=this,b,f;this.protectedInitExtendUi=function(c){var d=e.getDownSpace(),g=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var k=new X(p.get("port","\u7aef\u53e3"));f=new Va;f.setTabindex(2);var a=new X(p.get("database","\u6570\u636e\u5e93"));_oInitDbNameTextField=
new Va;_oInitDbNameTextField.setTabindex(3);b.setText(e.getSource().getDbAddress());var r=e.getSource().getDbPort(),y=e.getSource().getDbName();f.setText(r?r:"5439");_oInitDbNameTextField.setText(y?y:"");g=g.getJqUi();r=b.getJqUi();k=k.getJqUi();y=f.getJqUi();a=a.getJqUi();var x=_oInitDbNameTextField.getJqUi();m.layoutCtrl(g,20,d,70,23);m.layoutCtrl(r,105,d,200,23);m.layoutCtrl(k,20,2*d,70,23);m.layoutCtrl(y,105,2*d,200,23);m.layoutCtrl(a,20,3*d,80,23);m.layoutCtrl(x,105,3*d,200,23);c.append(g);c.append(r);
c.append(k);c.append(y);c.append(a);c.append(x);r.on("input",function(A){h.checkTextFieldInput()});y.on("input",function(A){h.checkTextFieldInput()});x.on("input",function(A){h.checkTextFieldInput()})};this.protectedCollectExtendSource=function(c){var d=$.trim(b.getText()),g=$.trim(f.getText()),k=$.trim(_oInitDbNameTextField.getText());c.setDbAddress(d);c.setDbPort(g);c.setDbName(k)};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())&&
$.trim(f.getText())&&$.trim(_oInitDbNameTextField.getText())};this.checkTextFields=function(){var c=$.trim(b.getText()),d=$.trim(f.getText());if(""===c)return p.get("dbAddress","\u670d\u52a1\u5668\u5730\u5740\u4e0d\u80fd\u4e3a\u7a7a");if(""===d)return p.get("dbPortNotNull","\u7aef\u53e3\u4e0d\u80fd\u4e3a\u7a7a")}}function wb(){Cb.call(this);var h=this.protectedMethod,e=this,b,f;this.protectedInitExtendUi=function(c){var d=e.getDownSpace(),g=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;
b.setTabindex(1);var k=new X(p.get("port","\u7aef\u53e3"));f=new Va;f.setTabindex(2);var a=e.getSource().getDbPort();f.setText(a?a:"4000");b.setText(e.getSource().getDbAddress());g=g.getJqUi();a=b.getJqUi();k=k.getJqUi();var r=f.getJqUi();m.layoutCtrl(g,20,d,70,23);m.layoutCtrl(a,105,d,200,23);m.layoutCtrl(k,20,2*d,70,23);m.layoutCtrl(r,105,2*d,200,23);c.append(g);c.append(a);c.append(k);c.append(r);a.on("input",function(y){h.checkTextFieldInput()});r.on("input",function(y){h.checkTextFieldInput()})};
this.protectedCollectExtendSource=function(c){var d=$.trim(b.getText()),g=$.trim(f.getText());c.setDbAddress(d);c.setDbPort(g)};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())&&$.trim(f.getText())}}function bb(){Cb.call(this);var h=this.protectedMethod,e=this,b,f;this.protectedInitExtendUi=function(c){var d=e.getDownSpace(),g=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var k=new X(p.get("port",
"\u7aef\u53e3"));f=new Va;f.setTabindex(2);var a=e.getSource().getDbPort();f.setText(a?a:"5236");b.setText(e.getSource().getDbAddress());g=g.getJqUi();a=b.getJqUi();k=k.getJqUi();var r=f.getJqUi();m.layoutCtrl(g,20,d,70,23);m.layoutCtrl(a,105,d,200,23);m.layoutCtrl(k,20,2*d,70,23);m.layoutCtrl(r,105,2*d,200,23);c.append(g);c.append(a);c.append(k);c.append(r);a.on("input",function(y){h.checkTextFieldInput()});r.on("input",function(y){h.checkTextFieldInput()})};this.protectedCollectExtendSource=function(c){var d=
$.trim(b.getText()),g=$.trim(f.getText());c.setDbAddress(d);c.setDbPort(g)};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())&&$.trim(f.getText())}}function $b(){hc.call(this)}function Hb(){hc.call(this)}function Tb(){hc.call(this)}function Za(){hc.call(this)}function oa(){hc.call(this);this.protectedGetDefaultPort=function(){return"54321"}}function Kb(){oc.call(this);this.protectedGetDefaultPort=function(){return"15023"}}
function hc(){Cb.call(this);var h=this.protectedMethod,e=this,b,f,c;this.protectedGetDefaultPort=function(){return"5432"};this.protectedGetDefaultDB=function(){return"template1"};this.protectedInitExtendUi=function(d){var g=e.getDownSpace(),k=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var a=new X(p.get("port","\u7aef\u53e3"));f=new Va;f.setTabindex(2);var r=new X(p.get("initDbName","\u6570\u636e\u5e93"));c=new Va;c.setTabindex(3);b.setText(e.getSource().getDbAddress());
var y=e.getSource().getDbPort(),x=e.getSource().getDbName();f.setText(y?y:e.protectedGetDefaultPort());c.setText(x?x:e.protectedGetDefaultDB());k=k.getJqUi();y=b.getJqUi();a=a.getJqUi();x=f.getJqUi();r=r.getJqUi();var A=c.getJqUi();m.layoutCtrl(k,20,g,70,23);m.layoutCtrl(y,105,g,200,23);m.layoutCtrl(a,20,2*g,70,23);m.layoutCtrl(x,105,2*g,200,23);m.layoutCtrl(r,20,3*g,80,23);m.layoutCtrl(A,105,3*g,200,23);d.append(k);d.append(y);d.append(a);d.append(x);d.append(r);d.append(A);y.on("input",function(v){h.checkTextFieldInput()});
x.on("input",function(v){h.checkTextFieldInput()});A.on("input",function(v){h.checkTextFieldInput()})};this.protectedCollectExtendSource=function(d){var g=$.trim(b.getText()),k=$.trim(f.getText()),a=$.trim(c.getText());d.setDbAddress(g);d.setDbPort(k);d.setDbName(a)};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())&&$.trim(f.getText())&&$.trim(c.getText())}}function Lb(){Cb.call(this);var h=this.protectedMethod,e=this,
b=["GaussDB100","GaussDB200","GaussDB300"],f,c,d,g;this.protectedInitExtendUi=function(a){var r=new X(p.get("dbVersion","\u6570\u636e\u5e93\u7248\u672c"));f=new Pb;f.setItemModels(b);f.addSelectedChangedListener(k);var y=new X(p.get("IPAddress","\u670d\u52a1\u5668"));c=new Va;c.setTabindex(1);var x=new X(p.get("port","\u7aef\u53e3"));d=new Va;d.setTabindex(2);var A=new X(p.get("initDbName","\u6570\u636e\u5e93"));g=new Va;g.setTabindex(3);var v=e.getSource().getDbVersion();f.setSelected(v?v:b[0]);
v=e.getSource().getDbAddress();c.setText(v);v=e.getSource().getDbPort();d.setText(v?v:"1888");v=e.getSource().getDbName();g.setText(v?v:"");r=r.getJqUi();r.attr("title",p.get("dbVersion","\u6570\u636e\u5e93\u7248\u672c"));v=f.getJqUi();y=y.getJqUi();var H=c.getJqUi();x=x.getJqUi();var u=d.getJqUi();A=A.getJqUi();var w=g.getJqUi(),n=e.getDownSpace();m.layoutCtrl(r,20,n,70,23);m.layoutCtrl(v,105,n,200,23);m.layoutCtrl(y,20,2*n,70,23);m.layoutCtrl(H,105,2*n,200,23);m.layoutCtrl(x,20,3*n,70,23);m.layoutCtrl(u,
105,3*n,200,23);m.layoutCtrl(A,20,4*n,80,23);m.layoutCtrl(w,105,4*n,200,23);a.append(r);a.append(v);a.append(y);a.append(H);a.append(x);a.append(u);a.append(A);a.append(w);H.on("input",function(E){h.checkTextFieldInput()});u.on("input",function(E){h.checkTextFieldInput()});w.on("input",function(E){h.checkTextFieldInput()})};this.protectedCollectExtendSource=function(a){var r=$.trim(c.getText()),y=$.trim(d.getText()),x=$.trim(g.getText()),A=f.getSelected();a.setDbAddress(r);a.setDbPort(y);a.setDbName(x);
a.setDbVersion(A)};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return $.trim(c.getText())&&$.trim(d.getText())&&$.trim(g.getText())};var k=function(a,r,y){0==y.localeCompare(b[0])?(a=e.getSource().getDbName(),g.setText(a?a:""),a=e.getSource().getDbPort(),d.setText(a?a:"1888")):(a=e.getSource().getDbName(),g.setText(a?a:"template1"),a=e.getSource().getDbPort(),d.setText(a?a:"25308"));h.checkTextFieldInput()}}function pb(){Cb.call(this);var h=
this.protectedMethod,e=this,b=[{type:"Direct",displayName:p.get("direct","\u76f4\u8fde")},{type:"ZooKeeper",displayName:"ZooKeeper"}],f,c,d,g,k;this.protectedInitExtendUi=function(r){var y=new X(p.get("connectType","\u8fde\u63a5\u7c7b\u578b"));f=new Pb;f.setItemModels(b);f.addSelectedChangedListener(a);c=new X(p.get("IPAddress","\u670d\u52a1\u5668"));d=new Va;d.setTabindex(1);g=new X(p.get("port","\u7aef\u53e3"));k=new Va;k.setTabindex(2);var x=e.getSource().getConnectType(),A=b[0];if(x)for(var v=
0;v<b.length;v++)if(x==b[v].type){A=b[v];break}f.setSelected(A);f.setCustomPainter(function(n,E,Z){E.text(Z?Z.displayName:"")});x=e.getSource().getDbAddress();d.setText(x);x=e.getSource().getDbPort();k.setText(x?x:"31010");y=y.getJqUi();y.attr("title",p.get("connectType","\u8fde\u63a5\u7c7b\u578b"));x=f.getJqUi();A=c.getJqUi();v=d.getJqUi();var H=g.getJqUi(),u=k.getJqUi(),w=e.getDownSpace();m.layoutCtrl(y,20,w,70,23);m.layoutCtrl(x,105,w,200,23);m.layoutCtrl(A,20,2*w,70,23);m.layoutCtrl(v,105,2*w,
200,23);m.layoutCtrl(H,20,3*w,70,23);m.layoutCtrl(u,105,3*w,200,23);r.append(y);r.append(x);r.append(A);r.append(v);r.append(H);r.append(u);v.on("input",function(n){h.checkTextFieldInput()});u.on("input",function(n){h.checkTextFieldInput()})};this.protectedCollectExtendSource=function(r){var y=$.trim(d.getText()),x=$.trim(k.getText()),A=f.getSelected();r.setDbAddress(y);r.setDbPort(x);r.setConnectType(A.type)};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=
function(){return $.trim(d.getText())&&$.trim(k.getText())};var a=function(r,y,x){r=e.getSource().getConnectType();x.type==b[0].type?(c.setText(p.get("IPAddress","\u670d\u52a1\u5668")),g.setText(p.get("port","\u7aef\u53e3")),r==b[0].type?(x=e.getSource().getDbAddress(),d.setText(x),x=e.getSource().getDbPort(),k.setText(x?x:"31010")):(d.setText(""),k.setText("31010"))):(c.setText(p.get("quorum","\u6cd5\u5b9a\u6570\u91cf")),g.setText(p.get("clusterId","\u7fa4\u96c6ID")),r==b[1].type?(x=e.getSource().getDbAddress(),
d.setText(x),x=e.getSource().getDbPort(),k.setText(x)):(d.setText(""),k.setText("")));h.checkTextFieldInput()}}function yc(){Cb.call(this);var h=this.protectedMethod,e=this,b,f;this.protectedInitExtendUi=function(c){var d=e.getDownSpace(),g=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var k=new X(p.get("port","\u7aef\u53e3"));f=new Va;f.setTabindex(2);var a=new X(p.get("initDbName","\u6570\u636e\u5e93"));_oInitDbNameTextField=new Va;_oInitDbNameTextField.setTabindex(3);
b.setText(e.getSource().getDbAddress());var r=e.getSource().getDbPort(),y=e.getSource().getDbName();f.setText(r?r:"50000");_oInitDbNameTextField.setText(y?y:"sample");g=g.getJqUi();r=b.getJqUi();k=k.getJqUi();y=f.getJqUi();a=a.getJqUi();var x=_oInitDbNameTextField.getJqUi();m.layoutCtrl(g,20,d,70,23);m.layoutCtrl(r,105,d,200,23);m.layoutCtrl(k,20,2*d,70,23);m.layoutCtrl(y,105,2*d,200,23);m.layoutCtrl(a,20,3*d,80,23);m.layoutCtrl(x,105,3*d,200,23);c.append(g);c.append(r);c.append(k);c.append(y);c.append(a);
c.append(x);r.on("input",function(A){h.checkTextFieldInput()});y.on("input",function(A){h.checkTextFieldInput()});x.on("input",function(A){h.checkTextFieldInput()})};this.protectedCollectExtendSource=function(c){var d=$.trim(b.getText()),g=$.trim(f.getText()),k=$.trim(_oInitDbNameTextField.getText());c.setDbAddress(d);c.setDbPort(g);c.setDbName(k)};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())&&$.trim(f.getText())&&
$.trim(_oInitDbNameTextField.getText())}}function Nb(){Cb.call(this);var h=this.protectedMethod,e=this,b,f;this.protectedInitExtendUi=function(c){var d=e.getDownSpace(),g=e.getDownOffset();b=new fb;b.setSource(e.getSource().clone());b.setExt([".accdb",".mdb"]);b.setSize(100);b.setCtxApi(e.getCtxApi());b.setFunErrorCallbackEvent(h.fireErrorCallbackEvent);b.addSuccessCallbackEvent(h.fireSuccessCallbackEvent);var k=new X(p.get("loginInfo","\u670d\u52a1\u5668\u767b\u5f55\u4fe1\u606f\uff1a")),a=new X(p.get("password",
"\u5bc6\u7801"));f=new Ob;f.setTabindex(5);e.getSource().getPassword()&&f.setPassword(e.getSource().getPassword());k=k.getJqUi();a=a.getJqUi();var r=f.getJqUi();m.layoutCtrl(k,20,4*d+g,200,23);m.layoutCtrl(a,20,5*d+g,70,23);m.layoutCtrl(r,105,5*d+g,200,23);c.append(b.getJqUi());c.append(k);c.append(a);c.append(r)};this.protectedCollectExtendSource=function(c){c.setDbAddress(b.getSource().getDbAddress());c.setDbName(b.getSource().getDbName());c.setPassword(f.getPassword())};this.protectedConnectDb=
function(){h.checkConnection()};this.protectedIsTextFieldNotNull=function(){return b.getSource().getDbAddress()?-1:!1};this.getHasUploadFile=function(){return b.getSource().getDbAddress()}}function Ec(){Cb.call(this);var h=this.protectedMethod,e=this,b,f,c,d,g;this.protectedInitExtendUi=function(k){var a=e.getDownSpace(),r=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var y=new X(p.get("port","\u7aef\u53e3"));f=new Va;f.setTabindex(2);var x=new X(p.get("mode","\u6a21\u5f0f"));
c=new Pb;c.setItemModels([p.get("singleContainer"),p.get("multiContainer")]);c.addSelectedChangedListener(this.modeSelectEvent);g=new X(p.get("initDbName","\u6570\u636e\u5e93"));d=new Va;d.setTabindex(3);b.setText(e.getSource().getDbAddress());var A=e.getSource().getDbPort(),v=e.getSource().getDbName();f.setText(A?A:"39015");d.setText(v?v:"");v?(c.setSelected(p.get("multiContainer")),d.getJqUi().show(),g.getJqUi().show(),d.setEnabled(!0)):(c.setSelected(p.get("singleContainer")),d.setEnabled(!1),
d.getJqUi().hide(),g.getJqUi().hide());r=r.getJqUi();A=b.getJqUi();y=y.getJqUi();v=f.getJqUi();x=x.getJqUi();var H=c.getJqUi(),u=g.getJqUi(),w=d.getJqUi();m.layoutCtrl(r,20,a,70,23);m.layoutCtrl(A,105,a,200,23);m.layoutCtrl(y,20,2*a,70,23);m.layoutCtrl(v,105,2*a,200,23);m.layoutCtrl(x,20,3*a,70,23);m.layoutCtrl(H,105,3*a,200,23);m.layoutCtrl(u,20,4*a,80,23);m.layoutCtrl(w,105,4*a,200,23);k.append(r);k.append(A);k.append(y);k.append(v);k.append(x);k.append(H);k.append(u);k.append(w);A.on("input",function(n){h.checkTextFieldInput()});
v.on("input",function(n){h.checkTextFieldInput()});w.on("input",function(n){h.checkTextFieldInput()})};this.modeSelectEvent=function(k,a,r){0==r.localeCompare(p.get("singleContainer"))?(d.setText(""),d.setEnabled(!1),d.getJqUi().hide(),g.getJqUi().hide()):(d.setEnabled(!0),d.getJqUi().show(),g.getJqUi().show());h.checkTextFieldInput()};this.protectedCollectExtendSource=function(k){var a=$.trim(b.getText()),r=$.trim(f.getText()),y=$.trim(d.getText());k.setDbAddress(a);k.setDbPort(r);k.setDbName(y)};
this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return 0==c.getSelected().localeCompare(p.get("multiContainer"))?$.trim(b.getText())&&$.trim(d.getText())&&$.trim(f.getText()):$.trim(b.getText())&&$.trim(f.getText())}}function bd(){Cb.call(this);var h=this.protectedMethod,e=this,b;this.protectedInitExtendUi=function(f){b=new fb;b.setSource(e.getSource().clone());b.setExt(".db");b.setSize(100);b.setCtxApi(e.getCtxApi());b.setFunErrorCallbackEvent(h.fireErrorCallbackEvent);
b.addSuccessCallbackEvent(h.fireSuccessCallbackEvent);b.addSuccessCallbackEvent(h.checkTextFieldInput);f.append(b.getJqUi())};this.protectedCollectExtendSource=function(f){f.setDbAddress(b.getSource().getDbAddress());f.setDbName(b.getSource().getDbName())};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return b.getSource().getDbAddress()?-1:!1};this.getHasUploadFile=function(){return b.getSource().getDbAddress()}}function Uc(){Wb.call(this);
this.getDefaultPort=function(){return 1E4}}function Pc(){Wb.call(this);this.getDefaultPort=function(){return 10016}}function Wb(){Cb.call(this);var h=this.protectedMethod,e=this,b,f;this.getDefaultPort=function(){throw new error("override me");};this.protectedInitExtendUi=function(c){var d=e.getDownSpace(),g=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var k=new X(p.get("port","\u7aef\u53e3"));f=new Va;f.setTabindex(2);var a=new X(p.get("initDbName","\u6570\u636e\u5e93"));
_oInitDbNameTextField=new Va;_oInitDbNameTextField.setTabindex(3);b.setText(e.getSource().getDbAddress());var r=e.getSource().getDbPort(),y=e.getSource().getDbName();f.setText(r?r:e.getDefaultPort());_oInitDbNameTextField.setText(y?y:"default");g=g.getJqUi();r=b.getJqUi();k=k.getJqUi();y=f.getJqUi();a=a.getJqUi();var x=_oInitDbNameTextField.getJqUi();m.layoutCtrl(g,20,d,70,23);m.layoutCtrl(r,105,d,200,23);m.layoutCtrl(k,20,2*d,70,23);m.layoutCtrl(y,105,2*d,200,23);m.layoutCtrl(a,20,3*d,80,23);m.layoutCtrl(x,
105,3*d,200,23);c.append(g);c.append(r);c.append(k);c.append(y);c.append(a);c.append(x);r.on("input",function(A){h.checkTextFieldInput()});y.on("input",function(A){h.checkTextFieldInput()});x.on("input",function(A){h.checkTextFieldInput()})};this.protectedCollectExtendSource=function(c){var d=$.trim(b.getText()),g=$.trim(f.getText()),k=$.trim(_oInitDbNameTextField.getText());c.setDbAddress(d);c.setDbPort(g);c.setDbName(k)};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=
function(){return $.trim(b.getText())?-1:!1}}function cc(){Ea.call(this);this.getDefaultPort=function(){return 21050}}function Ea(){Cb.call(this);var h=this.protectedMethod,e=this,b,f;this.getDefaultPort=function(){throw new error("override me");};this.protectedInitExtendUi=function(c){var d=e.getDownSpace(),g=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var k=new X(p.get("port","\u7aef\u53e3"));f=new Va;f.setTabindex(2);var a=new X(p.get("initDbName","\u6570\u636e\u5e93"));
_oInitDbNameTextField=new Va;_oInitDbNameTextField.setTabindex(3);b.setText(e.getSource().getDbAddress());var r=e.getSource().getDbPort(),y=e.getSource().getDbName();f.setText(r?r:e.getDefaultPort());_oInitDbNameTextField.setText(y?y:"default");g=g.getJqUi();r=b.getJqUi();k=k.getJqUi();y=f.getJqUi();a=a.getJqUi();var x=_oInitDbNameTextField.getJqUi();m.layoutCtrl(g,20,d,70,23);m.layoutCtrl(r,105,d,200,23);m.layoutCtrl(k,20,2*d,70,23);m.layoutCtrl(y,105,2*d,200,23);m.layoutCtrl(a,20,3*d,80,23);m.layoutCtrl(x,
105,3*d,200,23);c.append(g);c.append(r);c.append(k);c.append(y);c.append(a);c.append(x);r.on("input",function(A){h.checkTextFieldInput()});y.on("input",function(A){h.checkTextFieldInput()});x.on("input",function(A){h.checkTextFieldInput()})};this.checkTextFields=function(){var c=$.trim(b.getText()),d=$.trim(f.getText()),g=$.trim(_oInitDbNameTextField.getText());if(""===c)return p.get("dbAddress","\u670d\u52a1\u5668\u5730\u5740\u4e0d\u80fd\u4e3a\u7a7a");if(""===d)return p.get("dbPortNotNull","\u7aef\u53e3\u4e0d\u80fd\u4e3a\u7a7a");
if(""===g)return p.get("dbNameNotNull","\u6570\u636e\u5e93\u4e0d\u80fd\u4e3a\u7a7a")};this.protectedCollectExtendSource=function(c){var d=$.trim(b.getText()),g=$.trim(f.getText()),k=$.trim(_oInitDbNameTextField.getText());c.setDbAddress(d);c.setDbPort(g);c.setDbName(k)};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())?-1:!1}}function qa(){$a.call(this);this.getDefaultPort=function(){return 7070}}function $a(){Cb.call(this);
var h=this.protectedMethod,e=this,b,f,c;this.getDefaultPort=function(){throw new error("override me");};this.protectedInitExtendUi=function(d){var g=e.getDownSpace(),k=new X(p.get("IPAddress","\u670d\u52a1\u5668"));b=new Va;b.setTabindex(1);var a=new X(p.get("port","\u7aef\u53e3"));f=new Va;f.setTabindex(2);var r=new X(p.get("ProjectName","\u9879\u76ee\u540d\u79f0"));c=new Va;c.setTabindex(3);b.setText(e.getSource().getDbAddress());var y=e.getSource().getDbPort(),x=e.getSource().getDbName();f.setText(y?
y:e.getDefaultPort());c.setText(x?x:"default_project");k=k.getJqUi();y=b.getJqUi();a=a.getJqUi();x=f.getJqUi();r=r.getJqUi();var A=c.getJqUi();m.layoutCtrl(k,20,g,70,23);m.layoutCtrl(y,105,g,200,23);m.layoutCtrl(a,20,2*g,70,23);m.layoutCtrl(x,105,2*g,200,23);m.layoutCtrl(r,20,3*g,80,23);m.layoutCtrl(A,105,3*g,200,23);d.append(k);d.append(y);d.append(a);d.append(x);d.append(r);d.append(A);y.on("input",function(v){h.checkTextFieldInput()});x.on("input",function(v){h.checkTextFieldInput()});A.on("input",
function(v){h.checkTextFieldInput()})};this.checkTextFields=function(){var d=$.trim(b.getText()),g=$.trim(f.getText()),k=$.trim(c.getText());if(""===d)return p.get("dbAddress","\u670d\u52a1\u5668\u5730\u5740\u4e0d\u80fd\u4e3a\u7a7a");if(""===g)return p.get("dbPortNotNull","\u7aef\u53e3\u4e0d\u80fd\u4e3a\u7a7a");if(""===k)return p.get("projectNotNull","\u9879\u76ee\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a")};this.protectedCollectExtendSource=function(d){var g=$.trim(b.getText()),k=$.trim(f.getText()),a=
$.trim(c.getText());d.setDbAddress(g);d.setDbPort(k);d.setDbName(a)};this.protectedConnectDb=function(){h.getDatabaseNameList()};this.protectedIsTextFieldNotNull=function(){return $.trim(b.getText())?-1:!1}}function Ua(){oc.call(this);this.protectedGetDefaultPort=function(){return"9030"}}function fb(){var h,e=this,b,f,c,d=[],g=1,k;this.getJqUi=function(){h||(h=$("<div>"),e.protectedInitUi());return h};this.protectedInitUi=function(){var v=$("<div style='text-align:center'>");$("<input>");var H=$("<div type='button'>");
H.on("click",function(){u.click()});if("placeholder"in $("<input>")[0]){var u=$("<input type='file' id='fileToUpload' style='width:0;height:0;position:absolute;left:-100px'>");u.attr("accept",k);u.change(function(P){var fa;P=h.find("#fileToUpload");null!=P&&null!=P.get(0)&&null!=P.get(0).files&&(fa=P.get(0).files[0]);if(fa)if(0!=fa.size){P=fa.name;var xb=fa.size,tb=P.lastIndexOf(".");tb=P.substring(tb,P.length).toLowerCase();if(xb>1048576*g)c&&c(p.get("fileTooLarge","\u6587\u4ef6\u5927\u5c0f\u8d85\u8fc7\u6700\u5927\u9650\u5236\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u6587\u4ef6\u3002"));
else if(k&&0>k.indexOf(tb))c&&c(p.get("fileTypeIncorrect","\u6587\u4ef6\u7c7b\u578b\u4e0d\u6b63\u786e"));else{tb=h.find("#fileIcon");var Qb=h.find("#fileName"),U=h.find("#fileSize"),Ca;1048576>xb?Ca=(xb/1024).toFixed(2)+"KB":1048576<=xb&&(Ca=(xb/1048576).toFixed(2)+"M");vb.background(tb,"file_"+b.getDbType().toLowerCase());Qb.text(P);U.text("("+Ca+")");Qb.attr("title",P);U.attr("title",Ca);tb.show();Qb.show();U.show();r(fa)}}else h.find("#fileToUpload").val(""),c(p.get("uploadFileIsNull","\u4e0a\u4f20\u7684\u6587\u4ef6\u4e3a\u7a7a\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002"))});
v.append(u)}else{var w=$("<form id='uploadForm' method='post' enctype='multipart/form-data' target='targetIframeA'>");u=$("<input name='filename' type='file' style='width:0;height:0;position:absolute;left:-100px' onchange='submit()' multiple/>");var n=$("<iframe name='targetIframeA' id='targetIframeA' style='height: 0;width: 0'>");w.attr("action","/qing/uploadFileForIE9.do?type="+k);w.append(u);v.append(w);v.append(n);n.on("load",function(P){P=$(window.frames.targetIframeA.document).find("body");
if(P.html())try{var fa=JSON.parse(P.html().toString()),xb=fa.fileName,tb=fa.fileSize,Qb=fa.errorCode;if("IE9001"==Qb)c&&c(p.get("fileTypeIncorrect","\u6587\u4ef6\u7c7b\u578b\u4e0d\u6b63\u786e"));else if("IE9002"==Qb)c&&c(p.get("fileTooLarge","\u6587\u4ef6\u5927\u5c0f\u8d85\u8fc7\u6700\u5927\u9650\u5236\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u6587\u4ef6\u3002"));else if("IE9003"==Qb)c&&c(p.get("uploadFileIsNull","\u4e0a\u4f20\u7684\u6587\u4ef6\u4e3a\u7a7a\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002"));
else{var U=h.find("#fileIcon"),Ca=h.find("#fileName"),z=h.find("#fileSize"),N;1048576>tb?N=(tb/1024).toFixed(2)+"KB":1048576<=tb&&(N=(tb/1048576).toFixed(2)+"M");vb.background(U,"file_"+b.getDbType().toLowerCase());Ca.text(xb);z.text("("+N+")");Ca.attr("title",xb);z.attr("title",N);U.show();Ca.show();z.show();a(p.get("uploadSuccess","\u4e0a\u4f20\u6210\u529f"));b.setDbName(xb);b.setDbAddress(fa.data)}}catch(t){console&&console.log(t),c&&c(p.get("fileTooLarge","\u6587\u4ef6\u5927\u5c0f\u8d85\u8fc7\u6700\u5927\u9650\u5236\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u6587\u4ef6\u3002"))}})}H.addClass("dm-source-db-file-upload-btn");
w=$("<div>");w.css("text-align","center");n=$("<div>");n.addClass("dm-source-db-file-upload-btn-text");n.text(p.get("uploadFile","\u4e0a\u4f20\u6587\u4ef6"));var E=$("<div>");E.addClass("dm-source-db-file-upload-btn-icon");vb.background(E,"upload_icon_selected");var Z=$("<span>");Z.addClass("dm-source-db-file-upload-prompt");Z.text(p.get("acceptDBFile","\u652f\u6301#1\u6587\u4ef6\uff0c\u4e14\u6587\u4ef6\u4e0d\u5927\u4e8e100M").replace("#1",k));var C=$("<div id='fileIcon'>");C.addClass("dm-source-db-file-upload-fileIcon");
var ba=$("<div id='fileName'>");ba.addClass("dm-source-db-file-upload-filedetail");var K=$("<div id='fileSize'>");K.addClass("dm-source-db-file-upload-filedetail");K.css("top","129px");var ca=$("<progress value='0' max='100'>");ca.addClass("dm-source-db-file-upload-progress");b.getDbName()?(ba.text(b.getDbName()),ba.attr("title",b.getDbName()),vb.background(C,"file_"+b.getDbType().toLowerCase()),C.show()):(ba.hide(),K.hide(),C.hide());ca.hide();w.append(E);w.append(n);H.append(w);v.append(H);h.append(v);
h.append(Z);h.append(C);h.append(ba);h.append(K);h.append(ca)};this.setSource=function(v){b=v};this.getSource=function(){return b};this.setSize=function(v){g=v};this.setExt=function(v){k=v};this.setCtxApi=function(v){f=v};this.setFunErrorCallbackEvent=function(v){c=v};this.addSuccessCallbackEvent=function(v){d.push(v)};var a=function(v){for(var H=0;H<d.length;H++)(0,d[H])(v)},r=function(v){h.find(".dm-source-db-file-upload-progress").show();var H=v.name,u=new FormData;u.append("filename",v);v=new XMLHttpRequest;
v.upload.addEventListener("progress",y,!1);v.addEventListener("load",x,!1);v.addEventListener("error",A,!1);var w=v.addEventListener;v.abort();w.call(v,"abort",void 0,!1);f.createFacade().uploadFile(v);v.onload=function(n){if(200==this.status){n=this.response;var E=null;try{E=JSON.parse(n)}catch(Z){c(p.get("uploadFail","\u4e0a\u4f20\u5931\u8d25"));return}if(E&&E.data){h.find(".dm-source-db-file-upload-progress").hide();a(p.get("uploadSuccess","\u4e0a\u4f20\u6210\u529f"));b.setDbName(H);b.setDbAddress(E.data);
return}if(E&&"4001002"==E.errorCode){c(p.get("uploadFileNoAccess","\u65e0\u4e0a\u4f20\u6587\u4ef6\u6743\u9650"));return}if(E&&3099003==E.errorCode){c(E.errorMessage);return}if(E&&E.errorMessage){c(E.errorMessage);return}}c(p.get("uploadFail","\u4e0a\u4f20\u5931\u8d25"))};v.send(u)},y=function(v){var H=h.find(".dm-source-db-file-upload-progress").get(0);v.lengthComputable&&(H.max=v.total,H.value=v.loaded)},x=function(v){},A=function(v){c&&c(p.get("uploadFail","\u4e0a\u4f20\u5931\u8d25"))}}function ea(h,
e,b,f,c,d,g){this.isNeedSelectDb=function(){return d};this.isSchemaSupported=function(){return g};this.getDbType=function(){return h};this.getDownOffset=function(){return e};this.getConfigRowCount=function(){return b};this.isNotShowAll=function(){return f};this.getConnectionPane=function(){return c}}function da(){Jb.call(this);var h=this,e=this.protectedMethod,b,f,c,d,g,k,a,r=!1,y=[new ea(na.TYPE_HANA,40,4,!1,new Ec,!0,!0),new ea(na.TYPE_MYSQL,-1,-1,!1,new oc,!0,!1),new ea(na.TYPE_SQLSERVER,-1,-1,
!1,new xc,!0,!1),new ea(na.TYPE_SYBASE,-1,-1,!1,new Ub,!0,!1),new ea(na.TYPE_ORACLE,40,-1,!1,new Cc,!1,!1),new ea(na.TYPE_ODPS,40,-1,!1,new rc,!1,!1),new ea(na.TYPE_POSTGRESQL,40,-1,!1,new $b,!0,!0),new ea(na.TYPE_DB2,40,-1,!1,new yc,!0,!0),new ea(na.TYPE_ACCESS,40,-1,!0,new Nb,!1,!1),new ea(na.TYPE_SQLITE,40,-1,!0,new bd,!1,!1),new ea(na.TYPE_HIVE,40,-1,!1,new Uc,!1,!1),new ea(na.TYPE_REDSHIFT,40,-1,!1,new Fb,!0,!0),new ea(na.TYPE_TIDB,-1,-1,!1,new wb,!0,!1),new ea(na.TYPE_DM,-1,-1,!1,new bb,!0,
!1),new ea(na.TYPE_GREENPLUM,40,-1,!1,new Za,!0,!0),new ea(na.TYPE_GAUSSDB,40,4,!1,new Lb,!0,!1),new ea(na.TYPE_APACHEDRILL,40,-1,!1,new pb,!0,!1),new ea(na.TYPE_SPARKSQL,40,-1,!1,new Pc,!1,!1),new ea(na.TYPE_SYBASEIQ,-1,-1,!1,new tc,!0,!1),new ea(na.TYPE_IMPALA,40,-1,!1,new cc,!1,!1),new ea(na.TYPE_KYLIN,40,-1,!1,new qa,!0,!0),new ea(na.TYPE_KINGBASE,40,-1,!1,new oa,!0,!0),new ea(na.TYPE_TDSQL,-1,-1,!1,new Kb,!0,!1),new ea(na.TYPE_GBASE,40,-1,!1,new Hb,!0,!0),new ea(na.TYPE_VASTBASE,40,-1,!1,new Tb,
!0,!0),new ea(na.TYPE_DORIS,-1,-1,!1,new Ua,!0,!1),new ea(na.TYPE_YASHANDB,40,-1,!1,new Kc,!1,!0)],x,A=!1,v,H;this.setChangeSourceType=function(C){A=C};this.setOldEntity=function(C){x=C};this.setDModel=function(C){v=C};this.getSubTitle=function(){return p.get("connectDbServer","\u8fde\u63a5\u6570\u636e\u5e93\u670d\u52a1\u5668")};var u=function(){var C=y.filter(function(ba){return ba.getDbType()==a.getDbType()});return C&&1==C.length?C[0]:null};this.protectedCreateUi=function(){var C=$("<div>");a=
h.getSource().clone();var ba=u();if(ba){var K=C.append;b=ba.getConnectionPane();-1!=ba.getDownOffset()&&b.setDownOffset(ba.getDownOffset());-1!=ba.getConfigRowCount()&&b.setDbConfigRowCount(ba.getConfigRowCount());ba.isNeedSelectDb()&&b.addSuccessCallbackListener(w);b.setSource(a);b.setCtxApi(h.getCtxApi());b.addSuccessCallbackListener(n);b.addErrorCallbackListener(E);var ca=b.getJqUi(ba.isNotShowAll());K.call(C,ca)}if(A)ba.isNeedSelectDb()&&(f=new Pb,ba.isSchemaSupported()?(ba=new X(p.get("dbschema",
"\u6a21\u5f0f")),f.setSelected(a.getSchema())):(ba=new X(p.get("database","\u6570\u636e\u5e93")),f.setSelected(a.getDbName())),ba=ba.getJqUi(),K=f.getJqUi(),m.layoutCtrl(ba,20,b.getCurrentHight()+40,70,23),m.layoutCtrl(K,105,b.getCurrentHight()+40,200,23),C.append(ba),C.append(K)),H=new La,H.setText(p.get("actOnTheSameDatabase","\u540c\u65f6\u4fee\u6539\u5f53\u524d\u4e3b\u9898\u4e2d\u5176\u4ed6\u540c\u6e90\u6570\u636e\u8868")),H.setChecked(!1),ba=H.getJqUi(),m.layoutCtrl(ba,20,b.getCurrentHight()+
80,250,23),C.append(ba);else{K=C.append;ca=$("<div>");ca.addClass("dm-source-db-table-dbname");var P=0;if(ba.isNeedSelectDb()){f=new Pb;if(ba.isSchemaSupported()){var fa=new X(p.get("dbschema","\u6a21\u5f0f"));f.setSelected(a.getSchema())}else fa=new X(p.get("database","\u6570\u636e\u5e93")),f.setSelected(a.getDbName());fa=fa.getJqUi();var xb=f.getJqUi();P+=40;m.layoutCtrl(fa,36,P,70,23);m.layoutCtrl(xb,121,P,200,23);ca.append(fa);ca.append(xb)}fa=(new X(p.get("type","\u7c7b\u578b"))).getJqUi();P+=
40;m.layoutCtrl(fa,36,P,70,23);ca.append(fa);c=new Fc;c.setText(p.get("table","\u8868"));xb=c.getJqUi();d=new Fc;d.setText(p.get("customSql","\u81ea\u5b9a\u4e49")+na.SQLTYPE_SQL);var tb=d.getJqUi();fa=new kd;fa.addElement(c);fa.addElement(d);m.layoutCtrl(xb,120,P,120,23);P+=40;m.layoutCtrl(tb,120,P,120,23);ca.append(xb);ca.append(tb);na.isNeedShowKSql(ba.getDbType())&&(g=new Fc,g.setText(p.get("customSql","\u81ea\u5b9a\u4e49")+na.SQLTYPE_KSQL),fa.addElement(g),xb=g.getJqUi(),P+=40,m.layoutCtrl(xb,
120,P,120,23),ca.append(xb));na.isNeedShowPrecedure(ba.getDbType())&&(k=new Fc,k.setText(p.get("storedProcedure","\u5b58\u50a8\u8fc7\u7a0b")),fa.addElement(k),ba=k.getJqUi(),m.layoutCtrl(ba,120,P+40,150,23),ca.append(ba));c.setChecked(!0);K.call(C,ca)}return C};this.createNextTableSteps=function(){var C=new L;C.setCtxApi(h.getCtxApi());C.setSource(h.getSource());var ba=new Bc;ba.setCtxApi(h.getCtxApi());ba.setSource(h.getSource());return[C,ba]};this.creatNextCustomSqlStep=function(){var C=new dc;
C.setSqlType(na.SQLTYPE_SQL);C.setCtxApi(h.getCtxApi());C.setSource(h.getSource());return C};this.creatNextCustomKSqlStep=function(){var C=new dc;C.setSqlType(na.SQLTYPE_KSQL);C.setCtxApi(h.getCtxApi());C.setSource(h.getSource());return C};this.creatNextStoredProcedureStep=function(){var C=new Wc;C.setCtxApi(h.getCtxApi());C.setSource(h.getSource());return C};this.intoThisStep=function(C,ba){r=!1};this.outThisStep=function(C,ba){var K=b.collectSource(),ca=u();ca.isNeedSelectDb()&&(ca.isSchemaSupported()?
(ca=f.getSelected(),a.setSchema(ca)):(ca=f.getSelected(),a.setDbName(ca)));C?(e.getTopJqUi()&&e.getTopJqUi().remove(),ba(null)):(C=function(){if(A)r&&ba(null);else if(r)if(c.isChecked()){var P=h.createNextTableSteps();ba(P)}else d.isChecked()?(P=h.creatNextCustomSqlStep(),ba(P)):g&&g.isChecked()?(P=h.creatNextCustomKSqlStep(),ba(P)):k&&k.isChecked()&&(P=h.creatNextStoredProcedureStep(),ba(P))},a.getDbType()==na.TYPE_SQLITE?b.getHasUploadFile()?(K.setName(h.getSource().getName()),h.setSource(K),r=
!0,C()):e.getMessageCurtain().showPrompt(p.get("pleaseUploadFile","\u8bf7\u5148\u4e0a\u4f20\u6587\u4ef6\u3002")):a.getDbType()==na.TYPE_ACCESS?b.getHasUploadFile()?Z(K,C):e.getMessageCurtain().showPrompt(p.get("pleaseUploadFile","\u8bf7\u5148\u4e0a\u4f20\u6587\u4ef6\u3002")):r?C():Z(K,C))};this.isLastStep=function(){return A?!0:!1};this.over=function(C,ba){if(x&&A&&C){ba=!H.isChecked();C=x.getSource();var K=b.collectSource(),ca=u(K);ca.isNeedSelectDb()&&(ca.isSchemaSupported()?K.setSchema(f.getSelected()):
K.setDbName(f.getSelected()));ba?(K.isTheSame(C)||(ba=x.getName(),C.isUserSql(ba)?(ba=C.getUserSql(ba),K.addUserSql(ba)):C.isStoredProcedure(ba)&&(ba=C.getStoredProcedure(ba),K.addStoredProcedure(ba)),ba=v.getSources(),x.setSource(K),x.mergeSource(ba),(C.hasUserSql()||C.hasStoredProcedure())&&v.funClearUserSqlsAndStoredProcedures(C)),e.refreshDesigntimeDataObject(x,K)):(C=x.getSource(),C.hasUserSql&&C.hasUserSql()&&K.setAllUserSql(C.getAllUserSql()),C.hasStoredProcedure()&&K.setAllStoredProcedure(C.getAllStoredProcedure()),
(new Jc).updateSameSource(v,C,K,function(P){P.setSource(K);P.mergeSource(v.getSources());e.refreshDesigntimeDataObject(P,K)},x))}};var w=function(){var C=b.getDbNameList();f.setItemModels(C);C&&!h.getSource().getDbName()&&f.setSelected(C[0])},n=function(C){e.getMessageCurtain().showSuccess(C)},E=function(C){e.getMessageCurtain().showPrompt(C)},Z=function(C,ba){var K=b.checkTextFields();K?e.getMessageCurtain().showPrompt(K):e.checkConnection(C,function(ca){ca?(a.isTheSame(h.getSource())||h.setSource(a),
r=!0):r=!1;ba()})}}function L(){function h(Da,gb){KTDefaultCellRender.call(this,Da);var Ib=this;this.paintCellUI=function(Vb,fc){var pc=Ib.getCell().getValue(),Nc=pc.getName(),Lc=pc.getDisplayName(),Xc=Lc+"("+pc.getCommentInfo()+")",ed=a.find(".sa-ctrl-switcher-thumb").parent();if(pc instanceof Na){var Yc=$("<div>");Yc.addClass("dm-source-db-table-list-item");Yc.attr("table-name",S.encode(Nc));Yc.attr("title",Lc);var md=$("<div>");md.addClass("dm-source-db-table-list-item-text");md.css("left","0px");
md.css("top","-2px");md.text(Lc);Yc.append(md);Vb=$(Vb);Vb.css("left","4px");Vb.append(Yc)}else{Yc=$("<div>");Yc.addClass("dm-source-db-table-list-item");Yc.css("margin-left","-16px");Yc.attr("table-name",S.encode(Nc));Yc.attr("parent-name",S.encode(pc.getParentNode().getName()));Yc.attr("associateName",S.encode(pc.getAssociateName()));Yc.attr("table-type",S.encode(pc.getType()));ed.hasClass("sa-ctrl-switcher_on")?Yc.attr("title",Xc):Yc.attr("title",Lc);Yc.on("mousedown",Wa);var od=f.isMultiSelectable()?
f.newTableItemComponent(pc):f.newTableItemComponentWithRadio(pc);var pd=$("<div>");m.layoutCtrl(pd,25,0,300,23);pd.addClass("dm-source-db-table-item");var vd=$("<div>");vd.addClass("dm-source-db-table-list-item-icon");var Q=pc.getType();vb.background(vd,Q);md=$("<div>");md.addClass("dm-source-db-table-list-item-text");ed.hasClass("sa-ctrl-switcher_on")?(md.text(Xc),md.attr("entity-coding",Lc)):(md.text(Lc),md.attr("entity-coding",Xc));"xml"==Q&&md.attr("title",Xc);Lc=od.getJqUi();Yc.append(Lc);pd.append(vd);
pd.append(md);Yc.append(pd);for(var ta in n)pc==n[ta]&&od.setChecked(!0);""!=E&&E==Nc&&(pd.addClass("dm-source-db-table-list-item_selected"),vb.background(vd,Q+"_selected"));Vb=$(Vb);Vb.css("overflow","visible")}fc?(fc=$(fc),fc.css("overflow","visible"),Yc.appendTo(fc)):Yc.appendTo(Vb);m.layoutCtrlWithLRTB(Yc,0,0,null,0,0,null)}}function e(Da,gb){for(var Ib=0;Ib<ca.length;Ib++){var Vb=ca[Ib].getFileName();Vb=Vb.substring(0,Vb.lastIndexOf("."));if(f.getSource().getFileType()==ib.TYPE_TXT||f.getSource().getFileType()==
ib.TYPE_CSV){if(Vb===Da)return ca[Ib]}else if(Vb===gb)return ca[Ib]}}function b(Da,gb,Ib){var Vb=za(E);Vb&&(Vb=Vb.getFisrtEntity())&&Vb.getName()==Da.getName()&&(gb=p.get("totalRows","\u603b\u5171#1\u884c\u6570\u636e").replace("#1",Ib)+p.get("previewTipsComma",",")+gb,Mc(gb,Ib))}Jb.call(this);var f=this,c=this.protectedMethod,d,g,k,a,r,y,x,A,v,H,u=[],w,n=[],E,Z={},C=0,ba,K={},ca,P={},fa={},xb={};this.setArrSource=function(Da){ca=Da};this.getSubTitle=function(){return p.get("selectTable","\u9009\u62e9\u8868")};
this.isMultiSelectable=function(){return!0};this.addDataObjectNode=function(Da){u.push(Da)};this.setCustomHandler=function(Da){ba=Da};this.getDataObject=function(Da){return za(Da)};this.protectedGetPreviewTableImpl=function(){var Da=new wc;Da.setEnablePreviewFunction(N);return Da};this.protectedCreateUi=function(){d=$("<div>");a=$("<div>");g=$("<div>");a.append(g);v=f.protectedGetPreviewTableImpl();v.setSelectedDataObjectName(E);k=v.getJqUi();r=$("<div>");r.addClass("dm-source-db-table-selection-right");
A=new X;A.setText(p.get("selectedTable","\u5df2\u9009\u8868")+"("+n.length+")");A.getJqUi().addClass("dm-source-db-table-selection-selectedtablelabel");var Da=(new X(p.get("clearAll","\u5168\u90e8\u6e05\u9664"))).getJqUi();Da.addClass("dm-source-db-table-selection-clearalllabel");Da.on("mousedown",t);y=$("<div>");y.addClass("dm-source-db-table-selected-table-area");r.append(A.getJqUi());r.append(Da);r.append(y);sd(!0);return d};var tb=function(){if(f.isMultiSelectable()){var Da=new V;Da.setHorizontalSplit(!0);
Da.setEnabled(!0);Da.setFirstSize(200,185,300);Da.setSecondSize(520,0,-1);Da.setResizeMode(V.RESIZE_MODE_FIRST_FIXED);Da.setFirstChild(V.createChildWrapper(a));Da.setSecondChild(V.createChildWrapper(k,function(){v.relayoutViews()}));var gb=new V;gb.setHorizontalSplit(!0);gb.setEnabled(!0);gb.setFirstSize(728,-1,-1);gb.setSecondSize(200,185,300);gb.setResizeMode(V.RESIZE_MODE_SECOND_FIXED);gb.setFirstChild(Da);gb.setSecondChild(V.createChildWrapper(r));return gb}r.remove();Da=new V;Da.setHorizontalSplit(!0);
Da.setEnabled(!0);Da.setFirstSize(200,185,300);Da.setSecondSize(720,0,-1);Da.setResizeMode(V.RESIZE_MODE_FIRST_FIXED);Da.setFirstChild(V.createChildWrapper(a));Da.setSecondChild(V.createChildWrapper(k,function(){v.relayoutViews()}));return Da},Qb=function(){var Da=f.getSource().toJsonObject();f.getCtxApi().createFacade(function(gb){f.getCtxApi().createFacade().getExportedData(gb,".xlsx")},function(gb,Ib){return!0}).scanAllEntity(Da)};this.refreshPreviewTable=function(){v&&v.getPreviewTable()&&zb.refresh(v.getPreviewTable())};
this.over=function(Da){sd(!1)};this.intoThisStep=function(Da,gb){gb?zb.refresh(v.getPreviewTable()):(u=[],E="",n=[],dd(),f.loadLeftNodes())};this.outThisStep=function(Da,gb){if("dpp"===f.getSource().getTypeName())for(var Ib=Object.keys(K),Vb=0;Vb<Ib.length;Vb++){var fc=K[Ib[Vb]];f.getSource().addModelType(Ib[Vb],fc)}if(Da)gb(null);else if(0==n.length)c.getMessageCurtain().showPrompt(p.get("selectATable","\u8bf7\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\u6570\u636e\u8868\u3002")),gb(f);else if(f.protectedOutThisStep()){Da=
!0;for(var pc in n)if(Ib=n[pc].getName(),void 0==za(Ib)){gb(f);Da=!1;break}Da&&gb(null)}else c.getMessageCurtain().showPrompt(f.protectedOutThisStepPrompt())};this.protectedOutThisStep=function(){return!0};this.protectedOutThisStepPrompt=function(){return""};this.loadLeftNodes=function(){var Da=tb();d.append(Da.getJqUi());U()};this.getTableSearchBoxPlaceholder=function(Da){if("dpp"===f.getSource().getTypeName()){var gb=p.get("enterSearchModel","\u641c\u7d22\u6a21\u578b\u540d\u79f0");Da&&(gb=gb+"/"+
p.get("enterSearchModerMark","\u6a21\u578b\u7f16\u7801"))}else ka.ERPCloudEntity&&f.getSource()instanceof ka.ERPCloudEntity||ka.SuperQuery&&f.getSource()instanceof ka.SuperQuery?(gb=p.get("enterSearchText","\u641c\u7d22\u5b9e\u4f53\u540d\u79f0"),Da&&(gb=gb+"/"+p.get("enterSearchTextMark","\u5b9e\u4f53\u6807\u8bc6"))):gb=p.get("enterSearchTable","\u641c\u7d22\u6570\u636e\u8868\u540d\u79f0");return gb};this.setTableSearchBoxPlaceholder=function(Da){x&&x.setPlaceholder(f.getTableSearchBoxPlaceholder(Da))};
this.protectedCreateNoTableTipUi=function(){var Da=new X(p.get("nothingTable","\u6682\u65e0\u6570\u636e\u8868"));Da.setAlign(X.ALIGN_CENTER);return Da.getJqUi()};var U=function(){g.empty();var Da=rd(p.get("loadingData","\u52a0\u8f7d\u4e2d\uff0c\u8bf7\u7a0d\u5019\u2026\u2026"),g,20);C=Da;var gb=f.getSource().toJsonObject(),Ib=f.getCtxApi().createFacade(function(fc){var pc=new Na;pc.fromJsonObject(fc);fc=pc.getChildren();for(pc=0;pc<fc.length;pc++){var Nc=fc[pc];f.getTreeNodeParser()?f.getTreeNodeParser()(Nc):
O(Nc)}w=u;0<u.length&&(Da>=C&&qd(g),Yb(null,null),x&&x.getJqUi().remove(),x=new aa,x.addSearchListener(z),x.setPlaceholder(f.getTableSearchBoxPlaceholder(!1)),x.setShowSearchIcon(!0),fc=x.getJqUi(),fc.addClass("dm-source-db-table-selection-searchbox"),a.prepend(fc));z(!0);f.getSource().isShowEntityMark()&&0<u.length&&(fc=new Ac,fc.setJqLeftPane(a),pc=p.get("displayEntityMark","\u663e\u793a\u5b9e\u4f53\u6807\u8bc6"),"dpp"===f.getSource().getTypeName()&&(pc=p.get("displayModelCode","\u663e\u793a\u6a21\u578b\u7f16\u7801")),
fc.displayEntityCodingPane(".dm-source-db-table-list-item-text",".dm-source-db-table-selected-list-item-name",pc,".dm-source-db-table-list-item",f.setTableSearchBoxPlaceholder))},function(fc,pc){if(382011002==fc)return c.getMessageCurtain().showPrompt(p.get("noDmoPermission","\u6ca1\u6709\u6570\u636e\u5f00\u53d1\u5e73\u53f0\u6570\u636e\u8868\u6743\u9650\uff0c\u8bf7\u5148\u8054\u7cfb\u7ba1\u7406\u5458\u5206\u914d\u6743\u9650\u3002"),2E3),!0;if(2030100==fc)return c.getMessageCurtain().showError(p.get("entityFileNotFound",
"\u6570\u636e\u8868\u6587\u4ef6\u4e0d\u5b58\u5728\u3002")),!0;fc=fc.toString();if("20"==fc.substr(0,2)&&7==fc.length){if("20612"==fc.substr(0,5)||"20622"==fc.substr(0,5))return!1;c.getMessageCurtain().showError(pc);return!0}return!1});if(null!=ca){gb=[];for(var Vb=0;Vb<ca.length;Vb++)gb.push(ca[Vb].toJsonObject());Ib.getUsableEntitiesFromMultiFile(gb)}else Ib.getUsableEntities(gb)};this.getTreeNodeParser=function(){return null};var Ca=function(Da,gb){var Ib=[];if(Da instanceof sa){var Vb=$(".sa-ctrl-switcher-thumb").parent();
0<=Da.getDisplayName().toUpperCase().indexOf(gb.toUpperCase())?Ib.push(Da):Vb.hasClass("sa-ctrl-switcher_on")&&0<=Da.getCommentInfo().toUpperCase().indexOf(gb.toUpperCase())&&Ib.push(Da)}else{Vb=!0;var fc=Da.getChildren(),pc;for(pc in fc){var Nc=Ca(fc[pc],gb);Nc&&0<Nc.length&&(Vb&&(Ib.push(Da),Vb=!1),Ib=Ib.concat(Nc))}}return Ib},z=function(Da){w=[];var gb;x&&(gb=x.getText().trim());if(gb)for(var Ib in u){var Vb=u[Ib];0==Vb.getSubNodeLevel()&&(w=w.concat(Ca(Vb,gb)))}else w=u;g.empty();0==w.length?
(qd(g),Ib=new X(p.get("nothingSearched","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c")),Ib.setAlign(X.ALIGN_CENTER),Ib=Ib.getJqUi(),gb||(Ib=f.protectedCreateNoTableTipUi()),Ib.addClass("dm-source-db-table-selection-table-area-prompt"),g.append(Ib)):(Ib=$("<div>"),Ib.addClass("dm-source-db-table-selection-table-area"),Vb=W(gb?!0:!1),Ib.append(Vb),g.append(Ib));if(1==u.length&&Da){Da=u[0];Ib=Da.getName();if(Vb=$(x.getJqUi()).parent().find("[table-name='"+S.encode(Ib)+"']").find(".dm-source-db-table-list-item-component").data("model"))Vb.setChecked(!0),
f.defaultSelectTableWhenInit(Da),dd();ua(Ib)}"scanAllEntity"==gb&&Qb()};this.defaultSelectTableWhenInit=function(Da){0==n.length&&n.push(Da)};this.setArrSelectedDataObjectNode=function(Da){n=Da};this.getSelectedDataObjectMap=function(){var Da={},gb;for(gb in n){var Ib=n[gb].getName();Da[Ib]=za(Ib)}return Da};var N=function(){if(v.getCheckBoxIsChecked()){$(v.getPreviewTable().getUI()).show();var Da=za(E);if(Da){if(null!=ca&&0<ca.length){var gb=E.indexOf("/");var Ib=E.substring(gb+1,E.length);gb=E.substring(0,
gb);gb=e(Ib,gb)}Da=Da.getFisrtEntity();hb(Da,gb,Ib)}}else $(v.getPreviewTable().getUI()).hide()},t=function(){for(var Da in n)td(n[Da].getName());n=[];dd()},O=function(Da){u.push(Da);if(Da instanceof Na&&(Da=Da.getChildren()))for(var gb=0;gb<Da.length;gb++)O(Da[gb])},W=function(Da){var gb=new KTable,Ib=$(gb.getUI());f.isMultiSelectable()||(H=new kd,H.addChangedListener(lc));Ib.children().css("overflow-x","hidden");gb.setCellRender(new h(gb,f.isMultiSelectable()));gb.setSyncUIWhenModelChanged(!1);
gb.setLargeDataMode(!0,!1);gb.addColumn().setWidth(300);gb.addTreeExpandListener(function(){var Vb=gb.keepScrollStatus();Vb.v&&(Vb.v+=1);gb.restoreScrollStatus(Vb)});Fa(gb,Da);gb.updateUI();return Ib},Fa=function(Da,gb){null!=ca&&0<ca.length&&(gb=!0);var Ib=w;if(0==Ib.length)return!1;for(var Vb=0;Vb<Ib.length;Vb++){var fc=Ib[Vb],pc=Da.addRow();pc.setHeight(23);var Nc=pc.getCell(0);Nc.setValue(fc);fc=fc.getSubNodeLevel();var Lc=new KTCellTreeModel(fc);Lc.setExpanded(gb);!gb&&0<fc&&pc.setHide(!0);Nc.setTreeModel(Lc)}};
this.newTableItemComponent=function(Da){var gb=new La,Ib=gb.getJqUi();Ib.attr("table-name-component",S.encode(Da.getName()));Ib.addClass("dm-source-db-table-list-item-component");Ib.data("object",Da);Ib.data("model",gb);gb.addCheckedListener($c);return gb};this.newTableItemComponentWithRadio=function(Da){var gb=new Fc,Ib=gb.getJqUi();Ib.attr("table-name-component",S.encode(Da.getName()));Ib.addClass("dm-source-db-table-list-item-component");Ib.data("object",Da);Ib.data("model",gb);H.addElement(gb);
return gb};var Wa=function(Da){Da=$(Da.currentTarget);var gb=S.decode(Da.attr("table-name")),Ib=S.decode(Da.attr("parent-name"));if("dpp"===f.getSource().getTypeName()){var Vb=S.decode(Da.attr("table-type")),fc=S.decode(Da.attr("associateName"));f.getSource().setModelId(fc);f.getSource().setModelType(Vb);K[fc]=Vb}E!=gb&&(ua(gb,Ib),f.doCheckBox(Da))};this.doCheckBox=function(){};var ua=function(Da,gb){E&&D(!1);(E=Da)&&D(!0);v.refreshPreviewSetting(Da,function(){var Ib;null!=ca&&0<ca.length&&(Ib=e(Da,
gb));var Vb=za(Da);Vb?(Vb=Vb.getFisrtEntity(),F(Vb,Da)||hb(Vb,Ib,Da)):la(Da,gb)})},D=function(Da){var gb=$(x.getJqUi()).parent().find("[table-name='"+S.encode(E)+"']"),Ib=gb.find(".dm-source-db-table-list-item-component"),Vb=gb.find(".dm-source-db-table-item"),fc=Ib.data("object");fc&&(fc=fc.getType(),gb=gb.find(".dm-source-db-table-list-item-icon"),Da?(Vb.addClass("dm-source-db-table-list-item_selected"),vb.background(gb,fc+"_selected")):Da||(f.unCheckBox(Ib),Vb.removeClass("dm-source-db-table-list-item_selected"),
vb.background(gb,fc)))};this.unCheckBox=function(Da){};var la=function(Da,gb){v.getCheckBoxIsChecked()&&(Yb(null,null),rd(p.get("loadingPreviewData","\u6b63\u5728\u83b7\u53d6\u9884\u89c8\u6570\u636e\uff0c\u8bf7\u7a0d\u5019\u2026\u2026"),k.find(".dm-source-db-table-selection-datapreviewarea"),10));var Ib=f.getSource();null!=ca&&0<ca.length&&(Ib=e(Da,gb));var Vb={};Vb[Ib.getName()]=Ib;var fc=ka.SuperQuery&&Ib instanceof ka.SuperQuery;fc&&Ib.setQueryEntries(!0);gb=f.getCtxApi().createFacade(function(pc){var Nc=
new ob;Nc.fromJsonObject(pc,Vb);if(fc){Ib.setQueryEntries(!1);pc=null;for(var Lc=0;Lc<u.length;Lc++){var Xc=u[Lc];if(Xc.getName()==Da){pc=Xc.getDisplayName();break}}if(pc&&(Lc=Nc.getFisrtEntity(),Lc.setAlias(pc),Xc=Nc.getEntities(),null!=Xc))for(var ed=1;ed<Xc.length;ed++){Lc=Xc[ed];var Yc=pc+"_"+Lc.getAlias();Lc.setAlias(Yc)}}ba&&ba(Nc);pc=Nc.getFisrtEntity();F(pc,Da)||(Lc=f.protectedGetHasSelectedDataObjectCacheKey(Da),Z[Lc]=Nc,hb(pc,Ib,Da))},function(pc,Nc){fc&&Ib.setQueryEntries(!1);var Lc=pc.toString();
if("20"==Lc.substr(0,2)&&7==Lc.length&&209E4!=pc){if("20612"==Lc.substr(0,5)||"20622"==Lc.substr(0,5))return!1;qd(k.find(".dm-source-db-table-selection-datapreviewarea"));c.getMessageCurtain().showError(Nc);return!0}if("31"==Lc.substr(0,2)){if(3101018==pc)return ja(Da,p.get("modelDestroyedUnableToSelect","\u8be5\u6a21\u578b\u5df2\u635f\u574f\uff0c\u65e0\u6cd5\u88ab\u9009\u4e2d\u3002")),!0;if(3101022==pc)return ja(Da,p.get("modelNotExisted","\u8be5\u6a21\u578b\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u88ab\u9009\u4e2d\u3002")),
!0}else return!1});gb.setShowBlocking(!1);gb.getDesigntimeDataObject(Ib.toJsonObject(),Da)},za=function(Da){Da=f.protectedGetHasSelectedDataObjectCacheKey(Da);return Z[Da]};this.protectedGetHasSelectedDataObjectCacheKey=function(Da){return Da};var F=function(Da,gb){return 0==Da.getProperties().length?(ja(gb,p.get("noDataAndUnableToSelect","\u8be5\u8868\u6ca1\u6709\u6570\u636e\uff0c\u65e0\u6cd5\u88ab\u9009\u4e2d\u3002")),!0):!1},ja=function(Da,gb){c.getMessageCurtain().showPrompt(gb);Da=g.find("[table-name='"+
S.encode(Da)+"']");var Ib=Da.find(".dm-source-db-table-list-item-component"),Vb=Ib.data("model");Vb&&(Vb.setChecked(!1),Vb.setEnabled(!1));Da.find(".dm-source-db-table-list-item-text").css("color","#c0c0c0");Da=Ib.data("object");for(var fc in n)Da==n[fc]&&n.splice(fc,1);dd();Yb(null,null);rd(gb,k.find(".dm-source-db-table-selection-datapreviewarea"),10)},Pa=function(Da,gb,Ib,Vb){c.getMessageCurtain().hide(!0);Da>=C&&(qd(k.find(".dm-source-db-table-selection-datapreviewarea")),Da=new nb,gb&&Da.fromJsonObject(gb),
Da&&Da.getWarmingMessage()&&c.getMessageCurtain().showPrompt(Da.getWarmingMessage(),-1),v.getCheckBoxIsChecked()&&Yb(Ib,Da.getData(),Vb))},hb=function(Da,gb,Ib){if(v.getCheckBoxIsChecked()){Yb(null,null);var Vb=rd(p.get("loadingPreviewData","\u6b63\u5728\u83b7\u53d6\u9884\u89c8\u6570\u636e\uff0c\u8bf7\u7a0d\u5019\u2026\u2026"),k.find(".dm-source-db-table-selection-datapreviewarea"),10);C=Vb;var fc=ec(Da),pc=fa[Da.getName()];if(pc)setTimeout(function(){Pa(Vb,pc,fc,gb)},100);else{var Nc=gb?gb.toJsonObject():
f.getSource().toJsonObject(),Lc=f.getCtxApi().createFacade(function(Xc){fa[Da.getName()]=Xc;Pa(Vb,Xc,fc,gb,Ib)},function(Xc,ed,Yc){qd(k.find(".dm-source-db-table-selection-datapreviewarea"));Yc=Xc.toString();if("20"==Yc.substr(0,2)&&7==Yc.length){if("20612"==Yc.substr(0,5)||"20622"==Yc.substr(0,5))return!1;if(2020106==Xc)return c.getMessageCurtain().showPrompt(p.get("noDBCenterPermission","\u6ca1\u6709\u6570\u636e\u4e2d\u5fc3\u6743\u9650\uff0c\u8bf7\u5148\u8054\u7cfb\u7ba1\u7406\u5458\u5206\u914d\u6743\u9650\u3002")),
!0;if(2040004==Xc&&-1<ed.indexOf("Too many tables; MySQL can only use 61 tables in a join"))return c.getMessageCurtain().showPrompt(p.get("tooManyTablesCanNotPreviewError","\u5f53\u524d\u5b9e\u4f53\u5173\u8054\u7684\u6570\u636e\u8868\u8fc7\u591a\uff0c\u4e0d\u80fd\u6b63\u5e38\u9884\u89c8\u6570\u636e\uff0c\u4f60\u53ef\u4ee5\u8fdb\u5165\u201c\u4e0b\u4e00\u6b65\u201d\u51cf\u5c11\u6570\u636e\u8868\u7684\u5173\u8054\u6570\u91cf\u3002")),!0}else if("21"==Yc.substr(0,2)){if(2101019==Xc)return ja(Ib,p.get("modelUnAvailable",
"\u6ca1\u6709\u8be5\u6a21\u578b\u7684\u8fd0\u884c\u6743\u9650\uff0c\u65e0\u6cd5\u88ab\u9009\u4e2d\u3002")),!0}else if("31"==Yc.substr(0,2)){if(3101018==Xc)return ja(Ib,p.get("modelDestroyedUnableToSelect","\u8be5\u6a21\u578b\u5df2\u635f\u574f\uff0c\u65e0\u6cd5\u88ab\u9009\u4e2d\u3002")),!0}else return!1});Lc.setShowBlocking(!1);Lc.previewData([fc.toJsonObject()],[Nc],11)}}},Yb=function(Da,gb,Ib,Vb){qd(k.find(".dm-source-db-table-selection-datapreviewarea"));Vb=v.getPreviewTable();if(!f.getCtxApi().isFinished()){zb.clear(Vb);
if(Da){for(var fc=zb.createHeadRow(Vb),pc=Da.getProperties(),Nc=pc.length,Lc=[],Xc=0;Xc<Nc;Xc++){var ed=pc[Xc],Yc=ed.getOutputDataType(),md=Yc==Mb.DT_INT||Yc==Mb.DT_NUMBER,od=Vb.addColumn(ed.getName());od.setStyle(zb.getColumnStyle(md));od.setWidth(Vc(Yc));fc.getCell(Xc).setValue(ed.getAlias());Lc[Xc]=bc.createFormater(Yc,ed.getFormatString())}fc=gb.length;Xc=0;for(Nc=Math.min(fc,10);Xc<Nc;Xc++)for(Yc=gb[Xc],md=zb.createRow(Vb),od=0;od<Yc.length;od++){var pd=(0,Lc[od])(Yc[od]);ed=pc[od];ed.getEnumValue()&&
(ed=ed.getEnumValue(),ed[pd]&&(pd=ed[pd]));md.getCell(od).setValue(pd)}gb=10<fc;pc=pc.length>=L.PREVIEW_LIMITED_COLS;0==fc?(gb=p.get("noData","\u6ca1\u6709\u6570\u636e"),Mc(gb)):gb||pc?!gb&&pc?(gb=p.get("totalRows","\u603b\u5171#1\u884c\u6570\u636e").replace("#1",fc),gb+=p.get("previewTipsComma",",")+p.get("dataShownCols","\u4ec5\u9884\u89c8\u524d#1\u5217\u6570\u636e").replace("#1",L.PREVIEW_LIMITED_COLS),Mc(gb,fc)):(gb&&!pc?(Mc(p.get("loadingTotalRows","\u6b63\u5728\u8ba1\u7b97\u603b\u884c\u6570\uff0c\u8bf7\u7a0d\u5019....")),
gb=p.get("dataShownRows","\u4ec5\u9884\u89c8\u524d#1\u884c\u6570\u636e").replace("#1",10)):(Mc(p.get("loadingTotalRows","\u6b63\u5728\u8ba1\u7b97\u603b\u884c\u6570\uff0c\u8bf7\u7a0d\u5019....")),gb=p.get("dataShownRowsAndCols","\u4ec5\u9884\u89c8\u524d#1\u884c\u3001\u524d#2\u5217\u6570\u636e"),gb=gb.replace("#1",10),gb=gb.replace("#2",L.PREVIEW_LIMITED_COLS)),fd(Da,gb,Ib)):(gb=p.get("totalRows","\u603b\u5171#1\u884c\u6570\u636e").replace("#1",fc),Mc(gb,fc))}zb.refresh(Vb)}},ec=function(Da){Da=Da.cloneMe();
var gb=Da.getProperties();gb.length>L.PREVIEW_LIMITED_COLS&&gb.splice(L.PREVIEW_LIMITED_COLS);return Da},Vc=function(Da){switch(Da){case Mb.DT_INT:case Mb.DT_NUMBER:return 90;case Mb.DT_DATE:return 80;case Mb.DT_DATETIME:return 130;case Mb.DT_BOOLEAN:return 40;default:return 120}},fd=function(Da,gb,Ib){var Vb=xb[Da.getName()];Vb?b(Da,gb,Vb):(Ib=Ib?Ib.toJsonObject():f.getSource().toJsonObject(),Vb=f.getCtxApi().createFacade(function(fc){xb[Da.getName()]=fc;b(Da,gb,fc)},function(fc,pc){var Nc=fc.toString();
if("20"==Nc.substr(0,2)&&7==Nc.length&&209E4!=fc){if("20612"==Nc.substr(0,5)||"20622"==Nc.substr(0,5))return!1;2040005==fc?Mc(pc):(gb=p.get("loadingTotalRowsError","\u83b7\u53d6\u603b\u884c\u6570\u5931\u8d25"),Mc(gb));return!0}return!1}),Vb.setShowBlocking(!1),Vb.getDataCount([Da.toJsonObject()],[Ib]))},Mc=function(Da,gb){P.sTips=Da;P.iDataCount=gb;var Ib=v.getPreviewTable(),Vb=10;gb&&10>gb&&(Vb=gb);Ib.getRowsCount()-zb.getHeadRowCount()==Vb||0==Ib.getRowsCount()-zb.getHeadRowCount()?(gb=zb.createRow(Ib),
gb.getCell(0).setValue(Da),Da=new KTStyle,Da.setBackgroundColor(com.kingdee.bos.qing.common.CommonTableSkin.ODD_ROW_BACKGROUND_COLOR),gb.setStyle(Da),Da=new KTStyle,Da.setTextAlign("left"),gb.getCell(0).setStyle(Da),zb.refresh(Ib)):Ib.getRowsCount()-zb.getHeadRowCount()==Vb+1&&(gb=Ib.getRowsCount()-1,Ib.getRow(gb).getCell(0).setValue(Da),zb.refresh(Ib))},lc=function(Da,gb){Da=Da.getJqUi().data("object");gb&&(n=[Da])},$c=function(Da,gb){var Ib=Da.getJqUi().data("object");if(gb)if(Da.isChecked())(null==
n||0>n.indexOf(Ib))&&n.push(Ib);else for(var Vb in n)Ib==n[Vb]&&n.splice(Vb,1);dd()},dd=function(){y.empty();if(0<n.length){var Da=$(document.createDocumentFragment()),gb;for(gb in n){var Ib=Da,Vb=Ib.append,fc=n[gb],pc=$("<div>"),Nc=fc.getDisplayName(),Lc=fc.getCommentInfo(),Xc=Nc+"("+Lc+")",ed=a.find(".sa-ctrl-switcher-thumb").parent();pc.addClass("dm-source-db-table-selected-list-item");pc.attr("table-name",S.encode(fc.getName()));pc.data("object",fc);pc.on("mouseenter",id);pc.on("mouseleave",hd);
pc.css("margin-left",20);Lc=$("<div>");ed.hasClass("sa-ctrl-switcher_on")?(pc.attr("title",Xc),Lc.text(Xc),Lc.attr("entity-coding",Nc)):(pc.attr("title",Nc),ed=fc.getName().indexOf("/"),null!=ca&&0<ca.length&&0<ed?(fc=fc.getName().substring(0,ed)+"_"+Nc,Lc.text(fc),pc.attr("title",fc)):Lc.text(Nc),Lc.attr("entity-coding",Xc));Lc.addClass("dm-source-db-table-selected-list-item-name");Lc.css("max-width","80%");fc=$("<div>");fc.addClass("dm-source-db-table-selected-list-item-icon");vb.background(fc,
"btn_delete");fc.on("click",ud);pc.append(fc);pc.append(Lc);Vb.call(Ib,pc)}y.append(Da)}A.setText(p.get("selectedTable","\u5df2\u9009\u8868")+"("+n.length+")");100<=n.length&&A.getJqUi().attr("title",p.get("selectedTable","\u5df2\u9009\u8868")+"("+n.length+")")},id=function(Da){$(Da.currentTarget).find(".dm-source-db-table-selected-list-item-icon").css("display","block")},hd=function(Da){$(Da.currentTarget).find(".dm-source-db-table-selected-list-item-icon").css("display","none")},ud=function(Da){Da=
$(Da.currentTarget).parent().data("object");for(var gb in n)Da==n[gb]&&n.splice(gb,1);td(Da.getName());dd()},td=function(Da){(Da=g.find("[table-name-component='"+S.encode(Da)+"']").data("model"))&&Da.setChecked(!1)},qd=function(Da){Da.find(".dm-source-db-table-selection-waiting").remove()},rd=function(Da,gb,Ib){qd(gb);var Vb=$("<div>");Vb.text(Da);Vb.addClass("dm-source-db-table-selection-waiting");Vb.css("top",Ib);Vb.appendTo(gb);return(new Date).getTime()},sd=function(Da){Da?Ma.addWindowResizeListener("updatePreviewTableHandler",
function(){v&&zb.refresh(v.getPreviewTable());P&&P.sTips&&P.iDataCount&&Mc(P.sTips,P.iDataCount)}):Ma.removeWindowResizeListener("updatePreviewTableHandler")}}function mc(){var h=this,e,b,f;this.getJqUi=function(){if(!e){e=$("<div>");e.addClass("dm-source-db-table-selection-center");h.protectedCustomPriviewSetting(e);f=zb.createTable();var c=$(f.getUI());c.addClass("dm-source-db-table-selection-datapreviewarea");e.append(c)}return e};this.setSelectedDataObjectName=function(c){b=c};this.getSelectedDataObjectName=
function(){return b};this.getPreviewTable=function(){return f};this.relayoutViews=function(){f.relayoutViews()};this.refreshPreviewSetting=function(c,d){d()};this.getCheckBoxIsChecked=function(){throw Error("Override me");};this.protectedCustomPriviewSetting=function(c){throw Error("Override me");}}function wc(){mc.call(this);var h,e;this.setEnablePreviewFunction=function(b){e=b};this.protectedCustomPriviewSetting=function(b){var f=(new X(p.get("priview","\u9884\u89c8"))).getJqUi();f.addClass("dm-source-db-table-selection-priviewlabel");
h=new La;h.setText(p.get("enablePriview","\u542f\u7528\u9884\u89c8"));h.setChecked(!0);h.addCheckedListener(e);var c=h.getJqUi();c.addClass("dm-source-db-table-selection-priviewcheckbox");b.append(f);b.append(c)};this.getCheckBoxIsChecked=function(){return h.isChecked()}}function Bc(){Jb.call(this);var h=this,e=this.protectedMethod,b=0,f,c,d,g,k=[],a,r={},y={},x={},A=[],v={},H=[],u,w,n,E,Z,C=Eb.BizSourceTypeContext;this.getSubTitle=function(){return p.get("selectField","\u9009\u62e9\u5b57\u6bb5")};
this.setFieldSelectChangeListener=function(z){E=z};this.setDefaultCheckEntityMap=function(z){w=z};this.setAllFieldSearchBoxPlaceholder=function(z){for(var N in v)v.hasOwnProperty(N)&&v[N].setFieldSearchBoxPlaceholder(z)};this.protectedCreateUi=function(){u=$("<div>");c=$("<div>");var z=(new X(p.get("selected","\u5df2\u9009"))).getJqUi();z.addClass("dm-source-db-field-selection-tablelabel");c.append(z);f=new T;f.setItemHeight(26);z=f.getJqUi();z.addClass("dm-source-db-field-selection-table-area");
c.append(z);h.getSource().isShowEntityMark()&&"dpp"!==h.getSource().getTypeName()&&(z=new Ac,z.setJqLeftPane(c),z.displayEntityCodingPane(".dm-source-db-field-table-list-item-text",".dm-fieldselection-checkbox-text",p.get("displayFieldMark","\u663e\u793a\u5b9e\u4f53/\u5b57\u6bb5\u6807\u8bc6"),".dm-source-db-field-table-list-item",h.setAllFieldSearchBoxPlaceholder),Z=z);Ia=c;d=$("<div>");d.addClass("dm-source-db-field-selection-right");n=$("<div>");n.addClass("dm-source-db-field-selection-field-area");
d.append(n);z=new V;z.setHorizontalSplit(!0);z.setEnabled(!0);z.setFirstSize(200,185,300);z.setSecondSize(700,-1,-1);z.setResizeMode(V.RESIZE_MODE_SECOND_FIXED);z.setFirstChild(V.createChildWrapper(c));z.setSecondChild(V.createChildWrapper(d));u.append(z.getJqUi());return u};this.intoThisStep=function(z,N){if(!N){g="";k=[];r={};A=[];v={};a=z.getSelectedDataObjectMap();for(var t in a)if(N=a[t]){z=N.getEntityMap();N=N.getRelations();for(var O in z){var W=z[O],Fa=W.isSubNodeAtView();k.push(W);var Wa=
W.getAssociateName();r[Wa]=W;y[Wa]=w?null!=w[Wa]:!Fa}if(N)for(var ua in N)A.push(N[ua])}f.getJqUi().empty();f.setItemCount(k.length);f.setItemUiCreator(P);f.repaint();Qb(k[0].getAssociateName())}};this.checkEntityAndField=function(z){var N=[],t;for(t in k){var O=k[t].getAssociateName();y[O]&&N.push(k[t])}0===N.length?(z(!1),e.getMessageCurtain().showPrompt(p.get("selectATable","\u8bf7\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\u6570\u636e\u8868\u3002"))):ba(N,0,z)};var ba=function(z,N,t){if(N>=z.length)t(!0);
else{var O=z[N],W=O.getAssociateName(),Fa=v[W];if(Fa){Fa=Fa.getSelectedFieldName();var Wa=[];for(D in A){var ua=A[D];ua.getFromEntity().getAssociateName()==W?(ua=ua.getFromProperty().getName(),0>Wa.indexOf(ua)&&Wa.push(ua)):ua.getToEntity().getAssociateName()==W&&(ua=ua.getToProperty().getName(),0>Wa.indexOf(ua)&&Wa.push(ua))}var D=!1;for(var la in Fa)if(0>Wa.indexOf(Fa[la])){D=!0;break}if(!D){0==Wa.length?1==z.length?e.getMessageCurtain().showPrompt(p.get("atLeastSelectAField","\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\u5b57\u6bb5\u3002")):
e.getMessageCurtain().showPrompt(p.get("ensureHasSelectedField","\u8bf7\u786e\u4fdd\u6bcf\u4e2a\u6570\u636e\u8868\u90fd\u6709\u9009\u4e2d\u5b57\u6bb5\u3002")):e.getMessageCurtain().showPrompt(p.get("ensureHasSelectedFieldWithLock","\u8bf7\u786e\u4fdd\u6bcf\u4e2a\u6570\u636e\u8868\u9664\u9501\u5b9a\u7684\u5173\u8054\u5b57\u6bb5\u5916\uff0c\u81f3\u5c11\u6709\u4e00\u4e2a\u9009\u4e2d\u5b57\u6bb5\u3002"));t(!1);g!=W&&Qb(W);return}}else if(!w||!w[W]){1==z.length?e.getMessageCurtain().showPrompt(p.get("atLeastSelectAField",
"\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\u5b57\u6bb5\u3002")):e.getMessageCurtain().showPrompt(p.get("ensureHasSelectedField","\u8bf7\u786e\u4fdd\u6bcf\u4e2a\u6570\u636e\u8868\u90fd\u6709\u9009\u4e2d\u5b57\u6bb5\u3002"));t(!1);g!=W&&Qb(W);return}O=K(O);ad.checkFieldNum(null!=O?O.length:0,e.getMessageCurtain(),function(za){za?ba(z,N+1,t):(t(!1),g!=W&&Qb(W))})}};this.outThisStep=function(z,N){z?(b=0,N&&N(null)):h.checkEntityAndField(function(t){t&&"relationDiff"!=h.protectedGetNextStep()&&N&&N(h.protectedGetNextStep())})};
this.protectedGetNextStep=function(){return null};this.isLastStep=function(){return!0};this.getCheckedCloneEntities=function(){var z=[],N={},t;for(t in k){var O=k[t];if(y[O.getAssociateName()]){var W=O.getParentEntity();W?(W=N[W.getName()],O=O.cloneMe(W)):O=O.cloneMe(null);N[O.getName()]=O;W=K(O);O.setProperties(W);z.push(O)}}return z};this.getCheckedEntities=function(){var z=[],N;for(N in k){var t=k[N];if(y[t.getAssociateName()]){z.push(t);var O=K(t);t.setProperties(O)}}h.protectedHandleEntities(z);
return z};this.protectedHandleEntities=function(z){};this.getAllInnerRelations=function(){return A};this.getValidRelation4CheckedEntity=function(){var z=[],N;for(N in A){var t=A[N],O=t.getFromEntity(),W=t.getToEntity();y[O.getAssociateName()]&&y[W.getAssociateName()]&&z.push(t)}return z};this.over=function(z){if(z&&0==b){b=1;for(z=0;z<H.length;z++){var N=H[z];h.getSource().addStoredProcedure(N)}h.getCtxApi().finish(h.getCheckedEntities(),h.getValidRelation4CheckedEntity());h.getCtxApi().refreshFinishFlag()}};
this.setStoredProcedureModels=function(z){H=z};var K=function(z){var N=z.getAssociateName(),t=[],O=v[N];if(O){N=O.getSelectedFieldName();z=z.getProperties();O=z.length;for(var W=0;W<O;W++)0<=N.indexOf(z[W].getName())&&t.push(z[W])}else t=w?w[N]:null,t=null!=t?t.getProperties():z.getProperties();return t},ca=function(z,N){N=z.getJqUi().data("index");N=k[N];y[N.getAssociateName()]=z.isChecked();if(z.isChecked())for(z=N.getParentEntity();null!=z;){N=z.getAssociateName();var t=x[N];if(t.isChecked())break;
else t.setChecked(!0),y[N]=!0}else for(z=(new Zb).getEntityWithSubNodesUtil(N,k),z.splice(0,1),N=0;N<z.length;N++)t=z[N].getAssociateName(),y[t]=!1,x[t].setChecked(!1)},P=function(z){var N=k[z],t=N.getAssociateName(),O=N.getAlias(),W=N.getSubNodeLevel(),Fa=c.find(".sa-ctrl-switcher-thumb").parent(),Wa=N.getCommentInfo();Wa=O+"("+Wa+")";var ua=C.isBizSourceType(N.getSource().getTypeName()),D=$("<div>");D.addClass("dm-source-db-field-table-list-item");D.data("object",N);D.attr("table-name",S.encode(t));
D.attr("title",O);D.on("mousedown",tb);D.on("mouseenter",fa);D.on("mouseleave",xb);var la=$("<div>"),za=pa.entity2IconName(N),F=$("<div>");if(ua&&"dpp"!==h.getSource().getTypeName())return ua=$("<div>"),ua.addClass("dm-source-db-field-entity-table-list-item"),h.newTableItemComponent(z,N,W,ua,D),la.addClass("dm-source-db-field-table-list-item-icon"),vb.background(la,za),F.addClass("dm-source-db-field-table-list-item-text"),Fa.hasClass("sa-ctrl-switcher_on")?(D.attr("title",Wa),F.text(Wa),F.attr("entity-coding",
O)):(D.attr("title",O),F.text(O),F.attr("entity-coding",Wa)),D.append(la),D.append(F),ua.append(D),""!=g&&g==t&&D.addClass("dm-source-db-field-table-list-item_selected"),ua;la.addClass("dm-source-db-field-table-list-item-icon");vb.background(la,za);F.addClass("dm-source-db-field-table-list-item-text");Fa.hasClass("sa-ctrl-switcher_on")?(D.attr("title",Wa),F.text(Wa),F.attr("entity-coding",O)):(D.attr("title",O),F.text(O),F.attr("entity-coding",Wa));D.append(la);D.append(F);""!=g&&g==t&&D.addClass("dm-source-db-field-table-list-item_selected");
return D};this.newTableItemComponent=function(z,N,t,O,W){var Fa=N.isSubNodeAtView(),Wa=new La;Wa.setUserObject(N);var ua=Wa.getJqUi();ua.data("model",Wa);ua.data("index",z);ua.addClass("dm-source-db-table-entity-list-item-checkbox");Wa.setEnabled(Fa);ka.SuperQuery&&h.getSource()instanceof ka.SuperQuery&&Wa.setEnabled(!0);Wa.setChecked(w?null!=w[N.getAssociateName()]:!Fa);Wa.addCheckedListener(ca);x[N.getAssociateName()]=Wa;Fa?(ua.css("margin-left",20*t),W.css("margin-left",20*t+25)):W.css("margin-left",
25);O.append(ua)};var fa=function(z){$(z.currentTarget).find(".dm-source-db-field-table-list-item-menu").css("display","block")},xb=function(z){$(z.currentTarget).find(".dm-source-db-field-table-list-item-menu").css("display","none")},tb=function(z){z=$(z.currentTarget);var N=S.decode(z.attr("table-name"));g!=N&&Qb(N);h.doSelectItem(z)};this.doSelectItem=function(z){};var Qb=function(z){g&&U(!1);(g=z)&&U(!0);n.detach();Ca(z)},U=function(z){var N=f.getJqUi().find("[table-name='"+S.encode(g)+"']"),
t=N.data("object");if(t){var O=N.find(".dm-source-db-field-table-list-item-icon"),W=N.find(".dm-source-db-field-table-list-item-menu");t=pa.entity2IconName(t);z?(N.addClass("dm-source-db-field-table-list-item_selected"),vb.background(O,t+"_selected"),vb.background(W,"delete_selected")):(N.removeClass("dm-source-db-field-table-list-item_selected"),vb.background(O,t),vb.background(W,"delete"))}},Ca=function(z){var N=r[z].getProperties();if(v[z]){var t=v[z];t.setAllField(N)}else{var O=[];for(t in A){var W=
A[t];W.getFromEntity().getAssociateName()==z?(W=W.getFromProperty().getName(),0>O.indexOf(W)&&O.push(W)):W.getToEntity().getAssociateName()==z&&(W=W.getToProperty().getName(),0>O.indexOf(W)&&O.push(W))}var Fa=[];(t=w?w[z]:null)?t.getProperties().forEach(function(Wa){Wa.getName()!=Mb.CUSTOM_BIZ_ENTITY_NAME_FIELD&&Fa.push(Wa.getName())}):Fa=O.slice();t=new Gc;t.setAllField(N);t.setEntityAssociateName(z);t.setLockSelectedFieldNames(O);t.setAllRelationPropNames(O);t.setSelectedFieldName(Fa);t.addFieldSelectChangeListener(function(Wa,
ua,D){D&&(Wa=x[Wa])&&!Wa.isChecked()&&Wa.setChecked(!0)});E&&t.addFieldSelectChangeListener(E);v[z]=t}z=Z?Z.getSwitchButtonStatus():!1;t.setSwitchButtonStatus(z);d.empty();d.append(t.getJqUi())};e.doPressTableItem=tb;e.selectTable=Qb}function Gc(){var h=this,e,b,f,c=[],d=[],g,k,a=[],r,y,x,A,v,H,u,w=[],n=!1,E,Z,C,ba,K,ca;this.getJqUi=function(){e=$("<div>");x=new aa;x.addSearchListener(xb);x.setPlaceholder(h.getFieldSearchBoxPlaceholder(ca));x.setShowSearchIcon(!0);y=x.getJqUi();y.addClass("dm-source-db-table-selection-searchbox");
y.css("width","230px");e.append(y);m.layoutCtrlWithLRTB(y,17,0,null,0,null,23);var t=new La;t.setText(p.get("showOnlySelected","\u4ec5\u663e\u793a\u9009\u4e2d\u9879"));t.addCheckedListener(fa);t=t.getJqUi();e.append(t);m.layoutCtrlWithLRTB(t,325,null,140,0,null,23);C=$("<div>");e.append(C);f=h.getSelectedFieldName();v=new X;H=v.getJqUi();e.append(H);m.layoutCtrlWithLRTB(H,90,0,null,33,null,21);tb();w=u=b;P();e.append(A);return e};this.setChoiceField=function(t){ba=t};this.addFieldSelectChangeListener=
function(t){a.push(t)};this.setEntityAssociateName=function(t){K=t};this.setSwitchButtonStatus=function(t){ca=t};this.setFieldSearchBoxPlaceholder=function(t){x.setPlaceholder(h.getFieldSearchBoxPlaceholder(t))};this.getFieldSearchBoxPlaceholder=function(t){return t?p.get("enterSearchField","\u641c\u7d22\u5b57\u6bb5\u540d\u79f0")+"/"+p.get("enterSearchFieldMark","\u5b57\u6bb5\u6807\u8bc6"):p.get("enterSearchField","\u641c\u7d22\u5b57\u6bb5\u540d\u79f0")};var P=function(){C.empty();var t=!0,O=!1;E=
n||x.getText().trim()?u.filter(function(Pa){return-1<w.indexOf(Pa)}):b;A?A.empty():A=$("<div>");g=new La;g.setText(p.get("selectAll","\u5168\u9009"));g.addCheckedListener(Qb);k=g.getJqUi();k.addClass("dm-fieldselection-checkboxall");r=$("<div>");r.addClass("dm-fieldselection-checkbox-area");m.layoutCtrlWithLRTB(A,18,0,null,33,0,null);A.append(k);A.append(r);for(var W=0;W<E.length;W++){var Fa=E[W],Wa=Fa.getAlias(),ua=Fa.getName(),D=Fa.getCommentInfo(),la=Wa+"("+D+")";D=$("<div>");D.addClass("dm-fieldselection-checkbox");
D.attr("field-name",S.encode(ua));var za=new La;za.setUserObject(Fa);var F=za.getJqUi();F.addClass("dm-fieldselection-checkbox-icon");F.attr("field-name-checkbox",S.encode(ua));F.data("model",za);c&&0<=c.indexOf(ua)?za.setEnabled(!1):(za.setEnabled(!0),za.addCheckedListener(U));var ja=$("<div>");null==Ia||ba?(ja.text(Wa),ja.attr("entity-coding",la)):Ia.find(".sa-ctrl-switcher-thumb").parent().hasClass("sa-ctrl-switcher_on")?(ja.text(la),ja.attr("entity-coding",Wa)):(ja.text(Wa),ja.attr("entity-coding",
la));ja.addClass("dm-fieldselection-checkbox-text");Wa=$("<div>");Wa.addClass("dm-fieldselection-checkbox-pic");vb.background(Wa,"relation");D.append(F);D.append(ja);0<=d.indexOf(Fa.getName())&&(D.append(Wa),Fa=$("<div>"),Fa.addClass("dm-fieldselection-checkbox-warning"),Fa.text(p.get("theRalationWillBeDeletedWhenDeleteTheField","\u5220\u9664\u8be5\u5b57\u6bb5\u7684\u540c\u65f6\u4f1a\u5220\u9664\u5173\u7cfb")),D.append(Fa),Fa.hide());f&&0<=f.indexOf(ua)?(O=!0,za.setChecked(!0)):t=!1;r.append(D)}g.setChecked(t&&
O);0==E.length&&(t=new X(p.get("nothingSearched","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c")),t.setEnabled(!1),Z=t.getJqUi(),m.layoutCtrlWithLRTB(Z,18,0,null,60,null,16),C.append(Z))},fa=function(t,O){n=t.isChecked();w=[];if(O){if(t.isChecked())for(w=[],t=0;t<b.length;t++)0<=f.indexOf(b[t].getName())&&w.push(b[t]);else w=b;P()}},xb=function(t){var O=t.getJqUi();t=x.getText().trim();O=O.parents(".sa-ctrl-splitpane-part").siblings(".sa-ctrl-splitpane-part").find("#dm-field-popup-show-field-comment").find(".sa-ctrl-switcher-thumb").parent();
u=[];if(t)for(var W in b){var Fa=b[W];0<=Fa.getAlias().toUpperCase().indexOf(t.toUpperCase())?u.push(b[W]):O.hasClass("sa-ctrl-switcher_on")&&0<=Fa.getCommentInfo().toUpperCase().indexOf(t.toUpperCase())&&u.push(b[W])}else H&&H.show(),u=b;P()},tb=function(){var t=f.length;t=p.get("selectedCount","(\u5df2\u9009\u62e9 #1 \u9879)").replace("#1",t);v.setText(t)};this.setAllField=function(t){b=t};this.getAllField=function(){return b};this.setSelectedFieldName=function(t){f=t};this.getSelectedFieldName=
function(){return f};this.setLockSelectedFieldNames=function(t){c=t};this.setAllRelationPropNames=function(t){d=t};var Qb=function(t,O){if(O){for(var W in E){O=E[W];var Fa=!1;if(0>c.indexOf(O.getName())){var Wa=z(O);Wa.setChecked(t.isChecked());var ua=O.getName(),D=0<=f.indexOf(ua);t.isChecked()&&!D?(f.push(ua),Fa=!0):!t.isChecked()&&D&&(f.splice(f.indexOf(ua),1),Fa=!0);N(Wa)}Fa&&Ca(K,O,t.isChecked())}tb()}},U=function(t,O){if(O){O=!0;var W=t.getUserObject();if(t.isChecked())f.push(W.getName());else for(var Fa in f)f[Fa]==
W.getName()&&f.splice(Fa,1);N(t);if(t.isChecked())for(var Wa in E){if(!z(E[Wa]).isChecked()){O=!1;break}}else O=!1;Ca(K,t.getUserObject(),t.isChecked());g.setChecked(O);tb()}},Ca=function(t,O,W){for(var Fa=0;Fa<a.length;Fa++)(0,a[Fa])(t,O,W)},z=function(t){return e.find("[field-name-checkbox='"+S.encode(t.getName())+"']").data("model")},N=function(t){var O=t.getUserObject().getName(),W=e.find("[field-name='"+S.encode(O)+"']").find(".dm-fieldselection-checkbox-warning");t.isChecked()?W.hide():0<=d.indexOf(O)?
W.show():W.hide()}}function Wc(){function h(ua,D){KTDefaultCellRender.call(this,ua);var la=this;this.paintCellUI=function(za,F){var ja=la.getCell().getValue(),Pa=ja.getName(),hb=ja.getDisplayName();if(ja instanceof Na){var Yb=$("<div>");Yb.addClass("dm-source-db-table-list-item");Yb.attr("table-name",S.encode(Pa));Yb.attr("title",hb);Yb.css("margin-left",20*ja.getSubNodeLevel());var ec=$("<div>");ec.addClass("dm-source-db-table-list-item-text");ec.css("left","16px");ec.css("top","-2px");ec.text(hb);
Yb.append(ec);za=$(za);za.css("left","4px");za.append(Yb)}else{Yb=$("<div>");Yb.addClass("dm-source-db-table-list-item");Yb.css("margin-left","-16px");Yb.attr("table-name",S.encode(Pa));Yb.attr("title",hb);Yb.on("mousedown",xb);var Vc=e.newTableItemComponent(ja),fd=$("<div>");m.layoutCtrl(fd,25,0,300,23);fd.addClass("dm-source-db-table-item");var Mc=$("<div>");Mc.addClass("dm-source-db-table-list-item-icon");vb.background(Mc,"stored-procedure");ec=$("<div>");ec.addClass("dm-source-db-table-list-item-text");
ec.text(hb);Yb.append(Vc.getJqUi());fd.append(Mc);fd.append(ec);Yb.append(fd);for(var lc in H)ja==H[lc]&&Vc.setChecked(!0);""!=u&&u==Pa&&(fd.addClass("dm-source-db-table-list-item_selected"),vb.background(Mc,"stored-procedure_selected"));za=$(za);za.css("overflow","visible");F?(F=$(F),F.css("overflow","visible"),Yb.appendTo(F)):Yb.appendTo(za)}m.layoutCtrlWithLRTB(Yb,0,0,null,0,0,null)}}Jb.call(this);var e=this,b=this.protectedMethod,f,c,d,g,k,a,r,y,x,A=[],v,H=[],u,w={},n={},E=!0;this.getSubTitle=
function(){return p.get("selectStoredProcedure","\u9009\u62e9\u5b58\u50a8\u8fc7\u7a0b")};this.addDataObjectNode=function(ua){A.push(ua)};this.isMultiSelectable=function(){return!0};this.getDataObject=function(ua){return n[ua]};this.setArrSelectedDataObjectNode=function(ua){H=ua};this.protectedCreateUi=function(){var ua=$("<div>");f=$("<div>");g=$("<div>");f.append(g);k=$("<div>");k.addClass("dm-source-db-table-selection-right");var D=$("<div>");D.text(p.get("selectAStoredProcedure","\u8bf7\u9009\u4e2d\u4e00\u4e2a\u5b58\u50a8\u8fc7\u7a0b"));
D.addClass("dm-source-db-table-selection-tips");D.appendTo(k);c=$("<div>");c.addClass("dm-source-db-table-selection-right");r=new X;D=p.get("selectedStoredProcedure","\u5df2\u9009\u5b58\u50a8\u8fc7\u7a0b")+"("+H.length+")";r.setText(D);r.getJqUi().addClass("dm-source-db-table-selection-selectedtablelabel");r.getJqUi().attr("title",D);D=(new X(p.get("clearAll","\u5168\u90e8\u6e05\u9664"))).getJqUi();D.addClass("dm-source-db-table-selection-clearalllabel");D.on("mousedown",P);a=$("<div>");a.addClass("dm-source-db-table-selected-table-area");
c.append(r.getJqUi());c.append(D);c.append(a);D=Z();ua.append(D.getJqUi());return ua};var Z=function(){if(e.isMultiSelectable()){var ua=new V;ua.setHorizontalSplit(!0);ua.setEnabled(!0);ua.setFirstSize(200,185,300);ua.setSecondSize(520,0,-1);ua.setResizeMode(V.RESIZE_MODE_FIRST_FIXED);ua.setFirstChild(V.createChildWrapper(f,function(){x&&x.relayoutViews()}));ua.setSecondChild(V.createChildWrapper(k,function(){x&&x.relayoutViews()}));var D=new V;D.setHorizontalSplit(!0);D.setEnabled(!0);D.setFirstSize(728,
-1,-1);D.setSecondSize(200,185,300);D.setResizeMode(V.RESIZE_MODE_SECOND_FIXED);D.setFirstChild(ua);D.setSecondChild(V.createChildWrapper(c,function(){x&&x.relayoutViews()}));return D}ua=new V;ua.setHorizontalSplit(!0);ua.setEnabled(!0);ua.setFirstSize(200,185,300);ua.setSecondSize(720,0,-1);ua.setResizeMode(V.RESIZE_MODE_FIRST_FIXED);ua.setFirstChild(V.createChildWrapper(f,function(){x&&x.relayoutViews()}));ua.setSecondChild(V.createChildWrapper(k,function(){x&&x.relayoutViews()}));return ua};this.intoThisStep=
function(ua,D){D||K()};this.outThisStep=function(ua,D){E&&(ua?D(null):0==H.length?(b.getMessageCurtain().showPrompt(p.get("selectAStoredProcedure","\u8bf7\u9009\u4e2d\u4e00\u4e2a\u5b58\u50a8\u8fc7\u7a0b\u3002")),D(e)):C(D))};this.isLastStep=function(){return!1};this.getNextStep=function(ua){var D=new Bc;D.setCtxApi(e.getCtxApi());D.setSource(e.getSource());D.setStoredProcedureModels(ua);return D};var C=function(ua){var D=!0,la;for(la in H)if(D){var za=H[la].getName();if(void 0==n[za]){D=!1;var F=
w[za],ja=F.doCheckParameters();if(ja){D=ja.getPrompt();b.getMessageCurtain().showPrompt(D);tb(za);return}ja="dm"+(new Date).getTime();F.setName(ja);var Pa=e.getSource().clone();Pa.setName(e.getSource().getName());Pa.addStoredProcedure(F);F=e.getCtxApi().createFacade(function(hb){E=!0;var Yb={};Yb[Pa.getName()]=Pa;var ec=new ob;ec.fromJsonObject(hb,Yb);n[za]=ec;C(ua)},function(hb,Yb,ec){E=!0;ec=hb.toString();return"20"==ec.substr(0,2)&&7==ec.length&&209E4!=hb?(2020501==hb&&(Yb=-1==Yb?p.get("notFindResult",
"\u6ca1\u6709\u83b7\u53d6\u5230\u5b58\u50a8\u8fc7\u7a0b#1\u7684\u7ed3\u679c\u96c6\u3002").replace("#1",za):p.get("notFindIdxResult","\u6ca1\u6709\u83b7\u53d6\u5230\u5b58\u50a8\u8fc7\u7a0b#1\u7b2c#2\u4e2a\u7684\u7ed3\u679c\u96c6\u3002").replace("#1",za).replace("#2",Yb)),ua(e),b.getMessageCurtain().showPrompt(Yb),!0):!1});F.setShowBlocking(!1);F.getDesigntimeDataObject(Pa.toJsonObject(),ja);E=!1}}D&&(D=ba(),ua(e.getNextStep(D)))},ba=function(){for(var ua=[],D=0;D<H.length;D++){var la=H[D].getName(),
za=n[la],F=w[la],ja=za.getName();za=za.getFisrtEntity();for(var Pa=la,hb=1;e.getCtxApi().isEntityAliasExist(Pa);)Pa=la+"_"+hb++;za.setAlias(Pa);F.setName(ja);ua.push(F)}return ua},K=function(){g.empty();Wa(p.get("loadingData","\u52a0\u8f7d\u4e2d\uff0c\u8bf7\u7a0d\u5019\u2026\u2026"),g,20,30);var ua=e.getSource().toJsonObject();e.getCtxApi().createFacade(function(D){var la=new Na;la.fromJsonObject(D);D=la.getChildren();for(la=0;la<D.length;la++)fa(D[la]);v=A;0<A.length&&(d=new aa,d.addSearchListener(ca),
d.setPlaceholder(p.get("enterSearchText","\u641c\u7d22\u5b9e\u4f53\u540d\u79f0")),d.setShowSearchIcon(!0),D=d.getJqUi(),D.addClass("dm-source-db-table-selection-searchbox"),f.prepend(D));ca(!0)},function(D,la){var za=D.toString();if("20"==za.substr(0,2)&&7==za.length&&209E4!=D){if(2020502==D){var F=p.get("dbStoredProcedureNameRepeat","\u68c0\u6d4b\u5230\u5b58\u5728\u91cd\u590d\u7684\u5b58\u50a8\u8fc7\u7a0b\u540d\u79f0\uff0c\u8bf7\u786e\u4fdd\u5b58\u50a8\u8fc7\u7a0b\u540d\u79f0\u4e0d\u91cd\u590d\u3002");
Wa(F,g,20,0);setTimeout(function(){b.getMessageCurtain().showError(F)},100)}else b.getMessageCurtain().showError(la);return!0}return!1}).getStoredProcedures(ua)},ca=function(ua){v=[];var D,la=$(".sa-ctrl-switcher-thumb").parent();d&&(D=d.getText().trim());if(D)for(var za in A){var F=A[za];F instanceof sa&&0<=F.getDisplayName().toUpperCase().indexOf(D.toUpperCase())?v.push(A[za]):la.hasClass("sa-ctrl-switcher_on")&&0<=F.getCommentInfo().toUpperCase().indexOf(D.toUpperCase())&&v.push(A[za])}else v=
A;g.empty();if(0==v.length)y&&y.remove(),ua=new X(p.get("nothingSearched","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c")),ua.setAlign(X.ALIGN_CENTER),ua=ua.getJqUi(),ua.addClass("dm-source-db-table-selection-table-area-prompt"),g.append(ua);else{la=$("<div>");la.addClass("dm-source-db-table-selection-table-area");D=D?!0:!1;za=new KTable;F=$(za.getUI());F.children().css("overflow-x","hidden");za.setCellRender(new h(za,!0));za.setSyncUIWhenModelChanged(!1);za.addColumn().setWidth(300);var ja=v;
if(0!=ja.length)for(var Pa=0;Pa<ja.length;Pa++){var hb=ja[Pa],Yb=za.addRow();Yb.setHeight(23);var ec=Yb.getCell(0);ec.setValue(hb);hb=D?0:hb.getSubNodeLevel();hb=new KTCellTreeModel(hb);hb.setExpanded(!1);0<hb.getLevel()&&Yb.setHide(!0);ec.setTreeModel(hb)}za.updateUI();la.append(F);g.append(la);if(1==A.length&&1==ua){ua=A[0];la=ua.getName();if(D=$(d.getJqUi()).parent().find("[table-name='"+S.encode(la)+"']").find(".dm-source-db-table-list-item-component").data("model"))D.setChecked(!0),e.defaultSelectTableWhenInit(ua),
N();tb(la)}}};this.defaultSelectTableWhenInit=function(ua){0==H.length&&H.push(ua)};this.getSelectedDataObjectMap=function(){var ua={},D;for(D in H){var la=H[D].getName();ua[la]=n[la]}return ua};var P=function(){for(var ua in H)Fa(H[ua].getName());H=[];N()},fa=function(ua){A.push(ua);if(ua instanceof Na&&(ua=ua.getChildren()))for(var D=0;D<ua.length;D++)fa(ua[D])};this.newTableItemComponent=function(ua){var D=new La,la=D.getJqUi();la.attr("table-name-component",S.encode(ua.getName()));la.addClass("dm-source-db-table-list-item-component");
la.data("object",ua);la.data("model",D);D.addCheckedListener(z);return D};var xb=function(ua){ua=$(ua.currentTarget);var D=S.decode(ua.attr("table-name"));tb(D);e.doCheckBox(ua)};this.doCheckBox=function(){};var tb=function(ua){u!=ua&&(u&&Qb(!1),(u=ua)&&Qb(!0),k.empty(),U(ua))},Qb=function(ua){var D=$(d.getJqUi()).parent().find("[table-name='"+S.encode(u)+"']"),la=D.find(".dm-source-db-table-list-item-component"),za=D.find(".dm-source-db-table-item");la.data("object")&&(D=D.find(".dm-source-db-table-list-item-icon"),
ua?(za.addClass("dm-source-db-table-list-item_selected"),vb.background(D,"stored-procedure_selected")):(za.removeClass("dm-source-db-table-list-item_selected"),vb.background(D,"stored-procedure")))},U=function(ua){Wa(p.get("loadingPreviewData","\u6b63\u5728\u83b7\u53d6\u9884\u89c8\u6570\u636e\uff0c\u8bf7\u7a0d\u5019\u2026\u2026"),k,-4,0);var D=w[ua];D?(x=new M,x.setInitValue(D,e.getSource(),e.getCtxApi().createFacade,b.getMessageCurtain()),x.setCallbackDesignTimeDataObject(Ca),k.empty(),k.append(x.getJqUi()),
x.refreshTable()):(D=e.getCtxApi().createFacade(function(la){for(var za=[],F=0;F<la.length;F++){var ja=new Gb;ja.fromJsonObject(la[F]);za.push(ja)}la=new Ta;la.setAssociateName(ua);la.setParameters(za);za="dm"+(new Date).getTime();la.setName(za);w[ua]=la;x=new M;x.setInitValue(la,e.getSource(),e.getCtxApi().createFacade,b.getMessageCurtain());x.setCallbackDesignTimeDataObject(Ca);k.empty();k.append(x.getJqUi());x.refreshTable()},function(la,za){var F=la.toString();return"20"==F.substr(0,2)&&7==F.length&&
209E4!=la?(y&&y.remove(),b.getMessageCurtain().showError(za),!0):!1}),D.setShowBlocking(!1),D.getStoredProcedureParameters(e.getSource().toJsonObject(),ua))},Ca=function(ua,D){n[ua]=D},z=function(ua,D){var la=ua.getJqUi().data("object");if(D)if(ua.isChecked())(null==H||0>H.indexOf(la))&&H.push(la);else for(var za in H)la==H[za]&&H.splice(za,1);N()},N=function(){a.empty();if(0<H.length){var ua=$(document.createDocumentFragment()),D;for(D in H){var la=ua,za=la.append,F=H[D],ja=$("<div>"),Pa=F.getName(),
hb=F.getDisplayName();Pa=Pa+"("+hb+")";var Yb=f.find(".sa-ctrl-switcher-thumb").parent();ja.addClass("dm-source-db-table-selected-list-item");ja.attr("table-name",S.encode(F.getName()));ja.data("object",F);ja.on("mouseenter",t);ja.on("mouseleave",O);ja.css("margin-left",20);F=$("<div>");Yb.hasClass("sa-ctrl-switcher_on")?(ja.attr("title",Pa),F.text(Pa),F.attr("entity-coding",hb)):(ja.attr("title",hb),F.text(hb),F.attr("entity-coding",Pa));F.addClass("dm-source-db-table-selected-list-item-name");hb=
$("<div>");hb.addClass("dm-source-db-table-selected-list-item-icon");vb.background(hb,"btn_delete");hb.on("click",W);ja.append(hb);ja.append(F);za.call(la,ja)}a.append(ua)}r.setText(p.get("selectedStoredProcedure","\u5df2\u9009\u5b58\u50a8\u8fc7\u7a0b")+"("+H.length+")");100<=H.length&&r.getJqUi().attr("title",p.get("selectedStoredProcedure","\u5df2\u9009\u5b58\u50a8\u8fc7\u7a0b")+"("+H.length+")")},t=function(ua){$(ua.currentTarget).find(".dm-source-db-table-selected-list-item-icon").css("display",
"block")},O=function(ua){$(ua.currentTarget).find(".dm-source-db-table-selected-list-item-icon").css("display","none")},W=function(ua){ua=$(ua.currentTarget).parent().data("object");for(var D in H)ua==H[D]&&H.splice(D,1);Fa(ua.getName());N()},Fa=function(ua){(ua=g.find("[table-name-component='"+S.encode(ua)+"']").data("model"))&&ua.setChecked(!1)},Wa=function(ua,D,la,za){y&&y.remove();y=$("<div>");y.text(ua);y.addClass("dm-source-db-table-selection-waiting");y.css("top",la);y.css("left",za);y.appendTo(D)}}
function dc(){Jb.call(this);var h=this,e=this.protectedMethod,b,f,c,d,g,k=!1;this.setSqlType=function(a){f=a};this.setAlias=function(a){g=a};this.setIsShowTips=function(a){k=a};this.setUserSqlObj=function(a){d=a};this.getSubTitle=function(){return p.get("customSql","\u81ea\u5b9a\u4e49")+f};this.protectedCreateUi=function(){c=new Hc;if(void 0==d){var a=new Tc;a.setSqlType(f)}else a=d,h.setSqlType(d.getSqlType()),c.setAlias(g),c.setReadonly(!0);c.setIsShowTips(k);c.setUserSqlObjModel(a);c.setFacadeCreator(h.getCtxApi().createFacade);
c.setMessageCurtain(e.getMessageCurtain());return c.getJqUi()};this.getNextStep=function(a){return null};this.intoThisStep=function(a,r){};this.outThisStep=function(a,r){if(a)e.getTopJqUi()&&e.getTopJqUi().remove(),r(null);else if(a=c.check())e.getMessageCurtain().showPrompt(a);else{var y=h.getSource().clone();y.setName(h.getSource().getName());c.asynGetUserSqlObjModel(function(x){y.addUserSql(x);c.getDesigntimeDataObject(y,x.getName(),e.getMessageCurtain(),h.getCtxApi().createFacade,function(A,v){for(var H=
v,u=1;h.getCtxApi().isEntityAliasExist(H);)H=v+"_"+u++;v={};v[h.getSource().getName()]=h.getSource();u=new ob;u.fromJsonObject(A,v);A=u.getFisrtEntity();A.setAlias(H);b=[A];h.isLastStep()&&h.getSource().addUserSql(x);r(h.getNextStep(x))})})}};this.isLastStep=function(){return!0};this.getArrEntity=function(){return b};this.over=function(a){a&&h.getCtxApi().finish(b,[])}}function Hc(){var h,e,b,f,c,d=!1,g,k,a=!1,r,y,x;this.getJqUi=function(){h||A();return h};this.setMessageCurtain=function(u){x=u};
this.asynGetUserSqlObjModel=function(u){var w=new Tc;w.setSqlType(k.getSqlType());if(k.getName())w.setName(k.getName());else{var n="dm"+(new Date).getTime();w.setName(n)}var E=kc.getAllImpl(),Z=c.val(),C=0,ba=E.length,K=function(ca){Z=ca;C++;C<ba?E[C].switchSQLToPersistentMode(Z,K):(w.setContent(Z),u(w))};E[C].switchSQLToPersistentMode(Z,K)};this.setFacadeCreator=function(u){y=u};this.setUserSqlObjModel=function(u){k=u};this.setIsShowTips=function(u){a=u};this.setAlias=function(u){g=u};this.check=
function(){if(""==e.getText())return p.get("inputNameNotNull","\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a\u3002");var u=c.val();return""==u?k.getSqlType()+p.get("inputSqlNotNull","\u4e0d\u80fd\u4e3a\u7a7a\u3002"):0!=u.trim().toLowerCase().indexOf("select")?p.get("onlyAllowSelection","\u53ea\u5141\u8bb8\u67e5\u8be2\u64cd\u4f5c"):null};this.getDesigntimeDataObject=function(u,w,n,E,Z,C){E(function(ba){var K=e.getText(),ca={};ca[u.getName()]=u;var P=new ob;P.fromJsonObject(ba,ca);ca=P.getFisrtEntity().getProperties().length;
ad.checkFieldNum(ca,n,function(fa){fa?Z&&Z(ba,K):C&&C()})},function(ba,K){C&&C();var ca=ba.toString();"20"==ca.substr(0,2)&&7==ca.length?(2020400==ba&&"kSQLTranUnknError"==K?K=p.get("kSQLTranUnknError","KSQL\u8f6c\u6362\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u672a\u77e5\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5\u8bed\u6cd5\u662f\u5426\u6b63\u786e\u3002"):2020400==ba?K=p.get("kSQLTranFail","KSQL\u8f6c\u6362\u5931\u8d25\uff0c\u5931\u8d25\u4fe1\u606f\uff1a")+K:2013002==ba?K=p.get("macroNotFound","\u5f53\u524d\u5b9e\u4f53\u5f15\u7528\u7684\u5b8f\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u5b8fid\u4e3a\uff1a#1\u3002").replace("#1",
K):2013003==ba?K=p.get("macroNoAuthority","\u5f53\u524d\u5b9e\u4f53\u5f15\u7528\u4e86\u6ca1\u6709\u6743\u9650\u67e5\u770b\u7684\u5b8f\uff0c\u5b8f\u540d\u79f0\u4e3a\uff1a#1\u3002").replace("#1",K):2013004==ba?K=p.get("macroDBUnset","\u5f53\u524d\u5b9e\u4f53\u5f15\u7528\u7684\u5b8f\u672a\u8bbe\u7f6e\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u5b8f\u540d\u79f0\u4e3a\uff1a#1\u3002").replace("#1",K):2013005==ba?K=p.get("superQueryMacroNoPerm",'\u5b8f\u53d8\u91cf"#1"\u4f7f\u7528\u7684\u8d85\u7ea7\u67e5\u8be2\u8fde\u63a5\u5df2\u88ab\u53d6\u6d88\u6388\u6743\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u3002').replace("#1",
K):2013006==ba&&(K=p.get("macroNoFoundEntity","\u5f53\u524d\u5b9e\u4f53\u5f15\u7528\u7684\u5b8f\uff0c\u5176\u4f7f\u7528\u7684\u57fa\u7840\u8d44\u6599\u4e0d\u5b58\u5728\uff0c\u5b8f\u540d\u79f0\u4e3a\uff1a#1\u3002").replace("#1",K)),n.showPrompt(K),ba=!0):ba=!1;return ba}).getDesigntimeDataObject(u.toJsonObject(),w)};this.setReadonly=function(u){d=u};var A=function(){h=$("<div>");var u=new X(p.get("customSqlName","\u540d\u79f0"));e=new Va;b=e.getJqUi();d&&(e.setEnabled(!1),b.attr("title",g));f=new X("");
var w=$("<div>"),n=$("<span>");n.text(p.get("needWhereTips","\u4e3a\u4e86\u9632\u6b62\u67e5\u8be2\u7684\u6570\u636e\u91cf\u8fc7\u591a\u9020\u6210\u6027\u80fd\u95ee\u9898\uff0c\u8bf7\u5728SQL\u8bed\u53e5\u4e2d\u4f7f\u7528where/limit\u5b50\u53e5"));n.appendTo(w);n=new xa;n.setIconType(xa.ICON_TYPE_QUESTION);n.setTipsSize(255,60);n.setTipsHtml(w[0]);w=n.getJqUi();c=$("<textarea spellcheck='false'>");c.addClass("dm-source-db-selection-sql-textarea");if(Ga.isIEBrowser())c.on("beforedeactivate",function(){r=
c[0].selectionStart});n=new sb;n.setFontSize(12,"Microsoft YaHei");var E=new cb;E.setSelectedCallback(v);E=E.getJqUi();var Z=new kb(y,function(){return c.val()});Z.setMessageCurtain(x,k.getSqlType());Z=Z.getJqUi();m.layoutCtrl(u.getJqUi(),0,0,50,23);m.layoutCtrl(b,50,0,184,23);m.layoutCtrlWithLRTB(E,null,0,n.measureWidth(E.text())+10,0,null,23);m.layoutCtrl(f.getJqUi(),0,35,50,23);m.layoutCtrl(w,28,40,16,16);m.layoutCtrl(c,50,40,870,338);m.layoutCtrlWithLRTB(Z,null,0,n.measureWidth(Z.text())+10,390,
null,23);h.append(u.getJqUi());h.append(b);h.append(E);h.append(f.getJqUi());a&&h.append(w);h.append(c);h.append(Z);H()},v=function(u){u=u.getTextInUserSQL();var w=c[0],n=w.value;if(Ga.isIEBrowser())w.value=n.substring(0,r)+u+n.substring(r,n.length),r+=u.length,w.setSelectionRange(r,r),w.focus();else{if("number"===typeof w.selectionStart&&"number"===typeof w.selectionEnd){var E=w.selectionStart,Z=w.selectionEnd;var C=E;w.value=n.substring(0,E)+u+n.substring(Z,n.length);C+=u.length}else w.value+=u;
setTimeout(function(){C&&w.setSelectionRange(C,C);w.focus()},100)}},H=function(){e.setText(g);f.setText(k.getSqlType());var u=k.getContent(),w=kc.getAllImpl(),n=0,E=w.length,Z=function(C){u=C;c.text(u);n++;n>=E||w[n].switchSQLToDisplayMode(u,Z)};w[n].switchSQLToDisplayMode(u,Z)}}function Sc(){var h=this,e=[],b,f,c,d=[],g,k,a;this.setItemModels=function(u){e=u;k=null};this.setItemsWidth=function(u){f=u};this.setText=function(u){b=u;g&&g.text(b?b:"")};this.setCustomPainter=function(u){c=u;k&&A()};this.addPressedListener=
function(u){d.push(u)};this.getJqUi=function(){g||(g=$("<div>"),g.text(b?b:""),g.addClass("dm-source-dropdownitemlistpane-text"),g.on("click",r));return g};var r=function(){if(a)y();else{k||x();var u=$(document.body),w=g.outerHeight(),n=f?f:g.outerWidth(),E=[0,w];E=m.upwardCoordinate(g[0],E,u[0]);w=E[0];var Z=E[1];E=u.prop("clientHeight");var C=Math.min(20*Math.max(1,Math.min(e.length,10))+2,(E>>1)-10);Z+C>E&&(E=[0,0],E=m.upwardCoordinate(g[0],E,u[0]),E=E[1]-C,0<=E&&(Z=E));a=$("<div>");a.addClass("dm-dropdownitemlist-popup");
a.css("position","absolute");a.css("left",w+"px");a.css("top",Z+"px");a.css("width",n+"px");a.css("height",C+"px");a.css("box-shadow","0 0 2px 0 #ccc");a.css("z-index","999999");a.appendTo(u);n=k.getJqUi();n.appendTo(a);n.css("position","absolute");n.css("left","0px");n.css("top","0px");n.css("width","100%");n.css("height","100%");k.scrollSelectedToVisible();u.on("mousedown",H);u.on("mousewheel",v)}},y=function(){if(a){var u=$(document.body);u.off("mousedown",H);u.off("mousewheel",v);a.detach();a=
null}},x=function(){k=new jb;k.setItemModels(e);k.addPressedListener(function(u,w){y();for(var n=0;n<d.length;n++)(0,d[n])(h,u.getSelecteds()[0],w);(u=u.getJqUi().find(".sa-ctrl-list-item_selected_enabled"))&&u.removeClass("sa-ctrl-list-item_selected_enabled")});A()},A=function(){c?k.setCustomItemPainter(function(u,w){c(!1,u,w)}):k.setCustomItemPainter(null)},v=function(u){return m.isDescendent(u.target,k.getJqUi()[0])?!0:!1},H=function(u){g.is(":visible")&&(m.isDescendent(u.target,g[0])||m.isDescendent(u.target,
a[0]))||y()}}function Dc(){var h=this,e,b,f,c=!1,d,g,k,a,r,y;this.setClosingAction=function(u){r=u};this.setChangeDataSourceParameter=function(u,w,n,E){d=u;g=w;k=n;a=E};this.setCloseCallerDialogCallback=function(u){y=u};var x=function(){var u=new jc;u.setChangeSourceType(!0);u.setDModel(d);u.setOldEntity(g);u.setFacadeCreator(k.createFacade);u.setEntityExistChecker(A,v);u.setFinishedCallback(function(n){r&&r(n)});u.setDataSourceDisabled(a);var w=new nc;w.setTitle(p.get("changeDataSource","\u66f4\u6362\u6570\u636e\u6e90"));
w.setSteps([u]);w.show(960,540);y&&y()},A=function(u){return h.getDmModel().isEntityNameExist(u)},v=function(u){return h.getDmModel().isEntityAliasExist(u)},H=function(){c?(f.removeClass(),f.addClass("advanced-setting-text-on"),f.text(p.get("advancedSetting","\u9ad8\u7ea7")+"..."),b.hide(),c=!1):(f.removeClass(),f.addClass("advanced-setting-text"),f.text(p.get("advancedSetting","\u9ad8\u7ea7")+"\uff1a"),b.show(),c=!0)};this.getJqUi=function(){if(!e){e=$("<div>");f=$("<div>");f.addClass("advanced-setting-text-on");
f.text(p.get("advancedSetting","\u9ad8\u7ea7")+"...");f.on("click",H);f.appendTo(e);m.layoutCtrl(f,0,0,50,23);b=$("<div>");m.layoutCtrl(b,20,35,300,23);var u=$("<div>");u.addClass("advanced-change-text");u.text(p.get("changeDataSource","\u66f4\u6362\u6570\u636e\u6e90"));u.on("click",x);u.appendTo(b);u=new xa;u.setIconType(xa.ICON_TYPE_QUESTION);u.setTipsSize(230,52);u.setTipsText(p.get("changeDataSourceTips","\u53ef\u66f4\u6362\u5f53\u524d\u6570\u636e\u6e90\u7684\u7c7b\u578b\uff0c\u4f8b\u5982\u5c06Excel\u6570\u636e\u6e90\u66f4\u6362\u4e3aMySQL\u6570\u636e\u6e90"));
u=u.getJqUi();u.addClass("advanced-change-icon");u.appendTo(b);b.appendTo(e);b.hide()}return e}}function cd(){ia.call(this);var h=this,e=this.protectedMethod,b,f,c;this.edit=function(d,g,k,a,r){h.setSize(640,520);e.setTitle(p.get("modifyConnection","\u6570\u636e\u6e90"));f=d;c=a;e.setContentPaneCreator(function(){return h.propectedCreateJqUi(d,g,k,a,r)});e.setClosingChecker(h.protectedIsValidToAccepted,!0);e.setClosingAction(function(y){y&&h.protectedAccepted(g,k)});h.showDialog()};this.propectedCreateJqUi=
function(d,g,k,a,r){c=a;throw Error("Override me.");};this.protectedIsValidToAccepted=function(d){d(!0)};this.protectedAccepted=function(d,g){throw Error("Override me.");};this.refreshDesigntimeDataObject=function(d,g,k){var a={};a[g.getName()]=g;k=k.createFacade(function(r){var y=new ob;y.fromJsonObject(r,a);r=d.getAssociateName();null==y.getEntityByAssociateName(r)?(y=new ra,y.setErrorState(Eb.AbstractEntity.ERROR_STATE_TABLENOTEXIST),d.setErrorInfo(y)):d.setErrorInfo(null);b(d.getName())},function(r,
y){var x=Eb.AbstractEntity.ERROR_STATE_TABLENOTEXIST;2020401==r?x=Eb.AbstractEntity.ERROR_STATE_KSQL_NOT_SUPPORT:2020503==r&&(x=Eb.AbstractEntity.ERROR_STATE_STORED_PROCEDURE_NOT_SUPPORT);var A=new ra;A.setErrorState(x);d.setErrorInfo(A);b(d.getName());r=r.toString();return"20"==r.substr(0,2)&&7==r.length?(e.getMessageCurtain().showError(y),!0):!1});k.setShowBlocking(!1);k.getDesigntimeDataObject(g.toJsonObject(),d.getAssociateName())};this.setConfirmListener=function(d){b=d};this.getConfirmListener=
function(){return b};this.protectedMethod.updateSameSource=function(d,g){var k=new Jc,a=d.getSource();k.updateSameSource(f,g,a,function(r){r.setSource(a);h.refreshDesigntimeDataObject(r,a,c)},d)}}function ld(){Jb.call(this);var h=this,e=this.protectedMethod,b,f,c=!1,d,g,k=!1;this.setChangeSourceType=function(x){c=x};this.setOldEntity=function(x){f=x};this.setDModel=function(x){d=x};this.getSubTitle=function(){return p.get("selectFile","\u9009\u62e9\u6587\u4ef6")};this.setIsUsedForMerge=function(x){k=
x};this.protectedCreateUi=function(){b=new R;b.setCtxApi(h.getCtxApi());var x=lb.getUrlParamValue("flatFileSize");b.setFileSize(x?x:100);b.setSource(h.getSource().clone());b.setMessageCurtain(e.getMessageCurtain());b.setChangeSourceType(c);b.setIsUsedForMerge(k);return b.getJqUi()};this.intoThisStep=function(x,A){};this.createNextTableSteps=function(){var x=new L;x.setCtxApi(h.getCtxApi());x.setSource(h.getSource());x.setArrSource(g);var A=new Bc;A.setCtxApi(h.getCtxApi());A.setSource(h.getSource());
return[x,A]};this.outThisStep=function(x,A){if(x)e.getTopJqUi()&&e.getTopJqUi().remove(),A(null);else{var v=function(){c?A(null):A(h.createNextTableSteps())};if(b.isUploading())e.getMessageCurtain().showPrompt(p.get("theFileIsUploading","\u6587\u4ef6\u6b63\u5728\u4e0a\u4f20\u4e2d\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\u3002"));else if(b.hasUploadFile()){x=h.getSource();g=b.getArrSource();var H=b.getArrSource()[0],u=H.getFileName();x.setFileUrl(H.getFileUrl());x.setFileName(u);x.setDefineTypeRowCount(H.getDefineTypeRowCount());
x.setCharacterSet(H.getCharacterSet());x.getFileType()==ib.TYPE_TXT||x.getFileType()==ib.TYPE_CSV?(u=H.getSplitSign())?(x.setSplitSign(u),x.setTextLimitSign(H.getTextLimitSign()),v()):e.getMessageCurtain().showPrompt(p.get("customSplitSignShouldNotNull","\u81ea\u5b9a\u4e49\u5206\u9694\u7b26\u4e0d\u80fd\u4e3a\u7a7a\u3002")):x.getFileType()==ib.TYPE_EXCEL?c&&f?a(H,function(w){w&&v()}):v():x.getFileType()==ib.TYPE_XML&&(c&&f?r(H,function(w){w&&v()}):v())}else e.getMessageCurtain().showPrompt(p.get("pleaseUploadFile",
"\u8bf7\u5148\u4e0a\u4f20\u6587\u4ef6\u3002"))}};var a=function(x,A){var v=[],H=f.getSource(),u=f.getName(),w=f.getAssociateName().substring(f.getAssociateName().indexOf("/")+1);H.isUserSql(u)&&(w=f.getAlias());H.isStoredProcedure(u)&&H.supportStoredProcedure()&&(w=H.getStoredProcedure(u).getAssociateName());var n=function(E){v.push(E.getName().substring(E.getName().indexOf("/")+1));if(E instanceof Na&&(E=E.getChildren()))for(var Z=0;Z<E.length;Z++)n(E[Z])};H=h.getCtxApi().createFacade(function(E){var Z=
new Na;Z.fromJsonObject(E);E=Z.getChildren();for(Z=0;Z<E.length;Z++)n(E[Z]);0<=v.indexOf(w)?A(!0):(e.getMessageCurtain().showPrompt(p.get("noCorrespondingSheetInThisFile","\u4e0a\u4f20\u7684\u6587\u4ef6\u4e2d\u6ca1\u6709\u540d\u79f0\u4e3a\u201c#1\u201d\u7684\u5de5\u4f5c\u8868\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002").replace("#1",w)),A(!1))},function(E,Z){E=E.toString();"20"==E.substr(0,2)&&7==E.length&&e.getMessageCurtain().showPrompt(Z);A(!1)});x=x.toJsonObject();H.getUsableEntities(x)},r=function(x,
A){var v=[],H=f.getSource(),u=f.getName(),w=f.getAssociateName().substring(f.getAssociateName().indexOf("/")+1);H.isUserSql(u)&&(w=f.getAlias());H.isStoredProcedure(u)&&H.supportStoredProcedure()&&(w=H.getStoredProcedure(u).getAssociateName());var n=function(E){v.push(E.getName().substring(E.getName().indexOf("/")+1));if(E instanceof Na&&(E=E.getChildren()))for(var Z=0;Z<E.length;Z++)n(E[Z])};H=h.getCtxApi().createFacade(function(E){var Z=new Na;Z.fromJsonObject(E);E=Z.getChildren();for(Z=0;Z<E.length;Z++)n(E[Z]);
0<=v.indexOf(w)?A(!0):(e.getMessageCurtain().showPrompt(p.get("noCorrespondingXmlNodeInThisFile","\u4e0a\u4f20\u7684\u6587\u4ef6\u4e2d\u6ca1\u6709\u201c#1\u201d\u8282\u70b9\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002").replace("#1",w)),A(!1))},function(E,Z){E=E.toString();"20"==E.substr(0,2)&&7==E.length&&e.getMessageCurtain().showPrompt(Z);A(!1)});x=x.toJsonObject();H.getUsableEntities(x)};this.isLastStep=function(){return c?!0:!1};var y=function(x){return x.substring(0,x.lastIndexOf("."))};this.over=
function(x,A){if(x&&c&&f){x=f.getSource();var v=b.getSource();A=!b.getCheckBoxState();if(v.getFileType()==ib.TYPE_XML&&0<f.getAssociateName().indexOf("/")){var H=y(v.getFileName()),u=y(x.getFileName());H+=f.getAssociateName().replace(u,"");f.setAssociateName(H)}A?(A=f.getName(),x.isUserSql(A)&&f.setAssociateName(f.getAlias()),x.isStoredProcedure(A)&&x.supportStoredProcedure()&&(A=x.getStoredProcedure(A),f.setAssociateName(A.getAssociateName())),v.isTheSame(x)||(f.setSource(v),f.mergeSource(d.getSources())),
e.refreshDesigntimeDataObject(f,f.getSource(),h.getCtxApi())):(new Jc).updateSameSource(d,x,v,function(w){w.setSource(v);w.mergeSource(d.getSources());e.refreshDesigntimeDataObject(w,v)})}}}function sc(){Jb.call(this);var h=this,e=this.protectedMethod,b,f,c,d,g,k,a=!1,r,y,x;this.setChangeSourceType=function(w){a=w};this.setOldEntity=function(w){k=w};this.setDModel=function(w){y=w};this.getCloneSource=function(){return c};this.protectedCreateUi=function(){b||(c=h.getSource().clone(),a?A():v());return b};
var A=function(){b=$("<div>");var w=$("<div>"),n=$("<div>");f=new Va;f.setPlaceholder(p.get("RESTfulDataSetUrlPlaceholder","\u8bf7\u8f93\u5165URL\u5168\u8def\u5f84"));c.getUrl()&&f.setText(ha.decode(c.getUrl()));var E=f.getJqUi();m.layoutCtrl(E,0,30,570,23);E.appendTo(n);x=new l;c.getAuthModel()&&x.setModel(c.getAuthModel());E=x.initUi();m.layoutCtrl(E,-10,70,580,240);n.append(E);r=new La;r.setText(p.get("actOnTheSameDatabase","\u540c\u65f6\u4fee\u6539\u5f53\u524d\u4e3b\u9898\u4e2d\u5176\u4ed6\u540c\u6e90\u6570\u636e\u8868"));
r.setChecked(!1);E=r.getJqUi();E.css("z-index",1);m.layoutCtrl(E,15,360,250,23);E.appendTo(b);g=new yb;g.setBottomLineVisible(!1);g.addItem("RESTFUL_DATA_SET",150,n,p.get("RESTfulDataSet","RESTful\u6570\u636e\u96c6"));g.addItem("PROGRAM_DATA_SET",150,w,p.get("programDataSet","\u7a0b\u5e8f\u6570\u636e\u96c6"));w=g.getJqUi();m.layoutCtrlWithLRTB(w,15,15,null,10,0,null);b.append(w);g.setSelectedChangedListener(function(Z,C,ba){"RESTFUL_DATA_SET"==C?f.setPlaceholder(p.get("RESTfulDataSetUrlPlaceholder",
"\u8bf7\u8f93\u5165URL\u5168\u8def\u5f84")):f.setPlaceholder(p.get("programDataSetPlaceholder","\u8bf7\u8f93\u5165Java\u7c7b\u7684\u5168\u8def\u5f84"));f.getJqUi().appendTo(ba);c.setOpenAPIType(C)});c.getOpenAPIType()||c.setOpenAPIType("RESTFUL_DATA_SET");g.setSelected(c.getOpenAPIType())},v=function(){var w=$("<div>");w.addClass("openApi-left-side");d=new Fc;d.setText(p.get("RESTfulDataSet","RESTful\u6570\u636e\u96c6"));var n=d.getJqUi();d.setChecked(!0);var E=new Fc;E.setText(p.get("programDataSet",
"\u7a0b\u5e8f\u6570\u636e\u96c6"));var Z=E.getJqUi();n.appendTo(w);Z.appendTo(w);var C=$("<div>");C.addClass("openApi-right-side");var ba=0;if(h.getAppendComponentUi()){ba=50;var K=h.getAppendComponentUi();C.append(K)}var ca=new X("URL");K=ca.getJqUi();K.appendTo(C);f=new Va;f.setPlaceholder(p.get("RESTfulDataSetUrlPlaceholder","\u8bf7\u8f93\u5165ULR\u5168\u8def\u5f84"));var P=f.getJqUi();P.appendTo(C);x=new l;var fa=x.initUi();m.layoutCtrl(fa,30,60+ba,580,240);C.append(fa);var xb=new kd;xb.addElement(d);
xb.addElement(E);xb.addChangedListener(function(){d.isChecked()?(ca.setText("URL"),f.setPlaceholder(p.get("RESTfulDataSetUrlPlaceholder","\u8bf7\u8f93\u5165URL\u5168\u8def\u5f84")),c.setOpenAPIType("RESTFUL_DATA_SET"),fa.empty()&&(fa=x.initUi(),m.layoutCtrl(fa,30,60+ba,580,240),C.append(fa))):E.isChecked()&&(ca.setText(p.get("classPath","\u7c7b\u8def\u5f84")),f.setPlaceholder(p.get("programDataSetPlaceholder","\u8bf7\u8f93\u5165Java\u7c7b\u7684\u5168\u8def\u5f84")),c.setOpenAPIType("PROGRAM_DATA_SET"),
fa.empty());f.setText()});c.getOpenAPIType()?(c.setOpenAPIType(c.getOpenAPIType()),"RESTFUL_DATA_SET"!=c.getOpenAPIType()&&E.setChecked(!0)):c.setOpenAPIType("RESTFUL_DATA_SET");m.layoutCtrl(n,20,20,200,20);m.layoutCtrl(Z,20,60,200,20);m.layoutCtrl(K,40,12+ba,80,23);m.layoutCtrl(P,100,12+ba,510,23);b=$("<div>");w.appendTo(b);C.appendTo(b)};this.intoThisStep=function(w,n){};this.getFacadeCreator=function(){};this.getAppendComponentUi=function(w){};this.getNameInput=function(){};this.getConnectionModel=
function(){};this.getConnectionSuccessCallBack=function(){};this.outThisStep=function(w,n){if(w)n(null);else if(h.getNameInput()&&!$.trim(h.getNameInput().getText()))e.getMessageCurtain().showPrompt("\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a\u3002");else if($.trim(f.getText())){w=ha.encode($.trim(f.getText()));c.setUrl(w);w=x.getAbstractOpenAPIAuth();if(H()&&w){if(null!=w.protectedCheckParams()){e.getMessageCurtain().showPrompt(w.protectedCheckParams());return}w=w.protectedGetModelFromUI();c.setAuthModel(w.protectedToJsonObject())}else c.setAuthModel(null);
w=function(C){if(k&&a)u(Z,function(K){K&&n(null)});else if(h.getFacadeCreator()){C=h.getConnectionModel();var ba=$.trim(h.getNameInput().getText());C.setDBSource(c);C.setName(ba);h.getFacadeCreator()(function(K){n(null);var ca=h.getConnectionSuccessCallBack();ca&&ca(K)},function(K,ca){return"1300001"==K?(e.getMessageCurtain().showPrompt(p.get("duplicateName","\u540d\u79f0\u91cd\u590d\u3002")),!0):"1300002"==K?(e.getMessageCurtain().showPrompt("\u5df2\u5b58\u5728\u76f8\u540c\u8fde\u63a5\u7684\u6570\u636e\u5e93\u3002"),
!0):"1300003"==K?(e.getMessageCurtain().showPrompt(p.get("dbInfoNotFound","\u6570\u636e\u5e93\u8fde\u63a5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),!0):"1300004"==K?(e.getMessageCurtain().showPrompt(p.get("noDbManagePerm","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):!1}).saveDBConnection(C)}else n(h.createNextTableSteps())};var E=function(C,ba){C=C.toString();if("20"==C.substr(0,2)&&7==C.length){if("20612"==C.substr(0,5)||"20622"==C.substr(0,5))return!1;if(2061100==
C)return e.getMessageCurtain().showError(p.get("error2061100",": \u8bf7\u586b\u5199\u6b63\u786e\u7684url\uff0c\u5982\u679c\u662f\u6839\u8def\u5f84\uff0c\u5fc5\u987b\u4ee5.QData\u7ed3\u5c3e\u3002")),!0;if(2061103==C)return e.getMessageCurtain().showError(p.get("error2061103",": pageSize\u7684\u503c\u5fc5\u987b\u57282000\u81f320000\u4e4b\u95f4\u3002")),!0;if(2061104==C)return e.getMessageCurtain().showError(p.get("error2061104",": \u53c2\u6570\u5f02\u5e38,pageNo\uff0cselectedFields\u4e3a\u7cfb\u7edf\u53c2\u6570\u3002")),
!0;if(2062100==C)return e.getMessageCurtain().showError(p.get("error2062100",": \u6ca1\u6709\u5b9e\u73b0\u63a5\u53e3ITableDataProvider\u3002")),!0;if(2061301==C)return e.getMessageCurtain().showError(p.get("error2061301",": \u8bf7\u586b\u5199\u6b63\u786e\u7684\u8ba4\u8bc1\u4fe1\u606f\u3002")),!0;if(2061302==C)return e.getMessageCurtain().showPrompt(p.get("error2061302",": \u8bf7\u586b\u5199\u5b8c\u6574\u7684\u8ba4\u8bc1\u4fe1\u606f\u3002")),!0;if(2061303==C)return e.getMessageCurtain().showPrompt(p.get("error2061303",
": \u6458\u8981\u8ba4\u8bc1\u670d\u52a1\u5668\u8d28\u8be2\u5934\u53c2\u6570\u5f02\u5e38\u3002")),!0;e.getMessageCurtain().showError(ba);return!0}return!1},Z=c.toJsonObject();(h.getFacadeCreator()?h.getFacadeCreator()(w,E):h.getCtxApi().createFacade(w,E)).openAPIInitialCheck(Z)}else H()?e.getMessageCurtain().showPrompt(p.get("urlNotNull","URL\u4e0d\u80fd\u4e3a\u7a7a\u3002")):e.getMessageCurtain().showPrompt(p.get("classNameNotNull","Java\u7c7b\u7684\u5168\u8def\u5f84\u4e0d\u80fd\u4e3a\u7a7a\u3002"))};
var H=function(){return a?"RESTFUL_DATA_SET"==g.getSelected():d.isChecked()},u=function(w,n){var E=[],Z=k.getSource(),C=k.getName(),ba=k.getAssociateName();Z.isUserSql(C)&&(ba=k.getAlias());Z.isStoredProcedure(C)&&Z.supportStoredProcedure()&&(ba=Z.getStoredProcedure(C).getAssociateName());var K=function(ca){E.push(ca.getName());if(ca instanceof Na&&(ca=ca.getChildren()))for(var P=0;P<ca.length;P++)K(ca[P])};h.getCtxApi().createFacade(function(ca){var P=new Na;P.fromJsonObject(ca);ca=P.getChildren();
for(P=0;P<ca.length;P++)K(ca[P]);0<=E.indexOf(ba)?n(!0):(e.getMessageCurtain().showPrompt(p.get("noCorrespondingTable","\u6ca1\u6709\u5bf9\u5e94\u7684\u8868,\u8bf7\u91cd\u65b0\u586b\u5199URL\u3002")),n(!1))},function(ca,P){ca=ca.toString();return"20"==ca.substr(0,2)&&7==ca.length?(e.getMessageCurtain().showPrompt(P),!0):!1}).getUsableEntities(w)};this.over=function(w,n){if(k&&a&&w){var E=!r.isChecked();w=k.getSource();n=k;n.setSource(w);E?(E=k.getName(),w.isUserSql(E)&&k.setAssociateName(k.getAlias()),
w.isStoredProcedure(E)&&w.supportStoredProcedure()&&(E=w.getStoredProcedure(E),k.setAssociateName(E.getAssociateName())),c.setUrl(ha.encode($.trim(f.getText()))),w.isTheSame(c)||(n.setSource(c),n.mergeSource(w)),e.refreshDesigntimeDataObject(n,n.getSource())):(c.setUrl(ha.encode($.trim(f.getText()))),(new Jc).updateSameSource(y,w,c,function(Z){Z.setSource(c);Z.mergeSource(y.getSources());e.refreshDesigntimeDataObject(Z,c)},k))}};this.isLastStep=function(){return a?!0:!1};this.getSubTitle=function(){return p.get("OpenAPI",
"OpenAPI")};this.createNextTableSteps=function(){var w=h.getSource();h.getSource().isTheSame(c)||(w=c);var n=new L;n.setCtxApi(h.getCtxApi());n.setSource(w);var E=new Bc;E.setCtxApi(h.getCtxApi());E.setSource(w);return[n,E]};this.protectedIsTextFieldNotNull=function(){return $.trim(_oUrlTextArea.getText())}}function l(){function h(a,r){this.getTypeName=function(){return a};this.getTypeCode=function(){return r}}var e,b,f,c,d,g=[new h(p.get("noAuth","\u65e0"),null),new h("Basic",Zc.BASIC),new h("Bearer",
Zc.BEARER),new h("Digest",Zc.DIGEST),new h(p.get("cosmicAuth","\u82cd\u7a79\u8ba4\u8bc1"),Zc.COSMIC)];this.setAbstractOpenAPIAuth=function(a){c=a};this.getAbstractOpenAPIAuth=function(){return c};this.initUi=function(){e=$("<div>");var a=(new X(p.get("authType","\u8ba4\u8bc1\u65b9\u5f0f"))).getJqUi();a.attr("title",p.get("authType","\u8ba4\u8bc1\u65b9\u5f0f"));m.layoutCtrl(a,10,0,54,23);a.appendTo(e);a=$("<div>");var r=$("<span>");r.text(p.get("httpAuthHelpIconTips","\u63d0\u4f9b\u5e38\u89c1HTTP\u8eab\u4efd\u8ba4\u8bc1\uff0c\u53ef\u4ee5\u6307\u5b9a\u8ba4\u8bc1\u65b9\u5f0f\uff0c\u8fdb\u884c\u8eab\u4efd\u8ba4\u8bc1\u9274\u6743  "));
r.appendTo(a);r=jd.getRESTfulAuthUrl();r=$("<a onclick='javascript:window.open(\""+r+"\");' href='#'>");r.text(p.get("viewDetails","\u67e5\u770b\u5e2e\u52a9\u6587\u6863"));r.css("cursor","pointer");r.css("color","#5582f3");r.appendTo(a);r=new xa;r.setIconType(xa.ICON_TYPE_QUESTION);r.setTipsSize(200,70);r.setTipsHtml(a[0]);a=r.getJqUi();a.addClass("dm-notice-icon");m.layoutCtrl(a,64,4,16,16);a.appendTo(e);b=new Pb;b.setItemModels(g);b.setSelected(g[0]);b.setCustomPainter(function(y,x,A){x.text(A.getTypeName())});
b.addSelectedChangedListener(function(y,x,A){y=A.getTypeCode();null==y?(c=null,d&&d.hide()):(d&&d.empty(),c=f&&y==f.getAuthType()?zc.getImpl(y,f):zc.getImpl(y,null),d=c.getJqUi(),m.layoutCtrl(d,0,30,580,150),d.appendTo(e),d.show())});a=b.getJqUi();a.appendTo(e);m.layoutCtrl(a,110,0,170,23);k();e.addClass("sa-ctrl-common-foreground_enabled");return e};this.setModel=function(a){f=Zc.getImpl(a.authType);f.protectedFromJsonObject(a)};var k=function(){if(f){for(var a=1;a<g.length;a++)if(g[a].getTypeCode()===
f.getAuthType()){b.setSelected(g[a]);break}c=zc.getImpl(f.getAuthType(),f);d=c.getJqUi();m.layoutCtrl(d,0,30,580,150);d.appendTo(e)}}}function B(){function h(){var A=[],v,H,u;this.setItemModel=function(w){A=w};this.setSearchListener=function(w){};this.setListItemPainter=function(w){v=w};this.createJqPopup=function(w,n,E){H=$("<div>");H.addClass("dm-field-popup");H.appendTo(w);u=$("<div>");u.addClass("dm-field-popup-list-owner");u.css({top:"0px",bottom:"0px"});u.appendTo(H);u.on("click",function(Z){var C=
$(Z.currentTarget);Z=$(Z.target);if(Z=m.upwardSearchHasClass(Z,C,"dm-field-popup-list-item"))Z.addClass("dm-list-item_selected_enabled"),E(Z.data("model"))});for(w=0;w<A.length;w++)v(A[w],u,n);n=[];w=Math.max(20*Math.min(A.length,10),20);n[0]=-1;n[1]=w;return n}}var e,b,f,c,d=!1,g,k;this.setSchemas=function(A){e=A;g&&g.setItemModel(e)};this.setSelectedSchema=function(A){b=A;k&&k.setSelectedModel(b)};this.setFunSelectCallBack=function(A){f=A};this.setFunAfterOpenDropdown=function(A){c=A};this.setShowTips=
function(A){d=A};this.getJqUi=function(){return a()};var a=function(){g=new h;g.setItemModel(e);g.setListItemPainter(y);g.setSearchListener(r);k=new Ya;k.setSelectedModel(b);k.setDropdownCreator(function(A,v,H,u,w){c&&w(c);return g.createJqPopup(A,v,H)});k.setCustomPainter(function(A,v){A?(v.text(A.getName()),v.attr("title",A.getName()),b=A,f(A)):d&&v.text(p.get("selectSchemaTips","\u8bf7\u9009\u62e9\u4e00\u4e2a\u6a21\u5f0f"))});return k.getJqUi()},r=function(A,v,H,u,w){v=v.trim().toLowerCase();for(var n=
[],E,Z=0;Z<A.length;Z++){var C=A[Z];E=C.getName().trim().toLowerCase();var ba=C.getAlias().trim().toLowerCase();(E=-1<E.indexOf(v)||-1<ba.indexOf(v))&&n.push(C)}H.children().remove();if(0<n.length)for(A=0;A<n.length;A++)w(n[A],H,u);else u=new X,u.setText(p.get("nothingSearched","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c")),u.setEnabled(!1),u.setAlign(X.ALIGN_CENTER),u=u.getJqUi(),u.addClass("dm-field-popup-search-result"),u.appendTo(H)},y=function(A,v,H){var u=$("<div>");u.addClass("dm-field-popup-list-item");
u.css("padding-left","4px");u.data("model",A);var w=A?A.getAlias():"",n=$("<span>");n.addClass("dm-field-popup-list-item-text");n.text(w);var E=A?A.getName():"",Z=$("<span>");Z.addClass("dm-field-popup-list-item-field-name");Z.text("("+E+")");Z.css("display","inline-block");u.append(n);u.append(Z);u.attr("title",w+"("+E+")");v.append(u);H&&H.getName()===A.getName()&&x(v,u)},x=function(A,v){var H=null;0<A.height()?(clearTimeout(H),v.addClass("dm-list-item_selected_enabled"),A.prop("scrollTop",v.prop("offsetTop"))):
H=setTimeout(function(){x(A,v)},0)}}function I(){var h,e,b,f,c=[],d=0;this.setOffset=function(k){d=k};this.setTitle=function(k){b&&b.setText(k)};this.setSchemas=function(k){c=k};this.setSelectedSchema=function(k){f=k};this.getType=function(){return"currentSystem"};this.getSchema=function(){return f};this.isChecked=function(){return e.isChecked()};this.getErrorMessage=function(){return f?null:p.get("selectOneSchema","\u8bf7\u9009\u62e9\u4e00\u4e2a\u6a21\u5f0f\u3002")};this.getJqUi=function(){h||(h=
$("<div>"),g());return h};var g=function(){var k=d;b=new X(p.get("superQuery","\u8d85\u7ea7\u67e5\u8be2"));var a=b.getJqUi();m.layoutCtrl(a,0,k,120,23);h.append(a);k+=36;a=(new X(p.get("schemas","\u6a21\u5f0f"))).getJqUi();m.layoutCtrl(a,15,k,60,23);h.append(a);a=new B;a.setSchemas(c);a.setSelectedSchema(f);a.setFunSelectCallBack(function(r){f=r});a=a.getJqUi();m.layoutCtrl(a,75,k,200,23);h.append(a);k+=36;e=new La;e.setText(p.get("actOnTheSameDatabase","\u540c\u65f6\u4fee\u6539\u5f53\u524d\u4e3b\u9898\u4e2d\u5176\u4ed6\u540c\u6e90\u6570\u636e\u8868"));
e.setChecked(!0);a=e.getJqUi();m.layoutCtrl(a,15,k,250,23);a.css("z-index",1);h.append(a)}}function q(h,e,b){var f=this,c,d,g,k,a,r,y,x,A,v,H,u,w,n,E=100,Z={LOADING:0,FAIL:1,SUCCESS:2},C=Z.LOADING,ba={CSV:["csv"],TXT:["txt"],EXCEL:["xls","xlsx"],XML:["xml"]};this.setFunAddSuccessNum=function(D){u=D};this.setFunFinalPrompt=function(D){w=D};this.setFunCharacterSetComboBoxCallBack=function(D){n=D};this.getUploadState=function(){return C};this.setSource=function(D){v=D};this.getSource=function(){return v};
this.setFile=function(D){c=D};this.getFile=function(){return c};this.setSourceDealType=function(D){H=D};var K;this.setFileSize=function(D){K=D};this.setMaxFileSize=function(D){E=D};this.createUi=function(D,la){d=D;r=la;a=$("<div id='fileDetailProgress'>");a.hide();g=$("<div>");k=$("<div>");if(q.CHANGE_SAME_SOURCE_TYPE==H){a.addClass("dm-source-file-upload-detail");g.addClass("dm-source-file-upload-filename");ca(v.getFileName());k.addClass("dm-source-file-upload-filesize");P();var za=$("<div>");za.addClass("dm-source-file-upload-fileicon");
vb.background(za,"file_"+v.getFileType().toLowerCase());var F=$("<div id='download'>");F.on("click",function(){fa(v)});F.addClass("dm-source-file-download-operation");vb.background(F,"download_icon");F.attr("title",p.get("download","\u4e0b\u8f7d"));var ja=$("<progress id='progressBar' value='0' max='100'>");ja.addClass("dm-source-file-upload-progress");ja.hide();C=Z.SUCCESS}else q.CHANGE_SOURCE_TYPE==H?(a.addClass("dm-source-db-file-upload-detail-new"),g.addClass("dm-source-file-upload-filename_new"),
k.addClass("dm-source-file-upload-filesize_new"),x=$("<div>"),x.addClass("dm-source-file-upload-state"),ca(v.getFileName()),W()):(a.addClass("dm-source-db-file-upload-detail-new"),g.addClass("dm-source-file-upload-filename_new"),k.addClass("dm-source-file-upload-filesize_new"),x=$("<div>"),x.addClass("dm-source-file-upload-state"),vb.background(x,"upload_running"),A=$("<div>"),A.addClass("dm-source-file-upload-operation"));za&&a.append(za);a.append(g);a.append(k);F&&a.append(F);ja&&a.append(ja);x&&
a.prepend(x);A&&a.append(A);r.append(a)};this.showFileDetailProgressBar=function(){a&&a.show()};this.hideFileDetailProgressBar=function(){a&&a.hide()};var ca=function(D){g.text(D);g.attr("title",D)},P=function(){var D;1048576>K?D=(K/1024).toFixed(2)+"KB":1048576<=K&&(D=(K/1048576).toFixed(2)+"M");k.text("("+D+")");k.attr("title",D)},fa=function(D){h.createFacade(function(la){var za="";"EXCEL"===D.getFileType()?za=".xlsx":"CSV"===D.getFileType()?za=".csv":"XML"===D.getFileType()?za=".xml":"TXT"===
D.getFileType()&&(za=".txt");h.createFacade().getDownloadFileData(la,za)},function(la,za){return!1}).downloadFile(D.getFileUrl())};this.changeFile=function(D){c=D;f.uploadAcceptFile()};this.uploadAcceptFile=function(){ca(c.name);K=c.size;P();if(0!=c.size)if(c.size>1048576*E)xb(p.get("fileTooLarge","\u6587\u4ef6\u5927\u5c0f\u8d85\u8fc7\u6700\u5927\u9650\u5236\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u6587\u4ef6\u3002"));else{var D=c.name,la=v.getFileType(),za=!0,F=D.lastIndexOf(".");D=D.substring(F+1,D.length).toLowerCase();
0>ba[la].indexOf(D)&&(za=!1);za?Qb():xb(p.get("fileTypeIncorrect","\u6587\u4ef6\u7c7b\u578b\u4e0d\u6b63\u786e\u3002"))}else xb(p.get("uploadFileIsNull","\u4e0a\u4f20\u7684\u6587\u4ef6\u4e3a\u7a7a\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002"))};var xb=function(D){q.CREATE_NEW_SOURCE_TYPE==H?Fa(D,!1):e.showPrompt(D)},tb=function(D){q.CREATE_NEW_SOURCE_TYPE==H?Fa(D,!0):e.showError(D)},Qb=function(){var D=new FormData;D.append("filename",c);y=new XMLHttpRequest;y.upload.addEventListener("progress",z,!1);
h.createFacade().uploadFile(y);y.onload=function(la){if(200==this.status){la=this.response;var za=null;try{za=JSON.parse(la)}catch(F){tb(p.get("uploadFail","\u4e0a\u4f20\u5931\u8d25"));return}if(za&&za.data){U(c,za.data);return}if(za&&"4001002"==za.errorCode){tb(p.get("uploadFileNoAccess","\u65e0\u4e0a\u4f20\u6587\u4ef6\u6743\u9650"));return}if(za&&3099003==za.errorCode){tb(za.errorMessage);return}if(za&&za.errorMessage){tb(za.errorMessage);return}}tb(p.get("networkError","\u7f51\u7edc\u8fde\u63a5\u5f02\u5e38\u3002"))};
y.send(D)},U=function(D,la){var za=h.createFacade(function(F){F&&(v.setCharacterSet(F),n&&n(F));F=D.name;v.setName("s"+(new Date).getTime()+Math.floor(1E4*Math.random())+1);v.setFileUrl(la);v.setFileName(F);d.find(".dm-source-file-upload-setting").show();v.getFileType()==ib.TYPE_XML?Ca(v):W()},function(F,ja){Fa(null,!0);F=F.toString();return"20"==F.substr(0,2)&&7==F.length?(a.attr("title",p.get("uploadFail","\u4e0a\u4f20\u5931\u8d25")),!0):!1});za.setShowBlocking(!1);za.guessFileEncoding(la)},Ca=
function(D){D.setDefineTypeRowCount(-1);var la=h.createFacade(function(za){W();return!0},function(za,F){za=za.toString();return"20"==za.substr(0,2)&&7==za.length?(Fa(F,!0),!0):!1});D=D.toJsonObject();la.setShowBlocking(!1);la.getUsableEntities(D)},z=function(D){if(q.CHANGE_SAME_SOURCE_TYPE==H){var la=d.find("#progressBar");la.show();la=d.find("#progressBar").get(0);D.lengthComputable&&(la.max=D.total,la.value=D.loaded)}else q.CHANGE_SOURCE_TYPE!=H&&(d.find(".dm-source-file-upload-area").find("#uploadAreaText"),
vb.background(A,"upload_pause"),N(A,"pause"),D.lengthComputable&&(1048576<=D.total?(la=(D.loaded/1048576).toFixed(2)+"M",D=(D.total/1048576).toFixed(2)+"M"):(la=(D.loaded/1024).toFixed(2)+"KB",D=(D.total/1024).toFixed(2)+"KB"),k.text("("+la+" of "+D+")"),la==D&&k.text("("+D+")")))},N=function(D,la){D.off();if("delete"==la)D.on("mousedown",t);else if("uploadAgain"==la)D.on("mousedown",uploadAgain);else if("pause"==la)D.on("mousedown",O)},t=function(){a.hide();var D=b.indexOf(f);if(1==b.length&&(d.find(".dm-source-file-upload-setting").hide(),
d.find(".dm-source-file-detail-progress").hide(),d.find(".dm-source-file-upload-area").find("#uploadAreaText").show(),d.find("#fileToUpload").val(""),1<=window.navigator.userAgent.indexOf("MSIE"))){var la=d.find("#fileToUpload"),za=document.createElement("form"),F=la.nextSibling,ja=la.parentNode;za.appendChild(la);za.reset();ja.insertBefore(la,F)}b.splice(D,1)},O=function(){y.abort();C=Z.FAIL;var D=p.get("upladCanceled","\u6682\u505c\u4e0a\u4f20\u6587\u4ef6\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002");
a.attr("title",D);a.on("mouseenter",Wa);a.on("mouseleave",ua);vb.background(A,"btn_delete");A.css("display","none");N(A,"delete");w&&w(D)},W=function(){C=Z.SUCCESS;u&&u();q.CHANGE_SAME_SOURCE_TYPE==H?(d.find("#progressBar").hide(),e.showSuccess(p.get("uploadSuccess","\u4e0a\u4f20\u6210\u529f\u3002"))):q.CHANGE_SOURCE_TYPE==H?(vb.background(x,"upload_success"),a.on("mouseenter",Wa),a.on("mouseleave",ua)):(vb.background(x,"upload_success"),a.on("mouseenter",Wa),a.on("mouseleave",ua),vb.background(A,
"btn_delete"),A.css("display","none"),N(A,"delete"));w&&w()},Fa=function(D,la){C=Z.FAIL;q.CHANGE_SAME_SOURCE_TYPE==H?(d.find("#progressBar").hide(),D&&e.showError(D)):q.CHANGE_SOURCE_TYPE==H?(D&&a.attr("title",D),vb.background(x,"upload_error"),a.on("mouseenter",Wa),a.on("mouseleave",ua)):(D&&a.attr("title",D),vb.background(x,"upload_error"),a.on("mouseenter",Wa),a.on("mouseleave",ua),vb.background(A,"btn_delete"),A.css("display","none"),N(A,"delete"),D&&e.showError(p.get("uploadFail","\u4e0a\u4f20\u5931\u8d25")+
D))},Wa=function(D){$(D.currentTarget).find(".dm-source-file-upload-operation").css("display","inline-block")},ua=function(D){$(D.currentTarget).find(".dm-source-file-upload-operation").css("display","none")}}function G(){function h(F,ja){this.toString=function(){return ja};this.getName=function(){return F}}var e=this,b,f,c,d=1,g=0,k,a,r,y,x,A,v,H;p.get("uploadFile","\u4e0a\u4f20\u6587\u4ef6");var u=!1,w=[],n,E,Z,C,ba=!1,K=!1,ca={CSV:["csv"],TXT:["txt"],EXCEL:["xls","xlsx"],XML:["xml"]},P={XML:"text/xml",
CSV:".csv",TXT:"text/plain",EXCEL:"application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},fa=["CSV","TXT"],xb=["CSV","TXT"],tb=[new h(",",p.get("comma","\u9017\u53f7")),new h(";",p.get("semicolon","\u5206\u53f7")),new h(" ",p.get("space","\u7a7a\u683c")),new h("\t",p.get("tabs","\u5236\u8868\u7b26")),new h("\u81ea\u5b9a\u4e49",p.get("custom","\u81ea\u5b9a\u4e49"))],Qb=[new h("UTF-8","UTF-8"),new h("UTF-16BE","UTF-16BE"),new h("UTF-16LE","UTF-16LE"),new h("GB2312",
"GB2312"),new h("GB18030","GB18030"),new h("GBK","GBK")],U=[new h('"',p.get("doubleQuotationMark","\u53cc\u5f15\u53f7")),new h("'",p.get("singleQuotationMark","\u5355\u5f15\u53f7"))],Ca=[new h("50",p.get("checkFirstFiftyLines","\u4ec5\u68c0\u6d4b\u524d50\u884c")),new h("100",p.get("checkFirstOneHundredLines","\u4ec5\u68c0\u6d4b\u524d100\u884c")),new h("-1",p.get("checkWholeFile","\u68c0\u6d4b\u6574\u4e2a\u6587\u4ef6"))],z=!1;this.getFileDetailProgress=function(){return w};this.setChangeSourceType=
function(F){z=F};this.isChangeSourceType=function(){return z};this.isUsedForMerge=function(){return K};this.setIsUsedForMerge=function(F){K=F};this.protectedDefaultActOnOtherSource=function(){return!1};this.setCtxApi=function(F){b=F};this.getCtxApi=function(){return b};this.getJqUi=function(){f||(f=$("<div>"),a&&a.getFileName()?D(function(){e.protectedInitUi(f)}):e.protectedInitUi(f));return f};this.protectedInitUi=function(){var F=a.getFileType(),ja=$("<div style='text-align:center'>");var Pa=z||
a&&a.getFileName()||K?$("<input type='file' id='fileToUpload' style='width:0;height:0;position:absolute;left:-100px'>"):$("<input type='file' id='fileToUpload' style='width:0;height:0;position:absolute;left:-100px' multiple>");Pa.attr("accept",P[F]);var hb=$("<div type='button'>");hb.on("click",function(){Pa.click()});hb.addClass("dm-source-file-upload-btn");var Yb=$("<div>");Yb.css("text-align","center");var ec=$("<div>");ec.addClass("dm-source-file-upload-btn-text");ec.text(p.get("uploadFile","\u4e0a\u4f20\u6587\u4ef6"));
var Vc=$("<div>");Vc.addClass("dm-source-file-upload-btn-icon");vb.background(Vc,"upload_icon_selected");var fd=$("<span>");fd.addClass("dm-source-file-upload-prompt");fd.text(p.get("acceptFile","\u652f\u6301#1\u6587\u4ef6\uff0c\u4e14\u6587\u4ef6\u4e0d\u5927\u4e8e#2M").replace("#1",ca[F]).replace("#2",d));var Mc=$("<div>");Mc.addClass("dm-source-file-upload-setting");c=$("<div>");c.addClass("dm-source-file-detail-progress-pane");if(0<=fa.indexOf(F)){var lc=new X(p.get("splitSign","\u5206\u9694\u7b26"));
r=new Pb;r.setItemModels(tb);r.setSelected(tb[0]);y=new Va;var $c=new X(p.get("characterSet","\u7f16\u7801"));x=new Pb;x.setItemModels(Qb);x.setSelected(Qb[0]);var dd=new X(p.get("textLimitSign","\u6587\u672c\u9650\u5b9a\u7b26"));A=new Pb;A.setItemModels(U);A.setSelected(U[0]);var id=new X(p.get("defineTypeRowCount","\u6570\u636e\u7c7b\u578b\u68c0\u6d4b"));v=new Pb;v.setItemModels(Ca);v.setSelected(Ca[0]);var hd=lc.getJqUi();m.layoutCtrl(hd,20,15,70,23);var ud=r.getJqUi();m.layoutCtrl(ud,105,15,120,
23);lc=y.getJqUi();m.layoutCtrl(lc,230,15,120,23);$c=$c.getJqUi();m.layoutCtrl($c,20,50,70,23);var td=x.getJqUi();m.layoutCtrl(td,105,50,120,23);dd=dd.getJqUi();m.layoutCtrl(dd,20,85,70,23);var qd=A.getJqUi();m.layoutCtrl(qd,105,85,120,23);id=id.getJqUi();m.layoutCtrl(id,20,120,72,23);var rd=v.getJqUi();m.layoutCtrl(rd,105,120,120,23);Mc.append(hd);Mc.append(ud);Mc.append(lc);Mc.append($c);Mc.append(td);Mc.append(dd);Mc.append(qd);Mc.append(id);Mc.append(rd);r.addSelectedChangedListener(N);lc.hide()}else id=
new X(p.get("defineTypeRowCount","\u6570\u636e\u7c7b\u578b\u68c0\u6d4b")),v=new Pb,v.setItemModels(Ca),v.setSelected(Ca[0]),id=id.getJqUi(),m.layoutCtrl(id,20,20,72,23),rd=v.getJqUi(),m.layoutCtrl(rd,105,20,120,23),Mc.append(id),Mc.append(rd);Mc.hide();z?(a&&a.getFileName()&&(0<=fa.indexOf(F)&&a.getSplitSign()&&(hd=a.getSplitSign(),ud=la(hd,tb),0>tb.indexOf(ud)?(r.setSelected(tb[tb.length-1]),y.setText(hd),lc.show()):r.setSelected(la(a.getSplitSign(),tb)),x.setSelected(la(a.getCharacterSet(),Qb)),
A.setSelected(la(a.getTextLimitSign(),U))),v.setSelected(la(a.getDefineTypeRowCount(),Ca)),Mc.show(),u=!0),0<=xb.indexOf(F)||(H=new La,H.setText(p.get("actOnTheSameDatabase","\u540c\u65f6\u4fee\u6539\u5f53\u524d\u4e3b\u9898\u4e2d\u5176\u4ed6\u540c\u6e90\u6570\u636e\u8868")),H.setChecked(e.protectedDefaultActOnOtherSource()),lc=H.getJqUi(),m.layoutCtrl(lc,0,400,250,23),lc.css("z-index",1),f.append(lc))):a&&a.getFileName()&&(hd=new q(b,k,w),hd.setSource(a),hd.setSourceDealType(q.CHANGE_SAME_SOURCE_TYPE),
hd.setFileSize(g),hd.setMaxFileSize(d),hd.setFunCharacterSetComboBoxCallBack(e.funCharacterSetComboBoxCallBack),c.css("overflow-y","visible"),hd.createUi(f,c),hd.showFileDetailProgressBar(),w.push(hd),Mc.removeClass("dm-source-file-upload-setting"),Mc.addClass("dm-source-file-upload-setting-reload"),0<=fa.indexOf(F)&&a.getSplitSign()?(hd=a.getSplitSign(),ud=la(hd,tb),0>tb.indexOf(ud)?(r.setSelected(tb[tb.length-1]),y.setText(hd),lc.show()):r.setSelected(la(a.getSplitSign(),tb)),x.setSelected(la(a.getCharacterSet(),
Qb)),A.setSelected(la(a.getTextLimitSign(),U)),v.setSelected(la(a.getDefineTypeRowCount(),Ca)),Mc.show()):(v.setSelected(la(a.getDefineTypeRowCount(),Ca)),Mc.show(),H=new La,H.setText(p.get("actOnTheSameDatabase","\u540c\u65f6\u4fee\u6539\u5f53\u524d\u4e3b\u9898\u4e2d\u5176\u4ed6\u540c\u6e90\u6570\u636e\u8868")),H.setChecked(e.protectedDefaultActOnOtherSource()),lc=H.getJqUi(),m.layoutCtrl(lc,20,175,250,23),lc.css("z-index",1),f.append(lc)));"placeholder"in $("<input>")[0]?(Pa.change(function(sd){t()}),
Yb.append(Vc),Yb.append(ec),hb.append(Yb),ja.append(Pa),ja.append(hb),f.append(ja)):(ja=$("<form id='uploadForm' method='post' enctype='multipart/form-data' target='targetIframeC'>"),Pa=$("<input name='filename' type='file' id='fileToUpload' style='width:0;height:0;position:absolute;left:-100px' onchange='submit()' multiple/>"),lc=$("<iframe name='targetIframeC' id='targetIframeC' style='height: 0;width: 0'>"),ja.attr("action","/qing/uploadFileForIE9.do?type="+ca[F]),Yb.append(Vc),Yb.append(ec),hb.append(Yb),
ja.append(Pa),f.append(ja),f.append(lc),f.append(hb),lc.on("load",function(sd){try{var Da=$(window.self.frames.targetIframeC.document).find("body");if(Da.html()){var gb=JSON.parse(Da.html().toString()),Ib=gb.fileName,Vb=gb.fileSize;sd={};sd.name=Ib;var fc=gb.errorCode;if("IE9001"==fc)k.showPrompt(p.get("fileTypeIncorrect","\u6587\u4ef6\u7c7b\u578b\u4e0d\u6b63\u786e\u3002"));else if("IE9002"==fc)k.showPrompt(p.get("fileTooLarge","\u6587\u4ef6\u5927\u5c0f\u8d85\u8fc7\u6700\u5927\u9650\u5236\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u6587\u4ef6\u3002"));
else if("IE9003"==fc)k.showPrompt(p.get("uploadFileIsNull","\u4e0a\u4f20\u7684\u6587\u4ef6\u4e3a\u7a7a\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002"));else{var pc=f.find(".dm-source-file-upload-filename_new"),Nc=f.find(".dm-source-file-upload-filesize_new"),Lc=(Vb/1048576).toFixed(2)+"M";pc.text(Ib);Nc.text("("+Lc+")");pc.attr("title",Ib);Nc.attr("title",Lc);var Xc=f.find(".dm-source-file-upload-fileicon");pc=f.find(".dm-source-file-upload-filename");Nc=f.find(".dm-source-file-upload-filesize");1048576>
Vb?Lc=(Vb/1024).toFixed(2)+"KB":1048576<=Vb&&(Lc=(Vb/1048576).toFixed(2)+"M");vb.background(Xc,"file_"+F.toLowerCase());pc.text(Ib);Nc.text("("+Lc+")");pc.attr("title",Ib);Nc.attr("title",Lc);jqFileDetailProgressDiv.show();za().find("#uploadAreaText").hide();console&&console.log(gb);guessFileEncoding(sd,gb.data)}}}catch(ed){console&&console.log(ed),k.showError(p.get("uploadFail","\u4e0a\u4f20\u5931\u8d25\u3002"))}}));f.append(fd);e.initExtraUi(f,c,Mc,Pa)};this.initExtraUi=function(){throw Error("Override me.");
};this.setText=function(F){};this.setSource=function(F){a=F};this.getSource=function(){0<=fa.indexOf(a.getFileType())&&(r.getSelected()==tb[tb.length-1]?a.setSplitSign($.trim(y.getText())):a.setSplitSign(r.getSelected().getName()),a.setCharacterSet(x.getSelected().getName()),a.setTextLimitSign(A.getSelected().getName()));a.setDefineTypeRowCount(v.getSelected().getName());if(z||K){var F=w[0].getSource();a.setName(F.getName());a.setFileName(F.getFileName());a.setFileUrl(F.getFileUrl());0>fa.indexOf(a.getFileType())&&
a.setCharacterSet(F.getCharacterSet())}return a};this.getArrSource=function(){n=[];for(var F=0;F<w.length;F++)if(2==w[F].getUploadState()){var ja=e.getSource().clone(),Pa=w[F].getSource();ja.setName(Pa.getName());ja.setFileName(Pa.getFileName());ja.setFileUrl(Pa.getFileUrl());null!=Pa.getCharacterSet()&&null==ja.getCharacterSet()&&ja.setCharacterSet(Pa.getCharacterSet());n.push(ja)}return n};this.getOnlySource=function(){return a};this.setFileSize=function(F){d=F};this.getFileSize=function(){return d};
this.setMessageCurtain=function(F){k=F};this.getMessageCurtain=function(){return k};this.isUploading=function(){for(var F=!1,ja=0;ja<w.length;ja++)if(0==w[ja].getUploadState()){F=!0;break}return F};this.hasUploadFile=function(){u=!1;for(var F=0;F<w.length;F++)if(2==w[F].getUploadState()){u=!0;break}return u};this.getCheckBoxState=function(){return H&&H.isChecked()};var N=function(){r.getSelected()==tb[tb.length-1]?y.getJqUi().show():y.getJqUi().hide()},t=function(F){F=f.find("#fileToUpload");if(null!=
F&&null!=F.get(0)&&null!=F.get(0).files)var ja=F.get(0).files;""!=F.val()&&O(ja);F.val("")},O=function(F){if((a&&a.getFileName()||z||K)&&0<w.length)F=F[0],ua(F.name)?k.showError(p.get("fileTypeIncorrect","\u6587\u4ef6\u7c7b\u578b\u4e0d\u6b63\u786e\u3002")):W(F)||w[0].changeFile(F);else a:if(e.isUploading())k.showPrompt(p.get("theFileIsUploading","\u6587\u4ef6\u6b63\u5728\u4e0a\u4f20\u4e2d\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\u3002"));else{for(var ja=F.length,Pa=0,hb=0;hb<w.length;hb++)2==w[hb].getUploadState()&&
Pa++;if(10<Pa+ja)k.showPrompt(p.get("fileNumberExceeds","\u6700\u591a\u4e0a\u4f20#1\u4e2a\u6587\u4ef6\u3002").replace("#1",10));else{C=Z=E=0;ba=!1;if(1==F.length&&(ba=!0,W(F[0])))break a;ja=za().find("#uploadAreaText");ja.hide();c.show();for(Pa=0;Pa<F.length;Pa++){hb=F[Pa].name;var Yb=!1;if(0!==w.length)for(var ec=0;ec<w.length;ec++)if(w[ec].getFile().name===hb){Yb=!0;break}hb=Yb;hb?Z+=1:ua(F[Pa].name)?E+=1:(hb=new q(b,k,w),hb.setSource(e.getOnlySource().clone()),hb.setSourceDealType(q.CREATE_NEW_SOURCE_TYPE),
hb.createUi(f,c),hb.setFile(F[Pa]),hb.setMaxFileSize(d),hb.setFunFinalPrompt(Fa),hb.setFunAddSuccessNum(Wa),hb.setFunCharacterSetComboBoxCallBack(e.funCharacterSetComboBoxCallBack),hb.showFileDetailProgressBar(),w.push(hb),hb.uploadAcceptFile())}0==w.length&&ja.show();Fa()}}},W=function(F){var ja=!1;F.size>1048576*d&&(k.showPrompt(p.get("fileTooLarge","\u6587\u4ef6\u5927\u5c0f\u8d85\u8fc7\u6700\u5927\u9650\u5236\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u6587\u4ef6\u3002")),ja=!0);return ja},Fa=function(F){if(!e.isUploading()&&
!F){ba?F=0<Z?p.get("duplicateFileExists","\u5b58\u5728\u91cd\u540d\u6587\u4ef6\uff0c"):0<E?p.get("fileTypeIncorrectError","\u6587\u4ef6\u7c7b\u578b\u9519\u8bef\uff0c"):p.get("uploadSuccess","\u4e0a\u4f20\u6210\u529f"):(F=p.get("uploadSuccessFileNum","\u6210\u529f\u4e0a\u4f20#1\u4e2a\u6587\u4ef6\u3002").replace("#1",C),0<Z&&(F+=p.get("duplicateFileExistsNum","#1\u4e2a\u6587\u4ef6\u5b58\u5728\u91cd\u540d\u6587\u4ef6\uff0c").replace("#1",Z)),0<E&&(F+=p.get("fileTypeIncorrectNum","#1\u4e2a\u6587\u4ef6\u7c7b\u578b\u9519\u8bef\uff0c").replace("#1",
E)));if(0<Z||0<E)F+=p.get("uploadFail","\u4e0a\u4f20\u5931\u8d25\u3002");e.isUploading()||null==F||(0<Z||0<E?k.showPrompt(F):k.showSuccess(F))}},Wa=function(){C++};this.funCharacterSetComboBoxCallBack=function(F){x&&x.setSelected(la(F,Qb))};var ua=function(F){var ja=F.lastIndexOf(".");F=F.substring(ja+1,F.length).toLowerCase();return 0>ca[e.getOnlySource().getFileType()].indexOf(F)?!0:!1},D=function(F){var ja=b.createFacade(function(hb){g=hb;F()},function(hb,Yb){return!1}),Pa=a.getFileUrl();ja.getFileSize(Pa)},
la=function(F,ja){for(var Pa in ja)if(ja[Pa].getName()==F)return ja[Pa]},za=function(){return f.find(".dm-source-file-upload-area")};this.protectedMethod={doSelectFile:t,supportActOnSameSource:function(F){return!(0<=xb.indexOf(F))},doUpladFiles:O}}function R(){G.call(this);var h=this,e=this.protectedMethod,b,f;this.initExtraUi=function(r,y,x,A){b=r;f=y;f.css("height","160px");f.css("top","10px");y=$("<div>");y.addClass("dm-source-file-upload-area");var v=$("<div id='uploadAreaText'>");v.addClass("dm-source-file-upload-areatext");
v.css("z-index","9999");y.append(A);y.append(f);y.append(x);y.append(v);y.on("dragenter",d);y.on("dragenter",g);y.on("dragover",d);y.on("dragleave",d);y.on("dragleave",k);y.on("drop",a);if(h.isChangeSourceType()&&(x=h.getOnlySource())&&(e.supportActOnSameSource(x.getTypeName())&&y.css("height",340),x.getFileName())){v.hide();var H=new q(h.getCtxApi(),h.getMessageCurtain(),h.getFileDetailProgress());H.setSource(x);H.setSourceDealType(q.CHANGE_SOURCE_TYPE);H.setMaxFileSize(h.getFileSize());H.setFunCharacterSetComboBoxCallBack(h.funCharacterSetComboBoxCallBack);
H.createUi(b,f);H.showFileDetailProgressBar();h.getFileDetailProgress().push(H)}"placeholder"in $("<input>")[0]?(v.on("click",function(){b.find("#fileToUpload").click()}),v.change(function(u){doSelectFile()}),v.text(p.get("clickOrDrag","\u70b9\u51fb\u6216\u5c06\u6587\u4ef6\u62d6\u62fd\u5230\u8fd9\u91cc\u4e0a\u4f20"))):(v.text(p.get("clickForUploadFile","\u70b9\u51fb\u8fd9\u91cc\u4e0a\u4f20\u6587\u4ef6")),x=r.find("#uploadForm"),x.append(A),y.append(x),v.on("click",function(){A.click()}));r.append(y)};
this.changeStyleWhenDragEnter=function(){c().removeClass("dm-source-file-upload-area_enter")};var c=function(){return b.find(".dm-source-file-upload-area")},d=function(r){r.originalEvent.stopPropagation();r.originalEvent.preventDefault()},g=function(r){c().addClass("dm-source-file-upload-area_enter")},k=function(r){c().removeClass("dm-source-file-upload-area_enter")},a=function(r){d(r);c().removeClass("dm-source-file-upload-area_enter");r=r.originalEvent.dataTransfer.files;if(h.isChangeSourceType()||
h.isUsedForMerge()){var y=r[0];r=[];r.push(y)}e.doUpladFiles(r)}}function J(){G.call(this);this.protectedDefaultActOnOtherSource=function(){return!0};this.initExtraUi=function(h,e,b,f){h.append(e);h.append(b)}}function M(){function h(U){KTDefaultCellRender.call(this,U);var Ca=this,z=this.paintCellUI;this.paintCellUI=function(N,t){if(Ca.getCurrentRowIdx()<zb.getHeadRowCount())z(N,t);else if(4==Ca.getCurrentColIdx())t=Ca.getCurrentRow().getUserObject(),t.getIoType()==Gb.PROCEDUREIOTYPE_IN||t.getIoType()==
Gb.PROCEDUREIOTYPE_INOUT?(t=Ca.getCell().getValue(),P(N,Ca.getCellWidth(),Ca.getCellHeight(),t,Ca.getCurrentRow())):t.getIoType()==Gb.PROCEDUREIOTYPE_OUT&&(N=$(N),N.empty(),t=$("<div>"),t.text(p.get("outParameterNotNeedSet","\u8f93\u51fa\u53c2\u6570\u65e0\u9700\u8bbe\u7f6e")),t.addClass("dm-source-db-tablecell-unable-edit"),t.appendTo(N));else if(0==Ca.getCurrentColIdx()){if(t=Ca.getCell().getValue(),N=$(N),N.find(".dm-entity-filtertable-prompt").remove(),t){var O=Ab.createWarning();O.addClass("dm-entity-filtertable-prompt");
O.attr("title",t);O.appendTo(N)}}else z(N,t)}}var e,b,f,c,d,g,k,a,r,y;this.getJqUi=function(){if(!e){e=$("<div>");e.addClass("dm-source-db-storedprocedure-panel");var U=new xa;U.setIconType(xa.ICON_TYPE_QUESTION);U.setTipsSize(400,140);U.setTipsHtml(p.get("tipsHtml","\u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c\u8bf4\u660e\uff1a<br/>1\u3001\u754c\u9762\u4e2d\u8bbe\u7f6e\u7684\u5b58\u50a8\u8fc7\u7a0b\u7684\u8f93\u5165\u8f93\u51fa\u53c2\u6570\uff0c\u987a\u5e8f\u5fc5\u987b\u548c\u5b58\u50a8\u8fc7\u7a0b\u5b9a\u4e49\u7684\u53c2\u6570\u987a\u5e8f\u4e00\u81f4\uff1b<br/>2\u3001\u5982\u679c\u8f93\u5165\u53c2\u6570\u6ca1\u6709\u9ed8\u8ba4\u503c\uff0c\u5219\u9700\u8981\u8bbe\u7f6e\u53c2\u6570\u503c\uff0c\u5426\u5219\u53ef\u80fd\u51fa\u73b0\u6267\u884c\u51fa\u9519\uff1b<br/>3\u3001\u5982\u679c\u8f93\u51fa\u53c2\u6570\u4e0d\u662f\u7ed3\u679c\u96c6\uff0c\u5219\u63d0\u793a\u627e\u4e0d\u5230\u5bf9\u5e94\u7684\u7ed3\u679c\u96c6\uff1b<br/>4\u3001\u53ea\u80fd\u9009\u62e9\u4e00\u4e2a\u7ed3\u679c\u96c6\u4f5c\u4e3a\u8f93\u51fa\u5b57\u6bb5\u3002"));
U=U.getJqUi();U.addClass("dm-source-db-storedprocedure-panel-helptips");U.appendTo(e);U=(new X(p.get("storedProceParameter","\u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570"))).getJqUi();U.addClass("dm-source-db-storedprocedure-panel-label");U.appendTo(e);f=zb.createTable();zb.bindTextEditor(f,K,ca);zb.bindTableListenerForCtrl(f);f.setSyncUIWhenModelChanged(!0);U=$(f.getUI());U.css("width","100%");U.children().css("overflow-x","hidden");m.layoutCtrl(U,0,23,495,110);U.appendTo(e);U=[];for(var Ca=g.getParameters(),
z=0;z<Ca.length;z++){var N=Ca[z];N.getDataType()==Ra.DATA_CURSOR&&U.push(N.getName())}0<U.length?(Ca=(new X(p.get("cursorResult","\u6e38\u6807\u7ed3\u679c\u96c6\u5b57\u6bb5\uff1a"))).getJqUi(),z=g.getCursorFieldName()?g.getCursorFieldName():U[0],g&&g.setCursorFieldName(z),N=new Pb,N.setSelected(z),N.setItemModels(U),N.addSelectedChangedListener(v),U=N.getJqUi(),m.layoutCtrl(Ca,0,140,100,23),m.layoutCtrl(U,100,140,150,23),Ca.appendTo(e),U.appendTo(e)):(Ca=g.getOutResultIdx()?g.getOutResultIdx():1,
U=$("<div>"),U.text(p.get("outSetResultBefore","\u4f7f\u7528\u7b2c")),U.addClass("dm-source-db-storedprocedure-panel-outsetresultbeforelabel"),d=new Aa,d.setConstraint(1,1024,1),d.setValue(Ca),d.addValueChangedListener(A),g&&g.setOutResultIdx(Ca),Ca=d.getJqUi(),Ca.addClass("dm-source-db-storedprocedure-panel-spinner"),z=$("<div>"),z.text(p.get("outSetResultAfter","\u4e2a\u7ed3\u679c\u96c6")),z.addClass("dm-source-db-storedprocedure-panel-outsetresultafterlabel"),U.appendTo(e),Ca.appendTo(e),z.appendTo(e));
U=new ub;U.setText(p.get("previewResultSet","\u9884\u89c8\u7ed3\u679c\u96c6"));U.addActionListener(x);U=U.getJqUi();b=zb.createTable();Ca=$(b.getUI());Ca.css("width","100%");Ca.css("overflow","auto");m.layoutCtrlWithLRTB(U,null,0,120,140,null,23);m.layoutCtrl(Ca,0,169,510,255);U.appendTo(e);Ca.appendTo(e)}zb.clear(f);f.addColumns(5);f.getColumn(0).setWidth(20);f.getColumn(1).setWidth(110);f.getColumn(2).setWidth(110);f.getColumn(3).setWidth(60);f.getColumn(4).setWidth(120);U=zb.createHeadRow(f);U.getCell(1).setValue(p.get("parameterName",
"\u53c2\u6570\u540d\u79f0"));U.getCell(2).setValue(p.get("direction","\u4f20\u8f93\u65b9\u5411"));U.getCell(3).setValue(p.get("dataType","\u6570\u636e\u7c7b\u578b"));U.getCell(4).setValue(p.get("parameterValue","\u53c2\u6570\u503c"));U=g.getParameters();Ca=U.length;if(0==Ca)U=p.get("noData","\u6ca1\u6709\u6570\u636e"),z=zb.createRow(f),z.getCell(1).setValue(U);else for(z=new h(f),z.setOutsideVisible(!1),f.setCellRender(z),N=0;N<Ca;N++){var t=U[N];z=zb.createRow(f);z.setUserObject(t);z.getCell(0).setValue("");
z.getCell(1).setValue(t.getName());var O=t.getIoTypeText();z.getCell(2).setValue(O);O=t.getDataTypeText();z.getCell(3).setValue(O);z.getCell(4).setValue(null==t.getValue()?"":t.getValue())}zb.refresh(f);u();return e};this.setInitValue=function(U,Ca,z,N){g=U;k=Ca.clone();k.setName(Ca.getName());r=z;a=N};this.getStoredProcedureModel=function(){return g};this.refreshTable=function(){f&&zb.refresh(f);b&&zb.refresh(b)};this.relayoutViews=function(){f&&f.relayoutViews();b&&b.relayoutViews()};this.setCallbackDesignTimeDataObject=
function(U){y=U};var x=function(){var U=g.doCheckParameters();if(U){var Ca=U.getPrompt();Qb(Ca,e,"red");setTimeout(function(){H(U.getErrorRow(),Ca)},500)}else $(b.getUI()).show(),w()},A=function(){g&&g.setOutResultIdx(d.getValue());g&&g.setIsChange(!0);E(null,null);y&&y(g.getAssociateName(),null)},v=function(U,Ca,z){Ca!=z&&(g&&g.setCursorFieldName(z),g&&g.setIsChange(!0),E(null,null),y&&y(g.getAssociateName(),null))},H=function(U,Ca){for(var z=zb.getHeadRowCount();z<f.getRowsCount();z++)f.getRow(z).getCell(0).setValue("");
0<=U&&f.getRow(U+zb.getHeadRowCount()).getCell(0).setValue(Ca)},u=function(){var U=g.doCheckParameters();U?H(U.getErrorRow(),U.getPrompt()):(tb(),H(-1))},w=function(){var U=g.getAssociateName();k.removeStoredProcedure(g.getName());k.addStoredProcedure(g);var Ca=r(function(z){var N={};N[k.getName()]=k;var t=new ob;t.fromJsonObject(z,N);y&&y(g.getAssociateName(),t);z=t.getFisrtEntity();n(z)},function(z,N){var t=z.toString();return"20"==t.substr(0,2)&&7==t.length&&209E4!=z?(2020501==z&&(N=-1==N?p.get("notFindResult",
"\u6ca1\u6709\u83b7\u53d6\u5230\u5b58\u50a8\u8fc7\u7a0b#1\u7684\u7ed3\u679c\u96c6\u3002").replace("#1",U):p.get("notFindIdxResult","\u6ca1\u6709\u83b7\u53d6\u5230\u5b58\u50a8\u8fc7\u7a0b#1\u7b2c#2\u4e2a\u7684\u7ed3\u679c\u96c6\u3002").replace("#1",U).replace("#2",N)),a.showPrompt(N),!0):!1});Ca.setShowBlocking(!1);Ca.getDesigntimeDataObject(k.toJsonObject(),g.getName())},n=function(U){E(null,null);Qb(p.get("loadingPreviewData","\u6b63\u5728\u83b7\u53d6\u9884\u89c8\u6570\u636e\uff0c\u8bf7\u7a0d\u5019\u2026\u2026"),
e,"#666");var Ca=k.toJsonObject(),z=r(function(N){tb();var t=new nb;N&&t.fromJsonObject(N);t&&t.getWarmingMessage()&&a.showPrompt(t.getWarmingMessage());E(U,t.getData())},function(N,t){var O=N.toString();return"20"==O.substr(0,2)&&7==O.length&&209E4!=N?(tb(),a.showError(t),!0):!1});z.setShowBlocking(!1);z.previewData([U.toJsonObject()],[Ca],101)},E=function(U,Ca){zb.clear(b);if(U){for(var z=zb.createHeadRow(b),N=U.getProperties(),t=N.length,O=[],W=0;W<t;W++){var Fa=N[W],Wa=Fa.getOutputDataType(),
ua=Wa==Mb.DT_INT||Wa==Mb.DT_NUMBER,D=b.addColumn(Fa.getName());D.setStyle(zb.getColumnStyle(ua));D.setWidth(Z(Wa));z.getCell(W).setValue(Fa.getAlias());O[W]=bc.createFormater(Wa,Fa.getFormatString())}z=Ca.length;W=0;for(t=Math.min(z,100);W<t;W++)for(Wa=Ca[W],ua=zb.createRow(b),D=0;D<Wa.length;D++){var la=(0,O[D])(Wa[D]);Fa=N[D];Fa.getEnumValue()&&(Fa=Fa.getEnumValue(),Fa[la]&&(la=Fa[la]));ua.getCell(D).setValue(la)}Ca="";0==z?(Ca=p.get("noData","\u6ca1\u6709\u6570\u636e"),ba(Ca)):100>=z?(Ca=p.get("totalRows",
"\u603b\u5171#1\u884c\u6570\u636e").replace("#1",z),ba(Ca,z)):(ba(p.get("loadingTotalRows","\u6b63\u5728\u8ba1\u7b97\u603b\u884c\u6570\uff0c\u8bf7\u7a0d\u5019....")),100<z&&(Ca=p.get("dataShownRows","\u4ec5\u9884\u89c8\u524d#1\u884c\u6570\u636e").replace("#1",100)),C(U,Ca))}zb.refresh(b)},Z=function(U){switch(U){case Mb.DT_INT:case Mb.DT_NUMBER:return 90;case Mb.DT_DATE:return 80;case Mb.DT_DATETIME:return 130;case Mb.DT_BOOLEAN:return 40;default:return 120}},C=function(U,Ca){var z=k.toJsonObject(),
N=r(function(t){0<=t&&(Ca=p.get("totalRows","\u603b\u5171#1\u884c\u6570\u636e").replace("#1",t)+p.get("previewTipsComma",",")+Ca);ba(Ca,t)},function(t,O){O=t.toString();return"20"==O.substr(0,2)&&7==O.length&&209E4!=t?(Ca=p.get("loadingTotalRowsError","\u83b7\u53d6\u603b\u884c\u6570\u5931\u8d25"),ba(Ca),!0):!1});N.setShowBlocking(!1);N.getDataCount([U.toJsonObject()],[z])},ba=function(U,Ca){var z=100;Ca&&100>Ca&&(z=Ca);b.getRowsCount()-zb.getHeadRowCount()==z||0==b.getRowsCount()-zb.getHeadRowCount()?
(Ca=zb.createRow(b),Ca.getCell(0).setValue(U),U=new KTStyle,U.setBackgroundColor(com.kingdee.bos.qing.common.CommonTableSkin.ODD_ROW_BACKGROUND_COLOR),Ca.setStyle(U),U=new KTStyle,U.setTextAlign("left"),Ca.getCell(0).setStyle(U),zb.refresh(b)):b.getRowsCount()-zb.getHeadRowCount()==z+1&&(Ca=b.getRowsCount()-1,b.getRow(Ca).getCell(0).setValue(U),zb.refresh(b))},K=function(U,Ca){if(4!=Ca||(U=f.getRow(U).getUserObject())&&U.getIoType()==Gb.PROCEDUREIOTYPE_OUT)return!1;U=U?U.getDataType():null;return U==
Ra.DATA_STRING||U==Ra.DATA_NUMBER||U==Ra.DATA_INT},ca=function(U,Ca,z,N,t){(U=U.getUserObject())&&U.getValue()!==N&&(U.setValue(N),z.setValue(N),E(null,null),g.setIsChange(!0),y&&y(g.getAssociateName(),null),u());return!0},P=function(U,Ca,z,N,t){var O=$(U);O.empty();O.css("cursor","pointer");var W=t.getUserObject(),Fa=W?W.getDataType():null;Fa==Ra.DATA_DATE||Fa==Ra.DATA_DATETIME?(O=new Date,N=N?parseInt(N):null,isNaN(N)||null==N?W.setValue(O.getTime()):O.setTime(N),N=zb.createCtrlInCell(U,Ca,z,Fa==
Ra.DATA_DATETIME?wa:ma),N.setDateObject(O),N.setUserObject(t),N.addModelChangedListener(fa)):Fa==Ra.DATA_BOOLEAN?(U=zb.createCtrlInCell(U,Ca,z,Pb),U.setSelected(N),U.setItemModels([Mb.BOOLEAN_TRUE,Mb.BOOLEAN_FALSE]),U.setUserObject(t),U.setCustomPainter(function(Wa,ua,D){Wa=D==Mb.BOOLEAN_TRUE?p.get("dataTypeTrue","\u771f"):D==Mb.BOOLEAN_FALSE?p.get("dataTypeFalse","\u5047"):"";ua.text(Wa)}),U.addSelectedChangedListener(xb)):(t=$("<div>"),t.text(N),t.addClass("dm-common-tablecell-editable"),t.appendTo(O))},
fa=function(U){var Ca=""+U.getDateObject().getTime();U=U.getUserObject();U.getUserObject().setValue(Ca);g.setIsChange(!0);U.getCell(4).setValue(Ca)},xb=function(U,Ca,z){U=U.getUserObject();U.getUserObject().setValue(z);g.setIsChange(!0);U.getCell(4).setValue(z)},tb=function(){c&&c.remove()},Qb=function(U,Ca,z){tb();c=$("<div>");c.text(U);c.addClass("dm-source-db-table-selection-waiting");c.css("top","165px");c.css("left","auto");c.css("right",0);c.css("color",z);c.appendTo(Ca)}}function cb(){var h,
e,b;this.getJqUi=function(){h||f();return h};this.setSelectedCallback=function(g){e=g;b&&b.setSelectedCallback(e)};var f=function(){if(Eb.MacroVariateSelectorRegister.isRegisterComplete()){var g=new ub(p.get("insertVariate","\u63d2\u5165\u53d8\u91cf"));g.addActionListener(c);h=g.getJqUi()}else{g=new Sc;g.setText(p.get("insertSystemVar","\u63d2\u5165\u7cfb\u7edf\u53d8\u91cf"));var k=kc.getImpl(kc.SYS_VAR_HELPER).createSysVarAdapters(gc.SUPPORTED_VAR_TYPE);g.setItemModels(k);g.setItemsWidth(285);g.setCustomPainter(d);
g.addPressedListener(function(a,r){a=r.getTextInUserSQL();e(a)});h=g.getJqUi()}},c=function(){b=new rb;b.setSelectedCallback(e);b.showDialog()},d=function(g,k,a){g?(g=$("<div>"),g.text(a)):(a=a.getDisplayName(),k.attr("title",a),g=$("<div>"),g.text(a));g.appendTo(k)}}function rb(){ia.call(this);var h=this,e=this.protectedMethod,b,f,c;(function(){e.setTitle(p.get("selectVariate","\u9009\u62e9\u53d8\u91cf"));h.setSize(500,540);e.setSelectable(!0);e.setContentPaneCreator(function(){b||(b=new Ja,b.setSelected(c));
return b.getJqUi()});e.setClosingChecker2(function(d){if(d=b.getSelectedModel())return f(d),e.destroy(),!0;e.getMessageCurtain().showPrompt(p.get("noVarSelected","\u8bf7\u9009\u62e9\u4e00\u4e2a\u53d8\u91cf\u3002"));return!1},function(d){e.destroy();return!0});e.setClosingAction(function(d){})})();this.setSelectedCallback=function(d){f=d};this.setSelected=function(d){c=d;b&&b.setSelected(c)}}function Ja(){var h,e,b,f,c,d,g,k;this.getJqUi=function(){h||(r(),a());return h};this.setSelected=function(y){e=
y;h&&a()};this.getSelectedModel=function(){return b.isChecked()?c.getSelected():k.getSelectedModel()};var a=function(){if(e){var y=e.getVariateType();y==Eb.AbstractVariateAdapter.VAR_TYPE_SYS?(b.setChecked(!0),c.setSelected(e)):y==Eb.AbstractVariateAdapter.VAR_TYPE_MACRO&&(f.setChecked(!0),k&&k.setSelected(e))}},r=function(){h=$("<div>");var y=0,x=new kd;b=new Fc;b.setChecked(!0);b.setText(p.get("systemVar","\u7cfb\u7edf\u53d8\u91cf"));var A=b.getJqUi();A.appendTo(h);m.layoutCtrl(A,0,y,200,23);x.addElement(b);
b.addCheckedListener(function(){g&&g.hide();c.setEnabled(!0)});c=new Pb;A=kc.getImpl(kc.SYS_VAR_HELPER).createSysVarAdapters(gc.SUPPORTED_VAR_TYPE);c.setItemModels(A);c.setSelected(A[0]);c.setCustomPainter(function(v,H,u){v=u.getDisplayName();H.attr("title",v);u=$("<div>");u.text(v);u.appendTo(H)});d=c.getJqUi();m.layoutCtrl(d,0,y+=43,200,23);d.appendTo(h);f=new Fc;f.setText(p.get("macroVar","\u5b8f\u53d8\u91cf"));A=f.getJqUi();A.appendTo(h);m.layoutCtrl(A,0,y+=43,200,23);x.addElement(f);f.addCheckedListener(function(){c.setEnabled(!1);
k?g&&g.show():(k=Eb.MacroVariateSelectorRegister.createSelector(),e&&k.setSelected(e),g=k.getJqUi(),m.layoutCtrl(g,0,y+=33,465,290),g.appendTo(h))})}}function kb(h,e){function b(k){ia.call(this);var a=this,r=this.protectedMethod;(function(){r.setTitle(p.get("previewRuntimeSQL","\u67e5\u770b\u6267\u884c\u671fSQL"));a.setSize(960,540);r.setSelectable(!0);r.setContentPaneCreator(function(){var y=$("<div>"),x=new Db;x.setText(k);x.setEnabled(!1);x=x.getJqUi();x.appendTo(y);m.layoutCtrlWithLRTB(x,0,0,
null,0,0,null);return y});r.setFooterClosingOnly(!0);r.setClosingChecker2(null,function(y){r.destroy();return!0});r.setClosingAction(function(y){})})()}var f,c,d;this.getJqUi=function(){f||g();return f};this.setMessageCurtain=function(k,a){c=a;d=k};var g=function(){var k=new ub(p.get("previewRuntimeSQL","\u67e5\u770b\u6267\u884c\u671fSQL"));k.addActionListener(function(){var a=kc.getAllImpl(),r=e();if(null==r||0>=r.trim().length)d.showPrompt(c+p.get("inputSqlNotNull","\u4e0d\u80fd\u4e3a\u7a7a\u3002"));
else{var y=0,x=a.length,A=function(v){r=v;y++;y<x?a[y].switchSQLToPersistentMode(r,A):h(function(H){var u=r;H&&(u=H);(new b(u)).showDialog()},function(){(new b(r)).showDialog();return!0}).previewRuntimeUserSQL(r)};a[y].switchSQLToPersistentMode(r,A)}});f=k.getJqUi()}}function Ac(){var h,e;this.setJqLeftPane=function(f){h=f};this.getSwitchButtonStatus=function(){return e.isOn()};this.displayEntityCodingPane=function(f,c,d,g,k){var a=new X;a.setText(d);a=a.getJqUi();a.attr("title",d);m.layoutCtrlWithLRTB(a,
8,null,105,2,10,23);e=new Oa;e.setOn(!1);e.addStateChangeListener(function(){var y=$(f),x=$(c);b(y,g);b(x,".dm-source-db-table-selected-list-item");k(e.isOn())});d=e.getJqUi();m.layoutCtrlWithLRTB(d,120,null,35,2,10,23);var r=$("<div>");r.addClass("dm-field-popup-show-field-name");r.attr("id","dm-field-popup-show-field-comment");r.css("margin-bottom","-3px");d.appendTo(r);a.appendTo(r);r.appendTo(h);h.parents(".sa-ctrl-dialog-padding").css("overflow","visible")};var b=function(f,c){for(var d=0;d<
f.length;d++){var g=f.eq(d);if(g.attr("entity-coding")){var k=g.attr("entity-coding"),a=g.text();g.text(k);g.parents(c).attr("title",k);g.attr("entity-coding",a)}}}}function Jc(){this.updateSameSource=function(e,b,f,c,d){var g=e.getAllEntity();e=[];var k=new Qc,a=0;d&&(a++,h(d,f,k,e,c));for(var r in g){var y=g[r];if(!(y.isUnion()||d&&d==y)){var x=y.getSource();b.isTheSame(x)&&(a++,h(y,f,k,e,c))}}b=a;(new ic).showResult(b,e)};var h=function(e,b,f,c,d){e.isUnion()||(f=f.getSupportState(e,b.getTypeName()),
f.isSupport()?(c=e.getSource(),f=e.getName(),c.isUserSql(f)?(c=c.getUserSql(f),b.addUserSql&&b.addUserSql(c)):c.isStoredProcedure(f)&&(c=c.getStoredProcedure(f),b.addStoredProcedure&&b.addStoredProcedure(c)),d(e)):(f.setEntityAlias(e.getAlias()),c.push(f)))}}function Qc(){this.getSupportState=function(h,e){var b=new ab(!0),f=h.getSource();if(f.isUserSql(h.getName())){h=f.getUserSql(h.getName()).getSqlType();var c=ab.UNSUPPORTED_TYPE_SQL;f=Eb.BizSourceTypeContext.getSourceTypes();for(var d=0;d<f.length;d++)if(e==
f[d].getName()){var g=Ha.createBizMetaSource(e);if(g.isBasedOnDB())return b}if(h==na.SQLTYPE_KSQL){if(c=ab.UNSUPPORTED_TYPE_KSQL,na.isNeedShowKSql(e))return b}else{a:{h=Ha.DB_SOURCES;for(f=0;f<h.length;f++)if(e==h[f].getName()){e=!0;break a}e=!1}if(e)return b}}else if(f.isStoredProcedure(h.getName())){c=ab.UNSUPPORTED_TYPE_STOREPROCEDURE;if(na.isNeedShowPrecedure(e))return b;f=Eb.BizSourceTypeContext.getSourceTypes();for(d=0;d<f.length;d++)if(e==f[d].getName()&&(g=Ha.createBizMetaSource(e),g.supportStoredProcedure()))return b}if(!c)return b;
b.setSupport(!1);b.setUnsupportedType(c);return b}}function ab(h,e){var b=h,f=e,c;this.isSupport=function(){return b};this.setSupport=function(d){b=d};this.getUnsupportedType=function(){return f};this.setUnsupportedType=function(d){f=d};this.setEntityAlias=function(d){c=d};this.getEntityAlias=function(){return c}}function ic(){this.showResult=function(b,f){if(f&&0!=f.length){var c=f.length;b-=c;c=p.get("changeSourceResult","\u66f4\u65b0\u6210\u529f\u6570\u636e\u8868#1\u5f20\uff0c\u5931\u8d25#2\u5f20").replace("#1",
b).replace("#2",c);b=qb.createFeedbackDialog();b.setMsgImageType(qb.MSG_WARNING);b.setExtendPainter(function(d,g){var k=$("<div>");k.addClass("sa-ctrl-feedback-dialog-text");k.css({left:"75px",right:"75px"});k.text(g);k.attr("title",g);k.appendTo(d);g=new xa;g.setIconType(xa.ICON_TYPE_QUESTION);g.setTipsSize(265,70);k=g.setTipsText;for(var a=p.get("unsupportedSourceTips","\u540c\u4e00\u6570\u636e\u6e90\u7684\u5176\u4ed6\u6570\u636e\u8868\u4e2d\uff0c\u5b58\u5728\u4f7f\u7528#1\u53d6\u6570\u7684\u6570\u636e\u8868\uff0c\u66f4\u6362\u7684\u6570\u636e\u6e90\u4e0d\u652f\u6301\u8fd9#2\u79cd\u53d6\u6570\u7c7b\u578b\u3002"),
r="",y=0,x=0;x<f.length;x++){var A=e(f[x].getUnsupportedType());0>r.indexOf(A)&&(0<y&&(r+=p.get("splitMark","\u3001")),r+=p.get("quotationMark","\u201c#1\u201d").replace("#1",A),y++)}y=1==y?"":y+"";a=a.replace("#1",r).replace("#2",y);k.call(g,a);g=g.getJqUi();g.css({position:"absolute",right:"60px",top:"3px"});g.appendTo(d)});b.setOptionType(qb.OPTION_OK);b.setButtonText(qb.RETURN_OK,p.get("iSee","\u6211\u77e5\u9053\u4e86"));b.setMessage(c);b.setDetail(h(f));b.showDialog()}};var h=function(b){for(var f=
p.get("followingEntityChangeSourceFailed","\u4ee5\u4e0b\u6570\u636e\u8868\u66f4\u6362\u6570\u636e\u6e90\u5931\u8d25\uff1a")+"\r\n",c=0;c<b.length;c++){var d=b[c],g="  ",k=d.getEntityAlias();d=d.getUnsupportedType();d=e(d);g=g+k+"(";g+=d;g+=");\r\n";f+=g}return f},e=function(b){switch(b){case ab.UNSUPPORTED_TYPE_SQL:var f=p.get("customSql","\u81ea\u5b9a\u4e49")+na.SQLTYPE_SQL;break;case ab.UNSUPPORTED_TYPE_KSQL:f=p.get("customSql","\u81ea\u5b9a\u4e49")+na.SQLTYPE_KSQL;break;case ab.UNSUPPORTED_TYPE_STOREPROCEDURE:f=
p.get("storedProcedure","\u5b58\u50a8\u8fc7\u7a0b")}return f}}"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.data&&(com.kingdee.bos.qing.data={});var Eb=com.kingdee.bos.qing.data;Eb.SourceType=Ha;Eb.AbstractImportEntityStep=Jb;Eb.SourceTypeStep=jc;Eb.DbConnectionStep=da;Eb.SelectFieldPane=Gc;Eb.AbstractSourceModifyingEditor=
cd;Eb.DbConnectionModifyingEditor=function(){cd.call(this);var h=this,e=this.protectedMethod,b,f,c,d,g,k,a,r,y=[new ea(na.TYPE_HANA,30,4,!1,new Ec,!0,!0),new ea(na.TYPE_MYSQL,-1,-1,!1,new oc,!0,!1),new ea(na.TYPE_SQLSERVER,-1,-1,!1,new xc,!0,!1),new ea(na.TYPE_SYBASE,-1,-1,!1,new Ub,!0,!1),new ea(na.TYPE_ORACLE,30,-1,!1,new Cc,!1,!1),new ea(na.TYPE_ODPS,30,-1,!1,new rc,!1,!1),new ea(na.TYPE_POSTGRESQL,30,-1,!1,new $b,!0,!0),new ea(na.TYPE_DB2,30,-1,!1,new yc,!0,!0),new ea(na.TYPE_ACCESS,30,-1,!0,
new Nb,!1,!1),new ea(na.TYPE_SQLITE,30,-1,!0,new bd,!1,!1),new ea(na.TYPE_HIVE,30,-1,!1,new Uc,!1,!1),new ea(na.TYPE_REDSHIFT,30,-1,!0,new Fb,!0,!0),new ea(na.TYPE_TIDB,-1,-1,!1,new wb,!0,!1),new ea(na.TYPE_DM,-1,-1,!1,new bb,!0,!1),new ea(na.TYPE_GREENPLUM,30,-1,!1,new Za,!0,!0),new ea(na.TYPE_GAUSSDB,30,4,!1,new Lb,!0,!1),new ea(na.TYPE_APACHEDRILL,30,-1,!1,new pb,!0,!1),new ea(na.TYPE_SPARKSQL,30,-1,!1,new Pc,!1,!1),new ea(na.TYPE_SYBASEIQ,-1,-1,!1,new tc,!0,!1),new ea(na.TYPE_IMPALA,30,-1,!1,
new cc,!1,!1),new ea(na.TYPE_KYLIN,30,-1,!1,new qa,!0,!0),new ea(na.TYPE_KINGBASE,30,-1,!1,new oa,!0,!0),new ea(na.TYPE_TDSQL,-1,-1,!1,new Kb,!0,!1),new ea(na.TYPE_GBASE,30,-1,!1,new Hb,!0,!0),new ea(na.TYPE_VASTBASE,30,-1,!1,new Tb,!0,!0),new ea(na.TYPE_DORIS,-1,-1,!1,new Ua,!0,!1),new ea(na.TYPE_YASHANDB,30,-1,!1,new Kc,!1,!0)],x=function(n){var E=y.filter(function(Z){return Z.getDbType()==n.getDbType()});return E&&1==E.length?E[0]:null},A=function(n,E){a=n.getConnectionPane();-1!=n.getDownOffset()&&
a.setDownOffset(n.getDownOffset());-1!=n.getConfigRowCount()&&a.setDbConfigRowCount(n.getConfigRowCount());n.isNeedSelectDb()&&a.addSuccessCallbackListener(H);a.setSource(E);a.setCtxApi(d);a.addSuccessCallbackListener(u);a.addErrorCallbackListener(w);a.setDownSpace(30);return a.getJqUi(n.isNotShowAll())};this.propectedCreateJqUi=function(n,E,Z,C,ba){b=n;f=E;c=Z;d=C;r=ba;n=c.clone();E=f.getAssociateName();Z.isUserSql(E)?(Z=c.getUserSql(E),n.addUserSql(Z)):Z.isStoredProcedure(E)&&(Z=c.getStoredProcedure(E),
n.addStoredProcedure(Z));Z=$("<div>");E=x(n);Z.append(A(E,n));E.isNeedSelectDb()&&(k=new Pb,E.isSchemaSupported()?(n=new X(p.get("dbschema","\u6a21\u5f0f")),k.setSelected(c.getSchema())):(n=new X(p.get("database","\u6570\u636e\u5e93")),k.setSelected(c.getDbName())),n=n.getJqUi(),E=k.getJqUi(),m.layoutCtrl(n,20,a.getCurrentHight()+30,70,23),m.layoutCtrl(E,105,a.getCurrentHight()+30,200,23),Z.append(n),Z.append(E));g=new La;g.setText(p.get("actOnTheSameDatabase","\u540c\u65f6\u4fee\u6539\u5f53\u524d\u4e3b\u9898\u4e2d\u5176\u4ed6\u540c\u6e90\u6570\u636e\u8868"));
g.setChecked(!0);n=g.getJqUi();m.layoutCtrl(n,20,a.getCurrentHight()+60,250,23);Z.append(n);n=new Dc;var K=h.getConfirmListener();n.setClosingAction(function(ca){K&&K(ca)});n.setCloseCallerDialogCallback(function(){e.destroy()});n.setChangeDataSourceParameter(b,f,d,r,c);n=n.getJqUi();m.layoutCtrl(n,0,a.getCurrentHight()+90,120,60);Z.append(n);return Z};this.protectedIsValidToAccepted=function(n){var E=a.collectSource(),Z=x(E);Z.isNeedSelectDb()&&(Z.isSchemaSupported()?E.setSchema(k.getSelected()):
E.setDbName(k.getSelected()));E.getDbType()==na.TYPE_SQLITE?a.getHasUploadFile()?n(!0):e.getMessageCurtain().showPrompt(p.get("pleaseUploadFile","\u8bf7\u5148\u4e0a\u4f20\u6587\u4ef6\u3002")):E.getDbType()==na.TYPE_ACCESS?a.getHasUploadFile()?v(E,n):e.getMessageCurtain().showPrompt(p.get("pleaseUploadFile","\u8bf7\u5148\u4e0a\u4f20\u6587\u4ef6\u3002")):v(E,n)};this.protectedAccepted=function(n,E){var Z=!g.isChecked(),C=a.collectSource(),ba=x(C);ba.isNeedSelectDb()&&(ba.isSchemaSupported()?C.setSchema(k.getSelected()):
C.setDbName(k.getSelected()));if(Z){if(!C.isTheSame(E))for(Z=b.getSources(),n.setSource(C),n.mergeSource(Z),Z=b.getSources(),C=0,n=Z.length;C<n;C++)b.funClearUserSqlsAndStoredProcedures(Z[C]);h.refreshDesigntimeDataObject(f,f.getSource(),d)}else{E.setDbAddress(C.getDbAddress());E.setDbPort(C.getDbPort());E.setDbName(C.getDbName());E.setUserName(C.getUserName());E.setPassword(C.getPassword());ba.isSchemaSupported()&&E.setSchema(C.getSchema());Z=b.getSources();for(C=0;C<Z.length;C++)if(ba=Z[C],E.isTheSame(ba)&&
E!=ba){Z=E;E=ba;E.mergeFrom(Z);break}Z=n.getSource();n.setSource(E);e.updateSameSource(n,Z)}};var v=function(n,E){var Z=a.checkTextFields();Z?e.getMessageCurtain().showPrompt(Z):(n=n.toJsonObject(),d.createFacade(function(C){E(!0)},function(C,ba){E(!1);C=C.toString();return"20"==C.substr(0,2)&&7==C.length?(e.getMessageCurtain().showPrompt(ba),!0):!1}).checkConnection(n))},H=function(){k.setItemModels(a.getDbNameList())},u=function(){e.getMessageCurtain().showSuccess(p.get("connectionSuccessful","\u8fde\u63a5\u6210\u529f\u3002"))},
w=function(n){e.getMessageCurtain().showPrompt(n)}};Eb.FileConnectionModifyingEditor=function(){cd.call(this);var h=this,e=this.protectedMethod,b,f,c,d,g,k;this.propectedCreateJqUi=function(y,x,A,v,H){f=y;c=x;d=A;g=v;y=A.clone();b=new J;b.setCtxApi(g);b.setText(p.get("reupload","\u91cd\u65b0\u4e0a\u4f20"));x=lb.getUrlParamValue("flatFileSize");b.setFileSize(x?x:100);b.setSource(y);b.setMessageCurtain(e.getMessageCurtain());y=$("<div>");x=b.getJqUi();A=new Dc;var u=h.getConfirmListener();A.setChangeDataSourceParameter(f,
c,g,H,d);A.setClosingAction(function(w){u&&u(w)});A.setCloseCallerDialogCallback(function(){e.destroy()});H=A.getJqUi();d.getFileType()==ib.TYPE_EXCEL?m.layoutCtrl(H,0,240,120,60):m.layoutCtrl(H,0,300,120,60);y.append(x);y.append(H);return y};this.protectedIsValidToAccepted=function(y){if(b.hasUploadFile()){k=[];var x=b.getSource(),A=x.toJsonObject();d.getFileType()==ib.TYPE_TXT||d.getFileType()==ib.TYPE_CSV?x.getSplitSign()?y(!0):(e.getMessageCurtain().showPrompt(p.get("customSplitSignShouldNotNull",
"\u81ea\u5b9a\u4e49\u5206\u9694\u7b26\u4e0d\u80fd\u4e3a\u7a7a\u3002")),y(!1)):d.getFileType()!=ib.TYPE_EXCEL&&d.getFileType()!=ib.TYPE_XML||g.createFacade(function(v){var H=new Na;H.fromJsonObject(v);v=H.getChildren();for(H=0;H<v.length;H++)r(v[H]);v=c.getAssociateName().substring(c.getAssociateName().indexOf("/")+1);0<=k.indexOf(v)&&y(!0);0<=k.indexOf(v)||d.getFileType()!=ib.TYPE_EXCEL||(e.getMessageCurtain().showPrompt(p.get("noCorrespondingSheetInThisFile","\u4e0a\u4f20\u7684\u6587\u4ef6\u4e2d\u6ca1\u6709\u540d\u79f0\u4e3a\u201c#1\u201d\u7684\u5de5\u4f5c\u8868\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002").replace("#1",
v)),y(!1));0<=k.indexOf(v)||d.getFileType()!=ib.TYPE_XML||(e.getMessageCurtain().showPrompt(p.get("noCorrespondingXmlNodeInThisFile","\u4e0a\u4f20\u7684\u6587\u4ef6\u4e2d\u6ca1\u6709\u201c#1\u201d\u8282\u70b9\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002").replace("#1",v)),y(!1))},function(v,H){v=v.toString();return"20"==v.substr(0,2)&&7==v.length?(e.getMessageCurtain().showPrompt(H),d.getFileType()==ib.TYPE_XML&&y(!1),!0):!1}).getUsableEntities(A)}else e.getMessageCurtain().showPrompt(p.get("pleaseUploadFile",
"\u8bf7\u5148\u4e0a\u4f20\u6587\u4ef6\u3002")),y(!1)};this.protectedAccepted=function(y,x){var A=b.getSource(),v=!b.getCheckBoxState();if(A.getFileType()==ib.TYPE_XML&&0<y.getAssociateName().indexOf("/")){var H=a(A.getFileName()),u=a(x.getFileName());H+=y.getAssociateName().replace(u,"");y.setAssociateName(H)}if(v)A.isTheSame(x)||(y.setSource(A),y.mergeSource(f.getSources())),h.refreshDesigntimeDataObject(c,c.getSource(),g);else{if(A.getFileType()!=ib.TYPE_EXCEL&&A.getFileType()!=ib.TYPE_XML){if(!sSplitSign){e.getMessageCurtain().showPrompt(p.get("customSplitSignShouldNotNull",
"\u81ea\u5b9a\u4e49\u5206\u9694\u7b26\u4e0d\u80fd\u4e3a\u7a7a\u3002"));funCallback(h);return}x.setSplitSign(sSplitSign);x.setTextLimitSign(A.getTextLimitSign())}x.setCharacterSet(A.getCharacterSet());x.setDefineTypeRowCount(A.getDefineTypeRowCount());x.setFileUrl(A.getFileUrl());x.setFileName(A.getFileName());A=y.getSource();y.setSource(x);e.updateSameSource(y,A)}};var a=function(y){return y.substring(0,y.lastIndexOf("."))},r=function(y){k.push(y.getName().substring(y.getName().indexOf("/")+1));if(y instanceof
Na&&(y=y.getChildren()))for(var x=0;x<y.length;x++)r(y[x])}};Eb.OpenAPIConnectionModifyingEditor=function(){cd.call(this);var h=this,e=this.protectedMethod,b,f,c,d,g,k,a,r,y,x,A;this.propectedCreateJqUi=function(w,n,E,Z,C){b=w;f=n;c=Z;a=E;x=C;d||v();return d};var v=function(){d=$("<div>");r=new X(p.get("RESTfulDataSet","RESTful\u6570\u636e\u96c6"));var w=a.clone();g=new Va;g.setPlaceholder(p.get("RESTfulDataSetUrlPlaceholder","\u8bf7\u8f93\u5165URL\u5168\u8def\u5f84"));var n="URL";"PROGRAM_DATA_SET"==
w.getOpenAPIType()&&(g.setPlaceholder(p.get("programDataSetPlaceholder","\u8bf7\u8f93\u5165Java\u7c7b\u7684\u5168\u8def\u5f84")),r=new X(p.get("programDataSet","\u7a0b\u5e8f\u6570\u636e\u96c6\uff1a")),n=p.get("classPath","\u7c7b\u8def\u5f84"));g.setText(ha.decode(w.getUrl()));var E=g.getJqUi();n=(new X(n)).getJqUi();n.appendTo(d);m.layoutCtrl(n,20,35,80,23);m.layoutCtrl(E,80,35,510,23);E.appendTo(d);E=r.getJqUi();m.layoutCtrl(E,0,0,200,23);E.appendTo(d);k=new La;k.setText(p.get("actOnTheSameDatabase",
"\u540c\u65f6\u4fee\u6539\u5f53\u524d\u4e3b\u9898\u4e2d\u5176\u4ed6\u540c\u6e90\u6570\u636e\u8868"));k.setChecked(!0);E=k.getJqUi();d.append(E);n=new Dc;var Z=h.getConfirmListener();n.setClosingAction(function(C){Z&&Z(C)});n.setCloseCallerDialogCallback(function(){e.destroy()});n.setChangeDataSourceParameter(b,f,c,x,a);n=n.getJqUi();d.append(n);"RESTFUL_DATA_SET"==w.getOpenAPIType()?(A=new l,a.getAuthModel()&&A.setModel(a.getAuthModel()),w=A.initUi(),m.layoutCtrl(w,10,80,580,200),d.append(w),m.layoutCtrl(E,
20,290,250,23),m.layoutCtrl(n,0,320,120,60)):(m.layoutCtrl(E,20,80,250,23),m.layoutCtrl(n,0,120,120,60))};this.protectedAccepted=function(w,n){var E=a.clone(),Z=null;if("RESTFUL_DATA_SET"==E.getOpenAPIType()){var C=A.getAbstractOpenAPIAuth();C&&(C=C.protectedGetModelFromUI())&&(Z=C.protectedToJsonObject())}k&&k.isChecked()?(n.setUrl(ha.encode($.trim(g.getText()))),n.setAuthModel(Z),w.mergeSource(E),E=w.getSource(),w.setSource(n),e.updateSameSource(w,E)):(E.setAuthModel(Z),E.setUrl(ha.encode($.trim(g.getText()))),
E.isTheSame(n)||(w.setSource(E),w.mergeSource(b.getSources())),h.refreshDesigntimeDataObject(f,f.getSource(),c))};this.protectedIsValidToAccepted=function(w){var n=a.clone();y=[];if($.trim(g.getText())){n.setUrl(ha.encode($.trim(g.getText())));if("RESTFUL_DATA_SET"==n.getOpenAPIType()){var E=A.getAbstractOpenAPIAuth();if(E){var Z=E.protectedGetModelFromUI();if(null!=E.protectedCheckParams()){w(!1);e.getMessageCurtain().showPrompt(E.protectedCheckParams());return}n.setAuthModel(Z.protectedToJsonObject())}}var C=
n.toJsonObject();c.createFacade(function(ba){H(C,w)},function(ba,K){w(!1);ba=ba.toString();if("20"==ba.substr(0,2)&&7==ba.length){if("20612"==ba.substr(0,5)||"20622"==ba.substr(0,5))return!1;2061100==ba?e.getMessageCurtain().showError(p.get("error2061100","\u8bf7\u586b\u5199\u6b63\u786e\u7684url\uff0c\u5982\u679c\u662f\u6839\u8def\u5f84\uff0c\u5fc5\u987b\u4ee5.QData\u7ed3\u5c3e\u3002")):2061103==ba?e.getMessageCurtain().showError(p.get("error2061103","pageSize\u7684\u503c\u5fc5\u987b\u57282000\u81f320000\u4e4b\u95f4\u3002")):
2061104==ba?e.getMessageCurtain().showError(p.get("error2061104","\u53c2\u6570\u5f02\u5e38,pageNo\uff0cselectedFields\u4e3a\u7cfb\u7edf\u53c2\u6570\u3002")):2062100==ba?e.getMessageCurtain().showError(p.get("error2062100","\u6ca1\u6709\u5b9e\u73b0\u63a5\u53e3ITableDataProvider\u3002")):2061301==ba?e.getMessageCurtain().showError(p.get("error2061301","\u8bf7\u586b\u5199\u6b63\u786e\u7684\u8ba4\u8bc1\u4fe1\u606f\u3002")):2061302==ba?e.getMessageCurtain().showPrompt(p.get("error2061302","\u8bf7\u586b\u5199\u5b8c\u6574\u7684\u8ba4\u8bc1\u4fe1\u606f\u3002")):
2061303==ba?e.getMessageCurtain().showPrompt(p.get("error2061303","\u6458\u8981\u8ba4\u8bc1\u670d\u52a1\u5668\u8d28\u8be2\u5934\u53c2\u6570\u5f02\u5e38\u3002")):e.getMessageCurtain().showError(K);return!0}return!1}).openAPIInitialCheck(C)}else w(!1),"RESTFUL_DATA_SET"==n.getOpenAPIType()?e.getMessageCurtain().showPrompt(p.get("urlNotNull","URL\u4e0d\u80fd\u4e3a\u7a7a\u3002")):e.getMessageCurtain().showPrompt(p.get("classNameNotNull","Java\u7c7b\u7684\u5168\u8def\u5f84\u4e0d\u80fd\u4e3a\u7a7a\u3002"))};
var H=function(w,n){c.createFacade(function(E){var Z=new Na;Z.fromJsonObject(E);E=Z.getChildren();for(Z=0;Z<E.length;Z++)u(E[Z]);0<=y.indexOf(f.getAssociateName())?n(!0):(e.getMessageCurtain().showPrompt(p.get("noCorrespondingTable","\u6ca1\u6709\u5bf9\u5e94\u7684\u8868,\u8bf7\u91cd\u65b0\u586b\u5199URL\u3002")),n(!1))},function(E,Z){E=E.toString();return"20"==E.substr(0,2)&&7==E.length?(e.getMessageCurtain().showPrompt(Z),!0):!1}).getUsableEntities(w)},u=function(w){y.push(w.getName());if(w instanceof
Na&&(w=w.getChildren()))for(var n=0;n<w.length;n++)u(w[n])}};Eb.DbSelectTableStep=L;Eb.DbSelectFieldStep=Bc;Eb.StoredProcedurePreviewPanel=M;Eb.MetaDBConnectionStep=function(){Jb.call(this);var h=this,e=this.protectedMethod,b,f,c,d,g,k,a,r,y,x,A=!1,v=!1,H=!1,u,w=!1,n,E;this.setChangeSourceType=function(K){w=K};this.getChangeSourceType=function(){return w};this.setOldEntity=function(K){u=K};this.getOldEntity=function(){return u};this.setDModel=function(K){E=K};this.getDModel=function(){return E};this.isShowDataBase=
function(K){A=K};this.setDbChecker=function(K){y=K};this.setDataBaseJqUiCreator=function(K){x=K};this.getSubTitle=function(){return p.get("connectDbCenter","\u6570\u636e\u4e2d\u5fc3")};this.setSource=function(K){r=K};this.getSource=function(){return r};this.setSupportStoredProcedure=function(K){H=K};this.protectedCreateUi=function(){var K=$("<div>");a=$("<div>");K.append(a);return K};this.intoThisStep=function(K,ca){A?(v=!0,w?ba():C()):(v=!1,e.checkConnection(r,function(P){P?(v=!0,w?ba():C()):v=!1}))};
this.outThisStep=function(K,ca){K?ca(null):(K=Eb.BizSourceTypeContext.getPermissionChecker())?K(r.getTypeName(),e.getMessageCurtain(),function(){u&&w&&A?y(r,e.getMessageCurtain())&&Z(ca):Z(ca)},function(){}):Z(ca)};this.isLastStep=function(){return w?!0:!1};this.over=function(K,ca){u&&w&&K&&(ca=!n.isChecked(),K=u.getSource(),ca?(r.isTheSame(K)||(ca=u.getName(),K.isUserSql(ca)?(ca=K.getUserSql(ca),r.addUserSql(ca)):K.isStoredProcedure(ca)&&(ca=K.getStoredProcedure(ca),r.addStoredProcedure(ca)),ca=
E.getSources(),u.setSource(r),u.mergeSource(ca),(K.hasUserSql()||K.hasStoredProcedure())&&E.funClearUserSqlsAndStoredProcedures(K)),e.refreshDesigntimeDataObject(u,r)):(K.hasUserSql()&&r.setAllUserSql(K.getAllUserSql()),K.hasStoredProcedure()&&r.setAllStoredProcedure(K.getAllStoredProcedure()),(new Jc).updateSameSource(E,K,r,function(P){P.setSource(r);P.mergeSource(E.getSources());e.refreshDesigntimeDataObject(P,r)},u)))};this.createNextTableSteps=function(){var K=new L;K.setCtxApi(h.getCtxApi());
K.setSource(r);var ca=new Bc;ca.setCtxApi(h.getCtxApi());ca.setSource(r);return[K,ca]};this.creatNextCustomSqlStep=function(){var K=new dc;K.setSqlType(na.SQLTYPE_SQL);K.setCtxApi(h.getCtxApi());K.setSource(r);return K};this.creatNextCustomKSqlStep=function(){var K=new dc;K.setSqlType(na.SQLTYPE_KSQL);K.setCtxApi(h.getCtxApi());K.setSource(r);return K};this.creatNextStoredProcedureStep=function(){var K=new Wc;K.setCtxApi(h.getCtxApi());K.setSource(r);return K};this.changeDBType=function(K){if(!w){b.setChecked(!0);
var ca=na.isNeedShowKSql(K);g.css("display",ca?"block":"none");k.css("display",na.isNeedShowPrecedure(K)?"block":"none");ca?k.css("top",160):k.css("top",120)}};var Z=function(K){if(w)K(null);else if(v){if(!A||y(r,e.getMessageCurtain()))if(b.isChecked()){var ca=h.createNextTableSteps();K(ca)}else f.isChecked()?(ca=h.creatNextCustomSqlStep(),K(ca)):c&&c.isChecked()?(ca=h.creatNextCustomKSqlStep(),K(ca)):d&&d.isChecked()&&(ca=h.creatNextStoredProcedureStep(),K(ca))}else K(h)},C=function(){a.detach();
a=$("<div>");var K=0;if(A){var ca=x(e.getMessageCurtain());a.append(ca);K+=40}ca=(new X(p.get("type","\u7c7b\u578b"))).getJqUi();m.layoutCtrl(ca,15,K,70,23);a.append(ca);ca=new kd;b=new Fc;b.setChecked(!0);b.setText(p.get("table","\u8868"));var P=b.getJqUi();m.layoutCtrl(P,60,K,120,23);a.append(P);ca.addElement(b);f=new Fc;f.setText(p.get("customSql","\u81ea\u5b9a\u4e49")+na.SQLTYPE_SQL);P=f.getJqUi();K+=40;m.layoutCtrl(P,60,K,120,23);a.append(P);ca.addElement(f);c=new Fc;c.setText(p.get("customSql",
"\u81ea\u5b9a\u4e49")+na.SQLTYPE_KSQL);g=c.getJqUi();K+=40;m.layoutCtrl(g,60,K,120,23);a.append(g);ca.addElement(c);d=new Fc;d.setText(p.get("storedProcedure","\u5b58\u50a8\u8fc7\u7a0b"));k=d.getJqUi();m.layoutCtrl(k,60,K+40,120,23);H&&a.append(k);ca.addElement(d);h.getJqUi().append(a)},ba=function(){a.detach();a=$("<div>");var K=0,ca=(new X(p.get("dataCenter","\u5f53\u524d\u6570\u636e\u4e2d\u5fc3"))).getJqUi();m.layoutCtrl(ca,0,K,120,23);a.append(ca);K+=40;A&&(ca=x(e.getMessageCurtain()),m.layoutCtrl(ca,
5,K,120,23),a.append(ca),K+=40);n=new La;n.setText(p.get("actOnTheSameDatabase","\u540c\u65f6\u4fee\u6539\u5f53\u524d\u4e3b\u9898\u4e2d\u5176\u4ed6\u540c\u6e90\u6570\u636e\u8868"));n.setChecked(!1);ca=n.getJqUi();m.layoutCtrl(ca,20,K,250,23);ca.css("z-index",1);a.append(ca);h.getJqUi().append(a)}};Eb.DbCustomSqlPanel=Hc;Eb.DropdownItemListPane=Sc;Eb.VarSelectDialog=rb;Eb.UploadDbFilePane=fb;Eb.FileConnectionStep=ld;Eb.DbCustomSqlStep=dc;Eb.DBStoredProcedureStep=Wc;Eb.OpenAPIConnectionStep=sc;Eb.TableAndFieldSelectDialog=
function(h,e,b,f){function c(){this.getSelectedDataObjectMap=function(){var Z={};Z[r.getAssociateName()]=y;return Z}}function d(){var Z=0,C={};this.init=function(ba){ba.getProperties().forEach(function(K){C[K.getAssociateName()]=K})};this.changeField=function(ba,K){ba=ba.getAssociateName();C[ba]?K?Z--:Z++:K?Z++:Z--};this.getFieldChangeCount=function(){return Z}}ia.call(this);var g=this,k=this.protectedMethod,a,r=h,y=b,x=new Bc,A={},v,H={};this.setSelectConfirmHandler=function(Z){v=Z};var u=function(){var Z=
{getMessageCurtain:k.getMessageCurtain};a=$("<div>");x.setDefaultCheckEntityMap(A);x.setSource(f);x.setFieldSelectChangeListener(w);a.append(x.getJqUi(Z));e.forEach(function(C){A[C.getAssociateName()]=C;var ba=new d;ba.init(C);H[C.getAssociateName()]=ba});x.intoThisStep(new c,!1)},w=function(Z,C,ba){var K=H[Z];K||(K=new d,H[Z]=K);K.changeField(C,ba)};this.initUi=function(){k.setTitle(p.get("selectTableAndField","\u9009\u62e9\u6570\u636e\u8868\u53ca\u5b57\u6bb5"));g.setSize(960,550);k.setContentPaneCreator(function(){u();
return a});k.setClosingChecker(n,!0);k.setClosingAction(E)};var n=function(Z){x.checkEntityAndField(function(C){if(C){var ba=x.getCheckedEntities(),K=[],ca=[],P=[],fa={},xb=x.getAllInnerRelations(),tb=[];ba.forEach(function(Qb){var U=Qb.getAssociateName();fa[U]=Qb;A[U]?(U=H[U])&&0<U.getFieldChangeCount()&&P.push(Qb):(ca.push(Qb),(U=Qb.getParentEntity())&&A[U.getAssociateName()]&&(Qb.setParentEntity(A[U.getAssociateName()]),xb.forEach(function(Ca){Ca.getToEntity()==Qb&&(Ca.setFromEntity(Qb.getParentEntity()),
tb.push(Ca))})))});e.forEach(function(Qb){fa[Qb.getAssociateName()]||K.push(Qb)});v&&v(r,K,ca,P,tb)}Z(C)})},E=function(Z){}};Eb.AdvancedSettingPane=Dc;Eb.ChoosePropertyPane=function(){var h=[],e,b,f,c,d,g=!1,k=!0;this.setItemModel=function(a){h=a};this.setShowFieldNameEnable=function(a){k=a};this.setRawTypeSwitchListener=function(a){};this.setSearchListener=function(a){e=a};this.setListItemPainter=function(a){b=a};this.setShowFieldNameListener=function(a){f=a};this.createJqPopup=function(a,r,y){c=
$("<div>");c.appendTo(a);d=$("<div>");c.addClass("dm-field-popup");a=p.get("search","\u641c\u7d22");var x=new aa;x.setSearchListenerDelay(200);x.setPlaceholder(a);x.addSearchListener(function(){e(h,x.getText(),d,r,b,g)});a=x.getJqUi();a.addClass("dm-field-popup-search");a.appendTo(c);d.addClass("dm-field-popup-list-owner");d.on("click",function(H){var u=$(H.currentTarget);H=$(H.target);if(H=m.upwardSearchHasClass(H,u,"dm-field-popup-list-item"))H.addClass("dm-list-item_selected_enabled"),u=H.data("model"),
y(u)});d.appendTo(c);a=c.find(".sa-ctrl-textfield-input");a.css("top","0px");a.css("height","100%");for(a=0;a<h.length;a++)b(h[a],d,r,!1);if(k){a=new X;var A=p.get("showFieldName","\u663e\u793a\u539f\u5b57\u6bb5\u540d\u79f0");a.setText(A);a=a.getJqUi();a.attr("title",A);m.layoutCtrlWithLRTB(a,8,null,100,2,10,23);A=new Oa;A.addStateChangeListener(function(H,u,w){(g=w)?f&&f(d,!0):f&&f(d,!1)});A.setOn(!1);A=A.getJqUi();m.layoutCtrlWithLRTB(A,110,null,35,2,10,23);var v=$("<div>");v.addClass("dm-field-popup-show-field-name");
A.appendTo(v);a.appendTo(v);v.appendTo(c)}else d.css("bottom","5px")}};Eb.SourceChangeHelper=Jc;Eb.OpenAPIAuthTypeUI=l;Eb.AbstractPreviewTablePanel=mc;Eb.SuperQueryConnectionStep=function(){function h(){var n,E,Z,C;this.getType=function(){return"currentSystem"};this.getSchema=function(){return C};this.isTable=function(){return E.isChecked()};this.isCustomSql=function(){return Z.isChecked()};this.getErrorMessage=function(){return C?null:p.get("selectOneSchema","\u8bf7\u9009\u62e9\u4e00\u4e2a\u6a21\u5f0f\u3002")};
this.getJqUi=function(){n||(n=$("<div>"),ba());return n};var ba=function(){var K=0,ca=(new X(p.get("schemas","\u6a21\u5f0f"))).getJqUi();m.layoutCtrl(ca,15,K,60,23);n.append(ca);ca=new B;ca.setSchemas(a);ca.setSelectedSchema(r);ca.setFunSelectCallBack(function(fa){C=fa});ca=ca.getJqUi();m.layoutCtrl(ca,60,K,200,23);n.append(ca);K+=40;ca=(new X(p.get("type","\u7c7b\u578b"))).getJqUi();m.layoutCtrl(ca,15,K,60,23);n.append(ca);ca=new kd;E=new Fc;E.setChecked(!0);E.setText(p.get("table","\u8868"));var P=
E.getJqUi();m.layoutCtrl(P,60,K,120,23);n.append(P);ca.addElement(E);K+=40;Z=new Fc;Z.setText(p.get("customSql","\u81ea\u5b9a\u4e49")+na.SQLTYPE_SQL);P=Z.getJqUi();m.layoutCtrl(P,60,K,120,23);n.append(P);ca.addElement(Z)}}Jb.call(this);var e=this,b=this.protectedMethod,f,c,d,g,k=!1,a=[],r,y,x;this.getSubTitle=function(){return p.get("superQuery","\u8d85\u7ea7\u67e5\u8be2")};this.setMessageCurtain=function(n){};this.setChangeSourceType=function(n){k=n};this.getChangeSourceType=function(){return k};
this.setDModel=function(n){g=n};this.getDModel=function(){return g};this.setSource=function(n){x=n};this.getSource=function(){return x};this.setOldEntity=function(n){y=n};this.getOldEntity=function(){return y};this.protectedCreateUi=function(){var n=$("<div>");c=$("<div>");n.append(c);return n};this.intoThisStep=function(n,E){if(0<c.children().length)return!0;v()};var A=function(){c.detach();c=$("<div>");d=new I;d.setSchemas(a);d.setSelectedSchema(r);d.setOffset(0);c.append(d.getJqUi());f=d;e.getJqUi().append(c)},
v=function(){var n=x.clone();n.clear();e.getCtxApi().createFacade(function(E){a=[];for(var Z=Object.keys(E),C=0;C<Z.length;C++){var ba=new db;ba.setName(Z[C]);ba.setAlias(E[Z[C]]);a.push(ba)}r=a[0];0==a.length&&(E=p.get("noAuthentication","\u6ca1\u6709\u53ef\u7528\u7684\u6a21\u5f0f\uff0c\u8bf7\u5148\u8054\u7cfb\u7ba1\u7406\u5458\u6388\u6743\u6a21\u5f0f\u3002"),b.getMessageCurtain().showPrompt(E));k?A():H();return!0},function(E,Z){a=[];k?A():H();3201007==E&&(Z=p.get("SQNotDeploy","\u5f53\u524d\u73af\u5883\u672a\u90e8\u7f72\u8d85\u7ea7\u67e5\u8be2\u670d\u52a1\u6216\u670d\u52a1\u672a\u542f\u52a8\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u68c0\u67e5\u8d85\u7ea7\u67e5\u8be2\u90e8\u7f72\u60c5\u51b5\u3002"));
b.getMessageCurtain().showPrompt(Z);return!0}).getUsableSchemas(n.toJsonObject())},H=function(){c.detach();c=$("<div>");var n=new h;c.append(n.getJqUi());f=n;e.getJqUi().append(c)};this.outThisStep=function(n,E){n?E(null):(n=Eb.BizSourceTypeContext.getPermissionChecker())?n(x.getTypeName(),b.getMessageCurtain(),function(){u(E)},function(){E(null)}):u(E)};var u=function(n){var E=f.getErrorMessage();if(E)return b.getMessageCurtain().showPrompt(E),!1;E=f.getSchema();if("currentSystem"==f.getType())x.clear(),
x.setSchemaName(E.getName()),w(n);else{var Z=E.getName(),C=f.getCloneSource();C.setSchemaName(Z);e.getCtxApi().createFacade(function(ba){x.setSchemaName(Z);x.setDbAddress(C.getDbAddress());x.setDbName(C.getDbName());x.setUserName(C.getUserName());x.setPassword(C.getPassword());w(n);return!0},function(ba,K){b.getMessageCurtain().showPrompt(K);return!0}).getUsableSchemas(C.toJsonObject())}},w=function(n){if(k)n(null);else if(f.isTable()){var E=e.createNextTableSteps();n(E)}else f.isCustomSql()&&(E=
e.creatNextCustomSqlStep(),n(E))};this.isLastStep=function(){return k};this.over=function(n,E){if(!y||!k||!n)return!0;n=y.getSource();f.isChecked()?(x.setAllUserSql(n.getAllUserSql()),(new Jc).updateSameSource(g,n,x,function(Z){Z.setSource(x);Z.mergeSource(g.getSources());b.refreshDesigntimeDataObject(Z,x)},y)):(x.isTheSame(n)||(E=y.getName(),n.isUserSql(E)&&(E=n.getUserSql(E),x.addUserSql(E)),y.setSource(x),E=g.getSources(),y.mergeSource(E),g.funClearUserSqlsAndStoredProcedures(n)),b.refreshDesigntimeDataObject(y,
x))};this.createNextTableSteps=function(){var n=new L;n.setCtxApi(e.getCtxApi());n.setSource(x);var E=new Bc;E.setCtxApi(e.getCtxApi());E.setSource(x);return[n,E]};this.creatNextCustomSqlStep=function(){var n=new dc;n.setSqlType(na.SQLTYPE_SQL);n.setCtxApi(e.getCtxApi());n.setSource(x);n.setIsShowTips(!0);return n}};Eb.SuperQuerySchemaSelector=B;Eb.ModifyDirectConnPanel=I;Eb.ModifySqlConnPanel=function(){var h,e,b,f,c,d,g,k,a,r,y=[],x,A=0,v,H,u;this.setOffset=function(K){A=K};this.setTitle=function(K){a&&
a.setText(K)};this.setCtxApi=function(K){u=K};this.setMessageCurtain=function(K){H=K};this.setSchemas=function(K){y=K};this.setSelectedSchema=function(K){x=K};this.setSource=function(K){r=K};this.getType=function(){return"otherSystem"};this.getSchema=function(){return x};this.getCloneSource=function(){ba();return v};this.isChecked=function(){return k.isChecked()};this.getErrorMessage=function(){return $.trim(e.getText())?$.trim(b.getText())?x?null:p.get("selectOneSchema","\u8bf7\u9009\u62e9\u4e00\u4e2a\u6a21\u5f0f\u3002"):
p.get("dbNameNotNull","\u6570\u636e\u5e93\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a\u3002"):p.get("dbAddress","\u670d\u52a1\u5668\u5730\u5740\u4e0d\u80fd\u4e3a\u7a7a\u3002")};this.getJqUi=function(){if(!h){h=$("<div>");var K=w();h.append(K)}return h};var w=function(){var K=$("<div>");K.addClass("dm-source-db-table-connection");var ca=A;a=new X;a.setText(p.get("superQuery","\u8d85\u7ea7\u67e5\u8be2"));var P=a.getJqUi();m.layoutCtrl(P,0,ca,200,23);P.css("font-size","14px");K.append(P);ca+=36;P=(new X(p.get("IPAddress",
"\u670d\u52a1\u5668"))).getJqUi();m.layoutCtrl(P,20,ca,70,23);K.append(P);e=new Va;e.setText(r.getDbAddress());e.setTabindex(1);P=e.getJqUi();P.on("input",function(fa){n()});m.layoutCtrl(P,100,ca,200,23);K.append(P);ca+=36;P=(new X(p.get("database","\u6570\u636e\u5e93"))).getJqUi();m.layoutCtrl(P,20,ca,70,23);K.append(P);b=new Va;b.setText("cosmic_db");null!=r.getDbName()&&b.setText(r.getDbName());b.setTabindex(2);P=b.getJqUi();P.on("input",function(fa){n()});m.layoutCtrl(P,100,ca,200,23);K.append(P);
ca+=36;P=(new X(p.get("loginInfo","\u670d\u52a1\u5668\u767b\u5f55\u4fe1\u606f\uff1a"))).getJqUi();m.layoutCtrl(P,20,ca,200,23);K.append(P);ca+=36;P=(new X(p.get("userName","\u7528\u6237\u540d"))).getJqUi();m.layoutCtrl(P,20,ca,70,23);K.append(P);f=new Va;f.setText(r.getUserName());f.setTabindex(3);P=f.getJqUi();P.on("input",function(fa){n()});m.layoutCtrl(P,100,ca,200,23);K.append(P);ca+=36;P=(new X(p.get("password","\u5bc6\u7801"))).getJqUi();m.layoutCtrl(P,20,ca,70,23);K.append(P);c=new Ob;c.setPassword(r.getPassword());
c.setTabindex(4);P=c.getJqUi();P.on("input",function(fa){n()});m.layoutCtrl(P,100,ca,200,23);K.append(P);ca+=36;d=$("<div>");d.text(p.get("connect","\u8fde\u63a5"));d.addClass("dm-source-db-table-connection-btn");d.css("line-height","23px");m.layoutCtrl(d,20,ca,50,23);K.append(d);ca+=36;P=(new X(p.get("schemas","\u6a21\u5f0f"))).getJqUi();m.layoutCtrl(P,20,ca,60,23);K.append(P);g=new B;g.setSchemas(y);g.setSelectedSchema(x);g.setFunSelectCallBack(function(fa){x=fa});P=g.getJqUi();m.layoutCtrl(P,100,
ca,120,23);K.append(P);ca+=36;k=new La;k.setText(p.get("actOnTheSameDatabase","\u540c\u65f6\u4fee\u6539\u5f53\u524d\u4e3b\u9898\u4e2d\u5176\u4ed6\u540c\u6e90\u6570\u636e\u8868"));k.setChecked(!1);P=k.getJqUi();m.layoutCtrl(P,20,ca,250,23);P.css("z-index",1);K.append(P);n();return K},n=function(){var K=$.trim(e.getText())&&$.trim(b.getText())&&$.trim(f.getText())&&$.trim(c.getPassword());E(K)},E=function(K){d.off("mousedown",Z);d.removeClass("dm-source-db-table-connection-btn-enable");K&&(d.on("mousedown",
Z),d.addClass("dm-source-db-table-connection-btn-enable"))},Z=function(){ba();v.setSchemaName(null);if(0<v.getDbAddress().indexOf(" "))return H.showPrompt(p.get("IPAddressError","\u670d\u52a1\u5668\u5730\u5740\u4e0d\u6b63\u786e\u3002")),!1;E(!1);d.text(p.get("connecting","\u8fde\u63a5\u4e2d..."));var K=(new Date).getTime();u.createFacade(function(ca){for(var P=[],fa=Object.keys(ca),xb=0;xb<fa.length;xb++){var tb=new db;tb.setName(fa[xb]);tb.setAlias(ca[fa[xb]]);P.push(tb)}g.setSchemas(P);g.setSelectedSchema(P[0]);
H.showSuccess(p.get("connectionSuccessful","\u8fde\u63a5\u6210\u529f\u3002"));C(K);return!0},function(ca,P){C(K);H.showPrompt(P);return!0}).getUsableSchemas(v.toJsonObject())},C=function(K){var ca=(new Date).getTime();setTimeout(function(){d.text(p.get("connect","\u8fde\u63a5"));E(!0)},1E3>ca-K?1E3:0)},ba=function(){v=r.clone();v.setDbAddress($.trim(e.getText()));v.setDbName($.trim(b.getText()));v.setUserName($.trim(f.getText()));v.setPassword($.trim(c.getPassword()))}};var m,S,ha,Ga,sb,p,nc,jb,Fc,
kd,X,Va,Ob,Db,ub,Pb,aa,La,T,V,ia,ma,wa,xa,Aa,Oa,Ia,lb,qb,Ya,zb,Ab,yb,Zb=Eb.Box,mb=Eb.UnionEntity,Mb=Eb.Property,na=Eb.DBSource,ib=Eb.FileSource,Xa=Eb.ExcelSource,Rb=Eb.TextSource,Xb=Eb.XMLSource,ac=Eb.OpenAPISource,gc=Eb.SystemVarType,Tc=Eb.UserSqlObj,Ra=Eb.ParameterModel,Gb=Eb.StoredProcedureParameterModel,Ta=Eb.StoredProcedureModel,Sa=Eb.AbstractSource,ra=Eb.EntityErrorInfo,db=Eb.SchemaInfo,Ma=Eb.Integration,Na=Eb.FolderNode,sa=Eb.LeafNode,ob=Eb.DesigntimeDataObject,nb=Eb.PreviewDataModel,vb=Eb.Icons,
bc=Eb.FormatUtil,kc=Eb.VariateHelperFactory,zc=Eb.OpenAPIAuthFactory,Zc=Eb.AuthModelFactory,jd,ad=Eb.CheckFieldNumUtil;(function(){var h=com.kingdee.bos.qing.common;m=h.DomUtil;S=h.Base32Util;ha=h.Base64Util;Ga=h.Util;sb=h.TextMeasurer;h=com.kingdee.bos.qing.framework.common;p=h.MultilanguageManager.createPackageAccessor(Eb);jd=h.OfficialArticleUtil;h=com.kingdee.bos.qing.ui.component;nc=h.WizardDialog;jb=h.List;Fc=h.RadioButton;kd=h.RadioButtonGroup;X=h.Label;Va=h.TextField;Ob=h.PasswordField;Db=
h.TextArea;ub=h.WorkButton;Pb=h.ComboBox;aa=h.SearchBox;La=h.CheckBox;T=h.DynamicScroller;V=h.SplitPane;ia=h.AbstractModalDialog;ma=h.DateSelector;wa=h.DateTimeSelector;xa=h.HelpIcon;Aa=h.Spinner;Oa=h.SwitchButton;qb=h.MessageDialog;Ya=h.DropdownSelector;h=com.kingdee.bos.qing.common.ui;zb=h.TableUtil;Ab=h.CommonIconUtil;yb=h.RadioButtonGroupWithTabbedPane;h=com.kingdee.bos.qing;lb=h.Seer})();var pa=new function(){var h;this.dataType2IconName=function(e){h||(h={},h[Mb.DT_BOOLEAN]="boolean",h[Mb.DT_INT]=
"int",h[Mb.DT_NUMBER]="number",h[Mb.DT_DATE]="date",h[Mb.DT_DATETIME]="datetime",h[Mb.DT_STRING]="string");return h[e]};this.getTreePropIconName=function(){return"elastic-dm"};this.entity2IconName=function(e){return e.isUnion()?e.getUnionType()==mb.BIZ_UNION?e.getParentEntity()?"entry-biz-union":"head-biz-union":"union":e.getERPCloudEntityType()?e.isSubNodeAtView()?e.getERPCloudEntityType().toLowerCase()+"-sub":e.getERPCloudEntityType().toLowerCase():e.isSubNodeAtView()?"entity-sub":e.getSource().getEntityIconName(e.getName())}};
Eb.IconUtil=pa;Eb.BizSourceTypeContext=new function(){var h,e,b,f,c;this.setTitle=function(d){h=d};this.getTitle=function(){return h};this.setSourceTypes=function(d){e=d};this.getSourceTypes=function(){return e};this.isBizSourceType=function(d){for(var g=0;g<e.length;g++)if(d==e[g].getName())return!0;return!1};this.setPermissionChecker=function(d){f=d};this.getPermissionChecker=function(){return f};this.setStepProvider=function(d){b=d};this.getStepProvider=function(){return b};this.setMutexChecker=
function(d){c=d};this.getMutexChecker=function(){return c};this.addSourceModifyingEditor=function(d,g){va[d]=g};this.addSourceFilterUIRender=function(d,g){Ba[d]=g}};var Y={};Ha.getIconName=function(h){return Y[h]};var ka={};Ha.createBizMetaSource=function(h){return(h=ka[h])?new h:null};var va={};Ha.createBizMetaSourceEditor=function(h){return new va[h]};var Ba={};Ha.createFilterUIRender=function(h){return(h=Ba[h])?new h:null};Ha.DB_SOURCES=[new Ha(na.TYPE_SQLSERVER,"SQL Server","source_sqlserver"),
new Ha(na.TYPE_ORACLE,"ORACLE","source_oracle"),new Ha(na.TYPE_MYSQL,"MySQL","source_mysql"),new Ha(na.TYPE_POSTGRESQL,"Postgre SQL","source_pg"),new Ha(na.TYPE_DB2,"DB2","source_db2"),new Ha(na.TYPE_ACCESS,"Access","source_access"),new Ha(na.TYPE_SQLITE,"SQLite","source_sqlite"),new Ha(na.TYPE_HIVE,"Apache Hive","source_hive"),new Ha(na.TYPE_HANA,"HANA","source_hana"),new Ha(na.TYPE_ODPS,"ODPS","source_odps"),new Ha(na.TYPE_REDSHIFT,"Amazon Redshift","source_redshift"),new Ha(na.TYPE_SYBASE,"SYBASE",
"source_sybase"),new Ha(na.TYPE_TIDB,"TiDB","source_tidb"),new Ha(na.TYPE_DM,"DM","source_dm"),new Ha(na.TYPE_GREENPLUM,"Greenplum","source_greenplum"),new Ha(na.TYPE_GAUSSDB,"GaussDB","source_gaussdb"),new Ha(na.TYPE_APACHEDRILL,"Apache Drill","source_apachedrill"),new Ha(na.TYPE_SPARKSQL,"Spark SQL","source_sparksql"),new Ha(na.TYPE_SYBASEIQ,"Sybase IQ","source_sybaseiq"),new Ha(na.TYPE_IMPALA,"Apache Impala","source_impala"),new Ha(na.TYPE_KYLIN,"Apache Kylin","source_kylin"),new Ha(na.TYPE_DORIS,
"Apache Doris","source_doris"),new Ha(na.TYPE_KINGBASE,"KingBase","source_kingbase"),new Ha(na.TYPE_TDSQL,"TDSQL","source_tdsql"),new Ha(na.TYPE_GBASE,"GBase","source_gbase"),new Ha(na.TYPE_VASTBASE,"Vastbase","source_vastbase"),new Ha(na.TYPE_YASHANDB,"YashanDB","source_yashandb")];Ha.FILE_SOURCES=[new Ha(ib.TYPE_EXCEL,"Excel","source_excel"),new Ha(ib.TYPE_CSV,"CSV","source_csv"),new Ha(ib.TYPE_TXT,"TXT","source_txt"),new Ha(ib.TYPE_XML,"XML","source_xml")];Ha.OPENAPI_SOURCES=[new Ha(ac.TYPE_OPENAPI,
"OpenAPI","source_openAPI")];L.PREVIEW_LIMITED_COLS=50;q.CHANGE_SOURCE_TYPE="changeSource";q.CHANGE_SAME_SOURCE_TYPE="changeSameSource";q.CREATE_NEW_SOURCE_TYPE="createNewSource";Eb.MacroVariateSelectorRegister=new function(){var h;this.registerConstructor=function(e){h=e};this.createSelector=function(){return new h};this.isRegisterComplete=function(){return void 0!=h}};ab.UNSUPPORTED_TYPE_SQL="customSQLUnsupported";ab.UNSUPPORTED_TYPE_KSQL="customKSQLUnsupported";ab.UNSUPPORTED_TYPE_STOREPROCEDURE=
"spUnsupported"})();(function(){function Ha(aa,La,T,V,ia,ma,wa){this.getEntityLocation=function(){return ia};this.getUserObject=function(){return V};this.getName=function(){return La};this.getWidth=function(){return T};this.getBodyCellPainter=function(){return ma};this.getHeadCellPainter=function(){return wa};this.getColIndex=function(){return aa}}function Jb(){jb.call(this);var aa=this,La=this.protectedMethod,T,V,ia,ma,wa,xa=[],Aa,Oa=new Nb,Ia,lb,qb=!1,Ya=!1,zb=0,Ab;this.setIndex=function(Ra){lb=Ra};this.setRefreshMergedTable=
function(Ra){Ia=Ra};this.setIsChangeSql=function(){Ya=!0};this.getSubTitle=function(){return Ua.get("setFieldRelation","\u5b57\u6bb5\u5339\u914d")};this.protectedCreateUi=function(){var Ra=$("<div>");ia=$("<div>");Ra.append(ia);return Ra};this.setSelectEntity=function(Ra){T=Ra};this.isLastStep=function(){return!0};this.over=function(Ra){if(T){var Gb=null;if(T instanceof Dc){var Ta=T.getChildren();Ta&&0<Ta.length&&(Gb=Ta[0])}else Gb=T;Gb&&Zb(Gb)}Ra&&(void 0!==Ia?aa.refreshMergedTable():aa.getCtxApi().finish(wa))};
this.refreshMergedTable=function(){qb=!0;if(null!=lb){var Ra=wa.getChildren(),Gb=Ra.pop();Ra.splice(lb,0,Gb);Gb={};for(var Ta in Ra){var Sa=Ra[Ta].getProperties(),ra;for(ra in Sa){var db=Sa[ra].getRelatedBaseProp(),Ma=Gb[db];Ma||(Ma=[],Gb[db]=Ma);Ma.push(Sa[ra])}}Ra=wa.getProperties();for(Ta in Ra){var Na=Ra[Ta];if(Sa=Gb[Na.getName()]){db=!1;for(ra in Sa)if(Sa[ra].getName()==Na.getName()){db=!0;break}db&&(Na=Sa[0].cloneMe(),Na.setRelatedBaseProp(""),void 0===Na.getFormatString()&&sc.confirmDefaultFormatString(Na),
Ra[Ta]=Na,Sa.forEach(function(sa){sa&&sa.setRelatedBaseProp(Na.getName())}))}}}Tc(function(sa){var ob={};wa.collectSources(ob);var nb=new ab;nb.fromJsonObject(sa,ob);sa=gc(nb);sa.compareAndSync();Ia(wa,sa,lb)})};this.outThisStep=function(Ra,Gb){Ra?Gb(null):ma&&yb(function(Ta){if(Ta){for(Ta=0;Ta<xa.length;Ta++){var Sa=xa[Ta];aa.getSource().addStoredProcedure(Sa)}Aa&&aa.getSource().addUserSql(Aa);wa=T instanceof Dc?T:Oa.convertEntityToUnion(T);V.setUnionUnit(!0);Mb();na();wa.getChildren().push(V);Oa.setUnionEntityProperties(wa,
ma.getPropertyMapModels());Ta=wa.getChildren();for(Sa=0;Sa<Ta.length;Sa++){var ra=Ta[Sa];ra.setProperties(ib(ra,Sa))}Gb(null);Ya&&aa.over(!0)}})};var yb=function(Ra){mb()?(La.getMessageCurtain().showPrompt(Ua.get("atLeastSelectAField","\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\u5b57\u6bb5\u3002")),Ra(!1)):Ya?Ra(!0):Pb.checkFieldNum(zb,La.getMessageCurtain(),Ra)};this.setStoredProcedureModels=function(Ra){xa=Ra};this.setUserSqlModel=function(Ra){Aa=Ra};var Zb=function(Ra){var Gb=Ra.getProperties();if((Ra=
Ra.getColumnToRowProperties())&&0<Ra.length){var Ta={};Gb.forEach(function(Sa){var ra=Sa.getRelatedBaseProp()?Sa.getRelatedBaseProp():Sa.getName();Ta[ra]=Sa});Xa(Ta,Gb,Ra)}},mb=function(){return ma.getPropertyMapModels().every(function(Ra){return!Ra.isSelected()})},Mb=function(){var Ra={};wa.getChildren().forEach(function(Gb){Ra[Gb.getName()]=Gb});Oa.resetIndexNameIfExist(V,Ra)},na=function(){var Ra={};wa.getChildren().forEach(function(Gb){Ra[Gb.getAlias()]=Gb});Oa.resetIndexAliasIfExist(V,Ra)},ib=
function(Ra,Gb){for(var Ta=wa.getProperties(),Sa=ma.getPropertyMapModels(),ra=[],db=0;db<Sa.length;db++){var Ma=Sa[db];Ma.isSelected()||ra.push(Ma)}var Na={};for(Sa=0;Sa<ra.length;Sa++)db=ra[Sa].getPropCell(Gb),(db=null==db?null:db.getProperty())&&(Na[db.getName()]=db);var sa={},ob=[];Ra.getProperties().forEach(function(nb){if(null==Na[nb.getName()]){var vb=nb.getRelatedBaseProp()?nb.getRelatedBaseProp():nb.getName();sa[vb]=nb}});Ta.forEach(function(nb){var vb=sa[nb.getName()];vb&&(vb.setRelatedBaseProp(nb.getName()),
ob.push(vb))});(Ra=Ra.getColumnToRowProperties())&&0<Ra.length&&Xa(sa,ob,Ra);return ob},Xa=function(Ra,Gb,Ta){for(var Sa in Ta){var ra=Ta[Sa];if(ra){var db=void 0,Ma=Gb,Na=ra,sa=[],ob=Na.getFieldNameProperty();Na=Na.getFieldValueProperties();sa.push(ob);sa=sa.concat(Na);for(db in sa){Na=sa[db];ob=Na.getName();Na.setRelatedBaseProp(ob);for(var nb in Ma)if(Ma[nb].getName()==ob){Ma.splice(nb,1);break}}Rb(Ra,Gb,ra)}}},Rb=function(Ra,Gb,Ta){var Sa={};Gb.forEach(function(Na){var sa=Na.getRelatedBaseProp()?
Na.getRelatedBaseProp():Na.getName();Sa[sa]=Na});Ta=Ta.getUsedColumnToRowPropertyNames();for(var ra in Ta){var db=Ta[ra],Ma=Ra[db];Ma&&((db=Sa[db])&&db.setRelatedBaseProp(""),db||(Ma.setRelatedBaseProp(""),Gb.push(Ma)))}},Xb=function(Ra){ma=new cc;ma.setEntityCompareModel(Ra);ma.setFieldSelectChangeListener(function(Gb){ac(Gb)});ia.detach();ia=$("<div>");ia.addClass("dm-entity-fieldtable");Ab=$("<div>");Ab.addClass("dm-entity-field-match-label-title-field-num");Ab.css({left:"10px",top:"-10px"});ia.append(Ab);
ia.append(ma.getJqUi());!Ya&&aa.getJqUi().append(ia);ma.loadData(T,V);Ra=ma.getSelectedFieldNum();ac(Ra);Ya&&aa.outThisStep(!1,function(){})},ac=function(Ra){zb=Ra;Ra=Ua.get("selectedFieldNum","\u5df2\u9009\u62e9#1\u4e2a\u5b57\u6bb5");Ra=Ra.replace("#1",zb);Ab.text(Ra)},gc=function(Ra){var Gb=1==qb?wa:T;return Gb instanceof Dc?new kb(Gb,Ra.getEntityMap()):new Ja(Gb,Ra.getFisrtEntity())},Tc=function(Ra){Ra=aa.getCtxApi().createFacade(Ra);Ra.setBlockingJqUi(aa.getJqUi());Ra.setShowBlocking(!0);var Gb=
1==qb?wa:T;if(Gb instanceof cd)Ra.getDesigntimeDataObject(Gb.getSource().toJsonObject(),Gb.getAssociateName());else{var Ta=Ra.getUnionDesigntimeDataObject,Sa=[Gb.toJsonObject()],ra={};Gb.collectSources(ra);Gb=[];for(var db in ra){var Ma=ra[db].toJsonObject();Gb.push(Ma)}Ta.call(Ra,Sa,Gb)}};this.intoThisStep=function(Ra,Gb){V=Ra.getNewMergedEntity().cloneMe(null);Tc(function(Ta){var Sa={};T.collectSources(Sa);var ra=new ab;ra.fromJsonObject(Ta,Sa);Ta=gc(ra);Ta.compareAndSync();Xb(Ta)})}}function jc(aa,
La){var T,V=aa instanceof Dc,ia,ma,wa,xa,Aa,Oa=[],Ia,lb={},qb,Ya=new Nb;this.setDesigntimeObjDataMap=function(na){lb=na};this.setFunRowSelectChangeCallBack=function(na){qb=na};this.setFunOpenRelationDialog=function(na){Aa=na};this.setGlobal=function(na){Ia=na};this.setBox=function(na){ia=na};this.getRootMergeModel=function(){return ma};this.getBizEntityMergeCtx=function(){return wa};this.setEntityRelations=function(na){Oa=na};this.getJqUi=function(){if(!T){T=$("<div>");T.addClass("dm-biz-entity-merge-table-container");
wa=new rb;wa.initForNewMerge(ia,aa,La,Oa,lb);var na=new J(2,0);na.setRowNum(0);na.initCellNode();na.getEntityCellNode(0).setEntity(aa);var ib=wa.getArrSourceEntity();if(1!=ib.length)for(var Xa=1;Xa<ib.length;Xa++){var Rb=ib[Xa],Xb=Rb.getParentEntity();Xb=na.deepFindRowByEntity(0,Xb);if(null!=Xb){var ac=new J(2,Xb.getRowLevel()+1);ac.setEntityMergeChangeListener(Ab);ac.setParentRowModel(Xb);ac.setRowNum(Xa);ac.initCellNode();ac.getEntityCellNode(0).setEntity(Rb);Xb.addChildrenRowModel(ac)}}ib=na.getColSize()-
1;for(Xa=0;Xa<La.length;Xa++){Rb=La[Xa];Xb=0;for(ac=Rb;null!=ac.getParentEntity();)Xb+=1,ac=ac.getParentEntity();ac=Xb;if(0==ac)na.getEntityCellNode(ib).setEntity(Rb);else{Xb=na.deepFindRowByEntity(ib,Rb.getParentEntity());var gc=Xb.findSameAliasRowModel(Rb,!1);gc?gc.getEntityCellNode(ib).setEntity(Rb):(ac=new J(ib+1,ac),ac.setEntityMergeChangeListener(Ab),ac.initCellNode(),ac.getEntityCellNode(ib).setEntity(Rb),Xb.addChildrenRowModel(ac),ac.setParentRowModel(Xb))}}na.recalcRowNum(new Ac(0));ma=na;
xa=new Cb;xa.setBizEntityMergeCtx(wa);xa.setEntityMergeModel(ma);xa.setPropMapDataRowCreator(Zb);xa.setHeadCellPainter(mb);xa.setTableSelectChangeHandler(Mb);xa.initMergeTable();na=$(xa.getInnerTable().getUI());na.addClass("dm-entity-merge-table");na.appendTo(T)}return T};this.mergeBizEntity=function(){var na=[];ma.deepVisitRow(function(ib){var Xa=ib.getColSize();for(var Rb=0;Rb<Xa;Rb++){var Xb=ib.getEntityCellNode(Rb).getEntity();if(Xb&&!(Xb instanceof Dc)){var ac=Ya.createBizUnionEntityNameField();
ac.setRelatedBaseProp(sc.CUSTOM_BIZ_ENTITY_NAME_FIELD);Xb.getProperties().splice(0,0,ac)}}Rb=ib.getEntityCellNode(0).getEntity();if(Xb=ib.getEntityCellNode(1).getEntity())Xb.setUnionUnit(!0),Xb.setUnionLocation(wa.getNewMergeEntityLocation()),Xa=Xb.getName(),Ya.resetIndexNameIfExist(Xb,wa.getSourceInnerEntityNameMap()),Ya.resetIndexAliasIfExist(Xb,wa.getSourceInnerEntityAliasMap()),ac=Xb.getName(),ac!=Xa&&wa.replaceTargetEntityRelationPropMapKey(Xa,ac);Rb?(Xa=V?Rb:Ya.convertEntityToUnion(Rb),!V&&
Rb.setUnionLocation(0),Xb&&Xa.getChildren().push(Xb)):(Xa=Ya.convertEntityToUnion(Xb),Ya.resetIndexNameIfExist(Xa,wa.getBoxEntityNameMap()),Ya.resetIndexAliasIfExist(Xa,wa.getBoxEntityAliasMap()));Ya.setUnionEntityProperties(Xa,ib.getPropMapModels());Ya.mergeUnionTreeProp4NewEntityMerge(Xa,ib);Rb=Xa;a:if(0!=ib.getChildrenRows().length){ac=ib.getEntityCellNode(0).getEntity();Xb=ib.getEntityCellNode(1).getEntity();if(ac){if(wa.isSourceUnionEntity()){if((ac=wa.getSourceUnionEntityOriginalCalcRelatedProps(ac))&&
ac[0]){ib.setRelationFromProp(ac[0]);break a}}else var gc=wa.getEntityRelationFromProp(ac.getName(),rb.SOURCE_ENTITY);gc||(gc=wa.getEntityRelationFromProp(Xb.getName(),rb.TARGET_ENTITY))}else gc=wa.getEntityRelationFromProp(Xb.getName(),rb.TARGET_ENTITY);gc=Rb.findProperty(gc.getRelatedBaseProp());gc=Ya.createSpecialCalcProp4Relation(Rb,gc);Rb.getProperties().push(gc);ib.setRelationFromProp(gc)}a:if(ib.getParentRowModel()){gc=ib.getEntityCellNode(0).getEntity();Xb=ib.getEntityCellNode(1).getEntity();
Xb=gc?gc:Xb;ac=gc?rb.SOURCE_ENTITY:rb.TARGET_ENTITY;if(gc&&wa.isSourceUnionEntity()&&(gc=wa.getSourceUnionEntityOriginalCalcRelatedProps(gc))&&gc[1]){ib.setRelationToProp(gc[1]);break a}if(gc=wa.getEntityRelationToProp(Xb.getName(),ac))gc=Rb.findProperty(gc.getRelatedBaseProp()),gc=Ya.createSpecialCalcProp4Relation(Rb,gc),Rb.getProperties().push(gc),ib.setRelationToProp(gc)}Rb=ib.getUnSelectedMapModels();gc=Xa.getChildren();for(Xb=0;Xb<gc.length;Xb++){ac=gc[Xb];for(var Tc={},Ra=0;Ra<Rb.length;Ra++){var Gb=
Rb[Ra].getPropCell(Xb);(Gb=null==Gb?null:Gb.getProperty())&&(Tc[Gb.getName()]=Gb)}ac.setProperties(Ya.rebuildInnerEntityProperty(Xa,ac,Tc))}Xa.setUnionType(Dc.BIZ_UNION);na.push(Xa);ib.setFinalUnionEntity(Xa);if(ib=ib.getParentRowModel())ib=ib.getFinalUnionEntity(),Xa.setParentEntity(ib)});ia.refreshEntities(na);zb();ma.deepVisitRow(function(ib){var Xa=ib.getParentRowModel();if(Xa){var Rb=Xa.getInnerRelationProps()[0],Xb=ib.getInnerRelationProps()[1];Xa=Xa.getFinalUnionEntity();var ac=ib.getFinalUnionEntity(),
gc=ia.getRelationByEntitiesName(Xa.getName(),ac.getName());if(!gc||gc.getFromProperty().getName()!=Rb.getName()||gc.getToProperty().getName()!=Xb.getName()){gc=ib.getEntityCellNode(0).getEntity();ib=ib.getEntityCellNode(1).getEntity();var Tc=gc?rb.SOURCE_ENTITY:rb.TARGET_ENTITY;ib=wa.getRelationByToEntityName((gc?gc:ib).getName(),Tc).clone();ib.setFromProperty(Rb);ib.setFromEntity(Xa);ib.setToProperty(Xb);ib.setToEntity(ac);ia.addRelation(ib)}}})};var zb=function(){var na=ia.findUnionInnerEntityRelation(aa.getName());
na||(na=new R,na.setRootUnionEntityName(aa.getName()));V||ia.removeInnerRelationByEntityName(wa.getSourceInnerEntityNameMap()).forEach(function(Xa){na.addRelation(Xa)});var ib={};La.forEach(function(Xa){ib[Xa.getName()]=Xa});Oa.forEach(function(Xa){ib[Xa.getFromEntity().getName()]&&ib[Xa.getToEntity().getName()]&&na.addRelation(Xa)});0<na.getRelations().length&&ia.replaceOrAddUnionInnerEntityRelation(na)},Ab=function(na){na.setPropertyMapModels(null)};this.selectRow=function(na){xa.getInnerTable().getSelectionModel().setSelected(new KTSelectionModel.Target(na,
0,0,1))};var yb=function(na){if(na==ma.getColSize()-1){var ib=new ld;ib.addEntities(La);var Xa={};La.forEach(function(Rb){Xa[Rb.getName()]=Rb});Oa.forEach(function(Rb){var Xb=Rb.getFromEntity().getName(),ac=Rb.getToEntity().getName();(Xa[Xb]||Xa[ac])&&ib.addRelation(Rb)});Aa&&Aa(ib,La[0],Ia)}else na=ma.getEntityCellNode(na).getEntity(),Aa&&Aa(ia,na,Ia)},Zb=function(na,ib){var Xa=na.getEntityCellNode(0).getEntity(),Rb=na.getEntityCellNode(1).getEntity();Rb=new Pc(Xa,Rb);Xa&&(Xa=ib.isSourceUnionEntity()?
Xa.getName():Xa.getAssociateName(),Rb.setEntityCompareModel(ib.getEntityCompareModel(Xa)));Rb.setEntityMergeCtx(ib);na.setPropertyMapModels(Rb.createPropRelationMapData())},mb=function(na,ib,Xa){var Rb=na.getCurrentRow().getUserObject(),Xb=na.getCurrentColIdx();Xa=Rb.getEntityCellNode(Xb).getEntity();(Rb=Rb.getEntityCellNode(Xb).getEndEntityNodeInTree())&&Rb.getEntity()!=Xa&&(Xa=$("<div>"),Xa.addClass("dm-biz-entity-merge-table-root-relation-icon"),Va.background(Xa,"relation"),$(ib).append(Xa),Xb=
na.getCurrentColIdx(),Xa.attr("title",Ua.get("checkInnerRelation","\u67e5\u770b\u5185\u90e8\u5173\u7cfb")),Xa.on("click",function(){yb(Xb)}))},Mb=function(na){if(KTSelectionModel.CHANGE_ADD==na){na=xa.getInnerTable();var ib=na.getSelectionModel().getSelected().getRowIdx();na=na.getRow(ib).getUserObject();qb&&qb(na)}};this.refresh=function(){xa.getInnerTable().updateUI()};this.resize=function(){xa.getInnerTable().relayoutViews()}}function Cb(){function aa(Ya){KTDefaultTreeHandlerRender.call(this,Ya);
var zb=this,Ab={};this.prepareBefore=function(){for(var yb=0;yb<ia.getColSize();yb++){var Zb=ia.getEntityCellNode(yb).getEndEntityNodeInTree();Ab[yb]=Zb}};this.create=function(yb,Zb,mb,Mb,na,ib,Xa){var Rb=Ya.getRow(Zb).getUserObject();yb=17*yb.getLevel();ib=zb.protectedMethod.createAbsoluteHtmlElement("span",yb,na,Mb+ib-yb,na+Xa-na);yb=null;var Xb=Rb.hasChildren();if(!Rb.getParentRowModel()&&!Xb)return[null,ib,null];if(Ya.isMultiTreeSupported()&&(yb=document.createDocumentFragment(),Zb<=Ab[mb].getRowIndex())){Zb=
yb;Xb=Mb+2+4+2;var ac=Rb.getEntityCellNode(mb);if(ac.hasNotEmptyChild()&&ac.isNotEmptyCellNode()){var gc=Xb+17*ac.getCellNodeLevel();gc=zb.protectedMethod.createAbsoluteHtmlElement("div",gc,na+(Xa/2+6),0,Xa/2-5);Zb.appendChild(gc);gc.style.borderLeft="1px dotted #8A9EBF"}for(var Tc=ac.getParentCellNode(),Ra=ac;Tc;){gc=Xb+17*Tc.getCellNodeLevel();var Gb=na;if(Tc.isNotEmptyCellNode()){var Ta=Tc.getLastNotEmptyChild();if(Ra.isNotEmptyCellNode()){var Sa=Xa;Ta==Ra?ac==Ra&&(Sa=Xa/2,gc=zb.protectedMethod.createAbsoluteHtmlElement("div",
gc,Gb,0,Sa),Zb.appendChild(gc),gc.style.borderLeft="1px dotted #8A9EBF"):(gc=zb.protectedMethod.createAbsoluteHtmlElement("div",gc,Gb,0,Sa),Zb.appendChild(gc),gc.style.borderLeft="1px dotted #8A9EBF")}else Ta&&Ra.getRowIndex()<Ta.getRowIndex()&&(gc=zb.protectedMethod.createAbsoluteHtmlElement("div",gc,Gb,0,Xa),Zb.appendChild(gc),gc.style.borderLeft="1px dotted #8A9EBF")}Ra=Tc;Tc=Ra.getParentCellNode()}Zb=yb;mb=Rb.getEntityCellNode(mb);(Rb=mb.getParentCellNode())&&mb.isNotEmptyCellNode()&&(Mb=Mb+2+
4+2+17*Rb.getCellNodeLevel()+1,na=zb.protectedMethod.createAbsoluteHtmlElement("div",Mb,na+Xa/2,10,0),Zb.appendChild(na),na.style.borderTop="1px dotted #8A9EBF")}return[null,ib,yb]}}function La(Ya){KTDefaultCellRender.call(this,Ya);var zb=this,Ab;this.setHeadCellPainter=function(na){Ab=na};this.paintCellUI=function(na,ib){var Xa=zb.getCurrentRowIdx(),Rb=zb.getCurrentColIdx(),Xb=zb.getCurrentRow().getUserObject(),ac=17*Xb.getRowLevel(),gc=zb.getCellHeight();1>Xa&&(Ab&&Ab(zb,na,ib),0<Rb&&(ac=zb.createIconDivHtmlElement(ac,
.2*gc/2,1,.8*gc),$(ac).css("border-left-style","solid"),$(ac).css("border-left-color","#E5E5E5"),$(ac).css("border-left-width","1px"),$(na).append(ac)));if((ac=Xb.getEntityCellNode(Rb).getEntity())&&(0==Rb||1>Xa)){var Tc=$("<div>");Tc.addClass("dm-biz-entity-merge-table-entity-icon");Tc.css("left","2px");var Ra=I.entity2IconName(ac);Va.background(Tc,Ra);$(ib).append($(Tc));Tc=$("<div>");Tc.addClass("dm-biz-entity-combo-text");Tc.text(ac.getAlias());Tc.attr("title",ac.getAlias());Tc.css("margin-top",
"-8px");Tc.css("top","50%");Tc.css("left","20px");$(ib).append(Tc)}1<=Xa&&0<Rb&&(Tc=Xb.getEntityCellNode(Rb),gc=Tc.getParentCellNode(),gc.isNotEmptyCellNode()&&(Ra=[],Ra.push(new M(null,Xa,Rb,Xb.getRowLevel())),gc.collectNotEmptyCellNode(Ra),1<Ra.length&&(Xa=$(ib).width(),gc=zb.getCellHeight(),Xa=Hc.createCtrlInCell(ib,Xa,gc,L),$(na).data("my-ctrl",Xa),Xa.setSelected(Tc),Xa.setItemModels(Ra),Xa.setCustomPainter(function(Gb,Ta,Sa){if(Gb=Sa.getEntity()){if(V.isAppendNewEntity()){var ra=Xb.getEntityCellNode(0).getEntity();
var db=ra?ra.getName():"";var Ma=V.getTargetEntityToRelation(Gb.getName());db=V.getSourceEntityToRelation(db)}else{var Na=Xb.getFirstNotEmptyNode().getEntity();Na!=Gb&&(db=V.getInnerRelationByToEntityName(Na.getName()),Ma=V.getInnerRelationByToEntityName(Gb.getName()))}db&&Ma&&db.getRelated()!=Ma.getRelated()?(Na=Ua.get("relationDiffErrMsg","\u5f53\u524d\u6570\u636e\u8868#1\u4e0e#2\u4e4b\u95f4\u7684\u5185\u90e8\u5173\u7cfb\u7c7b\u578b\u4e3a#3\uff0c\u4e0e\u5de6\u4fa7\u6570\u636e\u8868#4\u4e0e#5\u4e4b\u95f4\u7684\u5185\u90e8\u5173\u7cfb\u7c7b\u578b#6\u4e0d\u4e00\u81f4\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9"),
Na=Na.replace("#1",Gb.getAlias()),Na=Na.replace("#2",Gb.getParentEntity().getAlias()),Na=Na.replace("#3",Mb(Ma.getRelated())),Na=Na.replace("#4",ra.getAlias()),Na=Na.replace("#5",ra.getParentEntity().getAlias()),Ma=Na=Na.replace("#6",Mb(db.getRelated()))):Ma=null;Ma&&!Gb.getErrorState()?(ra=Sc.createWarning(),ra.attr("title",Ma),ra.addClass("dm-biz-merge-diff-entity-error-icon"),Ta.parent().append(ra),Sa.setErrorDesc(Ma)):Sa.setErrorDesc(null);Sa=$("<div>");Sa.addClass("dm-biz-entity-merge-table-entity-icon");
Sa.css("left","0px");Ma=I.entity2IconName(Gb);Va.background(Sa,Ma);Ta.append($(Sa));Sa=$("<div>");Sa.addClass("dm-biz-entity-combo-text");Sa.text(Gb.getAlias());Sa.attr("title",Gb.getAlias());Ta.append(Sa)}else Ta.text(""),Sa.setErrorDesc(null)}),Xa.setUserObject(Xb),Xa.addSelectedChangedListener(Zb))));ac&&ac.getErrorState()&&yb($(ib),ac)};var yb=function(na,ib){var Xa=Sc.createWarning();Xa.attr("title",ub.getDefaultErrorDesc(ib));Xa.addClass("dm-biz-merge-diff-entity-error-icon");na.append(Xa)};
this.createIconDivHtmlElement=function(na,ib,Xa,Rb){var Xb=document.createElement("div");Xb.style.overflow="hidden";Xb.style.position="absolute";Xb.style.left=na+"px";Xb.style.top=ib+"px";Xb.style.width=(0>Xa?0:Xa)+"px";Xb.style.height=(0>Rb?0:Rb)+"px";return Xb};var Zb=function(na,ib,Xa){na=na.getUserObject();var Rb=ib.getEntity(),Xb=Xa.getEntity();if(null==Xb&&null!=Rb)na.makeLocalCopy(na.getParentRowModel(),ib.getCol(),!0),ib.clearChildCellNodeDataIncludeMe(),ia.removeEmptyChildRow(),ia.recalcRowNum(new Ac(0)),
lb(),Xa=na.getRowNum(),T.getSelectionModel().setSelected(new KTSelectionModel.Target(Xa,0,0,1));else if(null!=Xb&&null==Rb){ib=[];Xa.collectEntity(ib);for(Rb=0;Rb<ib.length;Rb++)Xb=ib[Rb],Xb.getProperties().forEach(function(ac){ac.setRelatedBaseProp(null)});mb(na,ib,Xa.getCol());Xa.clearChildCellNodeDataIncludeMe();ia.removeEmptyChildRow();ia.recalcRowNum(new Ac(0));lb();Xa=na.getRowNum();T.getSelectionModel().setSelected(new KTSelectionModel.Target(Xa,0,0,1))}else if(null!=Xb&&null!=Rb){na.makeLocalCopy(na.getParentRowModel(),
ib.getCol(),!0);ib.clearChildCellNodeDataIncludeMe();ib=[];Xa.collectEntity(ib);for(Rb=0;Rb<ib.length;Rb++)Xb=ib[Rb],Xb.getProperties().forEach(function(ac){ac.setRelatedBaseProp(null)});mb(na,ib,Xa.getCol());Xa.clearChildCellNodeDataIncludeMe();ia.removeEmptyChildRow();ia.recalcRowNum(new Ac(0));lb();Xa=na.getRowNum();T.getSelectionModel().setSelected(new KTSelectionModel.Target(Xa,0,0,1))}},mb=function(na,ib,Xa){na.getEntityCellNode(Xa).setEntity(ib[0],!0);if(1<ib.length)for(var Rb=1;Rb<ib.length;Rb++){var Xb=
ib[Rb],ac=Xb.getParentEntity();ac=na.deepFindRowByEntity(Xa,ac);var gc=ac.findSameAliasRowModel(Xb,!1);gc?gc.getEntityCellNode(Xa).setEntity(Xb,!0):(gc=new J(ac.getColSize(),ac.getRowLevel()+1),gc.initCellNode(),gc.setEntityMergeChangeListener(na.getEntityChangeListener()),gc.getEntityCellNode(Xa).setEntity(Xb,!0),ac.addChildrenRowModel(gc),gc.setParentRowModel(ac))}},Mb=function(na){if(na==G.R_1_1)return Ua.get("oneToOne","\u4e00\u5bf9\u4e00");if(na==G.R_1_N)return Ua.get("oneToN","\u4e00\u5bf9\u591a");
if(na==G.R_N_1)return Ua.get("nToOne","\u591a\u5bf9\u4e00")}}var T,V,ia,ma,wa,xa,Aa;this.setBizEntityMergeCtx=function(Ya){V=Ya};this.setPropMapDataRowCreator=function(Ya){Aa=Ya};this.getInnerTable=function(){return T};this.setHeadCellPainter=function(Ya){wa=Ya};this.setEntityMergeModel=function(Ya){ia=Ya};this.setTableSelectChangeHandler=function(Ya){ma=Ya};this.getTableJqUI=function(){return T.getUI()};this.selectFirstRow=function(){T.getSelectionModel().setSelected(new KTSelectionModel.Target(0,
0,0,ia.getColSize()-1))};var Oa=function(Ya,zb){(Ya=Ya.data("my-ctrl"))&&Ya.showFeature&&Ya.showFeature(zb)},Ia=function(Ya){var zb=-1,Ab=-1,yb=null;Ya.setCellAcrossListener(function(Zb,mb,Mb){Zb||(Mb=mb=-1);if(zb!=mb||Ab!=Mb)yb&&Oa(yb,!1),yb=Zb,zb=mb,Ab=Mb,1<=zb&&yb&&Oa(yb,!0)})};this.initMergeTable=function(){T=new KTable;T.setDraggableAdjusting(!0,1,0);var Ya=T,zb=Ya.setStyle,Ab=new KTStyle;Ab.setVerticalAlign("middle");Ab.setFontSize(Ob.getFontSize());Ab.setFontUnit("px");Ab.setFontName(Ob.getFontName());
Ab.setColor(com.kingdee.bos.qing.common.CommonTableSkin.COLOR);zb.call(Ya,Ab);T.setBorder(null);T.getCellRender().setPaddingHV(8,1);Ia(T);Hc.setupSingleRowSelection(T);T.getSelectionModel().addChangeListener(ma);Ya=ia.getColSize();T.setMultiTreeSupported(!0,ia.getChildMaxRowNum()+1,Ya);xa=new aa(T);T.setTreeHandlerRender(xa);Ya=new La(T);Ya.setOutsideVisible(!0);Ya.setHeadCellPainter(wa);T.setCellRender(Ya);qb()};this.refreshData=function(){lb()};var lb=function(){Hc.clear(T);qb();T.updateUI()},qb=
function(){xa.prepareBefore();ia.deepVisitRow(function(Ya){Ya.getPropMapModels()||Aa&&Aa(Ya,V);if(0==Ya.getRowNum()){var zb=Ya.getColSize(),Ab=T.isSyncUIWhenModelChanged();T.setSyncUIWhenModelChanged(!1);var yb=T.addRow();yb.setHeight(30);var Zb=yb.setStyle,mb=new KTStyle;mb.setBackgroundColor("#fffff");mb.setBold(!1);mb.setTextAlign("left");Zb.call(yb,mb);Zb=yb.setBorder;mb=new KTBorderStyle;mb.setTopBorderWidth(1);mb.setTopBorderPen("solid");mb.setTopBorderColor("#E5E5E5");mb.setBottomBorderWidth(1);
mb.setBottomBorderPen("solid");mb.setBottomBorderColor("#E5E5E5");Zb.call(yb,mb);T.setSyncUIWhenModelChanged(Ab);yb.setUserObject(Ya);for(Ab=0;Ab<zb;Ab++){T.addColumn(Ab+"").setWidth(170);Zb=Ya.getEntityCellNode(Ab).getEntity();mb=new KTCellTreeModel(Ya.getRowLevel());mb.setExpanded(!0);var Mb=yb.getCell(Ab);Mb.setValue(Zb.getAlias());Mb.setTreeModel(mb)}}else{yb=ia.getColSize();zb=Hc.createRow(T,!1);zb.setUserObject(Ya);for(Ab=0;Ab<yb;Ab++)Zb=Ya.getEntityCellNode(Ab).getEntity(),mb=new KTCellTreeModel(Ya.getRowLevel()),
mb.setExpanded(!0),Mb=zb.getCell(Ab),Mb.setValue(Zb?Zb.getAlias():""),Mb.setTreeModel(mb);Ya=new KTBorderStyle;Ya.setBottomBorderWidth(1);Ya.setBottomBorderPen("solid");Ya.setBottomBorderColor("#E5E5E5");zb.setBorder(Ya)}})}}function oc(){jb.call(this);var aa=this,La,T=this.protectedMethod,V,ia,ma,wa,xa,Aa,Oa,Ia=0,lb;this.setSourceEntity=function(mb){ma=mb};this.setTargetEntityForMerge=function(mb){wa=mb};this.setTargetEntityRelations=function(mb){xa=mb};this.protectedCreateUi=function(){return La=
$("<div>")};this.getSubTitle=function(){return Ua.get("mergeEntityAndMatchField","\u5b9e\u4f53\u5408\u5e76\u4e0e\u5b57\u6bb5\u5339\u914d")};this.isLastStep=function(){return!0};this.over=function(mb){mb&&aa.getCtxApi().refreshFinishFlag()};var qb=function(mb){var Mb={};ma.collectSources(Mb);var na=new ab;na.fromJsonObject(mb,Mb);return na};this.intoThisStep=function(mb,Mb){Mb||(ma instanceof cd?(mb=aa.getCtxApi().createFacade(function(na){na=qb(na);var ib={};ib[ma.getAssociateName()]=na;Ya(ib)}),
mb.setBlockingJqUi(aa.getJqUi()),mb.setShowBlocking(!0),mb.getDesigntimeDataObject(ma.getSource().toJsonObject(),ma.getAssociateName())):(mb=aa.getCtxApi().createFacade(function(na){for(var ib={},Xa=0;Xa<na.length;Xa++){var Rb=qb(na[Xa]);ib[Rb.getFisrtEntity().getAssociateName()]=Rb}Ya(ib)}),Mb=[],Mb.push(ma.getChildren()[0].getSource().toJsonObject()),mb.setBlockingJqUi(aa.getJqUi()),mb.setShowBlocking(!0),mb.getUnionDesigntimeDataObject([ma.toJsonObject()],Mb,!0)))};var Ya=function(mb){V=$("<div>");
var Mb=new da;Mb.setText(Ua.get("mergeEntity","\u5b9e\u4f53\u5408\u5e76"));Mb.setEnabled(!1);Mb=Mb.getJqUi();Mb.addClass("dm-entity-merge-label-title");V.append(Mb);Oa=new jc(ma,wa);Oa.setBox(aa.getCtxApi().getBoxModel());Oa.setGlobal(aa.getCtxApi().getGlobal());Oa.setDesigntimeObjDataMap(mb);Oa.setFunOpenRelationDialog(aa.getCtxApi().getOpenRelationDlgFun());Oa.setEntityRelations(xa);Oa.setFunRowSelectChangeCallBack(Ab);V.append(Oa.getJqUi());Oa.refresh();ia=$("<div>");ia.addClass("dm-source-db-table-selection-center");
mb=new da;mb.setText(Ua.get("setFieldRelation","\u5b57\u6bb5\u5339\u914d"));mb.setEnabled(!1);mb=mb.getJqUi();mb.addClass("dm-entity-field-match-label-title");ia.append(mb);lb=$("<div>");lb.addClass("dm-entity-field-match-label-title-field-num");ia.append(lb);Aa=new Wb;Aa.setFieldSelectChangeListener(function(na){zb(na)});mb=Aa.getJqUi();mb.addClass("dm-biz-entity-fieldmatch-table-container");ia.append(mb);mb=new wc;mb.setHorizontalSplit(!0);mb.setEnabled(!1);mb.setFirstSize(360,-1,-1);mb.setSecondSize(560,
-1,-1);mb.setResizeMode(wc.RESIZE_MODE_SECOND_FIXED);mb.setFirstChild(wc.createChildWrapper(V));mb.setSecondChild(wc.createChildWrapper(ia));La.append(mb.getJqUi());Oa.selectRow(0)},zb=function(mb){Ia=mb;mb=Ua.get("selectedFieldNum","\u5df2\u9009\u62e9#1\u4e2a\u5b57\u6bb5");mb=mb.replace("#1",Ia);lb.text(mb)},Ab=function(mb){var Mb=mb.getPropMapModels(),na=mb.getEntityCellNode(0).getEntity(),ib=mb.getEntityCellNode(1).getEntity(),Xa=new Pc(na,ib),Rb=na?na.getAssociateName():null;Aa.setBizEntityMergeCtx(Oa.getBizEntityMergeCtx());
Xa.setEntityCompareModel(Oa.getBizEntityMergeCtx().getEntityCompareModel(Rb));Xa.setEntityMergeCtx(Oa.getBizEntityMergeCtx());Aa.setPropMappingHelper(Xa);Aa.setPropertyRelationRows(Mb);Aa.setBox(aa.getCtxApi().getBoxModel());Aa.setEntityMergeModel(mb);Aa.loadData(na,ib);mb=Aa.getSelectedFieldNum();zb(mb)},yb=function(mb){var Mb=Oa.getRootMergeModel(),na=[];Mb.makeFlat(na);Mb=Mb.getColSize();var ib=new Nb;Zb(na,0,Mb,ib,mb)},Zb=function(mb,Mb,na,ib,Xa){if(Mb>=mb.length)Xa(!0);else{for(var Rb=mb[Mb],
Xb=0;Xb<na;Xb++){var ac=Rb.getEntityCellNode(Xb).getErrorDesc();if(ac){T.getMessageCurtain().showPrompt(ac);Xa(!1);return}}if(ac=Rb.getPropMapModels()){for(Xb in ac){var gc=ac[Xb].getUnAcceptedError();if(gc){T.getMessageCurtain().showPrompt(gc.getErrorDesc());Xa(!1);return}}ib.isAllPropNotSelected(ac)?(Xb=Ua.get("allPropNotSelectError",'\u6570\u636e\u8868"#1"\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b57\u6bb5'),Rb=Rb.getFirstNotEmptyNode().getEntity(),T.getMessageCurtain().showPrompt(Xb.replace("#1",
Rb.getAlias)),Xa(!1)):(Rb=ib.getSelectedFieldNum(ac),Pb.checkFieldNum(Rb,T.getMessageCurtain(),function(Tc){Tc?Zb(mb,Mb+1,na,ib,Xa):Xa(!1)}))}else Zb(mb,Mb+1,na,ib,Xa)}};this.outThisStep=function(mb,Mb){mb?Mb(null):Oa&&yb(function(na){na&&(Oa.mergeBizEntity(),Mb(null))})}}function rc(){ic.call(this);var aa=this,La,T;this.isLastStep=function(){return!1};this.protectedGetNextStep=function(){var ma=new oc;ma.setCtxApi(aa.getCtxApi());ma.setSourceEntity(La);var wa=aa.getCheckedCloneEntities();ma.setTargetEntityForMerge(wa);
var xa=aa.getAllInnerRelations();if(V(xa))ma=Ua.get("relationDiffTips1",'\u4e1a\u52a1\u5b9e\u4f53"#1"\u4e2d\uff0c \u5b58\u5728\u6570\u636e\u8868\u67092\u4e2a\u53ca\u4ee5\u4e0a\u5b57\u6bb5\u4e0e\u5176\u4ed6\u6570\u636e\u8868\u521b\u5efa\u5173\u7cfb\uff0c\u8bf7\u53d6\u6d88\u52fe\u9009\u4e0d\u6ee1\u8db3\u5408\u5e76\u6761\u4ef6\u7684\u6570\u636e\u8868\u3002').replace("#1",T),ia(ma);else{var Aa={};wa.forEach(function(Ia){Aa[Ia.getName()]=Ia});var Oa=[];xa.forEach(function(Ia){Ia=Ia.clone();var lb=Aa[Ia.getFromEntity().getName()];
lb&&(Ia.setFromEntity(lb),Ia.setFromProperty(lb.findProperty(Ia.getFromProperty().getName())));if(lb=Aa[Ia.getToEntity().getName()])Ia.setToEntity(lb),Ia.setToProperty(lb.findProperty(Ia.getToProperty().getName()));Oa.push(Ia)});ma.setTargetEntityRelations(Oa);return ma}};this.over=function(ma){};this.setSourceEntity=function(ma){La=ma};this.setSelectModeDisplayName=function(ma){T=ma};var V=function(ma){for(var wa={},xa=!1,Aa=0;Aa<ma.length;Aa++){var Oa=ma[Aa],Ia=Oa.getFromEntity().getName(),lb=Oa.getFromProperty().getName();
if(wa[Ia]&&wa[Ia]!=lb&&Oa.isInnerRelation()){xa=!0;break}else wa[Ia]=lb}return xa},ia=function(ma){var wa=com.kingdee.bos.qing.ui.component.MessageDialog,xa=wa.createFeedbackDialog();xa.setOptionType(wa.OPTION_OK);xa.setMsgImageType(wa.MSG_WARNING);xa.setButtonText(wa.OPTION_OK,Ua.get("iknow","\u6211\u77e5\u9053\u4e86"));xa.setMessage(ma);xa.setExtendPainter(function(Aa,Oa){var Ia=$("<div class='sa-ctrl-feedback-dialog-text'>"),lb=$("<span>");lb.text(Oa);lb.appendTo(Ia);Oa=$("<a onclick='javascript:window.open(\"https://q.kdcloud.com/support/index.html?version=1.0&docId=Tvqwnwaig\");' href='#'>");
Oa.css({cursor:"pointer",color:"#5582f3"});Oa.text(Ua.get("viewDocument","\u67e5\u770b\u5e2e\u52a9\u6587\u6863"));Oa.appendTo(Ia);Ia.appendTo(Aa)});xa.showDialog()}}function Kc(){var aa=[],La={},T=[];this.addEntityExchanger=function(V,ia){V?(aa.push(V),La[V.getName()]=ia):T.push(ia)};this.getNewAddedEntities=function(){return T};this.getNewEntity=function(V){return La[V]};this.getAllOldEntity=function(){return aa}}function Cc(aa,La){var T,V,ia,ma,wa,xa,Aa,Oa,Ia,lb,qb,Ya=[];this.setFunSelectChangeCallBack=
function(ra){qb=ra};this.relayoutViews=function(){ia.getInnerTable().relayoutViews()};this.setGlobal=function(ra){Oa=ra};this.getRootEntityMergeRow=function(){return Aa};this.setBox=function(ra,db){T=db;V=ra;lb=T.findUnionInnerEntityRelation(aa.getName())};this.getBizUnionInnerEntityRelations=function(){return lb};this.setFunOpenRelationDialog=function(ra){wa=ra};this.setDesigntimeObjDataMap=function(ra){Ia=ra};var zb=function(ra,db,Ma){Ma=$("<div>");Ma.addClass("dm-modify-union-entity-menu");Va.background(Ma,
"menu");$(db).append(Ma);var Na=ra.getCurrentColIdx();Ma.on("click",function(sa){ac(sa,Na)})},Ab=function(ra){var db=ra.getUserObject();ra=db.getEntity();var Ma=[];db.collectEntity(Ma);var Na=Ia[ra.getAssociateName()];db=ra.getSource();Na=Na.cloneMe();ra=new kd(ra,Ma,Na,db);ra.setSelectConfirmHandler(na);ra.initUi();ra.showDialog()},yb=function(ra,db){var Ma=ra.getUnionLocation();0<db.length&&Aa.deepVisitRow(function(Na){Na=Na.getEntityCellNode(Ma);var sa=Na.getEntity();sa&&0<=db.indexOf(sa)&&(ma.removeInnerEntityUnit(sa),
lb.removeRelation(sa),Na.setEntity(null,!0))})},Zb=function(ra,db){var Ma=[],Na;for(Na in db){var sa=db[Na];sa.getFromEntity()!=ra&&sa.getToEntity()!=ra||Ma.push(sa)}return Ma},mb=function(ra,db,Ma){ra=ra.getUnionLocation();var Na=Aa.getColSize(),sa=new Nb,ob;for(ob in db){var nb=db[ob],vb=Zb(nb,Ma);nb.setUnionLocation(ra);nb.setUnionUnit(!0);nb.getProperties().splice(0,0,sa.createBizUnionEntityNameField());sa.resetIndexNameIfExist(nb,ma.getSourceInnerEntityNameMap());sa.resetIndexAliasIfExist(nb,
ma.getSourceInnerEntityAliasMap());var bc=Aa.deepFindRowByEntity(ra,nb.getParentEntity(),!0);ma.addNewInnerEntityUnit(nb,vb);nb.setParentEntity(bc.getEntityCellNode(ra).getEntity());vb.forEach(function(kc){kc.getToEntity()==nb&&kc.setFromEntity(nb.getParentEntity());lb.addRelation(kc)});(vb=bc.findSameAliasRowModel(nb,!0))?vb.getEntityCellNode(ra).setEntity(nb,!0):(vb=new J(Na,bc.getRowLevel()+1),vb.setEntityMergeChangeListener(Ra),vb.setRowNum(bc.getChildMaxRowNum()+1),vb.initCellNode(),bc.addChildrenRowModel(vb),
vb.setParentRowModel(bc),vb.getEntityCellNode(ra).setEntity(nb,!0))}},Mb=function(ra,db){var Ma=ra.getUnionLocation(),Na={};db.forEach(function(sa){Na[sa.getAssociateName()]=sa});Aa.deepVisitRow(function(sa){var ob=sa.getEntityCellNode(Ma).getEntity();if(ob){var nb=Na[ob.getAssociateName()];if(nb){var vb=ma.getEntityUnitPropAssociateNameMap(ob.getName()),bc={},kc=[];kc.push(ob.getProperties()[0]);bc[kc[0].getAssociateName()]=kc[0];var zc=[];nb.getProperties().forEach(function(Ba){var h=Ba.getAssociateName(),
e=vb[h];e?(kc.push(e),bc[h]=e):(kc.push(Ba),bc[h]=Ba,zc.push(Ba),0<=Ba.getTreeType()&&ob.getTreeRootProps().push(nb.getTreeRootProp(Ba)))});ma.replaceEntityPropAssociateNameMap(ob.getName(),bc);var Zc=sa.getPropMapModels(),jd=sa.getCurrentUnionEntity(),ad=jd.indexOfEntity(ob);if(!Zc){jd=sa.getOriginalUnionEntity()?sa.getOriginalUnionEntity():sa.getCurrentUnionEntity();var pa=ma.getEntityCompareModel(jd.getName());pa=new Ec(jd,pa);pa.setEntityMergeCtx(ma);Zc=pa.loadPropertyMapModels();sa.setPropertyMapModels(Zc)}pa=
{};var Y=[];sa.setPropertyMapModels(Y);sa.getUnionChangeState().setPropMapChanged(!0);for(sa=0;sa<Zc.length;sa++){var ka=Zc[sa],va=ka.getFieldPropByIndex(ad);va?bc[va.getAssociateName()]?Y.push(ka):(ka.resetProperty(ad,null),ka.isEmpty()||Y.push(ka),va=ka.getBaseFieldProp(),pa[va.getAssociateName()]=ka):(va=ka.getBaseFieldProp(),pa[va.getAssociateName()]=ka,Y.push(ka))}for(sa=0;sa<zc.length;sa++)Zc=zc[sa],(ka=pa[Zc.getAssociateName()])?ka.resetProperty(ad,Zc):(ka=new cb,ka.init(jd.getChildren().length),
ka.setProperty(ad,Zc,!0),Y.push(ka));ob.setProperties(kc)}}})},na=function(ra,db,Ma,Na,sa){var ob=0<db.length||0<Ma.length;yb(ra,db);Mb(ra,Na);mb(ra,Ma,sa);ob&&(Aa.removeEmptyChildRow(),Aa.recalcRowNum(new Ac(0)),ia.refreshData());ia.selectFirstRow()};this.getBizUnionEntityMergeCtx=function(){return ma};var ib=function(ra){if(KTSelectionModel.CHANGE_ADD==ra){ra=ia.getInnerTable();var db=ra.getSelectionModel().getSelected().getRowIdx();ra=ra.getRow(db).getUserObject();qb&&qb(ra)}},Xa=function(ra){var db=
new Gc,Ma=Aa.getEntityCellNode(ra),Na=Ma.getEntity(),sa=Ma.getEndEntityNodeInTree();sa&&sa.getEntity()!=Na&&(Na=Ua.get("checkInnerRelation","\u67e5\u770b\u5185\u90e8\u5173\u7cfb")+"...",Na=Bc.createActionMenuItem(Na,Xb),Na.setIconName("relation"),Na.setUserObject(Ma),db.addItemModel(Na));Ma=Ua.get("selectEntityAndField","\u9009\u62e9\u6570\u636e\u8868\u53ca\u5b57\u6bb5")+"...";Na=Bc.createActionMenuItem(Ma,Ab);Na.setIconName("btn_edit");Ma=Aa.getEntityCellNode(ra);Na.setUserObject(Ma);db.addItemModel(Na);
0<ra&&(Ma=Ua.get("deleteEntity","\u5220\u9664"),Na=Bc.createActionMenuItem(Ma,Rb),Na.setIconName("delete"),Ma=Aa.getEntityCellNode(ra),Na.setUserObject(Ma),db.addItemModel(Na));return db},Rb=function(ra){var db=ra.getUserObject().getEntity().getUnionLocation();Aa.deepVisitRow(function(Ma){var Na=Ma.getEntityCellNode(db),sa=Na.getEntity();sa&&(Na.setEntity(null,!0),lb.removeRelation(sa));Ma.removeEntityCell(db)});Aa.removeEmptyChildRow();ia.refreshData();ia.selectFirstRow()},Xb=function(ra){ra=ra.getUserObject();
var db=ra.getEntity(),Ma=[];ra.collectEntity(Ma);var Na=new ld;Na.addEntities(Ma);lb.getRelations().forEach(function(sa){Na.addRelation(sa)});wa&&wa(Na,db,Oa)},ac=function(ra,db){var Ma=$(ra.currentTarget);if((ra=Ma.data("menu"))&&ra.isShowing())Ma.data("menu",null),ra.hide();else{ra=new Bc;ra.setModel(Xa(db));ra.setIconSetter(function(sa,ob){Va.background(sa,ob)});ra.setHideListener(function(){Ma.data("menu",null)});Ma.data("menu",ra);db=Ma.outerHeight();var Na=[0,db];Na=qa.upwardCoordinate(Ma[0],
Na,La[0]);ra.show(La,Na[0],Na[1],Ma,!0,[0,-db])}},gc=function(ra,db){var Ma=ra.getCurrentUnionEntity(),Na=Ma.indexOfEntity(db),sa=ra.getPropMapModels();sa||(sa=ma.getEntityCompareModel(Ma.getName()),sa=new Ec(Ma,sa),sa.setEntityMergeCtx(ma),sa=sa.loadPropertyMapModels());var ob=[],nb=[];sa.forEach(function(vb){vb.deleteProperty(Na);vb.isEmpty()||(ob.push(vb),nb.push(vb.getBaseFieldProp()))});ra.setPropertyMapModels(ob);Ma.removeChild(db);Ma.setProperties(nb)},Tc=function(ra,db){var Ma=ra.getCurrentUnionEntity();
if(Ma){var Na=ma.getEntityCompareModel(Ma.getName()),sa=new Ec(Ma,Na);sa.setEntityMergeCtx(ma);Na=ra.getPropMapModels();Na||(Na=sa.loadPropertyMapModels(),ra.setPropertyMapModels(Na));ra=Gb(Ma,db);for(var ob=ma.getEntityUnitPropAssociateNameMap(db.getName()),nb={},vb=0;vb<Na.length;vb++){var bc=Na[vb];bc.spliceNewLocation(ra);var kc=bc.getBaseFieldProp().getAssociateName();if(kc=ob[kc])bc.resetProperty(ra,kc),nb[kc.getName()]=kc,sa.setPropMapRowStatus(bc)}Ma=Ma.getChildren().length;db=db.getProperties();
for(vb=0;vb<db.length;vb++)sa=db[vb],nb[sa.getName()]||(bc=new cb,bc.init(Ma),bc.setProperty(ra,sa,!0),Na.push(bc))}else{Na=new Pc(db,null);Na.setEntityMergeCtx(ma);Na=Na.createPropRelationMapData();ra.setPropertyMapModels(Na);nb=new Dc;nb.setName(db.getName());nb.setAssociateName(db.getName());nb.getChildren().push(db);var zc=[];Na.forEach(function(Zc){zc.push(Zc.getBaseFieldProp())});nb.setProperties(zc);ra.setCurrentUnionEntity(nb)}},Ra=function(ra,db,Ma,Na){Ma&&!Na?gc(ra,Ma):!Ma&&Na&&Tc(ra,Na)};
this.getRemovedUnionEntity=function(){return Ya};var Gb=function(ra,db){for(var Ma=ra.getChildren(),Na=[],sa=-1,ob=0;ob<Ma.length;ob++)if(Ma[ob].getUnionLocation()<db.getUnionLocation())Na.push(Ma[ob]);else{sa=ob;Na.push(db);break}if(0<=sa&&sa<Ma.length)for(ob=sa;ob<Ma.length;ob++)Na.push(Ma[ob]);-1==sa&&(Na.push(db),sa=Na.length-1);ra.resetEntityChildren(Na);return sa};this.getJqUi=function(){if(!xa){xa=$("<div>");xa.addClass("dm-biz-entity-merge-table-container");ma=new rb;ma.initForModifyMerge(T,
aa,Ia);Aa=Sa();ia=new Cb;ia.setBizEntityMergeCtx(ma);ia.setEntityMergeModel(Aa);ia.setTableSelectChangeHandler(ib);ia.setHeadCellPainter(zb);ia.initMergeTable();var ra=$(ia.getInnerTable().getUI());ra.addClass("dm-entity-merge-table");ra.appendTo(xa)}return xa};var Ta=function(ra){(ra=ra.getOriginalUnionEntity())&&Ya.push(ra)},Sa=function(){var ra=ma.getArrSourceEntity(),db=ra[0].getChildren().length,Ma=null,Na=new J(db,0);Na.setEntityMergeChangeListener(Ra);Na.setRowNum(0);Na.initCellNode();var sa=
ra[0];Ma=sa.getChildren();for(var ob=0;ob<Ma.length;ob++)Na.getEntityCellNode(ob).setEntity(Ma[ob]);Na.setOriginalUnionEntity(V.getEntityByName(sa.getName()));Na.setCurrentUnionEntity(sa);Na.setRowRemoveListener(Ta);for(ob=1;ob<ra.length;ob++){var nb=ra[ob];Ma=nb.getChildren();sa=Ma[0].getParentEntity();if(sa=Na.deepFindRowByEntity(Ma[0].getUnionLocation(),sa)){var vb=new J(db,sa.getRowLevel()+1);vb.setParentRowModel(sa);vb.setRowNum(ob);vb.setEntityMergeChangeListener(Ra);vb.setRowRemoveListener(Ta);
vb.initCellNode();sa.addChildrenRowModel(vb);vb.setOriginalUnionEntity(V.getEntityByName(nb.getName()));vb.setCurrentUnionEntity(nb);Ma.forEach(function(bc){var kc=bc.getUnionLocation();vb.getEntityCellNode(kc).setEntity(bc)});Ma=nb.getParentEntity().getName();nb=nb.getName();if(Ma=V.getRelationByEntitiesName(Ma,nb))sa.setRelationFromProp(Ma.getFromProperty()),vb.setRelationToProp(Ma.getToProperty())}}return Na};this.selectRow=function(ra){ia.getInnerTable().getSelectionModel().setSelected(new KTSelectionModel.Target(ra,
0,0,Aa.getColSize()-1))};this.refresh=function(){ia.getInnerTable().updateUI()}}function xc(aa){tc.call(this,aa);var La=this.protectedMethod,T=this,V,ia,ma,wa,xa;this.setEntityMergeModel=function(qb){ma=qb;ia=qb.getPropMapModels()};this.setBizUnionEntityMergeCtx=function(qb){V=qb};this.setFieldSelectChangeListener=function(qb){xa=qb};this.protectedGetPropMapLoader=function(){var qb=new Ec(T.getUnionEntity(),T.getCompareModel());qb.setEntityMergeCtx(V);qb.setPropMapRelationDataRows(ia);return qb};
this.protectedCreateHeadRow=function(qb,Ya){qb=Hc.createHeadRow(qb);for(var zb=0;zb<Ya.length;zb++)qb.getCell(zb).setValue(Ya[zb].getName())};var Aa=function(qb){qb=(aa-100)/qb;return 230>qb?230:qb};this.protectedGetCellValue=function(qb){return qb?qb.getTreeType()==l.TREE_TYPE_FLEX?qb.getAlias()+"("+Ua.get("flexField","\u5f39\u6027\u57df")+")":qb.isEnum()?qb.getAlias()+"("+Ua.get("enumField","\u679a\u4e3e\u5b57\u6bb5")+")":qb.getAlias():""};var Oa=function(qb){var Ya=[];Ya.push(null);qb.getProperties().forEach(function(zb){var Ab=
qb.getName();Ab=zb.getName()==sc.CUSTOM_BIZ_ENTITY_NAME_FIELD?!1:!V.isRelationProperty(Ab,zb,rb.UNION_ENTITY_UNIT);Ab&&Ya.push(zb)});return Ya},Ia=function(qb){ma.getUnionChangeState().setPropCheckChanged(qb);xa&&xa(T.getSelectedFieldNum())};this.getSelectedFieldNum=function(){return wa?wa.getCheckCount()-1:0};this.protectedCreateColumnMetas=function(){var qb=T.getSubEntitys();if(0!=qb.length){var Ya=0,zb=[];wa=new Ub(Ia);zb.push(new Ha(Ya++,"",40,null,-1,new wb(wa),new Fb(wa)));zb.push(new Ha(Ya++,
qb[0].getAlias(),Aa(qb.length),qb[0],0,new bb));for(var Ab=1;Ab<qb.length;Ab++){var yb=new bb;yb.setItemModels(Oa(qb[Ab]));yb.setCustomItemPainter(lb);yb.setPropSelectChangedListener(function(Zb,mb){La.doFieldSelectChanged(Zb,mb);ma.getUnionChangeState().setPropMapChanged(!0);xa&&xa(T.getSelectedFieldNum())});zb.push(new Ha(Ya++,qb[Ab].getAlias(),Aa(qb.length),qb[Ab],Ab,yb))}return zb}};var lb=function(qb,Ya){Ya=T.protectedGetCellValue(Ya);qb.text(Ya);qb.attr("title",Ya)}}function Ub(aa){var La=[],
T,V=0;this.setFullCheckBox=function(ia){T=ia};this.cleanOnRefreshTable=function(){V=La.length=0};this.addSubCheckBox=function(ia){La.push(ia);ia.isChecked()?V++:T&&T.setChecked(!1)};this.isAllChecked=function(){return La.length==V};this.handleSubCheckBoxChanged=function(ia,ma){ma?V++:V--;ia=La.length==V;T.setChecked(ia);aa&&aa(!ia)};this.handleFullCheckChanged=function(ia){V=ia?La.length:0;for(var ma in La){var wa=La[ma],xa=wa.getUserObject();xa.isLocked()?!ia&&V++:(wa.setChecked(ia),xa.setSelected(ia))}aa&&
aa(!ia)};this.getCheckCount=function(){return V}}function tc(aa){function La(Ta){Ka.call(this);this.paintCell=function(Sa,ra,db,Ma){Sa=ra.getUserObject();ra=ra.getColIndex();Ma=$("<div>");Ma.text(Sa.getAlias());Ma.attr("title",Sa.getAlias());Ma.addClass("dm-multi-entity-column-head");$(db).append(Ma);if(Sa&&Sa.isErrorExist()){Ma=Sc.createWarning();Ma.addClass("dm-entity-list-item-notexist");var Na=ub.getDefaultErrorDesc(Sa);Ma.attr("title",Na);Ma.css("cursor","pointer");Ma.attr("data-columnIndex",
ra);$(db).append(Ma)}Ta||(Ma=$("<div>"),Va.background(Ma,"btn_delete"),Ma.attr("title",Ua.get("delete","\u5220\u9664")),Ma.addClass("dm-multi-entity-column-delete"),Ma.on("click",Gb),Ma.attr("data-columnIndex",ra),$(db).append(Ma));Sa.getSource().getUserSql&&(Ma=Sa.getSource().getUserSql(Sa.getName()),void 0!==Ma&&null!==Ma&&(Ma=$("<div>"),Va.background(Ma,"btn_edit"),Ma.attr("title",Ua.get("editSql","\u7f16\u8f91")),Ma.addClass(Ta?"dm-multi-entity-column-delete":"dm-multi-entity-column-Edit"),Ma.on("click",
{oEntity:Sa},Tc),Ma.attr("data-columnIndex",ra),$(db).append(Ma)))}}function T(){yc.call(this);var Ta=this,Sa,ra,db;this.setIndex=function(Ma){db=Ma};this.setRefreshMergedTable=function(Ma){ra=Ma};this.setSelectEntity=function(Ma){Sa=Ma};this.getNextStep=function(Ma){var Na=new Jb;Na.setCtxApi(Ta.getCtxApi());Na.setSource(Ta.getSource());Na.setUserSqlModel(Ma);Na.setSelectEntity(Sa);Na.setRefreshMergedTable(ra);Na.setIndex(db);Na.setIsChangeSql(!0);Na.intoThisStep(Ta)};this.isLastStep=function(){return!0}}
var V=this,ia,ma,wa,xa=[],Aa,Oa=[],Ia=[],lb,qb,Ya,zb=[],Ab=!0,yb,Zb;this.setCreateNewMergeModifiedEntity=function(Ta){Ya=Ta};this.setGlobalDependence=function(Ta){qb=Ta};this.setFieldSelectChangeListener=function(Ta){Zb=Ta};this.refreshTable=function(){Hc.refresh(wa)};this.setUnionEntityCompareModel=function(Ta){lb=Ta};this.setUnionEntity=function(Ta){ma=Ta;Ta.getUnionType();Ia=[];ma.getChildren().forEach(function(Sa){Ia.push(Sa);if(Ab){var ra=new Qc;ra.setEntity(Sa);zb.push(ra)}});Ab=!1};this.getArrEntitySource=
function(){return zb};this.getUnionEntity=function(){return ma};this.getCompareModel=function(){return lb};this.getSubEntitys=function(){return Ia};this.getPropertyMapModels=function(){return xa};this.getJqUi=function(){if(!ia){ia=$("<div>");ia.addClass("dm-union-entity-prop-map-container");wa=Hc.createTable();wa.setSyncUIWhenModelChanged(!1);Hc.bindTableListenerForCtrl(wa);var Ta=$(wa.getUI());Ta.addClass("dm-entity-fieldtable");Ta.appendTo(ia)}return ia};this.protectedGetPropMapLoader=function(){return new bd(ma,
lb)};this.loadData=function(){Hc.clear(wa);Oa=V.protectedCreateColumnMetas();Aa=new $b(wa);Aa.setColumnMetas(Oa);Aa.setOutsideVisible(!0);wa.setCellRender(Aa);ib();V.protectedCreateHeadRow(wa,Oa);xa=V.protectedGetPropMapLoader().loadPropertyMapModels();Xa();V.refreshTable()};this.checkRelation=function(){for(var Ta=0;Ta<xa.length;Ta++){var Sa=xa[Ta].getPrompt();if(Sa&&""!=Sa)return!1}return!0};this.protectedCreateHeadRow=function(Ta,Sa){Hc.createHeadRow(Ta)};var mb=function(){var Ta=(aa-110)/Ia.length;
return 200>Ta?200:Ta};this.protectedCreateColumnMetas=function(){if(0!=Ia.length){var Ta=0,Sa=[];yb=new Ub(na);Sa.push(new Ha(Ta++,"",40,null,-1,new wb(yb),new Fb(yb)));for(var ra=0;ra<Ia.length;ra++){var db=Ia[ra],Ma=new bb;Ma.setItemModels(ac(db));Ma.setCustomItemPainter(gc);Ma.setPropSelectChangedListener(function(Na,sa){Xb(Na,sa);Mb()});db=new La(0==ra);Sa.push(new Ha(Ta++,Ia[ra].getAlias(),mb(),Ia[ra],ra,Ma,db))}return Sa}};var Mb=function(){Zb&&Zb(V.getSelectedFieldNum())};this.getSelectedFieldNum=
function(){return yb?yb.getCheckCount():0};var na=function(Ta){Mb()},ib=function(){wa.addColumns(Oa.length);for(var Ta=0;Ta<Oa.length;Ta++)wa.getColumn(Ta).setWidth(Oa[Ta].getWidth())},Xa=function(){for(var Ta=0;Ta<xa.length;Ta++){var Sa=Hc.createRow(wa);Sa.setUserObject(xa[Ta]);V.setRowCellValue(xa[Ta],Sa)}};this.protectedGetCellValue=function(Ta){return Ta?Ta.getAlias():""};this.setRowCellValue=function(Ta,Sa){Sa.getCell(0).setValue(Ta.isSelected());for(var ra=1;ra<=Ta.getPropCellSize();ra++){var db=
Ta.getFieldPropByIndex(ra-1);Sa.getCell(ra).setValue(V.protectedGetCellValue(db))}};var Rb=function(Ta){var Sa=Ta.getPropCells(),ra=Ta.findFirstNotNullPropCell();if(ra){var db=ra.getProperty(),Ma;for(Ma in Sa){var Na=Sa[Ma];Na.setError(null);var sa=Na.getProperty();if(sa&&sa!=db)if(sa.getTreeType()!=db.getTreeType()){var ob=db;ob=-1!=ob.getTreeType()?ob:-1!=sa.getTreeType()?sa:void 0;switch(ob.getTreeType()){case 0:var nb=Ua.get("flexFieldInConsistent",'\u6570\u636e\u8868"#1"\u4e2d\u7684"#2"\u5b57\u6bb5\u4e3a\u5f39\u6027\u57df\u5b57\u6bb5\uff0c\u5f39\u6027\u57df\u53ea\u80fd\u4e0e\u5f39\u6027\u57df\u5b57\u6bb5\u5408\u5e76\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9');
break;case 1:nb=Ua.get("customFieldInConsistent",'\u6570\u636e\u8868"#1"\u4e2d\u7684"#2"\u5b57\u6bb5\u4e3a\u81ea\u5b9a\u4e49\u5b57\u6bb5\uff0c\u81ea\u5b9a\u4e49\u53ea\u80fd\u4e0e\u81ea\u5b9a\u4e49\u5b57\u6bb5\u5408\u5e76\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9')}Na=ob==db?ra.getIndex():Na.getIndex();nb=nb.replace("#1",Ia[Na].getAlias());nb=nb.replace("#2",ob.getAlias());Ta.setPrompt(Ma,new Jc(!1,nb))}else Db.isPropEnumValueConsistent(sa,db)?Db.isDataTypeConvertable(sa.getOutputDataType(),db.getOutputDataType())||
(nb=q.buildDataTypeInConsistantPrompt(sa,db),Ta.setPrompt(Ma,new Jc(!0,nb))):(nb=Ua.get("enumFieldInConsistent","\u5efa\u7acb\u6620\u5c04\u7684\u679a\u4e3e\u5b57\u6bb5\uff0c\u5176\u4e2d\u6bcf\u4e2a\u5b57\u6bb5\u679a\u4e3e\u503c\u5fc5\u987b\u5b8c\u5168\u4e00\u81f4\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9"),Ta.setPrompt(Ma,new Jc(!1,nb)))}}},Xb=function(Ta,Sa){if(Sa){Sa=Ta.getJqUi().attr("data-colIndex")-1;var ra=Ta.getSelectedModel(),db=Ta.getUserObject();Ta=db.getPropCell(Sa).getProperty();if(!Ta||!ra||
Ta.getName()!=ra.getName()){var Ma;if(ra)a:{for(Ma=0;Ma<xa.length;Ma++){var Na=xa[Ma];if((Na=Na.getFieldPropByIndex(Sa))&&Na.getName()==ra.getName())break a}Ma=-1}else Ma=-1;-1!=Ma&&(Na=xa[Ma],Na.resetProperty(Sa,null),Na.isEmpty()?xa.splice(Ma,1):Rb(Na));db.resetProperty(Sa,ra);db.isEmpty()&&(ra=xa.indexOf(db),xa.splice(ra,1));Rb(db);Ta&&(ra=new cb,db=ma.getChildren().length,ra.init(db),ra.setProperty(Sa,Ta,!0),xa.push(ra));Hc.clearWithoutHead(wa);Xa();Hc.refresh(wa)}}},ac=function(Ta){var Sa=[];
Sa.push(null);Ta.getProperties().forEach(function(ra){Sa.push(ra)});lb.getUnSelectedProperty(Ta.getName()).forEach(function(ra){Sa.push(ra)});return Sa},gc=function(Ta,Sa){Sa=Sa?Sa.getAssociateName():"";Ta.text(Sa);Ta.attr("title",Sa)},Tc=function(Ta){var Sa=Ta.data.oEntity,ra=Sa.getSource().clone(),db=ra.getUserSql(Sa.getName());Ta=new T;Ta.setCtxApi({createFacade:qb.createFacade,isEntityNameExist:function(){},isEntityAliasExist:function(){}});Ta.setSource(ra);Ta.setUserSqlObj(db);Ta.setAlias(Sa.getAlias());
Ta.setRefreshMergedTable(Ra);db=[];var Ma=V.getSubEntitys();ra=null;for(var Na=0;Na<Ma.length;Na++)Ma[Na].getName()==Sa.getName()?ra=Na:db.push(Ma[Na].cloneMe());Sa=[];Ma=V.getPropertyMapModels();for(Na=0;Na<Ma.length;Na++){var sa=Ma[Na].cloneMe();sa.deleteProperty(ra);Rb(sa);Sa.push(sa)}Na=Sa.filter(function(nb){return!nb.isEmpty()});db=Ya(db,Na);Ta.setSelectEntity(db);Ta.setIndex(ra);ra=new fb;ra.setTitle(Ua.get("mergeDataSourceTitle","\u5408\u5e76\u6570\u636e\u8868"));ra.setSteps([Ta]);ra.show(960,
540);var ob=$(".sa-ctrl-wizard-prev");ob.css("cursor","pointer");ob.on("mouseenter",function(){ob.css("background-color","#f7f7f7")});ob.on("mouseleave",function(){ob.css("background-color","")});ob.on("click",function(){ob.parent().parent().find(".sa-ctrl-dialog-close").click()});Ta=$(ob.children()[0]);Ta.text("\u53d6\u6d88");Ta.css("color","#666");Ta=$(".sa-ctrl-wizard-next");$(Ta.children()[0]).text("\u786e\u5b9a")},Ra=function(Ta,Sa,ra){ra=Ta.getChildren()[ra];for(var db=0;db<zb.length;db++){var Ma=
zb[db];if(Ma.getEntity().getName()==ra.getName()){Ma.setUserSql(ra.getSource().getUserSql(ra.getName()));break}}V.setUnionEntity(Ta);V.setUnionEntityCompareModel(Sa);V.loadData();Mb()},Gb=function(Ta){Ta=Ta.target.getAttribute("data-columnIndex")-1;for(var Sa=0;Sa<xa.length;Sa++)xa[Sa].deleteProperty(Ta),Rb(xa[Sa]);xa=xa.filter(function(ra){return!ra.isEmpty()});Ia.splice(Ta,1);Hc.clear(wa);Oa=V.protectedCreateColumnMetas();Aa.setColumnMetas(Oa);ib();V.protectedCreateHeadRow(wa,Oa);Xa();Hc.refresh(wa);
Mb()};this.protectedMethod={doFieldSelectChanged:Xb,getPropMapDataRows:function(){return xa}}}function Ka(){this.paintCell=function(aa,La,T,V){aa.defaultPaint(T,V)}}function Fb(aa){Ka.call(this);this.paintCell=function(T,V,ia,ma){T=new mc;T.setChecked(aa.isAllChecked());T.addCheckedListener(La);V=T.getJqUi();V.addClass("dm-merge-entity-fieldtable-checkbox");V.appendTo($(ia));aa.setFullCheckBox(T)};var La=function(T,V){V&&aa.handleFullCheckChanged(T.isChecked())}}function wb(aa){Ka.call(this);this.paintCell=
function(T,V,ia,ma){T.getCurrentRowIdx()==Hc.getHeadRowCount()&&aa&&aa.cleanOnRefreshTable();V=T.getCurrentRow().getUserObject();ma=T.getCell().getValue();T=new mc;T.setChecked(ma);T.setEnabled(!V.isLocked());T.setUserObject(V);T.addCheckedListener(La);V=T.getJqUi();V.addClass("dm-merge-entity-fieldtable-checkbox");V.appendTo($(ia));aa&&aa.addSubCheckBox(T)};var La=function(T,V){V&&(V=T.getUserObject(),V.setSelected(T.isChecked()),aa&&aa.handleSubCheckBoxChanged(V,T.isChecked()))}}function bb(){Ka.call(this);
var aa,La,T;this.setItemModels=function(ma){aa=ma};this.setPropSelectChangedListener=function(ma){T=ma};this.setCustomItemPainter=function(ma){La=ma};this.paintCell=function(ma,wa,xa,Aa){var Oa=wa.getEntityLocation();if(0==Oa)ma.defaultPaint(xa,Aa);else if(wa=ma.getCurrentRow().getUserObject(),Oa=wa.getPropCell(Oa),Oa.isSelectable()){var Ia=new X;Ia.setItemModel(aa);Ia.setListItemPainter(ia);Ia.setSearchListener(V);Ia.setShowFieldNameEnable(!1);Aa=ma.getCellWidth();var lb=ma.getCellHeight();Aa=Hc.createCtrlInCell($(xa),
Aa,lb,dc);Aa.setUserObject(wa);Aa.getJqUi().attr("data-colIndex",ma.getCurrentColIdx());(ma=Oa.getProperty())&&Aa.setSelectedModel(ma);Aa.setDropdownCreator(function(qb,Ya,zb){return Ia.createJqPopup(qb,Ya,zb)});Aa.addSelectionListener(T);Aa.setCustomPainter(function(qb,Ya){La&&La(Ya,qb)});if(ma=Oa.getError())wa=$("<div>"),wa.text("!"),wa.addClass("dm-mergetable-field-notmatch-prompt"),wa.attr("title",ma.getErrorDesc()),wa.appendTo($(xa))}else ma.defaultPaint(xa,Aa)};var V=function(ma,wa,xa,Aa,Oa){wa=
wa.trim().toLowerCase();var Ia=[],lb;wa||Ia.push(null);for(var qb=0;qb<ma.length;qb++)(lb=ma[qb])&&(lb=-1!=lb.getAlias().toLowerCase().indexOf(wa)?!0:!1)&&Ia.push(ma[qb]);xa.children().remove();if(0<Ia.length){for(qb=0;qb<Ia.length;qb++)Oa(Ia[qb],xa,Aa);Ia.length=0}else ma=new da,ma.setText(Ua.get("nothingSearched","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c")),ma.setEnabled(!1),ma.setAlign(da.ALIGN_CENTER),ma=ma.getJqUi(),ma.addClass("dm-field-popup-search-result"),ma.appendTo(xa)},ia=function(ma,
wa,xa){xa=$("<div>");xa.addClass("dm-field-popup-list-item");xa.data("model",ma);var Aa=$("<span>");Aa.addClass("dm-field-popup-list-item-text");La?La(Aa,ma):(ma=ma?ma.getAlias():"",Aa.text(ma),Aa.attr("title",ma));xa.append(Aa);wa.append(xa)}}function $b(aa){KTDefaultCellRender.call(this,aa);var La=this,T,V=this.paintCellUI;this.setColumnMetas=function(ia){T=ia};this.getTable=function(){return aa};this.defaultPaint=function(ia,ma){V(ia,ma);$(ia).css("cursor","default")};this.paintCellUI=function(ia,
ma){var wa=La.getCurrentRowIdx(),xa=La.getCurrentColIdx();wa<Hc.getHeadRowCount()?(V(ia,ma),1==wa&&(wa=T[xa],(xa=wa.getHeadCellPainter())&&xa.paintCell(La,wa,ia,ma))):(wa=T[xa],wa.getBodyCellPainter().paintCell(La,wa,ia,ma))}}function Hb(){ic.call(this);var aa=this;this.isLastStep=function(){return!1};this.over=function(){};this.getNewMergedEntity=function(){return aa.getCheckedCloneEntities()[0]}}function Tb(){ha.call(this);var aa=this,La;this.setSelectEntity=function(T){La=T};this.createNextTableSteps=
function(){var T=new oa;T.setCtxApi(aa.getCtxApi());T.setSource(aa.getSource());T.setSelectEntity(La);var V=new Hb;V.setCtxApi(aa.getCtxApi());V.setSource(aa.getSource());var ia=new Jb;ia.setCtxApi(aa.getCtxApi());ia.setSource(aa.getSource());ia.setSelectEntity(La);return[T,V,ia]}}function Za(){Fc.call(this);var aa=this,La;this.setSelectEntity=function(T){La=T};this.createNextTableSteps=function(){var T=aa.getSource(),V=aa.getCloneSource();aa.getSource().isTheSame(V)||(T=V);V=new oa;V.setCtxApi(aa.getCtxApi());
V.setSource(T);V.setSelectEntity(La);var ia=new Hb;ia.setCtxApi(aa.getCtxApi());ia.setSource(T);var ma=new Jb;ma.setCtxApi(aa.getCtxApi());ma.setSource(T);ma.setSelectEntity(La);return[V,ia,ma]}}function oa(){m.call(this);var aa=this,La=this.protectedMethod,T,V,ia;this.setSelectEntity=function(xa){T=xa};this.getSelectEntity=function(){return T};this.getSelectNode=function(){return ia};this.doCheckBox=function(xa){xa=xa.find(".dm-source-db-table-list-item-component").data("model");xa.isEnabled()&&
(xa.setChecked(!0),xa.isChecked()?(V&&V!=xa&&(wa(V,!1),V.setChecked(!1)),V=xa,ia=V.getJqUi().data("object"),ma(ia)):(ia=null,ma()),wa(xa,xa.isChecked()))};this.unCheckBox=function(xa){xa&&xa.data("model").setChecked(!1)};this.newTableItemComponent=function(xa){var Aa=new ea,Oa=Aa.getJqUi();Oa.attr("table-name-component",$a.encode(xa.getName()));Oa.addClass("dm-source-db-table-list-item-component");Oa.off();Oa.data("object",xa);Oa.data("model",Aa);return Aa};this.defaultSelectTableWhenInit=function(xa){ia=
xa;ma(xa)};var ma=function(xa){var Aa=[];null!=xa&&Aa.push(xa);aa.setArrSelectedDataObjectNode(Aa)},wa=function(xa,Aa){(xa=xa.getJqUi().find(".sa-ctrl-radiobutton-check_enabled"))&&(Aa?xa.addClass("dm-source-db-table-radioitem-checked"):xa.removeClass("dm-source-db-table-radioitem-checked"))};this.outThisStep=function(xa,Aa){xa?Aa(null):null==ia?(La.getMessageCurtain().showPrompt(Ua.get("selectOneTable","\u8bf7\u9009\u4e2d\u4e00\u4e2a\u6570\u636e\u8868\u3002")),Aa(aa)):(xa=aa.getDataObject(ia.getName()),
Aa(xa?null:aa))};this.getNewMergedEntity=function(){return aa.getDataObject(ia.getName()).getFisrtEntity()};this.isMultiSelectable=function(){return!1}}function Kb(){oa.call(this);var aa=this,La=this.protectedMethod;this.outThisStep=function(T,V){if(T)V(null);else if(T=aa.getSelectNode(),null==T)La.getMessageCurtain().showPrompt(Ua.get("selectOneTable","\u8bf7\u9009\u4e2d\u4e00\u4e2a\u6570\u636e\u8868\u3002")),V(aa);else{var ia=aa.getDataObject(T.getName()),ma=new hc;ma.setCtxApi(aa.getCtxApi());
ma.setSource(aa.getSource());ma.setSourceEntity(aa.getSelectEntity());ma.setSelectModeDisplayName(T?T.getDisplayName():null);V(ia?ma:aa)}}}function hc(){ic.call(this);var aa=this,La=this.protectedMethod,T,V,ia;this.setSourceEntity=function(Aa){T=Aa};this.setSelectModeDisplayName=function(Aa){};this.getNewMergedEntity=function(){for(var Aa=V.getName(),Oa=aa.getCheckedCloneEntities(),Ia=0;Ia<Oa.length;Ia++)if(Aa==Oa[Ia].getName())return Oa[Ia];return V};this.newTableItemComponent=function(Aa,Oa,Ia,
lb,qb){Ia=new ea;Ia.setUserObject(Oa);Oa=Ia.getJqUi();Oa.addClass("dm-source-db-table-entity-list-item-checkbox");Oa.data("model",Ia);Oa.off();0==Aa&&wa(Ia);qb.css("margin-left",25);lb.append(Oa);Oa.on("mousedown",ma)};var ma=function(Aa){Aa=$(Aa.currentTarget).data("model");var Oa=Aa.getUserObject().getAssociateName();La.selectTable(Oa);wa(Aa)};this.doSelectItem=function(Aa){Aa=Aa.parent();var Oa=Aa.find(".dm-source-db-table-entity-list-item-checkbox");Oa||(Aa=Aa.parent(),Oa=Aa.find(".dm-source-db-table-entity-list-item-checkbox"));
Aa=Oa.data("model");wa(Aa)};var wa=function(Aa){ia&&ia!=Aa&&(xa(ia,!1),ia.setChecked(!1));ia=Aa;xa(Aa,!0);Aa.setChecked(!0);V=Aa.getUserObject()},xa=function(Aa,Oa){(Aa=Aa.getJqUi().find(".sa-ctrl-radiobutton-check_enabled"))&&(Oa?Aa.addClass("dm-source-db-table-radioitem-checked"):Aa.removeClass("dm-source-db-table-radioitem-checked"))};this.protectedGetNextStep=function(){var Aa=new Jb;Aa.setCtxApi(aa.getCtxApi());Aa.setSource(aa.getSource());Aa.setSelectEntity(T);return Aa};this.isLastStep=function(){return!1};
this.over=function(Aa){}}function Lb(){S.call(this);var aa=this,La;this.setSelectEntity=function(T){La=T};this.createNextTableSteps=function(){var T=new oa;T.setCtxApi(aa.getCtxApi());T.setSource(aa.getSource());T.setSelectEntity(La);var V=new Hb;V.setCtxApi(aa.getCtxApi());V.setSource(aa.getSource());var ia=new Jb;ia.setCtxApi(aa.getCtxApi());ia.setSource(aa.getSource());ia.setSelectEntity(La);return[T,V,ia]};this.creatNextCustomSqlStep=function(){var T=new yc;T.setSqlType(B.SQLTYPE_SQL);T.setCtxApi(aa.getCtxApi());
T.setSource(aa.getSource());T.setSelectEntity(La);return T};this.creatNextCustomKSqlStep=function(){var T=new yc;T.setSqlType(B.SQLTYPE_KSQL);T.setCtxApi(aa.getCtxApi());T.setSource(aa.getSource());T.setSelectEntity(La);return T};this.creatNextStoredProcedureStep=function(){var T=new pb;T.setCtxApi(aa.getCtxApi());T.setSource(aa.getSource());T.setSelectEntity(La);return T}}function pb(){sb.call(this);var aa=this,La,T,V;this.setSelectEntity=function(wa){La=wa};this.isMultiSelectable=function(){return!1};
this.doCheckBox=function(wa){wa=wa.find(".dm-source-db-table-list-item-component").data("model");if(wa.isEnabled()){wa.setChecked(!0);var xa=wa.getJqUi().data("object");wa.isChecked()?ia(xa):ia();wa.isChecked()?(T&&T!=wa&&(ma(T,!1),T.setChecked(!1)),T=wa,V=T.getJqUi().data("object")):(T&&T==wa&&(T=null),V=null);ma(wa,wa.isChecked())}};this.newTableItemComponent=function(wa){var xa=new ea,Aa=xa.getJqUi();Aa.attr("table-name-component",$a.encode(wa.getName()));Aa.addClass("dm-source-db-table-list-item-component");
Aa.off();Aa.data("object",wa);Aa.data("model",xa);return xa};this.defaultSelectTableWhenInit=function(wa){V=wa;ia(wa)};this.getNewMergedEntity=function(){return aa.getDataObject(V.getName()).getFisrtEntity()};this.getNextStep=function(wa){var xa=new Hb;xa.setCtxApi(aa.getCtxApi());xa.setSource(aa.getSource());var Aa=new Jb;Aa.setCtxApi(aa.getCtxApi());Aa.setSource(aa.getSource());Aa.setStoredProcedureModels(wa);Aa.setSelectEntity(La);return[xa,Aa]};this.isLastStep=function(){return!1};var ia=function(wa){var xa=
[];null!=wa&&xa.push(wa);aa.setArrSelectedDataObjectNode(xa)},ma=function(wa,xa){(wa=wa.getJqUi().find(".sa-ctrl-radiobutton-check_enabled"))&&(xa?wa.addClass("dm-source-db-table-radioitem-checked"):wa.removeClass("dm-source-db-table-radioitem-checked"))}}function yc(){Ga.call(this);var aa=this,La;this.setSelectEntity=function(T){La=T};this.isLastStep=function(){return!1};this.getNewMergedEntity=function(){return aa.getArrEntity()[0]};this.getNextStep=function(T){var V=new Jb;V.setCtxApi(aa.getCtxApi());
V.setSource(aa.getSource());V.setUserSqlModel(T);V.setSelectEntity(La);return V};this.over=function(T){}}function Nb(){this.createBizUnionEntityNameField=function(){var V=new sc;V.setAppointedDataType(sc.DT_STRING);V.setDataType(sc.DT_STRING);V.setName(sc.CUSTOM_BIZ_ENTITY_NAME_FIELD);V.setAssociateName(sc.CUSTOM_BIZ_ENTITY_NAME_FIELD);V.setAlias(Ua.get("customBizEntityNameField","\u5b9e\u4f53\u540d\u79f0"));return V};this.isAllPropNotSelected=function(V){for(var ia=1;ia<V.length;ia++)if(V[ia].isSelected())return!1;
return!0};this.getSelectedFieldNum=function(V){for(var ia=0,ma=1;ma<V.length;ma++)V[ma].isSelected()&&ia++;return ia};this.rebuildInnerEntityProperty=function(V,ia,ma){V=V.getProperties();var wa={},xa=[];ia.getProperties().forEach(function(Aa){if(null==ma[Aa.getName()]){var Oa=Aa.getRelatedBaseProp()?Aa.getRelatedBaseProp():Aa.getName();wa[Oa]=Aa}});V.forEach(function(Aa){var Oa=wa[Aa.getName()];Oa&&(Oa.setRelatedBaseProp(Aa.getName()),xa.push(Oa))});return xa};this.mergeUnionTreeProp4NewEntityMerge=
function(V,ia){var ma=ia.getPropMapModels(),wa=ia.getEntityCellNode(1).getEntity(),xa=ia.getEntityCellNode(0).getEntity();ia=[];for(var Aa=0;Aa<ma.length;Aa++){var Oa=ma[Aa];Oa.isSelected()&&0<=Oa.getBaseFieldProp().getTreeType()&&ia.push(Oa)}ma=V.getChildren();Aa=[];if(wa&&xa)for(xa=0;xa<ia.length;xa++)Ia=ia[xa],Oa=Ia.getFieldPropByIndex(1),lb=Ia.getBaseFieldProp(),(Ia=V.getTreeRootProp(lb))?(Oa&&(Oa=wa.getTreeRootProp(Oa),Ia.mergeFrom(Oa)),Aa.push(Ia)):(Oa=aa(lb,ma))&&Aa.push(Oa);else for(xa=0;xa<
ia.length;xa++){var Ia=ia[xa],lb=Ia.getBaseFieldProp();(Ia=V.getTreeRootProp(lb))?Aa.push(Ia):(Oa=aa(lb,ma))&&Aa.push(Oa)}V.setTreeRootProps(Aa)};var aa=function(V,ia){for(var ma=[],wa=V.getName(),xa=0;xa<ia.length;xa++)for(var Aa=ia[xa].getTreeRootProps(),Oa=0;Oa<Aa.length;Oa++){var Ia=Aa[Oa];Ia.getRefProp().getRelatedBaseProp()==wa&&ma.push(Ia)}if(0<ma.length){V=ma[0].cloneMe(V);for(ia=1;ia<ma.length;ia++)V.mergeFrom(ma[ia]);return V}return null};this.setUnionEntityProperties=function(V,ia){for(var ma=
[],wa={},xa={},Aa=0;Aa<ia.length;Aa++){var Oa=ia[Aa];if(Oa.isSelected()){var Ia=Oa.getBaseFieldProp();void 0===Ia.getFormatString()&&sc.confirmDefaultFormatString(Ia);var lb=Ia.getName(),qb=La(wa,lb),Ya=La(xa,Ia.getAlias());Ia.setName(qb);Ia.setAlias(Ya);lb!=qb&&Oa.changeBasePropName(qb);wa[Ia.getName()]=Ia;xa[Ia.getAlias()]=Ia;ma.push(Ia)}}V.getProperties().forEach(function(zb){zb.isCalculatingField()&&ma.push(zb)});V.setProperties(ma)};var La=function(V,ia){if(V[ia]){for(var ma=1,wa=ia+"_"+ma;V[wa];)ma++,
wa=ia+"_"+ma;return wa}return ia};this.resetIndexAliasIfExist=function(V,ia){for(var ma=V.getAlias(),wa=1;ia[ma];)ma=V.getAlias()+"_"+wa,wa++;V.setAlias(ma)};this.resetIndexNameIfExist=function(V,ia){for(var ma=V.getName(),wa=1;ia[ma];)ma=V.getName()+"_"+wa,wa++;V.setName(ma)};this.convertEntityToUnion=function(V){var ia=new Dc;ia.setFilters(V.getFilters());ia.setName(V.getName());ia.setAlias(V.getAlias());ia.setDesign(V.getDesign());V.setUnionUnit(!0);V.setFilters([]);V.setDesign(null);ia.getChildren().push(V);
T(ia,V);return ia};var T=function(V,ia){var ma=[],wa=[];ia.getProperties().forEach(function(xa){xa.isCalculatingField()?wa.push(xa):ma.push(xa)});ia.setProperties(ma);V.setProperties(wa)};this.createSpecialCalcProp4Relation=function(V,ia){var ma=new sc,wa=Math.floor(999999*Math.random()+1);ma.setName("F"+((new Date).getTime()+wa));ma.setAssociateName(ma.getName());ma.setDataType(sc.DT_STRING);ma.setHide(!0);ma.setHideInDataModeling(!0);wa=Ua.get("customBizEntityNameField","\u5b9e\u4f53\u540d\u79f0");
V=V.getAlias()+"."+ia.getAlias();ma.setAlias(wa+"+"+V);ma.setFormula("["+sc.CUSTOM_BIZ_ENTITY_NAME_FIELD+"]+["+ia.getName()+"]");return ma}}function Ec(aa,La){bd.call(this,aa,La);var T=this.protectedMethod,V,ia;this.setPropMapRelationDataRows=function(ma){ia=ma};this.protectedGetCurrentMapData=function(){return ia};this.isNeedAppendUnSelectProperty=function(){return!1};this.setEntityMergeCtx=function(ma){V=ma};this.setPropMapRowStatus=function(ma){var wa=ma.getBaseFieldProp(),xa=ma.getPropCells();
if(wa.getName()==sc.CUSTOM_BIZ_ENTITY_NAME_FIELD)ma.setLocked(!0),xa.forEach(function(lb){lb.setSelectable(!1)});else for(wa=0;wa<xa.length;wa++){var Aa=xa[wa],Oa=Aa.getProperty();if(Oa){var Ia=T.getEntityUnitByIndex(Aa.getIndex());V.isRelationProperty(Ia.getName(),Oa,rb.UNION_ENTITY_UNIT)&&(ma.setLocked(!0),Aa.setSelectable(!1))}}}}function bd(aa,La){var T=this;this.protectedGetCurrentMapData=function(){return null};this.loadPropertyMapModels=function(){var ia=T.protectedGetCurrentMapData();if(ia)return ia;
ia=[];for(var ma=aa.getChildren(),wa=aa.getProperties(),xa=0;xa<wa.length;xa++){var Aa=wa[xa];if(!Aa.isCalculatingField()){var Oa=Aa.getName(),Ia=new cb;Ia.init(ma.length);for(var lb=!1,qb=0;qb<ma.length;qb++){var Ya=ma[qb].getName();Ya=La.getEntityRelatedPropMap(Ya)[Oa];Ia.setProperty(qb,Ya,!1);lb=lb||null!=Ya}lb&&(Ia.setUnionBaseProp(Aa),Ia.setSelected(!0),T.setPropMapRowStatus(Ia),ia.push(Ia))}}T.isNeedAppendUnSelectProperty()&&V(ia);return ia};this.isNeedAppendUnSelectProperty=function(){return!0};
var V=function(ia){for(var ma=aa.getChildren(),wa=[],xa=0,Aa=0;Aa<ma.length;Aa++){var Oa=La.getUnSelectedProperty(ma[Aa].getName());Oa&&0!=Oa.length&&Oa.forEach(function(Ia){var lb;a:{for(lb=0;lb<wa.length;lb++){var qb=wa[lb];if(qb.getBaseFieldProp().getName()==Ia.getName()){lb=qb;break a}}lb=null}lb?(Ia.setRelatedBaseProp(lb.getBaseFieldProp().getName()),lb.setProperty(xa,Ia,!1)):(lb=new cb,qb=Ia.cloneMe(),lb.init(ma.length),lb.setSelected(!1),lb.setUnionBaseProp(qb),lb.setProperty(xa,Ia,!1),wa.push(lb));
qb=lb.getBaseFieldProp();if(qb!=Ia){var Ya=Ia.getOutputDataType();Db.isDataTypeConvertable(Ya,qb.getOutputDataType())||(Ia=q.buildDataTypeInConsistantPrompt(Ia,qb),lb.setPrompt(Aa,new Jc(!0,Ia)))}});xa++}wa.forEach(function(Ia){ia.push(Ia)})};this.setPropMapRowStatus=function(ia){};this.protectedMethod={getEntityUnitByIndex:function(ia){return aa.getChildren()[ia]}}}function Uc(aa,La){var T;this.setEntityCompareModel=function(Oa){T=Oa};var V=function(Oa){for(var Ia={},lb=0;lb<Oa.length;lb++)Ia[Oa[lb].getAssociateName()]=
Oa[lb];return Ia};this.createPropRelationMapData=function(){var Oa=[];ia(Oa);xa(Oa);Aa(Oa);return Oa};var ia=function(Oa){for(var Ia=ma(),lb=0;lb<Ia.length;lb++){var qb=new cb;qb.init(2);qb.setProperty(0,Ia[lb],!0);Oa.push(qb)}return Oa},ma=function(){var Oa=[];if(aa.isUnion())Oa=aa.getProperties();else{Oa=aa.getProperties().map(function(lb){return lb.cloneMe()});var Ia=aa.getColumnToRowProperties();Ia&&0<Ia.length&&(Oa=wa(Oa,Ia))}return Oa.filter(function(lb){return!lb.isCalculatingField()})},wa=
function(Oa,Ia){for(var lb in Ia){var qb=Ia[lb],Ya=qb.getUsedColumnToRowPropertyNames(),zb;for(zb in Ya)a:{var Ab=void 0,yb=Ya[zb],Zb=Oa;for(Ab in Zb)if(yb==Zb[Ab].getName()){Zb.splice(Ab,1);break a}}Oa.push(qb.getFieldNameProperty());Oa=Oa.concat(qb.getFieldValueProperties())}return Oa},xa=function(Oa){for(var Ia=V(La.getProperties()),lb=0;lb<Oa.length;lb++){var qb=Oa[lb];if(!qb.getFieldPropByIndex(1)){var Ya=qb.getBaseFieldProp(),zb=Ia[Ya.getAssociateName()];zb&&(Ia[Ya.getAssociateName()]=null,
qb.setProperty(1,zb,!1),zb.setRelatedBaseProp(Ya.getName()),Db.isDataTypeConvertable(zb.getOutputDataType(),Ya.getOutputDataType())||(Ya=q.buildDataTypeInConsistantPrompt(zb,Ya),qb.setPrompt(1,new Jc(!0,Ya))))}}},Aa=function(Oa){for(var Ia=La.getProperties(),lb=0;lb<Ia.length;lb++){var qb=Ia[lb];if(!qb.getRelatedBaseProp()){var Ya=new cb;Ya.init(2);Ya.setProperty(1,qb,!0);Oa.push(Ya)}}};this.protectedMethod={getEntityCompareModel:function(){return T},createSelectedRowItem:ia,getEntityByIndex:function(Oa){return 0==
Oa?aa:La},changePropListToMap:V,matchSameAssociateNameProperty:xa,createNewAddedProperty:Aa}}function Pc(aa,La){Uc.call(this,aa,La);var T=aa&&La?2:1,V=this.protectedMethod,ia,ma=new Nb;this.setEntityMergeCtx=function(wa){ia=wa};this.createPropRelationMapData=function(){var wa=[],xa=V.getEntityByIndex(0),Aa=V.getEntityByIndex(1);if(xa&&Aa){var Oa=V.changePropListToMap(Aa.getProperties()),Ia=xa.getProperties(),lb=Aa.getProperties(),qb=Ia.length,Ya=lb.length,zb=xa.isUnion();xa={};for(var Ab={},yb=0;yb<
qb;yb++){var Zb=new cb;Zb.init(2);var mb=Ia[yb];if(!mb.isCalculatingField()){if(zb)var Mb=mb;else Mb=mb.cloneMe(),mb.setRelatedBaseProp(Mb.getName());Zb.setUnionBaseProp(Mb);Zb.setProperty(0,mb);mb=Mb;var na=Oa,ib=Zb;if(mb.getName()==sc.CUSTOM_BIZ_ENTITY_NAME_FIELD)na=ma.createBizUnionEntityNameField(),na.setRelatedBaseProp(mb.getName()),ib.setProperty(1,na,!1),ib.setPropCellSelectable(1,!1),ib.setLocked(!0);else{var Xa=V.getEntityByIndex(1),Rb=V.getEntityByIndex(0);ia.isSourceEntityFromProperty(Rb.getName(),
mb)?((Xa=ia.findTargetEntityRelationFromProp(Xa.getName()))?(Xa.setRelatedBaseProp(mb.getName()),ib.setProperty(1,Xa,!1),ib.setPropCellSelectable(1,!1)):((na=na[mb.getAssociateName()])&&na.setRelatedBaseProp(mb.getName()),ib.setProperty(1,na,!1),ib.setPropCellSelectable(1,!0)),ib.setLocked(!0)):ia.isSourceEntityToProperty(Rb.getName(),mb)?(na=ia.findTargetEntityRelationToProperty(Xa.getName()),na.setRelatedBaseProp(mb.getName()),ib.setProperty(1,na,!1),ib.setPropCellSelectable(1,!1),ib.setLocked(!0)):
(na=na[mb.getAssociateName()])&&Db.isPropEnumValueConsistent(na,mb)?(mb.getTreeType()==na.getTreeType()&&(na.setRelatedBaseProp(mb.getName()),ib.setProperty(1,na,!1)),ia.isRelationProperty(Xa.getName(),na,rb.TARGET_ENTITY)?(ib.setPropCellSelectable(1,!1),ib.setLocked(!0)):(ib.setFieldSelectable(!0),ib.setLocked(!1))):(ib.setFieldSelectable(!0),ib.setLocked(!1))}wa.push(Zb);(mb=Zb.getFieldPropByIndex(1))?(delete Oa[mb.getAssociateName()],xa[mb.getName()]=mb):Ab[Mb.getAlias()]=Zb}}for(yb=0;yb<Ya;yb++)Oa=
lb[yb],xa[Oa.getName()]||(Zb=Ab[Oa.getAlias()])&&!Zb.isLocked()&&(Mb=Zb.getFieldPropByIndex(0),Db.isPropEnumValueConsistent(Mb,Oa)&&Mb.getTreeType()==Oa.getTreeType()&&(Oa.setRelatedBaseProp(Mb.getName()),Zb.setProperty(1,Oa,!1),delete Ab[Mb.getAlias()],xa[Oa.getName()]=Oa));for(yb=0;yb<Ya;yb++)Oa=lb[yb],xa[Oa.getName()]||(Zb=new cb,Zb.init(2),Mb=Oa.cloneMe(),Zb.setUnionBaseProp(Mb),Oa.setRelatedBaseProp(Mb.getName()),Zb.setProperty(1,Oa),ia.isRelationProperty(Aa.getName(),Oa,rb.TARGET_ENTITY)&&(Zb.setPropCellSelectable(1,
!1),Zb.setLocked(!0)),wa.push(Zb))}else for(Aa=xa?xa:Aa,lb=Aa.isUnion(),Ya=Aa.getProperties(),Oa=ia.isAppendNewEntity()?Aa==xa?rb.SOURCE_ENTITY:rb.TARGET_ENTITY:rb.UNION_ENTITY_UNIT,Ia=0;Ia<Ya.length;Ia++)qb=Ya[Ia],qb.isCalculatingField()||(xa=new cb,xa.init(1),lb?Ab=qb:(Ab=qb.cloneMe(),qb.setRelatedBaseProp(Ab.getName())),xa.setUnionBaseProp(Ab),xa.setProperty(0,qb),ia.isRelationProperty(Aa.getName(),qb,Oa)&&xa.setLocked(!0),qb.getName()==sc.CUSTOM_BIZ_ENTITY_NAME_FIELD&&xa.setLocked(!0),wa.push(xa));
if(0!=wa.length&&wa[0].getBaseFieldProp().getName()!=sc.CUSTOM_BIZ_ENTITY_NAME_FIELD){Aa=new cb;Aa.init(T);Aa.setUnionBaseProp(ma.createBizUnionEntityNameField());lb=ma.createBizUnionEntityNameField();lb.setRelatedBaseProp(sc.CUSTOM_BIZ_ENTITY_NAME_FIELD);Aa.setProperty(0,lb,!1);Aa.setLocked(!0);for(lb=1;lb<T;lb++)Ya=ma.createBizUnionEntityNameField(),Ya.setRelatedBaseProp(sc.CUSTOM_BIZ_ENTITY_NAME_FIELD),Aa.setProperty(lb,Ya,!1),Aa.setPropCellSelectable(lb,!1);wa.splice(0,0,Aa)}return wa}}function Wb(){cc.call(this);
var aa=this,La=this.protectedMethod,T,V,ia,ma;this.setEntityMergeModel=function(Ia){V=Ia};this.setBizEntityMergeCtx=function(Ia){T=Ia};this.setFieldSelectChangeListener=function(Ia){ma=Ia};var wa=function(Ia,lb){lb=xa(lb);Ia.text(lb);Ia.attr("title",lb)},xa=function(Ia){return Ia?Ia.getTreeType()==l.TREE_TYPE_FLEX?Ia.getAlias()+"("+Ua.get("flexField","\u5f39\u6027\u57df")+")":Ia.isEnum()?Ia.getAlias()+"("+Ua.get("enumField","\u679a\u4e3e\u5b57\u6bb5")+")":Ia.getAlias():""};this.protectedFillRowCellValue=
function(Ia,lb){var qb=La.getSourceEntity(),Ya=La.getNewMergeEntity();qb&&Ya?(qb=Ia.getFieldPropByIndex(0),Ya=Ia.getFieldPropByIndex(1),lb.getCell(0).setValue(Ia.isSelected()),lb.getCell(1).setValue(xa(qb)),lb.getCell(2).setValue(xa(Ya)),lb.getCell(3).setValue(Ia.getPrompt())):(qb=Ia.findFirstNotNullPropCell().getProperty(),lb.getCell(0).setValue(Ia.isSelected()),lb.getCell(1).setValue(xa(qb)))};var Aa=function(){var Ia=La.getNewMergeEntity();if(!Ia)return[];var lb=[];lb.push(null);Ia.getProperties().forEach(function(qb,
Ya,zb){Ya=qb.getName()==sc.CUSTOM_BIZ_ENTITY_NAME_FIELD?!1:(Ya=T.getTargetEntityRelationProps(La.getNewMergeEntity()))?Ya[0]!=qb&&Ya[1]!=qb:!0;Ya&&lb.push(qb)});return lb};this.protectedPrepareColMeta=function(){var Ia=La.getSourceEntity(),lb=La.getNewMergeEntity();ia=new Ub(Oa);if(Ia&&lb){var qb=[],Ya=new Ha(0,"",40,null,-1,new wb(ia),new Fb(ia));qb.push(Ya);Ya=new bb;Ya.setItemModels(Aa());Ya.setCustomItemPainter(wa);Ya.setPropSelectChangedListener(function(zb,Ab){La.getFieldSelectChangeHandler()(zb,
Ab);ma&&ma(aa.getSelectedFieldNum())});Ia=new Ha(1,Ia.getAlias(),225,Ia,0,Ya);qb.push(Ia);lb=new Ha(2,lb.getAlias(),225,lb,1,Ya);qb.push(lb)}else qb=[],lb=Ia?Ia:lb,Ya=new Ha(0,"",40,null,-1,new wb(ia),new Fb(ia)),qb.push(Ya),Ia=new bb,lb=new Ha(1,lb.getAlias(),560,lb,0,Ia),qb.push(lb);return qb};this.getSelectedFieldNum=function(){return ia?ia.getCheckCount()-1:0};var Oa=function(Ia){V.getUnionChangeState().setPropCheckChanged(Ia);ma&&ma(aa.getSelectedFieldNum())}}function cc(){var aa=this,La,T,V,
ia,ma,wa,xa,Aa,Oa;this.getJqUi=function(){if(!La){La=$("<div>");La.addClass("dm-union-entity-prop-map-container");T=Hc.createTable();T.setSyncUIWhenModelChanged(!1);Hc.bindTableListenerForCtrl(T);var Ab=$(T.getUI());Ab.addClass("dm-entity-fieldtable");Ab.appendTo(La)}return La};this.loadData=function(Ab,yb){V=Ab;ia=yb;xa=new Uc(V,ia);Ab=aa.protectedPrepareColMeta();Hc.clear(T);yb=new $b(T);yb.setColumnMetas(Ab);yb.setOutsideVisible(!0);T.setCellRender(yb);T.addColumns(Ab.length);for(yb=0;yb<Ab.length;yb++){var Zb=
Ab[yb],mb=Zb.getColIndex();T.getColumn(mb).setWidth(Zb.getWidth())}yb=Hc.createHeadRow(T);for(Zb=0;Zb<Ab.length;Zb++){mb=Ab[Zb];var Mb=mb.getColIndex();yb.getCell(Mb).setValue(mb.getName())}ma||(xa.setEntityCompareModel(wa),ma=xa.createPropRelationMapData());Ya()};var Ia=function(){if(!ia)return[];var Ab=[];Ab.push(null);ia.getProperties().forEach(function(yb,Zb,mb){Ab.push(yb)});return Ab},lb=function(Ab,yb){yb?yb.getAlias()?(Ab.text(yb.getAlias()),Ab.attr("title",yb.getAlias())):(Ab.text(yb.getAssociateName()),
Ab.attr("title",yb.getAssociateName())):(Ab.text(""),Ab.attr("title",""))};this.setFieldSelectChangeListener=function(Ab){Oa=Ab};this.protectedPrepareColMeta=function(){var Ab=[];Aa=new Ub(qb);var yb=new Ha(0,"",40,null,-1,new wb(Aa),new Fb(Aa));Ab.push(yb);yb=new bb;yb.setItemModels(Ia());yb.setCustomItemPainter(lb);yb.setPropSelectChangedListener(function(mb,Mb){zb(mb,Mb);Oa&&Oa(aa.getSelectedFieldNum())});var Zb=new Ha(1,V.getAlias(),400,V,0,yb);Ab.push(Zb);yb=new Ha(2,ia.getAlias(),400,ia,1,yb);
Ab.push(yb);return Ab};var qb=function(Ab){Oa&&Oa(aa.getSelectedFieldNum())};this.getSelectedFieldNum=function(){return Aa?Aa.getCheckCount():0};this.resize=function(){T.relayoutViews()};this.setBox=function(Ab){};this.setPropMappingHelper=function(Ab){xa=Ab};this.setPropertyRelationRows=function(Ab){ma=Ab};this.setEntityCompareModel=function(Ab){wa=Ab};this.getPropertyMapModels=function(){return ma};this.refresh=function(){T.updateUI()};this.protectedInitUi=function(){};this.protectedFillRowCellValue=
function(Ab,yb){var Zb=Ab.getFieldPropByIndex(0),mb=Ab.getFieldPropByIndex(1);yb.getCell(0).setValue(Ab.isSelected());yb.getCell(1).setValue(Zb?Zb.getAlias():"");yb.getCell(2).setValue(mb?mb.getAlias():"");yb.getCell(3).setValue(Ab.getPrompt())};var Ya=function(){for(var Ab=0;Ab<ma.length;Ab++){var yb=Hc.createRow(T),Zb=ma[Ab];yb.setUserObject(Zb);aa.protectedFillRowCellValue(Zb,yb)}Hc.refresh(T)},zb=function(Ab,yb){if(yb){yb=Ab.getSelectedModel();var Zb=Ab.getUserObject();Ab=Zb.getPropCell(1).getProperty();
if(!Ab||!yb||Ab.getName()!=yb.getName()){var mb;if(yb)b:{for(mb=0;mb<ma.length;mb++){var Mb=ma[mb].getFieldPropByIndex(1);if(yb==Mb)break b}mb=-1}else mb=-1;-1!=mb&&(Mb=ma[mb],Mb.setProperty(1,null,!1),Mb.setPrompt(1,null),Mb.isEmpty()&&ma.splice(mb,1));Zb.setProperty(1,yb,!1);Zb.isEmpty()?ma.splice(ma.indexOf(Zb),1):(mb=Zb.getBaseFieldProp(),Zb.setPrompt(1,null),mb&&yb&&(yb.setRelatedBaseProp(mb.getName()),Db.isPropEnumValueConsistent(yb,mb)?mb.getTreeType()!=yb.getTreeType()?(Mb=Ua.get("flexFieldInConsistent",
'\u6570\u636e\u8868"#1"\u4e2d\u7684"#2"\u5b57\u6bb5\u4e3a\u5f39\u6027\u57df\u5b57\u6bb5\uff0c\u5f39\u6027\u57df\u53ea\u80fd\u4e0e\u5f39\u6027\u57df\u5b57\u6bb5\u5408\u5e76\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9'),mb.getTreeType()==l.TREE_TYPE_FLEX?(Mb=Mb.replace("#1",V.getAlias()),Mb=Mb.replace("#2",mb.getAlias()),Zb.setPrompt(1,new Jc(!1,Mb))):yb.getTreeType()==l.TREE_TYPE_FLEX&&(Mb=Mb.replace("#1",ia.getAlias()),Mb=Mb.replace("#2",yb.getAlias()),Zb.setPrompt(1,new Jc(!1,Mb)))):(Mb=yb.getOutputDataType(),
Db.isDataTypeConvertable(Mb,mb.getOutputDataType())||(yb=q.buildDataTypeInConsistantPrompt(yb,mb),Zb.setPrompt(1,new Jc(!0,yb)))):(yb=Ua.get("enumFieldInConsistent","\u5efa\u7acb\u6620\u5c04\u7684\u679a\u4e3e\u5b57\u6bb5\uff0c\u5176\u4e2d\u6bcf\u4e2a\u5b57\u6bb5\u679a\u4e3e\u503c\u5fc5\u987b\u5b8c\u5168\u4e00\u81f4\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9"),Zb.setPrompt(1,new Jc(!1,yb)))));Ab&&(Ab.setRelatedBaseProp(null),yb=new cb,yb.init(2),yb.setProperty(1,Ab,!0),ma.push(yb));Hc.clearWithoutHead(T);
Ya()}}};this.protectedMethod={getSourceEntity:function(){return V},getNewMergeEntity:function(){return ia},getFieldSelectChangeHandler:function(){return zb}}}"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.data&&(com.kingdee.bos.qing.data={});var Ea=com.kingdee.bos.qing.data;Ea.PropertyMapTableModifyPane=
tc;Ea.DataSourceMergeFirstStep=function(){Eb.call(this);var aa=this,La;this.createNextDbConnectStep=function(T){var V=new Lb;V.setSource(T);V.setCtxApi(aa.getCtxApi());V.setSelectEntity(La);return V};this.createNextFileConnectStep=function(T){var V=new Tb;V.setSource(T);V.setCtxApi(aa.getCtxApi());V.setSelectEntity(La);V.setIsUsedForMerge(aa.isUsedForMerge());return V};this.createNextOpenAPIConnectStep=function(T){var V=new Za;V.setSource(T);V.setCtxApi(aa.getCtxApi());V.setSelectEntity(La);return V};
this.createNextSelectTableSteps=function(T){var V=new oa;V.setCtxApi(aa.getCtxApi());V.setSource(T);V.setSelectEntity(La);var ia=new Hb;ia.setCtxApi(aa.getCtxApi());ia.setSource(T);var ma=new Jb;ma.setCtxApi(aa.getCtxApi());ma.setSource(T);ma.setSelectEntity(La);return[V,ia,ma]};this.prepareStep=function(T){for(var V=0;V<T.length;V++)T[V].setCtxApi(aa.getCtxApi()),T[V].setSelectEntity(La)};this.setSelectEntity=function(T){La=T};this.isUsedForMerge=function(){return!0}};Ea.MergedTableModifyDialog=
function(){Wc.call(this);var aa=this,La=this.protectedMethod,T,V,ia,ma,wa,xa,Aa=0,Oa;this.setUnionEntityCompareModel=function(Ra){xa=Ra};this.setGlobalDependence=function(Ra){wa=Ra};this.setRelations=function(Ra){ma=Ra};this.setUnionEntity=function(Ra){V=Ra};this.setConfirmListener=function(Ra){ia=Ra};this.refresh=function(){T.refreshTable()};var Ia=function(){T=new tc(800);T.setUnionEntity(V);T.setUnionEntityCompareModel(xa);T.setGlobalDependence(wa);T.setCreateNewMergeModifiedEntity(yb);T.setFieldSelectChangeListener(function(Ra){lb(Ra)});
aa.setSize(800,480);La.setContentPaneCreator(function(){var Ra=T.getJqUi();Ra.children(".dm-entity-fieldtable").css("top","25px");Oa=$("<div>");Oa.addClass("dm-entity-field-match-label-title-field-num");Oa.css({left:"10px",top:"5px"});Oa.appendTo(Ra);T.loadData();var Gb=T.getSelectedFieldNum();lb(Gb);return Ra});La.setClosingAction(qb);La.setClosingChecker(Tc,!0)},lb=function(Ra){Aa=Ra;Ra=Ua.get("selectedFieldNum","\u5df2\u9009\u62e9#1\u4e2a\u5b57\u6bb5");Ra=Ra.replace("#1",Aa);Oa.text(Ra)};this.initUi=
function(){La.setTitle(Ua.get("modifyMergedTable","\u4fee\u6539\u5408\u5e76\u72b6\u6001"));Ia()};var qb=function(Ra){if(Ra){Ra=T.getArrEntitySource();var Gb=T.getSubEntitys(),Ta={},Sa;for(Sa in Ra){var ra=Ra[Sa].getEntity(),db=Ta[ra.getSource().getName()];null==db&&(db=[],Ta[ra.getSource().getName()]=db);db.push(ra.getSource())}for(Sa=0;Sa<Ra.length;Sa++)if(ra=Ra[Sa],null!=ra.getUserSql())for(var Ma=0;Ma<Gb.length;Ma++)if(db=ra.getEntity(),db.getName()==Gb[Ma].getName()){var Na=db.getSource();db=
Ta[Na.getName()];for(var sa in db)db[sa].addUserSql(ra.getUserSql());Gb[Ma].setSource(Na);break}Sa=T.getSubEntitys();Sa=1==Sa.length?Zb(Sa[0]):Rb();ib(Sa);ia(Sa,Ab(Sa))}else V&&V.getChildren()&&(Sa=V.getChildren(),0<Sa.length&&Mb(Sa[0],!0))},Ya=function(Ra){var Gb=[],Ta={};Ra.getProperties().forEach(function(Sa){Ta[Sa.getName()]=Sa});V.getProperties().forEach(function(Sa){Ta[Sa.getName()]||Gb.push(Sa)});return Gb},zb=function(Ra,Gb){for(var Ta=[],Sa=0;Sa<ma.length;Sa++){var ra=ma[Sa],db=Ra,Ma=Gb,
Na=ra.getFromEntity();ra=ra.getFromProperty();(db=Na.getName()==Ma&&ra.getName()==db.getName())||(ra=ma[Sa],db=Ra,Ma=Gb,Na=ra.getToEntity(),ra=ra.getToProperty(),db=Na.getName()==Ma&&ra.getName()==db.getName());db&&Ta.push(ma[Sa])}return Ta},Ab=function(Ra){var Gb=[];Ya(Ra).forEach(function(Ta){zb(Ta,Ra.getName()).forEach(function(Sa){Gb.push(Sa)})});return Gb},yb=function(Ra,Gb){Ra=Rb(Ra,Gb);ib(Ra);return Ra},Zb=function(Ra){Ra.setUnionUnit(!1);Ra.setDesign(V.getDesign());Ra.setParild(V.getParild());
Ra.setName(V.getName());Ra.setAlias(V.getAlias());Ra.setFilters(Xa());Ra.getProperties().forEach(function(Gb){Gb.setRelatedBaseProp("")});mb(Ra);Mb(Ra,!1);return Ra},mb=function(Ra){var Gb=T.getPropertyMapModels();Gb=gc(0,Gb);Ra.setProperties(Gb)},Mb=function(Ra,Gb){var Ta=Ra.getProperties();if((Ra=Ra.getColumnToRowProperties())&&0<Ra.length){var Sa={};Ta.forEach(function(ra){var db=ra.getRelatedBaseProp()?ra.getRelatedBaseProp():ra.getName();Sa[db]=ra});Xb(Sa,Ta,Ra,Gb)}},na=function(Ra){for(var Gb=
[],Ta=0;Ta<Ra.length;Ta++){var Sa=Ra[Ta];Sa.isSelected()&&Gb.push(Sa.getBaseFieldProp())}Ra={};for(Ta=0;Ta<Gb.length;Ta++){Sa=Gb[Ta];if(Ra[Sa.getName()]){for(var ra=1,db=Sa.getName()+"_"+ra;Ra[db];)ra++,db=Sa.getName()+"_"+ra;Sa.setName(db);Sa.setAlias(db)}Ra[Sa.getName()]=Sa}return Gb},ib=function(Ra){V.getProperties().forEach(function(Gb){Gb.isCalculatingField()&&Ra.getProperties().push(Gb)})},Xa=function(){return V.getFilters().filter(function(Ra,Gb,Ta){return null!=Ra.getProperty()&&null!=Ra.getProperty().getName()})},
Rb=function(Ra,Gb){Gb=void 0==Gb?T.getPropertyMapModels():Gb;var Ta=new Dc;Ta.setFilters(Xa());Ra=void 0==Ra?T.getSubEntitys():Ra;var Sa=na(Gb);Ta.setProperties(Sa);for(Sa=0;Sa<Ra.length;Sa++){var ra=Ra[Sa],db=ra.getProperties(),Ma=gc(Sa,Gb);ra.setProperties(Ma);if(0==Sa){var Na=ra.getColumnToRowProperties();if(Na&&0<Na.length){var sa={};db.forEach(function(ob){var nb=ob.getRelatedBaseProp()?ob.getRelatedBaseProp():ob.getName();sa[nb]=ob});Xb(sa,Ma,Na,!0)}}Ta.getChildren().push(ra)}Ta.setName(V.getName());
Ta.setAlias(V.getAlias());Ta.setParild(V.getParild());Ta.setDesign(V.getDesign());Ta.setColumnToRowProperties(V.getColumnToRowProperties());return Ta},Xb=function(Ra,Gb,Ta,Sa){for(var ra in Ta){var db=Ta[ra];if(db){var Ma=void 0,Na=Gb,sa=db,ob=Sa,nb=[],vb=sa.getFieldNameProperty();sa=sa.getFieldValueProperties();nb.push(vb);nb=nb.concat(sa);for(Ma in nb){sa=nb[Ma];vb=sa.getName();ob?sa.setRelatedBaseProp(vb):sa.setRelatedBaseProp("");for(var bc in Na)if(Na[bc].getName()==vb){Na.splice(bc,1);break}}ac(Ra,
Gb,db)}}},ac=function(Ra,Gb,Ta){var Sa={};Gb.forEach(function(Na){var sa=Na.getRelatedBaseProp()?Na.getRelatedBaseProp():Na.getName();Sa[sa]=Na});Ta=Ta.getUsedColumnToRowPropertyNames();for(var ra in Ta){var db=Ta[ra],Ma=Ra[db];Ma&&((db=Sa[db])&&db.setRelatedBaseProp(""),db||(Ma.setRelatedBaseProp(""),Gb.push(Ma)))}},gc=function(Ra,Gb){for(var Ta=[],Sa,ra,db=0;db<Gb.length;db++)if(ra=Gb[db],ra.isSelected()&&(Sa=ra.getFieldPropByIndex(Ra)))Ta.push(Sa),Sa.setRelatedBaseProp(ra.getBaseFieldProp().getName());
return Ta},Tc=function(Ra){for(var Gb=T.getPropertyMapModels(),Ta=!0,Sa=0;Sa<Gb.length;Sa++)Gb[Sa].isSelected()&&(Ta=!1);Ta?(La.getMessageCurtain().showPrompt(Ua.get("atLeastSelectAField","\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\u5b57\u6bb5\u3002")),Ra(!1)):Pb.checkFieldNum(Aa,La.getMessageCurtain(),Ra)}};Ea.MergeDBCenterConnectionStep=function(){p.call(this);var aa=this,La;this.setSelectEntity=function(T){La=T};this.createNextTableSteps=function(){var T=new oa;T.setCtxApi(aa.getCtxApi());T.setSource(aa.getSource());
T.setSelectEntity(La);var V=new Hb;V.setCtxApi(aa.getCtxApi());V.setSource(aa.getSource());var ia=new Jb;ia.setCtxApi(aa.getCtxApi());ia.setSource(aa.getSource());ia.setSelectEntity(La);return[T,V,ia]};this.creatNextCustomSqlStep=function(){var T=new yc;T.setSqlType(B.SQLTYPE_SQL);T.setCtxApi(aa.getCtxApi());T.setSource(aa.getSource());T.setSelectEntity(La);return T};this.creatNextCustomKSqlStep=function(){var T=new yc;T.setSqlType(B.SQLTYPE_KSQL);T.setCtxApi(aa.getCtxApi());T.setSource(aa.getSource());
T.setSelectEntity(La);return T};this.creatNextStoredProcedureStep=function(){var T=new pb;T.setCtxApi(aa.getCtxApi());T.setSource(aa.getSource());T.setSelectEntity(La);return T}};Ea.MergeSuperQueryStep=function(){nc.call(this);var aa=this,La;this.setSelectEntity=function(T){La=T};this.createNextTableSteps=function(){var T=new Kb;T.setCtxApi(aa.getCtxApi());T.setSource(aa.getSource());T.setSelectEntity(La);return T};this.creatNextCustomSqlStep=function(){var T=new yc;T.setSqlType(B.SQLTYPE_SQL);T.setCtxApi(aa.getCtxApi());
T.setSource(aa.getSource());T.setSelectEntity(La);return T}};Ea.BizEntityMergeEntranceStep=function(){oa.call(this);var aa=this,La=this.protectedMethod,T,V,ia,ma,wa,xa;this.setBox=function(Ya){xa=Ya};this.setRelationDialogOpener=function(Ya){ma=Ya};this.setGlobal=function(Ya){wa=Ya};var Aa=function(){return ma},Oa=function(){return wa};this.getSubTitle=function(){return Ua.get("selectBizEntity","\u9009\u62e9\u4e1a\u52a1\u5b9e\u4f53")};this.isScannable=function(){return!0};var Ia=function(){T=!0},
lb=function(){return T};this.setFacadeCreator=function(Ya){V=Ya};this.setFinishedCallback=function(Ya){ia=Ya};this.intoThisStep=function(Ya,zb){zb?aa.refreshPreviewTable():(aa.setCtxApi({createFacade:V,finish:ia,isFinished:lb,getBoxModel:qb,getGlobal:Oa,getOpenRelationDlgFun:Aa,refreshFinishFlag:Ia}),aa.loadLeftNodes())};var qb=function(){return xa};this.outThisStep=function(Ya,zb){if(Ya)zb(null);else if(Ya=aa.getSelectNode(),null==Ya)La.getMessageCurtain().showPrompt(Ua.get("selectOneTable","\u8bf7\u9009\u4e2d\u4e00\u4e2a\u6570\u636e\u8868\u3002")),
zb(aa);else{var Ab=aa.getDataObject(Ya.getName()),yb=new rc;yb.setCtxApi(aa.getCtxApi());yb.setSource(aa.getSource());yb.setSourceEntity(aa.getSelectEntity());yb.setSelectModeDisplayName(Ya?Ya.getDisplayName():null);zb(Ab?yb:aa)}}};Ea.BizUnionEntityModifyDialog=function(){Wc.call(this);var aa=this,La=this.protectedMethod,T,V,ia=new Nb,ma,wa=$("<div>"),xa,Aa,Oa,Ia,lb,qb,Ya,zb=0,Ab;this.setOpenInnerRelationDialog=function(sa){lb=sa};this.setGlobalDependence=function(sa){ma=sa};var yb=function(){xa=
$("<div>");var sa=new da;sa.setText(Ua.get("mergeEntity","\u5b9e\u4f53\u5408\u5e76"));sa.setEnabled(!1);sa=sa.getJqUi();sa.addClass("dm-entity-merge-label-title");xa.append(sa);T=new Cc(V,wa);T.setBox(Ia,Oa);T.setGlobal(ma);T.setDesigntimeObjDataMap(qb);T.setFunOpenRelationDialog(lb);T.setFunSelectChangeCallBack(mb);xa.append(T.getJqUi());T.refresh();Aa=$("<div>");Aa.addClass("dm-source-db-table-selection-center");sa=new da;sa.setText(Ua.get("setFieldRelation","\u5b57\u6bb5\u5339\u914d"));sa.setEnabled(!1);
sa=sa.getJqUi();sa.addClass("dm-entity-field-match-label-title");Aa.append(sa);Ab=$("<div>");Ab.addClass("dm-entity-field-match-label-title-field-num");Aa.append(Ab);Ya=new xc(560);Ya.setFieldSelectChangeListener(function(ob){Zb(ob)});sa=Ya.getJqUi();sa.addClass("dm-biz-entity-fieldmatch-table-container");Aa.append(sa);sa=new wc;sa.setHorizontalSplit(!0);sa.setEnabled(!1);sa.setFirstSize(360,200,450);sa.setSecondSize(560,-1,-1);sa.setResizeMode(wc.RESIZE_MODE_FIRST_FIXED);sa.setFirstChild(wc.createChildWrapper(xa));
sa.setSecondChild(wc.createChildWrapper(Aa));wa.append(sa.getJqUi())},Zb=function(sa){zb=sa;sa=Ua.get("selectedFieldNum","\u5df2\u9009\u62e9#1\u4e2a\u5b57\u6bb5");sa=sa.replace("#1",zb);Ab.text(sa)},mb=function(sa){Ya.setEntityMergeModel(sa);var ob=sa.getCurrentUnionEntity();Ya.setUnionEntity(ob);var nb=T.getBizUnionEntityMergeCtx();Ya.setBizUnionEntityMergeCtx(nb);ob=nb.getEntityCompareModel(ob.getName());Ya.setUnionEntityCompareModel(ob);Ya.loadData();sa.setPropertyMapModels(Ya.getPropertyMapModels());
sa=Ya.getSelectedFieldNum();Zb(sa)};this.refreshContent=function(){T.selectRow(0)};this.initUi=function(sa,ob,nb){Ia=ob;Oa=ob.cloneMe();V=Oa.getEntityByName(sa);qb=nb;La.setTitle(Ua.get("modifyMergedTable","\u4fee\u6539\u5408\u5e76\u72b6\u6001"));aa.setSize(960,540);La.setContentPaneCreator(function(){yb();return wa});La.setClosingAction(Ra);La.setClosingChecker(Mb,!0)};var Mb=function(sa){var ob=T.getRootEntityMergeRow(),nb=ob.getColSize(),vb=[];ob.makeFlat(vb);na(vb,0,nb,sa)},na=function(sa,ob,
nb,vb){if(ob>=sa.length)vb(!0);else{for(var bc=sa[ob],kc=0;kc<nb;kc++){var zc=bc.getEntityCellNode(kc).getErrorDesc();if(zc){La.getMessageCurtain().showPrompt(zc);vb(!1);return}}if(zc=bc.getPropMapModels()){for(var Zc in zc)if(kc=zc[Zc].getUnAcceptedError()){La.getMessageCurtain().showPrompt(kc.getErrorDesc());vb(!1);return}ia.isAllPropNotSelected(zc)?(zc=Ua.get("allPropNotSelectErrorCurtain",'\u6570\u636e\u8868"#1"\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b57\u6bb5\u3002'),bc=bc.getFirstNotEmptyNode().getEntity(),
bc=zc.replace("#1",bc.getAlias()),La.getMessageCurtain().showPrompt(bc),vb(!1)):(bc=ia.getSelectedFieldNum(zc),Pb.checkFieldNum(bc,La.getMessageCurtain(),function(jd){jd?na(sa,ob+1,nb,vb):vb(!1)}))}else na(sa,ob+1,nb,vb)}},ib=function(sa,ob){if((sa=sa.getFilters())&&0<sa.length){var nb={};ob.getProperties().forEach(function(zc){nb[zc.getName()]=zc});for(var vb in sa){var bc=sa[vb],kc=bc.getProperty();kc&&(kc=kc.getName(),(kc=nb[kc])&&bc.setProperty(kc))}ob.setFilters(sa)}},Xa=function(sa,ob){sa.getProperties().forEach(function(nb){nb.isCalculatingField()&&
!nb.isHideInDataModeling()&&ob.getProperties().push(nb)})},Rb=function(sa){for(var ob=sa.getCurrentUnionEntity(),nb=0;nb<sa.getColSize();nb++){var vb=sa.getEntityCellNode(nb).getEntity();vb&&ob.getEntityChild(vb.getName()).setUnionLocation(vb.getUnionLocation())}},Xb=function(sa,ob){T.getRootEntityMergeRow().deepVisitRow(function(nb){var vb=nb.getParentRowModel(),bc=nb.getOriginalUnionEntity(),kc=db(nb);bc?(sa.addEntityExchanger(bc,kc),ib(bc,kc),Xa(bc,kc)):ob.push(kc);bc=null!=nb.getParentRowModel();
if(0<nb.getChildrenRows().length){a:{var zc=T.getBizUnionEntityMergeCtx(),Zc=kc.getChildren();for(ad in Zc){var jd=zc.getEntityRelationProperties(Zc[ad].getName(),rb.UNION_ENTITY_UNIT)[0];if(jd){var ad=kc.findProperty(jd.getRelatedBaseProp());ad=ia.createSpecialCalcProp4Relation(kc,ad);break a}}ad=null}ad&&(kc.getProperties().push(ad),nb.setRelationFromProp(ad))}if(bc){a:{bc=T.getBizUnionEntityMergeCtx();ad=kc.getChildren();for(pa in ad)if(zc=bc.getEntityRelationProperties(ad[pa].getName(),rb.UNION_ENTITY_UNIT)[1]){var pa=
kc.findProperty(zc.getRelatedBaseProp());pa=ia.createSpecialCalcProp4Relation(kc,pa);break a}pa=null}pa&&(kc.getProperties().push(pa),nb.setRelationToProp(pa))}kc.setUnionType(Dc.BIZ_UNION);nb.setFinalUnionEntity(kc);vb&&kc.setParentEntity(vb.getFinalUnionEntity())})},ac=function(sa){sa=sa.getPropMapModels();var ob={};sa&&sa.forEach(function(nb){var vb=nb.findFirstNotNullPropCell();vb&&!nb.isSelected()&&(nb=vb.getProperty(),ob[nb.getName()]=nb)});return ob},gc=function(sa){var ob=T.getRemovedUnionEntity();
Sa(ob);ob=sa.getOriginalUnionEntity();var nb=T.getBizUnionInnerEntityRelations();nb=nb?nb.getRelations():[];sa.makeFlat([]);var vb=new Kc;sa.deepVisitRow(function(bc){var kc=ac(bc),zc=bc.getOriginalUnionEntity();bc=bc.getEntityCellNode(0).getEntity();var Zc={},jd=[];bc.getProperties().forEach(function(ad){ad.getName()==sc.CUSTOM_BIZ_ENTITY_NAME_FIELD||ad.isCalculatingField()&&ad.isHideInDataModeling()||kc[ad.getName()]||(ad.getRelatedBaseProp(),ad.setRelatedBaseProp(null),jd.push(ad),Zc[ad.getName()]=
ad)});zc&&(zc.getProperties().forEach(function(ad){ad.isCalculatingField()&&!ad.isHideInDataModeling()&&jd.push(ad)}),bc.setFilters(zc.getFilters()));bc.setProperties(jd,Zc);bc.setUnionUnit(!1);vb.addEntityExchanger(zc,bc)});Ia.replaceEntity(vb,!0);sa=vb.getNewAddedEntities();0<sa.length&&Ia.batchInsertEntity(sa);Ia.removeBizUnionInnerEntityRelations(ob.getName());nb.forEach(function(bc){Ia.addRelation(bc)})},Tc=function(){var sa=T.getBizUnionInnerEntityRelations();sa&&(0==sa.getRelations().length?
Ia.removeBizUnionInnerEntityRelations(sa.getRootUnionEntityName()):Ia.replaceOrAddUnionInnerEntityRelation(sa))},Ra=function(sa){if(sa){sa=T.getRootEntityMergeRow();var ob=!1;sa.deepVisitRow(function(bc){bc.isNeedRebuildUnion()&&(ob=!0)});if(ob){var nb=T.getBizUnionInnerEntityRelations().getRelations();if(Gb(nb))return sa=Ua.get("relationDiffTips1",'\u4e1a\u52a1\u5b9e\u4f53"#1"\u4e2d\uff0c \u5b58\u5728\u6570\u636e\u8868\u67092\u4e2a\u53ca\u4ee5\u4e0a\u5b57\u6bb5\u4e0e\u5176\u4ed6\u6570\u636e\u8868\u521b\u5efa\u5173\u7cfb\uff0c\u8bf7\u53d6\u6d88\u52fe\u9009\u4e0d\u6ee1\u8db3\u5408\u5e76\u6761\u4ef6\u7684\u6570\u636e\u8868\u3002').replace("#1",
sa.getOriginalUnionEntity().getAlias()),Ta(sa),"relationDiff";if(1==sa.getColSize())gc(sa);else{nb=[];var vb=T.getRemovedUnionEntity();Sa(vb);vb=new Kc;Xb(vb,nb);Ia.replaceEntity(vb,!1);0<nb.length&&Ia.batchInsertEntity(nb);Tc();ra();Ia.fireEntityRefresh(sa.getOriginalUnionEntity().getName())}}}},Gb=function(sa){for(var ob={},nb=!1,vb=0;vb<sa.length;vb++){var bc=sa[vb],kc=bc.getFromEntity().getName(),zc=bc.getFromProperty().getName();if(ob[kc]&&ob[kc]!=zc&&bc.isInnerRelation()){nb=!0;break}else ob[kc]=
zc}return nb},Ta=function(sa){var ob=com.kingdee.bos.qing.ui.component.MessageDialog,nb=ob.createFeedbackDialog();nb.setOptionType(ob.OPTION_OK);nb.setMsgImageType(ob.MSG_WARNING);nb.setButtonText(ob.OPTION_OK,Ua.get("iknow","\u6211\u77e5\u9053\u4e86"));nb.setMessage(sa);nb.setExtendPainter(function(vb,bc){var kc=$("<div class='sa-ctrl-feedback-dialog-text'>"),zc=$("<span>");zc.text(bc);zc.appendTo(kc);bc=$("<a onclick='javascript:window.open(\"https://q.kdcloud.com/support/index.html?version=1.0&docId=Tvqwnwaig\");' href='#'>");
bc.css({cursor:"pointer",color:"#5582f3"});bc.text(Ua.get("viewDocument","\u67e5\u770b\u5e2e\u52a9\u6587\u6863"));bc.appendTo(kc);kc.appendTo(vb)});nb.showDialog()},Sa=function(sa){sa.forEach(function(ob){Ia.removeEntityByName(ob.getName())})},ra=function(){var sa=T.getBizUnionEntityMergeCtx();T.getRootEntityMergeRow().deepVisitRow(function(ob){var nb=ob.getParentRowModel();if(nb){for(var vb=nb.getInnerRelationProps()[0],bc=ob.getInnerRelationProps()[1],kc,zc=0;zc<ob.getColSize();zc++){var Zc=ob.getEntityCellNode(zc).getEntity();
if(Zc&&(kc=sa.getInnerRelationByToEntityName(Zc.getName())))break}kc&&(kc=kc.clone(),kc.setFromEntity(nb.getFinalUnionEntity()),kc.setToEntity(ob.getFinalUnionEntity()),kc.setFromProperty(vb),kc.setToProperty(bc),nb=nb.getOriginalUnionEntity(),ob=ob.getOriginalUnionEntity(),nb&&ob&&Ia.removeInnerRelationByFromAndToEntityName(nb.getName(),ob.getName()),Ia.addRelation(kc))}})},db=function(sa){var ob=sa.getCurrentUnionEntity(),nb=sa.getPropMapModels();if(!nb){var vb=[];ob.getProperties().forEach(function(h){h.isCalculatingField()||
vb.push(h)});ob.setProperties(vb);return ob}var bc=ob.getChildren()[0];ob.setName(bc.getName());ob.setAlias(bc.getAlias());bc=[];var kc={},zc={},Zc=ob.getChildren(),jd=Zc.length;Zc.forEach(function(h,e){zc[e]=[]});for(var ad=[],pa=0;pa<nb.length;pa++){var Y=nb[pa];if(Y.isSelected()){var ka=Y.getBaseFieldProp();Na(ka,kc);kc[ka.getName()]=ka;bc.push(ka);for(var va=0;va<jd;va++){var Ba=Y.getFieldPropByIndex(va);Ba&&(Ba.setRelatedBaseProp(ka.getName()),zc[va].push(Ba))}Ma(ad,Y,Zc)}}for(pa=0;pa<jd;pa++)Zc[pa].setProperties(zc[pa]);
ob.setTreeRootProps(ad);ob.setProperties(bc);Rb(sa);return ob},Ma=function(sa,ob,nb){var vb=ob.getBaseFieldProp();if(0<=vb.getTreeType()){var bc=ob.findFirstNotNullPropCell();if(bc){var kc=nb[bc.getIndex()].getTreeRootProp(bc.getProperty());if(kc){vb=kc.cloneMe(vb);var zc=ob.getPropCellSize();for(bc=bc.getIndex()+1;bc<zc;bc++)(kc=ob.getPropCell(bc).getProperty())&&(kc=nb[bc].getTreeRootProp(kc))&&vb.mergeFrom(kc);sa.push(vb)}}}},Na=function(sa,ob){for(var nb=sa.getName(),vb=1,bc=!1,kc=-1;ob[nb];)nb=
sa.getName()+"_"+vb,kc=vb,vb++,bc=!0;bc&&(sa.setName(nb),sa.setAlias(sa.getAlias()+"_"+kc))}};Ea.DataFieldRelationSetStep=Jb;Ea.DbSelectTable4MergeStep=oa;Ea.DBMergeCustomSqlStep=yc;var qa,$a,Ua,fb,ea,da,L,mc,wc,Bc,Gc,Wc,dc,Hc,Sc,Dc=Ea.UnionEntity,cd=Ea.Entity,ld=Ea.Box,sc=Ea.Property,l=Ea.TreeProperty,B=Ea.DBSource,I=Ea.IconUtil,q=Ea.PropDataTypeUtil,G=Ea.Relation,R=Ea.BizUnionInnerEntityRelations,J=Ea.EntityMergeModel,M=Ea.EntityCellNode,cb=Ea.PropRelationMapModel,rb=Ea.BizEntityMergeCtx,Ja=Ea.SingleEntityCompareModel,
kb=Ea.UnionEntityCompareModel,Ac=Ea.RowNum,Jc=Ea.PropertyMapError,Qc=Ea.EntitySourceChangeSqlModel,ab=Ea.DesigntimeDataObject,ic=Ea.DbSelectFieldStep,Eb=Ea.SourceTypeStep,m=Ea.DbSelectTableStep,S=Ea.DbConnectionStep,ha=Ea.FileConnectionStep,Ga=Ea.DbCustomSqlStep,sb=Ea.DBStoredProcedureStep,p=Ea.MetaDBConnectionStep,nc=Ea.SuperQueryConnectionStep,jb=Ea.AbstractImportEntityStep,Fc=Ea.OpenAPIConnectionStep,kd=Ea.TableAndFieldSelectDialog,X=Ea.ChoosePropertyPane,Va=Ea.Icons,Ob;Ea.MergeEntityUtil=new function(){this.isDataTypeConvertable=
function(aa,La){switch(La){case sc.DT_STRING:return!0;case sc.DT_INT:case sc.DT_NUMBER:return aa==sc.DT_INT||aa==sc.DT_NUMBER;case sc.DT_DATE:case sc.DT_DATETIME:return aa==sc.DT_DATE||aa==sc.DT_DATETIME;case sc.DT_BOOLEAN:return aa==sc.DT_BOOLEAN}return!1};this.isPropEnumValueConsistent=function(aa,La){aa=aa.getEnumValue();La=La.getEnumValue();if(!aa&&!La)return!0;if(!aa&&La||aa&&!La||Object.keys(La).length!=Object.keys(aa).length)return!1;for(var T in La){var V=La[T],ia=aa[T];if(!ia||ia!=V)return!1}return!0}};
var Db=Ea.MergeEntityUtil,ub=Ea.EntityErrorStatesUtil,Pb=Ea.CheckFieldNumUtil;(function(){var aa=com.kingdee.bos.qing.common;qa=aa.DomUtil;$a=aa.Base32Util;aa=com.kingdee.bos.qing.framework.common;Ua=aa.MultilanguageManager.createPackageAccessor(Ea);Ob=aa.GlobalFont;aa=com.kingdee.bos.qing.ui.component;fb=aa.WizardDialog;ea=aa.RadioButton;da=aa.Label;L=aa.ComboBox;mc=aa.CheckBox;dc=aa.DropdownSelector;wc=aa.SplitPane;Bc=aa.Menu;Gc=aa.MenuModel;Wc=aa.AbstractModalDialog;aa=com.kingdee.bos.qing.common.ui;
Hc=aa.TableUtil;Sc=aa.CommonIconUtil})()})();(function(){function Ha(){var pa=!1,Y=!1;this.setError=function(ka){pa=ka};this.isError=function(){return pa};this.setTooModern=function(ka){Y=ka};this.isTooModern=function(){return Y}}function Jb(pa,Y){this.getMessageCurtain=function(){return Y.getGlobal().getMessageCurtain()};this.insertToolbarButton=function(ka,va,Ba,h){return pa.addButtonForHeadCustom(ka,va,Ba,h)};this.appendToolbarButton=function(ka,va,Ba,h){return pa.addButtonForTailCustom(ka,va,Ba,h)};this.insertToolbarSeperator=function(){pa.addSeperatorForHeadCustom()};
this.insertToolbarMenu=function(ka,va,Ba,h){return pa.addMenuButtonForHeadCustom(function(){return ka},va,Ba,h)};this.appendToolbarMenu=function(ka,va,Ba,h){return pa.addMenuButtonForTailCustom(function(){return ka},va,Ba,h)};this.setDirtyListener=function(ka){Y.hookDirtyListener(ka)};this.clearDirty=function(){Y.setDirty(!1)};this.isDirty=function(){return Y.isDirty()}}function jc(){var pa,Y=$("<div>"),ka=$("<div>"),va=$("<div>");this.getJqUi=function(){pa||(pa=$("<div>"),pa.addClass("dm-toolbar"),
Y.addClass("dm-toolbar-sub"),Y.appendTo(pa),ka.addClass("dm-toolbar-sub"),ka.appendTo(pa),va.addClass("dm-toolbar-sub"),va.appendTo(pa));return pa};this.addSeperator=function(){Ba(ka)};this.addSeperatorForHeadCustom=function(){Ba(Y)};this.addButton=function(b,f,c,d){return h(ka,!1,b,f,c,d)};this.addButtonForHeadCustom=function(b,f,c,d){return h(Y,!1,b,f,c,d)};this.addButtonForTailCustom=function(b,f,c,d){return h(va,!1,b,f,c,d)};this.addMenuButton=function(b,f,c,d){return h(ka,!0,b,f,c,d)};this.addMenuButtonForHeadCustom=
function(b,f,c,d){return h(Y,!0,b,f,c,d)};this.addMenuButtonForTailCustom=function(b,f,c,d){return h(va,!0,b,f,c,d)};var Ba=function(b){var f=$("<div>");f.addClass("dm-toolbar-seperator");f.appendTo(b)},h=function(b,f,c,d,g,k){var a=new Gc;a.setIconSetter(function(r,y){Xa.background(r,y)});a.setIconName(d);a.setText(g);a.setTooltips(null!=k?k:g);f&&a.setShowDropdownArrow(!0);a.addActionListener(function(r,y){f?e(r.getJqUi(),y,c,b):c(r)});a.getJqUi().appendTo(b);return a},e=function(b,f,c,d){var g=
b.data("menu");if(g&&g.isShowing())b.data("menu",null),g.hide();else{g=new Hc;g.setModel(c());g.setHideListener(function(){b.data("menu",null)});b.data("menu",g);c=null==d?ka:d;d=b.prop("offsetLeft");var k=b.prop("offsetHeight")+b.prop("offsetTop");g.show(c,d,k,f,!0)}}}function Cb(){Wc.AbstractTabPane.call(this);var pa=this,Y,ka,va,Ba;this.setTitle=function(h){Y=h};this.getTitle=function(){return Y};this.setGlobalDependence=function(h){ka=h};this.getGlobalDependence=function(){return ka};this.setDmModel=
function(h){va&&va.removeChangedListener(pa.protectedModelChanged);va=h;Ba&&pa.protectedUpdateUi(va);va&&va.addChangedListener(pa.protectedModelChanged)};this.getDmModel=function(){return va};this.getJqUi=function(){Ba||(Ba=$("<div>"),pa.protectedInit(Ba),va&&pa.protectedUpdateUi(va));return Ba};this.resize=function(){};this.protectedInit=function(h){throw Error("Override me.");};this.protectedUpdateUi=function(h){throw Error("Override me.");};this.protectedModelChanged=function(h,e){}}function oc(){function pa(Q){KTDefaultCellRender.call(this,
Q);var ta=this,ya,Qa,eb,Bb,Sb=this.paintCellUI;this.paintCellUI=function(vc,qc){if(ya==ta.getCurrentRowIdx()&&Qa==ta.getCurrentColIdx()){var uc=ta.getCurrentRow(),Rc=new KTStyle;Rc.setBackgroundColor(com.kingdee.bos.qing.common.CommonTableSkin.ODD_ROW_BACKGROUND_COLOR);uc.setStyle(Rc);Rc=new KTStyle;Rc.setTextAlign("left");uc.getCell(Qa).setStyle(Rc);vc.style.zIndex=2;vc.style.overflow="visible";uc=$("<span class='dm-preview-row-tips'>");uc.text(eb);uc.appendTo(vc);if((uc=Y.getDmModel().getEntityByName(b))&&
(uc instanceof Ob&&uc.supportRefreshEntity(uc)||!(uc instanceof Ob)&&uc.getSource()&&uc.getSource().supportRefreshEntity())){var Ic=$("<span class='dm-preview-row-tips-refresh'>");Ic.text(L.get("refreshEntity","\u5237\u65b0\u6570\u636e"));Ic.css("display","none");Ic.appendTo(vc);Ic.on("click",function(Oc){Oc=Y.getDmModel().getEntityByName(b);Xc(Oc.getName());Yc()});Bb?(uc=(uc=u[uc.getName()])?(new Date).getTime()-uc:0,setTimeout(function(){Ic.css("display","")},Math.max(1E4-uc,0))):Ic.css("display",
"")}}Sb(vc,qc)};this.setTipsParams=function(vc,qc,uc,Rc){ya=vc;Qa=qc;eb=uc;Bb=Rc}}Cb.call(this);var Y=this,ka=/^[\s\u3000\u4E00-\u9FA5a-zA-Z0-9_]+$/,va,Ba,h,e,b,f,c,d,g,k=[],a=null,r=!1,y=0,x,A=!1,v={},H={},u={};this.createToolbarButtons=function(Q){return[Q.addButton(Mc,"btn_add-entity",L.get("createEntity","\u65b0\u5efa\u6570\u636e\u8868"))]};this.createToolbarViewSysVarButton=function(Q){x=Q.addButton(w,"btn_view-sysvar",L.get("viewSystemVariable","\u67e5\u770b\u7cfb\u7edf\u53d8\u91cf"));return[x]};
var w=function(){if(0<k.length){var Q=new tc;Q.setArrSystemVar(k);Q.showDialog()}else x.setEnabled(!1),Q=Y.getGlobalDependence().createFacade(function(ta){if(ta)for(var ya in ta){var Qa=new Mb;Qa.setName(ya);Qa.setValue(ta[ya]);k.push(Qa)}ta=new tc;ta.setArrSystemVar(k);ta.showDialog();x.setEnabled(!0)}),Q.setShowBlocking(!1),Q.getPreviewDataSysVars()};this.protectedInit=function(Q){e=$("<div>");e.addClass("dm-entity-list");f=ha.createTable();var ta=new pa(f);ta.setEllipsis(!0);f.setCellRender(ta);
ta=$(f.getUI());ta.addClass("dm-entity-datapreview");c=new xc;c.setTitle(L.get("field","\u5b57\u6bb5"));c.setGlobalDependence(Y.getGlobalDependence());c.setPreviewRefreshRequestListener(ed);c.setValidNameChecker(dd);c.setCustomFieldHandler(fd);c.setFieldAliasEditListener(Lc);d=new $b;d.setTitle(L.get("filter","\u8fc7\u6ee4"));d.setGlobalDependence(Y.getGlobalDependence());d.setPreviewRefreshRequestListener(ed);h=new Wc;h.setTabLevel(Wc.SECOND_LEVEL);h.addTab(c,!0);h.addTab(d);var ya=h.getJqUi();ya.addClass("dm-entity-setting");
g=new Ub;g.setTitle(L.get("sqlParse","SQL\u89e3\u6790"));g.setGlobalDependence(Y.getGlobalDependence());g.setPreviewRefreshRequestListener(ed);Ba=new dc;Ba.setHorizontalSplit(!1);Ba.setFirstSize(240,0,-1);Ba.setSecondSize(-1,0,-1);Ba.setFirstChild(dc.createChildWrapper(ta,function(){f.relayoutViews()}));Ba.setSecondChild(dc.createChildWrapper(ya,function(){h.getCurrentTabPane().afterResize()}));Ba.getJqUi().addClass("dm-entity-rightside");va=new dc;va.setHorizontalSplit(!0);va.setFirstSize(260,100,
600);va.setSecondSize(-1,400,-1);va.setFirstChild(dc.createChildWrapper(e));va.setSecondChild(Ba);ta=va.getJqUi();ta.addClass("dm-tab-pane");ta.appendTo(Q)};this.protectedUpdateUi=function(Q){C(null);for(var ta=$(document.createDocumentFragment()),ya=0,Qa=Q.getEntityCount();ya<Qa;ya++){var eb=Q.getEntityByIndex(ya),Bb=ta,Sb=Bb.append,vc=void 0,qc=eb;eb=$("<div>");eb.addClass("dm-entity-list-item");var uc=qc.getName();eb.attr("datamodeling-name",fb.encode(uc));eb.on("mousedown",K);eb.on("mouseenter",
ca);eb.on("mouseleave",P);qc.isSubNodeAtView()&&(uc=qc.getSubNodeLevel(),eb.css("margin-left",20*uc));uc=$("<div>");uc.addClass("dm-entity-list-item-icon");var Rc=nb.entity2IconName(qc);Xa.background(uc,Rc);Rc=$("<div>");Rc.addClass("dm-entity-list-item-text");Rc.text(qc.getAlias());a:{var Ic=qc,Oc=Rc;if(!Ic.isUnion()){var gd=Ic.getSource();if(gd.isUserSql(Ic.getName())||gd.isStoredProcedure(Ic.getName()))break a}Ic.getTitle()?(Ic=Ic.getTitle(),Oc.attr("title",Ic)):Ic.isUnion()?Oc.attr("title",Ic.getAlias()):
E(Ic.getTopParentEntity(),Oc)}Oc=$("<div>");Oc.addClass("dm-entity-list-item-menu");Xa.background(Oc,"menu");Oc.on("click",fa);qc.isErrorExist()&&(vc=Ga.createWarning(),vc.addClass("dm-entity-list-item-notexist"),qc=jd.getDefaultErrorDescForTips(qc),vc.attr("title",qc),Rc.addClass("dm-entity-list-item-text-with-warning"),uc.addClass("dm-entity-list-item-icon-with-warning"));vc&&eb.append(vc);eb.append(uc);eb.append(Rc);eb.append(Oc);Sb.call(Bb,eb)}e.empty();e.append(ta);e.find(".dm-entity-list-nodataprompt").remove();
0==Y.getDmModel().getEntityCount()&&(Q=$("<div>"),Q.text(L.get("noEntity","\u672a\u521b\u5efa\u6570\u636e\u8868")),Q.addClass("dm-entity-list-nodataprompt"),e.append(Q))};this.setDataSourceDisabled=function(Q){A=Q};this.protectedModelChanged=function(Q,ta){if(Q==X.KEY_ADD_ENTITIES){Y.protectedUpdateUi(Y.getDmModel());ta=ta[0];Q=ta.getParentEntity();for(ta=ta.getName();Q;)ta=Q.getName(),Q=Q.getParentEntity();C(ta);n()}else if(Q==X.KEY_REFRESH_ENTITY){Y.protectedUpdateUi(Y.getDmModel());Q=Y.getDmModel().getEntityWithSubNodes(ta);
for(var ya=0;ya<Q.length;ya++){var Qa=Q[ya].getName();delete v[Qa]}Q=ta.getParentEntity();for(ta=ta.getName();Q;)ta=Q.getName(),Q=Q.getParentEntity();C(ta);n()}else Q==X.KEY_REMOVE_ENTITY?(Y.protectedUpdateUi(Y.getDmModel()),C(null),n()):Q==Va.KEY_CHANGE_SOURCE&&n()};this.into=function(){va.resize()};this.resize=function(){va.resize()};this.locateToFilterPane=function(Q,ta,ya){C(Q);h.setCurrentTabPane(d);d.locateToErrorRow(ta,ya)};var n=function(){Y.getGlobalDependence().setDirty(!0)},E=function(Q,
ta){var ya=Y.getGlobalDependence().createFacade(function(Qa){ta.attr("title",Qa)},function(Qa,eb,Bb){return null});ya.setShowBlocking(!1);ya.getHeadEntityTitle(Q)},Z=function(Q){return e.find("[datamodeling-name='"+fb.encode(Q)+"']")},C=function(Q,ta){b&&ba(!1);(b=Q)&&ba(!0);md();(Q=Y.getDmModel().getEntityByName(b))?(Ib(null),vd(),qd(Q,ta),td(Q)):(qd(null),td(null))},ba=function(Q,ta){ta||(ta=b);var ya=Y.getDmModel().getEntityByName(ta),Qa=ya?!1:!0,eb=ya?nb.entity2IconName(ya):null,Bb=Z(ta),Sb=Bb.find(".dm-entity-list-item-icon"),
vc=Bb.find(".dm-entity-list-item-notexist"),qc=Bb.find(".dm-entity-list-item-menu"),uc=Bb.find(".dm-entity-list-item-text");Q&&!Qa?(Q=ya.getErrorState(),0==vc.length&&Q&&(Q=Ga.createWarning(),Q.addClass("dm-entity-list-item-notexist"),Qa=(Qa=ya.getErrorDesc())?Qa:jd.getDefaultErrorDescForTips(ya),ya.isUnion()||ya.getSource().isBasedOnDB()&&(Qa=L.get("dbTableExecuteError","\u6570\u636e\u8868\u6267\u884c\u5f02\u5e38")),Q.attr("title",Qa),uc.addClass("dm-entity-list-item-text-with-warning"),Sb.addClass("dm-entity-list-item-icon-with-warning"),
Q.insertBefore(Sb)),0<vc.length&&!ya.isErrorExist()&&(vc.remove(),uc.removeClass("dm-entity-list-item-text-with-warning"),Sb.removeClass("dm-entity-list-item-icon-with-warning")),ta===b&&(Bb.addClass("dm-entity-list-item_selected"),Xa.background(Sb,eb+"_selected")),Xa.background(qc,"menu_selected")):Qa||(Bb.removeClass("dm-entity-list-item_selected"),Xa.background(Sb,eb),Xa.background(qc,"menu"))},K=function(Q){Q=$(Q.currentTarget);Q=fb.decode(Q.attr("datamodeling-name"));b!=Q&&C(Q,!0)},ca=function(Q){$(Q.currentTarget).find(".dm-entity-list-item-menu").css("display",
"block")},P=function(Q){$(Q.currentTarget).find(".dm-entity-list-item-menu").css("display","none")},fa=function(Q){var ta=$(Q.currentTarget);Q=ta.parent();var ya=fb.decode(Q.attr("datamodeling-name"));if((Q=ta.data("menu"))&&Q.isShowing())ta.data("menu",null),Q.hide();else{Q=new Hc;Q.setModel(tb(ya));Q.setIconSetter(function(Bb,Sb){Xa.background(Bb,Sb)});Q.setHideListener(function(){ta.data("menu",null)});ta.data("menu",Q);ya=ta.outerHeight();var Qa=Y.getGlobalDependence().getTopJqUi(),eb=[0,ya];
eb=$a.upwardCoordinate(ta[0],eb,Qa[0]);Q.show(Qa,eb[0],eb[1],ta,!0,[0,-ya])}},xb=function(){var Q=Y.getDmModel(),ta=Q.getEntityByName(b),ya=ta.getChildren()[0].getSource(),Qa={};Qa[ya.getName()]=ya;var eb=Y.getGlobalDependence().createFacade(function(Sb){for(var vc={},qc=0;qc<Sb.length;qc++){var uc=Sb[qc],Rc=new zb;Rc.fromJsonObject(uc,Qa);vc[Rc.getFisrtEntity().getAssociateName()]=Rc}Sb=new db;Sb.setGlobalDependence(Y.getGlobalDependence());Sb.setOpenInnerRelationDialog(function(Ic,Oc,gd){var nd=
new Za;nd.prepare(Ic,Oc,gd);nd.showDialog()});Sb.initUi(b,Q,vc);Sb.showDialog();Sb.refreshContent()}),Bb=[];Bb.push(ya.toJsonObject());eb.setBlockingJqUi(Y.getJqUi());eb.setShowBlocking(!0);eb.getUnionDesigntimeDataObject([ta.toJsonObject()],Bb,!0)},tb=function(Q){Q=Y.getDmModel().getEntityByName(Q);if(Q instanceof Ob){var ta=new Sc;if(!Q.isSubNodeAtView()){var ya=Q.getUnionType(),Qa=Ca(L.get("mergeDataSource","\u5408\u5e76\u6570\u636e\u8868..."),O,!0);ta.addItemModel(Qa);ya=ya==Ob.BIZ_UNION?xb:N;
ya=Ca(L.get("modifyMergedDataSource","\u4fee\u6539\u5408\u5e76\u72b6\u6001..."),ya,!0);ta.addItemModel(ya)}ta.addSeperator();Qa=Ca(L.get("renameEntity","\u91cd\u547d\u540d"),$c,!0);ya=Ca(L.get("addCustomField","\u65b0\u5efa\u8ba1\u7b97\u5b57\u6bb5"),ja);ta.addItemModel(Qa);Q.isSupportColumnToRow()&&(Qa=Q.getColumnToRowProperties(),Qa=null!=Qa&&0<Qa.length?L.get("modifyColumnToRow","\u4fee\u6539\u5217\u8f6c\u884c"):L.get("columnToRow","\u5217\u8f6c\u884c"),Qa=Ca(Qa,Pa),ta.addItemModel(Qa));ta.addItemModel(ya);
Q.getUnionType()==Ob.BIZ_UNION&&!Q.isSubNodeAtView()&&U(Q)&&(ta.addSeperator(),Q=Ca(L.get("editInnerRelation","\u7f16\u8f91\u5185\u90e8\u5173\u7cfb"),hb),ta.addItemModel(Q));ta.addSeperator();Q=Ca(L.get("deleteEntity","\u5220\u9664"),lc,!0,"delete");ta.addItemModel(Q);return ta}Qa=new Sc;var eb=Q.getSource();if(eb.isUserSql(Q.getName())){var Bb=Q.getName();Bb=eb.getUserSql(Bb).getSqlType();Bb=L.get("editSql","\u7f16\u8f91")+Bb;Bb=Ca(Bb,Wa)}else eb.isStoredProcedure(Q.getName())&&eb.supportStoredProcedure&&
eb.supportStoredProcedure()&&(Bb=L.get("editStoredProcedure","\u7f16\u8f91\u5b58\u50a8\u8fc7\u7a0b"),Bb=Ca(Bb,ua));eb.isSupportSelectField()&&(ta=Ca(L.get("fieldSelect","\u9009\u62e9\u5b57\u6bb5"),za));eb.isSupportCustomField(Q.getName())&&(ya=Ca(L.get("addCustomField","\u65b0\u5efa\u8ba1\u7b97\u5b57\u6bb5"),ja));var Sb=Q.getColumnToRowProperties();Sb=null!=Sb&&0<Sb.length;if(eb.isSupportColumnToRow()){var vc=Sb?L.get("modifyColumnToRow","\u4fee\u6539\u5217\u8f6c\u884c"):L.get("columnToRow","\u5217\u8f6c\u884c");
vc=Ca(vc,Pa)}Sb=Ca(L.get("editInnerRelation","\u7f16\u8f91\u5185\u90e8\u5173\u7cfb"),hb);var qc=Ca(L.get("renameEntity","\u91cd\u547d\u540d"),$c,!0),uc=null,Rc=Q.isSubNodeAtView();eb.supportMergeTable()&&!Rc&&(uc=Ca(L.get("mergeDataSource","\u5408\u5e76\u6570\u636e\u8868..."),O,!0));var Ic=Ca(L.get("deleteEntity","\u5220\u9664"),lc,!0,"delete");Rc?(Qa.addItemModel(qc),Bb&&Qa.addItemModel(Bb),ta&&Qa.addItemModel(ta),vc&&Qa.addItemModel(vc),ya&&Qa.addItemModel(ya)):(eb.isModifiable()&&(Rc=Ca(L.get("modifyConnection",
"\u6570\u636e\u6e90..."),F),Qa.addItemModel(Rc)),eb.isShowChangeSourceTypeButtonInMenu()&&(eb=Ca(L.get("changeDataSource","\u66f4\u6362\u6570\u636e\u6e90"),Qb),Qa.addItemModel(eb)),uc&&Qa.addItemModel(uc),Qa.addSeperator(),Qa.addItemModel(qc),Bb&&Qa.addItemModel(Bb),ta&&Qa.addItemModel(ta),vc&&Qa.addItemModel(vc),ya&&Qa.addItemModel(ya),U(Q)&&(Qa.addSeperator(),Qa.addItemModel(Sb)));Qa.addSeperator();Qa.addItemModel(Ic);return Qa},Qb=function(Q){var ta=Y.getDmModel(),ya=ta.getEntityByName(b),Qa=Y.getGlobalDependence();
Q=new ac;Q.setChangeSourceType(!0);Q.setDModel(ta);Q.setOldEntity(ya);Q.setFacadeCreator(Qa.createFacade);Q.setEntityExistChecker(id,hd);Q.setFinishedCallback(function(eb){eb&&eb!==b?(Xc(eb),ba(!0,eb)):C(b)});Q.setDataSourceDisabled(A);ta=new B;ta.setTitle(L.get("changeDataSource","\u66f4\u6362\u6570\u636e\u6e90"));ta.setSteps([Q]);ta.show(960,540)},U=function(Q){for(var ta=!1,ya=0;ya<Y.getDmModel().getEntityCount();ya++){var Qa=Y.getDmModel().getEntityByIndex(ya);Q!=Qa&&Qa.getTopParentEntity()==
Q&&(ta=!0)}return ta},Ca=function(Q,ta,ya,Qa){Q=Hc.createActionMenuItem(Q+(ya?"":"..."),ta);Qa&&Q.setIconName(Qa);return Q},z=function(Q){var ta=[],ya;for(ya in Q){var Qa=Q[ya].toJsonObject();ta.push(Qa)}return ta},N=function(){var Q=Y.getDmModel(),ta=Q.getEntityByName(b),ya={};ta.collectSources(ya);var Qa=Y.getGlobalDependence().createFacade(function(eb){var Bb=new zb;Bb.fromJsonObject(eb,ya);eb=new sa(ta,Bb.getEntityMap());eb.compareAndSync();Bb=new ra;var Sb=Q.searchRelationsByEntityName(b);Bb.setGlobalDependence(Y.getGlobalDependence());
Bb.setUnionEntity(ta);Bb.setUnionEntityCompareModel(eb);Bb.setRelations(Sb);Bb.initUi();Bb.setConfirmListener(function(vc,qc){qc.forEach(function(uc){Q.removeRelation(uc)});Q.refreshRelationEntity(vc);Q.refreshEntity(vc)});Bb.showDialog();setTimeout(Bb.refresh)});Qa.setShowBlocking(!0);Qa.getUnionDesigntimeDataObject([ta.toJsonObject()],z(ya),!1)},t=function(Q,ta,ya){var Qa=new Za;Qa.prepare(Q,ta,ya);Qa.showDialog()},O=function(){var Q=Y.getDmModel(),ta=Q.getEntityByName(b);if(ta instanceof Ob)var ya=
ta.getUnionType()==Ob.BIZ_UNION;else ya=ta.getSource(),ya=gc.isBizSourceType(ya.getTypeName())&&ya.getMergeType()==ma.BIZ_MERGE;var Qa;if(Qa=ya){Qa={};for(var eb=Q.getRelationCount(),Bb=!1,Sb=0;Sb<eb;Sb++){var vc=Q.getRelationByIndex(Sb),qc=vc.getFromEntity().getName(),uc=vc.getFromProperty().getName();if(Qa[qc]&&Qa[qc]!=uc&&vc.isInnerRelation()){Bb=!0;break}else Qa[qc]=uc}Qa=Bb}Qa?(Q=L.get("relationDiffTips",'\u4e1a\u52a1\u5b9e\u4f53"#1"\u4e2d\uff0c \u5b58\u5728\u6570\u636e\u8868\u67092\u4e2a\u53ca\u4ee5\u4e0a\u5b57\u6bb5\u4e0e\u5176\u4ed6\u6570\u636e\u8868\u521b\u5efa\u5173\u7cfb\uff0c\u8bf7\u5220\u9664\u4e0d\u6ee1\u8db3\u7684\u5408\u5e76\u6761\u4ef6\u7684\u6570\u636e\u8868\u3002').replace("#1",
ta.getAlias()),W(Q)):(ya?(ya=new Na,ya.setGlobal(Y.getGlobalDependence()),ya.setFacadeCreator(Y.getGlobalDependence().createFacade),ya.setFinishedCallback(Fa),ya.setSelectEntity(ta),ta instanceof Ob?ya.setSource(ta.getChildren()[0].getSource()):ya.setSource(ta.getSource()),ya.setRelationDialogOpener(t),ya.setBox(Q)):(ya=new Sa,ya.setDModel(Q),ya.setFacadeCreator(Y.getGlobalDependence().createFacade),ya.setEntityExistChecker(id,hd),ya.setFinishedCallback(Fa),ya.setSelectEntity(ta),ya.setDataSourceDisabled(A)),
Q=new B,Q.setTitle(L.get("mergeDataSourceTitle","\u5408\u5e76\u6570\u636e\u8868")),Q.setSteps([ya]),Q.show(960,540))},W=function(Q){var ta=com.kingdee.bos.qing.ui.component.MessageDialog,ya=ta.createFeedbackDialog();ya.setOptionType(ta.OPTION_OK);ya.setMsgImageType(ta.MSG_WARNING);ya.setButtonText(ta.OPTION_OK,L.get("iknow","\u6211\u77e5\u9053\u4e86"));ya.setMessage(Q);ya.setExtendPainter(function(Qa,eb){var Bb=$("<div class='sa-ctrl-feedback-dialog-text'>"),Sb=$("<span>");Sb.text(eb);Sb.appendTo(Bb);
eb=$("<a onclick='javascript:window.open(\"https://q.kdcloud.com/support/index.html?version=1.0&docId=Tvqwnwaig\");' href='#'>");eb.css({cursor:"pointer",color:"#5582f3"});eb.text(L.get("viewDocument","\u67e5\u770b\u5e2e\u52a9\u6587\u6863"));eb.appendTo(Bb);Bb.appendTo(Qa)});ya.showDialog()},Fa=function(Q){var ta=Y.getDmModel();ta.refreshRelationEntity(Q);ta.refreshEntity(Q);n();zc.occur(zc.DM_OPERATING_MERGE_TABLE,1)},Wa=function(){for(var Q=Y.getDmModel(),ta=Q.getEntityByName(b),ya=ta.getProperties(),
Qa=[],eb=0;eb<ya.length;eb++)ya[eb].isCalculatingField()&&Qa.push(ya[eb]);var Bb=ta.getColumnToRowProperties();ya=new Lb;ya.setInitValue(Q,ta,Y.getGlobalDependence());ya.setConfirmListener(function(){Z(b).find(".dm-entity-list-item-text").text(ta.getAlias());var Sb=ta.getProperties();Sb=Sb.concat(Qa);var vc=[];vc=vc.concat(Sb);vc=la(vc,Bb);D(Q,ta,vc);ta.setProperties(Sb);Q.getEntityByName(b).setColumnToRowProperties(Bb);0!=Qa.length?Vc(ta,!0,null):C(b)});ya.initUi();ya.showDialog()},ua=function(){for(var Q=
Y.getDmModel(),ta=Q.getEntityByName(b),ya=ta.getProperties(),Qa=[],eb=0;eb<ya.length;eb++)ya[eb].isCalculatingField()&&Qa.push(ya[eb]);var Bb=ta.getColumnToRowProperties();ya=new yc;ya.setInitValue(Q,ta,Y.getGlobalDependence());ya.setConfirmListener(function(){Z(b).find(".dm-entity-list-item-text").text(ta.getAlias());var Sb=ta.getProperties();Sb=Sb.concat(Qa);var vc=[];vc=vc.concat(Sb);vc=la(vc,Bb);D(Q,ta,vc);ta.setProperties(Sb);Q.getEntityByName(b).setColumnToRowProperties(Bb);0!=Qa.length?Vc(ta,
!0,null):C(b)});ya.initUiShowDialog()},D=function(Q,ta,ya){var Qa=Q.searchRelationsByEntityName(b);if(Qa){for(var eb={},Bb=0;Bb<ya.length;Bb++)eb[ya[Bb].getName().toUpperCase()]=ya[Bb];for(Bb=Qa.length-1;0<=Bb;Bb--){ya=Qa[Bb].getFromEntity();var Sb=Qa[Bb].getToEntity(),vc=Qa[Bb].getFromProperty(),qc=Qa[Bb].getToProperty();vc=vc.getName().toUpperCase();qc=qc.getName().toUpperCase();ya==ta&&!eb[vc]||Sb==ta&&!eb[qc]?Q.removeRelation(Qa[Bb]):(ya==ta&&eb[vc]&&Qa[Bb].setFromProperty(eb[vc]),Sb==ta&&eb[qc]&&
Qa[Bb].setToProperty(eb[qc]))}}},la=function(Q,ta){if(ta&&0<ta.length)for(var ya in ta){var Qa=ta[ya];if(Qa){var eb=Qa.getFieldNameProperty();Qa=Qa.getFieldValueProperties();Q=Q.concat(eb);Q=Q.concat(Qa)}}return Q},za=function(Q){var ta=Y.getDmModel(),ya=ta.getEntityByName(b),Qa=ya.getSource();Q=ya.getProperties();for(var eb=[],Bb=[],Sb=0;Sb<Q.length;Sb++)Q[Sb].isCalculatingField()?eb.push(Q[Sb]):Bb.push(Q[Sb]);Q=ya.getTopParentEntity().getAssociateName();Y.getGlobalDependence().createFacade(function(vc){var qc=
new zb;qc.fromJsonObject(vc,[Qa]);var uc=qc.getEntityByAssociateName(ya.getAssociateName());vc=uc.getProperties();uc.syncPropertyFrom(Bb);qc=ta.getLockedPropNames(ya);var Rc=new hc;Rc.setAllProperties(vc);Rc.setEntity(uc);Rc.setSelectedProperties(Bb);Rc.setLockSelectedFieldNames(qc);Rc.setAllRelationPropName(ta.searchAllRelationPropNames(b));Rc.setClosingCheckListener(function(Ic,Oc,gd){uc.setSource(Qa);ad.checkFieldNum(null!=Ic?Ic.length:0,gd,function(nd){Oc(nd)})});Rc.setConfirmListener(function(Ic,
Oc){Ic=Ic.concat(eb);for(var gd=0;gd<Oc.length;gd++)ta.removeRelationByProperty(b,Oc[gd].getName());Oc=ta.searchRelationsByEntityName(b);for(gd=0;gd<Oc.length;gd++)for(var nd=Oc[gd],xd=nd.getFromProperty(),zd=nd.getToProperty(),yd=0;yd<Ic.length;yd++){var wd=Ic[yd];if(nd.getFromEntity().getName()==b){if(xd.getAssociateName()==wd.getAssociateName()&&xd!=wd){nd.setFromProperty(wd);break}}else if(zd.getAssociateName()==wd.getAssociateName()&&zd!=wd){nd.setToProperty(wd);break}}Oc=[];for(gd=0;gd<Ic.length;gd++)Ic[gd].hasChild()&&
((nd=ya.getTreeRootProp(Ic[gd]))||(nd=uc.getTreeRootProp(Ic[gd])),nd&&Oc.push(nd));ya.setTreeRootProps(Oc);ya.setProperties(Ic);0!=eb.length?Vc(ya,!0,null):C(b);n()});Rc.initUi();Rc.showDialog()}).getDesigntimeDataObject(Qa.toJsonObject(),Q)},F=function(Q){Q=Y.getDmModel();var ta=Q.getEntityByName(b),ya=ta.getSource(),Qa=Y.getGlobalDependence();var eb=ya instanceof aa?new Ra:ya instanceof La||ya instanceof T||ya instanceof V?new Gb:ya instanceof ia?new Ta:Xb.createBizMetaSourceEditor(ya.getTypeName());
eb.setConfirmListener(function(Bb){Bb&&Bb!==b?(Xc(Bb),ba(!0,Bb)):C(b)});eb.edit(Q,ta,ya,Qa,A)},ja=function(Q){Q=new Db;Q.setName("F"+(new Date).getTime());Q.setAssociateName(Q.getName());Yb(Q,!1,function(ta,ya){ta.push(ya);n()},function(){c.scrollToBottom()})},Pa=function(Q){Q=Y.getDmModel();var ta=Q.getEntityByName(b);Q=Q.searchRelationsByEntityName(b);var ya=new Wb;ya.setGlobalDependence(Y.getGlobalDependence());ya.setRelationsAndEntity(Q,ta);ya.setConfirmListener(function(){qd(ta);td(ta)});ya.initUi();
ya.showDialog()},hb=function(){var Q=Y.getDmModel(),ta=Q.getEntityByName(b),ya=Y.getGlobalDependence(),Qa=new Za;Qa.prepare(Q,ta,ya,!0);Qa.showDialog()},Yb=function(Q,ta,ya,Qa){var eb=Y.getDmModel().getEntityByName(b),Bb=eb.getProperties(),Sb=eb.toOutputPropertiesJsonObject(),vc=Q.getDataType(),qc,uc=null,Rc=Y.getGlobalDependence().createFacade(function(Oc){var gd=Oc.ok,nd=Oc.errorPosition,xd=Oc.errorPrompt;qc=Oc.dataType;uc(gd,nd,xd)});Rc.setShowBlocking(!1);var Ic=new Kb;Ic.setContext(eb.getOutputProperties(Bb),
Q,ta);Ic.setSyntaxValidator(function(Oc,gd,nd){uc=nd;Rc.checkFormula(gd,Oc,Sb)});Ic.edit(function(){qc=qc?qc:Db.DT_NUMBER;Q.setDataType(qc);Q.setAppointedDataType(null);qc!=vc&&Db.confirmDefaultFormatString(Q);ya&&ya(eb.getProperties(),Q);Vc(eb,!0,Qa)})},ec=function(Q,ta){if(ta){Q=Q.getOutputProperties(Q.getProperties());for(var ya=0;ya<Q.length;ya++){var Qa=Q[ya];if(Qa.isCalculatingField()){var eb=ta[Qa.getName()];Qa.setCalculatingFieldInvalid(!eb.valid);eb=(eb=eb.dataType)?eb:Db.DT_NUMBER;var Bb=
Qa.getDataType(),Sb=Qa.getAppointedDataType();Bb!=eb&&(Qa.setDataType(eb),Db.confirmDefaultFormatString(Qa));Sb==eb&&Qa.setAppointedDataType(null)}}}},Vc=function(Q,ta,ya){var Qa=Q.toOutputPropertiesJsonObject(function(eb){return eb.isNotExisted()});Y.getGlobalDependence().createFacade(function(eb){ec(Q,eb.map);ta&&C(b);ya&&ya()}).checkAllFormula(Qa)},fd=function(Q,ta){var ya=Y.getDmModel().getEntityByName(b),Qa;if(Qa="recheckAll"==Q)a:{Qa=ya.getProperties();for(var eb=Qa.length-1;0<=eb;eb--)if(Qa[eb].isCalculatingField()){Qa=
!0;break a}Qa=void 0}Qa&&Vc(ya,!0);if("modify"==Q)Yb(ta,!0);else if("delete"==Q)for(Q=ya.getProperties(),Qa=Q.length-1;0<=Qa;Qa--)if(ta==Q[Qa]){Q.splice(Qa,1);Qa=ya;Q=ta;if(Qa.isUnion())for(Qa=Qa.getChildren(),eb=0;eb<Qa.length;eb++)for(var Bb=Qa[eb].getProperties(),Sb=Bb.length-1;0<=Sb;Sb--)if(Q.getName()==Bb[Sb].getRelatedBaseProp()){Bb.splice(Sb,1);break}Q=ya.getName();if(!ta.isCalculatingField()&&(Q=Y.getDmModel().searchRelationsByEntityName(Q)))for(Qa=0;Qa<Q.length;Qa++)eb=Q[Qa],eb.getFromProperty().getName()==
ta.getName()?Y.getDmModel().removeRelation(eb):eb.getToProperty().getName()==ta.getName()&&Y.getDmModel().removeRelation(eb);Vc(ya,!0);break}},Mc=function(Q){Q=new ac;Q.setDModel(Y.getDmModel());Q.setFacadeCreator(Y.getGlobalDependence().createFacade);Q.setEntityExistChecker(id,hd);Q.setFinishedCallback(ud);Q.setDataSourceDisabled(A);var ta=new B;ta.setTitle(L.get("createEntity","\u65b0\u5efa\u6570\u636e\u8868"));ta.setSteps([Q]);ta.show(960,540)},lc=function(Q){var ta=Y.getDmModel(),ya=ta.getEntityByName(b);
ta.searchRelationsByEntityName(b);Q=L.get("confirmDelEntity","\u5220\u9664\u6570\u636e\u8868\u201c#1\u201d\u540e\u5c06\u65e0\u6cd5\u6062\u590d\uff0c\u786e\u5b9a\u5220\u9664\u8be5\u6570\u636e\u8868\u5417\uff1f").replace("#1",ya.getAlias());Q=Q.replace("#1",ya.getAlias());var Qa=Z(b).find(".dm-entity-list-item-menu");Qa.css("display","block");var eb=new rb;eb.setText(Q);eb.setConfirmedListener(function(Bb){if(Bb){Bb=ta.getEntityWithSubNodes(ya);for(var Sb=0;Sb<Bb.length;Sb++)ta.removeEntity(Bb[Sb]),
Xc(Bb[Sb].getName())}});eb.show(Qa);Qa.css("display","none")},$c=function(Q){var ta=Y.getDmModel().getEntityByName(b);ta.getName();var ya=ta.getAlias();Q=Z(b);var Qa=Q.find(".dm-entity-list-item-text"),eb=new M;eb.setText(ya);var Bb=eb.getJqUi();Bb.css({position:"absolute",left:"0",right:"0",top:"0",height:Q.height(),"z-index":"65535"});Bb.appendTo(Q);eb.requestFocus();var Sb=function(uc,Rc){var Ic=$.trim(eb.getText());if(!hd(Ic)&&dd(Ic)&&Ic!=ya)ta.setAlias(Ic),Qa.text(Ic),uc=!0,n();else if(dd(Ic))Ic!=
ya&&(Oc=L.get("entityNameExist","\u5df2\u5b58\u5728\u6570\u636e\u8868\u540d\u79f0\uff1a"),Oc+=Ic,Rc&&(Oc+=L.get("abandonModify","\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002")),Y.getGlobalDependence().getMessageCurtain().showPrompt(Oc));else{var Oc=L.get("invalidEntityName","\u6570\u636e\u8868\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e14\u4e0d\u80fd\u5305\u542b\u7a7a\u683c\u3002");""==Ic&&(Oc=L.get("entityNameNull","\u6570\u636e\u8868\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a\u3002"));
Rc&&(Oc=""==Ic?L.get("abandonModifysAndEntityNameNull","\u6570\u636e\u8868\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002"):L.get("abandonModifys","\u6570\u636e\u8868\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e14\u4e0d\u80fd\u5305\u542b\u7a7a\u683c\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002"));Y.getGlobalDependence().getMessageCurtain().showPrompt(Oc)}Ic==ya&&(uc=!0);uc&&(Bb.remove(),document.body.removeEventListener("mousedown",
vc,!0),document.body.removeEventListener("keydown",qc,!0))},vc=function(uc){for(uc=uc.target;uc!=document.body;){if(uc==Bb[0])return;uc=uc.parentNode}Sb(!0,!0)},qc=function(uc){13==uc.keyCode&&Sb(!1,!1)};document.body.addEventListener("mousedown",vc,!0);document.body.addEventListener("keydown",qc,!0)},dd=function(Q){return Q&&0<Q.indexOf(" ")?!1:ka.test(Q)},id=function(Q){return Y.getDmModel().isEntityNameExist(Q)},hd=function(Q){return Y.getDmModel().isEntityAliasExist(Q)},ud=function(Q,ta){for(var ya=
0;ya<Q.length;ya++){for(var Qa=Q[ya],eb=Qa.getProperties(),Bb=0;Bb<eb.length;Bb++)Db.confirmDefaultFormatString(eb[Bb]);var Sb=Bb=Qa.getName();for(eb=1;id(Sb);)Sb=Bb+"_"+eb++;Qa.setName(Sb);Sb=Bb=Qa.getAlias();for(eb=1;hd(Sb);)Sb=Bb+"_"+eb++;Qa.setAlias(Sb)}Y.getDmModel().addEntities(Q);if(ta)for(Q=0;Q<ta.length;Q++)Y.getDmModel().addRelation(ta[Q])},td=function(Q){c.updateUi(Q);d.updateUi(Q);g.updateUi(Q)},qd=function(Q,ta){Ib(null);if(!Q)return pd(),!1;var ya=vd();y=ya;gb(Q);if(!Da(Q))return!1;
var Qa=[];Q.collectJsonSource(Qa);var eb=[];Q.toExecuteJsonArr(eb);if(ta&&v[Q.getName()]){var Bb=v[Q.getName()];setTimeout(function(){sd(Bb,Q,ya,!0)},100)}else rd(Q,ya,eb,Qa);return!0},rd=function(Q,ta,ya,Qa){delete v[Q.getName()];var eb=Y.getGlobalDependence().createFacade(function(Bb){sd(Bb,Q,ta,!1)},function(Bb,Sb,vc){var qc=Bb.toString();return"20"==qc.substr(0,2)&&7==qc.length?(ta>=y&&(2040004==Bb&&-1<Sb.indexOf("Too many tables; MySQL can only use 61 tables in a join")?qc=L.get("tooManyTablesSelectFieldOneEntityError",
"\u5f53\u524d\u5b9e\u4f53\u5173\u8054\u7684\u6570\u636e\u8868\u8fc7\u591a\uff0c\u8bf7\u53cd\u9009\u4e0d\u9700\u8981\u7684\u5b57\u6bb5\u3002"):(qc=L.get("errorInfo","\u9519\u8bef\u7801\uff1a#1\r\n\u9519\u8bef\u4fe1\u606f\uff1a#2"),qc=qc.replace("#1",Bb),qc=qc.replace("#2",vc?vc:Sb)),a=null,ba(!0),od(qc)),!0):!1});eb.setShowBlocking(!1);eb.previewData(ya,Qa,11)},sd=function(Q,ta,ya,Qa){if(Y.getDmModel().getEntityByName(ta.getName())&&(ba(!0),ya>=y)){pd();ya=new Ab;Q&&ya.fromJsonObject(Q);ta.setErrorInfo(ya.getErrorInfo());
ba(!0);var eb=ya.getErrorInfo();if(eb){var Bb=eb.getErrorDesc();eb="";Bb=(Bb?Bb:jd.getDefaultErrorDesc(ta)).split("\uff1b");for(var Sb=0;Sb<Bb.length;Sb++)eb+="<span class = 'entity-error-info' style='display: block;'>"+Bb[Sb]+"</span>";od(eb);a=null;switch(ta.getErrorState()){case qa.AbstractEntity.ERROR_STATE_BIZMETANOTSUPPORT:eb=da.getSupportQingAnalysisUrl(),eb=$("<a onclick='javascript:window.open(\""+eb+"\");' href='#'>"),eb.css("cursor","pointer"),eb.css("color","#5582f3"),eb.text(L.get("viewDocument",
"\u67e5\u770b\u5e2e\u52a9\u6587\u6863")),Y.getJqUi().find(".dm-entity-datapreview-waiting").append(eb)}}ya.getErrorState()||(v[ta.getName()]=Q,ta.setErrorInfo(null),a=ya.getData(),Q=ya.getNotExistedPropNames(),ta.refreshNotExistedProperty(Q),ec(ta,ya.getCalcFieldCheckInfo()),Ib(ta,Qa),g.setSqlContent(ya.getSqlContent()),g.setUnPushdownFilterContent(ya.getUnPushdownFilterContent()),td(ta),Da(ta))}},Da=function(Q){return(Q=(new Ka).checkEntityFilters(Q))?(Ib(null),Q=Q.getPrompt(),Q=L.get("filterCriteria",
"\u8fc7\u6ee4\u6761\u4ef6")+Q,od(Q),setTimeout(function(){h.setCurrentTabPane(d)},200),!1):!0},gb=function(Q){var ta=Q.getColumnToRowProperties();if(ta&&0<ta.length){Q.getProperties();for(var ya in ta){var Qa=[],eb=ta[ya],Bb=eb.getFieldNameProperty();Qa.push(Bb);var Sb=eb.getFieldValueProperties();eb=void 0;Bb=Qa;if(Sb&&0<Sb.length)for(eb in Bb=Bb?Bb:[],Sb)Bb.push(Sb[eb]);if(Qa&&0<Qa.length)for(eb in eb=void 0,Bb=Q,Qa)if(Sb=Qa[eb])Sb.setColumnToRowField(!0),Bb.findProperty(Sb.getName())?Sb.setColumnToRowFieldInvalid(!1):
Sb.setColumnToRowFieldInvalid(!0)}}},Ib=function(Q,ta){ha.clear(f);if(Q&&Y.getDmModel().isEntityNameExist(Q.getName())){var ya=ha.createHeadRow(f),Qa=Q.getProperties(),eb=Q.getOutputProperties(Qa),Bb=eb.length,Sb=[];Qa=0;for(var vc=!1,qc=0;qc<Bb;qc++){var uc=eb[qc],Rc=uc.getOutputDataType(),Ic=Rc==Db.DT_INT||Rc==Db.DT_NUMBER,Oc=f.addColumn(uc.getName());Oc.setStyle(ha.getColumnStyle(Ic));Oc.setWidth(Vb(Rc));Ic=uc.isHideInDataModeling()||uc.isNotExisted();Oc.setHide(Ic);ya.getCell(qc).setValue(uc.getAlias());
Sb[qc]=Rb.createFormater(Rc,uc.getFormatString());vc||Ic||(Qa=qc,vc=!0)}ya=a.length;qc=0;for(vc=Math.min(ya,10);qc<vc;qc++)for(uc=a[qc],Rc=ha.createRow(f),Oc=0;Oc<Bb;Oc++)eb[Oc].isNotExisted()&&uc.length<eb.length&&uc.splice(Oc,0,""),Ic=(0,Sb[Oc])(uc[Oc]),Rc.getCell(Oc).setValue(Ic);eb="";if(0==ya)eb=L.get("noPreviewData","\u6ca1\u6709\u6570\u636e"),Nc(eb,null,Qa,!1);else if(10>=ya)eb=L.get("totalRows","\u603b\u5171#1\u884c\u6570\u636e").replace("#1",ya),Nc(eb,ya,Qa,!1);else if(Nc(L.get("loadingTotalRows",
"\u6b63\u5728\u8ba1\u7b97\u603b\u884c\u6570\uff0c\u8bf7\u7a0d\u5019...."),null,Qa,!0),10<ya&&(eb=L.get("dataShownRows","\u4ec5\u9884\u89c8\u524d#1\u884c\u6570\u636e").replace("#1",10)),Y.getDmModel().isEntityNameExist(Q.getName())&&!(new Ka).checkEntityFilters(Q)){Sb={};Q.collectSources(Sb);Bb=[];for(var gd in Sb)qc=Sb[gd].toJsonObject(),Bb.push(qc);gd=[];gd.push(Q.toExecutableJsonObject());for(Sb=Q;Sb.getParentEntity();)Sb=Sb.getParentEntity(),gd.push(Sb.toExecutableJsonObject());ta&&H.hasOwnProperty(Q.getName())&&
!H[Q.getName()]||(ta&&H[Q.getName()]?(ta=H[Q.getName()],pc(ta,Q,eb,Qa)):fc(Q,gd,Bb,eb,Qa))}}ha.refresh(f);Q&&b!=Q.getName()&&C(b)},Vb=function(Q){switch(Q){case Db.DT_INT:case Db.DT_NUMBER:return 90;case Db.DT_DATE:return 80;case Db.DT_DATETIME:return 130;case Db.DT_BOOLEAN:return 40;default:return 120}},fc=function(Q,ta,ya,Qa,eb){var Bb=(new Date).getTime();u[Q.getName()]=Bb;H[Q.getName()]=null;var Sb=Y.getGlobalDependence().createFacade(function(vc){var qc=u[Q.getName()];qc&&Bb<qc||(H[Q.getName()]=
vc,pc(vc,Q,Qa,eb))},function(vc,qc,uc){qc=vc.toString();return"20"==qc.substr(0,2)&&7==qc.length&&209E4!=vc?(Qa=L.get("loadingTotalRowsError","\u83b7\u53d6\u603b\u884c\u6570\u5931\u8d25",null,eb),Nc(Qa,null,null,!1),!0):!1});Sb.setShowBlocking(!1);Sb.getDataCount(ta,ya)},pc=function(Q,ta,ya,Qa){b==ta.getName()&&(0<=Q&&(ya=L.get("totalRows","\u603b\u5171#1\u884c\u6570\u636e").replace("#1",Q)+L.get("previewTipsComma",",")+ya),Nc(ya,Q,Qa,!1))},Nc=function(Q,ta,ya,Qa){if(void 0==ya||null==ya)ya=0;var eb=
10;ta&&0<=ta&&10>ta&&(eb=ta);f.getRowsCount()-ha.getHeadRowCount()==eb||0==f.getRowsCount()-ha.getHeadRowCount()?(ha.createRow(f),ta=f.getCellRender(),ta.setTipsParams(f.getRowsCount()-1,ya,Q,Qa),ha.refresh(f)):f.getRowsCount()-ha.getHeadRowCount()==eb+1&&(ta=f.getCellRender(),ta.setTipsParams(f.getRowsCount()-1,ya,Q,Qa),ha.refresh(f))},Lc=function(Q){var ta=Y.getDmModel(),ya=ta.getEntityByName(b);ta.fireRelationPropChanged(ya.getName(),Q.getName())},Xc=function(Q){delete v[Q];delete H[Q];for(var ta=
Y.getDmModel().getAllEntity(),ya=0;ya<ta.length;ya++){var Qa=ta[ya];Qa.getParentEntity()&&Qa.getParentEntity().getName()==Q&&Xc(Qa.getName())}},ed=function(Q){if(!r)if(Q)Q=Y.getDmModel(),Q=Q.getEntityByName(b),a&&Ib(Q,!0);else{Q=Y.getDmModel();Q=Q.getEntityByName(b);Xc(Q.getName());r=!0;var ta=$(f.getUI()).parent();Q=$("<div>");Q.addClass("dm-entity-datapreview-darkmask");Q.appendTo(ta);ta=$("<div>");ta.text(L.get("refreshPreviewData","\u7f16\u8f91\u5b8c\u6210\u540e\uff0c\u70b9\u51fb\u6b64\u5904\u5237\u65b0\u9884\u89c8\u6570\u636e\u3002"));
ta.on("click",function(ya){Yc()});ta.addClass("dm-entity-datapreview-darkmask-button");ta.appendTo(Q)}},Yc=function(){var Q=Y.getDmModel().getEntityByName(b);qd(Q)&&md()},md=function(){Y.getJqUi().find(".dm-entity-datapreview-darkmask").remove();r=!1},od=function(Q){pd();var ta=$(f.getUI()),ya=$("<div>");ya.html(Q);ya.addClass("dm-entity-datapreview-waiting");ya.appendTo(ta)},pd=function(){Y.getJqUi().find(".dm-entity-datapreview-waiting").remove()},vd=function(){od(L.get("loadingPreviewData","\u6b63\u5728\u83b7\u53d6\u9884\u89c8\u6570\u636e\uff0c\u8bf7\u7a0d\u5019\u2026\u2026"));
return(new Date).getTime()}}function rc(){Cb.call(this);var pa=this,Y,ka,va,Ba,h,e,b,f,c=!1;this.createToolbarButtons=function(z){return[z.addButton(Qb,"btn_add-relation",L.get("createRelation","\u65b0\u5efa\u5173\u7cfb"))]};this.protectedInit=function(z){va=$("<div>");va.addClass("dm-relation-list");Ba=new sb;Ba.setDefaultTableSize(200,90);Ba.setSelectedListener(tb);Ba.setTableIconSetter(a);Ba.setFieldIconSetter(r);Ba.setNoFieldPrompt(L.get("relationNotCreate","\u672a\u521b\u5efa\u4e0e\u5176\u5b83\u6570\u636e\u8868\u7684\u5173\u7cfb"));
var N=Ba.getJqUi();N.addClass("dm-relation-view");e=new Hb;e.setModifyMode(!0);e.setEntities(pa.getDmModel().copyEntityArray());e.setDirtyListener(g);var t=e.createJqUi();t.addClass("dm-relation-modify-major");var O=$("<div>");O.text(L.get("relatedfield","\u5173\u8054\u5b57\u6bb5"));O.addClass("dm-relation-modify-title");h=$("<div>");h.append(O);h.append(t);ka=new dc;ka.setHorizontalSplit(!1);ka.setFirstSize(-1,0,-1);ka.setSecondSize(160,0,-1);ka.setResizeMode(dc.RESIZE_MODE_SECOND_FIXED);ka.setFirstChild(dc.createChildWrapper(N));
ka.setSecondChild(dc.createChildWrapper(h));ka.getJqUi().addClass("dm-relation-major");Y=new dc;Y.setHorizontalSplit(!0);Y.setFirstSize(260,100,600);Y.setSecondSize(-1,400,-1);Y.setFirstChild(dc.createChildWrapper(va));Y.setSecondChild(ka);N=Y.getJqUi();N.addClass("dm-tab-pane");N.appendTo(z)};this.protectedUpdateUi=function(z,N,t){v(N);e.bindModel(z);if(!t){var O=new p;N=0;for(t=z.getEntityCount();N<t;N++){var W=z.getEntityByIndex(N);W.isSubNodeAtView()||(W=ca(W),O.addTable(W))}N=0;for(t=z.getRelationCount();N<
t;N++)W=z.getRelationByIndex(N),z.isRelationInsideSubSystem(W)||(W=fa(W),O.addRelation(W));Ba.setDataModel(O)}O=$(document.createDocumentFragment());N=0;for(t=z.getRelationCount();N<t;N++)W=z.getRelationByIndex(N),z.isRelationInsideSubSystem(W)||O.append(k(W));va.empty();va.append(O);pa.updateEntityRelationToUi();U();w()};this.protectedModelChanged=function(z,N){if(Ba){var t=Ba.getDataModel();if(z==X.KEY_ADD_ENTITIES){for(var O=!1,W=0;W<N.length;W++)z=N[W],z.isSubNodeAtView()||(O=ca(z),t.addTable(O),
O=!0);O&&e.setEntities(pa.getDmModel().copyEntityArray());g()}else if(z==X.KEY_REFRESH_ENTITY)z=N,z.isSubNodeAtView()||(t.refreshTable(z.getName()),e.setEntities(pa.getDmModel().copyEntityArray())),g();else if(z==X.KEY_REMOVE_ENTITY)z=N,z.isSubNodeAtView()||(O=t.getTableById(z.getName()),t.removeTable(O),e.setEntities(pa.getDmModel().copyEntityArray())),g();else if(z==X.KEY_ADD_RELATION)W=N,z=pa.getDmModel(),z.isRelationInsideSubSystem(W)||(O=k(W),va.append(O),U(),z=fa(W),t.addRelation(z),xb(W,t),
v(N)),g();else if(z==X.KEY_REFRESH_RELATION)v(N),g();else if(z==X.KEY_REMOVE_RELATION){W=N;O=x(W);O.remove();U();v(null);var Fa=W.getFromEntity().getTopParentEntity().getName(),Wa=W.getToEntity().getTopParentEntity().getName();z=t.getRelationByTableId(Fa,Wa);t.removeRelation(z);xb(W,t);g()}else if(z==Pb.KEY_FROM_PROPERTY_ALIAS_CHANED)W=N,z=pa.getDmModel(),z.isRelationInsideSubSystem(W)||xb(W,t);else if(z==Pb.KEY_TO_PROPERTY_ALIAS_CHANED)W=N,z=pa.getDmModel(),z.isRelationInsideSubSystem(W)||xb(W,t);
else if(z==Va.KEY_CHANGE_ENTITYALIAS){z=N;N=(W=z.isSubNodeAtView())?z.getTopParentEntity().getName():z.getName();O=t.getTableById(N);W?O.refreshSubEntityDisplayName(z):O.setDisplayName(z.getAlias());z=pa.getDmModel();t=va.find(".dm-relation-list-item");for(W=0;W<t.length;W++){O=$(t[W]);Fa=fb.decode(O.attr("datamodeling-name1"));Wa=fb.decode(O.attr("datamodeling-name2"));Fa=z.getEntityByName(Fa);var ua=z.getEntityByName(Wa);Wa=Fa.getTopParentEntity().getName();Fa=Fa.getTopParentEntity().getAlias();
var D=ua.getTopParentEntity().getName();ua=ua.getTopParentEntity().getAlias();Wa==N?(O=O.find(".dm-relation-list-item-text"),ua=z.getEntityByName(D).getAlias(),O.text(Fa+"-"+ua)):D==N&&(O=O.find(".dm-relation-list-item-text"),Wa=z.getEntityByName(Wa).getAlias(),O.text(Wa+"-"+ua))}w();g()}else if(z==Pb.KEY_FROM_ENTITY||z==Pb.KEY_TO_ENTITY)W=N.getRelation(),N=N.getOldValue().getName(),Fa=W.getFromEntity().getName(),Wa=W.getToEntity().getName(),O=A(z==Pb.KEY_FROM_ENTITY?N:Fa,z==Pb.KEY_TO_ENTITY?N:Wa),
y(O,Fa,Wa);else if(z==Pb.KEY_FROM_PROPERTY||z==Pb.KEY_TO_PROPERTY||z==Pb.KEY_RELATED)W=N.getRelation(),z=pa.getDmModel(),z.isRelationInsideSubSystem(W)||(Fa=W.getFromEntity().getTopParentEntity().getName(),Wa=W.getToEntity().getTopParentEntity().getName(),z=t.getRelationByTableId(Fa,Wa),t.removeRelation(z),z=fa(W),t.addRelation(z),xb(W,t),v(W));else if(z==X.KEY_MOVE_UP_RELATION||z==X.KEY_MOVE_DOWN_RELATION)U(),pa.protectedUpdateUi(pa.getDmModel(),b,!0),v(b),g()}};this.into=function(){Y.resize();Ba.updateViewBounds()};
this.resize=function(){Y.resize();Ba.updateViewBounds()};this.collectEdited=function(){if(Ba)for(var z=pa.getDmModel(),N=Ba.getDataModel(),t=0;t<N.getTableCount();t++){var O=N.getTable(t);z.getEntityByName(O.getId()).getDesign(!0).setRectangle(O.getRect())}};this.updateEntityRelationToUi=function(){if(va)for(var z=va.find(".dm-relation-list-item"),N=0;N<z.length;N++){var t=$(z[N]),O=t.find(".dm-relation-list-item-icon"),W=t.find(".dm-relation-list-item-text"),Fa=t.find(".dm-entity-list-item-notexist");
Fa&&Fa.remove();Fa=t.data("entityRelation");t=L.get("notExistProperty","\u5173\u8054\u5173\u7cfb\u5f15\u7528\u4e86\u4e0d\u5b58\u5728\u7684\u5b57\u6bb5:");var Wa=!1,ua=!1,D="";if(Fa.getFromProperty().isNotExisted()){Wa=ua=!0;var la=Fa.getFromEntity();D+=la.getAlias()+"."+Fa.getFromProperty().getAlias()}d(Fa.getFromProperty())&&(Wa=ua=!0,la=Fa.getFromEntity(),D+=la.getAlias()+"."+Fa.getFromProperty().getAlias());""!==D&&(Fa.getFromEntity()instanceof Ob||Fa.getFromEntity().getSource().isShowEntityMark())&&
(t=L.get("relationRefNotExistedProp",'\u5173\u8054\u5173\u7cfb\u5f15\u7528\u4e86\u4e0d\u5b58\u5728\u6216\u672a\u5f00\u542f"\u652f\u6301\u8f7b\u5206\u6790"\u8bbe\u7f6e\u9879\u7684\u5b57\u6bb5:'));la="";if(Fa.getToProperty().isNotExisted()){ua=!0;var za=Fa.getToEntity();la+=(Wa?"\uff0c":"")+za.getAlias()+"."+Fa.getToProperty().getAlias()}d(Fa.getToProperty())&&(ua=!0,za=Fa.getToEntity(),la+=(Wa?"\uff0c":"")+za.getAlias()+"."+Fa.getToProperty().getAlias());""!==la&&(Fa.getToEntity()instanceof Ob||Fa.getToEntity().getSource().isShowEntityMark())&&
(t=L.get("relationRefNotExistedProp",'\u5173\u8054\u5173\u7cfb\u5f15\u7528\u4e86\u4e0d\u5b58\u5728\u6216\u672a\u5f00\u542f"\u652f\u6301\u8f7b\u5206\u6790"\u8bbe\u7f6e\u9879\u7684\u5b57\u6bb5:'));t=t+D+la;ua?(Fa=Ga.createWarning(),Fa.addClass("dm-entity-list-item-notexist"),Fa.attr("title",t),Fa.css("top","30%"),O.css("left","19px"),W.css("left","35px"),Fa.insertBefore(O)):(O.css("left","4px"),W.css("left","24px"))}};var d=function(z){return z&&z.isCalculatingField()&&z.isCalculatingFieldInvalid()},
g=function(){pa.getGlobalDependence().setDirty(!0)},k=function(z){var N=z.getFromEntity(),t=z.getToEntity(),O=N.getTopParentEntity(),W=t.getTopParentEntity(),Fa=$("<div>");Fa.addClass("dm-relation-list-item");Fa.data("entityRelation",z);y(Fa,N.getName(),t.getName());Fa.on("mousedown",n);Fa.on("mouseenter",E);Fa.on("mouseleave",Z);z=$("<div>");z.addClass("dm-relation-list-item-icon");Xa.background(z,"relation");N=$("<div>");N.addClass("dm-relation-list-item-text");N.text(O.getAlias()+"-"+W.getAlias());
O=$("<div>");O.addClass("dm-relation-list-item-up-down");W=$("<div>");W.attr("title",L.get("moveUpRelation","\u4e0a\u79fb"));W.addClass("dm-relation-list-item-up");Xa.background(W,"up_move");W.on("click",ba);O.append(W);W=$("<div>");W.attr("title",L.get("moveDownRelation","\u4e0b\u79fb"));W.addClass("dm-relation-list-item-down");Xa.background(W,"down_move");W.on("click",K);O.append(W);O=$("<div>");O.attr("title",L.get("deleteRelation","\u5220\u9664"));O.addClass("dm-relation-list-item-delete");Xa.background(O,
"delete");O.on("click",C);Fa.append(z);Fa.append(N);Fa.append(O);return Fa},a=function(z,N){N=pa.getDmModel().getEntityByName(N.getId());N=nb.entity2IconName(N)+"_selected";Xa.background(z,N)},r=function(z,N,t){N=t.getUserObject();N=nb.dataType2IconName(N);Xa.background(z,N)},y=function(z,N,t){z.attr("datamodeling-name1",fb.encode(N));z.attr("datamodeling-name2",fb.encode(t))},x=function(z){var N=z.getFromEntity().getName();z=z.getToEntity().getName();return A(N,z)},A=function(z,N){return va.find("[datamodeling-name1='"+
fb.encode(z)+"'][datamodeling-name2='"+fb.encode(N)+"']")},v=function(z){b=z;H();u();w()},H=function(){var z=va.find(".dm-relation-list-item");z.removeClass("dm-relation-list-item_selected");for(var N=0;N<z.length;N++){var t=$(z[N]),O=t.find(".dm-relation-list-item-icon");Xa.background(O,"relation");O=t.find(".dm-relation-list-item-delete");Xa.background(O,"delete");O=t.find(".dm-relation-list-item-up");Xa.background(O,"up_move");t=t.find(".dm-relation-list-item-down");Xa.background(t,"down_move")}b&&
(z=x(b),z.addClass("dm-relation-list-item_selected"),N=z.find(".dm-relation-list-item-icon"),Xa.background(N,"relation_selected"),O=z.find(".dm-relation-list-item-delete"),Xa.background(O,"delete_selected"),O=z.find(".dm-relation-list-item-up"),Xa.background(O,"up_move_selected"),t=z.find(".dm-relation-list-item-down"),Xa.background(t,"down_move_selected"))},u=function(){if(b){var z=b.getFromEntity().getTopParentEntity().getName(),N=b.getToEntity().getTopParentEntity().getName();z=Ba.getDataModel().getRelationByTableId(z,
N);Ba.setSelectedRelation(z)}},w=function(){e.setRelation(b);h.css("display",b?"block":"none")},n=function(z){var N=$(z.currentTarget);var t=fb.decode(N.attr("datamodeling-name1"));N=fb.decode(N.attr("datamodeling-name2"));t=pa.getDmModel().getRelationByEntitiesName(t,N);z=$(z.target);z.hasClass("dm-relation-list-item-up")||z.hasClass("dm-relation-list-item-down")?(f=t,H(),u(),w()):b!=t&&v(t)},E=function(z){var N=$(z.currentTarget);N.find(".dm-relation-list-item-delete").css("display","block");z=
N.prev();var t=N.next(),O=N.find(".dm-relation-list-item-up");O&&O.css("display","block");(N=N.find(".dm-relation-list-item-down"))&&N.css("display","block");0<z.length&&0>=t.length&&N&&N.attr("disabled","disabled").css("opacity","0.6");0<t.length&&0>=z.length&&O&&O.attr("disabled","disabled").css("opacity","0.6")},Z=function(z){if(!c){z=$(z.currentTarget);z.find(".dm-relation-list-item-delete").css("display","none");var N=z.find(".dm-relation-list-item-up");N&&N.css("display","none");(z=z.find(".dm-relation-list-item-down"))&&
z.css("display","none")}},C=function(z){var N=L.get("confirmDelRelation","\u5220\u9664\u8be5\u5173\u7cfb\u540e\u5c06\u65e0\u6cd5\u6062\u590d\uff0c\u786e\u5b9a\u5220\u9664\u8be5\u5173\u7cfb\u5417\uff1f"),t=$(z.currentTarget);z=new rb;z.setText(N);z.setConfirmedListener(function(O){O&&pa.getDmModel().removeRelation(b);c=!1;t.css("display","none");O=t.parent();var W=O.find(".dm-relation-list-item-up");W&&W.css("display","none");(O=O.find(".dm-relation-list-item-down"))&&O.css("display","none")});z.show(t);
c=!0},ba=function(z){pa.getDmModel().moveUpRelation(f)},K=function(z){pa.getDmModel().moveDownRelation(f)},ca=function(z){var N=z.getName(),t=new nc;t.setId(N);t.setDisplayName(z.getAlias());(N=z.getDesign())&&t.setRect(N.getRectangle());P(z,t);return t},P=function(z,N){var t=[],O={},W=pa.getDmModel(),Fa=W.isEntityWithSubNodes(z);z=W.getEntityWithSubNodes(z);for(var Wa=0;Wa<z.length;Wa++)for(var ua=z[Wa],D=W.searchRelationsByEntityName(ua.getName()),la=0;la<D.length;la++){var za=D[la];if(!W.isRelationInsideSubSystem(za)){var F;
za.getFromEntity().getName()==ua.getName()?F=za.getFromProperty():za.getToEntity().getName()==ua.getName()&&(F=za.getToProperty());var ja=ua.getName()+"."+F.getName();O[ja]||(O[ja]=!0,za=new jb,za.setId(ja),ja=F.getParent(),Fa&&za.setSubNodeEntity(ua),ja=ja?ja.getAlias()+"."+F.getAlias():F.getAlias(),za.setDisplayName(ja),za.setUserObject(F.getOutputDataType()),t.push(za))}}N.setFields(t)},fa=function(z){var N=z.getFromEntity(),t=z.getToEntity(),O=new Fc;O.setFromTableId(N.getTopParentEntity().getName());
O.setFromFieldId(N.getName()+"."+z.getFromProperty().getName());O.setToTableId(t.getTopParentEntity().getName());O.setToFieldId(t.getName()+"."+z.getToProperty().getName());N=O.setRelated;a:switch(z=z.getRelated(),z){case Pb.R_1_1:z=Fc.R_11;break a;case Pb.R_1_N:z=Fc.R_1N;break a;case Pb.R_N_1:z=Fc.R_N1;break a;default:throw Error("Unknown Related: "+z);}N.call(O,z);return O},xb=function(z,N){var t=z.getFromEntity().getTopParentEntity(),O=N.getTableById(t.getName());O&&P(t,O);t=z.getToEntity().getTopParentEntity();
(O=N.getTableById(t.getName()))&&P(t,O)},tb=function(z,N){if(z){if(z=pa.getDmModel(),b=z.getRelationByEntitiesName(N.getFromTableId(),N.getToTableId()),!b){var t=z.getEntityByName(N.getFromTableId());N=z.getEntityByName(N.getToTableId());for(var O=z.getEntityWithSubNodes(t),W=z.getEntityWithSubNodes(N),Fa=0;Fa<O.length;Fa++){t=O[Fa];for(var Wa=0;Wa<W.length;Wa++)if(N=W[Wa],b=z.getRelationByEntitiesName(t.getName(),N.getName())){Fa=O.length;break}}}}else b=null;H();w()},Qb=function(z){var N;z=0;for(var t=
pa.getDmModel(),O=0;O<t.getEntityCount();O++)t.getEntityByIndex(O).isSubNodeAtView()||z++;a:{t=pa.getDmModel().getAllEntity();for(O=0;O<t.length;O++)if(!t[O].isSupportCreateRelation()){t=t[O].getSource().getDisplayName(t[O].getAssociateName());O=L.get("noSupportCreateRelation","\u4e0d\u652f\u6301\u521b\u5efa#1\u95f4\u7684\u5173\u7cfb\u3002");pa.getGlobalDependence().getMessageCurtain().showPrompt(O.replace("#1",t));t=!1;break a}t=!0}t&&(2>z?N=L.get("relationNeedTwoEntity","\u4e24\u4e2a\u53ca\u4ee5\u4e0a\u7684\u6570\u636e\u8868\u624d\u53ef\u4ee5\u5efa\u7acb\u5173\u7cfb\u3002"):
Ca()==z-1&&(N=L.get("cannotAddMoreRelation","\u4e0d\u80fd\u65b0\u5efa\u66f4\u591a\u7684\u5173\u7cfb\u3002")),N?pa.getGlobalDependence().getMessageCurtain().showPrompt(N):(N=new Tb,N.prepare(pa.getDmModel(),pa.getGlobalDependence()),N.showDialog()))},U=function(){va.find(".dm-relation-list-nodataprompt").remove();if(0==Ca()){var z=$("<div>");z.text(L.get("noRelationCreated","\u672a\u521b\u5efa\u6570\u636e\u8868\u95f4\u7684\u5173\u7cfb"));z.addClass("dm-relation-list-nodataprompt");va.append(z)}},Ca=
function(){for(var z=0,N=pa.getDmModel(),t=0,O=N.getRelationCount();t<O;t++){var W=N.getRelationByIndex(t);N.isRelationInsideSubSystem(W)||z++}return z}}function Kc(){Cb.call(this);var pa=this,Y,ka,va;this.protectedInit=function(c){var d=new sc;d.setText(L.get("dataExtract","\u6570\u636e\u63d0\u53d6"));d=d.getJqUi();Y=new mc;Y.setCronAnalysisFacade(Ba);Y.setScheduleChangedListener(h);Y.setUnTimingButtonText(L.get("disposableExtract","\u5b9e\u65f6\u63d0\u53d6"));Y.setTimingButtonText(L.get("timingExtract",
"\u5b9a\u65f6\u9884\u63d0\u53d6"));var g=Y.getJqUi();va=new Ea;va.setConfigChangedListener(e);var k=va.getJqUi();b();$a.layoutCtrl(d,20,25,200,23);$a.layoutCtrl(g,20,55,500,500);$a.layoutCtrl(k,40,240,480,100);d.appendTo(c);g.appendTo(c);k.appendTo(c)};this.into=function(){a:{for(var c=pa.getDmModel().getAllEntity(),d=0;d<c.length;d++)if(!c[d].isSupportExtractData()){c=c[d].getSource().getDisplayName(c[d].getAssociateName());d=L.get("noSupportExtractTimingData","#1\u7c7b\u578b\u7684\u6570\u636e\u8868\u4e0d\u652f\u6301\u5b9a\u65f6\u9884\u63d0\u53d6");
Y.setTimingButtonDisabled(!0);Y.setTimingButtonTip(d.replace("#1",c));break a}Y.setTimingButtonDisabled(!1);Y.removeTimingButtonTip()}f()};var Ba=function(c,d,g){d=pa.getGlobalDependence().createFacade(d,g);d.setShowBlocking(!0);d.cronExpression(c)},h=function(){pa.getGlobalDependence().setDirty(!0);f()},e=function(c){pa.getGlobalDependence().setDirty(!0);pa.getDmModel().setExtractConfig(c)},b=function(){var c=pa.getGlobalDependence().createFacade(function(d){va.setExtractUserLimit(d)},function(d,
g){return!0});c.setShowBlocking(!1);c.getExtractUserLimit()},f=function(){var c=Y.getSchedule().getPeriod(),d=va.getJqUi();c?(d.show(),$a.layoutCtrl(d,40,wc.Period_Monthly===c?240:wc.Period_Weekly===c?300:180,480,100)):d.hide()};this.protectedUpdateUi=function(c){var d=c.getExtractSchedule();Y.setSchedule(d);ka=c.getExtractConfig();va.setExtractConfig(ka)};this.showTimingExtractCustomPanePrompt=function(){Y&&Y.showCustomPanePrompt()};this.validateExtractConfig=function(){return Y&&Y.getSchedule().getPeriod()?
va.validateConfig():null}}function Cc(){Wc.AbstractTabPane.call(this);var pa=this,Y,ka,va,Ba,h,e;this.setTitle=function(b){Y=b};this.getTitle=function(){return Y};this.getJqUi=function(){h||(h=$("<div>"),pa.protectedInit(h),void 0!==e&&pa.protectedUpdateUi(e));return h};this.protectedInit=function(b){throw Error("Override me.");};this.updateUi=function(b){e=b;h&&pa.protectedUpdateUi(e)};this.protectedUpdateUi=function(b){throw Error("Override me.");};this.afterResize=function(){throw Error("Override me.");
};this.setGlobalDependence=function(b){ka=b};this.setPreviewRefreshRequestListener=function(b){va=b};this.setFieldAliasEditListener=function(b){Ba=b};this.protectedMethod={getGlobalDependence:function(){return ka},firePreviewRefreshWithOnlyRepaint:function(b){ka.setDirty(!0);e&&va(b)},fireAliasEditRepaint:function(b){e&&Ba(b)},getCurrentEntity:function(){return e}}}function xc(){function pa(k){KTDefaultCellRender.call(this,k);var a=[Db.DT_STRING,Db.DT_NUMBER,Db.DT_INT,Db.DT_DATE,Db.DT_DATETIME,Db.DT_BOOLEAN],
r=this,y=this.paintCellUI;this.paintCellUI=function(H,u){if(r.getCurrentRowIdx()<ha.getHeadRowCount())y(H,u);else{var w=r.getCurrentRow().getUserObject();if(1==r.getCurrentColIdx()){var n=$(H);w=r.getCell().getValue();H=$("<div>");H.text(w);H.addClass("dm-common-tablecell-editable");n.empty();n.append(H);n.css("cursor","pointer")}else w instanceof Db?(n=$(H),2==r.getCurrentColIdx()?x(H,r.getCellWidth(),r.getCellHeight(),w,r.getCurrentRow()):3==r.getCurrentColIdx()?(H=r.getCell().getValue(),w=w.getOutputDataType(),
n.empty(),H&&(u=new Eb,u.setJustForInteger(w==Db.DT_INT),w=u.toSampleString(H),H=$("<div>"),H.text(w),H.addClass("dm-entity-fieldtable-format-text"),H.appendTo(n),w=$("<div>"),Xa.background(w,"btn_edit"),w.addClass("dm-entity-fieldtable-format-icon"),w.appendTo(n))):4==r.getCurrentColIdx()?(H=new I,H.setChecked(w.isHide()),H.setUserObject(w),H.addCheckedListener(g),w=H.getJqUi(),w.addClass("dm-entity-fieldtable-checkbox"),w.appendTo(n)):(y(H,u),n.css("cursor","default"),0==r.getCurrentColIdx()&&(w.isCalculatingField()?
(v(n,w),w.isCalculatingFieldInvalid()&&(H=Ga.createWarning(),H.addClass("dm-entity-fieldtable-name-error"),H.attr("title",L.get("CalculatingField","\u8ba1\u7b97\u5b57\u6bb5")+'"'+w.getAlias()+'"'+L.get("invalid","\u65e0\u6548")),n.append(H))):w.isColumnToRowField()?w.isColumnToRowFieldInvalid()&&(H=Ga.createWarning(),H.addClass("dm-entity-fieldtable-name-error"),H.attr("title",L.get("columnToRowPropertyNotExists","\u5217\u8f6c\u884c\u5b57\u6bb5\u4e0d\u5b58\u5728\uff0c\u8bf7\u91cd\u65b0\u914d\u7f6e\u5217\u8f6c\u884c")),
n.append(H)):w.isNotExisted()&&(A(n,w),$(u).css({right:"31px",width:"unset"}),H=Ga.createWarning(),H.addClass("dm-entity-fieldtable-name-error"),H.attr("title",L.get("fieldNotExistInfo","\u8be5\u6570\u636e\u6e90\u4e2d\u4e0d\u5b58\u5728\u5b57\u6bb5")+'"'+w.getName()+'"'),(u=h)&&u.isUnion()&&(u=u.getChildren()[0]),u&&u.getSource().isShowEntityMark()&&H.attr("title",L.get("fieldNotExistInfo","\u8be5\u6570\u636e\u6e90\u4e2d\u4e0d\u5b58\u5728\u5b57\u6bb5")+'"'+w.getName()+'"'+L.get("fieldNotSupportQing",
'\u6216\u8be5\u5b57\u6bb5\u672a\u5f00\u542f"\u652f\u6301\u8f7b\u5206\u6790"\u8bbe\u7f6e\u9879')),n.append(H))))):y(H,u)}};var x=function(H,u,w,n,E){var Z=n.getDataType();n=n.getOutputDataType();H=ha.createCtrlInCell(H,u,w,cd);H.setSelected(n);H.setItemModels(a);H.setUserObject(E);H.setEnabled(e);H.setCustomPainter(function(C,ba,K){C=C?!1:K==Z;var ca=nb.dataType2IconName(K),P=$("<div>");P.addClass("dm-entity-fieldtable-datatype-icon");Xa.background(P,ca);P.appendTo(ba);K=bc.getDataTypeDesc(K);ca=$("<div>");
ca.text(K+(C?"("+L.get("origin","\u539f\u59cb")+")":""));ca.addClass("dm-entity-fieldtable-datatype-text");ca.appendTo(ba)});H.addSelectedChangedListener(d)},A=function(H,u){var w=$("<div>");w.addClass("dm-entity-fieldtable-op");w.addClass("dm-entity-fieldtable-op-delete");Xa.backgroundWithHover(w,"btn_delete");w.on("click",function(n){n=new rb;n.setText(L.get("deleteUnExistedField","\u5220\u9664\u8be5\u5b57\u6bb5\u540e\u5c06\u65e0\u6cd5\u6062\u590d\uff0c\u786e\u5b9a\u5220\u9664\u8be5\u5b57\u6bb5\u5417\uff1f"));
n.setConfirmedListener(function(E){E&&Ba("delete",u)});n.show(w)});H.append(w)},v=function(H,u){var w=$("<div>");w.addClass("dm-entity-fieldtable-op");w.addClass("dm-entity-fieldtable-op-edit");Xa.backgroundWithHover(w,"btn_edit");w.on("click",function(E){Ba("modify",u)});var n=$("<div>");n.addClass("dm-entity-fieldtable-op");n.addClass("dm-entity-fieldtable-op-delete");Xa.backgroundWithHover(n,"btn_delete");n.on("click",function(E){E=new rb;E.setText(L.get("deleteCustomField","\u5220\u9664\u8be5\u5b57\u6bb5\u540e\u5c06\u65e0\u6cd5\u6062\u590d\uff0c\u786e\u5b9a\u5220\u9664\u8be5\u5b57\u6bb5\u5417\uff1f"));
E.setConfirmedListener(function(Z){Z&&Ba("delete",u)});E.show(n)});H.append(w);H.append(n)}}Cc.call(this);var Y=this.protectedMethod,ka,va,Ba,h,e=!0;this.protectedInit=function(k){ka=ha.createTable();ka.addCellClickListener(c);ha.bindTextEditor(ka,b,f);ha.bindTableListenerForCtrl(ka);var a=new pa(ka);a.setOutsideVisible(!1);ka.setCellRender(a);ka.addColumns(5);ka.getColumn(0).setWidth(200);ka.getColumn(1).setWidth(200);ka.getColumn(2).setWidth(140);ka.getColumn(3).setWidth(160);ka.getColumn(4).setWidth(140);
a=ha.createHeadRow(ka);a.getCell(0).setValue(L.get("fieldName","\u5b57\u6bb5\u540d\u79f0"));a.getCell(1).setValue(L.get("showName","\u663e\u793a\u540d\u79f0"));a.getCell(2).setValue(L.get("dataType","\u6570\u636e\u7c7b\u578b"));a.getCell(3).setValue(L.get("numberFormat","\u6570\u5b57\u683c\u5f0f"));a.getCell(4).setValue(L.get("hideWhileAnalyze","\u5728\u5206\u6790\u4e2d\u9690\u85cf"));a=$(ka.getUI());a.addClass("dm-entity-fieldtable");a.appendTo(k);ka.setSyncUIWhenModelChanged(!0)};this.protectedUpdateUi=
function(k){h=k;var a=[];k&&(a=k.getPropertyViewNodes(),e=k.isSupportChangeFieldType());ha.clearWithoutHead(ka);ka.setSyncUIWhenModelChanged(!1);for(k=0;k<a.length;k++){var r=a[k],y=r.isProperty();if(!y||!r.getModel().isHideInDataModeling()){var x=ha.createRow(ka);var A=r.getTreeLevel();A=new KTCellTreeModel(A);x.getCell(0).setTreeModel(A);x.getCell(0).setValue(r.getDisplayName());x.getCell(1).setValue(r.getAlias());y?(x.setUserObject(r.getModel()),y=x,r=r.getModel(),y.getCell(2).setValue(r.getOutputDataType()),
y.getCell(3).setValue(r.getFormatString()?r.getFormatString():""),y.getCell(4).setValue(r.isHide())):x.setUserObject(r)}}x&&(a=(a=x.getBorder())?a.copy():new KTBorderStyle,a.setBottomBorderWidth(1),a.setBottomBorderPen("solid"),a.setBottomBorderColor("#eee"),x.setBorder(a));ka.setSyncUIWhenModelChanged(!0);ha.refresh(ka)};this.afterResize=function(){ka.relayoutViews()};this.into=function(){ka.relayoutViews()};this.setValidNameChecker=function(k){va=k};this.setCustomFieldHandler=function(k){Ba=k};
this.scrollToBottom=function(){var k=ka.getRowsCount()-1;ka.scrollCellVisible(k,0,!0)};var b=function(k,a){return 1==a},f=function(k,a,r,y,x){a=k.getUserObject();var A=Y.getCurrentEntity(),v=!1;if(A){A=A.getPropertyViewNodes();for(var H=0;H<A.length;H++){var u=A[H];if(a instanceof Db){if(a.getName()==u.getUniqueName())continue}else if(u.getUniqueName()==a.getUniqueName())continue;if(u.getAlias()==y){v=!0;break}}}if(v)return k=L.get("duplicatedName","\u91cd\u590d\u7684\u5b57\u6bb5\u663e\u793a\u540d\u79f0\uff1a")+
y,x||(k+=L.get("abandonModify","\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002")),Y.getGlobalDependence().getMessageCurtain().showPrompt(k),!1;if(!va(y))return k=L.get("invalidFieldName","\u5b57\u6bb5\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e14\u4e0d\u80fd\u5305\u542b\u7a7a\u683c\u3002"),""==y&&(k=L.get("fieldNameNull","\u5b57\u6bb5\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a\u3002")),x||(k=""==y?L.get("abandonModifysAndFieldNameNull",
"\u5b57\u6bb5\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002"):L.get("abandonModifyAndFielNameValid","\u5b57\u6bb5\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e14\u4e0d\u80fd\u5305\u542b\u7a7a\u683c\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002")),Y.getGlobalDependence().getMessageCurtain().showPrompt(k),!1;a.getAlias()!=y&&(r.setValue(y),a.setAlias(y),a.getDisplayName&&k.getCell(0).setValue(a.getDisplayName()),
Y.firePreviewRefreshWithOnlyRepaint(!0),Y.fireAliasEditRepaint(a));return!0},c=function(k,a){if(!(a.getRowIdx()<ha.getHeadRowCount())&&3==a.getColIdx()){var r=a.getCell();if(r&&r.getValue()){var y=a.getRow().getUserObject();k=new oa;k.edit(y.getAlias(),y.getFormatString(),function(x){y.setFormatString(x);r.setValue(x);Y.firePreviewRefreshWithOnlyRepaint(!0)});k.showDialog()}}},d=function(k,a,r){k=k.getUserObject();var y=k.getUserObject();y.setAppointedDataType(r);a!=r&&(Db.confirmDefaultFormatString(y),
k.getCell(3).setValue(y.getFormatString()));Ba("recheckAll",null);Y.firePreviewRefreshWithOnlyRepaint(!1)},g=function(k,a){a&&(k.getUserObject().setHide(k.isChecked()),Y.getGlobalDependence().setDirty(!0))}}function Ub(){Cc.call(this);var pa=!0,Y,ka,va,Ba,h,e,b;this.getSelectEntity=function(){return va};this.setSqlContent=function(d){d?(d=d.toUpperCase(),d=d.replace(RegExp(",","gm"),",\n"),d=d.replace(RegExp("SELECT","gm"),"SELECT\n"),d=d.replace(RegExp("FROM","gm"),"\nFROM\n"),d=d.replace(RegExp("WHERE",
"gm"),"\nWHERE\n"),d=d.replace(RegExp("UNION","gm"),"\nUNION\n"),d=d.replace(RegExp("GROUP BY","gm"),"\nGROUP BY\n"),d=d.replace(RegExp("HAVING","gm"),"\nHAVING\n"),Y=d=d.replace(RegExp("ORDER BY","gm"),"\nORDER BY\n")):Y=L.get("emptyData","\u6682\u65e0\u76f8\u5173\u6570\u636e")};this.setUnPushdownFilterContent=function(d){ka=d?d:L.get("emptyData","\u6682\u65e0\u76f8\u5173\u6570\u636e")};this.setNeedOpenNewTab=function(d){pa=d};this.isNeedOpenNewTab=function(){return pa};this.protectedInit=function(d){d.css("overflow",
"auto");d.css("white-space","pre-wrap");e=$("<div>");e.addClass("dm-view-system-variable");e.css("overflow","auto");var g=$("<div id ='SQL_CONTENT' >"),k=$("<div id ='SQL_CONTENT_icon'>");k.text("\u25b2");k.addClass("dm-view-system-variable-icon-close");var a=$("<div id ='SQL_CONTENT_text'>");a.text(L.get("sqlContent","\u811a\u672c\u5185\u5bb9"));a.addClass("dm-view-system-variable-text");k.appendTo(g);a.appendTo(g);g.appendTo(e);Ba=$("<textarea id='SQL_CONTENT_value' >");k={position:"relative",width:"90%",
height:"200px",color:"#666",border:"0.1px solid #E9ECF1"};Ba.css(k);Ba.attr("readonly",!0);Ba.text(Y);Ba.addClass("dm-view-system-variable-value");Ba.appendTo(e);g.on("click",function(y){c(y)});g=$("<div id ='SQL_FILTER' >");a=$("<div id ='SQL_FILTER_icon'>");a.text("\u25b2");a.addClass("dm-view-system-variable-icon-close");var r=$("<div id ='SQL_FILTER_text'>");r.text(L.get("unPushdownFilterConditions","\u4e0d\u53ef\u4e0b\u63a8\u7684\u8fc7\u6ee4\u6761\u4ef6"));r.addClass("dm-view-system-variable-text");
a.appendTo(g);r.appendTo(g);g.appendTo(e);h=$("<textarea id='SQL_FILTER_value' >");h.css(k);h.css("height","120px");h.attr("readonly",!0);h.text(ka);h.addClass("dm-view-system-variable-value");h.appendTo(e);g.on("click",function(y){c(y)});e.appendTo(d);b=$("<div>");b.css({color:"rgb(102, 102, 102)",margin:"10px"});b.text(L.get("unSupportSqlParse","\u5f53\u524d\u6570\u636e\u7c7b\u578b\u6682\u4e0d\u652f\u6301SQL\u89e3\u6790\u3002"));b.appendTo(d)};var f=function(){Y==L.get("emptyData","\u6682\u65e0\u76f8\u5173\u6570\u636e")?
(e.hide(),b.show()):(Ba.text(Y),h.text(ka),b.hide(),e.show())};this.protectedUpdateUi=function(d){va=d;f()};var c=function(d){$("#"+d.currentTarget.id+"_value");$("#"+d.currentTarget.id+"_value").is(":hidden")?($("#"+d.currentTarget.id+"_icon").removeClass("dm-view-system-variable-icon-close"),$("#"+d.currentTarget.id+"_icon").addClass("dm-view-system-variable-icon-open"),$("#"+d.currentTarget.id+"_value").css("display","block")):($("#"+d.currentTarget.id+"_icon").removeClass("dm-view-system-variable-icon-open"),
$("#"+d.currentTarget.id+"_icon").addClass("dm-view-system-variable-icon-close"),$("#"+d.currentTarget.id+"_value").css("display","none"))};this.afterResize=function(){f()}}function tc(){l.call(this);var pa=this,Y=this.protectedMethod,ka,va=[];(function(){Y.setTitle(L.get("viewSystemVariable","\u67e5\u770b\u7cfb\u7edf\u53d8\u91cf"));pa.setSize(810,570);Y.setSelectable(!0);Y.setContentPaneCreator(function(){ka||(ka=Ba());return ka});Y.setFooterClosingOnly(!0);Y.setClosingChecker2(null,function(b){Y.destroy();
return!0});Y.setClosingAction(function(b){})})();this.setArrSystemVar=function(b){va=b};this.getArrSystemVar=function(){return va};var Ba=function(){var b=$("<div>");b.addClass("dm-view-system-variable");b.css("overflow","auto");b.css("width","780px");for(var f in va){var c=$("<div id ='"+f+"' >"),d=$("<div id ='"+f+"_icon'>");d.text("\u25b2");d.addClass("dm-view-system-variable-icon-close");var g=$("<div id ='"+f+"_text'>"),k=e(va[f].getName());g.text(k);g.addClass("dm-view-system-variable-text");
d.appendTo(c);g.appendTo(c);c.appendTo(b);d=$("<p id ='"+f+"_value'>");d.text(h(va[f].getValue()));d.addClass("dm-view-system-variable-value");d.appendTo(b);c.on("click",function(a){var r=$("#"+a.currentTarget.id+"_value");a=$("#"+a.currentTarget.id+"_icon");r.is(":hidden")?(a.removeClass("dm-view-system-variable-icon-close"),a.addClass("dm-view-system-variable-icon-open"),r.css("display","block"),r.css("word-break","break-all")):(a.removeClass("dm-view-system-variable-icon-open"),a.addClass("dm-view-system-variable-icon-close"),
r.css("display","none"))})}return b},h=function(b){"\u6682\u65e0\u6570\u636e"==b&&(b=L.get("emptyData","\u6682\u65e0\u6570\u636e"));return b},e=function(b){for(var f,c=0;c<vb.SUPPORTED_VAR_TYPE.length;c++){var d=vb.SUPPORTED_VAR_TYPE[c];if(d.getTypeID()==b){f=L.get(d.getI18nKey(),d.getDefaultDesc());break}}return f}}function Ka(){var pa=this,Y=!1;this.setFromFilterPane=function(h){Y=h};this.checkArrEntityFilter=function(h){for(var e=0;e<h.length;e++){var b=h[e],f=pa.checkEntityFilters(b);if(f)return h=
L.get("entityFilterCriteria","\u6570\u636e\u8868\u201c#1\u201d\u8fc7\u6ee4\u6761\u4ef6").replace("#1",b.getAlias()),f.setPrompt(h+f.getPrompt()),f}return null};this.checkEntityFilters=function(h){if(!h)return null;a:{var e=h.getFilters();for(var b,f=0;f<e.length;f++){var c=e[f];if(!c.isEmpty()){b=h;var d=f,g=b.findProperty(c.getProperty().getName());g?g.isNotExisted()?(g=L.get("lackField","\u7b2c#1\u884c\u5b57\u6bb5\u4e0d\u5b58\u5728\u3002"),g=g.replace("#1",d+1),b=new wa(b.getName(),d,g)):b=null:
(g=L.get("lackField","\u7b2c#1\u884c\u5b57\u6bb5\u4e0d\u5b58\u5728\u3002"),g=g.replace("#1",d+1),b=new wa(b.getName(),d,g));b||(b=h,d=f,g=c.getProperty(),g.isCalculatingField()&&g.isCalculatingFieldInvalid()?(g=L.get("invalidProperty","\u7b2c#1\u884c\u65e0\u6548\u7684\u5b57\u6bb5\u3002"),g=g.replace("#1",d+1),b=new wa(b.getName(),d,g)):b=null);if(!b)b:{b=h;g=c;d=f;if(g.getCompareOp()==ub.COMPARE_VARIABLE&&g.isSystemVariant()){g=g.getValue();for(var k=!1,a=0;a<vb.SUPPORTED_VAR_TYPE.length;a++)if(vb.SUPPORTED_VAR_TYPE[a].getTypeID()==
g){k=!0;break}if(!k){g=L.get("invalidSystemVarType","\u7b2c#1\u884c\u65e0\u6548\u7684\u7cfb\u7edf\u53d8\u91cf\u3002");g=g.replace("#1",d+1);b=new wa(b.getName(),d,g);break b}}b=null}b||(b=Ba(h,c,f));b||(b=h,d=f,(c=c.checkCompletion())?(g=L.get("incompleteFilter","\u7b2c#1\u884c\u4e0d\u5b8c\u6574\uff0c"),g=g.replace("#1",d+1),g+=c,b=new wa(b.getName(),d,g)):b=null);if(b){e=b;break a}}}e=b}return e?e:va(h)};this.checkRelationPropertyExisted=function(h){for(var e=h.copyEntityArray(),b=0;b<e.length;b++)for(var f=
e[b],c=h.searchRelationsByEntityName(f.getName()),d=0;d<c.length;d++){var g=c[d],k=g.getFromEntity().getName()==f.getName(),a=L.get("notExistProperty","\u5173\u8054\u5173\u7cfb\u5f15\u7528\u4e86\u4e0d\u5b58\u5728\u7684\u5b57\u6bb5:");if(k){if(g.getFromEntity()instanceof Ob||g.getFromEntity().getSource().isShowEntityMark())a=L.get("relationRefNotExistedProp",'\u5173\u8054\u5173\u7cfb\u5f15\u7528\u4e86\u4e0d\u5b58\u5728\u6216\u672a\u5f00\u542f"\u652f\u6301\u8f7b\u5206\u6790"\u8bbe\u7f6e\u9879\u7684\u5b57\u6bb5:');
if(g.getFromProperty().isNotExisted()||!f.findProperty(g.getFromProperty().getName()))return a+f.getAlias()+"."+g.getFromProperty().getAlias()+L.get("fullStop","\u3002")}else{if(g.getToEntity()instanceof Ob||g.getToEntity().getSource().isShowEntityMark())a=L.get("relationRefNotExistedProp",'\u5173\u8054\u5173\u7cfb\u5f15\u7528\u4e86\u4e0d\u5b58\u5728\u6216\u672a\u5f00\u542f"\u652f\u6301\u8f7b\u5206\u6790"\u8bbe\u7f6e\u9879\u7684\u5b57\u6bb5:');if(g.getToProperty().isNotExisted()||!f.findProperty(g.getToProperty().getName()))return a+
f.getAlias()+"."+g.getToProperty().getAlias()+L.get("fullStop","\u3002")}if(ka(g.getFromProperty()))return L.get("relationRefInvalidCalculateProp","\u5173\u8054\u5173\u7cfb\u5f15\u7528\u4e86\u65e0\u6548\u7684\u8ba1\u7b97\u5b57\u6bb5\uff1a")+g.getFromEntity().getAlias()+"."+g.getFromProperty().getAlias();if(ka(g.getToProperty()))return L.get("relationRefInvalidCalculateProp","\u5173\u8054\u5173\u7cfb\u5f15\u7528\u4e86\u65e0\u6548\u7684\u8ba1\u7b97\u5b57\u6bb5\uff1a")+g.getFromEntity().getAlias()+"."+
g.getToProperty().getAlias()}return null};this.checkExtractUserConfig=function(h){return(h=h.validateExtractConfig())?(h=new wa("Extract warning",0,h),h.setPromptLevel(wa.LEVEL_WARNING),h):null};var ka=function(h){return h&&h.isCalculatingField()&&h.isCalculatingFieldInvalid()},va=function(h){var e=0,b=-1,f=0;var c=h.getFilters();for(var d=0;d<c.length;d++)c[d].isEmpty()||(f=d);c=f;d=h.getFilters();for(f=0;f<d.length;f++){var g=d[f];if(!g.isEmpty()){e+=g.getLeftBracketCount();e-=g.getRightBracketCount();
0>b&&0!=e&&(b=f);if(0>e)return e=L.get("bracketMismatch","\u5de6\u53f3\u62ec\u53f7\u4e0d\u5339\u914d\u3002"),new wa(h.getName(),b,e);if(f!=c&&!g.getLogicOp())return e=L.get("lackLogicalSymbol","\u7b2c#1\u884c\u7f3a\u5c11\u903b\u8f91\u7b26"),e=e.replace("#1",f+1),new wa(h.getName(),f,e)}}return 0<e?(e=L.get("bracketMismatch","\u5de6\u53f3\u62ec\u53f7\u4e0d\u5339\u914d\u3002"),new wa(h.getName(),b,e)):null},Ba=function(h,e,b){if(e.getCompareOp()==ub.COMPARE_VARIABLE&&e.isMacroVar()&&(e=e.getValue())&&
(e=qa.DesigntimeMacroCache.get(e))&&e.getMacroCheckResult()){var f=e.getMacroCheckResult(),c=com.kingdee.bos.qing.macro.model.MacroStatusEnum;switch(f.getMacroStatus()){case c.AVAILABLE:case c.PROPERTY_ABNORMAL:break;case c.WITHOUT_DB_PERMISSION:case c.WITHOUT_ENTITY_PERMISSION:case c.WITHOUT_DB_CENTER_PERMISSION:case c.WITHOUT_SCHEMA_PERMISSION:case c.NOT_EXIST:return c=L.get("invalidMacroFilter","\u7b2c#1\u884c\u5f15\u7528\u7684\u5b8f\u53d8\u91cf\u5df2\u88ab\u5220\u9664\u6216\u6ca1\u6709\u6743\u9650\u8bbf\u95ee\u3002"),
c=c.replace("#1",b+1),new wa(h.getName(),b,c);case c.MACRO_REJECT:return c=L.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"),c=c.replace("#1",b+1),new wa(h.getName(),b,c);case c.DB_NOT_EXIST:return c=L.get("invalidFilterDBNoExist","\u7b2c#1\u884c\u5f15\u7528\u7684\u5b8f\u53d8\u91cf\u201c#2\u201d\uff0c\u5176\u4f7f\u7528\u7684\u6570\u636e\u5e93\u8fde\u63a5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u3002"),
c=c.replace("#1",b+1),c=c.replace("#2",e.getName()),new wa(h.getName(),b,c);case c.ENTITY_NOT_EXIST:return c=L.get("invalidFilterEntityNoExist","\u8fc7\u6ee4\u6761\u4ef6\u7b2c#1\u884c\u5f15\u7528\u7684\u5b8f\u53d8\u91cf\u201c#2\u201d\uff0c\u5176\u4f7f\u7528\u7684\u57fa\u7840\u8d44\u6599\u4e0d\u5b58\u5728\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u3002"),c=c.replace("#1",b+1),c=c.replace("#2",e.getName()),new wa(h.getName(),b,c);case c.DB_CENTER_NO_APP_METADATA:case c.DB_CENTER_NO_APP:return Y?(c=L.get("appNotExistFilter",
"\u5b8f\u53d8\u91cf\u201c#1\u201d\u4f7f\u7528\u7684\u5e94\u7528\u201c#2\u201d\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u3002"),c=c.replace("#1",e.getName()),c=c.replace("#2",f.getAppNumber())):(c=L.get("appNotExist","\u7b2c#1\u884c\u5f15\u7528\u7684\u5b8f\u53d8\u91cf\u201c#2\u201d\uff0c\u5176\u4f7f\u7528\u7684\u5e94\u7528\u201c#3\u201d\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u3002"),c=c.replace("#1",b+1),c=c.replace("#2",
e.getName()),c=c.replace("#3",f.getAppNumber())),new wa(h.getName(),b,c);case c.DB_CENTER_APP_CLOUD_DISABLED:return Y?(c=L.get("appCloudDisabledFilter","\u5b8f\u53d8\u91cf\u201c#1\u201d\u4f7f\u7528\u7684\u5e94\u7528\u201c#2\u201d\u6240\u5728\u4e91\u88ab\u7981\u7528\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u3002"),c=c.replace("#1",e.getName()),c=c.replace("#2",f.getAppNumber())):(c=L.get("appCloudDisabled","\u7b2c#1\u884c\u5f15\u7528\u7684\u5b8f\u53d8\u91cf\u201c#2\u201d\uff0c\u5176\u4f7f\u7528\u7684\u5e94\u7528\u201c#3\u201d\u6240\u5728\u4e91\u88ab\u7981\u7528\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u3002"),
c=c.replace("#1",b+1),c=c.replace("#2",e.getName()),c=c.replace("#3",f.getAppNumber())),new wa(h.getName(),b,c);case c.DB_CENTER_APP_DISABLED:return Y?(c=L.get("appDisabledFilter","\u5b8f\u53d8\u91cf\u201c#1\u201d\u4f7f\u7528\u7684\u5e94\u7528\u201c#2\u201d\u88ab\u7981\u7528\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u3002"),c=c.replace("#1",e.getName()),c=c.replace("#2",f.getAppNumber())):(c=L.get("appDisabled","\u7b2c#1\u884c\u5f15\u7528\u7684\u5b8f\u53d8\u91cf\u201c#2\u201d\uff0c\u5176\u4f7f\u7528\u7684\u5e94\u7528\u201c#3\u201d\u88ab\u7981\u7528\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u3002"),
c=c.replace("#1",b+1),c=c.replace("#2",e.getName()),c=c.replace("#3",f.getAppNumber())),new wa(h.getName(),b,c);default:throw Error("Unknown macro status: "+f.getMacroStatus());}}return null}}function Fb(){var pa=this,Y,ka,va,Ba,h;this.setFunCheckError=function(e){ka=e};this.setFunGetGlobalDependence=function(e){Y=e};this.setFunGetCurrentEntity=function(e){va=e};this.setFunFirePreviewRefreshWithOnlyRepaint=function(e){Ba=e};this.getJqUi=function(){h||(h=pa.protectedInit());return h};this.protectedInit=
function(){throw Error("overwrite me");};this.updateUi=function(e){throw Error("overwrite me");};this.afterResize=function(){throw Error("overwrite me");};this.locateToErrorRow=function(e,b){throw Error("overwrite me");};this.protectedMethod={checkError:function(){ka&&ka()},getGlobalDependence:Y,getCurrentEntity:function(){return va?va():null},firePreviewRefreshWithOnlyRepaint:function(e){Ba&&Ba(e)}}}function wb(){Fb.call(this);var pa;this.protectedInit=function(){pa=ha.createTable();var Y=new KTDefaultCellRender(pa);
Y.setOutsideVisible(!1);pa.setCellRender(Y);pa.addColumns(8);pa.getColumn(0).setWidth(20);pa.getColumn(1).setWidth(100);pa.getColumn(2).setWidth(180);pa.getColumn(3).setWidth(100);pa.getColumn(4).setWidth(220);pa.getColumn(5).setWidth(100);pa.getColumn(6).setWidth(60);pa.getColumn(7).setWidth(100);Y=ha.createHeadRow(pa);Y.getCell(1).setValue(L.get("leftBracket","\u5de6\u62ec\u53f7"));Y.getCell(2).setValue(L.get("field","\u5b57\u6bb5"));Y.getCell(3).setValue(L.get("compare","\u6bd4\u8f83"));Y.getCell(4).setValue(L.get("value",
"\u503c"));Y.getCell(5).setValue(L.get("rightBracket","\u53f3\u62ec\u53f7"));Y.getCell(6).setValue(L.get("logic","\u903b\u8f91"));Y=$(pa.getUI());Y.addClass("dm-entity-filtertable");pa.setSyncUIWhenModelChanged(!0);return Y};this.updateUi=function(Y){ha.clearWithoutHead(pa);ha.refresh(pa)};this.afterResize=function(){pa.relayoutViews()};this.locateToErrorRow=function(Y,ka){}}function bb(){function pa(u){KTDefaultCellRender.call(this,u);var w=this,n=va,E=this.paintCellUI;this.paintCellUI=function(U,
Ca){if(w.getCurrentRowIdx()<ha.getHeadRowCount()||!w.getCell())E(U,Ca);else{var z=w.getCellWidth(),N=w.getCellHeight(),t=w.getCurrentRow();if(1==w.getCurrentColIdx()||5==w.getCurrentColIdx()){Ca=1==w.getCurrentColIdx();var O=w.getCell().getValue();tb(U,z,N,Ca,O,t)}else if(2==w.getCurrentColIdx()){var W=w.getCell().getValue();Z(U,z,N,W,t)}else 3==w.getCurrentColIdx()?(Ca=w.getCell().getValue(),O=t.getUserObject(),W=O.getProperty(),O=O.getComparedDataType(),W=W?W.isEnum():!1,U=ha.createCtrlInCell(U,
z,N,cd),U.setSelected(Ca),U.setItemModels(O?ub.getSelectableCompares(O,W):[]),U.setUserObject(t),U.setCustomPainter(P),U.addSelectedChangedListener(g)):4==w.getCurrentColIdx()?(Ca=w.getCell().getValue(),xb(U,z,N,Ca,t)):6==w.getCurrentColIdx()?(Ca=w.getCell().getValue(),Qb(U,z,N,Ca,t)):0==w.getCurrentColIdx()?(t=w.getCell().getValue(),U=$(U),U.find(".dm-entity-filtertable-prompt").remove(),t&&(z=Ga.createWarning(),z.addClass("dm-entity-filtertable-prompt"),z.attr("title",t),z.appendTo(U))):E(U,Ca)}};
var Z=function(U,Ca,z,N,t){var O=new ob,W=n.getCurrentEntity(),Fa=W.getFilteredProperties(function(Wa){return!Wa.isHideInDataModeling()});W=W?W.getOutputProperties(Fa):[];O.setItemModel(W);O.setListItemPainter(K);O.setSearchListener(C);O.setShowFieldNameListener(ba);U=ha.createCtrlInCell(U,Ca,z,kb);U.setUserObject(t);U.setSelectedModel(N);U.setDropdownCreator(function(Wa,ua,D){return O.createJqPopup(Wa,ua,D)});U.addSelectionListener(function(Wa){var ua=Wa.getSelectedModel();Wa=Wa.getUserObject();
var D=Wa.getUserObject(),la=D.getProperty(),za=D.getComparedDataType(),F=ua.getOutputDataType();D.setProperty(ua);D.setCompareType(ub.COMPARE_WITH_APPOINTED);Wa.getCell(2).setValue(ua);if(za!=F||la.getEnumValue()!=ua.getEnumValue()){la=D.getCompareOp();ua=ub.getSelectableCompares(F,ua.isEnum());F=!1;for(za=0;za<ua.length;za++)if(la==ua[za]){F=!0;break}F||(la=ub.COMPARE_EQUAL);D.setCompareOp(la);d(Wa.getCell(3),la);D.setValue(null);D.setValueMode(ub.MODE_CONST);D.setRelativeDateRange(null);d(Wa.getCell(4),
" ")}va.checkError();va.firePreviewRefreshWithOnlyRepaint(!1)});U.setCustomPainter(function(Wa,ua){ua.text(Wa?Wa.getAlias():"")})},C=function(U,Ca,z,N,t,O){Ca=Ca.trim().toLowerCase();for(var W=[],Fa,Wa=0;Wa<U.length;Wa++)Fa=U[Wa],(Fa=-1!=Fa.getAlias().trim().toLowerCase().indexOf(Ca)?!0:O&&-1!=Fa.getName().trim().toLowerCase().indexOf(Ca)?!0:!1)&&W.push(U[Wa]);z.children().remove();if(0<W.length){for(Wa=0;Wa<W.length;Wa++)t(W[Wa],z,N);W.length=0}else U=new sc,U.setText(L.get("nothingSearched","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c")),
U.setEnabled(!1),U.setAlign(sc.ALIGN_CENTER),U=U.getJqUi(),U.addClass("dm-field-popup-search-result"),U.appendTo(z);ba(z,O)},ba=function(U,Ca){if(Ca)for(U=U.find(".dm-field-popup-list-item-field-name"),Ca=0;Ca<U.length;Ca++){var z=U.eq(Ca);z.css("display","inline-block");var N=z.prev().text()+z.text();z.prev().attr("title",null);z.parent().attr("title",N)}else for(U=U.find(".dm-field-popup-list-item-field-name"),Ca=0;Ca<U.length;Ca++)z=U.eq(Ca),z.css("display","none"),z.parent().attr("title",null),
z.prev().attr("title",z.prev().text())},K=function(U,Ca,z){var N=$("<div>");N.addClass("dm-field-popup-list-item");N.data("model",U);var t=U?U.getAlias():"",O=$("<span>");O.text(t);O.attr("title",t);O.addClass("dm-field-popup-list-item-text");t="";U&&(t=U.getFormula()?U.getAlias():U.getName());var W=$("<span>");W.addClass("dm-field-popup-list-item-field-name");W.text("("+t+")");N.append(O);N.append(W);Ca.append(N);z&&z.getAlias()==U.getAlias()&&ca(Ca,N)},ca=function(U,Ca){var z=null;0<U.height()?
(clearTimeout(z),Ca.addClass("dm-list-item_selected_enabled"),U.prop("scrollTop",Ca.prop("offsetTop"))):z=setTimeout(function(){ca(U,Ca)},0)},P=function(U,Ca,z){switch(z){case ub.COMPARE_EQUAL:U=L.get("equal","\u7b49\u4e8e");break;case ub.COMPARE_NOT_EQUAL:U=L.get("notEqual","\u4e0d\u7b49\u4e8e");break;case ub.COMPARE_GREATER:U=L.get("greater","\u5927\u4e8e");break;case ub.COMPARE_GREATER_EQUAL:U=L.get("equalOrGreater","\u5927\u4e8e\u7b49\u4e8e");break;case ub.COMPARE_LESS:U=L.get("less","\u5c0f\u4e8e");
break;case ub.COMPARE_LESS_EQUAL:U=L.get("equalOrLess","\u5c0f\u4e8e\u7b49\u4e8e");break;case ub.COMPARE_INCLUDE:U=L.get("include","\u5305\u542b");break;case ub.COMPARE_NOT_INCLUDE:U=L.get("notInclude","\u4e0d\u5305\u542b");break;case ub.COMPARE_START_WITH:U=L.get("startWith","\u5f00\u5934\u662f");break;case ub.COMPARE_END_WITH:U=L.get("endWith","\u7ed3\u5c3e\u662f");break;case ub.COMPARE_NULL:U=L.get("compareNull","\u4e3a\u7a7a");break;case ub.COMPARE_NOT_NULL:U=L.get("compareNotNull","\u4e0d\u4e3a\u7a7a");
break;case ub.COMPARE_RELATIVE_DATE_RANGE:U=L.get("relativeDateRange","\u76f8\u5bf9\u65e5\u671f");break;case ub.COMPARE_VARIABLE:U=L.get("compareVariable","\u5339\u914d\u53d8\u91cf");break;case ub.COMPARE_IN:U=L.get("compareIn","\u5728......\u4e4b\u5185");break;case ub.COMPARE_NOT_IN:U=L.get("compareNotIn","\u4e0d\u5728......\u4e4b\u5185");break;default:U=""}Ca.text(U);Ca.attr("title",U)},fa=function(U,Ca){var z=L.get("enterSplit","\u7cbe\u786e\u5339\u914d\u591a\u503c\uff0c\u5404\u9879\u4e4b\u95f4\u4f7f\u7528\u56de\u8f66\u4f5c\u4e3a\u5206\u9694\u7b26"),
N=U.getCompareOp()==ub.COMPARE_IN?L.get("compareIn","\u5728......\u4e4b\u5185"):L.get("compareNotIn","\u4e0d\u5728......\u4e4b\u5185"),t=JSON.parse(U.getValue());t=t?t.join("\n"):"";var O=new Nb;O.setCaption(N,z);O.setClosingChecker(function(W){if(W&&5E4<W.length)return L.get("matchTooLong","\u5339\u914d\u9879\u4e0d\u80fd\u8d85\u8fc750000\u4e2a\u5b57\u7b26")});O.setText(t,function(W,Fa){W&&H(Ca,U,Fa)});O.showDialogLeftAnchorTo(Ca.getJqUi())},xb=function(U,Ca,z,N,t){var O=$(U);O.empty();O.css("cursor",
"");var W=t.getUserObject(),Fa=W.getCompareOp();if(!ub.isCompareOpWithoutValue(Fa)){var Wa=W.getProperty(),ua=W.getComparedDataType(),D=Wa?Wa.getEnumValue():null;Wa=Wa?Wa.isVoidEnumProp():null;if(Fa==ub.COMPARE_VARIABLE)if(qa.MacroVariateSelectorRegister.isRegisterComplete()){var la=ha.createCtrlInCell(U,Ca,z,Ac);la.setClearable(!0);la.addActionListener(function(lc){lc=new Ia;lc.setSelectedCallback(function($c){A(la,W,$c)});lc.setSelected(la.getModel());lc.showDialog()});la.setCustomPainter(function(lc){var $c=
W.getValue();lc=null==lc?$c?$c:"":lc.getDisplayName();""!=lc&&(lc=(W.isMacroVar()?"$":W.isSystemVariant()?"@":"")+lc);return lc});la.addClearListener(function(lc){A(lc,W,null)});W.isSystemVariant()?Zc.getImpl(Zc.SYS_VAR_HELPER).loadVarModelAdapter(W.getValue(),function(lc){la.setModel(lc)}):W.isMacroVar()&&Zc.getImpl(Zc.MACRO_VAR_HELPER).loadVarModelAdapter(W.getValue(),function(lc){la.setModel(lc)})}else{var za=ha.createCtrlInCell(U,Ca,z,cd);W.setValueMode(ub.MODE_SYS_VAR);U=Zc.getImpl(Zc.SYS_VAR_HELPER);
var F=U.createSysVarAdapters(vb.SUPPORTED_VAR_TYPE);U.loadVarModelAdapter(W.getValue(),function(lc){lc=lc?lc:F[0];za.setSelected(lc);W.setValue(lc.getId())});za.setItemModels(F);za.setUserObject(t);za.addSelectedChangedListener(x);za.setCustomPainter(function(lc,$c,dd){lc=dd.getDisplayName();$c.text(lc)})}else if(Fa==ub.COMPARE_IN||Fa==ub.COMPARE_NOT_IN)if(W.getProperty().isEnum()){var ja=[],Pa;for(Pa in D)ja.push({fieldValue:D[Pa],fieldName:Pa});var hb=[];(N=JSON.parse(W.getValue()))&&N.forEach(function(lc){ja.forEach(function($c){lc==
$c.fieldName&&hb.push({fieldValue:$c.fieldValue,fieldName:$c.fieldName})})});var Yb=new pb;Yb.setItemModel(ja,function(lc,$c){return lc&&$c&&lc.fieldName==$c.fieldName});Yb.setSelectedItemModel(hb);U=ha.createCtrlInCell(U,Ca,z,kb);U.setUserObject(t);U.setSelectedModel(hb);U.setDropdownCreator(function(lc,$c,dd,id){return Yb.createJqPopup(lc,$c,dd,id)});U.addSelectionListener(function(lc){var $c=lc.getSelectedModel();lc=lc.getUserObject().getUserObject();if(null==$c||0==$c.length)lc.setValue(null);
else{var dd=JSON.parse(lc.getValue()),id=[],hd;for(hd in $c)id.push($c[hd].fieldName);null!=dd&&JSON.stringify(dd.sort())==JSON.stringify(id.sort())||va.firePreviewRefreshWithOnlyRepaint(!1);lc.setValue(JSON.stringify(id))}va.checkError()});U.setCustomPainter(function(lc,$c){var dd=[],id;for(id in lc)dd.push(lc[id].fieldValue);$c.text(dd.join(","))})}else la=ha.createCtrlInCell(U,Ca,z,Ac),la.setClearable(!0),la.setUserObject(t),la.getJqUi().find(".sa-ctrl-f7selector-text").on("click",function(){fa(W,
la)}),la.addActionListener(function(lc){fa(W,la)}),null!=N&&""!=N&&" "!=N&&N&&la.setModel(JSON.parse(N).join(",")),la.setCustomPainter(function(lc){return lc}),la.addClearListener(function(lc){H(lc,W,null)});else if(b(ua,D,Wa))U=$("<div>"),U.text(N),U.addClass("dm-common-tablecell-editable"),U.appendTo(O),O.css("cursor","pointer");else if(ua==Db.DT_DATE||ua==Db.DT_DATETIME)if(ub.isCompareOpRelativeDateRangeValue(Fa)){var ec=ua==Db.DT_DATETIME;ua="";var Vc=N;Vc instanceof ea?ua=S.modelToDisplayText(Vc,
ec):(Vc=new ea,Vc.setPeriod(ea.PERIOD_DAY),Vc.setWhichPeriod(0));var fd=ha.createCtrlInCell(U,Ca,z,sc);fd.setText(ua);fd.setUserObject(t);U=fd.getJqUi();U.find(".sa-ctrl-label-text").css("padding-right","12px");U.css("line-height","28px");U.on("click",function(lc){lc=Vc;var $c=Mc,dd=new Y;dd.edit(lc,ec,$c);dd.showDialog()});Ca=$("<div>");Xa.background(Ca,"btn_edit");Ca.addClass("dm-entity-fieldtable-format-icon");Ca.appendTo(U);var Mc=function(lc){W.setRelativeDateRange(lc);W.setValueMode(ub.MODE_SYS_VAR);
fd.setText(S.modelToDisplayText(lc,ec));t.getCell(4).setValue(lc);va.checkError();va.firePreviewRefreshWithOnlyRepaint(!1)}}else O=new Date,N=N?parseInt(N):null,isNaN(N)||null==N?(W=t.getUserObject(),W.setValue(O.getTime()),W.setValueMode(ub.MODE_CONST)):O.setTime(N),U=ha.createCtrlInCell(U,Ca,z,ua==Db.DT_DATETIME?J:R),U.setDateObject(O),U.setUserObject(t),U.addModelChangedListener(v);else if(ua==Db.DT_BOOLEAN)za=ha.createCtrlInCell(U,Ca,z,cd),za.setSelected(N),za.setItemModels([Db.BOOLEAN_TRUE,Db.BOOLEAN_FALSE]),
za.setUserObject(t),za.setCustomPainter(function(lc,$c,dd){lc=dd==Db.BOOLEAN_TRUE?L.get("dataTypeTrue","\u771f"):dd==Db.BOOLEAN_FALSE?L.get("dataTypeFalse","\u5047"):"";$c.text(lc)}),za.addSelectedChangedListener(y);else if(null!=D){ja=[];for(Pa in D)ja=ja.concat(Pa);za=ha.createCtrlInCell(U,Ca,z,cd);za.setSelected(N);za.setItemModels(ja);za.setUserObject(t);za.setCustomPainter(function(lc,$c,dd){$c.text(D[dd])});za.addSelectedChangedListener(y)}}},tb=function(U,Ca,z,N,t,O){U=ha.createCtrlInCell(U,
Ca,z,cd);U.setSelected(t);U.setItemModels([0,1,2,3,4]);U.setUserObject(O);U.setCustomPainter(function(W,Fa,Wa){W=N?"(":")";for(var ua="",D=0;D<Wa;D++)ua+=W;Fa.text(ua)});U.addSelectedChangedListener(N?k:a)},Qb=function(U,Ca,z,N,t){U=ha.createCtrlInCell(U,Ca,z,cd);U.setSelected(N?N:null);U.setItemModels([null,ub.LOGIC_AND,ub.LOGIC_OR]);U.setUserObject(t);U.setCustomPainter(function(O,W,Fa){O="";Fa==ub.LOGIC_AND?O=L.get("and","\u5e76\u4e14"):Fa==ub.LOGIC_OR&&(O=L.get("or","\u6216"));W.text(O)});U.addSelectedChangedListener(r)}}
function Y(){l.call(this);var u=this,w=this.protectedMethod,n;this.edit=function(E,Z,C){w.setTitle(L.get("relativeDateRange","\u76f8\u5bf9\u65e5\u671f"));n||(u.setSize(450,430),n=new S,n.setContainsTime(Z),Z=new ea,Z.fromJsonObject(E.toJsonObject()),n.setModel(Z),w.setContentPaneCreator(function(){return n.getJqUi()}),w.setClosingAction(function(ba){ba&&(ba=n.getModel(),C(ba))}))}}Fb.call(this);var ka=this,va=this.protectedMethod,Ba,h;this.protectedInit=function(){Ba=ha.createTable();ha.bindTextEditor(Ba,
f,c);ha.bindTableListenerForCtrl(Ba,e);var u=new pa(Ba);u.setOutsideVisible(!1);Ba.setCellRender(u);Ba.addColumns(8);Ba.getColumn(0).setWidth(20);Ba.getColumn(1).setWidth(100);Ba.getColumn(2).setWidth(180);Ba.getColumn(3).setWidth(100);Ba.getColumn(4).setWidth(220);Ba.getColumn(5).setWidth(100);Ba.getColumn(6).setWidth(60);Ba.getColumn(7).setWidth(100);u=ha.createHeadRow(Ba);u.getCell(1).setValue(L.get("leftBracket","\u5de6\u62ec\u53f7"));u.getCell(2).setValue(L.get("field","\u5b57\u6bb5"));u.getCell(3).setValue(L.get("compare",
"\u6bd4\u8f83"));u.getCell(4).setValue(L.get("value","\u503c"));u.getCell(5).setValue(L.get("rightBracket","\u53f3\u62ec\u53f7"));u.getCell(6).setValue(L.get("logic","\u903b\u8f91"));u=$(Ba.getUI());u.addClass("dm-entity-filtertable");Ba.setSyncUIWhenModelChanged(!0);return u};this.updateUi=function(u){u=u?u.getFilters():[];for(var w=u.length-1;0<=w;w--){var n=u[w];if(0!=n.getLeftBracketCount()||0!=n.getRightBracketCount()||n.getProperty()||n.getCompareOp()||n.getValue())break;else u.splice(w,1)}ha.clearWithoutHead(Ba);
var E=u.length,Z=Math.max(8,E+4);for(w=0;w<Z;w++){w<E?n=u[w]:(n=new ub,u.push(n));var C=ha.createRow(Ba),ba=w==E-1;C.setUserObject(n);C.getCell(0).setValue("");C.getCell(1).setValue(n.getLeftBracketCount());C.getCell(2).setValue(n.getProperty());C.getCell(3).setValue(n.getCompareOp());var K=n.getCompareOp();ub.isCompareOpRelativeDateRangeValue(K)?C.getCell(4).setValue(n.getRelativeDateRange()?n.getRelativeDateRange():""):C.getCell(4).setValue(n.getValue()?n.getValue():"");C.getCell(5).setValue(n.getRightBracketCount());
C.getCell(6).setValue(ba?null:n.getLogicOp())}ha.refresh(Ba)};this.afterResize=function(){console.log("oTable relayoutViews.")};this.locateToErrorRow=function(u,w){for(var n=ha.getHeadRowCount();n<Ba.getRowsCount();n++)Ba.getRow(n).getCell(0).setValue("");0<=u&&Ba.getRow(u+ha.getHeadRowCount()).getCell(0).setValue(w)};var e=function(u,w,n,E){var Z=va.getCurrentEntity();if(Z){u=null;if(w){w=KTableUIAbstractView.createCellId(Ba.getRow(n),Ba.getColumn(7));u=ka.getJqUi().find("#"+w);var C=n-ha.getHeadRowCount();
n=$("<div>");n.text(L.get("insert","\u63d2\u5165"));n.addClass("dm-entity-filtertable-op");n.addClass("dm-entity-filtertable-op-insert");n.appendTo(u);n.on("click",function(ba){ba=new ub;Z.getFilters().splice(C,0,ba);ka.updateUi(va.getCurrentEntity());va.checkError()});n=$("<div>");n.text(L.get("deleteRow","\u5220\u9664"));n.addClass("dm-entity-filtertable-op");n.addClass("dm-entity-filtertable-op-delete");n.appendTo(u);n.on("click",function(ba){Z.getFilters().splice(C,1);ka.updateUi(va.getCurrentEntity());
va.checkError();va.firePreviewRefreshWithOnlyRepaint(!1)})}else h&&h.find(".dm-entity-filtertable-op").remove();h=u}},b=function(u,w,n){return null!=n&&1==n?!0:u==Db.DT_STRING?null==w:u==Db.DT_STRING||u==Db.DT_NUMBER||u==Db.DT_INT},f=function(u,w){if(4!=w)return!1;w=Ba.getRow(u).getUserObject();u=w.getCompareOp();if(u==ub.COMPARE_VARIABLE||u==ub.COMPARE_IN||u==ub.COMPARE_NOT_IN||ub.isCompareOpWithoutValue(u))return!1;u=w.getProperty();w=w.getComparedDataType();var n=u?u.getEnumValue():null;u=u?u.isVoidEnumProp():
null;return b(w,n,u)},c=function(u,w,n,E,Z){u=u.getUserObject();u.getValue()!==E&&(u.setValue(E),n.setValue(E),va.checkError(),va.firePreviewRefreshWithOnlyRepaint(!1));return!0},d=function(u,w){u.setValue(""===w?" ":"");u.setValue(w)},g=function(u,w,n){u=u.getUserObject();var E=u.getUserObject();E.setCompareOp(n);u.getCell(3).setValue(n);if(ub.isCompareOpWithoutValue(w)!=ub.isCompareOpWithoutValue(n)||ub.isCompareOpRelativeDateRangeValue(w)!=ub.isCompareOpRelativeDateRangeValue(n)||ub.isCompareOpWithinOrNotWithinValue(w)!=
ub.isCompareOpWithinOrNotWithinValue(n))E.setValue(null),E.setRelativeDateRange(null),E.setValueMode(ub.MODE_CONST),d(u.getCell(4)," ");if(n==ub.COMPARE_VARIABLE||w==ub.COMPARE_VARIABLE)E.setValue(null),E.setRelativeDateRange(null),E.setValueMode(n==ub.COMPARE_VARIABLE?ub.MODE_SYS_VAR:ub.MODE_CONST),d(u.getCell(4)," ");va.checkError();va.firePreviewRefreshWithOnlyRepaint(!1)},k=function(u,w,n){u=u.getUserObject();u.getUserObject().setLeftBracketCount(n);u.getCell(1).setValue(n);va.checkError();va.firePreviewRefreshWithOnlyRepaint(!1)},
a=function(u,w,n){u=u.getUserObject();u.getUserObject().setRightBracketCount(n);u.getCell(5).setValue(n);va.checkError();va.firePreviewRefreshWithOnlyRepaint(!1)},r=function(u,w,n){u=u.getUserObject();u.getUserObject().setLogicOp(n);u.getCell(6).setValue(n);va.checkError();va.firePreviewRefreshWithOnlyRepaint(!1)},y=function(u,w,n){u=u.getUserObject();u.getUserObject().setValue(n);u.getCell(4).setValue(n);va.checkError();va.firePreviewRefreshWithOnlyRepaint(!1)},x=function(u,w,n){u=u.getUserObject();
u.getUserObject().setValue(n.getId());u.getCell(4).setValue(n.getDisplayName());va.checkError();va.firePreviewRefreshWithOnlyRepaint(!1)},A=function(u,w,n){if(null!=n){var E=n.getFilterMode();w.setValue(n.getId());w.setValueMode(n.getFilterMode());E==ub.MODE_MACRO_VAR&&(w=qa.DesigntimeMacroCache.convertToDesigntimeModel(n),qa.DesigntimeMacroCache.put(n.getId(),w))}else w.setValue(null);u.setModel(n);va.checkError();va.firePreviewRefreshWithOnlyRepaint(!1)},v=function(u){var w=""+u.getDateObject().getTime();
u=u.getUserObject();var n=u.getUserObject();n.setValue(w);n.setValueMode(ub.MODE_CONST);u.getCell(4).setValue(w);va.checkError();va.firePreviewRefreshWithOnlyRepaint(!1)},H=function(u,w,n){null!=n&&u.setModel(n.replace(/(\n\s*)+/g,","));if(null==n||w.getValue()!=JSON.stringify(n.split("\n"))){u=u.getUserObject();if(null!=n&&""!=n){n=JSON.parse(JSON.stringify(n.split("\n")));var E=[];n&&n.forEach(function(Z){""!=Z.trim()&&E.push(Z)});n=JSON.stringify(E);w.setValue(n);u.getCell(4).setValue(n)}else w.setValue(null),
u.getCell(4).setValue(null);va.checkError();va.firePreviewRefreshWithOnlyRepaint(!1)}}}function $b(){Cc.call(this);var pa=this,Y=this.protectedMethod,ka,va;this.protectedInit=function(h){};this.protectedUpdateUi=function(h){var e=pa.getJqUi();e.empty();if(h){ka=null;if(h.getSource){var b=h.getSource();ka=Xb.createFilterUIRender(b.getTypeName())}ka||(ka=new bb);ka.setFunGetGlobalDependence(Y.getGlobalDependence);ka.setFunCheckError(Ba);ka.setFunGetCurrentEntity(Y.getCurrentEntity);ka.setFunFirePreviewRefreshWithOnlyRepaint(Y.firePreviewRefreshWithOnlyRepaint)}else va||
(va=new wb,va.setFunGetGlobalDependence(Y.getGlobalDependence),va.setFunCheckError(Ba),va.setFunGetCurrentEntity(Y.getCurrentEntity),va.setFunFirePreviewRefreshWithOnlyRepaint(Y.firePreviewRefreshWithOnlyRepaint)),ka=va;ka.getJqUi().appendTo(e);ka.updateUi(h)};this.afterResize=function(){ka.afterResize()};this.into=function(){pa.protectedUpdateUi(Y.getCurrentEntity());Ba()};this.locateToErrorRow=function(h,e){ka.locateToErrorRow(h,e)};var Ba=function(){var h=Y.getCurrentEntity(),e=new Ka;e.setFromFilterPane(!0);
(h=e.checkEntityFilters(h))?pa.locateToErrorRow(h.getFiltersErrorRow(),h.getPrompt()):pa.locateToErrorRow(-1)}}function Hb(){function pa(t,O,W){var Fa=this,Wa;this.setTabLevel=function(ua){Wa=ua};this.getTabLevel=function(){return Wa};this.getParentProperty=function(){return W};this.getEntity=function(){return t};this.getProperty=function(){return O};this.isTitleItem=function(){return O?O.hasChild():!0};this.isEquals=function(ua){return ua instanceof pa?ua.getEntity()==Fa.getEntity()&&ua.getProperty()==
Fa.getProperty():!1}}var Y=this,ka,va,Ba=$("<div>"),h=$("<div>"),e=new cd,b=new kb,f=new cd,c=new kb,d=new cd,g=new I,k=new I,a,r,y=new ob,x=new ob,A={},v,H=!1,u=!1,w=!0;this.setEditable=function(t){w=t};this.setDirtyListener=function(t){ka=t};this.setRelationChangeListener=function(t){v=t};this.setModifyMode=function(t){t=t?!1:!0;e.getJqUi().css("display",t?"block":"none");f.getJqUi().css("display",t?"block":"none");Ba.css("display",t?"none":"block");h.css("display",t?"none":"block")};this.setModifyInnerRelationMode=
function(t){u=t;Y.setModifyMode(t);b.setEnabled(!1);c.setEnabled(!1);d.setEnabled(!1)};this.bindModel=function(t){r=t};this.initPropItemModels=function(){for(var t=r.copyEntityArray(),O=0;O<t.length;O++){var W=t[O].getTopParentEntity(),Fa=tb(W);A[W.getName()]=Fa}};this.setEntities=function(t){for(var O=[],W=0;W<t.length;W++){var Fa=t[W];Fa.isSubNodeAtView()||O.push(Fa)}e.setItemModels(O);f.setItemModels(O)};var n=function(t,O){var W=A[t.getName()];W||(W=tb(t),A[t.getName()]=W);for(var Fa=0;Fa<W.length;Fa++){var Wa=
W[Fa];if(Wa.getEntity().getName()==t.getName()&&Wa.getProperty()&&Wa.getProperty().getName()==O.getName())return Wa}return new pa(t,O)};this.setRelation=function(t){a=t;Ba.empty();h.empty();var O=t?!0:!1;if(O){var W=u?t.getFromEntity():t.getFromEntity().getTopParentEntity(),Fa=u?t.getToEntity():t.getToEntity().getTopParentEntity();ca(!0,Ba,W);ca(!0,h,Fa);u&&(b.setEnabled(!1),c.setEnabled(!1),d.setEnabled(!1))}H=!0;e.setSelected(O?t.getFromEntity().getTopParentEntity():null);b.setSelectedModel(O?n(t.getFromEntity(),
t.getFromProperty()):null);f.setSelected(O?t.getToEntity().getTopParentEntity():null);c.setSelectedModel(O?n(t.getToEntity(),t.getToProperty()):null);d.setSelected(O?t.getRelated():null);H=!1;g.setChecked(O?t.isFromPointKeepFifthWheel():!1);k.setChecked(O?t.isToPointKeepFifthWheel():!1)};this.getRelation=function(){return a};this.createJqUi=function(){d.setItemModels([Pb.R_1_1,Pb.R_1_N,Pb.R_N_1]);d.setCustomPainter(K);d.addSelectedChangedListener(z);var t=d.getJqUi();e.setCustomPainter(ca);e.addSelectedChangedListener(U);
b.setCustomPainter(ba);b.setDropdownCreator(E);b.addSelectionListener(function(la){Ca(la)});f.setCustomPainter(ca);f.addSelectedChangedListener(U);c.setCustomPainter(ba);c.setDropdownCreator(Z);c.addSelectionListener(function(la){Ca(la)});g.setText(L.get("keepFifthWheel","\u4fdd\u7559\u65e0\u6cd5\u5173\u8054\u7684\u884c"));g.setEnabled(w);g.addCheckedListener(N);k.setText(L.get("keepFifthWheel","\u4fdd\u7559\u65e0\u6cd5\u5173\u8054\u7684\u884c"));k.setEnabled(w);k.addCheckedListener(N);var O=e.getJqUi(),
W=b.getJqUi(),Fa=g.getJqUi(),Wa=f.getJqUi(),ua=c.getJqUi(),D=k.getJqUi();va=$("<div>");va.append(Ba);va.append(h);va.append(O);va.append(W);va.append(Fa);va.append(Wa);va.append(ua);va.append(D);va.append(t);Ba.addClass("dm-relation-setting-from1");O.addClass("dm-relation-setting-from1");W.addClass("dm-relation-setting-from2");Fa.addClass("dm-relation-setting-from3");t.addClass("dm-relation-setting-related");h.addClass("dm-relation-setting-to1");Wa.addClass("dm-relation-setting-to1");ua.addClass("dm-relation-setting-to2");
D.addClass("dm-relation-setting-to3");return va};var E=function(t,O,W){var Fa=Y.getRelation();Fa=tb(Fa.getFromEntity().getTopParentEntity());x.setItemModel(Fa);x.setSearchListener(C);x.setListItemPainter(P);x.setShowFieldNameListener(fa);return x.createJqPopup(t,O,W)},Z=function(t,O,W){var Fa=Y.getRelation();Fa=tb(Fa.getToEntity().getTopParentEntity());y.setItemModel(Fa);y.setSearchListener(C);y.setListItemPainter(P);y.setShowFieldNameListener(fa);return y.createJqPopup(t,O,W)},C=function(t,O,W,Fa,
Wa,ua){O=O.toLowerCase();Wa=!0;for(var D,la=0;la<t.length;la++){var za=t[la].getProperty();if(D=za&&-1!=za.getAlias().toLowerCase().indexOf(O)?!0:za&&ua&&-1!=za.getName().toLowerCase().indexOf(O)?!0:!1){Wa=!1;D=t[la].getEntity();za.setFieldVisible(!0);za.getParent()&&za.getParent().setFieldVisible(!0);if(za.hasChild()&&(za=D.getTreeRootProp(za))){za=za.getChildren();for(var F=0;F<za.length;F++)za[F].setFieldVisible(!0)}D.setFieldVisible(!0);for(D=D.getParentEntity();D;)D.setFieldVisible(!0),D=D.getParentEntity()}}W.children().remove();
if(Wa)t=new sc,t.setText(L.get("nothingSearched","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c")),t.setEnabled(!1),t.setAlign(sc.ALIGN_CENTER),t=t.getJqUi(),t.addClass("dm-field-popup-search-result"),t.appendTo(W);else for(la=0;la<t.length;la++)P(t[la],W,Fa,!0);fa(W,ua)},ba=function(t,O){if(t){var W=t.getEntity(),Fa=t.getProperty(),Wa="";r.isEntityWithSubNodes(W.getTopParentEntity())&&(Wa=Wa+W.getAlias()+".");t.getParentProperty()&&(Wa=Wa+t.getParentProperty().getAlias()+".");Wa+=Fa.getAlias();
O.text(Wa);O.attr("title",Wa)}else O.text("")},K=function(t,O,W){switch(W){case Pb.R_1_1:O.text(L.get("oneToOne","\u4e00\u5bf9\u4e00"));break;case Pb.R_1_N:O.text(L.get("oneToN","\u4e00\u5bf9\u591a"));break;case Pb.R_N_1:O.text(L.get("nToOne","\u591a\u5bf9\u4e00"));break;default:O.text("")}},ca=function(t,O,W){if(W){t=nb.entity2IconName(W);var Fa=$("<div>");Fa.addClass("dm-relation-setting-item-icon");Xa.background(Fa,t);Fa.appendTo(O);t=$("<div>");t.addClass("dm-relation-setting-item-text");t.text(W.getAlias());
t.appendTo(O)}},P=function(t,O,W,Fa){if(t){if(t.getProperty()){var Wa=t.getProperty();var ua=Wa.getFieldVisible();Wa.setFieldVisible(!1)}else Wa=t.getEntity(),ua=Wa.getFieldVisible(),Wa.setFieldVisible(!1);Fa=!ua&&Fa?!1:!0}else Fa=!1;if(Fa){Fa=$("<div>");Fa.data("model",t);Wa=t.getEntity();var D=t.getProperty();if(t.isTitleItem())D?(Fa.addClass("dm-field-popup-list-item-title"),ua=nb.getTreePropIconName(),D=D.getAlias(),Wa=$("<div>")):(Fa.addClass("dm-field-popup-list-item-title"),ua=nb.entity2IconName(Wa),
D=Wa.getAlias(),Wa=$("<div>")),Wa.addClass("dm-relation-setting-item-text"),Wa.text(D);else{Fa.addClass("dm-field-popup-list-item");ua=D.getOutputDataType();ua=nb.dataType2IconName(ua);Wa=$("<div>");Wa.addClass("dm-relation-setting-item-text");Wa.addClass("dm-field-popup-list-item-field-text");var la=D.getAlias(),za=$("<span>");za.text(la);za.attr("title",la);za.addClass("dm-field-popup-list-item-text");D=D.getFormula()?D.getAlias():D.getName();la=$("<span>");la.addClass("dm-field-popup-list-item-field-name");
la.text("("+D+")");Wa.append(za);Wa.append(la)}Wa.appendTo(Fa);Fa.appendTo(O);0<t.getTabLevel()&&Fa.css("margin-left",20*t.getTabLevel());Wa=$("<div>");Wa.addClass("dm-relation-setting-item-icon");Xa.background(Wa,ua);Wa.appendTo(Fa);W&&W.isEquals(t)&&xb(O,Fa)}},fa=function(t,O){if(O)for(t=t.find(".dm-field-popup-list-item-field-name"),O=0;O<t.length;O++){var W=t.eq(O);W.css("display","inline-block");var Fa=W.prev().text()+W.text();W.prev().attr("title",null);W.parent().attr("title",Fa)}else for(t=
t.find(".dm-field-popup-list-item-field-name"),O=0;O<t.length;O++)W=t.eq(O),W.css("display","none"),W.parent().attr("title",null),W.prev().attr("title",W.prev().text())},xb=function(t,O){var W=null;0<t.height()?(clearTimeout(W),O.addClass("dm-list-item_selected_enabled"),t.prop("scrollTop",O.prop("offsetTop"))):W=setTimeout(function(){xb(t,O)},0)},tb=function(t){var O=[];t=r.getEntityWithSubNodes(t);if(1==t.length)Qb(t[0],O);else for(var W=0;W<t.length;W++){var Fa=t[W],Wa=new pa(Fa,null);Wa.setTabLevel(Fa.getSubNodeLevel());
O.push(Wa);Qb(Fa,O)}return O},Qb=function(t,O){for(var W=t.getChooseRelationProperties(),Fa=r.isEntityWithSubNodes(t.getTopParentEntity())?t.getSubNodeLevel():-1,Wa=0;Wa<W.length;Wa++){var ua=W[Wa];if(ua.hasChild()){var D=new pa(t,ua);D.setTabLevel(Fa+1);O.push(D);var la=t.getTreeRootProp(ua);if(la&&la.getTreeType()==yb.TREE_TYPE_FLEX&&(la=la.getChildren())&&0<la.length)for(var za=0;za<la.length;za++){var F=new pa(t,la[za],ua);F.setTabLevel(D.getTabLevel()+1);O.push(F)}}else ua.isHideInDataModeling()||
(ua=new pa(t,ua),ua.setTabLevel(Fa+1),O.push(ua))}},U=function(t,O,W){H||((t==e?b:c).setSelectedModel(null),a&&(t==e?(a.setFromEntity(W),a.setFromProperty(null)):(a.setToEntity(W),a.setToProperty(null))),ka&&ka())},Ca=function(t){var O=t.getSelectedModel();!H&&O&&(a&&(t==b?(a.setFromEntity(O.getEntity()),a.setFromProperty(O.getProperty())):(a.setToEntity(O.getEntity()),a.setToProperty(O.getProperty()))),ka&&ka())},z=function(t,O,W){H||(a&&a.setRelated(W),ka&&ka())},N=function(t,O){O&&(t==g?(a.setFromPointKeepFifthWheel(t.isChecked()),
v&&v(a,Pb.KEY_FROM_ENTITY,t.isChecked())):t==k&&(a.setToPointKeepFifthWheel(t.isChecked()),v&&v(a,Pb.KEY_TO_ENTITY,t.isChecked())),ka())}}function Tb(){l.call(this);var pa=this,Y=this.protectedMethod,ka=new Hb,va=$("<div>"),Ba;this.prepare=function(d,g){Ba=d;g=new Pb;g.setRelated(Pb.R_1_1);for(var k=d.copyEntityArray(),a=0;a<k.length-1;a++)for(var r=a+1;r<k.length;r++){var y=k[a],x=k[r];if(!y.isSubNodeAtView()&&!x.isSubNodeAtView()&&d.isNewRelationCreatable(y.getName(),x.getName())){g.setFromEntity(y);
a=y.getChooseRelationProperties();g.setFromProperty(null!=a&&0<a.length?a[0]:null);g.setToEntity(x);x=x.getChooseRelationProperties();g.setToProperty(null!=x&&0<x.length?x[0]:null);a=k.length;break}}ka.bindModel(d);ka.setEntities(k);ka.initPropItemModels();ka.setRelation(g);f();Y.setContentPaneCreator(h);Y.setClosingChecker(e);Y.setClosingAction(b);Y.setTitle(L.get("createRelation","\u65b0\u5efa\u5173\u7cfb"));pa.setSize(640,360)};var h=function(){va.addClass("dm-relation-dialog-prompt");ka.setModifyMode(!1);
ka.setDirtyListener(f);var d=ka.createJqUi();d.addClass("dm-relation-dialog-setting");var g=$("<div>");g.append(d);g.append(va);return g},e=function(){return!f()},b=function(d){d&&(d=ka.getRelation(),Ba.addRelation(d))},f=function(){va.empty();var d=!1,g=ka.getRelation(),k=g.getFromEntity().getName(),a=g.getToEntity().getName(),r=g.getFromEntity().getAlias(),y=g.getToEntity().getAlias();k==a?(k=L.get("forbidRelateToItself","\u4e0d\u5141\u8bb8\u521b\u5efa\u6570\u636e\u8868\u4e0e\u5176\u81ea\u8eab\u7684\u5173\u7cfb\uff0c\u8bf7\u9009\u62e9\u4e24\u4e2a\u4e0d\u540c\u7684\u6570\u636e\u8868\u3002"),
c(!0,k),d=!0):Ba.isRelationExist(k,a)?(k=L.get("relationExist","\u5df2\u5b58\u5728\u201c#1\u201d\u548c\u201c#2\u201d\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u4e0d\u80fd\u91cd\u590d\u521b\u5efa\u3002"),k=k.replace("#1",r),k=k.replace("#2",y),c(!0,k),d=!0):Ba.isNewRelationCreatable(k,a)||(k=L.get("ringlikeRelation","\u7531\u4e8e\u53ef\u80fd\u4f7f\u5df2\u5b58\u5728\u7684\u5173\u7cfb\u5f62\u6210\u73af\u72b6\uff0c\u4e0d\u5141\u8bb8\u521b\u5efa\u201c#1\u201d\u548c\u201c#2\u201d\u4e4b\u95f4\u7684\u5173\u7cfb\u3002"),
k=k.replace("#1",r),k=k.replace("#2",y),c(!0,k),d=!0);r=g.getFromProperty();g=g.getToProperty();r&&g?r.getOutputDataType()!=g.getOutputDataType()&&(k=L.get("inconsistentDataType","\u4e24\u4e2a\u5b57\u6bb5\u7684\u6570\u636e\u7c7b\u578b\u4e0d\u4e00\u81f4\u3002\u5982\u679c\u786e\u8ba4\u6ca1\u6709\u903b\u8f91\u95ee\u9898\uff0c\u53ef\u4ee5\u5ffd\u7565\u6b64\u8b66\u544a\u3002"),c(!1,k)):(k=L.get("fieldIncomplete","\u5b57\u6bb5\u4e0d\u5b8c\u6574\u3002"),c(!0,k),d=!0);return d},c=function(d,g){var k=$("<div>");
k.text("!");k.addClass("dm-relation-dialog-promptitem-icon");k.addClass("dm-relation-dialog-promptitem-icon-"+(d?"err":"warn"));d=$("<div>");d.addClass("dm-relation-dialog-promptitem-text");d.text(g);var a=$("<div>");a.addClass("dm-relation-dialog-promptitem");a.append(k);a.append(d);setTimeout(function(){va.append(a)},100)}}function Za(){l.call(this);var pa=this,Y=this.protectedMethod,ka,va,Ba,h=new Hb,e,b={},f={},c,d=[],g;this.prepare=function(C,ba,K,ca){ka=C;va=ba;g=ca;h.setEditable(g);Ba=K;h.bindModel(ka);
h.setModifyInnerRelationMode(!0);h.setDirtyListener(k);h.setRelationChangeListener(a);Y.setContentPaneCreator(r);Y.setClosingChecker(function(){return!0});Y.setClosingAction(function(P){if(P)for(var fa in f){P=f[fa];var xb=b[P.getFromEntity().getName()+P.getToEntity().getName()];xb.setFromPointKeepFifthWheel(P.isFromPointKeepFifthWheel());xb.setToPointKeepFifthWheel(P.isToPointKeepFifthWheel())}});g?Y.setTitle(L.get("editInnerRelation","\u7f16\u8f91\u5185\u90e8\u5173\u7cfb")):Y.setTitle(L.get("checkInnerRelation",
"\u67e5\u770b\u5185\u90e8\u5173\u7cfb"));pa.setSize(920,570)};var k=function(){Ba.setDirty(!0)},a=function(C,ba,K){C=C.getToEntity();if(C.isUnion()&&C.getUnionType()==Ob.BIZ_UNION){var ca=C.getTopParentEntity();ca=ka.getBizUnionInnerEntityRelations(ca.getName());for(var P in ca){var fa=ca[P];-1<C.indexOfEntity(fa.getToEntity())&&(ba==Pb.KEY_FROM_ENTITY&&fa.setFromPointKeepFifthWheel(K),ba==Pb.KEY_TO_ENTITY&&fa.setToPointKeepFifthWheel(K))}}},r=function(){var C=$("<div>");c=$("<div>");c.addClass("dm-relation-list");
var ba=h.createJqUi();ba.addClass("dm-entity-inner-relation-rightside");var K=$("<div>");K.addClass("dm-entity-inner-relation-rightside-div");K.append(ba);ba=new dc;ba.setHorizontalSplit(!0);ba.setEnabled(!0);ba.setFirstSize(200,160,300);ba.setSecondSize(660,0,-1);ba.setResizeMode(dc.RESIZE_MODE_FIRST_FIXED);ba.setFirstChild(dc.createChildWrapper(c));ba.setSecondChild(dc.createChildWrapper(K));K=$(document.createDocumentFragment());for(var ca,P=0,fa=ka.getRelationCount();P<fa;P++){var xb=ka.getRelationByIndex(P);
!ka.isRelationInsideSubSystem(xb)||xb.getFromEntity().getTopParentEntity()!=va&&xb.getToEntity().getTopParentEntity()!=va||(ca||(ca=xb.clone()),b[xb.getFromEntity().getName()+xb.getToEntity().getName()]=xb,xb=xb.clone(),d[P]=xb,K.append(H(xb)))}c.empty();c.append(K);ca&&n(ca);ca=ba.getJqUi();C.append(ca);return C},y=function(){c.find(".dm-relation-list-item").remove();for(var C=0,ba=d.length;C<ba;C++){var K=d[C];K&&(b[K.getFromEntity().getName()+K.getToEntity().getName()]=K,K=K.clone(),d[C]=K,c.append(H(K)),
n(e))}},x=function(C){C=$(C.currentTarget);var ba=w(C.parent().parent());for(C=0;C<d.length;C++)if(d[C]&&ba){var K=d[C].getFromEntity(),ca=d[C].getToEntity(),P=ba.getFromEntity(),fa=ba.getToEntity();if(K.getName()==P.getName()&&ca.getName()==fa.getName()&&(K=v(C,!1),-1<K)){ba=K;K=d[C];d[C]=d[ba];d[ba]=K;y();break}}},A=function(C){C=$(C.currentTarget);var ba=w(C.parent().parent());for(C=0;C<d.length;C++)if(d[C]&&ba){var K=d[C].getFromEntity(),ca=d[C].getToEntity(),P=ba.getFromEntity(),fa=ba.getToEntity();
if(K.getName()==P.getName()&&ca.getName()==fa.getName()&&(K=v(C,!0),-1<K)){ba=K;K=d[C];d[C]=d[ba];d[ba]=K;y();break}}},v=function(C,ba){if(ba)for(C+=1;C<d.length;C++){if(d[C])return C}else for(--C;0<=C;C--)if(d[C])return C;return-1},H=function(C){var ba=C.getFromEntity(),K=C.getToEntity();C=$("<div>");C.addClass("dm-relation-list-item");var ca=ba.getName(),P=K.getName();C.attr("datamodeling-name1",fb.encode(ca));C.attr("datamodeling-name2",fb.encode(P));C.on("mousedown",u);C.on("mouseenter",E);C.on("mouseleave",
Z);ca=$("<div>");ca.addClass("dm-relation-list-item-icon");Xa.background(ca,"relation");P=$("<div>");P.addClass("dm-relation-list-item-text");P.css("right","5px");P.text(ba.getAlias()+"-"+K.getAlias());ba=$("<div>");ba.addClass("dm-relation-list-item-up-down");K=$("<div>");K.attr("title",L.get("moveUpRelation","\u4e0a\u79fb"));K.addClass("dm-relation-list-item-up");Xa.background(K,"up_move");K.on("click",x);ba.append(K);K=$("<div>");K.attr("title",L.get("moveDownRelation","\u4e0b\u79fb"));K.addClass("dm-relation-list-item-down");
Xa.background(K,"down_move");K.on("click",A);ba.append(K);C.append(ca);C.append(P);return C},u=function(C){C=$(C.currentTarget);C=w(C);e!=C&&n(C)},w=function(C){var ba=fb.decode(C.attr("datamodeling-name1"));C=fb.decode(C.attr("datamodeling-name2"));return f[ba+C]?f[ba+C]:ka.getRelationByEntitiesName(ba,C).clone()},n=function(C){e=C;f[C.getFromEntity().getName()+C.getToEntity().getName()]=C;C=c.find(".dm-relation-list-item");C.removeClass("dm-relation-list-item_selected");for(var ba=0;ba<C.length;ba++){var K=
$(C[ba]),ca=K.find(".dm-relation-list-item-icon");Xa.background(ca,"relation");ca=K.find(".dm-relation-list-item-up");Xa.background(ca,"up_move");K=K.find(".dm-relation-list-item-down");Xa.background(K,"down_move")}e&&(ba=e,C=ba.getFromEntity().getName(),ba=ba.getToEntity().getName(),C=c.find("[datamodeling-name1='"+fb.encode(C)+"'][datamodeling-name2='"+fb.encode(ba)+"']"),C.addClass("dm-relation-list-item_selected"),ba=C.find(".dm-relation-list-item-icon"),Xa.background(ba,"relation_selected"),
ca=C.find(".dm-relation-list-item-up"),Xa.background(ca,"up_move_selected"),K=C.find(".dm-relation-list-item-down"),Xa.background(K,"down_move_selected"));h.setRelation(e)},E=function(C){C=$(C.currentTarget);if(0<C.prev().length){var ba=C.find(".dm-relation-list-item-up");ba&&ba.css("display","block")}0<C.next().length&&(C=C.find(".dm-relation-list-item-down"))&&C.css("display","block")},Z=function(C){C=$(C.currentTarget);var ba=C.find(".dm-relation-list-item-up");ba&&ba.css("display","none");(C=
C.find(".dm-relation-list-item-down"))&&C.css("display","none")}}function oa(){l.call(this);var pa=this,Y=this.protectedMethod,ka;this.edit=function(va,Ba,h){Y.setTitle(L.get("numberFormatOfField","\u5b57\u6bb5[#1]\u7684\u6570\u5b57\u683c\u5f0f").replace("#1",va));ka||(ka=new ic,pa.setSize(428,257),Y.setContentPaneCreator(function(){return ka.getJqUi()}),Y.setClosingChecker(ka.isValidToAccepted),Y.setClosingAction(function(e){e&&(e=ka.getModel().encode(),h(e))}));va=new ab;va.decode(Ba?Ba:"#,##0");
ka.setModel(va)}}function Kb(){function pa(){m.FieldsProvider.call(this);var g=this.protectedMethod,k=new Y;(function(){k.setCustomItemPainter(function(a,r){var y=nb.dataType2IconName(r.getOutputDataType()),x=$("<div>");x.addClass("dm-customfield-fields-icon");Xa.background(x,y);x.appendTo(a);y=$("<div>");y.addClass("dm-customfield-fields-text");y.text(r.getAlias());y.appendTo(a)});k.addDBLClickListener(function(a){a="["+a.getSelecteds()[0].getAlias()+"]";g.fireChoosingEvent(a)})})();this.setAllFields=
function(a){k.setAllFields(a)};this.getJqUi=function(){return k.getJqUi()}}function Y(){var g,k=$("<div>"),a,r;this.setAllFields=function(y){g=y};this.getJqUi=function(){var y=$("<div>"),x=new Ja;x.setSearchListenerDelay(200);x.setPlaceholder(L.get("search","\u641c\u7d22"));x.addSearchListener(function(){var v=x.getText().trim(),H=new ld;if(v){var u=[],w;for(w in g){var n=g[w];0<=n.getAlias().toUpperCase().indexOf(v.toUpperCase())&&u.push(n)}k.empty();0<u.length?H.setItemModels(u):(v=new sc,v.setText(L.get("nothingSearched",
"\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c")),v.setEnabled(!1),v.setAlign(sc.ALIGN_CENTER),v=v.getJqUi(),v.addClass("dm-field-popup-search-result"),v.appendTo(k))}else k.empty(),H.setItemModels(g);H.addDBLClickListener(a);H.setCustomItemPainter(r);H.getJqUi().appendTo(k)});var A=x.getJqUi();A.addClass("dm-customfield-fields-search");A.appendTo(y);A=new ld;A.setItemModels(g);A.addDBLClickListener(a);A.setCustomItemPainter(r);k.addClass("dm-customfield-fields-list");A.getJqUi().appendTo(k);k.appendTo(y);
return y};this.setCustomItemPainter=function(y){r=y};this.addDBLClickListener=function(y){a=y}}l.call(this);var ka=this,va=this.protectedMethod,Ba=new m,h,e,b;(function(){ka.setSize(800,570);va.setSelectable(!0);va.setContentPaneCreator(function(){return Ba.getJqUi()});va.setClosingChecker(function(){return Ba.isValidToAccepted()});va.setClosingAction(function(g){g&&(Ba.acceptEditing(),b.setAlias(Ba.getEditedDisplayName()),b.setFormula(Ba.getEditedExecutableFormula()),h())});Ba.setFunctionsProviderCreator(function(g){return g.getInstanceForDataModeling()});
Ba.setDuplicatedNameChecker(function(g,k){a:{for(var a=0;a<e.length;a++){var r=e[a];if(g!=r.getName()&&k==r.getAlias()){g=!0;break a}}g=!1}return g});Ba.setDisplayNameTranslator(function(g,k){return k?c(g):f(g)})})();this.setSyntaxValidator=function(g){Ba.setSyntaxValidator(g)};this.setContext=function(g,k,a){e=g;b=k;va.setTitle(a?L.get("modifyCustomField","\u7f16\u8f91\u8ba1\u7b97\u5b57\u6bb5"):L.get("addCustomField","\u65b0\u5efa\u8ba1\u7b97\u5b57\u6bb5"))};this.edit=function(g){h=g;g=new pa;g.setAllFields(e);
Ba.setFieldsProvider(g);Ba.setEditingTarget(b.getName(),b.getAlias(),b.getFormula());ka.showDialog();Ba.prepareToStart()};var f=function(g){return d(g,function(k){return k.getAlias()},function(k){return k.getName()})},c=function(g){return d(g,function(k){return k.getName()},function(k){return k.getAlias()})},d=function(g,k,a){for(var r={},y=0;y<e.length;y++){var x=e[y],A="["+k(x)+"]";x="["+a(x)+"]";if(A!=x)for(var v=null;-1!=g.indexOf(A);)v||(v="["+Ua.createUUID()+"]",r[v]=x),g=g.replace(A,v)}for(v in r)for(x=
r[v];-1!=g.indexOf(v);)g=g.replace(v,x);return g}}function hc(){l.call(this);var pa=this,Y=this.protectedMethod,ka,va,Ba,h=[],e=[],b=[],f=[];this.setEntity=function(g){};this.setAllProperties=function(g){h=g};this.setSelectedProperties=function(g){e=g};this.setLockSelectedFieldNames=function(g){b=g};this.setAllRelationPropName=function(g){f=g};this.setConfirmListener=function(g){va=g};this.setClosingCheckListener=function(g){Ba=g};this.initUi=function(){Y.setTitle(L.get("selectField","\u9009\u62e9\u5b57\u6bb5"));
if(!ka){ka=new Tc;ka.setChoiceField(!0);ka.setAllField(h);var g=[],k=!0;for(r in e)-1<h.indexOf(e[r])&&g.push(e[r].getName());for(var a in b){var r=b[a];var y=!1,x;for(x in h){var A=h[x];if(A&&A.getName()==r){y=!0;break}}if(!y){k=!1;break}}ka.setSelectedFieldName(g);ka.setLockSelectedFieldNames(b&&k?b:[]);ka.setAllRelationPropNames(f?f:[]);pa.setSize(640,480);Y.setContentPaneCreator(function(){return ka.getJqUi()});Y.setClosingAction(c);Y.setClosingChecker(function(v){var H=ka.getSelectedFieldName();
b=b?b:[];var u=[],w;for(w in H){var n=H[w];0>b.indexOf(n)&&u.push(n)}0==u.length?(0==b.length?Y.getMessageCurtain().showPrompt(L.get("atLeastSelectAField","\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\u5b57\u6bb5\u3002")):Y.getMessageCurtain().showPrompt(L.get("atLeastSelectAFieldExceptLockField","\u9664\u4e86\u9501\u5b9a\u7684\u5173\u8054\u5b57\u6bb5\uff0c\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\u5b57\u6bb5\u3002")),v(!1)):(H=[],d(H,[]),Ba&&Ba(H,v,Y.getMessageCurtain()))},!0)}};var c=function(g){if(g){g=[];
var k=[];d(g,k);va(g,k)}},d=function(g,k){for(var a=h,r=ka.getSelectedFieldName(),y=e,x={},A=0;A<y.length;A++){var v=y[A];x[v.getAssociateName()]=v}for(A in a)0<=r.indexOf(a[A].getName())?(g.push(a[A]),x[a[A].getAssociateName()]||Db.confirmDefaultFormatString(a[A])):k.push(a[A])}}function Lb(){l.call(this);var pa=this,Y=this.protectedMethod,ka,va,Ba,h,e;this.setInitValue=function(d,g,k){va=d;Ba=g;h=k};this.setConfirmListener=function(d){e=d};this.initUi=function(){var d=Ba.getName();sSqlType=Ba.getSource().getUserSql(d).getSqlType();
d=L.get("editSql","\u7f16\u8f91")+sSqlType;Y.setTitle(d);pa.setSize(960,540);Y.setContentPaneCreator(b);Y.setClosingAction(f);Y.setClosingChecker(c,!0);Y.setSelectable(!0)};var b=function(){var d=Ba.getName(),g=Ba.getSource().getUserSql(d).getSqlType(),k=Ba.getSource().getUserSql(d).getContent(),a=new xa;a.setName(d);a.setSqlType(g);a.setContent(k);ka=new kc;Ba.getSource().getConnectionType()==ma.DBCONNECTION_TYPE_SUPERQUERY&&ka.setIsShowTips(!0);ka.setUserSqlObjModel(a);ka.setFacadeCreator(h.createFacade);
ka.setAlias(Ba.getAlias());ka.setMessageCurtain(Y.getMessageCurtain());return ka.getJqUi()},f=function(d){d&&e()},c=function(d){var g=Ba.getName(),k=ka.check();if(k)Y.getMessageCurtain().showPrompt(k),d(!1);else{var a=Ba.getName(),r=Ba.getSource(),y=r.clone();y.setName(r.getName());y.removeUserSql(a);ka.asynGetUserSqlObjModel(function(x){y.addUserSql(x);ka.getDesigntimeDataObject(y,g,Y.getMessageCurtain(),h.createFacade,function(A,v){var H=v;if(Ba.getAlias()!=v)for(var u=1;va.isEntityAliasExist(H);)H=
v+"_"+u++;v={};v[r.getName()]=r;u=va.getEntityByName(g);u.setProperties([]);u.fromJsonObject(A.entities[0],v);u.setAlias(H);A=u.getProperties();for(H=0;H<A.length;H++)Db.confirmDefaultFormatString(A[H]);r.removeUserSql(a);r.addUserSql(x);d(!0)},function(){d(!1)})})}}}function pb(){var pa=[],Y,ka,va=[],Ba=[],h;this.setItemModel=function(c,d){h=d;pa=c};this.setListItemPainter=function(c){};this.setSelectedItemModel=function(c){va=c;Ba=va.slice(0)};this.setLastTimeSelectedModel=function(c){Ba=c};this.getSelectedItemModel=
function(){return va};this.createJqPopup=function(c,d,g,k){Y=$("<div>");Y.appendTo(c);ka=$("<div>");Y.addClass("dm-field-popup");ka.addClass("dm-enum-popup-list-owner");for(c=0;c<pa.length;c++)b(pa[c],ka,d,!1);d=new Jc;d.setHighlight(!0);d.setText(L.get("ok","\u786e\u5b9a"));d=d.getJqUi();d.css("z-index",3);d.css("margin-left",10);$a.layoutCtrlWithLRTB(d,"50%",null,80,null,8,28);d.on("click",function(a){Ba=va.slice(0);g(va)});c=new Jc(L.get("cancle","\u53d6\u6d88"));c.setHighlight(!1);c=c.getJqUi();
c.css("z-index",3);c.css("margin-left",-90);$a.layoutCtrlWithLRTB(c,"50%",null,80,null,8,28);c.on("click",function(a){va=Ba.slice(0);k()});ka.appendTo(Y);d.appendTo(Y);c.appendTo(Y);ka.css("height","77%");return[-1,260]};var e=function(c,d){d=c.getUserObject();c=c.isChecked();d&&c?(c=f(d),0>c&&va.push(d)):d&&!c&&(c=f(d),-1<c&&va.splice(c,1))},b=function(c,d,g){var k=f(c);g=$("<div>");g.addClass("dm-field-popup-list-item");g.data("model",c);var a=$("<div>"),r=new I;r.setUserObject(c);r.setChecked(-1<
k);r.addCheckedListener(e);k=r.getJqUi();k.addClass("dm-fieldselection-checkbox-icon");k.data("model",r);r=$("<div>");r.text(c.fieldValue);r.addClass("dm-fieldselection-checkbox-text");a.append(k);a.append(r);g.append(a);d.append(g)},f=function(c){for(var d=0;d<va.length;d++)if(h(c,va[d]))return d;return-1}}function yc(){l.call(this);var pa=this,Y=this.protectedMethod,ka,va,Ba,h,e,b;this.setInitValue=function(a,r,y){ka=a;va=r;Ba=y};this.setConfirmListener=function(a){h=a};this.initUiShowDialog=function(){var a=
Y.getMessageCurtain(),r=va.getSource(),y=va.getAssociateName(),x=r.getStoredProcedure(y);y=x.getAssociateName();var A=L.get("editStoredProcedure","\u7f16\u8f91\u5b58\u50a8\u8fc7\u7a0b")+" "+y;Y.setTitle(A);pa.setSize(560,540);Y.setClosingAction(c);Y.setClosingChecker(d,!0);A=Ba.createFacade(function(v){for(var H={},u=x.getParameters(),w=0;w<u.length;w++){var n=u[w].getName();H[n]=u[w].getValue()}u=[];for(w=0;w<v.length;w++){var E=new Oa;E.fromJsonObject(v[w]);n=E.getName();(n=H[n])&&E.setValue(n);
u.push(E)}v=new Aa;v.fromJsonObject(x.toJsonObject());v.setParameters(u);e=new Ma;e.setInitValue(v,r,Ba.createFacade,a);e.setCallbackDesignTimeDataObject(f);Y.setContentPaneCreator(function(){var Z=e.getJqUi();Z.css("left","0px");Z.css("right","0px");return Z});pa.showDialog();e.refreshTable()},function(v,H,u){u=v.toString();return"20"==u.substr(0,2)&&7==u.length&&209E4!=v?(a.showError(H),!0):!1});A.setShowBlocking(!1);A.getStoredProcedureParameters(r.toJsonObject(),y)};var f=function(a,r){b=r},c=
function(a){a&&h()},d=function(a){var r=va.getSource();va.getName();var y=va.getProperties(),x=va.getAlias(),A=va.getAssociateName();r.getStoredProcedure(A);var v=e.getStoredProcedureModel();if(b){var H=b.getFisrtEntity();H.setAlias(x);var u=H.getProperties();u=g(y,u);H.setProperties(u);for(var w=H.getProperties(),n=0;n<w.length;n++)Db.confirmDefaultFormatString(w[n]);ka.refreshEntity(H);k(y,u)?v.getIsChange()&&Ba.getMessageCurtain().showPrompt(L.get("storedProcedureSetChangeTips","\u60a8\u4fee\u6539\u4e86\u5b58\u50a8\u8fc7\u7a0b\u8bbe\u7f6e\uff0c\u6570\u636e\u7ed3\u679c\u96c6\u53ef\u80fd\u53d1\u751f\u53d8\u52a8\uff0c\u60a8\u4e5f\u53ef\u4ee5\u91cd\u65b0\u8bbe\u7f6e\u5b57\u6bb5\u3002")):
Ba.getMessageCurtain().showPrompt(L.get("propertiesChangeTips","\u6570\u636e\u5b57\u6bb5\u5df2\u53d1\u751f\u53d8\u52a8\uff0c\u5df2\u5220\u9664\u4e86\u90e8\u5206\u539f\u5b57\u6bb5\uff0c\u60a8\u4e5f\u53ef\u4ee5\u91cd\u65b0\u8bbe\u7f6e\u5b57\u6bb5\u3002"));a(!0)}else v.setName(A),H=r.clone(),H.setName(r.getName()),H.removeStoredProcedure(A),H.addStoredProcedure(v),Ba.createFacade(function(E){var Z={};Z[r.getName()]=r;var C=new zb;C.fromJsonObject(E,Z);E=C.getFisrtEntity();E.setAlias(x);Z=E.getProperties();
C=g(y,Z);E.setProperties(C);C=E.getProperties();for(var ba=0;ba<C.length;ba++)Db.confirmDefaultFormatString(C[ba]);ka.refreshEntity(E);k(va.getProperties(),Z)?v.getIsChange()&&Ba.getMessageCurtain().showPrompt(L.get("storedProcedureSetChangeTips","\u60a8\u4fee\u6539\u4e86\u5b58\u50a8\u8fc7\u7a0b\u8bbe\u7f6e\uff0c\u6570\u636e\u7ed3\u679c\u96c6\u53ef\u80fd\u53d1\u751f\u53d8\u52a8\uff0c\u60a8\u4e5f\u53ef\u4ee5\u91cd\u65b0\u8bbe\u7f6e\u5b57\u6bb5\u3002")):Ba.getMessageCurtain().showPrompt(L.get("propertiesChangeTips",
"\u6570\u636e\u5b57\u6bb5\u5df2\u53d1\u751f\u53d8\u52a8\uff0c\u5df2\u5220\u9664\u4e86\u90e8\u5206\u539f\u5b57\u6bb5\uff0c\u60a8\u4e5f\u53ef\u4ee5\u91cd\u65b0\u8bbe\u7f6e\u5b57\u6bb5\u3002"));r.removeStoredProcedure(A);r.addStoredProcedure(v);a(!0)},function(E,Z,C){C=E.toString();return"20"==C.substr(0,2)&&7==C.length&&209E4!=E?(2020501==E&&(E=v.getAssociateName(),Z=-1==Z?L.get("notFindResult","\u6ca1\u6709\u83b7\u53d6\u5230\u5b58\u50a8\u8fc7\u7a0b#1\u7684\u7ed3\u679c\u96c6\u3002").replace("#1",E):
L.get("notFindIdxResult","\u6ca1\u6709\u83b7\u53d6\u5230\u5b58\u50a8\u8fc7\u7a0b#1\u7b2c#2\u4e2a\u7684\u7ed3\u679c\u96c6\u3002").replace("#1",E).replace("#2",Z)),Y.getMessageCurtain().showPrompt(Z),a(!1),!0):!1}).getDesigntimeDataObject(H.toJsonObject(),va.getAssociateName())},g=function(a,r){for(var y=[],x=[],A=0;A<r.length;A++)x.push(r[A].getName());for(A=0;A<a.length;A++)0<=x.indexOf(a[A].getName())&&y.push(a[A]);return y},k=function(a,r){if(a.length!==r.length)return!1;for(var y=[],x=0;x<a.length;x++)y.push(a[x].getName());
for(x=0;x<r.length;x++)if(-1==y.indexOf(r[x].getName()))return!1;return!0}}function Nb(){l.call(this);var pa=this,Y=this.protectedMethod,ka=new sc,va=new sc,Ba=new cb,h,e;this.setCaption=function(c,d){Y.setTitle(c);ka.setText(d)};this.setText=function(c,d){Ba.setText(c);var g=0;c&&(c=c.split("\n").length,g=1E3<c?1E3:c);va.setText(g+"/1000\u9879");e=function(k){var a=k?$.trim(Ba.getText()):null;d(k,a)};Y.setClosingAction(e)};this.showDialogLeftAnchorTo=function(c){c&&(pa.setSize(450,430),c=$a.upwardCoordinate(document.body,
[0,0],document.body),pa.setPosition(Math.max(0,c[0]-10),Math.max(6,c[1]-430+40)));Ba.addEditedListener(f);Y.setContentPaneCreator(b);pa.showDialog();Ba.requestFocus()};this.setClosingChecker=function(c){c&&(h=function(){var d=c($.trim(Ba.getText()));d&&Y.getMessageCurtain().showPrompt(d);return d?!1:!0},Y.setClosingChecker(h))};var b=function(){va.setAlign(sc.ALIGN_RIGHT);$a.layoutCtrlWithLRTB(ka.getJqUi(),0,0,null,0,null,23);$a.layoutCtrlWithLRTB(Ba.getJqUi(),0,0,null,30,null,260);$a.layoutCtrlWithLRTB(va.getJqUi(),
290,0,null,287,null,23);var c=$("<div>");c.append(ka.getJqUi());c.append(Ba.getJqUi());c.append(va.getJqUi());return c},f=function(c){var d=c.getText(),g=[];d&&(g=d.trim().replace(/(\n\s*)+/g,"\n").split("\n"));d=g.length;1E3<d&&(c.setText(g.slice(0,1E3).join("\n")),d=1E3);va.setText(d+"/1000\u9879");Y.getMessageCurtain().hide()}}function Ec(){function pa(P){KTDefaultCellRender.call(this,P);var fa=this,xb=this.paintCellUI;this.paintCellUI=function(D,la){var za=fa.getCellWidth(),F=fa.getCellHeight(),
ja=fa.getCurrentRow();if(fa.getCurrentRowIdx()<ha.getHeadRowCount()&&22==ja.getHeight())if(1==fa.getCurrentColIdx()){var Pa=A(L.get("targetFieldName","\u76ee\u6807\u5c5e\u6027\u5217"),e.getFieldName());e.setFieldName(H(Pa));tb(D,za,F,ja,Pa,!1,fa.getCurrentColIdx())}else 2==fa.getCurrentColIdx()?(4==P.getColumnsCount()?(Pa=4<P.getColumnsCount(),la=A(L.get("targetFieldValue","\u76ee\u6807\u503c\u5217"),e.getFieldValueName(fa.getCurrentColIdx()-2))):(Pa=4<P.getColumnsCount(),la=A(L.get("targetFieldValue",
"\u76ee\u6807\u503c\u5217")+(fa.getCurrentColIdx()-1),e.getFieldValueName(fa.getCurrentColIdx()-2))),e.addFieldValueName(fa.getCurrentColIdx()-2,H(la)),tb(D,za,F,ja,la,Pa,fa.getCurrentColIdx())):2<fa.getCurrentColIdx()&&fa.getCurrentColIdx()<P.getColumnsCount()-1?(Pa=4<P.getColumnsCount(),la=A(L.get("targetFieldValue","\u76ee\u6807\u503c\u5217")+(fa.getCurrentColIdx()-1),e.getFieldValueName(fa.getCurrentColIdx()-2)),e.addFieldValueName(fa.getCurrentColIdx()-2,H(la)),tb(D,za,F,ja,la,Pa,fa.getCurrentColIdx())):
xb(D,la);else if(Pa=fa.getCurrentRowIdx()-3,1==fa.getCurrentColIdx()&&fa.getCurrentRowIdx()>=ha.getHeadRowCount()){D=$(D);F=D.find(".dm-common-tablecell-editable");la=F.eq(0);var hb=!0;za=ja.getCell(1).getValue();0==F.length&&(hb=!1,la=$("<div>"),la.addClass("dm-common-tablecell-editable"),D.css("cursor","pointer"),la.appendTo(D));la.text(za);hb&&(Pa=fa.getCurrentRowIdx()-3,(F=e.getColumnToRowPropertyItem(Pa))||(F=new mb),F.setFieldName(za),e.addColumnToRowPropertyItem(Pa,F));C(D,ja,P,fa.getCurrentColIdx(),
Pa)}else fa.getCurrentRowIdx()>=ha.getHeadRowCount()&&1<fa.getCurrentColIdx()&&fa.getCurrentColIdx()<P.getColumnsCount()-1?(D=$(D),la=ja.getCell(fa.getCurrentColIdx()).getValue(),O(D,za,F,la,ja,fa.getCurrentRowIdx()-3,fa.getCurrentColIdx()),C(D,ja,P,fa.getCurrentColIdx(),Pa)):(xb(D,la),C($(D),ja,P,fa.getCurrentColIdx(),Pa))};var tb=function(D,la,za,F,ja,Pa,hb){var Yb=$(D),ec=ha.createCtrlInCell(D,la,za,sc);ec.setText(U(ja));ec.setUserObject(F);D=ec.getJqUi();D.css({"line-height":"28px",width:"100%"});
D.find(".sa-ctrl-label-text").css("width","90%");la=$("<div>");Xa.background(la,"btn_edit");la.css("left","90%");la.on("click",function(){Qb(Yb,ec,hb)});la.addClass("dm-entity-fieldtable-format-icon");la.appendTo(D);Pa&&(la.css("left","80%"),D.find(".sa-ctrl-label-text").css("width","80%"),Pa=$("<div>"),Xa.background(Pa,"btn_delete"),Pa.css("left","90%"),Pa.addClass("dm-entity-fieldtable-format-icon"),Pa.on("click",function(){e.deleteFieldValueProperty(hb-2);P.removeColumn(hb)}),Pa.appendTo(D));Ca(Yb,
hb,ja)},Qb=function(D,la,za){var F=new Uc;F.setSize(null,100);var ja=new Pc($(document.body));ja.setSize(312,155);var Pa=la.getText().replace("\uff08"+L.get("columnName","\u540d\u79f0\uff1a"),"\uff08");Pa=N(Pa,"\uff09")?Pa.substring(Pa.indexOf("\uff08")+1,Pa.length-1):"";var hb=F.getJqUi();F.setInputValue(Pa);ja.setTitle(L.get("modifyFieldName","\u4fee\u6539\u5b57\u6bb5\u540d\u79f0"));ja.setClosingListener(function(Yb){if(Yb){Yb=F.getInputValue().trim();var ec=z(Yb,za);ec?F.showMessage(ec,"#FCAD05"):
Pa!=Yb?(ec=la.getText(),N(ec,"\uff09")?Yb?la.setText(ec.substring(0,ec.indexOf("\uff08")+1)+Yb+"\uff09"):la.setText(ec.substring(0,ec.indexOf("\uff08"))):Yb&&la.setText(ec+"\uff08"+Yb+"\uff09"),Ca(D,za,la.getText()),la.setText(U(la.getText())),d.showSuccess(L.get("editSuccess","\u4fee\u6539\u6210\u529f\u3002")),ja.destroy()):ja&&ja.destroy()}});ja.showDialog(hb);setTimeout(function(){F&&F.setFocus()},100)},U=function(D){return D.replace("\uff08","\uff08"+L.get("columnName","\u540d\u79f0\uff1a"))},
Ca=function(D,la,za){D=H(la,za);u(la,za);1==la?e.setFieldName(D):e.addFieldValueName(la-2,D)},z=function(D,la){if(null==D||""==D||0==D.length)return L.get("fieldNameIsNull","\u5b57\u6bb5\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a");if(50<D.length)return L.get("fieldNameCanNotExceedLimit","\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26");if(D){var za=D.indexOf("\uff08"),F=D.indexOf("\uff09");-1<za&&-1<F&&(D=D.substr(0,za)+D.substr(za+1,F-(za+1)));if(!D.match(/^[\s\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/))return L.get("headNameComponentCheckError",
"\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210");za=e.getFieldName();F=e.getFieldValueNames().indexOf(D);if(D==za&&1!=la||-1<F&&F!=la-2)return L.get("headNameRepeatCheckError","\u5b57\u6bb5\u540d\u79f0\u5df2\u5b58\u5728")}},N=function(D,la){return D.indexOf(la)==D.length-la.length},t=function(){for(var D=b,la=[],za=0;za<D.length;za++){var F=D[za],ja;if(ja=!F.isCalculatingField()){a:{ja=void 0;var Pa=F;if(null!=f&&0!=f.length)for(ja in f){var hb=
f[ja];if(hb&&hb.getName()==Pa.getName()){ja=!0;break a}}ja=!1}ja=!ja}ja&&la.push(F)}return la},O=function(D,la,za,F,ja,Pa,hb){var Yb=new ob,ec=t();Yb.setItemModel(ec);Yb.setListItemPainter(Wa);Yb.setSearchListener(W);Yb.setShowFieldNameListener(Fa);D=ha.createCtrlInCell(D,la,za,kb);D.setUserObject(ja);D.setSelectedModel(F);D.setDropdownCreator(function(Vc,fd,Mc){return Yb.createJqPopup(Vc,fd,Mc)});D.setCustomPainter(function(Vc,fd){fd.text(Vc?"\u5b57\u6bb5 ["+Vc.getAlias()+"] \u7684\u503c":"");if(Vc){(fd=
e.getColumnToRowPropertyItem(Pa))||(fd=new mb);var Mc=fd.getPropertyValues();null==Mc&&(Mc=[]);var lc=Vc.getName();Mc[hb-2]=lc;fd.setPropertyValues(Mc);Mc=fd.getFieldName();Mc||(Mc=(Mc=Vc.getAlias())?Mc:lc,ja.getCell(1).setValue(Mc),fd.setFieldName(Mc));e.addColumnToRowPropertyItem(Pa,fd);ja.getCell(hb).setValue(Vc)}else ja.getCell(hb).setValue("");K(P,Pa,hb-2)})},W=function(D,la,za,F,ja,Pa){la=la.toLowerCase();for(var hb=[],Yb,ec=0;ec<D.length;ec++)Yb=D[ec],(Yb=-1!=Yb.getAlias().toLowerCase().indexOf(la)?
!0:Pa&&-1!=Yb.getName().toLowerCase().indexOf(la)?!0:!1)&&hb.push(D[ec]);za.children().remove();if(0<hb.length){for(ec=0;ec<hb.length;ec++)ja(hb[ec],za,F);hb.length=0}else D=new sc,D.setText(L.get("nothingSearched","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c")),D.setEnabled(!1),D.setAlign(sc.ALIGN_CENTER),D=D.getJqUi(),D.addClass("dm-field-popup-search-result"),D.appendTo(za);Fa(za,Pa)},Fa=function(D,la){if(la)for(D=D.find(".dm-field-popup-list-item-field-name"),la=0;la<D.length;la++){var za=
D.eq(la);za.css("display","inline-block");var F=za.prev().text()+za.text();za.prev().attr("title",null);za.parent().attr("title",F)}else for(D=D.find(".dm-field-popup-list-item-field-name"),la=0;la<D.length;la++)za=D.eq(la),za.css("display","none"),za.parent().attr("title",null),za.prev().attr("title",za.prev().text())},Wa=function(D,la,za){var F=$("<div>");F.addClass("dm-field-popup-list-item");F.data("model",D);var ja=D?D.getAlias():"",Pa=$("<span>");Pa.text(ja);Pa.attr("title",ja);Pa.addClass("dm-field-popup-list-item-text");
ja="";D&&(ja=D.getFormula()?D.getAlias():D.getName());var hb=$("<span>");hb.text("("+ja+")");hb.addClass("dm-field-popup-list-item-field-name");F.append(Pa);F.append(hb);la.append(F);za&&za.getAlias()==D.getAlias()&&ua(la,F)},ua=function(D,la){var za=null;0<D.height()?(clearTimeout(za),la.addClass("dm-list-item_selected_enabled"),D.prop("scrollTop",la.prop("offsetTop"))):za=setTimeout(function(){ua(D,la)},0)}}var Y=this,ka,va,Ba,h,e,b,f,c,d,g={};this.setMessageCurtain=function(P){d=P};this.isExistError=
function(){return 0<va.find(".dm-entity-filtertable-prompt").length?!0:!1};this.getErrorMessage=function(){var P=null,fa=e.getColumnToRowPropertyItems();if(null!=fa&&0<fa.length)if(Y.isExistError())P=c;else{a:{P=e.getFieldValueProperties();fa=e.getColumnToRowPropertyItems();for(var xb=0;xb<P.length;xb++){var tb;if(tb=fa&&0<fa.length)b:{tb=void 0;var Qb=fa,U=xb;for(tb in Qb){var Ca=Qb[tb];if(Ca&&(Ca=Ca.getPropertyValues()[U])&&k(Ca)){tb=!1;break b}}tb=!0}if(tb){P=L.get("existsUnconfigColumn",'"\u76ee\u6807\u503c\u5217#1"\u672a\u8bbe\u7f6e').replace("#1",
xb+1);break a}}P=void 0}P||(P=ba());if(P)return P;fa=e.getFieldName();xb=e.getFieldValueNames();fa?-1<xb.indexOf("")&&(P=xb.indexOf(""),P=L.get("Rename","\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u5b57\u6bb5\u503c"+(P+1)+"\u540d\u79f0\u3002")):P=L.get("Rename","\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u5b57\u6bb5\u540d\u79f0\u3002")}return P};this.setCurrentEntityProperties=function(P){b=P};this.setSetUpRelationProperties=function(P){f=P};this.initAllPropertyNamesMap=function(P,fa){if(P&&fa)try{g={};var xb=[];fa instanceof
Ob?xb=fa.getChildren():xb.push(fa);for(var tb in xb){var Qb=xb[tb].getSource(),U=xb[tb].getTopParentEntity().getAssociateName(),Ca=P.createFacade(function(z){var N=new zb;N.fromJsonObject(z,[Qb]);(z=N.getEntityByAssociateName(U))&&z.getProperties().forEach(function(t){g[t.getName()]=t})});Ca.setShowBlocking(!1);Ca.getDesigntimeDataObject(Qb.toJsonObject(),U)}}catch(z){window.console&&console.error(z.stack)}};var k=function(P){if(b)for(var fa in b){var xb=b[fa];if(xb.getName()==P)return xb}return null};
this.setColumnToRowProperty=function(P){null==P?e=new Zb:(e=new Zb,e.fromJsonObject(P.toJsonObject()))};this.getColumnToRowProperty=function(){return e};var a=function(){var P=$("<div class='dm-column-to-row-delete'>"),fa=$("<div>"),xb=$("<span class='dm-column-to-row-delete-button'>");xb.text(L.get("clearColumnToRowSetting",'\u6e05\u7a7a"\u5217\u8f6c\u884c"\u8bbe\u7f6e'));xb.on("click",function(){e=new Zb;Z()});fa.append(xb);P.append(fa);va.append(P)},r=function(){var P=$("<div>");P.addClass("dm-column-to-row-add-column");
$a.layoutCtrlWithLRTB(P,null,0,130,390,null,50);var fa=$("<div>");fa.addClass("dm-column-to-row-advanced-setting");$a.layoutCtrlWithLRTB(fa,null,0,80,6,null,20);var xb=$("<div>");xb.addClass("dm-column-to-row-advanced-setting-desc");xb.text(L.get("advancedSetting","\u9ad8\u7ea7"));var tb=$("<div>");tb.addClass("dm-column-to-row-advanced-setting-desc-icon");xb.appendTo(fa);tb.appendTo(fa);xb.css("text-align","right");$a.layoutCtrlWithLRTB(xb,null,20,130,0,0,20);$a.layoutCtrlWithLRTB(tb,null,4,7,4,
null,7);fa.on("click",function(){Ba?y(Ba):(Ba=$("<div class='dm-column-to-row-add-column-button'>"),Ba.text(L.get("addColumnButton",'\u6dfb\u52a0"\u76ee\u6807\u503c\u5217"')),Ba.on("click",function(Qb){Qb=ka.getColumnsCount();ka.insertColumn(Qb-1,"columns"+Qb).setWidth(200);Z(e);y(Ba)}),$a.layoutCtrlWithLRTB(Ba,null,1,120,26,null,28),P.append(Ba))});P.append(fa);va.append(P)},y=function(P){P&&("block"==P.css("display")?P.hide():P.show())},x=function(P,fa){return P.indexOf(fa)==P.length-fa.length},
A=function(P,fa){if(fa)var xb=fa;else{fa=0;if(null!=b&&0<b.length)for(xb in b){var tb=b[xb],Qb=tb.getName();tb.getAlias();fa=v(Qb,fa);fa=v(Qb,fa)}(tb=e.getFieldName())&&(fa=v(tb,fa));tb=e.getFieldValueNames();if(null!=tb&&0<tb.length)for(xb in tb)fa=v(tb[xb],fa);xb="column"+(parseInt(fa)+1)}fa=xb;return x(P,"\uff09")?P.substring(0,P.indexOf("\uff08")+1)+fa+"\uff09":fa?P+"\uff08"+fa+"\uff09":P},v=function(P,fa){if(0==!P.indexOf("column"))return fa;(P=P.substring(P.indexOf("column")+6,P.length))&&/^\+?[1-9][0-9]*$/.test(P)&&
(P=parseInt(P),null!=fa&&void 0!=fa&&parseInt(fa)<P&&(fa=P));return fa},H=function(P,fa){return(fa=u(P,fa))?fa:"column"+P},u=function(P,fa){return fa&&x(fa,"\uff09")?fa.substring(fa.indexOf("\uff08")+1,fa.lastIndexOf("\uff09")):""},w=function(P,fa){return 1==fa},n=function(P,fa,xb,tb,Qb){xb.setValue(tb);return!0};this.getJqUi=function(){if(va)return va;va=$("<div>");var P=$("<div class='dm-column-to-row-table'>");ka=ha.createTable();ka.setSyncUIWhenModelChanged(!0);ka.setDraggableAdjusting(!0,3,0,
new bd);ha.bindTextEditor(ka,w,n);ha.bindTableListenerForCtrl(ka,E);var fa=new pa(ka);fa.setOutsideVisible(!1);ka.setCellRender(fa);fa=e.getFieldValueNames();var xb=e.getFieldName(),tb=fa.length+3;if(null==fa||0==fa.length)fa=[L.get("firstFieldOne","\u76ee\u6807\u503c\u52171")],tb=4;ka.addColumns(tb);ka.getColumn(0).setWidth(25);ka.getColumn(1).setWidth(200);for(var Qb=0;Qb<fa.length;Qb++){var U=2+Qb;ka.getColumn(U).setWidth(200)}ka.getColumn(tb-1).setWidth(162);tb=ha.createHeadRow(ka);tb.getCell(1).setValue(A(L.get("targetFieldName",
"\u76ee\u6807\u5c5e\u6027\u5217"),xb));for(Qb=0;Qb<fa.length;Qb++)U=2+Qb,tb.getCell(U).setValue(A(L.get("targetFieldValue","\u76ee\u6807\u503c\u5217"),fa[Qb]));fa=$(ka.getUI());$a.layoutCtrlWithLRTB(fa,0,0,null,50,0,null);P.append(fa);va.append(P);Z();fa.children().eq(1).css("width","100%");a();r();return va};var E=function(P,fa,xb,tb){P=null;fa?(fa=KTableUIAbstractView.createCellId(ka.getRow(xb),ka.getColumn(ka.getColumnsCount()-1)),P=Y.getJqUi().find("#"+fa),fa=$("<div>"),fa.text(L.get("insert",
"\u63d2\u5165")),fa.addClass("dm-entity-filtertable-op"),fa.addClass("dm-entity-filtertable-op-insert"),fa.appendTo(P),fa.on("click",function(Qb){e.getColumnToRowPropertyItems().splice(xb-3,0,null);Z()}),fa=$("<div>"),fa.text(L.get("deleteRow","\u5220\u9664")),fa.addClass("dm-entity-filtertable-op"),fa.addClass("dm-entity-filtertable-op-delete"),fa.appendTo(P),fa.on("click",function(Qb){e.deleteColumnToRowPropertyItem(xb-3);Z()})):h&&h.find(".dm-entity-filtertable-op").remove();h=P},Z=function(){ha.clearWithoutHead(ka);
var P=e.getColumnToRowPropertyItems(),fa=e.getFieldValueNames();if(P)for(var xb=0;xb<P.length;xb++){var tb=P[xb];if(tb){var Qb=ha.createRow(ka);Qb.getCell(1).setValue(tb.getFieldName());var U=tb.getPropertyValues();for(tb=0;tb<fa.length;tb++){var Ca=2+tb,z=k(U[tb]);Qb.getCell(Ca).setValue(z)}}else for(Qb=ha.createRow(ka),Qb.getCell(1).setValue(""),tb=0;tb<fa.length;tb++)Ca=2+tb,Qb.getCell(Ca).setValue("")}P=10-(P?P.length:0);if(0<P)for(xb=0;xb<P;xb++)for(Qb=ha.createRow(ka),Qb.setHeight(30),tb=1,
fa=ka.getColumnsCount()-1;tb<fa;tb++)Qb.getCell(tb).setValue("");ha.refresh(ka)},C=function(P,fa,xb,tb,Qb){for(var U=0;U<tb;U++)P=P.prev();a:{if(fa){U=xb.getColumnsCount()-3;var Ca=!1,z=!1;try{var N=fa.getCell(1)}catch(O){console.log("error");break a}N&&N.getValue()&&(z=!0);for(N=2;N<U+2;N++){var t=fa.getCell(N);if(t&&t.getValue()){Ca=!0;break}}if(z&&!Ca){c=L.get("existColumnToRowErrorItem","\u5b58\u5728\u4e0d\u5b8c\u6574\u7684\u914d\u7f6e\u9879");ca(P,null,null,L.get("existColumnToRowErrorItem",
"\u5b58\u5728\u4e0d\u5b8c\u6574\u7684\u914d\u7f6e\u9879"));break a}else if(Ca&&!z){c=L.get("existColumnToRowErrorItem","\u5b58\u5728\u4e0d\u5b8c\u6574\u7684\u914d\u7f6e\u9879");ca(P,null,null,L.get("existColumnToRowErrorItem","\u5b58\u5728\u4e0d\u5b8c\u6574\u7684\u914d\u7f6e\u9879"));break a}}ca(P,null,null,null)}K(xb,Qb,tb)},ba=function(){b.forEach(function(Qb){g[Qb.getName()]=Qb});var P=[],fa=e.getFieldName(),xb=e.getFieldValueNames();P.push(fa);P=P.concat(xb);for(var tb in P)if(fa=P[tb],g[fa])return P=
L.get("existsSameColumnName",'\u5f53\u524d\u8bbe\u7f6e\u7684\u7b2c#1\u5217\u5217\u540d\u79f0"#2"\u4e0e\u5df2\u5b58\u5728\u7684\u5217\u540d\u79f0\u91cd\u590d'),P=P.replace("#1",parseInt(tb)+1),P=P.replace("#2",fa)},K=function(P,fa,xb){P.getColumnsCount();var tb=P.getRowsCount()-3;if(0<tb)for(var Qb=3;Qb<tb;Qb++)if(P.getRow(Qb).getCell(1).getValue()){a:{var U=fa;var Ca=xb,z=P.getRow(U+3).getCell(Ca+2).getValue();if(z=z?z.getName():"")for(var N=e.getColumnToRowPropertyItems(),t=0;t<N.length;t++){var O=
N[t];if(O){var W=O.getPropertyValues(),Fa;for(Fa in W)if((t!=U||Fa!=Ca)&&W[Fa]==z){W.splice(Fa,1,"");O.setPropertyValues(W);U=!0;break a}}}U=!1}if(U){Z();break}}},ca=function(P,fa,xb,tb){P=$(P);P.find(".dm-entity-filtertable-prompt").remove();tb&&(fa=Ga.createWarning(),fa.addClass("dm-entity-filtertable-prompt"),fa.css({left:"5px",right:"0px"}),fa.attr("title",tb),fa.appendTo(P))}}function bd(){this.isRowDraggable=function(pa,Y){return!0};this.isColumnDraggable=function(pa,Y){return!0};this.getMinRowHeightLimited=
function(pa,Y){return 3};this.getMinColumnWidthLimited=function(pa,Y){return 4};this.rowDraggedAction=function(pa,Y,ka){var va=pa.isSyncUIWhenModelChanged();pa.setSyncUIWhenModelChanged(!0);Y=pa.getRow(Y);Y.setHeight(Y.getHeight()+ka);pa.setSyncUIWhenModelChanged(va)};this.columnDraggedAction=function(pa,Y,ka){var va=pa.isSyncUIWhenModelChanged();pa.setSyncUIWhenModelChanged(!0);Y=pa.getColumn(Y);Y.setWidth(Y.getWidth()+ka);pa.setSyncUIWhenModelChanged(va)};this.getTailBlankForDragging=function(){return 0}}
function Uc(){var pa,Y,ka,va;this.setSize=function(Ba,h){};this.getDefault=function(){};this.setInputValue=function(Ba){va.setText(Ba)};this.getInputValue=function(){return va.getText()};this.setFocus=function(){va.requestFocus()};this.showMessage=function(Ba,h){clearTimeout(ka);Y.text(Ba);h&&Y.css("color",h);ka=setTimeout(function(){Y.text("")},5E3)};this.getJqUi=function(){if(!pa){pa=$("<div>");var Ba=$("<div>");Ba.addClass("field-input-container");var h=new sc;h.setText(L.get("fieldName","\u5b57\u6bb5\u540d\u79f0"));
h.setRequired(!0);h=h.getJqUi();$a.layoutCtrl(h,8,0,72,21);va=new M;var e=va.getJqUi();e.addClass("field-name-input");Y=$("<div>");Y.addClass("message-tips");Ba.append(h);Ba.append(e);pa.append(Ba);pa.append(Y)}return pa}}function Pc(pa){var Y=$("<div class='sa-ctrl-common-modallayer'>"),ka=new kd(Y),va=0,Ba=0,h=320,e=240,b=pa?pa:$(document.body),f,c;this.setTitle=function(d){c=d};this.setClosingListener=function(d){f=d};this.setSize=function(d,g){h=d;e=g};this.showDialog=function(d){Y.appendTo(b);
if(!va){var g=b.prop("clientWidth"),k=b.prop("clientHeight");va=g-h>>1;Ba=(k-e)/3}ka.setBounds(va,Ba,h,e);ka.setToolbarVisible(!1);ka.setContent(d);ka.setTitle(c);ka.addClosingListener(function(a,r){if(r)f(r);else return a.destroy(),Y.remove(),!0});ka.addClosedListener(function(a){a.destroy();Y.remove()});ka.showFooterPane();ka.show()};this.destroy=function(){ka.destroy();Y.remove()}}function Wb(){l.call(this);var pa=this,Y=this.protectedMethod,ka,va,Ba,h,e=[],b;this.setGlobalDependence=function(k){va=
k};this.getGlobalDependence=function(){return va};this.setRelationsAndEntity=function(k,a){var r=[];if(null!=k&&0<k.length)for(var y=0;y<k.length;y++){if(k[y].getFromEntity().getName()==a.getName()){var x=k[y].getFromProperty();r.push(x)}k[y].getToEntity().getName()==a.getName()&&(x=k[y].getToProperty(),r.push(x))}b=r;k=Ba=a;a=k.getColumnToRowProperties();r=k.getProperties();if(null!=a&&0<a.length)for(var A in a)y=new Ec,y.setColumnToRowProperty(a[A]),y.setSetUpRelationProperties(b),y.setCurrentEntityProperties(r),
y.setMessageCurtain(Y.getMessageCurtain()),y.initAllPropertyNamesMap(va,k),e.push(y);else y=new Ec,y.setColumnToRowProperty(null),y.setCurrentEntityProperties(r),y.setSetUpRelationProperties(b),y.initAllPropertyNamesMap(va,k),y.setMessageCurtain(Y.getMessageCurtain()),e.push(y)};this.getEntity=function(){return Ba};this.setConfirmListener=function(k){h=k};this.setColumnToRowPanels=function(k){e=k};this.getColumnToRowPanels=function(){return e};this.initUi=function(){var k=L.get("columnToRow","\u5217\u8f6c\u884c");
pa.setSize(620,560);Y.setTitle(k);var a=$("<div>");k=$("<div>");k.css("position","absolute");var r=$("<span>");r.addClass("dm-column-to-row-add-column-desc");r.text(L.get("configColumnDesc",'\u8bf7\u5728"\u76ee\u6807\u503c\u5217"\u4e2d\u9009\u62e9\u9700\u8981\u8fdb\u884c\u8f6c\u7f6e\u7684\u5217'));r.appendTo(k);r=f().getJqUi();r.appendTo(k);r.css({display:"inline-block",top:"10px","margin-left":"5px"});r.css("z-index",2);k.appendTo(a);Y.setContentPaneCreator(function(){for(var y in e)a.append(e[y].getJqUi());
return a});Y.setClosingChecker(g,!0);Y.setClosingAction(c);Y.setSelectable(!0)};var f=function(){if(!ka){var k=$("<div>"),a=$("<span>");a.text(L.get("columnToRowHelpIconTips","\u201c\u5217\u8f6c\u884c\u201d\u529f\u80fd\u53ef\u5c06\u539f\u59cb\u6570\u636e\u4e2d\u7684\u540c\u4e00\u884c\u591a\u5217\u6570\u636e\u8f6c\u6362\u4e3a\u591a\u884c\u6570\u636e  "));a.appendTo(k);a=da.getColumnToRowUrl();a=$("<a onclick='javascript:window.open(\""+a+"\");' href='#'>");a.text(L.get("viewDetails","\u67e5\u770b\u5e2e\u52a9\u6587\u6863"));
a.css("cursor","pointer");a.css("color","#5582f3");a.appendTo(k);ka=new Qc;ka.setIconType(Qc.ICON_TYPE_QUESTION);ka.setTipsSize(200,70);ka.setTipsHtml(k[0])}return ka},c=function(k){if(k){k=pa.getColumnToRowPanels();var a=pa.getEntity(),r=a.getProperties();a=a.getPropertyViewNodes();for(var y=[],x={},A=0;A<a.length;A++){var v=a[A];v&&v.isProperty()&&(v=v.getModel(),x[v.getName()]=v)}if(null!=k&&0<k.length)for(var H in k)if(A=k[H].getColumnToRowProperty())if(v=A.getColumnToRowPropertyItems(),null!=
v&&0!=v.length){v=r;var u=a,w=x,n=A,E=n.getColumnToRowPropertyItems();if(null!=E&&0<E.length)for(var Z=0;Z<E.length;Z++)E[Z]||(E.splice(Z,1),Z--);var C=n.getFieldNameProperty();E=n.getFieldValueProperties();Z=n.getColumnToRowPropertyItems();n=n.getUsedColumnToRowPropertyNames();var ba=C.getName();if(!w[ba]){C.setHide(!1);var K=new na(C,0);u.push(K);w[ba]=C}for(C=0;C<E.length;C++){ba=E[C];var ca=ba.getName();w[ca]||(ba.setHide(!1),K=new na(ba,0),u.push(K),w[ca]=ba);if(Z&&0<Z.length){var P=void 0;ca=
K=void 0;var fa=Z,xb=v,tb=C;for(P in fa){var Qb=fa[P];if(Qb){var U=Qb.getPropertyValues()[tb];a:{Qb=void 0;var Ca=xb;for(Qb in Ca){var z=Ca[Qb];if(z instanceof Db&&z.getName()==U){Qb=z;break a}}Qb=null}if(Qb)if(!ca)ca=Qb.getDataType(),K=Qb.getFormatString();else if(ca!=Qb.getDataType()){ca=Db.DT_STRING;K=null;break}}}P={};P.dataType=ca;P.format=K;K=P;ba.setDataType(K.dataType);ba.setFormatString(K.format)}}d(v,u,w,n);A&&0<A.getColumnToRowPropertyItems().length&&y.push(A)}else d(r,a,x,[]);Ba.setColumnToRowProperties(y);
h()}},d=function(k,a,r,y){for(var x in k){var A=k[x],v=A.getName(),H=y.indexOf(v);v=r[v];-1!=H||v||(A.setHide(!1),A=new na(A,0),a.push(A))}},g=function(k){for(var a in e){var r=e[a];if(oColumnToRowProperty=r.getColumnToRowProperty())if(r=r.getErrorMessage())return Y.getMessageCurtain().showError(r),k(!1),!1}k(!0)}}function cc(){Bc.call(this);var pa=this,Y=this.getDisplayText;this.getDisplayText=function(){return 0===pa.getSelectedValue().length?L.get("selectUsersPlaceholder","\u8bf7\u9009\u62e9\u7528\u6237\uff08\u9ed8\u8ba4\u5305\u542b\u4e1a\u52a1\u4e3b\u9898\u521b\u5efa\u4eba\uff09"):
Y()}}function Ea(){var pa,Y,ka,va,Ba,h,e,b,f,c,d,g;this.getJqUi=function(){if(!pa){var A=new sc(L.get("extractUsers","\u63d0\u53d6\u65f6\u7684\u7528\u6237\u8eab\u4efd\uff1a")),v=new q;va=new G;Ba=new G;va.setText(L.get("extractByCreator","\u6309\u4e1a\u52a1\u4e3b\u9898\u521b\u5efa\u4eba\u63d0\u53d6"));Ba.setText(L.get("extractByUsers","\u6309\u6307\u5b9a\u7528\u6237\u63d0\u53d6"));v.addElement(va);v.addElement(Ba);v.addChangedListener(y);A=A.getJqUi();v=va.getJqUi();var H=Ba.getJqUi();Y=a();pa=$("<div>");
pa.append(A);pa.append(v);pa.append(H);pa.append(Y);$a.layoutCtrl(A,0,0,300,23);$a.layoutCtrl(v,0,30,300,23);$a.layoutCtrl(H,0,60,300,23);$a.layoutCtrl(Y,0,90,500,50)}return pa};this.setExtractConfig=function(A){d=!0;(b=A)?Ba.setChecked(!0):va.setChecked(!0);d=!1};this.setExtractUserLimit=function(A){g=A};this.setConfigChangedListener=function(A){c=A};this.validateConfig=function(){if(!b)return null;var A;b.getExtractUsers()&&0!==b.getExtractUsers().length?g&&b.getExtractUsers().length>=g&&(A=L.get("selectUsersLimitWaring",
"\u6307\u5b9a\u7528\u6237\u6570\u91cf\u8d85\u8fc7\u6700\u5927\u9650\u5236\u3002")):A=L.get("selectUsersWarning","\u8bf7\u9009\u62e9\u7528\u6237\u3002");return A};var k=function(){d||c&&c(b)},a=function(){var A=new sc(L.get("selectUsers","\u6307\u5b9a\u7528\u6237"));A.setRequired(!0);h=new cc;h.setConfirmClear(!1);h.setSelectedListener(function(n){b.setExtractUsers(n);k();g&&b.getExtractUsers().length>=g?r(ka,L.get("selectUsersLimitWaring","\u6307\u5b9a\u7528\u6237\u6570\u91cf\u8d85\u8fc7\u6700\u5927\u9650\u5236\u3002")):
ka.empty()});var v=[Ya.REAL_TIME,Ya.USE_THEME_CREATOR],H=new sc(L.get("otherUserPolicy","\u5176\u4ed6\u7528\u6237\u63d0\u53d6\u7b56\u7565"));e=new cd;e.setItemModels(v);e.setCustomPainter(x);e.addSelectedChangedListener(function(n,E,Z){b.setDefaultPolicy(Z);k()});A=A.getJqUi();v=h.getJqUi();H=H.getJqUi();var u=e.getJqUi();H.attr("title",L.get("otherUserPolicy","\u5176\u4ed6\u7528\u6237\u63d0\u53d6\u7b56\u7565"));var w=$("<div>");ka=$("<div>");w.append(A);w.append(v);w.append(H);w.append(u);w.append(ka);
$a.layoutCtrl(A,20,0,100,23);$a.layoutCtrl(v,130,0,250,23);$a.layoutCtrl(H,20,30,100,23);$a.layoutCtrl(u,130,30,250,23);$a.layoutCtrl(ka,390,0,600,23);return w},r=function(A,v,H){var u=$("<div>");u.text("!");u.addClass("dm-relation-dialog-promptitem-icon");u.addClass("dm-relation-dialog-promptitem-icon-"+(H?"err":"warn"));H=$("<div>");H.addClass("dm-relation-dialog-promptitem-text");H.text(v);var w=$("<div>");w.addClass("dm-relation-dialog-promptitem");w.append(u);w.append(H);setTimeout(function(){A.empty();
A.append(w)},100)},y=function(){va.isChecked()?(Y.hide(),f=b,b=null):(Y.show(),b=f||b,b||(b=new qb,b.setDefaultPolicy(Ya.REAL_TIME)),h.setSelectedValue(b.getExtractUsers()),e.setSelected(b.getDefaultPolicy()));k()},x=function(A,v,H){A="";Ya.REAL_TIME===H?A=L.get("disposableExtract","\u5b9e\u65f6\u63d0\u53d6"):Ya.USE_THEME_CREATOR===H&&(A=L.get("extractByCreator","\u6309\u4e1a\u52a1\u4e3b\u9898\u521b\u5efa\u4eba\u8eab\u4efd\u63d0\u53d6"));v.text(A);v.attr("title",A)}}"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.data&&(com.kingdee.bos.qing.data={});var qa=com.kingdee.bos.qing.data;qa.Main=function(){var pa,Y=new jc,ka=[],va,Ba=new oc,h=new rc,e=new Kc,b,f,c,d,g=!1,k=!1,a=new function(){this.createFacade=function(v,H,u){return new ib(f,v,function(w,n,E){return H&&H(w,n,E)?!0:!1},u)};this.getTopJqUi=
function(){return pa};this.getMessageCurtain=function(){return b};this.setDirty=function(v){r(v)};this.getRemoteImpl=function(){return f}};this.setRemoteImpl=function(v){f=v};this.setDataSourceDisabled=function(v){k=v};this.createJqUi=function(){pa=$("<div>");pa.addClass("dm-main");b=new Dc;b.getJqUi().appendTo(pa);Y.getJqUi().appendTo(pa);Ba.setTitle(L.get("entity","\u6570\u636e\u8868"));h.setTitle(L.get("relation","\u5173\u7cfb"));e.setTitle(L.get("config","\u8bbe\u7f6e"));va=new Wc;va.addTab(Ba,
!0);va.addTab(h);va.addTab(e);va.addTabChangedListener(x);Ba.setGlobalDependence(a);h.setGlobalDependence(a);e.setGlobalDependence(a);ka[0]=Ba.createToolbarButtons(Y);ka[1]=h.createToolbarButtons(Y);ka[2]=[];ka[3]=Ba.createToolbarViewSysVarButton(Y);Ba.setDataSourceDisabled(k);var v=va.getJqUi();v.addClass("dm-main-body");v.appendTo(pa);return pa};this.resize=function(){va.getCurrentTabPane().resize()};this.getConductor=function(){if(!c){var v={getGlobal:function(){return a}};v.setDirty=r;v.isDirty=
function(){return g};v.hookDirtyListener=function(H){d=H};c=new Jb(Y,v)}return c};this.saveAfterRefreshUploadTypeSource=function(v){if(v){var H=Ba.getDmModel(),u=new X;u.fromJsonObject(v);H.refreshUploadTypeSourceUrl(u.getSources())}};this.setJsonModel=function(v,H){var u=new Ha,w=new X;try{v&&v.boxModel&&w.fromJsonObject(v.boxModel);var n=v.systemVarTypes;n&&0<n.length&&vb.VARIANTTYPEENUM.forEach(function(ba){n.forEach(function(K){ba.getTypeID()==K&&vb.SUPPORTED_VAR_TYPE.push(ba)})});var E=v.designtimeMacros;
qa.DesigntimeMacroCache.clear();if(E&&0<E.length){v=0;for(var Z=E.length;v<Z;v++){var C=new lb;C.fromJsonObject(E[v]);qa.DesigntimeMacroCache.put(C.getId(),C)}}Ba.setDmModel(w);h.setDmModel(w);e.setDmModel(w)}catch(ba){u.setError(!0),window.console&&console.error(ba.stack)}r(!1);w.isTooModern()&&b.showPrompt(L.get("docTooModern","\u6587\u6863\u7684\u7248\u672c\u6bd4\u73af\u5883\u66f4\u9ad8\uff0c\u5df2\u6700\u5927\u517c\u5bb9\u6027\u52a0\u8f7d\u3002"));u.setTooModern(w.isTooModern());H&&H(u)};this.getJsonModel=
function(){h.collectEdited();var v=Ba.getDmModel(),H=new Ka,u=H.checkArrEntityFilter(v.copyEntityArray());if(u){var w=u.getPrompt();b.showError(w);setTimeout(function(){va.setCurrentTabPane(Ba);Ba.locateToFilterPane(u.getEntityName(),u.getFiltersErrorRow(),w)},500);return null}var n=H.checkRelationPropertyExisted(v);if(n)return b.showError(n),setTimeout(function(){va.setCurrentTabPane(h);h.updateEntityRelationToUi()},500),null;h.updateEntityRelationToUi();if(u=v.checkSchedule())return u.showMessageCurtain(b),
v=v.getExtractSchedule(),"Custom"==v.getPeriod()&&(v=v.getCron(),"undefined"!=typeof v&&""!=v||e.showTimingExtractCustomPanePrompt()),setTimeout(function(){va.setCurrentTabPane(e)},500),null;if(u=H.checkExtractUserConfig(e))return u.showMessageCurtain(b),setTimeout(function(){va.setCurrentTabPane(e)},500),null;y(v);r(!1);return v.toJsonObject()};var r=function(v){g=v;d&&d(g)},y=function(v){if(v){var H=v.getRelationCount();zc.occur(zc.DM_CREATE_RELATION,H);var u=v.getSources(),w=[];for(H=0;H<u.length;H++){var n=
u[H];w.push(n.getTypeName());if(n instanceof aa){var E=n.getAllUserSqlName(),Z=n.getAllStoredProcedureName();E&&0<E.length?(E=n.getUserSql(E[0]).getSqlType(),zc.occur(zc.DM_IMPORT_TYPE,E,n.getTypeName())):Z&&0<Z.length?zc.occur(zc.DM_IMPORT_TYPE,zc.DM_IMPORT_TYPE_STORED_PROCEDURE,n.getTypeName()):zc.occur(zc.DM_IMPORT_TYPE,zc.DM_IMPORT_TYPE_TABLE,n.getTypeName())}}zc.occur(zc.DM_SOURCE_TYPE,w);for(H=0;H<v.getEntityCount();H++){u=0;w=v.getEntityByIndex(H).getProperties();for(n=0;n<w.length;n++)w[n].isCalculatingField()&&
u++;zc.occur(zc.DM_OPERATING_NEW_FIELD,u)}v.getExtractSchedule().getPeriod()?zc.occur(zc.DM_DATA_EXTRACT_TYPE,zc.DM_DATA_TIMING_EXTRACT):zc.occur(zc.DM_DATA_EXTRACT_TYPE,zc.DM_DATA_DISPOSABLE_EXTRACT)}},x=function(v,H){var u=v=!1,w=!1;H==Ba?v=!0:H==h?u=!0:H==e&&(w=!0);A(ka[0],v);A(ka[3],v);A(ka[1],u);A(ka[2],w)},A=function(v,H){for(var u=0;u<v.length;u++)v[u].getJqUi().css("display",H?"":"none")}};qa.AbstractFilterUIRender=Fb;var $a,Ua,fb,ea,da,L,mc,wc,Bc,Gc,Wc,dc,Hc,Sc,Dc,cd,ld,sc,l,B,I,q,G,R,J,
M,cb,rb,Ja,kb,Ac,Jc,Qc,ab,ic,Eb,m,S,ha,Ga,sb,p,nc,jb,Fc,kd,X=qa.Box,Va=qa.Entity,Ob=qa.UnionEntity,Db=qa.Property,ub=qa.FilterItem,Pb=qa.Relation,aa=qa.DBSource,La=qa.ExcelSource,T=qa.TextSource,V=qa.XMLSource,ia=qa.OpenAPISource,ma=qa.AbstractSource,wa=qa.FiltersCheckingResult,xa=qa.UserSqlObj,Aa=qa.StoredProcedureModel,Oa=qa.StoredProcedureParameterModel,Ia=qa.VarSelectDialog,lb=qa.DesigntimeMacro,qb=qa.ExtractConfig,Ya=qa.ExtractPolicy,zb=qa.DesigntimeDataObject,Ab=qa.PreviewDataModel,yb=qa.TreeProperty,
Zb=qa.ColumnToRowProperty,mb=qa.ColumnToRowPropertyItem,Mb=qa.SystemVarModel,na=qa.PropertyViewNode,ib=qa.Facade,Xa=qa.Icons,Rb=qa.FormatUtil,Xb=qa.SourceType,ac=qa.SourceTypeStep,gc=qa.BizSourceTypeContext,Tc=qa.SelectFieldPane,Ra=qa.DbConnectionModifyingEditor,Gb=qa.FileConnectionModifyingEditor,Ta=qa.OpenAPIConnectionModifyingEditor,Sa=qa.DataSourceMergeFirstStep,ra=qa.MergedTableModifyDialog,db=qa.BizUnionEntityModifyDialog,Ma=qa.StoredProcedurePreviewPanel,Na=qa.BizEntityMergeEntranceStep,sa=
qa.UnionEntityCompareModel,ob=qa.ChoosePropertyPane,nb=qa.IconUtil,vb=qa.SystemVarType,bc=qa.PropDataTypeUtil,kc=qa.DbCustomSqlPanel,zc=qa.UserOperationReporter,Zc=qa.VariateHelperFactory,jd=qa.EntityErrorStatesUtil,ad=qa.CheckFieldNumUtil;(function(){var pa=com.kingdee.bos.qing.common;$a=pa.DomUtil;Ua=pa.Util;fb=pa.Base32Util;ea=pa.RelativePeriodModel;pa=com.kingdee.bos.qing.framework.common;L=pa.MultilanguageManager.createPackageAccessor(qa);da=pa.OfficialArticleUtil;pa=com.kingdee.bos.qing.biz.common;
Bc=pa.UserDialogSelector;pa=com.kingdee.bos.qing.schedule;mc=pa.ScheduleSelector;wc=pa.QingSchedule;pa=com.kingdee.bos.qing.ui.component;kd=pa.Dialog;Gc=pa.ToolbarButton;Wc=pa.TabContainer;dc=pa.SplitPane;Hc=pa.Menu;Sc=pa.MenuModel;Dc=pa.MessageCurtain;cd=pa.ComboBox;ld=pa.List;sc=pa.Label;l=pa.AbstractModalDialog;B=pa.WizardDialog;I=pa.CheckBox;q=pa.RadioButtonGroup;G=pa.RadioButton;R=pa.DateSelector;J=pa.DateTimeSelector;M=pa.TextField;cb=pa.TextArea;rb=pa.SimpleConfirmer;Ja=pa.SearchBox;kb=pa.DropdownSelector;
Jc=pa.Button;Ac=pa.F7Selector;Qc=pa.HelpIcon;pa=com.kingdee.bos.qing.common.ui;ab=pa.NumberFormatModel;ic=pa.NumberFormatSettingPanel;Eb=pa.NumberFormatSample;m=pa.FormulaEditorPanel;S=pa.RelativePeriodPanel;ha=pa.TableUtil;Ga=pa.CommonIconUtil;pa=com.kingdee.bos.qing.data.rview;sb=pa.RelationView;p=pa.DataModel;nc=pa.Table;jb=pa.Field;Fc=pa.Relation})()})();(function(){function Ha(){com.kingdee.bos.qing.framework.common.AbstractRemoteCall.call(this);var Cb;this.getRemoteUrl=function(oc){return Cb};this.setRemoteUrl=function(oc){Cb=oc}}function Jb(){var Cb=this;this.getParamSkin=function(){return Cb.getUrlParam("skin")};this.getParamLanguage=function(){return Cb.getUrlParam("language")};this.getParamPathPrefix=function(){return Cb.getUrlParam("path")};this.getUrlParam=function(oc){return com.kingdee.bos.qing.common.Util.decodeParamFromUrl(window.location.search,
oc)}}"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.data&&(com.kingdee.bos.qing.data={});var jc=com.kingdee.bos.qing.data;jc.DataModelingScene=function(){var Cb,oc,rc,Kc,Cc,xc,Ub;(function(){var Tb=com.kingdee.bos.qing;Cb=Tb.CodeLoader;oc=Tb.CommonCodeImporter;Tb=com.kingdee.bos.qing.framework.common;
rc=Tb.WebPageInitializer;Kc=Tb.WindowResizeObserver;Tb=com.kingdee.bos.qing.data;Cc=Tb.Main;xc=Tb.UserOperationReporter;Ub=Tb.Integration})();var tc=this,Ka=new Jb,Fb,wb;this.start=function(Tb){Cb.setCallback(function(){bb();tc.protectedCustomInitEnv();$b(Tb?Tb:document.body);tc.protectedLoadingImpl(tc.getRemoteImpl(),wb,function(Za){})});oc.importDataModelingSkin(Cb);oc.importDataModelingI18n(Cb);tc.protectedImportMoreCode(Cb)};this.getUrlParam=function(Tb){return Ka.getUrlParam(Tb)};this.protectedGetRemoteUrl=
function(){throw Error("Override me.");};this.protectedImportMoreCode=function(Tb){};this.protectedCustomInitEnv=function(){throw Error("Override me.");};this.protectedCustomInitDesigner=function(Tb){throw Error("Override me.");};this.protectedLoadingImpl=function(Tb,Za,oa){throw Error("Override me.");};this.protectedGetDataSourceDisabled=function(){};this.getRemoteImpl=function(){Fb||(Fb=new Ha,Fb.setRemoteUrl(tc.protectedGetRemoteUrl()));return Fb};var bb=function(){rc.init();xc.hookCollector(function(Tb,
Za,oa){com.kingdee.bos.qing.behavior.BehaviorManager.interestInBehavior(Tb,Za,0,oa)});Hb()},$b=function(Tb){wb=new Cc;wb.setRemoteImpl(tc.getRemoteImpl());wb.setDataSourceDisabled(tc.protectedGetDataSourceDisabled());var Za=new Kc;Za.setCallbackImmediately(function(){Hb()});Za.setDelay(250);Za.setCallback(function(){wb.resize();Ub.fireWindowResizeListener()});Za.observe();tc.protectedCustomInitDesigner(wb);Za=wb.createJqUi();$(Tb).append(Za);wb.resize()},Hb=function(){document.body.style.height=document.documentElement.clientHeight+
"px"}};jc.RemoteImpl=Ha})();
//qingVersionTag: 20250807