var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(G){var da=0;return function(){return da<G.length?{done:!1,value:G[da++]}:{done:!0}}};$jscomp.arrayIterator=function(G){return{next:$jscomp.arrayIteratorImpl(G)}};$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(G,da,oa){if(G==Array.prototype||G==Object.prototype)return G;G[da]=oa.value;return G};$jscomp.getGlobal=function(G){G=["object"==typeof globalThis&&globalThis,G,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var da=0;da<G.length;++da){var oa=G[da];if(oa&&oa.Math==Math)return oa}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(G,da){var oa=$jscomp.propertyToPolyfillSymbol[da];if(null==oa)return G[da];oa=G[oa];return void 0!==oa?oa:G[da]};
$jscomp.polyfill=function(G,da,oa,ya){da&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(G,da,oa,ya):$jscomp.polyfillUnisolated(G,da,oa,ya))};$jscomp.polyfillUnisolated=function(G,da,oa,ya){oa=$jscomp.global;G=G.split(".");for(ya=0;ya<G.length-1;ya++){var ea=G[ya];if(!(ea in oa))return;oa=oa[ea]}G=G[G.length-1];ya=oa[G];da=da(ya);da!=ya&&null!=da&&$jscomp.defineProperty(oa,G,{configurable:!0,writable:!0,value:da})};
$jscomp.polyfillIsolated=function(G,da,oa,ya){var ea=G.split(".");G=1===ea.length;ya=ea[0];ya=!G&&ya in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var X=0;X<ea.length-1;X++){var N=ea[X];if(!(N in ya))return;ya=ya[N]}ea=ea[ea.length-1];oa=$jscomp.IS_SYMBOL_NATIVE&&"es6"===oa?ya[ea]:null;da=da(oa);null!=da&&(G?$jscomp.defineProperty($jscomp.polyfills,ea,{configurable:!0,writable:!0,value:da}):da!==oa&&(void 0===$jscomp.propertyToPolyfillSymbol[ea]&&(oa=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[ea]=
$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(ea):$jscomp.POLYFILL_PREFIX+oa+"$"+ea),$jscomp.defineProperty(ya,$jscomp.propertyToPolyfillSymbol[ea],{configurable:!0,writable:!0,value:da})))};$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(G){if(G)return G;var da=function(X,N){this.$jscomp$symbol$id_=X;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:N})};da.prototype.toString=function(){return this.$jscomp$symbol$id_};var oa="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",ya=0,ea=function(X){if(this instanceof ea)throw new TypeError("Symbol is not a constructor");return new da(oa+(X||"")+"_"+ya++,X)};return ea},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(G){if(G)return G;G=Symbol("Symbol.iterator");for(var da="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),oa=0;oa<da.length;oa++){var ya=$jscomp.global[da[oa]];"function"===typeof ya&&"function"!=typeof ya.prototype[G]&&$jscomp.defineProperty(ya.prototype,G,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return G},
"es6","es3");$jscomp.iteratorPrototype=function(G){G={next:G};G[Symbol.iterator]=function(){return this};return G};$jscomp.iteratorFromArray=function(G,da){G instanceof String&&(G+="");var oa=0,ya=!1,ea={next:function(){if(!ya&&oa<G.length){var X=oa++;return{value:da(X,G[X]),done:!1}}ya=!0;return{done:!0,value:void 0}}};ea[Symbol.iterator]=function(){return ea};return ea};
$jscomp.polyfill("Array.prototype.keys",function(G){return G?G:function(){return $jscomp.iteratorFromArray(this,function(da){return da})}},"es6","es3");$jscomp.findInternal=function(G,da,oa){G instanceof String&&(G=String(G));for(var ya=G.length,ea=0;ea<ya;ea++){var X=G[ea];if(da.call(oa,X,ea,G))return{i:ea,v:X}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(G){return G?G:function(da,oa){return $jscomp.findInternal(this,da,oa).v}},"es6","es3");
(function(){function G(){var h=this,y,u=[],v=[],l=[],V;this.setType=function(a){y=a};this.getType=function(){return y};this.supportIncrementalMaterialize=function(){return!1};this.protectedIsTableInUse=function(){throw Error("override me");};this.insertSource=function(a,c){for(var b=!1,e=a.getSourceId(),d=0;d<u.length;d++)if(e==u[d].getSourceId()){b=!0;break}b||(u.splice(c,0,a),z(G.KEY_ADD_PREPARED_SOURCE,[a]))};this.batchAddSource=function(a){for(var c=[],b=0;b<a.length;b++){for(var e=!1,d=a[b],
f=d.getSourceId(),A=0;A<u.length;A++)if(f==u[A].getSourceId()){e=!0;break}e||(u.push(d),c.push(d))}z(G.KEY_ADD_PREPARED_SOURCE,c)};this.setSource=function(a,c){u=a;!c&&z(G.KEY_SET_PREPARED_SOURCE,u)};this.removeSource=function(a){var c=u.indexOf(a);return-1<c?(u.splice(c,1),z(G.KEY_REMOVE_PREPARED_SOURCE,[a]),c):-1};this.batchRemoveUserSqlTable=function(a){a=h.getUserSqlTables(a);for(var c=0;c<a.length;c++)h.removeTableIfUseless(a[c])};this.batchRemoveSource=function(a){for(var c=0;c<a.length;c++){var b=
u.indexOf(a[c]);-1<b&&u.splice(b,1)}z(G.KEY_REMOVE_PREPARED_SOURCE,a)};this.getSource=function(a){for(var c=0,b=u.length;c<b;c++)if(u[c].getId()==a)return u[c]};this.getAllSource=function(){return u};this.isSourceUsed=function(a){a=a.getId();for(var c=0,b=v.length;c<b;c++){var e=v[c];if(e.getSourceUid()==a&&h.protectedIsTableInUse(e))return!0}return!1};this.addTable=function(a){for(var c=0,b=v.length;c<b;c++)if(v[c].isSame(a))return;v.push(a);a.addPropertyChangeCallback(z);z(G.KEY_ADD_TABLE,a)};this.updateTable=
function(a,c){for(var b=-1,e=0,d=v.length;e<d;e++)if(v[e].isSame(c)){b=e;break}-1<b&&(v.splice(b,1),v.splice(b,0,a),c.removePropertyChangeCallback(z),a.addPropertyChangeCallback(z))};this.batchAddTable=function(a){for(var c=0;c<a.length;c++)h.addTable(a[c])};this.setTables=function(a){v=a};this.getTable=function(a){for(var c=0,b=v.length;c<b;c++)if(v[c].getUid()==a)return v[c]};this.removeTable=function(a){var c=v.indexOf(a);-1<c&&(v.splice(c,1),a.removePropertyChangeCallback(z),z(G.KEY_REMOVE_TABLE,
a));return c};this.batchRemoveTable=function(a){for(var c=0;c<a.length;c++){var b=a[c];h.removeTable(b);b.removePropertyChangeCallback(z)}};this.insertTable=function(a,c){for(var b=0,e=v.length;b<e;b++)if(v[b].isSame(a))return;v.splice(c,0,a);a.addPropertyChangeCallback(z);z(G.KEY_ADD_TABLE,a)};this.getUserSqlTables=function(a){for(var c=[],b=0,e=v.length;b<e;b++){var d=v[b];d.isUserSql()&&d.getSourceUid()==a&&c.push(d)}return c};this.getAllUserSqlTables=function(){for(var a=[],c=0,b=v.length;c<b;c++)v[c].isUserSql()&&
a.push(v[c]);return a};this.getAllTable=function(a){for(var c=[],b=0,e=v.length;b<e;b++){var d=v[b];a?(h.protectedIsTableInUse(d)||d.isUserSql())&&c.push(d):h.protectedIsTableInUse(d)&&c.push(d)}return c};this.getSameTable=function(a){for(var c=0,b=v.length;c<b;c++)if(v[c].isSame(a))return v[c]};this.isSameTableAndSourceExist=function(a,c,b){for(var e=0;e<v.length;e++){var d=v[e];if(d.getTableName()==c&&d.getNamespace()==b&&h.getSource(d.getSourceUid()).getSourceId()==a)return!0}return!1};this.setMaterializedConfig=
function(a){V=a};this.getMaterializedConfig=function(){return V};this.toJsonObject=function(){var a={};a.type=y;for(var c=[],b=0;b<u.length;b++)c.push(u[b].toJsonObject());a.sources=c;c=[];for(b=0;b<v.length;b++){var e=v[b];(h.protectedIsTableInUse(e)||e.isUserSql())&&c.push(e.toJsonObject())}a.tables=c;V&&(a.materializedConfig=V.toJsonObject());h.protectedToJsonObject(a);return a};this.fromJsonObject=function(a){y=a.type;var c=a.sources;if(c)for(var b=0;b<c.length;b++){var e=c[b],d=new ea;d.fromJsonObject(e);
u.push(d)}if(c=a.tables)for(b=0;b<c.length;b++)e=new oa,e.fromJsonObject(c[b]),e.addPropertyChangeCallback(z),v.push(e);(b=a.materializedConfig)?(V=new H,V.fromJsonObject(b)):V=null;h.protectedFromJsonObject(a)};this.isUserSqlTableInUse=function(a){a=h.getSameTable(a);return h.protectedIsTableInUse(a)};this.protectedToJsonObject=function(a){};this.protectedFromJsonObject=function(a){};this.addPropertyChangeCallback=function(a){l.push(a)};this.removePropertyChangeCallback=function(a){a=l.indexOf(a);
-1<a&&l.splice(a,1)};this.clearPropertyChangeCallback=function(){l=[]};var z=function(a,c){for(var b=0,e=l.length;b<e;b++)l[b](a,c)};this.protectedMethod={firePropertyChangeEvt:z,copy:function(a){a.setType(y);for(var c=[],b=0;b<u.length;b++)c.push(u[b].copy());a.setSource(c,!0);c=[];for(b=0;b<v.length;b++)c.push(v[b].clone());a.setTables(c);V&&a.setMaterializedConfig(V.copy())}}}function da(){var h=this,y,u,v,l,V,z,a,c,b=[];this.setId=function(d){y=d};this.getId=function(){return y};this.setAlias=
function(d){u=d;l=void 0;e(G.KEY_NODE_CHANGE_ALIAS,h)};this.getAlias=function(){return u};this.setNameIndex=function(d){l=d};this.getNameIndex=function(){return l};this.getX=function(){return V};this.getY=function(){return z};this.getWidth=function(){return a};this.getHeight=function(){return c};this.setPosition=function(d,f){V=d;z=f};this.changePosition=function(d,f){h.setPosition(d,f);e(G.KEY_NODE_CHANGE_POSITION,h)};this.setSize=function(d,f){a=d;c=f};this.setType=function(d){v=d};this.getType=
function(d){return v};this.addPropertyChangeCallback=function(d){b.push(d)};this.removePropertyChangeCallback=function(d){d=b.indexOf(d);-1<d&&b.splice(d,1)};this.toJsonObject=function(){var d={};d.id=y;d.alias=u;d.x=V;d.y=z;d.type=v;l&&(d.nameIndex=l);h.protectedToJson(d);return d};this.fromJsonObject=function(d){y=d.id;u=d.alias;V=d.x;z=d.y;v=d.type;var f=parseInt(d.nameIndex);isNaN(f)||(l=f);h.protectedFromJson(d)};this.protectedToJson=function(d){};this.protectedFromJson=function(d){};var e=function(d,
f){for(var A=0,D=b.length;A<D;A++)b[A](d,f)};this.protectedMethod={firePropertyChangeEvt:function(d){e(d,h)}}}function oa(){var h=this,y,u,v,l,V,z,a,c=[],b=[];this.setUid=function(d){y=d};this.getUid=function(){return y};this.isUserSql=function(){return z?!0:!1};this.getUserSql=function(){return z};this.setUserSql=function(d){z=d};this.setTableName=function(d){u=d};this.getTableName=function(){return u};this.setSourceUid=function(d){v=d};this.getSourceUid=function(){return v};this.setNamespace=function(d){l=
d};this.getNamespace=function(){return l};this.setDisplayName=function(d){V=d};this.getDisplayName=function(){return V};this.setSelectedFields=function(d){a=d;e(G.KEY_TABLE_SELECT_FIELD,h)};this.getSelectedFields=function(){return a};this.setFilterItems=function(d){c=d;e(G.KEY_TABLE_SET_FILTER,h)};this.getFilterItems=function(){return c};this.addPropertyChangeCallback=function(d){b.push(d)};this.removePropertyChangeCallback=function(d){d=b.indexOf(d);-1<d&&b.splice(d,1)};this.isSame=function(d){return v==
d.getSourceUid()&&u==d.getTableName()&&l==d.getNamespace()&&(!h.isUserSql()&&!d.isUserSql()||h.isUserSql()&&d.isUserSql()&&(d=d.getUserSql(),d.getSqlType()==z.getSqlType()&&d.getContent()==z.getContent()))?!0:!1};this.toJsonObject=function(){var d={};d.id=y;d.name=u;d.sourceId=v;d.namespace=l;h.isUserSql()&&(d.userSQL=z.toJsonObject());if(a){for(var f=[],A=0;A<a.length;A++)f.push(a[A].toJsonObject());d.selectedFields=f}if(c){f=[];for(A=0;A<c.length;A++)f.push(c[A].toJsonObject());d.filterItems=f}return d};
this.fromJsonObject=function(d){y=d.id;u=d.name;v=d.sourceId;l=d.namespace;V=d.displayName;d.userSQL&&(z=new ya,z.fromJsonObject(d.userSQL));var f=d.selectedFields;if(f){for(var A=[],D=0;D<f.length;D++){var Y=new X;Y.fromJsonObject(f[D]);A.push(Y)}a=A}if(d=d.filterItems){f=[];for(D=0;D<d.length;D++)A=new n,A.fromJsonObject(d[D]),f.push(A);c=f}};this.clone=function(){var d=new oa;d.setUid(y);d.setTableName(u);d.setNamespace(l);d.setDisplayName(V);d.setSourceUid(v);z&&d.setUserSql(z.copy());var f=[];
if(a){for(var A=0;A<a.length;A++)f.push(a[A].clone());d.setSelectedFields(f)}f=[];for(A=0;A<c.length;A++)f.push(c[A].copy());d.setFilterItems(f);return d};var e=function(d,f){for(var A=0,D=b.length;A<D;A++)b[A](d,f)}}function ya(){var h,y;this.getSqlType=function(){return h};this.setSqlType=function(u){h=u};this.setContent=function(u){y=u};this.getContent=function(){return y};this.fromJsonObject=function(u){h=u.type;y=u.content};this.toJsonObject=function(){var u={};u.type=h;u.content=y;return u};
this.copy=function(){var u=new ya;u.setSqlType(h);u.setContent(y);return u}}function ea(){var h,y,u,v,l,V;this.setId=function(z){h=z};this.getId=function(){return h};this.getSourceId=function(){return y};this.setSourceId=function(z){y=z};this.setSourceRefId=function(z){u=sId};this.getSourceRefId=function(){return u};this.getName=function(){return v};this.setName=function(z){v=z};this.setSourceType=function(z){l=z};this.getSourceType=function(){return l};this.setModelId=function(z){V=z};this.getModelId=
function(){return V};this.copy=function(){var z=new ea;z.setId(h);z.setSourceId(y);z.setSourceType(l);z.setName(v);z.setSourceType(l);z.setModelId(V);return z};this.toJsonObject=function(){var z={};z.id=h;z.modelSetSourceId=y;z.modelSetSourceRefId=u;z.modelId=V;return z};this.fromJsonObject=function(z){h=z.id;y=z.modelSetSourceId;u=z.modelSetSourceRefId;l=z.type;v=z.name}}function X(){var h=this,y,u,v,l,V,z,a,c,b,e;this.setTableId=function(f){y=f};this.getTableId=function(){return y};this.setFromNode=
function(f){u=f};this.getSourceNodeId=function(){return u};this.setName=function(f){v=f};this.getName=function(){return v};this.getFullName=function(){return u?u+"_"+v:y+"_"+v};this.setAlias=function(f){l=f};this.getAlias=function(){return l?l:v};this.setDataType=function(f){d(f);V=f};this.getDataType=function(){return V};this.setAppointedDataType=function(f){f&&d(f);z=f==V?null:f};this.getAppointedDataType=function(){return z};this.getOutputDataType=function(){return z?z:V};this.setRoundMode=function(f){c=
f};this.getRoundMode=function(){return c};this.setScale=function(f){a=f};this.getScale=function(){return a};this.getFormat=function(){return b};this.setFormat=function(f){b=f};this.setExtensions=function(f){e=f};this.getEnumValue=function(){return e?e[X.EXTENSION_BIZ_FIELD_ENUM_KEY]:null};this.isMulBaseData=function(){return e?e[X.EXTENSION_IS_MUL_BASE_DATA]:!1};this.isPk=function(){return e?e[X.EXTENSION_IS_PK]:!1};this.isEnum=function(){if(h.isMulBaseData()||h.getOutputDataType()!=X.DT_STRING)return!1;
var f=h.getEnumValue();return 0==(f?Object.keys(f):[]).length?!1:!0};this.fromJsonObject=function(f){v=f.name;l=f.alias;V=f.dataType;z=f.appointedDataType;u=f.fromNode;void 0!=f.scale&&(a=f.scale);f.roundMode&&(c=f.roundMode);e=f.extensions;f.format&&(b=f.format);f.tableId&&(y=f.tableId)};this.toJsonObject=function(){var f={};f.name=v;f.alias=l;f.dataType=V;f.fromNode=u;z&&(f.appointedDataType=z);void 0!=a&&(f.scale=a);c&&(f.roundMode=c);e&&(f.extensions=e);y&&(f.tableId=y);return f};var d=function(f){if(f!==
X.DT_STRING&&f!==X.DT_INT&&f!==X.DT_NUMBER&&f!==X.DT_DATE&&f!==X.DT_DATETIME&&f!==X.DT_BOOLEAN)throw Error("IllegalArgument: "+f);};this.clone=function(){var f=new X;f.setName(v);V&&f.setDataType(V);f.setAlias(l);z&&f.setAppointedDataType(z);f.setFromNode(u);void 0!=a&&f.setScale(a);c&&f.setRoundMode(c);f.setExtensions(e);b&&f.setFormat(b);y&&f.setTableId(y);return f};this.equals=function(f){return v==f.getName()&&l==f.getAlias()&&z==f.getAppointedDataType()&&a==f.getScale()&&c==f.getRoundMode()?
!0:!1}}function N(){var h,y;this.setExtractPartlyData=function(u,v){h=u;y=v};this.setExtractAllData=function(u){h=N.ALL_DATA_NUMBER;y=u};this.toJsonObject=function(){var u={};u.extractCount=h;u.previewCount=y;return u}}function ha(){var h=this,y,u;this.setId=function(v){y=v};this.getId=function(){return y};this.toJsonObject=function(){var v={};v.id=y;v.type=u;h.protectedToJson(v);return v};this.protectedToJson=function(v){};this.protectedMethod={setType:function(v){u=v}}}function ma(){var h=[],y,
u=[];this.isValid=function(){return y};this.getCases=function(){return u};this.getCheckedNodeIds=function(){return h};this.fromJsonObject=function(v){y=v.valid;h=v.nodeIds;if(v=v.cases){u=[];for(var l=new B,V=0;V<v.length;V++){var z=v[V],a=l.getInvalidityCase(z.type);z&&(a.fromJsonObject(z),u.push(a))}}}}function B(){this.getInvalidityCase=function(h){switch(h){case M.TYPE_MULTI_OUTPUT:return new ba;case M.TYPE_LACK_OUTPUT:return new E;case M.TYPE_INVALID_CONFIG:return new p;case M.TYPE_LACK_INPUT:return new q;
case M.TYPE_INVALID_UPWARDNODE:return new r;case M.TYPE_INVALID_SOURCE:return new P;case M.TYPE_TABLE_NO_FIELD:return new m;case M.TYPE_TABLE_NO_AUTHORITY:return new C}}}function M(){var h,y=this;this.getType=function(){return h};this.fromJsonObject=function(u){h=u.type;y.protectedFromJsonObject(u)};this.protectedFromJsonObject=function(u){}}function ba(){M.call(this);var h=[];this.protectedFromJsonObject=function(y){h=y.outputNodes};this.getOutputNodeIds=function(){return h}}function E(){M.call(this)}
function p(){M.call(this);var h;this.protectedFromJsonObject=function(y){h=y.nodeIds};this.getNodeIds=function(){return h}}function C(){M.call(this);var h;this.protectedFromJsonObject=function(y){h=y.nodeIds};this.getNodeIds=function(){return h}}function q(){M.call(this);var h;this.protectedFromJsonObject=function(y){h=y.nodeIds};this.getNodeIds=function(){return h}}function r(){M.call(this);var h;this.protectedFromJsonObject=function(y){h=y.nodeIds};this.getNodeIds=function(){return h}}function P(){M.call(this);
var h;this.protectedFromJsonObject=function(y){h=y.nodeIds};this.getNodeIds=function(){return h}}function m(){M.call(this);var h;this.protectedFromJsonObject=function(y){h=y.nodeIds};this.getNodeIds=function(){return h}}function U(){var h,y=[],u=[];this.getField=function(v){return y[v]};this.getAllField=function(){return y};this.getColumnCount=function(){return y?y.length:0};this.getOneRow=function(v){return u[v]};this.getRowCount=function(){return u?u.length:0};this.getNodeId=function(){return h};
this.fromJsonObject=function(v){for(var l=v.fields,V=0;V<l.length;V++){var z=new X;z.fromJsonObject(l[V]);y.push(z)}u=v.data;h=v.nodeId}}function n(){var h,y,u,v,l=0,V=0,z,a=null;this.setField=function(b){(h=b)&&!b.isMulBaseData()&&y&&u&&(b=b.getOutputDataType(),b!==X.DT_DATE&&b!==X.DT_DATETIME||n.REG_DATETIME.test(u)||n.isCompareOpWithinOrNotWithinValue(y)||(u=(new Date).getTime()));c()};this.updateNotExistFieldByMyself=function(){var b=new X;b.setFromNode(h.getSourceNodeId());b.setName(h.getName());
b.setAlias(h.getAlias());h=b};this.updateNotExistField=function(b){var e=new X;e.setFromNode(b.getSourceNodeId());e.setName(b.getName());e.setAlias(b.getAlias());h=e};this.getField=function(){return h};this.getTargetFieldFullName=function(){return h?h.getFullName():null};this.setCompareOp=function(b){y=b};this.getCompareOp=function(){return y};this.setValue=function(b){u=b;c()};this.getValue=function(){return u};this.setDisplayValue=function(b){v=b};this.getDisplayValue=function(b){return v?!b&&n.isCompareOpWithinOrNotWithinValue(y)?
JSON.parse(v).join(","):n.isCompareOpRelativeDateRangeValue(y)?(b=h.getOutputDataType()===X.DT_DATETIME,ja.modelToDisplayText(a,b)):v:""};this.setLeftBracketCount=function(b){l=b};this.getLeftBracketCount=function(){return l};this.setRightBracketCount=function(b){V=b};this.getRightBracketCount=function(){return V};this.setLogicOp=function(b){z=b};this.getLogicOp=function(){return z};this.setRelativeDateRange=function(b){a=b};this.getRelativeDateRange=function(){return a};this.isEmpty=function(){return 0===
l&&0===V&&!h&&!y&&!u&&!z};var c=function(){if(h&&y){var b=h.getOutputDataType();if(u){var e=h.isEnum(),d=h.isMulBaseData(),f=e?h.getEnumValue():null;if(n.isCompareOpWithinOrNotWithinValue(y))if(e){b=JSON.parse(u);e=[];for(d=0;d<b.length;d++){var A=f[b[d]];A&&e.push(A)}v=JSON.stringify(e)}else v=u;else d?v=u:b===X.DT_DATE||b===X.DT_DATETIME?(f=new Date,f.setTime(u),e=new com.kingdee.bos.qing.common.DateFormater,d=e.setFormatString,b=b===X.DT_DATE?"yyyy-MM-dd":"yyyy-MM-dd HH:mm:ss",d.call(e,b),v=e.format(f)):
b===X.DT_BOOLEAN?(f=com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(Q),v=u===X.BOOLEAN_TRUE?f.get("dataTypeTrue","\u771f"):u===X.BOOLEAN_FALSE?f.get("dataTypeFalse","\u5047"):""):v=e?f[u]?f[u]:"":u}else v=n.isCompareOpRelativeDateRangeValue(y)&&null!=a?ja.modelToDisplayText(a,b===X.DT_DATETIME):null}};this.copy=function(){var b=new n;b.setField(h);b.setCompareOp(y);b.setValue(u);b.setDisplayValue(v);b.setLeftBracketCount(l);b.setRightBracketCount(V);b.setLogicOp(z);
b.setRelativeDateRange(a);return b};this.equals=function(b){if(!b)return!1;var e;if(e=h.equals(b.getField())&&y===b.getCompareOp()&&u===b.getValue()&&l===b.getLeftBracketCount()&&V===b.getRightBracketCount()&&z===b.getLogicOp())e=a||b.getRelativeDateRange()?a&&b.getRelativeDateRange()?JSON.stringify(a.toJsonObject())===JSON.stringify(b.getRelativeDateRange().toJsonObject()):!1:!0;return e?!0:!1};this.toJsonObject=function(){if(!h)return null;var b={};b.field=h.toJsonObject();b.compareOp=y;b.value=
u;b.displayValue=v;b.leftBrackets=l;b.rightBrackets=V;b.logicOp=z;a&&(b.relativeDateRange=a.toJsonObject());return b};this.fromJsonObject=function(b){b&&(h=new X,h.fromJsonObject(b.field),y=b.compareOp,u=b.value,v=b.displayValue,l=b.leftBrackets,V=b.rightBrackets,z=b.logicOp,b=b.relativeDateRange)&&(a=new ca,a.fromJsonObject(b))}}function fa(){var h=this,y,u=[];this.getNodeIdInConfig=function(){return[]};this.addPropertyChangeCallback=function(v){u.push(v)};this.toJsonObject=function(){var v={};v.type=
y;h.protectedToJsonObject(v);return v};this.fromJsonObject=function(v){y=v.type;h.protectedFromJsonObject(v)};this.protectedToJsonObject=function(v){};this.protectedFromJsonObject=function(v){};this.protectedMethod={firePropertyChangeEvt:function(v){for(var l=0,V=u.length;l<V;l++)u[l](v)},setType:function(v){y=v}}}function I(){fa.call(this);var h=this,y=this.protectedMethod;y.setType(fa.TYPE_FILTER);var u=[];this.getFilterItems=function(){return u};this.setFilterItems=function(v){u=v};this.copyFilterItems=
function(){for(var v=[],l=0;l<u.length;l++)v.push(u[l].copy());return v};this.firePropertyChangeEvt=function(){y.firePropertyChangeEvt(TableModeler.KEY_TRANSFORM_FILTER)};this.getNotEmptyFilterItems=function(){for(var v=[],l=0;l<u.length;l++)u[l].isEmpty()||v.push(u[l]);return v};this.protectedToJsonObject=function(v){for(var l=h.getNotEmptyFilterItems(),V=[],z=0,a=l.length;z<a;z++)V.push(l[z].toJsonObject());v.filterItems=V};this.protectedFromJsonObject=function(v){if(v){v=v.filterItems;for(var l=
0;l<v.length;l++){var V=new n;V.fromJsonObject(v[l]);u.push(V)}}};this.clone=function(){var v=new I;v.setFilterItems(h.getNotEmptyFilterItems());return v}}function H(){var h=H.TYPE_ONCE,y=H.STRATEGY_FULL,u,v;this.setType=function(l){if(l===H.TYPE_ONCE||l===H.TYPE_TIMING)h=l;else throw Error("IllegalArgument: "+l);};this.getType=function(){return h};this.setStrategy=function(l){if(l===H.STRATEGY_FULL||l===H.STRATEGY_INCREMENTAL)y=l;else throw Error("IllegalArgument: "+l);};this.getStrategy=function(){return y};
this.setSchedule=function(l){u=l};this.getSchedule=function(){return u};this.setBasedFields=function(l){v=l};this.getBasedFields=function(){return v};this.copy=function(){var l=new H;l.setType(h);l.setStrategy(y);u&&l.setSchedule(u.copy());if(v){for(var V=[],z=0;z<v.length;z++)V.push(v[z].copy());l.setBasedFields(V)}return l};this.toJsonObject=function(){var l={};l.type=h;l.strategy=y;u&&(l.schedule=u.toJsonObject());if(v){for(var V=[],z=0;z<v.length;z++)V.push(v[z].toJsonObject());l.basedFields=
V}return l};this.fromJsonObject=function(l){h=l.type;y=l.strategy;l.schedule&&(u=new O,u.fromJsonObject(l.schedule));if(l=l.basedFields){v=[];for(var V=0;V<l.length;V++){var z=new F;z.fromJsonObject(l[V]);v.push(z)}}};this.equals=function(l){if(l instanceof H){if(h!==l.getType()||y!==l.getStrategy())return!1;var V=l.getSchedule();if(u&&!V||!u&&V)return!1;if(u&&V){var z=u.toJsonObject();V=V.toJsonObject();for(var a in z)if(z[a]!==V[a])return!1}l=l.getBasedFields();if(!v&&!l)return!0;if(!v||!l||v.length!==
l.length)return!1;for(z=0;z<v.length;z++)if(!v[z].equals(l[z]))return!1;return!0}return!1}}function F(){var h,y,u,v;this.setTableId=function(l){h=l};this.getTableId=function(){return h};this.setTableName=function(l){y=l};this.getTableName=function(){return y};this.setName=function(l){u=l};this.getName=function(){return u};this.setAlias=function(l){v=l};this.getAlias=function(){return v};this.copy=function(){var l=new F;l.setTableId(h);l.setTableName(y);l.setName(u);l.setAlias(v);return l};this.toJsonObject=
function(){var l={};l.tableId=h;l.tableName=y;l.name=u;l.alias=v;return l};this.fromJsonObject=function(l){h=l.tableId;y=l.tableName;u=l.name;v=l.alias};this.equals=function(l){return l instanceof F?h===l.getTableId()&&y===l.getTableName()&&u===l.getName()&&v===l.getAlias():!1}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==
typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});var Q=com.kingdee.bos.qing.modeler.designer;Q.QingModeler=function(){var h;this.setModelerModel=function(y){h=y};this.getModelerModel=function(){return h};this.toJsonObject=function(){var y={};y.modelerModel=h.toJsonObject();return y};this.fromJsonObject=function(y){(y=y.modelerModel)&&(h=Q.ModelerModerParser.parseToModel(y.type,
y))}};Q.AbstractModelerModelParser=function(){this.parseToModel=function(h){throw Error("override me");}};Q.ModelerModel=G;Q.AbstractPage=function(){function h(z,a,c,b){this.getLeftExtension=function(){return z};this.getTopExtension=function(){return a};this.getHorizonExtension=function(){return z+c};this.getVerticalExtension=function(){return a+b}}var y=this,u=1024,v=768,l=[];this.getWidth=function(){return u};this.getHeight=function(){return v};this.addPropertyChangeCallback=function(z){l.push(z)};
this.setExtension=function(z,a,c,b){z=new h(z,a,c,b);u+=z.getHorizonExtension();v+=z.getVerticalExtension();V(G.KEY_PAGE_SIZE,z)};this.toJsonObject=function(){var z={};z.width=u;z.height=v;y.protectedToJsonObject(z);return z};this.fromJsonObject=function(z){u=z.width;v=z.height;y.protectedFromJsonObject(z)};this.protectedToJsonObject=function(z){};this.protectedFromJsonObject=function(z){};var V=function(z,a){for(var c=0,b=l.length;c<b;c++)l[c](z,a)};this.protectedMethod={firePropertyChangeEvt:V}};
Q.Node=da;Q.Table=oa;Q.DesignTimeSource=ea;Q.Field=X;Q.UserSQL=ya;Q.PreviewConfig=N;Q.RuntimeModel=function(){var h,y=[],u=[],v;this.setOutputVertexId=function(l){h=l};this.addEdge=function(l){y.push(l)};this.addVertex=function(l){u.push(l)};this.getVertexes=function(){return u};this.setPreviewConfig=function(l){v=l};this.toJsonObject=function(){for(var l={},V=[],z=[],a=0,c=y.length;a<c;a++)V.push(y[a].toJsonObject());a=0;for(c=u.length;a<c;a++)z.push(u[a].toJsonObject());l.edges=V;l.vertexes=z;l.outputVertexId=
h;l.previewConfig=v?v.toJsonObject():null;return l}};Q.Edge=function(h,y){this.toJsonObject=function(){var u={};u.fromId=h;u.toId=y;return u}};Q.SourceVertex=function(){ha.call(this);var h,y,u;this.protectedMethod.setType(ha.TYPE_SOURCE);this.setTable=function(v){h=v};this.setSource=function(v){y=v};this.setSelectedFields=function(v){u=v};this.protectedToJson=function(v){v.table=h.toJsonObject();v.source=y.toJsonObject();if(u){for(var l=[],V=0;V<u.length;V++)l.push(u[V].toJsonObject());v.selectedFields=
l}}};Q.ExecuteResult=function(){var h,y=[],u,v;this.getNodeId=function(){return h};this.getValidity=function(){return v};this.getPreviewData=function(){return u};this.getFields=function(){return y};this.fromJsonObject=function(l){h=l.nodeId;var V=l.validity;V&&(v=new ma,v.fromJsonObject(V));if(V=l.previewData)u=new U,u.fromJsonObject(V);if(l=l.fields)for(V=0;V<l.length;V++){var z=l[V],a=new X;a.fromJsonObject(z);y.push(a)}}};Q.PreviewData=U;Q.FilterItem=n;Q.MaterializedConfig=H;Q.BasedField=F;Q.FilterConfig=
I;var ca,ja,O;(function(){var h=com.kingdee.bos.qing.common;ca=h.RelativePeriodModel;h=com.kingdee.bos.qing.common.ui;ja=h.RelativePeriodPanel;h=com.kingdee.bos.qing.schedule;O=h.QingSchedule})();Q.ModelerModerParser=new function(){var h={};this.registerParser=function(y,u){h[y]=u};this.parseToModel=function(y,u){return(y=h[y])&&y.parseToModel(u)}};G.TYPE_TABLE_MODELER="table";G.TYPE_RELATION_MODELER="relation";G.TYPE_METRIC_MODELER="metric";G.KEY_UPDATE_TABLE="update_table";G.KEY_ADD_TABLE="add_table";
G.KEY_REMOVE_TABLE="remove_table";G.KEY_TABLE_SELECT_FIELD="table_select_field";G.KEY_TABLE_SET_FILTER="table_set_filter";G.KEY_PAGE_SIZE="page_change_size";G.KEY_ADD_PREPARED_SOURCE="add_prepared_source";G.KEY_REMOVE_PREPARED_SOURCE="remove_prepared_source";G.KEY_SET_PREPARED_SOURCE="set_prepared_source";G.KEY_NODE_CHANGE_ALIAS="node_change_alias";G.KEY_NODE_CHANGE_POSITION="node_change_position";G.KEY_TABLE_NODE_SELECT_FIELD="table_node_select_field";da.TYPE_TABLE="table";da.TYPE_TRANSFORM="transform";
X.DT_BOOLEAN="BOOLEAN";X.DT_INT="INT";X.DT_NUMBER="NUMBER";X.DT_DATE="DATE";X.DT_DATETIME="DATETIME";X.DT_STRING="STRING";X.ROUND_MODE_UP="ROUND_UP";X.ROUND_MODE_DOWN="ROUND_DOWN";X.ROUND_MODE_HALF_UP="ROUND_HALF_UP";X.BOOLEAN_TRUE="true";X.BOOLEAN_FALSE="false";X.EXTENSION_BIZ_FIELD_ENUM_KEY="bizFieldEnumKey";X.EXTENSION_IS_MUL_BASE_DATA="isMulBaseData";X.EXTENSION_IS_PK="isPK";Q.UIDHelper=new function(){var h,y={};this.init=function(d,f){y={};h=d;f&Q.UIDHelper.SUPPORT_TYPE_NODE&&a();f&Q.UIDHelper.SUPPORT_TYPE_SOURCE&&
c();f&Q.UIDHelper.SUPPORT_TYPE_TABLE&&b();f&Q.UIDHelper.SUPPORT_TYPE_LINE&&e();f&Q.UIDHelper.SUPPORT_TYPE_DIMENSION&&v();f&Q.UIDHelper.SUPPORT_TYPE_PUBLIC_DIMENSION&&l();f&Q.UIDHelper.SUPPORT_TYPE_METRIC&&V();f&Q.UIDHelper.SUPPORT_TYPE_REFERENCE&&z()};this.getUID=function(d){var f=y[d];f||(f=0);f+=1;y[d]=f;return d+f};var u=function(d,f,A){for(var D=0,Y=0;Y<f.length;Y++)for(var qa=A(f[Y]),R=0;R<qa.length;R++){var aa=qa[R];D=Math.max(D,parseInt(aa.slice(d.length,aa.length)))}y[d]=D},v=function(){var d=
h.getAllDimension();d&&u(Q.UIDHelper.NS_DIMENSION,d,function(f){return[f.getDimensionId()]})},l=function(){var d=h.getPublicDimensions();d&&u(Q.UIDHelper.NS_PUBLIC_DIMENSION,d,function(f){return[f.getId()]});(d=h.getAllDimension())&&u(Q.UIDHelper.NS_PUBLIC_DIMENSION,d,function(f){return[f.getPublicDimensionId()]})},V=function(){var d=h.getAllMetric();d&&u(Q.UIDHelper.NS_METRIC,d,function(f){return[f.getId()]})},z=function(){var d=h.getExprReferences();d&&u(Q.UIDHelper.NS_REFERENCE,d,function(f){return[f.getId()]})},
a=function(){var d=h.getAllNodes();d&&u(Q.UIDHelper.NS_NODE,d,function(f){var A=[];A.push(f.getId());f.getType()==da.TYPE_TRANSFORM&&(f=f.getNodeIdInConfig(),A=A.concat(f));return A})},c=function(){var d=h.getAllSource();d&&u(Q.UIDHelper.NS_SOURCE,d,function(f){return[f.getId()]})},b=function(){var d=h.getAllTable();d&&u(Q.UIDHelper.NS_TABLE,d,function(f){return[f.getUid()]})},e=function(){var d=h.getAllLines();d&&u(Q.UIDHelper.NS_LINE,d,function(f){return[f.getId()]})}};Q.UIDHelper.NS_NODE="n";Q.UIDHelper.NS_LINE=
"l";Q.UIDHelper.NS_TABLE="t";Q.UIDHelper.NS_SOURCE="s";Q.UIDHelper.NS_DIMENSION="d";Q.UIDHelper.NS_PUBLIC_DIMENSION="pd";Q.UIDHelper.NS_METRIC="m";Q.UIDHelper.NS_REFERENCE="r";Q.UIDHelper.SUPPORT_TYPE_NODE=1;Q.UIDHelper.SUPPORT_TYPE_LINE=2;Q.UIDHelper.SUPPORT_TYPE_TABLE=4;Q.UIDHelper.SUPPORT_TYPE_SOURCE=8;Q.UIDHelper.SUPPORT_TYPE_DIMENSION=16;Q.UIDHelper.SUPPORT_TYPE_PUBLIC_DIMENSION=32;Q.UIDHelper.SUPPORT_TYPE_METRIC=64;Q.UIDHelper.SUPPORT_TYPE_REFERENCE=128;Q.UIDHelper.METRIC_SCENE=Q.UIDHelper.SUPPORT_TYPE_TABLE|
Q.UIDHelper.SUPPORT_TYPE_SOURCE|Q.UIDHelper.SUPPORT_TYPE_DIMENSION|Q.UIDHelper.SUPPORT_TYPE_PUBLIC_DIMENSION|Q.UIDHelper.SUPPORT_TYPE_METRIC|Q.UIDHelper.SUPPORT_TYPE_REFERENCE;N.ALL_DATA_NUMBER=-1;ha.TYPE_SOURCE="source";ha.TYPE_TRANSFORM_FIELD_SELECT="field_select";ha.TYPE_TRANSFORM_FIELD_SETTING="field_setting";ha.TYPE_TRANSFORM_GROUP_BY="group_by";ha.TYPE_TRANSFORM_FILTER="filter";ha.TYPE_TRANSFORM_SORT="sort";ha.TYPE_TRANSFORM_JOIN="join";M.TYPE_MULTI_OUTPUT="multiOutput";M.TYPE_LACK_OUTPUT="lackOutputNode";
M.TYPE_INVALID_CONFIG="invalidConfig";M.TYPE_LACK_INPUT="lackInputNode";M.TYPE_INVALID_UPWARDNODE="invalidUpwardNode";M.TYPE_INVALID_SOURCE="invalidSource";M.TYPE_TABLE_NO_FIELD="tableNoField";M.TYPE_TABLE_NO_AUTHORITY="tableNoAuthority";n.REG_NUMBER=/^-?\d+(\.\d+)?$/;n.REG_DATETIME=/^-?\d+(\.\d+)?$/;n.COMPARE_EQUAL="EQUAL";n.COMPARE_NOT_EQUAL="NOT_EQUAL";n.COMPARE_GREATER="GREATER";n.COMPARE_GREATER_EQUAL="GREATER_EQUAL";n.COMPARE_LESS="LESS";n.COMPARE_LESS_EQUAL="LESS_EQUAL";n.COMPARE_INCLUDE="INCLUDE";
n.COMPARE_NOT_INCLUDE="NOT_INCLUDE";n.COMPARE_START_WITH="START_WITH";n.COMPARE_END_WITH="END_WITH";n.COMPARE_NULL="NULL";n.COMPARE_NOT_NULL="NOT_NULL";n.COMPARE_IN="IN";n.COMPARE_NOT_IN="NOT_IN";n.COMPARE_RELATIVE_DATE_RANGE="RELATIVE_DATE_RANGE";n.LOGIC_AND="AND";n.LOGIC_OR="OR";n.COMPARES_FOR_STRING=[n.COMPARE_EQUAL,n.COMPARE_NOT_EQUAL,n.COMPARE_INCLUDE,n.COMPARE_NOT_INCLUDE,n.COMPARE_START_WITH,n.COMPARE_END_WITH,n.COMPARE_NULL,n.COMPARE_NOT_NULL,n.COMPARE_IN,n.COMPARE_NOT_IN];n.COMPARES_FOR_ENUM=
[n.COMPARE_EQUAL,n.COMPARE_NOT_EQUAL,n.COMPARE_NULL,n.COMPARE_NOT_NULL,n.COMPARE_IN,n.COMPARE_NOT_IN];n.COMPARES_FOR_NUMBER=[n.COMPARE_EQUAL,n.COMPARE_NOT_EQUAL,n.COMPARE_GREATER,n.COMPARE_GREATER_EQUAL,n.COMPARE_LESS,n.COMPARE_LESS_EQUAL,n.COMPARE_NULL,n.COMPARE_NOT_NULL,n.COMPARE_IN,n.COMPARE_NOT_IN];n.COMPARES_FOR_DATETIME=[n.COMPARE_RELATIVE_DATE_RANGE,n.COMPARE_EQUAL,n.COMPARE_NOT_EQUAL,n.COMPARE_GREATER,n.COMPARE_GREATER_EQUAL,n.COMPARE_LESS,n.COMPARE_LESS_EQUAL,n.COMPARE_NULL,n.COMPARE_NOT_NULL];
n.COMPARES_FOR_BOOLEAN=[n.COMPARE_EQUAL,n.COMPARE_NOT_EQUAL,n.COMPARE_NULL,n.COMPARE_NOT_NULL];n.isCompareOpWithoutValue=function(h){return h===n.COMPARE_NULL||h===n.COMPARE_NOT_NULL};n.isCompareOpWithinOrNotWithinValue=function(h){return h===n.COMPARE_IN||h===n.COMPARE_NOT_IN};n.isCompareOpRelativeDateRangeValue=function(h){return h===n.COMPARE_RELATIVE_DATE_RANGE};n.getSelectableCompares=function(h,y){switch(h){case X.DT_STRING:return y?n.COMPARES_FOR_ENUM:n.COMPARES_FOR_STRING;case X.DT_NUMBER:case X.DT_INT:return n.COMPARES_FOR_NUMBER;
case X.DT_DATE:case X.DT_DATETIME:return n.COMPARES_FOR_DATETIME;case X.DT_BOOLEAN:return n.COMPARES_FOR_BOOLEAN;default:throw Error("Unknown DataType");}};n.FiltersCheckingResult=function(h,y){var u=y;this.getFiltersErrorRow=function(){return h};this.getPrompt=function(){return u};this.setPrompt=function(v){u=v}};fa.TYPE_FIELD_SELECT="field_select";fa.TYPE_FIELD_SETTING="field_setting";fa.TYPE_FILTER="filter";fa.TYPE_SORT="sort";fa.TYPE_GROUP_BY="group_by";fa.TYPE_CALCULATED_FIELD="calculated_field";
fa.TYPE_CUSTOM_GROUP="custom_group";fa.TYPE_JOIN="join";fa.TYPE_UNION="union";H.TYPE_ONCE="once";H.TYPE_TIMING="timing";H.STRATEGY_FULL="full";H.STRATEGY_INCREMENTAL="incremental";Q.ENTITY_SEPARATOR="@#!&@"})();(function(){function G(){var ea,X,N,ha,ma;this.setFromTable=function(B){ea=B};this.getFromTable=function(){return ea};this.setFromProperty=function(B){N=B};this.getFromProperty=function(){return N};this.setToTable=function(B){X=B};this.getToTable=function(){return X};this.setToProperty=function(B){ha=B};this.getToProperty=function(){return ha};this.setRelated=function(B){ma=B};this.getRelated=function(){return ma};this.fromJsonObject=function(B){ea=B.fromModel;X=B.toModel;N=B.fromField;ha=B.toField;
ma=B.related};this.toJsonObject=function(B){B={};B.fromModel=ea;B.toModel=X;B.fromField=N;B.toField=ha;B.related=ma;return B}}function da(){var ea=this,X,N,ha;this.setUid=function(ma){X=ma};this.getUid=function(){return X};this.setId=function(ma){ha=ma};this.getId=function(){return ha};this.getSourceType=function(){return N};this.fromJsonObject=function(ma){X=ma.id;N=ma.type;ea.protectedFromJsonObject(ma)};this.toJsonObject=function(){var ma={};ma.type=N;ma.id=X;ea.protectedToJsonObject(ma);return ma};
this.protectedToJsonObject=function(ma){};this.protectedFromJsonObject=function(ma){};this.protectedMethod={setSourceType:function(ma){N=ma}}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer=
{});var oa=com.kingdee.bos.qing.modeler.designer;oa.AbstractModelerSource=da;oa.ModelSetDataSource=function(){var ea,X,N,ha,ma,B,M;this.getErrorMessage=function(){return M};this.getSpecificType=function(){return B};this.getSourceName=function(){return ea};this.setSourceName=function(ba){ea=ba};this.getId=function(){return X};this.setId=function(ba){X=ba};this.setCreatorName=function(ba){N=ba};this.getCreatorName=function(){return N};this.setCreateTime=function(ba){ha=ba};this.getCreateTime=function(){return ha};
this.setSourceType=function(ba){ma=ba};this.getSourceType=function(){return ma};this.fromJsonObject=function(ba){X=ba.id;ea=ba.sourceName;ma=ba.sourceType;ha=ba.createTime;N=ba.creatorName;var E=ba.source;ma===da.SOURCE_TYPE_PUBLIC_DATA_SOURCE&&"DB"===E.sourceType?B=E.publicSourceType:ma===da.SOURCE_TYPE_MODELSET_DB_SOURCE&&E.dbType?B=E.dbType:ma===da.SOURCE_TYPE_MODELSET_FILE_SOURCE&&E.fileType&&(B=E.fileType);ba.errorMessage&&(M=ba.errorMessage)}};oa.Meta=function(){var ea,X,N,ha,ma;this.setTableNode=
function(B){ea=B};this.getTableNode=function(){return ea};this.setPropertyMap=function(B){X=B};this.getPropertyMap=function(){return X};this.setSourceType=function(B){N=B};this.getSourceType=function(){return N};this.setRelations=function(B){ha=B};this.getRelations=function(){return ha};this.setErrorMap=function(B){ma=B};this.getErrorMap=function(){return ma};this.fromJsonObject=function(B){ea=B.tableNode;if(X=B.propertiesMap)for(var M in X){var ba=X[M];if(ba&&0<ba.length){for(var E=[],p=0;p<ba.length;p++){var C=
new ya,q=ba[p];C.fromJsonObject(ba[p]);q.number&&C.setName(q.number);E.push(C)}X[M]=E}}N=B.sourceType;if((M=B.relations)&&0<M.length)for(ha=[],p=0;p<M.length;p++)ba=new G,ba.fromJsonObject(M[p]),ha.push(ba);ma=B.errorMap}};var ya=oa.Field;G.R_1_1="From1To1";G.R_1_N="From1ToN";G.R_N_1="FromNTo1";G.KFW_FROM=1;G.KFW_TO=2;G.KEY_FROM_ENTITY="fromEntity";G.KEY_FROM_PROPERTY="fromProperty";G.KEY_FROM_PROPERTY_ALIAS_CHANED="fromPropertyAliasChanged";G.KEY_TO_PROPERTY_ALIAS_CHANED="toPropertyAliasChanged";
G.KEY_TO_ENTITY="toEntity";G.KEY_TO_PROPERTY="toProperty";G.KEY_RELATED="related";da.SOURCE_TYPE_PUBLIC_DATA_SOURCE="PublicDBSource";da.SOURCE_TYPE_CURRENT_ENTITY_SOURCE="ERPCloudEntity";da.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE="ERPCloudDBCenter";da.SOURCE_TYPE_MODELSET_FILE_SOURCE="FileSource";da.SOURCE_TYPE_MODELSET_DB_SOURCE="DBSource";da.SOURCE_TYPE_MODEL_SET_SOURCE="ModelSet";da.SOURCE_TYPE_OPEN_API_SOURCE="OpenAPI"})();(function(){function G(){var N,ha,ma,B=!1,M,ba,E=!1,p;this.setUid=function(C){ba=C};this.getUid=function(){return ba};this.setId=function(C){p=C};this.getId=function(){return p};this.setCommentInfo=function(C){M=C};this.getCommentInfo=function(){return M};this.setMatch=function(C){B=C};this.getMatch=function(){return B};this.setName=function(C){N=C};this.getName=function(){return N};this.setDisplayName=function(C){ha=C};this.getDisplayName=function(){return ha};this.setParentNode=function(C){ma=C};
this.getParentNode=function(){return ma};this.setChecked=function(C){E=C};this.isChecked=function(){return E};this.check=function(C){};this.getSubNodeLevel=function(){for(var C=-1,q=ma;q;)C++,q=q.getParentNode();return C}}function da(){G.call(this);var N=this,ha=[],ma=!0;this.setChildren=function(B){ha=B};this.getChildren=function(){return ha};this.setExpanded=function(B){ma=B};this.isExpanded=function(){return ma};this.check=function(B,M){var ba=function(p){p.getParentNode()&&(M&&M(p.getParentNode()),
1==p.getParentNode().getChildren().length&&ba(p.getParentNode()))};if(0!==ha.length&&B!==N.isChecked()){N.setChecked(B);for(var E=0;E<ha.length;E++)ha[E].check(B,M);ba(N)}};this.toJsonObject=function(){var B={};B.children=ha;return B};this.fromJsonObject=function(B,M){N.setName(B.name);N.setDisplayName(B.displayName);N.setId(B.id);if(B=B.children)for(var ba=0;ba<B.length;ba++){var E=B[ba];if(E.type){var p=new oa;p.fromJsonObject(E);p.setParentNode(N);ha.push(p);M&&p.setCommentInfo(M)}else p=new da,
p.fromJsonObject(E),p.setParentNode(N),ha.push(p)}}}function oa(){G.call(this);var N=this,ha,ma,B,M,ba;this.setNumber=function(E){ma=E};this.getNumber=function(){return ma};this.setUserSql=function(E){ba=E};this.getUserSql=function(){return ba};this.setCommentInfo=function(E){B=E};this.getCommentInfo=function(){return B};this.setType=function(E){ha=E};this.getType=function(){return ha};this.setErrorMessage=function(E){M=E};this.getErrorMessage=function(){return M};this.fromJsonObject=function(E){N.setType(E.type);
N.setName(E.name);N.setDisplayName(E.displayName);N.setId(E.id);N.setNumber(E.number);E.commentInfo&&(N.setName(E.name),N.setCommentInfo(E.commentInfo))};this.check=function(E,p){var C=function(q){q.getParentNode()&&(p&&p(q.getParentNode()),1==q.getParentNode().getChildren().length&&C(q.getParentNode()))};E!==N.isChecked()&&(N.setChecked(E),C(N))}}function ya(){var N=!1,ha=!1,ma=!1,B=X.get("selectTable","\u9009\u62e9\u8868"),M=X.get("metricSearchTable","\u641c\u7d22\u6570\u636e\u8868\u540d\u79f0"),
ba=X.get("metricSearchTable","\u641c\u7d22\u6570\u636e\u8868\u540d\u79f0"),E=10,p=360;this.getCodePlaceHolder=function(){return ba};this.getPlaceHolder=function(){return M};this.isShowAppUi=function(){return N};this.isShowEntityMark=function(){return ha};this.isShowModelNumber=function(){return ma};this.getTitle=function(){return B};this.getTop=function(){return E};this.getHeight=function(){return p};this.protectedMethod={setShowAppUi:function(C){N=C},setShowEntityMark:function(C){ha=C},setShowModelNumber:function(C){ma=
C},setTitle:function(C){B=C},setTop:function(C){E=C},setHeight:function(C){p=C},setPlaceHolder:function(C){M=C},setCodePlaceHolder:function(C){ba=C}}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&
(com.kingdee.bos.qing.modeler.designer={});var ea=com.kingdee.bos.qing.modeler.designer;ea.FolderNode=da;ea.LeafNode=oa;ea.DraggingTableNode=function(){var N,ha;this.setTableNode=function(ma){N=ma};this.getTableNode=function(){return N};this.setTable=function(ma){ha=ma};this.getTable=function(){return ha}};ea.NodeStatusMonitor=function(){var N=this,ha,ma=[],B=[],M=[],ba={};this.reset=function(){N.setSelected(void 0);N.setInvalidNodes([])};this.addSelectNodeListener=function(p){ma.push(p)};this.removeSelectNodeListener=
function(p){p=ma.indexOf(p);-1<p&&ma.splice(p,1)};this.setSelected=function(p){if(ha!==p){var C=ha;p=ha=p;for(var q=0;q<ma.length;q++)(0,ma[q])(C,p)}};this.getSelected=function(){return ha};this.setInvalidNodes=function(p,C){B=p;ba={};if(p&&C)for(var q=Math.min(p.length,C.length),r=0;r<q;r++){var P=p[r];if(P){var m=C[r];ba[P.getId()]=m}}E()};this.getInvalidNodes=function(){return B};this.isInvalidNode=function(p){if(!B)return!1;for(var C=0;C<B.length;C++){var q=B[C];if(q&&q.getId()==p)return!0}return!1};
this.getInvalidPrompt=function(p){if(p&&(p=ba[p.getId()]))return p.getPrompt()};this.addInvalidNode=function(p,C){p&&(0>B.indexOf(p)&&B.push(p),C&&(ba[p.getId()]=C),E())};this.removeInvalidNode=function(p){var C=B.indexOf(p);-1<C&&(B.splice(C,1),ba[p.getId()]=null,E())};this.batchUpdateNodeValidity=function(p,C,q){if(p&&C)for(var r=Math.min(p.length,C.length),P=0;P<r;P++){var m=p[P];if(m){var U=C[P],n=B.indexOf(m);0>n&&B.push(m);ba[m.getId()]=U}}if(q)for(P=0;P<q.length;P++)m=q[P],n=B.indexOf(m),-1<
n&&(B.splice(n,1),ba[m.getId()]=null);E()};this.addInvalidNodeChangeListener=function(p){M.push(p)};this.removeInvalidNodeChangeListener=function(p){p=M.indexOf(p);-1<p&&M.splice(p,1)};this.getInvalidState=function(p){return ba[p.getId()]};var E=function(){for(var p=0;p<M.length;p++)(0,M[p])(B)}};ea.MetricEntitySource=function(){ya.call(this);var N=this.protectedMethod;N.setShowEntityMark(!0);N.setTitle(X.get("selectEntity","\u9009\u62e9\u5b9e\u4f53"));N.setHeight(310);N.setPlaceHolder(X.get("metricSearchEntity",
"\u641c\u7d22\u5b9e\u4f53\u540d\u79f0"));N.setCodePlaceHolder(X.get("metricSearchEntityCode","\u641c\u7d22\u5b9e\u4f53\u540d\u79f0/\u5b9e\u4f53\u6807\u8bc6"))};ea.MetricDataCenterSource=function(){ya.call(this);var N=this.protectedMethod;N.setShowAppUi(!0);N.setTop(15);N.setHeight(330)};ea.MetricDefaultSource=function(){ya.call(this)};ea.MetricModelSetSource=function(){ya.call(this);var N=this.protectedMethod;N.setShowModelNumber(!0);N.setTitle(X.get("selectModel","\u9009\u62e9\u6a21\u578b"));N.setHeight(310);
N.setPlaceHolder(X.get("metricSearchModel","\u641c\u7d22\u6a21\u578b\u540d\u79f0"));N.setCodePlaceHolder(X.get("metricSearchModelCode","\u641c\u7d22\u6a21\u578b\u540d\u79f0/\u6a21\u578b\u7f16\u7801"))};var X=com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer)})();(function(){function G(){var p=1,C=[];this.zoomIn=function(){var r=G.SUPPORT_SCALES.indexOf(p);r<G.SUPPORT_SCALES.length-1&&(p=G.SUPPORT_SCALES[r+1],q())};this.zoomOut=function(){var r=G.SUPPORT_SCALES.indexOf(p);0<r&&(p=G.SUPPORT_SCALES[r-1],q())};this.isMinScale=function(){return G.SUPPORT_SCALES[0]==p};this.isMaxScale=function(){return G.SUPPORT_SCALES[G.SUPPORT_SCALES.length-1]==p};this.getRatio=function(){return p};this.setCustomRatio=function(r){p=r};this.getScaledSize=function(r){return 1==
p?r:p*r};this.getRawSize=function(r){return 1==p?r:r/p};this.getScaledCoordinate=function(r){return 1==p?r:[p*r[0],p*r[1]]};this.getRawCoordinate=function(r){return 1==p?r:[r[0]/p,r[1]/p]};this.addPropertyChangedListener=function(r){C.push(r)};var q=function(){for(var r=0;r<C.length;r++){var P=C[r];P&&P()}}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing=
{});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});var da=com.kingdee.bos.qing.modeler.designer;da.Toolbar=function(){var p=new oa,C,q=$("<div>"),r=$("<div>"),P=$("<div>");this.getJqUi=function(){C||(C=p.getJqUi(),C.addClass("modeler-designer-toolbar"),m(q),m(r),m(P));return C};this.addButton=function(n,fa,I,H){return U(r,!1,n,fa,I,H)};this.addButtonForHeadCustom=
function(n,fa,I,H){return U(q,!1,n,fa,I,H)};this.addButtonForTailCustom=function(n,fa,I,H){return U(P,!1,n,fa,I,H)};this.addMenuButton=function(n,fa,I,H){return U(r,!0,n,fa,I,H)};this.addMenuButtonForHeadCustom=function(n,fa,I,H){return U(q,!0,n,fa,I,H)};this.addMenuButtonForTailCustom=function(n,fa,I,H){return U(P,!0,n,fa,I,H)};this.getAllBtnWidth=function(){return q.width()+r.width()+P.width()};var m=function(n){n.css({"float":"left",position:"relative",height:"100%"});n.appendTo(C)},U=function(n,
fa,I,H,F,Q){n=p.createButton(n,fa,I,F,Q);n.setIconSetter(function(ca,ja){da.Icons.background(ca,ja)});n.setIconName(H);return n}};da.RemoteImpl=function(){ha.call(this);var p;this.getRemoteUrl=function(){return p};this.setRemoteUrl=function(C){p=C}};da.Integration=function(){var p,C,q,r,P,m=!0;this.setMapTableException=function(U){P=U};this.getMapTableException=function(){return P};this.setMapSourceType=function(U){r=U};this.getMapSourceType=function(){return r};this.setMapSourcePermission=function(U){q=
U};this.getMapSourcePermission=function(){return q};this.setModelName=function(U){p=U};this.getModelName=function(){return p};this.setModelDesc=function(U){C=U};this.getModelDesc=function(){return C};this.setModelIsValid=function(U){m=U};this.isValidModel=function(){return m}};da.StatusBar=function(){var p,C,q,r,P;this.getJqUi=function(){p||(p=$("<div>"),p.addClass("modeler-designer-statusbar"),C=$("<span>"),C.addClass("modeler-designer-statusbar-name"),C.appendTo(p),q=$("<span>"),q.addClass("modeler-designer-statusbar-dirtystate"),
q.appendTo(p),r=$("<span>"),r.addClass("modeler-designer-statusbar-prompt"),r.appendTo(p));return p};this.setCurrentName=function(U){C.text(U)};this.showDirtyState=function(U){q.text(U?"*":"")};this.showShortPrompt=function(U,n,fa){clearTimeout(P);r.text(U);r.css("color",fa?fa:"");if(n){var I=0,H=function(){if(6<I)m();else{if(0==I%2){r.text(U);var F=650}else r.text(""),F=350;P=setTimeout(H,F);I++}};H()}else m()};var m=function(){P=setTimeout(function(){r.text("")},5E3)}};da.DesignerFacade=function(p,
C,q,r){X.call(this,p,C,q,r);var P=this.protectedMethod;this.loadTables=function(m){m={source:JSON.stringify(m.toJsonObject()),needFilterMetric:!0};P.remote("loadTables",m)};this.getMeta=function(m,U){m={source:JSON.stringify(m.toJsonObject()),table:JSON.stringify(U.toJsonObject())};P.remote("getMeta",m)};this.getTableField=function(m,U){for(var n=[],fa=[],I=0;I<m.length;I++)n.push(m[I].toJsonObject());for(I=0;I<U.length;I++)fa.push(U[I].toJsonObject());m={sources:JSON.stringify(n),tables:JSON.stringify(fa)};
P.remote("getTableField",m)};this.getTableFieldWithCheckModel=function(m){m={model:JSON.stringify(m.toJsonObject())};P.remote("getTableFieldWithCheckModel",m)};this.getDBCenterTables=function(m){P.remote("getDBCenterTables",{appNumber:m})};this.checkConnection=function(m){P.remote("checkConnection",{sourceId:m})};this.checkMetricFormula=function(m,U,n,fa){var I={};if(n)for(var H=Object.keys(n),F=0;F<H.length;F++){for(var Q=H[F],ca=n[Q],ja=[],O=0;O<ca.length;O++)ja.push(ca[O].toJsonObject());I[Q]=
ja}m={expr:m,metricId:fa,model:JSON.stringify(U.toJsonObject()),fields:JSON.stringify(I)};P.remote("checkMetricFormula",m)};this.previewMetrics=function(m,U,n,fa){m={modeler:JSON.stringify(m),filters:JSON.stringify(U),previewConfig:JSON.stringify(n),metricId:fa};P.remote("previewMetrics",m)};this.getFirstPageMetric=function(m){m={model:JSON.stringify(m)};P.remote("getFirstPageMetric",m)};this.updateMetricByPage=function(m,U,n,fa,I){m={model:JSON.stringify(m),jobId:U,jobName:n,startIndex:fa,pageSize:I};
P.remote("updateMetricByPage",m)};this.exportMetricData=function(m,U,n,fa){m={model:JSON.stringify(m),jobId:U,jobName:n,totalRowCount:fa};P.remote("exportMetricData",m)};this.getTotalRowCount=function(m,U){P.remote("getTotalRowCount",{jobId:m,jobName:U})};this.deleteResultDataFile=function(m,U){P.remote("deleteResultDataFile",{jobId:m,jobName:U})};this.getMetricDimValues=function(m,U,n){m={modeler:JSON.stringify(m),dimensionId:U,metricId:n};P.remote("getMetricDimValues",m)};this.getTablePreviewData=
function(m,U,n,fa){m={source:JSON.stringify(m.toJsonObject()),table:JSON.stringify(U.toJsonObject()),filters:JSON.stringify(n),rowCount:fa};P.remote("getTablePreviewData",m)};this.getDataRowCount=function(m,U,n){m={source:JSON.stringify(m.toJsonObject()),table:JSON.stringify(U.toJsonObject()),filters:JSON.stringify(n)};P.remote("getDataRowCount",m)};this.cronExpression=function(m){P.remote("cronExpression",{cron:m})};this.checkDataWarehouseConfig=function(){P.remote("checkDataWarehouseConfig",{})};
this.checkReferencedModel=function(m,U,n){m={source:JSON.stringify(m.toJsonObject()),table:JSON.stringify(U.toJsonObject()),modelId:n};P.remote("checkReferencedModel",m)};this.checkModelerValid=function(m){m={model:JSON.stringify(m)};P.remote("checkModelerValid",m)};this.checkMetricTableException=function(m,U,n){m={source:JSON.stringify(m.toJsonObject()),table:JSON.stringify(U.toJsonObject()),modelId:n};P.remote("checkMetricTableException",m)}};da.PageScaleHelper=G;var oa,ya,ea,X,N,ha,ma,B,M,ba;(function(){var p=
com.kingdee.bos.qing.ui.component;oa=p.Toolbar;ya=p.SimpleConfirmer;ma=p.MessageDialog;p=com.kingdee.bos.qing.framework.common;ea=p.AbstractIcons;N=p.MultilanguageManager.createPackageAccessor(da);ha=p.AbstractRemoteCall;X=p.AbstractFacade;p=com.kingdee.bos.qing.common;ba=p.RelativePeriodModel;B=da.FilterItem;M=da.Field})();da.Icons=new function(){ea.call(this);var p=this.protectedMethod,C;this.setComboIconImpl=function(P){C=P};this.protectedInit=function(P,m){if(!C)throw Error("qing modeler comboIcon not found.");
C.define(m,"designer");m.setIconSize(16,16);q(0,0,"edit");q(0,1,"delete");q(0,2,"add");q(0,3,"zoomIn");q(0,4,"zoomOut");q(0,5,"layout");q(0,6,"rightArrow");q(0,7,"leftArrow");q(0,8,"upArrow");q(0,9,"downArrow");r(0,10,"qingWarning");r(0,11,"relation");r(0,12,"qingTable");q(0,13,"expanded");q(0,14,"expand");r(0,15,"btn_edit");q(0,17,"trial_calc");r(1,12,"qingTable_hover");q(0,18,"moveUp");r(0,19,"reset");q(0,20,"createDim");q(0,21,"publicDimension");q(0,22,"metric_filter");m.setStartPosition(84,35);
r(0,0,"select_field");r(0,1,"field_setting");r(0,2,"join");r(0,3,"union");r(0,4,"filter");r(0,5,"sort");r(0,6,"group_by");r(0,7,"calculate_field");q(0,8,"metric",!0);m.setStartPosition(84,52);r(0,0,"entity-sub");r(0,1,"entity-entry");r(0,2,"unlock");r(0,3,"lock_by_other");r(0,4,"lock_by_me");r(0,5,"tick");r(0,6,"cross");m.setIconSize(20,20);m.setStartPosition(0,35);r(0,0,"leftJoin");r(0,1,"rightJoin");r(0,2,"innerJoin");r(0,3,"fullJoin");m.setStartPosition(238,35);m.setIconSize(32,32);r(0,0,"metric_icon");
m.setStartPosition(288,35);m.setIconSize(16,16);q(0,0,"table_relation_with_hover");r(1,0,"table_relation");r(0,1,"custom_group");m.setStartPosition(0,55);m.setIconSize(20,20);q(0,0,"setting");r(0,1,"warning");m.setIconSize(60,80);m.setStartPosition(0,98);r(0,0,"no_source");m.setIconSize(138,78);m.setStartPosition(240,240);r(0,0,"no_data_cloud");m.setIconSize(253,140);m.setStartPosition(62,71);r(0,0,"drag_node_prompt");m.setIconSize(210,170);m.setStartPosition(0,211);r(0,0,"no_node_and_source");C.define(m,
"source");m.setStartPosition(0,20);m.setIconSize(16,16);r(0,0,"entity");r(0,1,"data");r(0,2,"modelSet");r(0,3,"file");r(0,4,"data-center");r(0,5,"table");r(0,6,"openapi");m.setStartPosition(85,0);m.setIconSize(16,16);r(0,0,"table_selected");m.setStartPosition(101,0);r(0,0,"f7");m.setStartPosition(0,40);m.setIconSize(20,20);m.setGap(0,1);r(0,0,"modelset-source-icon");r(0,1,"mysql");r(0,2,"datacenter-source-icon");r(0,3,"entity-source-icon");r(0,4,"oracle");r(0,5,"postgresql");r(0,6,"sqlserver");r(0,
7,"greenplum");r(0,8,"access");r(0,9,"db2");r(0,10,"odps");r(0,11,"sparksql");r(1,1,"redshift");r(1,2,"apachedrill");r(1,3,"hive");r(1,4,"impala");r(1,5,"kylin");r(1,6,"dm");r(1,7,"gaussdb");r(1,8,"sybaseiq");r(1,9,"sqlite");r(1,10,"sybase");r(2,2,"doris");r(2,3,"hana");m.setGap(0,0);r(1,0,"excel");r(2,0,"txt");r(2,1,"csv");r(1,11,"xml");r(2,4,"kingbase");r(2,5,"tdsql");r(2,6,"gbase");r(2,7,"vastbase");r(2,8,"yashandb");r(2,9,"openapi-source-icon");r(2,10,"tidb");m.setStartPosition(120,-1);m.setIconSize(16,
16);q(0,0,"refresh");m.setStartPosition(180,-1);m.setIconSize(16,16);q(0,0,"menu");m.setStartPosition(0,110);m.setIconSize(120,93);r(0,0,"no-permission");m.setStartPosition(100,100);m.setIconSize(138,84);r(0,0,"search-no-result");C.define(m,"metatree");m.setGap(1);m.setStartPosition(1,1);m.setIconSize(16,16);q(0,0,"DATE",!0);q(0,1,"STRING",!0);q(0,5,"TABLE",!0);q(0,8,"DATETIME",!0);q(0,9,"BOOLEAN",!0);q(0,10,"NUMBER",!0);q(0,11,"INT",!0);C.define(m,"metric");m.setStartPosition(0,0);m.setIconSize(260,
160);r(0,0,"add_metric");m.setStartPosition(0,164);m.setIconSize(210,170);r(0,0,"no_metric");m.setStartPosition(230,165);m.setIconSize(12,12);r(0,0,"add_metric_plug_sign")};var q=function(P,m,U,n){var fa=U+"_hover";n?(r(P,m,U),r(P+1,m,fa)):(r(P,m,fa),r(P+1,m,U))},r=function(P,m,U){p.registIcon(P,m,U)}};da.LockHelper=new function(){var p,C,q,r,P,m,U,n,fa=!1;this.show=function(H){m=$("<div>");m.addClass("modeler-designer-lock-statusbar");U=$("<div>");n=$("<div>");n.addClass("modeler-designer-lock-text");
U.addClass("modeler-designer-lock-icon");m.append(n);m.append(U);m.appendTo(H);m.on("click",I);fa=!0};this.registerLockRequestSender=function(H){r=H};this.setGlobal=function(H){p=H};this.setLockStateChangeListener=function(H){P=H};this.setLockInfo=function(H,F,Q){if(fa){q=F;C=H?da.LockHelper.STATE_LOCK_BY_ME:F?da.LockHelper.STATE_LOCK_BY_OTHER:da.LockHelper.STATE_UNLOCK;P&&P(C==da.LockHelper.STATE_LOCK_BY_ME);if(!Q){if(C==da.LockHelper.STATE_LOCK_BY_OTHER){var ca=N.get("lockByOtherPrompt","\u5f53\u524d\u6a21\u578b\u5df2\u88ab\u201c#1\u201d\u9501\u5b9a\uff0c\u60a8\u7684\u4fee\u6539\u5c06\u65e0\u6cd5\u4fdd\u5b58\uff0c\u5efa\u8bae\u60a8\u83b7\u5f97\u9501\u540e\u518d\u8fdb\u884c\u7f16\u8f91\u3002");
ca=ca.replace("#1",q)}else C==da.LockHelper.STATE_UNLOCK&&(ca=N.get("unlockPrompt","\u5f53\u524d\u6a21\u578b\u672a\u9501\u5b9a\uff0c\u4e0d\u53ef\u7f16\u8f91\uff0c\u8bf7\u9501\u5b9a\u6a21\u578b\u540e\u518d\u8fdb\u884c\u64cd\u4f5c"));ca?p.getMessageCurtain().showPrompt(ca,-1):C==da.LockHelper.STATE_LOCK_BY_ME&&p.getMessageCurtain().showSuccess(N.get("lockSuccess","\u60a8\u5df2\u6210\u529f\u9501\u5b9a\u8be5\u6a21\u578b"))}H="lock_by_other";if(C==da.LockHelper.STATE_UNLOCK){H="unlock";var ja=N.get("unlock",
"\u672a\u9501\u5b9a")}else C==da.LockHelper.STATE_LOCK_BY_OTHER?ja=N.get("lockedBy","\u5df2\u88ab\u201c#1\u201d\u9501\u5b9a").replace("#1",q):C==da.LockHelper.STATE_LOCK_BY_ME&&(ja=N.get("lockedBy","\u5df2\u88ab\u201c#1\u201d\u9501\u5b9a").replace("#1",N.get("me","\u6211")),H="lock_by_me");da.Icons.background(U,H);n.text(ja);n.attr("title",ja)}};this.setMaxWidth=function(H){n&&n.css("max-width",Math.max(0,Math.min(H-50,250))+"px")};var I=function(){if(r){var H=C!=da.LockHelper.STATE_LOCK_BY_ME;if(H)r(H);
else{var F=new ya;F.setText(N.get("confirmUnlock","\u786e\u5b9a\u8981\u89e3\u9501\u5f53\u524d\u6a21\u578b\uff1f"));F.setConfirmedListener(function(Q){Q&&r(H)});F.show(m)}}}};da.LockHelper.STATE_LOCK_BY_ME="lock_by_me";da.LockHelper.STATE_LOCK_BY_OTHER="lock_by_other";da.LockHelper.STATE_UNLOCK="unlock";da.DppVersionExceptionHandler=new function(){var p=!1;this.handle=function(C){if(20001101!=C)return!1;p||(p=!0,C=ma.createFeedbackDialog(),C.setMsgImageType(ma.MSG_WARNING),C.setMessage(N.get("dppVersionException",
"\u8f7b\u5efa\u6a21\u5ba2\u6237\u7aef\u7248\u672c\u4e0e\u6570\u636e\u5904\u7406\u5f15\u64ce\u7248\u672c\u4e0d\u4e00\u81f4\uff0c\u8bf7\u8054\u7cfb\u8fd0\u7ef4\u4eba\u5458\u5347\u7ea7\u5ba2\u6237\u7aef\u6216\u5f15\u64ce\u3002")),C.setOptionType(ma.OPTION_OK),C.setButtonText(ma.RETURN_OK,N.get("iSee","\u6211\u77e5\u9053\u4e86")),C.setClosedAction(function(){p=!1}),C.showDialog());return!0}};da.PropDataTypeUtil=new function(){this.getDataTypeDesc=function(p){switch(p){case M.DT_STRING:p=N.get("text",
"\u6587\u672c");break;case M.DT_NUMBER:p=N.get("number","\u6570\u503c");break;case M.DT_INT:p=N.get("integer","\u6574\u6570");break;case M.DT_DATE:p=N.get("dataTypeDate","\u65e5\u671f");break;case M.DT_DATETIME:p=N.get("dateTime","\u65e5\u671f\u65f6\u95f4");break;case M.DT_BOOLEAN:p=N.get("bool","\u5e03\u5c14");break;default:p=""}return p}};G.SUPPORT_SCALES=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5];da.NodeResultCache=new function(){var p={},C={},q=[];this.cacheOneNodeField=function(r,P,m){if(m){var U=
C[r];if(!U||U<m)for(p[r]=P,m=0;m<q.length;m++)(U=q[m])&&U(r,P)}};this.removeNodeCache=function(r){p[r]=void 0;C[r]=void 0};this.getOneNodeField=function(r){return p[r]};this.addCacheChangeListener=function(r){q.push(r)};this.clear=function(){p={};C={}}};da.FilterCheckHelper=new function(){this.checkFilterField=function(q,r){if(!r)return q=N.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5"),new B.FiltersCheckingResult(-1,q);for(var P,m=0;m<q.length;m++){var U=q[m];if(!U.isEmpty()){P=p(U,m,r);
if(!P)if(P=m,U=C(U)){var n=N.get("incompleteFilter","\u7b2c#1\u884c\u4e0d\u5b8c\u6574\uff0c");n=n.replace("#1",P+1);P=new B.FiltersCheckingResult(P,n+U)}else P=null;if(P)break}}return P};this.checkFilterLogical=function(q){var r=0,P=-1,m,U=0;for(m=0;m<q.length;m++)q[m].isEmpty()||(U=m);m=U;for(U=0;U<q.length;U++){var n=q[U];if(!n.isEmpty()){r+=n.getLeftBracketCount();r-=n.getRightBracketCount();0>P&&0!=r&&(P=U);if(0>r)return q=N.get("bracketMismatch","\u5de6\u53f3\u62ec\u53f7\u4e0d\u5339\u914d\u3002"),
new B.FiltersCheckingResult(P,q);if(U!==m&&!n.getLogicOp())return q=N.get("lackLogicalSymbol","\u7b2c#1\u884c\u7f3a\u5c11\u903b\u8f91\u7b26"),q=q.replace("#1",U+1),new B.FiltersCheckingResult(U,q);if(U==m&&n.getLogicOp())return q=N.get("logicalSymbolUnnecessary","\u5b58\u5728\u591a\u4f59\u7684\u903b\u8f91\u3002"),new B.FiltersCheckingResult(U,q)}}return 0<r?(q=N.get("bracketMismatch","\u5de6\u53f3\u62ec\u53f7\u4e0d\u5339\u914d\u3002"),new B.FiltersCheckingResult(P,q)):null};this.checkFieldExisted=
function(q,r){return p(q,-1,r)?!1:!0};var p=function(q,r,P){q=q.getField();for(var m=0;m<P.length;m++)if(q&&P[m].getFullName()===q.getFullName())return null;P=N.get("lackField","\u7b2c#1\u884c\u5b57\u6bb5\u4e0d\u5b58\u5728\u3002");P=P.replace("#1",r+1);return new B.FiltersCheckingResult(r,P)},C=function(q){var r=q.getCompareOp(),P=q.getField(),m=q.getValue(),U=P?P.getOutputDataType():null;P=P?P.isEnum():!1;P=B.getSelectableCompares(U,P);q=q.getRelativeDateRange();if(!r)return N.get("lackComparisonOperator",
"\u7f3a\u5c11\u6bd4\u8f83\u7b26\u3002");for(var n=!1,fa=0;fa<P.length;fa++)if(r===P[fa]){n=!0;break}if(!n)return N.get("comparisonMismatch","\u6bd4\u8f83\u7b26\u4e0d\u5339\u914d\u3002");if(!B.isCompareOpWithoutValue(r)){if(!m&&!q)return N.get("lackValue","\u7f3a\u5c11\u503c\u3002");if(U===M.DT_NUMBER||U===M.DT_INT){if(!B.REG_NUMBER.test(m)&&!B.isCompareOpWithinOrNotWithinValue(r))return N.get("valueMustBeNum","\u503c\u5fc5\u987b\u4e3a\u6570\u5b57\u3002")}else if(U===M.DT_DATE||U===M.DT_DATETIME)if(B.isCompareOpRelativeDateRangeValue(r)){if(!(q instanceof
ba))return N.get("invalidRelativeDateValue","\u65e0\u6548\u7684\u76f8\u5bf9\u65e5\u671f\u503c\u3002")}else{if(!B.REG_DATETIME.test(m))return N.get("invalidDateValue","\u65e0\u6548\u7684\u65e5\u671f\u503c\u3002")}else if(U===M.DT_BOOLEAN&&m!==M.BOOLEAN_TRUE&&m!==M.BOOLEAN_FALSE)return N.get("wrongBoolean","\u9519\u8bef\u7684\u5e03\u5c14\u503c\u3002")}return null}};var E=new function(){var p;this.hookCollector=function(C){p=C};this.occur=function(C,q){try{p&&p(C,q)}catch(r){window.console&&console.warn(r)}}};
E.BUTTON_TYPE="button-type";E.FUNCTION="function";E.DATATABLE_MODEL_TRANSFORM_NODE_TYPE="datatable-model-transform-node-type";E.METRIC_MODEL_DIMENSION_TYPE="metric-model-dimension-type";E.ENTER_DATA_AUTH_MANAGE="enter-data-auth-manage";E.SAVE="\u4fdd\u5b58";E.REFRESH="\u5237\u65b0";E.DEPLOY="\u90e8\u7f72";E.ROLLBACK_CURRENT_DEPLOY="\u56de\u9000\u5230\u6700\u65b0\u90e8\u7f72\u72b6\u6001";E.UNDO="\u64a4\u9500";E.REDO="\u53cd\u64a4\u9500";E.CLEAR="\u6e05\u9664";E.MODEL_CHECK="\u6a21\u578b\u6821\u9a8c";
E.MODEL_PREVIEW="\u6a21\u578b\u9884\u89c8";E.MODEL_PROPERTY="\u6a21\u578b\u5c5e\u6027";E.SOURCE_MANAGE="\u6570\u636e\u6e90\u7ba1\u7406";E.MODEL_PREVIEW_EXPORT_TO_EXCEL="\u9884\u89c8-\u5bfc\u51fa\u5230Excel";E.METRIC_DELETE="\u5220\u9664";E.TRIAL_CALCULATE="\u8bd5\u8ba1\u7b97";E.TRIAL_CALCULATE_DIMENSION_FILTER="\u8bd5\u8ba1\u7b97-\u7ef4\u5ea6\u8fc7\u6ee4";E.SOURCE_TABLE_FILTER="\u6e90\u8868\u8fc7\u6ee4";E.SELECT_FIELD="\u9009\u62e9\u5b57\u6bb5";E.METRIC_FILTER="\u6307\u6807\u8fc7\u6ee4";E.NUMBER_FOMMAT=
"\u6570\u5b57\u683c\u5f0f";E.ADD_DIMENSION="\u65b0\u589e\u7ef4\u5ea6";E.PUBLIC_DIMENSION_SETTING="\u516c\u5171\u7ef4\u5ea6\u8bbe\u7f6e";E.ENTER_DATA_AUTH_MANAGE_AFTER_DEPLOY="\u6210\u529f\u90e8\u7f72\u540e\u70b9\u51fb\u8df3\u8f6c\u8fdb\u5165";da.UserOperationReporter=E})();(function(){function G(){var ea;this.setCaption=function(X){ea=X};this.getCaption=function(){return ea?ea:""};this.perform=function(){throw Error("Override me.");};this.unperform=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.modeler&&(com.kingdee.bos.qing.modeler=
{});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});var da=com.kingdee.bos.qing.modeler.designer;da.CommandManager=function(){var ea=[],X=[],N=new ya;this.perform=function(B){B.perform();ha(ea,B);X.length=0;ma(B,!0)};this.addPerformedListener=function(B){N.addListener(B)};this.isCanUndo=function(){return 0<ea.length};this.isCanRedo=function(){return 0<X.length};this.undo=function(){var B=ea.pop();B&&(B.unperform(),ha(X,B),ma(B,!1,!0))};this.redo=
function(){var B=X.pop();B&&(B.perform(),ha(ea,B),ma(B,!1,!1))};this.reset=function(){ea.length=0;X.length=0;ma(null)};var ha=function(B,M){B.push(M);32<B.length&&B.splice(0,1)},ma=function(B,M,ba){N.fireEvent(function(E){E(B,M,ba)})}};da.AbstractAction=G;da.ActionSetModel=function(){G.call(this);var ea,X,N;this.setValue=function(ha,ma,B){X=ha;N=ma;ea=B};this.perform=function(){ea(N)};this.unperform=function(){ea(X)}};da.ActionChangeModelInfo=function(){G.call(this);var ea,X,N,ha,ma;this.getCaption=
function(){return oa.get("editModelInfo","\u7f16\u8f91\u6a21\u578b\u5c5e\u6027")};this.setValue=function(B,M,ba,E,p){ea=B;X=M;N=ba;ha=E;ma=p};this.perform=function(){ea.setModelName(X);ea.setModelDesc(ha)};this.unperform=function(){ea.setModelName(N);ea.setModelDesc(ma)}};da.ActionAddRemoveSource=function(){G.call(this);var ea,X,N,ha;this.getCaption=function(){return ea};this.setValue=function(ma,B,M){X=M.getAllSource();var ba="",E="";N=[];for(var p=0;p<X.length;p++){var C=X[p];-1<B.indexOf(C)?(0<
E.length&&(E+="\uff0c"),E+=C.getName()):N.push(C)}for(p=0;p<ma.length;p++)B=ma[p],N.push(B),0<ba.length&&(ba+="\uff0c"),ba+=B.getName();ea="";0<ba.length&&(ea+=oa.get("actionAddSource","\u6dfb\u52a0\u6570\u636e\u6e90\u201c#1\u201d").replace("#1",ba));0<E.length&&(0<ea.length&&(ea+="\uff1b"),ea+=oa.get("actionRemoveSource","\u5220\u9664\u6570\u636e\u6e90\u201c#1\u201d").replace("#1",E));ha=M};this.perform=function(){ha.setSource(N)};this.unperform=function(){ha.setSource(X)}};da.ActionMoveNode=function(){G.call(this);
var ea,X,N,ha;this.getCaption=function(){if(!ha){var ma=da.DisplayNameHelper.getNodeDisplayName(ea);ha=oa.get("actionMoveNode","\u79fb\u52a8\u8282\u70b9\u201c#1\u201c").replace("#1",ma)}return ha};this.setValue=function(ma,B){ea=ma;X=B;N=[X[0]-ea.getX(),X[1]-ea.getY()]};this.perform=function(){ea.changePosition(X[0],X[1])};this.unperform=function(){ea.changePosition(ea.getX()-N[0],ea.getY()-N[1])}};da.ActionChangeMaterializedConfig=function(){G.call(this);var ea,X,N;this.getCaption=function(){return oa.get("editMaterializedConfig",
"\u7f16\u8f91\u7269\u5316\u5b58\u50a8\u8bbe\u7f6e")};this.setValue=function(ha,ma){ea=ha;N=ma};this.perform=function(){X=ea.getMaterializedConfig();ea.setMaterializedConfig(N)};this.unperform=function(){ea.setMaterializedConfig(X)}};var oa,ya;(function(){var ea=com.kingdee.bos.qing.framework.common;oa=ea.MultilanguageManager.createPackageAccessor(da);ea=com.kingdee.bos.qing.common;ya=ea.EventListenerList})()})();(function(){function G(){function a(R,aa,T,t){this.getX1=function(){return R};this.getX2=function(){return T};this.getY1=function(){return aa};this.getY2=function(){return t}}var c=!1,b,e,d=[],f,A;this.isPrepared=function(){return c};this.prepare=function(R,aa,T){A=T;e=aa;R=R.getAllNodes();b=[];for(aa=0;aa<R.length;aa++){var t=R[aa];T=t.getX();var x=t.getY(),g=T+t.getWidth();t=x+t.getHeight();b.push(new a(T,x,g,t))}c=!0};this.anchor=function(R){qa();f=R;var aa=!1,T=!1;for(R=0;R<b.length;R++){var t=
b[R];if(!aa){aa=t;var x=f[1]+(f[3]>>1);var g=aa.getY1()+aa.getY2()>>1;if(10>=Math.abs(g-x)){x=D(aa);var w=A.getScaledSize(g);Y(x[0],w,x[1],w);f[1]=g-(f[3]>>1);g=!0}else g=!1;g?aa=!0:(x=f[1],g=aa.getY1(),10>=Math.abs(g-x)?(x=D(aa),w=A.getScaledSize(g),Y(x[0],w,x[1],w),f[1]=g,g=!0):g=!1,g?aa=!0:(x=f[1]+f[3],g=aa.getY2(),10>=Math.abs(x-g)?(aa=D(aa),x=A.getScaledSize(g),Y(aa[0],x,aa[1],x),f[1]=g-f[3],aa=!0):aa=!1))}T||(T=t,g=f[0],t=T.getX1(),10>=Math.abs(t-g)?(g=D(T,!0),x=A.getScaledSize(t),Y(x,g[0],
x,g[1]),f[0]=t,t=!0):t=!1,t||(g=f[0]+f[2],t=T.getX2(),10>=Math.abs(t-g)?(T=D(T,!0),g=A.getScaledSize(t),Y(g,T[0],g,T[1]),f[0]=t-f[2],t=!0):t=!1),T=t);if(aa&&T)break}};this.abort=function(){qa()};var D=function(R,aa){if(aa){aa=f[1];var T=R.getY1();aa<T?R=R.getY2():(aa=T,R=f[1]+f[3])}else aa=f[0],T=R.getX1(),aa<T?R=R.getX2():(aa=T,R=f[0]+f[2]);return A.getScaledCoordinate([aa-15,R+15])},Y=function(R,aa,T,t){var x=$("<div>");x.addClass("modeler-designer-auxiliary-line");e.append(x);d.push(x);E.layoutCtrl(x,
R,aa,T-R,t-aa)},qa=function(){for(var R=0;R<d.length;R++)d[R].remove();d=[]}}function da(){var a=this;this.createNode=function(c){return document.createElementNS("http://www.w3.org/2000/svg",c)};this.createWithAttrs=function(c,b){c=a.createNode(c);a.setAttributes(c,b);return c};this.setText=function(c,b){$(c).empty();b=document.createTextNode(b);c.appendChild(b)};this.setTitle=function(c,b){var e=c.getElementsByTagName("title");0==e.length?(e=a.createNode("title"),c.appendChild(e)):e=e[0];a.setText(e,
b)};this.addClass=function(c,b){$(c).addClass(b)};this.createPath=function(c,b,e,d){var f=a.createNode("path"),A=a.getPathCoordinate(c,b),D=a.getPathCoordinate(c+e,b);e=a.getPathCoordinate(c+e,b+d);c=a.getPathCoordinate(c,b+d);a.setAttributes(f,{d:"M"+A+" L"+D+" L"+e+" L"+c+" Z"});return f};this.setAttributes=function(c,b){for(var e in b)c.setAttribute(e,b[e])};this.getPathCoordinate=function(c,b){return""+c+" "+b}}function oa(){var a,c,b=0,e={},d={},f,A,D;this.getSelectedEntityName=function(){var g,
w;for(w in e){var k=e[w];k&&k.isChecked()&&(g=g?g+B.ENTITY_SEPARATOR+w:w)}return g};this.setFunUpdateProperties=function(g){a=g};this.setMeta=function(g){A=g};this.setSelectedTableNames=function(g){if(A.getTableNode())for(D=g,g=0;g<D.length;g++){var w=D[g],k=e[w];k&&(k.setChecked(!0),x(k,!0),a(d[w],w))}};this.getJqUi=function(){if(!c){c=$("<div>");c.addClass("modeler-designer-selected-field-entry-panel");if(!A.getTableNode()){var g=new ha;g.setType(ha.TYPE_NO_SOURCE);g.getJqUi().appendTo(c);return c}var w=
new y;w.fromJsonObject(A.getTableNode());var k=new N;k.setLevel(0);k.toFolderLevelNode(w);Y(k,0);w=A.getPropertyMap();for(g in w)d[g]=w[g]}return c};var Y=function(g,w){if(g.getDisplayName()){var k=w,K=$("<div>");K.addClass("modeler-designer-selected-entity-item");var W=new m;W.setUserObject(g);0==k&&g.getName();e[g.getName()]=W;W.addCheckedListener(x);W=W.getJqUi();E.layoutCtrl(W,20*k,30*b,15,20);W.appendTo(K);W=$("<div>");W.addClass("modeler-designer-selected-entity-item-ui");W.attr("entity-name",
g.getName());W.on("click",T);E.layoutCtrlWithLRTB(W,20*k+18,10,null,30*b,0,20);var J=$("<div>");J.addClass("modeler-designer-selected-entity-item-text");J.text(g.getDisplayName());J.attr("title",g.getDisplayName());E.layoutCtrl(J,23,2,null,20);J.appendTo(W);J=$("<span>");J.addClass("modeler-designer-selected-entity-item-icon");h.background(J,"entity-entry");0==k&&h.background(J,"entity-sub");E.layoutCtrl(J,2,2,16,16);J.appendTo(W);W.appendTo(K);K.appendTo(c);b++;++w}if(k=g.getChildren())for(K=0;K<
k.length;K++)W=new N,W.setLevel(w),W.toFolderLevelNode(k[K]),W.setParentNode(g),Y(W,w)},qa=function(g,w){if((g=g.getChildren())&&0<g.length)for(var k=0;k<g.length;k++){var K=g[k];w[K.getName()]=K;qa(K,w)}},R=function(g,w){if(g=g.getParentNode())w[g.getName()]=g,R(g,w)},aa=function(g){var w={};if(!g)return w;if(g=g.getChildren())for(var k=0;k<g.length;k++){var K=g[k];w[K.getName()]=K}return w},T=function(g){g=$(g.currentTarget).attr("entity-name");a(d[g],g);f&&t(!1);f=g;t(!0)},t=function(g){var w=
c.find("[entity-name='"+f+"']");w&&(g?w.addClass("modeler-designer-selected-entity-item-ui_selected"):w.removeClass("modeler-designer-selected-entity-item-ui_selected"))},x=function(g,w){if(w){w=g.getUserObject();a(d[w.getName()],w.getName());var k=w.getParentNode(),K=aa(w),W={};qa(w,W);var J={};R(w,J);var ka=!1;for(pa in W){var na=e[pa];if(na&&na.isChecked()){ka=!0;break}}var pa=ka;ka=!1;for(za in J)if((na=e[za])&&na.isChecked()){ka=!0;break}var za=ka;if(g.isChecked()){f&&t(!1);f=w.getName();t(!0);
k&&(g=e[k.getName()])&&g.setEnabled(!0);for(var Aa in e)g=e[Aa],w.getName()==Aa||k&&Aa==k.getName()||pa&&W[Aa]||za&&J[Aa]||(K[Aa]?g.setEnabled(!0):g.setEnabled(!1))}else for(Aa in f&&t(!1),f=w.getName(),t(!0),k=aa(k),e)g=e[Aa],w.getName()==Aa||za&&J[Aa]||(k[Aa]?g.setEnabled(!0):(W[Aa]&&g.isChecked()&&g.setChecked(!1),g.setEnabled(!za)))}}}function ya(){var a,c,b,e;this.setMeta=function(d){a=d};this.setCurrentTableName=function(d){c=d};this.getCurrentTableName=function(){return c};this.setSelectedPropertyName=
function(d){b=d};this.getSelectedPropertyName=function(){return b};this.getMeta=function(){return a};this.getJqUi=function(){};this.getSelectedProperties=function(){return null};this.getSelectedEntityName=function(){};this.getIsEntityView=function(){return!1};this.setWidth=function(d){e=d};this.getWidth=function(d){return e}}function ea(){ya.call(this);var a=this,c,b,e,d,f,A,D={},Y=[];this.setLockPropertyName=function(T){Y=T};this.setArrProperties=function(T,t){f=t;d=T;qa(!0)};this.getTableFieldMap=
function(){return D};var qa=function(T){b&&b.hide();if(d&&0!=d.length){A=[];if(D[f])var t=D[f];else{t=d;for(var x=a.getCurrentTableName().split(B.ENTITY_SEPARATOR),g=0;g<t.length;g++){var w=t[g],k=new ma;k.setField(w);k.setDisplayName(w.getAlias());Y&&-1!=Y.indexOf(w.getName())&&(k.setEnabled(!1),k.setShowRelationIcon(!0));k.setSelected(!0);-1!=x.indexOf(f)&&a.getSelectedPropertyName()&&-1==a.getSelectedPropertyName().indexOf(w.getName())&&k.setSelected(!1);A.push(k)}D[f]||(D[f]=A);t=A}e.setArrFieldItems(t,
T)}else b?b.show():(T=new ha,T.setType(ha.TYPE_NO_DATA_WITH_CLOUD),b=T.getJqUi(),e.setJqNoDataUI(b),b.appendTo(c))},R=function(){var T=a.getMeta().getRelations();if(T&&0<T.length){Y=[];for(var t=0;t<T.length;t++){var x=T[t];-1==Y.indexOf(x.getFromProperty())&&Y.push(x.getFromProperty())}}};this.getJqUi=function(){c||aa();return c};var aa=function(){c=$("<div>");c.addClass("modeler-designer-selected-field-panel");e=new X;e.setShowAllCheckbox(!0);e.setFunFieldCheckClick(function(t,x){x.setSelected(t)});
var T=e.getJqUi();T.addClass("modeler-designer-selected-field-list-panel");T.appendTo(c);f=a.getCurrentTableName();a.getMeta().getPropertyMap()&&(d=a.getMeta().getPropertyMap()[f]);R();qa()};this.getSelectedProperties=function(){if(!d)return[];var T=[],t={},x=!0,g=D[a.getCurrentTableName()];if(!g)return[];for(var w=0;w<g.length;w++){var k=g[w],K=k.getField();t[K.getFullName()]||(k.getSelected()?(T.push(K),t[K.getFullName()]=!0):x=!1)}return x?null:T}}function X(){var a=[],c,b,e,d,f=!1,A=!1,D=!0,Y=
!0,qa=!0,R,aa,T,t,x,g,w;this.getContentPaneCreator=function(){return K};this.show=function(){c.show()};this.hide=function(){c.hide()};this.getJqUi=function(){c||K();return c};this.setJqNoDataUI=function(Z){aa=Z};this.getArrFieldItems=function(){return a};this.setArrFieldItems=function(Z,sa){a=[];R.empty();Z&&0!==Z.length?aa&&aa.hide():aa&&aa.show();sa&&(f=!1,e&&e.setChecked(!1),b&&b.clear());if(A){sa=k(Z);var S=R,L=S.append,ia=sa==Z.length,xa=$("<div>");xa.addClass("modeler-desinger-select-field-lineitem");
T=new m;T.setChecked(ia);T.addCheckedListener(na);ia=T.getJqUi();ia.addClass("modeler-designer-field-item-checkbox");ia.appendTo(xa);ia=$("<div>");ia.addClass("modeler-designer-field-item-allcheckbox-text");ia.text(M.get("selectAll","\u5168\u9009"));ia.appendTo(xa);t=$("<div>");t.addClass("modeler-designer-field-item-selected-prompt");t.text(M.get("selectedItemsPrompt","(\u5df2\u9009\u62e9#1\u9879)"));t.appendTo(xa);L.call(S,xa);W(sa)}for(sa=0;sa<Z.length;sa++)S=Z[sa],S.setFunFieldCheckClick(Aa),
a.push(S),S.initJqUi(),L=S.getJqUi(),L.appendTo(R),e&&e.isChecked()&&!S.getSelected()&&L.hide();J()};this.setFunFieldCheckClick=function(Z){x=Z};this.setFunAllCheckboxClick=function(Z){g=Z};this.setAllCheckboxSelected=function(Z){T.setChecked(Z)};this.setShowSearchText=function(Z){qa=Z};var k=function(Z){for(var sa=0,S=0;S<Z.length;S++)Z[S].getSelected()&&sa++;return sa},K=function(){if(!c){c=$("<div>");if(qa){var Z=$("<div class='modeler-designer-select-field-search-text'>");Z.text(M.get("search",
"\u641c\u7d22"));Z.appendTo(c)}Z=c;var sa=Z.append;b=new U;b.setShowSearchIcon(!0);b.addSearchListener(J);b.setSearchListenerDelay(500);b.setPlaceholder(M.get("inputSearchText","\u8f93\u5165\u641c\u7d22\u6587\u672c"));var S=b.getJqUi();S.addClass("modeler-designer-select-field-search-box");qa?S.css("left","10px"):S.css("width","90%");sa.call(Z,S);D&&c.append(pa);R=$("<div class='modeler-designer-select-field-list'>");Y&&R.css("overflow","scroll");aa&&c.append(aa);c.append(R)}return c},W=function(Z){t&&
t.text(M.get("selectedItemsPrompt","(\u5df2\u9009\u62e9#1\u9879)").replace("#1",Z))},J=function(Z){d=$.trim(b.getText());ka(a,d)},ka=function(Z,sa){if(0==sa.length){w&&w.hide();Z&&0!==Z.length||aa.show();for(var S=0;S<Z.length;S++){var L=Z[S];f&&!L.getSelected()||L.show(!0)}T&&T.setChecked(Ba())}else{var ia=!0;for(S=0;S<Z.length;S++)if(L=Z[S],!f||L.getSelected())-1===L.getDisplayName().toLowerCase().indexOf(sa.toLowerCase())?L.show(!1):(L.show(!0),ia=!1);ia?(w||(w=$("<div>"),w.addClass("modeler-designer-addsource-noresult-view-container"),
Z=$("<div>"),Z.addClass("modeler-designer-addsource-noresult-view-icon"),h.background(Z,"search-no-result"),Z.appendTo(w),Z=$("<div>"),Z.addClass("modeler-designer-addsource-noresult-view-tip"),Z.text(M.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),Z.appendTo(w),w.appendTo(c),w.hide()),w.show(),aa&&aa.hide(),T&&T.setChecked(!1)):(w&&w.hide(),T&&T.setChecked(Ba()))}};this.updateSelectedItemsPrompt=function(){W(k(a))};var na=function(Z,sa){if(sa){for(var S=
0;S<a.length;S++){var L=a[S];L.isShow()&&L.getEnabled()&&L.setSelected(Z.isChecked())}g&&g(Z,sa);Z=k(a);W(Z)}},pa=function(){e=new m;e.setChecked(f);e.addCheckedListener(za);e.setText(M.get("showOnlyChecked","\u4ec5\u663e\u793a\u9009\u4e2d\u9879"));var Z=e.getJqUi();E.layoutCtrl(Z,290,5,200,23);return Z},za=function(Z,sa){sa&&((f=Z.isChecked())?a.forEach(function(S){S.getSelected()||S.show(!1)}):a.forEach(function(S){S.show(!0)}),ka(a,d))};this.setShowAllCheckbox=function(Z){A=Z};this.setShowScroll=
function(Z){Y=Z};this.setShowOnlyChecked=function(Z){D=Z};var Aa=function(Z,sa){x&&x(Z,sa);Z=k(a);W(Z);T&&T.setChecked(Ba())},Ba=function(){for(var Z=!0,sa=0;sa<a.length;sa++){var S=a[sa];if(S.isShow()&&!S.getSelected()){Z=!1;break}}return Z}}function N(){y.call(this);var a=this,c,b;this.getLevel=function(){return c};this.setLevel=function(e){c=e};this.getParentNode=function(){return b};this.setParentNode=function(e){b=e};this.toFolderLevelNode=function(e){a.setName(e.getName());a.setDisplayName(e.getDisplayName());
a.setChildren(e.getChildren());a.setLevel(c)}}function ha(){var a,c=ha.TYPE_TEXT,b=M.get("noDataTips","\u6682\u65e0\u6570\u636e"),e;this.getJqUi=function(){if(!a)switch(a=$("<div>"),a.addClass("modeler-designer-no-data"),c){case ha.TYPE_TEXT:f(b,"modeler-designer-no-data-only-text");break;case ha.TYPE_NO_SOURCE:d("no_source","modeler-designer-no-data-icon");f(b,"modeler-designer-no-data-text");break;case ha.TYPE_NO_SEARCH_RESULT:d("search-no-result","modeler-designer-node-selection-icon");f(b,"modeler-designer-node-selection-tip");
break;case ha.TYPE_NO_DATA_WITH_CLOUD:d("no_data_cloud","modeler-designer-no-data-cloud-icon");f(b,"modeler-designer-no-data-text");break;default:throw Error("The view type error, please set first.");}return a};this.setType=function(A){c=A};this.setText=function(A){b=A?A:"";e&&e.text(b)};var d=function(A,D){var Y=$("<div>");Y.addClass(D);h.background(Y,A);Y.appendTo(a)},f=function(A,D){e=$("<div>");e.addClass(D);e.text(A);e.appendTo(a)}}function ma(){var a=this,c,b=!1,e=!0,d=!0,f,A,D,Y;this.setField=
function(R){c=R};this.getField=function(){return c};this.setDisplayName=function(R){c&&c.setAlias(R)};this.getDisplayName=function(){return c.getAlias()};this.getFieldType=function(){return c.getOutputDataType()};this.setSelected=function(R){b=R;f&&f.setChecked(R)};this.setShowRelationIcon=function(R){D=R};this.show=function(R){R?A&&A.show():A&&A.hide();d=R};this.isShow=function(){return d};this.getSelected=function(){return f?f.isChecked():b};this.setEnabled=function(R){e=R};this.getEnabled=function(){return e};
this.getJqUi=function(){return A};this.setFunFieldCheckClick=function(R){Y=R};this.initJqUi=function(){A=$("<div>");f=new m;f.setUserObject(a);f.setChecked(b);f.setEnabled(a.getEnabled());f.addCheckedListener(function(R,aa){aa&&Y&&Y(R.isChecked(),a)});qa(a,f);return A};var qa=function(R,aa){var T=$("<div>");T.addClass("modeler-desinger-select-field-lineitem");aa=aa.getJqUi();aa.addClass("modeler-designer-field-item-checkbox");aa.appendTo(T);aa=$("<div>");aa.addClass("modeler-designer-field-item-checkbox-text");
aa.text(R.getDisplayName());aa.attr("title",R.getDisplayName());R=R.getFieldType();var t=$("<div>");t.addClass("modeler-designer-field-item-icon");h.background(t,R);t.appendTo(T);aa.appendTo(T);D&&(R=$("<div>"),R.addClass("modeler-designer-field-item-relation-icon"),h.background(R,"relation"),R.appendTo(T));T.appendTo(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.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});var B=com.kingdee.bos.qing.modeler.designer;B.AbstractDesigner=function(){var a=this,c,b,e=new ca,d=new ja,f=new O,A,D,Y,qa,R=!0,aa;this.setMessageResize=function(J){aa=J};var T=new function(){this.getModelerModel=function(){return a.protectedGetModelerModel()};this.getIntegration=function(){return c};
this.getMessageCurtain=function(){return A};this.getCommandManager=function(){return f};this.getRemoteImpl=function(){return qa}};this.protectedInit=function(){};this.protectedResize=function(){};this.protectedGetModelerModel=function(){throw Error("override me");};this.setJsonModel=function(J){throw Error("override me");};this.protectedUpdateModelerModel=function(J){throw Error("override me");};this.getJsonModel=function(){var J=T.getModelerModel(),ka=new H;ka.setModelerModel(J);return ka.toJsonObject()};
this.setJsonValidity=function(J,ka){throw Error("override me");};this.setUndoAbleJsonModel=function(J,ka){var na=new H;na.fromJsonObject(J);J=na.getModelerModel();na=new Q;na.setCaption(ka);na.setValue(a.protectedGetModelerModel(),J,a.protectedUpdateModelerModel);f.perform(na)};this.setRemoteImpl=function(J){qa=J};this.setEditable=function(J){R=J};this.isEditable=function(){return R};this.createJqUi=function(){b=$("<div onselectstart='return false'>");b.addClass("modeler-designer");A=new P;A.getJqUi().appendTo(b);
x();b.append(e.getJqUi());b.append(d.getJqUi());a.protectedInit();R&&(B.LockHelper.setGlobal(T),B.LockHelper.show(b));return b};this.resize=function(){g()};this.setIntegration=function(J){c=J};this.getIntegration=function(){return c};this.setLockInfo=function(J,ka,na){B.LockHelper.setLockInfo(J,ka,na)};this.setLockStateChangeListener=function(J){B.LockHelper.setLockStateChangeListener(J)};this.registerLockRequestSender=function(J){B.LockHelper.registerLockRequestSender(J)};this.insertToolbarBtn=function(J,
ka,na,pa){return e.addButtonForHeadCustom(J,ka,na,pa)};this.insertMenuButton=function(J,ka,na,pa){return e.addMenuButtonForHeadCustom(J,ka,na,pa)};this.appendToolbarBtn=function(J,ka,na,pa){return e.addButtonForTailCustom(J,ka,na,pa)};this.getMsgCurtain=function(){return A};this.clearDirty=function(){t(!1)};this.isDirty=function(){return D};this.setDirtyListener=function(J){Y=J};var t=function(J){D=J;d&&d.showDirtyState(D);Y&&Y(D)},x=function(){w();var J=new ba;J.setCallbackImmediately(function(){w()});
J.setDelay(100);J.setCallback(function(){g()});J.observe()},g=function(){B.LockHelper.setMaxWidth(b.width()-e.getAllBtnWidth());a.protectedResize();aa&&aa()},w=function(){document.body.style.height=document.documentElement.clientHeight+"px"},k=function(){f.isCanUndo()&&f.undo();z.occur(z.BUTTON_TYPE,z.UNDO)},K=function(){f.isCanRedo()&&f.redo();z.occur(z.BUTTON_TYPE,z.REDO)},W=function(){var J=new V;J.setGlobal(T);J.setRemoteImpl(qa);J.showDialog()};this.protectedMethod={addToolbarButton:function(J,
ka,na,pa){return e.addButton(J,ka,na,pa)},getGlobal:function(){return T},getMainUi:function(){return b},addUndoRedoBtn:function(J){var ka=e.addButton(k,"btn_undo",M.get("undo","\u64a4\u6d88")),na=e.addButton(K,"btn_redo",M.get("redo","\u53cd\u64a4\u6d88"));ka.setEnabled(f.isCanUndo());na.setEnabled(f.isCanRedo());f.addPerformedListener(function(pa,za,Aa){ka.setEnabled(f.isCanUndo());na.setEnabled(f.isCanRedo())});f.addPerformedListener(function(pa,za,Aa){t(!0);pa&&(za=za?"":(Aa?M.get("undo","\u64a4\u6d88"):
M.get("redo","\u53cd\u64a4\u6d88"))+" ",za+=pa.getCaption(),d.showShortPrompt(za),J&&J(pa))})},addMaterializedConfigBtn:function(){e.addButton(W,"btn_materialized_config",M.get("materializedConfig","\u7269\u5316\u5b58\u50a8\u8bbe\u7f6e"))}}};B.ModelInfoDialog=function(){r.call(this);var a=this.protectedMethod,c=this,b,e,d;(function(){a.setTitle(M.get("modelProp","\u6a21\u578b\u5c5e\u6027"));c.setSize(400,300);a.setContentPaneCreator(function(){var f=$("<div>"),A=new p;A.setRequired(!0);A.setText(M.get("name",
"\u540d\u79f0"));A=A.getJqUi();b=new C;var D=b.getJqUi(),Y=d.getIntegration();b.setText(Y.getModelName());var qa=new p;qa.setText(M.get("desc","\u63cf\u8ff0"));qa=qa.getJqUi();e=new q;var R=e.getJqUi();e.setText(Y.getModelDesc());A.appendTo(f);D.appendTo(f);qa.appendTo(f);R.appendTo(f);E.layoutCtrl(A,8,0,70,23);E.layoutCtrl(D,76,0,280,23);E.layoutCtrl(qa,8,48,70,23);E.layoutCtrl(R,76,54,280,120);return f});a.setClosingChecker2(function(f){f=$.trim(b.getText());var A=$.trim(e.getText()),D=d.getIntegration(),
Y=D.getModelName(),qa=D.getModelDesc();if(f==Y&&A==qa)return!0;var R;0==f.length?R=M.get("nameIsEmptyPrompt","\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a\u3002"):50<f.length&&(R=M.get("nameTooLongPrompt","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"));500<A.length&&(R=M.get("descTooLongPrompt","\u63cf\u8ff0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7500\u4e2a\u5b57\u7b26\u3002"));if(R)return a.getMessageCurtain().showPrompt(R),!1;R=new F;R.setValue(D,f,D.getModelName(),A,D.getModelDesc());
d.getCommandManager().perform(R);return!0});a.setClosingAction(function(f){})})();this.setGlobal=function(f){d=f}};B.NoNodePromptUi=function(){var a,c,b,e,d;this.setNoNode=function(Y){D()};this.setNoSource=function(Y){b=Y;D()};this.show=function(){a&&a.show()};this.hide=function(){a&&a.hide()};this.getJqUi=function(){a||(a=$("<div>"),a.css("background","#f7f7f7"),a.css("z-index",1E3),E.layoutCtrlWithLRTB(a,0,0,null,0,0,null),D());return a};var f=function(){if(!e){e=$("<div>");E.layoutCtrlMiddleAlign(e,
180);E.layoutCtrlCenterAlign(e,260);e.appendTo(a);c=$("<div>");c.addClass("modeler-designer-no-node-prompt");E.layoutCtrl(c,10,0,260,20);c.appendTo(e);c.text(M.get("dragInNode","\u62d6\u5165\u8868\uff0c\u5f00\u59cb\u521b\u5efa\u6a21\u578b"));var Y=$("<div>");E.layoutCtrl(Y,0,40,253,140);h.background(Y,"drag_node_prompt");Y.appendTo(e)}return e},A=function(){d||(d=$("<div>"),E.layoutCtrlMiddleAlign(d,170),E.layoutCtrlCenterAlign(d,210),h.background(d,"no_node_and_source"),d.appendTo(a));return d},
D=function(){b?(f().hide(),A().show()):(f().show(),A().hide())}};B.DragHandler=function(){var a=$(document.body),c,b,e,d,f,A,D,Y,qa,R,aa;this.bindDragUi=function(k,K){var W=!1,J=[-1,-1],ka=null,na=function(){c=W=!1;ka=null;J=[-1,-1]};k.on("mousedown",function(pa){W=!0;c=!1;ka=$(pa.target);J=[pa.screenX,pa.screenY]});k.on("mouseup",function(pa){na()});k.on("mouseleave",function(pa){W&&na()});k.on("mousemove",function(pa){var za=!1;W&&(za=5<Math.abs(pa.screenX-J[0])||5<Math.abs(pa.screenY-J[1]));za&&
(W=!1,(d=K(ka))?(A=new G,e=Y(),f=d.getTableNode(),c=!0,a.on("mousemove",T),a.on("mouseup",t),a.on("mouseleave",g)):na())})};this.bindDropUi=function(k,K,W,J,ka){Y=K;qa=W;R=J;D=ka};var T=function(k){if(c){if(!b){b=$("<div onselectstart='return false'>");b.addClass("modeler-dragdrop-mask");var K=E.getCurrentTargetPosition(k);K=E.upwardCoordinate(k.target,K,a[0]);b.data("target-origin-pos-left",K[0]);b.data("target-origin-pos-top",K[1]);b.appendTo(a)}if(K=qa(k,e,f)){var W=K.getJqPhysicalUi();A.isPrepared()||
A.prepare(K.getModeler(),W,D);aa||(aa=$("<div>"),E.layoutCtrlWithLRTB(aa,0,0,null,0,0,null),aa.css("z-index",999999));aa.appendTo(W);x();k=[f.getX(),f.getY()];k=D.getScaledCoordinate(k);k=E.upwardCoordinate(W[0],k,a[0]);K=D.getScaledSize(f.getWidth());W=D.getScaledSize(f.getHeight());E.layoutCtrl(b,k[0],k[1],K,W)}else console.log("moving"),b.text(""),K=E.getCurrentTargetPosition(k),K=E.upwardCoordinate(k.target,K,a[0]),E.layoutCtrl(b,K[0]-20,K[1]-15,40,30)}},t=function(k){qa(k,e,f)?(x(),R(d,function(){b.remove();
b=null}),w(!0)):w()},x=function(){var k=[f.getX(),f.getY(),f.getWidth(),f.getHeight()];A.anchor(k);f.setPosition(k[0],k[1])},g=function(){w()},w=function(k){c=!1;!k&&b&&b.animate({left:b.data("target-origin-pos-left"),top:b.data("target-origin-pos-top"),width:4,height:3},function(){b.remove();b=null});a.off("mousemove",T);a.off("mouseup",t);a.off("mouseleave",g);aa&&aa.remove();A&&A.abort()}};B.NodeDragHelper=function(){var a,c,b,e,d,f,A,D,Y=!1,qa,R;this.setTarget=function(k){b=k};this.setScaleHelper=
function(k){R=k};this.setModelerModel=function(k){qa=k};this.setMovableArea=function(k){a=k};this.startDrag=function(k){console.log("start drag");D=new G;D.prepare(qa,a,R);c=[k.clientX,k.clientY];e=$("<div>");e.css("z-index",999999);e.appendTo($(document.body));E.layoutCtrlWithLRTB(e,0,0,null,0,0,null);e.on("mousemove",aa);e.on("mouseup",T);e.on("mouseleave",g)};this.setEndMoveCallback=function(k){f=k};var aa=function(k){if(Y)var K=!0;else K=Math.abs(k.clientY-c[1]),K=5<Math.abs(k.clientX-c[0])||
5<K?Y=!0:!1;if(K){if(!d){d=$("<div>");d.addClass("modeler-dragdrop-mask");d.appendTo(a);var W=b.getX(),J=b.getY(),ka=b.getWidth();K=b.getHeight();A=[W,J];W=R.getScaledCoordinate(A);ka=R.getScaledSize(ka);K=R.getScaledSize(K);E.layoutCtrl(d,W[0],W[1],ka,K)}k=x(k);t(k);k=R.getScaledCoordinate(k);E.layoutCtrl(d,k[0],k[1],null,null)}},T=function(k){d&&(k=x(k),t(k),f&&f(k[0],k[1]));w()},t=function(k){if(d){var K=R.getRawSize(d.width()),W=R.getRawSize(d.height()),J=R.getRawCoordinate(k);K=[J[0],J[1],K,
W];D.anchor(K);k[0]=K[0];k[1]=K[1]}},x=function(k){var K=k.clientX-c[0];k=k.clientY-c[1];var W=R.getScaledCoordinate(A);return[W[0]+K,W[1]+k]},g=function(k){w()},w=function(){console.log("destroy");e&&(e.off("mousemove",aa),e.off("mouseup",T),e.off("mouseleave",g),e.remove(),e=null);d&&(d&&d.remove(),d=null);D&&D.abort()}};B.PageDragHelper=function(){var a,c,b,e,d,f,A,D;this.startDrag=function(t,x){console.log("start drag page");d=x;c=[t.clientX,t.clientY];b=(t=d.position())?[t.left,t.top]:[0,0];
f=$("<div>");f.css("z-index",999999);f.appendTo($(document.body));f.css("cursor","move");E.layoutCtrlWithLRTB(f,0,0,null,0,0,null);f.on("mousemove",Y);f.on("mouseup",qa);f.on("mouseleave",R)};this.setMovableArea=function(t){e=t};this.setGlobal=function(t){A=t};this.setScaleHelper=function(t){D=t};var Y=function(t){var x=t.clientX-c[0];t=t.clientY-c[1];if(a)var g=!0;else g=Math.abs(t),g=5<Math.abs(x)||5<g?a=!0:!1;g&&d.css({left:T(b[0]+x,!0)+"px",top:T(b[1]+t,!1)+"px"})},qa=function(t){aa()},R=function(t){aa()},
aa=function(){console.log("destroy drag page");f.css("cursor","default");f&&f.remove();f=null},T=function(t,x){if(x){x=9999;var g=d.width();var w=e.width()}else x=9999,g=d.height(),w=e.height();x=D.getScaledSize(x);var k=g>x;x=0<t?k?0:Math.min(t,x-g):k?Math.max(t,w-g):Math.max(t,w-x);x!=t&&A.getMessageCurtain().showPrompt(M.get("svgMaxSize","\u5df2\u8fbe\u5230\u7ed8\u5236\u533a\u57df\u6700\u5927\u5c3a\u5bf8\u3002"));return x}};B.DragInsideCheckResult=function(a,c){this.getJqPhysicalUi=function(){return a};
this.getModeler=function(){return c}};B.FieldSelectDialog=function(a,c,b,e,d){r.call(this);var f=this,A=this.protectedMethod,D,Y,qa=d,R,aa;this.showSelectFieldDialog=function(g,w){f.setSize(g,w);f.setPosition(window.innerWidth-g>>1,window.innerHeight-w>>1);A.setTitle(M.get("selectField","\u9009\u62e9\u5b57\u6bb5"));A.setClosingAction(T);A.setClosingChecker(t);A.setContentPaneCreator(x);f.showDialog()};var T=function(g){if(g)if((g=Y.getSelectedProperties())&&b.setSelectedFields(g),Y.getIsEntityView()){var w=
Y.getSelectedEntityName();g=e.clone();var k=b.clone();if(w!=e.getTableName()){var K=qa.getAllTable(),W=!1;g.setTableName(w);for(w=0;w<K.length;w++){var J=K[w];if(g.isSame(J)){W=!0;g.setUid(J.getUid());k.setTableUid(J.getUid());break}}W||(K=B.UIDHelper.getUID(B.UIDHelper.NS_TABLE),g.setUid(K),k.setTableUid(K))}K=R;aa(k,g);K&&K()}else g=R,aa(b,e),g&&g();else R&&R()},t=function(){if(!Y)return!1;if(Y.getIsEntityView()){var g=Y.getSelectedEntityName();if(!g)return A.getMessageCurtain().showPrompt(M.get("needSelectedEntity",
"\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b9e\u4f53\u6216\u8005\u5206\u5f55\u8868\u3002")),!1;Y.setCurrentTableName(g)}return(g=Y.getSelectedProperties())&&0==g.length?(A.getMessageCurtain().showPrompt(M.get("noSelectedField","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b57\u6bb5\u3002")),!1):!0},x=function(){D=$("<div>");var g=new l(a,function(w){var k=new v;k.fromJsonObject(w);Y=B.SelectFieldFactory.createSelectFieldToDialog(k.getSourceType());Y.setMeta(k);Y.setCurrentTableName(e.getTableName());
Y.setWidth(850);Y.getIsEntityView()&&A.setTitle(M.get("selectEntityAndField","\u9009\u62e9\u6570\u636e\u8868\u53ca\u5b57\u6bb5"));Y.getJqUi().appendTo(D)});g.setBlockingJqUi(D);g.setShowBlocking(!0);g.getMeta(c,e);return D};this.setGlobal=function(g){};this.setModeler=function(g){qa=g};this.setFunFinishCallback=function(g){R=g};this.setAddNodeCallback=function(g){aa=g}};B.SelectFieldPanel=X;B.SvgHelper=da;B.ChooseFieldPanelHelper=function(){function a(){var D=[],Y,qa,R,aa,T,t=!1,x=!0,g;this.setItemModel=
function(w){D=w};this.setShowFieldNameEnable=function(w){x=w};this.setRawTypeSwitchListener=function(w){};this.setSearchListener=function(w){Y=w};this.setListItemPainter=function(w){qa=w};this.setShowFieldNameListener=function(w){R=w};this.setSearchBoxPlaceholder=function(w){g=w};this.createJqPopup=function(w,k,K){aa=$("<div>");aa.appendTo(w);T=$("<div>");aa.addClass("modeler-designer-field-popup");w=g?g:M.get("search","\u641c\u7d22");var W=new U;W.setSearchListenerDelay(200);W.setPlaceholder(w);
W.addSearchListener(function(){Y(D,W.getText(),T,k,qa,t)});w=W.getJqUi();w.addClass("modeler-designer-field-popup-search");w.appendTo(aa);T.addClass("modeler-designer-field-popup-list-owner");T.on("click",function(na){var pa=$(na.currentTarget);na=$(na.target);if(na=E.upwardSearchHasClass(na,pa,"modeler-designer-field-popup-list-item"))na.addClass("modeler-designer-list-item_selected_enabled"),pa=na.data("model"),K(pa)});T.appendTo(aa);w=aa.find(".sa-ctrl-textfield-input");w.css("top","0px");w.css("height",
"100%");if(0==D.length)b(T,M.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5"));else for(w=0;w<D.length;w++)qa(D[w],T,k);if(x){var J=M.get("showFieldName","\u663e\u793a\u539f\u5b57\u6bb5\u540d\u79f0");w=new p;w.setText(J);w=w.getJqUi();w.attr("title",J);w.addClass("modeler-designer-field-popup-show-field-name-label");J=new n;J.addStateChangeListener(function(na,pa,za){(t=za)?R&&R(T,!0):R&&R(T,!1)});J.setOn(!1);J=J.getJqUi();J.addClass("modeler-designer-field-popup-show-field-name-button");var ka=
$("<div>");ka.addClass("modeler-designer-field-popup-show-field-name");J.appendTo(ka);w.appendTo(ka);ka.appendTo(aa)}else T.css("bottom","5px")}}var c;this.createChooseFieldPanel=function(D){c=D;D=new a;D.setListItemPainter(f);D.setSearchListener(e);D.setShowFieldNameListener(d);return D};var b=function(D,Y){var qa=new p;qa.setText(Y);qa.setEnabled(!1);qa.setAlign(p.ALIGN_CENTER);Y=qa.getJqUi();Y.addClass("modeler-designer-field-popup-no-data");Y.appendTo(D)},e=function(D,Y,qa,R,aa,T){Y=Y.toLowerCase();
for(var t=[],x,g=0;g<D.length;g++)(x=D[g])&&(x=-1!=x.getAlias().toLowerCase().indexOf(Y)?!0:T&&-1!=x.getName().toLowerCase().indexOf(Y)?!0:!1)&&t.push(D[g]);qa.children().remove();if(0<t.length){for(g=0;g<t.length;g++)aa(t[g],qa,R);t.length=0}else""==Y?b(qa,M.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5")):b(qa,M.get("noSearchResult","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c"));d(qa,T)},d=function(D,Y){if(Y)for(D=D.find(".modeler-designer-field-popup-list-item-text-name"),Y=0;Y<D.length;Y++){var qa=
D.eq(Y);qa.css("display","inline-block");var R=qa.prev().text()+qa.text();qa.prev().attr("title",null);qa.parent().attr("title",R)}else for(D=D.find(".modeler-designer-field-popup-list-item-text-name"),Y=0;Y<D.length;Y++)qa=D.eq(Y),qa.css("display","none"),qa.parent().attr("title",null),qa.prev().attr("title",qa.prev().text())},f=function(D,Y,qa){var R=$("<div>");R.addClass("modeler-designer-field-popup-list-item");R.data("model",D);c(R,D);Y.append(R);qa&&D&&qa.getFullName()==D.getFullName()&&A(Y,
R)},A=function(D,Y){var qa=null;0<D.height()?(clearTimeout(qa),Y.addClass("modeler-designer-list-item_selected_enabled"),D.prop("scrollTop",Y.prop("offsetTop"))):qa=setTimeout(function(){A(D,Y)},0)}};B.CommonSvgIconHelper=function(){this.makeUrl=function(a){return"../qinganalysis/qingmodeler/designer/svgicon/"+a+".svg"};this.getTableIconColor=function(a){var c="#ffa500";if(a)switch(a.getSourceType()){case u.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:case u.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:c="#A06AE2";
break;case u.SOURCE_TYPE_MODEL_SET_SOURCE:c="#40A9FF";break;case u.SOURCE_TYPE_MODELSET_FILE_SOURCE:c="#F67682";break;case u.SOURCE_TYPE_OPEN_API_SOURCE:c="#73D13D"}return c}};B.AbstractDisplayNameHelper=function(){var a=this,c={};this.init=function(e){a.protectedInit(e);e=e.getAllNodes();c={};if(e)for(var d=0;d<e.length;d++)a.getNodeDisplayName(e[d])};this.protectedInit=function(e){};this.protectedGetDefaultName=function(e){throw Error("override me");};this.getNodeDisplayName=function(e){if(!e)return"";
var d=e.getAlias();if(d)return c[e.getId()]=d;d=e.getId();if(d=c[d])return d;var f=a.protectedGetDefaultName(e);d=e.getNameIndex();d=b(f,d);f=d[0];(d=d[1])&&e.setNameIndex(d);return c[e.getId()]=f};this.isDuplicate=function(e,d){for(var f=Object.keys(c),A=!1,D=0,Y=f.length;D<Y;D++)if(c[f[D]]==e&&(!d||d.getId()!=f[D])){A=!0;break}return A};var b=function(e,d){var f=d?e+"_"+d:e;var A=[f,d];a.isDuplicate(f)&&(A=b(e,d?d+1:1));return A};this.protectedMethod={cacheDisplayName:function(e,d){c[e]=d}}};B.PageSizeHelper=
function(){this.adaptSize=function(a){var c=a.getPage();var b=a.getAllNodes(),e=a.getPage();if(1>b.length)var d=[0,0,e.getWidth(),e.getHeight()];else{var f=b[0];e=f.getX();var A=f.getY();d=e+f.getWidth();f=A+f.getHeight();for(var D=1;D<b.length;D++){var Y=b[D];e=Math.min(e,Y.getX());A=Math.min(A,Y.getY());d=Math.max(d,Y.getX()+Y.getWidth());f=Math.max(f,Y.getY()+Y.getHeight())}d=[e-100,A-100,d+100,f+100]}A=c.getWidth();f=c.getHeight();b=-d[0];e=-d[1];A=d[2]-A;d=d[3]-f;if(0!=b||0!=A||0!=e||0!=d){if(0!=
b||0!=e)for(a=a.getAllNodes(),f=0;f<a.length;f++)D=a[f],D.setPosition(D.getX()+b,D.getY()+e);c.setExtension(b,e,A,d);return!0}return!1}};B.SelectFieldView=ea;B.AbstractLeftRightSelector=function(){var a=this,c,b,e,d,f,A,D;this.getJqUi=function(){c||(d=Y(">",!0,!1),f=Y(">>",!0,!0),A=Y("<",!1,!1),D=Y("<<",!1,!0),b=qa(a.protectedCreateLeftJqTitle(),a.protectedGetLeftCtrl()),e=qa(a.protectedCreateRightJqTitle(),a.protectedGetRightCtrl()),c=$("<div>"),c.append(b),c.append(e),c.append(d.getJqUi()),c.append(A.getJqUi()),
c.append(f.getJqUi()),c.append(D.getJqUi()));return c};this.relayout=function(){var R=c.prop("clientWidth"),aa=c.prop("clientHeight");E.layoutCtrlWithLRTB(b,0,(R>>1)+36,null,0,0,null);E.layoutCtrlWithLRTB(e,(R>>1)+36,0,null,0,0,null);E.layoutCtrlWithLRTB(d.getJqUi(),null,null,null,null,(aa>>1)+8,28);E.layoutCtrlCenterAlign(d.getJqUi(),40);E.layoutCtrlWithLRTB(A.getJqUi(),null,null,null,(aa>>1)+8,null,28);E.layoutCtrlCenterAlign(A.getJqUi(),40);E.layoutCtrlWithLRTB(f.getJqUi(),null,null,null,null,
(aa>>1)+56,28);E.layoutCtrlCenterAlign(f.getJqUi(),40);E.layoutCtrlWithLRTB(D.getJqUi(),null,null,null,(aa>>1)+56,null,28);E.layoutCtrlCenterAlign(D.getJqUi(),40)};var Y=function(R,aa,T){R=new fa(R);R.getJqUi().css({border:"1px solid #ddd","font-size":"18px"});R.addActionListener(function(t){a.protectedSelect(aa,T)});return R},qa=function(R,aa){var T=$("<div>");T.append(aa.getJqUi());R?(T.append(R),E.layoutCtrlWithLRTB(R,0,0,null,0,null,20),E.layoutCtrlWithLRTB(aa.getJqUi(),0,0,null,22,0,null)):E.layoutCtrlWithLRTB(aa.getJqUi(),
0,0,null,0,0,null);return T};this.protectedCreateLeftJqTitle=function(){return null};this.protectedCreateRightJqTitle=function(){return null};this.protectedGetLeftCtrl=function(){throw Error("Implement");};this.protectedGetRightCtrl=function(){throw Error("Implement");};this.protectedSelect=function(R){throw Error("Implement");}};B.NoDataView=ha;var M,ba,E,p,C,q,r,P,m,U,n,fa,I,H,F,Q,ca,ja,O,h,y,u,v,l,V,z;(function(){var a=com.kingdee.bos.qing.common;E=a.DomUtil;a=com.kingdee.bos.qing.framework.common;
M=a.MultilanguageManager.createPackageAccessor(B);ba=a.WindowResizeObserver;a=com.kingdee.bos.qing.ui.component;r=a.AbstractModalDialog;p=a.Label;C=a.TextField;q=a.TextArea;P=a.MessageCurtain;m=a.CheckBox;U=a.SearchBox;n=a.SwitchButton;fa=a.WorkButton;I=a.SplitPane;F=B.ActionChangeModelInfo;Q=B.ActionSetModel;ca=B.Toolbar;ja=B.StatusBar;O=B.CommandManager;h=B.Icons;y=B.FolderNode;u=B.AbstractModelerSource;v=B.Meta;l=B.DesignerFacade;H=B.QingModeler;V=B.MaterializedConfigDialog;z=B.UserOperationReporter})();
B.SvgTextTrimer=new function(){var a,c,b;this.init=function(){b=$("<div>");E.layoutCtrl(b,-10,-10,10,10);a=new da;var d=a.createNode("svg");a.setAttributes(d,{width:10,height:10});c=a.createNode("text");d.appendChild(c);b.append($(d));$(document.body).append(b);b.hide()};this.trim=function(d,f,A){b.show();a.setAttributes(c,{"font-size":f+"px"});f=e(d);for(var D=d,Y=1;f>A&&Y<d.length;)D=d.slice(0,d.length-Y)+"...",f=e(D),Y++;b.hide();return D};this.measureText=function(d){b.show();d=e(d);b.hide();
return d};var e=function(d){a.setText(c,d);return c.getComputedTextLength()}};B.DisplayNameHelper=new function(){var a;this.registerImpl=function(c){a=c};this.isDuplicate=function(c,b){if(!a)throw Error("need register first");return a.isDuplicate(c,b)};this.getNodeDisplayName=function(c){if(!a)throw Error("need register first");return a.getNodeDisplayName(c)}};ha.TYPE_TEXT="text";ha.TYPE_NO_SOURCE="noSource";ha.TYPE_NO_SEARCH_RESULT="noSearchResult";ha.TYPE_NO_DATA_WITH_CLOUD="noDataWithCloud";B.SelectFieldFactory=
new function(){var a={};this.addSelectFieldToPanel=function(c,b){a[c]=b};this.createSelectFieldToDialog=function(c,b){var e=a[c];c=e?new e(c,b):new ea;return c}};B.SelectFieldFactory.addSelectFieldToPanel(u.SOURCE_TYPE_CURRENT_ENTITY_SOURCE,function(){ya.call(this);var a=this,c,b,e;this.getJqUi=function(){if(!c){c=$("<div>");e=new ea;e.setMeta(a.getMeta());e.setCurrentTableName(a.getCurrentTableName());e.setSelectedPropertyName(a.getSelectedPropertyName());var f=e.getJqUi(),A=new I;A.setHorizontalSplit(!0);
A.setSplitLineWide(8);A.setResizeMode(I.RESIZE_MODE_FIRST_FIXED);A.setFirstSize(200,185,300);A.setSecondSize(a.getWidth()-250,350,-1);b=new oa;b.setFunUpdateProperties(d);b.setMeta(a.getMeta());A.setFirstChild(I.createChildWrapper(b.getJqUi()));A.setSecondChild(I.createChildWrapper(f));A.getJqUi().appendTo(c);b.setSelectedTableNames(a.getCurrentTableName().split(B.ENTITY_SEPARATOR))}return c};this.getIsEntityView=function(){return!0};this.getSelectedProperties=function(){for(var f=[],A={},D=!0,Y=
a.getCurrentTableName().split(B.ENTITY_SEPARATOR),qa=0;qa<Y.length;qa++){var R=Y[qa];R=e.getTableFieldMap()[R];for(var aa=0;aa<R.length;aa++){var T=R[aa],t=T.getField();A[t.getFullName()]||(T.getSelected()?(f.push(t),A[t.getFullName()]=!0):D=!1)}}return D?null:f};this.getSelectedEntityName=function(){return b.getSelectedEntityName()};var d=function(f,A){e.setArrProperties(f,A)}})})();(function(){function G(){var I=this,H,F,Q,ca,ja,O,h,y;this.setCurrentNode=function(V){H=V};this.getCurrentNode=function(){return H};this.setModelerModel=function(V){F=V};this.setNodeStatusMonitor=function(V){Q=V};this.setDirty=function(V){ca=V};this.isDirty=function(){return ca};this.setMask=function(V){ja=V};this.getMask=function(){return ja};this.setInValidBackgroundPanel=function(V){O=V};this.getInValidBackgroundPanel=function(){return O};this.setModelerChecker=function(V){h=V};this.protectedGetModelerChecker=
function(){return h};this.clear=function(){H=null;I.protectedClear()};this.protectedClear=function(){throw Error("Implement me.");};this.showPreviewContent=function(){H?I instanceof da?h.focusNodeValidity(H,u):h.focusNodeValidity(H,v):(ja.hide(),O.setText(E.get("dataLoading","\u6570\u636e\u52a0\u8f7d\u4e2d")),O.show())};this.protectedGetModeler=function(){return F};var u=function(){I.isCurrentNodeValid()?(O.hide(),I.protectedShowPreviewContent()):(O.setText(l()),O.show())},v=function(){I.isCurrentNodeValid()?
(O.hide(),ja.setClickCallback(I.protectedShowPreviewContent),ja.show()):(ja.hide(),O.setText(l()),O.show())};this.protectedShowPreviewContent=function(){throw Error("Implement me.");};this.afterResize=function(){console.log("preview area resize.....");Q&&Q.getSelected()&&I.protectedAfterResize()};this.protectedAfterResize=function(){throw Error("Implement me.");};this.setRuntimeModelGetter=function(V){y=V};this.getRuntimeModel=function(){if(H&&F)return y(F,H)};this.isCurrentNodeValid=function(){return H?
!Q.isInvalidNode(H.getId()):!0};var l=function(){var V=Q.getInvalidPrompt(H);return V?V:E.get("invalidNodeConfig","\u8282\u70b9#1\u8bbe\u7f6e\u4e0d\u5b8c\u6574").replace("#1",H.getAlias())}}function da(){function I(h){KTDefaultCellRender.call(this,h);var y=this,u=this.paintCellUI;this.paintCellUI=function(v,l){var V=y.getCurrentRowIdx(),z=y.getCurrentRow(),a=y.getCurrentColIdx();z=z.getUserObject();if(V<p.getHeadRowCount())u(v,l);else if(0==a)l=$("<div>"),z=z.getName(),l.text(z),l.attr("title",z),
l.css("line-height","28px"),l.css("padding-left","2px"),l.css("padding-right","2px"),l.appendTo(v);else if(1==a)l=$("<div>"),z=z.getAlias(),l.text(z),l.attr("title",z),l.css("line-height","28px"),l.css("padding-left","2px"),l.css("padding-right","2px"),l.appendTo(v);else if(2==a){if(z=z.getSourceNodeId(),l=H.protectedGetModeler().getNode(z))z=$("<div>"),l=X.DisplayNameHelper.getNodeDisplayName(l),z.text(l),z.attr("title",l),z.css("line-height","28px"),z.css("padding-left","2px"),z.css("padding-right",
"2px"),z.appendTo(v)}else 3==a&&(l=$("<div>"),z=m.getDataTypeDesc(z.getAppointedDataType()),l.text(z),l.attr("title",z),l.css("line-height","28px"),l.css("padding-left","2px"),l.css("padding-right","2px"),l.appendTo(v))}}N.AbstractTabPane.call(this);G.call(this);var H=this,F,Q,ca,ja;this.getTitle=function(){return E.get("field","\u5b57\u6bb5")};this.getJqUi=function(){if(!F){F=$("<div>");Q&&O();var h=new ea,y=h.getJqUi();H.setMask(h);h.hide();q.layoutCtrlWithLRTB(y,0,0,null,0,0,null);F.append(y);
h=new ya;y=h.getJqUi();h.hide();H.setInValidBackgroundPanel(h);q.layoutCtrlWithLRTB(y,0,0,null,0,0,null);F.append(y)}return F};this.into=function(){!Q||H.isDirty()?(H.showPreviewContent(),H.setDirty(!1)):H.afterResize()};this.protectedAfterResize=function(){ca&&Q&&0!=Q.length&&ca.relayoutViews()};this.setRemoteImpl=function(h){};this.protectedClear=function(){Q=null};this.reload=function(){H.showPreviewContent()};this.protectedShowPreviewContent=function(){X.NodeFieldHelper.asynGetFields(H.getGlobal().getModelerModel(),
H.getCurrentNode(),function(h){Q=h;ca||O();p.clear(ca);ca.addColumns(4);ca.getColumn(0).setWidth(200);ca.getColumn(1).setWidth(200);ca.getColumn(2).setWidth(140);ca.getColumn(3).setWidth(140);h=p.createHeadRow(ca);h.getCell(0).setValue(E.get("fieldName","\u5b57\u6bb5\u540d\u79f0"));h.getCell(1).setValue(E.get("fieldAlias","\u663e\u793a\u540d\u79f0"));h.getCell(2).setValue(E.get("tableSource","\u6765\u6e90\u8868"));h.getCell(3).setValue(E.get("dataType","\u6570\u636e\u7c7b\u578b"));if(Q){h=0;for(var y=
Q.length;h<y;h++)p.createRow(ca).setUserObject(Q[h])}p.refresh(ca)},function(){},F)};var O=function(){ca=p.createTable();ca.setColumnFitVisibleWidth(!0);var h=new I(ca);h.setOutsideVisible(!1);ca.setCellRender(h);ca.setSyncUIWhenModelChanged(!0);ja=$(ca.getUI());q.layoutCtrlWithLRTB(ja,10,10,null,10,10,null);ja.appendTo(F)}}function oa(){function I(c){KTDefaultCellRender.call(this,c);var b=this,e=this.paintCellUI;this.paintCellUI=function(d,f){var A=b.getCurrentRowIdx(),D=b.getCurrentRow(),Y=b.getCurrentColIdx();
D=D.getUserObject();if(A<p.getHeadRowCount())e(d,f);else{f=h.getField(Y);A=f.getOutputDataType();Y=D[Y];if(null==Y||void 0==Y)Y="";else if(A==U.DT_DATE)D=new r,D.setFormatString("yyyy-MM-dd"),Y=D.format(Y);else if(A==U.DT_DATETIME)D=new r,D.setFormatString("yyyy-MM-dd HH:mm:ss"),Y=D.format(Y);else if(A==U.DT_BOOLEAN)Y=void 0===Y?"":Y?"true":"false";else if(A==U.DT_NUMBER&&(D=f.getScale()))for(Y+="",f=Y.split("."),2>f.length?(Y+=".",f=""):f=f[1],D-=f.length,f=0;f<D;f++)Y+="0";D=$("<div>");D.text(Y);
D.attr("title",Y);D.css("line-height","28px");D.css("padding-left","2px");D.css("padding-right","2px");D.appendTo(d)}}}function H(){M.call(this);var c=this.protectedMethod,b=this,e,d,f,A,D=!1,Y;(function(){c.setTitle(E.get("previewSet","\u9884\u89c8\u8bbe\u7f6e"));c.setSelectable(!0);c.setContentPaneCreator(function(){b.setSize(440,330);return qa()});c.setFooterPaneCreator(function(T){var t=new ba(E.get("confirm","\u786e\u5b9a"));t.setHighlight(!0);var x=t.getJqUi();x.addClass("sa-ctrl-dialog-footer-ok");
x.appendTo(T);t.addActionListener(function(g){g=e.getValue();var w=d.getValue();Y&&Y(D,g,w);c.destroy();return!0});t=new ba(E.get("cancel","\u53d6\u6d88"));t.setHighlight(!1);x=t.getJqUi();x.addClass("sa-ctrl-dialog-footer-cancel");x.appendTo(T);t.addActionListener(function(g){c.destroy();return!0})});c.setClosingAction(function(T){})})();this.setOriginExtractCount=function(T){f=T};this.setOriginPreviewCount=function(T){A=T};this.setAllData=function(T){D=T};this.setConfirmCallback=function(T){Y=T};
var qa=function(){var T=$("<div>"),t=$("<div>");t.text(E.get("extractSet","\u62bd\u53d6\u8bbe\u7f6e"));q.layoutCtrl(t,30,20,100,24);t.appendTo(T);t.css({color:"#333333","line-height":"24px","font-size":"14px"});t=R("extract",E.get("extract","\u62bd\u53d6\u524d"),T);var x=t.getJqUi();q.layoutCtrlWithLRTB(x,60,null,300,60,null,null);e=new ha;var g=e.getJqUi();e.setConstraint(1,1E4,1);e.setValue(f);q.layoutCtrlWithLRTB(g,120,null,100,49,null,null);g.appendTo(T);g=$("<div>");g.text(E.get("rowDataCalculate",
"\u884c\u6570\u636e\u8ba1\u7b97"));g.css("color","#666");q.layoutCtrlWithLRTB(g,170,0);q.layoutCtrlMiddleAlign(g,22);g.appendTo(x);x=R("extractAll",E.get("all","\u5168\u91cf"),T);g=x.getJqUi();q.layoutCtrlWithLRTB(g,60,null,300,90,null,null);var w=$("<div>");C.background(w,"warning");w.attr("title",E.get("extractAllWarn","\u62bd\u53d6\u5168\u91cf\u6570\u636e\u8ba1\u7b97\u65f6\uff0c\u4f1a\u589e\u52a0\u6570\u636e\u9884\u89c8\u7684\u65f6\u957f\uff0c\u589e\u52a0\u670d\u52a1\u5668\u538b\u529b\uff0c\n\u53ef\u80fd\u4f1a\u5bfc\u81f4\u7cfb\u7edf\u5d29\u6e83\uff0c\u56e0\u6b64\u63a8\u8350\u62bd\u53d6\u90e8\u5206\u6570\u636e\u3002"));
q.layoutCtrlWithLRTB(w,110,null,20,79,null,20);w.appendTo(T);g=new ma;g.addElement(t);g.addElement(x);g.addChangedListener(function(K,W){W&&("extract"==K.getUserObject()?(D=!1,e.setEnabled(!0),w.hide()):(D=!0,e.setEnabled(!1),w.show()))});D?(aa(g,"extractAll"),e.setEnabled(!1),w.show()):(aa(g,"extract"),e.setEnabled(!0),w.hide());t=$("<div>");t.text(E.get("dataPreview","\u6570\u636e\u9884\u89c8"));q.layoutCtrl(t,30,115,100,24);t.appendTo(T);t.css({color:"#333333","line-height":"24px","font-size":"14px"});
var k=R("dataPreview",E.get("previewResult","\u9884\u89c8\u8ba1\u7b97\u7ed3\u679c\u7684\u524d"),T);k.setChecked(!0);k.addCheckedListener(function(){k.setChecked(!0)});t=k.getJqUi();q.layoutCtrlWithLRTB(t,60,null,300,155,null,null);d=new ha;x=d.getJqUi();d.setConstraint(1,1E3,1);d.setValue(A);q.layoutCtrlWithLRTB(x,180,null,100,144,null,null);x.appendTo(T);x=$("<div>");x.text(E.get("rowData","\u884c\u6570\u636e"));x.css("color","#666");q.layoutCtrlWithLRTB(x,230,0);q.layoutCtrlMiddleAlign(x,22);x.appendTo(t);
return T},R=function(T,t,x){var g=new B;g.setUserObject(T);g.setText(t);T=g.getJqUi();x.append(T);return g},aa=function(T,t){T.toCheckTheElement(function(x){return x.getUserObject()===t})}}N.AbstractTabPane.call(this);G.call(this);var F=this,Q,ca,ja,O,h,y=1E3,u=100,v=!1,l;this.getTitle=function(){return E.get("preview","\u9884\u89c8")};this.getJqUi=function(){if(!Q){Q=$("<div>");var c=$("<div>");c.css("cursor","pointer");c.attr("title",E.get("previewSet","\u9884\u89c8\u8bbe\u7f6e"));c.on("click",
a);C.backgroundWithHover(c,"setting");q.layoutCtrl(c,10,3,20,20);c.appendTo(Q);l=$("<div>");q.layoutCtrlWithLRTB(l,40,10,null,5,null,20);l.css({"font-size":"14px",color:"#666",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"});l.appendTo(Q);z();c=new ea;var b=c.getJqUi();F.setMask(c);c.hide();q.layoutCtrlWithLRTB(b,5,5,null,28,5,null);Q.append(b);c=new ya;b=c.getJqUi();F.setInValidBackgroundPanel(c);c.hide();q.layoutCtrlWithLRTB(b,5,5,null,28,5,null);Q.append(b);V()}return Q};this.setRemoteImpl=
function(c){ca=c};this.into=function(){!h||F.isDirty()?(F.showPreviewContent(),F.setDirty(!1)):F.afterResize()};this.protectedAfterResize=function(){ja&&h&&0!=h.getRowCount()&&ja.relayoutViews()};this.protectedClear=function(){h=null};this.reload=function(){F.showPreviewContent()};this.protectedShowPreviewContent=function(){var c=F.getRuntimeModel();if(c){var b=(new Date).getTime(),e=new P(ca,function(f){var A=F.getCurrentNode(),D=new fa;D.fromJsonObject(f);if(f=D.getValidity())F.protectedGetModelerChecker().updateNodeValidity(f,
b);else if(f=D.getPreviewData(),A&&D.getNodeId()==A.getId()&&(h=f,h&&0!=h.getRowCount()||(F.getMask().hide(),F.getInValidBackgroundPanel().setText(E.get("noData","\u5f53\u524d\u9884\u89c8\u89c4\u5219\u4e0b,\u6ca1\u6709\u7b26\u5408\u6761\u4ef6\u7684\u6570\u636e")),F.getInValidBackgroundPanel().show()),ja||z(),h)){O||(O=$(ja.getUI()),q.layoutCtrlWithLRTB(O,10,10,null,30,10,null),O.appendTo(Q));f=h.getColumnCount();A=h.getRowCount();p.clear(ja);if(0!=f&&0!=A){ja.addColumns(f);var Y=p.createHeadRow(ja);
for(D=0;D<f;D++)ja.getColumn(D).setWidth(150),Y.getCell(D).setValue(h.getField(D).getAlias());for(D=0;D<A;D++)f=h.getOneRow(D),p.createRow(ja).setUserObject(f)}p.refresh(ja)}},function(f,A){return X.DppVersionExceptionHandler.handle(f)}),d=new n;v?d.setExtractAllData(u):d.setExtractPartlyData(y,u);c.setPreviewConfig(d);e.setBlockingJqUi(Q);e.getPreviewData(c)}};var V=function(){var c=v?E.get("extractAllData","\u62bd\u53d6\u5168\u91cf\u6570\u636e\u8fdb\u884c\u8ba1\u7b97, "):E.get("onlyExtractSomeRows",
"\u4ec5\u62bd\u53d6\u524d#1\u884c\u8fdb\u884c\u8ba1\u7b97, ").replace("#1",y);c+=E.get("previewRows","\u663e\u793a\u8ba1\u7b97\u7ed3\u679c\u7684\u524d#1\u884c\u6570\u636e").replace("#1",u);l.text(c)},z=function(){ja=p.createTable();ja.setColumnFitVisibleWidth(!1);var c=new I(ja);c.setOutsideVisible(!1);ja.setCellRender(c);ja.setSyncUIWhenModelChanged(!0)},a=function(){var c=new H;c.setOriginExtractCount(y);c.setOriginPreviewCount(u);c.setAllData(v);c.setConfirmCallback(function(b,e,d){v=b;y=e;u=d;
F.showPreviewContent();V()});c.showDialog()}}function ya(){var I,H;this.getJqUi=function(){I||(I=$("<div>"),I.addClass("modeler-designer-preview-no-data-background"),H=$("<div>"),H.addClass("modeler-designer-preview-no-data-text"),H.appendTo(I));return I};this.setText=function(F){H.text(F)};this.hide=function(){I.hide()};this.show=function(){I.show()}}function ea(){var I=this,H,F;this.setClickCallback=function(ca){F=ca};this.getJqUi=function(){H||Q();return H};var Q=function(){H=$("<div>");H.addClass("modeler-designer-preview-mask");
var ca=$("<div>");ca.text(E.get("refreshPreviewData","\u7f16\u8f91\u5b8c\u6210\u540e\uff0c\u70b9\u51fb\u6b64\u5904\u5237\u65b0\u9884\u89c8\u6570\u636e\u3002"));ca.on("click",function(ja){I.hide();F&&F()});ca.addClass("modeler-designer-preview-mask-button");ca.appendTo(H)};this.show=function(){H.show()};this.hide=function(){H.hide()}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&
(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});var X=com.kingdee.bos.qing.modeler.designer;X.AbstractPreviewArea=function(){var I=this,H,F,Q,ca,ja,O,h,y,u,v,l=!1,V;this.protectedModelerPropChangeListener=function(e,d){};this.protectedGetRuntimeModel=function(e,d){throw Error("override me");};this.getJqUi=function(){ja||z();return ja};
this.setModelerModel=function(e){H&&H.removePropertyChangeCallback(b);H=e;H.addPropertyChangeCallback(b)};this.setModelerChecker=function(e){u=e};this.setNodeStatusMonitor=function(e){F&&F.removeSelectNodeListener(a);F&&F.removeInvalidNodeChangeListener(c);F=e;F.addSelectNodeListener(a);F.addInvalidNodeChangeListener(c)};this.setGlobal=function(e){Q=e};this.setRemoteImpl=function(e){ca=e};this.setHideListener=function(e){v=e};this.show=function(e){l!=!e&&((l=!e)||O.getCurrentTabPane().into())};var z=
function(){ja=$("<div>");h=new da;y=new oa;h.setRemoteImpl(ca);y.setRemoteImpl(ca);y.setNodeStatusMonitor(F);h.setNodeStatusMonitor(F);y.setModelerChecker(u);h.setModelerChecker(u);y.setRuntimeModelGetter(I.protectedGetRuntimeModel);h.setRuntimeModelGetter(I.protectedGetRuntimeModel);O=new N;O.setTabLevel(N.SECOND_LEVEL);O.addTab(h,!0);O.addTab(y);var e=$("<div>");C.background(e,"downArrow");q.layoutCtrlWithLRTB(e,null,5,16,8,null,16);e.css("cursor","pointer");e.on("click",function(){l=!0;v&&v()});
e.appendTo(ja);ja.append(O.getJqUi())},a=function(e,d){y.clear();h.clear();d&&(V=F.getInvalidState(d),e=Q.getModelerModel(),h.setCurrentNode(d),h.setModelerModel(e),y.setCurrentNode(d),y.setModelerModel(e));l||(d=O.getCurrentTabPane(),(e=d.getJqUi().find(".sa-common-loading-modallayer"))&&e.remove(),d.showPreviewContent())},c=function(e){if(e=O.getCurrentTabPane())if(e=e.getCurrentNode()){e=F.getInvalidState(e);if(V!=e&&!l){var d=O.getCurrentTabPane();d.reload();d==y?h.setDirty(!0):y.setDirty(!0)}V=
e}},b=function(e,d){I.protectedModelerPropChangeListener(e,d)};this.afterResize=function(){O.getCurrentTabPane().afterResize()}};var N,ha,ma,B,M,ba,E,p,C,q,r,P,m,U,n,fa;(function(){var I=com.kingdee.bos.qing.ui.component;N=I.TabContainer;ha=I.Spinner;ma=I.RadioButtonGroup;B=I.RadioButton;M=I.AbstractModalDialog;ba=I.Button;I=com.kingdee.bos.qing.common.ui;p=I.TableUtil;I=com.kingdee.bos.qing.common;q=I.DomUtil;r=I.DateFormater;I=com.kingdee.bos.qing.framework.common;E=I.MultilanguageManager.createPackageAccessor(X);
P=X.DesignerFacade;U=X.Field;m=X.PropDataTypeUtil;n=X.PreviewConfig;C=X.Icons;fa=X.ExecuteResult})()})();(function(){function G(){var t,x,g,w,k,K,W,J;this.setTableArea=function(S){};this.setGlobal=function(S){W=S};this.getGlobal=function(){return W};this.setRemoteImpl=function(S){};this.setModelerModel=function(S){x&&x.removePropertyChangeCallback(pa);x=S;x.addPropertyChangeCallback(pa);ka()};this.getJqUi=function(){if(!t){t=$("<div>");t.addClass("modeler-designer-workarea");t.addClass("modeler-designer-common-border");var S=$("<div>");S.addClass("modeler-designer-workarea-title");var L=$("<div>");L.addClass("modeler-designer-workarea-title-text");
L.text(O.get("source","\u6570\u636e\u6e90"));S.append(L);L=$("<div>");L.addClass("modeler-designer-workarea-title-btn");aa.backgroundWithHover(L,"add");L.on("click",na);L.attr("title",O.get("selectDataSource","\u9009\u62e9\u6570\u636e\u6e90"));L.appendTo(t);g=$("<div>");g.addClass("modeler-designer-workarea-container");w=new V;w.setBorderVisible(!1);w.setToggleSelectingEnabled(!1);w.setCustomItemPainter(Aa);w.setCustomSelectedsPainter(Ba);w.addSelectedChangedListener(Z);k=w.getJqUi();k.appendTo(g);
ja.layoutCtrlWithLRTB(k,0,0,null,0,0,null);t.append(S);t.append(g);ka()}return t};this.showDialogIfNoSource=function(){var S=x.getAllSource();if(!S||0==S.length){var L=na();S=new h;S.setCallbackImmediately(function(){L.updateTable()});S.observe()}};var ka=function(){if(x){var S=x.getAllSource();w.setItemModels(S);if(S&&0!=S.length){K&&K.hide();var L=!1,ia=w.getSelecteds();if(ia)for(var xa=0;xa<ia.length;xa++)for(var ta=ia[xa],wa=0;wa<S.length;wa++){var Ea=S[wa];if(Ea==ta){L=!0;1===S.length&&(ia.push(null),
w.setSelecteds([Ea]));break}}L||w.setSelecteds([S[0]]);k.show()}else k.hide(),K||(K=$("<div>"),K.appendTo(t),K.addClass("modeler-designer-sourcearea-nosource"),S=$("<div>"),S.appendTo(K),aa.background(S,"no_data_cloud"),ja.layoutCtrlCenterAlign(S,138),ja.layoutCtrl(S,null,0,null,78),S=$("<div>"),S.text(O.get("selectDataSource","\u9009\u62e9\u6570\u636e\u6e90")),S.attr("title",O.get("selectDataSource","\u9009\u62e9\u6570\u636e\u6e90")),S.on("click",na),S.appendTo(K),S.addClass("modeler-designer-sourcearea-text-add")),
K.show()}},na=function(){var S=new da;S.setGlobal(W);S.setSelectedCallback(za);S.setModeler(x);S.showDialog();return S},pa=function(S){if(S==r.KEY_ADD_PREPARED_SOURCE||S==r.KEY_REMOVE_PREPARED_SOURCE||S==r.KEY_SET_PREPARED_SOURCE)console.log("update source area ui"),ka()},za=function(S,L){if(S&&0!=S.length||L&&0!=L.length){var ia=new I;ia.setValue(S,L,x);W.getCommandManager().perform(ia)}},Aa=function(S,L){S.css("height","30px");S.css("cursor","pointer");var ia=L.getSourceType();if(ia){var xa=L.getName();
xa||(xa=T.createSourceNameByType(ia),L.setName(xa));S.attr("name",xa);var ta=0,wa=W.getIntegration().getMapSourcePermission();if(wa)for(var Ea=Object.keys(wa),Ja=0;Ja<Ea.length;Ja++)if(Ea[Ja]===L.getSourceId()){Ea=wa[Ea[Ja]];if(!Ea)break;wa=Ea.errorCode;wa!=G.CURRENT_USER_NOPERMISSION_PUBLIC_SOURCE_ERRORCODE&&wa!=G.CURRENT_USER_NOPERMISSION_DATACENTER_ERRORCODE&&(ta=T.createExceptionIcon(Ea.errorMessage),ta.addClass("modeler-designer-sourcearea-exception-icon"),ta.appendTo(S),ta=22);S.data("errorCode",
wa);break}wa=$("<div>");wa.addClass("modeler-designer-sourcearea-icon");wa.css("top","9px");aa.background(wa,T.getSourceIconName(ia));wa.css("left",12+ta+"px");wa.appendTo(S);wa=$("<div>");wa.text(xa);wa.addClass("modeler-designer-sourcearea-name");wa.css("left",34+ta+"px");wa.attr("title",O.get("name","\u540d\u79f0")+"\uff1a"+xa+"\n"+O.get("type","\u7c7b\u578b")+"\uff1a"+T.translateSourceType(ia));wa.appendTo(S)}else T.updateDeletedSourceStatus(S);var Ka=$("<div>");Ka.addClass("modeler-designer-sourcearea-delete-btn");
Ka.on("mousedown",function(Ua){Ua.stopPropagation();x.isSourceUsed(L)?W.getMessageCurtain().showPrompt(O.get("theSourceIsUsed","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u6570\u636e\u8868\u6a21\u578b\u4f7f\u7528\uff0c\u8bf7\u5148\u5728\u8bbe\u8ba1\u7a97\u53e3\u5220\u9664\u8be5\u6570\u636e\u6e90\u4e0b\u7684\u8868\uff0c\u518d\u5220\u9664\u6570\u636e\u6e90\u3002")):sa().setClosingChecker(function(Ra){Ra==f.RETURN_OK&&(Ra=new fa,Ra.setValue(L,x),W.getCommandManager().perform(Ra),S.is(J)&&M.SourceConnectStep.removeTableTree(),
S.remove());return!0})});aa.backgroundWithHover(Ka,"delete");Ka.appendTo(S);Ka.hide();S.mouseenter(function(){Ka.show()}).mouseleave(function(){Ka.hide()})},Ba=function(S,L){L&&0<L.length&&(S&&0<S.length&&(S=S[0],S.css("background-color",""),S.css("color","")),L=L[0],L.css("background-color","#eff3fd"),L.css("color","rgb(130, 130, 130)"))},Z=function(S,L,ia){S=ia[0];J=L=w.getItemUiByModel(S);M.ConnectSourceCreator.getSourceConnector(S,L).getFunConnectSource()()},sa=function(){var S=f.createFeedbackDialog();
S.setMsgImageType(f.MSG_DELETE);S.setOptionType(f.OPTION_OK_CANCEL);S.setMessage(O.get("confirmDeleteSource","\u786e\u5b9a\u5220\u9664\u8be5\u6570\u636e\u6e90\u5417\uff1f"));S.showDialog();return S}}function da(){u.call(this);var t=this,x=this.protectedMethod,g,w,k,K;(function(){x.setTitle(O.get("selectDataSource","\u9009\u62e9\u6570\u636e\u6e90"));t.setSize(791,600);x.setSelectable(!0);x.setContentPaneCreator(function(){g=new ya;g.setRemoteImpl(M.ModelSetSourceIntegration.getRemoteImpl());var J=
$("<div>");g.setArrExistsSource(k.getAllSource());g.setContainer(J);g.setMultiSelect(!0);g.loadDataSource();return J});x.setFooterPaneCreator(function(J){var ka=new y(O.get("confirm","\u786e\u5b9a"));ka.setHighlight(!0);var na=ka.getJqUi();na.addClass("sa-ctrl-dialog-footer-ok");na.appendTo(J);ka.addActionListener(function(pa){pa=g.getSelected();g.getTable()?W(pa):x.destroy()});ka=new y(O.get("cancel","\u53d6\u6d88"));ka.setHighlight(!1);na=ka.getJqUi();na.addClass("sa-ctrl-dialog-footer-cancel");
na.appendTo(J);ka.addActionListener(function(pa){x.destroy();return!0})});x.setClosingAction(function(J){})})();this.setGlobal=function(J){K=J};this.updateTable=function(){var J=$(document.body),ka=J.prop("clientWidth");J=J.prop("clientHeight");ka=Math.max(0,ka-791>>1);J=Math.max(0,J-600>>1);x.getDialogCtrl().setBounds(ka,J,791,600);g.updateUiByObserver()};this.setSelectedCallback=function(J){w=J};this.setModeler=function(J){k=J};var W=function(J){(new (M.ModelSetSourceIntegration.getModelSetSourceFacade())(M.ModelSetSourceIntegration.getRemoteImpl(),
function(ka){for(var na,pa=0,za=0;za<J.length;za++){for(var Aa=!1,Ba=0;Ba<ka.length;Ba++)if(J[za].getId()==ka[Ba].id){Aa=!0;break}Aa||(pa++,1==pa&&(na=J[za].getSourceName()))}if(0<pa){g.rePaintSource(ka);if(1<pa){var Z=O.get("moreSourceDeleted","\u201c#1\u201d\u7b49#N\u4e2a\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");Z=Z.replace("#N",""+pa)}else Z=O.get("sourceDeleted","\u201c#1\u201d\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");
Z=Z.replace("#1",na);x.getMessageCurtain().showPrompt(Z)}else{pa=0;na=[];ka=k.getAllSource();for(za=0;za<ka.length;za++){Aa=ka[za];Ba=!1;for(var sa=J.length-1;0<=sa;sa--)Aa.getSourceId()===J[sa].getId()&&(Ba=!0,J.splice(sa,1));Ba||(k.isSourceUsed(Aa)?(pa++,1===pa&&(Z=Aa.getName())):na.push(Aa))}if(0<pa)1<pa?(na=O.get("moreSourceIsUsed","\u201c#1\u201d\u7b49#N\u4e2a\u6570\u636e\u6e90\u5df2\u88ab\u6570\u636e\u8868\u6a21\u578b\u4f7f\u7528\uff0c\u8bf7\u5148\u5728\u8bbe\u8ba1\u7a97\u53e3\u5220\u9664\u6570\u636e\u6e90\u4e0b\u7684\u8868\uff0c\u518d\u53d6\u6d88\u52fe\u9009\u6570\u636e\u6e90\u3002"),
na=na.replace("#N",""+pa)):na=O.get("sourceIsUsed","\u201c#1\u201d\u6570\u636e\u6e90\u5df2\u88ab\u6570\u636e\u8868\u6a21\u578b\u4f7f\u7528\uff0c\u8bf7\u5148\u5728\u8bbe\u8ba1\u7a97\u53e3\u5220\u9664\u6570\u636e\u6e90\u4e0b\u7684\u8868\uff0c\u518d\u53d6\u6d88\u52fe\u9009\u6570\u636e\u6e90\u3002"),na=na.replace("#1",Z),x.getMessageCurtain().showPrompt(na),g.rePaintSource();else{if(K.getIntegration()&&(Z=K.getIntegration().getMapSourcePermission()))for(pa=Object.keys(Z),ka=0;ka<J.length;ka++)for(za=
0;za<pa.length;za++)if(pa[za]==J[ka].getId()){Z[pa[za]]=null;break}Z=[];for(pa=0;pa<J.length;pa++)ka=new p,ka.setName(J[pa].getSourceName()),ka.setSourceType(J[pa].getSourceType()),ka.setId(M.UIDHelper.getUID(M.UIDHelper.NS_SOURCE)),ka.setSourceId(J[pa].getId()),ka.setModelId(M.ModelSetSourceIntegration.getModelId()),Z.push(ka);w&&w(Z,na);x.destroy()}}})).designerLoadSources()}}function oa(t,x,g){u.call(this);var w=this,k=this.protectedMethod,K,W,J,ka,na,pa=[],za,Aa,Ba,Z;(function(){x?k.setTitle(O.get("EditSQL",
"\u7f16\u8f91SQL/KSQL")):k.setTitle(O.get("customSQL","\u81ea\u5b9a\u4e49SQL/KSQL"));w.setSize(590,450);k.setSelectable(!0);var sa=function(){k.destroy()},S=function(){J.setTableName(K.getText().trim());J.setDisplayName(K.getText());var L=new U,ia=za.isChecked()?"SQL":"KSQL";L.setSqlType(ia);L.setContent(W.getText());J.setUserSql(L);(new C(t,function(xa){for(xa=0;xa<pa.length;xa++)(0,pa[xa])(J,ka);sa()},function(xa,ta){k.getMessageCurtain().showError(ta);return!0})).checkUserSqlExecutable(ia,W.getText(),
na.getSourceId(),J.getNamespace())};k.setContentPaneCreator(function(){var L=$("<div>"),ia=new D;ia.setText(O.get("name","\u540d\u79f0"));ia=ia.getJqUi();K=new Y;J.getTableName()&&K.setText(J.getTableName());var xa=K.getJqUi(),ta=new v;za=new l;za.setText("SQL");za.setChecked(!0);Aa=new l;Aa.setText("KSQL");ta.addElement(za);ta.addElement(Aa);ta=za.getJqUi();var wa=Aa.getJqUi(),Ea=new D;Ea.setText(O.get("SQLContent","\u5185\u5bb9"));Ea=Ea.getJqUi();W=new qa;if(J&&J.getUserSql()){var Ja=J.getUserSql();
"KSQL"==Ja.getSqlType()&&Aa.setChecked(!0);W.setText(Ja.getContent())}Ja=W.getJqUi();L.append(ia);L.append(xa);L.append(ta);g&&L.append(wa);L.append(Ea);L.append(Ja);var Ka=12;ja.layoutCtrl(ia,10,Ka,80,23);ja.layoutCtrl(xa,90,Ka,420,23);ja.layoutCtrl(Ea,10,Ka+=50,80,23);ja.layoutCtrl(ta,90,Ka,80,23);ja.layoutCtrl(wa,170,Ka,80,23);ja.layoutCtrl(Ja,90,Ka+50,420,200);return L});k.setFooterPaneCreator(function(L){var ia=new y(O.get("confirm","\u786e\u5b9a"));ia.setHighlight(!0);var xa=ia.getJqUi();xa.addClass("sa-ctrl-dialog-footer-ok");
xa.appendTo(L);ia.addActionListener(function(ta){ta="";var wa=K.getText().trim(),Ea=W.getText().toLowerCase();0==wa.length?ta=O.get("nameIsEmptyPrompt","\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a\u3002"):50<wa.length?ta=O.get("nameTooLongPrompt","\u540d\u79f0\u4e0d\u53ef\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"):0<wa.indexOf(" ")?ta=O.get("nameWithSpace","\u540d\u79f0\u4e0d\u80fd\u643a\u5e26\u7a7a\u683c\u3002"):/^[\u4E00-\u9FA5A-Za-z0-9_]+$/.test(wa)?Ea&&""!=$.trim(Ea)?0!=Ea.trim().toLowerCase().indexOf("select")?
ta=O.get("onlyAllowSelection","\u53ea\u5141\u8bb8\u67e5\u8be2\u64cd\u4f5c\u3002"):-1==Ea.indexOf("from")&&-1==Ea.indexOf("FROM")&&(ta=O.get("sqlError","sql\u6267\u884c\u51fa\u9519\uff0c\u8bf7\u68c0\u67e5sql\u8bed\u53e5\u3002")):ta=O.get("noQuery","\u8bf7\u8f93\u5165\u67e5\u8be2\u8bed\u53e5\u3002"):ta=O.get("invalidName","\u540d\u79f0\u53ea\u80fd\u4f7f\u7528\u4e2d\u6587\u3001\u6570\u5b57\u3001\u5b57\u6bcd\u6216\u4e0b\u5212\u7ebf\u3002");0<ta.length?k.getMessageCurtain().showPrompt(ta):(ta=K.getText().trim(),
x?(wa=ka.getTableName(),ta=Ba(ta,wa)):ta=Ba(ta,void 0),ta?k.getMessageCurtain().showPrompt(O.get("duplicateNameTips","\u540d\u79f0\u91cd\u590d\u3002")):Z&&Z(S,sa,x))});ia=new y(O.get("cancel","\u53d6\u6d88"));ia.setHighlight(!1);xa=ia.getJqUi();xa.addClass("sa-ctrl-dialog-footer-cancel");xa.appendTo(L);ia.addActionListener(function(ta){k.destroy();return!0})});k.setClosingAction(function(L){})})();this.setModel=function(sa){J=sa;x&&(ka=sa.clone())};this.getModel=function(){return J};this.setSource=
function(sa){na=sa};this.addConfirmListener=function(sa){pa.push(sa)};this.setTableNameChecker=function(sa){Ba=sa};this.setPermAndConnChecker=function(sa){Z=sa}}function ya(){function t(ra){KTDefaultCellRender.call(this,ra);var Fa=this,Ia=this.paintCellUI;this.paintCellUI=function(Ha,Ga){var Pa=Fa.getCurrentRowIdx(),Da=Fa.getCurrentRow(),Na=Fa.getCurrentColIdx();Da=Da.getUserObject();var La=new c;La.setFormatString("yyyy-MM-dd HH:mm:ss");Fa.setPaddingHV(8,1);if(Pa<a.getHeadRowCount()){if(Ia(Ha,Ga),
0===Na&&1===Pa){if(!L)return;Da=Aa&&Aa.isChecked();Aa=new b;Aa.setChecked(Da);Aa.addCheckedListener(function(la,ua){if(ua){ua=Object.keys(Ba);for(var va=0;va<ua.length;va++)Ba[ua[va]].setChecked(la.isChecked())}});Da=Aa.getJqUi();ja.layoutCtrl(Da,12,0,14,18);Da.appendTo(Ha)}}else if(0===Na)Da=L?Va(Da):Wa(Da),ja.layoutCtrl(Da,12,4,14,18),Da.appendTo(Ha);else if(1===Na){La=$("<div class='modeler-designer-addsource-name-info'>");Pa=$("<span class='modeler-designer-addsource-cell-item-name'>");Na=Da.getSourceName();
var Oa=Da.getErrorMessage(),Sa=Qa(Da);Oa&&(Oa=T.createExceptionIcon(Oa),ja.layoutCtrlWithLRTB(Oa,5,null,16,8,null,16),Oa.appendTo(La),Sa.css("margin-left","23px"));Sa.appendTo(La);Na||(Na=Da.getSourceType(),Na=T.createSourceNameByType(Na),Da.setSourceName(Na));S&&""!=$.trim(za.getText())?ab(Pa,Na,$.trim(za.getText())):Pa.text(Na);Pa.attr("title",Na);Pa.appendTo(La);La.appendTo(Ha)}else 2===Na?(La=$("<div class='modeler-designer-addsource-cell-item'>"),Na=T.translateSourceType(Da.getSourceType()),
S&&""!=$.trim(za.getText())?ab(La,Na,za.getText()):La.text(Na),La.attr("title",Na),La.appendTo(Ha)):3===Na?(La=$("<div class='modeler-designer-addsource-cell-item'>"),Da=Da.getCreatorName(),S&&""!=$.trim(za.getText())?ab(La,Da,za.getText()):La.text(Da),La.attr("title",Da),La.appendTo(Ha)):4===Na&&(Pa=$("<div class='modeler-designer-addsource-cell-item'>"),Da=Da.getCreateTime(),Da=La.format(Da),Pa.text(Da),Pa.attr("title",Da),Pa.appendTo(Ha));Ia(Ha,Ga)};var Qa=function(Ha){var Ga=$("<span>");Ga.addClass("modeler-designer-addsource-source-icon");
switch(Ha.getSourceType()){case ba.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:Ha="entity-source-icon";break;case ba.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:Ha="datacenter-source-icon";break;case ba.SOURCE_TYPE_MODEL_SET_SOURCE:Ha="modelset-source-icon";break;case ba.SOURCE_TYPE_OPEN_API_SOURCE:Ha="openapi-source-icon";break;default:if(Ha.getSpecificType())Ha=Ha.getSpecificType().toLowerCase();else throw Error("unknown type");}aa.background(Ga,Ha);return Ga},Va=function(Ha){var Ga=Ha.getErrorMessage(),Pa=Ha.getId(),
Da=new b,Na=!1,La=Da.getJqUi(),Oa=!1;if(0<sa.length)for(var Sa=sa.length-1;0<=Sa;Sa--)if(Pa===sa[Sa].getSourceId()){Oa=Na=!0;break}if(!Oa&&Ga)return Da.setEnabled(!1),Da.setChecked(Na),La;Ga=Object.keys(Ba);for(Oa=0;Oa<Ga.length;Oa++)if(Pa===Ga[Oa]){Na=Ba[Ga[Oa]].isChecked();break}Ba[Pa]=Da;Da.setChecked(Na);Da.setUserObject(Ha);Da.addCheckedListener(function(la){la=la.isChecked();var ua=Object.keys(Ba);if(la)for(var va=0;va<ua.length;va++)if(!Ba[ua[va]].isChecked())return;Aa.setChecked(la)});return La},
Wa=function(Ha){var Ga=new l,Pa=!1,Da=Ga.getJqUi();if(Ha.getErrorMessage())Ga.setEnabled(!1),Da.children().eq(0).css("background-color","#ddd");else{for(var Na=Ha.getId(),La=Object.keys(Ba),Oa=0;Oa<La.length;Oa++)Na===La[Oa]&&(Pa=Ba[La[Oa]].isChecked());Ba[Na]=Ga;Ga.addCheckedListener(function(Sa,la){if(la&&Sa.isChecked())for(Sa=0;Sa<La.length;Sa++)Na!=La[Sa]&&Ba[La[Sa]].setChecked(!1)})}Ga.setChecked(Pa);Ga.setUserObject(Ha);return Da}}var x,g,w,k,K,W,J,ka,na,pa,za,Aa,Ba={},Z=[],sa,S=!1,L,ia=!1;
this.setMultiSelect=function(ra){L=ra};this.setContainer=function(ra){ka=ra};this.setArrExistsSource=function(ra){sa=ra};this.getJqUi=function(){x||cb();return x};this.setRemoteImpl=function(ra){na=ra};this.getTable=function(){return pa};this.getSelected=function(){for(var ra=Object.keys(Ba),Fa=[],Ia=0;Ia<ra.length;Ia++){var Qa=Ba[ra[Ia]];if(Qa.isChecked()&&(Fa.push(Qa.getUserObject()),!L))break}return Fa};this.updateUiByObserver=function(){ia&&(0===Z.length?Xa():Ka(Z))};this.rePaintSource=function(ra){ra?
xa(ra):(Ka(Z),L&&bb())};var xa=function(ra){if(0==ra.length)Ba={},Z=[],k&&k.css("right","15px"),W&&(W.hide(),za.clear()),x&&x.remove(),Xa();else{w&&w.hide();W&&W.show();za&&za.clear();k&&k.css("right","205px");Z=[];Ba={};for(var Fa=0;Fa<ra.length;Fa++){var Ia=new n;Ia.fromJsonObject(ra[Fa]);Z.push(Ia)}Ka(Z);L&&bb()}},ta=function(){k=$("<div>");k.attr("title",O.get("refresh","\u5237\u65b0"));aa.backgroundWithHover(k,"refresh");k.addClass("modeler-designer-addsource-btn-refresh");k.on("click",wa);k.appendTo(ka)},
wa=function(){(new (M.ModelSetSourceIntegration.getModelSetSourceFacade())(na,function(ra){xa(ra)})).designerLoadSources()},Ea=function(){W=$("<div>");W.css("display","flex");var ra=$("<div class = 'modeler-designer-addsource-modelset-source-link'>");ra.text(O.get("modelSetSourceManage","\u6570\u636e\u6e90\u7ba1\u7406"));ra.attr("title",O.get("modelSetSourceManage","\u6570\u636e\u6e90\u7ba1\u7406"));ra.on("click",function(){Q&&Q.occur(Q.BUTTON_TYPE,Q.SOURCE_MANAGE);M.ModelSetSourceIntegration.getDataSourceManageEntrance()()});
ra.appendTo(W);ra=new d;ra.setIconType(d.ICON_TYPE_QUESTION);ra.setTipsSize(380,54);var Fa=ra.getJqUi();Fa.css("position","relative");var Ia="<span>"+O.get("sourceHelpTip","\u4ee5\u4e0b\u6570\u636e\u6e90\u662f\u5728\u5f53\u524d\u6a21\u578b\u96c6\u7684\u201c\u6570\u636e\u6e90\u7ba1\u7406\u201d\u4e2d\u5b9a\u4e49\u7684\u8fde\u63a5\u4fe1\u606f\uff0c\u5982\u679c\u9700\u8981\u5176\u4ed6\u7684\u6570\u636e\u6e90\uff0c\u8bf7\u5728\u201c\u6570\u636e\u6e90\u7ba1\u7406\u201d\u6dfb\u52a0\u3002")+"</span>";ra.setTipsHtml(Ia);
Fa.appendTo(W);Ua();W.appendTo(ka)},Ja=function(ra){if(""===ra)S&&(S=!1,Ka(Z));else{S=!0;ra=ra.toLowerCase();for(var Fa=[],Ia=0;Ia<Z.length;Ia++){var Qa=Z[Ia],Va=Qa.getSourceName(),Wa=Qa.getSourceType(),Ha=T.translateSourceType(Wa),Ga=Qa.getCreatorName();Va||(Va=T.createSourceNameByType(Wa));-1==Va.toLowerCase().indexOf(ra)&&-1==Ha.toLowerCase().indexOf(ra)&&-1==Ga.toLowerCase().indexOf(ra)||Fa.push(Qa)}Ka(Fa)}},Ka=function(ra){g&&g.remove();cb();if(ra&&0<ra.length){for(var Fa=0;Fa<ra.length;Fa++)Ra(ra[Fa]);
K&&K.hide()}else K?K.show():(K=$("<div>"),K.addClass("modeler-designer-addsource-noresult-view-container"),ra=$("<div>"),ra.addClass("modeler-designer-addsource-noresult-view-icon"),aa.background(ra,"search-no-result"),ra.appendTo(K),ra=$("<div>"),ra.addClass("modeler-designer-addsource-noresult-view-tip"),ra.text(O.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),ra.appendTo(K),K.appendTo(ka));x.appendTo(ka);a.refresh(pa)},Ua=function(){J||(za=new z,za.setShowSearchIcon(!0),
za.setPlaceholder(O.get("searchContent","\u8bf7\u8f93\u5165\u540d\u79f0/\u7c7b\u578b/\u521b\u5efa\u4eba")),za.setSearchListenerDelay(1E3),za.addSearchListener(function(){Ja($.trim(za.getText()))}),J=za.getJqUi(),J.find(":input").on("keydown",function(ra){13==(ra.keyCode||ra.which||ra.charCode)&&Ja($.trim(za.getText()))}),J.addClass("modeler-designer-addsource-search-box"));J.appendTo(W)},Ra=function(ra){if(ra){var Fa=a.createRow(pa,!1),Ia=new KTBorderStyle;Ia.setBottomBorderWidth(1);Ia.setBottomBorderPen("solid");
Ia.setBottomBorderColor("#e5e5e5");Fa.setBorder(Ia);Fa.setUserObject(ra)}},Xa=function(){if(w)w.show();else{w=$("<div>");w.addClass("modeler-designer-addsource-nodata-view-container");var ra=$("<div>");ra.addClass("modeler-designer-addsource-nodata-view-icon");aa.background(ra,"no_data_cloud");ra.appendTo(w);ra=$("<div>");ra.addClass("modeler-designer-addsource-nodata-view-tip");ra.text(O.get("pleaseCreateSource","\u8bf7\u5148\u5728\u201c\u6570\u636e\u6e90\u7ba1\u7406\u201d\u4e2d\u521b\u5efa\u6570\u636e\u6e90\u8fde\u63a5\u4fe1\u606f"));
ra.appendTo(w);ra=$("<a>");ra.addClass("modeler-designer-addsource-nodata-view-text");ra.text(O.get("modelSetSourceManage","\u6570\u636e\u6e90\u7ba1\u7406"));ra.attr("title",O.get("modelSetSourceManage","\u6570\u636e\u6e90\u7ba1\u7406"));ra.on("click",function(){M.ModelSetSourceIntegration.getDataSourceManageEntrance()()});ra.appendTo(w);w.appendTo(ka);k||ta();k.css("right","15px")}},bb=function(){for(var ra=Object.keys(Ba),Fa=0;Fa<ra.length;Fa++)if(!Ba[ra[Fa]].isChecked()){Aa.setChecked(!1);return}Aa.setChecked(!0)};
this.loadDataSource=function(){(new (M.ModelSetSourceIntegration.getModelSetSourceFacade())(na,function(ra){ia||(ia=!0);if(0===ra.length)Xa();else{cb();for(var Fa=0;Fa<ra.length;Fa++){var Ia=new n;Ia.fromJsonObject(ra[Fa]);Z.push(Ia);Ra(Ia)}a.refresh(pa);L&&bb()}})).designerLoadSources()};var cb=function(){x=$("<div class='modeler-designer-addsource-list-table'>");pa=a.createTable();pa.setColumnFitVisibleWidth(!0);pa.addColumns(5);pa.getColumn(0).setWidth(40);pa.getColumn(1).setWidth(190);pa.getColumn(2).setWidth(190);
pa.getColumn(3).setWidth(95);pa.getColumn(4).setWidth(215);pa.setScrollerVisible("hidden");var ra=a.createHeadRow(pa);ra.getCell(1).setValue(O.get("name","\u540d\u79f0"));ra.getCell(2).setValue(O.get("type","\u7c7b\u578b"));ra.getCell(3).setValue(O.get("creator","\u521b\u5efa\u4eba"));ra.getCell(4).setValue(O.get("createTime","\u521b\u5efa\u65f6\u95f4"));ra=new t(pa);ra.setOutsideVisible(!1);pa.setCellRender(ra);pa.setSyncUIWhenModelChanged(!0);g=$(pa.getUI());g.appendTo(x);x.appendTo(ka);W||Ea();
k||ta();k.css("right","255px")},ab=function(ra,Fa,Ia){if(ra&&Fa&&Ia){Ia=Ia.toUpperCase();for(var Qa=Fa.toUpperCase(),Va=Qa.split(Ia),Wa=Ia.length,Ha=0;Ha<Va.length;Ha++){var Ga=Qa.indexOf(Va[Ha]),Pa=Fa.substr(0,Va[Ha].length);Ga+=Va[Ha].length;var Da=Qa.length-Ga;Qa=Qa.substr(Ga,Da);Fa=Fa.substr(Ga,Da);Ga=$("<span>");Ga.text(Pa);Ga.appendTo(ra);Ha!=Va.length-1&&1<Va.length&&(Ga=Qa.indexOf(Ia),Pa=Fa.substr(Ga,Wa),Ga+=Wa,Da=Qa.length-Ga,Qa=Qa.substr(Ga,Da),Fa=Fa.substr(Ga,Da),Ga=$("<span>"),Ga.text(Pa),
Ga.css("color","red"),Ga.clone().appendTo(ra))}}}}function ea(t){var x,g,w,k=!1,K=[],W,J,ka,na=[];this.getJqUi=function(){w||(x=new e,x.setRootVisible(!1),x.setNodePainter(za),g=sa(t),x.setRoot(g),g.setExpanded(!0),g.setSelectable(!1),x.setLineHeight(30),w=x.getJqUi(),ja.layoutCtrl(w,0,1,"100%",118),x.addSelectingListener(pa),w.css({top:"31px",background:"white",height:"auto",width:"100%",bottom:"30px",overflow:"hidden auto"}));return w};var pa=function(L,ia){L=x.searchUiByModel(ia);L.attr("id","modeler-designer-tablearea-table-selected");
L.siblings().removeAttr("id")};this.scrollNodeToVisibleByName=function(L){for(var ia,xa=0;xa<na.length;xa++)na[xa].getUserObject().getName()==L&&(ia=na[xa]);if(L=x.searchUiByModel(ia))L.attr("id","modeler-designer-tablearea-table-selected"),L.siblings().removeAttr("id"),document.querySelector(".sa-ctrl-tree").scrollTop=L.prop("offsetTop")};this.updateExceptionNodeUi=function(L,ia){for(var xa=w.children(),ta,wa,Ea=0;Ea<xa.length;Ea++){var Ja=xa.eq(Ea),Ka=Ja.data("model"),Ua=Ka.getUserObject();if(Ka.isLeafNode()&&
Ua.getCommentInfo()==L){ta=Ja;wa=Ua;break}}if(ta){L=ta.children().eq(0);xa=L.children(".modeler-designer-tablearea-table-exception-icon");ta=0;0<xa.length&&xa.remove();if(ia=T.getModelExceptionTips(ia))ta+=20,L.css("margin-left","20px"),xa=T.createExceptionIcon(ia),xa.addClass("modeler-designer-tablearea-table-exception-icon"),xa.appendTo(L);wa.setErrorMessage(ia);L.css("margin-left",ta+"px")}};var za=function(L,ia){var xa=function(Ka){var Ua=$("<div>");ja.layoutCtrlWithLRTB(Ua,"",0,50,0,0,16);var Ra=
$("<div class='modeler-designer-tablearea-table-name-edit'>");aa.backgroundWithHover(Ra,"edit");Ra.on("click",function(){J&&J(ia.getUserObject())});var Xa=$("<div class='modeler-designer-tablearea-table-name-delete'>");aa.backgroundWithHover(Xa,"delete");Xa.on("click",function(){ka&&ka(ia.getUserObject(),Xa)});wa.getErrorMessage()&&(Ra.css("right","72px"),Xa.css("right","34px"));Ra.appendTo(Ua);Xa.appendTo(Ua);Ua.appendTo(Ka);Ua.hide();Ka.on("mouseenter",function(){Ua.show();wa.getErrorMessage()?
Ea.css("right","90px"):Ea.css("right","70px")});Ka.on("mouseleave",function(){Ua.hide();wa.getErrorMessage()?Ea.css("right","50px"):Ea.css("right","30px")})},ta=20*ia.getLevel();L.css("padding-left","4px");L.css("padding-right","4px");L.css("width","calc(100% - "+ta+"px)");var wa=ia.getUserObject(),Ea=$("<div>");Ea.addClass("modeler-designer-tablearea-table-name");Ea.text(wa.getDisplayName());Ea.attr("title",wa.getDisplayName());Ea.appendTo(L);if(ia.isLeafNode()){ta=$("<div>");ta.addClass("modeler-designer-tablearea-table-icon");
var Ja=wa.getUserSql()?wa.getUserSql().getSqlType():"entity"==wa.getType()?"entity-sub":"table";aa.background(ta,Ja);ta.appendTo(L);L.css("overflow","");wa.getErrorMessage()&&(L.css("margin-left","20px"),ta=T.createExceptionIcon(wa.getErrorMessage()),ta.addClass("modeler-designer-tablearea-table-exception-icon"),ta.appendTo(L));wa.getUserSql()&&(xa(L),na.push(ia))}};this.doSearch=function(L){W&&W.hide();if(""===L)k&&(Z(),Ba(),x.setRoot(g),k=!1);else if(w){L=L.toLowerCase();k&&Ba();var ia=sa(t);ia.deepFirstVisiting(function(xa){var ta=
xa.getUserObject().getDisplayName();if(ta&&-1!=ta.toLowerCase().indexOf(L))for(xa=xa.getTreePath(),ta=0;ta<xa.length;ta++){var wa=xa[ta];!wa.isLeafNode()&&xa[ta+1]&&wa.setExpanded(!0);wa=wa.getUserObject();wa.setMatch(!0);K.push(wa)}},!1);Aa(ia);x.setRoot(ia);0===K.length&&(W=$("<div>"),W.text(O.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),W.addClass("modeler-designer-tablearea-noresult-tip"),W.appendTo(w));k=!0}};var Aa=function(L){if(L.isExpanded())for(var ia=
L.getAllChildren(),xa=0;xa<ia.length;xa++){var ta=ia[xa];ta.getUserObject().getMatch()?ta.isLeafNode()||Aa(ta):L.removeChild(ta)}},Ba=function(){if(0<K.length)for(var L=0;L<K.length;L++)K[L].setMatch(!1);K=[]},Z=function(){g.deepFirstVisiting(function(L){L!=g&&(L.isLeafNode()||L.setExpanded(!1))},!1)};this.setUserSqlDeleteListener=function(L){ka=L};this.setUserSqlEditListener=function(L){J=L};var sa=function(L){var ia=new e.BranchNode;ia.setUserObject(L);if((L=L.getChildren())&&0<L.length)for(var xa=
0;xa<L.length;xa++){var ta=L[xa];if(ta instanceof q){var wa=ia;ta=ta.getChildren()?sa(ta):S(ta);wa.addChild(ta)}else ia.addChild(S(ta))}return ia},S=function(L){var ia=new e.LeafNode;ia.setUserObject(L);return ia};this.setSelectedNode=function(){}}function X(t){var x,g,w,k,K,W=!1,J=[],ka=[],na;this.setUserSqlDeleteListener=function(Z){K=Z};this.setUserSqlEditListener=function(Z){k=Z};var pa=function(){var Z=W?J:t.getChildren();x.getJqUi().empty();x.setItemCount(Z.length);x.setItemUiCreator(za);x.repaint()},
za=function(Z){var sa=function(ta){var wa=$("<div>");ja.layoutCtrlWithLRTB(wa,"",0,50,0,0,16);var Ea=$("<div class='modeler-designer-tablearea-table-name-edit'>");aa.backgroundWithHover(Ea,"edit");Ea.on("click",function(){k&&k(S)});var Ja=$("<div class='modeler-designer-tablearea-table-name-delete'>");aa.backgroundWithHover(Ja,"delete");Ja.on("click",function(){K&&K(S,Ja)});S.getErrorMessage()&&(Ea.css("right","72px"),Ja.css("right","34px"));Ea.appendTo(wa);Ja.appendTo(wa);wa.appendTo(ta);wa.hide();
ta.on("mouseenter",function(){wa.show();S.getErrorMessage()?ia.css("right","90px"):ia.css("right","70px")});ta.on("mouseleave",function(){wa.hide();S.getErrorMessage()?ia.css("right","50px"):ia.css("right","30px")})},S=(W?J:t.getChildren())[Z],L=$("<div class='modeler-designer-tablearea-dbCenter-item'>");L.css("padding-left","4px");L.css("padding-right","4px");L.css("height","30px");L.css("width","calc(100% - 10px)");L.data("model",S);L.on("click",function(){Aa(L)});L.on("mouseenter",function(){L.addClass("modeler-designer-tablearea-dbCenter-table-hover")});
L.on("mouseleave",function(){L.removeClass("modeler-designer-tablearea-dbCenter-table-hover")});var ia=$("<div>");ia.addClass("modeler-designer-tablearea-dbCenter-table-name");ia.text(S.getDisplayName());ia.attr("title",S.getDisplayName());ia.appendTo(L);Z=$("<div class='modeler-designer-tablearea-dbCenter-table-icon'>");var xa=S.getUserSql()?S.getUserSql().getSqlType():"table";aa.background(Z,xa);Z.appendTo(L);L.css("overflow","");S.getErrorMessage()&&(L.css("margin-left","20px"),Z=T.createExceptionIcon(S.getErrorMessage()),
Z.addClass("modeler-designer-tablearea-dbCenter-table-exception-icon"),Z.appendTo(L));S.getUserSql()&&sa(L);return L},Aa=function(Z){for(var sa=0;sa<ka.length;sa++)ka[sa].removeClass("modeler-designer-tablearea-table-selected");ka=[Z];Z.addClass("modeler-designer-tablearea-table-selected")};this.setSelectedNode=function(Z){if(Z){Z=Z.getDisplayName();for(var sa=x.getPaintedItems(),S=0;S<sa.length;S++){var L=sa[S],ia=L.data("model");if(ia&&ia.getDisplayName()===Z){Aa(L);break}}}};var Ba=function(Z,
sa){for(var S=0;S<Z.length;S++){var L=Z[S];if(L.getDisplayName()===sa)return L}};this.updateExceptionNodeUi=function(Z,sa){sa=T.getModelExceptionTips(sa);for(var S=x.getPaintedItems(),L,ia,xa=0;xa<S.length;xa++){var ta=S[xa],wa=ta.data("model");if(wa&&wa.getDisplayName()===Z){L=ta;ia=wa;break}}L?L&&(Z=L.children(".modeler-designer-tablearea-dbCenter-table-exception-icon"),S=0,0<Z.length&&Z.remove(),sa&&(S+=20,L.css("margin-left","20px"),Z=T.createExceptionIcon(sa),Z.addClass("modeler-designer-tablearea-dbCenter-table-exception-icon"),
Z.appendTo(L)),ia.setErrorMessage(sa),L.css("margin-left",S+"px")):(L=t.getChildren(),(ia=Ba(L,Z))&&ia.setErrorMessage(sa))};this.scrollNodeToVisibleByName=function(Z){var sa=W?J:t.getChildren(),S=Ba(sa,Z);if(S)for(sa=30*sa.indexOf(S),x.repaint(sa),sa=x.getPaintedItems(),S=0;S<sa.length;S++){var L=sa[S],ia=L.data("model");if(ia&&ia.getDisplayName()===Z){Aa(L);break}}};this.setSearchClearCallBack=function(Z){na=Z};this.doSearch=function(Z){Z=$.trim(Z).toLowerCase();w&&w.hide();var sa=t.getChildren();
if(0===Z.length)W=!1,pa();else{W=!0;J=[];for(var S=0;S<sa.length;S++){var L=sa[S],ia=L.getDisplayName();ia&&-1!==ia.toLowerCase().indexOf(Z)&&J.push(L)}pa();0===J.length&&(w=$("<div>"),w.text(O.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),w.addClass("modeler-designer-tablearea-noresult-tip"),w.appendTo(g))}};this.getJqUi=function(){g||(x=new R,x.setItemHeight(30),g=x.getJqUi(),ja.layoutCtrlWithLRTB(g,0,0,"100%",0,30,null),g.addClass("modeler-designer-tablearea-dbCenter"),
na&&na(),pa());return g}}function N(){var t,x,g=M.SourceConnectStep.getExeSourceChangeCallback(),w=function(){M.SourceConnectStep.clearTableAreaSearchBox();var k=t.data("errorCode");k?g&&g(x,k):M.SourceConnectStep.checkSourceConnectivity(x,t)};this.setJqItem=function(k){t=k};this.getJqItem=function(){return t};this.setSource=function(k){x=k};this.getSource=function(){return x};this.getFunConnectSource=function(){return w};this.protectedMethod={setFunConnectSource:function(k){w=k},getFunFailCallback:function(){return g}}}
function ha(){N.call(this)}function ma(){N.call(this);var t=this;this.protectedMethod.setFunConnectSource(function(){M.SourceConnectStep.checkModelSetSourceConnect(t.getSource(),t.getJqItem());M.SourceConnectStep.clearTableAreaSearchBox()})}function B(){N.call(this);var t=this.protectedMethod,x=this;t.setFunConnectSource(function(){M.SourceConnectStep.clearTableAreaSearchBox();t.getFunFailCallback()(x.getSource(),G.SOURCE_EXCEPTION_DELETED_ERRORCODE)})}"undefined"==typeof com&&(com={});"undefined"==
typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});var M=com.kingdee.bos.qing.modeler.designer;M.SourceArea=G;M.TableArea=function(){var t,x,g,w,k,K,W,J,ka,na,pa,za,Aa,Ba,Z,sa,S,L,ia,xa,ta,wa,Ea,Ja={};this.getSearchBox=
function(){return J};this.getJqTableTree=function(){return na};this.setTableNodeCreator=function(la){Ea=la};this.setGlobal=function(la){K=la};this.setRemoteImpl=function(la){w=la};this.setDragHandler=function(la){k=la};this.updateNodeStatus=function(la,ua){ka&&ka.updateExceptionNodeUi(la,ua)};this.getJqUi=function(){if(!t){t=$("<div>");t.addClass("modeler-designer-workarea");t.addClass("modeler-designer-common-border");za=$("<div>");za.addClass("modeler-designer-workarea-title");pa=$("<span>");pa.addClass("modeler-designer-tablearea-title-text");
pa.text(O.get("table","\u8868"));za.append(pa);x=$("<div>");x.addClass("modeler-designer-workarea-container");var la=$("<div>"),ua=$("<div>");ua.text(O.get("customSQL","\u81ea\u5b9a\u4e49SQL/KSQL"));ua.attr("title",O.get("customSQL","\u81ea\u5b9a\u4e49SQL/KSQL"));var va=$("<div>");aa.backgroundWithHover(va,"add");la.append(ua);la.append(va);ja.layoutCtrlWithLRTB(la,0,0,null,null,0,25);ja.layoutCtrlWithLRTB(ua,5,null,170,5,0,18);ja.layoutCtrlWithLRTB(va,null,0,18,5,0,18);ja.makeTextOmissible(ua);la.css({"border-top":"1px solid #e5e5e5"});
va.css({cursor:"pointer"});va.on("click",Ua);wa=la;wa.hide();x.append(wa);x.appendTo(t);Fa();t.append(za)}return t};this.setSource=function(la){la&&la!=g&&(g=la);Ja[la]=void 0;Ga()};this.setExceptionSource=function(la,ua){sa=new Date;la&&la!=g&&(g=la);Ja[g]=ua;Na();na&&na.remove();L&&L.hide();Ha(la,ua)};var Ka=function(la,ua){na&&na.remove();ua?(ka=new X(la),ka.setSearchClearCallBack(function(){J&&J.clear()})):ka=new ea(la);ka.setUserSqlDeleteListener(cb);ka.setUserSqlEditListener(Xa);na=ka.getJqUi();
na.appendTo(x);La(!1)},Ua=function(){if(Ja[g])return Ra(Ja[g],!1),!0;if(Oa()&&!ia.getSelectPair())K.getMessageCurtain().showPrompt(O.get("chooseAppWarn","\u8bf7\u5148\u9009\u62e9\u4e00\u4e2a\u5e94\u7528\u3002"));else{var la=new C(w,function(va){var Ca=new m;Ca.setSourceUid(g.getId());var Ma=M.UIDHelper.getUID(M.UIDHelper.NS_TABLE);Ca.setUid(Ma);Oa()&&Ca.setNamespace(ia.getSelectPair().value);va=new oa(w,!1,va);va.setModel(Ca);va.setSource(g);va.setTableNameChecker(Ia);va.setPermAndConnChecker(bb);
va.addConfirmListener(function(Ta,$a){var Ya=K.getModelerModel(),Za=new H;Za.setValue(Ta,$a,Ya,Wa);K.getCommandManager().perform(Za);K.getMessageCurtain().showSuccess(O.get("CreateSQLSuccess","\u65b0\u5efa\u81ea\u5b9a\u4e49SQL\u6210\u529f\u3002"))});va.showDialog()},function(va){Ra(va+"",!1);return!0});if(ia&&ia.getSelectPair())var ua=ia.getSelectPair().value;la.checkKSQLSupport(g.getSourceId(),ua)}},Ra=function(la,ua){switch(la){case G.PUBLIC_SOURCE_IS_DELETED_ERRORCODE:case G.SOURCE_CONNECT_FAILED_ERRORCODE:case G.SOURCE_EXCEPTION_DELETED_ERRORCODE:case G.SOURCE_EXCEPTION_DELETED_ERRORCODE_1:ua?
K.getMessageCurtain().showPrompt(O.get("editSQLWithoutSource","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7f16\u8f91\u81ea\u5b9a\u4e49SQL/KSQL\u3002")):K.getMessageCurtain().showPrompt(O.get("createSQLWithoutSource","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u65b0\u5efa\u81ea\u5b9a\u4e49SQL/KSQL\u3002"));break;default:ua?K.getMessageCurtain().showPrompt(O.get("editWithoutPerm","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650\uff0c\u65e0\u6cd5\u7f16\u8f91\u81ea\u5b9a\u4e49SQL/KSQL\u3002")):
K.getMessageCurtain().showPrompt(O.get("createWithoutPerm","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650\uff0c\u65e0\u6cd5\u65b0\u5efa\u81ea\u5b9a\u4e49SQL/KSQL\u3002"))}},Xa=function(la){if(Ja[g]||la.getErrorMessage())return Ra(Ja[g],!0),!0;var ua=new C(w,function(Ca){var Ma=new m;Ma.setSourceUid(g.getId());Ma.setTableName(la.getName());Ma.setUserSql(la.getUserSql());Oa()&&Ma.setNamespace(la.getCommentInfo());Ma=K.getModelerModel().getSameTable(Ma).clone();Ca=new oa(w,
!0,Ca);Ca.setModel(Ma);Ca.setSource(g);Ca.setTableNameChecker(Ia);Ca.setPermAndConnChecker(bb);Ca.addConfirmListener(function(Ta,$a){var Ya=K.getModelerModel(),Za=new H;Za.setValue(Ta,$a,Ya,Wa);K.getCommandManager().perform(Za);K.getMessageCurtain().showSuccess(O.get("EditSQLSuccess","\u7f16\u8f91\u81ea\u5b9a\u4e49SQL\u6210\u529f\u3002"))});Ca.showDialog()},function(Ca){Ra(Ca+"",!0);return!0});if(ia&&ia.getSelectPair())var va=ia.getSelectPair().value;ua.checkKSQLSupport(g.getSourceId(),va)},bb=function(la,
ua,va){var Ca=O.get("createWithoutPerm","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650\uff0c\u65e0\u6cd5\u65b0\u5efa\u81ea\u5b9a\u4e49SQL/KSQL\u3002");va&&(Ca=O.get("editWithoutPerm","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650\uff0c\u65e0\u6cd5\u7f16\u8f91\u81ea\u5b9a\u4e49SQL/KSQL\u3002"));(new C(w,function(Ma){Ma?la():(ua(),K.getMessageCurtain().showPrompt(Ca))},function(){ua();K.getMessageCurtain().showPrompt(Ca);return!0})).checkUserSqlSourcePermission(g.getSourceId())},
cb=function(la,ua){var va=new A;va.setText(O.get("ConfirmDeleteSQL","\u786e\u5b9a\u5220\u9664\u8be5\u81ea\u5b9a\u4e49SQL\u5417\uff1f"));va.setConfirmedListener(function(Ca){if(Ca){Ca=new m;Ca.setSourceUid(g.getId());Ca.setTableName(la.getName());Ca.setUserSql(la.getUserSql());Oa()&&Ca.setNamespace(la.getCommentInfo());var Ma=K.getModelerModel();if(Ma.isUserSqlTableInUse(Ca))K.getMessageCurtain().showPrompt(O.get("customSQLUsedInDesign","\u8be5\u81ea\u5b9a\u4e49SQL/KSQL\u5df2\u88ab\u6570\u636e\u8868\u6a21\u578b\u4f7f\u7528\uff0c\u8bf7\u5148\u5728\u8bbe\u8ba1\u7a97\u53e3\u5220\u9664\u3002"));
else{var Ta=new F;Ta.setValue(Ca,Ma,Wa);K.getCommandManager().perform(Ta);K.getMessageCurtain().showSuccess(O.get("DeleteSQLSuccess","\u5220\u9664\u81ea\u5b9a\u4e49SQL\u6210\u529f\u3002"))}}});va.show(ua,!1)},ab=function(){L&&L.hide();W&&W.hide();Ba&&Ba.hide();na&&na.remove();La(!0);if(Z)ra(),Z.show();else{Z=$("<div>");Z.addClass("modeler-designer-tablearea-notable-view");Z.appendTo(x);var la=$("<div>");aa.background(la,"no_data_cloud");la.addClass("modeler-designer-tablearea-notable-icon");la.appendTo(Z);
xa=$("<div>");xa.addClass("modeler-designer-tablearea-notable-text");ra();xa.appendTo(Z)}},ra=function(){switch(g.getSourceType()){case ba.SOURCE_TYPE_MODEL_SET_SOURCE:xa.text(O.get("noModelTip","\u6682\u65e0\u53ef\u7528\u7684\u6a21\u578b"));break;default:xa.text(O.get("noTableTip","\u6682\u65e0\u53ef\u7528\u7684\u6570\u636e\u8868"))}},Fa=function(){W||(J=new z,J.setSearchListenerDelay(1E3),J.addSearchListener(function(){ka&&ka.doSearch($.trim(J.getText()),function(){J.clear()})}),J.setShowSearchIcon(!0),
J.setPlaceholder(O.get("searchTable","\u8bf7\u8f93\u5165\u641c\u7d22\u5185\u5bb9")),W=J.getJqUi(),W.addClass("modeler-designer-tablearea-search-box"),W.find(":input").on("keydown",function(la){13==(la.keyCode||la.which||la.charCode)&&ka&&ka.doSearch($.trim(J.getText()))}));W.appendTo(x)},Ia=function(la,ua){for(var va=Qa(),Ca=[],Ma=0;Ma<va.length;Ma++)Ca.push(va[Ma].getName());ua&&Ca.splice(Ca.indexOf(ua),1);return-1<Ca.indexOf(la)},Qa=function(){for(var la=K.getModelerModel().getUserSqlTables(g.getId()),
ua=[],va=0;va<la.length;va++){var Ca=la[va];if(!Oa()||ia.getSelectPair()&&ia.getSelectPair().value&&Ca.getNamespace()==ia.getSelectPair().value){var Ma=new E;Ma.setName(Ca.getTableName());Ma.setDisplayName(Ca.getTableName());Ma.setUserSql(Ca.getUserSql());Ma.setCommentInfo(Ca.getNamespace());ua.push(Ma)}}return ua},Va=function(la){for(var ua=Qa(),va=0;va<ua.length;va++)la.getChildren().push(ua[va])},Wa=function(la){na&&na.remove();var ua=Ja[g];if(ua)Ha(g,ua);else{0<$.trim(J.getText()).length&&J.clear();
ua=new q;var va=Oa();va?ia.getSelectPair()&&ia.getSelectPair().value&&ua.fromJsonObject(ta,ia.getSelectPair().value):ua.fromJsonObject(ta);Va(ua);Ka(ua,va);k.bindDragUi(na,Sa);va&&na.css("top","65px");la&&ka.scrollNodeToVisibleByName(la.getTableName())}},Ha=function(la,ua){for(var va=Oa(),Ca=K.getModelerModel().getAllTable(),Ma=[],Ta=0;Ta<Ca.length;Ta++)la.getId()===Ca[Ta].getSourceUid()&&Ma.push(Ca[Ta]);if(Ma&&0<Ma.length){switch(ua){case G.SOURCE_EXCEPTION_DELETED_ERRORCODE:var $a=O.get("tableNotExist",
"\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664");break;case G.PUBLIC_SOURCE_IS_DELETED_ERRORCODE:case G.PUBLIC_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case G.DATACENTER_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case G.SOURCE_CONNECT_FAILED_ERRORCODE:$a=O.get("tableCanNotUse","\u8be5\u6570\u636e\u6e90\u4e0b\u7684\u8868\u5747\u65e0\u6cd5\u4f7f\u7528")}la=new q;Ca=la.getChildren();for(Ta=0;Ta<Ma.length;Ta++){var Ya=new E;Ya.setName(Ma[Ta].getTableName());Ya.setDisplayName(Ma[Ta].getTableName());Ya.setUserSql(Ma[Ta].getUserSql());
$a&&Ya.setErrorMessage($a);Ca.push(Ya)}Ka(la,va);Aa&&Aa.remove();switch(ua){case G.PUBLIC_SOURCE_IS_DELETED_ERRORCODE:case G.PUBLIC_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case G.DATACENTER_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case G.SOURCE_CONNECT_FAILED_ERRORCODE:var Za=O.get("sourceCanNotUse","\u8be5\u6570\u636e\u6e90\u65e0\u6cd5\u4f7f\u7528\uff0c\u4ec5\u5c55\u793a\u5728\u6a21\u578b\u8bbe\u8ba1\u4e2d\u5df2\u4f7f\u7528\u7684\u8868\u3002");break;case G.CURRENT_USER_NOPERMISSION_PUBLIC_SOURCE_ERRORCODE:case G.CURRENT_USER_NOPERMISSION_DATACENTER_ERRORCODE:Za=
O.get("showUsedTable","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650\uff0c\u4ec5\u5c55\u793a\u5728\u6a21\u578b\u8bbe\u8ba1\u4e2d\u5df2\u4f7f\u7528\u7684\u8868\u3002")}Za&&(Aa=T.createExceptionIcon(Za),Aa.addClass("modeler-designer-tablearea-title-exception-icon"),Aa.appendTo(za));W&&W.show()}else switch(Aa&&Aa.remove(),ua){case G.MODELSET_SOURCE_ALL_MODEL_CANCEL_DEPLOY_ERRORCODE:case G.SOURCE_EXCEPTION_DELETED_ERRORCODE:case G.PUBLIC_SOURCE_IS_DELETED_ERRORCODE:case G.SOURCE_CONNECT_FAILED_ERRORCODE:ab();
break;case G.CURRENT_USER_NOPERMISSION_DATACENTER_ERRORCODE:case G.CURRENT_USER_NOPERMISSION_PUBLIC_SOURCE_ERRORCODE:case G.DATACENTER_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case G.PUBLIC_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:L&&L.hide(),W&&W.hide(),Z&&Z.hide(),La(!0),Ba?Ba.show():(Ba=$("<div>"),Ba.addClass("modeler-designer-tablearea-nopermission-view"),Ba.appendTo(x),ua=$("<div>"),ua.addClass("modeler-designer-tablearea-nopermission-icon"),aa.background(ua,"no-permission"),ua.appendTo(Ba),ua=$("<div>"),
ua.addClass("modeler-designer-tablearea-nopermission-text"),ua.text(O.get("noPermission","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650")),ua.appendTo(Ba))}},Ga=function(){var la=new Date;sa=la;if(Oa())na&&na.remove(),Pa();else{L&&L.hide();var ua=new C(w,function(va){if(sa===la){ta=va;var Ca=new q;Ca.fromJsonObject(va);Va(Ca);0===Ca.getChildren().length?ab():(Ka(Ca,!1),k.bindDragUi(na,Sa))}});ua.setBlockingJqUi(x);g.setModelId(M.ModelSetSourceIntegration.getModelId());ua.loadTables(g)}Na();
Aa&&Aa.remove();Ba&&Ba.hide();Z&&Z.hide();W.show()},Pa=function(){La();L?(L.show(),Da()):(ia=new (M.ModelSetSourceIntegration.getDataCenterSelector()),L=ia.getJqUi(),L.appendTo(x),S=ia.getTextField(),ia.setFunSelectedChangeListener(function(la){(new C(w,function(ua){var va=new q;va.fromJsonObject(ua,la);ta=ua;Va(va);Ka(va,!0);na.css("top","65px");k.bindDragUi(na,Sa)})).getDBCenterTables(la)}))},Da=function(){var la=ia.getSelectPair();la&&(S.setText(la.text),ia.getFunSelectedChangeListener()(la.value))},
Na=function(){switch(g.getSourceType()){case ba.SOURCE_TYPE_MODEL_SET_SOURCE:pa.text(O.get("model","\u6a21\u578b"));break;case ba.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:pa.text(O.get("entity","\u5b9e\u4f53"));break;case ba.SOURCE_TYPE_MODELSET_FILE_SOURCE:pa.text(O.get("table","\u8868"));break;default:pa.text(O.get("table","\u8868"))}},La=function(la){if(la)wa&&wa.hide(),na&&na.css("bottom","1px");else switch(g.getSourceType()){case ba.SOURCE_TYPE_MODEL_SET_SOURCE:case ba.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:case ba.SOURCE_TYPE_MODELSET_FILE_SOURCE:wa.hide();
na&&na.css("bottom","1px");break;default:wa.show(),na&&na.css("bottom","30px")}},Oa=function(){return g.getSourceType()===ba.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE},Sa=function(la){var ua=la.parent();if(ua&&ua.hasClass("sa-ctrl-tree-nodeline")){var va=ua.data("model").getUserObject();va instanceof E&&ua.addClass("modeler-designer-tablearea-table-item")}else ua&&ua.hasClass("modeler-designer-tablearea-dbCenter")?(la.addClass("modeler-designer-tablearea-table-item"),(va=la.data("model"))&&ka.setSelectedNode(va)):
la.hasClass("modeler-designer-tablearea-table-icon")||la.hasClass("modeler-designer-tablearea-table-name")?(ua=la.parents(".sa-ctrl-tree-nodeline"),va=ua.data("model").getUserObject(),va instanceof E&&ua.addClass("modeler-designer-tablearea-table-item")):la.hasClass("modeler-designer-tablearea-dbCenter-table-icon")||la.hasClass("modeler-designer-tablearea-dbCenter-table-name")?(ua=la.parents(".modeler-designer-tablearea-dbCenter-item"),(va=ua.data("model"))&&ka.setSelectedNode(va),ua.addClass("modeler-designer-tablearea-table-item")):
la.hasClass("sa-ctrl-tree-nodeline")&&(va=la.data("model").getUserObject(),va instanceof E&&la.addClass("modeler-designer-tablearea-table-item"));return ja.upwardSearchHasClass(la,na,"modeler-designer-tablearea-table-item")?(la=new m,la.setSourceUid(g.getId()),la.setTableName(va.getName()),va.getCommentInfo()&&la.setNamespace(va.getCommentInfo()),va.getName()&&la.setTableName(va.getName()),va.getDisplayName()&&la.setDisplayName(va.getDisplayName()),va.getUserSql()&&la.setUserSql(va.getUserSql()),
(va=K.getModelerModel().getSameTable(la))?la=va:(va=M.UIDHelper.getUID(M.UIDHelper.NS_TABLE),la.setUid(va)),va=Ea(la),ua=new P,ua.setTableNode(va),ua.setTable(la),ua):null}};M.SourceListPanel=ya;var ba=M.AbstractModelerSource,E=M.LeafNode,p=M.DesignTimeSource,C,q,r,P,m,U,n,fa,I,H,F,Q,ca,ja,O,h,y,u,v,l,V,z,a,c,b,e,d,f,A,D,Y,qa,R;var aa=M.Icons;(function(){var t=com.kingdee.bos.qing.framework.common;O=t.MultilanguageManager.createPackageAccessor(M);h=t.WindowResizeObserver;t=com.kingdee.bos.qing.common;
ja=t.DomUtil;c=t.DateFormater;t=com.kingdee.bos.qing.ui.component;u=t.AbstractModalDialog;y=t.Button;v=t.RadioButtonGroup;l=t.RadioButton;V=t.List;z=t.SearchBox;b=t.CheckBox;e=t.Tree;d=t.HelpIcon;f=t.MessageDialog;A=t.SimpleConfirmer;D=t.Label;Y=t.TextField;qa=t.TextArea;R=t.DynamicScroller;t=com.kingdee.bos.qing.common.ui;a=t.TableUtil;C=M.DesignerFacade;q=M.FolderNode;r=M.ModelerModel;P=M.DraggingTableNode;m=M.Table;U=M.UserSQL;n=M.ModelSetDataSource;fa=M.ActionRemoveSource;I=M.ActionAddRemoveSource;
H=M.ActionAddUserSqlTable;F=M.ActionRemoveUserSqlTable;Q=M.UserOperationReporter;ca=M.AbstractInvalidityCase})();G.CURRENT_USER_NOPERMISSION_DATACENTER_ERRORCODE="20002101";G.CURRENT_USER_NOPERMISSION_PUBLIC_SOURCE_ERRORCODE="20002102";G.PUBLIC_SOURCE_IS_DELETED_ERRORCODE="20002103";G.PUBLIC_SOURCE_CREATOR_NOPERMISSION_ERRORCODE="20002104";G.DATACENTER_SOURCE_CREATOR_NOPERMISSION_ERRORCODE="20002105";G.MODELSET_SOURCE_ALL_MODEL_CANCEL_DEPLOY_ERRORCODE="20002106";G.SOURCE_CONNECT_FAILED_ERRORCODE=
"2025008";G.SOURCE_EXCEPTION_DELETED_ERRORCODE="2025009";G.SOURCE_EXCEPTION_DELETED_ERRORCODE_1="20001004";var T=new function(){var t=this;this.translateSourceType=function(x){switch(x){case ba.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:return O.get("currentEntity","\u91d1\u8776\u4e91\u00b7\u82cd\u7a79-\u4e1a\u52a1\u5b9e\u4f53");case ba.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:return O.get("currentDataCenter","\u91d1\u8776\u4e91\u00b7\u82cd\u7a79-\u6570\u636e\u4e2d\u5fc3");case ba.SOURCE_TYPE_MODELSET_DB_SOURCE:return O.get("modelSetDBSource",
"\u6570\u636e\u5e93");case ba.SOURCE_TYPE_PUBLIC_DATA_SOURCE:return O.get("publicDBSource","\u516c\u5171\u6570\u636e\u6e90-\u6570\u636e\u5e93");case ba.SOURCE_TYPE_MODEL_SET_SOURCE:return O.get("modelSet","\u6a21\u578b\u96c6");case ba.SOURCE_TYPE_MODELSET_FILE_SOURCE:return O.get("modelSetFile","\u6587\u4ef6");case ba.SOURCE_TYPE_OPEN_API_SOURCE:return O.get("openAPI","OpenAPI")}};this.createExceptionIcon=function(x){var g=$("<div>");aa.background(g,"qingWarning");g.attr("title",x);return g};this.createSourceNameByType=
function(x){var g;x===ba.SOURCE_TYPE_CURRENT_ENTITY_SOURCE?g=O.get("businessEntity","\u4e1a\u52a1\u5b9e\u4f53"):x===ba.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE&&(g=O.get("dataCenter","\u6570\u636e\u4e2d\u5fc3"));return g};this.getSourceIconName=function(x){switch(x){case ba.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:return"entity";case ba.SOURCE_TYPE_MODEL_SET_SOURCE:return"modelSet";case ba.SOURCE_TYPE_MODELSET_FILE_SOURCE:return"file";case ba.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:return"data-center";case ba.SOURCE_TYPE_OPEN_API_SOURCE:return"openapi";
default:return"data"}};this.updateSourceItemStatus=function(x,g,w){var k=x.children(".modeler-designer-sourcearea-exception-icon"),K=x.children(".modeler-designer-sourcearea-icon"),W=x.children(".modeler-designer-sourcearea-name"),J=12,ka=34;k&&k.remove();g||(k=t.createExceptionIcon(w),k.addClass("modeler-designer-sourcearea-exception-icon"),k.appendTo(x),J+=22,ka+=22);K.css("left",J+"px");W.css("left",ka+"px")};this.updateDeletedSourceStatus=function(x){var g=t.createExceptionIcon(O.get("sourceExceptionDeleted",
"\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002"));g.addClass("modeler-designer-sourcearea-exception-icon");g.appendTo(x);g=x.children(".modeler-designer-sourcearea-icon");g.length?(g.css("left","34px"),g=x.children(".modeler-designer-sourcearea-name"),g.css("left","56px")):(g=$("<div>"),g.addClass("modeler-designer-sourcearea-name"),g.text(O.get("theSourceIsDeleted","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664")),g.css("left","34px"),g.appendTo(x))};
this.getModelExceptionTips=function(x){if(!x)return null;switch(x){case ca.TYPE_MODEL_DELETED:return O.get("modelDeleted","\u8be5\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");case ca.TYPE_MODEL_NO_DATA_PERMISSION:return O.get("modelNoPermission","\u60a8\u672a\u88ab\u6388\u6743\u4f7f\u7528\u8be5\u6a21\u578b\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");case ca.TYPE_MODEL_INCOMPLETE:return O.get("modelNoComplete","\u8be5\u6a21\u578b\u8bbe\u7f6e\u4e0d\u5b8c\u6574\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");
case ca.TYPE_MODEL_DAMAGE:return O.get("modelBad","\u8be5\u6a21\u578b\u5df2\u635f\u574f\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");case ca.TYPE_MODEL_CYCLE_REFERENCE:return O.get("modelCycleRef","\u8be5\u6a21\u578b\u4e0e\u5f53\u524d\u6a21\u578b\u5b58\u5728\u5faa\u73af\u5f15\u7528\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");case ca.TYPE_TABLE_NOT_EXISTS:return O.get("tableNotExistCantUse","\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002")}}};
M.SourceConnectStep=new function(){var t,x,g;this.setGlobal=function(k){t=k};this.setRemoteImpl=function(k){x=k};this.setSourceArea=function(k){};this.setTableArea=function(k){g=k};this.removeTableTree=function(){var k=g.getJqTableTree();k&&k.remove()};this.clearTableAreaSearchBox=function(){g.getSearchBox().clear()};this.getExeSourceChangeCallback=function(){return g.setExceptionSource};var w=function(k,K,W){var J=t.getIntegration().getMapSourcePermission();K?J&&(J[k]=null):(K={},K.errorMessage=
W,J&&(J[k]=K))};this.checkModelSetSourceConnect=function(k,K){(new C(x,function(W){var J=W?!1:!0;T.updateSourceItemStatus(K,J,W);g.setSource(k);w(k.getSourceId(),J,W)},function(W){if(20001004===W)return K.data("errorCode",G.SOURCE_EXCEPTION_DELETED_ERRORCODE),g.setExceptionSource(k,G.SOURCE_EXCEPTION_DELETED_ERRORCODE),T.updateDeletedSourceStatus(K),!0})).checkModelSetSourceConnect(k.getSourceId())};this.checkSourceConnectivity=function(k,K){(new C(x,function(W){if(W)g.setSource(k);else{var J=O.get("sourceConnectFailed",
"\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");g.setExceptionSource(k,G.SOURCE_CONNECT_FAILED_ERRORCODE)}w(k.getSourceId(),W,J);T.updateSourceItemStatus(K,W,J)},function(W,J){var ka=W.toString();if(20001004===W)K.data("errorCode",G.SOURCE_EXCEPTION_DELETED_ERRORCODE),g.setExceptionSource(k,G.SOURCE_EXCEPTION_DELETED_ERRORCODE),T.updateDeletedSourceStatus(K);else{var na="206"==ka.substr(0,3)?O.get("openAPIConnectFailed","OpenAPI\u7684\u8fde\u63a5\u4fe1\u606f\u65e0\u6548\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002"):
-1!=J.indexOf("2030900")?O.get("xmlParseFailed","xml\u6587\u4ef6\u5904\u7406\u5931\u8d25\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002"):O.get("sourceConnectFailed","\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");g.setExceptionSource(k,G.SOURCE_CONNECT_FAILED_ERRORCODE)}na&&(w(k.getSourceId(),!1,na),T.updateSourceItemStatus(K,!1,na));return!0})).checkConnection(k.getSourceId())}};M.ConnectSourceCreator=new function(){var t;this.getSourceConnector=function(x,
g){if(!t){t={};var w=new ma,k=new ha;t[ba.SOURCE_TYPE_MODEL_SET_SOURCE]=w;t[ba.SOURCE_TYPE_PUBLIC_DATA_SOURCE]=k;t[ba.SOURCE_TYPE_MODELSET_DB_SOURCE]=k;t[ba.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE]=k;t[ba.SOURCE_TYPE_CURRENT_ENTITY_SOURCE]=k;t[ba.SOURCE_TYPE_MODELSET_FILE_SOURCE]=k;t[ba.SOURCE_TYPE_OPEN_API_SOURCE]=k}w=(w=x.getSourceType())?t[w]:new B;w.setSource(x);w.setJqItem(g);return w}};M.ModelSetSourceIntegration=new function(){var t,x,g,w,k,K;this.setModelId=function(W){K=W};this.getModelId=
function(){return K};this.setDataSourceManageEntrance=function(W){t=W};this.getDataSourceManageEntrance=function(){return t};this.setRemoteImpl=function(W){x=W};this.getRemoteImpl=function(){return x};this.registerDataCenterSelectorConstructor=function(W){g=W};this.getDataCenterSelector=function(){return g};this.registerMetricDataCenterSelector=function(W){w=W};this.getMetricDataCenterSelector=function(){return w};this.setModelSetSourceFacade=function(W){k=W};this.getModelSetSourceFacade=function(){return k}}})();(function(){function G(){this.convertToRuntimeModel=function(ba,E){if(E){var p=new B,C=p.addVertex,q=new M;q.setId(E.getId());var r=E.getTableUid();r=ba.getTable(r);var P=r.getSourceUid();ba=ba.getSource(P);q.setTable(r);q.setSource(ba);q.setSelectedFields(E.getSelectedFields());C.call(p,q);p.setOutputVertexId(E.getId())}}}function da(){X.call(this);var ba=this,E=ba.protectedMethod,p;ba.setType(X.TYPE_RELATION_MODELER);this.getPage=function(){p||(p=new oa,p.addPropertyChangeCallback(E.firePropertyChangeEvt));
return p};this.protectedIsTableInUse=function(){return!1};this.getNode=function(C){if(p)return p.getNode(C)};this.getAllNodes=function(){return ba.getPage().getAllNodes()};this.getNodeSource=function(C){if(C instanceof ya&&(C=ba.getTable(C.getTableUid())))return ba.getSource(C.getSourceUid())}}function oa(){N.call(this);var ba=this.protectedMethod,E=[];this.addNode=function(C){C.addPropertyChangeCallback(p);E.push(C);p(da.KEY_ADD_NODE,C)};this.removeNode=function(C,q){var r=E.indexOf(C);C.removePropertyChangeCallback(p);
-1<r&&(E.splice(r,1),p(da.KEY_REMOVE_NODE,q))};this.getNode=function(C){for(var q=0,r=E.length;q<r;q++){var P=E[q];if(P.getId()==C)return P}};this.getAllNodes=function(){return E};var p=function(C,q){ba.firePropertyChangeEvt(C,q)}}function ya(){ha.call(this);var ba=this,E=this.protectedMethod,p,C;ba.setSize(200,150);ba.setType(ha.TYPE_TABLE);this.setTableUid=function(q){p=q};this.getTableUid=function(){return p};this.setSelectedFields=function(q,r){if(q)for(var P=0;P<q.length;P++)q[P].setFromNode(ba.getId());
C=q;r&&E.firePropertyChangeEvt(X.KEY_TABLE_NODE_SELECT_FIELD)};this.getSelectedFields=function(){return C};this.protectedToJson=function(q){q.tableId=p;if(C){for(var r=[],P=0;P<C.length;P++)r.push(C[P].toJsonObject());q.selectedFields=r}};this.protectedFromJson=function(q){p=q.tableId;if(q=q.selectedFields){for(var r=[],P=0;P<q.length;P++){var m=new ma;m.fromJsonObject(q[P]);r.push(m)}C=r}};this.clone=function(){var q=new ya;q.setId(ba.getId());q.setAlias(ba.getAlias());q.setType(ba.getType());q.setPosition(ba.getX(),
ba.getY());q.setSize(ba.getWidth(),ba.getHeight());q.setTableUid(p);q.setSelectedFields(C);return q}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==
typeof com.kingdee.bos.qing.modeler.designer.relationdesigner&&(com.kingdee.bos.qing.modeler.designer.relationdesigner={});var ea=com.kingdee.bos.qing.modeler.designer.relationdesigner;ea.RelationModeler=da;ea.RelationTableNode=ya;ea.ModelConverter=G;var X,N,ha,ma,B,M;(function(){var ba=com.kingdee.bos.qing.modeler.designer;X=ba.ModelerModel;N=ba.AbstractPage;ha=ba.Node;ma=ba.Field;M=ba.SourceVertex})();ea.ModelConverter=new G;da.KEY_NODE_CHANGE_ALIAS="relation_designer_change_alias";da.KEY_ADD_NODE=
"relation_designer_add_node";da.KEY_REMOVE_NODE="relation_designer_remove_node"})();(function(){function G(p){var C,q,r,P=new oa,m,U,n=new X,fa;this.setScaleHelper=function(F){m=F};this.setGlobal=function(F){U=F};this.changePosition=function(F,Q){C&&(F=[F,Q],F=m?m.getScaledCoordinate(F):F,P.setAttributes(C,{transform:"translate("+F[0]+","+F[1]+")"}))};this.getSvgElement=function(){if(!C){C=P.createNode("g");P.setAttributes(C,{transform:"translate("+I(p.getX())+","+I(p.getY())+")"});var F=P.createNode("rect");P.setAttributes(F,{width:I(p.getWidth()),height:I(p.getHeight()),x:0,y:0,
rx:I(2),fill:"#fafafa","stroke-width":I(1),stroke:"#999"});C.appendChild(F);F=P.createNode("rect");var Q=P.setAttributes,ca=I(p.getWidth()-2),ja=I(30),O=I(2),h=I(1),y=I(1);var u=U.getModelerModel().getNodeSource(p);u=n.getTableIconColor(u);Q.call(P,F,{width:ca,height:ja,rx:O,x:h,y:y,fill:u});Q=P.createNode("image");P.setAttributes(Q,{width:I(20),height:I(20),x:I(10),y:I(10)>>1,href:n.makeUrl("table")});q=P.createNode("text");$(q).addClass(G.NODE_NAME_UI_CLASS);P.setAttributes(q,{fill:"#fff",x:I(40),
y:I(20),"font-size":I(14)});ca=ha.getNodeDisplayName(p);ja=N.trim(ca,I(11),I(100));P.setText(q,ja);P.setTitle(C,ca);C.appendChild(F);C.appendChild(Q);C.appendChild(q);H()}return C};this.remove=function(){C&&C.remove();C=null};this.setSelected=function(F){fa=F;H()};this.isSelected=function(){return fa};var I=function(F){return m?m.getScaledSize(F):F},H=function(){if(C)if(fa){r=P.createNode("rect");var F=Math.max(1,I(1));P.setAttributes(r,{width:I(p.getWidth())+F,height:I(p.getHeight())+F,x:-(F>>1),
y:-(F>>1),rx:I(1),fill:"none","stroke-width":F,stroke:"#276ff5"});C.appendChild(r)}else r&&r.remove(),r=null}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer=
{});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.relationdesigner&&(com.kingdee.bos.qing.modeler.designer.relationdesigner={});var da=com.kingdee.bos.qing.modeler.designer.relationdesigner;da.RelationTableNodeUi=G;da.RelationModelerDisplayNameHelper=function(){ya.call(this);var p;this.protectedInit=function(q){p&&p.removePropertyChangeCallback(C);p=q;p.addPropertyChangeCallback(C)};this.protectedGetDefaultName=function(q){q=q.getTableUid();q=p.getTable(q);return q.getDisplayName()?q.getDisplayName():
q.getTableName()};var C=function(q,r){q==ea.KEY_NODE_CHANGE_ALIAS?_super.cacheDisplayName(r.getId(),r.getAlias()):q==ea.KEY_REMOVE_NODE&&(q=r.getRemovedNode(),_super.cacheDisplayName(q.getId(),void 0))}};var oa,ya,ea,X,N,ha,ma,B,M,ba,E;(function(){var p=com.kingdee.bos.qing.modeler.designer;oa=p.SvgHelper;X=p.CommonSvgIconHelper;ya=p.AbstractDisplayNameHelper;N=p.SvgTextTrimer;ha=p.DisplayNameHelper;ma=p.Meta;B=p.DesignerFacade;M=p.NodeResultCache;ba=p.ExecuteResult;E=p.DppVersionExceptionHandler;
p=da;ea=p.RelationModeler})();G.NODE_UI_CLASS="relation-designer-node";G.NODE_NAME_UI_CLASS="relation-designer-node-name";da.NodeFieldHelper=new function(){var p,C,q;this.init=function(m){p=m};this.setNodeStatusMonitor=function(m){C=m};this.setRemoteImpl=function(m){q=m};this.asynGetFields=function(m,U,n,fa,I){if(U){var H=M.getOneNodeField(U.getId());H?n(H):r(m,U,n,fa,I)}else n([])};this.getMeta=function(m,U){if(C.isInvalidNode(m.getId()))U(new ma);else{m=p.getTable(m.getTableUid());var n=p.getSource(m.getSourceUid());
(new B(q,function(fa){var I=new ma;I.fromJsonObject(fa);U(I)})).getMeta(n,m)}};var r=function(m,U,n,fa,I){m=da.ModelConverter.convertToRuntimeModel(m,U);if(P(m))n([]);else{var H=(new Date).getTime(),F=new B(q,function(Q){var ca=new ba;ca.fromJsonObject(Q);ca.getValidity()?n([]):(Q=ca.getFields(),n(Q),M.cacheOneNodeField(U.getId(),Q,H))},function(Q,ca){if(E.handle(Q))return!0;fa&&fa();return!1});I?F.setBlockingJqUi(I):F.setShowBlocking(!1);F.getFieldInfo(m)}},P=function(m){m=m.getVertexes();for(var U=
0;U<m.length;U++)if(C.isInvalidNode(m[U].getId()))return!0;return!1}}})();(function(){function G(){var n,fa,I,H,F,Q,ca,ja,O,h,y;this.getJqUi=function(){if(!n){n=$("<div>");var b=$("<div>");b.addClass("modeler-propertyarea-lineitem-title");b.appendTo(n);var e=$("<div>");e.appendTo(b);ha.layoutCtrlWithLRTB(e,5,0,null,2,2,null);e.css("border-left","3px solid #5582f3");e=$("<div>");e.text(N.get("tableProp","\u8868"));ha.layoutCtrl(e,15,null,200,null);ha.layoutCtrlMiddleAlign(e,16);e.appendTo(b);e.css({"font-weight":"bold",color:"#666"});Q=new M;Q.setEnabled(!1);V(N.get("source",
"\u6570\u636e\u6e90"),Q).appendTo(n);ca=new M;ca.setEnabled(!1);V(N.get("tableName","\u8868\u540d"),ca).appendTo(n);v();O=new da;O.setModeler(I.getModelerModel());O.setRemoteImpl(H);O.setNodeStatusMonitor(F);O.setSelectFieldCallback(c);V(N.get("field","\u5b57\u6bb5"),O).appendTo(n);l();u()}return n};this.setNode=function(b){fa=b;u()};this.setGlobal=function(b){I=b};this.setNodeStatusMonitor=function(b){F=b};this.setRemoteImpl=function(b){H=b};var u=function(){if(fa&&n){var b=I.getModelerModel(),e=
b.getNodeSource(fa).getName();Q.setText(e?e:N.get("theSourceIsDeleted","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664"));b=b.getTable(fa.getTableUid());ca.setText(b.getTableName());b=r.getNodeDisplayName(fa);ja.setText(b);O.setNode(fa)}},v=function(){ja=new M;var b=V(N.get("alias","\u522b\u540d"),ja);ja.addBlurListener(a);ja.addAcceptableListener(function(e,d){a(e)});b.appendTo(n)},l=function(){var b=(new B(N.get("relation","\u5173\u8054\u5173\u7cfb"))).getJqUi();b.addClass("modeler-propertyarea-lineitem-caption");
var e=z();e.append(b);e.appendTo(n);h=$("<div>");h.appendTo(n);h.css({position:"relative",overflow:"auto"});b=new E;e="+"+N.get("addRelation","\u65b0\u5efa\u5173\u7cfb");b.setText(e);y=b.getJqUi();b.addActionListener(function(d){d=new ya;d.setGlobal(I);d.setNode(fa);d.showDialog()});y.addClass("relation-modeler-designer-add-btn");h.append(y)},V=function(b,e){b=(new B(b)).getJqUi();b.addClass("modeler-propertyarea-lineitem-caption");e=e.getJqUi();e.addClass("modeler-propertyarea-lineitem-ctrl");var d=
z();d.append(b);d.append(e);return d},z=function(){var b=$("<div>");b.addClass("modeler-propertyarea-lineitem");return b},a=function(b){b=b.getText();var e;b=$.trim(b);var d=/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/;0==b.length?e=N.get("nameIsEmpty","\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a"):50<$.trim(b).length?e=N.get("nameTooLong","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26"):r.isDuplicate(b,fa)?e=N.get("duplicateName","\u540d\u79f0\u91cd\u590d"):b.match(d)||(e=N.get("invalidNodeName",
"\u8282\u70b9\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210"));e&&(e=N.get("modifyAbandoned","#1\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",e),I.getMessageCurtain().showPrompt(e),ja.setText(r.getNodeDisplayName(fa)))},c=function(b,e,d,f){b?O.setSelectedFieldCount(b.length):O.setSelectedFieldCount(0);f&&(f=I.getModelerModel(),e&&fa.setTableUid(e),f.getTable(e).setTableName(d));fa.setSelectedFields(b,!0)}}function da(){var n=
this,fa,I,H,F,Q,ca,ja,O=0,h,y;this.setNode=function(a){I=a;a=0;var c=I.getSelectedFields();c&&(a=c.length);n.setSelectedFieldCount(a)};this.setModeler=function(a){H=a};this.setSelectFieldCallback=function(a){ja=a};this.setNodeStatusMonitor=function(a){};this.setRemoteImpl=function(a){};this.getJqUi=function(){if(!F){F=$("<div>");F.addClass("modeler-propertyarea-tablenode-property-ui");Q=$("<div>");Q.addClass("modeler-propertyarea-tablenode-property-text");ha.layoutCtrlWithLRTB(Q,4,4,null,4,0,null);
Q.appendTo(F);var a=$("<div>");a.addClass("modeler-propertyarea-tablenode-property-icon");ma.backgroundWithHover(a,"edit");a.on("click",u);ha.layoutCtrlWithLRTB(a,null,0,16,4,0,16);a.appendTo(F);n.setSelectedFieldCount(O)}return F};this.setSelectedFieldCount=function(a){O=a;var c=N.get("selectedFields","\u5df2\u9009\u62e9#1\u4e2a\u5b57\u6bb5").replace("#1",O);0==a&&(c=N.get("selectedAllFields","\u5df2\u9009\u62e9\u6240\u6709\u5b57\u6bb5"));Q&&Q.text(c)};var u=function(){v(H,I,function(a){fa=new oa;
fa.setFunContentPaneCreator(function(){var c=$("<div>");ca=m.createSelectFieldToDialog(a.getSourceType());var b=I.getSelectedFields();if(b&&0!=b.length){for(var e=[],d=0;d<b.length;d++)e.push(b[d].getName());ca.setSelectedPropertyName(e)}b=H.getTable(I.getTableUid()).getTableName();ca.setMeta(a);ca.setCurrentTableName(b);ca.setWidth(800);ca.getJqUi().appendTo(c);return c});fa.setFunClosingChecker(l);fa.setFunConfirmClose(V);fa.showSelectFieldDialog(800,520)})},v=function(a,c,b){X.NodeFieldHelper.getMeta(c,
b)},l=function(){y=ca.getSelectedEntityName();if(ca.getIsEntityView()){if(!y)return fa.showPrompt(N.get("needSelectedEntity","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b9e\u4f53\u6216\u8005\u5206\u5f55\u8868\u3002")),!1;ca.setCurrentTableName(y)}return(h=ca.getSelectedProperties())&&0==h.length?(fa.showPrompt(N.get("noSelectedField","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b57\u6bb5\u3002")),!1):!0},V=function(a){if(a){a=H.getTable(I.getTableUid()).getTableName();var c=ca.getIsEntityView()&&
y!=a;if(c)ja(h,z(),y,ca.getIsEntityView());else{var b=I.getSelectedFields();if(b){if(c=!h||b.length!=h.length,!c){for(var e={},d=0;d<b.length;d++){var f=b[d];e[f.getFullName()]=f}for(d=0;d<h.length;d++)if(f=h[d],!e[f.getFullName()]){c=!0;break}}}else c=null!=h;c&&ja(h,I.getTableUid(),a,ca.getIsEntityView())}}},z=function(){var a=H.getTable(I.getTableUid()),c=a.getTableName();a=a.clone();if(y!=c){a.setTableName(y);c=H.getAllTable();for(var b=0;b<c.length;b++){var e=c[b];if(a.isSame(e))return e.getUid()}c=
X.UIDHelper.getUID(X.UIDHelper.NS_TABLE);a.setUid(c);I.setTableUid(c);H.addTable(a);return c}return I.getTableUid()}}function oa(){ba.call(this);var n=this,fa=this.protectedMethod,I,H,F,Q;this.setGlobal=function(ca){};this.setFunConfirmClose=function(ca){H=ca};this.setFunClosingChecker=function(ca){F=ca};this.showPrompt=function(ca){fa.getMessageCurtain().showPrompt(ca)};this.setFunContentPaneCreator=function(ca){Q=ca};this.showSelectFieldDialog=function(ca,ja){n.setSize(ca,ja);n.setPosition(window.innerWidth-
ca>>1,window.innerHeight-ja>>1);fa.setTitle(N.get("selectField","\u9009\u62e9\u5b57\u6bb5"));fa.setClosingAction(H);fa.setClosingChecker(F);Q?fa.setContentPaneCreator(Q):(I=new P,I.setShowAllCheckbox(!0),fa.setContentPaneCreator(I.getContentPaneCreator()));n.showDialog()}}function ya(){ba.call(this);var n=this.protectedMethod,fa=this,I,H,F,Q;(function(){n.setTitle(N.get("addRelation","\u65b0\u5efa\u5173\u7cfb"));fa.setSize(640,360);n.setContentPaneCreator(function(){if(!I){I=$("<div>");F=new ea;F.setModeler(H.getModelerModel());
F.setNode(Q,!0);var ca=F.getJqUi();ca.appendTo(I);ha.layoutCtrlWithLRTB(ca,0,0,null,0,0,null)}return I});n.setClosingChecker2(function(ca){return!0});n.setClosingAction(function(ca){})})();this.setGlobal=function(ca){H=ca};this.setNode=function(ca){Q=ca}}function ea(){function n(){var e,d,f;this.getJqUi=function(){if(!e){e=$("<div>");e.css({position:"relative",width:"100%",height:"25px"});d=new fa;f=new fa;var A=d.getJqUi(),D=f.getJqUi();ha.layoutCtrl(A,0,0,"40%",23);ha.layoutCtrlWithLRTB(D,null,
0,"40%",0,null,23);A.appendTo(e);D.appendTo(e)}return e};this.setLeftFields=function(A){d&&d.setFields(A)};this.setRightFields=function(A){f&&f.setFields(A)}}function fa(){var e,d=[],f,A;this.setFields=function(qa){d=qa;f&&f.setItemModel(d)};this.getJqUi=function(){e||D();return e};var D=function(){e=$("<div>");f=(new U).createChooseFieldPanel(Y);A=new q;A.setDropdownCreator(function(R,aa,T){return f.createJqPopup(R,aa,T)});A.addSelectionListener(function(R,aa){aa&&R.getSelectedModel()});A.setCustomPainter(function(R,
aa){R?(aa.text(R.getAlias()),aa.attr("title",R.getAlias())):aa.text("")});var qa=A.getJqUi();e.append(qa)},Y=function(qa,R){var aa=$("<div>");aa.addClass("modeler-designer-field-popup-list-item-icon");ma.background(aa,R.getOutputDataType());var T=$("<div>");T.addClass("modeler-designer-field-popup-list-item-text");var t=R?R.getAlias():"",x=$("<span>");x.text(t);x.attr("title",t);x.addClass("modeler-designer-field-popup-list-item-text-alias");R=R?R.getName():"";t=$("<span>");t.addClass("modeler-designer-field-popup-list-item-text-name");
t.text("("+R+")");T.append(x);T.append(t);qa.append(T);qa.append(aa)}}var I,H,F,Q,ca=new C,ja=new C,O=new p,h=new p,y=[],u,v;this.setNode=function(e,d){F=e;Q=d;b()};this.setModeler=function(e){H=e};this.getJqUi=function(){I||l();return I};this.setRelation=function(e){b()};var l=function(){I=$("<div>");ca.setCustomPainter(V);ca.addSelectedChangedListener(function(f,A,D){z(D,!0)});ja.setCustomPainter(V);ja.addSelectedChangedListener(function(f,A,D){z(D)});var e=ca.getJqUi(),d=ja.getJqUi();e.appendTo(I);
d.appendTo(I);ha.layoutCtrl(e,0,0,"40%",23);ha.layoutCtrlWithLRTB(d,null,0,"40%",0,null,23);u=$("<div>");ha.layoutCtrlWithLRTB(u,0,0,null,35,0,null);u.appendTo(I);c();a();b()},V=function(e,d,f){f&&H.getNode(f.getId())&&(e=$("<div>"),e.addClass("modeler-propertyarea-join-relation-node-icon"),ma.background(e,"TABLE"),e.appendTo(d),f=r.getNodeDisplayName(f),e=$("<div>"),e.addClass("modeler-propertyarea-join-relation-node-text"),e.text(f),e.attr("title",f),e.appendTo(d))},z=function(e,d){X.NodeFieldHelper.getMeta(e,
function(f){for(var A=0,D=y.length;A<D;A++){var Y=y[A];d?Y.setLeftFields(f):Y.setRightFields(f)}})},a=function(){var e=$("<div>"),d=N.get("keepIrrelevantRow","\u4fdd\u7559\u65e0\u6cd5\u5173\u8054\u7684\u884c");O.setText(d);h.setText(d);d=O.getJqUi();var f=h.getJqUi();ha.layoutCtrl(d,0,0,"40%",23);ha.layoutCtrlWithLRTB(f,null,0,"40%",0,null,23);e.css({position:"relative",width:"100%",height:"25px","margin-top":"10px"});e.append(d);e.append(f);e.appendTo(u)},c=function(){v=$("<div>");v.css({position:"relative",
overflow:"auto"});v.appendTo(u);var e=new n;v.append(e.getJqUi())},b=function(){F&&(Q?(ca.setEnabled(!1),ca.setSelected(F)):(ja.setEnabled(!1),ja.setSelected(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.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&
(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.relationdesigner&&(com.kingdee.bos.qing.modeler.designer.relationdesigner={});var X=com.kingdee.bos.qing.modeler.designer.relationdesigner;X.PropertyArea=function(){var n,fa,I,H,F,Q,ca,ja=!1,O;this.setHideListener=function(l){F=l};this.setNodeStatusMonitor=function(l){I&&I.removeSelectNodeListener(v);I=l;I.addSelectNodeListener(v)};this.setGlobal=function(l){Q=l};this.setRemoteImpl=function(l){H=l};
this.setModelerModel=function(l){ca&&ca.removePropertyChangeCallback(u);ca=l;ca.addPropertyChangeCallback(u)};this.show=function(l){ja!=!l&&(ja=!l)};this.getJqUi=function(){n||h();return n};this.afterResize=function(){};var h=function(){n=$("<div>");n.addClass("modeler-designer-workarea");n.addClass("modeler-designer-common-border");var l=$("<div>");l.addClass("modeler-designer-workarea-title");var V=$("<div>");V.addClass("modeler-designer-workarea-title-text");V.text(N.get("properties","\u5c5e\u6027"));
l.append(V);fa=$("<div>");fa.addClass("modeler-designer-workarea-container");V=$("<div>");ma.backgroundWithHover(V,"rightArrow");ha.layoutCtrlWithLRTB(V,null,5,16,5,null,16);V.on("click",function(){ja=!0;F&&F()});V.css("cursor","pointer");V.appendTo(l);n.append(l);n.append(fa);y()},y=function(){O=new G;O.setGlobal(Q);O.setRemoteImpl(H);O.setNodeStatusMonitor(I);var l=O.getJqUi();ha.layoutCtrlWithLRTB(l,0,0,null,0,0,null);l.appendTo(fa)},u=function(l,V){},v=function(l,V){O.setNode(V)}};var N,ha,ma,
B,M,ba,E,p,C,q,r,P,m,U;(function(){var n=com.kingdee.bos.qing.common;ha=n.DomUtil;n=com.kingdee.bos.qing.ui.component;B=n.Label;M=n.TextField;ba=n.AbstractModalDialog;E=n.WorkButton;p=n.CheckBox;C=n.ComboBox;q=n.DropdownSelector;n=com.kingdee.bos.qing.modeler.designer;ma=n.Icons;r=n.DisplayNameHelper;P=n.SelectFieldPanel;m=n.SelectFieldFactory;U=n.ChooseFieldPanelHelper;n=com.kingdee.bos.qing.framework.common;N=n.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer)})()})();(function(){"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.relationdesigner&&(com.kingdee.bos.qing.modeler.designer.relationdesigner=
{});com.kingdee.bos.qing.modeler.designer.relationdesigner.PreviewArea=function(){G.call(this);this.protectedModelerPropChangeListener=function(da,oa){};this.protectedGetRuntimeModel=function(){}};var G=com.kingdee.bos.qing.modeler.designer.AbstractPreviewArea})();(function(){function G(){var q=this,r=new ma,P,m,U,n,fa={};this.create=function(H,F){P=F;m||(m=r.createNode("svg"),F=U.getScaledSize(H.getWidth()),H=U.getScaledSize(H.getHeight()),r.setAttributes(m,{width:F,height:H}),P[0].appendChild(m))};this.setScaleHelper=function(H){U=H};this.setGlobal=function(H){n=H};this.clear=function(){m&&m.remove();m=null};this.addNodeUi=function(H){if(m){var F=new E(H);F.setScaleHelper(U);F.setGlobal(n);var Q=H.getId();I(H,F);fa[Q]=F}};this.getNodeUiMark=function(){return E.NODE_UI_CLASS};
this.changeNodePosition=function(H){var F=H.getId();(F=fa[F])&&F.changePosition(H.getX(),H.getY())};this.getNodeIdFromUi=function(H){return H.attr("id")};this.setInvalidNodeUi=function(H,F){H=H.getId();(H=fa[H])&&H.setInvalid(!0,F)};this.cleanInvalidNodeUi=function(){for(var H=Object.keys(fa),F=0,Q=H.length;F<Q;F++){var ca=fa[H[F]];ca&&ca.setInvalid(!1)}};this.addSelectedNodeUi=function(H){var F=H.getId();if(F=fa[F])F.setSelected(!0),F.remove(),I(H,F)};this.cleanSelectedUi=function(){for(var H=Object.keys(fa),
F=0,Q=H.length;F<Q;F++){var ca=fa[H[F]];ca&&ca.setSelected(!1)}};var I=function(H,F){F=F.getSvgElement();r.addClass(F,q.getNodeUiMark());H=H.getId();F.setAttribute("id",H);m.appendChild(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.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&
(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.relationdesigner&&(com.kingdee.bos.qing.modeler.designer.relationdesigner={});var da=com.kingdee.bos.qing.modeler.designer.relationdesigner;da.PageArea=function(){var q,r,P,m,U,n,fa=new C,I,H,F;this.getJqUi=function(){q||(q=$("<div>"),q.on("mousedown",y),q.addClass("modeler-designer-page"),B.init(),Q(),I=new G,I.setScaleHelper(n),I.setGlobal(r),F=$("<div>"),F.appendTo(q),oa.layoutCtrlWithLRTB(F,0,
0,null,0,0,null),U.bindDropUi(F,u,v,l,n),P&&h());return q};this.setDragHandler=function(a){U=a};this.setModelerModel=function(a){P&&P.removePropertyChangeCallback(z);P=a;P.addPropertyChangeCallback(z);ca()};this.setGlobal=function(a){r=a};this.setRemoteImpl=function(a){m=a};this.setNodeStatusMonitor=function(a){H&&(H.removeSelectNodeListener(ja),H.removeInvalidNodeChangeListener(O));H=a;H.addSelectNodeListener(ja);H.addInvalidNodeChangeListener(O)};var Q=function(){n=new X;n.addPropertyChangedListener(function(){var a=
F.width(),c=F.height();ca();var b=F.width(),e=F.height(),d=F.position();oa.layoutCtrl(F,d.left+(a-b>>1),d.top+(c-e>>1),null,null)})},ca=function(){I&&I.clear();h();for(var a=P.getAllNodes(),c=0;c<a.length;c++)I.addNodeUi(a[c]);(a=H.getSelected())&&P.getNode(a.getId())&&I.addSelectedNodeUi(a)},ja=function(a,c){I.cleanSelectedUi();c&&P.getNode(c.getId())&&I.addSelectedNodeUi(c)},O=function(a){I.cleanInvalidNodeUi();for(var c=0;c<a.length;c++){var b=a[c];I.setInvalidNodeUi(b,H.getInvalidPrompt(b))}},
h=function(){var a=P.getPage(),c=n.getScaledSize(a.getWidth()),b=n.getScaledSize(a.getHeight());oa.layoutCtrl(F,null,null,c,b);I.create(a,F)},y=function(a){var c=$(a.target);if(c=oa.upwardSearchHasClass(c,q,I.getNodeUiMark())){c=I.getNodeIdFromUi(c);var b=P.getNode(c);H.setSelected(b);c=new M;c.setTarget(b);c.setEndMoveCallback(function(e,d){var f=new p;f.setValue(b,[e,d]);r.getCommandManager().perform(f)});c.setMovableArea(F);c.setScaleHelper(n);c.setModelerModel(P);c.startDrag(a)}else c=new ba,
c.setMovableArea(q),c.setGlobal(r),c.setScaleHelper(n),c.startDrag(a,F)},u=function(){var a=[0,0];a=oa.upwardCoordinate(q[0],a,document.body);var c=[q.prop("clientWidth"),q.prop("clientHeight")];c=oa.upwardCoordinate(q[0],c,document.body);return new function(b,e,d,f){this.getLeft=function(){return b};this.getRight=function(){return e};this.getTop=function(){return d};this.getBottom=function(){return f}}(a[0],c[0],a[1],c[1])},v=function(a,c,b){var e=oa.getCurrentTargetPosition(a);e=oa.upwardCoordinate(a.target,
e,document.body);a=e[0];e=e[1];if(a<c.getLeft()||a>c.getRight()||e<c.getTop()||e>c.getBottom())return null;c=[0,0];c=oa.upwardCoordinate(F[0],c,document.body);a-=c[0];c=e-c[1];a-=parseInt(n.getScaledSize(b.getWidth())>>1);c-=parseInt(n.getScaledSize(b.getHeight())>>1);c=n.getRawCoordinate([a,c]);b.setPosition(c[0],c[1]);return new ea(F,P)},l=function(a,c){var b=a.getTableNode();a=a.getTable();var e=a.getSourceUid();e=P.getSource(e);b=new N(m,e,b,a,P);b.setGlobal(r);b.setFunFinishCallback(c);b.setAddNodeCallback(V);
b.showSelectFieldDialog(850,520)},V=function(a,c){P.addTable(c);P.getPage().addNode(a)},z=function(a,c){if(a==ha.KEY_ADD_NODE)(a=fa.adaptSize(P))||I.addNodeUi(c);else if(a==ya.KEY_NODE_CHANGE_POSITION)(a=fa.adaptSize(P))||I.changeNodePosition(c);else if(a==ya.KEY_PAGE_SIZE){ca();a=F.position();var b=n.getScaledSize(c.getLeftExtension());c=n.getScaledSize(c.getTopExtension());oa.layoutCtrl(F,a.left-b,a.top-c,null,null)}}};var oa,ya,ea,X,N,ha,ma,B,M,ba,E,p,C;(function(){var q=com.kingdee.bos.qing.common;
oa=q.DomUtil;q=com.kingdee.bos.qing.modeler.designer;ya=q.ModelerModel;ea=q.DragInsideCheckResult;X=q.PageScaleHelper;N=q.FieldSelectDialog;ma=q.SvgHelper;B=q.SvgTextTrimer;M=q.NodeDragHelper;p=q.ActionMoveNode;C=q.PageSizeHelper;ba=q.PageDragHelper;q=da;ha=q.RelationModeler;E=q.RelationTableNodeUi})()})();(function(){function G(){var U=this,n,fa,I,H,F,Q,ca,ja,O,h,y,u,v,l,V,z,a,c;this.setGlobal=function(k){H=k};this.setRemoteImpl=function(k){fa=k};this.updateModelerModel=function(){if(v){var k=H.getModelerModel();F&&F.removePropertyChangeCallback(w);F=k;F.addPropertyChangeCallback(w);k=F;var K=new r;K.init(k);com.kingdee.bos.qing.modeler.designer.DisplayNameHelper.registerImpl(K);v.setModelerModel(F);y.setModelerModel(F);V.setModelerModel(F);l.setModelerModel(F);qa()}};this.setNodeStatusMonitor=function(k){Q&&
Q.removeSelectNodeListener(A);Q=k;Q.addSelectNodeListener(A);da.NodeFieldHelper.setNodeStatusMonitor(Q)};this.getJqUi=function(){n||b();return n};this.resize=function(){ca&&ca.resize()};var b=function(){n=$("<div>");n.addClass("modeler-designer-main");I=new M;e();l=new C;l.setGlobal(H);l.setRemoteImpl(fa);l.setNodeStatusMonitor(Q);l.setHideListener(function(){f=!0;Y(!0);ja.collapseSecondHalf(!0);l.show(!1)});v=new q;v.setDragHandler(I);v.setGlobal(H);v.setNodeStatusMonitor(Q);v.setRemoteImpl(fa);
V=new N;V.setRemoteImpl(fa);V.setGlobal(H);V.setHideListener(function(){aa=!0;t(!0);g(!0);V.show(!1)});d();U.updateModelerModel()},e=function(){y=new ea;y.setGlobal(H);y.setRemoteImpl(fa);y.setSourceChangeCallback(function(k){u&&u.setSource(k)});y.setExceptionSourceChangeCallback(function(k,K){u&&u.setExceptionSource(k,K)});u=new X;u.setGlobal(H);u.setRemoteImpl(fa);u.setDragHandler(I);u.setTableNodeCreator(function(k){var K=new p,W=com.kingdee.bos.qing.modeler.designer.UIDHelper;K.setId(W.getUID(W.NS_NODE));
K.setTableUid(k.getUid());return K});y.setTableArea(u)},d=function(){O=new m;O.setHorizontalSplit(!1);O.setSplitLineWide(8);O.setResizeMode(m.RESIZE_MODE_FIRST_FIXED);O.setFirstSize(360,60,400);O.setSecondSize(-1,60,-1);O.setFirstChild(m.createChildWrapper(y.getJqUi()));O.setSecondChild(m.createChildWrapper(u.getJqUi()));h=new m;h.setHorizontalSplit(!1);h.setSplitLineWide(8);h.setResizeMode(m.RESIZE_MODE_SECOND_FIXED);h.setFirstSize(-1,120,-1);h.setSecondSize(240,210,350);h.setFirstChild(m.createChildWrapper(v.getJqUi()));
h.setSecondChild(m.createChildWrapper(V.getJqUi(),function(){V.afterResize()}));ja=new m;ja.setHorizontalSplit(!0);ja.setSplitLineWide(8);ja.setResizeMode(m.RESIZE_MODE_SECOND_FIXED);ja.setFirstSize(-1,120,-1);ja.setSecondSize(280,210,450);ja.setFirstChild(h);ja.setSecondChild(m.createChildWrapper(l.getJqUi(),function(){l.afterResize()}));ca=new m;ca.setHorizontalSplit(!0);ca.setSplitLineWide(8);ca.setResizeMode(m.RESIZE_MODE_FIRST_FIXED);ca.setFirstSize(206,100,450);ca.setSecondSize(-1,600,-1);ca.setFirstChild(O);
ca.setSecondChild(ja);n=ca.getJqUi();n.addClass("modeler-designer-main");Y(!0);ja.collapseSecondHalf(!0);l.show(!1)},f=!1,A=function(){f||D()},D=function(){Y(!1);ja.collapseSecondHalf(!1);l.show(!0)},Y=function(k){if(!z){z=$("<div>");z.addClass("modeler-designer-property-show-btn");z.on("click",D);var K=$("<div>");K.appendTo(z);ha.backgroundWithHover(K,"leftArrow");var W=$("<div>");W.text(P.get("properties","\u5c5e\u6027"));W.appendTo(z);oa.layoutCtrlCenterAlign(W,20);oa.layoutCtrlWithLRTB(W,null,
null,null,25,0,null);oa.layoutCtrlCenterAlign(K,16);oa.layoutCtrlWithLRTB(K,null,null,null,5,null,16);z.appendTo(n)}k?(z.show(),ja.setSplitLineWide(33)):(z.hide(),ja.setSplitLineWide(8))},qa=function(){if(F){var k=F.getAllSource();k=!k||0==k.length;R!=k&&(k?O.setFirstSize(360,60,-1):O.setFirstSize(360,60,400),O.collapseSecondHalf(k),R=k);var K=F.getAllNodes();K=!K||0==K.length;aa||(K?(t(!0),g(!0),V.show(!1)):T());K?(c||(c=new B,c.getJqUi().appendTo(ja.getJqUi())),c.setNoNode(K),c.setNoSource(k),c.show(),
z&&z.css("z-index",0)):(c&&c.hide(),z&&z.css("z-index",100))}},R=!1,aa=!1,T=function(){t(!1);g(!1);V.show(!0)},t=function(k){if(!a){a=$("<div>");a.on("click",T);a.addClass("modeler-designer-preview-show-btn");var K=$("<div>");K.appendTo(a);ha.backgroundWithHover(K,"upArrow");var W=$("<div>");W.text(P.get("fieldAndPreviewData","\u5b57\u6bb5/\u9884\u89c8"));W.appendTo(a);oa.layoutCtrlMiddleAlign(W,20);oa.layoutCtrlMiddleAlign(K,16);oa.layoutCtrlWithLRTB(W,5,null,120,null,null,null);oa.layoutCtrlWithLRTB(K,
null,5,16,null,null,16);a.appendTo(h.getJqUi())}k?(a.show(),h.setSplitLineWide(33)):(a.hide(),h.setSplitLineWide(8))},x=!1,g=function(k){x!=k&&(h.collapseSecondHalf(k),x=k)},w=function(k,K){if(k==ma.KEY_ADD_PREPARED_SOURCE||k==ma.KEY_REMOVE_PREPARED_SOURCE||k==ma.KEY_SET_PREPARED_SOURCE||k==E.KEY_ADD_NODE||k==E.KEY_REMOVE_NODE)console.log("update main ui"),qa()}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos=
{});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.relationdesigner&&(com.kingdee.bos.qing.modeler.designer.relationdesigner={});var da=com.kingdee.bos.qing.modeler.designer.relationdesigner;da.Designer=function(){ya.call(this);var U=this.protectedMethod,
n,fa=new ba,I,H;this.setRemoteImpl=function(Q){H=Q;I&&I.setRemoteImpl(H);da.NodeFieldHelper.setRemoteImpl(H)};this.protectedInit=function(){I=new G;I.setGlobal(U.getGlobal());I.setRemoteImpl(H);I.setNodeStatusMonitor(fa);I.getJqUi().appendTo(U.getMainUi());U.addToolbarButton(F,"btn_check",P.get("checkModeler","\u6a21\u578b\u6821\u9a8c"))};this.protectedResize=function(){I&&I.resize()};this.protectedGetModelerModel=function(){n||(n=new E,da.NodeFieldHelper.init(n));return n};this.setJsonModel=function(Q){};
this.setJsonValidity=function(Q,ca){};this.setUndoAbleJsonModel=function(Q,ca){};var F=function(){}};var oa,ya,ea,X,N,ha,ma,B,M,ba,E,p,C,q,r,P,m;(function(){var U=com.kingdee.bos.qing.modeler.designer;ya=U.AbstractDesigner;ea=U.SourceArea;X=U.TableArea;ha=U.Icons;ma=U.ModelerModel;B=U.NoNodePromptUi;M=U.DragHandler;ba=U.NodeStatusMonitor;U=com.kingdee.bos.qing.common;oa=U.DomUtil;U=com.kingdee.bos.qing.modeler.designer.relationdesigner;E=U.RelationModeler;p=U.RelationTableNode;C=U.PropertyArea;q=
U.PageArea;N=U.PreviewArea;r=U.RelationModelerDisplayNameHelper;U=com.kingdee.bos.qing.ui.component;m=U.SplitPane;U=com.kingdee.bos.qing.framework.common;P=U.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer)})()})();
//qingVersionTag: 20250415