var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(qa){var Ca=0;return function(){return Ca<qa.length?{done:!1,value:qa[Ca++]}:{done:!0}}};$jscomp.arrayIterator=function(qa){return{next:$jscomp.arrayIteratorImpl(qa)}};$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(qa,Ca,cb){if(qa==Array.prototype||qa==Object.prototype)return qa;qa[Ca]=cb.value;return qa};$jscomp.getGlobal=function(qa){qa=["object"==typeof globalThis&&globalThis,qa,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var Ca=0;Ca<qa.length;++Ca){var cb=qa[Ca];if(cb&&cb.Math==Math)return cb}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(qa,Ca){var cb=$jscomp.propertyToPolyfillSymbol[Ca];if(null==cb)return qa[Ca];cb=qa[cb];return void 0!==cb?cb:qa[Ca]};
$jscomp.polyfill=function(qa,Ca,cb,ab){Ca&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(qa,Ca,cb,ab):$jscomp.polyfillUnisolated(qa,Ca,cb,ab))};$jscomp.polyfillUnisolated=function(qa,Ca,cb,ab){cb=$jscomp.global;qa=qa.split(".");for(ab=0;ab<qa.length-1;ab++){var sb=qa[ab];if(!(sb in cb))return;cb=cb[sb]}qa=qa[qa.length-1];ab=cb[qa];Ca=Ca(ab);Ca!=ab&&null!=Ca&&$jscomp.defineProperty(cb,qa,{configurable:!0,writable:!0,value:Ca})};
$jscomp.polyfillIsolated=function(qa,Ca,cb,ab){var sb=qa.split(".");qa=1===sb.length;ab=sb[0];ab=!qa&&ab in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var vb=0;vb<sb.length-1;vb++){var Ab=sb[vb];if(!(Ab in ab))return;ab=ab[Ab]}sb=sb[sb.length-1];cb=$jscomp.IS_SYMBOL_NATIVE&&"es6"===cb?ab[sb]:null;Ca=Ca(cb);null!=Ca&&(qa?$jscomp.defineProperty($jscomp.polyfills,sb,{configurable:!0,writable:!0,value:Ca}):Ca!==cb&&(void 0===$jscomp.propertyToPolyfillSymbol[sb]&&(cb=1E9*Math.random()>>>0,
$jscomp.propertyToPolyfillSymbol[sb]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(sb):$jscomp.POLYFILL_PREFIX+cb+"$"+sb),$jscomp.defineProperty(ab,$jscomp.propertyToPolyfillSymbol[sb],{configurable:!0,writable:!0,value:Ca})))};$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(qa){if(qa)return qa;var Ca=function(vb,Ab){this.$jscomp$symbol$id_=vb;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:Ab})};Ca.prototype.toString=function(){return this.$jscomp$symbol$id_};var cb="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",ab=0,sb=function(vb){if(this instanceof sb)throw new TypeError("Symbol is not a constructor");return new Ca(cb+(vb||"")+"_"+ab++,vb)};return sb},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(qa){if(qa)return qa;qa=Symbol("Symbol.iterator");for(var Ca="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),cb=0;cb<Ca.length;cb++){var ab=$jscomp.global[Ca[cb]];"function"===typeof ab&&"function"!=typeof ab.prototype[qa]&&$jscomp.defineProperty(ab.prototype,qa,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return qa},
"es6","es3");$jscomp.iteratorPrototype=function(qa){qa={next:qa};qa[Symbol.iterator]=function(){return this};return qa};$jscomp.iteratorFromArray=function(qa,Ca){qa instanceof String&&(qa+="");var cb=0,ab=!1,sb={next:function(){if(!ab&&cb<qa.length){var vb=cb++;return{value:Ca(vb,qa[vb]),done:!1}}ab=!0;return{done:!0,value:void 0}}};sb[Symbol.iterator]=function(){return sb};return sb};
$jscomp.polyfill("Array.prototype.keys",function(qa){return qa?qa:function(){return $jscomp.iteratorFromArray(this,function(Ca){return Ca})}},"es6","es3");$jscomp.polyfill("Array.prototype.fill",function(qa){return qa?qa:function(Ca,cb,ab){var sb=this.length||0;0>cb&&(cb=Math.max(0,sb+cb));if(null==ab||ab>sb)ab=sb;ab=Number(ab);0>ab&&(ab=Math.max(0,sb+ab));for(cb=Number(cb||0);cb<ab;cb++)this[cb]=Ca;return this}},"es6","es3");$jscomp.typedArrayFill=function(qa){return qa?qa:Array.prototype.fill};
$jscomp.polyfill("Int8Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint8Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint8ClampedArray.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Int16Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Uint16Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Int32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");
$jscomp.polyfill("Uint32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Float32Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.polyfill("Float64Array.prototype.fill",$jscomp.typedArrayFill,"es6","es5");$jscomp.findInternal=function(qa,Ca,cb){qa instanceof String&&(qa=String(qa));for(var ab=qa.length,sb=0;sb<ab;sb++){var vb=qa[sb];if(Ca.call(cb,vb,sb,qa))return{i:sb,v:vb}}return{i:-1,v:void 0}};
$jscomp.polyfill("Array.prototype.find",function(qa){return qa?qa:function(Ca,cb){return $jscomp.findInternal(this,Ca,cb).v}},"es6","es3");$jscomp.polyfill("Object.is",function(qa){return qa?qa:function(Ca,cb){return Ca===cb?0!==Ca||1/Ca===1/cb:Ca!==Ca&&cb!==cb}},"es6","es3");
$jscomp.polyfill("Array.prototype.includes",function(qa){return qa?qa:function(Ca,cb){var ab=this;ab instanceof String&&(ab=String(ab));var sb=ab.length;cb=cb||0;for(0>cb&&(cb=Math.max(cb+sb,0));cb<sb;cb++){var vb=ab[cb];if(vb===Ca||Object.is(vb,Ca))return!0}return!1}},"es7","es3");
$jscomp.checkStringArgs=function(qa,Ca,cb){if(null==qa)throw new TypeError("The 'this' value for String.prototype."+cb+" must not be null or undefined");if(Ca instanceof RegExp)throw new TypeError("First argument to String.prototype."+cb+" must not be a regular expression");return qa+""};$jscomp.polyfill("String.prototype.includes",function(qa){return qa?qa:function(Ca,cb){return-1!==$jscomp.checkStringArgs(this,Ca,"includes").indexOf(Ca,cb||0)}},"es6","es3");
(function(){"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});com.kingdee.bos.qing.modeler.SpecialWordChecker=new function(){var qa="! $ & * + , - . / : < << = > @ ABORT ACCESS ACCESSED ACCOUNT ACTIVATE ADD ADMIN ADMINISTER ADMINISTRATOR ADVISE ADVISOR AFTER ALGORITHM ALIAS ALL ALLOCATE ALLOW ALL_ROWS ALTER ALWAYS ANALYZE ANCILLARY AND AND_EQUAL ANTIJOIN ANY APPEND APPLY ARCHIVE ARCHIVELOG ARRAY AS ASC ASSOCIATE AT ATTRIBUTE ATTRIBUTES AUDIT AUTHENTICATED AUTHENTICATION AUTHID AUTHORIZATION AUTO AUTOALLOCATE AUTOEXTEND AUTOMATIC AVAILABILITY BACKUP BECOME BEFORE BEGIN BEHALF BETWEEN BFILE BIGFILE BINARY_DOUBLE BINARY_DOUBLE_INFINITY BINARY_DOUBLE_NAN BINARY_FLOAT BINARY_FLOAT_INFINITY BINARY_FLOAT_NAN BINDING BITMAP BITS BLOB BLOCK BLOCKS BLOCKSIZE BLOCK_RANGE BODY BOTH BOUND BROADCAST BUFFER BUFFER_CACHE BUFFER_POOL BUILD BULK BY BYPASS_RECURSIVE_CHECK BYPASS_UJVC BYTE CACHE CACHE_CB CACHE_INSTANCES CACHE_TEMP_TABLE CALL CANCEL CARDINALITY CASCADE CASE CAST CATEGORY CERTIFICATE CFILE CHAINED CHANGE CHAR CHARACTER CHAR_CS CHECK CHECKPOINT CHILD CHOOSE CHUNK CIV_GB CLASS CLEAR CLOB CLONE CLOSE CLOSE_CACHED_OPEN_CURSORS CLUSTER CLUSTERING_FACTOR COALESCE COARSE COLLECT COLLECTIONS_GET_REFS COLUMN COLUMNS COLUMN_STATS COLUMN_VALUE COMMENT COMMIT COMMITTED COMPACT COMPATIBILITY COMPILE COMPLETE COMPOSITE_LIMIT COMPRESS COMPUTE CONFORMING CONNECT CONNECT_BY_ISCYCLE CONNECT_BY_ISLEAF CONNECT_BY_ROOT CONNECT_TIME CONSIDER CONSISTENT CONSTRAINT CONSTRAINTS CONTAINER CONTENT CONTENTS CONTEXT CONTINUE CONTROLFILE CONVERT CORRUPTION COST CPU_COSTING CPU_PER_CALL CPU_PER_SESSION CREATE CREATE_STORED_OUTLINES CROSS CUBE CUBE_GB CURRENT CURRENT_DATE CURRENT_SCHEMA CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CURSOR_SHARING_EXACT CURSOR_SPECIFIC_SEGMENT CYCLE DANGLING DATA DATABASE DATAFILE DATAFILES DATAOBJNO DATE DATE_MODE DAY DBA DBA_RECYCLEBIN DBTIMEZONE DDL DEALLOCATE DEBUG DEC DECIMAL DECLARE DECREMENT DEFAULT DEFERRABLE DEFERRED DEFINED DEFINER DEGREE DELAY DELETE DEMAND DENSE_RANK DEREF DEREF_NO_REWRITE DESC DETACHED DETERMINES DICTIONARY DIMENSION DIRECTORY DISABLE DISASSOCIATE DISCONNECT DISK DISKGROUP DISKS DISMOUNT DISTINCT DISTINGUISHED DISTRIBUTED DML DML_UPDATE DOCUMENT DOMAIN_INDEX_NO_SORT DOMAIN_INDEX_SORT DOUBLE DOWNGRADE DRIVING_SITE DROP DUMP DYNAMIC DYNAMIC_SAMPLING DYNAMIC_SAMPLING_EST_CDN EACH ELEMENT ELSE EMPTY ENABLE ENCRYPTED ENCRYPTION END ENFORCE ENFORCED ENTRY ERROR ERROR_ON_OVERLAP_TIME ESCAPE ESTIMATE EVENTS EXCEPT EXCEPTIONS EXCHANGE EXCLUDING EXCLUSIVE EXECUTE EXEMPT EXISTS EXPAND_GSET_TO_UNION EXPIRE EXPLAIN EXPLOSION EXPORT EXPR_CORR_CHECK EXTEND EXTENDS EXTENT EXTENTS EXTERNAL EXTERNALLY EXTRACT FACT FAILED FAILED_LOGIN_ATTEMPTS FAILGROUP FALSE FAST FBTSCAN FIC_CIV FIC_PIV FILE FILTER FINAL FINE FINISH FIRST FIRST_ROWS FLAGGER FLASHBACK FLOAT FLOB FLUSH FOLLOWING FOR FORCE FORCE_XML_QUERY_REWRITE FOREIGN FREELIST FREELISTS FREEPOOLS FRESH FROM FULL FUNCTION FUNCTIONS GATHER_PLAN_STATISTICS GBY_CONC_ROLLUP GENERATED GLOBAL GLOBALLY GLOBAL_NAME GLOBAL_TOPIC_ENABLED GRANT GROUP GROUPING GROUPS GROUP_BY GUARANTEE GUARANTEED GUARD HASH HASHKEYS HASH_AJ HASH_SJ HAVING HEADER HEAP HIERARCHY HIGH HINTSET_BEGIN HINTSET_END HOUR HWM_BROKERED IDENTIFIED IDENTIFIER IDENTITY IDGENERATORS IDLE_TIME IF IGNORE IGNORE_ON_CLAUSE IGNORE_OPTIM_EMBEDDED_HINTS IGNORE_WHERE_CLAUSE IMMEDIATE IMPORT IN INCLUDE_VERSION INCLUDING INCREMENT INCREMENTAL INDEX INDEXED INDEXES INDEXTYPE INDEXTYPES INDEX_ASC INDEX_COMBINE INDEX_DESC INDEX_FFS INDEX_FILTER INDEX_JOIN INDEX_ROWS INDEX_RRS INDEX_SCAN INDEX_SKIP_SCAN INDEX_SS INDEX_SS_ASC INDEX_SS_DESC INDEX_STATS INDICATOR INFINITE INFORMATIONAL INITIAL INITIALIZED INITIALLY INITRANS INLINE INNER INSERT INSTANCE INSTANCES INSTANTIABLE INSTANTLY INSTEAD INT INTEGER INTEGRITY INTERMEDIATE INTERNAL_CONVERT INTERNAL_USE INTERPRETED INTERSECT INTERVAL INTO INVALIDATE IN_MEMORY_METADATA IS ISOLATION ISOLATION_LEVEL ITERATE ITERATION_NUMBER JAVA JOB JOIN KEEP KERBEROS KEY KEYFILE KEYS KEYSIZE KEY_LENGTH KILL LAST LATERAL LAYER LDAP_REGISTRATION LDAP_REGISTRATION_ENABLED LDAP_REG_SYNC_INTERVAL LEADING LEFT LENGTH LESS LEVEL LEVELS LIBRARY LIKE LIKE2 LIKE4 LIKEC LIKE_EXPAND LIMIT LINK LIST LOB LOCAL LOCALTIME LOCALTIMESTAMP LOCAL_INDEXES LOCATION LOCATOR LOCK LOCKED LOG LOGFILE LOGGING LOGICAL LOGICAL_READS_PER_CALL LOGICAL_READS_PER_SESSION LOGOFF LOGON LONG MAIN MANAGE MANAGED MANAGEMENT MANUAL MAPPING MASTER MATCHED MATERIALIZE MATERIALIZED MAX MAXARCHLOGS MAXDATAFILES MAXEXTENTS MAXIMIZE MAXINSTANCES MAXLOGFILES MAXLOGHISTORY MAXLOGMEMBERS MAXSIZE MAXTRANS MAXVALUE MEASURES MEMBER MEMORY MERGE MERGE_AJ MERGE_CONST_ON MERGE_SJ METHOD MIGRATE MIN MINEXTENTS MINIMIZE MINIMUM MINUS MINUTE MINVALUE MIRROR MLSLABEL MODE MODEL MODEL_DONTVERIFY_UNIQUENESS MODEL_MIN_ANALYSIS MODEL_NO_ANALYSIS MODEL_PBY MODEL_PUSH_REF MODIFY MONITORING MONTH MOUNT MOVE MOVEMENT MULTISET MV_MERGE NAME NAMED NAN NATIONAL NATIVE NATURAL NAV NCHAR NCHAR_CS NCLOB NEEDED NESTED NESTED_TABLE_FAST_INSERT NESTED_TABLE_GET_REFS NESTED_TABLE_ID NESTED_TABLE_SET_REFS NESTED_TABLE_SET_SETID NETWORK NEVER NEW NEXT NLS_CALENDAR NLS_CHARACTERSET NLS_COMP NLS_CURRENCY NLS_DATE_FORMAT NLS_DATE_LANGUAGE NLS_ISO_CURRENCY NLS_LANG NLS_LANGUAGE NLS_LENGTH_SEMANTICS NLS_NCHAR_CONV_EXCP NLS_NUMERIC_CHARACTERS NLS_SORT NLS_SPECIAL_CHARS NLS_TERRITORY NL_AJ NL_SJ NO NOAPPEND NOARCHIVELOG NOAUDIT NOCACHE NOCOMPRESS NOCPU_COSTING NOCYCLE NODELAY NOFORCE NOGUARANTEE NOLOGGING NOMAPPING NOMAXVALUE NOMINIMIZE NOMINVALUE NOMONITORING NONE NOORDER NOOVERRIDE NOPARALLEL NOPARALLEL_INDEX NORELY NOREPAIR NORESETLOGS NOREVERSE NOREWRITE NORMAL NOROWDEPENDENCIES NOSEGMENT NOSORT NOSTRICT NOSWITCH NOT NOTHING NOVALIDATE NOWAIT NO_ACCESS NO_BASETABLE_MULTIMV_REWRITE NO_BUFFER NO_CPU_COSTING NO_EXPAND NO_EXPAND_GSET_TO_UNION NO_FACT NO_FILTERING NO_INDEX NO_INDEX_FFS NO_INDEX_SS NO_MERGE NO_MODEL_PUSH_REF NO_MONITORING NO_MULTIMV_REWRITE NO_ORDER_ROLLUPS NO_PARALLEL NO_PARALLEL_INDEX NO_PARTIAL_COMMIT NO_PRUNE_GSETS NO_PUSH_PRED NO_PUSH_SUBQ NO_QKN_BUFF NO_QUERY_TRANSFORMATION NO_REF_CASCADE NO_REWRITE NO_SEMIJOIN NO_SET_TO_JOIN NO_STAR_TRANSFORMATION NO_STATS_GSETS NO_SWAP_JOIN_INPUTS NO_TRIGGER NO_UNNEST NO_USE_HASH NO_USE_MERGE NO_USE_NL NO_XML_QUERY_REWRITE NULL NULLS NUMBER NUMERIC NVARCHAR2 OBJECT OBJNO OBJNO_REUSE OF OFF OFFLINE OID OIDINDEX OLD ON ONLINE ONLY OPAQUE OPAQUE_TRANSFORM OPAQUE_XCANONICAL OPCODE OPEN OPERATOR OPTIMAL OPTIMIZER_FEATURES_ENABLE OPTIMIZER_GOAL OPTION OPT_ESTIMATE OR ORA_ROWSCN ORDER ORDERED ORDERED_PREDICATES ORGANIZATION OR_EXPAND OUTER OUTLINE OUT_OF_LINE OVER OVERFLOW OVERFLOW_NOMOVE OVERLAPS OWN PACKAGE PACKAGES PARALLEL PARALLEL_INDEX PARAMETERS PARENT PARITY PARTIALLY PARTITION PARTITIONS PARTITION_HASH PARTITION_LIST PARTITION_RANGE PASSWORD PASSWORD_GRACE_TIME PASSWORD_LIFE_TIME PASSWORD_LOCK_TIME PASSWORD_REUSE_MAX PASSWORD_REUSE_TIME PASSWORD_VERIFY_FUNCTION PCTFREE PCTINCREASE PCTTHRESHOLD PCTUSED PCTVERSION PERCENT PERFORMANCE PERMANENT PFILE PHYSICAL PIV_GB PIV_SSF PLAN PLSQL_CODE_TYPE PLSQL_DEBUG PLSQL_OPTIMIZE_LEVEL PLSQL_WARNINGS POLICY POST_TRANSACTION POWER PQ_DISTRIBUTE PQ_MAP PQ_NOMAP PREBUILT PRECEDING PRECISION PREPARE PRESENT PRESERVE PRIMARY PRIOR PRIVATE PRIVATE_SGA PRIVILEGE PRIVILEGES PROCEDURE PROFILE PROGRAM PROJECT PROTECTED PROTECTION PUBLIC PURGE PUSH_PRED PUSH_SUBQ PX_GRANULE QB_NAME QUERY QUERY_BLOCK QUEUE QUEUE_CURR QUEUE_ROWP QUIESCE QUOTA RANDOM RANGE RAPIDLY RAW RBA READ READS REAL REBALANCE REBUILD RECORDS_PER_BLOCK RECOVER RECOVERABLE RECOVERY RECYCLE RECYCLEBIN REDUCED REDUNDANCY REF REFERENCE REFERENCED REFERENCES REFERENCING REFRESH REF_CASCADE_CURSOR REGEXP_LIKE REGISTER REJECT REKEY RELATIONAL RELY REMOTE_MAPPED RENAME REPAIR REPLACE REQUIRED RESET RESETLOGS RESIZE RESOLVE RESOLVER RESOURCE RESTORE_AS_INTERVALS RESTRICT RESTRICTED RESTRICT_ALL_REF_CONS RESUMABLE RESUME RETENTION RETURN RETURNING REUSE REVERSE REVOKE REWRITE REWRITE_OR_ERROR RIGHT ROLE ROLES ROLLBACK ROLLUP ROW ROWDEPENDENCIES ROWID ROWNUM ROWS ROW_LENGTH RULE RULES SAMPLE SAVEPOINT SAVE_AS_INTERVALS SB4 SCALE SCALE_ROWS SCAN SCAN_INSTANCES SCHEDULER SCHEMA SCN SCN_ASCENDING SCOPE SD_ALL SD_INHIBIT SD_SHOW SECOND SECURITY SEED SEGMENT SEG_BLOCK SEG_FILE SELECT SELECTIVITY SEMIJOIN SEMIJOIN_DRIVER SEQUENCE SEQUENCED SEQUENTIAL SERIALIZABLE SERVERERROR SESSION SESSIONS_PER_USER SESSIONTIMEZONE SESSIONTZNAME SESSION_CACHED_CURSORS SET SETS SETTINGS SET_TO_JOIN SEVERE SHARE SHARED SHARED_POOL SHRINK SHUTDOWN SIBLINGS SID SIMPLE SINGLE SINGLETASK SIZE SKIP SKIP_EXT_OPTIMIZER SKIP_UNQ_UNUSABLE_IDX SKIP_UNUSABLE_INDEXES SMALLFILE SMALLINT SNAPSHOT SOME SORT SOURCE SPACE SPECIFICATION SPFILE SPLIT SPREADSHEET SQL SQLLDR SQL_TRACE STANDBY STAR START STARTUP STAR_TRANSFORMATION STATEMENT_ID STATIC STATISTICS STOP STORAGE STORE STREAMS STRICT STRIP STRUCTURE SUBMULTISET SUBPARTITION SUBPARTITIONS SUBPARTITION_REL SUBSTITUTABLE SUCCESSFUL SUMMARY SUPPLEMENTAL SUSPEND SWAP_JOIN_INPUTS SWITCH SWITCHOVER SYNONYM SYSAUX SYSDATE SYSDBA SYSOPER SYSTEM SYSTIMESTAMP SYS_DL_CURSOR SYS_FBT_INSDEL SYS_OP_BITVEC SYS_OP_CAST SYS_OP_COL_PRESENT SYS_OP_ENFORCE_NOT_NULL $SYS_OP_MINE_VALUE SYS_OP_NOEXPAND SYS_OP_NTCIMG $SYS_PARALLEL_TXN SYS_RID_ORDER TABLE TABLES TABLESPACE TABLESPACE_NO TABLE_STATS TABNO TEMPFILE TEMPLATE TEMPORARY THAN THE THEN THREAD THROUGH TIME TIMEOUT TIMESTAMP TIMEZONE_ABBR TIMEZONE_HOUR TIMEZONE_MINUTE TIMEZONE_REGION TIME_ZONE TIV_GB TIV_SSF TO TOPLEVEL TRACE TRACING TRACKING TRAILING TRANSACTION TRANSITIONAL TREAT TRIGGER TRIGGERS TRUE TRUNCATE TRUSTED TUNING TX TYPE TYPES TZ_OFFSET UB2 UBA UID UNARCHIVED UNBOUND UNBOUNDED UNDER UNDO UNDROP UNIFORM UNION UNIQUE UNLIMITED UNLOCK UNNEST UNPACKED UNPROTECTED UNQUIESCE UNRECOVERABLE UNTIL UNUSABLE UNUSED UPDATABLE UPDATE UPDATED UPD_INDEXES UPD_JOININDEX UPGRADE UPSERT UROWID USAGE USE USER USER_DEFINED USER_RECYCLEBIN USE_ANTI USE_CONCAT USE_HASH USE_MERGE USE_NL USE_NL_WITH_INDEX USE_PRIVATE_OUTLINES USE_SEMI USE_STORED_OUTLINES USE_TTT_FOR_GSETS USE_WEAK_NAME_RESL USING VALIDATE VALIDATION VALUE VALUES VARCHAR VARCHAR2 VARRAY VARYING VECTOR_READ VECTOR_READ_TRACE VERSION VERSIONS VIEW WAIT WELLFORMED WHEN WHENEVER WHERE WHITESPACE WITH WITHIN WITHOUT WORK WRITE XID XMLATTRIBUTES XMLCOLATTVAL XMLELEMENT XMLFOREST XMLPARSE XMLSCHEMA XMLTYPE X_DYN_PRUNE YEAR ZONE [ ] ^ | ABS ABSENT ABSOLUTE ACCORDING ACTION ADA AGGREGATE ALSO ANALYSE ARE ARRAY_AGG ARRAY_MAX_CARDINALITY ASENSITIVE ASSERTION ASSIGNMENT ASYMMETRIC ATOMIC AVG BACKWARD BASE64 BEGIN_FRAME BEGIN_PARTITION BERNOULLI BIGINT BINARY BIT BIT_LENGTH BLOCKED BOM BOOLEAN BREADTH C CALLED CASCADED CATALOG CATALOG_NAME CEIL CEILING CHAIN CHARACTERISTICS CHARACTERS CHARACTER_LENGTH CHARACTER_SET_CATALOG CHARACTER_SET_NAME CHARACTER_SET_SCHEMA CHAR_LENGTH CLASS_ORIGIN COBOL COLLATE COLLATION COLLATION_CATALOG COLLATION_NAME COLLATION_SCHEMA COLUMN_NAME COMMAND_FUNCTION COMMAND_FUNCTION_CODE COMMENTS CONCURRENTLY CONDITION CONDITION_NUMBER CONFIGURATION CONFLICT CONNECTION CONNECTION_NAME CONSTRAINT_CATALOG CONSTRAINT_NAME CONSTRAINT_SCHEMA CONSTRUCTOR CONTAINS CONTROL CONVERSION COPY CORR CORRESPONDING COUNT COVAR_POP COVAR_SAMP CSV CUME_DIST CURRENT_CATALOG CURRENT_DEFAULT_TRANSFORM_GROUP CURRENT_PATH CURRENT_ROLE CURRENT_ROW CURRENT_TRANSFORM_GROUP_FOR_TYPE CURSOR_NAME DATALINK DATETIME_INTERVAL_CODE DATETIME_INTERVAL_PRECISION DB DEFAULTS DELIMITER DELIMITERS DEPENDS DEPTH DERIVED DESCRIBE DESCRIPTOR DETERMINISTIC DIAGNOSTICS DISCARD DISPATCH DLNEWCOPY DLPREVIOUSCOPY DLURLCOMPLETE DLURLCOMPLETEONLY DLURLCOMPLETEWRITE DLURLPATH DLURLPATHONLY DLURLPATHWRITE DLURLSCHEME DLURLSERVER DLVALUE DO DOMAIN DYNAMIC_FUNCTION DYNAMIC_FUNCTION_CODE ENCODING END-EXEC END_FRAME END_PARTITION ENUM EQUALS EVENT EVERY EXCEPTION EXCLUDE EXEC EXP EXPRESSION EXTENSION FAMILY FETCH FIRST_VALUE FLAG FLOOR FORTRAN FORWARD FOUND FRAME_ROW FREE FREEZE FS FUSION G GENERAL GET GO GOTO GRANTED GREATEST HANDLER HEX HOLD ILIKE IMMEDIATELY IMMUTABLE IMPLEMENTATION IMPLICIT INDENT INHERIT INHERITS INOUT INPUT INSENSITIVE INTERSECTION INVOKER ISNULL K KEY_MEMBER KEY_TYPE LABEL LAG LANGUAGE LARGE LAST_VALUE LEAD LEAKPROOF LEAST LIKE_REGEX LISTEN LN LOAD LOGGED LOWER M MAP MATCH MAX_CARDINALITY MESSAGE_LENGTH MESSAGE_OCTET_LENGTH MESSAGE_TEXT MOD MODIFIES MODULE MORE MUMPS NAMES NAMESPACE NESTING NFC NFD NFKC NFKD NIL NORMALIZE NORMALIZED NOTIFY NOTNULL NTH_VALUE NTILE NULLABLE NULLIF OCCURRENCES_REGEX OCTETS OCTET_LENGTH OFFSET OIDS OPTIONS ORDERING ORDINALITY OTHERS OUT OUTPUT OVERLAY OVERRIDING OWNED OWNER P PAD PARAMETER PARAMETER_MODE PARAMETER_NAME PARAMETER_ORDINAL_POSITION PARAMETER_SPECIFIC_CATALOG PARAMETER_SPECIFIC_NAME PARAMETER_SPECIFIC_SCHEMA PARSER PARTIAL PASCAL PASSING PASSTHROUGH PATH PERCENTILE_CONT PERCENTILE_DISC PERCENT_RANK PERIOD PERMISSION PLACING PLANS PLI PORTION POSITION POSITION_REGEX PRECEDES PREPARED PROCEDURAL QUOTE RANK REASSIGN RECHECK RECURSIVE REGR_AVGX REGR_AVGY REGR_COUNT REGR_INTERCEPT REGR_R2 EXIT PRINT PROC FILLFACTOR RAISERROR FREETEXT READTEXT BREAK FREETEXTTABLE RECONFIGURE BROWSE REPLICATION RESTORE HOLDLOCK CLUSTERED ROWCOUNT IDENTITY_INSERT ROWGUIDCOL IDENTITYCOL SAVE SESSION_USER CONTAINSTABLE SETUSER SYSTEM_USER TEXTSIZE LINENO TOP TRAN NOCHECK DBCC NONCLUSTERED TSEQUAL DENY OFFSETS UPDATETEXT OPENDATASOURCE OPENQUERY OPENROWSET DUMMY OPENXML WAITFOR WHILE ERRLVL WRITETEXT L S RK SEQ MS XXFIELDXX".split(" ");
this.isSpecialWord=function(Ca){return Ca&&0!=Ca.length?-1<qa.indexOf(Ca.trim().toUpperCase()):!0}}})();(function(){function qa(){var h=this,n;this.setType=function(e){n=e};this.getType=function(){return n};this.toJsonObject=function(){var e={};e.type=n;h.protectedToJsonObject(e);return e};this.fromJsonObject=function(e){n=e.type;h.protectedFromJsonObject(e)};this.supportIncrementalMaterialize=function(){return!1};this.protectedToJsonObject=function(e){};this.protectedFromJsonObject=function(e){}}function Ca(){function h(){var l,m,p=!1;this.setFieldFullName=function(w){l=w};this.getFieldFullName=function(){return l};
this.setNumber=function(w){m=w};this.getNumber=function(){return m};this.isManualModified=function(){return p};this.setManualModified=function(w){p=w};this.fromJsonObject=function(w){l=w.fieldFullName;m=w.number;p=1==w.manualModified};this.toJsonObject=function(){var w={};w.fieldFullName=l;w.number=m;w.manualModified=p;return w}}qa.call(this);var n=this,e,f=[],a=[],b,c=[],d=[];n.setType(qa.TYPE_TABLE_MODELER);this.getPage=function(){e||(e=new ab,e.addPropertyChangeCallback(k));return e};this.getNode=
function(l){if(e)return e.getNode(l)};this.getAllNodes=function(){if(e)return e.getAllNodes()};this.setAllNodeCoordinate=function(l){if(e)return e.setAllNodeCoordinate(l)};this.getAllNodeCoordinate=function(){if(e)return e.getAllNodeCoordinate()};this.getRelatedLine=function(l,m){if(e)return e.getRelatedLine(l,m)};this.getAllLines=function(){if(e)return e.getAllLines()};this.getPrevNode=function(l){if((l=n.getRelatedLine(l,Ca.GET_LINE_STRATEGY_IN))&&0<l.length)return n.getNode(l[0].getFromId())};
this.getNextNode=function(l){if((l=n.getRelatedLine(l,Ca.GET_LINE_STRATEGY_OUT))&&0<l.length)return n.getNode(l[0].getToId())};this.getFromToNode=function(l){if(e){var m=e.getNode(l.getFromId());l=e.getNode(l.getToId());return[m,l]}};this.insertSource=function(l,m){for(var p=!1,w=l.getSourceId(),u=0;u<f.length;u++)if(w==f[u].getSourceId()){p=!0;break}p||(f.splice(m,0,l),k(qa.KEY_ADD_PREPARED_SOURCE,[l]))};this.batchAddSource=function(l){for(var m=[],p=0;p<l.length;p++){for(var w=!1,u=l[p],x=u.getSourceId(),
F=0;F<f.length;F++)if(x==f[F].getSourceId()){w=!0;break}w||(f.push(u),m.push(u))}k(qa.KEY_ADD_PREPARED_SOURCE,m)};this.setSource=function(l){f=l;k(qa.KEY_SET_PREPARED_SOURCE,f)};this.removeSource=function(l){var m=f.indexOf(l);return-1<m?(f.splice(m,1),k(qa.KEY_REMOVE_PREPARED_SOURCE,[l]),m):-1};this.batchRemoveUserSqlTable=function(l){l=n.getUserSqlTables(l);for(var m=0;m<l.length;m++)n.removeTableIfUseless(l[m])};this.batchRemoveSource=function(l){for(var m=0;m<l.length;m++){var p=f.indexOf(l[m]);
-1<p&&f.splice(p,1)}k(qa.KEY_REMOVE_PREPARED_SOURCE,l)};this.getSource=function(l){for(var m=0,p=f.length;m<p;m++)if(f[m].getId()==l)return f[m]};this.getNodeSource=function(l){if(l instanceof vb&&(l=n.getTable(l.getTableUid())))return n.getSource(l.getSourceUid())};this.getAllSource=function(){return f};this.isSourceUsed=function(l){l=l.getId();for(var m=0,p=a.length;m<p;m++){var w=a[m];if(w.getSourceUid()==l&&g(w))return!0}return!1};this.addTable=function(l){for(var m=0,p=a.length;m<p;m++)if(a[m].isSame(l))return;
a.push(l)};this.updateTable=function(l,m){for(var p=0,w=a.length;p<w;p++)if(a[p].isSame(m)){a.splice(p,1);a.splice(p,0,l);break}g(m)&&(l=e.getNodesByTableId(m.getUid()),k(qa.KEY_UPDATE_TABLE,l))};this.batchAddTable=function(l){for(var m=0;m<l.length;m++)n.addTable(l[m])};this.removeTableIfUseless=function(l,m){l=l.getUid();for(var p=!0,w=e.getAllNodes(),u=0;u<w.length;u++){var x=w[u];if(x instanceof vb&&x.getTableUid()==l&&x!=m){p=!1;break}}if(p){m=[];for(u=0;u<a.length;u++)a[u].getUid()==l&&m.push(u);
for(u=m.length-1;0<=u;u--)a.splice(m[u],1)}return p};this.getNodeTable=function(l){if(l instanceof vb)return n.getTable(l.getTableUid())};this.getTableByNodeId=function(l){l=n.getNode(l).getTableUid();return n.getTable(l)};this.getTable=function(l){for(var m=0,p=a.length;m<p;m++)if(a[m].getUid()==l)return a[m]};this.getUserSqlTables=function(l){for(var m=[],p=0,w=a.length;p<w;p++){var u=a[p];u.isUserSql()&&u.getSourceUid()==l&&m.push(u)}return m};this.getAllUserSqlTables=function(){for(var l=[],m=
0,p=a.length;m<p;m++)a[m].isUserSql()&&l.push(a[m]);return l};this.getAllTable=function(l){for(var m=[],p=0,w=a.length;p<w;p++){var u=a[p];l?(g(u)||u.isUserSql())&&m.push(u):g(u)&&m.push(u)}return m};this.getSameTable=function(l){for(var m=0,p=a.length;m<p;m++)if(a[m].isSame(l))return a[m]};this.setMaterializedConfig=function(l){b=l};this.getMaterializedConfig=function(){return b};this.supportIncrementalMaterialize=function(){var l=n.getAllNodes();if(!l)return!1;for(var m=0,p=0;p<l.length;p++){var w=
l[p].getType();if(w===sb.TYPE_TABLE)m++;else if(w!==Z.TYPE_FIELD_SELECT&&w!==Z.TYPE_FIELD_SETTING&&w!==Z.TYPE_FILTER&&w!==Z.TYPE_CALCULATED_FIELD&&w!==Z.TYPE_CUSTOM_GROUP)return!1}return 1===m};this.addFieldNumberMap=function(l,m,p,w){for(var u,x=0;x<d.length;x++){var F=d[x];if(F.getFieldFullName()==l.getFullName()){u=F;break}}u||(u=new h,d.push(u),u.setFieldFullName(l.getFullName()));u.setNumber(m);u.setManualModified(p?!0:!1);!w&&k(Ca.KEY_CHANGE_FIELD_NUMBER,l)};this.isNumberManualModified=function(l){for(var m=
0;m<d.length;m++){var p=d[m];if(p.getFieldFullName()==l.getFullName())return p.isManualModified()}return!1};this.getFieldNumberMap=function(){for(var l={},m=0;m<d.length;m++){var p=d[m];l[p.getFieldFullName()]=p.getNumber()}return l};this.removeFieldNumber=function(l){for(var m=[],p=[],w=0;w<d.length;w++){var u=d[w],x=u.getFieldFullName().split("_");1<x.length&&x[0]==l.getId()?m.push(u):p.push(u)}d=p;return m};this.removeFieldNumberByFullName=function(l){for(var m=0;m<d.length;m++)if(d[m].getFieldFullName()===
l){d.splice(m,1);break}};this.restoreFieldNumber=function(l){for(var m=0;m<l.length;m++){for(var p=!1,w=l[m],u=0;u<d.length;u++)if(w.getFieldFullName()==d[u].getFieldFullName()){p=!0;break}p||d.push(w)}};this.addPropertyChangeCallback=function(l){c.push(l)};this.removePropertyChangeCallback=function(l){l=c.indexOf(l);-1<l&&c.splice(l,1)};this.clearPropertyChangeCallback=function(){c=[]};this.protectedToJsonObject=function(l){l.page=e.toJsonObject();for(var m=[],p=0;p<f.length;p++)m.push(f[p].toJsonObject());
l.sources=m;m=[];for(p=0;p<a.length;p++){var w=a[p];(g(w)||w.isUserSql())&&m.push(w.toJsonObject())}l.tables=m;b&&(l.materializedConfig=b.toJsonObject());m=[];for(p=0;p<d.length;p++)m.push(d[p].toJsonObject());l.fieldNumberMap=m};this.isUserSqlTableInUse=function(l){l=n.getSameTable(l);return g(l)};this.protectedFromJsonObject=function(l){var m=l.sources;if(m)for(var p=0;p<m.length;p++){var w=m[p],u=new da;u.fromJsonObject(w);f.push(u)}if(m=l.tables)for(p=0;p<m.length;p++)w=new Ga,w.fromJsonObject(m[p]),
a.push(w);if(p=l.page)e=new ab,e.fromJsonObject(p),e.addPropertyChangeCallback(k);(p=l.materializedConfig)?(b=new jb,b.fromJsonObject(p)):b=null;if(l=l.fieldNumberMap)for(p=0;p<l.length;p++)m=new h,m.fromJsonObject(l[p]),d.push(m);if(e)for(l=e.getAllNodes(),p=0;p<l.length;p++)m=l[p],m instanceof vb&&!n.getTable(m.getTableUid())&&(0<a.length?m.setTableUid(a[0].getUid()):l.splice(p,1))};var g=function(l){var m=n.getAllNodes();if(m)for(var p=0;p<m.length;p++){var w=m[p];if(w instanceof vb&&w.getTableUid()==
l.getUid())return!0}return!1},k=function(l,m){for(var p=0,w=c.length;p<w;p++)c[p](l,m)}}function cb(){function h(c,d,g,k){this.getLeftExtension=function(){return c};this.getTopExtension=function(){return d};this.getHorizonExtension=function(){return c+g};this.getVerticalExtension=function(){return d+k}}var n=this,e=1024,f=768,a=[];this.getWidth=function(){return e};this.getHeight=function(){return f};this.addPropertyChangeCallback=function(c){a.push(c)};this.setExtension=function(c,d,g,k){c=new h(c,
d,g,k);e+=c.getHorizonExtension();f+=c.getVerticalExtension();b(qa.KEY_PAGE_SIZE,c)};this.toJsonObject=function(){var c={};c.width=e;c.height=f;n.protectedToJsonObject(c);return c};this.fromJsonObject=function(c){e=c.width;f=c.height;n.protectedFromJsonObject(c)};this.protectedToJsonObject=function(c){};this.protectedFromJsonObject=function(c){};var b=function(c,d){for(var g=0,k=a.length;g<k;g++)a[g](c,d)};this.protectedMethod={firePropertyChangeEvt:b}}function ab(){cb.call(this);var h=this.protectedMethod,
n=this,e=[],f=[];this.getNode=function(c){for(var d=0,g=e.length;d<g;d++){var k=e[d];if(S.ModelConverter.treatAsSameNode(k.getId(),c))return k}};this.getAllNodes=function(){return e};this.getNodesByTableId=function(c){for(var d=[],g=0;g<e.length;g++)e[g]instanceof vb&&e[g].getTableUid()==c&&d.push(e[g]);return d};this.getAllNodeCoordinate=function(){for(var c={},d=0;d<e.length;d++){var g=e[d],k=g.getId();c[k]=[g.getX(),g.getY()]}return c};this.setAllNodeCoordinate=function(c){for(var d=Object.keys(c),
g=0;g<d.length;g++){var k=d[g],l=n.getNode(k);k=c[k];l.setPosition(k[0],k[1])}b(Ca.KEY_NODE_RELAYOUT,this)};this.addNode=function(c){c.addPropertyChangeCallback(b);e.push(c);b(Ca.KEY_ADD_NODE,c)};this.removeNode=function(c,d){var g=e.indexOf(c);c.removePropertyChangeCallback(b);-1<g&&(e.splice(g,1),b(Ca.KEY_REMOVE_NODE,d))};this.linkNode=function(c,d){n.addLine(c,d);b(Ca.KEY_LINK_NODE,d)};this.breakLink=function(c,d){for(var g=0;g<f.length;g++){var k=f[g];if(k.getFromId()==c.getId()&&k.getToId()==
d.getId()){n.removeLine(k);b(Ca.KEY_BREAK_LINK,d);break}}};this.addLine=function(c,d){var g=new ra;g.setFromId(c.getId());g.setToId(d.getId());a(g)&&(g.setId(S.UIDHelper.getUID(S.UIDHelper.NS_LINE)),f.push(g),b(Ca.KEY_ADD_LINE,g))};this.getAllLines=function(){return f};this.removeLine=function(c){var d=f.indexOf(c);-1<d&&(f.splice(d,1),b(Ca.KEY_REMOVE_LINE,c))};this.getRelatedLine=function(c,d){var g=[];if(!c)return g;c=c.getId();for(var k=0,l=f.length;k<l;k++){var m=f[k];if((d&Ca.GET_LINE_STRATEGY_IN)==
Ca.GET_LINE_STRATEGY_IN&&m.getToId()==c||(d&Ca.GET_LINE_STRATEGY_OUT)==Ca.GET_LINE_STRATEGY_OUT&&m.getFromId()==c){for(var p=!1,w=0;w<g.length;w++){var u=g[w];if(u.getFromId()==m.getFromId()&&u.getToId()==m.getToId()){p=!0;break}}p||g.push(m)}}return g};this.protectedToJsonObject=function(c){for(var d=[],g=0;g<e.length;g++)d.push(e[g].toJsonObject());c.nodes=d;d=[];for(g=0;g<f.length;g++)d.push(f[g].toJsonObject());c.lines=d};this.protectedFromJsonObject=function(c){for(var d=c.nodes,g=0;g<d.length;g++){var k=
d[g],l=k.type,m;l==sb.TYPE_TABLE?m=new vb:l==sb.TYPE_TRANSFORM&&(m=S.TransformNodeFactory.createTransformNode(k.config.type));m&&(m.fromJsonObject(k),m.addPropertyChangeCallback(b),e.push(m))}c=c.lines;for(g=0;g<c.length;g++)d=c[g],k=new ra,k.fromJsonObject(d),a(k)&&f.push(k)};var a=function(c){for(var d=0;d<f.length;d++){var g=f[d];if(g.getFromId()==c.getFromId()&&g.getToId()==c.getToId())return!1}return n.getNode(c.getFromId())&&n.getNode(c.getToId())?!0:!1},b=function(c,d){h.firePropertyChangeEvt(c,
d)}}function sb(){var h=this,n,e,f,a,b,c,d,g,k,l=[];this.setId=function(p){n=p};this.getId=function(){return n};this.setAlias=function(p){e=p;a=void 0;m(Ca.KEY_NODE_CHANGE_ALIAS,h)};this.getAlias=function(){return e};this.setNameIndex=function(p){a=p};this.getNameIndex=function(){return a};this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return d};this.getHeight=function(){return g};this.setPosition=function(p,w){b=p;c=w};this.changePosition=function(p,w){h.setPosition(p,
w);m(Ca.KEY_NODE_CHANGE_POSITION,h)};this.setSize=function(p,w){d=p;g=w};this.setType=function(p){f=p};this.getType=function(){return f};this.setFieldSettingConfig=function(p,w){k=p;!w&&m(Ca.KEY_TRANSFORM_FIELD_SETTING,h)};this.getFieldSettingConfig=function(){return k};this.addPropertyChangeCallback=function(p){l.push(p)};this.removePropertyChangeCallback=function(p){p=l.indexOf(p);-1<p&&l.splice(p,1)};this.canGenerateNewField=function(){return!1};this.toJsonObject=function(){var p={};p.id=n;p.alias=
e;p.x=b;p.y=c;p.type=f;a&&(p.nameIndex=a);h.protectedToJson(p);k&&(p.fieldSettingConfig=k.toJsonObject());return p};this.fromJsonObject=function(p){n=p.id;e=p.alias;b=p.x;c=p.y;f=p.type;var w=parseInt(p.nameIndex);isNaN(w)||(a=w);p.fieldSettingConfig&&(k=new O,k.fromJsonObject(p.fieldSettingConfig));h.protectedFromJson(p)};this.protectedToJson=function(p){};this.protectedFromJson=function(p){};var m=function(p,w){for(var u=0,x=l.length;u<x;u++)l[u](p,w)};this.protectedMethod={firePropertyChangeEvt:function(p){m(p,
h)}}}function vb(){sb.call(this);var h=this,n=this.protectedMethod,e,f,a;h.setSize(150,40);h.setType(sb.TYPE_TABLE);this.setName=function(b){e=b};this.getName=function(){return e};this.setTableUid=function(b){f=b};this.getTableUid=function(){return f};this.setSelectedFields=function(b,c){if(b)for(var d=0;d<b.length;d++)b[d].setFromNode(h.getId());a=b;c&&n.firePropertyChangeEvt(qa.KEY_TABLE_NODE_SELECT_FIELD)};this.getSelectedFields=function(){return a};this.protectedToJson=function(b){b.tableId=f;
if(a){for(var c=[],d=0;d<a.length;d++)c.push(a[d].toJsonObject());b.selectedFields=c}};this.protectedFromJson=function(b){f=b.tableId;if(b=b.selectedFields){for(var c=[],d=0;d<b.length;d++){var g=new z;g.fromJsonObject(b[d]);c.push(g)}a=c}};this.clone=function(){var b=new vb;b.setId(h.getId());b.setAlias(h.getAlias());b.setType(h.getType());b.setPosition(h.getX(),h.getY());b.setSize(h.getWidth(),h.getHeight());b.setTableUid(f);b.setName(e);b.setSelectedFields(a);return b}}function Ab(){sb.call(this);
var h=this.protectedMethod,n;this.setSize(50,30);this.setType(sb.TYPE_TRANSFORM);this.isMultiInDegree=function(){return!1};this.getType=function(){throw Error("override me");};this.setConfig=function(e){n=e;n.addPropertyChangeCallback(h.firePropertyChangeEvt)};this.getConfig=function(){return n};this.getNodeIdInConfig=function(){return n?n.getNodeIdInConfig():[]};this.protectedToJson=function(e){e.config=n.toJsonObject()};this.protectedFromJson=function(e){n.fromJsonObject(e.config)}}function Yb(){Ab.call(this);
this.canGenerateNewField=function(){return!0};this.getGeneratedSourceFieldName=function(h){throw Error("override me");};this.getGeneratedFieldSourceTableName=function(h){throw Error("override me");}}function Nb(){Ab.call(this);this.getType=function(){return Z.TYPE_FIELD_SELECT}}function ub(){Ab.call(this);this.getType=function(){return Z.TYPE_FIELD_SETTING}}function Jb(){Ab.call(this);this.getType=function(){return Z.TYPE_FILTER}}function Fa(){Yb.call(this);this.getType=function(){return Z.TYPE_COLUMN_TO_ROW};
this.getGeneratedSourceFieldName=function(h,n,e){if(e instanceof Fa)return" ";e=h.getFromNode();var f=n.getNode(e);n=f.getId();e=h.getFullName();var a=f.getConfig().getTargetAttrField();a.setFromNode(n);if(a.getFullName()===e)return a.getAlias();f=f.getConfig().getTargetValueFields();for(a=0;a<f.length;a++)if(f[a].setFromNode(n),f[a].getFullName()===e)return f[a].getAlias();return h.getAlias()};this.getGeneratedFieldSourceTableName=function(h,n){return S.DisplayNameHelper.getNodeDisplayName(this)}}
function Aa(){Ab.call(this);this.getType=function(){return Z.TYPE_SORT}}function nb(){var h=this;Yb.call(this);this.getType=function(){return Z.TYPE_GROUP_BY};this.getGeneratedSourceFieldName=function(e,f,a){e=n(e);var b=e.getFromNode();b=f.getNode(b);var c=b.getType();return c===Z.TYPE_GROUP_BY||c===Z.TYPE_CALCULATED_FIELD?S.FieldNumberHelper.getFieldNumberByFullName(e.getFullName()):c===Z.TYPE_CUSTOM_GROUP?b.getConfig().getSelectedField().getAlias():c===Z.TYPE_COLUMN_TO_ROW?b.getGeneratedSourceFieldName(e,
f,a):e.getName()};this.getGeneratedFieldSourceTableName=function(e,f){e=n(e).getFromNode();e=f.getNode(e);return e.getType()===Z.TYPE_CUSTOM_GROUP?(e=e.getConfig().getSelectedField().getFromNode(),f=f.getNode(e),S.DisplayNameHelper.getNodeDisplayName(f)):S.DisplayNameHelper.getNodeDisplayName(e)};var n=function(e){var f=e,a=e.getFullName();e=e.getFromNode();var b=h.getConfig(),c=b.getAggregateFieldItems();b=b.getGroupFieldItems().concat(c);for(c=0;c<b.length;c++){var d=b[c].getName();if(a===e+"_"+
d){f=b[c].getField();break}}return f}}function wb(){var h=this;Yb.call(this);this.getType=function(){return Z.TYPE_CUSTOM_GROUP};this.getGeneratedSourceFieldName=function(n,e,f){return h.getConfig().getSelectedField().getAlias()};this.getGeneratedFieldSourceTableName=function(n,e){n=h.getConfig().getSelectedField().getFromNode();e=e.getNode(n);return S.DisplayNameHelper.getNodeDisplayName(e)}}function sa(){Yb.call(this);this.getType=function(){return Z.TYPE_CALCULATED_FIELD};this.getGeneratedSourceFieldName=
function(h,n,e){if(e instanceof sa)return" ";e=h.getFromNode();n=n.getNode(e).getConfig().getCalculatedFields();e=h.getAlias();for(var f=0;f<n.length;f++)if(n[f].getFullName()===h.getFullName()){e=n[f].getAlias();break}return e};this.getGeneratedFieldSourceTableName=function(h){return S.DisplayNameHelper.getNodeDisplayName(this)}}function N(){var h=[];this.addExtraFromNode=function(n){h.push(n)};this.getExtraFromNode=function(){return h};this.isMultiInDegree=function(){return!0};this.affectByAddOrRemoveNode=
function(n,e){throw Error("override me");};this.affectByLink=function(n,e){throw Error("override me");};this.affectByBreakLink=function(n,e){throw Error("override me");};this.getSuggestUpwardIdWhenDelete=function(){throw Error("override me");}}function Ma(){Ab.call(this);N.call(this);var h=this;this.getType=function(){return Z.TYPE_JOIN};this.affectByAddOrRemoveNode=function(n,e){console.log("join config affect by node");var f=h.getConfig(),a=f.getRelationModel();a.getLeft()==n.getId()?(n=e?e.getId():
null,a.setLeft(n)):a.getRight()==n.getId()&&(n=e?e.getId():null,a.setRight(n));f.setRelationModel(a)};this.affectByLink=function(n,e){var f=h.getConfig(),a=f.getRelationModel(),b=a.getLeft(),c=a.getRight();e=e.getId();b&&n.getNode(b)?c&&n.getNode(c)||a.setRight(e):a.setLeft(e);f.setRelationModel(a)};this.affectByBreakLink=function(n,e){n=h.getConfig();var f=n.getRelationModel(),a=f.getLeft(),b=f.getRight();e=e.getId();e==a?f.setLeft(null):e==b&&f.setRight(null);n.setRelationModel(f)};this.getSuggestUpwardIdWhenDelete=
function(){return h.getConfig().getLeft()}}function Mb(){Yb.call(this);N.call(this);var h=this,n;this.getType=function(){return Z.TYPE_UNION};this.affectByAddOrRemoveNode=function(e,f){if(f){for(var a=h.getConfig(),b=a.getNodeItems(),c=0,d=0;d<b.length;d++){var g=b[d];if(g.getNodeId()==e.getId()){c=d;g.setNodeId(f.getId());g.setAlias(S.DisplayNameHelper.getNodeDisplayName(f));break}}e=a.getUnionItems();for(d=0;d<e.length;d++)e[d].getUnionInnerItemByIndex(c).setNodeId(f.getId());a.firePropertyChangeEvt()}};
this.affectByLink=function(e,f){e=h.getConfig();for(var a=e.getNodeItems(),b=0;b<a.length;b++)if(f.getId()==a[b].getNodeId()&&S.DisplayNameHelper.getNodeDisplayName(f)==a[b].getAlias()){e.firePropertyChangeEvt();return}n=e.getBaseNodeItem();b=new $a;b.setNodeId(f.getId());b.setAlias(S.DisplayNameHelper.getNodeDisplayName(f));e.setBaseNodeItem(b);a=e.getUnionItems();for(b=0;b<a.length;b++)a[b].getUnionInnerItemByIndex(0).setNodeId(f.getId());e.firePropertyChangeEvt()};this.affectByBreakLink=function(e,
f){e=h.getConfig();e.setBaseNodeItem(n);f=e.getUnionItems();for(var a=0;a<f.length;a++)f[a].getUnionInnerItemByIndex(0).setNodeId(n.getNodeId());e.firePropertyChangeEvt()};this.getSuggestUpwardIdWhenDelete=function(){return h.getConfig().getBaseNodeItem().getNodeId()};this.getGeneratedSourceFieldName=function(e,f,a){if(a instanceof Mb)return" ";f=h.getConfig().getUnionItems();a=e.getAlias();for(var b=0;b<f.length;b++)if(f[b].getName()===e.getName()){a:{e=f[b];f=(f=h.getFieldSettingConfig())?f.getModifiedField():
[];a=e.getName();for(b=0;b<f.length;b++){var c=f[b];if(a==c.getName()){a=c.getAlias();break a}}a=e.getAlias()}break}return a};this.getGeneratedFieldSourceTableName=function(e){return S.DisplayNameHelper.getNodeDisplayName(this)}}function ra(){var h,n,e;this.setId=function(f){h=f};this.getId=function(){return h};this.setFromId=function(f){n=f};this.getFromId=function(){return n};this.setToId=function(f){e=f};this.getToId=function(){return e};this.toJsonObject=function(){var f={};f.id=h;f.fromNode=
n;f.toNode=e;return f};this.fromJsonObject=function(f){h=f.id;n=f.fromNode;e=f.toNode}}function Z(){var h=this,n,e=[];this.getNodeIdInConfig=function(){return[]};this.addPropertyChangeCallback=function(f){e.push(f)};this.toJsonObject=function(){var f={};f.type=n;h.protectedToJsonObject(f);return f};this.fromJsonObject=function(f){n=f.type;h.protectedFromJsonObject(f)};this.protectedToJsonObject=function(f){};this.protectedFromJsonObject=function(f){};this.protectedMethod={firePropertyChangeEvt:function(f){for(var a=
0,b=e.length;a<b;a++)e[a](f)},setType:function(f){n=f}}}function Ka(){this.affectByPrevNode=function(h,n){throw Error("override me");};this.getConfigCopy=function(){throw Error("override me");}}function ta(){function h(){var a,b;this.setState=function(c,d){a=c;b=d};this.isSelectAll=function(){return a};this.getSelected=function(){return b}}Z.call(this);var n=this.protectedMethod,e=[],f=!0;n.setType(Z.TYPE_FIELD_SELECT);this.extractSelectState=function(){var a=new h;a.setState(f,e);return a};this.setSelectState=
function(a,b){f=a.isSelectAll();e=a.getSelected();b||n.firePropertyChangeEvt(Ca.KEY_TRANSFORM_SELECT_FIELD)};this.isSelectAll=function(){return f};this.isSelected=function(a){if(f)return!0;for(var b=0,c=e.length;b<c;b++)if(e[b].getFullName()==a.getFullName())return!0;return!1};this.getSelected=function(){return e};this.protectedToJsonObject=function(a){a.selectAll=f;var b=[];if(!f)for(var c=0,d=e.length;c<d;c++)b.push(e[c].toJsonObject());a.selectedFields=b};this.protectedFromJsonObject=function(a){f=
a.selectAll;a=a.selectedFields;for(var b=0;b<a.length;b++){var c=a[b],d=new z;d.fromJsonObject(c);e.push(d)}}}function O(){Z.call(this);var h=this.protectedMethod,n=[];h.setType(Z.TYPE_FIELD_SETTING);this.setModifiedField=function(f,a){n=f;!a&&h.firePropertyChangeEvt(Ca.KEY_TRANSFORM_FIELD_SETTING)};this.getModifiedField=function(){return e()};this.getModifiedFieldByFullName=function(f){for(var a=0;a<n.length;a++)if(n[a].getFullName()==f)return n[a];return null};this.copy=function(){var f=new O;f.setModifiedField(e(),
!0);return f};this.protectedToJsonObject=function(f){for(var a=[],b=0;b<n.length;b++)a.push(n[b].toJsonObject());f.fields=a};this.protectedFromJsonObject=function(f){f=f.fields;for(var a=0;a<f.length;a++){var b=f[a],c=new z;c.fromJsonObject(b);n.push(c)}};this.fitRuntimeProperty=function(f){for(var a=0,b=f.length;a<b;a++)for(var c=f[a],d=c.getFullName(),g=0;g<n.length;g++){var k=n[g];d==k.getFullName()&&k.setDataType(c.getDataType())}};var e=function(){for(var f=[],a=0;a<n.length;a++)f.push(n[a].clone());
return f}}function R(){Z.call(this);var h=this.protectedMethod,n=this,e,f,a="F"+(new Date).getTime(),b,c=!0,d;h.setType(Z.TYPE_CUSTOM_GROUP);this.setSelectedField=function(g){e=g};this.getSelectedField=function(){return e};this.setGroupName=function(g,k){f=g;!k&&h.firePropertyChangeEvt(Ca.KEY_TRANSFORM_CUSTOM_GROUP)};this.getGroupName=function(){return f};this.setName=function(g){a=g};this.getName=function(){return a};this.setOtherGroupName=function(g){b=g;h.firePropertyChangeEvt(Ca.KEY_TRANSFORM_CUSTOM_GROUP)};
this.getOtherGroupName=function(){var g=com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(S);return b||g.get("others","\u5176\u5b83")};this.setHasOtherGroup=function(g,k){c=g;!k&&h.firePropertyChangeEvt(Ca.KEY_TRANSFORM_CUSTOM_GROUP)};this.getHasOtherGroup=function(){return c};this.getCustomGroupType=function(){return d?d.getCustomGroupType():e?e.getOutputDataType()==z.DT_STRING?R.STRING:R.NUMBER:null};this.setGroups=function(g,k){d=new na;d.setGroups(g);d.setCustomGroupType(k);
h.firePropertyChangeEvt(Ca.KEY_TRANSFORM_CUSTOM_GROUP)};this.getGroups=function(){return d?d.getGroups():null};this.getGroupAndField=function(){return{field:n.getSelectedField(),groups:n.getGroups(),groupType:n.getCustomGroupType()}};this.setGroupAndField=function(g){n.setSelectedField(g.field);n.setGroups(g.groups,g.groupType)};this.protectedToJsonObject=function(g){g.field=e?e.toJsonObject():void 0;g.groupName=f;g.hasOtherGroup=c;g.otherGroupName=n.getOtherGroupName();g.name=n.getName();d&&d.getGroups()&&
d.getGroups().length&&(g.customGroups=d.toJsonObject())};this.protectedFromJsonObject=function(g){var k=new z;k.fromJsonObject(g.field);e=k;f=g.groupName;a=g.name;c=g.hasOtherGroup;b=g.otherGroupName;g.customGroups&&(d=new na,d.fromJsonObject(g.customGroups))}}function na(){var h,n;this.setCustomGroupType=function(e){h=e};this.getCustomGroupType=function(){return h};this.setGroups=function(e){n=e};this.getGroups=function(){return n};this.toJsonObject=function(){var e={};e.customGroupType=h;if(n&&
0<n.length){var f=[];n.forEach(function(a){f.push(a.toJsonObject())});e.groups=f}return e};this.fromJsonObject=function(e){h=e.customGroupType;n=[];h===R.STRING?e.groups.forEach(function(f){var a=new X;a.fromJsonObject(f);n.push(a)}):e.groups.forEach(function(f){var a=new J;a.fromJsonObject(f);n.push(a)})}}function ja(){var h,n;this.setCollapse=function(e){n=e};this.getCollapse=function(){return n};this.setName=function(e){h=e};this.getName=function(){return h};this.protectedMethod={toJsonObject:function(){var e=
{};e.name=h;return e},fromJsonObject:function(e){h=e.name}}}function X(){ja.call(this);var h=this.protectedMethod,n=this,e=[],f=[];this.setSelecteds=function(a){f=a};this.getSelecteds=function(){return f};this.setMembers=function(a){e=a};this.getMembers=function(){return e.slice()};this.toJsonObject=function(){var a=h.toJsonObject();a.items=e;return a};this.fromJsonObject=function(a){h.fromJsonObject(a);e=a.items||[]};this.clone=function(){var a=new X;a.setName(n.getName());a.setMembers(e);return a}}
function J(){ja.call(this);var h=this.protectedMethod,n=this,e=0,f=0,a=wa.COMPARE_GREATER_EQUAL,b=wa.COMPARE_LESS;this.setFrom=function(c){e=c};this.getFrom=function(){return e};this.setFromBoundary=function(c){a=c};this.getFromBoundary=function(){return a};this.setTo=function(c){f=c};this.getTo=function(){return f};this.setToBoundary=function(c){b=c};this.getToBoundary=function(){return b};this.toJsonObject=function(){var c=h.toJsonObject(),d=new wa;d.setCompareOp(a);d.setValue(e.toString());var g=
new wa;g.setCompareOp(b);g.setValue(f.toString());c.items=[d.toJsonObject(),g.toJsonObject()];return c};this.fromJsonObject=function(c){h.fromJsonObject(c);c=c.items;var d=new wa;d.fromJsonObject(c[0]);a=d.getCompareOp();e=parseFloat(d.getValue());d=new wa;d.fromJsonObject(c[1]);b=d.getCompareOp();f=parseFloat(d.getValue())};this.clone=function(){var c=new J;c.setName(n.getName());c.setFrom(e);c.setFromBoundary(a);c.setTo(f);c.setToBoundary(b);return c}}function wa(){var h,n;this.setValue=function(e){n=
e};this.getValue=function(){return n};this.setCompareOp=function(e){h=e};this.getCompareOp=function(){return h};this.fromJsonObject=function(e){n=e.value;h=e.compareOp};this.toJsonObject=function(){var e={};e.value=n;e.compareOp=h;return e}}function La(){Z.call(this);var h=this.protectedMethod,n=[],e=[],f={};h.setType(Z.TYPE_GROUP_BY);this.setGroupFieldItems=function(b){n=b;h.firePropertyChangeEvt(Ca.KEY_TRANSFORM_GROUP_BY)};this.getGroupFieldItems=function(){return n};this.copyGroupFieldItems=function(){return n.concat([])};
this.setAggregateFieldItems=function(b){e=b;h.firePropertyChangeEvt(Ca.KEY_TRANSFORM_GROUP_BY)};this.getAggregateFieldItems=function(){return e};this.copyAggregateFieldItems=function(){return e.concat([])};this.setMapInitFieldItem=function(b){f=b};this.getMapInitFieldItem=function(){return f};this.protectedToJsonObject=function(b){b.groupFieldItems=a(n);b.aggregateFieldItems=a(e)};var a=function(b){var c=[];b.forEach(function(d){c.push(d.toJsonObject())});return c};this.protectedFromJsonObject=function(b){var c=
b.aggregateFieldItems;b=b.groupFieldItems;for(var d=[],g=0;g<b.length;g++){var k=b[g],l=new Ha;l.fromJsonObject(k);d.push(l)}n=d;b=[];for(d=0;d<c.length;d++)g=c[d],k=new Qa,k.fromJsonObject(g),b.push(k);e=b}}function Oa(){var h,n;this.setField=function(e){n=e};this.getField=function(){return n};this.setName=function(e){h=e};this.getName=function(){return h};this.protectedMethod={toJsonObject:function(){var e={};e.name=h;e.field=n.toJsonObject();return e},fromJsonObject:function(e){h=e.name;e=e.field;
n=new z;n.fromJsonObject(e)}}}function Ha(){Oa.call(this);var h=this.protectedMethod,n=this,e=!1,f=S.DateGroupType.YEAR,a={};this.setDateGroup=function(b){e=b};this.getDateGroup=function(){return e};this.setDateGroupType=function(b){f=b};this.getDateGroupType=function(){return f};this.setDateGroupTypeMap=function(b){a=b};this.getDateGroupTypeMap=function(){return a};this.updateGroupByFieldProperty=function(){e=!0;n.setDateGroupType(S.DateGroupType.YEAR)};this.toJsonObject=function(){var b=h.toJsonObject();
e&&(b.dateGroupType=f);b.isDateGroup=e;return b};this.fromJsonObject=function(b){h.fromJsonObject(b);if(e=b.isDateGroup)f=b.dateGroupType,a.alias=n.getField().getAlias(),a.dateGroupType=f}}function Qa(){Oa.call(this);var h=this.protectedMethod,n=this,e,f,a={};this.setFunctionType=function(b){e=b};this.getFunctionType=function(){return e};this.setFunctionTypeMap=function(b){a=b};this.getFunctionTypeMap=function(){return a};this.setCalculateByDateType=function(b){f=b};this.getCalculateByDateType=function(){return f};
this.toJsonObject=function(){var b=h.toJsonObject();b.functionType=e;f&&(b.calculateByDateType=f);return b};this.fromJsonObject=function(b){h.fromJsonObject(b);n.setFunctionType(b.functionType);n.setCalculateByDateType(b.calculateByDateType);a.alias=n.getField().getAlias();a.functionType=e;a.calculateByDateType=f}}function r(){Z.call(this);Ka.call(this);var h=this,n=this.protectedMethod;n.setType(Z.TYPE_JOIN);var e,f;this.init=function(a,b,c,d){f=a;e=new M;e.init(b,c,d)};this.setJoinType=function(a){f=
a;n.firePropertyChangeEvt(Ca.KEY_TRANSFORM_JOIN)};this.getJoinType=function(){return f};this.getLeft=function(){if(e)return e.getLeft()};this.getRight=function(){if(e)return e.getRight()};this.getRelationModel=function(){return e.clone()};this.setRelationModel=function(a){e=a;n.firePropertyChangeEvt(Ca.KEY_TRANSFORM_JOIN)};this.affectByPrevNode=function(a,b){e&&(e.getLeft()==a?e.setLeft(b):e.getRight()==a&&e.setRight(b))};this.getConfigCopy=function(){var a=new r;a.fromJsonObject(h.toJsonObject());
return a};this.protectedToJsonObject=function(a){a.leftNode=e.getLeft();a.rightNode=e.getRight();a.joinType=f;for(var b=[],c=e.getRelations(),d=0,g=c.length;d<g;d++){var k=[],l=c[d],m=l[0];l=l[1];m&&(k[0]=m.toJsonObject());l&&(k[1]=l.toJsonObject());b.push(k)}a.allRelations=b};this.protectedFromJsonObject=function(a){var b=a.leftNode,c=a.rightNode;f=a.joinType;a=a.allRelations;for(var d=[],g=0;g<a.length;g++){var k=a[g];if(2==k.length){var l=[];if(k[0]){var m=new z;m.fromJsonObject(k[0]);l[0]=m}k[1]&&
(m=new z,m.fromJsonObject(k[1]),l[1]=m);d.push(l)}}e=new M;e.init(b,c,d)}}function M(){var h,n,e;this.init=function(f,a,b){h=f;n=a;e=b};this.clone=function(){for(var f=new M,a=[],b=0;b<e.length;b++){var c=e[b],d=[];d[0]=c[0]&&c[0].clone();d[1]=c[1]&&c[1].clone();a.push(d)}f.init(h,n,a);return f};this.setLeft=function(f){h=f};this.getLeft=function(){return h};this.setRight=function(f){n=f};this.getRight=function(){return n};this.setRelations=function(f){e=f};this.getRelations=function(){return e}}
function P(){Z.call(this);var h=this,n=this.protectedMethod;n.setType(Z.TYPE_FILTER);var e=[];this.getFilterItems=function(){return e};this.setFilterItems=function(f){e=f};this.copyFilterItems=function(){for(var f=[],a=0;a<e.length;a++)f.push(e[a].copy());return f};this.firePropertyChangeEvt=function(){n.firePropertyChangeEvt(Ca.KEY_TRANSFORM_FILTER)};this.getNotEmptyFilterItems=function(){for(var f=[],a=0;a<e.length;a++)e[a].isEmpty()||f.push(e[a]);return f};this.protectedToJsonObject=function(f){for(var a=
h.getNotEmptyFilterItems(),b=[],c=0,d=a.length;c<d;c++)b.push(a[c].toJsonObject());f.filterItems=b};this.protectedFromJsonObject=function(f){if(f){f=f.filterItems;for(var a=0;a<f.length;a++){var b=new G;b.fromJsonObject(f[a]);e.push(b)}}}}function G(){var h,n,e,f,a=0,b=0,c,d=null;this.setField=function(k){(h=k)&&!k.isMulBaseData()&&n&&e&&(k=k.getOutputDataType(),k!=z.DT_DATE&&k!=z.DT_DATETIME||G.REG_DATETIME.test(e)||G.isCompareOpWithinOrNotWithinValue(n)||(e=(new Date).getTime()));g()};this.updateNotExistFieldByMyself=
function(){var k=new z;k.setFromNode(h.getSourceNodeId());k.setName(h.getName());k.setAlias(h.getAlias());h=k};this.getField=function(){return h};this.getTargetFieldFullName=function(){return h?h.getFullName():null};this.setCompareOp=function(k){n=k};this.getCompareOp=function(){return n};this.setValue=function(k){e=k;g()};this.getValue=function(){return e};this.setDisplayValue=function(k){f=k};this.getDisplayValue=function(k){if(f){if(!k&&G.isCompareOpWithinOrNotWithinValue(n))return JSON.parse(f).join(",");
if(G.isCompareOpRelativeDateRangeValue(n))return k=h.getOutputDataType()==z.DT_DATETIME,U.modelToDisplayText(d,k)}else return"";return f};this.setLeftBracketCount=function(k){a=k};this.getLeftBracketCount=function(){return a};this.setRightBracketCount=function(k){b=k};this.getRightBracketCount=function(){return b};this.setLogicOp=function(k){c=k};this.getLogicOp=function(){return c};this.setRelativeDateRange=function(k){d=k};this.getRelativeDateRange=function(){return d};this.isEmpty=function(){return 0==
a&&0==b&&!h&&!n&&!e&&!c};this.equals=function(k){if(n!==k.getCompareOp()||e!==k.getValue()||f!==k.getDisplayValue()||a!==k.getLeftBracketCount()||b!==k.getRightBracketCount()||c!==k.getLogicOp()||!h.equals(k.getField()))return!1;a:{var l=d;k=k.getRelativeDateRange();var m=Object.getOwnPropertyNames(l),p=Object.getOwnPropertyNames(k);if(m.length!==p.length)l=!1;else{for(p=0;p<m.length;p++){var w=m[p];if(l[w]!==k[w]){l=!1;break a}}l=!0}}if(!l)return!1};var g=function(){if(h&&n){var k=h.getOutputDataType();
if(e){var l=h.isEnum(),m=h.isMulBaseData(),p=l?h.getEnumValue():null;if(G.isCompareOpWithinOrNotWithinValue(n))if(l){k=JSON.parse(e);l=[];for(m=0;m<k.length;m++){var w=p[k[m]];w&&l.push(w)}f=JSON.stringify(l)}else f=e;else m?f=e:k==z.DT_DATE||k==z.DT_DATETIME?(p=new Date,p.setTime(e),l=new com.kingdee.bos.qing.common.DateFormater,m=l.setFormatString,k=k==z.DT_DATE?"yyyy-MM-dd":"yyyy-MM-dd HH:mm:ss",m.call(l,k),f=l.format(p)):k==z.DT_BOOLEAN?(p=com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(S),
f=e==z.BOOLEAN_TRUE?p.get("dataTypeTrue","\u771f"):e==z.BOOLEAN_FALSE?p.get("dataTypeFalse","\u5047"):""):f=l?p[e]?p[e]:"":e}else f=G.isCompareOpRelativeDateRangeValue(n)&&null!=d?U.modelToDisplayText(d,k==z.DT_DATETIME):null}};this.copy=function(){var k=new G;k.setField(h);k.setCompareOp(n);k.setValue(e);k.setDisplayValue(f);k.setLeftBracketCount(a);k.setRightBracketCount(b);k.setLogicOp(c);k.setRelativeDateRange(d);return k};this.toJsonObject=function(){if(!h)return null;var k={};k.field=h.toJsonObject();
k.compareOp=n;k.value=e;k.displayValue=f;k.leftBrackets=a;k.rightBrackets=b;k.logicOp=c;d&&(k.relativeDateRange=d.toJsonObject());return k};this.fromJsonObject=function(k){k&&(h=new z,h.fromJsonObject(k.field),n=k.compareOp,e=k.value,f=k.displayValue,a=k.leftBrackets,b=k.rightBrackets,c=k.logicOp,k=k.relativeDateRange)&&(d=new db,d.fromJsonObject(k))}}function za(){Z.call(this);var h=this.protectedMethod;h.setType(Z.TYPE_COLUMN_TO_ROW);var n=this,e,f=[],a=[],b=1;this.setTargetAttrField=function(d){e=
d};this.getTargetAttrField=function(){return e};this.getAttrFieldAlias=function(){return e?e.getAlias():""};this.addTargetAttrField=function(d){e=new z;e.setName("F"+(new Date).getTime()+b);e.setAlias(d);e.setDataType(z.DT_STRING);b+=1};this.setAttrFieldAlias=function(d){e?e.setAlias(d):n.addTargetAttrField(d)};this.setTargetValueFields=function(d){f=d};this.getTargetValueFields=function(){return f};this.getTargetValueFieldAlias=function(){var d=[],g;for(g in f)d.push(f[g].getAlias());return d};this.getTargetValueFieldAlia=
function(d){return n.getTargetValueFieldAlias()[d]};this.getTargetValueFieldSize=function(){return f.length};this.addTargetValueField=function(d,g){var k=new z;k.setName("F"+(new Date).getTime()+b);k.setAlias(g);k.setDataType(z.DT_STRING);f[d]=k;b+=1};this.setValueFieldAlias=function(d,g){f[d]?f[d].setAlias(g):n.addTargetValueField(d,g)};this.deleteTargetValueField=function(d){if(a&&0<a.length)for(var g=0;g<a.length;g++){var k=a[g];k&&k.getFields().splice(d,1)}f.splice(d,1)};this.getUsedFieldNames=
function(){var d=[];if(a&&0<a.length)for(var g in a){var k=a[g].getUsedFieldNames();c(d,k)}return d};this.getUsedFields=function(){var d=[];if(a&&0<a.length)for(var g in a){var k=a[g].getFields();c(d,k)}return d};var c=function(d,g){if(g&&0<g.length){d=d?d:[];for(var k in g){var l=g[k];l&&d.push(l)}}};this.addColumnToRowItem=function(d,g){a[d]=g};this.deleteColumnToRowItem=function(d){a.splice(d,1)};this.getColumnToRowItem=function(d){return a[d]};this.setColumnToRowItems=function(d){a=d};this.getColumnToRowItems=
function(){return a};this.clone=function(){var d=new za,g=new z;g.fromJsonObject(e.toJsonObject());d.setTargetAttrField(g);g=[];for(var k=0;k<f.length;k++){var l=new z;l.fromJsonObject(f[k].toJsonObject());g.push(l)}d.setTargetValueFields(g);g=[];for(k=0;k<a.length;k++)g.push(a[k].clone());d.setColumnToRowItems(g);return d};this.firePropertyChangeEvt=function(){h.firePropertyChangeEvt(Ca.KEY_TRANSFORM_COLUMN_TO_ROW)};this.protectedToJsonObject=function(d){d.targetAttrField=e.toJsonObject();var g=
[],k;for(k in f)g.push(f[k].toJsonObject());d.targetValueFields=g;g=[];for(k=0;k<a.length;k++)g.push(a[k].toJsonObject());d.columnToRowItems=g;return d};this.protectedFromJsonObject=function(d){e=new z;e.fromJsonObject(d.targetAttrField);if(d.columnToRowItems)for(var g=d.columnToRowItems,k=0;k<g.length;k++){var l=new ea;l.fromJsonObject(g[k]);a.push(l)}if(d.targetValueFields)for(d=d.targetValueFields,g=0;g<d.length;g++)k=new z,k.fromJsonObject(d[g]),f.push(k)}}function ea(){var h=this,n,e=[];this.setName=
function(f){n=f};this.getName=function(){return n};this.setFields=function(f){e=f};this.getFields=function(){return e};this.getField=function(f){return e[f]};this.getUsedFieldNames=function(){for(var f=[],a=0;a<e.length;a++)e[a]&&f.push(e[a].getFullName());return f};this.toJsonObject=function(){var f={};f.name=h.getName();for(var a=[],b=0;b<e.length;b++)e[b]?a.push(e[b].toJsonObject()):a.push((new z).toJsonObject());f.fields=a;return f};this.fromJsonObject=function(f){h.setName(f.name);f=f.fields;
for(var a=0;a<f.length;a++)if(f[a]&&f[a].name){var b=new z;b.fromJsonObject(f[a]);e.push(b)}else e.push(null)};this.clone=function(){var f=new ea;f.setName(n);for(var a=[],b=0;b<e.length;b++)if(e[b]){var c=new z;c.fromJsonObject(e[b].toJsonObject());a.push(c)}else a.push(null);f.setFields(a);return f}}function fa(){Z.call(this);var h=this.protectedMethod;h.setType(Z.TYPE_SORT);var n=[];this.getSortItems=function(){return n};this.setSortItems=function(e){n=e};this.copySortItems=function(){for(var e=
[],f=0;f<n.length;f++)e.push(n[f].copy());return e};this.firePropertyChangeEvt=function(){h.firePropertyChangeEvt&&h.firePropertyChangeEvt(Ca.KEY_TRANSFORM_SORT)};this.protectedToJsonObject=function(e){for(var f=[],a=0,b=n.length;a<b;a++)f.push(n[a].toJsonObject());e.sortItems=f};this.protectedFromJsonObject=function(e){if(e){e=e.sortItems;for(var f=0;f<e.length;f++){var a=new W;a.fromJsonObject(e[f]);n.push(a)}}}}function W(){var h,n;this.setField=function(e){h=e};this.getField=function(){return h};
this.updateNotExistFieldByMyself=function(){var e=new z;e.setFromNode(h.getSourceNodeId());e.setName(h.getName());e.setAlias(h.getAlias());h=e};this.getTargetFieldFullName=function(){return h?h.getFullName():null};this.initSortRule=function(){n=W.ORDER_ASC};this.setOrder=function(e){n=e};this.getOrder=function(){return n};this.copy=function(){var e=new W;e.setField(h);e.setOrder(n);return e};this.toJsonObject=function(){var e={};e.field=h.toJsonObject();e.order=n;return e};this.fromJsonObject=function(e){e&&
(h=new z,h.fromJsonObject(e.field),n=e.order)}}function C(){Z.call(this);var h=this.protectedMethod,n=[];h.setType(Z.TYPE_CALCULATED_FIELD);this.setCalculatedFields=function(f){n=f;h.firePropertyChangeEvt(Ca.KEY_TRANSFORM_CALCULATED_FIELD)};this.getCalculatedFields=function(){return n};this.copyCalculatedFields=function(){return n.concat([])};this.protectedToJsonObject=function(f){f.calculatedFields=e(n)};var e=function(f){var a=[];f.forEach(function(b){a.push(b.toJsonObject())});return a};this.protectedFromJsonObject=
function(f){f=f.calculatedFields;for(var a=[],b=0;b<f.length;b++){var c=f[b],d=new ia;d.fromJsonObject(c);a.push(d)}n=a}}function ia(){z.call(this);var h=this,n;this.setFormula=function(e){n=e};this.getFormula=function(){return n};this.protectedToJsonObject=function(e){e.formula=n};this.protectedFromJsonObject=function(e){n=e.formula};this.clone=function(){var e=new ia;e.setFromNode(h.getSourceNodeId());e.setName(h.getName());e.setAlias(h.getAlias());e.setDataType(h.getDataType());e.setAppointedDataType(h.getAppointedDataType());
e.setScale(h.getScale());e.setRoundMode(h.getRoundMode());e.setFormula(n);return e}}function ha(){Z.call(this);Ka.call(this);var h=this,n=this.protectedMethod;n.setType(Z.TYPE_UNION);var e=[],f=[];this.setNodeItems=function(c){e=c};this.getNodeItems=function(){return e};this.addNodeItem=function(c){e.push(c)};this.setUnionItems=function(c){f=c};this.getUnionItems=function(){return f};this.addUnionItem=function(c){f.push(c)};this.affectByPrevNode=function(c,d){for(var g=0;g<e.length;g++){var k=e[g];
if(k.getNodeId()==c){k.setNodeId(d);break}}for(g=0;g<f.length;g++){k=f[g].getUnionInnerItems();for(var l=0;l<k.length;l++){var m=k[l];if(m.getNodeId()==c){m.setNodeId(d);break}}}};this.getConfigCopy=function(){return h.clone()};this.getNodeIdInConfig=function(){for(var c=[],d=0;d<e.length;d++)c.push(e[d].getNodeId());return c};this.getNodeItemsSlice=function(c,d){for(var g=[],k=0;k<e.length;k++)if(0!=k||!c){var l=e[k];d?l.isExist()&&g.push(l):g.push(l)}return g};this.getNodeFields=function(){for(var c=
{},d=0;d<f.length;d++)for(var g=f[d].getUnionInnerItems(),k=0;k<g.length;k++){var l=g[k];if(!l.isEmpty()&&l.isFieldExist()){var m=l.getField();l=l.getNodeId();var p=c[l]?c[l]:[];c[l]=p;p.push(m)}}return c};this.getBaseNodeItem=function(){return e[0]};this.setBaseNodeItem=function(c){e&&0<e.length&&(e[0]=c)};this.checkNodeToUnionExistExceptBase=function(){return 1<e.length};this.checkUnionItemSelectEmpty=function(){for(var c=0;c<f.length;c++)if(f[c].isSelected())return!1;return!0};this.firePropertyChangeEvt=
function(){n.firePropertyChangeEvt&&n.firePropertyChangeEvt(Ca.KEY_TRANSFORM_UNION)};this.updateUnionItem=function(c,d){for(var g=0;g<f.length;g++)f[g].update(c,d)};this.checkFieldExist=function(c,d){for(var g=0;g<f.length;g++)if(!f[g].update(c,d))return!1;return!0};this.addOneNodeToUnion=function(c,d,g,k){for(var l=0;l<f.length;l++)f[l].appendEmptyUnionInnerItem(c,g);for(l=0;l<d.length;l++){var m=d[l];a:{var p=m;for(var w=g,u=0;u<f.length;u++)if(f[u].tryAddUnionInnerItem(p,w)){p=!0;break a}p=!1}p||
b(c,m).setSelected(k)}};this.deleteOneNodeToUnion=function(c){for(var d=0,g=0;g<e.length;g++)if(c==e[g].getNodeId()){d=g;break}e.splice(d,1);for(g=0;g<f.length;g++)f[g].deleteUnionInnerItemByNodeIndex(d);f=f.filter(function(k){return!k.isEmpty()})};this.addOneUnionItem=function(c,d){return b(c,d)};this.tryDeleteOneUnionItem=function(c){f[c].isEmpty()&&f.splice(c,1)};this.getSelectedUnionItem=function(c){for(var d=[],g=0;g<f.length;g++){var k=f[g];k.isSelected()&&d.push(k)}g=[];for(k=0;k<d.length;k++){var l=
d[k];if(l.getName())g.push(l.getName());else{var m=l.getBaseField().getName();m=a(g,m);l.setName(m);g.push(m)}}g=[];for(k=0;k<d.length;k++){l=d[k];if(l.getName())a:{m=l;for(var p=c?c.getModifiedField():[],w=m.getName(),u=0;u<p.length;u++){var x=p[u];if(w==x.getName()){m=x.getAlias();break a}}m=m.getAlias()}else m=null;m?g.push(m):(m=l.getBaseField().getAlias(),m=a(g,m),l.setAlias(m),g.push(m))}return d};this.clone=function(){for(var c=new ha,d=[],g=0;g<e.length;g++)d.push(e[g].clone());c.setNodeItems(d);
d=[];for(g=0;g<f.length;g++)d.push(f[g].clone());c.setUnionItems(d);return c};this.protectedToJsonObject=function(c){if(c){for(var d=[],g=0;g<e.length;g++)d.push(e[g].toJsonObject());c.nodeItems=d;d=[];for(g=0;g<f.length;g++){var k=f[g];k.isSelected()&&d.push(k.toNotEmptyUnionInnerItem().toJsonObject())}c.unionItems=d}};this.protectedFromJsonObject=function(c){if(c){for(var d=c.nodeItems,g=0;g<d.length;g++){var k=new $a;k.fromJsonObject(d[g]);e.push(k)}c=c.unionItems;for(g=0;g<c.length;g++)d=new Ia,
d.fromJsonObject(c[g]),f.push(d);for(g=0;g<f.length;g++)f[g].fill(e)}};var a=function(c,d){for(var g=1,k=d;-1<c.indexOf(k);)k=d+"_"+g,g++;return k},b=function(c,d){for(var g=new Ia,k=[],l=0;l<e.length;l++){var m=e[l].getNodeId(),p=new ka;p.setNodeId(m);m==c&&p.setField(d);k.push(p)}g.setUnionInnerItems(k);f.push(g);return g}}function $a(){var h,n,e=!0;this.getNodeId=function(){return h};this.setNodeId=function(f){h=f};this.getAlias=function(){return n};this.setAlias=function(f){n=f};this.isExist=
function(){return e};this.setExist=function(f){e=f};this.clone=function(){var f=new $a;f.setNodeId(h);f.setAlias(n);f.setExist(e);return f};this.toJsonObject=function(){var f={};f.nodeId=h;f.alias=n;return f};this.fromJsonObject=function(f){f&&(h=f.nodeId,n=f.alias)}}function Ia(){var h,n,e=[],f=!0;this.getName=function(){return h};this.setName=function(b){h=b};this.getAlias=function(){return n};this.setAlias=function(b){n=b};this.getUnionInnerItems=function(){return e};this.setUnionInnerItems=function(b){e=
b};this.isSelected=function(){return f};this.setSelected=function(b){f=b};this.getUnionInnerItemsCount=function(){return e.length};this.update=function(b,c){b=e[b];if(b.isEmpty())return!0;for(var d=b.getField(),g=0;g<c.length;g++)if(c[g].getFullName()==d.getFullName())return b.setField(c[g]),b.setFieldExist(!0),!0;b.updateNotExistFieldByMyself();b.setFieldExist(!1);return!1};this.appendEmptyUnionInnerItem=function(b,c){c<e.length||(c=new ka,c.setNodeId(b),e.push(c))};this.getUnionInnerItemByIndex=
function(b){return e[b]};this.fill=function(b){if(e.length!=b.length){for(var c=[],d=0,g=0;g<b.length;g++){var k=e[d];k&&b[g].getNodeId()==k.getNodeId()?(c.push(e[d]),d++):(k=new ka,k.setNodeId(b[g].getNodeId()),c.push(k))}e=c}};this.isEmpty=function(){for(var b=0;b<e.length;b++)if(!e[b].isEmpty())return!1;return!0};this.tryAddUnionInnerItem=function(b,c){c=e[c];if(!c.isEmpty())return!1;var d=a();if(d&&b&&d.getAlias()!=b.getAlias())return!1;c.setField(b);return!0};this.deleteUnionInnerItemByNodeIndex=
function(b){e.splice(b,1)};this.toNotEmptyUnionInnerItem=function(){var b=new Ia;b.setName(h);b.setAlias(n);for(var c=[],d=0;d<e.length;d++){var g=e[d];g&&!g.isEmpty()&&c.push(g)}b.setUnionInnerItems(c);b.setSelected(f);return b};this.getBaseField=function(){return a()};this.clone=function(){var b=new Ia;b.setName(h);b.setAlias(n);for(var c=[],d=0;d<e.length;d++)c.push(e[d].clone());b.setUnionInnerItems(c);b.setSelected(f);return b};this.toJsonObject=function(){var b={};b.name=h;b.alias=n;for(var c=
[],d=0;d<e.length;d++)c.push(e[d].toJsonObject());b.unionInnerItems=c;return b};this.fromJsonObject=function(b){if(b){h=b.name;n=b.alias;b=b.unionInnerItems;for(var c=0;c<b.length;c++){var d=new ka;d.fromJsonObject(b[c]);e.push(d)}f=!0}};var a=function(){if(e)for(var b=0;b<e.length;b++){var c=e[b];if(c&&c.getField())return c.getField()}}}function ka(){var h,n,e=!0;this.getField=function(){return h};this.setField=function(f){h=f};this.getNodeId=function(){return n};this.setNodeId=function(f){n=f};
this.isFieldExist=function(){return e};this.setFieldExist=function(f){e=f};this.getFiledAlias=function(){return h?h.getAlias():""};this.isEmpty=function(){return!h};this.updateNotExistFieldByMyself=function(){var f=new z;f.setFromNode(h.getSourceNodeId());f.setName(h.getName());f.setAlias(h.getAlias());h=f};this.clone=function(){var f=new ka;f.setField(h);f.setNodeId(n);f.setFieldExist(e);return f};this.toJsonObject=function(){var f={};f.field=h.toJsonObject();f.nodeId=n;return f};this.fromJsonObject=
function(f){f&&(h=new z,h.fromJsonObject(f.field),n=f.nodeId)}}function Ga(){var h,n,e,f,a,b,c=this;this.setUid=function(d){h=d};this.getUid=function(){return h};this.isUserSql=function(){return b?!0:!1};this.getUserSql=function(){return b};this.setUserSql=function(d){b=d};this.setTableName=function(d){n=d};this.getTableName=function(){return n};this.setSourceUid=function(d){e=d};this.getSourceUid=function(){return e};this.setNamespace=function(d){f=d};this.getNamespace=function(){return f};this.setDisplayName=
function(d){a=d};this.getDisplayName=function(){return a};this.isSame=function(d){return e==d.getSourceUid()&&n==d.getTableName()&&f==d.getNamespace()&&(!c.isUserSql()&&!d.isUserSql()||c.isUserSql()&&d.isUserSql()&&(d=d.getUserSql(),d.getSqlType()==b.getSqlType()&&d.getContent()==b.getContent()))?!0:!1};this.toJsonObject=function(){var d={};d.id=h;d.name=n;d.sourceId=e;d.namespace=f;c.isUserSql()&&(d.userSQL=b.toJsonObject());return d};this.fromJsonObject=function(d){h=d.id;n=d.name;e=d.sourceId;
f=d.namespace;a=d.displayName;d.userSQL&&(b=new la,b.fromJsonObject(d.userSQL))};this.clone=function(){var d=new Ga;d.setUid(h);d.setTableName(n);d.setNamespace(f);d.setDisplayName(a);d.setSourceUid(e);b&&d.setUserSql(b.copy());return d}}function la(){var h,n;this.getSqlType=function(){return h};this.setSqlType=function(e){h=e};this.setContent=function(e){n=e};this.getContent=function(){return n};this.fromJsonObject=function(e){h=e.type;n=e.content};this.toJsonObject=function(){var e={};e.type=h;
e.content=n;return e};this.copy=function(){var e=new la;e.setSqlType(h);e.setContent(n);return e}}function da(){var h,n,e,f,a,b;this.setId=function(c){h=c};this.getId=function(){return h};this.getSourceId=function(){return n};this.setSourceId=function(c){n=c};this.setSourceRefId=function(c){e=sId};this.getSourceRefId=function(){return e};this.getName=function(){return f};this.setName=function(c){f=c};this.setSourceType=function(c){a=c};this.getSourceType=function(){return a};this.setModelId=function(c){b=
c};this.getModelId=function(){return b};this.toJsonObject=function(){var c={};c.id=h;c.modelSetSourceId=n;c.modelSetSourceRefId=e;c.modelId=b;return c};this.fromJsonObject=function(c){h=c.id;n=c.modelSetSourceId;e=c.modelSetSourceRefId;a=c.type;f=c.name}}function z(){var h=this,n,e,f,a,b,c,d,g,k;this.setFromNode=function(m){n=m};this.getFromNode=function(){return n};this.getSourceNodeId=function(){return n};this.setName=function(m){e=m};this.getName=function(){return e};this.getFullName=function(){return n+
"_"+e};this.setAlias=function(m){f=m};this.getAlias=function(){return f?f:e};this.getAppointedAlias=function(){return f};this.setDataType=function(m){l(m);a=m};this.getDataType=function(){return a};this.setAppointedDataType=function(m){m&&l(m);c=m==b?null:m};this.getAppointedDataType=function(){return c};this.getOriginalDataType=function(){return b};this.setOriginalDataType=function(m){b=m};this.getOutputDataType=function(){return c?c:a};this.setRoundMode=function(m){g=m};this.getRoundMode=function(){return g};
this.setScale=function(m){d=m};this.getScale=function(){return d};this.setExtensions=function(m){k=m};this.getEnumValue=function(){return k?k[z.EXTENSION_BIZ_FIELD_ENUM_KEY]:null};this.isMulBaseData=function(){return k?k[z.EXTENSION_IS_MUL_BASE_DATA]:!1};this.isPk=function(){return k?k[z.EXTENSION_IS_PK]:!1};this.getSourceDisplayName=function(){return k?k[z.EXTENSION_SOURCE_FIELD_ALIAS]:null};this.isEnum=function(){if(h.isMulBaseData()||h.getOutputDataType()!=z.DT_STRING)return!1;var m=h.getEnumValue();
return 0==(m?Object.keys(m):[]).length?!1:!0};this.fromJsonObject=function(m){e=m.name;f=m.alias;a=m.dataType;c=m.appointedDataType;n=m.fromNode;void 0!=m.scale&&(d=m.scale);b=m.originalDataType;m.roundMode&&(g=m.roundMode);k=m.extensions;h.protectedFromJsonObject(m)};this.protectedFromJsonObject=function(m){};this.toJsonObject=function(){var m={};m.name=e;m.alias=f;m.dataType=a;m.fromNode=n;c&&(m.appointedDataType=c);void 0!=d&&(m.scale=d);g&&(m.roundMode=g);k&&(m.extensions=k);h.protectedToJsonObject(m);
return m};this.protectedToJsonObject=function(m){};var l=function(m){if(m!==z.DT_STRING&&m!==z.DT_INT&&m!==z.DT_NUMBER&&m!==z.DT_DATE&&m!==z.DT_DATETIME&&m!==z.DT_BOOLEAN)throw Error("IllegalArgument: "+m);};this.clone=function(){var m=new z;m.setName(e);a&&m.setDataType(a);m.setAlias(f);c&&m.setAppointedDataType(c);b&&m.setOriginalDataType(b);m.setFromNode(n);void 0!=d&&m.setScale(d);g&&m.setRoundMode(g);m.setExtensions(k);return m};this.equals=function(m){return e==m.getName()&&f==m.getAlias()&&
c==m.getAppointedDataType()&&d==m.getScale()&&g==m.getRoundMode()?!0:!1}}function ua(){var h,n=[],e=[],f;this.setOutputVertexId=function(a){h=a};this.addEdge=function(a){n.push(a)};this.addVertex=function(a){e.push(a)};this.getVertexes=function(){return e};this.setPreviewConfig=function(a){f=a};this.toJsonObject=function(){for(var a={},b=[],c=[],d=0,g=n.length;d<g;d++)b.push(n[d].toJsonObject());d=0;for(g=e.length;d<g;d++)c.push(e[d].toJsonObject());a.edges=b;a.vertexes=c;a.outputVertexId=h;a.previewConfig=
f?f.toJsonObject():null;return a};this.appendVertexAfter=function(a,b){if(null!=a&&null!=b){a:{for(var c=0;c<n.length;c++){var d=n[c];if(d.getFromId()==a.getId()){c=d.getToId();for(d=0;d<e.length;d++){var g=e[d];if(c==g.getId()){d=g;break a}}break}}d=null}c=null;for(g=0;g<n.length;g++){var k=n[g];if(k.getFromId()==a.getId()){c=k;break}}d?(d.getConfig&&(g=d.getConfig(),g.affectByPrevNode&&(g=g.getConfigCopy(),g.affectByPrevNode(a.getId(),b.getId()),d.setConfig(g))),g=new Ja,g.setFromId(b.getId()),
g.setToId(d.getId()),n.push(g)):h=b.getId();a=new Ja(a.getId(),b.getId());n.push(a);e.push(b);b=n.indexOf(c);-1<b&&n.splice(b,1)}}}function Ra(){var h,n,e,f;this.isExtractAllData=function(){return e};this.getExtractCount=function(){return h};this.setExtractCount=function(a){h=a};this.getPreviewCount=function(){return n};this.setPreviewCount=function(a){n=a};this.setExtractAllData=function(a){e=a};this.setPreviewAllData=function(a){f=a};this.setPreviewPartlyDataMode=function(a,b,c){h=b;n=c;e=a};this.setPreviewAllDataMode=
function(){f=e=!0};this.backup=function(){var a=new Ra;a.setExtractCount(h);a.setPreviewCount(n);a.setExtractAllData(e);a.setPreviewAllData(f);return a};this.toJsonObject=function(){var a={};a.extractCount=e?Ra.ALL_DATA_NUMBER:h;a.previewCount=f?Ra.ALL_DATA_NUMBER:n;return a}}function Ja(h,n){var e=h,f=n;this.setFromId=function(a){e=a};this.getFromId=function(){return e};this.setToId=function(a){f=a};this.getToId=function(){return f};this.toJsonObject=function(){var a={};a.fromId=e;a.toId=f;return a}}
function Ua(){var h=this,n,e;this.setId=function(f){n=f};this.getId=function(){return n};this.toJsonObject=function(){var f={};f.id=n;f.type=e;h.protectedToJson(f);return f};this.protectedToJson=function(f){};this.protectedMethod={setType:function(f){e=f}}}function mb(){Ua.call(this);var h,n,e;this.protectedMethod.setType(Ua.TYPE_SOURCE);this.setTable=function(f){h=f};this.setSource=function(f){n=f};this.setSelectedFields=function(f){e=f};this.protectedToJson=function(f){f.table=h.toJsonObject();
f.source=n.toJsonObject();if(e){for(var a=[],b=0;b<e.length;b++)a.push(e[b].toJsonObject());f.selectedFields=a}}}function Gb(){Ua.call(this);var h;this.setConfig=function(n){h=n};this.getConfig=function(){return h};this.protectedToJson=function(n){n.config=h.toJsonObject()}}function Va(){Gb.call(this);this.protectedMethod.setType(Ua.TYPE_TRANSFORM_FIELD_SELECT)}function ob(){Gb.call(this);this.protectedMethod.setType(Ua.TYPE_TRANSFORM_FIELD_SETTING)}function Bb(){Gb.call(this);this.protectedMethod.setType(Ua.TYPE_TRANSFORM_GROUP_BY)}
function Db(){Gb.call(this);this.protectedMethod.setType(Ua.TYPE_TRANSFORM_CUSTOM_GROUP)}function Hb(){Gb.call(this);this.protectedMethod.setType(Ua.TYPE_TRANSFORM_JOIN)}function qb(){Gb.call(this);this.protectedMethod.setType(Ua.TYPE_TRANSFORM_FILTER)}function Cb(){Gb.call(this);this.protectedMethod.setType(Ua.TYPE_TRANSFORM_COLUMN_TO_ROW)}function ma(){Gb.call(this);this.protectedMethod.setType(Ua.TYPE_TRANSFORM_SORT)}function xa(){Gb.call(this);this.protectedMethod.setType(Ua.TYPE_TRANSFORM_CALCULATED_FIELD)}
function ib(){Gb.call(this);this.protectedMethod.setType(Ua.TYPE_TRANSFORM_UNION)}function Pb(){var h=[],n,e,f=[];this.isValid=function(){return n};this.getCases=function(){return f};this.getCheckedNodeIds=function(){return h};this.isModelEmpty=function(){return e};this.fromJsonObject=function(a){n=a.valid;h=a.nodeIds;e=a.modelIsEmpty;if(a=a.cases){f=[];for(var b=new aa,c=0;c<a.length;c++){var d=a[c],g=b.getInvalidityCase(d.type);d&&(g.fromJsonObject(d),f.push(g))}}}}function aa(){this.getInvalidityCase=
function(h){switch(h){case Y.TYPE_MULTI_OUTPUT:return new t;case Y.TYPE_LACK_OUTPUT:return new H;case Y.TYPE_INVALID_CONFIG:return new Q;case Y.TYPE_LACK_INPUT:return new ba;case Y.TYPE_INVALID_UPWARDNODE:return new Sa;case Y.TYPE_INVALID_SOURCE:return new Ya;case Y.TYPE_TABLE_NO_FIELD:return new kb;case Y.TYPE_TABLE_NO_AUTHORITY:return new Ta;case Y.TYPE_MODEL_DELETED:return new ca;case Y.TYPE_MODEL_NO_DATA_PERMISSION:return new va;case Y.TYPE_MODEL_INCOMPLETE:return new Na;case Y.TYPE_MODEL_DAMAGE:return new Za;
case Y.TYPE_MODEL_CYCLE_REFERENCE:return new hb;case Y.TYPE_INCOMPLETE_MATERIALIZED_CONFIG:return new Ib}}}function Y(){var h,n=this;this.getType=function(){return h};this.fromJsonObject=function(e){h=e.type;n.protectedFromJsonObject(e)};this.protectedFromJsonObject=function(e){}}function t(){Y.call(this);var h=[];this.protectedFromJsonObject=function(n){h=n.outputNodes};this.getOutputNodeIds=function(){return h}}function H(){Y.call(this)}function Q(){Y.call(this);var h;this.protectedFromJsonObject=
function(n){h=n.nodeIds};this.getNodeIds=function(){return h}}function Ta(){Y.call(this);var h;this.protectedFromJsonObject=function(n){h=n.nodeIds};this.getNodeIds=function(){return h}}function ca(){Y.call(this);var h;this.protectedFromJsonObject=function(n){h=n.nodeIds};this.getNodeIds=function(){return h}}function va(){Y.call(this);var h;this.protectedFromJsonObject=function(n){h=n.nodeIds};this.getNodeIds=function(){return h}}function Na(){Y.call(this);var h;this.protectedFromJsonObject=function(n){h=
n.nodeIds};this.getNodeIds=function(){return h}}function Za(){Y.call(this);var h;this.protectedFromJsonObject=function(n){h=n.nodeIds};this.getNodeIds=function(){return h}}function hb(){Y.call(this);var h,n;this.protectedFromJsonObject=function(e){h=e.nodeIds;n=e.cycleRefModelNames};this.getNodeIds=function(){return h};this.getCycleRefModelNames=function(){return n}}function ba(){Y.call(this);var h;this.protectedFromJsonObject=function(n){h=n.nodeIds};this.getNodeIds=function(){return h}}function Sa(){Y.call(this);
var h;this.protectedFromJsonObject=function(n){h=n.nodeIds};this.getNodeIds=function(){return h}}function Ya(){Y.call(this);var h;this.protectedFromJsonObject=function(n){h=n.nodeIds};this.getNodeIds=function(){return h}}function kb(){Y.call(this);var h;this.protectedFromJsonObject=function(n){h=n.nodeIds};this.getNodeIds=function(){return h}}function Ib(){Y.call(this)}function Wa(){var h,n=[],e=[];this.getField=function(f){return n[f]};this.getAllField=function(){return n};this.getColumnCount=function(){return n?
n.length:0};this.getOneRow=function(f){return e[f]};this.getRowCount=function(){return e?e.length:0};this.getNodeId=function(){return h};this.fromJsonObject=function(f){for(var a=f.fields,b=0;b<a.length;b++){var c=new z;c.fromJsonObject(a[b]);n.push(c)}e=f.data;h=f.nodeId};this.toJsonObject=function(){var f={};f.data=e;f.nodeId=h;for(var a=[],b=0;b<n.length;b++)a.push(n[b].toJsonObject());f.fields=a;return f}}function jb(){var h=jb.TYPE_ONCE,n=jb.STRATEGY_FULL,e,f;this.setType=function(a){if(a===
jb.TYPE_ONCE||a===jb.TYPE_TIMING)h=a;else throw Error("IllegalArgument: "+a);};this.getType=function(){return h};this.setStrategy=function(a){if(a===jb.STRATEGY_FULL||a===jb.STRATEGY_INCREMENTAL)n=a;else throw Error("IllegalArgument: "+a);};this.getStrategy=function(){return n};this.setSchedule=function(a){e=a};this.getSchedule=function(){return e};this.setBasedFields=function(a){f=a};this.getBasedFields=function(){return f};this.copy=function(){var a=new jb;a.setType(h);a.setStrategy(n);e&&a.setSchedule(e.copy());
if(f){for(var b=[],c=0;c<f.length;c++)b.push(f[c].copy());a.setBasedFields(b)}return a};this.toJsonObject=function(){var a={};a.type=h;a.strategy=n;e&&(a.schedule=e.toJsonObject());if(f){for(var b=[],c=0;c<f.length;c++)b.push(f[c].toJsonObject());a.basedFields=b}return a};this.fromJsonObject=function(a){h=a.type;n=a.strategy;a.schedule&&(e=new B,e.fromJsonObject(a.schedule));if(a=a.basedFields){f=[];for(var b=0;b<a.length;b++){var c=new pb;c.fromJsonObject(a[b]);f.push(c)}}};this.equals=function(a){if(a instanceof
jb){if(h!==a.getType()||n!==a.getStrategy())return!1;var b=a.getSchedule();if(e&&!b||!e&&b)return!1;if(e&&b){var c=e.toJsonObject();b=b.toJsonObject();for(var d in c)if(c[d]!==b[d])return!1}a=a.getBasedFields();if(!f&&!a)return!0;if(!f||!a||f.length!==a.length)return!1;for(c=0;c<f.length;c++)if(!f[c].equals(a[c]))return!1;return!0}return!1}}function pb(){var h,n,e,f;this.setTableId=function(a){h=a};this.getTableId=function(){return h};this.setTableName=function(a){n=a};this.getTableName=function(){return n};
this.setName=function(a){e=a};this.getName=function(){return e};this.setAlias=function(a){f=a};this.getAlias=function(){return f};this.copy=function(){var a=new pb;a.setTableId(h);a.setTableName(n);a.setName(e);a.setAlias(f);return a};this.toJsonObject=function(){var a={};a.tableId=h;a.tableName=n;a.name=e;a.alias=f;return a};this.fromJsonObject=function(a){h=a.tableId;n=a.tableName;e=a.name;f=a.alias};this.equals=function(a){return a instanceof pb?h===a.getTableId()&&n===a.getTableName()&&e===a.getName()&&
f===a.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 S=com.kingdee.bos.qing.modeler.designer;S.QingModeler=function(){var h;this.setModelerModel=
function(n){h=n};this.getModelerModel=function(){return h};this.toJsonObject=function(){var n={};n.modelerModel=h.toJsonObject();return n};this.fromJsonObject=function(n){(n=n.modelerModel)&&n.type==qa.TYPE_TABLE_MODELER&&(h=new Ca,h.fromJsonObject(n))}};S.ModelerModel=qa;S.Table=Ga;S.DesignTimeSource=da;S.Integration=function(){var h,n,e,f,a,b=!0;this.setMapTableException=function(c){a=c};this.getMapTableException=function(){return a};this.setMapSourceType=function(c){f=c};this.getMapSourceType=
function(){return f};this.setMapSourcePermission=function(c){e=c};this.getMapSourcePermission=function(){return e};this.setModelName=function(c){h=c};this.getModelName=function(){return h};this.setModelDesc=function(c){n=c};this.getModelDesc=function(){return n};this.setModelIsValid=function(c){b=c};this.isValidModel=function(){return b}};S.Page=ab;S.TableModeler=Ca;S.Config=Z;S.JoinConfig=r;S.FilterConfig=P;S.FilterItem=G;S.UnionConfig=ha;S.FieldSettingConfig=O;S.NodeItem=$a;S.UnionItem=Ia;S.UnionInnerItem=
ka;S.ColumnToRowConfig=za;S.ColumnToRowItem=ea;S.SortConfig=fa;S.SortItem=W;S.GroupFieldItem=Ha;S.AggregateFieldItem=Qa;S.TableNode=vb;S.FieldSelectNode=Nb;S.FieldSettingNode=ub;S.JoinNode=Ma;S.GroupByNode=nb;S.CustomGroupNode=wb;S.SortNode=Aa;S.FilterNode=Jb;S.ColumnToRowNode=Fa;S.CalculatedFieldNode=sa;S.UnionNode=Mb;S.CalculatedField=ia;S.Field=z;S.CustomGroupConfig=R;S.NumberGroupItem=wa;S.PreviewConfig=Ra;S.ModelerValidity=Pb;S.LackInputNodeCase=ba;S.InvalidConfigCase=Q;S.InvalidUpwardNodeCase=
Sa;S.AbstractInvalidityCase=Y;S.InvalidSourceCase=Ya;S.TableNoFieldCase=kb;S.TableNoAuthorityCase=Ta;S.ModelDeletedCase=ca;S.ModelNoDataPermissionCase=va;S.ModelInCompleteCase=Na;S.ModelDamageCase=Za;S.ModelCycleReferenceCase=hb;S.ExecuteResult=function(){var h,n=[],e,f,a;this.getNodeId=function(){return h};this.getValidity=function(){return f};this.getPreviewData=function(){return e};this.getFields=function(){return n};this.getTimestamp=function(){return a};this.fromJsonObject=function(b){h=b.nodeId;
a=b.timestamp;var c=b.validity;c&&(f=new Pb,f.fromJsonObject(c));if(c=b.previewData)e=new Wa,e.fromJsonObject(c);if(b=b.fields)for(c=0;c<b.length;c++){var d=b[c],g=new z;g.fromJsonObject(d);n.push(g)}}};S.UserSQL=la;S.FieldValues=function(){var h=[];this.setValues=function(n){h=n};this.getValues=function(){return h};this.fromJsonObject=function(n){(n=n.fieldValues)&&(h=n.values)}};S.MaterializedConfig=jb;S.BasedField=pb;S.PreviewData=Wa;var db,U,B;(function(){var h=com.kingdee.bos.qing.common;db=
h.RelativePeriodModel;h=com.kingdee.bos.qing.common.ui;U=h.RelativePeriodPanel;h=com.kingdee.bos.qing.schedule;B=h.QingSchedule})();S.ModelConverter=new function(){var h=this;this.convertToRuntimeModel=function(a,b){var c=new ua,d=[],g=[b];e(a,b,g,d);for(var k=0,l=d.length;k<l;k++){var m=d[k];m=new Ja(m.getFromId(),m.getToId());c.addEdge(m)}k=0;for(l=g.length;k<l;k++){var p=void 0;d=a;m=g[k];if(m instanceof vb){p=new mb;p.setId(m.getId());var w=m.getTableUid();w=d.getTable(w);var u=w.getSourceUid();
u=d.getSource(u);p.setTable(w);p.setSource(u);p.setSelectedFields(h.getSelectedFieldsWhenSelectAll(d,m));d=p}else{switch(m.getType()){case Z.TYPE_FIELD_SELECT:p=new Va;break;case Z.TYPE_FIELD_SETTING:p=new ob;break;case Z.TYPE_GROUP_BY:p=new Bb;break;case Z.TYPE_CUSTOM_GROUP:p=new Db;break;case Z.TYPE_JOIN:p=new Hb;break;case Z.TYPE_FILTER:p=new qb;break;case Z.TYPE_COLUMN_TO_ROW:p=new Cb;break;case Z.TYPE_SORT:p=new ma;break;case Z.TYPE_CALCULATED_FIELD:p=new xa;break;case Z.TYPE_UNION:p=new ib}p?
(p.setId(m.getId()),p.setConfig(m.getConfig()),d=p):d=void 0}d&&c.addVertex(d)}c.setOutputVertexId(b.getId());b=c.getVertexes();d=a.getAllNodes();a=[];g={};for(k=0;k<b.length;k++)for(l=b[k],m=0;m<d.length;m++)if(p=d[m],w=p.getFieldSettingConfig(),p.getId()==l.getId()&&w){a.push(l);g[p.getId()]=w;break}for(k=0;k<a.length;k++)l=a[k],b=new ob,b.setId(l.getId()+"FIELDSETTING"),b.setConfig(g[l.getId()]),c.appendVertexAfter(l,b);return c};this.getUpwardNode=function(a,b,c){var d=[];!c&&d.push(b);e(a,b,
d);return d};this.getDownwardNode=function(a,b,c){var d=[];!c&&d.push(b);f(a,b,d);return d};this.getUpDownwardNode=function(a,b,c){return n(a,b,c)};this.getLinkableNodes=function(a,b){b=n(a,b);var c=a.getAllNodes();if(c.length==b.length)return[];for(var d=[],g=0;g<c.length;g++){for(var k=c[g],l=!1,m=0;m<b.length;m++)if(b[m].getId()==k.getId()){l=!0;break}l||(l=a.getRelatedLine(k,Ca.GET_LINE_STRATEGY_OUT))&&0!=l.length||d.push(k)}return d};var n=function(a,b,c){var d=[];!c&&d.push(b);e(a,b,d);f(a,
b,d);return d};this.getOutputNode=function(a,b){for(var c=a.getRelatedLine(b,Ca.GET_LINE_STRATEGY_OUT);0<c.length;)b=a.getNode(c[0].getToId()),c=a.getRelatedLine(b,Ca.GET_LINE_STRATEGY_OUT);return b};var e=function(a,b,c,d){b=a.getRelatedLine(b,Ca.GET_LINE_STRATEGY_IN);for(var g=0,k=b.length;g<k;g++){var l=b[g];d&&d.push(l);l=a.getNode(l.getFromId());c.push(l);e(a,l,c,d)}},f=function(a,b,c){b=a.getRelatedLine(b,Ca.GET_LINE_STRATEGY_OUT);for(var d=0,g=b.length;d<g;d++){var k=a.getNode(b[d].getToId());
c.push(k);f(a,k,c)}};this.treatAsSameNode=function(a,b){return a==b||a+"FIELDSETTING"==b||a==b+"FIELDSETTING"?!0:!1};this.getSelectedFieldsWhenSelectAll=function(a,b){var c=b.getSelectedFields();if(c)return c;c=[];a=a.getFieldNumberMap();a=Object.keys(a);for(var d=0;d<a.length;d++){var g=a[d],k=g.split("_");if(!(2>k.length)&&(k=k[0],k==b.getId())){var l=new z;l.setFromNode(k);l.setName(g.substring(k.length+1));c.push(l)}}return c}};qa.TYPE_TABLE_MODELER="table";qa.TYPE_RELATION_MODELER="relation";
qa.TYPE_METRIC_MODELER="metric";qa.KEY_UPDATE_TABLE="update_table";qa.KEY_PAGE_SIZE="page_change_size";qa.KEY_ADD_PREPARED_SOURCE="add_prepared_source";qa.KEY_REMOVE_PREPARED_SOURCE="remove_prepared_source";qa.KEY_SET_PREPARED_SOURCE="set_prepared_source";qa.KEY_TABLE_NODE_SELECT_FIELD="table_node_select_field";Ca.KEY_ADD_NODE="page_add_node";Ca.KEY_REMOVE_NODE="page_remove_node";Ca.KEY_LINK_NODE="page_link_node";Ca.KEY_BREAK_LINK="page_break_link";Ca.KEY_NODE_CHANGE_POSITION="node_change_position";
Ca.KEY_ADD_LINE="page_add_line";Ca.KEY_REMOVE_LINE="page_remove_line";Ca.KEY_NODE_CHANGE_ALIAS="node_change_alias";Ca.KEY_NODE_RELAYOUT="node_relayout";Ca.KEY_CHANGE_TRANSFORM_CONFIG="change_transform_config_";Ca.KEY_TRANSFORM_JOIN=Ca.KEY_CHANGE_TRANSFORM_CONFIG+"join";Ca.KEY_TRANSFORM_SELECT_FIELD=Ca.KEY_CHANGE_TRANSFORM_CONFIG+"select_field";Ca.KEY_TRANSFORM_FIELD_SETTING=Ca.KEY_CHANGE_TRANSFORM_CONFIG+"field_setting";Ca.KEY_TRANSFORM_FILTER=Ca.KEY_CHANGE_TRANSFORM_CONFIG+"filter";Ca.KEY_TRANSFORM_COLUMN_TO_ROW=
Ca.KEY_CHANGE_TRANSFORM_CONFIG+"column_to_row";Ca.KEY_TRANSFORM_SORT=Ca.KEY_CHANGE_TRANSFORM_CONFIG+"sort";Ca.KEY_TRANSFORM_GROUP_BY=Ca.KEY_CHANGE_TRANSFORM_CONFIG+"group_by";Ca.KEY_TRANSFORM_CALCULATED_FIELD=Ca.KEY_CHANGE_TRANSFORM_CONFIG+"calculated_field";Ca.KEY_TRANSFORM_CUSTOM_GROUP=Ca.KEY_CHANGE_TRANSFORM_CONFIG+"custom_group";Ca.KEY_TRANSFORM_UNION=Ca.KEY_CHANGE_TRANSFORM_CONFIG+"union";Ca.KEY_CHANGE_FIELD_NUMBER="change_field_number";Ca.GET_LINE_STRATEGY_IN=1;Ca.GET_LINE_STRATEGY_OUT=16;Ca.GET_LINE_STRATEGY_ALL=
17;S.TableNodeFactory=new function(){this.createTableNode=function(h){var n=new vb;n.setId(S.UIDHelper.getUID(S.UIDHelper.NS_NODE));n.setTableUid(h.getUid());return n}};S.TransformNodeFactory=new function(){this.createTransformNode=function(h){switch(h){case Z.TYPE_FIELD_SELECT:h=new Nb;h.setConfig(new ta);break;case Z.TYPE_FIELD_SETTING:h=new ub;h.setConfig(new O);break;case Z.TYPE_FILTER:h=new Jb;h.setConfig(new P);break;case Z.TYPE_COLUMN_TO_ROW:h=new Fa;h.setConfig(new za);break;case Z.TYPE_SORT:h=
new Aa;h.setConfig(new fa);break;case Z.TYPE_GROUP_BY:h=new nb;h.setConfig(new La);break;case Z.TYPE_CALCULATED_FIELD:h=new sa;h.setConfig(new C);break;case Z.TYPE_CUSTOM_GROUP:h=new wb;h.setConfig(new R);break;case Z.TYPE_JOIN:h=new Ma;h.setConfig(new r);break;case Z.TYPE_UNION:h=new Mb;h.setConfig(new ha);break;default:h=new Nb}h.setId(S.UIDHelper.getUID(S.UIDHelper.NS_NODE));return h}};sb.TYPE_TABLE="table";sb.TYPE_TRANSFORM="transform";Z.TYPE_FIELD_SELECT="field_select";Z.TYPE_FIELD_SETTING="field_setting";
Z.TYPE_FILTER="filter";Z.TYPE_COLUMN_TO_ROW="column_to_row";Z.TYPE_SORT="sort";Z.TYPE_GROUP_BY="group_by";Z.TYPE_CALCULATED_FIELD="calculated_field";Z.TYPE_CUSTOM_GROUP="custom_group";Z.TYPE_JOIN="join";Z.TYPE_UNION="union";R.NUMBER="NUMBER";R.STRING="STRING";S.CustomGroupFactory=new function(){this.createGroupByFieldType=function(h,n){h===R.STRING?(h=new X,h.setName(n.name),n.members&&h.setMembers(n.members)):(h=new J,h.setName(n.name));return h}};wa.COMPARE_GREATER="GREATER";wa.COMPARE_GREATER_EQUAL=
"GREATER_EQUAL";wa.COMPARE_LESS="LESS";wa.COMPARE_LESS_EQUAL="LESS_EQUAL";S.DateGroupType=new function(){var h=com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(S);this.dateTypeTextConvert=function(n){switch(n){case S.DateGroupType.YEAR:n=h.get("year","\u5e74");break;case S.DateGroupType.QUARTER:n=h.get("quarter","\u5b63\u5ea6");break;case S.DateGroupType.MONTH:n=h.get("month","\u6708");break;case S.DateGroupType.DAY:n=h.get("day","\u65e5");break;case S.DateGroupType.YEAR_QUARTER:n=
h.get("yearQuarter","\u5e74\u5b63");break;case S.DateGroupType.YEAR_MONTH:n=h.get("yearMonth","\u5e74\u6708");break;case S.DateGroupType.YEAR_MONTH_DAY:n=h.get("yearMonthDay","\u5e74\u6708\u65e5");break;default:throw Error("Unknown DateType: "+n);}return n}};S.DateGroupType.YEAR="YEAR";S.DateGroupType.QUARTER="QUARTER";S.DateGroupType.MONTH="MONTH";S.DateGroupType.DAY="DAY";S.DateGroupType.YEAR_QUARTER="YEAR_QUARTER";S.DateGroupType.YEAR_MONTH="YEAR_MONTH";S.DateGroupType.YEAR_MONTH_DAY="YEAR_MONTH_DAY";
Qa.SUM="SUM";Qa.AVG="AVG";Qa.MAX="MAX";Qa.MIN="MIN";Qa.COUNT="COUNT";Qa.DISTINCT_COUNT="DISTINCT_COUNT";S.CalculateByDateType=new function(){var h=com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(S);this.calculateByDateTextConvert=function(n){switch(n){case S.CalculateByDateType.LAST_PERIOD_VALUE:n=h.get("lastPeriodValue","\u4e0a\u671f\u503c");break;case S.CalculateByDateType.LAST_PERIOD_RATIO:n=h.get("lastPeriodRatio","\u73af\u6bd4\u589e\u957f\u7387");break;case S.CalculateByDateType.SAME_PERIOD_LAST_YEAR_VALUE:n=
h.get("samePeriodLastYearValue","\u53bb\u5e74\u540c\u671f\u503c");break;case S.CalculateByDateType.SAME_PERIOD_LAST_YEAR_RATIO:n=h.get("samePeriodLastYearRatio","\u540c\u6bd4\u589e\u957f\u7387");break;case S.CalculateByDateType.RUNNINGSUM:n=h.get("runningSum","\u7d2f\u8ba1");break;case S.CalculateByDateType.RUNNINGSUMY:n=h.get("runningSumY","\u5e74\u5185\u7d2f\u8ba1");break;default:throw Error("Unknown calculateByDateType: "+n);}return n}};S.CalculateByDateType.LAST_PERIOD_VALUE="LP_V";S.CalculateByDateType.LAST_PERIOD_RATIO=
"LP";S.CalculateByDateType.SAME_PERIOD_LAST_YEAR_VALUE="SPLY_V";S.CalculateByDateType.SAME_PERIOD_LAST_YEAR_RATIO="SPLY";S.CalculateByDateType.RUNNINGSUM="RS";S.CalculateByDateType.RUNNINGSUMY="RSY";r.TYPE_INNER_JOIN="innerJoin";r.TYPE_LEFT_JOIN="leftJoin";r.TYPE_RIGHT_JOIN="rightJoin";r.TYPE_FULL_JOIN="fullJoin";G.REG_NUMBER=/^-?\d+(\.\d+)?$/;G.REG_DATETIME=/^-?\d+(\.\d+)?$/;G.COMPARE_EQUAL="EQUAL";G.COMPARE_NOT_EQUAL="NOT_EQUAL";G.COMPARE_GREATER="GREATER";G.COMPARE_GREATER_EQUAL="GREATER_EQUAL";
G.COMPARE_LESS="LESS";G.COMPARE_LESS_EQUAL="LESS_EQUAL";G.COMPARE_INCLUDE="INCLUDE";G.COMPARE_NOT_INCLUDE="NOT_INCLUDE";G.COMPARE_START_WITH="START_WITH";G.COMPARE_END_WITH="END_WITH";G.COMPARE_NULL="NULL";G.COMPARE_NOT_NULL="NOT_NULL";G.COMPARE_IN="IN";G.COMPARE_NOT_IN="NOT_IN";G.COMPARE_RELATIVE_DATE_RANGE="RELATIVE_DATE_RANGE";G.LOGIC_AND="AND";G.LOGIC_OR="OR";G.COMPARES_FOR_STRING=[G.COMPARE_EQUAL,G.COMPARE_NOT_EQUAL,G.COMPARE_INCLUDE,G.COMPARE_NOT_INCLUDE,G.COMPARE_START_WITH,G.COMPARE_END_WITH,
G.COMPARE_NULL,G.COMPARE_NOT_NULL,G.COMPARE_IN,G.COMPARE_NOT_IN];G.COMPARES_FOR_ENUM=[G.COMPARE_EQUAL,G.COMPARE_NOT_EQUAL,G.COMPARE_NULL,G.COMPARE_NOT_NULL,G.COMPARE_IN,G.COMPARE_NOT_IN];G.COMPARES_FOR_NUMBER=[G.COMPARE_EQUAL,G.COMPARE_NOT_EQUAL,G.COMPARE_GREATER,G.COMPARE_GREATER_EQUAL,G.COMPARE_LESS,G.COMPARE_LESS_EQUAL,G.COMPARE_NULL,G.COMPARE_NOT_NULL,G.COMPARE_IN,G.COMPARE_NOT_IN];G.COMPARES_FOR_DATETIME=[G.COMPARE_RELATIVE_DATE_RANGE,G.COMPARE_EQUAL,G.COMPARE_NOT_EQUAL,G.COMPARE_GREATER,G.COMPARE_GREATER_EQUAL,
G.COMPARE_LESS,G.COMPARE_LESS_EQUAL,G.COMPARE_NULL,G.COMPARE_NOT_NULL];G.COMPARES_FOR_BOOLEAN=[G.COMPARE_EQUAL,G.COMPARE_NOT_EQUAL,G.COMPARE_NULL,G.COMPARE_NOT_NULL];G.isCompareOpWithoutValue=function(h){return h==G.COMPARE_NULL||h==G.COMPARE_NOT_NULL};G.isCompareOpWithinOrNotWithinValue=function(h){return h==G.COMPARE_IN||h==G.COMPARE_NOT_IN};G.isCompareOpRelativeDateRangeValue=function(h){return h==G.COMPARE_RELATIVE_DATE_RANGE};G.getSelectableCompares=function(h,n){switch(h){case z.DT_STRING:return n?
G.COMPARES_FOR_ENUM:G.COMPARES_FOR_STRING;case z.DT_NUMBER:case z.DT_INT:return G.COMPARES_FOR_NUMBER;case z.DT_DATE:case z.DT_DATETIME:return G.COMPARES_FOR_DATETIME;case z.DT_BOOLEAN:return G.COMPARES_FOR_BOOLEAN;default:throw Error("Unknown DataType");}};G.FiltersCheckingResult=function(h,n){var e=n;this.getFiltersErrorRow=function(){return h};this.getPrompt=function(){return e};this.setPrompt=function(f){e=f}};W.ORDER_ASC="ASC";W.ORDER_DESC="DESC";z.DT_BOOLEAN="BOOLEAN";z.DT_INT="INT";z.DT_NUMBER=
"NUMBER";z.DT_DATE="DATE";z.DT_DATETIME="DATETIME";z.DT_STRING="STRING";z.ROUND_MODE_UP="ROUND_UP";z.ROUND_MODE_DOWN="ROUND_DOWN";z.ROUND_MODE_HALF_UP="ROUND_HALF_UP";z.BOOLEAN_TRUE="true";z.BOOLEAN_FALSE="false";z.EXTENSION_BIZ_FIELD_ENUM_KEY="bizFieldEnumKey";z.EXTENSION_IS_MUL_BASE_DATA="isMulBaseData";z.EXTENSION_IS_PK="isPK";z.EXTENSION_SOURCE_FIELD_ALIAS="sourceFieldAlias";S.UIDHelper=new function(){var h,n={};this.init=function(d){n={};h=d;f();a();b();c()};this.getUID=function(d){var g=n[d];
g||(g=0);g+=1;n[d]=g;return d+g};var e=function(d,g,k){for(var l=0,m=0;m<g.length;m++)for(var p=k(g[m]),w=0;w<p.length;w++){var u=p[w];l=Math.max(l,parseInt(u.slice(d.length,u.length)))}n[d]=l},f=function(){var d=h.getAllNodes();d&&e(S.UIDHelper.NS_NODE,d,function(g){var k=[];k.push(g.getId());g instanceof vb||(g=g.getNodeIdInConfig(),k=k.concat(g));return k})},a=function(){var d=h.getAllSource();d&&e(S.UIDHelper.NS_SOURCE,d,function(g){return[g.getId()]})},b=function(){var d=h.getAllTable(!0);d&&
e(S.UIDHelper.NS_TABLE,d,function(g){return[g.getUid()]})},c=function(){var d=h.getAllLines();d&&e(S.UIDHelper.NS_LINE,d,function(g){return[g.getId()]})}};S.UIDHelper.NS_NODE="n";S.UIDHelper.NS_LINE="l";S.UIDHelper.NS_TABLE="t";S.UIDHelper.NS_SOURCE="s";Ra.ALL_DATA_NUMBER=-1;Ua.TYPE_SOURCE="source";Ua.TYPE_TRANSFORM_FIELD_SELECT="field_select";Ua.TYPE_TRANSFORM_FIELD_SETTING="field_setting";Ua.TYPE_TRANSFORM_GROUP_BY="group_by";Ua.TYPE_TRANSFORM_CUSTOM_GROUP="custom_group";Ua.TYPE_TRANSFORM_FILTER=
"filter";Ua.TYPE_TRANSFORM_COLUMN_TO_ROW="column_to_row";Ua.TYPE_TRANSFORM_SORT="sort";Ua.TYPE_TRANSFORM_JOIN="join";Ua.TYPE_TRANSFORM_CALCULATED_FIELD="calculated_field";Ua.TYPE_TRANSFORM_UNION="union";Y.TYPE_MULTI_OUTPUT="multiOutput";Y.TYPE_LACK_OUTPUT="lackOutputNode";Y.TYPE_INVALID_CONFIG="invalidConfig";Y.TYPE_LACK_INPUT="lackInputNode";Y.TYPE_INVALID_UPWARDNODE="invalidUpwardNode";Y.TYPE_INVALID_SOURCE="invalidSource";Y.TYPE_TABLE_NO_FIELD="tableNoField";Y.TYPE_TABLE_NO_AUTHORITY="tableNoAuthority";
Y.TYPE_DBCONNECTION_FAIL="DBConnectionFail";Y.TYPE_DBSOURCE_NO_AUTHORITY="DBSourceNoAuthority";Y.TYPE_SOURCE_NOT_EXISTS="sourceNotExists";Y.TYPE_TABLE_NOT_EXISTS="tableNotExists";Y.TYPE_MODEL_DELETED="modelDeleted";Y.TYPE_MODEL_NO_DATA_PERMISSION="modelNoDataPermission";Y.TYPE_MODEL_INCOMPLETE="modelInComplete";Y.TYPE_MODEL_DAMAGE="modelDamage";Y.TYPE_MODEL_CYCLE_REFERENCE="modelCycleReference";Y.TYPE_INCOMPLETE_MATERIALIZED_CONFIG="incompleteMaterializedConfig";jb.TYPE_ONCE="once";jb.TYPE_TIMING=
"timing";jb.STRATEGY_FULL="full";jb.STRATEGY_INCREMENTAL="incremental";S.ENTITY_SEPARATOR="@#!&@"})();(function(){function qa(){var sb,vb,Ab,Yb,Nb;this.setFromTable=function(ub){sb=ub};this.getFromTable=function(){return sb};this.setFromProperty=function(ub){Ab=ub};this.getFromProperty=function(){return Ab};this.setToTable=function(ub){vb=ub};this.getToTable=function(){return vb};this.setToProperty=function(ub){Yb=ub};this.getToProperty=function(){return Yb};this.setRelated=function(ub){Nb=ub};this.getRelated=function(){return Nb};this.fromJsonObject=function(ub){sb=ub.fromModel;vb=ub.toModel;Ab=
ub.fromField;Yb=ub.toField;Nb=ub.related};this.toJsonObject=function(ub){ub={};ub.fromModel=sb;ub.toModel=vb;ub.fromField=Ab;ub.toField=Yb;ub.related=Nb;return ub}}function Ca(){var sb=this,vb,Ab,Yb;this.setUid=function(Nb){vb=Nb};this.getUid=function(){return vb};this.setId=function(Nb){Yb=Nb};this.getId=function(){return Yb};this.getSourceType=function(){return Ab};this.fromJsonObject=function(Nb){vb=Nb.id;Ab=Nb.type;sb.protectedFromJsonObject(Nb)};this.toJsonObject=function(){var Nb={};Nb.type=
Ab;Nb.id=vb;sb.protectedToJsonObject(Nb);return Nb};this.protectedToJsonObject=function(Nb){};this.protectedFromJsonObject=function(Nb){};this.protectedMethod={setSourceType:function(Nb){Ab=Nb}}}"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 cb=com.kingdee.bos.qing.modeler.designer;cb.AbstractModelerSource=Ca;cb.ModelSetDataSource=function(){var sb,vb,Ab,Yb,Nb,ub,Jb;this.getErrorMessage=function(){return Jb};this.getSpecificType=function(){return ub};this.getSourceName=function(){return sb};this.setSourceName=function(Fa){sb=Fa};this.getId=function(){return vb};this.setId=function(Fa){vb=Fa};this.setCreatorName=function(Fa){Ab=Fa};this.getCreatorName=
function(){return Ab};this.setCreateTime=function(Fa){Yb=Fa};this.getCreateTime=function(){return Yb};this.setSourceType=function(Fa){Nb=Fa};this.getSourceType=function(){return Nb};this.fromJsonObject=function(Fa){vb=Fa.id;sb=Fa.sourceName;Nb=Fa.sourceType;Yb=Fa.createTime;Ab=Fa.creatorName;var Aa=Fa.source;Nb===Ca.SOURCE_TYPE_PUBLIC_DATA_SOURCE&&"DB"===Aa.sourceType?ub=Aa.publicSourceType:Nb===Ca.SOURCE_TYPE_MODELSET_DB_SOURCE&&Aa.dbType?ub=Aa.dbType:Nb===Ca.SOURCE_TYPE_MODELSET_FILE_SOURCE&&Aa.fileType&&
(ub=Aa.fileType);Fa.errorMessage&&(Jb=Fa.errorMessage)}};cb.Meta=function(){var sb,vb,Ab,Yb,Nb;this.setTableNode=function(ub){sb=ub};this.getTableNode=function(){return sb};this.setPropertyMap=function(ub){vb=ub};this.getPropertyMap=function(){return vb};this.setSourceType=function(ub){Ab=ub};this.getSourceType=function(){return Ab};this.setRelations=function(ub){Yb=ub};this.getRelations=function(){return Yb};this.setErrorMap=function(ub){Nb=ub};this.getErrorMap=function(){return Nb};this.fromJsonObject=
function(ub){sb=ub.tableNode;if(vb=ub.propertiesMap)for(var Jb in vb){var Fa=vb[Jb];if(Fa&&0<Fa.length){for(var Aa=[],nb=0;nb<Fa.length;nb++){var wb=new ab,sa=Fa[nb];wb.fromJsonObject(Fa[nb]);sa.number&&wb.setName(sa.number);Aa.push(wb)}vb[Jb]=Aa}}Ab=ub.sourceType;if((Jb=ub.relations)&&0<Jb.length)for(Yb=[],nb=0;nb<Jb.length;nb++)Fa=new qa,Fa.fromJsonObject(Jb[nb]),Yb.push(Fa);Nb=ub.errorMap}};var ab=cb.Field;qa.R_1_1="From1To1";qa.R_1_N="From1ToN";qa.R_N_1="FromNTo1";qa.KFW_FROM=1;qa.KFW_TO=2;qa.KEY_FROM_ENTITY=
"fromEntity";qa.KEY_FROM_PROPERTY="fromProperty";qa.KEY_FROM_PROPERTY_ALIAS_CHANED="fromPropertyAliasChanged";qa.KEY_TO_PROPERTY_ALIAS_CHANED="toPropertyAliasChanged";qa.KEY_TO_ENTITY="toEntity";qa.KEY_TO_PROPERTY="toProperty";qa.KEY_RELATED="related";Ca.SOURCE_TYPE_PUBLIC_DATA_SOURCE="PublicDBSource";Ca.SOURCE_TYPE_CURRENT_ENTITY_SOURCE="ERPCloudEntity";Ca.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE="ERPCloudDBCenter";Ca.SOURCE_TYPE_MODELSET_FILE_SOURCE="FileSource";Ca.SOURCE_TYPE_MODELSET_DB_SOURCE="DBSource";
Ca.SOURCE_TYPE_MODEL_SET_SOURCE="ModelSet";Ca.SOURCE_TYPE_OPEN_API_SOURCE="OpenAPI"})();(function(){function qa(ra,Z,Ka,ta){sb.call(this,ra,Z,Ka,ta);var O=this.protectedMethod;this.loadAlternativeSource=function(R){O.remote("loadAlternativeSource",{sourceType:R})};this.loadTables=function(R){R={source:JSON.stringify(R.toJsonObject()),needFilterMetric:!0};O.remote("loadTables",R)};this.checkKSQLSupport=function(R,na){O.remote("checkKSQLSupport",{sourceId:R,namespace:na})};this.getMeta=function(R,na){R={source:JSON.stringify(R.toJsonObject()),table:JSON.stringify(na.toJsonObject())};O.remote("getMeta",
R)};this.getFieldInfo=function(R){R={model:JSON.stringify(R.toJsonObject()),timestamp:(new Date).getTime()};O.remote("getFieldInfo",R)};this.getPreviewData=function(R){R={model:JSON.stringify(R.toJsonObject())};O.remote("getPreviewData",R)};this.getFieldValues=function(R,na){R={model:JSON.stringify(R.toJsonObject()),fields:JSON.stringify(na)};O.remote("getFieldValues",R)};this.checkModelerValid=function(R){R={model:JSON.stringify(R)};O.remote("checkModelerValid",R)};this.checkNodeValid=function(R){R=
{model:JSON.stringify(R.toJsonObject())};O.remote("checkNodeValid",R)};this.getDBCenterTables=function(R){O.remote("getDBCenterTables",{appNumber:R})};this.checkUserSqlSourcePermission=function(R){O.remote("checkUserSqlSourcePermission",{sourceId:R})};this.checkConnection=function(R){O.remote("checkConnection",{sourceId:R})};this.checkUserSqlExecutable=function(R,na,ja,X){O.remote("checkUserSqlExecutable",{sourceId:ja,sqlType:R,sqlContent:na,namespace:X})};this.checkFormula=function(R,na,ja,X,J){R=
{checking:JSON.stringify({name:R,fromNode:na,formula:ja,fields:X,calculatedFields:J})};O.remote("checkFormula",R)};this.checkAllFormula=function(R,na){R={checking:JSON.stringify({fields:R,calculatedFields:na})};O.remote("checkAllFormula",R)};this.exportModelResult=function(R,na,ja){O.remote("exportModelResult",{jobId:R,jobName:na,totalRowCount:ja})};this.checkReferencedModel=function(R,na,ja){R={source:JSON.stringify(R.toJsonObject()),table:JSON.stringify(na.toJsonObject()),modelId:ja};O.remote("checkReferencedModel",
R)};this.getFirstPageResultData=function(R){R={model:JSON.stringify(R.toJsonObject())};O.remote("getFirstPageResultData",R)};this.updateResultDataByPage=function(R,na,ja,X){O.remote("updateResultDataByPage",{jobId:R,jobName:na,startIndex:ja,pageSize:X})};this.getTotalRowCount=function(R,na){O.remote("getTotalRowCount",{jobId:R,jobName:na})};this.deleteResultDataFile=function(R,na){O.remote("deleteResultDataFile",{jobId:R,jobName:na})};this.cronExpression=function(R){O.remote("cronExpression",{cron:R})};
this.checkDataWarehouseConfig=function(){O.remote("checkDataWarehouseConfig",{})};this.checkModelSetSourceConnect=function(R){O.remote("checkModelSetSourceConnect",{sourceId:R})}}function Ca(ra,Z){this.getX=function(){return ra};this.getY=function(){return Z};this.isOnLeft=function(Ka){return Ka.getX()>ra};this.isOnRight=function(Ka){return Ka.getX()<ra};this.isAbove=function(Ka){return Ka.getY()>Z};this.isBelow=function(Ka){return Ka.getY()<Z}}"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 cb=com.kingdee.bos.qing.modeler.designer;cb.DesignerFacade=qa;cb.RemoteImpl=function(){vb.call(this);var ra;this.getRemoteUrl=function(){return ra};this.setRemoteUrl=function(Z){ra=
Z}};cb.RectCutLineLayoutHelper=function(ra){function Z(){var J=[],wa=!1;this.isBetween=function(Oa,Ha){return 0<J.length?J[0]==Oa&&J[J.length-1]==Ha:!1};this.getLength=function(){return J.length};this.setEnd=function(Oa){wa=Oa};this.isEnd=function(){return wa};this.addRect=function(Oa){J.push(Oa)};this.getAllRect=function(){return J};this.getLastRect=function(){if(0<J.length)return J[J.length-1]};this.generateLinePath=function(Oa,Ha){if(0==J.length)return null;var Qa=J[J.length-1];if(!J[0].isInRect(Oa)||
!Qa.isInRect(Ha))return null;Qa=[];Qa.push(Oa);for(var r=1;r<J.length;r++){var M=Qa,P=M.push;a:{var G=Qa[Qa.length-1],za=J[r-1],ea=J[r];var fa=G.getX();G=G.getY();za=za.getOverlapLineSegment(ea);if(za.isHorizontal()){if(fa>za.getStartX()&&fa<za.getEndX()){fa=new Ca(fa,za.getStartY());break a}}else if(G>za.getStartY()&&G<za.getEndY()){fa=new Ca(za.getStartX(),G);break a}fa=za.getMidPoint()}P.call(M,fa)}Qa.push(Ha);Ha=[];Ha.push(Oa);for(r=1;r<Qa.length;r++){G=Qa[r-1];var W=Qa[r];Oa=J[r-1];fa=[];ea=
G.getX();za=G.getY();P=W.getX();M=W.getY();Oa.isOnBorder(G)&&Oa.isOnBorder(W)?(G=Oa.getPositionRelation(G,W),G==Ka.POSITION_RELATION_ADJACENT_SIDE?(fa=ea,ea=Oa,Oa=new Ca(P,za),ea.isOnBorder(Oa)&&(Oa=new Ca(fa,M)),ea=[],ea.push(new Ca(fa,za)),ea.push(Oa),ea.push(new Ca(P,M)),fa=ea):G==Ka.POSITION_RELATION_SAME_SIDE?(fa=ea,G=Oa,fa==P?(W=Math.min(10,G.getWidth()>>1),ea=new Ca(fa-W,za),Oa=new Ca(P-W,M),G.isInRect(ea)&&G.isInRect(Oa)||(ea=new Ca(fa+W,za),Oa=new Ca(fa+W,M))):(W=Math.min(10,G.getHeight()>>
1),ea=new Ca(fa,za-W),Oa=new Ca(P,M-W),G.isInRect(ea)&&G.isInRect(Oa)||(ea=new Ca(fa,za+W),Oa=new Ca(P,M+W))),G=[],G.push(new Ca(fa,za)),G.push(ea),G.push(Oa),G.push(new Ca(P,M)),fa=G):ea==P||za==M?(fa.push(new Ca(ea,za)),fa.push(new Ca(P,M))):fa=La(ea,za,P,M,Oa)):ea==P||za==M?(fa.push(new Ca(ea,za)),fa.push(new Ca(P,M))):fa=La(ea,za,P,M,Oa);Oa=fa;Oa.splice(0,1);Ha=Ha.concat(Oa)}Qa=Ha;r=[];for(Ha=0;Ha<Qa.length;Ha++){Oa=Qa[Ha];M=r.length;if(P=1<M)P=r[M-2],fa=r[M-1],za=Oa,P=P.getX()==fa.getX()&&fa.getX()==
za.getX()||P.getY()==fa.getY()&&fa.getY()==za.getY()?!0:!1;P&&r.splice(M-1,1);r.push(Oa)}return r};this.clone=function(){for(var Oa=new Z,Ha=0;Ha<J.length;Ha++)Oa.addRect(J[Ha]);return Oa};var La=function(Oa,Ha,Qa,r,M){var P=Oa+Qa>>1,G=[];G.push(new Ca(Oa,Ha));var za=new Ca(P,Ha);P=new Ca(P,r);if(M.isOnBorder(za)||M.isOnBorder(P))Ha=Ha+r>>1,za=new Ca(Oa,Ha),P=new Ca(Qa,Ha);G.push(za);G.push(P);G.push(new Ca(Qa,r));return G}}function Ka(J,wa,La,Oa){var Ha=this;this.isInRect=function(r){var M=r.getX();
r=r.getY();return M>=J.getX()&&r>=J.getY()&&M>=La.getX()&&r<=La.getY()&&M<=wa.getX()&&r>=wa.getY()&&M<=Oa.getX()&&r<=Oa.getY()?!0:!1};this.isAdjoin=function(r){return null!=Ha.getOverlapLineSegment(r)};this.getOverlapLineSegment=function(r){var M=[];Ha.isOnBorder(r.getLeftTop())&&Qa(M,r.getLeftTop());Ha.isOnBorder(r.getRightTop())&&Qa(M,r.getRightTop());Ha.isOnBorder(r.getLeftBottom())&&Qa(M,r.getLeftBottom());Ha.isOnBorder(r.getRightBottom())&&Qa(M,r.getRightBottom());r.isOnBorder(J)&&Qa(M,J);r.isOnBorder(wa)&&
Qa(M,wa);r.isOnBorder(La)&&Qa(M,La);r.isOnBorder(Oa)&&Qa(M,Oa);return 2>M.length?null:new ta(M[0],M[1])};this.getBoundMidPoint=function(r){return(r=Ha.getOverlapLineSegment(r))?r.getMidPoint():null};var Qa=function(r,M){for(var P=!1,G=0;G<r.length;G++){var za=r[G];if(za.getX()==M.getX()&&za.getY()==M.getY()){P=!0;break}}P||r.push(M)};this.isOnBorder=function(r){return-1<Ha.getBorderIndex(r)};this.getWidth=function(){return wa.getX()-J.getX()};this.getHeight=function(){return Oa.getY()-wa.getY()};
this.getPositionRelation=function(r,M){r=Ha.getBorderIndex(r);M=Ha.getBorderIndex(M);M=Math.abs(r-M);if(0==M)return Ka.POSITION_RELATION_SAME_SIDE;if(1==M||3==M)return Ka.POSITION_RELATION_ADJACENT_SIDE;if(2==M)return Ka.POSITION_RELATION_OPPOSITE_SIDE};this.getOverlap=function(r){var M=r.getLeftTop(),P=r.getRightTop(),G=r.getLeftBottom();r=r.getRightBottom();M=new Ca(Math.max(J.getX(),M.getX()),Math.max(J.getY(),M.getY()));P=new Ca(Math.min(wa.getX(),P.getX()),Math.max(wa.getY(),P.getY()));G=new Ca(Math.max(La.getX(),
G.getX()),Math.min(La.getY(),G.getY()));r=new Ca(Math.min(Oa.getX(),r.getX()),Math.min(Oa.getY(),r.getY()));G=new Ka(M,P,G,r);return G.isValid()?G:null};this.isValid=function(){return J.isOnLeft(wa)&&J.getY()==wa.getY()&&La.isOnLeft(Oa)&&La.getY()==Oa.getY()&&J.isAbove(La)&&J.getX()==La.getX()&&wa.isAbove(Oa)&&wa.getX()==wa.getX()?!0:!1};this.getLeftTop=function(){return J};this.getRightTop=function(){return wa};this.getLeftBottom=function(){return La};this.getRightBottom=function(){return Oa};this.getBorderIndex=
function(r){var M=r.getX();r=r.getY();return r==J.getY()&&M>=J.getX()&&M<=wa.getX()?0:M==wa.getX()&&r>=wa.getY()&&r<=Oa.getY()?1:r==Oa.getY()&&M>=La.getX()&&M<=Oa.getX()?2:M==J.getX()&&r>=J.getY()&&r<=La.getY()?3:-1}}function ta(J,wa){this.getStartX=function(){return Math.min(J.getX(),wa.getX())};this.getEndX=function(){return Math.max(J.getX(),wa.getX())};this.getStartY=function(){return Math.min(J.getY(),wa.getY())};this.getEndY=function(){return Math.max(J.getY(),wa.getY())};this.getMidPoint=function(){return new Ca(J.getX()+
wa.getX()>>1,J.getY()+wa.getY()>>1)};this.isHorizontal=function(){return J.getY()==wa.getY()};this.isVertical=function(){return J.getX()==wa.getX()}}var O,R,na,ja;this.getLinePathCoordinate=function(J,wa){try{O=J;R=wa;var La=O.getX()+O.getWidth(),Oa=O.getY()+(O.getHeight()>>1),Ha=R.getX(),Qa=R.getY()+(R.getHeight()>>1);na=new Ca(La,Oa);ja=new Ca(Ha,Qa);na.getX();na.getY();ja.getX();ja.getY();var r=Math.min(R.getX(),O.getX())-50,M=Math.max(R.getX()+R.getWidth(),O.getX()+O.getWidth())+50,P=Math.min(R.getY(),
O.getY())-50,G=Math.max(R.getY()+R.getHeight(),O.getY()+R.getHeight())+50;var za=new Ca(r,P);var ea=new Ca(M,P);var fa=new Ca(r,G);var W=new Ca(M,G);var C=[new Ka(za,ea,fa,W)],ia=ra.getAllNodes();for(J=0;J<ia.length;J++){wa=void 0;var ha=ia[J];La=C;Oa=[];var $a=ha.getX(),Ia=ha.getY(),ka=ha.getWidth(),Ga=ha.getHeight(),la=new Ca($a,Ia),da=new Ca($a+ka,Ia),z=new Ca($a,Ia+Ga),ua=new Ca($a+ka,Ia+Ga);wa=new Ka(la,da,z,ua);for(Ha=0;Ha<La.length;Ha++){Qa=Oa;var Ra=Qa.concat;var Ja=La[Ha],Ua=Ja.getOverlap(wa);
if(Ua){za=[];var mb=Ja.getLeftTop(),Gb=Ja.getRightTop(),Va=Ja.getLeftBottom(),ob=Ja.getRightBottom(),Bb=Ua.getLeftTop(),Db=Ua.getRightTop(),Hb=Ua.getLeftBottom(),qb=Ua.getRightBottom();if(mb.isOnLeft(Bb)){var Cb=mb,ma=new Ca(Bb.getX(),mb.getY()),xa=Va,ib=new Ca(Bb.getX(),Va.getY()),Pb=new Ka(Cb,ma,xa,ib);za.push(Pb)}mb.isAbove(Bb)&&(Cb=new Ca(Bb.getX(),mb.getY()),ma=Gb,xa=Bb,ib=new Ca(ob.getX(),Db.getY()),Pb=new Ka(Cb,ma,xa,ib),za.push(Pb));Gb.isOnRight(Db)&&(Cb=Db,ma=new Ca(Gb.getX(),Db.getY()),
xa=new Ca(qb.getX(),ob.getY()),Pb=new Ka(Cb,ma,xa,ob),za.push(Pb));Va.isBelow(qb)&&(Cb=Hb,ma=qb,xa=new Ca(Hb.getX(),Va.getY()),ib=new Ca(qb.getX(),ob.getY()),Pb=new Ka(Cb,ma,xa,ib),za.push(Pb));var aa=za}else aa=[Ja];Oa=Ra.call(Qa,aa)}C=Oa}var Y=C;console.log("passable rect:"+Y.length);var t,H;for(C=0;C<Y.length;C++){var Q=Y[C];Q.isInRect(na)&&(t=Q);Q.isInRect(ja)&&(H=Q)}if(t&&H&&t!=H){Q=H;var Ta=new Z;Ta.addRect(t);H=[];X(Ta,Y,t,Q,H);if(0==H.length)var ca=null;else{Y=[];for(C=0;C<H.length;C++){var va=
H[C].generateLinePath(na,ja),Na=va.length;Y.push(va);if(void 0==hb){var Za=C;var hb=Na}else Na<hb&&(Za=C,hb=Na)}ca=Y[Za]}}else ca=null;return ca}catch(ba){return null}};var X=function(J,wa,La,Oa,Ha){for(var Qa=J.getLastRect(),r=J.getAllRect(),M=[],P=0;P<wa.length;P++){var G=wa[P];-1<r.indexOf(G)||G!=Qa&&Qa.isAdjoin(G)&&M.push(G)}if(0!=M.length)if(-1<M.indexOf(Oa))J.addRect(Oa),Ha.push(J);else for(Qa=0;Qa<M.length;Qa++)r=M[Qa],P=J.clone(),P.addRect(r),X(P,wa,La,Oa,Ha)};Ka.POSITION_RELATION_SAME_SIDE=
"same_side";Ka.POSITION_RELATION_ADJACENT_SIDE="adjacent_side";Ka.POSITION_RELATION_OPPOSITE_SIDE="opposite_side"};cb.Coordinate=Ca;var ab,sb,vb,Ab,Yb,Nb,ub,Jb,Fa,Aa,nb,wb,sa,N,Ma;(function(){var ra=com.kingdee.bos.qing.framework.common;ab=ra.AbstractIcons;sb=ra.AbstractFacade;vb=ra.AbstractRemoteCall;Ab=ra.MultilanguageManager.createPackageAccessor(cb);ra=com.kingdee.bos.qing.common;Yb=ra.RelativePeriodModel;ra=com.kingdee.bos.qing.ui.component;Nb=ra.SimpleConfirmer;ub=ra.MessageDialog;Jb=cb.Field;
Fa=cb.ModelerModel;Aa=cb.TableModeler;nb=cb.TableNode;wb=cb.Meta;sa=cb.PreviewConfig;N=cb.ExecuteResult;Ma=cb.FilterItem})();cb.Icons=new function(){ab.call(this);var ra=this.protectedMethod,Z;this.setComboIconImpl=function(O){Z=O};this.protectedInit=function(O,R){if(!Z)throw Error("qing modeler comboIcon not found.");Z.define(R,"designer");R.setIconSize(16,16);Ka(0,0,"edit");Ka(0,1,"delete");Ka(0,2,"add");Ka(0,3,"zoomIn");Ka(0,4,"zoomOut");Ka(0,5,"layout");Ka(0,6,"rightArrow");Ka(0,7,"leftArrow");
Ka(0,8,"upArrow");Ka(0,9,"downArrow");ta(0,10,"qingWarning");ta(0,11,"relation");ta(0,12,"qingTable");Ka(0,13,"expanded");Ka(0,14,"expand");ta(0,15,"btn_edit");ta(1,12,"qingTableWhite");ta(1,13,"expandTriangle");ta(1,14,"collapseTriangle");ta(1,16,"checkMark");ta(0,19,"reset");Ka(0,18,"moveUp");Ka(0,20,"createDim");Ka(0,21,"publicDimension");R.setStartPosition(84,35);ta(0,0,"select_field");ta(0,1,"field_setting");ta(0,2,"join");ta(0,3,"union");ta(0,4,"filter");ta(0,5,"sort");ta(0,6,"group_by");ta(0,
7,"calculated_field");ta(0,11,"column_to_row");R.setStartPosition(84,52);ta(0,0,"entity-sub");ta(0,1,"entity-entry");ta(0,2,"unlock");ta(0,3,"lock_by_other");ta(0,4,"lock_by_me");R.setIconSize(20,20);R.setStartPosition(0,35);ta(0,0,"leftJoin");ta(0,1,"rightJoin");ta(0,2,"innerJoin");ta(0,3,"fullJoin");R.setStartPosition(238,35);R.setIconSize(32,32);ta(0,0,"metric_icon");R.setStartPosition(288,35);R.setIconSize(16,16);ta(0,1,"custom_group");R.setStartPosition(0,55);R.setIconSize(20,20);Ka(0,0,"setting");
ta(0,1,"warning");R.setIconSize(18,18);R.setStartPosition(43,55);Ka(0,0,"preview");R.setIconSize(60,80);R.setStartPosition(0,98);ta(0,0,"no_source");R.setIconSize(138,78);R.setStartPosition(240,240);ta(0,0,"no_data_cloud");R.setIconSize(253,140);R.setStartPosition(62,71);ta(0,0,"drag_node_prompt");R.setIconSize(210,170);R.setStartPosition(0,211);ta(0,0,"no_node_and_source");Z.define(R,"source");R.setStartPosition(0,20);R.setIconSize(16,16);ta(0,0,"entity");ta(0,1,"data");ta(0,2,"modelSet");ta(0,3,
"file");ta(0,4,"data-center");ta(0,5,"table");ta(0,6,"openapi");ta(0,8,"KSQL");ta(0,9,"SQL");R.setStartPosition(85,-1);R.setIconSize(16,16);ta(0,0,"table_selected");ta(0,3,"KSQL_selected");ta(0,4,"SQL_selected");R.setStartPosition(101,0);ta(0,0,"f7");R.setStartPosition(0,40);R.setIconSize(20,20);R.setGap(0,1);ta(0,0,"modelset-source-icon");ta(0,1,"mysql");ta(0,2,"datacenter-source-icon");ta(0,3,"entity-source-icon");ta(0,4,"oracle");ta(0,5,"postgresql");ta(0,6,"sqlserver");ta(0,7,"greenplum");ta(0,
8,"access");ta(0,9,"db2");ta(0,10,"odps");ta(0,11,"sparksql");ta(1,1,"redshift");ta(1,2,"apachedrill");ta(1,3,"hive");ta(1,4,"impala");ta(1,5,"kylin");ta(1,6,"dm");ta(1,7,"gaussdb");ta(1,8,"sybaseiq");ta(1,9,"sqlite");ta(1,10,"sybase");ta(2,2,"doris");ta(2,3,"hana");R.setGap(0,0);ta(1,0,"excel");ta(2,0,"txt");ta(2,1,"csv");ta(1,11,"xml");ta(2,4,"kingbase");ta(2,5,"tdsql");ta(2,6,"gbase");ta(2,7,"vastbase");ta(2,8,"yashandb");ta(2,9,"openapi-source-icon");ta(2,10,"tidb");R.setStartPosition(120,-1);
R.setIconSize(16,16);Ka(0,0,"refresh");R.setStartPosition(5,110);R.setIconSize(120,93);ta(0,0,"no-permission");R.setStartPosition(100,100);R.setIconSize(138,84);ta(0,0,"search-no-result");Z.define(R,"metatree");R.setGap(1);R.setStartPosition(1,1);R.setIconSize(16,16);ta(0,0,"DATE");ta(0,1,"STRING");ta(0,5,"TABLE");ta(0,8,"DATETIME");ta(0,9,"BOOLEAN");ta(0,10,"NUMBER");ta(0,11,"INT");ta(1,0,"DATE_hover");ta(1,1,"STRING_hover");ta(1,5,"TABLE_hover");ta(1,8,"DATETIME_hover");ta(1,9,"BOOLEAN_hover");
ta(1,10,"NUMBER_hover");ta(1,11,"INT_hover")};var Ka=function(O,R,na){ta(O,R,na+"_hover");ta(O+1,R,na)},ta=function(O,R,na){ra.registIcon(O,R,na)}};cb.PropDataTypeUtil=new function(){this.getDataTypeDesc=function(ra){switch(ra){case Jb.DT_STRING:ra=Ab.get("text","\u6587\u672c");break;case Jb.DT_NUMBER:ra=Ab.get("number","\u6570\u503c");break;case Jb.DT_INT:ra=Ab.get("integer","\u6574\u6570");break;case Jb.DT_DATE:ra=Ab.get("dataTypeDate","\u65e5\u671f");break;case Jb.DT_DATETIME:ra=Ab.get("dateTime",
"\u65e5\u671f\u65f6\u95f4");break;case Jb.DT_BOOLEAN:ra=Ab.get("bool","\u5e03\u5c14");break;default:ra=""}return ra}};cb.FieldNumberHelper=new function(){var ra;this.init=function(O){ra=O};this.generateDefaultNumber=function(O,R){if(!ra)throw Error("uninitialized");for(var na=ra.getFieldNumberMap(),ja=0;ja<O.length;ja++){var X=O[ja].getFullName();na[X]||Z(O[ja],null,!1,!1,R)}};this.generateDefaultNumberByAssignedName=function(O,R,na,ja){if(!ra)throw Error("uninitialized");Z(O,R,na,ja)};this.getFieldNumber=
function(O){if(!ra)throw Error("uninitialized");return ra.getFieldNumberMap()[O.getFullName()]};this.clearInvalidNumber=function(O,R){if(O&&R&&0!=R.length){var na=ra.getFieldNumberMap();na=Object.keys(na);for(var ja=[],X=0;X<na.length;X++){var J=na[X],wa=O.getId();if(0==J.indexOf(wa+"_")){wa=!1;for(var La=0;La<R.length;La++)if(R[La].getFullName()==J){wa=!0;break}wa||ja.push(J)}}for(X=0;X<ja.length;X++)ra.removeFieldNumberByFullName(ja[X])}};this.getFieldNumberByFullName=function(O){if(!ra)throw Error("uninitialized");
return ra.getFieldNumberMap()[O]};this.removeFieldNumberByFullName=function(O){if(!ra)throw Error("uninitialized");ra.removeFieldNumberByFullName(O)};this.removeFieldNumberIfFieldNotExist=function(O,R){if(R){O||R();var na=O.split("_");1>na.length&&R();(na=ra.getNode(na[0]))?cb.NodeFieldHelper.asynGetFields(ra,na,function(ja){for(var X=!1,J=0;J<ja.length;J++)if(ja[J].getFullName()==O){X=!0;break}X||ra.removeFieldNumberByFullName(O);R(!X)}):(ra.removeFieldNumberByFullName(O),R(!0))}};this.isDynamicFieldNumber=
function(O){return!ra.isNumberManualModified(O)&&(O=ra.getNode(O.getFromNode()))&&O.canGenerateNewField()?!0:!1};this.isNumberManualModified=function(O){return ra.isNumberManualModified(O)};var Z=function(O,R,na,ja,X){var J=R?R:O.getName(),wa=ra.getFieldNumberMap(),La=Object.keys(wa),Oa=!1,Ha=!1;J=Ka(J);for(var Qa=0;Qa<La.length;Qa++)if(La[Qa]!=O.getFullName()&&wa[La[Qa]]&&J.toLowerCase()==wa[La[Qa]].toLowerCase()){Oa=!0;wa=O.getFromNode();Ha=0==La[Qa].indexOf(wa+"_");break}Oa?Ha?(X=ta(J),ra.addFieldNumberMap(O,
X,na,ja)):(R=R?R:O.getName(),X=X?X:ra.getNode(O.getSourceNodeId()),X=cb.DisplayNameHelper.getNodeDisplayName(X),X=Ka(X+"_"+R),X=ta(X),ra.addFieldNumberMap(O,X,na,ja)):ra.addFieldNumberMap(O,J,na,ja)},Ka=function(O){O=O.replace(/[^\u3000\u4E00-\u9FA5a-zA-Z0-9_()]/g,"_");com.kingdee.bos.qing.modeler.SpecialWordChecker.isSpecialWord(O)&&(O+="_");O.match(/^([\u3000\u4E00-\u9FA5a-zA-Z_()])/)||(O="_"+O);25<O.length&&(O=O.substring(0,25));return O},ta=function(O,R){var na=O;if(R){var ja=24-(R+"").length;
O.length>ja&&(O=O.substring(0,ja));O=O+"_"+R}ja=ra.getFieldNumberMap();for(var X=Object.keys(ja),J=!1,wa=0;wa<X.length;wa++)if(O.toLowerCase()==ja[X[wa]].toLowerCase()){J=!0;break}return J?ta(na,R?++R:1):O}};cb.NodeFieldHelper=new function(){var ra=this,Z,Ka,ta,O;this.asynGetFields=function(X,J,wa,La,Oa){var Ha;if(!(Ha=!J))a:{Ha=cb.ModelConverter.getUpwardNode(Ka,J,!1);for(var Qa=0;Qa<Ha.length;Qa++)if(ta.isInvalidNode(Ha[Qa].getId())){Ha=!0;break a}Ha=!1}Ha?wa([]):(Ha=cb.NodeResultCache.getOneNodeField(J.getId()))?
wa(Ha):na(X,J,wa,La,Oa)};this.getFieldValues=function(X,J,wa,La,Oa,Ha){X=cb.ModelConverter.convertToRuntimeModel(X,J);ja(X)?La([]):(J=new qa(Z,function(Qa){La(Qa.fieldValues)},function(Qa,r){Oa&&Oa();return!1}),Ha?J.setBlockingJqUi(Ha):J.setShowBlocking(!1),J.getFieldValues(X,wa))};this.getMeta=function(X,J,wa,La){if(ta.isInvalidNode(J.getId())){var Oa=ta.getInvalidState(J);if(!(Oa instanceof com.kingdee.bos.qing.modeler.designer.TableNoFieldState)){X=new wb;X.setErrorMap({isValid:!1,message:Oa.getPrompt()});
wa(X);return}}Oa=X.getTable(J.getTableUid());X=X.getSource(Oa.getSourceUid());(new qa(Z,function(Ha){var Qa=new wb;Qa.fromJsonObject(Ha);wa(Qa)},function(){La&&La();return!1})).getMeta(X,Oa)};this.init=function(X){Ka&&Ka.removePropertyChangeCallback(R);Ka=X;Ka.addPropertyChangeCallback(R);cb.FieldNumberHelper.init(Ka)};this.setRemoteImpl=function(X){Z=X};this.setNodeStatusMonitor=function(X){ta=X};this.setNodeInvalidCallback=function(X){O=X};this.getPreviewData=function(X,J,wa){var La=(new Date).getTime(),
Oa=new qa(Z,function(Ha){var Qa=new N;Qa.fromJsonObject(Ha);(Ha=Qa.getValidity())?O&&O(Ha,La):J&&J(Qa)},function(Ha,Qa){return cb.DppVersionExceptionHandler.handle(Ha)});wa&&Oa.setBlockingJqUi(wa);Oa.getPreviewData(X)};var R=function(X,J){if(X==Aa.KEY_TRANSFORM_JOIN||X==Aa.KEY_TRANSFORM_COLUMN_TO_ROW||X==Aa.KEY_TRANSFORM_SELECT_FIELD||X==Aa.KEY_TRANSFORM_FIELD_SETTING||X==Fa.KEY_TABLE_NODE_SELECT_FIELD||X==Aa.KEY_TRANSFORM_GROUP_BY||X==Aa.KEY_TRANSFORM_CALCULATED_FIELD||X==Aa.KEY_TRANSFORM_CUSTOM_GROUP||
X==Aa.KEY_TRANSFORM_UNION||X==Aa.KEY_BREAK_LINK||X==Aa.KEY_LINK_NODE||X==Aa.KEY_ADD_NODE)console.log("clean cache"),ra.clearDownwardNodeCache(J.getId());else if(X==Fa.KEY_UPDATE_TABLE)for(X=0;X<J.length;X++)console.log("clean the relative cache of userSQL "),ra.clearDownwardNodeCache(J[X].getId())};this.clearDownwardNodeCache=function(X){X=Ka.getNode(X);X=cb.ModelConverter.getDownwardNode(Ka,X,!1);for(var J=0;J<X.length;J++)cb.NodeResultCache.removeNodeCache(X[J].getId())};var na=function(X,J,wa,
La,Oa){X=cb.ModelConverter.convertToRuntimeModel(X,J);if(ja(X))wa([]);else{var Ha=(new Date).getTime(),Qa=new qa(Z,function(r){var M=new N;M.fromJsonObject(r);Ha=M.getTimestamp()?M.getTimestamp():Ha;(r=M.getValidity())?(O&&O(r,Ha),wa([])):(M=M.getFields(),J instanceof nb&&cb.FieldNumberHelper.clearInvalidNumber(J,M),cb.FieldNumberHelper.generateDefaultNumber(M),cb.NodeResultCache.cacheOneNodeField(J.getId(),M,Ha),wa(cb.NodeResultCache.getOneNodeField(J.getId())))},function(r,M){if(cb.DppVersionExceptionHandler.handle(r))return!0;
La&&La();return!1});Oa?Qa.setBlockingJqUi(Oa):Qa.setShowBlocking(!1);Qa.getFieldInfo(X)}},ja=function(X){X=X.getVertexes();for(var J=0;J<X.length;J++)if(ta.isInvalidNode(X[J].getId()))return!0;return!1}};cb.NodeResultCache=new function(){var ra={},Z={},Ka=[],ta={};this.cacheOneNodeField=function(O,R,na){if(na){var ja=Z[O],X=ta[O];if((!ja||ja<na)&&(!X||X<na))for(ra[O]=R,ta[O]=void 0,na=0;na<Ka.length;na++)(ja=Ka[na])&&ja(O,R)}};this.removeNodeCache=function(O){ra[O]=void 0;Z[O]=void 0;ta[O]=(new Date).getTime()};
this.getOneNodeField=function(O){return ra[O]};this.addCacheChangeListener=function(O){Ka.push(O)};this.clear=function(){ra={};Z={};ta={}}};cb.LockHelper=new function(){var ra,Z,Ka,ta,O,R,na,ja,X=!1;this.show=function(wa){R=$("<div>");R.addClass("modeler-designer-lock-statusbar");na=$("<div>");ja=$("<div>");ja.addClass("modeler-designer-lock-text");na.addClass("modeler-designer-lock-icon");R.append(ja);R.append(na);R.appendTo(wa);R.on("click",J);X=!0};this.registerLockRequestSender=function(wa){ta=
wa};this.setGlobal=function(wa){ra=wa};this.setLockStateChangeListener=function(wa){O=wa};this.setLockInfo=function(wa,La,Oa){if(X){Ka=La;Z=wa?cb.LockHelper.STATE_LOCK_BY_ME:La?cb.LockHelper.STATE_LOCK_BY_OTHER:cb.LockHelper.STATE_UNLOCK;O&&O(Z==cb.LockHelper.STATE_LOCK_BY_ME);if(!Oa){if(Z==cb.LockHelper.STATE_LOCK_BY_OTHER){var Ha=Ab.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");
Ha=Ha.replace("#1",Ka)}else Z==cb.LockHelper.STATE_UNLOCK&&(Ha=Ab.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"));Ha?ra.getMessageCurtain().showPrompt(Ha,-1):Z==cb.LockHelper.STATE_LOCK_BY_ME&&ra.getMessageCurtain().showSuccess(Ab.get("lockSuccess","\u60a8\u5df2\u6210\u529f\u9501\u5b9a\u8be5\u6a21\u578b"))}wa="lock_by_other";if(Z==cb.LockHelper.STATE_UNLOCK){wa="unlock";var Qa=Ab.get("unlock",
"\u672a\u9501\u5b9a")}else Z==cb.LockHelper.STATE_LOCK_BY_OTHER?Qa=Ab.get("lockedBy","\u5df2\u88ab\u201c#1\u201d\u9501\u5b9a").replace("#1",Ka):Z==cb.LockHelper.STATE_LOCK_BY_ME&&(Qa=Ab.get("lockedBy","\u5df2\u88ab\u201c#1\u201d\u9501\u5b9a").replace("#1",Ab.get("me","\u6211")),wa="lock_by_me");cb.Icons.background(na,wa);ja.text(Qa);ja.attr("title",Qa)}};this.setMaxWidth=function(wa){ja&&ja.css("max-width",Math.max(0,Math.min(wa-50,250))+"px")};var J=function(){if(ta){var wa=Z!=cb.LockHelper.STATE_LOCK_BY_ME;
if(wa)ta(wa);else{var La=new Nb;La.setText(Ab.get("confirmUnlock","\u786e\u5b9a\u8981\u89e3\u9501\u5f53\u524d\u6a21\u578b\uff1f"));La.setConfirmedListener(function(Oa){Oa&&ta(wa)});La.show(R)}}}};cb.LockHelper.STATE_LOCK_BY_ME="lock_by_me";cb.LockHelper.STATE_LOCK_BY_OTHER="lock_by_other";cb.LockHelper.STATE_UNLOCK="unlock";cb.DppVersionExceptionHandler=new function(){var ra=!1;this.handle=function(Z){if(20001101!=Z)return!1;ra||(ra=!0,Z=ub.createFeedbackDialog(),Z.setMsgImageType(ub.MSG_WARNING),
Z.setMessage(Ab.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")),Z.setOptionType(ub.OPTION_OK),Z.setButtonText(ub.RETURN_OK,Ab.get("iSee","\u6211\u77e5\u9053\u4e86")),Z.setClosedAction(function(){ra=!1}),Z.showDialog());return!0}};cb.FilterCheckHelper=new function(){this.checkFilterField=function(Ka,
ta){if(!ta)return Ka=Ab.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5"),new Ma.FiltersCheckingResult(-1,Ka);for(var O,R=0;R<Ka.length;R++){var na=Ka[R];if(!na.isEmpty()){O=ra(na,R,ta);if(!O)if(O=R,na=Z(na)){var ja=Ab.get("incompleteFilter","\u7b2c#1\u884c\u4e0d\u5b8c\u6574\uff0c");ja=ja.replace("#1",O+1);O=new Ma.FiltersCheckingResult(O,ja+na)}else O=null;if(O)break}}return O};this.checkFilterLogical=function(Ka){var ta=0,O=-1,R,na=0;for(R=0;R<Ka.length;R++)Ka[R].isEmpty()||(na=R);R=na;for(na=
0;na<Ka.length;na++){var ja=Ka[na];if(!ja.isEmpty()){ta+=ja.getLeftBracketCount();ta-=ja.getRightBracketCount();0>O&&0!=ta&&(O=na);if(0>ta)return Ka=Ab.get("bracketMismatch","\u5de6\u53f3\u62ec\u53f7\u4e0d\u5339\u914d\u3002"),new Ma.FiltersCheckingResult(O,Ka);if(na!=R&&!ja.getLogicOp())return Ka=Ab.get("lackLogicalSymbol","\u7b2c#1\u884c\u7f3a\u5c11\u903b\u8f91\u7b26"),Ka=Ka.replace("#1",na+1),new Ma.FiltersCheckingResult(na,Ka);if(na==R&&ja.getLogicOp())return Ka=Ab.get("logicalSymbolUnnecessary",
"\u5b58\u5728\u591a\u4f59\u7684\u903b\u8f91\u3002"),new Ma.FiltersCheckingResult(na,Ka)}}return 0<ta?(Ka=Ab.get("bracketMismatch","\u5de6\u53f3\u62ec\u53f7\u4e0d\u5339\u914d\u3002"),new Ma.FiltersCheckingResult(O,Ka)):null};this.checkFieldExisted=function(Ka,ta){return ra(Ka,-1,ta)?!1:!0};var ra=function(Ka,ta,O){Ka=Ka.getField();for(var R=0;R<O.length;R++)if(Ka&&O[R].getFullName()==Ka.getFullName())return null;O=Ab.get("lackField","\u7b2c#1\u884c\u5b57\u6bb5\u4e0d\u5b58\u5728\u3002");O=O.replace("#1",
ta+1);return new Ma.FiltersCheckingResult(ta,O)},Z=function(Ka){var ta=Ka.getCompareOp(),O=Ka.getField(),R=Ka.getValue(),na=O?O.getOutputDataType():null;O=O?O.isEnum():!1;O=Ma.getSelectableCompares(na,O);Ka=Ka.getRelativeDateRange();if(!ta)return Ab.get("lackComparisonOperator","\u7f3a\u5c11\u6bd4\u8f83\u7b26\u3002");for(var ja=!1,X=0;X<O.length;X++)if(ta==O[X]){ja=!0;break}if(!ja)return Ab.get("comparisonMismatch","\u6bd4\u8f83\u7b26\u4e0d\u5339\u914d\u3002");if(!Ma.isCompareOpWithoutValue(ta)){if(!R&&
!Ka)return Ab.get("lackValue","\u7f3a\u5c11\u503c\u3002");if(na==Jb.DT_NUMBER||na==Jb.DT_INT){if(!Ma.REG_NUMBER.test(R)&&!Ma.isCompareOpWithinOrNotWithinValue(ta))return Ab.get("valueMustBeNum","\u503c\u5fc5\u987b\u4e3a\u6570\u5b57\u3002")}else if(na==Jb.DT_DATE||na==Jb.DT_DATETIME)if(Ma.isCompareOpRelativeDateRangeValue(ta)){if(!(Ka instanceof Yb))return Ab.get("invalidRelativeDateValue","\u65e0\u6548\u7684\u76f8\u5bf9\u65e5\u671f\u503c\u3002")}else{if(!Ma.REG_DATETIME.test(R))return Ab.get("invalidDateValue",
"\u65e0\u6548\u7684\u65e5\u671f\u503c\u3002")}else if(na==Jb.DT_BOOLEAN&&R!=Jb.BOOLEAN_TRUE&&R!=Jb.BOOLEAN_FALSE)return Ab.get("wrongBoolean","\u9519\u8bef\u7684\u5e03\u5c14\u503c\u3002")}return null}};cb.SortCheckHelper=new function(){var ra=this;this.checkAllSortItemExist=function(Z,Ka){for(var ta=0;ta<Z.length;ta++)if(!ra.checkOneSortItemExist(Z[ta],Ka))return!1;return!0};this.checkOneSortItemExist=function(Z,Ka){for(var ta=0;ta<Ka.length;ta++)if(Ka[ta].getFullName()==Z.getTargetFieldFullName())return!0;
return!1}};cb.PreviewConfigManager=new function(){var ra=new sa;ra.setPreviewPartlyDataMode(!1,1E3,100);this.updatePreviewConfig=function(Z,Ka,ta){ra.setPreviewPartlyDataMode(Z,Ka,ta)};this.getPreviewConfig=function(){return ra.backup()};this.getRowCountText=function(){var Z=ra.isExtractAllData()?Ab.get("extractAllData","\u62bd\u53d6\u5168\u91cf\u6570\u636e\u8fdb\u884c\u8ba1\u7b97, "):Ab.get("onlyExtractSomeRows","\u4ec5\u62bd\u53d6\u524d#1\u884c\u8fdb\u884c\u8ba1\u7b97, ").replace("#1",ra.getExtractCount());
return Z+=Ab.get("previewRows","\u663e\u793a\u8ba1\u7b97\u7ed3\u679c\u7684\u524d#1\u884c\u6570\u636e").replace("#1",ra.getPreviewCount())}};var Mb=new function(){var ra;this.hookCollector=function(Z){ra=Z};this.occur=function(Z,Ka){try{ra&&ra(Z,Ka)}catch(ta){window.console&&console.warn(ta)}}};Mb.BUTTON_TYPE="button-type";Mb.DATATABLE_MODEL_TRANSFORM_NODE_TYPE="datatable-model-transform-node-type";Mb.ENTER_DATA_AUTH_MANAGE="enter-data-auth-manage";Mb.SAVE="\u4fdd\u5b58";Mb.REFRESH="\u5237\u65b0";
Mb.DEPLOY="\u90e8\u7f72";Mb.ROLLBACK_CURRENT_DEPLOY="\u56de\u9000\u5230\u6700\u65b0\u90e8\u7f72\u72b6\u6001";Mb.UNDO="\u64a4\u9500";Mb.REDO="\u53cd\u64a4\u9500";Mb.CLEAR="\u6e05\u9664";Mb.MODEL_CHECK="\u6a21\u578b\u6821\u9a8c";Mb.MODEL_PREVIEW="\u6a21\u578b\u9884\u89c8";Mb.MODEL_PROPERTY="\u6a21\u578b\u5c5e\u6027";Mb.SOURCE_MANAGE="\u6570\u636e\u6e90\u7ba1\u7406";Mb.MODEL_PREVIEW_EXPORT_TO_EXCEL="\u9884\u89c8-\u5bfc\u51fa\u5230Excel";Mb.METRIC_DELETE="\u5220\u9664";Mb.ENTER_DATA_AUTH_MANAGE_AFTER_DEPLOY=
"\u6210\u529f\u90e8\u7f72\u540e\u70b9\u51fb\u8df3\u8f6c\u8fdb\u5165";cb.UserOperationReporter=Mb})();(function(){function qa(){var Fa;this.setCaption=function(Aa){Fa=Aa};this.getCaption=function(){return Fa?Fa:""};this.perform=function(){throw Error("Override me.");};this.unperform=function(){throw Error("Override me.");}}function Ca(){qa.call(this);var Fa=this,Aa,nb,wb;this.setMethod=function(sa,N){Aa=sa;nb=N};this.setValue=function(sa){wb=sa};this.perform=function(){var sa=Aa();nb(wb);wb=sa};this.unperform=function(){Fa.perform()}}function cb(){qa.call(this);var Fa,Aa,nb,wb,sa,N;this.getNode=function(){return Fa};
this.getCaption=function(){return N==cb.TYPE_DATATYPE?vb.get("actionNodeChangeDataType","\u4fee\u6539\u6570\u636e\u7c7b\u578b"):N==cb.TYPE_ALIAS?vb.get("actionNodeChangeAlias","\u4fee\u6539\u663e\u793a\u540d\u79f0"):vb.get("actionNodeFieldSetting","\u8282\u70b9\u5b57\u6bb5\u8bbe\u7f6e")};this.setValue=function(Mb,ra,Z){N=Z;Fa=Mb;Aa=Mb.getFieldSettingConfig();nb=new Jb;Mb=[];if(Aa){Z=Aa.getModifiedField();for(var Ka=0;Ka<Z.length;Ka++)Z[Ka].getFullName()!=ra.getFullName()&&Mb.push(Z[Ka])}Mb.push(ra);
nb.setModifiedField(Mb,!0);sa=ra;wb=ab.FieldNumberHelper.getFieldNumber(ra)};this.perform=function(){Fa.setFieldSettingConfig(nb);Ma()};this.unperform=function(){Fa.setFieldSettingConfig(Aa);wb&&Ma(wb)};var Ma=function(Mb){N!=cb.TYPE_DATATYPE&&(Mb=Mb?Mb:sa.getAlias(),ab.FieldNumberHelper.isDynamicFieldNumber(sa)&&Fa.getId()==sa.getFromNode()&&ab.FieldNumberHelper.generateDefaultNumberByAssignedName(sa,Mb,!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 ab=com.kingdee.bos.qing.modeler.designer;ab.CommandManager=function(){var Fa=[],Aa=[],nb=new sb;this.perform=function(N){N.perform();wb(Fa,N);Aa.length=0;sa(N,!0)};this.addPerformedListener=function(N){nb.addListener(N)};
this.isCanUndo=function(){return 0<Fa.length};this.isCanRedo=function(){return 0<Aa.length};this.undo=function(){var N=Fa.pop();N&&(N.unperform(),wb(Aa,N),sa(N,!1,!0))};this.redo=function(){var N=Aa.pop();N&&(N.perform(),wb(Fa,N),sa(N,!1,!1))};this.reset=function(){Fa.length=0;Aa.length=0;sa(null)};var wb=function(N,Ma){N.push(Ma);32<N.length&&N.splice(0,1)},sa=function(N,Ma,Mb){nb.fireEvent(function(ra){ra(N,Ma,Mb)})}};ab.ActionSetModel=function(){qa.call(this);var Fa,Aa,nb;this.setValue=function(wb,
sa,N){Aa=wb;nb=sa;Fa=N};this.perform=function(){Fa(nb)};this.unperform=function(){Fa(Aa)}};ab.ActionAddSource=function(){qa.call(this);var Fa,Aa,nb;this.getCaption=function(){return Fa};this.setValue=function(wb,sa){for(var N="",Ma=0;Ma<wb.length;Ma++)N+=wb[Ma].getName(),Ma<wb.length-1&&(N+="\uff0c");Fa=vb.get("actionAddSource","\u6dfb\u52a0\u6570\u636e\u6e90\u201c#1\u201d").replace("#1",N);Aa=wb;nb=sa};this.perform=function(){nb.batchAddSource(Aa)};this.unperform=function(){nb.batchRemoveSource(Aa)}};
ab.ActionRemoveSource=function(){qa.call(this);var Fa,Aa,nb,wb,sa;this.getCaption=function(){return Fa};this.setValue=function(N,Ma){Fa=vb.get("actionRemoveSource","\u5220\u9664\u6570\u636e\u6e90\u201c#1\u201d").replace("#1",N.getName());Aa=N;nb=Ma};this.perform=function(){wb=nb.removeSource(Aa);sa=nb.getUserSqlTables(Aa.getId());nb.batchRemoveUserSqlTable(Aa.getId())};this.unperform=function(){if(-1<wb){nb.insertSource(Aa,wb);for(var N=0;N<sa.length;N++)nb.addTable(sa[N])}}};ab.ActionAddRemoveSource=
function(){qa.call(this);var Fa,Aa,nb,wb;this.getCaption=function(){return Fa};this.setValue=function(sa,N,Ma){Aa=Ma.getAllSource();var Mb="",ra="";nb=[];for(var Z=0;Z<Aa.length;Z++){var Ka=Aa[Z];-1<N.indexOf(Ka)?(0<ra.length&&(ra+="\uff0c"),ra+=Ka.getName()):nb.push(Ka)}for(Z=0;Z<sa.length;Z++)N=sa[Z],nb.push(N),0<Mb.length&&(Mb+="\uff0c"),Mb+=N.getName();Fa="";0<Mb.length&&(Fa+=vb.get("actionAddSource","\u6dfb\u52a0\u6570\u636e\u6e90\u201c#1\u201d").replace("#1",Mb));0<ra.length&&(0<Fa.length&&
(Fa+="\uff1b"),Fa+=vb.get("actionRemoveSource","\u5220\u9664\u6570\u636e\u6e90\u201c#1\u201d").replace("#1",ra));wb=Ma};this.perform=function(){wb.setSource(nb)};this.unperform=function(){wb.setSource(Aa)}};ab.ActionAddTableNode=function(){qa.call(this);var Fa,Aa,nb,wb,sa;this.getCaption=function(){if(!wb){var N=ab.DisplayNameHelper.getNodeDisplayName(Fa);wb=vb.get("actionAddNode","\u65b0\u589e\u8282\u70b9\u201d#1\u201c").replace("#1",N)}return wb};this.setValue=function(N,Ma,Mb){Fa=N;Aa=Ma;nb=Mb};
this.perform=function(){if(sa){var N=sa.getRelativeNode();if(N){var Ma=sa.getRelativePos(),Mb=N.getX()+Ma[0];N=N.getY()+Ma[1];Fa.setPosition(Mb,N)}nb.restoreFieldNumber(sa.getFieldNumberMap())}nb.addTable(Aa);ab.NodeHelper.addNode(Fa)};this.unperform=function(){sa=ab.NodeHelper.removeNode(Fa)}};ab.ActionAddUserSqlTable=function(){qa.call(this);var Fa,Aa,nb,wb,sa;this.getCaption=function(){return Fa};this.setValue=function(N,Ma,Mb,ra){Aa=Mb;nb=N;nb.getUid();Ma?(wb=Ma,Fa=vb.get("revokeEditSQL","\u7f16\u8f91\u81ea\u5b9a\u4e49SQL/KSQL\u201c#1\u201d")):
Fa=vb.get("revokeCreateSQL","\u65b0\u5efa\u81ea\u5b9a\u4e49SQL/KSQL\u201c#1\u201d");Fa=Fa.replace("#1",N.getTableName());sa=ra};this.perform=function(){wb?Aa.updateTable(nb,wb):Aa.addTable(nb);sa&&sa(nb)};this.unperform=function(){wb?Aa.updateTable(wb,nb):Aa.removeTableIfUseless(nb);sa&&sa(wb)}};ab.ActionRemoveUserSqlTable=function(){qa.call(this);var Fa,Aa,nb,wb;this.getCaption=function(){return Fa};this.setValue=function(sa,N,Ma){Fa=vb.get("revokeDelSQL","\u5220\u9664\u81ea\u5b9a\u4e49SQL/KSQL\u201c#1\u201d");
Fa=Fa.replace("#1",sa.getTableName());Aa=N;nb=Aa.getSameTable(sa);wb=Ma};this.perform=function(){Aa.removeTableIfUseless(nb)&&wb&&wb(nb)};this.unperform=function(){Aa.addTable(nb);wb&&wb(nb)}};ab.ActionAddTransformNode=function(){qa.call(this);var Fa,Aa,nb,wb,sa,N;this.getCaption=function(){if(!wb){var Ma=ab.DisplayNameHelper.getNodeDisplayName(Fa);wb=vb.get("actionAddNode","\u65b0\u589e\u8282\u70b9\u201d#1\u201c").replace("#1",Ma)}return wb};this.setValue=function(Ma,Mb,ra,Z){Fa=Ma;Aa=Mb;nb=ra;N=
Z};this.perform=function(){ab.NodeHelper.addNode(Fa,Aa,nb);sa&&N.restoreFieldNumber(sa.getFieldNumberMap())};this.unperform=function(){sa=ab.NodeHelper.removeNode(Fa)}};ab.ActionRemoveNode=function(){qa.call(this);var Fa,Aa,nb,wb;this.getCaption=function(){return wb};this.setValue=function(sa,N){Fa=sa;Aa=N};this.perform=function(){if(!wb){var sa=ab.DisplayNameHelper.getNodeDisplayName(Fa);wb=vb.get("actionRemoveNode","\u79fb\u9664\u8282\u70b9\u201d#1\u201c").replace("#1",sa)}nb=ab.NodeHelper.removeNode(Fa)};
this.unperform=function(){Aa.restoreFieldNumber(nb.getFieldNumberMap());var sa=nb.getRelativeNode();if(sa){var N=nb.getRelativePos(),Ma=sa.getX()+N[0];sa=sa.getY()+N[1];Fa.setPosition(Ma,sa)}Ma=nb.getUpwardNodes();(sa=nb.getRemovedTable())&&Aa.addTable(sa);ab.NodeHelper.addNode(Fa,Ma[0],Ma);(Ma=nb.getDownwardNode())&&ab.NodeHelper.linkNode(Fa,Ma)}};ab.ActionLinkNode=function(){qa.call(this);var Fa,Aa;this.getCaption=function(){var nb=vb.get("actionLinkNodes","\u8fde\u63a5\u8282\u70b9\u201d#1\u201c\uff0c\u201c#2\u201d");
nb=nb.replace("#1",ab.DisplayNameHelper.getNodeDisplayName(Fa));return nb=nb.replace("#2",ab.DisplayNameHelper.getNodeDisplayName(Aa))};this.setValue=function(nb,wb){Fa=nb;Aa=wb};this.perform=function(){ab.NodeHelper.linkNode(Fa,Aa)};this.unperform=function(){ab.NodeHelper.breakLink(Fa,Aa)}};ab.ActionChangeModelInfo=function(){qa.call(this);var Fa,Aa,nb,wb,sa;this.getCaption=function(){return vb.get("editModelInfo","\u7f16\u8f91\u6a21\u578b\u5c5e\u6027")};this.setValue=function(N,Ma,Mb,ra,Z){Fa=N;
Aa=Ma;nb=Mb;wb=ra;sa=Z};this.perform=function(){Fa.setModelName(Aa);Fa.setModelDesc(wb)};this.unperform=function(){Fa.setModelName(nb);Fa.setModelDesc(sa)}};ab.ActionMoveNode=function(){qa.call(this);var Fa,Aa,nb,wb;this.getCaption=function(){if(!wb){var sa=ab.DisplayNameHelper.getNodeDisplayName(Fa);wb=vb.get("actionMoveNode","\u79fb\u52a8\u8282\u70b9\u201c#1\u201c").replace("#1",sa)}return wb};this.setValue=function(sa,N){Fa=sa;Aa=N;nb=[Aa[0]-Fa.getX(),Aa[1]-Fa.getY()]};this.perform=function(){Fa.changePosition(Aa[0],
Aa[1])};this.unperform=function(){Fa.changePosition(Fa.getX()-nb[0],Fa.getY()-nb[1])}};ab.ActionNodeRename=function(){qa.call(this);var Fa,Aa,nb,wb,sa;this.getCaption=function(){sa||(sa=vb.get("actionRenameNode","\u91cd\u547d\u540d\u8282\u70b9\u201d#1\u201c\u4e3a\u201d#2\u201c").replace("#1",wb).replace("#2",Aa));return sa};this.setValue=function(N,Ma){Fa=N;Aa=Ma;nb=N.getAlias();wb=ab.DisplayNameHelper.getNodeDisplayName(Fa)};this.perform=function(){Fa.setAlias(Aa)};this.unperform=function(){Fa.setAlias(nb)}};
ab.ActionChangeConfig=function(){Ca.call(this);var Fa;this.setNode=function(Aa){Fa=Aa};this.getNode=function(){return Fa}};ab.ActionRelayout=function(){qa.call(this);var Fa,Aa,nb;this.setValue=function(wb,sa){Fa=wb;nb=sa};this.perform=function(){Aa=Fa.getAllNodeCoordinate();Fa.setAllNodeCoordinate(nb)};this.unperform=function(){Fa.setAllNodeCoordinate(Aa)}};ab.ActionChangeModelProp=function(){Ca.call(this)};ab.ActionChangeMaterializedConfig=function(){qa.call(this);var Fa,Aa,nb;this.getCaption=function(){return vb.get("editMaterializedConfig",
"\u7f16\u8f91\u7269\u5316\u5b58\u50a8\u8bbe\u7f6e")};this.setValue=function(wb,sa){Fa=wb;nb=sa};this.perform=function(){Aa=Fa.getMaterializedConfig();Fa.setMaterializedConfig(nb)};this.unperform=function(){Fa.setMaterializedConfig(Aa)}};ab.ActionNodeFieldSetting=cb;ab.ActionFieldNumberMapping=function(){qa.call(this);var Fa,Aa,nb,wb,sa;this.getCaption=function(){return vb.get("actionChangeFieldNumber","\u4fee\u6539\u5b57\u6bb5\u540d\u79f0")};this.setValue=function(N,Ma,Mb){Fa=N;Aa=Ma;nb=Mb;wb=N.getFieldNumberMap()[Ma.getFullName()]};
this.perform=function(){sa=Fa.isNumberManualModified(Aa);Fa.addFieldNumberMap(Aa,nb,!0)};this.unperform=function(){Fa.addFieldNumberMap(Aa,wb,sa)}};var sb,vb,Ab,Yb,Nb,ub,Jb;(function(){var Fa=com.kingdee.bos.qing.common;sb=Fa.EventListenerList;Fa=com.kingdee.bos.qing.framework.common;vb=Fa.MultilanguageManager.createPackageAccessor(ab);Ab=ab.TableModeler;Yb=ab.TableNode;Nb=ab.JoinNode;ub=ab.UnionNode;Jb=ab.FieldSettingConfig})();cb.TYPE_ALIAS="alias";cb.TYPE_DATATYPE="datatype";ab.NodeHelper=new function(){function Fa(ra){var Z=
[],Ka,ta,O={},R,na;this.getRemovedNode=function(){return ra};this.setUpwardNodes=function(ja){Z=ja};this.getUpwardNodes=function(){return Z};this.setDownwardNode=function(ja){Ka=ja};this.getDownwardNode=function(){return Ka};this.setRemovedTable=function(ja){ta=ja};this.getRemovedTable=function(){return ta};this.setRelativeNode=function(ja){na=ja};this.getRelativeNode=function(){return na};this.setRelativePos=function(ja){R=ja};this.getRelativePos=function(){return R};this.setFieldNumberMap=function(ja){O=
ja};this.getFieldNumberMap=function(){return O}}var Aa,nb,wb;this.setModeler=function(ra){Aa=ra};this.setModelerChecker=function(ra){wb=ra};this.setNodeStatusMonitor=function(ra){nb=ra};this.addNode=function(ra,Z,Ka){if(Z){var ta=Aa.getPage().getRelatedLine(Z,Ab.GET_LINE_STRATEGY_OUT);if(ta&&0!=ta.length){ta=Aa.getPage();var O=ta.getRelatedLine(Z,Ab.GET_LINE_STRATEGY_OUT)[0],R=!ra.getX()||!ra.getY();R&&N(Z,ra);ta.addNode(ra);ta.addLine(Z,ra);if(Ka)for(Z=0;Z<Ka.length;Z++)ta.addLine(Ka[Z],ra);Ka=Aa.getNode(O.getToId());
ta.removeLine(O);ta.addLine(ra,Ka);R&&(Ma(Ka),sa(Ka));(Ka instanceof Nb||Ka instanceof ub)&&Ka.affectByAddOrRemoveNode(Aa.getNode(O.getFromId()),ra)}else if(ta=Aa.getPage(),ra.getX()&&ra.getY()||N(Z,ra),ta.addNode(ra),ta.addLine(Z,ra),Ka)for(Z=0;Z<Ka.length;Z++)ta.addLine(Ka[Z],ra)}else Aa.getPage().addNode(ra);wb.checkDownwardNode(ra);nb&&nb.setSelected(ra)};this.removeNode=function(ra){var Z=new Fa(ra);a:for(var Ka=Aa.getAllNodes(),ta=0;ta<Ka.length;ta++){var O=Ka[ta];if(O!=ra){Z.setRelativeNode(O);
Ka=[ra.getX()-O.getX(),ra.getY()-O.getY()];Z.setRelativePos(Ka);break a}}Z.setFieldNumberMap(Aa.removeFieldNumber(ra));ta=Aa.getRelatedLine(ra,Ab.GET_LINE_STRATEGY_IN);O=Aa.getRelatedLine(ra,Ab.GET_LINE_STRATEGY_OUT);Ka=Aa.getPage();var R;0<O.length&&(R=Aa.getNode(O[0].getToId()));if(R instanceof Nb||R instanceof ub)if(0<ta.length){var na=Mb(ra,ta);R.affectByAddOrRemoveNode(ra,na)}else R.affectByAddOrRemoveNode(ra,null);else R&&0<ta.length&&(na=Aa.getNode(ta[0].getFromId()),Ka.addLine(na,R));for(na=
0;na<ta.length;na++)Ka.removeLine(ta[na]);for(na=0;na<O.length;na++)Ka.removeLine(O[na]);O=[];for(na=0;na<ta.length;na++)O.push(Aa.getNode(ta[na].getFromId()));Z.setUpwardNodes(O);ra instanceof Yb&&!Aa.getTable(ra.getTableUid()).isUserSql()&&(ra instanceof Yb?(ta=Aa.getTable(ra.getTableUid()),ta=Aa.removeTableIfUseless(ta,ra)?ta:null):ta=null,Z.setRemovedTable(ta));R&&(wb.checkDownwardNode(R),Z.setDownwardNode(R),ab.NodeFieldHelper.clearDownwardNodeCache(R.getId()));Ka.removeNode(ra,Z);nb.getSelected()==
ra&&(ra=Aa.getAllNodes(),0<ra.length?nb.setSelected(ra[0]):nb.setSelected(null));return Z};this.reHandleNodeRelation=function(ra,Z){if(ra){for(var Ka=Aa.getPage(),ta=Aa.getRelatedLine(ra,Ab.GET_LINE_STRATEGY_IN),O=0;O<ta.length;O++)Ka.removeLine(ta[O]);for(O=0;O<Z.length;O++)(ta=Z[O])&&Ka.addLine(ta,ra);wb.checkDownwardNode(ra)}};this.linkNode=function(ra,Z){Z instanceof Nb||Z instanceof ub?Z.affectByLink(Aa,ra):Aa.getPage().linkNode(ra,Z);wb.checkDownwardNode(ra)};this.breakLink=function(ra,Z){Z instanceof
Nb||Z instanceof ub?Z.affectByBreakLink(Aa,ra):Aa.getPage().breakLink(ra,Z);wb.checkDownwardNode(Z)};var sa=function(ra){(ra=Aa.getRelatedLine(ra,Ab.GET_LINE_STRATEGY_OUT))&&0<ra.length&&(ra=Aa.getNode(ra[0].getToId()),Ma(ra),sa(ra))},N=function(ra,Z){var Ka=ra.getY()+(ra.getHeight()>>1)-(Z.getHeight()>>1);Z.setPosition(ra.getX()+ra.getWidth()+150,Ka)},Ma=function(ra){ra.changePosition(ra.getX()+ra.getWidth()+150,ra.getY())},Mb=function(ra,Z){if(!Z||0==Z.length)return null;var Ka=Z[0].getFromId(),
ta=Aa.getNode(Ka);if(1==Z.length)return ta;if(ra instanceof Nb||ra instanceof ub)Ka=ra.getSuggestUpwardIdWhenDelete();if(!Ka)return ta;(ra=Aa.getNode(Ka))&&(ta=ra);return ta}}})();(function(){function qa(){var O,R,na,ja=!1,X=!1,J;this.setId=function(wa){J=wa};this.getId=function(){return J};this.setMatch=function(wa){ja=wa};this.getMatch=function(){return ja};this.setName=function(wa){O=wa};this.getName=function(){return O};this.setDisplayName=function(wa){R=wa};this.getDisplayName=function(){return R};this.setParentNode=function(wa){na=wa};this.getParentNode=function(){return na};this.setChecked=function(wa){X=wa};this.isChecked=function(){return X};this.check=function(wa){};
this.getSubNodeLevel=function(){for(var wa=-1,La=na;La;)wa++,La=La.getParentNode();return wa}}function Ca(){qa.call(this);var O=this,R=[],na=!0;this.setChildren=function(ja){R=ja};this.getChildren=function(){return R};this.setExpanded=function(ja){na=ja};this.isExpanded=function(){return na};this.check=function(ja,X){if(0!==R.length&&ja!==O.isChecked()){O.setChecked(ja);for(var J=0;J<R.length;J++)R[J].check(ja,X)}};this.toJsonObject=function(){var ja={};ja.children=R;return ja};this.fromJsonObject=
function(ja,X){O.setName(ja.name);O.setDisplayName(ja.displayName);O.setId(ja.id);if(ja=ja.children)for(var J=0;J<ja.length;J++){var wa=ja[J];if(wa.type){var La=new cb;La.fromJsonObject(wa);La.setParentNode(O);R.push(La);X&&La.setCommentInfo(X)}else La=new Ca,La.fromJsonObject(wa),La.setParentNode(O),R.push(La)}}}function cb(){qa.call(this);var O=this,R,na,ja,X;this.setUserSql=function(J){X=J};this.getUserSql=function(){return X};this.setCommentInfo=function(J){na=J};this.getCommentInfo=function(){return na};
this.setType=function(J){R=J};this.getType=function(){return R};this.setErrorMessage=function(J){ja=J};this.getErrorMessage=function(){return ja};this.fromJsonObject=function(J){O.setType(J.type);O.setName(J.name);O.setDisplayName(J.displayName);O.setCommentInfo(J.commentInfo);O.setId(J.id)};this.check=function(J,wa){J!==O.isChecked()&&(O.setChecked(J),wa&&wa(O.getParentNode()))}}function ab(){var O=this,R,na;this.getType=function(){return R};this.getDisplayName=function(){throw Error("override me");
};this.getIconName=function(){return na};this.getNodeCreator=function(){return ja};var ja=function(X,J,wa){X=Z.createTransformNode(O.getType());wa(X)};this.protectedMethod={setType:function(X){R=X},setIconName:function(X){na=X}}}function sb(){ab.call(this);var O=this.protectedMethod;O.setType(Mb.TYPE_FIELD_SELECT);O.setIconName("select_field");this.getDisplayName=function(){return ra.get("selectField","\u9009\u62e9\u5b57\u6bb5")}}function vb(){ab.call(this);var O=this.protectedMethod;O.setType(Mb.TYPE_SORT);
O.setIconName("sort");this.getDisplayName=function(){return ra.get("sort","\u6392\u5e8f")}}function Ab(){ab.call(this);var O=this.protectedMethod;O.setType(Mb.TYPE_GROUP_BY);O.setIconName("group_by");this.getDisplayName=function(){return ra.get("groupBy","\u5206\u7ec4\u6c47\u603b")}}function Yb(){ab.call(this);var O=this.protectedMethod;O.setType(Mb.TYPE_CUSTOM_GROUP);O.setIconName("custom_group");this.getDisplayName=function(){return ra.get("customGroup","\u81ea\u5b9a\u4e49\u5206\u7ec4")}}function Nb(){ub.call(this);
var O=this.protectedMethod;O.setType(Mb.TYPE_CALCULATED_FIELD);O.setIconName("calculated_field");this.getDisplayName=function(){return ra.get("calculatedField","\u8ba1\u7b97\u5b57\u6bb5")}}function ub(){ab.call(this);var O;this.getNodeCreator=function(){return R};this.setCustomNodeCreator=function(na){O=na};var R=function(na,ja,X){O&&O(na,ja,X)}}function Jb(){ub.call(this);var O=this.protectedMethod;O.setType(Mb.TYPE_JOIN);O.setIconName("join");this.getDisplayName=function(){return ra.get("joinTable",
"\u5173\u8054\u8868")}}function Fa(){ub.call(this);var O=this.protectedMethod;O.setType(Mb.TYPE_FILTER);O.setIconName("filter");this.getDisplayName=function(){return ra.get("filter","\u8fc7\u6ee4")}}function Aa(){ub.call(this);var O=this.protectedMethod;O.setType(Mb.TYPE_UNION);O.setIconName("union");this.getDisplayName=function(){return ra.get("union","\u5408\u5e76\u8868")}}function nb(){ub.call(this);var O=this.protectedMethod;O.setType(Mb.TYPE_COLUMN_TO_ROW);O.setIconName("column_to_row");this.getDisplayName=
function(){return ra.get("columnToRow","\u5217\u8f6c\u884c")}}function wb(){var O;this.setType=function(R){O=R};this.getType=function(){return O};this.getDisplayName=function(){throw Error("override me");}}function sa(){wb.call(this);this.setType(wb.TYPE_DELETE);this.getDisplayName=function(){return ra.get("delete","\u5220\u9664")}}function N(){wb.call(this);this.setType(wb.TYPE_RENAME);this.getDisplayName=function(){return ra.get("rename","\u91cd\u547d\u540d")}}"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 Ma=com.kingdee.bos.qing.modeler.designer;Ma.FolderNode=Ca;Ma.LeafNode=cb;Ma.NodeStatusMonitor=function(){var O=this,R,na=[],ja=[],X=[],
J={};this.reset=function(){O.setSelected(void 0);O.setInvalidNodes([])};this.addSelectNodeListener=function(La){na.push(La)};this.removeSelectNodeListener=function(La){La=na.indexOf(La);-1<La&&na.splice(La,1)};this.setSelected=function(La){if(R!==La){var Oa=R;La=R=La;for(var Ha=0;Ha<na.length;Ha++)(0,na[Ha])(Oa,La)}};this.getSelected=function(){return R};this.setInvalidNodes=function(La,Oa){ja=La;J={};if(La&&Oa)for(var Ha=Math.min(La.length,Oa.length),Qa=0;Qa<Ha;Qa++){var r=La[Qa];if(r){var M=Oa[Qa];
J[r.getId()]=M}}wa()};this.getInvalidNodes=function(){return ja};this.isInvalidNode=function(La){if(!ja)return!1;for(var Oa=0;Oa<ja.length;Oa++){var Ha=ja[Oa];if(Ha&&Ha.getId()==La)return!0}return!1};this.getInvalidPrompt=function(La){if(La&&(La=J[La.getId()]))return La.getPrompt()};this.addInvalidNode=function(La,Oa){La&&(0>ja.indexOf(La)&&ja.push(La),Oa&&(J[La.getId()]=Oa),wa())};this.removeInvalidNode=function(La){var Oa=ja.indexOf(La);-1<Oa&&(ja.splice(Oa,1),J[La.getId()]=null,wa())};this.batchUpdateNodeValidity=
function(La,Oa,Ha){if(La&&Oa)for(var Qa=Math.min(La.length,Oa.length),r=0;r<Qa;r++){var M=La[r];if(M){var P=Oa[r],G=ja.indexOf(M);0>G&&ja.push(M);J[M.getId()]=P}}if(Ha)for(r=0;r<Ha.length;r++)M=Ha[r],G=ja.indexOf(M),-1<G&&(ja.splice(G,1),J[M.getId()]=null);wa()};this.addInvalidNodeChangeListener=function(La){X.push(La)};this.removeInvalidNodeChangeListener=function(La){La=X.indexOf(La);-1<La&&X.splice(La,1)};this.getInvalidState=function(La){return J[La.getId()]};var wa=function(){for(var La=0;La<
X.length;La++)(0,X[La])(ja)}};Ma.DraggingTableNode=function(){var O,R;this.setTableNode=function(na){O=na};this.getTableNode=function(){return O};this.setTable=function(na){R=na};this.getTable=function(){return R}};Ma.JoinTransformType=Jb;Ma.NodeOperateType=wb;var Mb,ra,Z,Ka;(function(){Mb=Ma.Config;Z=Ma.TransformNodeFactory;var O=com.kingdee.bos.qing.framework.common;ra=O.MultilanguageManager.createPackageAccessor(Ma);O=com.kingdee.bos.qing.common;Ka=O.TextMeasurer})();var ta=new function(){var O=
[sb,Fa,Jb,Aa,Nb,Yb,Ab,vb,nb],R,na=0;this.getAllTypes=function(){R||ja();return O};this.getMaxDisplayNameLength=function(){if(!na){var X=new Ka;X.setFontSize(12);for(var J=0;J<O.length;J++){var wa=O[J].getDisplayName();na=Math.max(na,X.measureWidth(wa))}}return na};this.getType=function(X){R||ja();return R[X]};var ja=function(){var X=O;O=[];R={};for(var J=0,wa=X.length;J<wa;J++){var La=new X[J];O.push(La);R[La.getType()]=La}}};Ma.TransformTypeFactory=ta;wb.TYPE_RENAME="rename";wb.TYPE_DELETE="delete";
Ma.NodeOperateTypeFactory=new function(){var O=!1,R=[sa,N];this.getAllTypes=function(){if(!O){for(var na=[],ja=0;ja<R.length;ja++)na[ja]=new R[ja];R=na;O=!0}return R}}})();(function(){function qa(){var t;this.getPrompt=function(){return t};this.setPrompt=function(H){t=H}}function Ca(t){qa.call(this);t=ha.get("lackInputNodePrompt","\u8282\u70b9\u6ca1\u6709\u8fde\u63a5\u6570\u636e\u8868");this.setPrompt(t)}function cb(){qa.call(this);this.setPrompt(ha.get("upwardNodeInvalid","\u4e0a\u6e38\u8282\u70b9\u8bbe\u7f6e\u4e0d\u5b8c\u6574"))}function ab(t){qa.call(this);t=t?t:ha.get("defaultConfigPrompt","\u8282\u70b9\u8bbe\u7f6e\u4e0d\u5b8c\u6574");this.setPrompt(t)}function sb(){qa.call(this);
this.setPrompt(ha.get("invalidSourcePrompt","\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664"))}function vb(){qa.call(this);this.setPrompt(ha.get("tableNoFieldPrompt","\u8282\u70b9\u7f3a\u5c11\u5b57\u6bb5"))}function Ab(){qa.call(this);this.setPrompt(ha.get("tableNoAuthorityPrompt","\u65e0\u6743\u67e5\u770b\u8868\u6570\u636e"))}function Yb(){qa.call(this);this.setPrompt(ha.get("tableModelDeleted","\u8be5\u8868\u5bf9\u5e94\u7684\u6a21\u578b\u5df2\u88ab\u5220\u9664"))}function Nb(){qa.call(this);
this.setPrompt(ha.get("tableModelNoDataPermission","\u60a8\u672a\u88ab\u6388\u6743\u4f7f\u7528\u8be5\u8868\u5bf9\u5e94\u7684\u6a21\u578b"))}function ub(){qa.call(this);this.setPrompt(ha.get("tableModelInComplete","\u8be5\u8868\u5bf9\u5e94\u7684\u6a21\u578b\u8bbe\u7f6e\u4e0d\u5b8c\u6574"))}function Jb(){qa.call(this);this.setPrompt(ha.get("tableModelDamage","\u8be5\u8868\u5bf9\u5e94\u7684\u6a21\u578b\u5df2\u635f\u574f"))}function Fa(t){qa.call(this);if(1==t.length)t=ha.get("tableModelCycleReference",
"\u8be5\u8868\u5bf9\u5e94\u7684\u6a21\u578b'#1'\u4e0e\u5f53\u524d\u6a21\u578b\u5b58\u5728\u5faa\u73af\u5f15\u7528").replace("#1",t[0]),this.setPrompt(t);else{for(var H=0;H<t.length;H++){if(0==H){var Q=ha.get("tableModelCycleReference","\u8be5\u8868\u5bf9\u5e94\u7684\u6a21\u578b'#1'\u4e0e\u5f53\u524d\u6a21\u578b\u5b58\u5728\u5faa\u73af\u5f15\u7528");Q=Q.replace("#1",t[H])}H==t.length-1?(Q+=ha.get("tableModelRefCurrentModel",",'#1'\u6a21\u578b\u5f15\u7528\u4e86\u5f53\u524d\u6a21\u578b"),Q=Q.replace("#1",
t[H])):(Q+=ha.get("tableModelRefOtherModel",",'#1'\u6a21\u578b\u5f15\u7528\u4e86'#2'\u6a21\u578b"),Q=Q.replace("#1",t[H]).replace("#2",t[H+1]))}this.setPrompt(Q)}}function Aa(){var t;this.setModeler=function(H){t=H};this.getNodeChecker=function(H){var Q=new N;H instanceof mb&&(Q=new wb);H instanceof ka?Q=new Ma:H instanceof Ga?Q=new Mb:H instanceof la?Q=new ra:H instanceof Ja?Q=new Z:H instanceof Ua?Q=new Ka:H instanceof ua?Q=new ta:H instanceof da?Q=new O:H instanceof Ra?Q=new R:H instanceof z&&
(Q=new na);Q&&Q.setModeler(t);return Q}}function nb(){var t;this.checkNode=function(H,Q,Ta){throw Error("override me");};this.setModeler=function(H){t=H};this.protectedMethod={getModeler:function(){return t}}}function wb(){nb.call(this);this.checkNode=function(t,H,Q){H()}}function sa(){nb.call(this);var t=this,H=this.protectedMethod;this.checkNode=function(Q,Ta,ca){var va,Na=W.ModelConverter.getUpwardNode(H.getModeler(),Q,!0);Na&&0!=Na.length||(va=new Ca(Q));va?Ta&&Ta(va):t.protectedCheckNode(Q,Ta,
ca)};this.protectedCheckNode=function(Q,Ta,ca){}}function N(){sa.call(this)}function Ma(){sa.call(this);var t=this.protectedMethod,H,Q;this.protectedCheckNode=function(ca,va,Na){H=ca;Q=va;va=t.getModeler();var Za=va.getPrevNode(H);W.NodeFieldHelper.asynGetFields(va,Za,Ta,function(){Na(ca)})};var Ta=function(ca){if(ca&&0!=ca.length){var va=H.getConfig();if(!va.isSelectAll()){var Na=!1;va=va.getSelected();for(var Za=0;Za<va.length;Za++){for(var hb=va[Za],ba=0;ba<ca.length;ba++){var Sa=ca[ba];if(hb.getFullName()==
Sa.getFullName()){Na=!0;break}}if(Na)break}if(!Na){Q(new ab(ha.get("noFieldSelect","\u672a\u9009\u62e9\u5b57\u6bb5")));return}}Q()}else Q(new ab(ha.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5")))}}function Mb(){sa.call(this);var t=this.protectedMethod,H,Q;this.protectedCheckNode=function(ca,va,Na){H=ca;Q=va;va=t.getModeler();var Za=va.getPrevNode(H);W.NodeFieldHelper.asynGetFields(va,Za,Ta,function(){Na(ca)})};var Ta=function(ca){ca&&0!=ca.length?Q():Q(new ab(ha.get("noFieldToSet","\u65e0\u53ef\u8bbe\u7f6e\u5b57\u6bb5")))}}
function ra(){sa.call(this);var t=this.protectedMethod,H,Q,Ta;this.protectedCheckNode=function(Sa,Ya,kb){H=Sa;Q=Ya;Ta=kb;Sa=t.getModeler();var Ib=H.getConfig();Ya=Sa.getNode(Ib.getLeft());kb=Sa.getNode(Ib.getRight());Ya&&kb?(Ib=Ib.getRelationModel())?(Ib=Ib.getRelations())&&0!=Ib.length?ca(Sa,Ya,kb,Ib):Q(new ab(ha.get("invalidRelation","\u5173\u8054\u5173\u7cfb\u8bbe\u7f6e\u4e0d\u5b8c\u6574"))):Q(new ab(ha.get("invalidRelation","\u5173\u8054\u5173\u7cfb\u8bbe\u7f6e\u4e0d\u5b8c\u6574"))):Q(new ab(ha.get("invalidRelation",
"\u5173\u8054\u5173\u7cfb\u8bbe\u7f6e\u4e0d\u5b8c\u6574")))};var ca=function(Sa,Ya,kb,Ib){W.NodeFieldHelper.asynGetFields(Sa,Ya,function(Wa){hb(Ib,Wa,!0)},function(){Ta(H)});W.NodeFieldHelper.asynGetFields(Sa,kb,function(Wa){hb(Ib,Wa)},function(){Ta(H)})},va,Na=!1,Za=!1,hb=function(Sa,Ya,kb){if(Ya&&0!=Ya.length)for(var Ib=kb?0:1,Wa=0;Wa<Sa.length;Wa++){var jb=Sa[Wa][Ib];if(!jb){va=ha.get("invalidRelation","\u5173\u8054\u5173\u7cfb\u8bbe\u7f6e\u4e0d\u5b8c\u6574");kb?Na=!0:Za=!0;ba();return}for(var pb=
!1,S=0;S<Ya.length;S++)if(Ya[S].getFullName()==jb.getFullName()){pb=!0;break}if(!pb){va=ha.get("invalidRelation","\u5173\u8054\u5173\u7cfb\u8bbe\u7f6e\u4e0d\u5b8c\u6574");kb?Na=!0:Za=!0;ba();return}}else va=ha.get("invalidRelation","\u5173\u8054\u5173\u7cfb\u8bbe\u7f6e\u4e0d\u5b8c\u6574");kb?Na=!0:Za=!0;ba()},ba=function(){if(Na&&Za){var Sa;va&&(Sa=new ab(va));Q(Sa)}}}function Z(){sa.call(this);var t=this.protectedMethod,H,Q;this.protectedCheckNode=function(ca,va,Na){H=ca;Q=va;va=t.getModeler();var Za=
va.getPrevNode(H);W.NodeFieldHelper.asynGetFields(va,Za,Ta,function(){Na(ca)})};var Ta=function(ca){if(ca&&0!=ca.length){var va=H.getConfig();va.updateFilterItems(ca);va=va.getNotEmptyFilterItems();0==va.length?Q(new ab(ha.get("noFilterSetting","\u672a\u8bbe\u7f6e\u8fc7\u6ee4\u6761\u4ef6\uff0c\u65e0\u6cd5\u9884\u89c8\u6570\u636e\uff0c\u8bf7\u8bbe\u7f6e\u8fc7\u6ee4\u6761\u4ef6"))):Gb.checkFilterField(va,ca)?Q(new ab(ha.get("invalidFilterSetting","\u8fc7\u6ee4\u6761\u4ef6\u4e0d\u5b8c\u6574\uff0c\u65e0\u6cd5\u9884\u89c8\u6570\u636e\uff0c\u8bf7\u4fee\u6539\u8fc7\u6ee4\u6761\u4ef6"))):
Q()}else Q(new ab(ha.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5")))}}function Ka(){sa.call(this);var t=this.protectedMethod,H,Q;this.protectedCheckNode=function(ca,va,Na){H=ca;Q=va;va=t.getModeler();var Za=va.getPrevNode(H);W.NodeFieldHelper.asynGetFields(va,Za,Ta,function(){Na(ca)})};var Ta=function(ca){if(ca&&0!==ca.length){var va=H.getConfig(),Na=va.getColumnToRowItems();if(Na&&0!==Na.length){Na={};for(var Za=0;Za<ca.length;Za++){var hb=ca[Za];Na[hb.getFullName()]=hb}ca=va.getUsedFieldNames();
for(va=0;va<ca.length;va++)if(!Na[ca[va]]){Q(new ab(ha.get("notExistColumnToRowField","\u201c\u5217\u8f6c\u884c\u201d\u4f7f\u7528\u7684\u5b57\u6bb5\u4e0d\u5b58\u5728")));return}Q()}else Q(new ab(ha.get("noColumnToRowSettings","\u672a\u8fdb\u884c\u201c\u5217\u8f6c\u884c\u201d\u8bbe\u7f6e")))}else Q(new ab(ha.get("noFieldToSet","\u65e0\u53ef\u8bbe\u7f6e\u5b57\u6bb5")))}}function ta(){sa.call(this);var t=this.protectedMethod,H,Q;this.protectedCheckNode=function(ca,va,Na){H=ca;Q=va;va=t.getModeler();
var Za=va.getPrevNode(H);W.NodeFieldHelper.asynGetFields(va,Za,Ta,function(){Na(ca)})};var Ta=function(ca){if(ca&&0!=ca.length){var va=H.getConfig().getAllSortItem();0==va.length?Q(new ab(ha.get("noSortItemSetting","\u672a\u8bbe\u7f6e\u6392\u5e8f\u4f9d\u636e\uff0c\u65e0\u6cd5\u9884\u89c8\u6570\u636e\uff0c\u8bf7\u8bbe\u7f6e\u6392\u5e8f\u4f9d\u636e"))):W.SortCheckHelper.checkAllSortItemExist(va,ca)?Q():Q(new ab(ha.get("invalidSortSetting","\u6392\u5e8f\u4f9d\u636e\u8bbe\u7f6e\u4e0d\u5b8c\u6574\uff0c\u65e0\u6cd5\u9884\u89c8\u6570\u636e\uff0c\u8bf7\u4fee\u6539\u6392\u5e8f\u4f9d\u636e")))}else Q(new ab(ha.get("noFieldToSelect",
"\u65e0\u53ef\u9009\u5b57\u6bb5")))}}function O(){sa.call(this);var t=this.protectedMethod,H,Q;this.protectedCheckNode=function(ca,va,Na){H=ca;Q=va;va=t.getModeler();var Za=va.getPrevNode(H);W.NodeFieldHelper.asynGetFields(va,Za,Ta,function(){Na(ca)})};var Ta=function(ca){ca&&0!=ca.length?0===H.getConfig().getGroupFieldItems().length?Q(new ab(ha.get("noSelectGroupFields","\u672a\u9009\u62e9\u5206\u7ec4\u5b57\u6bb5"))):Q():Q(new ab(ha.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5")))}}function R(){sa.call(this);
var t=this.protectedMethod,H,Q;this.protectedCheckNode=function(ca,va,Na){H=ca;Q=va;va=t.getModeler();var Za=va.getPrevNode(H);W.NodeFieldHelper.asynGetFields(va,Za,Ta,function(){Na(ca)})};var Ta=function(ca){ca&&0!=ca.length?0===H.getConfig().getCalculatedFields().length?Q(new ab(ha.get("noSetCalculatedField","\u672a\u8bbe\u7f6e\u8ba1\u7b97\u5b57\u6bb5"))):Q():Q(new ab(ha.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5")))}}function na(){sa.call(this);var t=this.protectedMethod,H,Q;this.protectedCheckNode=
function(ca,va,Na){H=ca;Q=va;va=t.getModeler();var Za=va.getPrevNode(H);W.NodeFieldHelper.asynGetFields(va,Za,Ta,function(){Na(ca)})};var Ta=function(ca){if(ca&&ca.length){var va=H.getConfig();ca=va.getGroupName();var Na=va.getSelectedField(),Za=va.getGroups();va=va.getHasOtherGroup();switch(!0){case !ca:var hb=new ab(ha.get("noSetGroupName","\u672a\u8bbe\u7f6e\u7ec4\u540d"));break;case !Na:hb=new ab(ha.get("noSetGroupName","\u672a\u9009\u62e9\u5b57\u6bb5"));break;case !Za.length&&!va:hb=new ab(ha.get("noSetGroupName",
"\u672a\u521b\u5efa\u4efb\u4f55\u5206\u7ec4"))}hb?Q(hb):Q()}else Q(new ab(ha.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5")))}}function ja(){this.getHandler=function(t,H){switch(t.getType()){case ma.TYPE_MULTI_OUTPUT:var Q=new J;break;case ma.TYPE_LACK_OUTPUT:Q=new wa;break;case ma.TYPE_INVALID_CONFIG:Q=new La;break;case ma.TYPE_LACK_INPUT:Q=new Oa;break;case ma.TYPE_INVALID_SOURCE:Q=new Ha;break;case ma.TYPE_TABLE_NO_FIELD:Q=new Qa;break;case ma.TYPE_TABLE_NO_AUTHORITY:Q=new r;break;case ma.TYPE_MODEL_DELETED:Q=
new M;break;case ma.TYPE_MODEL_NO_DATA_PERMISSION:Q=new P;break;case ma.TYPE_MODEL_INCOMPLETE:Q=new G;break;case ma.TYPE_MODEL_DAMAGE:Q=new za;break;case ma.TYPE_MODEL_CYCLE_REFERENCE:Q=new ea;break;case ma.TYPE_INCOMPLETE_MATERIALIZED_CONFIG:Q=new fa}Q&&(Q.setCase(t),Q.setGlobal(H));return Q}}function X(){var t,H;this.setCase=function(Q){t=Q};this.setGlobal=function(Q){H=Q};this.getDetail=function(){throw Error("override me");};this.protectedMethod={getCase:function(){return t},getGlobal:function(){return H},
getDisplayNameString:function(Q){for(var Ta=H.getModelerModel(),ca="",va=0;va<Q.length;va++){var Na=Ta.getNode(Q[va]);Na=W.DisplayNameHelper.getNodeDisplayName(Na);ca+="\u201c"+Na+"\u201d";va<Q.length-1&&(ca+=ha.get("comma","\u3001"))}return ca}}}function J(){X.call(this);var t=this.protectedMethod;this.getDetail=function(){var H=t.getCase().getOutputNodeIds(),Q=ha.get("onlyOneOutputAllowed","\u6570\u636e\u8868\u6a21\u578b\u4ec5\u53ef\u5b58\u5728\u4e00\u4e2a\u8f93\u51fa\u8282\u70b9\uff0c\u5f53\u524d\u6a21\u578b\u5b58\u5728#1#2\u4e2a\u8f93\u51fa\u8282\u70b9"),
Ta=t.getDisplayNameString(H);Q=Q.replace("#2",H.length);return Q.replace("#1",Ta)}}function wa(){X.call(this);this.getDetail=function(){return ha.get("lackOutputNode","\u6a21\u578b\u7f3a\u5c11\u8f93\u51fa\u8282\u70b9")}}function La(){X.call(this);var t=this.protectedMethod;this.getDetail=function(){var H=t.getCase().getNodeIds(),Q=ha.get("invalidNodeConfig","#1\u8282\u70b9\u7684\u8bbe\u7f6e\u4e0d\u5b8c\u6574");H=t.getDisplayNameString(H);return Q.replace("#1",H)}}function Oa(){X.call(this);var t=
this.protectedMethod;this.getDetail=function(){var H=t.getCase().getNodeIds(),Q=ha.get("lackInputNodeDetail","#1\u8282\u70b9\u6ca1\u6709\u8fde\u63a5\u6570\u636e\u8868");H=t.getDisplayNameString(H);return Q.replace("#1",H)}}function Ha(){X.call(this);var t=this.protectedMethod;this.getDetail=function(){var H=t.getCase().getNodeIds(),Q=ha.get("invalidNodeSource","#1\u8282\u70b9\u7684\u8868\u4e0d\u5b58\u5728");H=t.getDisplayNameString(H);return Q.replace("#1",H)}}function Qa(){X.call(this);var t=this.protectedMethod;
this.getDetail=function(){var H=t.getCase().getNodeIds(),Q=ha.get("tableNoField","#1\u8282\u70b9\u7f3a\u5c11\u5b57\u6bb5");H=t.getDisplayNameString(H);return Q.replace("#1",H)}}function r(){X.call(this);var t=this.protectedMethod;this.getDetail=function(){var H=t.getCase().getNodeIds(),Q=ha.get("tableNoAuthority","\u65e0\u6743\u67e5\u770b#1\u8282\u70b9\u7684\u8868\u6570\u636e");H=t.getDisplayNameString(H);return Q.replace("#1",H)}}function M(){X.call(this);var t=this.protectedMethod;this.getDetail=
function(){var H=t.getCase().getNodeIds();H=t.getDisplayNameString(H);return ha.get("nodeModelDeleted","#1\u8282\u70b9\u5bf9\u5e94\u7684\u6a21\u578b\u5df2\u88ab\u5220\u9664").replace("#1",H)}}function P(){X.call(this);var t=this.protectedMethod;this.getDetail=function(){var H=t.getCase().getNodeIds();H=t.getDisplayNameString(H);return ha.get("nodeModelNoDataPermission","\u60a8\u672a\u88ab\u6388\u6743\u4f7f\u7528#1\u8282\u70b9\u5bf9\u5e94\u7684\u6a21\u578b").replace("#1",H)}}function G(){X.call(this);
var t=this.protectedMethod;this.getDetail=function(){var H=t.getCase().getNodeIds();H=t.getDisplayNameString(H);return ha.get("nodeModelInComplete","#1\u8282\u70b9\u5bf9\u5e94\u7684\u6a21\u578b\u8bbe\u7f6e\u4e0d\u5b8c\u6574").replace("#1",H)}}function za(){X.call(this);var t=this.protectedMethod;this.getDetail=function(){var H=t.getCase().getNodeIds();H=t.getDisplayNameString(H);return ha.get("nodeModelDamage","#1\u8282\u70b9\u5bf9\u5e94\u7684\u6a21\u578b\u5df2\u635f\u574f").replace("#1",H)}}function ea(){X.call(this);
var t=this.protectedMethod;this.getDetail=function(){var H=t.getCase(),Q=H.getNodeIds();H=H.getCycleRefModelNames();Q=t.getDisplayNameString(Q);var Ta=ha.get("modelCannotCycleReference","\u6a21\u578b\u4e4b\u95f4\u4e0d\u5141\u8bb8\u5faa\u73af\u5f15\u7528\uff0c");if(1==H.length)Ta+=ha.get("nodeModelCycleReference","\u8282\u70b9#1\u5bf9\u5e94\u7684\u6a21\u578b'#2'\u4e0e\u5f53\u524d\u6a21\u578b\u5b58\u5728\u5faa\u73af\u5f15\u7528"),Ta=Ta.replace("#1",Q).replace("#2",H[0]);else for(var ca=0;ca<H.length;ca++){if(0==
ca){var va=ha.get("nodeModelRefOtherModel","\u8282\u70b9#1\u5bf9\u5e94\u7684\u6a21\u578b'#2'\u5f15\u7528\u4e86'#3'\u6a21\u578b\uff0c");va=va.replace("#1",Q).replace("#2",H[ca]).replace("#3",H[ca+1])}else ca==H.length-1?(va=ha.get("nodeModelRefCurrentModel","'#1'\u6a21\u578b\u5f15\u7528\u4e86\u5f53\u524d\u6a21\u578b"),va=va.replace("#1",H[ca])):(va=ha.get("modelRefOtherModel","'#1'\u6a21\u578b\u5f15\u7528\u4e86'#2'\u6a21\u578b\uff0c"),va=va.replace("#1",H[ca]).replace("#2",H[ca+1]));Ta+=va}return Ta}}
function fa(){X.call(this);this.getDetail=function(){return ha.get("incompleteMaterializedConfig","\u7269\u5316\u5b58\u50a8\u8bbe\u7f6e\u4e0d\u5b8c\u6574")}}"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 W=com.kingdee.bos.qing.modeler.designer;W.ModelerChecker=function(){var t=this,H,Q,Ta,ca,va,Na=[],Za={};this.setRemoteImpl=function(U){H=U};this.setGlobal=function(U){Q=U};this.init=function(U){va&&va.removePropertyChangeCallback(ba);va=U;va.addPropertyChangeCallback(ba);ca=new Aa;ca.setModeler(va)};this.setNodeStatusMonitor=function(U){Ta=U};this.check=function(U,B){(new ia(H,function(h){t.setGlobalCheckResult(h,!0)})).checkModelerValid(U)};this.backgroundCheck=
function(U){var B=new ia(H,function(h){var n=new Va;n.fromJsonObject(h);S(n)},function(){},function(){for(var h=Q.getModelerModel().getAllNodes(),n=0;n<h.length;n++)kb(h[n])});B.setShowBlocking(!1);Sa();B.checkModelerValid(U)};this.setGlobalCheckResult=function(U,B,h){var n=new Va;n.fromJsonObject(U);if(n.isValid())B&&(U=C.createFeedbackDialog(),U.setMessage(ha.get("tableModelerValid","\u5f53\u524d\u6570\u636e\u8868\u6a21\u578b\u6821\u9a8c\u901a\u8fc7")),U.setTitle(ha.get("operatingTips","\u64cd\u4f5c\u63d0\u793a")),
U.setOptionType(C.OPTION_OK),U.setButtonText(C.RETURN_OK,ha.get("iSee","\u6211\u77e5\u9053\u4e86")),U.showDialog());else{B=h?h:ha.get("tableModelerInvalid","\u5f53\u524d\u6570\u636e\u8868\u6a21\u578b\u6821\u9a8c\u5931\u8d25\uff0c\u65e0\u6cd5\u90e8\u7f72\u6216\u9884\u89c8\u6570\u636e");U=C.createFeedbackDialog();U.setMsgImageType(C.MSG_WARNING);U.setTitle(ha.get("operatingTips","\u64cd\u4f5c\u63d0\u793a"));U.setMessage(B);B=U.setDetail;h="";if(n.isModelEmpty())h=ha.get("noModeler","\u5f53\u524d\u6a21\u578b\u672a\u5efa\u6a21");
else{for(var e=n.getCases(),f=new ja,a=[],b=0,c=e.length;b<c;b++){var d=f.getHandler(e[b],Q);d&&a.push(d.getDetail())}b=0;for(c=a.length;b<c;b++)h+=b+1+"\u3001"+a[b],b<c-1?(h+="\uff1b",h+="\r\n"):h+=ha.get("period","\u3002")}B.call(U,h);U.setOptionType(C.OPTION_OK);U.setButtonText(C.RETURN_OK,ha.get("iSee","\u6211\u77e5\u9053\u4e86"));U.showDialog()}S(n)};var hb=(new Date).getTime();this.updateNodeValidity=function(U,B){if(!B)hb=(new Date).getTime();else if(B<hb)return;hb=B;B=U.getCheckedNodeIds();
var h=[],n=[],e=[];U=db(U);for(var f=0;f<B.length;f++){var a=B[f],b=va.getNode(a);(a=U[a])?-1<h.indexOf(b)||(h.push(b),e.push(a)):n.push(b)}Ta.batchUpdateNodeValidity(h,e,n)};var ba=function(U,B){(0==U.indexOf(Ia.KEY_CHANGE_TRANSFORM_CONFIG)&&U!=Ia.KEY_TRANSFORM_JOIN&&U!=Ia.KEY_TRANSFORM_UNION||U==$a.KEY_TABLE_NODE_SELECT_FIELD)&&t.checkDownwardNode(B)};this.focusNodeValidity=function(U,B,h){console.log("focus");0>Na.indexOf(U)?B&&B():(h=(h=Za[U.getId()])?h:[],h.push(B),Za[U.getId()]=h)};this.checkDownwardNode=
function(U){Ya(U,!0);Ib(U)};this.checkCurrentNode=function(U,B){Ya(U);Wa(U,B)};var Sa=function(){for(var U=Q.getModelerModel().getAllNodes(),B=0;B<U.length;B++)Ya(U[B])},Ya=function(U,B){if(B)for(U=W.ModelConverter.getDownwardNode(Q.getModelerModel(),U,!1),B=0;B<U.length;B++)console.log("start check"+U[B].getId()),Na.push(U[B]);else console.log("start check"+U.getId()),Na.push(U)},kb=function(U,B){var h=Na.indexOf(U);if(-1<h&&(console.log("finish check "+U.getId()),Na.splice(h,1),h=Za[U.getId()]))for(var n=
0;n<h.length;n++)h[n]();Za[U.getId()]=[];B&&(U=Q.getModelerModel().getNextNode(U))&&kb(U,!0)},Ib=function(U){var B=Q.getModelerModel();U=W.ModelConverter.getOutputNode(B,U);U=W.ModelConverter.convertToRuntimeModel(B,U);for(var h=[],n=U.getVertexes(),e=0;e<n.length;e++){var f=B.getNode(n[e].getId());f&&h.push(f)}var a=(new Date).getTime();B=new ia(H,function(b){var c=new Va;c.fromJsonObject(b);t.updateNodeValidity(c,a)},function(){},function(){for(var b=0;b<h.length;b++)kb(h[b])});B.setShowBlocking(!1);
B.checkNodeValid(U)},Wa=function(U,B,h){var n=Q.getModelerModel();if(jb(U))Ta.addInvalidNode(U,new cb),pb(n,U),B&&B(),kb(U,!0);else{var e=ca.getNodeChecker(U);e?e.checkNode(U,function(f){f?(Ta.addInvalidNode(U,f),pb(n,U),kb(U,!0)):(Ta.removeInvalidNode(U),kb(U),h&&(f=n.getNextNode(U))&&Wa(f,B,!0));B&&B()},function(f){kb(f)}):kb(U,h)}},jb=function(U){if(U=W.ModelConverter.getUpwardNode(Q.getModelerModel(),U,!0))for(var B=0;B<U.length;B++)if(Ta.isInvalidNode(U[B].getId()))return!0;return!1},pb=function(U,
B){if(B=U.getNextNode(B))Ta.addInvalidNode(B,new cb),pb(U,B)},S=function(U){var B=[],h=[];if(U.isValid())Ta.setInvalidNodes(B);else{var n=Q.getModelerModel();U=db(U);for(var e=Object.keys(U),f=0;f<e.length;f++){var a=e[f],b=n.getNode(a);b&&-1==B.indexOf(b)&&(B.push(n.getNode(a)),h.push(U[a]))}Ta.setInvalidNodes(B,h);for(f=0;f<B.length;f++)pb(n,B[f])}},db=function(U){var B={};U=U.getCases();for(var h=Q.getModelerModel(),n=0;n<U.length;n++){var e=U[n];if(e instanceof ob){var f=e.getNodeIds();for(e=
0;e<f.length;e++){var a=f[e],b=h.getNode(a);B[a]=new Ca(b)}}else if(e instanceof Bb)for(f=e.getNodeIds(),e=0;e<f.length;e++)a=f[e],B[a]||(B[a]=new ab);else if(e instanceof Db)for(f=e.getNodeIds(),e=0;e<f.length;e++)a=f[e],B[a]||(B[a]=new cb);else if(e instanceof Hb)for(f=e.getNodeIds(),e=0;e<f.length;e++)a=f[e],B[a]||(B[a]=new sb);else if(e instanceof qb)for(f=e.getNodeIds(),e=0;e<f.length;e++)a=f[e],B[a]||(B[a]=new vb);else if(e instanceof Cb)for(f=e.getNodeIds(),e=0;e<f.length;e++)a=f[e],B[a]||
(B[a]=new Ab);else if(e instanceof xa)for(f=e.getNodeIds(),e=0;e<f.length;e++)a=f[e],B[a]||(B[a]=new Yb);else if(e instanceof ib)for(f=e.getNodeIds(),e=0;e<f.length;e++)a=f[e],B[a]||(B[a]=new Nb);else if(e instanceof Pb)for(f=e.getNodeIds(),e=0;e<f.length;e++)a=f[e],B[a]||(B[a]=new ub);else if(e instanceof aa)for(f=e.getNodeIds(),e=0;e<f.length;e++)a=f[e],B[a]||(B[a]=new Jb);else if(e instanceof Y)for(f=e.getNodeIds(),b=e.getCycleRefModelNames(),e=0;e<f.length;e++)a=f[e],B[a]||(B[a]=new Fa(b))}return B}};
W.LackInputState=Ca;W.TableNoFieldState=vb;W.InvalidityCaseHandlerFactory=ja;var C,ia,ha,$a,Ia,ka,Ga,la,da,z,ua,Ra,Ja,Ua,mb,Gb,Va,ob,Bb,Db,Hb,qb,Cb,ma,xa,ib,Pb,aa,Y;(function(){var t=com.kingdee.bos.qing.ui.component;C=t.MessageDialog;t=com.kingdee.bos.qing.framework.common;ha=t.MultilanguageManager.createPackageAccessor(W);Ia=W.TableModeler;$a=W.ModelerModel;ia=W.DesignerFacade;ka=W.FieldSelectNode;Ga=W.FieldSettingNode;la=W.JoinNode;da=W.GroupByNode;z=W.CustomGroupNode;ua=W.SortNode;Ra=W.CalculatedFieldNode;
Ja=W.FilterNode;Ua=W.ColumnToRowNode;mb=W.TableNode;Gb=W.FilterCheckHelper;Va=W.ModelerValidity;ob=W.LackInputNodeCase;Bb=W.InvalidConfigCase;ma=W.AbstractInvalidityCase;Hb=W.InvalidSourceCase;Db=W.InvalidUpwardNodeCase;qb=W.TableNoFieldCase;Cb=W.TableNoAuthorityCase;xa=W.ModelDeletedCase;ib=W.ModelNoDataPermissionCase;Pb=W.ModelInCompleteCase;aa=W.ModelDamageCase;Y=W.ModelCycleReferenceCase})()})();(function(){function qa(a){var b=this,c,d=new sb,g,k,l,m,p,w,u,x,F,I;this.setScaleHelper=function(oa){k=oa};this.setGlobal=function(oa){I=oa};this.changeNodeDisplayName=function(){throw Error("override me");};this.getNamePositionRect=function(){throw Error("override me");};this.getOperateIconUi=function(){return l};this.changePosition=function(oa,bb){c&&(oa=pa([oa,bb]),d.setAttributes(c,{transform:"translate("+oa[0]+","+oa[1]+")"}))};this.getSvgElement=function(){if(!c){c=d.createNode("g");d.setAttributes(c,
{transform:"translate("+V(a.getX())+","+V(a.getY())+")"});b.protectedAddUi(c);var oa=d.createNode("rect");d.setAttributes(oa,{width:V(20),height:V(20),x:V(a.getWidth()-20),y:0,fill:"none","pointer-events":"visible"});c.appendChild(oa);l=$(oa);oa=d.createNode("text");d.setAttributes(oa,{fill:"#427cac",x:V(a.getWidth()-10)+"px",y:V(21)+"px","font-size":V(18)+"px"});d.setText(oa,"\u22ee");c.appendChild(oa);m=$(oa);d.setTitle(oa,C.get("moreOperation","\u66f4\u591a\u64cd\u4f5c"));m.addClass(qa.NODE_OPERATE_ICON_CLASS);
l.addClass(qa.NODE_OPERATE_ICON_CLASS);m.hide();l.hide();Da();Ba()}return c};this.remove=function(){c&&c.remove();c=null};this.protectedAddUi=function(oa){};this.setSelected=function(oa){p=oa;Da()};this.isSelected=function(){return p};this.setHover=function(oa){(w=oa)?(l.show(),m.show()):(m.hide(),l.hide())};this.isHover=function(){return w};this.setInvalid=function(oa,bb){u=oa;F=bb;Ba()};var V=function(oa){return k?k.getScaledSize(oa):oa},pa=function(oa){return k?k.getScaledCoordinate(oa):oa},Da=
function(){if(c)if(p){g=d.createNode("rect");var oa=Math.max(2,V(2));d.setAttributes(g,{width:V(a.getWidth())+oa,height:V(a.getHeight())+oa,x:-(oa>>1),y:-(oa>>1),rx:V(4),fill:"none","stroke-width":oa,stroke:"#276ff5"});c.appendChild(g)}else g&&g.remove(),g=null},Ba=function(){if(c)if(u){if(x=d.createNode("image"),d.setAttributes(x,{width:V(16),height:V(16),x:V(a.getWidth()-16>>1),y:-V(19),href:r.SvgIconHelper.makeUrl("error")}),c.appendChild(x),F){var oa=d.createNode("title");d.setText(oa,F);x.appendChild(oa)}}else x&&
x.remove(),x=null};this.protectedMethod={getSvgHelper:function(){return d},getScaledSize:V,getScaledCoordinate:pa,getGlobal:function(){return I}}}function Ca(a){qa.call(this,a);var b=this.protectedMethod,c,d,g,k,l=0;this.protectedAddUi=function(w){d=w;w=b.getSvgHelper();var u=w.createNode("rect");w.setAttributes(u,{width:b.getScaledSize(a.getWidth()),height:b.getScaledSize(a.getHeight()),x:0,y:0,rx:b.getScaledSize(4),fill:"#fafafa","stroke-width":b.getScaledSize(1),stroke:"#999"});d.appendChild(u);
w=b.getSvgHelper();c=w.createNode("text");$(c).addClass(qa.NODE_NAME_UI_CLASS);w.setAttributes(c,{fill:"#666",x:b.getScaledSize(40),y:b.getScaledSize(16),"font-size":b.getScaledSize(11)});m(r.DisplayNameHelper.getNodeDisplayName(a));d.appendChild(c);w=b.getSvgHelper();u=w.createNode("rect");var x=w.setAttributes,F=b.getScaledSize(30),I=b.getScaledSize(30),V=b.getScaledSize(5),pa=b.getScaledSize(a.getHeight()-30)>>1,Da=b.getScaledSize(4);var Ba=b.getGlobal().getModelerModel().getNodeSource(a);Ba=r.SvgIconHelper.getTableIconColor(Ba);
x.call(w,u,{width:F,height:I,x:V,y:pa,rx:Da,fill:Ba});x=w.createNode("image");F=w.setAttributes;I=b.getScaledSize(20);V=b.getScaledSize(20);pa=b.getScaledSize(10);Da=b.getScaledSize(a.getHeight()-20)>>1;Ba=r.SvgIconHelper;var oa=Ba.makeUrl,bb="table",gb=b.getGlobal().getModelerModel().getTableByNodeId(a.getId());gb&&gb.isUserSql()&&(bb=gb.getUserSql().getSqlType());F.call(w,x,{width:I,height:V,x:pa,y:Da,href:oa.call(Ba,bb)});d.appendChild(u);d.appendChild(x);w=b.getSvgHelper();g=w.createNode("text");
w.setAttributes(g,{fill:"#666",x:b.getScaledSize(57),y:b.getScaledSize(a.getHeight()-4-5+1),"font-size":b.getScaledSize(10)});k=w.createNode("image");w.setAttributes(k,{width:b.getScaledSize(16),height:b.getScaledSize(16),x:b.getScaledSize(38),y:b.getScaledSize(a.getHeight()-4-16),href:r.SvgIconHelper.makeUrl("field_num")});d.appendChild(k);d.appendChild(g);p()};this.changeNodeDisplayName=function(){m(r.DisplayNameHelper.getNodeDisplayName(a))};this.getNamePositionRect=function(){var w=b.getScaledSize(a.getX()+
40),u=b.getScaledSize(a.getY()+5),x=b.getScaledSize(100),F=Math.max(14,b.getScaledSize(18));return[w,u,x,F]};this.setFieldCount=function(w){l=w;p()};var m=function(w){var u=b.getSvgHelper(),x=r.SvgTextTrimer.trim(w,b.getScaledSize(11),b.getScaledSize(100));u.setText(c,x);u.setTitle(d,w)},p=function(){if(g){var w=b.getSvgHelper();w.setText(g,l);var u=C.get("selectedFields","\u5df2\u9009\u62e9#1\u4e2a\u5b57\u6bb5").replace("#1",l);w.setTitle(g,u);w.setTitle(k,u)}}}function cb(a){qa.call(this,a);var b=
this.protectedMethod,c,d;this.protectedAddUi=function(g){d=g;var k=b.getSvgHelper(),l=k.createNode("rect");k.setAttributes(l,{width:b.getScaledSize(a.getWidth()),height:b.getScaledSize(a.getHeight()),x:0,y:0,rx:b.getScaledSize(4),fill:"#fafafa","stroke-width":b.getScaledSize(1),stroke:"#999","pointer-events":"visible"});var m=r.DisplayNameHelper.getNodeDisplayName(a);c=k.createNode("text");$(c).addClass(qa.NODE_NAME_UI_CLASS);k.setAttributes(c,{fill:"#666",x:(b.getScaledSize(a.getWidth())>>1)+"px",
y:b.getScaledSize(a.getHeight()+11+3)+"px","font-size":b.getScaledSize(11)+"px","text-anchor":"middle"});k.setTitle(d,m);m=r.SvgTextTrimer.trim(m,b.getScaledSize(11),b.getScaledSize(150));k.setText(c,m);g.appendChild(l);g.appendChild(c);k=r.SvgIconHelper.getIconUrl(a);l=b.getSvgHelper();m=l.createNode("image");l.setAttributes(m,{width:b.getScaledSize(20),height:b.getScaledSize(20),x:b.getScaledSize(a.getWidth()-20>>1),y:b.getScaledSize(a.getHeight()-20>>1),href:k});g.appendChild(m)};this.changeNodeDisplayName=
function(){var g=b.getSvgHelper(),k=r.DisplayNameHelper.getNodeDisplayName(a);g.setTitle(d,k);k=r.SvgTextTrimer.trim(k,b.getScaledSize(11),b.getScaledSize(150));g.setText(c,k)};this.getNamePositionRect=function(){var g=r.DisplayNameHelper.getNodeDisplayName(a),k=Math.min(r.SvgTextTrimer.measureText(g),150);k+=20;g=b.getScaledSize(a.getX()+(a.getWidth()-k>>1));var l=b.getScaledSize(a.getY()+a.getHeight()+3);k=b.getScaledSize(k);var m=Math.max(80,k),p=Math.max(14,b.getScaledSize(18));return[g-(m-k>>
1),l,m,p]}}function ab(){function a(u,x,F,I){this.getX1=function(){return u};this.getX2=function(){return F};this.getY1=function(){return x};this.getY2=function(){return I}}var b=!1,c,d,g=[],k,l;this.isPrepared=function(){return b};this.prepare=function(u,x,F){l=F;d=x;u=u.getAllNodes();c=[];for(x=0;x<u.length;x++){var I=u[x];F=I.getX();var V=I.getY(),pa=F+I.getWidth();I=V+I.getHeight();c.push(new a(F,V,pa,I))}b=!0};this.anchor=function(u){w();k=u;var x=!1,F=!1;for(u=0;u<c.length;u++){var I=c[u];if(!x){x=
I;var V=k[1]+(k[3]>>1);var pa=x.getY1()+x.getY2()>>1;if(10>=Math.abs(pa-V)){V=m(x);var Da=l.getScaledSize(pa);p(V[0],Da,V[1],Da);k[1]=pa-(k[3]>>1);pa=!0}else pa=!1;pa?x=!0:(V=k[1],pa=x.getY1(),10>=Math.abs(pa-V)?(V=m(x),Da=l.getScaledSize(pa),p(V[0],Da,V[1],Da),k[1]=pa,pa=!0):pa=!1,pa?x=!0:(V=k[1]+k[3],pa=x.getY2(),10>=Math.abs(V-pa)?(x=m(x),V=l.getScaledSize(pa),p(x[0],V,x[1],V),k[1]=pa-k[3],x=!0):x=!1))}F||(F=I,pa=k[0],I=F.getX1(),10>=Math.abs(I-pa)?(pa=m(F,!0),V=l.getScaledSize(I),p(V,pa[0],V,
pa[1]),k[0]=I,I=!0):I=!1,I||(pa=k[0]+k[2],I=F.getX2(),10>=Math.abs(I-pa)?(F=m(F,!0),pa=l.getScaledSize(I),p(pa,F[0],pa,F[1]),k[0]=I-k[2],I=!0):I=!1),F=I);if(x&&F)break}};this.abort=function(){w()};var m=function(u,x){if(x){x=k[1];var F=u.getY1();x<F?u=u.getY2():(x=F,u=k[1]+k[3])}else x=k[0],F=u.getX1(),x<F?u=u.getX2():(x=F,u=k[0]+k[2]);return l.getScaledCoordinate([x-15,u+15])},p=function(u,x,F,I){var V=$("<div>");V.addClass("modeler-designer-auxiliary-line");d.append(V);g.push(V);M.layoutCtrl(V,
u,x,F-u,I-x)},w=function(){for(var u=0;u<g.length;u++)g[u].remove();g=[]}}function sb(){var a=this;this.createNode=function(b){return document.createElementNS("http://www.w3.org/2000/svg",b)};this.createWithAttrs=function(b,c){b=a.createNode(b);a.setAttributes(b,c);return b};this.setText=function(b,c){$(b).empty();c=document.createTextNode(c);b.appendChild(c)};this.setTitle=function(b,c){var d=b.getElementsByTagName("title");0==d.length?(d=a.createNode("title"),b.appendChild(d)):d=d[0];a.setText(d,
c)};this.addClass=function(b,c){$(b).addClass(c)};this.createPath=function(b,c,d,g){var k=a.createNode("path"),l=a.getPathCoordinate(b,c),m=a.getPathCoordinate(b+d,c);d=a.getPathCoordinate(b+d,c+g);b=a.getPathCoordinate(b,c+g);a.setAttributes(k,{d:"M"+l+" L"+m+" L"+d+" L"+b+" Z"});return k};this.setAttributes=function(b,c){for(var d in c)b.setAttribute(d,c[d])};this.getPathCoordinate=function(b,c){return""+b+" "+c}}function vb(){var a=this,b,c,d=[],g,k;this.protectedGetItemModels=function(){};this.protectedGetListPainter=
function(){};this.protectedGetListItemSize=function(){return[100,20]};this.protectedGetSuggestDropdownPos=function(){};this.protectedGetOperateIconHeight=function(){return 0};this.protectedGetOperateIconUi=function(){};this.addSelectedCallback=function(u){d.push(u)};this.setNode=function(u){u!=g&&l();g=u};this.setScaleHelper=function(u){k=u};var l=function(){if(c){var u=$(document.body);u.off("mousedown",w);u.off("mousewheel",p);c.detach();c=null}},m=function(){b=new Ia;b.setItemModels(a.protectedGetItemModels());
b.addPressedListener(function(u,x){l();if((x=u.getSelecteds())&&0!=x.length){for(var F=0;F<d.length;F++)(0,d[F])(x[0],g);u.setSelecteds([])}});b.setCustomItemPainter(function(u,x){var F=a.protectedGetListItemSize()[1];u.css({height:F+"px","line-height":F+"px"});(F=a.protectedGetListPainter())&&F(u,x)})},p=function(u){return M.isDescendent(u.target,b.getJqUi()[0])?!0:!1},w=function(u){var x=a.protectedGetOperateIconUi();x.is(":visible")&&(M.isDescendent(u.target,x[0])||M.isDescendent(u.target,c[0]))||
l()};this.protectedMethod={getNode:function(){return g},doDropdown:function(){console.log("do drop down");if(c)l();else{b||m();var u=$(document.body),x=a.protectedGetSuggestDropdownPos(),F=x[0],I=x[1],V=u.prop("clientHeight"),pa=a.protectedGetListItemSize()[1],Da=a.protectedGetItemModels().length;pa=Math.min(Da*pa+2,(V>>1)-10);I+pa>V&&(x=x[1]-pa-a.protectedGetOperateIconHeight(),0<=x&&(I=x));x=a.protectedGetListItemSize()[0];c=$("<div>");c.css("cursor","pointer");c.css("position","absolute");c.css("left",
F+"px");c.css("top",I+"px");c.css("width",x+"px");c.css("height",pa+"px");c.css("box-shadow","0 0 2px 0 #ccc");c.css("z-index","999999");c.appendTo(u);F=b.getJqUi();F.appendTo(c);F.css("position","absolute");F.css("left","0px");F.css("top","0px");F.css("width","100%");F.css("height","100%");b.scrollSelectedToVisible();u.on("mousedown",w);u.on("mousewheel",p)}},getScaledSize:function(u){return k?k.getScaledSize(u):u},getScaledCoordinate:function(u){return k?k.getScaledCoordinate(u):u}}}function Ab(a){ka.call(this);
var b=this.protectedMethod,c=this,d,g,k;(function(){b.setTitle(C.get("linkOtherNode","\u8fde\u63a5\u5176\u4ed6\u8282\u70b9"));c.setSize(300,280);b.setContentPaneCreator(function(){g||(g=new Yb(a),g.setGlobal(d));return g.getJqUi()});b.setClosingChecker2(function(l){l=g.getLinkNode();k&&k(l,a);return!0});b.setClosingAction(function(l){})})();this.setGlobal=function(l){d=l};this.getLinkableNode=function(){g||(g=new Yb(a),g.setGlobal(d));return g.getLinkableNode()};this.setLinkCallback=function(l){k=
l}}function Yb(a){var b=this,c,d,g,k=[];this.getJqUi=function(){if(!c){c=$("<div>");var l=$("<div>");k=[];g=new da;for(var m=b.getLinkableNode(),p=0,w=0;w<m.length;w++){var u=m[w],x=new z;x.setUserObject(u);x.setText(r.DisplayNameHelper.getNodeDisplayName(u));k.push(x);0==w&&x.setChecked(!0);g.addElement(x);u=x.getJqUi();M.layoutCtrl(u,0,p,200,25);u.appendTo(l);p+=30}M.layoutCtrlWithLRTB(l,0,0,null,0,0,null);l.css("overflow","scroll");l.appendTo(c)}return c};this.setGlobal=function(l){d=l};this.getLinkNode=
function(){for(var l=0;l<k.length;l++){var m=k[l];if(m.isChecked())return m.getUserObject()}};this.getLinkableNode=function(){return r.ModelConverter.getLinkableNodes(d.getModelerModel(),a)}}function Nb(){ka.call(this);var a=this.protectedMethod,b=this,c,d,g,k;(function(){a.setTitle(C.get("joinSetting","\u5173\u8054\u8868\u8bbe\u7f6e"));a.setSelectable(!0);a.setContentPaneCreator(function(){c||l();b.setSize(570,420);var m=c.getJqUi();m.css("overflow","scroll");return m});a.setFooterPaneCreator(function(m){var p=
new Ga(C.get("confirm","\u786e\u5b9a"));p.setHighlight(!0);var w=p.getJqUi();w.addClass("sa-ctrl-dialog-footer-ok");w.appendTo(m);p.addActionListener(function(u){var x=r.TransformNodeFactory.createTransformNode(H.TYPE_JOIN),F=c.getConfig();c.checkModelValid(F,function(I){if(I)return a.getMessageCurtain().showPrompt(I),!1;I=F.getRelationModel().getRight();I=g.getNode(I);x.addExtraFromNode(I);x.setConfig(F);k(x);a.destroy();return!0})});p=new Ga(C.get("cancel","\u53d6\u6d88"));p.setHighlight(!1);w=
p.getJqUi();w.addClass("sa-ctrl-dialog-footer-cancel");w.appendTo(m);p.addActionListener(function(u){a.destroy();return!0})});a.setClosingAction(function(m){})})();this.setNodeCreateCallback=function(m){k=m};this.setFromNode=function(m){d=m};this.setModelerModel=function(m){g=m};this.getNodeToJoin=function(){c||l();return c.getNodeToJoin()};var l=function(){c=new ub;c.setLeftNode(d);c.setModelerModel(g)}}function ub(){function a(){var q=this,y,L,T,Pa;this.getJqUi=function(){y||eb();return y};this.setSelectedChangedListener=
function(Lb){T=Lb};this.setItemModels=function(Lb){Pa=Lb;y||eb();q.protectedSetItemModels(Lb);Lb=q.getSelected();0>Pa.indexOf(Lb)&&q.setSelected(null)};this.protectedSetItemModels=function(Lb){throw Error("Implement");};this.getItemModels=function(){return Pa};this.setEnabled=function(Lb){q.protectedGetChooseCtrl()&&q.protectedGetChooseCtrl().setEnabled(Lb)};this.getSelected=function(){if(y)return q.protectedGetSelected()};this.protectedGetSelected=function(){throw Error("Implement");};this.setSelected=
function(Lb){y||eb();q.protectedSetSelected(Lb)};this.protectedSetSelected=function(Lb){throw Error("Implement");};this.setInvalidPrompt=function(Lb){Lb?(L||(L=$("<div>"),L.appendTo(y),M.layoutCtrl(L,0,4,16,16),Sa.background(L,"qingWarning")),L.show(),L.attr("title",Lb),M.layoutCtrlWithLRTB(q.protectedGetChooseCtrl().getJqUi(),16,0,null,0,0,null)):L&&(L.hide(),M.layoutCtrlWithLRTB(q.protectedGetChooseCtrl().getJqUi(),0,0,null,0,0,null))};this.protectedInit=function(Lb){throw Error("Implement");};
this.protectedGetChooseCtrl=function(){throw Error("Implement");};var eb=function(){y=$("<div>");q.protectedInit(y)};this.protectedMethod={fireSelectedChangedEvent:function(Lb){T&&T(Lb)}}}function b(){a.call(this);var q=this.protectedMethod,y;this.protectedSetItemModels=function(T){y.setItemModels(T)};this.protectedSetSelected=function(T){y.setSelected(T)};this.protectedGetSelected=function(){return y.getSelected()};this.protectedInit=function(T){y=new ua;y.setCustomPainter(L);y.addSelectedChangedListener(function(eb,
Lb,Wb){q.fireSelectedChangedEvent(Wb)});var Pa=y.getJqUi();T.append(Pa)};this.protectedGetChooseCtrl=function(){return y};this.setEnabled=function(T){y&&y.setEnabled(T)};var L=function(T,Pa,eb){eb&&w.getNode(eb.getId())&&(T=$("<div>"),T.addClass("modeler-propertyarea-join-relation-node-icon"),Sa.background(T,"TABLE"),T.appendTo(Pa),eb=r.DisplayNameHelper.getNodeDisplayName(eb),T=$("<div>"),T.addClass("modeler-propertyarea-join-relation-node-text"),T.text(eb),T.attr("title",eb),T.appendTo(Pa))}}function c(){a.call(this);
var q=this.protectedMethod,y,L;this.protectedSetItemModels=function(T){y&&y.setItemModel(T)};this.protectedSetSelected=function(T){L.setSelectedModel(T)};this.protectedGetSelected=function(){return L.getSelectedModel()};this.protectedInit=function(T){y=(new R).createChooseFieldPanel(w,!0);L=new Ua;L.setDropdownCreator(function(eb,Lb,Wb){return y.createJqPopup(eb,Lb,Wb)});L.addSelectionListener(function(eb,Lb){Lb&&(eb=eb.getSelectedModel(),q.fireSelectedChangedEvent(eb))});L.setCustomPainter(function(eb,
Lb){eb?(Lb.text(eb.getAlias()),Lb.attr("title",eb.getAlias())):Lb.text("")});var Pa=L.getJqUi();T.append(Pa)};this.protectedGetChooseCtrl=function(){return L}}function d(q){var y,L,T,Pa,eb,Lb;this.setConfig=function(fb,Ob){(y=fb)?Vb():Kb()};this.setLeftNode=function(fb){L=fb;y?Vb():Kb()};this.getNodePair=function(){return[Pa.getSelected(),eb.getSelected()]};this.setNodeChangeListener=function(fb){Lb=fb};this.getJqUi=function(){T||Wb();return T};var Wb=function(){T=$("<div>");T.addClass("modeler-propertyarea-lineitem");
Pa=new b;var fb=Pa.getJqUi();Pa.setEnabled(!1);Pa.setSelectedChangedListener(function(Ob){Pa.setInvalidPrompt();Lb&&Lb(Ob,!0)});fb.addClass("modeler-propertyarea-join-combobox-left");fb.appendTo(T);eb=new b;fb=eb.getJqUi();eb.setSelectedChangedListener(function(Ob){eb.setInvalidPrompt();Lb&&Lb(Ob)});fb.appendTo(T);fb.addClass("modeler-propertyarea-join-combobox-right")},Vb=function(){var fb=q.getNode(y.getLeft()),Ob=q.getNode(y.getRight()),yb,Rb,Xb=C.get("nodeNotFound","\u8282\u70b9\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664");
fb||(yb=Xb);Ob||(Rb=Xb);Pa.setInvalidPrompt(yb);eb.setInvalidPrompt(Rb);fb?(fb=q.getNode(y.getLeft()),Pa.setItemModels([fb]),yb=gb(fb),eb.setItemModels(yb)):Ob&&eb.setItemModels([Ob]);Pa.setSelected(fb);eb.setSelected(Ob)},Kb=function(){Pa.setItemModels([L]);Pa.setSelected(L);var fb=gb(L);eb.setItemModels(fb);0<fb.length&&eb.setSelected(fb[0])}}function g(){var q=this,y,L,T,Pa,eb,Lb;this.getJqUi=function(){y||Wb();return y};this.autoMatchField=function(){if(L&&T){var Kb=L.getItemModels(),fb=T.getItemModels();
if(Kb&&fb)for(var Ob=0;Ob<Kb.length;Ob++)for(var yb=0;yb<fb.length;yb++){var Rb=Kb[Ob],Xb=fb[yb];if(Rb.getAlias()==Xb.getAlias()){L.setSelected(Rb);L.setInvalidPrompt();T.setSelected(Xb);T.setInvalidPrompt();return}}}};this.setRemovable=function(Kb){Kb?Lb.show():Lb.hide()};this.setLeftEnabled=function(Kb){L&&L.setEnabled(Kb)};this.setRightEnabled=function(Kb){T&&T.setEnabled(Kb)};this.setDeleteCallback=function(Kb){eb=Kb};this.remove=function(){y&&y.remove()};this.getFieldPair=function(){return[L.getSelected(),
T.getSelected()]};this.setLeftRelation=function(Kb,fb){if(L){var Ob=L.getSelected();!fb&&Ob&&(fb=Ob);L.setItemModels(Kb);Vb(Kb,!0,fb)}};this.setRelationChangeListener=function(Kb){Pa=Kb};this.setRightRelation=function(Kb,fb){if(T){var Ob=T.getSelected();!fb&&Ob&&(fb=Ob);T.setItemModels(Kb);Vb(Kb,!1,fb)}};this.getFieldPair=function(){return[L.getSelected(),T.getSelected()]};var Wb=function(){y=$("<div>");L=new c;var Kb=L.getJqUi();Kb.addClass("modeler-propertyarea-join-combobox-left");L.setSelectedChangedListener(function(yb){yb&&
(L.setInvalidPrompt(),Pa&&Pa())});T=new c;var fb=T.getJqUi();T.setSelectedChangedListener(function(yb){yb&&(T.setInvalidPrompt(),Pa&&Pa())});fb.addClass("modeler-propertyarea-join-combobox-right");var Ob=$("<div>");Ob.text("=");Ob.appendTo(y);Ob.addClass("modeler-propertyarea-join-equal");Ob=new Ra;Ob.setText("\u00d7");Ob.addActionListener(function(yb){q.remove();eb&&eb(q)});Lb=Ob.getJqUi();Lb.appendTo(y);M.layoutCtrlWithLRTB(Lb,null,0,18,3,null,18);Lb.css("z-index",999);Kb.appendTo(y);fb.appendTo(y)},
Vb=function(Kb,fb,Ob){fb=fb?L:T;for(var yb,Rb=0;Rb<Kb.length;Rb++){var Xb=Kb[Rb];if(Ob&&Xb.getFullName()==Ob.getFullName()){yb=Xb;break}}if(yb)fb.setSelected(yb);else if(Ob){var $b=C.get("fieldNotExist","\u5b57\u6bb5\u4e0d\u5b58\u5728");fb.setSelected(Ob)}else $b=C.get("noFieldSelect","\u672a\u9009\u62e9\u5b57\u6bb5");fb.setInvalidPrompt($b)}}function k(){var q,y,L=[];this.isValid=function(){return y||q||0<L.length?!1:!0};this.isLackLeftNode=function(){return q};this.setLackLeftNode=function(T){q=
T};this.isLackRightNode=function(){return y};this.setLackRightNode=function(T){y=T};this.getInvalidRelationIdx=function(){return L};this.addInvalidRelationIdx=function(T){0>L.indexOf(T)&&L.push(T)}}var l,m,p,w,u,x,F=[],I=[],V,pa,Da,Ba=[Q.TYPE_LEFT_JOIN,Q.TYPE_RIGHT_JOIN,Q.TYPE_INNER_JOIN,Q.TYPE_FULL_JOIN],oa,bb;this.setLeftNode=function(q){p=q};this.setJoinConfig=function(q){u=q};this.setModelerModel=function(q){w=q};this.getJqUi=function(){l||Xa();return l};this.getConfig=function(){for(var q=new Q,
y,L=0;L<I.length;L++){var T=I[L];T.isChecked()&&(y=T.getUserObject())}L=x.getNodePair();var Pa;(T=L[0])&&(Pa=T.getId());var eb;(L=L[1])&&(eb=L.getId());L=Ub();q.init(y,Pa,eb,L);return q};this.updateUi=function(){Qb()};this.setJoinTypeChangeListener=function(q){oa=q};this.setRelationChangeListener=function(q){bb=q};this.checkModelValid=function(q,y){q.getJoinType()?(q=q.getRelationModel(),Fb(q,function(L){L.isValid()?y():y(C.get("invalidJoinConfig","\u5173\u8054\u8868\u8bbe\u7f6e\u4e0d\u5b8c\u6574\u3002"))})):
y(C.get("invalidJoinConfig","\u5173\u8054\u8868\u8bbe\u7f6e\u4e0d\u5b8c\u6574\u3002"))};this.getNodeToJoin=function(){return gb(p)};var gb=function(q){q=r.ModelConverter.getLinkableNodes(w,q);if(u){var y=u.getRelationModel();(y=w.getNode(y.getRight()))&&q.splice(0,0,y)}return q},Fb=function(q,y){var L=new k;w.getNode(q.getRight())||L.setLackRightNode(!0);w.getNode(q.getLeft())||L.setLackLeftNode(!0);if(L.isValid()){for(var T=q.getRelations(),Pa=0;Pa<T.length;Pa++){var eb=T[Pa];eb[0]&&eb[1]||L.addInvalidRelationIdx(Pa)}lb(q,
L,y)}else y(L)},lb=function(q,y,L){xb(q,y,function(T){T.isValid()?zb(q,T,L):L(T)})},xb=function(q,y,L){zb(q,y,L,!0)},zb=function(q,y,L,T){var Pa=T?q.getLeft():q.getRight(),eb=T?0:1;T=w.getNode(Pa);r.NodeFieldHelper.asynGetFields(w,T,function(Lb){for(var Wb=q.getRelations(),Vb=0;Vb<Wb.length;Vb++){var Kb=Wb[Vb][eb];if(!Kb){y.addInvalidRelationIdx(Vb);break}Kb=Kb.getFullName();for(var fb=!1,Ob=0;Ob<Lb.length;Ob++)if(Lb[Ob].getFullName()==Kb){fb=!0;break}fb||y.addInvalidRelationIdx(Vb)}L(y)})},Qb=function(){l||
Xa();if(u){for(var q=u.getJoinType(),y=0;y<I.length;y++)if(I[y].getUserObject()==q){I[y].setChecked(!0);break}y=u.getRelationModel();tb();q=y.getRelations();for(y=0;y<q.length;y++)Ea();x.setConfig(u);y=w.getNode(u.getLeft());q=w.getNode(u.getRight());y&&A(y,!0);q&&A(q)}else tb(),Ea(),x.setLeftNode(p),q=x.getNodePair(),y=q[0],q=q[1],y&&A(y,!0,Tb),q&&A(q,!1,Tb);rb()},Tb=function(){!F||1>F.length||F[0].autoMatchField()},tb=function(){for(var q=0;q<F.length;q++)F[q].remove();F=[]},Ub=function(){for(var q=
[],y=0;y<F.length;y++)q.push(F[y].getFieldPair());return q},Xa=function(){l=$("<div>");var q=ya(C.get("joinType","\u5173\u8054\u7c7b\u578b")),y=$("<div>");y.addClass("modeler-propertyarea-adaptive-lineitem");m=new da;for(var L=0;L<Ba.length;L++){var T=void 0,Pa=void 0,eb=Ba[L],Lb=$("<div>");Lb.addClass("modeler-propertyarea-join-radioitem");var Wb=new z;I.push(Wb);1==I.length&&Wb.setChecked(!0);Wb.addCheckedListener(D);m.addElement(Wb);Wb.setUserObject(eb);Wb=Wb.getJqUi();switch(eb){case Q.TYPE_LEFT_JOIN:Pa=
C.get("leftJoin","\u5de6\u8fde\u63a5");break;case Q.TYPE_RIGHT_JOIN:Pa=C.get("rightJoin","\u53f3\u8fde\u63a5");break;case Q.TYPE_INNER_JOIN:Pa=C.get("innerJoin","\u5185\u8fde\u63a5");break;case Q.TYPE_FULL_JOIN:Pa=C.get("fullJoin","\u5916\u8fde\u63a5")}var Vb=$("<div>");Vb.text(Pa);var Kb=$("<div>"),fb=Sa,Ob=fb.background;switch(eb){case Q.TYPE_LEFT_JOIN:T="leftJoin";break;case Q.TYPE_RIGHT_JOIN:T="rightJoin";break;case Q.TYPE_INNER_JOIN:T="innerJoin";break;case Q.TYPE_FULL_JOIN:T="fullJoin"}Ob.call(fb,
Kb,T);M.layoutCtrlWithLRTB(Wb,0,0,null,0,null,23);M.layoutCtrlMiddleAlign(Kb,20);M.layoutCtrl(Kb,22,null,20,20);M.layoutCtrl(Vb,50,null,70,23);M.layoutCtrlMiddleAlign(Vb,23);Vb.css({color:"#666","line-height":"23px"});Lb.append(Vb);Lb.append(Wb);Lb.append(Kb);Lb.attr("title",Pa);Lb.appendTo(y)}L=ya(C.get("joinConfig","\u5173\u8054\u4f9d\u636e"));T=Sb();eb=K();l.append(q);l.append(y);l.append(L);l.append(T);l.append(eb);Qb()},ya=function(q){var y=$("<div>");q=(new la(q)).getJqUi();y.addClass("modeler-propertyarea-lineitem");
y.append(q);M.layoutCtrlWithLRTB(q,0,0,null,0,0,null);return y},K=function(){var q=$("<div>");q.css({position:"relative",overflow:"auto"});var y=new Ra;y.setText(C.get("addJoinField","\u6dfb\u52a0\u5173\u8054\u5b57\u6bb5"));Da=y.getJqUi();y.addActionListener(function(L){L=Ea();var T=x.getNodePair();V?L.setLeftRelation(V):T&&T[0]&&A(T[0],!0);pa?L.setRightRelation(pa):T&&T[1]&&A(T[1])});Da.addClass("modeler-designer-add-btn");q.append(Da);return q},Ea=function(){var q=new g;q.setRelationChangeListener(Eb);
q.setDeleteCallback(function(L){L=F.indexOf(L);-1<L&&(F.splice(L,1),rb());Eb()});var y=q.getJqUi();y.addClass("modeler-propertyarea-lineitem");y.css("height","25px");y.insertBefore(Da);F.push(q);rb();return q},rb=function(){var q=!1,y=!1,L=x.getNodePair();L[0]&&w.getNode(L[0].getId())&&(q=!0);L[1]&&w.getNode(L[1].getId())&&(y=!0);L=1<F.length;for(var T=0;T<F.length;T++){var Pa=F[T];Pa.setRemovable(L);Pa.setLeftEnabled(q);Pa.setRightEnabled(y)}},Eb=function(){if(bb){var q=Ub(),y=u.getRelationModel(),
L=x.getNodePair(),T=L[0];T&&y.setLeft(T.getId());(L=L[1])&&y.setRight(L.getId());y.setRelations(q);Fb(y,function(Pa){Pa.isValid()&&bb(y)})}},Sb=function(){x=new d(w);var q=x.getJqUi();x.setNodeChangeListener(function(y,L){rb();A(y,L,function(){Tb();Eb()})});q.addClass("modeler-propertyarea-lineitem");return q},D=function(q,y){y&&oa&&oa(q.getUserObject())},v=!1,E=!1,A=function(q,y,L){!q||y&&v||!y&&E||(y?v=!0:E=!0,r.NodeFieldHelper.asynGetFields(w,q,function(T){var Pa=y?0:1;y?V=T:pa=T;y?v=!1:E=!1;for(var eb=
0;eb<F.length;eb++){var Lb=void 0,Wb=F[eb];if(u){var Vb=u.getRelationModel().getRelations()[eb];Vb&&(Vb=Vb[Pa])&&(Lb=Vb)}y?Wb.setLeftRelation(T,Lb):Wb.setRightRelation(T,Lb)}L&&L()},function(){y?v=!1:E=!1}))}}function Jb(){function a(){W.FieldsProvider.call(this);var F=this.protectedMethod,I=new b;(function(){I.setCustomItemPainter(function(V,pa){var Da=$("<div>");Da.addClass("modeler-designer-calculated-field-list-item-icon");Sa.background(Da,pa.getOutputDataType());Da.appendTo(V);Da=$("<div>");
Da.addClass("modeler-designer-calculated-field-list-item-text");Da.text(pa.getAlias());Da.appendTo(V)});I.addDBLClickListener(function(V){V="["+V.getSelecteds()[0].getAlias()+"]";F.fireChoosingEvent(V)})})();this.setAllFields=function(V){I.setAllFields(V)};this.getJqUi=function(){return I.getJqUi()}}function b(){var F,I=$("<div>"),V,pa;this.setAllFields=function(Da){F=Da};this.getJqUi=function(){var Da=$("<div>"),Ba=new mb;Ba.setSearchListenerDelay(200);Ba.setPlaceholder(C.get("search","\u641c\u7d22"));
Ba.addSearchListener(function(){var bb=Ba.getText().trim(),gb=new Ia;if(bb){for(var Fb=[],lb=0;lb<F.length;lb++){var xb=F[lb];0<=xb.getAlias().toUpperCase().indexOf(bb.toUpperCase())&&Fb.push(xb)}I.empty();0<Fb.length?gb.setItemModels(Fb):(bb=new la,bb.setText(C.get("nothingSearched","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),bb.setEnabled(!1),bb.setAlign(la.ALIGN_CENTER),bb=bb.getJqUi(),bb.addClass("modeler-designer-calculated-field-list-item-search-result"),bb.appendTo(I))}else I.empty(),
gb.setItemModels(F);gb.addDBLClickListener(V);gb.setCustomItemPainter(pa);gb.getJqUi().appendTo(I)});var oa=Ba.getJqUi();oa.addClass("modeler-designer-calculated-field-list-item-search");oa.appendTo(Da);oa=new Ia;oa.setItemModels(F);oa.addDBLClickListener(V);oa.setCustomItemPainter(pa);I.addClass("modeler-designer-calculated-field-list-item-list");oa.getJqUi().appendTo(I);I.appendTo(Da);return Da};this.setCustomItemPainter=function(Da){pa=Da};this.addDBLClickListener=function(Da){V=Da}}ka.call(this);
var c=this,d=this.protectedMethod,g=new W,k,l,m,p;(function(){c.setSize(800,570);d.setSelectable(!0);d.setContentPaneCreator(function(){return g.getJqUi()});d.setClosingChecker(function(){var F=g.isValidToAccepted();if(F){var I,V=g.getEditedDisplayName();V&&50<V.length&&(I=C.get("nameTooLongPrompt","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"));if(I)return d.getMessageCurtain().showPrompt(I),!1}return F});d.setClosingAction(function(F){if(F&&(g.acceptEditing(),F=g.getEditedDisplayName(),
p.setAlias(F),p.setFormula(g.getEditedExecutableFormula()),k(),l)){var I=r.TransformNodeFactory.createTransformNode(H.TYPE_CALCULATED_FIELD);p.setFromNode(I.getId());I.getConfig().setCalculatedFields([p]);l(I);r.FieldNumberHelper.generateDefaultNumberByAssignedName(p,p.getAlias());F=I.getFieldSettingConfig();F||(F=new r.FieldSettingConfig,I.setFieldSettingConfig(F));I=[];var V=new ba;V.setName(p.getName());V.setFromNode(p.getFromNode());V.setAlias(p.getAlias());I.push(V);F.setModifiedField(I,!0)}});
g.setFunctionsProviderCreator(function(F){return F.getInstanceForDataModeling()});g.setDuplicatedNameChecker(function(F,I){a:{for(var V=0;V<m.length;V++){var pa=m[V];if(F!=pa.getName()&&I==pa.getAlias()){F=!0;break a}}F=!1}return F});g.setDisplayNameTranslator(function(F,I){return I?u(F):w(F)})})();this.setSyntaxValidator=function(F){g.setSyntaxValidator(F)};this.setContext=function(F,I,V){var pa=F,Da=C.get("addCustomField","\u65b0\u5efa\u8ba1\u7b97\u5b57\u6bb5");if(V)for(pa=[],Da=C.get("modifyCustomField",
"\u7f16\u8f91\u8ba1\u7b97\u5b57\u6bb5"),V=0;V<F.length;V++)F[V].getFullName()!==I.getFullName()&&pa.push(F[V]);m=pa;p=I;d.setTitle(Da)};this.edit=function(F,I,V){k=I;l=V;I=new a;I.setAllFields(m);g.setFieldsProvider(I);F=F?p.getAlias():"";g.setEditingTarget(p.getName(),F,p.getFormula());c.showDialog();g.prepareToStart()};var w=function(F){return x(F,function(I){return I.getAlias()},function(I){return I.getFullName()})},u=function(F){return x(F,function(I){return I.getFullName()},function(I){return I.getAlias()})},
x=function(F,I,V){for(var pa={},Da=0;Da<m.length;Da++){var Ba=m[Da],oa="["+I(Ba)+"]";Ba="["+V(Ba)+"]";if(oa!=Ba)for(var bb=null;-1!=F.indexOf(oa);)bb||(bb="["+P.createUUID()+"]",pa[bb]=Ba),F=F.replace(oa,bb)}for(bb in pa)for(Ba=pa[bb];-1!=F.indexOf(bb);)F=F.replace(bb,Ba);return F}}function Fa(a){ka.call(this);var b=this.protectedMethod,c=this,d,g,k,l,m;(function(){if(a){var u=a.getConfig().copyFilterItems();d=new Aa(u)}else d=new Aa([]);b.setTitle(C.get("filterCondition","\u8fc7\u6ee4\u6761\u4ef6"));
b.setSelectable(!0);b.setContentPaneCreator(function(){d.setFromNode(g);d.setModelerModel(k);c.setSize(800,450);return d.getJqUi()});b.setFooterPaneCreator(function(x){var F=new Ga(C.get("confirm","\u786e\u5b9a"));F.setHighlight(!0);var I=F.getJqUi();I.addClass("sa-ctrl-dialog-footer-ok");I.appendTo(x);F.addActionListener(function(V){if(V=d.checkModelValid())b.getMessageCurtain().showPrompt(V);else{V=d.getFilterItem();if(a)m&&m(V);else{a=r.TransformNodeFactory.createTransformNode(H.TYPE_FILTER);var pa=
new Ta;pa.setFilterItems(V);a.setConfig(pa);l&&l(a)}p()}});F=new Ga(C.get("cancel","\u53d6\u6d88"));F.setHighlight(!1);I=F.getJqUi();I.addClass("sa-ctrl-dialog-footer-cancel");I.appendTo(x);F.addActionListener(function(V){p()})});b.setClosingAction(function(x){p()})})();this.updateTableUi=function(u){u?u(function(x){w(x)}):r.NodeFieldHelper.asynGetFields(k,g,function(x){w(x)})};this.setAfterSetCallback=function(u){l=u};this.setConfigChangeListen=function(u){m=u};this.setFromNode=function(u){g=u};
this.setModelerModel=function(u){k=u};var p=function(){b.destroy();d.destroy()},w=function(u){u||(u=[]);d.setFields(u);d.updateUi()}}function Aa(a){function b(K){KTDefaultCellRender.call(this,K);var Ea=this,rb=this.paintCellUI;this.paintCellUI=function(Eb,Sb){if(Ea.getCurrentRowIdx()<za.getHeadRowCount()||!Ea.getCell())rb(Eb,Sb);else{var D=Ea.getCellWidth(),v=Ea.getCellHeight(),E=Ea.getCurrentRow();if(0==Ea.getCurrentColIdx())E=Ea.getCell().getValue(),Eb=$(Eb),Eb.find(".modeler-designer-filter-table-prompt").remove(),
E&&(D=ea.createWarning(),D.addClass("modeler-designer-filter-table-prompt"),D.attr("title",E),D.appendTo(Eb));else if(1==Ea.getCurrentColIdx()||5==Ea.getCurrentColIdx()){Sb=1==Ea.getCurrentColIdx();var A=Ea.getCell().getValue();Ba(Eb,D,v,Sb,A,E)}else if(2==Ea.getCurrentColIdx())Sb=Ea.getCell().getValue(),oa(Eb,D,v,Sb,E);else if(3==Ea.getCurrentColIdx()){Sb=Ea.getCell().getValue();var q=E.getUserObject().getField();A=q?q.getOutputDataType():null;q=q?q.isEnum():!1;Eb=za.createCtrlInCell(Eb,D,v,ua);
Eb.setSelected(Sb);Eb.setItemModels(A?ca.getSelectableCompares(A,q):[]);Eb.setUserObject(E);Eb.setCustomPainter(bb);Eb.addSelectedChangedListener(zb)}else 4==Ea.getCurrentColIdx()?(Sb=Ea.getCell().getValue(),gb(Eb,D,v,Sb,E)):6==Ea.getCurrentColIdx()?(Sb=Ea.getCell().getValue(),lb(Eb,D,v,Sb,E)):rb(Eb,Sb)}}}function c(){ka.call(this);var K=this,Ea=this.protectedMethod,rb;this.edit=function(Eb,Sb,D){Ea.setTitle(C.get("relativeDateRange","\u76f8\u5bf9\u65e5\u671f"));rb||(K.setSize(450,430),rb=new fa,
rb.setContainsTime(Sb),Sb=new G,Sb.fromJsonObject(Eb.toJsonObject()),rb.setModel(Sb),Ea.setContentPaneCreator(function(){return rb.getJqUi()}),Ea.setClosingAction(function(v){v&&(v=rb.getModel(),D(v))}))}}function d(){ka.call(this);var K=this,Ea=this.protectedMethod,rb=new la,Eb=new la,Sb=new Db,D,v;this.setCaption=function(q,y){Ea.setTitle(q);rb.setText(y)};this.setText=function(q,y){Sb.setText(q);var L=0;q&&(q=q.split("\n").length,L=1E3<q?1E3:q);Eb.setText(L+"/1000\u9879");v=function(T){var Pa=
T?$.trim(Sb.getText()):null;y(T,Pa)};Ea.setClosingAction(v)};this.showDialogLeftAnchorTo=function(q){q&&(K.setSize(470,450),q=M.upwardCoordinate(document.body,[0,0],document.body),K.setPosition(Math.max(0,q[0]-10),Math.max(6,q[1]-450+40)));Sb.addEditedListener(A);Ea.setContentPaneCreator(E);K.showDialog();Sb.requestFocus()};this.setClosingChecker=function(q){q&&(D=function(){var y=q($.trim(Sb.getText()));y&&Ea.getMessageCurtain().showPrompt(y);return y?!1:!0},Ea.setClosingChecker(D))};var E=function(){Eb.setAlign(la.ALIGN_RIGHT);
M.layoutCtrlWithLRTB(rb.getJqUi(),0,0,null,0,null,23);M.layoutCtrlWithLRTB(Sb.getJqUi(),0,0,null,30,null,260);M.layoutCtrlWithLRTB(Eb.getJqUi(),290,0,null,287,null,23);var q=$("<div>");q.append(rb.getJqUi());q.append(Sb.getJqUi());q.append(Eb.getJqUi());return q},A=function(q){var y=q.getText(),L=[];y&&(L=y.trim().replace(/(\n\s*)+/g,"\n").split("\n"));y=L.length;1E3<y&&(q.setText(L.slice(0,1E3).join("\n")),y=1E3);Eb.setText(y+"/1000\u9879");Ea.getMessageCurtain().hide()}}function g(){var K=[],Ea,
rb,Eb=[],Sb=[],D;this.setItemModel=function(q,y){D=y;K=q};this.setListItemPainter=function(q){};this.setSelectedItemModel=function(q){Eb=q;Sb=Eb.slice(0)};this.setLastTimeSelectedModel=function(q){Sb=q};this.getSelectedItemModel=function(){return Eb};this.createJqPopup=function(q,y,L,T){Ea=$("<div>");Ea.appendTo(q);rb=$("<div>");Ea.addClass("modeler-designer-field-popup");rb.addClass("modeler-designer-enum-popup-list-owner");for(q=0;q<K.length;q++)E(K[q],rb,y,!1);y=new Ga;y.setHighlight(!0);y.setText(C.get("ok",
"\u786e\u5b9a"));y=y.getJqUi();y.css("z-index",3);y.css("margin-left",10);M.layoutCtrlWithLRTB(y,"50%",null,50,null,8,28);y.on("click",function(Pa){Sb=Eb.slice(0);L(Eb)});q=new Ga(C.get("cancle","\u53d6\u6d88"));q.setHighlight(!1);q=q.getJqUi();q.css("z-index",3);q.css("margin-left",-80);M.layoutCtrlWithLRTB(q,"50%",null,50,null,8,28);q.on("click",function(Pa){Eb=Sb.slice(0);T()});rb.appendTo(Ea);y.appendTo(Ea);q.appendTo(Ea);rb.css("height","77%");return[-1,260]};var v=function(q,y){y=q.getUserObject();
q=q.isChecked();y&&q?(q=A(y),0>q&&Eb.push(y)):y&&!q&&(q=A(y),-1<q&&Eb.splice(q,1))},E=function(q,y,L){var T=A(q);L=$("<div>");L.addClass("modeler-designer-field-popup-list-item");L.data("model",q);var Pa=$("<div>"),eb=new Hb;eb.setUserObject(q);eb.setChecked(-1<T);eb.addCheckedListener(v);T=eb.getJqUi();T.addClass("modeler-designer-field-selection-checkbox-icon");T.data("model",eb);eb=$("<div>");eb.text(q.fieldValue);eb.addClass("modeler-designer-field-selection-checkbox-text");Pa.append(T);Pa.append(eb);
L.append(Pa);y.append(L)},A=function(q){for(var y=0;y<Eb.length;y++)if(D(q,Eb[y]))return y;return-1}}var k=this,l,m,p,w=[],u,x;this.setFromNode=function(K){};this.setModelerModel=function(K){p=K};this.setFields=function(K){w=K};this.getJqUi=function(){l||F();return l};this.getFilterItem=function(){return a};var F=function(){l=$("<div>");u=za.createTable();u.setDraggableAdjusting(!1);u.setSyncUIWhenModelChanged(!0);u.setColumnFitVisibleWidth(!0);u.setScrollerVisible("hidden","auto");za.bindTextEditor(u,
I,pa);za.bindTableListenerForCtrl(u,Da);var K=new b(u);K.setOutsideVisible(!1);u.setCellRender(K);K=$(u.getUI());M.layoutCtrlWithLRTB(K,5,5,null,5,5,null);K.css("border","1px solid #dbdbdb");K.appendTo(l);x=new $a;x.setCallbackImmediately(function(){k.updateUi()});x.observe();return l};this.destroy=function(){x.unobserve()};this.locateToErrorRow=function(K,Ea){for(var rb=za.getHeadRowCount();rb<u.getRowsCount();rb++)u.getRow(rb).getCell(0).setValue("");-1!=K&&u.getRow(K+za.getHeadRowCount()).getCell(0).setValue(Ea)};
this.checkModelValid=function(){var K=r.FilterCheckHelper.checkFilterField(a,w);if(K||(K=r.FilterCheckHelper.checkFilterLogical(a)))return k.locateToErrorRow(K.getFiltersErrorRow(),K.getPrompt()),K.getPrompt();k.locateToErrorRow(-1);return null};var I=function(K,Ea){if(4!=Ea)return!1;K=u.getRow(K).getUserObject();Ea=K.getCompareOp();if(ca.isCompareOpWithoutValue(Ea)||ca.isCompareOpWithinOrNotWithinValue(Ea)||!r.FilterCheckHelper.checkFieldExisted(K,w))return!1;K=K.getField();return V(K)},V=function(K){var Ea=
K?K.getOutputDataType():null;return K&&K.isMulBaseData()?!0:Ea?(K=K?K.isEnum():!1,(Ea==ba.DT_STRING||Ea==ba.DT_NUMBER||Ea==ba.DT_INT)&&!K):!1},pa=function(K,Ea,rb,Eb,Sb){K=K.getUserObject();K.getValue()!==Eb&&(K.setValue(Eb),rb.setValue(Eb),k.checkModelValid());return!0},Da=function(K,Ea,rb,Eb){K=null;if(Ea){Ea=KTableUIAbstractView.createCellId(u.getRow(rb),u.getColumn(u.getColumnsCount()-1));K=k.getJqUi().find("#"+Ea);var Sb=rb-za.getHeadRowCount();rb=$("<div>");rb.text(C.get("insertRow","\u63d2\u5165"));
rb.addClass("modeler-designer-filter-table-op");rb.css("left","4px");rb.appendTo(K);rb.on("click",function(D){D=new ca;a.splice(Sb,0,D);k.updateUi()});rb=$("<div>");rb.text(C.get("deleteRow","\u5220\u9664"));rb.addClass("modeler-designer-filter-table-op");10<=a.length?rb.css("right","8px"):rb.css("right","4px");rb.appendTo(K);rb.on("click",function(D){a.splice(Sb,1);k.updateUi()})}else m&&m.find(".modeler-designer-filter-table-op").remove();m=K};this.updateUi=function(){u||F();for(var K=a.length-
1;0<=K;K--){var Ea=a[K];if(Ea.isEmpty())a.splice(K,1);else break}za.clear(u);u.addColumns(8);u.getColumn(0).setWidth(20);u.getColumn(1).setWidth(45);u.getColumn(2).setWidth(145);u.getColumn(3).setWidth(75);u.getColumn(4).setWidth(170);u.getColumn(5).setWidth(45);u.getColumn(6).setWidth(45);K=za.createHeadRow(u);K.getCell(1).setValue(C.get("leftBracket","\u5de6\u62ec\u53f7"));K.getCell(2).setValue(C.get("field","\u5b57\u6bb5"));K.getCell(3).setValue(C.get("compare","\u6bd4\u8f83"));K.getCell(4).setValue(C.get("value",
"\u503c"));K.getCell(5).setValue(C.get("rightBracket","\u53f3\u62ec\u53f7"));K.getCell(6).setValue(C.get("logic","\u903b\u8f91"));var rb=a.length,Eb=Math.max(9,rb+4);for(K=0;K<Eb;K++){K<rb?Ea=a[K]:(Ea=new ca,a.push(Ea));var Sb=za.createRow(u);Sb.setUserObject(Ea);Sb.getCell(0).setValue("");Sb.getCell(1).setValue(Ea.getLeftBracketCount());Sb.getCell(2).setValue(Ea.getField());Sb.getCell(3).setValue(Ea.getCompareOp());ca.isCompareOpRelativeDateRangeValue(Ea.getCompareOp())?Sb.getCell(4).setValue(Ea.getRelativeDateRange()?
Ea.getRelativeDateRange():""):Sb.getCell(4).setValue(Ea.getValue()?Ea.getValue():"");Sb.getCell(5).setValue(Ea.getRightBracketCount());Sb.getCell(6).setValue(Ea.getLogicOp()?Ea.getLogicOp():"")}k.checkModelValid();za.refresh(u)};var Ba=function(K,Ea,rb,Eb,Sb,D){K=za.createCtrlInCell(K,Ea,rb,ua);K.setSelected(Sb);K.setItemModels([0,1,2,3,4]);K.setUserObject(D);K.setCustomPainter(function(v,E,A){v=Eb?"(":")";for(var q="",y=0;y<A;y++)q+=v;E.text(q)});K.addSelectedChangedListener(Eb?Qb:Tb)},oa=function(K,
Ea,rb,Eb,Sb){var D=(new R).createChooseFieldPanel(p,!1);D.setItemModel(w);K=za.createCtrlInCell(K,Ea,rb,Ua);K.setUserObject(Sb);K.setSelectedModel(Eb);K.setDropdownCreator(function(v,E,A){return D.createJqPopup(v,E,A)});K.addSelectionListener(function(v){var E=v.getSelectedModel();v=v.getUserObject();var A=v.getUserObject(),q=A.getField(),y=q?q.getOutputDataType():"",L=E?E.getOutputDataType():"";A.setField(E);v.getCell(2).setValue(E);if(y!=L||q.getEnumValue()!=E.getEnumValue()){q=A.getCompareOp();
E=E?E.isEnum():!1;E=ca.getSelectableCompares(L,E);L=!1;for(y=0;y<E.length;y++)if(q==E[y]){L=!0;break}L||(q=ca.COMPARE_EQUAL);A.setCompareOp(q);xb(v.getCell(3),q);A.setValue(null);xb(v.getCell(4)," ")}k.checkModelValid()});K.setCustomPainter(function(v,E){E.text(v?v.getAlias():"")})},bb=function(K,Ea,rb){switch(rb){case ca.COMPARE_EQUAL:K=C.get("equal","\u7b49\u4e8e");break;case ca.COMPARE_NOT_EQUAL:K=C.get("notEqual","\u4e0d\u7b49\u4e8e");break;case ca.COMPARE_GREATER:K=C.get("greater","\u5927\u4e8e");
break;case ca.COMPARE_GREATER_EQUAL:K=C.get("equalOrGreater","\u5927\u4e8e\u7b49\u4e8e");break;case ca.COMPARE_LESS:K=C.get("less","\u5c0f\u4e8e");break;case ca.COMPARE_LESS_EQUAL:K=C.get("equalOrLess","\u5c0f\u4e8e\u7b49\u4e8e");break;case ca.COMPARE_INCLUDE:K=C.get("include","\u5305\u542b");break;case ca.COMPARE_NOT_INCLUDE:K=C.get("notInclude","\u4e0d\u5305\u542b");break;case ca.COMPARE_START_WITH:K=C.get("startWith","\u5f00\u5934\u662f");break;case ca.COMPARE_END_WITH:K=C.get("endWith","\u7ed3\u5c3e\u662f");
break;case ca.COMPARE_NULL:K=C.get("compareNull","\u4e3a\u7a7a");break;case ca.COMPARE_NOT_NULL:K=C.get("compareNotNull","\u4e0d\u4e3a\u7a7a");break;case ca.COMPARE_IN:K=C.get("compareIn","\u5728......\u4e4b\u5185");break;case ca.COMPARE_NOT_IN:K=C.get("compareNotIn","\u4e0d\u5728......\u4e4b\u5185");break;case ca.COMPARE_RELATIVE_DATE_RANGE:K=C.get("relativeDateRange","\u76f8\u5bf9\u65e5\u671f");break;default:K=""}Ea.text(K)},gb=function(K,Ea,rb,Eb,Sb){var D=Sb.getUserObject(),v=$(K);v.empty();if(r.FilterCheckHelper.checkFieldExisted(D,
w)){v.css("cursor","");var E=D.getCompareOp(),A=D.getField(),q=A?A.getOutputDataType():"",y=A?A.getEnumValue():null,L=A?A.isEnum():!1;if(!ca.isCompareOpWithoutValue(E))if(ca.isCompareOpWithinOrNotWithinValue(E))if(L){var T=[],Pa;for(Pa in y)T.push({fieldValue:y[Pa],fieldName:Pa});var eb=[];(Eb=JSON.parse(D.getValue()))&&Eb.forEach(function(yb){T.forEach(function(Rb){yb==Rb.fieldName&&eb.push({fieldValue:Rb.fieldValue,fieldName:Rb.fieldName})})});var Lb=new g;Lb.setItemModel(T,function(yb,Rb){return yb&&
Rb&&yb.fieldName==Rb.fieldName});Lb.setSelectedItemModel(eb);K=za.createCtrlInCell(K,Ea,rb,Ua);K.setUserObject(Sb);K.setSelectedModel(eb);K.setDropdownCreator(function(yb,Rb,Xb,$b){return Lb.createJqPopup(yb,Rb,Xb,$b)});K.addSelectionListener(function(yb){var Rb=yb.getSelectedModel();yb=yb.getUserObject().getUserObject();if(null==Rb||0==Rb.length)yb.setValue(null);else{JSON.parse(yb.getValue());var Xb=[],$b;for($b in Rb)Xb.push(Rb[$b].fieldName);yb.setValue(JSON.stringify(Xb))}k.checkModelValid()});
K.setCustomPainter(function(yb,Rb){var Xb=[],$b;for($b in yb)Xb.push(yb[$b].fieldValue);Rb.text(Xb.join(","))})}else{var Wb=za.createCtrlInCell(K,Ea,rb,Bb);Wb.setClearable(!0);Wb.setUserObject(Sb);Wb.getJqUi().find(".sa-ctrl-f7selector-text").on("click",function(){Fb(D,Wb)});Wb.addActionListener(function(yb){Fb(D,Wb)});null!=Eb&&""!=Eb&&" "!=Eb&&Eb&&Wb.setModel(JSON.parse(Eb).join(","));Wb.setCustomPainter(function(yb){return yb});Wb.addClearListener(function(yb){Ub(yb,D,null)})}else if(V(A))K=$("<div>"),
K.text(Eb),K.addClass("modeler-designer-common-table-cell-editable"),K.appendTo(v),v.css("cursor","pointer");else if(q==ba.DT_DATE||q==ba.DT_DATETIME)if(ca.isCompareOpRelativeDateRangeValue(E)){var Vb=q==ba.DT_DATETIME;v="";var Kb=Eb;Kb instanceof G?v=fa.modelToDisplayText(Kb,Vb):(Kb=new G,Kb.setPeriod(G.PERIOD_DAY),Kb.setWhichPeriod(0));var fb=za.createCtrlInCell(K,Ea,rb,la);v&&18<v.length&&(fb.getJqUi().attr("title",v),v=v.substring(0,18)+"...");fb.setText(v);fb.setUserObject(Sb);K=fb.getJqUi();
K.css("line-height","28px");K.on("click",function(yb){yb=Kb;var Rb=Ob,Xb=new c;Xb.edit(yb,Vb,Rb);Xb.showDialog()});Ea=$("<div>");Sa.background(Ea,"btn_edit");Ea.addClass("modeler-designer-filter-item-format-icon");Ea.appendTo(K);var Ob=function(yb){D.setRelativeDateRange(yb);fb.setText(fa.modelToDisplayText(yb,Vb));Sb.getCell(4).setValue(yb);k.checkModelValid()}}else v=new Date,Eb=Eb?parseInt(Eb):null,isNaN(Eb)||null==Eb?(D=Sb.getUserObject(),D.setValue(v.getTime())):v.setTime(Eb),K=za.createCtrlInCell(K,
Ea,rb,q==ba.DT_DATETIME?ob:Va),K.setDateObject(v),K.setUserObject(Sb),K.addModelChangedListener(Xa);else if(q==ba.DT_BOOLEAN)K=za.createCtrlInCell(K,Ea,rb,ua),K.setSelected(Eb),K.setItemModels([ba.BOOLEAN_TRUE,ba.BOOLEAN_FALSE]),K.setUserObject(Sb),K.setCustomPainter(function(yb,Rb,Xb){yb=Xb==ba.BOOLEAN_TRUE?C.get("dataTypeTrue","\u771f"):Xb==ba.BOOLEAN_FALSE?C.get("dataTypeFalse","\u5047"):"";Rb.text(yb)}),K.addSelectedChangedListener(ya);else if(L){T=[];for(Pa in y)T=T.concat(Pa);K=za.createCtrlInCell(K,
Ea,rb,ua);K.setSelected(Eb);K.setItemModels(T);K.setUserObject(Sb);K.setCustomPainter(function(yb,Rb,Xb){Rb.text(y[Xb])});K.addSelectedChangedListener(ya)}}else K=$("<div>"),Ea=D.getDisplayValue(!1),K.text(Ea),K.attr("title",Ea),K.addClass("modeler-designer-common-table-cell-not-editable"),K.appendTo(v)},Fb=function(K,Ea){var rb=C.get("enterSplit","\u7cbe\u786e\u5339\u914d\u591a\u503c\uff0c\u5404\u9879\u4e4b\u95f4\u4f7f\u7528\u56de\u8f66\u4f5c\u4e3a\u5206\u9694\u7b26"),Eb=K.getCompareOp()==ca.COMPARE_IN?
C.get("compareIn","\u5728......\u4e4b\u5185"):C.get("compareNotIn","\u4e0d\u5728......\u4e4b\u5185"),Sb=JSON.parse(K.getValue());Sb=Sb?Sb.join("\n"):"";var D=new d;D.setCaption(Eb,rb);D.setClosingChecker(function(v){if(v&&5E4<v.length)return C.get("matchTooLong","\u5339\u914d\u9879\u4e0d\u80fd\u8d85\u8fc750000\u4e2a\u5b57\u7b26")});D.setText(Sb,function(v,E){v&&Ub(Ea,K,E)});D.showDialogLeftAnchorTo(Ea.getJqUi())},lb=function(K,Ea,rb,Eb,Sb){K=za.createCtrlInCell(K,Ea,rb,ua);K.setSelected(Eb?Eb:null);
K.setItemModels([null,ca.LOGIC_AND,ca.LOGIC_OR]);K.setUserObject(Sb);K.setCustomPainter(function(D,v,E){D="";E==ca.LOGIC_AND?D=C.get("and","\u4e14"):E==ca.LOGIC_OR&&(D=C.get("or","\u6216"));v.text(D)});K.addSelectedChangedListener(tb)},xb=function(K,Ea){K.setValue(""===Ea?" ":"");K.setValue(Ea)},zb=function(K,Ea,rb){K=K.getUserObject();var Eb=K.getUserObject();Eb.setCompareOp(rb);K.getCell(3).setValue(rb);if(ca.isCompareOpWithoutValue(Ea)!=ca.isCompareOpWithoutValue(rb)||ca.isCompareOpRelativeDateRangeValue(Ea)!=
ca.isCompareOpRelativeDateRangeValue(rb)||ca.isCompareOpWithinOrNotWithinValue(Ea)!=ca.isCompareOpWithinOrNotWithinValue(rb))Eb.setValue(null),Eb.setRelativeDateRange(null),xb(K.getCell(4)," ");k.checkModelValid()},Qb=function(K,Ea,rb){K=K.getUserObject();K.getUserObject().setLeftBracketCount(rb);K.getCell(1).setValue(rb);k.checkModelValid()},Tb=function(K,Ea,rb){K=K.getUserObject();K.getUserObject().setRightBracketCount(rb);K.getCell(5).setValue(rb);k.checkModelValid()},tb=function(K,Ea,rb){K=K.getUserObject();
K.getUserObject().setLogicOp(rb);K.getCell(6).setValue(rb);k.checkModelValid()},Ub=function(K,Ea,rb){null!=rb&&K.setModel(rb.replace(/(\s*\n\s*)+/g,","));if(null==rb||Ea.getValue()!=JSON.stringify(rb.split("\n"))){K=K.getUserObject();if(null!=rb&&""!=rb){rb=JSON.parse(JSON.stringify(rb.split("\n")));var Eb=[];rb&&rb.forEach(function(Sb){""!=Sb.trim()&&Eb.push($.trim(Sb))});rb=JSON.stringify(Eb);Ea.setValue(rb);K.getCell(4).setValue(rb)}else Ea.setValue(null),K.getCell(4).setValue(null);k.checkModelValid()}},
Xa=function(K){var Ea=""+K.getDateObject().getTime();K=K.getUserObject();K.getUserObject().setValue(Ea);K.getCell(4).setValue(Ea);k.checkModelValid()},ya=function(K,Ea,rb){K=K.getUserObject();K.getUserObject().setValue(rb);K.getCell(4).setValue(rb);k.checkModelValid()}}function nb(){xa.AbstractWizardStep.call(this);var a,b,c,d,g,k,l;this.getSubTitle=function(){return C.get("unionConfigSelectNode","\u9009\u62e9\u8868")};this.getJqUi=function(m){l||(a=m,b=new wb,b.setItemModels(k),b.setGlobal(c),b.setMessageCurtain(a.getMessageCurtain()),
l=b.getJqUi());return l};this.intoThisStep=function(m,p){};this.outThisStep=function(m,p){if((m=b.getSelectedNodeItem())&&0!=m.length){m=new sa;m.setFromNode(d);m.setModelerModel(c.getModelerModel());m.setAfterSetCallback(g);var w=b.getSelectedNodeItem(),u=new va,x=u.setNodeItems,F=[],I=new Na;I.setNodeId(d.getId());I.setAlias(r.DisplayNameHelper.getNodeDisplayName(d));F.push(I);for(I=0;I<w.length;I++)F.push(w[I]);x.call(u,F);m.setUnionConfig(u);p(m)}else a.getMessageCurtain().showPrompt(C.get("needSelectedTable",
"\u8bf7\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\u8868\u3002"))};this.setGlobal=function(m){c=m};this.setFromNode=function(m){d=m};this.setAfterSetCallback=function(m){g=m};this.setItemModels=function(m){k=m}}function wb(){function a(){var p=[],w,u,x,F,I,V;this.getJqUi=function(){if(!u){u=$("<div>");w=new mb;w.addSearchListener(Ba);w.setPlaceholder(C.get("searchTable","\u8bf7\u8f93\u5165\u641c\u7d22\u5185\u5bb9"));w.setShowSearchIcon(!0);var oa=w.getJqUi();M.layoutCtrlWithLRTB(oa,17,null,230,0,null,23);
u.append(oa);x=$("<div>");x.addClass("modeler-designer-node-selection-left-node-area");u.append(x);oa=new Ha;oa.setType(Ha.TYPE_NO_SEARCH_RESULT);oa.setText(C.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"));F=oa.getJqUi();F.hide();F.appendTo(x);oa=new Ha;oa.setText(C.get("noTableToSelect","\u6682\u65e0\u53ef\u9009\u62e9\u7684\u8868"));I=oa.getJqUi();I.hide();I.appendTo(x);for(oa=0;oa<c.length;oa++)p.push(pa(c[oa]));oa=$(document.createDocumentFragment());
for(var bb=0;bb<p.length;bb++)oa.append(p[bb].getJqUi());x.append(oa);Da(p)}return u};this.setSelectedCallback=function(oa){V=oa};this.clearNodeSelected=function(){for(var oa=0;oa<p.length;oa++){for(var bb=p[oa],gb=!1,Fb=0;Fb<d.length;Fb++)if(d[Fb].getNodeId()==bb.getNodeId()){gb=!0;break}gb||bb.setSelected(!1)}};var pa=function(oa){var bb=new Mb;bb.setNodeItem(oa);bb.setGlobal(k);bb.setSelectedCallback(function(lb){var xb=k.getNodeStatusMonitor(),zb=lb.getNodeId();if(xb.isInvalidNode(zb))l.showPrompt(C.get("nodeNoDataAndCanNotSelect",
"\u8be5\u8282\u70b9\u6ca1\u6709\u6570\u636e, \u65e0\u6cd5\u88ab\u9009\u4e2d\u3002")),lb.setSelected(!1),lb.setEnabled(!1);else{xb=lb.getNodeItem();if(lb.isSelected())d.push(xb);else for(lb=xb.getNodeId(),xb=0;xb<d.length;xb++)if(d[xb].getNodeId()==lb){d.splice(xb,1);break}V&&V()}});for(var gb=0;gb<d.length;gb++){var Fb=d[gb];if(oa.getNodeId()==Fb.getNodeId()){bb.setSelected(!0);break}}return bb},Da=function(oa){if(oa){for(var bb=0;bb<p.length;bb++)p[bb].hide();F.hide();I.hide();if(0==oa.length)w.getText().trim()?
F.show():I.show();else for(bb=0;bb<oa.length;bb++)oa[bb].show()}},Ba=function(oa){if(oa=w.getText().trim()){for(var bb=[],gb=0;gb<p.length;gb++){var Fb=p[gb];0<=Fb.getNodeItemAlias().toUpperCase().indexOf(oa.toUpperCase())&&bb.push(Fb)}Da(bb)}else Da(p)}}function b(){var p,w,u,x;this.setDeleteCallback=function(Ba){x=Ba};this.getJqUi=function(){if(!w){w=$("<div>");w.addClass("modeler-designer-node-selection-right");p=new la;p.setText(C.get("selectedTable","\u5df2\u9009\u8868")+"("+d.length+")");p.getJqUi().addClass("modeler-designer-node-selection-selectedtablelabel");
w.append(p.getJqUi());var Ba=new la;Ba.setText(C.get("clearAll","\u5168\u90e8\u6e05\u9664"));Ba=Ba.getJqUi();Ba.addClass("modeler-designer-node-selection-clearalllabel");Ba.on("mousedown",Da);w.append(Ba);u=$("<div>");u.addClass("modeler-designer-table-selected-table-area");w.append(u);F()}return w};this.updateSelectedNodeAliasUi=function(){F()};var F=function(){if(d){u.empty();for(var Ba=$(document.createDocumentFragment()),oa=0;oa<d.length;oa++){var bb=Ba,gb=bb.append,Fb=d[oa],lb=$("<div>");lb.addClass("modeler-designer-table-selected-list-item");
lb.on("mouseenter",I);lb.on("mouseleave",V);var xb=$("<div>"),zb=Fb.getAlias();xb.text(zb);xb.addClass("modeler-designer-table-selected-list-item-alias");lb.append(xb);xb=$("<div>");xb.addClass("modeler-designer-table-selected-list-item-icon");Sa.background(xb,"delete");xb.data("nodeId",Fb.getNodeId());xb.on("click",pa);lb.append(xb);gb.call(bb,lb)}u.append(Ba);p.setText(C.get("selectedTable","\u5df2\u9009\u8868")+"("+d.length+")")}},I=function(Ba){$(Ba.currentTarget).find(".modeler-designer-table-selected-list-item-icon").css("display",
"block")},V=function(Ba){$(Ba.currentTarget).find(".modeler-designer-table-selected-list-item-icon").css("display","none")},pa=function(Ba){Ba=$(Ba.currentTarget).data("nodeId");for(var oa=0;oa<d.length;oa++)Ba==d[oa].getNodeId()&&d.splice(oa,1);F();x&&x()},Da=function(){d=[];F();x&&x()}}var c=[],d=[],g,k,l;this.getJqUi=function(){g||m();return g};this.setSelectedNodeItem=function(p){d=p};this.getSelectedNodeItem=function(){return d};this.setItemModels=function(p){c=p};this.setGlobal=function(p){k=
p};this.setMessageCurtain=function(p){l=p};var m=function(){g=$("<div>");var p=new a,w=new b;p.setSelectedCallback(function(){w.updateSelectedNodeAliasUi()});w.setDeleteCallback(function(){p.clearNodeSelected()});var u=new qb;u.setHorizontalSplit(!0);u.setEnabled(!0);u.setFirstSize(565,-1,-1);u.setSecondSize(200,185,300);u.setResizeMode(qb.RESIZE_MODE_SECOND_FIXED);u.setFirstChild(qb.createChildWrapper(p.getJqUi()));u.setSecondChild(qb.createChildWrapper(w.getJqUi()));g.append(u.getJqUi())}}function sa(){xa.AbstractWizardStep.call(this);
var a=this,b,c,d,g,k,l;this.getSubTitle=function(){return C.get("unionConfigFieldMapping","\u5b57\u6bb5\u5339\u914d")};this.getJqUi=function(p){k||(b=p,l=new N,l.setUnionConfig(c),l.setModeler(d),k=l.getJqUi());return k};this.intoThisStep=function(p,w){p=c.getNodeItems();m(p,0,{})};this.outThisStep=function(p,w){if(p)a.over(),w(null);else if(p=l.getUnacceptableError())b.getMessageCurtain().showPrompt(p.getErrorDesc());else if(c.checkUnionItemSelectEmpty())b.getMessageCurtain().showPrompt(C.get("noSelectedField",
"\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b57\u6bb5\u3002"));else{p=c.getNodeItems();for(var u=r.TransformNodeFactory.createTransformNode(H.TYPE_UNION),x=1;x<p.length;x++){var F=d.getNode(p[x].getNodeId());u.addExtraFromNode(F)}x=u.getConfig();x.setNodeItems(p);p=c.getSelectedUnionItem();x.setUnionItems(p);g&&g(u);u=u.getId();for(x=0;x<p.length;x++){var I=p[x];F=new ba;F.setName(I.getName());F.setFromNode(u);var V=I.getBaseField().getFromNode();I=(V=d.getNode(V))&&V.canGenerateNewField()?I.getAlias():
I.getName();r.FieldNumberHelper.generateDefaultNumberByAssignedName(F,I,!1)}w(null)}};this.isLastStep=function(){return!0};this.over=function(){l.destroy()};this.setUnionConfig=function(p){c=p};this.setFromNode=function(p){};this.setModelerModel=function(p){d=p};this.setAfterSetCallback=function(p){g=p};var m=function(p,w,u){if(p.length==w)l.updateSelectableNodeFields(u),l.updateUi();else{var x=d.getNode(p[w].getNodeId());r.NodeFieldHelper.asynGetFields(d,x,function(F){F||(F=[]);c.addOneNodeToUnion(x.getId(),
F,w,!0);u[x.getId()]=F.slice();m(p,w+1,u)})}}}function N(){function a(gb){KTDefaultCellRender.call(this,gb);var Fb=this,lb=this.paintCellUI,xb=new b,zb=new d,Qb=new g;this.getTable=function(){return gb};this.paintCellUI=function(Tb,tb){var Ub=Fb.getCurrentRowIdx(),Xa=Fb.getCurrentColIdx();1==Ub&&0==Xa?xb.paintAllCheckBoxCell(Fb,Tb,tb):Ub<za.getHeadRowCount()?(lb(Tb,tb),Qb.paintError(Fb,Tb,tb)):0==Xa?xb.paintCell(Fb,Tb,tb):1==Xa?zb.paintBaseCell(Fb,Tb,tb):zb.paintCell(Fb,Tb,tb)}}function b(){this.paintCell=
function(lb,xb,zb){lb.getCurrentRowIdx()==za.getHeadRowCount()&&u&&u.cleanOnRefreshTable();lb=lb.getCurrentRow().getUserObject();zb=new Hb;zb.setChecked(lb.isSelected());zb.setUserObject(lb);zb.addCheckedListener(Fb);u.addCheckBox(zb);lb=zb.getJqUi();lb.addClass("modeler-designer-field-table-checkbox");lb.appendTo($(xb))};this.paintAllCheckBoxCell=function(lb,xb,zb){a:{lb=lb.getCell().getUserObject().getUnionItems();for(zb=0;zb<lb.length;zb++)if(!lb[zb].isSelected()){lb=!1;break a}lb=!0}zb=new Hb;
zb.addCheckedListener(gb);zb.setChecked(lb);u.setAllCheckBox(zb);lb=zb.getJqUi();lb.addClass("modeler-designer-field-table-checkbox");lb.appendTo($(xb))};var gb=function(lb,xb){xb&&u.handleAllCheckBoxChange()},Fb=function(lb,xb){xb&&(lb.getUserObject().setSelected(lb.isChecked()),u.handleCheckBoxChange())}}function c(){var gb=[],Fb;this.addCheckBox=function(lb){gb.push(lb)};this.setAllCheckBox=function(lb){Fb=lb};this.cleanOnRefreshTable=function(){gb=[]};this.handleAllCheckBoxChange=function(){for(var lb=
0;lb<gb.length;lb++){var xb=gb[lb];xb.setChecked(Fb.isChecked());xb.getUserObject().setSelected(Fb.isChecked())}};this.handleCheckBoxChange=function(){for(var lb=!0,xb=0;xb<gb.length;xb++)lb=lb&&gb[xb].isChecked();Fb.setChecked(lb)}}function d(){this.paintBaseCell=function(zb,Qb,Tb){zb.getCellWidth();zb.getCellHeight();zb.getCurrentColIdx();var tb=zb.getCurrentRowIdx();Tb=zb.getCurrentRow().getUserObject();var Ub=zb.getCell(),Xa=Ub.getUserObject();zb=zb.getCurrentCol().getUserObject();Ub=Ub.getValue();
var ya=$("<div>");ya.text(Ub);ya.attr("title",Ub);ya.css("line-height","30px");ya.css("padding-left","2px");ya.css("padding-right","2px");ya.css("height","28px");ya.css("top","1px");$(Qb).append(ya);zb.isExist()&&gb(Xa,Tb.getBaseField(),Qb,!0)&&(ya.css("padding-left","17px"),Tb=$("<div>"),Tb.css("cursor","pointer"),Tb.attr("title",C.get("delete","\u5220\u9664")),Sa.backgroundWithHover(Tb,"delete"),Tb.addClass("modeler-designer-field-delete"),Tb.on("click",function(){Xa.setField(null);Xa.setFieldExist(!0);
m.tryDeleteOneUnionItem(tb-3);Da()}),Tb.appendTo($(Qb)))};this.paintCell=function(zb,Qb,Tb){var tb=zb.getCellWidth(),Ub=zb.getCellHeight(),Xa=zb.getCurrentColIdx();Tb=zb.getCurrentRow().getUserObject();var ya=zb.getCurrentCol().getUserObject();zb=zb.getCell().getUserObject();var K=(new R).createChooseFieldPanel(I,!0),Ea=x[zb.getNodeId()];K.setItemModel(Ea?Ea:[null]);K.setShowFieldNameEnable(!1);tb=za.createCtrlInCell($(Qb),tb,Ub,Ua);tb.setUserObject(Tb);tb.getJqUi().attr("data-colIndex",Xa);Xa=zb.getField();
tb.setSelectedModel(Xa);tb.setDropdownCreator(function(Eb,Sb,D){return K.createJqPopup(Eb,Sb,D)});tb.addSelectionListener(oa);var rb=!1;ya.isExist()&&(rb=gb(zb,Tb.getBaseField(),Qb,!1));tb.setCustomPainter(function(Eb,Sb){Eb=bb(Eb);Sb.text(Eb);Sb.attr("title",Eb);rb&&Sb.css("left","15px")});ya.isExist()||tb.setEnabled(!1)};var gb=function(zb,Qb,Tb,tb){zb=Fb(zb,Qb);if(!zb)return!1;zb.isAcceptable()||F||(F=zb);Qb=$("<div>");Qb.text("!");Qb.addClass("modeler-designer-field-notmatch-prompt");Qb.attr("title",
zb.getErrorDesc());tb||Qb.css("left","5px");Qb.appendTo($(Tb));return!0},Fb=function(zb,Qb){if(!zb.isFieldExist())return Qb=C.get("fieldNotExist","\u4e0d\u5b58\u5728\u7684\u5b57\u6bb5"),new k(!0,Qb);zb=zb.getField();if(!zb||!Qb||zb.getFullName()==Qb.getFullName())return null;if(!lb(zb,Qb))return Qb=C.get("enumFieldInConsistent","\u679a\u4e3e\u5b57\u6bb5\u5efa\u7acb\u6620\u5c04\u65f6\uff0c\u5b57\u6bb5\u7c7b\u578b\u548c\u679a\u4e3e\u503c\u5fc5\u987b\u5b8c\u5168\u4e00\u81f4\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9"),
new k(!1,Qb);if(!xb(zb,Qb)){var Tb=C.get("dataTypeNotMatch","\u5b57\u6bb5\u201c#1\u201d\u7684\u6570\u636e\u7c7b\u578b\u4e3a#2\uff0c\u4e0e\u5b57\u6bb5\u201c#3\u201d\u7684#4\u6570\u636e\u7c7b\u578b\u4e0d\u4e00\u81f4");Tb=Tb.replace("#1",zb.getAlias());Tb=Tb.replace("#2",r.PropDataTypeUtil.getDataTypeDesc(zb.getOutputDataType()));Tb=Tb.replace("#3",Qb.getAlias());Tb=Tb.replace("#4",r.PropDataTypeUtil.getDataTypeDesc(Qb.getOutputDataType()));return new k(!0,Tb)}},lb=function(zb,Qb){zb=zb?zb.getEnumValue():
null;Qb=Qb?Qb.getEnumValue():null;if(!zb&&!Qb)return!0;if(!zb&&Qb||zb&&!Qb||Object.keys(Qb).length!=Object.keys(zb).length)return!1;for(var Tb in Qb){var tb=Qb[Tb],Ub=zb[Tb];if(!Ub||Ub!=tb)return!1}return!0},xb=function(zb,Qb){zb=zb?zb.getOutputDataType():null;Qb=Qb?Qb.getOutputDataType():null;if(!zb||!Qb)return!0;switch(Qb){case ba.DT_STRING:return!0;case ba.DT_INT:case ba.DT_NUMBER:return zb==ba.DT_INT||zb==ba.DT_NUMBER;case ba.DT_DATE:case ba.DT_DATETIME:return zb==ba.DT_DATE||zb==ba.DT_DATETIME;
case ba.DT_BOOLEAN:return zb==ba.DT_BOOLEAN}return!1}}function g(){this.paintError=function(gb,Fb,lb){gb.getCellWidth();gb.getCellHeight();gb.getCurrentColIdx();(gb=gb.getCell())&&!gb.getUserObject().isExist()&&(gb=ea.createWarning(),gb.addClass("modeler-designer-node-item-error"),gb.attr("title",C.get("invalidSourcePrompt","\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664")),$(Fb).append(gb))}}function k(gb,Fb){this.isAcceptable=function(){return gb};this.getErrorDesc=function(){return Fb}}
var l,m,p,w,u,x={},F,I,V;this.getJqUi=function(){l||pa();return l};this.setUnionConfig=function(gb){m=gb};this.updateUi=function(){Da()};this.updateSelectableNodeFields=function(gb){x={};if(gb)for(var Fb in gb)if(gb[Fb]&&0!=gb[Fb].length){var lb=gb[Fb].slice();lb.unshift(null);x[Fb]=lb}};this.setModeler=function(gb){I=gb};this.getUnacceptableError=function(){return F};this.setTableStyle=function(gb){$(p.getUI()).addClass(gb)};this.destroy=function(){V.unobserve()};var pa=function(){l=$("<div>");p=
za.createTable();za.bindTableListenerForCtrl(p);w=new a(p);w.setOutsideVisible(!1);p.setCellRender(w);u=new c;var gb=$(p.getUI());gb.addClass("modeler-designer-field-table");gb.appendTo(l);V=new $a;V.setCallback(function(){p.relayoutViews()});V.observe()},Da=function(){F=null;u.cleanOnRefreshTable();za.clear(p);var gb=m.getNodeItems();p.addColumns(gb.length+1);p.getColumn(0).setWidth(40);for(var Fb=0;Fb<gb.length;Fb++)p.getColumn(Fb+1).setWidth(200),p.getColumn(Fb+1).setUserObject(gb[Fb]);gb=m.getNodeItems();
var lb=za.createHeadRow(p);lb.getCell(0).setUserObject(m);for(Fb=0;Fb<gb.length;Fb++){var xb=gb[Fb].getAlias();lb.getCell(Fb+1).setValue(xb);lb.getCell(Fb+1).setUserObject(gb[Fb])}gb=m.getUnionItems();for(Fb=0;Fb<gb.length;Fb++)lb=gb[Fb],xb=za.createRow(p),Ba(lb,xb);setTimeout(function(){za.refresh(p)},0)},Ba=function(gb,Fb){Fb.setUserObject(gb);gb=gb.getUnionInnerItems();for(var lb=0;lb<gb.length;lb++){var xb=gb[lb];Fb.getCell(lb+1).setUserObject(xb);xb=bb(xb.getField());Fb.getCell(lb+1).setValue(xb)}},
oa=function(gb,Fb){if(Fb){Fb=gb.getUserObject();var lb=gb.getSelectedModel();gb=gb.getJqUi().attr("data-colIndex")-1;var xb=Fb.getUnionInnerItemByIndex(gb),zb=xb.getField();if(!lb||!zb||lb.getFullName()!=zb.getFullName()){for(var Qb=m.getUnionItems(),Tb=0;lb&&Tb<Qb.length;Tb++){var tb=Qb[Tb].getUnionInnerItemByIndex(gb),Ub=tb.getField();if(Ub&&Ub.getFullName()==lb.getFullName()){tb.setField(null);m.tryDeleteOneUnionItem(Tb);break}}xb.isFieldExist()&&zb&&(Tb=m.getNodeItems(),m.addOneUnionItem(Tb[gb].getNodeId(),
zb.clone()));xb.setField(lb);xb.setFieldExist(!0);for(Tb=0;Tb<Qb.length;Tb++)if(Fb==Qb[Tb]){m.tryDeleteOneUnionItem(Tb);break}Da()}}},bb=function(gb){return gb?gb.isEnum()?gb.getAlias()+"("+C.get("enumField","\u679a\u4e3e\u5b57\u6bb5")+")":gb.getAlias():""}}function Ma(){var a=this,b,c;this.getJqUi=function(){if(!b){b=$("<div>");b.addClass("modeler-designer-node-selection-item");var d=$("<div>");d.addClass("modeler-designer-node-selection-item-table-icon");Sa.background(d,"table");b.append(d);var g=
$("<div>");g.text(c.getAlias());g.addClass("modeler-designer-node-selection-item-text");b.append(g);a.protectedInit(b,d,g)}return b};this.getNodeItem=function(){return c};this.setNodeItem=function(d){c=d};this.getNodeId=function(){return c.getNodeId()};this.getNodeItemAlias=function(){return c.getAlias()};this.hide=function(){b&&b.hide()};this.show=function(){b&&b.show()};this.protectedInit=function(d,g,k){throw Error("override me");}}function Mb(){Ma.call(this);var a=this,b=!1,c,d,g;this.protectedInit=
function(m){c=new Hb;c.setChecked(b);c.addCheckedListener(l);var p=c.getJqUi();p.addClass("modeler-designer-node-selection-checkbox");m.append(p);var w=$("<div>");w.addClass("modeler-designer-node-selection-preview-icon");w.css("cursor","pointer");w.on("click",k);Sa.backgroundWithHover(w,"preview");w.hide();m.mouseenter(function(){w.show()});m.mouseleave(function(){w.hide()});m.append(w)};this.setSelectedCallback=function(m){d=m};this.isSelected=function(){return b};this.setSelected=function(m){b=
m;c&&c.setChecked(m)};this.setEnabled=function(m){c.setEnabled(m)};this.setGlobal=function(m){g=m};var k=function(){var m=g.getModelerModel(),p=m.getNode(a.getNodeItem().getNodeId());m=r.ModelConverter.convertToRuntimeModel(m,p);m.setPreviewConfig(r.PreviewConfigManager.getPreviewConfig());var w=new ra;w.setRuntimeModel(m);w.setGlobal(g);w.setNode(p);w.showDialog()},l=function(m,p){p&&(b=m.isChecked(),d&&d(a))}}function ra(){ka.call(this);var a=this,b=this.protectedMethod,c,d,g,k,l,m;(function(){b.setTitle(C.get("dataPreview",
"\u6570\u636e\u9884\u89c8"));var x=$(document.body),F=x.prop("clientWidth");x=x.prop("clientHeight");var I=Math.min(1,Math.max(.8,1.16-2E-4*F));F=parseInt(I*F);x=parseInt(I*x);a.setSize(F,x);b.setSelectable(!0);b.setContentPaneCreator(function(){m=$("<div>");p();return m});b.getDialogCtrl().setFullScreenEnabled();b.getDialogCtrl().setResizeEnabled();b.getDialogCtrl().addResizeListener(function(){g.relayoutViews()});b.setFooterPaneCreator(null);b.setClosingAction(function(V){})})();this.setRuntimeModel=
function(x){k=x};this.setGlobal=function(x){c=x};this.setNode=function(x){d=x};var p=function(){w()||r.NodeFieldHelper.getPreviewData(k,function(x){l=x.getPreviewData();if(!w())if(l&&0!=l.getRowCount()){x=new KTBorderStyle;x.setBorderWidth(1);x.setBorderPen("solid");x.setBorderColor("#E3E3E3");var F=new KTStyle;F.setVerticalAlign("bottom");g=new KTable;g.setBorder(x);g.setStyle(F);g.setDraggableAdjusting(!0,1,0);g.setSyncUIWhenModelChanged(!1);g.setLargeDataMode(!0);g.setFrozenRows(1);g.getCellRender().setOutsideVisible(!1);
g.setColumnFitVisibleWidth(!1);x=l.getColumnCount()+1;g.addColumns(x);var I=new KTStyle;I.setTextAlign("center");I.setBold(!0);I.setColor("#666");I.setBackgroundColor("#E9E9E9");F=new KTStyle;F.setTextAlign("center");var V=g.addRow();V.setStyle(I);V.setHeight(22);for(I=0;I<x;I++){var pa=V.getCell(I),Da=g.getColumn(I);0==I?(pa.setValue(C.get("rowNum","\u5e8f\u53f7")),Da.setWidth(40),Da.setStyle(F)):(pa.setValue(l.getField(I-1).getAlias()),Da.setWidth(150))}x=$(g.getUI());x.appendTo(m);M.layoutCtrlWithLRTB(x,
0,0,null,32,0,null);x=new KTStyle;x.setColor("#333");x.setBackgroundColor("#fff");F=new KTStyle;F.setColor("#333");F.setBackgroundColor("#F3F3F3");V=new KTStyle;V.setTextAlign("right");for(I=0;I<l.getRowCount();I++)for(Da=0==I%2?x:F,pa=g.addRow(),pa.setHeight(22),pa.setStyle(Da),Da=0;Da<l.getColumnCount()+1;Da++){var Ba=pa.getCell(Da);if(0==Da)Ba.setValue(I+1);else{var oa=l.getOneRow(I),bb=l.getField(Da-1),gb=Ba,Fb=gb.setValue;oa=oa[Da-1];var lb=bb;var xb=lb.getOutputDataType();if(null==oa||void 0==
oa)oa="";else if(xb==ba.DT_DATE)lb=new ma,lb.setFormatString("yyyy-MM-dd"),oa=lb.format(oa);else if(xb==ba.DT_DATETIME)lb=new ma,lb.setFormatString("yyyy-MM-dd HH:mm:ss"),oa=lb.format(oa);else if(xb==ba.DT_BOOLEAN)oa=oa?"true":"false";else if(xb==ba.DT_NUMBER&&(lb=lb.getScale()))for(oa+="",xb=oa.split("."),2>xb.length?(oa+=".",xb=""):xb=xb[1],lb-=xb.length,xb=0;xb<lb;xb++)oa+="0";Fb.call(gb,oa);bb=bb.getOutputDataType();bb!=ba.DT_INT&&bb!=ba.DT_NUMBER||Ba.setStyle(V)}}g.updateUI();x=new la;x.setText(r.PreviewConfigManager.getRowCountText());
x.getJqUi().appendTo(m);M.layoutCtrlWithLRTB(x.getJqUi(),0,0,null,4,null,23)}else u(C.get("noData","\u5f53\u524d\u9884\u89c8\u89c4\u5219\u4e0b\uff0c\u6ca1\u6709\u7b26\u5408\u6761\u4ef6\u7684\u6570\u636e"))},m)},w=function(){var x=c.getNodeStatusMonitor();if(!x.isInvalidNode(d.getId()))return!1;(x=x.getInvalidPrompt(d))||(x=C.get("invalidNodeConfig","\u8282\u70b9#1\u8bbe\u7f6e\u4e0d\u5b8c\u6574").replace("#1",d.getAlias()));u(x);return!0},u=function(x){var F=new Z;m.append(F.getJqUi());F.setText(x)}}
function Z(){var a,b;this.getJqUi=function(){a||(a=$("<div>"),a.addClass("modeler-designer-preview-no-data-background"),b=$("<div>"),b.addClass("modeler-designer-preview-no-data-text"),b.appendTo(a));return a};this.setText=function(c){b.text(c)};this.hide=function(){a.hide()};this.show=function(){a.show()}}function Ka(a){ka.call(this);var b=this,c=this.protectedMethod,d,g,k,l,m=[],p;this.setFields=function(F){m=F;F=a;k=new ta;F=F?F.getConfig():null;k.setColumnToRowConfig(F);k.setCurrentFields(m);
k.setMessageCurtain(c.getMessageCurtain());k.setModeler(p)};this.setFunCallback=function(F){d=F};this.setConfigChangeListener=function(F){g=F};this.setModeler=function(F){p=F};this.initUi=function(){c.setSelectable(!0);c.setTitle(C.get("columnToRow","\u5217\u8f6c\u884c"));b.setSize(620,560);var F=$("<div>"),I=$("<div>");I.css({position:"absolute"});var V=$("<span>");V.addClass("modeler-designer-column-to-row-add-column-desc");V.text(C.get("configColumnDesc","\u5217\u8f6c\u884c\u529f\u80fd\u8bf4\u660e"));
V.appendTo(I);V=w().getJqUi();V.css({display:"inline-block",top:"10px","margin-left":"5px","z-index":"2"});V.appendTo(I);F.append(I);c.setContentPaneCreator(function(){F.append(k.getJqUi());return F});c.setClosingChecker(u,!0);c.setClosingAction(x)};var w=function(){var F=$("<div>"),I=$("<span>");I.text(C.get("columnToRowHelpIconTips","\u201c\u5217\u8f6c\u884c\u201d\u529f\u80fd\u53ef\u5c06\u539f\u59cb\u6570\u636e\u4e2d\u7684\u540c\u4e00\u884c\u591a\u5217\u6570\u636e\u8f6c\u6362\u4e3a\u591a\u884c\u6570\u636e "));
I.appendTo(F);I=ha.getColumnToRowUrl();I=$("<a onclick='javascript:window.open(\""+I+"\");' href='#'>");I.text(C.get("viewDetails","\u67e5\u770b\u5e2e\u52a9\u6587\u6863"));I.css({cursor:"pointer",color:"#5582f3"});I.appendTo(F);I=new Pb;I.setIconType(Pb.ICON_TYPE_QUESTION);I.setTipsSize(200,70);I.setTipsHtml(F[0]);return I},u=function(F){if(k.getColumnToRowConfig()){var I=k.getErrorMessage();if(I)return c.getMessageCurtain().showError(I),F(!1),!1}F(!0)},x=function(F){if(F){F=k.getColumnToRowConfig();
var I;if(I=F)I=F.getColumnToRowItems(),I=!(null==I||0===I.length);if(I){I=[];var V=F.getColumnToRowItems();if(null!=V&&0<V.length){for(var pa=0;pa<V.length;pa++){var Da=V[pa];Da&&Da.getName()&&I.push(Da)}F.setColumnToRowItems(I)}}l=F;if(a)g&&g(l);else for(a=r.TransformNodeFactory.createTransformNode(H.TYPE_COLUMN_TO_ROW),a.setConfig(l),d&&d(a),I=l,F=a.getId(),V=I.getTargetAttrField(),V.setFromNode(F),r.FieldNumberHelper.generateDefaultNumberByAssignedName(V,V.getAlias()),I=I.getTargetValueFields(),
V=0;V<I.length;V++)I[V].setFromNode(F),r.FieldNumberHelper.generateDefaultNumberByAssignedName(I[V],I[V].getAlias());c.destroy()}}}function ta(){function a(Xa){KTDefaultCellRender.call(this,Xa);var ya=this,K=this.paintCellUI;this.paintCellUI=function(q,y){var L=ya.getCellWidth(),T=ya.getCellHeight(),Pa=ya.getCurrentRow();if(ya.getCurrentRowIdx()<za.getHeadRowCount()&&22==Pa.getHeight())if(1==ya.getCurrentColIdx()){var eb=bb(C.get("targetFieldName","\u8f6c\u7f6e\u540e\u7684\u5c5e\u6027\u5217"),l.getAttrFieldAlias());
l.setAttrFieldAlias(Fb(ya.getCurrentColIdx(),eb));Ea(q,L,T,Pa,eb,!1,ya.getCurrentColIdx())}else 2==ya.getCurrentColIdx()?4==Xa.getColumnsCount()?(eb=bb(C.get("targetFieldValue","\u8f6c\u7f6e\u540e\u7684\u503c\u5217"),l.getTargetValueFieldAlia(ya.getCurrentColIdx()-2)),l.setValueFieldAlias(ya.getCurrentColIdx()-2,Fb(ya.getCurrentColIdx(),eb)),Ea(q,L,T,Pa,eb,!1,ya.getCurrentColIdx())):(eb=bb(C.get("targetFieldValue","\u8f6c\u7f6e\u540e\u7684\u503c\u5217")+(ya.getCurrentColIdx()-1),l.getTargetValueFieldAlia(ya.getCurrentColIdx()-
2)),l.setValueFieldAlias(ya.getCurrentColIdx()-2,Fb(ya.getCurrentColIdx(),eb)),Ea(q,L,T,Pa,eb,!0,ya.getCurrentColIdx())):2<ya.getCurrentColIdx()&&ya.getCurrentColIdx()<Xa.getColumnsCount()-1?(eb=bb(C.get("targetFieldValue","\u8f6c\u7f6e\u540e\u7684\u503c\u5217")+(ya.getCurrentColIdx()-1),l.getTargetValueFieldAlia(ya.getCurrentColIdx()-2)),l.setValueFieldAlias(ya.getCurrentColIdx()-2,Fb(ya.getCurrentColIdx(),eb)),Ea(q,L,T,Pa,eb,!0,ya.getCurrentColIdx())):K(q,y);else{eb=ya.getCurrentRowIdx()-3;var Lb=
$(q);ya.getCurrentRowIdx()>=za.getHeadRowCount()&&1==ya.getCurrentColIdx()?(T=!0,q=Lb.find(".modeler-designer-column-to-row-tablecell-editable"),y=q.eq(0),L=Pa.getCell(1).getValue(),0===q.length&&(T=!1,y=$("<div>"),y.addClass("modeler-designer-column-to-row-tablecell-editable"),y.appendTo(Lb),Lb.css("cursor","pointer")),y.text(L),T&&((T=l.getColumnToRowItem(eb))||(T=new hb),T.setName(L),l.addColumnToRowItem(eb,T)),V()):ya.getCurrentRowIdx()>=za.getHeadRowCount()&&1<ya.getCurrentColIdx()&&ya.getCurrentColIdx()<
Xa.getColumnsCount()-1?(q=Pa.getCell(ya.getCurrentColIdx()).getValue(),A(Lb,L,T,q,Pa,eb,ya.getCurrentColIdx())):K(q,y);Qb(Lb,Pa,Xa,ya.getCurrentColIdx(),eb)}};var Ea=function(q,y,L,T,Pa,eb,Lb){var Wb=$(q),Vb=za.createCtrlInCell(q,y,L,la);Vb.setText(Sb(Pa));Vb.setUserObject(T);q=Vb.getJqUi();q.css({"line-height":"28px",width:"100%"});q.find(".sa-ctrl-label-text").css({width:"87%","margin-left":"5px"});y=$("<div>");Sa.background(y,"edit");y.css("left","90%");y.on("click",function(){rb(Wb,Vb,Lb)});y.addClass("modeler-designer-column-to-row-format-icon");
y.appendTo(q);eb&&(y.css("left","80%"),q.find(".sa-ctrl-label-text").css("width","80%"),eb=$("<div>"),Sa.background(eb,"delete"),eb.css("left","90%"),eb.addClass("modeler-designer-column-to-row-format-icon"),eb.on("click",function(){l.deleteTargetValueField(Lb-2);Xa.removeColumn(Lb);V()}),eb.appendTo(q));D(Wb,Lb,Pa)},rb=function(q,y,L){var T=y.getText().replace("\uff08"+C.get("fieldNameReplace","\u540d\u79f0\uff1a"),"\uff08");T=oa(T,"\uff09")?T.substring(T.indexOf("\uff08")+1,T.length-1):"";var Pa=
new Ja;Pa.setText(T);var eb=$("<div>"),Lb=$(document.body),Wb=$("<div class='sa-ctrl-common-modallayer'>");Wb.appendTo(Lb);var Vb=new ib(Wb);Vb.setSelectable(!0);var Kb=C.get("modifyFieldName","\u4fee\u6539\u5b57\u6bb5\u540d\u79f0");Vb.setTitle(Kb);Kb=Lb.prop("clientWidth");var fb=Lb.prop("clientHeight");Vb.setBounds(Kb-312>>1,fb-175>>1,312,175);Vb.setToolbarVisible(!1);Vb.setContent(Eb(Pa,eb));Vb.showFooterPane();Wb.appendTo(Lb);var Ob=function(){var yb=Pa.getText().trim(),Rb=v(yb,L);if(Rb)return eb.text(Rb),
eb.attr("title",Rb),setTimeout(function(){eb.text("")},5E3),!1;T!=yb&&E(q,y,yb,L);return!0};Vb.addClosingListener(function(yb,Rb){Rb?Ob()&&(Vb.destroy(),Wb.remove()):(Vb.destroy(),Wb.remove())});return Vb},Eb=function(q,y){var L=$("<div>"),T=new la;T.setText(C.get("fieldName","\u5b57\u6bb5\u540d\u79f0"));T.setRequired(!0);T=T.getJqUi();M.layoutCtrl(T,25,7,75,23);T.appendTo(L);q=q.getJqUi();M.layoutCtrl(q,100,7,155,23);q.appendTo(L);y.css("color","#FCAD05");M.layoutCtrl(y,25,37,230,23);y.css({overflow:"hidden",
"text-overflow":"ellipsis","white-space":"nowrap"});y.appendTo(L);return L},Sb=function(q){return q.replace("\uff08","\uff08"+C.get("fieldNameReplace","\u540d\u79f0\uff1a"))},D=function(q,y,L){q=Fb(y,L);1!==y?l.setValueFieldAlias(y-2,q):l.setAttrFieldAlias(q)},v=function(q,y){if(null==q||""==q||0==q.length)return C.get("fieldNameIsNull","\u5b57\u6bb5\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a\u3002");if(50<q.length)return C.get("fieldNameCanNotExceedLimit","\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002");
if(q){if(!q.match(/^[\s\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/))return C.get("headNameComponentCheckError","\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\u3002");var L=l.getAttrFieldAlias(),T=l.getTargetValueFieldAlias().indexOf(q);if(q==L&&1!==y||-1<T&&T!==y-2)return C.get("headNameRepeatCheckError","\u5b57\u6bb5\u540d\u79f0\u5df2\u5b58\u5728\u3002");var Pa={};m.forEach(function(eb){Pa[eb.getAlias()]=eb});if(null!=Pa[q])return C.get("headNameRepeatCheckError",
"\u5b57\u6bb5\u540d\u79f0\u5df2\u5b58\u5728\u3002")}},E=function(q,y,L,T){var Pa=y.getText();oa(Pa,"\uff09")?y.setText(Pa.substring(0,Pa.indexOf("\uff08")+1)+L+"\uff09"):y.setText(Pa+"\uff08"+L+"\uff09");D(q,T,y.getText());y.setText(Sb(y.getText()));w.showSuccess(C.get("editSuccess","\u4fee\u6539\u6210\u529f\u3002"))},A=function(q,y,L,T,Pa,eb,Lb){var Wb=(new R).createChooseFieldPanel(x,!1);Wb.setItemModel(m);y=za.createCtrlInCell(q,y,L,Ua);y.setUserObject(Pa);y.setSelectedModel(T);y.setDropdownCreator(function(Vb,
Kb,fb){return Wb.createJqPopup(Vb,Kb,fb)});y.setCustomPainter(function(Vb,Kb){Pa.getCell(Lb).setValue(Vb);Kb.text(Vb?"\u5b57\u6bb5 ["+Vb.getAlias()+"] \u7684\u503c":"");if(Vb){var fb=l.getColumnToRowItem(eb);fb||(fb=new hb);var Ob=fb.getName();Ob||(Ob=(Ob=Vb.getAlias())?Ob:Vb.getFullName(),Pa.getCell(1).setValue(Ob),fb.setName(Ob));Ob=fb.getFields();Ob[Lb-2]=Vb;fb.setFields(Ob);l.addColumnToRowItem(eb,fb)}Qb(q,Pa,Xa,Lb,eb);Vb&&!u[Vb.getFullName()]&&(Kb.css("left","18px"),Vb=ea.createWarning(),Vb.attr("title",
C.get("disappearedField","\u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),Vb.addClass("modeler-designer-column-to-row-prompt"),Vb.css({left:"6px",right:"2px"}),Vb.appendTo($(q)));V()})}}var b=this,c,d,g,k,l,m=[],p,w,u={},x;this.getJqUi=function(){if(!d){d=$("<div>");var Xa=$("<div class='modeler-designer-column-to-row-table'>");c=za.createTable();c.setSyncUIWhenModelChanged(!0);c.setDraggableAdjusting(!0,3,0,new O);za.bindTextEditor(c,lb,xb);za.bindTableListenerForCtrl(c,zb);
var ya=new a(c);ya.setOutsideVisible(!1);c.setCellRender(ya);var K=l.getAttrFieldAlias();ya=l.getTargetValueFieldAlias();if(null==ya||0===ya.length)ya=[""];var Ea=ya.length+3;c.addColumns(Ea);c.getColumn(0).setWidth(25);c.getColumn(1).setWidth(200);for(var rb=0;rb<ya.length;rb++)c.getColumn(2+rb).setWidth(200);c.getColumn(Ea-1).setWidth(162);Ea=za.createHeadRow(c);Ea.getCell(1).setValue(K);for(K=0;K<ya.length;K++)Ea.getCell(2+K).setValue(ya[K]);ya=$(c.getUI());M.layoutCtrlWithLRTB(ya,0,0,null,50,
0,null);Xa.append(ya);d.append(Xa);I();ya.children().eq(1).css("width","100%");Da();pa()}return d};this.isExistError=function(){for(var Xa=l.getColumnToRowItems(),ya=0;ya<Xa.length;ya++){var K=c.getRow(ya+3);if(!Tb(c,null,K))return!0}return!1};this.setModeler=function(Xa){x=Xa};this.getErrorMessage=function(){var Xa=null,ya=l.getColumnToRowItems();if(null!=ya&&0<ya.length)if(b.isExistError())Xa=p;else{a:{Xa=l.getColumnToRowItems();ya=l.getTargetValueFieldSize();if(Xa&&0<Xa.length)for(var K=0;K<ya;K++){b:{var Ea=
void 0;var rb=Xa,Eb=K,Sb=!0;for(Ea in rb){var D=rb[Ea];if(D&&(Sb=!1,D.getField(Eb))){Ea=!1;break b}}Ea=!Sb}if(Ea){Xa=C.get("existUnconfiguredColumn","\u201c\u8f6c\u7f6e\u540e\u7684\u503c\u5217#1\u201d\u672a\u8bbe\u7f6e\u3002").replace("#1",K+1);break a}}Xa=void 0}Xa||(Xa=Ub())}return Xa};this.setMessageCurtain=function(Xa){w=Xa};this.setCurrentFields=function(Xa){m=Xa;F(Xa)};this.setColumnToRowConfig=function(Xa){l=null!=Xa?Xa.clone():new Za};this.getColumnToRowConfig=function(){return l};var F=function(Xa){Xa.forEach(function(ya){u[ya.getFullName()]=
ya})},I=function(){za.clearWithoutHead(c);for(var Xa=l.getTargetValueFieldSize(),ya=l.getColumnToRowItems(),K=0;K<ya.length;K++){var Ea=za.createRow(c),rb=ya[K];if(rb){var Eb=rb.getName();Ea.getCell(1).setValue(Eb);rb=rb.getFields();for(Eb=0;Eb<Xa;Eb++){var Sb=Ea.getCell(2+Eb),D=Sb.setValue,v;a:if(v=rb[Eb])for(var E=v.getFullName(),A=0;A<m.length;A++)if(E==m[A].getFullName()){v=m[A];break a}D.call(Sb,v)}}else{for(rb=0;rb<Xa;rb++)Ea.getCell(2+rb).setValue(null);Ea.getCell(1).setValue("")}}for(Xa=ya?
ya.length:0;10>Xa;Xa++){ya=za.createRow(c);K=2;for(Ea=c.getColumnsCount()-1;K<Ea;K++)ya.getCell(K).setValue(null);ya.getCell(1).setValue("")}za.refresh(c);V()},V=function(){$(".modeler-designer-column-to-row-tips-row-text").remove();var Xa=l.getColumnToRowItems();if(Xa=c.getRow(Xa.length+3)){var ya=c.getColumn(1);ya=KTableUIAbstractView.createCellId(Xa,ya);var K=d.find("#"+ya);ya=$("<div class='modeler-designer-column-to-row-tips-row-text'>");ya.css("line-height","26px");ya.appendTo(K);ya.text(C.get("enterAttrName",
"\u8bf7\u8f93\u5165\u5c5e\u6027\u540d"));for(var Ea=l.getTargetValueFieldSize(),rb=0;rb<Ea;rb++)ya=c.getColumn(2+rb),ya=KTableUIAbstractView.createCellId(Xa,ya),K=d.find("#"+ya),K=K.find(".sa-ctrl-combobox-text"),ya=$("<div class='modeler-designer-column-to-row-tips-row-text'>"),ya.appendTo(K),ya.text(C.get("selectColumn","\u8bf7\u9009\u62e9\u9700\u8981\u8f6c\u7f6e\u7684\u5217"))}},pa=function(){var Xa=$("<div class='modeler-designer-column-to-row-delete'>"),ya=$("<div>"),K=$("<span class='modeler-designer-column-to-row-delete-button'>");
K.text(C.get("clearColumnToRowSetting","\u6e05\u7a7a\u8bbe\u7f6e"));K.on("click",function(){l=new Za;I()});ya.append(K);Xa.append(ya);d.append(Xa)},Da=function(){var Xa=$("<div>");M.layoutCtrlWithLRTB(Xa,null,0,130,390,null,50);Xa.addClass("modeler-designer-column-to-row-add-column");var ya=$("<div>");M.layoutCtrlWithLRTB(ya,null,0,80,6,null,20);ya.addClass("modeler-designer-column-to-row-advanced-setting");ya.on("click",Ba);Xa.append(ya);var K=$("<div>");M.layoutCtrlWithLRTB(K,null,20,130,0,0,20);
K.addClass("modeler-designer-column-to-row-advanced-setting-desc");K.text(C.get("advancedSetting","\u9ad8\u7ea7"));K.css("text-align","right");K.appendTo(ya);K=$("<div>");M.layoutCtrlWithLRTB(K,null,4,7,4,null,7);K.addClass("modeler-designer-column-to-row-advanced-setting-desc-icon");K.appendTo(ya);g=$("<div class='modeler-designer-column-to-row-add-column-button'>");M.layoutCtrlWithLRTB(g,null,1,160,26,null,28);g.text(C.get("addColumnButton","\u65b0\u589e\u201c\u8f6c\u7f6e\u540e\u7684\u503c\u5217\u201d"));
g.on("click",function(Ea){Ea=c.getColumnsCount();c.insertColumn(Ea-1,"").setWidth(200);I();Ba()});Xa.append(g);g.hide();d.append(Xa)},Ba=function(){"block"===g.css("display")?g.hide():g.show()},oa=function(Xa,ya){return Xa.indexOf(ya)==Xa.length-ya.length},bb=function(Xa,ya){if(!ya){ya=0;var K=l.getAttrFieldAlias();K&&(ya=gb(K,ya));K=l.getTargetValueFieldAlias();if(null!=K&&0<K.length)for(var Ea in K)ya=gb(K[Ea],ya);for(Ea=0;Ea<m.length;Ea++)ya=gb(m[Ea].getAlias(),ya);ya="column"+(parseInt(ya)+1)}return Xa+
"\uff08"+ya+"\uff09"},gb=function(Xa,ya){if(0!==Xa.indexOf("column"))return ya;(Xa=Xa.substring(6,Xa.length))&&/^\+?[1-9][0-9]*$/.test(Xa)&&(Xa=parseInt(Xa),null!=ya&&void 0!=ya&&ya<Xa&&(ya=Xa));return ya},Fb=function(Xa,ya){return ya&&oa(ya,"\uff09")?ya.substring(ya.indexOf("\uff08")+1,ya.lastIndexOf("\uff09")):"column"+Xa},lb=function(Xa,ya){return 1==ya},xb=function(Xa,ya,K,Ea,rb){K.setValue(Ea);return!0},zb=function(Xa,ya,K,Ea){Xa=null;ya?(ya=KTableUIAbstractView.createCellId(c.getRow(K),c.getColumn(c.getColumnsCount()-
1)),Xa=b.getJqUi().find("#"+ya),ya=$("<div>"),ya.text(C.get("insertRow","\u63d2\u5165")),ya.addClass("modeler-designer-filter-table-op"),ya.css("left","35px"),ya.on("click",function(){l.getColumnToRowItems().splice(K-3,0,null);I()}),ya.appendTo(Xa),ya=$("<div>"),ya.text(C.get("deleteRow","\u5220\u9664")),ya.addClass("modeler-designer-filter-table-op"),ya.css("right","35px"),ya.on("click",function(){l.deleteColumnToRowItem(K-3);I()}),ya.appendTo(Xa)):k&&k.find(".modeler-designer-filter-table-op").remove();
k=Xa},Qb=function(Xa,ya,K,Ea,rb){for(var Eb=0;Eb<Ea;Eb++)Xa=Xa.prev();Tb(K,Xa,ya);if(1<Ea&&0<=rb)a:for(ya=Ea-2,Ea=3;Ea<K.getRowsCount();Ea++){if(Xa=K.getRow(Ea).getCell(1).getValue())b:{Xa=rb;Eb=ya;var Sb=K.getRow(Xa+3).getCell(Eb+2).getValue();if(Sb=Sb?Sb.getFullName():"")for(var D=l.getColumnToRowItems(),v=0;v<D.length;v++){var E=D[v];if(E)for(var A=E.getFields(),q=0;q<A.length;q++)if(A[q]&&(v!==Xa||q!==Eb)&&A[q].getFullName()==Sb){A.splice(q,1,null);E.setFields(A);Xa=!0;break b}}Xa=!1}if(Xa){I();
break a}}},Tb=function(Xa,ya,K){if(K){try{var Ea=K.getCell(1)}catch(D){return}var rb=!1;Ea&&Ea.getValue()&&(rb=!0);Ea=!1;for(var Eb=2;Eb<Xa.getColumnsCount()-1;Eb++){var Sb=K.getCell(Eb);if(Sb&&Sb.getValue()){Ea=!0;break}}if(rb&&!Ea||Ea&&!rb)return p=C.get("existColumnToRowErrorItem","\u5b58\u5728\u4e0d\u5b8c\u6574\u7684\u914d\u7f6e\u9879\u3002"),ya&&tb(ya,p),!1;rb=!1;for(Ea=2;Ea<Xa.getColumnsCount()-1;Ea++)if((Eb=K.getCell(Ea))&&Eb.getValue()&&(Eb=Eb.getValue())&&!u[Eb.getFullName()]){rb=!0;break}if(rb)return p=
C.get("disappearedField","\u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002"),!1}ya&&tb(ya,null);return!0},tb=function(Xa,ya){Xa=$(Xa);Xa.find(".modeler-designer-column-to-row-prompt").remove();if(ya){var K=ea.createWarning();K.attr("title",ya);K.addClass("modeler-designer-column-to-row-prompt");K.css({left:"5px",right:"0px"});K.appendTo(Xa)}},Ub=function(){var Xa={};m.forEach(function(Eb){Xa[Eb.getAlias()]=Eb});var ya=[],K=l.getAttrFieldAlias(),Ea=l.getTargetValueFieldAlias();ya.push(K);
ya=ya.concat(Ea);for(var rb in ya)if(K=ya[rb],Xa[K])return C.get("existsSameColumnName","\u5f53\u524d\u8bbe\u7f6e\u7684\u7b2c#1\u5217\u5217\u540d\u79f0\u201c#2\u201d\u4e0e\u5df2\u5b58\u5728\u7684\u5217\u540d\u79f0\u91cd\u590d\u3002").replace("#1",parseInt(rb)+1).replace("#2",K)}}function O(){this.isRowDraggable=function(a,b){return!0};this.isColumnDraggable=function(a,b){return!0};this.getMinRowHeightLimited=function(a,b){return 3};this.getMinColumnWidthLimited=function(a,b){return 4};this.rowDraggedAction=
function(a,b,c){var d=a.isSyncUIWhenModelChanged();a.setSyncUIWhenModelChanged(!0);b=a.getRow(b);b.setHeight(b.getHeight()+c);a.setSyncUIWhenModelChanged(d)};this.columnDraggedAction=function(a,b,c){var d=a.isSyncUIWhenModelChanged();a.setSyncUIWhenModelChanged(!0);b=a.getColumn(b);b.setWidth(b.getWidth()+c);a.setSyncUIWhenModelChanged(d)};this.getTailBlankForDragging=function(){return 0}}function R(){function a(){var w=[],u,x,F,I,V,pa=!1,Da=!0;this.setItemModel=function(Ba){w=Ba};this.setShowFieldNameEnable=
function(Ba){Da=Ba};this.setRawTypeSwitchListener=function(Ba){};this.setSearchListener=function(Ba){u=Ba};this.setListItemPainter=function(Ba){x=Ba};this.setShowFieldNameListener=function(Ba){F=Ba};this.createJqPopup=function(Ba,oa,bb){I=$("<div>");I.appendTo(Ba);V=$("<div>");I.addClass("modeler-designer-field-popup");Ba=C.get("search","\u641c\u7d22");var gb=new mb;gb.setSearchListenerDelay(200);gb.setPlaceholder(Ba);gb.addSearchListener(function(){u(w,gb.getText(),V,oa,x,pa)});Ba=gb.getJqUi();Ba.addClass("modeler-designer-field-popup-search");
Ba.appendTo(I);V.addClass("modeler-designer-field-popup-list-owner");V.on("click",function(xb){var zb=$(xb.currentTarget);xb=$(xb.target);if(xb=M.upwardSearchHasClass(xb,zb,"modeler-designer-field-popup-list-item"))xb.addClass("modeler-designer-list-item_selected_enabled"),zb=xb.data("model"),bb(zb)});V.appendTo(I);Ba=I.find(".sa-ctrl-textfield-input");Ba.css("top","0px");Ba.css("height","100%");if(0==w.length)d(V,C.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5"));else for(Ba=0;Ba<w.length;Ba++)x(w[Ba],
V,oa);if(Da){var Fb=C.get("showFieldName","\u663e\u793a\u539f\u5b57\u6bb5\u540d\u79f0");Ba=new la;Ba.setText(Fb);Ba=Ba.getJqUi();Ba.attr("title",Fb);Ba.addClass("modeler-designer-field-popup-show-field-name-label");Fb=new Gb;Fb.addStateChangeListener(function(xb,zb,Qb){(pa=Qb)?F&&F(V,!0):F&&F(V,!1)});Fb.setOn(!1);Fb=Fb.getJqUi();Fb.addClass("modeler-designer-field-popup-show-field-name-button");var lb=$("<div>");lb.addClass("modeler-designer-field-popup-show-field-name");Fb.appendTo(lb);Ba.appendTo(lb);
lb.appendTo(I)}else V.css("bottom","5px")}}var b,c;this.createChooseFieldPanel=function(w,u){b=w;c=u;w=new a;w.setListItemPainter(m);w.setSearchListener(g);w.setShowFieldNameListener(k);return w};var d=function(w,u){var x=new la;x.setText(u);x.setEnabled(!1);x.setAlign(la.ALIGN_CENTER);u=x.getJqUi();u.addClass("modeler-designer-field-popup-no-data");u.appendTo(w)},g=function(w,u,x,F,I,V){u=u.trim().toLowerCase();for(var pa=[],Da,Ba=0;Ba<w.length;Ba++)(Da=w[Ba])&&(Da=-1!=Da.getAlias().toLowerCase().indexOf(u)?
!0:V&&-1!=Da.getName().toLowerCase().indexOf(u)?!0:!1)&&pa.push(w[Ba]);x.children().remove();if(0<pa.length){for(Ba=0;Ba<pa.length;Ba++)I(pa[Ba],x,F);pa.length=0}else""==u?d(x,C.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5")):d(x,C.get("noSearchResult","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c"));k(x,V)},k=function(w,u){if(u)for(w=w.find(".modeler-designer-field-popup-list-item-text-name"),u=0;u<w.length;u++){var x=w.eq(u);x.css("display","inline-block");var F=x.prev().text()+x.text();
x.prev().attr("title",null);x.parent().attr("title",F)}else for(w=w.find(".modeler-designer-field-popup-list-item-text-name"),u=0;u<w.length;u++)x=w.eq(u),x.css("display","none"),x.parent().attr("title",null),x.prev().attr("title",x.prev().text())},l=function(w,u){var x=u?u.getAlias():"",F=$("<span>");F.text(x);F.attr("title",x);F.addClass("modeler-designer-field-popup-list-item-text-alias");if(u){x=r.FieldNumberHelper.getFieldNumber(u)?r.FieldNumberHelper.getFieldNumber(u):"";var I=u.getFromNode();
I=b.getNode(I);u=(I=b.getNodeSource(I))&&I.getSourceType()==kb.SOURCE_TYPE_CURRENT_ENTITY_SOURCE?u.getName():x}else u="";x=$("<span>");x.addClass("modeler-designer-field-popup-list-item-text-name");x.text("("+u+")");w.append(F);w.append(x)},m=function(w,u,x){var F=$("<div>");F.addClass("modeler-designer-field-popup-list-item");F.data("model",w);if(c){var I=$("<div>");I.addClass("modeler-designer-field-popup-list-item-icon");w&&Sa.background(I,w.getOutputDataType());var V=$("<div>");V.addClass("modeler-designer-field-popup-list-item-text");
l(V,w);F.append(V);F.append(I)}else l(F,w);u.append(F);x&&w&&x.getFullName()==w.getFullName()&&p(u,F)},p=function(w,u){var x=null;0<w.height()?(clearTimeout(x),u.addClass("modeler-designer-list-item_selected_enabled"),w.prop("scrollTop",u.prop("offsetTop"))):x=setTimeout(function(){p(w,u)},0)}}function na(){this.makeUrl=function(a){return"../qinganalysis/qingmodeler/designer/svgicon/"+a+".svg"};this.getTableIconColor=function(a){var b="#ffa500";if(a)switch(a.getSourceType()){case kb.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:case kb.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:b=
"#A06AE2";break;case kb.SOURCE_TYPE_MODEL_SET_SOURCE:b="#40A9FF";break;case kb.SOURCE_TYPE_MODELSET_FILE_SOURCE:b="#F67682";break;case kb.SOURCE_TYPE_OPEN_API_SOURCE:b="#73D13D"}return b}}function ja(){var a=this,b={};this.init=function(d){a.protectedInit(d);d=d.getAllNodes();b={};if(d)for(var g=0;g<d.length;g++)a.getNodeDisplayName(d[g])};this.protectedInit=function(d){};this.protectedGetDefaultName=function(d){throw Error("override me");};this.getNodeDisplayName=function(d){if(!d)return"";var g=
d.getAlias();if(g)return b[d.getId()]=g;g=d.getId();if(g=b[g])return g;var k=a.protectedGetDefaultName(d);g=d.getNameIndex();g=c(k,g);k=g[0];(g=g[1])&&d.setNameIndex(g);return b[d.getId()]=k};this.isDuplicate=function(d,g){for(var k=Object.keys(b),l=!1,m=0,p=k.length;m<p;m++)if(b[k[m]]==d&&(!g||g.getId()!=k[m])){l=!0;break}return l};var c=function(d,g){var k=g?d+"_"+g:d;var l=[k,g];a.isDuplicate(k)&&(l=c(d,g?g+1:1));return l};this.protectedMethod={cacheDisplayName:function(d,g){b[d]=g}}}function X(){var a,
b,c=0,d={},g={},k,l,m;this.getSelectedEntityName=function(){var pa,Da;for(Da in d){var Ba=d[Da];Ba&&Ba.isChecked()&&(pa=pa?pa+r.ENTITY_SEPARATOR+Da:Da)}return pa};this.setFunUpdateProperties=function(pa){a=pa};this.setMeta=function(pa){l=pa};this.setSelectedTableNames=function(pa){if(l.getTableNode())for(m=pa,pa=0;pa<m.length;pa++){var Da=m[pa],Ba=d[Da];Ba&&(Ba.setChecked(!0),V(Ba,!0),a(g[Da],Da))}};this.getJqUi=function(){if(!b){b=$("<div>");b.addClass("modeler-designer-selected-field-entry-panel");
if(!l.getTableNode()){var pa=$("<div>");pa.addClass("modeler-designer-select-field-no-data-text");pa.text(C.get("noTableToSelect","\u6682\u65e0\u53ef\u9009\u62e9\u7684\u8868"));pa.appendTo(b);return b}var Da=new Ya;Da.fromJsonObject(l.getTableNode());var Ba=new Oa;Ba.setLevel(0);Ba.toFolderLevelNode(Da);p(Ba,0);Da=l.getPropertyMap();for(pa in Da)g[pa]=Da[pa]}return b};var p=function(pa,Da){if(pa.getDisplayName()){var Ba=Da,oa=$("<div>");oa.addClass("modeler-designer-selected-entity-item");var bb=
new Hb;bb.setUserObject(pa);0==Ba&&pa.getName();d[pa.getName()]=bb;bb.addCheckedListener(V);bb=bb.getJqUi();M.layoutCtrl(bb,20*Ba,30*c,15,20);bb.appendTo(oa);bb=$("<div>");bb.addClass("modeler-designer-selected-entity-item-ui");bb.attr("entity-name",pa.getName());bb.on("click",F);M.layoutCtrlWithLRTB(bb,20*Ba+18,10,null,30*c,0,20);var gb=$("<div>");gb.addClass("modeler-designer-selected-entity-item-text");gb.text(pa.getDisplayName());gb.attr("title",pa.getDisplayName());M.layoutCtrl(gb,23,2,null,
20);gb.appendTo(bb);gb=$("<span>");gb.addClass("modeler-designer-selected-entity-item-icon");Sa.background(gb,"entity-entry");0==Ba&&Sa.background(gb,"entity-sub");M.layoutCtrl(gb,2,2,16,16);gb.appendTo(bb);bb.appendTo(oa);oa.appendTo(b);c++;++Da}if(Ba=pa.getChildren())for(oa=0;oa<Ba.length;oa++)bb=new Oa,bb.setLevel(Da),bb.toFolderLevelNode(Ba[oa]),bb.setParentNode(pa),p(bb,Da)},w=function(pa,Da){if((pa=pa.getChildren())&&0<pa.length)for(var Ba=0;Ba<pa.length;Ba++){var oa=pa[Ba];Da[oa.getName()]=
oa;w(oa,Da)}},u=function(pa,Da){if(pa=pa.getParentNode())Da[pa.getName()]=pa,u(pa,Da)},x=function(pa){var Da={};if(!pa)return Da;if(pa=pa.getChildren())for(var Ba=0;Ba<pa.length;Ba++){var oa=pa[Ba];Da[oa.getName()]=oa}return Da},F=function(pa){pa=$(pa.currentTarget).attr("entity-name");a(g[pa],pa);k&&I(!1);k=pa;I(!0)},I=function(pa){var Da=b.find("[entity-name='"+k+"']");Da&&(pa?Da.addClass("modeler-designer-selected-entity-item-ui_selected"):Da.removeClass("modeler-designer-selected-entity-item-ui_selected"))},
V=function(pa,Da){if(Da){Da=pa.getUserObject();a(g[Da.getName()],Da.getName());var Ba=Da.getParentNode(),oa=x(Da),bb={};w(Da,bb);var gb={};u(Da,gb);var Fb=!1;for(xb in bb){var lb=d[xb];if(lb&&lb.isChecked()){Fb=!0;break}}var xb=Fb;Fb=!1;for(zb in gb)if((lb=d[zb])&&lb.isChecked()){Fb=!0;break}var zb=Fb;if(pa.isChecked()){k&&I(!1);k=Da.getName();I(!0);Ba&&(pa=d[Ba.getName()])&&pa.setEnabled(!0);for(var Qb in d)pa=d[Qb],Da.getName()==Qb||Ba&&Qb==Ba.getName()||xb&&bb[Qb]||zb&&gb[Qb]||(oa[Qb]?pa.setEnabled(!0):
pa.setEnabled(!1))}else for(Qb in k&&I(!1),k=Da.getName(),I(!0),Ba=x(Ba),d)pa=d[Qb],Da.getName()==Qb||zb&&gb[Qb]||(Ba[Qb]?pa.setEnabled(!0):(bb[Qb]&&pa.isChecked()&&pa.setChecked(!1),pa.setEnabled(!zb)))}}}function J(){var a,b,c,d;this.setMeta=function(g){a=g};this.setCurrentTableName=function(g){b=g};this.getCurrentTableName=function(){return b};this.setSelectedPropertyName=function(g){c=g};this.getSelectedPropertyName=function(){return c};this.getMeta=function(){return a};this.getJqUi=function(){};
this.getSelectedProperties=function(){return null};this.getSelectedEntityName=function(){};this.getIsEntityView=function(){return!1};this.setWidth=function(g){d=g};this.getWidth=function(g){return d}}function wa(){J.call(this);var a=this,b,c,d,g,k,l={},m=[];this.setLockPropertyName=function(I){m=I};this.setArrProperties=function(I,V){g=V;d=I;p(!0)};this.getTableFieldMap=function(){return l};var p=function(I){if(d&&0!=d.length){k=[];if(l[g])var V=l[g];else{V=d;for(var pa=a.getCurrentTableName().split(r.ENTITY_SEPARATOR),
Da=0;Da<V.length;Da++){var Ba=V[Da],oa=new Qa;oa.setField(Ba);oa.setDisplayName(Ba.getAlias());m&&-1!=m.indexOf(Ba.getName())&&(oa.setEnabled(!1),oa.setShowRelationIcon(!0));oa.setSelected(!0);-1!=pa.indexOf(g)&&a.getSelectedPropertyName()&&-1==a.getSelectedPropertyName().indexOf(Ba.getName())&&oa.setSelected(!1);k.push(oa)}l[g]||(l[g]=k);V=k}c.setArrFieldItems(V,I)}},w=function(){var I=a.getMeta().getRelations();if(I&&0<I.length){m=[];for(var V=0;V<I.length;V++){var pa=I[V];-1==m.indexOf(pa.getFromProperty())&&
m.push(pa.getFromProperty())}}};this.getJqUi=function(){b||u();return b};var u=function(){b=$("<div>");b.addClass("modeler-designer-selected-field-panel");c=new La;c.setJqNoDataUI(x());c.setShowAllCheckbox(!0);c.setFunFieldCheckClick(function(V,pa){pa.setSelected(V)});var I=c.getJqUi();I.addClass("modeler-designer-selected-field-list-panel");I.appendTo(b);g=a.getCurrentTableName();a.getMeta().getPropertyMap()&&(d=a.getMeta().getPropertyMap()[g]);w();p()},x=function(){var I=$("<div>");I.text(C.get("noDataTips",
"\u6682\u65e0\u6570\u636e"));I.addClass("modeler-designer-select-field-no-data-text");return I},F=!0;this.getSelectedProperties=function(){if(!d)return[];var I=[],V={};F=!0;var pa=l[a.getCurrentTableName()];if(!pa)return[];for(var Da=0;Da<pa.length;Da++){var Ba=pa[Da],oa=Ba.getField();V[oa.getFullName()]||(Ba.getSelected()?(I.push(oa),V[oa.getFullName()]=!0):F=!1)}return I};this.isSelectAll=function(){return F}}function La(){var a=[],b,c,d,g,k=!1,l=!1,m=!0,p=!0,w=!0,u,x,F,I,V,pa,Da;this.getContentPaneCreator=
function(){return oa};this.show=function(){b.show()};this.hide=function(){b.hide()};this.getJqUi=function(){b||oa();return b};this.setJqNoDataUI=function(tb){x=tb};this.getArrFieldItems=function(){return a};this.setArrFieldItems=function(tb,Ub){a=[];u.empty();tb&&0!==tb.length?x&&x.hide():x&&x.show();Ub&&(k=!1,d&&d.setChecked(!1),c&&c.clear());if(l){Ub=Ba(tb);var Xa=u,ya=Xa.append,K=Ub==tb.length,Ea=$("<div>");Ea.addClass("modeler-desinger-select-field-lineitem");F=new Hb;F.setChecked(K);F.addCheckedListener(lb);
K=F.getJqUi();K.addClass("modeler-designer-field-item-checkbox");K.appendTo(Ea);K=$("<div>");K.addClass("modeler-designer-field-item-allcheckbox-text");K.text(C.get("selectAll","\u5168\u9009"));K.appendTo(Ea);I=$("<div>");I.addClass("modeler-designer-field-item-selected-prompt");I.text(C.get("selectedItemsPrompt","(\u5df2\u9009\u62e9#1\u9879)"));I.appendTo(Ea);ya.call(Xa,Ea);bb(Ub)}for(Ub=0;Ub<tb.length;Ub++)Xa=tb[Ub],Xa.setFunFieldCheckClick(Qb),a.push(Xa),Xa.initJqUi(),ya=Xa.getJqUi(),ya.appendTo(u),
d&&d.isChecked()&&!Xa.getSelected()&&ya.hide();gb()};this.setFunFieldCheckClick=function(tb){V=tb};this.setFunAllCheckboxClick=function(tb){pa=tb};this.setAllCheckboxSelected=function(tb){F.setChecked(tb)};this.setShowSearchText=function(tb){w=tb};var Ba=function(tb){for(var Ub=0,Xa=0;Xa<tb.length;Xa++)tb[Xa].getSelected()&&Ub++;return Ub},oa=function(){if(!b){b=$("<div>");if(w){var tb=$("<div class='modeler-designer-select-field-search-text'>");tb.text(C.get("search","\u641c\u7d22"));tb.appendTo(b)}tb=
b;var Ub=tb.append;c=new mb;c.setShowSearchIcon(!0);c.addSearchListener(gb);c.setSearchListenerDelay(500);c.setPlaceholder(C.get("inputSearchText","\u8f93\u5165\u641c\u7d22\u6587\u672c"));var Xa=c.getJqUi();Xa.addClass("modeler-designer-select-field-search-box");w?Xa.css("left","10px"):Xa.css("width","90%");Ub.call(tb,Xa);m&&b.append(xb);u=$("<div class='modeler-designer-select-field-list'>");p&&u.css("overflow","scroll");x&&b.append(x);b.append(u)}return b},bb=function(tb){I&&I.text(C.get("selectedItemsPrompt",
"(\u5df2\u9009\u62e9#1\u9879)").replace("#1",tb))},gb=function(tb){g=$.trim(c.getText());Fb(a,g)},Fb=function(tb,Ub){if(0==Ub.length){Da&&Da.hide();tb&&0!==tb.length||x.show();for(var Xa=0;Xa<tb.length;Xa++){var ya=tb[Xa];k&&!ya.getSelected()||ya.show(!0)}F&&F.setChecked(Tb())}else{var K=!0;for(Xa=0;Xa<tb.length;Xa++)if(ya=tb[Xa],!k||ya.getSelected())-1===ya.getDisplayName().toLowerCase().indexOf(Ub.toLowerCase())?ya.show(!1):(ya.show(!0),K=!1);K?(Da||(Da=$("<div>"),Da.addClass("modeler-designer-addsource-noresult-view-container"),
tb=$("<div>"),tb.addClass("modeler-designer-addsource-noresult-view-icon"),Sa.background(tb,"search-no-result"),tb.appendTo(Da),tb=$("<div>"),tb.addClass("modeler-designer-addsource-noresult-view-tip"),tb.text(C.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),tb.appendTo(Da),Da.appendTo(b),Da.hide()),Da.show(),x&&x.hide(),F&&F.setChecked(!1)):(Da&&Da.hide(),F&&F.setChecked(Tb()))}};this.updateSelectedItemsPrompt=function(){bb(Ba(a))};var lb=function(tb,
Ub){if(Ub){for(var Xa=0;Xa<a.length;Xa++){var ya=a[Xa];ya.isShow()&&ya.getEnabled()&&ya.setSelected(tb.isChecked())}pa&&pa(tb,Ub);tb=Ba(a);bb(tb)}},xb=function(){d=new Hb;d.setChecked(k);d.addCheckedListener(zb);d.setText(C.get("showOnlyChecked","\u4ec5\u663e\u793a\u9009\u4e2d\u9879"));var tb=d.getJqUi();M.layoutCtrl(tb,290,5,200,23);return tb},zb=function(tb,Ub){Ub&&((k=tb.isChecked())?a.forEach(function(Xa){Xa.getSelected()||Xa.show(!1)}):a.forEach(function(Xa){Xa.show(!0)}),Fb(a,g))};this.setShowAllCheckbox=
function(tb){l=tb};this.setShowScroll=function(tb){p=tb};this.setShowOnlyChecked=function(tb){m=tb};var Qb=function(tb,Ub){V&&V(tb,Ub);tb=Ba(a);bb(tb);F&&F.setChecked(Tb())},Tb=function(){for(var tb=!0,Ub=0;Ub<a.length;Ub++){var Xa=a[Ub];if(Xa.isShow()&&!Xa.getSelected()){tb=!1;break}}return tb}}function Oa(){Ya.call(this);var a=this,b,c;this.getLevel=function(){return b};this.setLevel=function(d){b=d};this.getParentNode=function(){return c};this.setParentNode=function(d){c=d};this.toFolderLevelNode=
function(d){a.setName(d.getName());a.setDisplayName(d.getDisplayName());a.setChildren(d.getChildren());a.setLevel(b)}}function Ha(){var a,b=Ha.TYPE_TEXT,c=C.get("noDataTips","\u6682\u65e0\u6570\u636e"),d;this.getJqUi=function(){if(!a)switch(a=$("<div>"),a.addClass("modeler-designer-no-data"),b){case Ha.TYPE_TEXT:k(c,"modeler-designer-no-data-only-text");break;case Ha.TYPE_NO_SOURCE:g("no_source","modeler-designer-no-data-icon");k(c,"modeler-designer-no-data-text");break;case Ha.TYPE_NO_SEARCH_RESULT:g("search-no-result",
"modeler-designer-node-selection-icon");k(c,"modeler-designer-node-selection-tip");break;case Ha.TYPE_NO_DATA_WITH_CLOUD:g("no_data_cloud","modeler-designer-no-data-cloud-icon");k(c,"modeler-designer-no-data-text");break;default:throw Error("The view type error, please set first.");}return a};this.setType=function(l){b=l};this.setText=function(l){c=l?l:"";d&&d.text(c)};var g=function(l,m){var p=$("<div>");p.addClass(m);Sa.background(p,l);p.appendTo(a)},k=function(l,m){d=$("<div>");d.addClass(m);d.text(l);
d.appendTo(a)}}function Qa(){var a=this,b,c,d=!1,g=!0,k=!0,l,m,p,w;this.setField=function(x){b=x};this.getField=function(){return b};this.setDisplayName=function(x){b&&b.setAlias(x)};this.getDisplayName=function(){return b.getAlias()};this.getFieldType=function(){return b.getOutputDataType()};this.setSelected=function(x){d=x;l&&l.setChecked(x)};this.setShowRelationIcon=function(x){p=x};this.show=function(x){x?m&&m.show():m&&m.hide();k=x};this.isShow=function(){return k};this.getSelected=function(){return l?
l.isChecked():d};this.setEnabled=function(x){g=x};this.getEnabled=function(){return g};this.getJqUi=function(){return m};this.getName=function(){return c};this.setFunFieldCheckClick=function(x){w=x};this.initJqUi=function(){m=$("<div>");l=new Hb;l.setUserObject(a);l.setChecked(d);l.setEnabled(a.getEnabled());l.addCheckedListener(function(x,F){F&&(w&&w(x.isChecked(),a),c="F"+(new Date).getTime())});u(a,l);return m};var u=function(x,F){var I=$("<div>");I.addClass("modeler-desinger-select-field-lineitem");
F=F.getJqUi();F.addClass("modeler-designer-field-item-checkbox");F.appendTo(I);F=$("<div>");F.addClass("modeler-designer-field-item-checkbox-text");F.text(x.getDisplayName());F.attr("title",x.getDisplayName());x=x.getFieldType();var V=$("<div>");V.addClass("modeler-designer-field-item-icon");Sa.background(V,x);V.appendTo(I);F.appendTo(I);p&&(x=$("<div>"),x.addClass("modeler-designer-field-item-relation-icon"),Sa.background(x,"relation"),x.appendTo(I));I.appendTo(m)}}"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 r=com.kingdee.bos.qing.modeler.designer;r.DragHandler=function(){var a=$(document.body),b,c,d,g,k,l,m,p,w,u,x;this.bindDragUi=function(Ba,
oa){var bb=!1,gb=[-1,-1],Fb=null,lb=function(){b=bb=!1;Fb=null;gb=[-1,-1]};Ba.on("mousedown",function(xb){bb=!0;b=!1;Fb=$(xb.target);gb=[xb.screenX,xb.screenY]});Ba.on("mouseup",function(xb){lb()});Ba.on("mouseleave",function(xb){bb&&lb()});Ba.on("mousemove",function(xb){var zb=!1;bb&&(zb=5<Math.abs(xb.screenX-gb[0])||5<Math.abs(xb.screenY-gb[1]));zb&&(bb=!1,(g=oa(Fb))?(l=new ab,d=p(),k=g.getTableNode(),b=!0,a.on("mousemove",F),a.on("mouseup",I),a.on("mouseleave",pa)):lb())})};this.bindDropUi=function(Ba,
oa,bb,gb,Fb){p=oa;w=bb;u=gb;m=Fb};var F=function(Ba){if(b){if(!c){c=$("<div onselectstart='return false'>");c.addClass("modeler-dragdrop-mask");var oa=M.getCurrentTargetPosition(Ba);oa=M.upwardCoordinate(Ba.target,oa,a[0]);c.data("target-origin-pos-left",oa[0]);c.data("target-origin-pos-top",oa[1]);c.appendTo(a)}if(oa=w(Ba,d,k)){var bb=oa.getJqPhysicalUi();l.isPrepared()||l.prepare(oa.getModeler(),bb,m);x||(x=$("<div>"),M.layoutCtrlWithLRTB(x,0,0,null,0,0,null),x.css("z-index",999999));x.appendTo(bb);
V();Ba=[k.getX(),k.getY()];Ba=m.getScaledCoordinate(Ba);Ba=M.upwardCoordinate(bb[0],Ba,a[0]);oa=m.getScaledSize(k.getWidth());bb=m.getScaledSize(k.getHeight());M.layoutCtrl(c,Ba[0],Ba[1],oa,bb)}else console.log("moving"),c.text(""),oa=M.getCurrentTargetPosition(Ba),oa=M.upwardCoordinate(Ba.target,oa,a[0]),M.layoutCtrl(c,oa[0]-20,oa[1]-15,40,30)}},I=function(Ba){w(Ba,d,k)?(V(),u(g,function(){c.remove();c=null}),Da(!0)):Da()},V=function(){var Ba=[k.getX(),k.getY(),k.getWidth(),k.getHeight()];l.anchor(Ba);
k.setPosition(Ba[0],Ba[1])},pa=function(){Da()},Da=function(Ba){b=!1;!Ba&&c&&c.animate({left:c.data("target-origin-pos-left"),top:c.data("target-origin-pos-top"),width:4,height:3},function(){c.remove();c=null});a.off("mousemove",F);a.off("mouseup",I);a.off("mouseleave",pa);x&&x.remove();l&&l.abort()}};r.DragInsideCheckResult=function(a,b){this.getJqPhysicalUi=function(){return a};this.getModeler=function(){return b}};r.Svg=sb;r.TransformNodeCreator=function(){vb.call(this);var a=this.protectedMethod,
b=this,c,d,g,k,l,m,p=new sb;this.protectedGetItemModels=function(){return t.getAllTypes()};this.protectedGetListPainter=function(){return w};this.protectedGetOperateIconUi=function(){return d};this.protectedGetSuggestDropdownPos=function(){var x=$(document.body),F=u();F=M.upwardCoordinate(c.parent()[0],F,x[0]);x=F[0];F=F[1]+b.protectedGetOperateIconHeight();return[x,F]};this.protectedGetListItemSize=function(){return[Math.max(100,t.getMaxDisplayNameLength()+26+5),30]};this.protectedGetOperateIconHeight=
function(){return a.getScaledSize(20+a.getNode().getHeight())>>1};var w=function(x,F){var I=$("<div>");I.appendTo(x);M.layoutCtrl(I,5,null,16,16);M.layoutCtrlMiddleAlign(I,16);Sa.background(I,F.getIconName());I=$("<div>");I.text(F.getDisplayName());I.attr("title",F.getDisplayName());I.css({"font-size":"12px","text-overflow":"ellipsis"});M.layoutCtrlWithLRTB(I,26,0,null,0,0,null);I.appendTo(x)};this.hook=function(x,F){var I=x!=a.getNode();b.setNode(x);c=$(F);g||(g=p.createNode("g"),d=$(g),d.addClass(b.getMark()),
d.on("click",a.doDropdown),k=p.createNode("rect"),p.setAttributes(k,{width:a.getScaledSize(30),height:a.getScaledSize(35),x:-a.getScaledSize(2)+"px",y:0,fill:"none","pointer-events":"visible"}),$(g).css("cursor","pointer"),g.appendChild(k));I&&($(l).remove(),$(m).remove(),m=p.createNode("circle"),p.setAttributes(m,{r:a.getScaledSize(20)>>1,fill:"#fff"}),g.appendChild(m),x=a.getNode(),l=p.createNode("image"),p.setAttributes(l,{width:a.getScaledSize(20),height:a.getScaledSize(20),x:a.getScaledSize(2),
y:a.getScaledSize(x.getHeight()-20)>>1,href:r.SvgIconHelper.makeUrl("add")}),g.appendChild(l));x=u();p.setAttributes(g,{transform:"translate("+x[0]+","+x[1]+")"});x=a.getNode();p.setAttributes(l,{width:a.getScaledSize(20),height:a.getScaledSize(20),x:a.getScaledSize(2),y:a.getScaledSize(x.getHeight()-20)>>1});I=a.getScaledSize(2);p.setAttributes(m,{r:a.getScaledSize(20)>>1,cx:(a.getScaledSize(20)>>1)+I,cy:a.getScaledSize(x.getHeight())>>1});p.setAttributes(k,{width:a.getScaledSize(40),height:a.getScaledSize(40),
x:-a.getScaledSize(2)+"px",y:0});F.appendChild(g)};this.release=function(){$(l).remove();$(m).remove();d&&d.detach();b.setNode(null)};this.getMark=function(){return"modeler-designer-transform-creator"};var u=function(){var x=a.getNode(),F=x.getX()+x.getWidth();x=x.getY();return a.getScaledCoordinate([F,x])}};r.NodeOperateCreator=function(){vb.call(this);var a=this.protectedMethod,b=this,c,d;this.hook=function(k,l,m){b.setNode(k);c=l;d=m};this.showOperateList=function(){console.log("show operate");
a.doDropdown()};this.getMark=function(){return"modeler-designer-node-operate"};this.protectedGetItemModels=function(){return r.NodeOperateTypeFactory.getAllTypes()};this.protectedGetListPainter=function(){return g};this.protectedGetOperateIconUi=function(){return d};this.protectedGetSuggestDropdownPos=function(){var k=$(document.body),l=a.getNode();var m=l.getX()+l.getWidth();l=l.getY()+l.getHeight();m=a.getScaledCoordinate([m-15,l-15]);m=M.upwardCoordinate(c[0],m,k[0]);k=m[0];m=m[1]+b.protectedGetOperateIconHeight();
return[k,m]};var g=function(k,l){k.text(l.getDisplayName())}};r.NodeRelinkHelper=function(){var a=this,b,c,d,g,k,l,m,p,w;this.hook=function(x,F){var I=x!=b;I&&(b=x);c||(g=new sb,c=g.createNode("g"),d=$(c),d.addClass(a.getMark()),d.on("click",u),$(c).css("cursor","pointer"));I&&($(l).remove(),$(k).remove(),k=g.createNode("circle"),g.setAttributes(k,{r:m.getScaledSize(16)>>1,fill:"#fff"}),c.appendChild(k),l=g.createNode("image"),g.setAttributes(l,{width:m.getScaledSize(16),height:m.getScaledSize(16),
x:m.getScaledSize(2),y:m.getScaledSize(b.getHeight()-16)>>1,href:r.SvgIconHelper.makeUrl("relink")}),c.appendChild(l),x=g.createNode("title"),g.setText(x,C.get("linkOtherNode","\u8fde\u63a5\u5176\u4ed6\u8282\u70b9")),c.appendChild(x));x=b.getX();I=b.getY();x=m.getScaledCoordinate([x,I]);g.setAttributes(c,{transform:"translate("+x[0]+","+x[1]+")"});g.setAttributes(l,{width:m.getScaledSize(16),height:m.getScaledSize(16),x:-(m.getScaledSize(16)>>1),y:-(m.getScaledSize(16)>>1)});g.setAttributes(k,{r:m.getScaledSize(16)>>
1,cx:0,cy:0});F.appendChild(c)};this.release=function(){$(l).remove();$(k).remove();d&&d.detach();b=null};this.getMark=function(){return"modeler-designer-transform-creator"};this.setScaleHelper=function(x){m=x};this.setGlobal=function(x){p=x};this.setLinkCallback=function(x){w=x};var u=function(){var x=new Ab(b);x.setGlobal(p);x.setLinkCallback(w);var F=x.getLinkableNode();F&&0!=F.length?x.showDialog():p.getMessageCurtain().showPrompt(C.get("noNodeToLink","\u6682\u65e0\u53ef\u8fde\u63a5\u8282\u70b9\uff0c\u8bf7\u4ece\u8868\u533a\u57df\u62d6\u5165\u4e00\u4e2a\u53ef\u8fde\u63a5\u7684\u8282\u70b9\u3002"))}};
r.AbstractNodeUI=qa;r.LineUi=function(a,b){var c,d=new sb,g,k;this.getSvgElement=function(){c||(c=d.createNode("path"),d.setAttributes(c,{d:l(),"stroke-width":g?g.getScaledSize(1):1,fill:"none",stroke:"#7f93bc"}),m());return c};this.setScaleHelper=function(p){g=p};this.remove=function(){c&&c.remove();c=null};this.changePosition=function(){c&&d.setAttributes(c,{d:l()})};this.setSelected=function(p){k=p;m()};var l=function(){for(var p=r.LineCoordinateHelper.getLinePathCoordinate(a,b),w="",u=0;u<p.length;u++){var x=
p[u];x=[x.getX(),x.getY()];x=g?g.getScaledCoordinate(x):x;w=0==u?w+"M":w+" L";w+=d.getPathCoordinate(x[0],x[1])}return w},m=function(){c&&(k?d.setAttributes(c,{"stroke-width":g?g.getScaledSize(2):2,stroke:"#276ff5"}):d.setAttributes(c,{"stroke-width":g?g.getScaledSize(1):1,stroke:"#7f93bc"}))}};r.DraggingAnchor=ab;r.NodeRenameHelper=function(){var a,b,c,d,g,k,l=!1;this.hook=function(x,F,I){l=!1;a=x;g=F.getNamePositionRect();k=I;m()};this.release=function(){c&&c.hide()};this.setCallback=function(x){d=
x};var m=function(){b||(b=new Ja,c=b.getJqUi(),$(document.body).append(c),b.addEditedListener(w),b.addBlurListener(u),c.css("z-index",99999));var x=r.DisplayNameHelper.getNodeDisplayName(a);b.setText(x);p();c.show();setTimeout(function(){b.requestFocus()},0)},p=function(){var x=$(document.body),F=[g[0],g[1]];F=M.upwardCoordinate(k[0],F,x[0]);c.find(".sa-ctrl-textarea-real").css("font-size",g[3]+"px");M.layoutCtrl(c,F[0],F[1],g[2],g[3])},w=function(){console.log("start edit");l=!0},u=function(x){console.log("blur");
c.hide();l&&(x=x.getText(),d(a,x))}};r.ModelInfoDialog=function(){ka.call(this);var a=this.protectedMethod,b=this,c,d,g;(function(){a.setTitle(C.get("modelProp","\u6a21\u578b\u5c5e\u6027"));b.setSize(400,300);a.setContentPaneCreator(function(){var k=$("<div>"),l=new la;l.setRequired(!0);l.setText(C.get("name","\u540d\u79f0"));l=l.getJqUi();c=new Ja;var m=c.getJqUi(),p=g.getIntegration();c.setText(p.getModelName());var w=new la;w.setText(C.get("desc","\u63cf\u8ff0"));w=w.getJqUi();d=new Db;var u=d.getJqUi();
d.setText(p.getModelDesc());l.appendTo(k);m.appendTo(k);w.appendTo(k);u.appendTo(k);M.layoutCtrl(l,8,0,70,23);M.layoutCtrl(m,76,0,280,23);M.layoutCtrl(w,8,48,70,23);M.layoutCtrl(u,76,54,280,120);return k});a.setClosingChecker2(function(k){k=$.trim(c.getText());var l=$.trim(d.getText()),m=g.getIntegration(),p=m.getModelName(),w=m.getModelDesc();if(k==p&&l==w)return!0;var u;0==k.length?u=C.get("nameIsEmptyPrompt","\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a\u3002"):50<k.length&&(u=C.get("nameTooLongPrompt",
"\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"));500<l.length&&(u=C.get("descTooLongPrompt","\u63cf\u8ff0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7500\u4e2a\u5b57\u7b26\u3002"));if(u)return a.getMessageCurtain().showPrompt(u),!1;u=new Wa;u.setValue(m,k,m.getModelName(),l,m.getModelDesc());g.getCommandManager().perform(u);return!0});a.setClosingAction(function(k){})})();this.setGlobal=function(k){g=k}};r.JoinConfigPanel=ub;r.CustomGroupSelectFieldPanel=function(){var a,b,c,
d,g;this.getJqUi=function(){a||k();return a};this.protectedSetItemModels=function(l){c&&c.setItemModel(l)};this.protectedSetSelected=function(l){b.setSelectedModel(l)};this.addSelectionListener=function(l){d=l};this.setModeler=function(l){g=l};var k=function(){a=$("<div>");c=(new R).createChooseFieldPanel(g,!0);b=new Ua;b.setDropdownCreator(function(m,p,w){return c.createJqPopup(m,p,w)});b.addSelectionListener(function(m,p){p&&(m=m.getSelectedModel(),d(m))});b.setCustomPainter(function(m,p){m?(p.text(m.getAlias()),
p.attr("title",m.getAlias())):p.text("")});var l=b.getJqUi();a.append(l)}};r.FilterConfigDialog=Fa;r.FormulaEditorDialog=Jb;r.ColumnToRowConfigDialog=Ka;r.FieldItemUI=Qa;r.SelectFieldPanel=La;r.NoDataView=Ha;r.FieldSelectDialog=function(a,b,c,d,g){ka.call(this);var k=this,l=this.protectedMethod,m,p,w=g,u,x,F;this.setFunUpdateTableArea=function(Da){F=Da};this.checkBeforeLoadField=function(){var Da=new Ib(a,function(oa){oa&&0==oa.isValid?(r.SourceCheck.showInvalidFeedBack(oa),u&&u(),F(d.getNamespace(),
oa.invalidityType)):(pa(850,520),F(d.getNamespace(),null))}),Ba=P.decodeParamFromUrl(window.location.search,"modelId");Da.setShowBlocking(!0);Da.checkReferencedModel(b,d,Ba)};this.showSelectFieldDialog=function(Da,Ba){pa(Da,Ba)};var I=function(Da){if(Da){if(Da=p.getSelectedProperties())for(var Ba=0;Ba<Da.length;Ba++)Da[Ba].setFromNode(c.getId());p.isSelectAll()?c.setSelectedFields(null):c.setSelectedFields(Da);Ba=c;var oa=d;if(p.getIsEntityView()){var bb=p.getSelectedEntityName();Ba=d.clone();oa=
c.clone();bb!=d.getTableName()&&(Ba.setTableName(bb),(bb=w.getSameTable(Ba))?(Ba.setUid(bb.getUid()),oa.setTableUid(bb.getUid())):(bb=r.UIDHelper.getUID(r.UIDHelper.NS_TABLE),Ba.setUid(bb),oa.setTableUid(bb)));oa=[oa,Ba];Ba=oa[0];oa=oa[1]}w.addTable(oa);Da&&r.FieldNumberHelper.generateDefaultNumber(Da,Ba);Da=u;x(Ba,oa);Da&&Da()}else u&&u()},V=function(){if(!p)return!1;if(p.getIsEntityView()){var Da=p.getSelectedEntityName();if(!Da)return l.getMessageCurtain().showPrompt(C.get("needSelectedEntity",
"\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b9e\u4f53\u6216\u8005\u5206\u5f55\u8868\u3002")),!1;p.setCurrentTableName(Da)}return(Da=p.getSelectedProperties())&&0==Da.length?(l.getMessageCurtain().showPrompt(C.get("noSelectedField","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b57\u6bb5\u3002")),!1):!0},pa=function(Da,Ba){m=$("<div>");k.setSize(Da,Ba);k.setPosition(window.innerWidth-Da>>1,window.innerHeight-Ba>>1);l.setTitle(C.get("selectField","\u9009\u62e9\u5b57\u6bb5"));l.setContentPaneCreator(function(){return m});
l.setClosingAction(I);Da=new Ib(a,function(oa){var bb=new jb;bb.fromJsonObject(oa);p=r.SelectFieldFactory.createSelectFieldToDialog(bb.getSourceType());p.setMeta(bb);p.setCurrentTableName(d.getTableName());p.setWidth(850);p.getIsEntityView()&&l.setTitle(C.get("selectEntityAndField","\u9009\u62e9\u6570\u636e\u8868\u53ca\u5b57\u6bb5"));p.getJqUi().appendTo(m);l.setClosingChecker(V);k.showDialog();oa=(oa=bb.getErrorMap())?oa:{};F(d.getNamespace(),oa.invalidityType)},function(oa,bb){l.setFooterClosingOnly(!0);
k.showDialog();if(20001004==oa)return oa=new Ha,oa.setType(Ha.TYPE_NO_DATA_WITH_CLOUD),oa.setText(C.get("noSourceTips","\u6570\u636e\u6e90\u4e0d\u5b58\u5728\uff0c\u8bf7\u68c0\u67e5\u6a21\u578b\u96c6\u6570\u636e\u6e90")),oa=oa.getJqUi(),oa.appendTo(m),!0;if(2030800==oa)return oa=new Ha,oa.setType(Ha.TYPE_NO_DATA_WITH_CLOUD),oa.setText(C.get("fileEncodingSelectTips","\u7f16\u7801\u4e0d\u6b63\u786e\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u6587\u4ef6\u7f16\u7801\u3002")),oa=oa.getJqUi(),oa.appendTo(m),!0});
Da.setShowBlocking(!0);Da.getMeta(b,d)};this.setGlobal=function(Da){};this.setModeler=function(Da){w=Da};this.setFunFinishCallback=function(Da){u=Da};this.setAddNodeCallback=function(Da){x=Da}};r.ModelPreviewDialog=function(){function a(){ka.call(this);var g=this,k=this.protectedMethod,l,m,p,w,u,x,F,I,V,pa=!1;(function(){k.setTitle(C.get("preview","\u9884\u89c8"));var lb=$(document.body),xb=lb.prop("clientWidth");lb=lb.prop("clientHeight");var zb=Math.min(1,Math.max(.8,1.16-2E-4*xb));xb=parseInt(zb*
xb);lb=parseInt(zb*lb);g.setSize(xb,lb);k.getDialogCtrl().setMinSize(680,240);k.setSelectable(!0);k.getDialogCtrl().setFullScreenEnabled();k.getDialogCtrl().setResizeEnabled();k.getDialogCtrl().addResizeListener(function(){w&&w.relayoutViews()});k.setContentPaneCreator(function(){var Qb=$("<div>"),Tb=new Ib(b,function(tb){var Ub=new n;Ub.fromJsonObject(tb.resultData);l=Ub;F=Ub=tb.totalRowCount;1E5<Ub&&(pa=!0,F--);I=tb.jobName;V=tb.jobId;if(l&&0!=l.getRowCount()){tb=new KTBorderStyle;tb.setBorderWidth(1);
tb.setBorderPen("solid");tb.setBorderColor("#E3E3E3");Ub=new KTStyle;Ub.setVerticalAlign("bottom");w=new KTable;w.setBorder(tb);w.setStyle(Ub);w.setDraggableAdjusting(!0,1,0);w.setSyncUIWhenModelChanged(!1);w.setLargeDataMode(!0);w.setFrozenRows(1);w.getCellRender().setOutsideVisible(!1);w.setColumnFitVisibleWidth(!1);tb=l.getColumnCount()+1;w.addColumns(tb);var Xa=new KTStyle;Xa.setTextAlign("center");Xa.setBold(!0);Xa.setColor("#666");Xa.setBackgroundColor("#E9E9E9");Ub=new KTStyle;Ub.setTextAlign("center");
var ya=w.addRow();ya.setStyle(Xa);ya.setHeight(22);for(Xa=0;Xa<tb;Xa++){var K=ya.getCell(Xa),Ea=w.getColumn(Xa);0===Xa?(K.setValue(C.get("rowNum","\u5e8f\u53f7")),Ea.setWidth(40),Ea.setStyle(Ub)):(K.setValue(l.getField(Xa-1).getAlias()),Ea.setWidth(150))}tb=$(w.getUI());tb.appendTo(Qb);M.layoutCtrlWithLRTB(tb,0,0,null,32,0,null);Fb(1,l.getRowCount());w.updateUI();w.setLargeDataMode(!0);Da(Qb);tb=$("<div>");tb.addClass("modeler-designer-model-preview-rowcount-container");tb.appendTo(m);pa?(Ub=C.get("showRowCount",
"\u4ec5\u663e\u793a#1\u884c"),ya=$("<span>"),ya.text(C.get("getTotalRowCount","\u603b\u884c\u6570")),ya.addClass("modeler-designer-model-preview-rowcount-btn"),ya.css("cursor","pointer"),Ba(ya),ya.appendTo(m)):Ub=C.get("totalRowCount","\u5171#1\u884c");Ub=Ub.replace("#1",F+"");p=$("<span>");p.text(Ub);p.appendTo(tb);u=new Ra;u.getJqUi().appendTo(m);u.addActionListener(gb);bb(!1);u.getJqUi().addClass("modeler-designer-model-preview-export-btn")}else tb=new Ha,tb.setText(C.get("modelNoData","\u5f53\u524d\u6a21\u578b\u6ca1\u6709\u53ef\u9884\u89c8\u7684\u6570\u636e")),
tb.setType(Ha.TYPE_NO_DATA_WITH_CLOUD),tb=tb.getJqUi(),tb.css("top","calc(50% - 110px)"),tb.appendTo(Qb),g.setSize(800,600)});Tb.setBlockingJqUi(Qb);Tb.getFirstPageResultData(x);return Qb});k.setFooterPaneCreator(null);k.setClosingAction(function(Qb){Qb=new Ib(b);Qb.setShowBlocking(!1);Qb.deleteResultDataFile(V,I)})})();this.setRuntimeModel=function(lb){x=lb};var Da=function(lb){var xb=new h;xb.protectedMethod.setTotalSelectedRowAndSelectedAllVisual(!1,!1);xb.protectedMethod.setTotalRowVisual(!1);
xb.protectedMethod.setCurrentPageVisual(!0);xb.protectedMethod.setFirstBtnAndEndBtnVisual(!0);xb.setComboBoxItemModelsAndSelectedItem([5,10,20,50,100,500,1E3],4);xb.setJumpToPageListener(function(zb,Qb,Tb){Tb&&Tb(F);oa(zb,Qb)});m=xb.getJqUi();m.appendTo(lb);xb.resetPaginationAndJumpToFirstPage(F)},Ba=function(lb){lb.on("click",function(){var xb=new Ib(b,function(zb){var Qb=C.get("showRowCount","\u4ec5\u663e\u793a#1\u884c").replace("#1",""+F);zb=C.get("totalRowCount","\u5171#1\u884c").replace("#1",
""+zb);p.text(Qb+"/"+zb);lb.remove()});xb.setShowBlocking(!1);xb.getTotalRowCount(V,I);lb.text(C.get("calculating","\u8ba1\u7b97\u4e2d..."));lb.css("color","#404040");lb.css("cursor","");lb.off("click")})},oa=function(lb,xb){var zb=(lb-1)*xb+1;var Qb=lb*xb>F?F:lb*xb;lb=new Ib(b,function(Tb){l=new n;l.fromJsonObject(Tb);for(Tb=w.getRowsCount()-1;0<Tb;Tb--)w.removeRow(Tb);Fb(zb,Qb);w.updateUI();w.setLargeDataMode(!0)});lb.setShowBlocking(!1);lb.updateResultDataByPage(V,I,zb-1,xb)},bb=function(lb){lb?
(u.setText(C.get("exporting","\u6b63\u5728\u5bfc\u51fa...")),u.setEnabled(!1)):(u.setText(C.get("exportToExcel","\u5bfc\u51fa\u5230Excel")),u.setEnabled(!0))},gb=function(){var lb=new Ib(b,function(xb){bb(!1);var zb=P.formatDate("yyyyMMdd_HHmmss");ia.downloadFile("QingModeler-"+zb+".xlsx",xb)});lb.setShowBlocking(!1);bb(!0);lb.exportModelResult(V,I,F);f.occur(f.BUTTON_TYPE,f.MODEL_PREVIEW_EXPORT_TO_EXCEL)},Fb=function(lb,xb){var zb=new KTStyle;zb.setColor("#333");zb.setBackgroundColor("#fff");var Qb=
new KTStyle;Qb.setColor("#333");Qb.setBackgroundColor("#F3F3F3");for(var Tb=0;lb<=xb;lb++,Tb++){var tb=1==lb%2?zb:Qb,Ub=w.addRow();Ub.setHeight(22);Ub.setStyle(tb);for(tb=0;tb<l.getColumnCount()+1;tb++){var Xa=Ub.getCell(tb);if(0==tb)Xa.setValue(lb);else{var ya=l.getOneRow(Tb),K=l.getField(tb-1),Ea=K.getOutputDataType();ya=ya[tb-1];if(null==ya||void 0==ya)ya="";else if(Ea==ba.DT_DATE)K=new ma,K.setFormatString("yyyy-MM-dd"),ya=K.format(ya);else if(Ea==ba.DT_DATETIME)K=new ma,K.setFormatString("yyyy-MM-dd HH:mm:ss"),
ya=K.format(ya);else if(Ea==ba.DT_BOOLEAN)ya=void 0===ya?"":ya?"true":"false";else if(Ea==ba.DT_NUMBER&&(K=K.getScale()))for(ya+="",Ea=ya.split("."),2>Ea.length?(ya+=".",Ea=""):Ea=Ea[1],K-=Ea.length,Ea=0;Ea<K;Ea++)ya+="0";Xa.setValue(ya)}}}}}var b,c,d;this.setRemoteImpl=function(g){b=g};this.setGlobal=function(g){c=g};this.setNode=function(g){d=g};this.check=function(g){(new Ib(b,function(k){var l=new db;l.fromJsonObject(k);if(l.isValid()){k=c.getModelerModel();var m=r.ModelConverter.getOutputNode(k,
d);k=r.ModelConverter.convertToRuntimeModel(k,m);m=new B;m.setExtractAllData(-1);k.setPreviewConfig(m);m=new a;m.setRuntimeModel(k);m.showDialog()}else{k=Cb.createFeedbackDialog();k.setMsgImageType(Cb.MSG_WARNING);k.setTitle(C.get("operatingTips","\u64cd\u4f5c\u63d0\u793a"));k.setMessage(C.get("tableModelerIncomplete","\u6570\u636e\u8868\u6a21\u578b\u8bbe\u7f6e\u4e0d\u5b8c\u6574\uff0c\u65e0\u6cd5\u9884\u89c8\u6570\u636e"));m=k.setDetail;var p="",w=l.getCases(),u=new U;l=[];for(var x=0;x<w.length;x++){var F=
u.getHandler(w[x],c);F&&l.push(F.getDetail())}x=0;for(w=l.length;x<w;x++)p+=x+1+"\u3001"+l[x],x<w-1?(p+="\uff1b",p+="\r\n"):p+=C.get("period","\u3002");m.call(k,p);k.setOptionType(Cb.OPTION_OK);k.setButtonText(Cb.RETURN_OK,C.get("iSee","\u6211\u77e5\u9053\u4e86"));k.showDialog()}})).checkModelerValid(g)}};r.TableModelerDisplayNameHelper=function(){ja.call(this);var a=this.protectedMethod,b;this.protectedGetDefaultName=function(d){if(d instanceof Y)return d=d.getTableUid(),(d=b.getTable(d))?d.getDisplayName()?
d.getDisplayName():d.getTableName():C.get("table","\u8868");d=d.getType();return t.getType(d).getDisplayName()};this.protectedInit=function(d){b&&b.removePropertyChangeCallback(c);b=d;b.addPropertyChangeCallback(c)};var c=function(d,g){d==aa.KEY_NODE_CHANGE_ALIAS?a.cacheDisplayName(g.getId(),g.getAlias()):d==aa.KEY_REMOVE_NODE&&(d=g.getRemovedNode(),a.cacheDisplayName(d.getId(),void 0))}};r.NodeItemUi=Ma;r.UnionConfigFieldMappingPane=N;r.UnionConfigSelectNodePane=wb;r.InvalidBackgroundPane=Z;var M,
P,G,za,ea,fa,W,C,ia,ha,$a,Ia,ka,Ga,la,da,z,ua,Ra,Ja,Ua,mb,Gb,Va,ob,Bb,Db,Hb,qb,Cb,ma,xa,ib,Pb,aa,Y,t,H,Q,Ta,ca,va,Na,Za,hb,ba,Sa,Ya,kb,Ib,Wa,jb,pb,S,db,U,B,h,n,e,f;(function(){var a=com.kingdee.bos.qing.common;M=a.DomUtil;ma=a.DateFormater;P=a.Util;G=a.RelativePeriodModel;a=com.kingdee.bos.qing.common.ui;za=a.TableUtil;ea=a.CommonIconUtil;fa=a.RelativePeriodPanel;W=a.FormulaEditorPanel;a=com.kingdee.bos.qing.framework.common;C=a.MultilanguageManager.createPackageAccessor(r);ia=a.RemoteFramework;ha=
a.OfficialArticleUtil;$a=a.WindowResizeObserver;a=com.kingdee.bos.qing.ui.component;Ia=a.List;ka=a.AbstractModalDialog;Ga=a.Button;la=a.Label;da=a.RadioButtonGroup;z=a.RadioButton;ua=a.ComboBox;Ra=a.WorkButton;Ja=a.TextField;Ua=a.DropdownSelector;mb=a.SearchBox;Gb=a.SwitchButton;Va=a.DateSelector;ob=a.DateTimeSelector;Bb=a.F7Selector;Db=a.TextArea;Hb=a.CheckBox;qb=a.SplitPane;Cb=a.MessageDialog;xa=a.WizardDialog;ib=a.Dialog;Pb=a.HelpIcon;a=com.kingdee.bos.qing.biz.common;h=a.ComplexPaginationBar;
aa=r.TableModeler;t=r.TransformTypeFactory;H=r.Config;Q=r.JoinConfig;Ta=r.FilterConfig;ca=r.FilterItem;va=r.UnionConfig;Na=r.NodeItem;Za=r.ColumnToRowConfig;hb=r.ColumnToRowItem;Y=r.TableNode;ba=r.Field;Sa=r.Icons;Ya=r.FolderNode;kb=r.AbstractModelerSource;Ib=r.DesignerFacade;Wa=r.ActionChangeModelInfo;jb=r.Meta;pb=r.RectCutLineLayoutHelper;S=r.Coordinate;db=r.ModelerValidity;U=r.InvalidityCaseHandlerFactory;B=r.PreviewConfig;n=r.PreviewData;e=r.AbstractInvalidityCase;f=r.UserOperationReporter})();
r.NodeUIFactory=new function(){this.create=function(a,b,c){if(a instanceof Y){var d=new Ca(a);var g=a.getSelectedFields();g?d.setFieldCount(g.length):r.NodeFieldHelper.asynGetFields(c.getModelerModel(),a,function(k){d.setFieldCount(k.length)})}else d=new cb(a);d&&d.setScaleHelper(b);d&&d.setGlobal(c);return d}};qa.NODE_UI_CLASS="modeler-designer-node";qa.NODE_OPERATE_ICON_CLASS="modeler-designer-node-operate-icon";qa.NODE_NAME_UI_CLASS="modeler-designer-node-name";r.LineCoordinateHelper=new function(){var a;
this.setModelerModel=function(b){a=b};this.getLinePathCoordinate=function(b,c){var d=b.getX()+b.getWidth(),g=b.getY()+(b.getHeight()>>1);var k=c.getX();var l=c.getY()+(c.getHeight()>>1),m=1>Math.abs(g-l),p=d>k,w=Math.abs(g-l)<b.getHeight()+c.getHeight()>>1,u=[];u.push(new S(d,g));w&&p?(p=10,w=Math.max(b.getHeight(),c.getHeight()),k-p>b.getX()&&l>b.getY()+b.getHeight()&&(p=k-b.getX()+10),m=new S(d+10,g),d=new S(d+10,Math.min(g,l)-w),g=new S(k-p,Math.min(g,l)-w),p=new S(k-p,l),u.push(m),u.push(d),u.push(g),
u.push(p)):m||(p?w||(p=b.getHeight()-c.getHeight()>>1,p=g<l?p:-p,m=new S(d+10,g),d=new S(d+10,(g+l>>1)+p),g=new S(k-10,(g+l>>1)+p),p=new S(k-10,l),u.push(m),u.push(d),u.push(g),u.push(p)):(m=new S(d+k>>1,g),d=new S(d+k>>1,l),u.push(m),u.push(d)));u.push(new S(k,l));k=u;a:{l=k;if(!(2>l.length))for(u=1;u<l.length;u++){b:{d=l[u-1];p=l[u];g=d.getX();d=d.getY();m=p.getX();p=p.getY();w=a.getAllNodes();for(var x=0;x<w.length;x++){var F=w[x],I=F.getX(),V=I+F.getWidth(),pa=F.getY();F=pa+F.getHeight();if(g>
I&&g<V&&m>I&&m<V){if(Math.max(d,p)>pa&&Math.min(d,p)<F){g=!0;break b}}else if(d>pa&&d<F&&p>pa&&p<F&&Math.max(g,m)>I&&Math.min(g,m)<V){g=!0;break b}}g=!1}if(g){l=!0;break a}}l=!1}l&&(b=(new pb(a)).getLinePathCoordinate(b,c))&&(k=b);return k}};r.LineCoordinateHelper.BASE_LINE_SHAPE_S="s";r.LineCoordinateHelper.BASE_LINE_SHAPE_U="u";r.LineCoordinateHelper.BASE_LINE_SHAPE_Z="z";r.SvgTextTrimer=new function(){var a,b,c;this.init=function(){c=$("<div>");M.layoutCtrl(c,-10,-10,10,10);a=new sb;var g=a.createNode("svg");
a.setAttributes(g,{width:10,height:10});b=a.createNode("text");g.appendChild(b);c.append($(g));$(document.body).append(c);c.hide()};this.trim=function(g,k,l){c.show();a.setAttributes(b,{"font-size":k+"px"});k=d(g);for(var m=g,p=1;k>l&&p<g.length;)m=g.slice(0,g.length-p)+"...",k=d(m),p++;c.hide();return m};this.measureText=function(g){c.show();g=d(g);c.hide();return g};var d=function(g){a.setText(b,g);return b.getComputedTextLength()}};t.getType(H.TYPE_JOIN).setCustomNodeCreator(function(a,b,c){var d=
new Nb;d.setNodeCreateCallback(c);d.setFromNode(a);d.setModelerModel(b.getModelerModel());(a=d.getNodeToJoin())&&0!=a.length?d.showDialog():b.getMessageCurtain().showPrompt(C.get("noNodeToJoinPrompt","\u6682\u65e0\u53ef\u5173\u8054\u8282\u70b9\uff0c\u8bf7\u4ece\u8868\u533a\u57df\u62d6\u5165\u4e00\u4e2a\u53ef\u5173\u8054\u7684\u8868"))});t.getType(H.TYPE_CALCULATED_FIELD).setCustomNodeCreator(function(a,b,c){r.NodeFieldHelper.asynGetFields(b.getModelerModel(),a,function(d){if(d&&0!==d.length){var g=
new r.CalculatedField;g.setName("F"+(new Date).getTime());for(var k=[],l=0;l<d.length;l++)k.push(d[l].toJsonObject());var m,p=null;l=b.getRemoteImpl();var w=new Ib(l,function(u){var x=u.ok,F=u.errorPosition,I=u.errorPrompt;m=u.dataType;p(x,F,I)});w.setShowBlocking(!1);l=new Jb;l.setContext(d,g,!1);l.setSyntaxValidator(function(u,x,F){p=F;w.checkFormula(x,g.getSourceNodeId(),u,k,[])});l.edit(!1,function(){m=m?m:ba.DT_NUMBER;g.setDataType(m)},c)}else d=C.get("upwardNodeInvalid","\u4e0a\u6e38\u8282\u70b9\u8bbe\u7f6e\u4e0d\u5b8c\u6574"),
(l=b.getNodeStatusMonitor().getInvalidState(a))&&(d=l.getPrompt()),b.getMessageCurtain().showPrompt(d+C.get("noCalculatedFieldToCreate","\uff0c\u65e0\u6cd5\u521b\u5efa\u8ba1\u7b97\u5b57\u6bb5\u3002"))},void 0)});t.getType(H.TYPE_FILTER).setCustomNodeCreator(function(a,b,c){var d=new Fa;d.setAfterSetCallback(c);d.setFromNode(a);d.setModelerModel(b.getModelerModel());d.showDialog();d.updateTableUi()});r.UnionNodeUtil=new function(){this.getNodeItemsToUnion=function(a,b){var c=[];a=r.ModelConverter.getLinkableNodes(a,
b);for(b=0;b<a.length;b++){var d=a[b],g=new Na,k=r.DisplayNameHelper.getNodeDisplayName(d);g.setAlias(k);g.setNodeId(d.getId());c.push(g)}return c}};t.getType(H.TYPE_UNION).setCustomNodeCreator(function(a,b,c){var d=r.UnionNodeUtil.getNodeItemsToUnion(b.getModelerModel(),a);if(d&&0!=d.length){var g=new nb;g.setFromNode(a);g.setGlobal(b);g.setItemModels(d);g.setAfterSetCallback(c);a=new xa;a.setTitle(C.get("union","\u5408\u5e76\u8868"));a.setSteps([g]);a.show(800,480)}else b.getMessageCurtain().showPrompt(C.get("noNodeToUnionPrompt",
"\u6682\u65e0\u53ef\u5408\u5e76\u8282\u70b9\uff0c\u8bf7\u4ece\u8868\u533a\u57df\u62d6\u5165\u4e00\u4e2a\u53ef\u5408\u5e76\u7684\u8868\u3002"))});t.getType(H.TYPE_COLUMN_TO_ROW).setCustomNodeCreator(function(a,b,c){var d=new Ka;d.setFunCallback(c);d.setModeler(b.getModelerModel());r.NodeFieldHelper.asynGetFields(b.getModelerModel(),a,function(g){g=g?g:[];d.setFields(g);d.initUi();d.showDialog()})});r.SvgIconHelper=new function(){na.call(this);var a=this;this.getIconUrl=function(b){b=b.getType();b=
t.getType(b).getIconName();return a.makeUrl(b)}};r.DisplayNameHelper=new function(){var a;this.registerImpl=function(b){a=b};this.isDuplicate=function(b,c){if(!a)throw Error("need register first");return a.isDuplicate(b,c)};this.getNodeDisplayName=function(b){if(!a)throw Error("need register first");return a.getNodeDisplayName(b)}};Ha.TYPE_TEXT="text";Ha.TYPE_NO_SOURCE="noSource";Ha.TYPE_NO_SEARCH_RESULT="noSearchResult";Ha.TYPE_NO_DATA_WITH_CLOUD="noDataWithCloud";r.SelectFieldFactory=new function(){var a=
{};this.addSelectFieldToPanel=function(b,c){a[b]=c};this.createSelectFieldToDialog=function(b,c){var d=a[b];b=d?new d(b,c):new wa;return b}};r.SourceCheck=new function(){this.showInvalidFeedBack=function(a){var b=Cb.createFeedbackDialog();b.setMsgImageType(Cb.MSG_WARNING);b.setTitle(C.get("operatingTips","\u64cd\u4f5c\u63d0\u793a"));switch(a.invalidityType){case e.TYPE_DBCONNECTION_FAIL:var c=C.get("dbconnectionFail","\u8be5\u8868\u6240\u5728\u7684\u6570\u636e\u6e90\u8fde\u63a5\u5931\u8d25\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");
break;case e.TYPE_DBSOURCE_NO_AUTHORITY:c=C.get("dbsourceNoAuth","\u60a8\u6ca1\u6709\u8be5\u8868\u6240\u5728\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");break;case e.TYPE_SOURCE_NOT_EXISTS:c=C.get("sourceNotExists","\u8be5\u8868\u6240\u5728\u7684\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");break;case e.TYPE_TABLE_NOT_EXISTS:c=C.get("tableNotExist","\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664");break;
case e.TYPE_MODEL_DELETED:c=C.get("modelDeleted","\u8be5\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");break;case e.TYPE_MODEL_NO_DATA_PERMISSION:c=C.get("modelNoDataPermission","\u60a8\u672a\u88ab\u6388\u6743\u4f7f\u7528\u8be5\u6a21\u578b\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");break;case e.TYPE_MODEL_INCOMPLETE:c=C.get("model_incomplete","\u8be5\u6a21\u578b\u8bbe\u7f6e\u4e0d\u5b8c\u6574\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");break;case e.TYPE_MODEL_DAMAGE:c=
C.get("modelDamage","\u8be5\u6a21\u578b\u5df2\u635f\u574f\uff0c\u65e0\u6cd5\u4f7f\u7528\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");break;case e.TYPE_MODEL_CYCLE_REFERENCE:c=C.get("modelCycleReference","\u8be5\u6a21\u578b\u4e0e\u5f53\u524d\u6a21\u578b\u5b58\u5728\u5faa\u73af\u5f15\u7528\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");if(1<a.cycleRefModelNames.length){for(var d="",g=0;g<a.cycleRefModelNames.length;g++){if(g==a.cycleRefModelNames.length-1){var k=C.get("modelRefCurrentModel","'#1'\u6a21\u578b\u5f15\u7528\u4e86\u5f53\u524d\u6a21\u578b\u3002");
k=k.replace("#1",a.cycleRefModelNames[g])}else k=C.get("modelRefOtherModel","'#1'\u6a21\u578b\u5f15\u7528\u4e86'#2'\u6a21\u578b\uff0c"),k=k.replace("#1",a.cycleRefModelNames[g]).replace("#2",a.cycleRefModelNames[g+1]);d+=k}b.setDetail(d)}break;default:c=a.message}b.setMessage(c);b.setOptionType(Cb.OPTION_OK);b.setButtonText(Cb.RETURN_OK,C.get("iSee","\u6211\u77e5\u9053\u4e86"));b.showDialog()}};r.SelectFieldFactory.addSelectFieldToPanel(kb.SOURCE_TYPE_CURRENT_ENTITY_SOURCE,function(){J.call(this);
var a=this,b,c,d;this.getJqUi=function(){if(!b){b=$("<div>");d=new wa;d.setMeta(a.getMeta());d.setCurrentTableName(a.getCurrentTableName());d.setSelectedPropertyName(a.getSelectedPropertyName());var l=d.getJqUi(),m=new qb;m.setHorizontalSplit(!0);m.setSplitLineWide(8);m.setResizeMode(qb.RESIZE_MODE_FIRST_FIXED);m.setFirstSize(200,185,300);m.setSecondSize(a.getWidth()-250,350,-1);c=new X;c.setFunUpdateProperties(k);c.setMeta(a.getMeta());m.setFirstChild(qb.createChildWrapper(c.getJqUi()));m.setSecondChild(qb.createChildWrapper(l));
m.getJqUi().appendTo(b);c.setSelectedTableNames(a.getCurrentTableName().split(r.ENTITY_SEPARATOR))}return b};this.getIsEntityView=function(){return!0};var g=!0;this.getSelectedProperties=function(){var l=[],m={};g=!0;for(var p=a.getCurrentTableName().split(r.ENTITY_SEPARATOR),w=0;w<p.length;w++){var u=p[w];u=d.getTableFieldMap()[u];for(var x=0;x<u.length;x++){var F=u[x],I=F.getField();m[I.getFullName()]||(F.getSelected()?(l.push(I),m[I.getFullName()]=!0):g=!1)}}return l};this.isSelectAll=function(){return g};
this.getSelectedEntityName=function(){return c.getSelectedEntityName()};var k=function(l,m){d.setArrProperties(l,m)}})})();(function(){function qa(){var t=this,H,Q,Ta;this.getCurrentNodeId=function(){throw Error("override me");};this.protectedUpdateUi=function(){};this.protectedInitUi=function(va){};this.setGlobal=function(va){H=va};this.getJqUi=function(){if(!Q){Q=$("<div>");Q.css({"overflow-x":"hidden","overflow-y":"auto"});var va=$("<div>");va.addClass("modeler-propertyarea-lineitem-title");va.appendTo(Q);var Na=$("<div>");Na.appendTo(va);Ma.layoutCtrlWithLRTB(Na,5,0,null,2,2,null);Na.css("border-left","3px solid #5582f3");
Na=$("<div>");Na.text(Ta);Ma.layoutCtrl(Na,15,null,200,null);Ma.layoutCtrlMiddleAlign(Na,16);Na.appendTo(va);Na.css({"font-weight":"bold",color:"#666"});t.protectedInitUi(Q)}return Q};this.updateUi=function(){t.protectedUpdateUi()};var ca=function(){var va=$("<div>");va.addClass("modeler-propertyarea-lineitem");return va};this.protectedMethod={getGlobal:function(){return H},createJqLineItem:function(va,Na){va=(new Z(va)).getJqUi();va.addClass("modeler-propertyarea-lineitem-caption");Na=Na.getJqUi();
Na.addClass("modeler-propertyarea-lineitem-ctrl");var Za=ca();Za.append(va);Za.append(Na);return Za},createJqLineContainer:ca,setTitle:function(va){Ta=va},getJqOwner:function(){return Q}}}function Ca(){qa.call(this);var t=this.protectedMethod,H,Q,Ta,ca,va,Na,Za,hb;t.setTitle(N.get("tableProp","\u8868"));this.setNode=function(B){H=B};this.getCurrentNodeId=function(){return H.getId()};this.protectedInitUi=function(B){var h=t.getGlobal().getModelerModel(),n=h.getNodeSource(H),e=new Ka;e.setEnabled(!1);
var f=n.getName();e.setText(f?f:N.get("theSourceIsDeleted","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664"));t.createJqLineItem(N.get("source","\u6570\u636e\u6e90"),e).appendTo(B);h=h.getNodeTable(H);n.getSourceType()==Pb.SOURCE_TYPE_CURRENT_ENTITY_SOURCE?(n=new Ka,n.setEnabled(!1),n.setText(h.getDisplayName()),t.createJqLineItem(N.get("entityName","\u5b9e\u4f53\u540d"),n).appendTo(B),n=new Ka,n.setEnabled(!1),n.setText(h.getTableName()),t.createJqLineItem(N.get("tag","\u6807\u8bc6"),n).appendTo(B)):
(hb=new Ka,hb.setEnabled(!1),hb.setText(h.getTableName()),t.createJqLineItem(N.get("tableName","\u8868\u540d"),hb).appendTo(B));ba(B);Ta=new cb;Ta.setFunShowSelectedFieldDialog(Sa);S();t.createJqLineItem(N.get("field","\u5b57\u6bb5"),Ta).appendTo(B)};this.protectedUpdateUi=function(){var B=sa.DisplayNameHelper.getNodeDisplayName(H);Q.setText(B);B=t.getGlobal().getModelerModel().getNodeTable(H);B.isUserSql()&&hb.setText(B.getTableName());S()};var ba=function(B){Q=new Ka;var h=sa.DisplayNameHelper.getNodeDisplayName(H);
Q.setText(h);h=t.createJqLineItem(N.get("alias","\u522b\u540d"),Q);Q.addBlurListener(db);Q.addAcceptableListener(function(n,e){db(n)});h.appendTo(B)},Sa=function(){var B=t.getGlobal().getModelerModel();sa.NodeFieldHelper.getMeta(B,H,function(h){h.getErrorMap()&&0==h.getErrorMap().isValid?sa.SourceCheck.showInvalidFeedBack(h.getErrorMap()):(ca=new Jb(h.getSourceType()),ca.setFunContentPaneCreator(function(){var n=$("<div>");Za=da.createSelectFieldToDialog(h.getSourceType());var e=H.getSelectedFields(),
f=[];e&&0!=e.length||(e=t.getGlobal().getModelerModel(),e=sa.ModelConverter.getSelectedFieldsWhenSelectAll(e,H));for(var a=0;a<e.length;a++)f.push(e[a].getName());Za.setSelectedPropertyName(f);f=jb().getTableName();Za.setMeta(h);Za.setCurrentTableName(f);Za.setWidth(800);Za.getJqUi().appendTo(n);return n}),ca.setShowAllCheckbox(!0),ca.setFunClosingChecker(Ya),ca.setFunConfirmClose(Ib),ca.showSelectFieldDialog(800,520))})},Ya=function(){Na=Za.getSelectedEntityName();if(Za.getIsEntityView()){if(!Na)return ca.showPrompt(N.get("needSelectedEntity",
"\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b9e\u4f53\u6216\u8005\u5206\u5f55\u8868\u3002")),!1;Za.setCurrentTableName(Na)}return(va=Za.getSelectedProperties())&&0==va.length?(ca.showPrompt(N.get("noSelectedField","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b57\u6bb5\u3002")),!1):!0},kb=function(){var B=t.getGlobal().getModelerModel(),h=B.getTable(H.getTableUid()),n=h.getTableName();h=h.clone();if(Na!=n){h.setTableName(Na);if(n=B.getSameTable(h))return n.getUid();n=sa.UIDHelper.getUID(sa.UIDHelper.NS_TABLE);
h.setUid(n);H.setTableUid(n);B.addTable(h);return n}return H.getTableUid()},Ib=function(B){if(B){B=t.getGlobal().getModelerModel().getTable(H.getTableUid()).getTableName();var h=Za.getIsEntityView()&&Na!=B;if(h)U([va,kb(),Na],Wa,pb);else{var n=H.getSelectedFields();if(n){if(h=!va||n.length!=va.length,!h){for(var e={},f=0;f<n.length;f++){var a=n[f];e[a.getFullName()]=a}for(f=0;f<va.length;f++)if(a=va[f],!e[a.getFullName()]){h=!0;break}}}else h=null!=va;h&&U([va,H.getTableUid(),B],Wa,pb)}}},Wa=function(){var B=
jb().getTableName();return[H.getSelectedFields(),H.getTableUid(),B]},jb=function(){return t.getGlobal().getModelerModel().getTable(H.getTableUid())},pb=function(B){var h=B[0];h?Ta.setSelectedFieldCount(h.length):Ta.setSelectedFieldCount(0);Za.getIsEntityView()&&(B[1]&&H.setTableUid(B[1]),jb().setTableName(B[2]));H.setSelectedFields(h,!0)},S=function(){if(Za){var B=Za.getSelectedProperties();Ta.setSelectedFieldCount(Za.isSelectAll()?0:B.length)}else B=H.getSelectedFields(),Ta.setSelectedFieldCount(B?
B.length:0)},db=function(B){B=B.getText();var h;B=$.trim(B);var n=/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/;0==B.length?h=N.get("nameIsEmpty","\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a"):50<$.trim(B).length?h=N.get("nameTooLong","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26"):sa.DisplayNameHelper.isDuplicate(B,H)?h=N.get("duplicateName","\u540d\u79f0\u91cd\u590d"):B.match(n)||(h=N.get("invalidNodeName","\u8282\u70b9\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210"));
h?(h=N.get("modifyAbandoned","#1\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",h),t.getGlobal().getMessageCurtain().showPrompt(h),Q.setText(sa.DisplayNameHelper.getNodeDisplayName(H))):(h=new ea,h.setValue(H,B),t.getGlobal().getCommandManager().perform(h))},U=function(B,h,n){var e=new fa;e.setNode(H);e.setMethod(h,n);e.setValue(B);e.setCaption(N.get("actionTableNodeConfig","\u8868\u8282\u70b9\u8bbe\u7f6e\uff1a#1").replace("#1",N.get("selectField","\u9009\u62e9\u5b57\u6bb5")));t.getGlobal().getCommandManager().perform(e)}}
function cb(){var t=this,H,Q,Ta,ca=0,va;this.getJqUi=function(){if(!H){H=$("<div>");H.addClass("modeler-propertyarea-tablenode-property-ui");Ta=new Ka;Ta.setEnabled(!1);Q=Ta.getJqUi();Ta.protectedMethod.getJqInput().css("color","#666");Ma.layoutCtrlWithLRTB(Q,0,0,null,0,0,null);Q.appendTo(H);var Na=$("<div>");Na.addClass("modeler-propertyarea-tablenode-property-icon");Qa.backgroundWithHover(Na,"edit");Na.on("click",va);Ma.layoutCtrlWithLRTB(Na,null,0,16,4,0,16);Na.appendTo(H);t.setSelectedFieldCount(ca)}return H};
this.setSelectedFieldCount=function(Na){ca=Na;var Za=N.get("selectedFields","\u5df2\u9009\u62e9#1\u4e2a\u5b57\u6bb5").replace("#1",ca);0==Na&&(Za=N.get("selectedAllFields","\u5df2\u9009\u62e9\u6240\u6709\u5b57\u6bb5"));Ta&&Ta.setText(Za)};this.setFunShowSelectedFieldDialog=function(Na){va=Na}}function ab(t){qa.call(this);var H=this.protectedMethod,Q=function(){var Ta=sa.TransformTypeFactory.getType(t.getType());return Ta&&Ta.getDisplayName()};H.setTitle(Q());this.getCurrentNodeId=function(){return t.getId()};
H.getNode=function(){return t};H.doConfigChangeAction=function(Ta,ca,va){var Na=new fa;Na.setNode(t);Na.setMethod(ca,va);Na.setValue(Ta);Na.setCaption(N.get("actionTransConfig","\u8f6c\u6362\u8282\u70b9\u8bbe\u7f6e\uff1a#1").replace("#1",Q()));H.getGlobal().getCommandManager().perform(Na)};H.asynGetFields=function(Ta){var ca=H.getGlobal().getModelerModel(),va=ca.getPrevNode(t);sa.NodeFieldHelper.asynGetFields(ca,va,function(Na){var Za=[],hb=t.getFieldSettingConfig();hb=hb?hb.getModifiedField():[];
for(var ba=0;ba<Na.length;ba++){for(var Sa=Na[ba].clone(),Ya=0;Ya<hb.length;Ya++){var kb=hb[Ya];if(Sa.getFullName()==kb.getFullName()){kb.getAppointedAlias()&&Sa.setAlias(kb.getAppointedAlias());Ya=kb.getAppointedDataType()?kb.getAppointedDataType():Sa.getOriginalDataType();Sa.setDataType(Ya);break}}Za.push(Sa)}Ta(Za)},void 0,H.getJqOwner())};H.asyncGetFieldValues=function(Ta,ca){var va=H.getGlobal().getModelerModel(),Na=va.getPrevNode(t);sa.NodeFieldHelper.getFieldValues(va,Na,Ta,ca,void 0,H.getJqOwner())}}
function sb(t){ab.call(this,t);var H=this.protectedMethod,Q,Ta,ca;this.protectedInitUi=function(ba){Q=ba;Ta=t.getConfig()};this.protectedUpdateUi=function(){if(ca)ca.updateUi();else{var ba=H.getGlobal().getModelerModel();ca=new Bb;var Sa=ba.getNode(Ta.getLeft());ca.setLeftNode(Sa);ca.setModelerModel(ba);ca.setJoinConfig(Ta);ba=ca.getJqUi();ba.addClass("modeler-propertyarea-join-container");ba.appendTo(Q);ca.setJoinTypeChangeListener(va);ca.setRelationChangeListener(Za)}};var va=function(ba){H.doConfigChangeAction(ba,
Ta.getJoinType,Na)},Na=function(ba){Ta.setJoinType(ba);ca.updateUi()},Za=function(ba){H.doConfigChangeAction(ba,Ta.getRelationModel,hb)},hb=function(ba){Ta.setRelationModel(ba);ca.updateUi()}}function vb(t){ab.call(this,t);var H=this.protectedMethod,Q,Ta,ca,va,Na=[];this.protectedInitUi=function(Sa){Q=Sa};this.protectedUpdateUi=function(){H.asynGetFields(function(Sa){if(Sa&&0!=Sa.length){Ta&&Ta.hide();va&&va.show();if(!va){va=new z;va.setShowAllCheckbox(!0);va.setShowOnlyChecked(!1);va.setShowScroll(!1);
va.setShowSearchText(!1);va.setFunFieldCheckClick(hb);va.setFunAllCheckboxClick(Za);var Ya=va.getJqUi();Ya.addClass("modeler-designer-selected-field-list-panel");Ya.css("min-height","240px");Ya.appendTo(Q)}Na=[];ca=t.getConfig();Ya=ca.isSelectAll();for(var kb=0;kb<Sa.length;kb++){var Ib=Sa[kb],Wa=new la;Wa.setField(Ib);Wa.setDisplayName(Ib.getAlias());Ib.isPk()&&(Wa.setEnabled(!1),Wa.setSelected(!0));Ib=Ya?!0:ca.isSelected(Ib);Wa.setSelected(Ib);Na.push(Wa)}va.setArrFieldItems(Na);Sa=[];kb=0;for(Wa=
Na.length;kb<Wa;kb++)Ib=Na[kb],Ib.getSelected()&&Sa.push(Ib.getField());kb=ca.extractSelectState();kb.setState(Ya,Sa);ca.setSelectState(kb,!0)}else va&&va.hide(),Ta?Ta.show():(Ya=new ua,Ya.setType(ua.TYPE_NO_SOURCE),Ya.setText(N.get("currentNodeNoField","\u5f53\u524d\u8282\u70b9\u6ca1\u6709\u53ef\u9009\u62e9\u7684\u5b57\u6bb5")),Ta=Ya.getJqUi(),Ta.appendTo(Q))})};var Za=function(Sa,Ya){if(Ya){Ya=[];if(Sa.isChecked()){Sa=0;for(var kb=Na.length;Sa<kb;Sa++){var Ib=Na[Sa];(Ib.isShow()||Ib.getSelected())&&
Ya.push(Ib.getField())}}else for(Sa=0,kb=Na.length;Sa<kb;Sa++)Ib=Na[Sa],Ib.getSelected()&&Ya.push(Ib.getField());ba(Ya.length==Na.length,Ya)}},hb=function(Sa,Ya){var kb=[];Ya.setSelected(Sa);Sa=0;for(Ya=Na.length;Sa<Ya;Sa++){var Ib=Na[Sa];Ib.getSelected()&&kb.push(Ib.getField())}ba(kb.length==Na.length,kb)},ba=function(Sa,Ya){var kb=ca.extractSelectState();kb.setState(Sa,Ya);H.doConfigChangeAction(kb,ca.extractSelectState,ca.setSelectState)}}function Ab(t){function H(f){KTDefaultCellRender.call(this,
f);var a=this,b=[P.DT_STRING,P.DT_NUMBER,P.DT_INT,P.DT_DATE,P.DT_DATETIME,P.DT_BOOLEAN],c=this.paintCellUI;this.paintCellUI=function(d,g){var k=a.getCurrentRowIdx(),l=a.getCurrentRow(),m=a.getCurrentColIdx(),p=l.getUserObject(),w=Ya&&-1<Ya.indexOf(p);if(k<Mb.getHeadRowCount())c(d,g);else if(m==pb)w&&(w=$(d),w.empty(),d=$("<div>"),d.attr("title",N.get("fieldNotFound","\u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664")),Qa.background(d,"qingWarning"),Ma.layoutCtrlCenterAlign(d,16),Ma.layoutCtrlMiddleAlign(d,
16),d.appendTo(w));else if(m==S)w&&(w=$(d),w.empty(),d=$("<div>"),d.css("cursor","pointer"),d.attr("title",N.get("clearSetting","\u6e05\u9664\u8bbe\u7f6e")),Qa.backgroundWithHover(d,"delete"),Ma.layoutCtrlCenterAlign(d,16),Ma.layoutCtrlMiddleAlign(d,16),d.on("click",function(){for(var x=-1,F=kb.getModifiedField(),I=0;I<F.length;I++)if(F[I].getFullName()==p.getFullName()){x=I;break}-1<x&&(F.splice(x,1),va.doConfigChangeAction(F,kb.getModifiedField,kb.setModifiedField))}),d.appendTo(w));else if(m==
Ib)w=$(d),w.empty(),w=$("<div>"),l=p.getAlias(),w.text(l),w.attr("title",l),w.css("line-height","28px"),w.css("padding-left","2px"),w.css("padding-right","2px"),w.css("overflow","hidden"),w.css("white-space","nowrap"),w.css("text-overflow","ellipsis"),w.addClass("modeler-designer-tablecell-editable"),w.appendTo(d);else if(m==Wa){g=p.getOutputDataType();var u=p.getDataType()?p.getDataType():P.DT_STRING;d=Mb.createCtrlInCell(d,a.getCellWidth(),a.getCellHeight(),O);d.setItemModels(b);d.setEnabled(!w);
d.setSelected(g);d.setUserObject(l);d.setCustomPainter(function(x,F,I){x=x?!1:I==u;var V=$("<div>");Qa.background(V,I);V.addClass("modeler-designer-select-field-dataType-icon");F.append(V);V=sa.PropDataTypeUtil.getDataTypeDesc(I);I=$("<div>");I.addClass("modeler-designer-select-text");x=V+(x?"("+N.get("origin","\u539f\u59cb")+")":"");I.text(x);I.attr("title",x);F.append(I)});d.addSelectedChangedListener(h)}else m==jb&&(g=p.getOutputDataType(),g==P.DT_NUMBER&&(l=new Q(p),l.setEnabled(!w),w=l.getJqUi(),
l=a.getCellWidth()-16>>1,g=a.getCellHeight()-16>>1,Ma.layoutCtrl(w,l,g,16,16),w.appendTo($(d))))}}function Q(f){var a,b;this.setEnabled=function(d){b=d};this.getJqUi=function(){a||(a=$("<div>"),a.css("cursor","pointer"),Qa.backgroundWithHover(a,"edit"),a.on("click",c));return a};var c=function(){b&&(new Ta(f)).showDialog()}}function Ta(f){J.call(this);var a=this.protectedMethod,b=this,c;(function(){var d=f.getAlias();a.setTitle(N.get("scaleOfField","\u5b57\u6bb5\u3010#1\u3011\u7684\u7cbe\u5ea6").replace("#1",
d));b.setSize(320,240);a.setContentPaneCreator(function(){c||(c=new ca(f));return c.createJqUi()});a.setClosingChecker2(function(g){g=e(f);g.setRoundMode(c.getRoundMode());g.setScale(c.getScale());n(g);return!0});a.setClosingAction(function(g){})})()}function ca(f){var a,b,c,d=[P.ROUND_MODE_HALF_UP,P.ROUND_MODE_UP,P.ROUND_MODE_DOWN];this.createJqUi=function(){a=$("<div>");var k=(new Z(N.get("roundMode","\u820d\u5165\u65b9\u5f0f"))).getJqUi();b=new O;b.setItemModels(d);b.setCustomPainter(g);var l=
f.getRoundMode();l=l?l:P.ROUND_MODE_HALF_UP;var m=b.getJqUi();b.setSelected(l);Ma.layoutCtrl(k,20,20,100,24);Ma.layoutCtrl(m,100,20,160,24);k.appendTo(a);m.appendTo(a);k=(new Z(N.get("decimalDigits","\u5c0f\u6570\u4f4d\u6570"))).getJqUi();c=new ja;l=f.getScale();void 0==l&&(l=2);c.setValue(l);c.setConstraint(0,10,1);l=c.getJqUi();Ma.layoutCtrl(k,20,70,100,24);Ma.layoutCtrl(l,100,70,160,24);k.appendTo(a);l.appendTo(a);return a};this.getRoundMode=function(){if(b)return b.getSelected()};this.getScale=
function(){if(c)return c.getValue()};var g=function(k,l,m){switch(m){case P.ROUND_MODE_HALF_UP:var p=N.get("roundHalfUp","\u56db\u820d\u4e94\u5165");break;case P.ROUND_MODE_UP:p=N.get("roundUp","\u5411\u4e0a\u820d\u5165");break;case P.ROUND_MODE_DOWN:p=N.get("roundDown","\u5411\u4e0b\u820d\u5165")}l.text(p)}}ab.call(this,t);var va=this.protectedMethod,Na,Za,hb,ba,Sa,Ya,kb,Ib=0,Wa=1,jb=2,pb,S;this.protectedInitUi=function(f){Na=f;kb=va.getNode().getConfig()};this.protectedUpdateUi=function(){va.asynGetFields(function(f){Sa!=
f&&(Za=null,hb&&hb.remove());if(f&&0!=f.length||0!=kb.getModifiedField().length){ba&&ba.hide();Sa=f;kb.fitRuntimeProperty(Sa);Za||(Za=Mb.createTable(),Za.setColumnFitVisibleWidth(!0),f=new H(Za),f.setOutsideVisible(!0),Za.setCellRender(f),Za.setSyncUIWhenModelChanged(!0),Mb.bindTextEditor(Za,U,B),Mb.bindTableListenerForCtrl(Za),hb=$(Za.getUI()),Ma.layoutCtrlWithLRTB(hb,10,10,null,38,10,null),hb.appendTo(Na));hb.show();var a=[];f=[];for(var b=0,c=Sa.length;b<c;b++){for(var d=Sa[b].clone(),g=a,k=kb.getModifiedField(),
l=0;l<k.length;l++)if(d.getFullName()==k[l].getFullName()){d=k[l];break}db(d,g,0);f.push(d)}Ya=[];a=kb.getModifiedField();for(b=0;b<a.length;b++){c=a[b];d=!0;for(g=0;g<f.length;g++)if(f[g].getFullName()==c.getFullName()){d=!1;break}d&&Ya.push(c)}c=(b=0<Ya.length)?5:3;a=b?1:0;Ib=0+a;Wa=1+a;jb=2+a;pb=b?0:null;S=b?4:null;a=Za.keepScrollStatus();Mb.clear(Za);Za.addColumns(c);Za.getColumn(Ib).setWidth(100);Za.getColumn(Wa).setWidth(100);Za.getColumn(jb).setWidth(50);c=Mb.createHeadRow(Za);c.getCell(Ib).setValue(N.get("fieldName",
"\u5b57\u6bb5\u540d\u79f0"));c.getCell(Wa).setValue(N.get("dataType","\u6570\u636e\u7c7b\u578b"));c.getCell(jb).setValue(N.get("accuracy","\u7cbe\u5ea6"));b&&(Za.getColumn(pb).setWidth(35),Za.getColumn(S).setWidth(35));for(b=0;b<Ya.length;b++)d=Ya[b],c=Mb.createRow(Za),c.setUserObject(d),c.getCell(Ib).setValue(d.getAlias());for(b=0;b<f.length;b++)d=f[b],c=Mb.createRow(Za),c.setUserObject(d),c.getCell(Ib).setValue(d.getAlias());Mb.refresh(Za);Za.restoreScrollStatus(a)}else hb&&hb.hide(),ba?ba.show():
(f=new ua,f.setType(ua.TYPE_NO_SOURCE),f.setText(N.get("currentNodeNoFieldToSet","\u5f53\u524d\u8282\u70b9\u6ca1\u6709\u53ef\u8bbe\u7f6e\u7684\u5b57\u6bb5")),ba=f.getJqUi(),ba.appendTo(Na))})};var db=function(f,a,b){var c=f.getAlias();c=0<b?c+"_"+b:c;-1<a.indexOf(c)?db(f,a,b+1):(f.setAlias(c),a.push(c))},U=function(f,a){return a==Ib&&(!Ya||Ya.length<f+1-Mb.getHeadRowCount())?!0:!1},B=function(f,a,b,c,d){c=c?c.trim():"";f=f.getUserObject();a=/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/;if(f.getAlias()!=
c){if(0==c.length)var g=N.get("nameIsEmpty","\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a");else if(50<c.length)g=N.get("nameTooLong","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26");else if(c.match(a)){a=!1;d=[];for(var k=kb.getModifiedField(),l=0;l<Sa.length;l++){for(var m=Sa[l],p=m.getAlias(),w=0;w<k.length;w++){var u=k[w];if(m.getFullName()==u.getFullName()){p=u.getAlias();break}}d.push(p)}for(k=0;k<d.length;k++)if(d[k]==c){a=!0;break}a&&(g=N.get("duplicateName","\u540d\u79f0\u91cd\u590d"))}else g=
N.get("invalidFieldName","\u5b57\u6bb5\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210");g?(g=N.get("modifyAbandoned","#1\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",g),va.getGlobal().getMessageCurtain().showPrompt(g)):(g=e(f),g.setAlias(c),b.setValue(c),n(g))}},h=function(f,a,b){f=f.getUserObject().getUserObject();f=e(f);f.setAppointedDataType(b);n(f)},n=function(f){for(var a=!1,b=0;b<Sa.length;b++)if(Sa[b].getFullName()==
f.getFullName()){a=Sa[b].equals(f);break}var c=-1,d=kb.getModifiedField();for(b=0;b<d.length;b++)if(d[b].getFullName()==f.getFullName()){c=b;break}-1<c&&d.splice(c,1);a||d.push(f);va.doConfigChangeAction(d,kb.getModifiedField,kb.setModifiedField)},e=function(f){for(var a=kb.getModifiedField(),b=0;b<a.length;b++){var c=a[b];if(c.getFullName()==f.getFullName())return c}return f.clone()}}function Yb(t){function H(){var v=[],E,A,q,y,L,T,Pa;this.getJqUi=function(){if(!E){E=$("<div>");Pa=new R;Pa.setText(N.get("addToGroup",
"\u6dfb\u52a0\u5230"));var yb=Pa.getJqUi();Ma.layoutCtrl(yb,0,0,70,20);yb.css("margin-right",5);E.append(yb);var Rb=$("<div>");Ma.layoutCtrl(Rb,55,0,15,15);Ma.layoutCtrlMiddleAlign(Rb,15);Rb.appendTo(yb);E.on("click",eb);Qa.background(Rb,"expandTriangle")}return E};this.setItemModels=function(yb){v=yb};this.setEnabled=function(yb){Pa.setEnabled(yb)};var eb=function(yb){if(L)Ob();else if(Pa.isEnabled()){A||(Wb(),Vb());A.setItemModels(v);yb=$(document.body);var Rb=[0,E.outerHeight()-1];Rb=Ma.upwardCoordinate(E[0],
Rb,yb[0]);var Xb=Rb[1];Rb=yb.prop("clientHeight");var $b=Math.min(25*Math.max(1,Math.min(v.length,10))+2,(Rb>>1)-10);Xb+$b>Rb&&(Rb=[0,0],Rb=Ma.upwardCoordinate(E[0],Rb,yb[0]),Rb=Rb[1]-$b+1,0<=Rb&&(Xb=Rb));L=$("<div>");L.addClass("sa-ctrl-common-popup sa-ctrl-common-unselectable modeler-designer-custom-group-popup");Ma.layoutCtrlWithLRTB(L,null,16,150,Xb,null,$b+24);L.appendTo(yb);Xb=q.getJqUi();Ma.layoutCtrl(Xb,0,0,"100%",23);Xb.appendTo(L);Xb=A.getJqUi();Ma.layoutCtrlWithLRTB(Xb,0,0,"100%",24,0,
null);Xb.appendTo(L);yb.on("mousedown",fb);yb.on("mousewheel",Kb);$(window).on("resize",Ob)}},Lb=function(yb,Rb){y||(y=new Z,y.setText(Rb),y.setEnabled(!1),y.setAlign(Z.ALIGN_CENTER),Rb=y.getJqUi(),Rb.addClass("modeler-designer-field-popup-no-data"),Rb.css("top",30),Rb.appendTo(yb))},Wb=function(){q=new xa;q.setSearchListenerDelay(200);q.setPlaceholder(N.get("search","\u641c\u7d22"));q.addSearchListener(function(){var yb=q.getText().trim();y&&y.getJqUi().remove();y=null;if(yb){var Rb=[];v.forEach(function(Xb){-1<
Xb.getGroupItem().getName().toLowerCase().indexOf(yb.toLowerCase())&&Rb.push(Xb)});A.setItemModels(Rb);Rb.length||Lb(L,N.get("nothingSearched","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c"))}else A.setItemModels(v)})},Vb=function(){A=new ib;A.setBorderVisible(!1);A.setToggleSelectingEnabled(!1);A.setCustomItemPainter(function(yb,Rb){Rb=Rb.getGroupItem().getName();yb.text(Rb);yb.attr("title",Rb)});A.addPressedListener(function(yb,Rb){T(yb);Ob()})};this.addPressedItemFunc=function(yb){T=yb};var Kb=
function(yb){Ma.isDescendent(yb.target,A.getJqUi()[0])||Ob()},fb=function(yb){E.is(":visible")&&(Ma.isDescendent(yb.target,E[0])||Ma.isDescendent(yb.target,L[0]))||Ob()},Ob=function(){if(L){var yb=$(document.body);yb.off("mousedown",fb);yb.off("mousewheel",Kb);$(window).off("resize",Ob);L.detach();L=null;q.clear()}}}function Q(){var v=this,E,A,q,y,L,T,Pa=!0,eb=!1,Lb=!0,Wb,Vb,Kb;var fb="GroupItem_"+com.kingdee.bos.qing.common.Util.createUUID();this.setNewCreated=function(){Kb=!0};this.getType=function(){return Vb};
this.setId=function(Zb){fb=Zb};this.getId=function(){return fb};this.setGroupItem=function(Zb){Wb=Zb};this.getGroupItem=function(){return Wb};this.setCollapse=function(Zb){Pa=!Zb};this.setEditEnable=function(Zb){Lb=Zb};this.setEditingStatus=function(Zb){eb=Zb};this.protectedUpdatePanel=function(){throw Error("overwrite method");};this.getJqUi=function(){if(!E){E=$("<div class='modeler-designer-custom-group-panel'>");q=$("<div class='modeler-designer-custom-group-panel-title'>");E.append(q);Ob();A=
$("<div>");A.css({position:"relative",overflow:"hidden auto"});var Zb=v.protectedUpdatePanel();Zb&&A.append(Zb);E.append(A);dc()}return E};var Ob=function(){q.empty();if(eb){var Zb=new Ka,ac=Zb.getJqUi();ac.css({width:"100%",height:"100%"});Zb.setPlaceholder(N.get("inputGroupName","\u8bf7\u8f93\u5165\u5206\u7ec4\u540d\u79f0"));Zb.setText(Wb.getName());Zb.addBlurListener(function(){yb(Zb.getText())});Zb.addAcceptableListener(function(gc,hc){yb(Zb.getText())});q.append(ac);q.css("margin-bottom",8);
setTimeout(Zb.requestFocus,0)}else{ac=$("<div class='modeler-designer-custom-group-panel-inner-title'>");y=$("<div>");Ma.layoutCtrl(y,0,4.4,15,15);var bc=$("<div class='sa-ctrl-common-foreground_enabled modeler-designer-custom-group-title-text'>");Ma.layoutCtrlWithLRTB(bc,19,0,null,0,0);Ma.layoutCtrlMiddleAlign(bc,25);Ma.makeTextOmissible(bc);var fc=Wb.getName();bc.text(fc);bc.attr("title",fc);ac.append(y);ac.append(bc);Rb(ac);ac.mouseenter(Xb);ac.mouseleave($b);ac.on("click",ec);ac.appendTo(q);q.css("margin-bottom",
2)}},yb=function(Zb){var ac=Ba(Zb,Wb.getName(),pa,!0);if(ac||Kb)Zb=ac?$.trim(Zb):Wb.getName(),ac=Wb.clone(),ac.setName(Zb),v.setGroupItem(ac),u();eb=!1;Ob();dc()},Rb=function(Zb){L=$("<div>");T=$("<div>");Ma.layoutCtrlWithLRTB(T,null,35,17,null,null,15);Ma.layoutCtrlMiddleAlign(T,15);Ma.layoutCtrlWithLRTB(L,null,10,17,null,null,15);Ma.layoutCtrlMiddleAlign(L,15);Qa.backgroundWithHover(L,"delete");Qa.backgroundWithHover(T,"edit");Zb.append(T);Zb.append(L);T.on("click",function(ac){cc(ac,"RENAME")});
L.on("click",function(ac){cc(ac,"DELETE")});L.hide();T.hide()},Xb=function(){Lb&&(L.show(),T.show())},$b=function(){Lb&&(L.hide(),T.hide())},cc=function(Zb,ac){Zb.stopPropagation();if("RENAME"===ac)eb=!0,Ob();else{Zb=v.getId();ac=-1;for(var bc=0;bc<S.length;bc++)if(S[bc].getId()===Zb){ac=bc;break}Zb=ac;-1<Zb&&S.splice(Zb,1);u()}},ec=function(){Pa=!Pa;Wb.setCollapse(!Pa);dc()},dc=function(){Pa?(y&&Qa.background(y,"expandTriangle"),A.show()):(y&&Qa.background(y,"collapseTriangle"),A.hide())};this.protectedMethod=
{setType:function(Zb){Vb=Zb}}}function Ta(){function v(L){var T=this,Pa,eb=[],Lb=[];this.highlightItem=function(fb){if(Pa){for(var Ob=Pa.find(".modeler-designer-custom-group-list-item"),yb=!1,Rb=0;Rb<Ob.length;Rb++){var Xb=Ob.eq(Rb),$b=Xb.data("text");-1<$b.toLowerCase().indexOf(fb.toLowerCase())?(yb=$b.replace(new RegExp(fb,"i"),function(cc){return"<span class='modeler-designer-custom-group-list-item_highlight'>"+cc+"</span>"}),Xb.children(":first").html(yb),Xb.show(),yb=!0):Xb.hide()}return yb}};
this.recovery=function(){if(Pa)for(var fb=Pa.find(".modeler-designer-custom-group-list-item"),Ob=0;Ob<fb.length;Ob++){var yb=fb.eq(Ob);yb.show();yb.children(":first").text(yb.data("text"))}};this.setSelecteds=function(fb){Lb=fb;Vb()};this.getSelecteds=function(){return Lb};this.setItemModels=function(fb){eb=fb;Wb()};this.getJqUi=function(){if(!Pa){Pa=$("<div>");var fb=$("<div>");fb.addClass("modeler-designer-custom-group-list-owner");fb.on("mousedown",Kb);fb.appendTo(Pa);Wb();Vb()}return Pa};var Wb=
function(){if(Pa){var fb=Pa.children(".modeler-designer-custom-group-list-owner");fb.empty();for(var Ob=$(document.createDocumentFragment()),yb=0;yb<eb.length;yb++){var Rb=eb[yb],Xb=$("<div>");Xb.attr("title",Rb.value);Xb.addClass("modeler-designer-custom-group-list-item");Xb.data("model",Rb.key);Xb.data("text",Rb.value);Rb=$("<div>"+Rb.value+"</div>");Ma.makeTextOmissible(Rb);var $b=$("<div class='modeler-designer-custom-group-list-item-mark-container'>");Ma.layoutCtrlWithLRTB($b,null,0,17,null,
0,17);var cc=$("<div class='modeler-designer-custom-group-list-item-mark-icon'>");Qa.background(cc,"checkMark");Ma.layoutCtrlWithLRTB(cc,null,-1,15,null,-1,15);Rb.appendTo(Xb);$b.appendTo(Xb);cc.appendTo(Xb);Ob.append(Xb)}fb.append(Ob)}},Vb=function(){if(Pa){Pa.find(".modeler-designer-custom-group-list-item_selected_enabled").removeClass("modeler-designer-custom-group-list-item_selected_enabled");for(var fb=Pa.find(".modeler-designer-custom-group-list-item"),Ob=0;Ob<Lb.length;Ob++)for(var yb=Lb[Ob],
Rb=0;Rb<fb.length;Rb++){var Xb=fb.eq(Rb);if(Xb.data("model")===yb){Xb.addClass("modeler-designer-custom-group-list-item_selected_enabled");break}}}},Kb=function(fb){fb=$(fb.target);if(fb=Ma.upwardSearchHasClass(fb,Pa,"modeler-designer-custom-group-list-item")){fb=fb.data("model");var Ob=Lb.slice(),yb=Ob.indexOf(fb);-1<yb?Ob.splice(yb,1):Ob.push(fb);T.setSelecteds(Ob);L.setSelecteds(Ob)}}}Q.call(this);var E=this,A,q=[];this.protectedMethod.setType(qb.STRING);this.getSelectedMembers=function(){return A?
A.getSelecteds():[]};this.setSelectedMembers=function(L){q=L;A&&A.setSelecteds(q)};this.highlightMember=function(L){if(L)return(L=A.highlightItem(L))?E.getJqUi().show():E.getJqUi().hide(),L};this.recovery=function(){E.getJqUi().show();A&&A.recovery()};this.protectedUpdatePanel=function(){var L=y(E.getGroupItem());A=new v(E.getGroupItem());A.setItemModels(L);A.setSelecteds(q);L=A.getJqUi();E.highlightMember(h.getText().trim());return L};var y=function(L){var T=L.getMembers();if(!p)return T.map(function(eb){return{key:eb,
value:eb}});var Pa=[];T.forEach(function(eb,Lb){p[eb]?Pa.push({key:eb,value:p[eb]}):T.splice(Lb,1)});L.setMembers(T);return Pa}}function ca(){Q.call(this);var v=this,E,A;this.protectedMethod.setType(qb.NUMBER);this.protectedUpdatePanel=function(){E=$(document.createDocumentFragment());A=v.getGroupItem();var y=new q;y.setValue(A.getFrom());y.setFuncValueSetter(function(T){var Pa=A.clone();Pa.setFrom(T);v.setGroupItem(Pa)});y.setBoundary(A.getFromBoundary());y.setFuncBoundarySetter(function(T){var Pa=
A.clone();Pa.setFromBoundary(T);v.setGroupItem(Pa)});y.setComboBoxSelectors([Cb.COMPARE_GREATER_EQUAL,Cb.COMPARE_GREATER]);var L=new q;L.setValue(A.getTo());L.setFuncValueSetter(function(T){var Pa=A.clone();Pa.setTo(T);v.setGroupItem(Pa)});L.setBoundary(A.getToBoundary());L.setFuncBoundarySetter(function(T){var Pa=A.clone();Pa.setToBoundary(T);v.setGroupItem(Pa)});L.setComboBoxSelectors([Cb.COMPARE_LESS,Cb.COMPARE_LESS_EQUAL]);E.append(y.getJqUi());E.append(L.getJqUi());return E};var q=function(){var y,
L,T,Pa,eb,Lb;this.setValue=function(fb){L=fb};this.setBoundary=function(fb){T=fb};this.setFuncValueSetter=function(fb){Pa=fb};this.setFuncBoundarySetter=function(fb){eb=fb};this.setComboBoxSelectors=function(fb){Lb=fb};var Wb=function(fb){switch(fb){case Cb.COMPARE_GREATER_EQUAL:return">=";case Cb.COMPARE_LESS_EQUAL:return"<=";case Cb.COMPARE_GREATER:return">";case Cb.COMPARE_LESS:return"<";default:return""}},Vb=function(fb,Ob,yb){Pa(yb);V();u()},Kb=function(fb,Ob,yb){eb(yb);V();u()};this.getJqUi=
function(){y=$("<div class='modeler-designer-custom-group-number-inline-row'>");var fb=new O,Ob=fb.getJqUi();fb.setEnabled(!db);Ma.layoutCtrlWithLRTB(Ob,0,"70%",null,0);fb.setCustomPainter(function(cc,ec,dc){ec.text(Wb(dc))});fb.addSelectedChangedListener(Kb);fb.setSelected(T);fb.setItemModels(Lb);fb=$("<div class='modeler-designer-custom-group-ctrl'>");Ma.layoutCtrlWithLRTB(fb,"38%",0,null,0);var yb=n.getOutputDataType(),Rb=yb===P.DT_INT?-2147483648:-1*Number.MAX_VALUE;yb=yb===P.DT_INT?2147483647:
Number.MAX_VALUE;var Xb=new ja;Xb.setEnabled(!db);var $b=$("<div class='warning-icon'></div>");Qa.background($b,"qingWarning");Ma.layoutCtrl($b,-16,4,16,16);Xb.supportDecimal(10);Xb.setConstraint(Rb,yb,1);Xb.setValue(L);Xb.addValueChangedListener(Vb,!0);fb.append($b);fb.append(Xb.getJqUi());Ob.appendTo(y);fb.appendTo(y);return y}}}ab.call(this,t);var va=this.protectedMethod,Na,Za,hb,ba,Sa,Ya,kb,Ib,Wa=[],jb=[],pb=[],S=[],db,U,B,h,n,e,f,a,b,c,d,g,k,l=!0,m,p,w=va.doConfigChangeAction,u=function(){for(var v=
[],E=0;E<S.length;E++)S[E].getId()!==Ta.UNGROUP&&v.push(S[E].getGroupItem());E=x(n.getOutputDataType());w({field:n,groups:v,groupType:E},function(){g=c.getSelectedField();return c.getGroupAndField()},c.setGroupAndField)},x=function(v){return v===P.DT_STRING?qb.STRING:qb.NUMBER},F=function(v){switch(v){case "DATA_DECREMENT":return N.get("dataDecrement","\u5206\u7ec4\u6570\u503c\u5fc5\u987b\u9012\u589e\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165");case "DATA_CROSSOVER":return N.get("dataCrossOver","\u6570\u636e\u8303\u56f4\u4e0e\u5176\u4ed6\u5206\u7ec4\u6709\u4ea4\u53c9\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165");
case "FIELD_TYPE_CHANGE":return N.get("fieldTypeChange","\u5b57\u6bb5\u7c7b\u578b\u53d8\u5316\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u5b57\u6bb5");case "FIELD_NOT_EXIST":return N.get("fieldNotFound","\u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664");default:throw Error("Unknown Error Type: "+v);}},I=function(v,E,A,q,y,L){if(null!==A){if(A<y)A=!0;else if(A>y)A=!1;else if(v===ca.TO)A=q===Cb.COMPARE_GREATER_EQUAL&&L===Cb.COMPARE_LESS_EQUAL;else if(v===ca.FROM)A=!(q===Cb.COMPARE_LESS_EQUAL&&
L===Cb.COMPARE_GREATER_EQUAL);else throw Error("Unknown NumberGroupPanel Type: "+v);A||(v=v===ca.FROM?"DATA_CROSSOVER":"DATA_DECREMENT",E.show(),E.attr("title",F(v)))}},V=function(){var v=null,E=null,A;S.forEach(function(q){var y=q.getGroupItem();q=q.getJqUi().find(".warning-icon");A=$(q[0]);A.hide();I(ca.FROM,A,v,E,y.getFrom(),y.getFromBoundary());v=y.getFrom();E=y.getFromBoundary();A=$(q[1]);A.hide();I(ca.TO,A,v,E,y.getTo(),y.getToBoundary());v=y.getTo();E=y.getToBoundary()})},pa=function(v){for(var E=
0;E<S.length;E++)if(S[E].getGroupItem().getName()===v||c.getOtherGroupName()===v)return!0;return!1},Da=function(v){for(var E=0;E<jb.length;E++)if(jb[E].getAlias()===v)return!0;return!1},Ba=function(v,E,A,q){v=$.trim(v);var y=/^([\u3000\u4E00-\u9FA5a-zA-Z_]{1,})[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{0,}$/;q&&(y=/^([\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,})[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{0,}$/);if(v===(E||""))return!1;switch(!0){case !v.length:var L=N.get("nameIsEmpty","\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a");break;
case 50<v.length:L=N.get("nameTooLong","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26");break;case !v.match(y):L=q?N.get("invalidGroupName","\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210"):N.get("invalidGroupNameNoStartNumber","\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e14\u4e0d\u80fd\u4ee5\u6570\u5b57\u5f00\u5934");break;case A(v):L=
N.get("duplicateName","\u540d\u79f0\u91cd\u590d")}return L?(L=N.get("modifyAbandoned","#1\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",L),va.getGlobal().getMessageCurtain().showPrompt(L),!1):!0};this.clearCache=function(){g=null};var oa=function(v){if(Ba(v.getText(),c.getGroupName(),Da)){var E=$.trim(v.getText());v.setText(E);bb(E);m=E;w(E,Fb,gb)}else v.setText(c.getGroupName())},bb=function(v){if(v!==m){var E=new P;E.setFromNode(t.getId());E.setName(c.getName());E.setAlias(v);sa.FieldNumberHelper.isDynamicFieldNumber(E)&&
sa.FieldNumberHelper.generateDefaultNumberByAssignedName(E,v)}},gb=function(v){if(t.getFieldSettingConfig()){for(var E=t.getFieldSettingConfig().getModifiedField(),A=[],q=0;q<E.length;q++){var y=E[q];y.getName()===c.getName()&&(y.setAlias(v),!y.getAppointedDataType()&&y.setAppointedDataType(P.DT_STRING));A.push(y)}t.getFieldSettingConfig().setModifiedField(A,!0)}else A=[],E=new sa.FieldSettingConfig,q=new P,q.setFromNode(t.getId()),q.setName(c.getName()),q.setAlias(v),A.push(q),E.setModifiedField(A,
!0),t.setFieldSettingConfig(E);c.setGroupName(v)},Fb=function(){return c.getGroupName()},lb=function(v,E){E&&(l=v.isChecked(),w(v.isChecked(),c.getHasOtherGroup,function(A){c.setHasOtherGroup(A);l=A}))},xb=function(v){if(Ba(v.getText(),c.getOtherGroupName(),pa,!0)){var E=$.trim(v.getText());v.setText(E);w(E,c.getOtherGroupName,c.setOtherGroupName)}else v.setText(c.getOtherGroupName())},zb=function(v){a:{v=v.getSelecteds()[0].getGroupItem();for(var E=0;E<S.length;E++)if(S[E].getGroupItem()===v){v=
S[E];break a}v=null}E=v.getGroupItem();for(var A=[],q=0;q<S.length;q++)if(S[q].getId()===v.getId())E.setSelecteds([]);else{var y=S[q].getSelectedMembers();if(y&&y.length){A=A.concat(y);var L=S[q],T=y;y=L.getGroupItem();var Pa=y.getMembers().slice();y.setSelecteds([]);for(var eb=0;eb<T.length;eb++){var Lb=Pa.indexOf(T[eb]);-1<Lb&&Pa.splice(Lb,1)}T=y.clone();T.setMembers(Pa);T.setCollapse(y.getCollapse());L.setGroupItem(T)}}if(A.length){q=E.getMembers().slice();L=E.clone();L.setMembers(q.concat(A));
L.setCollapse(E.getCollapse());v.setGroupItem(L);if(h.getText().trim())for(h.clear(),v=0;v<S.length;v++)S[v].recovery();u()}},Qb=function(v,E){var A=$("<div class='flex-center modeler-designer-custom-group-line-item'>");Ma.makeTextOmissible(v);A.append(v);A.append(E);return A};this.protectedInitUi=function(v){c=t.getConfig();l=c.getHasOtherGroup();if(!Na){v.addClass("modeler-designer-custom-group-owner");v.css("overflow","hidden");Na=$("<div class='modeler-designer-custom-group-container'>");Ma.layoutCtrlWithLRTB(Na,
0,0,null,39,45);Na.appendTo(v);f=new Ka;f.addBlurListener(oa);var E=(new Z(N.get("name","\u540d\u79f0"))).getJqUi();E.addClass("modeler-propertyarea-lineitem-caption");var A=f.getJqUi();A.addClass("modeler-propertyarea-lineitem-ctrl");Qb(E,A).appendTo(Na);E=$("<div>");Ib=$("<div>");Ib.hide();Qa.background(Ib,"qingWarning");Ma.layoutCtrl(Ib,-16,4,16,16);e=new Hb;e.setModeler(va.getGlobal().getModelerModel());e.addSelectionListener(function(q){n&&n.getFullName()===q.getFullName()||(d=!0,n=q,k=db=null,
h.clear(),tb(),S=[],K())});E.append(Ib);E.append(e.getJqUi());A=(new Z(N.get("groupField","\u5206\u7ec4\u4f9d\u636e"))).getJqUi();A.addClass("modeler-propertyarea-lineitem-caption");E.addClass("modeler-propertyarea-lineitem-ctrl");Qb(A,E).appendTo(Na);Ub();Tb();Za=$("<div>");Ma.layoutCtrlWithLRTB(Za,0,0);Za.css("overflow-y","auto");Za.appendTo(Na);hb=$("<div>");hb.appendTo(Za);E=$("<div>");Ma.layoutCtrlWithLRTB(E,0,0,null,null,0);E.appendTo(v);b=new ta;b.addCheckedListener(lb);v=b.getJqUi();v.css({position:"relative",
width:"60%","max-width":170});b.setText(N.get("unGroupMember","\u672a\u8bbe\u7f6e\u5206\u7ec4\u7684\u503c\u5212\u5206\u5230"));a=new Ka;a.addBlurListener(xb);A=a.getJqUi();A.addClass("modeler-designer-custom-group-line-item-right");Qb(v,A).appendTo(E);ba=$("<div class='flex-center' style='justify-content: flex-start; margin: 0 8px'>");ba.appendTo(E)}};this.protectedUpdateUi=function(){var v=c.getSelectedField(),E=c.getCustomGroupType();va.asynGetFields(function(A){Wa=[];jb=[];n=db=null;for(var q=
0;q<A.length;q++){var y=A[q],L=y.getOutputDataType();jb.push(y);if(v&&v.getFullName()===y.getFullName())n=y,c.setSelectedField(n);else if(L!==P.DT_STRING&&L!==P.DT_NUMBER&&L!==P.DT_INT)continue;Wa.push(y)}E=c.getCustomGroupType();if(v&&!n)db="FIELD_NOT_EXIST",E&&v.setDataType(E),n=v;else if(A=E,n&&A&&(q=n.getOutputDataType(),A!==qb.NUMBER||q!==P.DT_INT&&q!==P.DT_NUMBER))if(A!==qb.STRING||q!==P.DT_STRING)db="FIELD_TYPE_CHANGE";A=c.getGroupName();if(t.getFieldSettingConfig()&&t.getFieldSettingConfig().getModifiedField()){q=
t.getFieldSettingConfig().getModifiedField();for(y=0;y<q.length;y++)if(L=q[y],L.getName()===c.getName()){!L.getAppointedDataType()&&L.setAppointedDataType(P.DT_STRING);A=L.getAlias();c.getGroupName()?(c.setGroupName(A,!0),bb(A),m=A):A=void 0;break}t.getFieldSettingConfig().setModifiedField(q,!0)}f.setText(A);f.setEnabled(!db);f.getJqUi().attr("title",A);a.setText(c.getOtherGroupName());a.setEnabled(!db);a.getJqUi().attr("title",c.getOtherGroupName());U.setEnabled(!db);B.setEnabled(!db);b.setChecked(l);
b.setEnabled(!db);db?c.setHasOtherGroup(!1,!0):c.setHasOtherGroup(c.getHasOtherGroup(),!0);e.protectedSetItemModels(Wa);e.protectedSetSelected(n);Ib.hide();db&&(A=Ib,q=db,A.show(),A.attr("title",F(q)));d||(db?(pb=[],Ea()):g&&n&&g.getFullName()===n.getFullName()?Ea():D())})};var Tb=function(){h=new xa;h.setPlaceholder(N.get("searchTable","\u8bf7\u8f93\u5165\u641c\u7d22\u5185\u5bb9"));h.setShowSearchIcon(!0);h.setSearchListenerDelay(200);h.addSearchListener(function(v){if(v=v.getText().trim()){for(var E=
!0,A=0;A<S.length;A++)S[A].highlightMember(v)&&(E=!1);E?(kb||(v=new ua,v.setType(ua.TYPE_NO_SEARCH_RESULT),v.setText(N.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),kb=v.getJqUi(),kb.appendTo(Za)),kb.show(),hb.hide()):tb()}else{for(v=0;v<S.length;v++)S[v].recovery();tb()}});Ya=h.getJqUi();Ya.css({position:"relative",height:"25px",margin:"0 8px 8px"});Na.append(Ya);Ya.hide()},tb=function(){kb&&(kb.hide(),hb.show())},Ub=function(){Sa=$("<div class='modeler-designer-custom-group-ctrl-container flex-center'>");
var v=(new Z(N.get("groupSetting","\u5206\u7ec4\u8bbe\u7f6e"))).getJqUi();Ma.makeTextOmissible(v);v.appendTo(Sa);B=Xa();v=B.getJqUi();v.addClass("modeler-designer-custom-group-ctrl-setting-new-btn");v.appendTo(Sa);U=new H;v=U.getJqUi();v.addClass("modeler-designer-custom-group-ctrl-setting-add-btn");v.appendTo(Sa);U.addPressedItemFunc(zb);Na.append(Sa);Sa.hide()},Xa=function(){var v=new R;v.setText(N.get("addGroup","\u65b0\u589e\u5206\u7ec4"));v.addActionListener(function(){var E=n.getOutputDataType()===
P.DT_STRING?new Ta:new ca;var A=E.setGroupItem,q=Db,y=q.createGroupByFieldType,L=E.getType();var T=!1;for(var Pa=1;!T;){T=!0;for(var eb=N.get("group","\u5206\u7ec4")+Pa.toString(),Lb=0;Lb<S.length;Lb++)if(S[Lb].getGroupItem().getName()===eb){Pa++;T=!1;break}}T=N.get("group","\u5206\u7ec4")+Pa.toString();A.call(E,y.call(q,L,{name:T}));E.setEditingStatus(!0);E.setNewCreated();hb.append(E.getJqUi());S.push(E);U&&U.setItemModels(S)});return v},ya=function(){hb.empty();ba.empty();Sa.hide();Ya.hide()},
K=function(){n?va.asyncGetFieldValues([n.toJsonObject()],function(v){if(v){pb=[];var E=v.fields;p=E.length&&E[0].extensions?E[0].extensions.bizFieldEnumKey:null;v=v.values;v=v.length?v[0]:[];for(E=0;E<v.length;E++){var A=v[E];null!==A&&""!==A&&pb.push(A)}d?(ya(),Sa.show(),n.getOutputDataType()===P.DT_STRING?Eb(null):rb(null),u(),g=n,d=!1):Ea()}}):ya()},Ea=function(){ya();if(n){Sa.show();var v=c.getGroups();c.getCustomGroupType()===qb.STRING?Eb(v):rb(v);g=n}},rb=function(v){Za.css("height","calc(100% - 97px)");
U.getJqUi().hide();for(var E=$(document.createDocumentFragment()),A=v?v.length:3,q=[],y=0;y<A;y++){if(v){var L=v[y];var T=new ca;T.setGroupItem(L);T.setCollapse(L.getCollapse())}else T=new ca,T.setGroupItem(Db.createGroupByFieldType(T.getType(),{name:N.get("group","\u5206\u7ec4")+(y+1)}));T.setEditEnable(!db);E.append(T.getJqUi());q.push(T)}hb.append(E);S=q;V();E=pb.length?pb:[0];v=Math.min.apply(null,E);E=Math.max.apply(null,E);A=(new Z(n.getAlias()+N.get("fieldValueRange","\u5b57\u6bb5\u7684\u503c\u533a\u95f4")+
"\uff1a")).getJqUi();q=(new Z(N.get("minValue","\u6700\u5c0f\u503c")+v)).getJqUi();y=(new Z(N.get("maxValue","\u6700\u5927\u503c")+E)).getJqUi();q.attr("title",v);y.attr("title",E);Ma.makeTextOmissible(q);Ma.makeTextOmissible(y);ba.append(A);ba.append(q);ba.append("\uff0c");ba.append(y)},Eb=function(v){U.getJqUi().show();Ya.show();Za.css("height","calc(100% - 110px)");var E=pb.slice(),A=$(document.createDocumentFragment()),q=[],y=[];v=v||[];v.forEach(function(L){var T=new Ta;T.setGroupItem(L);T.setCollapse(L.getCollapse());
T.setSelectedMembers(L.getSelecteds());T.setEditEnable(!db);A.append(T.getJqUi());q.push(T);y=y.concat(L.getMembers())});0===v.length&&(v=new Ta,v.setGroupItem(Db.createGroupByFieldType(v.getType(),{name:N.get("group","\u5206\u7ec4")+1})),v.setEditEnable(!db),A.append(v.getJqUi()),q.push(v));hb.append(A);S=q;Sb(y,E)},Sb=function(v,E){if(!db){var A=!1,q=[];k&&(A=k.getGroupItem().getCollapse(),q=k.getGroupItem().getSelecteds());k=new Ta;if(E.length)for(var y=0;y<v.length;y++){var L=E.indexOf(v[y]);
-1<L&&E.splice(L,1)}k.setGroupItem(Db.createGroupByFieldType(k.getType(),{name:N.get("noGroupedLabel","\u672a\u8bbe\u7f6e\u5206\u7ec4\u7684\u7ef4\u5ea6\u6210\u5458"),members:E}));k.getGroupItem().setSelecteds(q);k.getGroupItem().setCollapse(A);k.setId(Ta.UNGROUP);k.setCollapse(A);k.setSelectedMembers(q);k.setEditEnable(!1);hb.prepend(k.getJqUi());S.unshift(k);U&&U.setItemModels(S)}},D=function(v,E){var A;return function(){A&&clearTimeout(A);A=setTimeout(v,E)}}(K,500);Ta.UNGROUP="unGroup";ca.FROM=
"from";ca.TO="to"}function Nb(t){function H(Ya,kb){function Ib(D){var v=this,E=!0,A=!0,q,y,L,T,Pa,eb;this.getGroupByFieldItem=function(){return D};this.setShowSortArrow=function(Kb){E=Kb};this.setFieldValid=function(Kb){A=Kb};this.setInValidText=function(Kb){q=Kb};this.checkGroupByFieldItemStatus=function(){for(var Kb=!1,fb=0;fb<B.length;fb++){var Ob=B[fb];if(Ob.getFullName()===D.getField().getFullName()){Kb=!0;v.protectedCheckDataTypeValid(D,Ob);break}}Kb||(v.setFieldValid(Kb),Kb=N.get("fieldNotExist",
"\u4e0d\u5b58\u5728\u7684\u5b57\u6bb5"),v.setInValidText(Kb))};this.setMoveUpGroupByField=function(Kb){Pa=Kb};this.setShowPropertySettingMenu=function(Kb){eb=Kb};this.createMenuModel=function(Kb){var fb=new wa;v.protectedCreateMenuModel(fb,A);var Ob=La.createActionMenuItem(N.get("rename","\u91cd\u547d\u540d"),function(){tb(v,Kb)});fb.addItemModel(Ob);Ob=La.createActionMenuItem(N.get("remove","\u79fb\u9664"),function(){Xa(D,Kb)});fb.addItemModel(Ob);return fb};this.getJqUi=function(){if(!y){y=$("<div class='model-designer-selected-group-by-field-item'>");
var Kb=ra.createWarning();Kb.css({position:"absolute","margin-top":"5px"});Kb.attr("title",q);Kb.appendTo(y);Kb.hide();var fb=$("<div class='model-designer-selected-group-by-field-name'>"),Ob=D.getField().getAppointedAlias();Ob=Ob?Ob:e(D.getField().getFullName(),D);fb.text(Ob);fb.attr("title",Ob);fb.appendTo(y);v.protectedInitGroupByFieldItemUi(fb);A||(fb.css("margin-left","16px"),Kb.show());y.mouseenter(Lb);y.mouseleave(Wb);Vb()}return y};var Lb=function(){L&&L.show();E&&T&&T.show()},Wb=function(){L&&
L.hide();T&&T.hide()},Vb=function(){T=$("<div class='model-designer-selected-group-by-field-sort-arrow'>");Qa.backgroundWithHover(T,"moveUp");T.attr("title",N.get("moveUpField","\u4e0a\u79fb\u5b57\u6bb5"));T.on("click",function(fb){v.protectedMoveUpGroupByField(D,Pa)});T.appendTo(y);L=$("<div class='model-designer-selected-group-by-field-menubtn'>");L.on("mousedown",function(fb){fb=$(fb.target);v.protectedShowPropertySettingMenu(fb,eb)});var Kb=$("<div class='model-designer-selected-group-by-field-menubtn-text'>");
Kb.text("\u25b2");Kb.appendTo(L);L.appendTo(y);L.hide();T.hide()}}function Wa(D){Ib.call(this,D);var v=this;this.protectedInitGroupByFieldItemUi=function(E){var A=D.getField().getOutputDataType();if(D.getDateGroup()||ya(A))!D.getDateGroup()&&ya(A)&&(D.updateGroupByFieldProperty(),A=g(D),D.getDateGroupTypeMap().alias=A,D.getField().setAlias(A),k(D)),A=C.dateTypeTextConvert(D.getDateGroupType()),E.text(A+N.get("colon","\uff1a")+D.getField().getAlias())};this.protectedMoveUpGroupByField=function(E,A){A(E,
hb.copyGroupFieldItems())};this.protectedShowPropertySettingMenu=function(E,A){A(v,E,hb.copyGroupFieldItems())};this.protectedCreateMenuModel=function(E,A){var q=D.getField().getOutputDataType();ya(q)&&A&&xb(E,D,hb.copyGroupFieldItems())};this.protectedCheckDataTypeValid=function(E,A){A=A.getOutputDataType();E.getField().setAppointedDataType(A);E.getDateGroup()&&!ya(A)&&(v.setFieldValid(!1),E=N.get("dateGroupInValid","\u975e\u201c\u65e5\u671f\u578b\u201d\u3001\u201c\u65e5\u671f\u65f6\u95f4\u578b\u201d\u5b57\u6bb5\uff0c\u65e5\u671f\u5206\u7ec4\u8bbe\u7f6e\u65e0\u6548\u3002"),
v.setInValidText(E))}}function jb(D){Ib.call(this,D);var v=this;this.protectedInitGroupByFieldItemUi=function(E){var A=gb(D.getFunctionType())+N.get("colon","\uff1a")+D.getField().getAlias();E.text(A)};this.protectedMoveUpGroupByField=function(E,A){A(E,hb.copyAggregateFieldItems())};this.protectedShowPropertySettingMenu=function(E,A){A(v,E,hb.copyAggregateFieldItems())};this.protectedCreateMenuModel=function(E,A){bb(E,A,D,hb.copyAggregateFieldItems())};this.protectedCheckDataTypeValid=function(E,
A){var q=E.getFunctionType();A=A.getOutputDataType();E.getField().setAppointedDataType(A);E=[ia.COUNT,ia.DISTINCT_COUNT];K(A)?E.push(ia.SUM,ia.AVG,ia.MAX,ia.MIN):ya(A)&&E.push(ia.MAX,ia.MIN);-1===E.indexOf(q)&&(v.setFieldValid(!1),q=N.get("functionTypeInValid","\u805a\u5408\u65b9\u5f0f\u4e0d\u6b63\u786e"),v.setInValidText(q))}}var pb=this,S,db,U=[],B=[],h,n;this.setFields=function(D){B=D};this.getJqUi=function(){if(!S){S=$("<div class='modeler-designer-group-agg-area'>");var D=$("<div class='modeler-designer-group-agg-title'>");
D.text(kb);var v=$("<span class='modeler-designer-group-add-btn'>");Qa.backgroundWithHover(v,"add");v.attr("title",N.get("addField","\u6dfb\u52a0\u5b57\u6bb5"));v.on("click",a);v.appendTo(D);D.appendTo(S);db=$("<div class='modeler-designer-group-agg-field-area'>");db.appendTo(S)}return S};this.getJqFieldArea=function(){return db};this.setGroupByFieldItems=function(D){U=D};this.setFunConfigGetterAndSetter=function(D,v){n=D;h=v};this.updatePanel=function(){if(t.getFieldSettingConfig())for(var D=t.getFieldSettingConfig().getModifiedField(),
v=0;v<U.length;v++){var E=!1,A=U[v],q=Ea(A),y=A.getField().getFullName();q&&(y=t.getId()+"_"+A.getName());for(var L=0;L<D.length;L++){var T=D[L],Pa=T.getFullName();if(y===Pa){E=!0;(T=L=T.getAppointedAlias())||(T=e(y,A));A.getField().getAlias()!==T&&(A.getField().setAlias(T),f(A));break}}!E&&(y=hb.getMapInitFieldItem()[y])&&(E=y.getAlias(),y=y.getNumber(),E&&A.getField().setAlias(E),q&&y&&V(A.getName(),y))}else for(D=hb.getMapInitFieldItem(),v=0;v<U.length;v++)A=U[v],q=A.getField().getFullName(),Ea(A)&&
(q=t.getId()+"_"+A.getName(),D[q]&&V(A.getName(),D[q].getNumber())),D[q]&&(q=D[q].getAlias())&&A.getField().setAlias(q);(D=pb.getJqFieldArea())&&D.empty();v=$(document.createDocumentFragment());for(A=0;A<U.length;A++)q=pb.createGroupByFieldItemUi(U[A],Ya),q.checkGroupByFieldItemStatus(),0===A&&q.setShowSortArrow(!1),q.setMoveUpGroupByField(Ba),q.setShowPropertySettingMenu(oa),q.getJqUi().appendTo(v);v.appendTo(D)};var e=function(D,v){for(var E,A=0;A<B.length;A++)if(D===B[A].getFullName()){E=B[A].getAlias();
break}E||(E=v.getField().getAlias());return E},f=function(D,v){v=v?v:D.getField().getAlias();D instanceof ia?D.getFunctionTypeMap().alias=v:D.getDateGroupTypeMap().alias=v;if(Ea(D)){var E=new P;E.setName(D.getName());E.setFromNode(t.getId());sa.FieldNumberHelper.isNumberManualModified(E)||sa.FieldNumberHelper.generateDefaultNumberByAssignedName(E,v)}};this.createGroupByFieldItemUi=function(D,v){switch(v){case Sa.GROUP:return new Wa(D);case Sa.AGGREGATE:return new jb(D)}};var a=function(){var D=new Jb,
v=b(B);D.setArrAllFieldItems(v);D.setFunFieldCheckboxClickHandler(function(E,A){if(Ya===Sa.GROUP&&E&&(E=A.getField(),!ya(E.getAppointedDataType()))){for(var q=!1,y=hb.getGroupFieldItems(),L=0;L<y.length;L++)if(y[L].getField().getFullName()===E.getFullName()){q=!0;break}q&&(D.protectedMethod.getMessageCurtain().showPrompt(N.get("notDateTypeDuplicateSelect","\u4ec5\u201c\u65e5\u671f\u201d\u3001\u201c\u65e5\u671f\u65f6\u95f4\u201d\u7c7b\u578b\u7684\u5b57\u6bb5\u652f\u6301\u91cd\u590d\u9009\u62e9\uff0c\u5df2\u653e\u5f03\u9009\u62e9\u3002")),
A.setSelected(!1))}});D.setFunConfirmClose(function(E){c(E,D)});D.showSelectFieldDialog(640,480)},b=function(D){var v=[];D.forEach(function(E){var A=new la,q=E.clone();A.setField(q);A.setDisplayName(E.getAlias());v.push(A)});return v},c=function(D,v){if(D){var E=[];v.getArrAllFieldItems().forEach(function(L){L.getSelected()&&E.push(L)});if(0!==E.length){D=Ya===Sa.GROUP?hb.copyGroupFieldItems():hb.copyAggregateFieldItems();v=[];for(var A=0;A<E.length;A++){var q=E[A],y=q.getField().clone();q=d(y,q.getName(),
Ya);v.push(q);D.push(q)}Da(D,v)}}},d=function(D,v,E){switch(E){case Sa.GROUP:E=D.getOutputDataType();var A=ya(E);E=new W;E.setName(v);E.setDateGroup(A);E.setField(D);if(A){var q=hb.getGroupFieldItems();v=[];for(A=0;A<q.length;A++)q[A].getDateGroup()&&E.getField().getFullName()===q[A].getField().getFullName()&&v.push(q[A]);if(0===v.length)A=C.YEAR;else{for(A=q=0;A<v.length;A++)q=Math.max(ba.indexOf(v[A].getDateGroupType()),q);q+=1;v=ba.indexOf(C.YEAR_MONTH_DAY);A=ba[q>=v?v:q]}E.setDateGroupType(A);
v={};v.dateGroupType=A;E.setDateGroupTypeMap(v);k(E);A=g(E);v.alias=A;D.setAlias(A)}return E;case Sa.AGGREGATE:return E=D.getOutputDataType(),E=K(E)?ia.SUM:ia.COUNT,A=new ia,A.setName(v),A.setField(D),A.setFunctionType(E),w(A),v=u(A),q={},q.functionType=E,q.alias=v,q.calculateByDateType=null,A.setFunctionTypeMap(q),D.setAlias(v),A}},g=function(D){var v=D.getField();if(!Ea(D))return v.getAlias();v=m();return p(D,v,50)},k=function(D){if(Ea(D)&&!Tb(D)){var v=l();v=p(D,v,25);V(D.getName(),v)}},l=function(D,
v){for(var E=[],A=Ta.getGlobal().getModelerModel().getFieldNumberMap(),q=Object.keys(A),y=0;y<q.length;y++)(!D||v||q[y]!==D.getField().getFullName())&&A[q[y]]&&E.push(A[q[y]]);return E},m=function(D,v){for(var E=[],A=0;A<B.length;A++)D&&!v&&B[A].getFullName()===D.getField().getFullName()||E.push(B[A].getAlias());A=hb.getAggregateFieldItems();v=hb.getGroupFieldItems().concat(A);for(A=0;A<v.length;A++){var q=v[A];!Ea(q)||D&&q.getName()===D.getName()||E.push(q.getField().getAlias())}return E},p=function(D,
v,E){var A=e(D.getField().getFullName(),D),q=D.getDateGroup(),y=0;if(q){D=D.getDateGroupType();var L=C.dateTypeTextConvert(D);y=L.length+2}A.length+y>E&&(A=A.substring(0,E-y));D=q?A+"("+L+")":A;var T=[];if(F(v,D))for(A=A.substring(0,E-3-y),D=q?A+"("+L+")":A,E=0;E<v.length;E++)A=v[E],0===A.indexOf(D)&&T.push(A);return I(T,D)},w=function(D){var v=sa.FieldNumberHelper.getFieldNumberByFullName(t.getId()+"_"+D.getName());if(Tb(D))return v;for(var E=hb.getAggregateFieldItems(),A=!1,q=0;q<E.length;q++)if(D.getName()!==
E[q].getName()){if(v&&E[q].getField().getFullName()===D.getField().getFullName()&&E[q].getFunctionType()===ia.SUM){A=!0;break}if(E[q].getField().getFullName()===D.getField().getFullName()&&E[q].getField().getAlias()===D.getField().getAlias()){A=!0;break}}v=l(D,A);v=x(D,v,25);V(D.getName(),v);return v},u=function(D){for(var v=hb.getAggregateFieldItems(),E=!1,A=0;A<v.length;A++){var q=v[A],y=q.getField();if(D.getName()!==q.getName()&&y.getFullName()===D.getField().getFullName()&&y.getAlias()===D.getField().getAlias()){E=
!0;break}}v=m(D,E);return x(D,v,50)},x=function(D,v,E){var A=e(D.getField().getFullName(),D),q=D.getFunctionType(),y=D.getCalculateByDateType(),L=pa(q),T=L.length;y&&(L=pa(y),T=L.length+N.get("of","\u7684").length);A.length+T>E&&(A=A.substring(0,E-T));q=y?A+N.get("of","\u7684")+L:A+L;D=[];if(F(v,q))for(A=A.substring(0,E-3-T),q=y?A+N.get("of","\u7684")+L:A+L,E=0;E<v.length;E++)A=v[E],0===A.indexOf(q)&&D.push(A);return I(D,q)},F=function(D,v){for(var E=!1,A=0;A<D.length;A++)if(D[A]===v){E=!0;break}return E},
I=function(D,v){if(0<D.length){for(var E=1,A=!1;!A;){A=!1;for(var q=0;q<D.length;q++)if(D[q]===v+"_"+E){E++;A=!0;break}A=!A}v=v+"_"+E}return v},V=function(D,v,E){var A=new P;A.setName(D);A.setFromNode(t.getId());sa.FieldNumberHelper.getFieldNumberByFullName(t.getId()+"_"+D)!==v&&sa.FieldNumberHelper.generateDefaultNumberByAssignedName(A,v,E)},pa=function(D){switch(D){case ia.AVG:D=N.get("avg_value","\u5e73\u5747\u503c");break;case ia.MAX:D=N.get("max_value","\u6700\u5927\u503c");break;case ia.MIN:D=
N.get("min_value","\u6700\u5c0f\u503c");break;case ia.COUNT:case ia.DISTINCT_COUNT:D=N.get("count","\u8ba1\u6570");break;case ha.LAST_PERIOD_VALUE:D=N.get("lastPeriodValue","\u4e0a\u671f\u503c");break;case ha.LAST_PERIOD_RATIO:D=N.get("chain","\u73af\u6bd4");break;case ha.SAME_PERIOD_LAST_YEAR_VALUE:D=N.get("samePeriodLastYearValue","\u53bb\u5e74\u540c\u671f\u503c");break;case ha.SAME_PERIOD_LAST_YEAR_RATIO:D=N.get("year_on_year_growth","\u540c\u6bd4");break;case ha.RUNNINGSUM:case ha.RUNNINGSUMY:D=
N.get("runningSum","\u7d2f\u8ba1");break;default:D=""}return D},Da=function(D,v){for(var E={},A=0;A<D.length;A++){var q=t.getId()+"_"+D[A].getName();E[q]=sa.FieldNumberHelper.getFieldNumberByFullName(q)}ca(D,n,function(y){for(var L=0;L<v.length;L++)if(Ea(v[L])){var T=t.getId()+"_"+v[L].getName();T=E[T];y.length===D.length?V(v[L].getName(),T):sa.FieldNumberHelper.removeFieldNumberByFullName(t.getId()+"_"+v[L].getName())}var Pa=hb.getMapInitFieldItem();for(L=0;L<v.length;L++)if(T=v[L].getField().getFullName(),
Ea(v[L])&&(T=t.getId()+"_"+v[L].getName()),y.length===D.length){var eb=new Q;eb.setFullName(T);eb.setAlias(v[L].getField().getAlias());eb.setNumber(sa.FieldNumberHelper.getFieldNumberByFullName(T));Pa[T]=eb}else delete Pa[T];hb.setMapInitFieldItem(Pa);h(y)})},Ba=function(D,v){D=v.indexOf(D);0<D&&(v[D]=v.splice(D-1,1,v[D])[0],ca(v,n,h))},oa=function(D,v,E){var A=D.getJqUi(),q=A.data("menu");if(q&&q.isShowing())A.data("menu",null),q.hide();else{var y=A.outerWidth(),L=A.outerHeight(),T=Math.min(181,
Math.max(y,140));q=new La;q.setWidth(T);q.setModel(D.createMenuModel(E));q.setHideListener(function(){A.data("menu",null)});A.data("menu",q);D=Ta.getGlobal().getTopJqUi();y=[y-T-2,L+3];y=Ma.upwardCoordinate(A[0],y,D[0]);q.show(D,y[0],y[1],v,!0,[0,-L-2])}},bb=function(D,v,E,A){var q=E.getFunctionType(),y=La.createSubMenu(N.get("measure","\u5ea6\u91cf")+(q?"("+gb(q)+")":""),!0,N.get("measure","\u5ea6\u91cf"));q&&y.setChecked(!0);var L=E.getField().getOutputDataType(),T=[ia.COUNT,ia.DISTINCT_COUNT];
K(L)&&v?T=[ia.SUM,ia.AVG,ia.MAX,ia.MIN,ia.COUNT,ia.DISTINCT_COUNT]:ya(L)&&v&&(T=[ia.MAX,ia.MIN,ia.COUNT,ia.DISTINCT_COUNT]);T.forEach(function(Pa){var eb=gb(Pa);eb=La.createRadio(eb,Pa,q===Pa,function(){Pa!==q&&Fb(E,Pa,A)});y.addItemModel(eb)});D.addItemModel(y);D.addSeperator();v=N.get("calculateByDate","\u6309\u65e5\u671f\u8ba1\u7b97");v=La.createSubMenu(v,!0);L=function(Pa){var eb=E.getCalculateByDateType()===Pa,Lb=ha.calculateByDateTextConvert(Pa);return La.createCheckbox(Lb,eb,function(Wb){Wb=
Wb.isChecked()?Pa:null;lb(E,Wb,A)})};v.addItemModel(L(ha.LAST_PERIOD_VALUE));v.addItemModel(L(ha.LAST_PERIOD_RATIO));v.addItemModel(L(ha.SAME_PERIOD_LAST_YEAR_VALUE));v.addItemModel(L(ha.SAME_PERIOD_LAST_YEAR_RATIO));v.addSeperator();v.addItemModel(L(ha.RUNNINGSUM));v.addItemModel(L(ha.RUNNINGSUMY));D.addItemModel(v);D.addSeperator()},gb=function(D){switch(D){case ia.SUM:D=N.get("sum","\u6c42\u548c");break;case ia.AVG:D=N.get("avg","\u5e73\u5747");break;case ia.MAX:D=N.get("max","\u6700\u5927");break;
case ia.MIN:D=N.get("min","\u6700\u5c0f");break;case ia.COUNT:D=N.get("count","\u8ba1\u6570");break;case ia.DISTINCT_COUNT:D=N.get("distinct_count","\u53bb\u91cd\u8ba1\u6570");break;default:throw Error("Unknown aggregationType: "+D);}return D},Fb=function(D,v,E){var A={};A.alias=D.getField().getAlias();A.functionType=v;ca(A,D.getFunctionTypeMap,function(q){var y=q.functionType,L=q.alias;if(Qb(D,D.getFunctionTypeMap()))D.setFunctionType(y);else{var T=D.getFunctionTypeMap().functionType;T=pa(T)!==pa(y);
D.getFunctionTypeMap().calculateByDateType&&(T=!1);var Pa=v!==y;D.setFunctionType(y);var eb=u(D);T&&w(D);Pa&&(eb=L);D.getField().setAlias(eb);q.alias=eb}rb(D);q.functionType=y;q.calculateByDateType=D.getCalculateByDateType();D.setFunctionTypeMap(q);hb.setAggregateFieldItems(E)})},lb=function(D,v,E){var A={};A.alias=D.getField().getAlias();A.calculateByDateType=v;ca(A,D.getFunctionTypeMap,function(q){var y=q.calculateByDateType,L=q.alias;if(Qb(D,D.getFunctionTypeMap()))D.setCalculateByDateType(y);
else{var T=D.getFunctionTypeMap().calculateByDateType;T=pa(T)!==pa(y);var Pa=v!==y;D.setCalculateByDateType(y);var eb=u(D);T&&w(D);Pa&&(eb=L);D.getField().setAlias(eb);q.alias=eb}rb(D);q.calculateByDateType=y;q.functionType=D.getFunctionType();D.setFunctionTypeMap(q);hb.setAggregateFieldItems(E)})},xb=function(D,v,E){var A=v.getDateGroupType();ba.forEach(function(q){var y=C.dateTypeTextConvert(q);y=La.createRadio(y,q,A===q,function(){q!==A&&zb(v,q,E)});D.addItemModel(y)});D.addSeperator()},zb=function(D,
v,E){var A={};A.alias=D.getField().getAlias();A.dateGroupType=v;ca(A,D.getDateGroupTypeMap,function(q){var y=q.dateGroupType,L=q.alias,T=D.getDateGroupTypeMap().alias,Pa=m(D,!1);Pa=p(D,Pa,50);T!==Pa?D.setDateGroupType(y):(T=v!==y,D.setDateGroupType(y),k(D),Pa=g(D),T&&(Pa=L),D.getField().setAlias(Pa),q.alias=Pa);rb(D);q.dateGroupType=y;D.setDateGroupTypeMap(q);hb.setGroupFieldItems(E)})},Qb=function(D,v){v=v.alias;for(var E=hb.getAggregateFieldItems(),A=!1,q=0;q<E.length;q++)if(D.getName()!==E[q].getName()&&
E[q].getField().getFullName()===D.getField().getFullName()&&E[q].getField().getAlias()===D.getField().getAlias()){A=!0;break}E=m(D,A);D=x(D,E,50);return v!==D},Tb=function(D){var v=new P;v.setFromNode(t.getId());v.setName(D.getName());return sa.FieldNumberHelper.isNumberManualModified(v)},tb=function(D,v){var E=hb.getGroupFieldItems(),A=hb.getAggregateFieldItems(),q=E.concat(A),y=D.getGroupByFieldItem(),L=D.getJqUi();L.hide();var T=$("<div class ='modeler-designer-selected-field-rename'>");T.insertBefore(L);
var Pa=new Ka;D=Pa.getJqUi();D.appendTo(T);E=y.getField();var eb=E.getAppointedAlias()?E.getAppointedAlias():e(E.getFullName(),y);Pa.setText(eb);Pa.addAcceptableListener(function(Kb,fb){fb&&Wb();Vb()});Pa.requestFocus();Ma.layoutCtrl(D,null,null,"calc(100% - 30px)",25);D.css("right",25);D=$("<div>");D.attr("title",N.get("reset","\u91cd\u7f6e"));D.on("click",function(Kb){Kb=[];for(var fb=0;fb<v.length;fb++)v[fb].getField().getFullName()===y.getField().getFullName()&&Kb.push(v[fb]);0<Kb.length&&(Kb=
m(y,!1),Kb=(y instanceof W?p:x)(y,Kb,50),Ub(y,Kb,v));Vb()});Qa.background(D,"reset");Ma.layoutCtrlWithLRTB(D,null,7,16,null,null,16);D.css("cursor","pointer");D.css("margin-top","5px");D.appendTo(T);var Lb=function(Kb){Ma.isDescendent(Kb.target,T[0])||(Wb(),Vb())},Wb=function(){var Kb=$.trim(Pa.getText()),fb=/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/;Kb=Kb||0!==Kb.length?Kb:eb;if(eb!==Kb){if(0===Kb.length)var Ob=N.get("nameIsEmpty","\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a");else if(50<Kb.length)Ob=N.get("nameTooLong",
"\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26");else if(Kb.match(fb)){fb=[];for(var yb=0;yb<B.length;yb++){for(var Rb=!1,Xb=B[yb],$b=0;$b<q.length;$b++)q[$b].getField().getFullName()===Xb.getFullName()&&(fb.push(q[$b].getField()),Rb=!0);Rb||fb.push(Xb)}Rb=!1;for(yb=0;yb<fb.length;yb++)if(fb[yb].getAlias()===Kb){Rb=!0;break}Rb&&(Ob=N.get("duplicateName","\u540d\u79f0\u91cd\u590d"))}else Ob=N.get("invalidFieldAlias","\u663e\u793a\u5b57\u6bb5\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210");
Ob?(Ob=N.get("modifyAbandoned","#1\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",Ob),Ta.getGlobal().getMessageCurtain().showPrompt(Ob),Pa.setText(eb)):Ub(y,Kb,v)}},Vb=function(){document.body.removeEventListener("mousedown",Lb);T.remove();L.show()};document.body.addEventListener("mousedown",Lb)},Ub=function(D,v,E){ca(v,function(){var A=D.getField().getAppointedAlias();A||(A=e(D.getField().getFullName(),D));return A},function(A){A!==D.getField().getAlias()&&f(D,A);D.getField().setAlias(A);
rb(D);h(E)})},Xa=function(D,v){var E=v.indexOf(D);v.splice(E,1);var A=Ea(D),q=D.getField().getFullName(),y=!1;A&&(q=t.getId()+"_"+D.getName(),y=Tb(D));var L=sa.FieldNumberHelper.getFieldNumberByFullName(q),T=D.getField().getAlias(),Pa=hb.getMapInitFieldItem(),eb=Pa[q];ca(v,n,function(Lb){-1!==Lb.indexOf(D)?(Pa[q]=eb,D.getField().setAlias(T),Eb(D,!1),A&&V(D.getName(),L,y)):(Eb(D,!0),delete Pa[q],A&&sa.FieldNumberHelper.removeFieldNumberByFullName(q));hb.setMapInitFieldItem(Pa);h(Lb)})},ya=function(D){return D===
P.DT_DATE||D===P.DT_DATETIME},K=function(D){return D===P.DT_INT||D===P.DT_NUMBER},Ea=function(D){return D instanceof ia||D.getDateGroup()},rb=function(D){var v=t.getFieldSettingConfig();v||(v=new sa.FieldSettingConfig);var E=Ea(D),A=v.getModifiedField(),q=new P;q.setName(E?D.getName():D.getField().getName());q.setFromNode(E?t.getId():D.getField().getFromNode());q.setAlias(D.getField().getAlias());!E&&q.setAppointedDataType(Sb(A,q.getFullName()));D=!1;for(E=0;E<A.length;E++)if(A[E].getFullName()===
q.getFullName()){D=!0;var y=E;break}D?A.splice(y,1,q):A.push(q);v.setModifiedField(A,!0);t.setFieldSettingConfig(v)},Eb=function(D,v){var E=t.getFieldSettingConfig();if(E){var A=Ea(D),q=E.getModifiedField(),y=new P;y.setName(A?D.getName():D.getField().getName());y.setFromNode(A?t.getId():D.getField().getFromNode());y.setAlias(D.getField().getAlias());!A&&y.setAppointedDataType(Sb(q,y.getFullName()));if(v)for(D=0;D<q.length;D++){if(q[D].getFullName()===y.getFullName()){q.splice(D,1);break}}else q.push(y);
E.setModifiedField(q,!0);t.setFieldSettingConfig(E)}},Sb=function(D,v){for(var E=0;E<D.length;E++)if(D[E].getFullName()===v)return D[E].getOutputDataType();for(E=0;E<B.length;E++)if(B[E].getFullName()===v)return B[E].getOutputDataType();return null}}function Q(){var Ya,kb,Ib;this.setFullName=function(Wa){Ya=Wa};this.getFullName=function(){return Ya};this.setNumber=function(Wa){kb=Wa};this.getNumber=function(){return kb};this.setAlias=function(Wa){Ib=Wa};this.getAlias=function(){return Ib};this.toJsonObject=
function(){var Wa={};Wa.fullName=Ya;Wa.number=kb;Wa.alias=Ib;return Wa}}ab.call(this,t);var Ta=this.protectedMethod,ca=Ta.doConfigChangeAction,va,Na,Za,hb,ba=[C.YEAR,C.QUARTER,C.MONTH,C.DAY,C.YEAR_QUARTER,C.YEAR_MONTH,C.YEAR_MONTH_DAY],Sa={GROUP:"GROUP",AGGREGATE:"AGGREGATE"};this.protectedInitUi=function(Ya){hb=t.getConfig();if(!va&&(va=$("<div class='modeler-designer-group-agg-container'>"),va.appendTo(Ya),Na=new H(Sa.GROUP,N.get("groupByFields","\u5206\u7ec4\u5b57\u6bb5")),Na.setFunConfigGetterAndSetter(hb.getGroupFieldItems,
hb.setGroupFieldItems),Na.getJqUi().appendTo(va),Za=new H(Sa.AGGREGATE,N.get("aggregateFields","\u6c47\u603b\u5b57\u6bb5")),Za.setFunConfigGetterAndSetter(hb.getAggregateFieldItems,hb.setAggregateFieldItems),Za.getJqUi().appendTo(va),Ya=hb.getMapInitFieldItem(),0===Object.keys(Ya).length)){var kb=hb.getGroupFieldItems().concat(hb.getAggregateFieldItems());Ya={};for(var Ib=0;Ib<kb.length;Ib++){var Wa=kb[Ib],jb=Wa.getField().getFullName();if(Wa instanceof ia||Wa.getDateGroup())jb=t.getId()+"_"+Wa.getName();
var pb=new Q;pb.setFullName(jb);pb.setAlias(Wa.getField().getAlias());(Wa=sa.FieldNumberHelper.getFieldNumberByFullName(jb))&&pb.setNumber(Wa);Ya[jb]=pb}hb.setMapInitFieldItem(Ya)}};this.protectedUpdateUi=function(){Ta.asynGetFields(function(Ya){var kb=hb.getGroupFieldItems(),Ib=hb.getAggregateFieldItems();Na.setFields(Ya);Na.setGroupByFieldItems(kb);Na.updatePanel();Za.setFields(Ya);Za.setGroupByFieldItems(Ib);Za.updatePanel()})}}function ub(t){function H(){var f,a,b,c;this.getJqUi=function(){if(!f){f=
$("<div>");var g=new Z;g.setText(N.get("transposedFields","\u9700\u8981\u8f6c\u7f6e\u7684\u5b57\u6bb5"));g=g.getJqUi();Ma.layoutCtrl(g,10,7,100,15);f.append(g);g=$("<div>");g.css("border-bottom","1px solid #e5e5e5");a=ra.createWarning();Ma.layoutCtrlWithLRTB(a,4,null,null,null,3,null);g.append(a);a.hide();c=new Z;b=c.getJqUi();g.append(b);var k=$("<div>");k.css("cursor","pointer");k.attr("title",N.get("editor","\u7f16\u8f91"));k.on("click",h);Qa.backgroundWithHover(k,"edit");Ma.layoutCtrlWithLRTB(k,
null,0,16,0,0,16);g.append(k);Ma.layoutCtrlWithLRTB(g,115,10,null,7,null,18);f.append(g)}return f};this.showNormalSetting=function(g){a.hide();d(4,g)};this.showWarningWhenNotSetting=function(){var g=N.get("notExistCondition","\u672a\u8bbe\u7f6e\u9700\u8981\u8f6c\u7f6e\u7684\u5b57\u6bb5");a.show();a.attr("title",g);d(24,N.get("notExistCondition","\u672a\u8bbe\u7f6e\u9700\u8981\u8f6c\u7f6e\u7684\u5b57\u6bb5"))};this.showWarningWhenSetting=function(g){var k=N.get("invalidCondition","\u8f6c\u7f6e\u8bbe\u7f6e\u4e0d\u5b8c\u6574\uff0c\u8bf7\u4fee\u6539\u201c\u5217\u8f6c\u884c\u201d\u8bbe\u7f6e");
a.show();a.attr("title",k);d(24,g)};var d=function(g,k){b.attr("title",k);Ma.layoutCtrlWithLRTB(b,g,20,null,null,3,16);c.setText(k)};this.hide=function(){f&&f.hide()};this.show=function(){f&&f.show()}}ab.call(this,t);var Q=this.protectedMethod,Ta,ca,va,Na,Za,hb=[],ba=t.getConfig(),Sa,Ya,kb,Ib;this.protectedInitUi=function(f){Ta=f;Sa=new H;f=Sa.getJqUi();f.appendTo(Ta);Ma.layoutCtrlWithLRTB(f,0,0,null,31,null,30);Wa();S()};var Wa=function(){var f=$("<div>"),a=new Z;a.setText(N.get("transposedAttrFieldName",
"\u8f6c\u7f6e\u540e\u7684\u5c5e\u6027\u5217\u540d"));a=a.getJqUi();Ma.layoutCtrl(a,10,7,100,15);f.append(a);a=$("<div>");a.css("border-bottom","1px solid #e5e5e5");Ya=new Ka;va=Ya.getJqUi();Ma.layoutCtrlWithLRTB(va,0,16,null,null,3,16);va.removeClass("sa-ctrl-common-singlelineborder");a.append(va);Ya.addAcceptableListener(jb);Ya.addBlurListener(function(b){jb(b,!0)});Ma.layoutCtrlWithLRTB(a,115,10,null,7,null,18);f.append(a);Ma.layoutCtrlWithLRTB(f,0,0,null,62,null,30);f.appendTo(Ta)},jb=function(f,
a){a?(f=f.getText(),pb(f,!0)?(a=ba.clone(),a.setAttrFieldAlias(f),n(a)):U()):U()},pb=function(f,a){if(null==f||""==f||0==f.length)return Q.getGlobal().getMessageCurtain().showPrompt(N.get("fieldNameIsNull","\u5b57\u6bb5\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a\u3002")),!1;if(50<f.length)return Q.getGlobal().getMessageCurtain().showPrompt(N.get("fieldNameCanNotExceedLimit","\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002")),!1;if(f){if(!f.match(/^[\s\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/))return Q.getGlobal().getMessageCurtain().showPrompt(N.get("headNameComponentCheckError",
"\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\u3002")),!1;var b=ba.getAttrFieldAlias(),c=ba.getTargetValueFieldAlia(0);if(a&&f==c||!a&&f==b)return Q.getGlobal().getMessageCurtain().showPrompt(N.get("headNameRepeatCheckError","\u5b57\u6bb5\u540d\u79f0\u5df2\u5b58\u5728\u3002")),!1;var d={};hb.forEach(function(g){d[g.getAlias()]=g});if(null!=d[f])return Q.getGlobal().getMessageCurtain().showPrompt(N.get("headNameRepeatCheckError",
"\u5b57\u6bb5\u540d\u79f0\u5df2\u5b58\u5728\u3002")),!1}return!0},S=function(){var f=$("<div>"),a=new Z;a.setText(N.get("transposedValueFieldName","\u8f6c\u7f6e\u540e\u7684\u503c\u5217\u540d"));a=a.getJqUi();Ma.layoutCtrl(a,10,7,100,15);f.append(a);a=$("<div>");a.css("border-bottom","1px solid #e5e5e5");kb=new Ka;Na=kb.getJqUi();Ma.layoutCtrlWithLRTB(Na,0,16,null,null,3,16);Na.removeClass("sa-ctrl-common-singlelineborder");a.append(Na);kb.addAcceptableListener(db);kb.addBlurListener(function(b){db(b,
!0)});Ib=new Z;Za=Ib.getJqUi();Ma.layoutCtrlWithLRTB(Za,4,20,null,null,3,16);a.append(Za);Za.hide();ca=$("<div>");ca.css("cursor","pointer");ca.attr("title",N.get("editor","\u7f16\u8f91"));ca.on("click",h);Qa.backgroundWithHover(ca,"edit");Ma.layoutCtrlWithLRTB(ca,null,0,16,0,0,16);a.append(ca);ca.hide();Ma.layoutCtrlWithLRTB(a,115,10,null,7,null,18);f.append(a);Ma.layoutCtrlWithLRTB(f,0,0,null,93,null,30);f.appendTo(Ta)},db=function(f,a){a?(f=f.getText(),pb(f,!1)?(a=ba.clone(),a.setValueFieldAlias(0,
f),n(a)):B()):B()};this.protectedUpdateUi=function(){Q.asynGetFields(function(f){hb=f?f:[];var a=t.getFieldSettingConfig();if(a){f=t.getId();var b=ba.getTargetAttrField();b.setFromNode(f);a=a.getModifiedField();for(var c=0;c<a.length;c++)if(a[c].getFullName()==b.getFullName()){var d=b.getAlias()!=a[c].getAlias();b.setAlias(a[c].getAlias());d&&!sa.FieldNumberHelper.isNumberManualModified(b)&&sa.FieldNumberHelper.generateDefaultNumberByAssignedName(b,b.getAlias());break}b=ba.getTargetValueFields();
for(c=0;c<b.length;c++)for(b[c].setFromNode(f),d=0;d<a.length;d++)if(a[d].getFullName()==b[c].getFullName()){var g=b[c].getAlias()!=a[d].getAlias();b[c].setAlias(a[d].getAlias());g&&!sa.FieldNumberHelper.isNumberManualModified(b[c])&&sa.FieldNumberHelper.generateDefaultNumberByAssignedName(b[c],b[c].getAlias());break}}f=0<ba.getColumnToRowItems().length;a:{a=ba.getUsedFieldNames();c=hb;b=[];for(d=0;d<c.length;d++)b.push(c[d].getFullName());for(c=0;c<a.length;c++)if(!b.includes(a[c])){a=!1;break a}a=
!0}b=ba.getUsedFields();c="";if(b&&0<b.length){c=b[0].getAlias();d=b[0].getFullName();for(g=0;g<hb.length;g++)d==hb[g].getFullName()&&(c=hb[g].getAlias());c=N.get("selectedField","\u5df2\u9009\u62e9\u201c#1\u201d").replace("#1",c);d=N.get("selectedNumber","\u7b49#1\u4e2a\u5b57\u6bb5").replace("#1",b.length);1<b.length&&(c+=d)}f?a?Sa.showNormalSetting(c):Sa.showWarningWhenSetting(c):Sa.showWarningWhenNotSetting();U();B()})};var U=function(){var f=ba.getAttrFieldAlias();Ya.setText(f);va.attr("title",
f)},B=function(){for(var f="",a=ba.getTargetValueFieldAlias(),b=0;b<a.length;b++)f=f+a[b]+",";f=f.substr(0,f.length-1);1<a.length?(ca.show(),Na.hide(),Za.show(),Ib.setText(f),Za.attr("title",f)):(ca.hide(),Za.hide(),Na.show(),kb.setText(f),Na.attr("title",f))},h=function(){var f=new Ga(t);f.setConfigChangeListener(n);f.setModeler(Q.getGlobal().getModelerModel());f.setFields(hb);f.initUi();f.showDialog()},n=function(f){var a=f.clone(),b=ba.clone(),c=t.getId();b=b.getTargetValueFields();a=a.getTargetValueFields();
for(var d=0;d<b.length;d++){b[d].setFromNode(c);for(var g=b[d].getFullName(),k=!1,l=0;l<a.length;l++)if(a[l].setFromNode(c),g==a[l].getFullName()){k=!0;break}k||sa.FieldNumberHelper.removeFieldNumberByFullName(g)}Q.doConfigChangeAction(f.clone(),ba.clone,e)},e=function(f){var a=t.getId(),b=f.getTargetAttrField();b.setFromNode(a);sa.FieldNumberHelper.isNumberManualModified(b)||sa.FieldNumberHelper.generateDefaultNumberByAssignedName(b,b.getAlias());b=f.getTargetValueFields();for(var c=0;c<b.length;c++)b[c].setFromNode(a),
sa.FieldNumberHelper.isNumberManualModified(b[c])||sa.FieldNumberHelper.generateDefaultNumberByAssignedName(b[c],b[c].getAlias());var d=f.clone();a=t.getFieldSettingConfig();a||(a=new sa.FieldSettingConfig,t.setFieldSettingConfig(a));b=[];c=t.getId();var g=d.getTargetAttrField();g.setFromNode(c);b.push(g);d=d.getTargetValueFields();for(g=0;g<d.length;g++)d[g].setFromNode(c),b.push(d[g]);a.setModifiedField(b,!0);ba.setTargetAttrField(f.getTargetAttrField());ba.setTargetValueFields(f.getTargetValueFields());
ba.setColumnToRowItems(f.getColumnToRowItems());ba.firePropertyChangeEvt()}}function Jb(t){J.call(this);var H=this,Q=this.protectedMethod,Ta,ca,va,Na,Za=!1,hb,ba,Sa;this.setArrAllFieldItems=function(Ya){Ta=Ya};this.getArrAllFieldItems=function(){if(ca)return ca.getArrFieldItems()};this.setGlobal=function(Ya){};this.setFunConfirmClose=function(Ya){va=Ya};this.setFunClosingChecker=function(Ya){Na=Ya};this.showPrompt=function(Ya){Q.getMessageCurtain().showPrompt(Ya)};this.setFunContentPaneCreator=function(Ya){Sa=
Ya};this.showSelectFieldDialog=function(Ya,kb){H.setSize(Ya,kb);H.setPosition(window.innerWidth-Ya>>1,window.innerHeight-kb>>1);t==Pb.SOURCE_TYPE_CURRENT_ENTITY_SOURCE?Q.setTitle(N.get("selectEntityAndField","\u9009\u62e9\u6570\u636e\u8868\u53ca\u5b57\u6bb5")):Q.setTitle(N.get("selectField","\u9009\u62e9\u5b57\u6bb5"));Q.setClosingAction(va);Q.setClosingChecker(Na);Sa?(Q.setContentPaneCreator(Sa),H.showDialog()):(ca=new z,ca.setShowAllCheckbox(Za),ca.setFunFieldCheckClick(hb),ca.setFunAllCheckboxClick(ba),
Ya=new ua,Ya.setType(ua.TYPE_NO_SOURCE),Ya.setText(N.get("currentNodeNoField","\u5f53\u524d\u8282\u70b9\u6ca1\u6709\u53ef\u9009\u62e9\u7684\u5b57\u6bb5")),ca.setJqNoDataUI(Ya.getJqUi()),Q.setContentPaneCreator(ca.getContentPaneCreator()),H.showDialog(),ca.setArrFieldItems(Ta))};this.setShowAllCheckbox=function(Ya){Za=Ya};this.setFunFieldCheckboxClickHandler=function(Ya){hb=Ya};this.setFunAllCheckboxClickHandler=function(Ya){ba=Ya}}function Fa(t){function H(){var Wa,jb=[];this.getJqUi=function(){Wa||
(Wa=$("<div>"),Wa.addClass("modeler-designer-sort-item-list"));return Wa};this.setSortItemPanels=function(pb){jb=pb};this.empty=function(){Wa&&Wa.empty()};this.updateUi=function(){for(var pb=$(document.createDocumentFragment()),S=0;S<jb.length;S++){var db=jb[S];pb.append(db.getJqUi());db.updateUi()}Wa.append(pb)}}function Q(Wa){var jb=this,pb=new O,S=new Ta(Wa),db,U,B;this.setDestroyCallback=function(e){B=e};this.getSortItem=function(){return Wa};this.getJqUi=function(){db||h();return db};var h=function(){db=
$("<div>");db.addClass("modeler-designer-sort-item-panel");var e=$("<div>");e.addClass("modeler-designer-sort-item-row-panel");var f=new Z;f.setText(N.get("targetField","\u76ee\u6807\u5b57\u6bb5"));f=f.getJqUi();f.appendTo(e);Ma.layoutCtrl(f,1,5,50,12);U=ra.createWarning();Ma.layoutCtrlWithLRTB(U,65,null,null,null,2,null);U.attr("title",N.get("fieldNotExist","\u4e0d\u5b58\u5728\u7684\u5b57\u6bb5"));e.append(U);pb.setCustomPainter(function(a,b,c){c&&(b.text(c.getAlias()),b.attr("title",c.getAlias()))});
pb.addSelectedChangedListener(function(a,b,c){b!=c&&(a=Wa.copy(),a.setField(c),a.initSortRule(),va(a,jb.getSortItem,n))});pb.setDropdownAsLongAsPossible(!0);pb.getJqUi().appendTo(e);e.appendTo(db);S.getJqUi().appendTo(db);e=new R;e.setText("\u00d7");e.addActionListener(function(a){B&&B()});e=e.getJqUi();e.addClass("modeler-designer-sort-item-delete");e.appendTo(db);return db},n=function(e){for(var f=ba.getSortItems(),a=0;a<f.length;a++)if(f[a].getTargetFieldFullName()==Wa.getTargetFieldFullName()){f[a]=
e;break}Wa=e;S.setSortItem(Wa);ba.firePropertyChangeEvt()};this.updateUi=function(){var e=Ib(Wa);pb.setItemModels(e);pb.setSelected(Wa.getField());var f=65;sa.SortCheckHelper.checkOneSortItemExist(Wa,e)?U.hide():(U.show(),f=85);Ma.layoutCtrlWithLRTB(pb.getJqUi(),f,30,null,0,null,18);S.updateUi()}}function Ta(Wa){var jb,pb;this.getJqUi=function(){jb||S();return jb};this.setSortItem=function(h){Wa=h};var S=function(){jb=$("<div>");jb.addClass("modeler-designer-sort-item-row-panel");var h=new Z;h.setText(N.get("order",
"\u6392\u5e8f\u65b9\u5f0f"));h=h.getJqUi();h.appendTo(jb);Ma.layoutCtrl(h,1,5,50,12);h=U($a.ORDER_ASC,N.get("orderAsc","\u5347\u5e8f"),jb);var n=h.getJqUi();Ma.layoutCtrlWithLRTB(n,65,null,50,0,null,20);n=U($a.ORDER_DESC,N.get("orderDesc","\u964d\u5e8f"),jb);var e=n.getJqUi();Ma.layoutCtrlWithLRTB(e,null,24,50,0,null,20);pb=new Oa;pb.addElement(h);pb.addElement(n);pb.addChangedListener(function(f,a){f=f.getUserObject();a&&f!=Wa.getOrder()&&(f==$a.ORDER_ASC?va($a.ORDER_ASC,Wa.getOrder,db):va($a.ORDER_DESC,
Wa.getOrder,db))});B(pb,Wa.getOrder());return jb},db=function(h){Wa.setOrder(h);ba.firePropertyChangeEvt()},U=function(h,n,e){var f=new Ha;f.setUserObject(h);f.setText(n);h=f.getJqUi();e.append(h);return f},B=function(h,n){h.toCheckTheElement(function(e){return e.getUserObject()===n})};this.updateUi=function(){B(pb,Wa.getOrder())}}ab.call(this,t);var ca=this.protectedMethod,va=ca.doConfigChangeAction,Na,Za,hb,ba,Sa;this.protectedUpdateUi=function(){ca.asynGetFields(function(Wa){Wa||(Wa=[]);Sa=Wa;
Wa=ba.getSortItems();if(Sa)for(var jb=0;jb<Wa.length;jb++){for(var pb=!1,S=Wa[jb],db=0;db<Sa.length;db++){var U=Sa[db];if(S.getTargetFieldFullName()==U.getFullName()){S.setField(U);pb=!0;break}}pb||S.updateNotExistFieldByMyself()}Wa=ba.getSortItems();jb=[];for(pb=0;pb<Wa.length;pb++)S=Ya(Wa[pb]),jb.push(S);hb.empty();hb.setSortItemPanels(jb);hb.updateUi();0==Wa.length?Za.css("margin-top","0px"):Za.css("margin-top","-4px");Za.show()})};this.protectedInitUi=function(Wa){Na=Wa;ba=t.getConfig();hb=new H;
Wa=hb.getJqUi();Na.append(Wa);Wa=new R;var jb=N.get("addSortBasis","\u6dfb\u52a0\u6392\u5e8f\u4f9d\u636e");Wa.setText(jb);Wa.addActionListener(function(pb){pb=ba.copySortItems();var S=Ib();if(S=0!=S.length?S[0]:null){var db=new $a;db.setField(S);db.initSortRule();pb.push(db);S=!0}else S=!1;S?va(pb,ba.getSortItems,kb):ca.getGlobal().getMessageCurtain().showPrompt(N.get("noFieldToAdd","\u6682\u65e0\u53ef\u6dfb\u52a0\u7684\u5b57\u6bb5\u3002"))});Za=Wa.getJqUi();Za.attr("title",jb);Za.addClass("modeler-designer-create-sort-item");
Za.hide();Na.append(Za)};var Ya=function(Wa){var jb=new Q(Wa);jb.setDestroyCallback(function(){for(var pb=ba.copySortItems(),S=0;S<pb.length;S++)if(Wa.getTargetFieldFullName()==pb[S].getTargetFieldFullName()){pb.splice(S,1);break}va(pb,ba.getSortItems,kb)});return jb},kb=function(Wa){ba.setSortItems(Wa);ba.firePropertyChangeEvt()},Ib=function(Wa){for(var jb=ba.getSortItems(),pb=[],S=0;S<Sa.length;S++){a:{var db=Sa[S];if(!Wa||Wa.getTargetFieldFullName()!=db.getFullName())for(var U=0;U<jb.length;U++)if(jb[U].getTargetFieldFullName()==
db.getFullName()){db=!1;break a}db=!0}db&&pb.push(Sa[S])}return pb}}function Aa(t){function H(Wa){KTDefaultCellRender.call(this,Wa);var jb=this;this.paintCellUI=function(pb,S){S=jb.getCell().getValue();var db=$("<div>");db.text(S);db.attr("title",S);db.addClass("modeler-designer-filter-item-rule-text");db.appendTo(pb)}}function Q(){var Wa,jb,pb;this.getJqUi=function(){if(!Wa){Wa=$("<div>");var db=new Z;db.setText(N.get("filterCondition","\u8fc7\u6ee4\u6761\u4ef6"));db=db.getJqUi();Ma.layoutCtrl(db,
10,7,50,15);Wa.append(db);db=$("<div>");db.css("border-bottom","1px solid #e5e5e5");jb=ra.createWarning();Ma.layoutCtrlWithLRTB(jb,0,null,null,null,3,null);db.append(jb);pb=new Z;db.append(pb.getJqUi());var U=$("<div>");U.css("cursor","pointer");U.attr("title",N.get("editor","\u7f16\u8f91"));U.on("click",Sa);Qa.backgroundWithHover(U,"edit");Ma.layoutCtrlWithLRTB(U,null,0,16,0,0,16);db.append(U);Ma.layoutCtrlWithLRTB(db,70,10,null,7,null,18);Wa.append(db)}return Wa};this.showNormalSetting=function(){jb.hide();
S(0,N.get("setAlready","\u5df2\u8bbe\u7f6e"))};this.showWarningWhenNotSetting=function(){var db=N.get("pleaseSetFilter","\u8bf7\u8bbe\u7f6e\u8fc7\u6ee4\u6761\u4ef6");jb.show();jb.attr("title",db);S(20,N.get("notSet","\u672a\u8bbe\u7f6e"))};this.showWarningWhenSetting=function(){var db=N.get("FilterSettingNotCompleted","\u8fc7\u6ee4\u6761\u4ef6\u4e0d\u5b8c\u6574\uff0c\u8bf7\u4fee\u6539\u8fc7\u6ee4\u6761\u4ef6");jb.show();jb.attr("title",db);S(20,N.get("setAlready","\u5df2\u8bbe\u7f6e"))};var S=function(db,
U){Ma.layoutCtrlWithLRTB(pb.getJqUi(),db,null,100,null,3,16);pb.setText(U)};this.hide=function(){Wa&&Wa.hide()};this.show=function(){Wa&&Wa.show()}}ab.call(this,t);var Ta=this.protectedMethod,ca,va,Na,Za,hb,ba;this.protectedUpdateUi=function(){Ta.asynGetFields(function(Wa){Wa||(Wa=[]);ba=Wa;Wa=Za.getFilterItems();if(ba)for(var jb=0;jb<Wa.length;jb++){var pb=!1,S=Wa[jb];if(!S.isEmpty()){for(var db=0;db<ba.length;db++){var U=ba[db];if(S.getTargetFieldFullName()==U.getFullName()){S.setField(U);pb=!0;
break}}pb||S.updateNotExistFieldByMyself()}}Na.show();Wa=0!=Za.getNotEmptyFilterItems().length;jb=sa.FilterCheckHelper.checkFilterField(Za.getNotEmptyFilterItems(),ba);Wa&&!jb?Na.showNormalSetting():Wa?Na.showWarningWhenSetting():Na.showWarningWhenNotSetting();Wa=Za.getNotEmptyFilterItems();jb=0;0==Wa.length?va.css("border",""):(jb=30*Wa.length+2,va.css("border","1px solid #dbdbdb"));Ma.layoutCtrlWithLRTB(va,10,10,null,68,null,jb);hb.getColumn(0).setWidth(30);hb.getColumn(1).setWidth(170);hb.getColumn(2).setWidth(30);
hb.getColumn(3).setWidth(30);for(jb=hb.getRowsCount()-1;0<=jb;jb--)hb.removeRow(jb);pb=Wa.length;for(jb=0;jb<pb;jb++){db=Wa[jb];S=Mb.createRow(hb);S.setUserObject(db);U=db.getLeftBracketCount();S.getCell(0).setValue(Ib(!0,U));U=S.getCell(1);var B=U.setValue,h=db,n=h.getField(),e=h.getCompareOp(),f=n.getAlias();switch(e){case Ia.COMPARE_EQUAL:var a=N.get("equal","\u7b49\u4e8e");break;case Ia.COMPARE_NOT_EQUAL:a=N.get("notEqual","\u4e0d\u7b49\u4e8e");break;case Ia.COMPARE_GREATER:a=N.get("greater",
"\u5927\u4e8e");break;case Ia.COMPARE_GREATER_EQUAL:a=N.get("equalOrGreater","\u5927\u4e8e\u7b49\u4e8e");break;case Ia.COMPARE_LESS:a=N.get("less","\u5c0f\u4e8e");break;case Ia.COMPARE_LESS_EQUAL:a=N.get("equalOrLess","\u5c0f\u4e8e\u7b49\u4e8e");break;case Ia.COMPARE_INCLUDE:a=N.get("include","\u5305\u542b");break;case Ia.COMPARE_NOT_INCLUDE:a=N.get("notInclude","\u4e0d\u5305\u542b");break;case Ia.COMPARE_START_WITH:a=N.get("startWith","\u5f00\u5934\u662f");break;case Ia.COMPARE_END_WITH:a=N.get("endWith",
"\u7ed3\u5c3e\u662f");break;case Ia.COMPARE_NULL:a=N.get("compareNull","\u4e3a\u7a7a");break;case Ia.COMPARE_NOT_NULL:a=N.get("compareNotNull","\u4e0d\u4e3a\u7a7a");break;case Ia.COMPARE_IN:a=N.get("compareIn","\u5728......\u4e4b\u5185");break;case Ia.COMPARE_NOT_IN:a=N.get("compareNotIn","\u4e0d\u5728......\u4e4b\u5185");break;case Ia.COMPARE_RELATIVE_DATE_RANGE:a=N.get("relativeDateRange","\u76f8\u5bf9\u65e5\u671f");break;default:a=""}a=f+a;h=h.getDisplayValue(!0);a=Ia.isCompareOpWithinOrNotWithinValue(e)?
a.replace("......",h):Ia.isCompareOpRelativeDateRangeValue(e)?n.getAlias()+N.get("equalRelativeDateRange","\u7b49\u4e8e\uff08\u76f8\u5bf9\u65e5\u671f\uff09")+h:a+h;B.call(U,a);U=db.getRightBracketCount();S.getCell(2).setValue(Ib(!1,U));U=db.getLogicOp();S=S.getCell(3);db=S.setValue;U?(B="",U==Ia.LOGIC_AND?B=N.get("and","\u4e14"):U==Ia.LOGIC_OR&&(B=N.get("or","\u6216")),U=B):U=void 0;db.call(S,U)}Mb.refresh(hb)})};this.protectedInitUi=function(Wa){ca=Wa;Za=t.getConfig();Na=new Q;Wa=Na.getJqUi();ca.append(Wa);
Ma.layoutCtrlWithLRTB(Wa,0,0,null,31,null,30);Na.hide();hb=Mb.createTable();va=$(hb.getUI());va.appendTo(ca);Wa=new H(hb);Wa.setOutsideVisible(!1);hb.setCellRender(Wa);hb.addColumns(4);hb.getColumn(0).setWidth(30);hb.getColumn(1).setWidth(170);hb.getColumn(2).setWidth(30);hb.getColumn(3).setWidth(30);hb.setDraggableAdjusting(!1);hb.setFrozenRows(0);hb.setSyncUIWhenModelChanged(!0);hb.setColumnFitVisibleWidth(!0);hb.setScrollerVisible("hidden","auto");Ma.layoutCtrlWithLRTB(va,10,10,null,60,null,0)};
var Sa=function(){var Wa=Ta.getGlobal().getModelerModel(),jb=Wa.getPrevNode(t),pb=new ka(t);pb.setConfigChangeListen(Ya);pb.setFromNode(jb);pb.setModelerModel(Wa);pb.showDialog();pb.updateTableUi(Ta.asynGetFields)},Ya=function(Wa){Ta.doConfigChangeAction(Wa,Za.getFilterItems,kb)},kb=function(Wa){Za.setFilterItems(Wa);Za.firePropertyChangeEvt()},Ib=function(Wa,jb){Wa=Wa?"(":")";for(var pb="",S=0;S<jb;S++)pb+=Wa;return pb}}function nb(t){function H(){var B,h=[];this.getJqUi=function(){B||(B=$("<div class='modeler-designer-calculated-field-panel'>"));
return B};this.setCalculatedFieldViewItems=function(n){h=n};this.empty=function(){B&&B.empty()};this.updateUi=function(){for(var n=$(document.createDocumentFragment()),e=0;e<h.length;e++)n.append(h[e].getJqUi());B.append(n)}}function Q(B){var h=!0,n,e,f;this.setValid=function(b){h=b};this.getValid=function(){return h};this.getJqUi=function(){n||a();return n};this.setFunEditCalculatedField=function(b){e=b};this.setFunDeleteCalculatedField=function(b){f=b};var a=function(){n=$("<div class='modeler-designer-calculated-field-item'>");
var b=B.getDataType(),c=$("<div class='modeler-designer-calculated-field-item-icon'>");Qa.background(c,b);b=B.getAlias();var d=$("<div class='modeler-designer-calculated-field-item-alias'>");d.text(b);d.attr("title",b);var g=$("<div class='modeler-designer-calculated-field-item-edit-btn'>");g.attr("title",N.get("editCalculatedField","\u7f16\u8f91"));g.on("click",function(m){e(B)});Qa.backgroundWithHover(g,"edit");var k=$("<div class='modeler-designer-calculated-field-item-delete-btn'>");k.attr("title",
N.get("deleteCalculatedField","\u5220\u9664"));k.on("click",function(m){f(B)});Qa.backgroundWithHover(k,"delete");var l=ra.createWarning();Ma.layoutCtrlWithLRTB(l,5,null,null,null,10,null);l.attr("title",N.get("invalidCalculatedField","\u8ba1\u7b97\u5b57\u6bb5#1\u65e0\u6548").replace("#1",'"'+b+'"'));l.appendTo(n);c.appendTo(n);d.appendTo(n);g.appendTo(n);k.appendTo(n);h?l.hide():(c.css("margin-left","25px"),d.css("margin-left","45px"),l.show())}}ab.call(this,t);var Ta=this.protectedMethod,ca=Ta.doConfigChangeAction,
va,Na,Za=[],hb=[],ba=!1;this.protectedInitUi=function(B){Na=t.getConfig();va=new H;va.getJqUi().appendTo(B);var h=new R;h.setText(N.get("createCalculatedFiled","\u521b\u5efa\u8ba1\u7b97\u5b57\u6bb5"));h.addActionListener(Sa);h=h.getJqUi();h.attr("title",N.get("createCalculatedFiled","\u521b\u5efa\u8ba1\u7b97\u5b57\u6bb5"));h.addClass("modeler-designer-create-calculated-field-btn");h.appendTo(B)};var Sa=function(B){if(0<Za.length){var h=new Ra;h.setName("F"+(new Date).getTime());h.setFromNode(t.getId());
Ya(h,!1,function(){Za.push(h);Ib(h)})}else{B=N.get("upwardNodeInvalid","\u4e0a\u6e38\u8282\u70b9\u8bbe\u7f6e\u4e0d\u5b8c\u6574");var n=Ta.getGlobal().getNodeStatusMonitor().getInvalidState(t);n&&(B=n.getPrompt());Ta.getGlobal().getMessageCurtain().showPrompt(B+N.get("noCalculatedFieldToCreate","\uff0c\u65e0\u6cd5\u521b\u5efa\u8ba1\u7b97\u5b57\u6bb5\u3002"))}},Ya=function(B,h,n){var e=[],f=[];kb(e,f,h,B);var a,b=null,c=Ta.getGlobal().getRemoteImpl(),d=new ob(c,function(g){var k=g.ok,l=g.errorPosition,
m=g.errorPrompt;a=g.dataType;b(k,l,m)});d.setShowBlocking(!1);c=new ma;c.setContext(Za,B,h);c.setSyntaxValidator(function(g,k,l){b=l;d.checkFormula(k,B.getSourceNodeId(),g,e,f)});c.edit(h,function(){a=a?a:P.DT_NUMBER;B.setDataType(a);n&&n(B)})},kb=function(B,h,n,e){for(var f=0;f<Za.length;f++){var a=Za[f];n&&a.getFullName()===e.getFullName()||(a instanceof P?B.push(a.toJsonObject()):h.push(a.toJsonObject()))}},Ib=function(B){var h=Na.copyCalculatedFields();h.push(B);ca(h,Na.getCalculatedFields,function(n){-1!==
n.indexOf(B)?db(B):sa.FieldNumberHelper.removeFieldNumberByFullName(B.getFullName());U(n);ba=!0;Na.setCalculatedFields(n)})};this.protectedUpdateUi=function(){Ta.asynGetFields(function(B){B||(B=[]);var h=t.getFieldSettingConfig(),n=Na.getCalculatedFields();Za=B.concat(n);if(h){h=h.getModifiedField();for(var e=0;e<n.length;e++)for(var f=n[e].getFullName(),a=0;a<h.length;a++){var b=h[a].getFullName();if(f===b){f=n[e].getAlias()!==h[a].getAlias();n[e].setAlias(h[a].getAlias());f&&db(n[e]);ba=!0;break}}}Wa(B)})};
var Wa=function(B){if(ba||hb!==B){var h=[],n=[];kb(h,n);var e=Ta.getGlobal().getRemoteImpl();e=new ob(e,function(f){if(f=f.map){var a=Na.getCalculatedFields();va.empty();for(var b=[],c=0;c<a.length;c++){var d=a[c],g=f[d.getName()];if(g){var k=g.valid;d.setDataType(g.dataType);d=new Q(d);d.setValid(k);d.setFunEditCalculatedField(jb);d.setFunDeleteCalculatedField(S);b.push(d)}}va.setCalculatedFieldViewItems(b);va.updateUi()}});e.setShowBlocking(!1);e.checkAllFormula(h,n);hb=B;ba=!1}},jb=function(B){var h=
B.clone();Ya(h,!0,function(){var n=Na.getCalculatedFields().indexOf(B),e=Na.copyCalculatedFields();e.splice(n,1,h);pb(e,n)})},pb=function(B,h){ca(B,Na.getCalculatedFields,function(n){U(n);db(n[h]);ba=!0;Na.setCalculatedFields(n)})},S=function(B){var h=Na.copyCalculatedFields(),n=h.indexOf(B);if(-1<n){var e=sa.FieldNumberHelper.getFieldNumberByFullName(B.getFullName()),f=sa.FieldNumberHelper.isNumberManualModified(B);h.splice(n,1);ca(h,Na.getCalculatedFields,function(a){-1!==a.indexOf(B)?sa.FieldNumberHelper.generateDefaultNumberByAssignedName(B,
e,f):sa.FieldNumberHelper.removeFieldNumberByFullName(B.getFullName());U(a);ba=!0;Na.setCalculatedFields(a)})}},db=function(B){sa.FieldNumberHelper.isNumberManualModified(B)||sa.FieldNumberHelper.generateDefaultNumberByAssignedName(B,B.getAlias())},U=function(B){var h=t.getFieldSettingConfig();h||(h=new sa.FieldSettingConfig,t.setFieldSettingConfig(h));for(var n=[],e=0;e<B.length;e++)n.push(B[e].clone());h.setModifiedField(n,!0)}}function wb(t){function H(){var B,h,n=[];this.getUnionConfig=function(){return B};
this.setUnionConfig=function(e){B=e};this.getFieldSettingConfig=function(){return h};this.setFieldSettingConfig=function(e){h=e};this.getFieldNumberMapItems=function(){return n};this.setFieldNumberMapItems=function(e){n=e};this.getFieldNumberMapItem=function(e){for(var f=0;f<n.length;f++)if(n[f].getFieldFullName()==e)return n[f];return null};this.copy=function(){var e=new H;e.setUnionConfig(B.clone());h&&e.setFieldSettingConfig(h.copy());e.setFieldNumberMapItems(n.slice());return e}}function Q(){var B,
h,n;this.getJqUi=function(){B||e();return B};this.showNormalSetting=function(){n.hide();var f=N.get("setAlready","\u5df2\u8bbe\u7f6e");Ma.layoutCtrlWithLRTB(h.getJqUi(),0,null,100,null,3,16);h.setText(f)};this.showWarningWhenSetting=function(){var f=N.get("unionConfigInvalid","\u5408\u5e76\u8868\u8bbe\u7f6e\u5f02\u5e38\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u3002");n.show();n.attr("title",f);f=N.get("setAlready","\u5df2\u8bbe\u7f6e");Ma.layoutCtrlWithLRTB(h.getJqUi(),20,null,100,null,3,16);h.setText(f)};
this.hide=function(){B&&B.hide()};this.show=function(){B&&B.show()};var e=function(){B=$("<div>");var f=new Z;f.setText(N.get("union","\u5408\u5e76\u8868"));f=f.getJqUi();Ma.layoutCtrl(f,10,7,50,15);B.append(f);f=$("<div>");f.css("border-bottom","1px solid #e5e5e5");n=ra.createWarning();Ma.layoutCtrlWithLRTB(n,0,null,null,null,3,null);f.append(n);h=new Z;f.append(h.getJqUi());var a=$("<div>");a.css("cursor","pointer");a.attr("title",N.get("editor","\u7f16\u8f91"));a.on("click",function(){var b=new Ta(Ya);
b.setConfirmCallback(jb);b.setGlobal(Za.getGlobal());b.showDialog()});Qa.backgroundWithHover(a,"edit");Ma.layoutCtrlWithLRTB(a,null,0,16,0,0,16);f.append(a);Ma.layoutCtrlWithLRTB(f,70,10,null,7,null,18);B.append(f)}}function Ta(B){J.call(this);var h=this.protectedMethod,n=this,e,f={},a,b,c=B.clone();(function(){n.setSize(800,480);h.setTitle(N.get("editUnion","\u7f16\u8f91\u5408\u5e76\u8868"));h.setSelectable(!0);h.setContentPaneCreator(function(){a=new ca(c);a.setNodeFields(f);a.setGlobal(b);var m=
a.getJqUi(),p=c.getNodeItems();k(p,0);return m});h.setFooterPaneCreator(function(m){var p=new na(N.get("confirm","\u786e\u5b9a"));p.setHighlight(!0);var w=p.getJqUi();w.addClass("sa-ctrl-dialog-footer-ok");w.appendTo(m);p.addActionListener(function(u){g()&&(e&&e(c),d())});p=new na(N.get("cancel","\u53d6\u6d88"));p.setHighlight(!1);w=p.getJqUi();w.addClass("sa-ctrl-dialog-footer-cancel");w.appendTo(m);p.addActionListener(function(u){d()})});h.setClosingAction(function(m){d()})})();this.setConfirmCallback=
function(m){e=m};this.setGlobal=function(m){b=m};var d=function(){h.destroy();a.destroy()},g=function(){if(!c)return!1;var m=a.getUnacceptableError();if(c.checkNodeToUnionExistExceptBase()){if(c.checkUnionItemSelectEmpty())return h.getMessageCurtain().showPrompt(N.get("noSelectedField","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b57\u6bb5\u3002")),!1;if(m)return h.getMessageCurtain().showPrompt(m.getErrorDesc()),!1}else return h.getMessageCurtain().showPrompt(N.get("needAddTable","\u8bf7\u81f3\u5c11\u6dfb\u52a0\u4e00\u4e2a\u8868\u3002")),
!1;return!0},k=function(m,p){if(m.length==p)l(),a.updateMappingPane();else{var w=kb.getNode(m[p].getNodeId());w?sa.NodeFieldHelper.asynGetFields(kb,w,function(u){u||(u=[]);f[w.getId()]=u.slice();c.updateUnionItem(p,u);k(m,p+1)}):(c.updateUnionItem(p,[]),k(m,p+1))}},l=function(){var m=c.getNodeFields(),p=new Va,w=c.getNodeItems();p.setNodeItems(w);for(var u=0;u<w.length;u++){var x=w[u].getNodeId(),F=f[x];if(F){var I=m[x]?m[x]:[];if(F.length!=I.length){for(var V=p,pa=u,Da=[],Ba=0;Ba<F.length;Ba++){var oa=
F[Ba];if(oa){for(var bb=!0,gb=0;gb<I.length;gb++)if(oa.getFullName()==I[gb].getFullName()){bb=!1;break}bb&&Da.push(oa)}}V.addOneNodeToUnion(x,Da,pa,!1)}}}m=p.getUnionItems();for(u=0;u<m.length;u++)c.addUnionItem(m[u])}}function ca(B){function h(){var d,g,k,l;this.getJqUi=function(){d||m();return d};this.setSelectedCallback=function(V){l=V};var m=function(){d=$("<div>");var V=$("<div>");V.addClass("modeler-designer-union-node-table-list-title");V.appendTo(d);var pa=$("<div>");pa.addClass("modeler-designer-workarea-title-text");
pa.text(N.get("selectedTable","\u5df2\u9009\u8868"));pa.appendTo(V);pa=$("<div>");pa.addClass("modeler-designer-workarea-title-btn");Qa.backgroundWithHover(pa,"add");pa.on("click",x);pa.attr("title",N.get("addTable","\u6dfb\u52a0\u6570\u636e\u8868"));pa.appendTo(V);g=new ib;g.setBorderVisible(!1);g.setToggleSelectingEnabled(!1);g.setCustomItemPainter(p);g.setCustomSelectedsPainter(u);g.setItemModels(B.getNodeItemsSlice(!0));V=g.getJqUi();V.appendTo(d);Ma.layoutCtrlWithLRTB(V,0,0,null,25,0,null);V=
N.get("addTable","\u6dfb\u52a0\u6570\u636e\u8868");k=$("<div>");k.addClass("modeler-designer-union-node-table-list-text-link");k.text(V);k.attr("title",V);k.css("cursor","pointer");k.css("color","#0E5FD8");k.on("click",function(Da){x()});k.appendTo(d);k.hide()},p=function(V,pa){V.css("height","30px");V.css("cursor","pointer");var Da=$("<div>");Da.appendTo(V);Da.addClass("modeler-designer-sourcearea-icon");Da.css("top","9px");Da.css("left","12px");Qa.background(Da,"table");var Ba=pa.getAlias(),oa=
$("<div>");oa.text(Ba);oa.addClass("modeler-designer-sourcearea-name");oa.css("left","34px");oa.attr("title",Ba);oa.appendTo(V);pa.isExist()||(Ba=ra.createWarning(),Ba.attr("title",N.get("invalidSourcePrompt","\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664")),Ma.layoutCtrlWithLRTB(Ba,12,null,null,8,null,null),Ba.appendTo(V),Da.css("left","34px"),oa.css("left","56px"));var bb=$("<div>");bb.addClass("modeler-designer-sourcearea-delete-btn");bb.on("click",function(gb){B.deleteOneNodeToUnion(pa.getNodeId());
V.remove();w();l&&l()});Qa.backgroundWithHover(bb,"delete");bb.appendTo(V);bb.hide();pa.getNodeId()!=B.getBaseNodeItem().getNodeId()&&(V.mouseenter(function(){bb.show()}),V.mouseleave(function(){bb.hide()}))},w=function(){B.checkNodeToUnionExistExceptBase()?(k.hide(),g.getJqUi().show()):(k.show(),g.getJqUi().hide())},u=function(V,pa){V&&0<V.length&&(V=V[0],V.css("background-color",""),V.css("color",""));pa&&0<pa.length&&(pa=pa[0],pa.css("background-color","#eff3fd"),pa.css("color","rgb(130, 130, 130)"))},
x=function(){var V=new va(B);V.setGlobal(b);V.setConfirmCallback(function(pa){for(var Da=B.getNodeItemsSlice(!0),Ba=0;Ba<Da.length;Ba++){for(var oa=Da[Ba],bb=oa.getNodeId(),gb=!1,Fb=0;Fb<pa.length;Fb++)if(bb==pa[Fb].getNodeId()){gb=!0;break}oa.isExist()&&!gb&&(B.deleteOneNodeToUnion(bb),delete f[bb])}F(Da,pa);pa=B.getNodeItemsSlice(!0);I(pa,Da,0,f);w()});V.showDialog()},F=function(V,pa){pa.forEach(function(Da){for(var Ba=!0,oa=0;oa<V.length;oa++){var bb=V[oa];if(bb.isExist()&&Da.getNodeId()==bb.getNodeId()){Ba=
!1;break}}Ba&&B.addNodeItem(Da)})},I=function(V,pa,Da,Ba){if(V.length==Da)g.setItemModels(V),l&&l();else{var oa=V[Da];if(oa.isExist()){for(var bb=0;bb<pa.length;bb++)if(oa.getNodeId()==pa[bb].getNodeId()){I(V,pa,Da+1,Ba);return}var gb=kb.getNode(oa.getNodeId());sa.NodeFieldHelper.asynGetFields(kb,gb,function(Fb){Fb||(Fb=[]);Ba[gb.getId()]=Fb.slice();B.addOneNodeToUnion(gb.getId(),Fb,Da+1,!0);I(V,pa,Da+1,Ba)})}else I(V,pa,Da+1,Ba)}}}var n=this,e,f,a,b;this.getJqUi=function(){e||c();return e};this.getUnacceptableError=
function(){return a.getUnacceptableError()};this.destroy=function(){a.destroy()};var c=function(){e=$("<div>");var d=new h;d.setSelectedCallback(function(){n.updateMappingPane()});a=new Ja;a.setUnionConfig(B);a.setModeler(kb);a.getJqUi().addClass("modeler-designer-node-selection-right");a.setTableStyle("modeler-designer-union-node-edit-table");var g=new X;g.setHorizontalSplit(!0);g.setEnabled(!0);g.setFirstSize(200,185,300);g.setSecondSize(565,-1,-1);g.setResizeMode(X.RESIZE_MODE_FIRST_FIXED);g.setFirstChild(X.createChildWrapper(d.getJqUi()));
g.setSecondChild(X.createChildWrapper(a.getJqUi()));e.append(g.getJqUi())};this.updateMappingPane=function(){a.updateSelectableNodeFields(f);a.updateUi()};this.setNodeFields=function(d){f=d};this.setGlobal=function(d){b=d}}function va(B){J.call(this);var h=this.protectedMethod,n=this,e,f,a;(function(){h.setTitle(N.get("addNodeToUnion","\u6dfb\u52a0\u5408\u5e76\u8868"));h.setSelectable(!0);h.setContentPaneCreator(function(){f=new mb;f.setSelectedNodeItem(B.getNodeItemsSlice(!0,!0));var b=f,c=b.setItemModels;
var d=[];for(var g=kb.getRelatedLine(t,G.GET_LINE_STRATEGY_IN),k=0;k<g.length;k++){var l=g[k].getFromId();if(l!=B.getBaseNodeItem().getNodeId()){var m=kb.getNode(l),p=new Gb;m=sa.DisplayNameHelper.getNodeDisplayName(m);p.setAlias(m);p.setNodeId(l);d.push(p)}}g=a.getModelerModel();k=B.getBaseNodeItem();(k=g.getNode(k.getNodeId()))&&(d=d.concat(sa.UnionNodeUtil.getNodeItemsToUnion(g,k)));c.call(b,d);f.setGlobal(a);f.setMessageCurtain(h.getMessageCurtain());n.setSize(800,480);return f.getJqUi()});h.setFooterPaneCreator(function(b){var c=
new na(N.get("confirm","\u786e\u5b9a"));c.setHighlight(!0);var d=c.getJqUi();d.addClass("sa-ctrl-dialog-footer-ok");d.appendTo(b);c.addActionListener(function(g){e&&e(f.getSelectedNodeItem());h.destroy()});c=new na(N.get("cancel","\u53d6\u6d88"));c.setHighlight(!1);d=c.getJqUi();d.addClass("sa-ctrl-dialog-footer-cancel");d.appendTo(b);c.addActionListener(function(g){h.destroy()})});h.setClosingAction(function(b){})})();this.setConfirmCallback=function(b){e=b};this.setGlobal=function(b){a=b}}function Na(){Ua.call(this);
var B;this.setErrorDesc=function(h){B=h};this.protectedInit=function(h,n,e){h.css("left","0px");B?(n=ra.createWarning(),n.addClass("modeler-designer-node-selection-item-error"),n.attr("title",B),h.append(n)):(n.css("left","0px"),e.css("margin-left","22px"))}}ab.call(this,t);var Za=this.protectedMethod,hb,ba,Sa,Ya,kb,Ib;this.protectedUpdateUi=function(){var B=Ya.getNodeItems();for(var h=sa.ModelConverter.getUpwardNode(kb,t,!0),n=!1,e=0;e<B.length;e++){for(var f=B[e],a=f.getNodeId(),b=!1,c=0;c<h.length;c++){var d=
h[c];if(a==d.getId()){f.setAlias(sa.DisplayNameHelper.getNodeDisplayName(d));b=!0;break}}f.setExist(b);n||b||(n=!0)}B=n;h=Ya.getNodeItems();Wa(h,0,B)};this.protectedInitUi=function(B){hb=B;Ya=t.getConfig();kb=Za.getGlobal().getModelerModel();Sa=new Q;B=Sa.getJqUi();hb.append(B);Ma.layoutCtrlWithLRTB(B,0,0,null,31,null,30);Sa.hide();ba=$("<div>");Ma.layoutCtrlWithLRTB(ba,10,10,null,60,null,null);hb.append(ba)};var Wa=function(B,h,n){if(B.length==h||n)U(n);else{var e=kb.getNode(B[h].getNodeId());sa.NodeFieldHelper.asynGetFields(kb,
e,function(f){f||(f=[]);n=!Ya.checkFieldExist(h,f);Wa(B,h+1,n)})}},jb=function(B){Ib=pb(Ya);for(var h=B.getSelectedUnionItem(t.getFieldSettingConfig()),n=t.getId(),e=Ib,f=0;f<h.length;f++){var a=h[f],b=new P;b.setName(a.getName());b.setFromNode(n);var c=e.getFieldNumberMapItem(b.getFullName());if(c)a=c.getNumber();else{var d=a.getBaseField().getFromNode();a=(d=kb.getNode(d))&&d.canGenerateNewField()?a.getAlias():a.getName()}c=c?c.isManualModified():!1;sa.FieldNumberHelper.generateDefaultNumberByAssignedName(b,
a,c,!0)}B.setUnionItems(h);B=pb(B);if(n=B.getFieldSettingConfig()){e=[];f=Ib.getUnionConfig().getUnionItems();for(b=0;b<f.length;b++){c=f[b];a=!1;for(d=0;d<h.length;d++)if(h[d].getName()==c.getName()){a=!0;break}a&&(a=new P,a.setName(c.getName()),a.setFromNode(t.getId()),(c=n.getModifiedFieldByFullName(a.getFullName()))&&e.push(c))}n.setModifiedField(e,!0)}Za.doConfigChangeAction(B,S,db)},pb=function(B){var h=new H;h.setUnionConfig(B);(B=t.getFieldSettingConfig())&&h.setFieldSettingConfig(B.copy());
B=kb.removeFieldNumber(t).slice();h.setFieldNumberMapItems(B);return h},S=function(){kb.removeFieldNumber(t);return Ib.copy()},db=function(B){var h=B.getUnionConfig();Ya.setNodeItems(h.getNodeItems());Ya.setUnionItems(h.getUnionItems());kb.restoreFieldNumber(B.getFieldNumberMapItems());t.setFieldSettingConfig(B.getFieldSettingConfig(),!0);Ib=B;Ya.firePropertyChangeEvt()},U=function(B){Sa.show();B?Sa.showWarningWhenSetting():Sa.showNormalSetting();ba.empty();B=Ya.getNodeItems();for(var h=$(document.createDocumentFragment()),
n=0;n<B.length;n++){var e=B[n],f=new Na;e.isExist()||f.setErrorDesc(N.get("invalidSourcePrompt","\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664"));f.setNodeItem(e);h.append(f.getJqUi())}ba.append(h)}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});
"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});var sa=com.kingdee.bos.qing.modeler.designer;sa.PropertyArea=function(){var t=this,H,Q,Ta,ca,va,Na={},Za,hb=!1,ba;this.getJqUi=function(){H||Sa();return H};this.setNodeStatusMonitor=function(U){Ta&&Ta.removeSelectNodeListener(Ya);Ta&&Ta.removeInvalidNodeChangeListener(kb);Ta=U;Ta.addSelectNodeListener(Ya);Ta.addInvalidNodeChangeListener(kb)};this.setGlobal=function(U){ca=U;U=Object.keys(Na);for(var B=
0;B<U.length;B++)Na[U[B]].setGlobal(ca)};this.setModelerModel=function(U){va&&va.removePropertyChangeCallback(jb);va=U;va.addPropertyChangeCallback(jb);Na={}};this.setHideListener=function(U){Za=U};this.show=function(U){hb!=!U&&(hb=!U,hb||(db(),Ib(Ta.getSelected())))};var Sa=function(){H=$("<div>");H.addClass("modeler-designer-workarea");H.addClass("modeler-designer-common-border");var U=$("<div>");U.addClass("modeler-designer-workarea-title");var B=$("<div>");B.addClass("modeler-designer-workarea-title-text");
B.text(N.get("properties","\u5c5e\u6027"));U.append(B);Q=$("<div>");Q.addClass("modeler-designer-workarea-container");B=$("<div>");Qa.backgroundWithHover(B,"rightArrow");Ma.layoutCtrlWithLRTB(B,null,5,16,5,null,16);B.on("click",function(){hb=!0;Za&&Za()});B.css("cursor","pointer");B.appendTo(U);H.append(U);H.append(Q)},Ya=function(U,B){db();hb||Ib(B)},kb=function(U){t.afterResize()},Ib=function(U){if(U){var B=Wa(U),h=B.getJqUi();Ma.layoutCtrlWithLRTB(h,0,0,null,0,0,null);Q.append(h);U.getType()===
r.TYPE_CUSTOM_GROUP&&B.clearCache();B.updateUi();ba=B}},Wa=function(U){if(U){var B=U.getId(),h=Na[B];h||(h=aa.createPanel(U),h.setGlobal(ca),Na[B]=h);return h}},jb=function(U,B){if(U==G.KEY_REMOVE_NODE){U=B.getRemovedNode();var h=Na[U.getId()];h&&h.getJqUi().remove();Na[U.getId()]=void 0;(B=B.getDownwardNode())&&S(B)}else if(U==G.KEY_LINK_NODE||U==G.KEY_ADD_NODE||U==G.KEY_BREAK_LINK)S(B);else if(U==G.KEY_NODE_CHANGE_ALIAS)B instanceof M&&pb(B),(ba instanceof sb||ba instanceof wb)&&ba.updateUi();else if(0==
U.indexOf(G.KEY_CHANGE_TRANSFORM_CONFIG)||U==za.KEY_TABLE_NODE_SELECT_FIELD)pb(B);else if(U==za.KEY_UPDATE_TABLE)for(U=0;U<B.length;U++)pb(B[U])},pb=function(U){ba&&U&&ba.getCurrentNodeId()==U.getId()&&ba.updateUi()},S=function(U){if(ba){var B=va.getNode(ba.getCurrentNodeId());B&&-1<sa.ModelConverter.getUpwardNode(va,B,!1).indexOf(U)&&ba.updateUi()}},db=function(){ba=null;for(var U=Object.keys(Na),B=0;B<U.length;B++){var h=Na[U[B]];h&&h.getJqUi().detach()}};this.afterResize=function(){var U=Ta.getSelected();
(U=Wa(U))&&U.getJqUi()&&U.updateUi()}};sa.SelectFieldDialog=Jb;var N,Ma,Mb,ra,Z,Ka,ta,O,R,na,ja,X,J,wa,La,Oa,Ha,Qa,r,M,P,G,za,ea,fa,W,C,ia,ha,$a,Ia,ka,Ga,la,da,z,ua,Ra,Ja,Ua,mb,Gb,Va,ob,Bb,Db,Hb,qb,Cb,ma,xa,ib,Pb;(function(){var t=com.kingdee.bos.qing.framework.common;N=t.MultilanguageManager.createPackageAccessor(sa);t=com.kingdee.bos.qing.common;Ma=t.DomUtil;t=com.kingdee.bos.qing.common.ui;Mb=t.TableUtil;ra=t.CommonIconUtil;t=com.kingdee.bos.qing.ui.component;Z=t.Label;Ka=t.TextField;ta=t.CheckBox;
O=t.ComboBox;xa=t.SearchBox;J=t.AbstractModalDialog;wa=t.MenuModel;La=t.Menu;ja=t.Spinner;ib=t.List;X=t.SplitPane;Oa=t.RadioButtonGroup;Ha=t.RadioButton;R=t.WorkButton;na=t.Button;Qa=sa.Icons;M=sa.TableNode;za=sa.ModelerModel;r=sa.Config;P=sa.Field;ea=sa.ActionNodeRename;fa=sa.ActionChangeConfig;G=sa.TableModeler;Bb=sa.JoinConfigPanel;W=sa.GroupFieldItem;C=sa.DateGroupType;ia=sa.AggregateFieldItem;ha=sa.CalculateByDateType;$a=sa.SortItem;Ia=sa.FilterItem;ka=sa.FilterConfigDialog;ma=sa.FormulaEditorDialog;
Ga=sa.ColumnToRowConfigDialog;la=sa.FieldItemUI;da=sa.SelectFieldFactory;z=sa.SelectFieldPanel;Hb=sa.CustomGroupSelectFieldPanel;Db=sa.CustomGroupFactory;qb=sa.CustomGroupConfig;Cb=sa.NumberGroupItem;ua=sa.NoDataView;Ra=sa.CalculatedField;ob=sa.DesignerFacade;Pb=sa.AbstractModelerSource;Ja=sa.UnionConfigFieldMappingPane;Ua=sa.NodeItemUi;mb=sa.UnionConfigSelectNodePane;Gb=sa.NodeItem;Va=sa.UnionConfig})();var aa=new function(){this.createPanel=function(t){if(t instanceof M){var H=new Ca;H.setNode(t)}else t&&
(H=Y.createPanel(t));return H}},Y=new function(){this.createPanel=function(t){switch(t.getType()){case r.TYPE_JOIN:return new sb(t);case r.TYPE_FIELD_SELECT:return new vb(t);case r.TYPE_FIELD_SETTING:return new Ab(t);case r.TYPE_GROUP_BY:return new Nb(t);case r.TYPE_CUSTOM_GROUP:return new Yb(t);case r.TYPE_SORT:return new Fa(t);case r.TYPE_FILTER:return new Aa(t);case r.TYPE_COLUMN_TO_ROW:return new ub(t);case r.TYPE_CALCULATED_FIELD:return new nb(t);case r.TYPE_UNION:return new wb(t)}}}})();(function(){function qa(){var la,da,z,ua,Ra,Ja,Ua,mb;this.setTableArea=function(ma){};this.setGlobal=function(ma){Ua=ma};this.getGlobal=function(){return Ua};this.setRemoteImpl=function(ma){};this.setModelerModel=function(ma){da&&da.removePropertyChangeCallback(ob);da=ma;da.addPropertyChangeCallback(ob);Gb()};this.getJqUi=function(){if(!la){la=$("<div>");la.addClass("modeler-designer-workarea");la.addClass("modeler-designer-common-border");var ma=$("<div>");ma.addClass("modeler-designer-workarea-title");
var xa=$("<div>");xa.addClass("modeler-designer-workarea-title-text");xa.text(J.get("source","\u6570\u636e\u6e90"));ma.append(xa);xa=$("<div>");xa.addClass("modeler-designer-workarea-title-btn");ka.backgroundWithHover(xa,"add");xa.on("click",Va);xa.attr("title",J.get("selectDataSource","\u9009\u62e9\u6570\u636e\u6e90"));xa.appendTo(la);z=$("<div>");z.addClass("modeler-designer-workarea-container");ua=new r;ua.setBorderVisible(!1);ua.setToggleSelectingEnabled(!1);ua.setCustomItemPainter(Db);ua.setCustomSelectedsPainter(Hb);
ua.addSelectedChangedListener(qb);Ra=ua.getJqUi();Ra.appendTo(z);X.layoutCtrlWithLRTB(Ra,0,0,null,0,0,null);la.append(ma);la.append(z);Gb()}return la};this.showDialogIfNoSource=function(){var ma=da.getAllSource();if(!ma||0==ma.length){var xa=Va();ma=new wa;ma.setCallbackImmediately(function(){xa.updateTable()});ma.observe()}};var Gb=function(){if(da){var ma=da.getAllSource();ua.setItemModels(ma);if(ma&&0!=ma.length){Ja&&Ja.hide();var xa=!1,ib=ua.getSelecteds();if(ib)for(var Pb=0;Pb<ib.length;Pb++)for(var aa=
ib[Pb],Y=0;Y<ma.length;Y++){var t=ma[Y];if(t==aa){xa=!0;1===ma.length&&(ib.push(null),ua.setSelecteds([t]));break}}xa||ua.setSelecteds([ma[0]]);Ra.show()}else Ra.hide(),Ja||(Ja=$("<div>"),Ja.appendTo(la),Ja.addClass("modeler-designer-sourcearea-nosource"),ma=$("<div>"),ma.appendTo(Ja),ka.background(ma,"no_data_cloud"),X.layoutCtrlCenterAlign(ma,138),X.layoutCtrl(ma,null,0,null,78),ma=$("<div>"),ma.text(J.get("selectDataSource","\u9009\u62e9\u6570\u636e\u6e90")),ma.attr("title",J.get("selectDataSource",
"\u9009\u62e9\u6570\u636e\u6e90")),ma.on("click",Va),ma.appendTo(Ja),ma.addClass("modeler-designer-sourcearea-text-add")),Ja.show()}},Va=function(){var ma=new Ca;ma.setGlobal(Ua);ma.setSelectedCallback(Bb);ma.setModeler(da);ma.showDialog();return ma},ob=function(ma){if(ma==N.KEY_ADD_PREPARED_SOURCE||ma==N.KEY_REMOVE_PREPARED_SOURCE||ma==N.KEY_SET_PREPARED_SOURCE)console.log("update source area ui"),Gb()},Bb=function(ma,xa){if(ma&&0!=ma.length||xa&&0!=xa.length){var ib=new ta;ib.setValue(ma,xa,da);
Ua.getCommandManager().perform(ib)}},Db=function(ma,xa){ma.css("height","30px");ma.css("cursor","pointer");var ib=xa.getSourceType();if(ib){var Pb=xa.getName();Pb||(Pb=Ga.createSourceNameByType(ib),xa.setName(Pb));ma.attr("name",Pb);var aa=0,Y=Ua.getIntegration().getMapSourcePermission();if(Y)for(var t=Object.keys(Y),H=0;H<t.length;H++)if(t[H]===xa.getSourceId()){t=Y[t[H]];if(!t)break;Y=t.errorCode;Y!=qa.CURRENT_USER_NOPERMISSION_PUBLIC_SOURCE_ERRORCODE&&Y!=qa.CURRENT_USER_NOPERMISSION_DATACENTER_ERRORCODE&&
(aa=Ga.createExceptionIcon(t.errorMessage),aa.addClass("modeler-designer-sourcearea-exception-icon"),aa.appendTo(ma),aa=22);ma.data("errorCode",Y);break}Y=$("<div>");Y.addClass("modeler-designer-sourcearea-icon");Y.css("top","9px");ka.background(Y,Ga.getSourceIconName(ib));Y.css("left",12+aa+"px");Y.appendTo(ma);Y=$("<div>");Y.text(Pb);Y.addClass("modeler-designer-sourcearea-name");Y.css("left",34+aa+"px");Y.attr("title",J.get("name","\u540d\u79f0")+"\uff1a"+Pb+"\n"+J.get("type","\u7c7b\u578b")+"\uff1a"+
Ga.translateSourceType(ib));Y.appendTo(ma)}else Ga.updateDeletedSourceStatus(ma);var Q=$("<div>");Q.addClass("modeler-designer-sourcearea-delete-btn");Q.on("mousedown",function(Ta){Ta.stopPropagation();da.isSourceUsed(xa)?Ua.getMessageCurtain().showPrompt(J.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")):
Cb().setClosingChecker(function(ca){ca==W.RETURN_OK&&(ca=new Ka,ca.setValue(xa,da),Ua.getCommandManager().perform(ca),ma.is(mb)&&Jb.SourceConnectStep.removeTableTree(),ma.remove());return!0})});ka.backgroundWithHover(Q,"delete");Q.appendTo(ma);Q.hide();ma.mouseenter(function(){Q.show()}).mouseleave(function(){Q.hide()})},Hb=function(ma,xa){xa&&0<xa.length&&(ma&&0<ma.length&&(ma=ma[0],ma.css("background-color",""),ma.css("color","")),xa=xa[0],xa.css("background-color","#eff3fd"),xa.css("color","rgb(130, 130, 130)"))},
qb=function(ma,xa,ib){ma=ib[0];mb=xa=ua.getItemUiByModel(ma);Jb.ConnectSourceCreator.getSourceConnector(ma,xa).getFunConnectSource()()},Cb=function(){var ma=W.createFeedbackDialog();ma.setMsgImageType(W.MSG_DELETE);ma.setOptionType(W.OPTION_OK_CANCEL);ma.setMessage(J.get("confirmDeleteSource","\u786e\u5b9a\u5220\u9664\u8be5\u6570\u636e\u6e90\u5417\uff1f"));ma.showDialog();return ma}}function Ca(){Oa.call(this);var la=this,da=this.protectedMethod,z,ua,Ra,Ja;(function(){da.setTitle(J.get("selectDataSource",
"\u9009\u62e9\u6570\u636e\u6e90"));la.setSize(791,600);da.setSelectable(!0);da.setContentPaneCreator(function(){z=new ab;z.setRemoteImpl(Jb.ModelSetSourceIntegration.getRemoteImpl());var mb=$("<div>");z.setArrExistsSource(Ra.getAllSource());z.setContainer(mb);z.setMultiSelect(!0);z.loadDataSource();return mb});da.setFooterPaneCreator(function(mb){var Gb=new La(J.get("confirm","\u786e\u5b9a"));Gb.setHighlight(!0);var Va=Gb.getJqUi();Va.addClass("sa-ctrl-dialog-footer-ok");Va.appendTo(mb);Gb.addActionListener(function(ob){ob=
z.getSelected();z.getTable()?Ua(ob):da.destroy()});Gb=new La(J.get("cancel","\u53d6\u6d88"));Gb.setHighlight(!1);Va=Gb.getJqUi();Va.addClass("sa-ctrl-dialog-footer-cancel");Va.appendTo(mb);Gb.addActionListener(function(ob){da.destroy();return!0})});da.setClosingAction(function(mb){})})();this.setGlobal=function(mb){Ja=mb};this.updateTable=function(){var mb=$(document.body),Gb=mb.prop("clientWidth");mb=mb.prop("clientHeight");Gb=Math.max(0,Gb-791>>1);mb=Math.max(0,mb-600>>1);da.getDialogCtrl().setBounds(Gb,
mb,791,600);z.updateUiByObserver()};this.setSelectedCallback=function(mb){ua=mb};this.setModeler=function(mb){Ra=mb};var Ua=function(mb){(new (Jb.ModelSetSourceIntegration.getModelSetSourceFacade())(Jb.ModelSetSourceIntegration.getRemoteImpl(),function(Gb){for(var Va,ob=0,Bb=0;Bb<mb.length;Bb++){for(var Db=!1,Hb=0;Hb<Gb.length;Hb++)if(mb[Bb].getId()==Gb[Hb].id){Db=!0;break}Db||(ob++,1==ob&&(Va=mb[Bb].getSourceName()))}if(0<ob){z.rePaintSource(Gb);if(1<ob){var qb=J.get("moreSourceDeleted","\u201c#1\u201d\u7b49#N\u4e2a\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");
qb=qb.replace("#N",""+ob)}else qb=J.get("sourceDeleted","\u201c#1\u201d\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");qb=qb.replace("#1",Va);da.getMessageCurtain().showPrompt(qb)}else{ob=0;Va=[];Gb=Ra.getAllSource();for(Bb=0;Bb<Gb.length;Bb++){Db=Gb[Bb];Hb=!1;for(var Cb=mb.length-1;0<=Cb;Cb--)Db.getSourceId()===mb[Cb].getId()&&(Hb=!0,mb.splice(Cb,1));Hb||(Ra.isSourceUsed(Db)?(ob++,1===ob&&(qb=Db.getName())):Va.push(Db))}if(0<ob)1<ob?(Va=J.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"),Va=Va.replace("#N",""+ob)):Va=J.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"),
Va=Va.replace("#1",qb),da.getMessageCurtain().showPrompt(Va),z.rePaintSource();else{if(Ja.getIntegration()&&(qb=Ja.getIntegration().getMapSourcePermission()))for(ob=Object.keys(qb),Gb=0;Gb<mb.length;Gb++)for(Bb=0;Bb<ob.length;Bb++)if(ob[Bb]==mb[Gb].getId()){qb[ob[Bb]]=null;break}qb=[];for(ob=0;ob<mb.length;ob++)Gb=new nb,Gb.setName(mb[ob].getSourceName()),Gb.setSourceType(mb[ob].getSourceType()),Gb.setId(Jb.UIDHelper.getUID(Jb.UIDHelper.NS_SOURCE)),Gb.setSourceId(mb[ob].getId()),Gb.setModelId(Jb.ModelSetSourceIntegration.getModelId()),
qb.push(Gb);ua&&ua(qb,Va);da.destroy()}}})).designerLoadSources()}}function cb(la,da,z){Oa.call(this);var ua=this,Ra=this.protectedMethod,Ja,Ua,mb,Gb,Va,ob=[],Bb,Db,Hb,qb;(function(){da?Ra.setTitle(J.get("EditSQL","\u7f16\u8f91SQL/KSQL")):Ra.setTitle(J.get("customSQL","\u81ea\u5b9a\u4e49SQL/KSQL"));ua.setSize(590,450);Ra.setSelectable(!0);var Cb=function(){Ra.destroy()},ma=function(){mb.setTableName(Ja.getText().trim());mb.setDisplayName(Ja.getText());var xa=new ra,ib=Bb.isChecked()?"SQL":"KSQL";
xa.setSqlType(ib);xa.setContent(Ua.getText());mb.setUserSql(xa);(new wb(la,function(Pb){for(Pb=0;Pb<ob.length;Pb++)(0,ob[Pb])(mb,Gb);Cb()},function(Pb,aa){Ra.getMessageCurtain().showError(aa);return!0})).checkUserSqlExecutable(ib,Ua.getText(),Va.getSourceId(),mb.getNamespace())};Ra.setContentPaneCreator(function(){var xa=$("<div>"),ib=new ia;ib.setText(J.get("name","\u540d\u79f0"));ib=ib.getJqUi();Ja=new ha;mb.getTableName()&&Ja.setText(mb.getTableName());var Pb=Ja.getJqUi(),aa=new Ha;Bb=new Qa;Bb.setText("SQL");
Bb.setChecked(!0);Db=new Qa;Db.setText("KSQL");aa.addElement(Bb);aa.addElement(Db);aa=Bb.getJqUi();var Y=Db.getJqUi(),t=new ia;t.setText(J.get("SQLContent","\u5185\u5bb9"));t=t.getJqUi();Ua=new $a;if(mb&&mb.getUserSql()){var H=mb.getUserSql();"KSQL"==H.getSqlType()&&Db.setChecked(!0);Ua.setText(H.getContent())}H=Ua.getJqUi();xa.append(ib);xa.append(Pb);xa.append(aa);z&&xa.append(Y);xa.append(t);xa.append(H);var Q=12;X.layoutCtrl(ib,10,Q,80,23);X.layoutCtrl(Pb,90,Q,420,23);X.layoutCtrl(t,10,Q+=50,
80,23);X.layoutCtrl(aa,90,Q,80,23);X.layoutCtrl(Y,170,Q,80,23);X.layoutCtrl(H,90,Q+50,420,200);return xa});Ra.setFooterPaneCreator(function(xa){var ib=new La(J.get("confirm","\u786e\u5b9a"));ib.setHighlight(!0);var Pb=ib.getJqUi();Pb.addClass("sa-ctrl-dialog-footer-ok");Pb.appendTo(xa);ib.addActionListener(function(aa){aa="";var Y=Ja.getText().trim(),t=Ua.getText().toLowerCase();0==Y.length?aa=J.get("nameIsEmptyPrompt","\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a\u3002"):50<Y.length?aa=J.get("nameTooLongPrompt",
"\u540d\u79f0\u4e0d\u53ef\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"):0<Y.indexOf(" ")?aa=J.get("nameWithSpace","\u540d\u79f0\u4e0d\u80fd\u643a\u5e26\u7a7a\u683c\u3002"):/^[\u4E00-\u9FA5A-Za-z0-9_]+$/.test(Y)?t&&""!=$.trim(t)?0!=t.trim().toLowerCase().indexOf("select")?aa=J.get("onlyAllowSelection","\u53ea\u5141\u8bb8\u67e5\u8be2\u64cd\u4f5c\u3002"):-1==t.indexOf("from")&&-1==t.indexOf("FROM")&&(aa=J.get("sqlError","sql\u6267\u884c\u51fa\u9519\uff0c\u8bf7\u68c0\u67e5sql\u8bed\u53e5\u3002")):aa=J.get("noQuery",
"\u8bf7\u8f93\u5165\u67e5\u8be2\u8bed\u53e5\u3002"):aa=J.get("invalidName","\u540d\u79f0\u53ea\u80fd\u4f7f\u7528\u4e2d\u6587\u3001\u6570\u5b57\u3001\u5b57\u6bcd\u6216\u4e0b\u5212\u7ebf\u3002");0<aa.length?Ra.getMessageCurtain().showPrompt(aa):(aa=Ja.getText().trim(),da?(Y=Gb.getTableName(),aa=Hb(aa,Y)):aa=Hb(aa,void 0),aa?Ra.getMessageCurtain().showPrompt(J.get("duplicateNameTips","\u540d\u79f0\u91cd\u590d\u3002")):qb&&qb(ma,Cb,da))});ib=new La(J.get("cancel","\u53d6\u6d88"));ib.setHighlight(!1);
Pb=ib.getJqUi();Pb.addClass("sa-ctrl-dialog-footer-cancel");Pb.appendTo(xa);ib.addActionListener(function(aa){Ra.destroy();return!0})});Ra.setClosingAction(function(xa){})})();this.setModel=function(Cb){mb=Cb;da&&(Gb=Cb.clone())};this.getModel=function(){return mb};this.setSource=function(Cb){Va=Cb};this.addConfirmListener=function(Cb){ob.push(Cb)};this.setTableNameChecker=function(Cb){Hb=Cb};this.setPermAndConnChecker=function(Cb){qb=Cb}}function ab(){function la(ba){KTDefaultCellRender.call(this,
ba);var Sa=this,Ya=this.paintCellUI;this.paintCellUI=function(jb,pb){var S=Sa.getCurrentRowIdx(),db=Sa.getCurrentRow(),U=Sa.getCurrentColIdx();db=db.getUserObject();var B=new G;B.setFormatString("yyyy-MM-dd HH:mm:ss");Sa.setPaddingHV(8,1);if(S<P.getHeadRowCount()){if(Ya(jb,pb),0===U&&1===S){if(!xa)return;db=Db&&Db.isChecked();Db=new za;Db.setChecked(db);Db.addCheckedListener(function(e,f){if(f){f=Object.keys(Hb);for(var a=0;a<f.length;a++)Hb[f[a]].setChecked(e.isChecked())}});db=Db.getJqUi();X.layoutCtrl(db,
12,0,14,18);db.appendTo(jb)}}else if(0===U)db=xa?Ib(db):Wa(db),X.layoutCtrl(db,12,4,14,18),db.appendTo(jb);else if(1===U){B=$("<div class='modeler-designer-addsource-name-info'>");S=$("<span class='modeler-designer-addsource-cell-item-name'>");U=db.getSourceName();var h=db.getErrorMessage(),n=kb(db);h&&(h=Ga.createExceptionIcon(h),X.layoutCtrlWithLRTB(h,5,null,16,8,null,16),h.appendTo(B),n.css("margin-left","23px"));n.appendTo(B);U||(U=db.getSourceType(),U=Ga.createSourceNameByType(U),db.setSourceName(U));
ma&&""!=$.trim(Bb.getText())?hb(S,U,$.trim(Bb.getText())):S.text(U);S.attr("title",U);S.appendTo(B);B.appendTo(jb)}else 2===U?(B=$("<div class='modeler-designer-addsource-cell-item'>"),U=Ga.translateSourceType(db.getSourceType()),ma&&""!=$.trim(Bb.getText())?hb(B,U,Bb.getText()):B.text(U),B.attr("title",U),B.appendTo(jb)):3===U?(B=$("<div class='modeler-designer-addsource-cell-item'>"),db=db.getCreatorName(),ma&&""!=$.trim(Bb.getText())?hb(B,db,Bb.getText()):B.text(db),B.attr("title",db),B.appendTo(jb)):
4===U&&(S=$("<div class='modeler-designer-addsource-cell-item'>"),db=db.getCreateTime(),db=B.format(db),S.text(db),S.attr("title",db),S.appendTo(jb));Ya(jb,pb)};var kb=function(jb){var pb=$("<span>");pb.addClass("modeler-designer-addsource-source-icon");switch(jb.getSourceType()){case Fa.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:jb="entity-source-icon";break;case Fa.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:jb="datacenter-source-icon";break;case Fa.SOURCE_TYPE_MODEL_SET_SOURCE:jb="modelset-source-icon";break;
case Fa.SOURCE_TYPE_OPEN_API_SOURCE:jb="openapi-source-icon";break;default:if(jb.getSpecificType())jb=jb.getSpecificType().toLowerCase();else throw Error("unknown type");}ka.background(pb,jb);return pb},Ib=function(jb){var pb=jb.getErrorMessage(),S=jb.getId(),db=new za,U=!1,B=db.getJqUi(),h=!1;if(0<Cb.length)for(var n=Cb.length-1;0<=n;n--)if(S===Cb[n].getSourceId()){h=U=!0;break}if(!h&&pb)return db.setEnabled(!1),db.setChecked(U),B;pb=Object.keys(Hb);for(h=0;h<pb.length;h++)if(S===pb[h]){U=Hb[pb[h]].isChecked();
break}Hb[S]=db;db.setChecked(U);db.setUserObject(jb);db.addCheckedListener(function(e){e=e.isChecked();var f=Object.keys(Hb);if(e)for(var a=0;a<f.length;a++)if(!Hb[f[a]].isChecked())return;Db.setChecked(e)});return B},Wa=function(jb){var pb=new Qa,S=!1,db=pb.getJqUi();if(jb.getErrorMessage())pb.setEnabled(!1),db.children().eq(0).css("background-color","#ddd");else{for(var U=jb.getId(),B=Object.keys(Hb),h=0;h<B.length;h++)U===B[h]&&(S=Hb[B[h]].isChecked());Hb[U]=pb;pb.addCheckedListener(function(n,
e){if(e&&n.isChecked())for(n=0;n<B.length;n++)U!=B[n]&&Hb[B[n]].setChecked(!1)})}pb.setChecked(S);pb.setUserObject(jb);return db}}var da,z,ua,Ra,Ja,Ua,mb,Gb,Va,ob,Bb,Db,Hb={},qb=[],Cb,ma=!1,xa,ib=!1;this.setMultiSelect=function(ba){xa=ba};this.setContainer=function(ba){Gb=ba};this.setArrExistsSource=function(ba){Cb=ba};this.getJqUi=function(){da||Za();return da};this.setRemoteImpl=function(ba){Va=ba};this.getTable=function(){return ob};this.getSelected=function(){for(var ba=Object.keys(Hb),Sa=[],
Ya=0;Ya<ba.length;Ya++){var kb=Hb[ba[Ya]];if(kb.isChecked()&&(Sa.push(kb.getUserObject()),!xa))break}return Sa};this.updateUiByObserver=function(){ib&&(0===qb.length?va():Q(qb))};this.rePaintSource=function(ba){ba?Pb(ba):(Q(qb),xa&&Na())};var Pb=function(ba){if(0==ba.length)Hb={},qb=[],Ra&&Ra.css("right","15px"),Ua&&(Ua.hide(),Bb.clear()),da&&da.remove(),va();else{ua&&ua.hide();Ua&&Ua.show();Bb&&Bb.clear();Ra&&Ra.css("right","205px");qb=[];Hb={};for(var Sa=0;Sa<ba.length;Sa++){var Ya=new Z;Ya.fromJsonObject(ba[Sa]);
qb.push(Ya)}Q(qb);xa&&Na()}},aa=function(){Ra=$("<div>");Ra.attr("title",J.get("refresh","\u5237\u65b0"));ka.backgroundWithHover(Ra,"refresh");Ra.addClass("modeler-designer-addsource-btn-refresh");Ra.on("click",Y);Ra.appendTo(Gb)},Y=function(){(new (Jb.ModelSetSourceIntegration.getModelSetSourceFacade())(Va,function(ba){Pb(ba)})).designerLoadSources()},t=function(){Ua=$("<div>");Ua.css("display","flex");var ba=$("<div class = 'modeler-designer-addsource-modelset-source-link'>");ba.text(J.get("modelSetSourceManage",
"\u6570\u636e\u6e90\u7ba1\u7406"));ba.attr("title",J.get("modelSetSourceManage","\u6570\u636e\u6e90\u7ba1\u7406"));ba.on("click",function(){na&&na.occur(na.BUTTON_TYPE,na.SOURCE_MANAGE);Jb.ModelSetSourceIntegration.getDataSourceManageEntrance()()});ba.appendTo(Ua);ba=new fa;ba.setIconType(fa.ICON_TYPE_QUESTION);ba.setTipsSize(380,54);var Sa=ba.getJqUi();Sa.css("position","relative");var Ya="<span>"+J.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>";ba.setTipsHtml(Ya);Sa.appendTo(Ua);Ta();Ua.appendTo(Gb)},H=function(ba){if(""===ba)ma&&(ma=!1,Q(qb));else{ma=!0;ba=ba.toLowerCase();for(var Sa=[],Ya=0;Ya<qb.length;Ya++){var kb=qb[Ya],Ib=kb.getSourceName(),Wa=kb.getSourceType(),jb=Ga.translateSourceType(Wa),pb=kb.getCreatorName();Ib||(Ib=Ga.createSourceNameByType(Wa));-1==Ib.toLowerCase().indexOf(ba)&&-1==jb.toLowerCase().indexOf(ba)&&-1==pb.toLowerCase().indexOf(ba)||Sa.push(kb)}Q(Sa)}},Q=function(ba){z&&z.remove();Za();if(ba&&0<ba.length){for(var Sa=
0;Sa<ba.length;Sa++)ca(ba[Sa]);Ja&&Ja.hide()}else Ja?Ja.show():(Ja=$("<div>"),Ja.addClass("modeler-designer-addsource-noresult-view-container"),ba=$("<div>"),ba.addClass("modeler-designer-addsource-noresult-view-icon"),ka.background(ba,"search-no-result"),ba.appendTo(Ja),ba=$("<div>"),ba.addClass("modeler-designer-addsource-noresult-view-tip"),ba.text(J.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),ba.appendTo(Ja),Ja.appendTo(Gb));da.appendTo(Gb);P.refresh(ob)},
Ta=function(){mb||(Bb=new M,Bb.setShowSearchIcon(!0),Bb.setPlaceholder(J.get("searchContent","\u8bf7\u8f93\u5165\u540d\u79f0/\u7c7b\u578b/\u521b\u5efa\u4eba")),Bb.setSearchListenerDelay(1E3),Bb.addSearchListener(function(){H($.trim(Bb.getText()))}),mb=Bb.getJqUi(),mb.find(":input").on("keydown",function(ba){13==(ba.keyCode||ba.which||ba.charCode)&&H($.trim(Bb.getText()))}),mb.addClass("modeler-designer-addsource-search-box"));mb.appendTo(Ua)},ca=function(ba){if(ba){var Sa=P.createRow(ob,!1),Ya=new KTBorderStyle;
Ya.setBottomBorderWidth(1);Ya.setBottomBorderPen("solid");Ya.setBottomBorderColor("#e5e5e5");Sa.setBorder(Ya);Sa.setUserObject(ba)}},va=function(){if(ua)ua.show();else{ua=$("<div>");ua.addClass("modeler-designer-addsource-nodata-view-container");var ba=$("<div>");ba.addClass("modeler-designer-addsource-nodata-view-icon");ka.background(ba,"no_data_cloud");ba.appendTo(ua);ba=$("<div>");ba.addClass("modeler-designer-addsource-nodata-view-tip");ba.text(J.get("pleaseCreateSource","\u8bf7\u5148\u5728\u201c\u6570\u636e\u6e90\u7ba1\u7406\u201d\u4e2d\u521b\u5efa\u6570\u636e\u6e90\u8fde\u63a5\u4fe1\u606f"));
ba.appendTo(ua);ba=$("<a>");ba.addClass("modeler-designer-addsource-nodata-view-text");ba.text(J.get("modelSetSourceManage","\u6570\u636e\u6e90\u7ba1\u7406"));ba.attr("title",J.get("modelSetSourceManage","\u6570\u636e\u6e90\u7ba1\u7406"));ba.on("click",function(){Jb.ModelSetSourceIntegration.getDataSourceManageEntrance()()});ba.appendTo(ua);ua.appendTo(Gb);Ra||aa();Ra.css("right","15px")}},Na=function(){for(var ba=Object.keys(Hb),Sa=0;Sa<ba.length;Sa++)if(!Hb[ba[Sa]].isChecked()){Db.setChecked(!1);
return}Db.setChecked(!0)};this.loadDataSource=function(){(new (Jb.ModelSetSourceIntegration.getModelSetSourceFacade())(Va,function(ba){ib||(ib=!0);if(0===ba.length)va();else{Za();for(var Sa=0;Sa<ba.length;Sa++){var Ya=new Z;Ya.fromJsonObject(ba[Sa]);qb.push(Ya);ca(Ya)}P.refresh(ob);xa&&Na()}})).designerLoadSources()};var Za=function(){da=$("<div class='modeler-designer-addsource-list-table'>");ob=P.createTable();ob.setColumnFitVisibleWidth(!0);ob.addColumns(5);ob.getColumn(0).setWidth(40);ob.getColumn(1).setWidth(190);
ob.getColumn(2).setWidth(190);ob.getColumn(3).setWidth(95);ob.getColumn(4).setWidth(215);ob.setScrollerVisible("hidden");var ba=P.createHeadRow(ob);ba.getCell(1).setValue(J.get("name","\u540d\u79f0"));ba.getCell(2).setValue(J.get("type","\u7c7b\u578b"));ba.getCell(3).setValue(J.get("creator","\u521b\u5efa\u4eba"));ba.getCell(4).setValue(J.get("createTime","\u521b\u5efa\u65f6\u95f4"));ba=new la(ob);ba.setOutsideVisible(!1);ob.setCellRender(ba);ob.setSyncUIWhenModelChanged(!0);z=$(ob.getUI());z.appendTo(da);
da.appendTo(Gb);Ua||t();Ra||aa();Ra.css("right","255px")},hb=function(ba,Sa,Ya){if(ba&&Sa&&Ya){Ya=Ya.toUpperCase();for(var kb=Sa.toUpperCase(),Ib=kb.split(Ya),Wa=Ya.length,jb=0;jb<Ib.length;jb++){var pb=kb.indexOf(Ib[jb]),S=Sa.substr(0,Ib[jb].length);pb+=Ib[jb].length;var db=kb.length-pb;kb=kb.substr(pb,db);Sa=Sa.substr(pb,db);pb=$("<span>");pb.text(S);pb.appendTo(ba);jb!=Ib.length-1&&1<Ib.length&&(pb=kb.indexOf(Ya),S=Sa.substr(pb,Wa),pb+=Wa,db=kb.length-pb,kb=kb.substr(pb,db),Sa=Sa.substr(pb,db),
pb=$("<span>"),pb.text(S),pb.css("color","red"),pb.clone().appendTo(ba))}}}}function sb(la){var da,z,ua,Ra=!1,Ja=[],Ua,mb,Gb,Va=[];this.getJqUi=function(){ua||(da=new ea,da.setRootVisible(!1),da.setNodePainter(Bb),z=Cb(la),da.setRoot(z),z.setExpanded(!0),z.setSelectable(!1),da.setLineHeight(30),ua=da.getJqUi(),X.layoutCtrl(ua,0,1,"100%",118),da.addSelectingListener(ob),ua.css({top:"31px",background:"white",height:"auto",width:"100%",bottom:"30px",overflow:"hidden auto"}));return ua};var ob=function(xa,
ib){xa=da.searchUiByModel(ib);xa.attr("id","modeler-designer-tablearea-table-selected");xa.siblings().removeAttr("id")};this.scrollNodeToVisibleByName=function(xa){for(var ib,Pb=0;Pb<Va.length;Pb++)Va[Pb].getUserObject().getName()==xa&&(ib=Va[Pb]);if(xa=da.searchUiByModel(ib))xa.attr("id","modeler-designer-tablearea-table-selected"),xa.siblings().removeAttr("id"),document.querySelector(".sa-ctrl-tree").scrollTop=xa.prop("offsetTop")};this.updateExceptionNodeUi=function(xa,ib){for(var Pb=ua.children(),
aa,Y,t=0;t<Pb.length;t++){var H=Pb.eq(t),Q=H.data("model"),Ta=Q.getUserObject();if(Q.isLeafNode()&&Ta.getCommentInfo()==xa){aa=H;Y=Ta;break}}if(aa){xa=aa.children().eq(0);Pb=xa.children(".modeler-designer-tablearea-table-exception-icon");aa=0;0<Pb.length&&Pb.remove();if(ib=Ga.getModelExceptionTips(ib))aa+=20,xa.css("margin-left","20px"),Pb=Ga.createExceptionIcon(ib),Pb.addClass("modeler-designer-tablearea-table-exception-icon"),Pb.appendTo(xa);Y.setErrorMessage(ib);xa.css("margin-left",aa+"px")}};
var Bb=function(xa,ib){var Pb=function(Q){var Ta=$("<div>");X.layoutCtrlWithLRTB(Ta,"",0,50,0,0,16);var ca=$("<div class='modeler-designer-tablearea-table-name-edit'>");ka.backgroundWithHover(ca,"edit");ca.on("click",function(){mb&&mb(ib.getUserObject())});var va=$("<div class='modeler-designer-tablearea-table-name-delete'>");ka.backgroundWithHover(va,"delete");va.on("click",function(){Gb&&Gb(ib.getUserObject(),va)});Y.getErrorMessage()&&(ca.css("right","72px"),va.css("right","34px"));ca.appendTo(Ta);
va.appendTo(Ta);Ta.appendTo(Q);Ta.hide();Q.on("mouseenter",function(){Ta.show();Y.getErrorMessage()?t.css("right","90px"):t.css("right","70px")});Q.on("mouseleave",function(){Ta.hide();Y.getErrorMessage()?t.css("right","50px"):t.css("right","30px")})},aa=20*ib.getLevel();xa.css("padding-left","4px");xa.css("padding-right","4px");xa.css("width","calc(100% - "+aa+"px)");var Y=ib.getUserObject(),t=$("<div>");t.addClass("modeler-designer-tablearea-table-name");t.text(Y.getDisplayName());t.attr("title",
Y.getDisplayName());t.appendTo(xa);if(ib.isLeafNode()){aa=$("<div>");aa.addClass("modeler-designer-tablearea-table-icon");var H=Y.getUserSql()?Y.getUserSql().getSqlType():"entity"==Y.getType()?"entity-sub":"table";ka.background(aa,H);aa.appendTo(xa);xa.css("overflow","");Y.getErrorMessage()&&(xa.css("margin-left","20px"),aa=Ga.createExceptionIcon(Y.getErrorMessage()),aa.addClass("modeler-designer-tablearea-table-exception-icon"),aa.appendTo(xa));Y.getUserSql()&&(Pb(xa),Va.push(ib))}};this.doSearch=
function(xa){Ua&&Ua.hide();if(""===xa)Ra&&(qb(),Hb(),da.setRoot(z),Ra=!1);else if(ua){xa=xa.toLowerCase();Ra&&Hb();var ib=Cb(la);ib.deepFirstVisiting(function(Pb){var aa=Pb.getUserObject().getDisplayName();if(aa&&-1!=aa.toLowerCase().indexOf(xa))for(Pb=Pb.getTreePath(),aa=0;aa<Pb.length;aa++){var Y=Pb[aa];!Y.isLeafNode()&&Pb[aa+1]&&Y.setExpanded(!0);Y=Y.getUserObject();Y.setMatch(!0);Ja.push(Y)}},!1);Db(ib);da.setRoot(ib);0===Ja.length&&(Ua=$("<div>"),Ua.text(J.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),
Ua.addClass("modeler-designer-tablearea-noresult-tip"),Ua.appendTo(ua));Ra=!0}};var Db=function(xa){if(xa.isExpanded())for(var ib=xa.getAllChildren(),Pb=0;Pb<ib.length;Pb++){var aa=ib[Pb];aa.getUserObject().getMatch()?aa.isLeafNode()||Db(aa):xa.removeChild(aa)}},Hb=function(){if(0<Ja.length)for(var xa=0;xa<Ja.length;xa++)Ja[xa].setMatch(!1);Ja=[]},qb=function(){z.deepFirstVisiting(function(xa){xa!=z&&(xa.isLeafNode()||xa.setExpanded(!1))},!1)};this.setUserSqlDeleteListener=function(xa){Gb=xa};this.setUserSqlEditListener=
function(xa){mb=xa};var Cb=function(xa){var ib=new ea.BranchNode;ib.setUserObject(xa);if((xa=xa.getChildren())&&0<xa.length)for(var Pb=0;Pb<xa.length;Pb++){var aa=xa[Pb];if(aa instanceof sa){var Y=ib;aa=aa.getChildren()?Cb(aa):ma(aa);Y.addChild(aa)}else ib.addChild(ma(aa))}return ib},ma=function(xa){var ib=new ea.LeafNode;ib.setUserObject(xa);return ib};this.setSelectedNode=function(){}}function vb(la){var da,z,ua,Ra,Ja,Ua=!1,mb=[],Gb=[],Va;this.setUserSqlDeleteListener=function(qb){Ja=qb};this.setUserSqlEditListener=
function(qb){Ra=qb};var ob=function(){var qb=Ua?mb:la.getChildren();da.getJqUi().empty();da.setItemCount(qb.length);da.setItemUiCreator(Bb);da.repaint()},Bb=function(qb){var Cb=function(aa){var Y=$("<div>");X.layoutCtrlWithLRTB(Y,"",0,50,0,0,16);var t=$("<div class='modeler-designer-tablearea-table-name-edit'>");ka.backgroundWithHover(t,"edit");t.on("click",function(){Ra&&Ra(ma)});var H=$("<div class='modeler-designer-tablearea-table-name-delete'>");ka.backgroundWithHover(H,"delete");H.on("click",
function(){Ja&&Ja(ma,H)});ma.getErrorMessage()&&(t.css("right","72px"),H.css("right","34px"));t.appendTo(Y);H.appendTo(Y);Y.appendTo(aa);Y.hide();aa.on("mouseenter",function(){Y.show();ma.getErrorMessage()?ib.css("right","90px"):ib.css("right","70px")});aa.on("mouseleave",function(){Y.hide();ma.getErrorMessage()?ib.css("right","50px"):ib.css("right","30px")})},ma=(Ua?mb:la.getChildren())[qb],xa=$("<div class='modeler-designer-tablearea-dbCenter-item'>");xa.css("padding-left","4px");xa.css("padding-right",
"4px");xa.css("height","30px");xa.css("width","calc(100% - 10px)");xa.data("model",ma);xa.on("click",function(){Db(xa)});xa.on("mouseenter",function(){xa.addClass("modeler-designer-tablearea-dbCenter-table-hover")});xa.on("mouseleave",function(){xa.removeClass("modeler-designer-tablearea-dbCenter-table-hover")});var ib=$("<div>");ib.addClass("modeler-designer-tablearea-dbCenter-table-name");ib.text(ma.getDisplayName());ib.attr("title",ma.getDisplayName());ib.appendTo(xa);qb=$("<div class='modeler-designer-tablearea-dbCenter-table-icon'>");
var Pb=ma.getUserSql()?ma.getUserSql().getSqlType():"table";ka.background(qb,Pb);qb.appendTo(xa);xa.css("overflow","");ma.getErrorMessage()&&(xa.css("margin-left","20px"),qb=Ga.createExceptionIcon(ma.getErrorMessage()),qb.addClass("modeler-designer-tablearea-dbCenter-table-exception-icon"),qb.appendTo(xa));ma.getUserSql()&&Cb(xa);return xa},Db=function(qb){for(var Cb=0;Cb<Gb.length;Cb++)Gb[Cb].removeClass("modeler-designer-tablearea-table-selected");Gb=[qb];qb.addClass("modeler-designer-tablearea-table-selected")};
this.setSelectedNode=function(qb){if(qb){qb=qb.getDisplayName();for(var Cb=da.getPaintedItems(),ma=0;ma<Cb.length;ma++){var xa=Cb[ma],ib=xa.data("model");if(ib&&ib.getDisplayName()===qb){Db(xa);break}}}};var Hb=function(qb,Cb){for(var ma=0;ma<qb.length;ma++){var xa=qb[ma];if(xa.getDisplayName()===Cb)return xa}};this.updateExceptionNodeUi=function(qb,Cb){Cb=Ga.getModelExceptionTips(Cb);for(var ma=da.getPaintedItems(),xa,ib,Pb=0;Pb<ma.length;Pb++){var aa=ma[Pb],Y=aa.data("model");if(Y&&Y.getDisplayName()===
qb){xa=aa;ib=Y;break}}xa?xa&&(qb=xa.children(".modeler-designer-tablearea-dbCenter-table-exception-icon"),ma=0,0<qb.length&&qb.remove(),Cb&&(ma+=20,xa.css("margin-left","20px"),qb=Ga.createExceptionIcon(Cb),qb.addClass("modeler-designer-tablearea-dbCenter-table-exception-icon"),qb.appendTo(xa)),ib.setErrorMessage(Cb),xa.css("margin-left",ma+"px")):(xa=la.getChildren(),(ib=Hb(xa,qb))&&ib.setErrorMessage(Cb))};this.scrollNodeToVisibleByName=function(qb){var Cb=Ua?mb:la.getChildren(),ma=Hb(Cb,qb);if(ma)for(Cb=
30*Cb.indexOf(ma),da.repaint(Cb),Cb=da.getPaintedItems(),ma=0;ma<Cb.length;ma++){var xa=Cb[ma],ib=xa.data("model");if(ib&&ib.getDisplayName()===qb){Db(xa);break}}};this.setSearchClearCallBack=function(qb){Va=qb};this.doSearch=function(qb){qb=$.trim(qb).toLowerCase();ua&&ua.hide();var Cb=la.getChildren();if(0===qb.length)Ua=!1,ob();else{Ua=!0;mb=[];for(var ma=0;ma<Cb.length;ma++){var xa=Cb[ma],ib=xa.getDisplayName();ib&&-1!==ib.toLowerCase().indexOf(qb)&&mb.push(xa)}ob();0===mb.length&&(ua=$("<div>"),
ua.text(J.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),ua.addClass("modeler-designer-tablearea-noresult-tip"),ua.appendTo(z))}};this.getJqUi=function(){z||(da=new Ia,da.setItemHeight(30),z=da.getJqUi(),X.layoutCtrlWithLRTB(z,0,0,"100%",0,30,null),z.addClass("modeler-designer-tablearea-dbCenter"),Va&&Va(),ob());return z}}function Ab(){var la,da,z=Jb.SourceConnectStep.getExeSourceChangeCallback(),ua=function(){Jb.SourceConnectStep.clearTableAreaSearchBox();
var Ra=la.data("errorCode");Ra?z&&z(da,Ra):Jb.SourceConnectStep.checkSourceConnectivity(da,la)};this.setJqItem=function(Ra){la=Ra};this.getJqItem=function(){return la};this.setSource=function(Ra){da=Ra};this.getSource=function(){return da};this.getFunConnectSource=function(){return ua};this.protectedMethod={setFunConnectSource:function(Ra){ua=Ra},getFunFailCallback:function(){return z}}}function Yb(){Ab.call(this)}function Nb(){Ab.call(this);var la=this;this.protectedMethod.setFunConnectSource(function(){Jb.SourceConnectStep.checkModelSetSourceConnect(la.getSource(),
la.getJqItem());Jb.SourceConnectStep.clearTableAreaSearchBox()})}function ub(){Ab.call(this);var la=this.protectedMethod,da=this;la.setFunConnectSource(function(){Jb.SourceConnectStep.clearTableAreaSearchBox();la.getFunFailCallback()(da.getSource(),qa.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 Jb=com.kingdee.bos.qing.modeler.designer;Jb.SourceArea=qa;Jb.TableArea=function(){var la,da,z,ua,Ra,Ja,Ua,mb,Gb,Va,ob,Bb,Db,Hb,qb,Cb,ma,xa,ib,Pb,aa,Y,t,H={};this.getSearchBox=function(){return mb};this.getJqTableTree=function(){return Va};this.setTableNodeCreator=function(e){t=e};this.setGlobal=function(e){Ja=e};this.setRemoteImpl=
function(e){ua=e};this.setDragHandler=function(e){Ra=e};this.updateNodeStatus=function(e,f){Gb&&Gb.updateExceptionNodeUi(e,f)};this.getJqUi=function(){if(!la){la=$("<div>");la.addClass("modeler-designer-workarea");la.addClass("modeler-designer-common-border");Bb=$("<div>");Bb.addClass("modeler-designer-workarea-title");ob=$("<span>");ob.addClass("modeler-designer-tablearea-title-text");ob.text(J.get("table","\u8868"));Bb.append(ob);da=$("<div>");da.addClass("modeler-designer-workarea-container");
var e=$("<div>"),f=$("<div>");f.text(J.get("customSQL","\u81ea\u5b9a\u4e49SQL/KSQL"));f.attr("title",J.get("customSQL","\u81ea\u5b9a\u4e49SQL/KSQL"));var a=$("<div>");ka.backgroundWithHover(a,"add");e.append(f);e.append(a);X.layoutCtrlWithLRTB(e,0,0,null,null,0,25);X.layoutCtrlWithLRTB(f,5,null,170,5,0,18);X.layoutCtrlWithLRTB(a,null,0,18,5,0,18);X.makeTextOmissible(f);e.css({"border-top":"1px solid #e5e5e5"});a.css({cursor:"pointer"});a.on("click",Ta);Y=e;Y.hide();da.append(Y);da.appendTo(la);Sa();
la.append(Bb)}return la};this.setSource=function(e){e&&e!=z&&(z=e);H[e]=void 0;pb()};this.setExceptionSource=function(e,f){Cb=new Date;e&&e!=z&&(z=e);H[z]=f;U();Va&&Va.remove();xa&&xa.hide();jb(e,f)};var Q=function(e,f){Va&&Va.remove();f?(Gb=new vb(e),Gb.setSearchClearCallBack(function(){mb&&mb.clear()})):Gb=new sb(e);Gb.setUserSqlDeleteListener(Za);Gb.setUserSqlEditListener(va);Va=Gb.getJqUi();Va.appendTo(da);B(!1)},Ta=function(){if(H[z])return ca(H[z],!1),!0;if(h()&&!ib.getSelectPair())Ja.getMessageCurtain().showPrompt(J.get("chooseAppWarn",
"\u8bf7\u5148\u9009\u62e9\u4e00\u4e2a\u5e94\u7528\u3002"));else{var e=new wb(ua,function(a){var b=new Mb;b.setSourceUid(z.getId());var c=Jb.UIDHelper.getUID(Jb.UIDHelper.NS_TABLE);b.setUid(c);h()&&b.setNamespace(ib.getSelectPair().value);a=new cb(ua,!1,a);a.setModel(b);a.setSource(z);a.setTableNameChecker(Ya);a.setPermAndConnChecker(Na);a.addConfirmListener(function(d,g){var k=Ja.getModelerModel(),l=new O;l.setValue(d,g,k,Wa);Ja.getCommandManager().perform(l);Ja.getMessageCurtain().showSuccess(J.get("CreateSQLSuccess",
"\u65b0\u5efa\u81ea\u5b9a\u4e49SQL\u6210\u529f\u3002"))});a.showDialog()},function(a){ca(a+"",!1);return!0});if(ib&&ib.getSelectPair())var f=ib.getSelectPair().value;e.checkKSQLSupport(z.getSourceId(),f)}},ca=function(e,f){switch(e){case qa.PUBLIC_SOURCE_IS_DELETED_ERRORCODE:case qa.SOURCE_CONNECT_FAILED_ERRORCODE:case qa.SOURCE_EXCEPTION_DELETED_ERRORCODE:case qa.SOURCE_EXCEPTION_DELETED_ERRORCODE_1:f?Ja.getMessageCurtain().showPrompt(J.get("editSQLWithoutSource","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7f16\u8f91\u81ea\u5b9a\u4e49SQL/KSQL\u3002")):
Ja.getMessageCurtain().showPrompt(J.get("createSQLWithoutSource","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u65b0\u5efa\u81ea\u5b9a\u4e49SQL/KSQL\u3002"));break;default:f?Ja.getMessageCurtain().showPrompt(J.get("editWithoutPerm","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650\uff0c\u65e0\u6cd5\u7f16\u8f91\u81ea\u5b9a\u4e49SQL/KSQL\u3002")):Ja.getMessageCurtain().showPrompt(J.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=function(e){if(H[z]||e.getErrorMessage())return ca(H[z],!0),!0;var f=new wb(ua,function(b){var c=new Mb;c.setSourceUid(z.getId());c.setTableName(e.getName());c.setUserSql(e.getUserSql());h()&&c.setNamespace(e.getCommentInfo());c=Ja.getModelerModel().getSameTable(c).clone();b=new cb(ua,!0,b);b.setModel(c);b.setSource(z);b.setTableNameChecker(Ya);b.setPermAndConnChecker(Na);b.addConfirmListener(function(d,g){var k=Ja.getModelerModel(),l=new O;l.setValue(d,g,k,Wa);Ja.getCommandManager().perform(l);
Ja.getMessageCurtain().showSuccess(J.get("EditSQLSuccess","\u7f16\u8f91\u81ea\u5b9a\u4e49SQL\u6210\u529f\u3002"))});b.showDialog()},function(b){ca(b+"",!0);return!0});if(ib&&ib.getSelectPair())var a=ib.getSelectPair().value;f.checkKSQLSupport(z.getSourceId(),a)},Na=function(e,f,a){var b=J.get("createWithoutPerm","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650\uff0c\u65e0\u6cd5\u65b0\u5efa\u81ea\u5b9a\u4e49SQL/KSQL\u3002");a&&(b=J.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 wb(ua,function(c){c?e():(f(),Ja.getMessageCurtain().showPrompt(b))},function(){f();Ja.getMessageCurtain().showPrompt(b);return!0})).checkUserSqlSourcePermission(z.getSourceId())},Za=function(e,f){var a=new C;a.setText(J.get("ConfirmDeleteSQL","\u786e\u5b9a\u5220\u9664\u8be5\u81ea\u5b9a\u4e49SQL\u5417\uff1f"));a.setConfirmedListener(function(b){if(b){b=new Mb;b.setSourceUid(z.getId());b.setTableName(e.getName());b.setUserSql(e.getUserSql());h()&&b.setNamespace(e.getCommentInfo());var c=Ja.getModelerModel();
if(c.isUserSqlTableInUse(b))Ja.getMessageCurtain().showPrompt(J.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 d=new R;d.setValue(b,c,Wa);Ja.getCommandManager().perform(d);Ja.getMessageCurtain().showSuccess(J.get("DeleteSQLSuccess","\u5220\u9664\u81ea\u5b9a\u4e49SQL\u6210\u529f\u3002"))}}});a.show(f,!1)},hb=function(){xa&&xa.hide();Ua&&Ua.hide();Hb&&Hb.hide();
Va&&Va.remove();B(!0);if(qb)ba(),qb.show();else{qb=$("<div>");qb.addClass("modeler-designer-tablearea-notable-view");qb.appendTo(da);var e=$("<div>");ka.background(e,"no_data_cloud");e.addClass("modeler-designer-tablearea-notable-icon");e.appendTo(qb);Pb=$("<div>");Pb.addClass("modeler-designer-tablearea-notable-text");ba();Pb.appendTo(qb)}},ba=function(){switch(z.getSourceType()){case Fa.SOURCE_TYPE_MODEL_SET_SOURCE:Pb.text(J.get("noModelTip","\u6682\u65e0\u53ef\u7528\u7684\u6a21\u578b"));break;
default:Pb.text(J.get("noTableTip","\u6682\u65e0\u53ef\u7528\u7684\u6570\u636e\u8868"))}},Sa=function(){Ua||(mb=new M,mb.setSearchListenerDelay(1E3),mb.addSearchListener(function(){Gb&&Gb.doSearch($.trim(mb.getText()),function(){mb.clear()})}),mb.setShowSearchIcon(!0),mb.setPlaceholder(J.get("searchTable","\u8bf7\u8f93\u5165\u641c\u7d22\u5185\u5bb9")),Ua=mb.getJqUi(),Ua.addClass("modeler-designer-tablearea-search-box"),Ua.find(":input").on("keydown",function(e){13==(e.keyCode||e.which||e.charCode)&&
Gb&&Gb.doSearch($.trim(mb.getText()))}));Ua.appendTo(da)},Ya=function(e,f){for(var a=kb(),b=[],c=0;c<a.length;c++)b.push(a[c].getName());f&&b.splice(b.indexOf(f),1);return-1<b.indexOf(e)},kb=function(){for(var e=Ja.getModelerModel().getUserSqlTables(z.getId()),f=[],a=0;a<e.length;a++){var b=e[a];if(!h()||ib.getSelectPair()&&ib.getSelectPair().value&&b.getNamespace()==ib.getSelectPair().value){var c=new Aa;c.setName(b.getTableName());c.setDisplayName(b.getTableName());c.setUserSql(b.getUserSql());
c.setCommentInfo(b.getNamespace());f.push(c)}}return f},Ib=function(e){for(var f=kb(),a=0;a<f.length;a++)e.getChildren().push(f[a])},Wa=function(e){Va&&Va.remove();var f=H[z];if(f)jb(z,f);else{0<$.trim(mb.getText()).length&&mb.clear();f=new sa;var a=h();a?ib.getSelectPair()&&ib.getSelectPair().value&&f.fromJsonObject(aa,ib.getSelectPair().value):f.fromJsonObject(aa);Ib(f);Q(f,a);Ra.bindDragUi(Va,n);a&&Va.css("top","65px");e&&Gb.scrollNodeToVisibleByName(e.getTableName())}},jb=function(e,f){for(var a=
h(),b=Ja.getModelerModel().getAllTable(),c=[],d=0;d<b.length;d++)e.getId()===b[d].getSourceUid()&&c.push(b[d]);if(c&&0<c.length){switch(f){case qa.SOURCE_EXCEPTION_DELETED_ERRORCODE:var g=J.get("tableNotExist","\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664");break;case qa.PUBLIC_SOURCE_IS_DELETED_ERRORCODE:case qa.PUBLIC_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case qa.DATACENTER_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case qa.SOURCE_CONNECT_FAILED_ERRORCODE:g=J.get("tableCanNotUse","\u8be5\u6570\u636e\u6e90\u4e0b\u7684\u8868\u5747\u65e0\u6cd5\u4f7f\u7528")}e=
new sa;b=e.getChildren();for(d=0;d<c.length;d++){var k=new Aa;k.setName(c[d].getTableName());k.setDisplayName(c[d].getTableName());k.setUserSql(c[d].getUserSql());g&&k.setErrorMessage(g);b.push(k)}Q(e,a);Db&&Db.remove();switch(f){case qa.PUBLIC_SOURCE_IS_DELETED_ERRORCODE:case qa.PUBLIC_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case qa.DATACENTER_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case qa.SOURCE_CONNECT_FAILED_ERRORCODE:var l=J.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 qa.CURRENT_USER_NOPERMISSION_PUBLIC_SOURCE_ERRORCODE:case qa.CURRENT_USER_NOPERMISSION_DATACENTER_ERRORCODE:l=J.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")}l&&(Db=Ga.createExceptionIcon(l),Db.addClass("modeler-designer-tablearea-title-exception-icon"),Db.appendTo(Bb));Ua&&Ua.show()}else switch(Db&&Db.remove(),f){case qa.MODELSET_SOURCE_ALL_MODEL_CANCEL_DEPLOY_ERRORCODE:case qa.SOURCE_EXCEPTION_DELETED_ERRORCODE:case qa.PUBLIC_SOURCE_IS_DELETED_ERRORCODE:case qa.SOURCE_CONNECT_FAILED_ERRORCODE:hb();
break;case qa.CURRENT_USER_NOPERMISSION_DATACENTER_ERRORCODE:case qa.CURRENT_USER_NOPERMISSION_PUBLIC_SOURCE_ERRORCODE:case qa.DATACENTER_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case qa.PUBLIC_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:xa&&xa.hide(),Ua&&Ua.hide(),qb&&qb.hide(),B(!0),Hb?Hb.show():(Hb=$("<div>"),Hb.addClass("modeler-designer-tablearea-nopermission-view"),Hb.appendTo(da),f=$("<div>"),f.addClass("modeler-designer-tablearea-nopermission-icon"),ka.background(f,"no-permission"),f.appendTo(Hb),
f=$("<div>"),f.addClass("modeler-designer-tablearea-nopermission-text"),f.text(J.get("noPermission","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650")),f.appendTo(Hb))}},pb=function(){var e=new Date;Cb=e;if(h())Va&&Va.remove(),S();else{xa&&xa.hide();var f=new wb(ua,function(a){if(Cb===e){aa=a;var b=new sa;b.fromJsonObject(a);Ib(b);0===b.getChildren().length?hb():(Q(b,!1),Ra.bindDragUi(Va,n))}});f.setBlockingJqUi(da);z.setModelId(Jb.ModelSetSourceIntegration.getModelId());
f.loadTables(z)}U();Db&&Db.remove();Hb&&Hb.hide();qb&&qb.hide();Ua.show()},S=function(){B();xa?(xa.show(),db()):(ib=new (Jb.ModelSetSourceIntegration.getDataCenterSelector()),xa=ib.getJqUi(),xa.appendTo(da),ma=ib.getTextField(),ib.setFunSelectedChangeListener(function(e){(new wb(ua,function(f){var a=new sa;a.fromJsonObject(f,e);aa=f;Ib(a);Q(a,!0);Va.css("top","65px");Ra.bindDragUi(Va,n)})).getDBCenterTables(e)}))},db=function(){var e=ib.getSelectPair();e&&(ma.setText(e.text),ib.getFunSelectedChangeListener()(e.value))},
U=function(){switch(z.getSourceType()){case Fa.SOURCE_TYPE_MODEL_SET_SOURCE:ob.text(J.get("model","\u6a21\u578b"));break;case Fa.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:ob.text(J.get("entity","\u5b9e\u4f53"));break;case Fa.SOURCE_TYPE_MODELSET_FILE_SOURCE:ob.text(J.get("table","\u8868"));break;default:ob.text(J.get("table","\u8868"))}},B=function(e){if(e)Y&&Y.hide(),Va&&Va.css("bottom","1px");else switch(z.getSourceType()){case Fa.SOURCE_TYPE_MODEL_SET_SOURCE:case Fa.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:case Fa.SOURCE_TYPE_MODELSET_FILE_SOURCE:Y.hide();
Va&&Va.css("bottom","1px");break;default:Y.show(),Va&&Va.css("bottom","30px")}},h=function(){return z.getSourceType()===Fa.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE},n=function(e){var f=e.parent();if(f&&f.hasClass("sa-ctrl-tree-nodeline")){var a=f.data("model").getUserObject();a instanceof Aa&&f.addClass("modeler-designer-tablearea-table-item")}else f&&f.hasClass("modeler-designer-tablearea-dbCenter")?(e.addClass("modeler-designer-tablearea-table-item"),(a=e.data("model"))&&Gb.setSelectedNode(a)):e.hasClass("modeler-designer-tablearea-table-icon")||
e.hasClass("modeler-designer-tablearea-table-name")?(f=e.parents(".sa-ctrl-tree-nodeline"),a=f.data("model").getUserObject(),a instanceof Aa&&f.addClass("modeler-designer-tablearea-table-item")):e.hasClass("modeler-designer-tablearea-dbCenter-table-icon")||e.hasClass("modeler-designer-tablearea-dbCenter-table-name")?(f=e.parents(".modeler-designer-tablearea-dbCenter-item"),(a=f.data("model"))&&Gb.setSelectedNode(a),f.addClass("modeler-designer-tablearea-table-item")):e.hasClass("sa-ctrl-tree-nodeline")&&
(a=e.data("model").getUserObject(),a instanceof Aa&&e.addClass("modeler-designer-tablearea-table-item"));return X.upwardSearchHasClass(e,Va,"modeler-designer-tablearea-table-item")?(e=new Mb,e.setSourceUid(z.getId()),e.setTableName(a.getName()),a.getCommentInfo()&&e.setNamespace(a.getCommentInfo()),a.getName()&&e.setTableName(a.getName()),a.getDisplayName()&&e.setDisplayName(a.getDisplayName()),a.getUserSql()&&e.setUserSql(a.getUserSql()),(a=Ja.getModelerModel().getSameTable(e))?e=a:(a=Jb.UIDHelper.getUID(Jb.UIDHelper.NS_TABLE),
e.setUid(a)),a=t(e),f=new Ma,f.setTableNode(a),f.setTable(e),f):null}};Jb.SourceListPanel=ab;var Fa=Jb.AbstractModelerSource,Aa=Jb.LeafNode,nb=Jb.DesignTimeSource,wb,sa,N,Ma,Mb,ra,Z,Ka,ta,O,R,na,ja,X,J,wa,La,Oa,Ha,Qa,r,M,P,G,za,ea,fa,W,C,ia,ha,$a,Ia;var ka=Jb.Icons;(function(){var la=com.kingdee.bos.qing.framework.common;J=la.MultilanguageManager.createPackageAccessor(Jb);wa=la.WindowResizeObserver;la=com.kingdee.bos.qing.common;X=la.DomUtil;G=la.DateFormater;la=com.kingdee.bos.qing.ui.component;
Oa=la.AbstractModalDialog;La=la.Button;Ha=la.RadioButtonGroup;Qa=la.RadioButton;r=la.List;M=la.SearchBox;za=la.CheckBox;ea=la.Tree;fa=la.HelpIcon;W=la.MessageDialog;C=la.SimpleConfirmer;ia=la.Label;ha=la.TextField;$a=la.TextArea;Ia=la.DynamicScroller;la=com.kingdee.bos.qing.common.ui;P=la.TableUtil;wb=Jb.DesignerFacade;sa=Jb.FolderNode;N=Jb.ModelerModel;Ma=Jb.DraggingTableNode;Mb=Jb.Table;ra=Jb.UserSQL;Z=Jb.ModelSetDataSource;Ka=Jb.ActionRemoveSource;ta=Jb.ActionAddRemoveSource;O=Jb.ActionAddUserSqlTable;
R=Jb.ActionRemoveUserSqlTable;na=Jb.UserOperationReporter;ja=Jb.AbstractInvalidityCase})();qa.CURRENT_USER_NOPERMISSION_DATACENTER_ERRORCODE="20002101";qa.CURRENT_USER_NOPERMISSION_PUBLIC_SOURCE_ERRORCODE="20002102";qa.PUBLIC_SOURCE_IS_DELETED_ERRORCODE="20002103";qa.PUBLIC_SOURCE_CREATOR_NOPERMISSION_ERRORCODE="20002104";qa.DATACENTER_SOURCE_CREATOR_NOPERMISSION_ERRORCODE="20002105";qa.MODELSET_SOURCE_ALL_MODEL_CANCEL_DEPLOY_ERRORCODE="20002106";qa.SOURCE_CONNECT_FAILED_ERRORCODE="2025008";qa.SOURCE_EXCEPTION_DELETED_ERRORCODE=
"2025009";qa.SOURCE_EXCEPTION_DELETED_ERRORCODE_1="20001004";var Ga=new function(){var la=this;this.translateSourceType=function(da){switch(da){case Fa.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:return J.get("currentEntity","\u91d1\u8776\u4e91\u00b7\u82cd\u7a79-\u4e1a\u52a1\u5b9e\u4f53");case Fa.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:return J.get("currentDataCenter","\u91d1\u8776\u4e91\u00b7\u82cd\u7a79-\u6570\u636e\u4e2d\u5fc3");case Fa.SOURCE_TYPE_MODELSET_DB_SOURCE:return J.get("modelSetDBSource","\u6570\u636e\u5e93");
case Fa.SOURCE_TYPE_PUBLIC_DATA_SOURCE:return J.get("publicDBSource","\u516c\u5171\u6570\u636e\u6e90-\u6570\u636e\u5e93");case Fa.SOURCE_TYPE_MODEL_SET_SOURCE:return J.get("modelSet","\u6a21\u578b\u96c6");case Fa.SOURCE_TYPE_MODELSET_FILE_SOURCE:return J.get("modelSetFile","\u6587\u4ef6");case Fa.SOURCE_TYPE_OPEN_API_SOURCE:return J.get("openAPI","OpenAPI")}};this.createExceptionIcon=function(da){var z=$("<div>");ka.background(z,"qingWarning");z.attr("title",da);return z};this.createSourceNameByType=
function(da){var z;da===Fa.SOURCE_TYPE_CURRENT_ENTITY_SOURCE?z=J.get("businessEntity","\u4e1a\u52a1\u5b9e\u4f53"):da===Fa.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE&&(z=J.get("dataCenter","\u6570\u636e\u4e2d\u5fc3"));return z};this.getSourceIconName=function(da){switch(da){case Fa.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:return"entity";case Fa.SOURCE_TYPE_MODEL_SET_SOURCE:return"modelSet";case Fa.SOURCE_TYPE_MODELSET_FILE_SOURCE:return"file";case Fa.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:return"data-center";case Fa.SOURCE_TYPE_OPEN_API_SOURCE:return"openapi";
default:return"data"}};this.updateSourceItemStatus=function(da,z,ua){var Ra=da.children(".modeler-designer-sourcearea-exception-icon"),Ja=da.children(".modeler-designer-sourcearea-icon"),Ua=da.children(".modeler-designer-sourcearea-name"),mb=12,Gb=34;Ra&&Ra.remove();z||(Ra=la.createExceptionIcon(ua),Ra.addClass("modeler-designer-sourcearea-exception-icon"),Ra.appendTo(da),mb+=22,Gb+=22);Ja.css("left",mb+"px");Ua.css("left",Gb+"px")};this.updateDeletedSourceStatus=function(da){var z=la.createExceptionIcon(J.get("sourceExceptionDeleted",
"\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002"));z.addClass("modeler-designer-sourcearea-exception-icon");z.appendTo(da);z=da.children(".modeler-designer-sourcearea-icon");z.length?(z.css("left","34px"),z=da.children(".modeler-designer-sourcearea-name"),z.css("left","56px")):(z=$("<div>"),z.addClass("modeler-designer-sourcearea-name"),z.text(J.get("theSourceIsDeleted","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664")),z.css("left","34px"),z.appendTo(da))};
this.getModelExceptionTips=function(da){if(!da)return null;switch(da){case ja.TYPE_MODEL_DELETED:return J.get("modelDeleted","\u8be5\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");case ja.TYPE_MODEL_NO_DATA_PERMISSION:return J.get("modelNoPermission","\u60a8\u672a\u88ab\u6388\u6743\u4f7f\u7528\u8be5\u6a21\u578b\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");case ja.TYPE_MODEL_INCOMPLETE:return J.get("modelNoComplete","\u8be5\u6a21\u578b\u8bbe\u7f6e\u4e0d\u5b8c\u6574\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");
case ja.TYPE_MODEL_DAMAGE:return J.get("modelBad","\u8be5\u6a21\u578b\u5df2\u635f\u574f\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");case ja.TYPE_MODEL_CYCLE_REFERENCE:return J.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 ja.TYPE_TABLE_NOT_EXISTS:return J.get("tableNotExistCantUse","\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002")}}};
Jb.SourceConnectStep=new function(){var la,da,z;this.setGlobal=function(Ra){la=Ra};this.setRemoteImpl=function(Ra){da=Ra};this.setSourceArea=function(Ra){};this.setTableArea=function(Ra){z=Ra};this.removeTableTree=function(){var Ra=z.getJqTableTree();Ra&&Ra.remove()};this.clearTableAreaSearchBox=function(){z.getSearchBox().clear()};this.getExeSourceChangeCallback=function(){return z.setExceptionSource};var ua=function(Ra,Ja,Ua){var mb=la.getIntegration().getMapSourcePermission();Ja?mb&&(mb[Ra]=null):
(Ja={},Ja.errorMessage=Ua,mb&&(mb[Ra]=Ja))};this.checkModelSetSourceConnect=function(Ra,Ja){(new wb(da,function(Ua){var mb=Ua?!1:!0;Ga.updateSourceItemStatus(Ja,mb,Ua);z.setSource(Ra);ua(Ra.getSourceId(),mb,Ua)},function(Ua){if(20001004===Ua)return Ja.data("errorCode",qa.SOURCE_EXCEPTION_DELETED_ERRORCODE),z.setExceptionSource(Ra,qa.SOURCE_EXCEPTION_DELETED_ERRORCODE),Ga.updateDeletedSourceStatus(Ja),!0})).checkModelSetSourceConnect(Ra.getSourceId())};this.checkSourceConnectivity=function(Ra,Ja){(new wb(da,
function(Ua){if(Ua)z.setSource(Ra);else{var mb=J.get("sourceConnectFailed","\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");z.setExceptionSource(Ra,qa.SOURCE_CONNECT_FAILED_ERRORCODE)}ua(Ra.getSourceId(),Ua,mb);Ga.updateSourceItemStatus(Ja,Ua,mb)},function(Ua,mb){var Gb=Ua.toString();if(20001004===Ua)Ja.data("errorCode",qa.SOURCE_EXCEPTION_DELETED_ERRORCODE),z.setExceptionSource(Ra,qa.SOURCE_EXCEPTION_DELETED_ERRORCODE),Ga.updateDeletedSourceStatus(Ja);
else{var Va="206"==Gb.substr(0,3)?J.get("openAPIConnectFailed","OpenAPI\u7684\u8fde\u63a5\u4fe1\u606f\u65e0\u6548\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002"):-1!=mb.indexOf("2030900")?J.get("xmlParseFailed","xml\u6587\u4ef6\u5904\u7406\u5931\u8d25\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002"):J.get("sourceConnectFailed","\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");z.setExceptionSource(Ra,qa.SOURCE_CONNECT_FAILED_ERRORCODE)}Va&&(ua(Ra.getSourceId(),
!1,Va),Ga.updateSourceItemStatus(Ja,!1,Va));return!0})).checkConnection(Ra.getSourceId())}};Jb.ConnectSourceCreator=new function(){var la;this.getSourceConnector=function(da,z){if(!la){la={};var ua=new Nb,Ra=new Yb;la[Fa.SOURCE_TYPE_MODEL_SET_SOURCE]=ua;la[Fa.SOURCE_TYPE_PUBLIC_DATA_SOURCE]=Ra;la[Fa.SOURCE_TYPE_MODELSET_DB_SOURCE]=Ra;la[Fa.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE]=Ra;la[Fa.SOURCE_TYPE_CURRENT_ENTITY_SOURCE]=Ra;la[Fa.SOURCE_TYPE_MODELSET_FILE_SOURCE]=Ra;la[Fa.SOURCE_TYPE_OPEN_API_SOURCE]=
Ra}ua=(ua=da.getSourceType())?la[ua]:new ub;ua.setSource(da);ua.setJqItem(z);return ua}};Jb.ModelSetSourceIntegration=new function(){var la,da,z,ua,Ra,Ja;this.setModelId=function(Ua){Ja=Ua};this.getModelId=function(){return Ja};this.setDataSourceManageEntrance=function(Ua){la=Ua};this.getDataSourceManageEntrance=function(){return la};this.setRemoteImpl=function(Ua){da=Ua};this.getRemoteImpl=function(){return da};this.registerDataCenterSelectorConstructor=function(Ua){z=Ua};this.getDataCenterSelector=
function(){return z};this.registerMetricDataCenterSelector=function(Ua){ua=Ua};this.getMetricDataCenterSelector=function(){return ua};this.setModelSetSourceFacade=function(Ua){Ra=Ua};this.getModelSetSourceFacade=function(){return Ra}}})();(function(){function qa(){var na=this,ja,X,J,wa,La,Oa,Ha,Qa;this.setCurrentNode=function(r){ja=r};this.getCurrentNode=function(){return ja};this.setModelerModel=function(r){X=r};this.setGlobal=function(r){Qa=r};this.getGlobal=function(){return Qa};this.setNodeStatusMonitor=function(r){J=r};this.setDirty=function(r){wa=r};this.isDirty=function(){return wa};this.setMask=function(r){La=r;La.setClickCallback(na.protectedShowPreviewContent)};this.getMask=function(){return La};this.setInvalidBackgroundPane=
function(r){Oa=r};this.getInvalidBackgroundPane=function(){return Oa};this.setModelerChecker=function(r){Ha=r};this.protectedGetModelerChecker=function(){return Ha};this.clear=function(){ja=null;na.protectedClear()};this.protectedClear=function(){throw Error("Implement me.");};this.showPreviewContent=function(){ja?Ha.focusNodeValidity(ja,na.protectedRefresh):(Oa.setText(Aa.get("dataLoading","\u6570\u636e\u52a0\u8f7d\u4e2d")),Oa.show())};this.protectedGetModeler=function(){return X};this.protectedRefresh=
function(){throw Error("Implement me.");};this.protectedChangeBackgroundStatus=function(r){if(r||!na.isCurrentNodeValid()){var M=Oa,P=M.setText;r||(r=(r=J.getInvalidPrompt(ja))?r:Aa.get("invalidNodeConfig","\u8282\u70b9#1\u8bbe\u7f6e\u4e0d\u5b8c\u6574").replace("#1",ja.getAlias()));P.call(M,r);Oa.show()}else Oa.hide()};this.protectedChangeMaskStatus=function(r){r||!na.isCurrentNodeValid()?La.hide():La.show()};this.protectedShowPreviewContent=function(){throw Error("Implement me.");};this.afterResize=
function(r){(r||J&&J.getSelected())&&na.protectedAfterResize(r)};this.protectedAfterResize=function(){throw Error("Implement me.");};this.getRuntimeModel=function(){if(ja&&X)return ra.convertToRuntimeModel(X,ja)};this.isCurrentNodeValid=function(){return ja?!J.isInvalidNode(ja.getId()):!0}}function Ca(){function na(ea){KTDefaultCellRender.call(this,ea);var fa=this,W=[Z.DT_STRING,Z.DT_NUMBER,Z.DT_INT,Z.DT_DATE,Z.DT_DATETIME,Z.DT_BOOLEAN],C=this.paintCellUI;this.paintCellUI=function(ia,ha){var $a=fa.getCurrentRowIdx(),
Ia=fa.getCurrentRow(),ka=fa.getCurrentColIdx(),Ga=Ia.getUserObject(),la=fa.getCell();if($a<nb.getHeadRowCount())C(ia,ha);else if(0==ka)ha=$("<div>"),Ia=sb.FieldNumberHelper.getFieldNumber(Ga),ha.text(Ia),ha.attr("title",Ia),ha.css("line-height","28px"),ha.css("padding-left","2px"),ha.css("padding-right","2px"),ha.addClass("modeler-designer-tablecell-editable"),sb.FieldNumberHelper.isDynamicFieldNumber(Ga)&&ja.getCurrentNode().getId()==Ga.getFromNode()&&ha.css("color","#c0c0c0"),ha.appendTo(ia);else if(1==
ka)Ga=$("<div>"),Ia=la.getValue(),Ga.text(Ia),Ga.attr("title",Ia),Ga.css("line-height","28px"),Ga.css("padding-left","2px"),Ga.css("padding-right","2px"),Ga.addClass("modeler-designer-tablecell-editable"),Ga.appendTo(ia);else if(3==ka){if($a=Ga.getFromNode(),la=ja.protectedGetModeler(),$a=la.getNode($a))ha=$("<div>"),ka=sb.DisplayNameHelper.getNodeDisplayName($a),$a.getGeneratedFieldSourceTableName&&(ka=(Ia=$a.getGeneratedFieldSourceTableName(Ga,la))?Ia:ka),ha.text(ka),ha.attr("title",ka),ha.css("line-height",
"28px"),ha.css("padding-left","2px"),ha.css("padding-right","2px"),ha.appendTo(ia)}else if(2==ka){la=Ga.getOutputDataType();var da=Ga.getOriginalDataType()?Ga.getOriginalDataType():Z.DT_STRING;ia=nb.createCtrlInCell(ia,fa.getCellWidth(),fa.getCellHeight(),Fa);ia.setItemModels(W);ia.setSelected(la);ia.setUserObject(Ia);ia.setCustomPainter(function(z,ua,Ra){z=z?!1:Ra==da;var Ja=$("<div>");wb.background(Ja,Ra);Ja.addClass("modeler-designer-select-field-dataType-icon");ua.append(Ja);Ja=sb.PropDataTypeUtil.getDataTypeDesc(Ra);
Ra=$("<div>");Ra.addClass("modeler-designer-select-text");z=Ja+(z?"("+Aa.get("origin","\u539f\u59cb")+")":"");Ra.text(z);Ra.attr("title",z);ua.append(Ra)});ia.addSelectedChangedListener(za)}else if(4==ka){ha=$("<div>");Ia=Ga.getName();$a=Ga.getFromNode();la=ja.protectedGetModeler();if($a=la.getNode($a))$a.getGeneratedSourceFieldName?Ia=(Ga=$a.getGeneratedSourceFieldName(Ga,la,ja.getCurrentNode()))?Ga:Ia:null!=Ga.getSourceDisplayName()&&(Ia=Ga.getSourceDisplayName()+"("+Ia+")");ha.text(Ia);ha.attr("title",
Ia);ha.css("line-height","28px");ha.css("padding-left","2px");ha.css("padding-right","2px");ha.appendTo(ia)}}}vb.AbstractTabPane.call(this);qa.call(this);var ja=this,X,J,wa,La,Oa;this.getTitle=function(){return Aa.get("field","\u5b57\u6bb5")};this.setMessageCurtain=function(ea){Oa=ea};this.getJqUi=function(){if(!X){X=$("<div>");J&&Ha();var ea=new ta,fa=ea.getJqUi();ea.hide();ja.setInvalidBackgroundPane(ea);sa.layoutCtrlWithLRTB(fa,0,0,null,0,0,null);X.append(fa)}return X};this.into=function(){!J||
ja.isDirty()?(ja.showPreviewContent(),ja.setDirty(!1)):ja.afterResize(!0)};this.protectedAfterResize=function(ea){wa&&J&&0!=J.length&&(ea?Qa():wa.relayoutViews())};this.updateNumberCellValue=function(ea){if(J){for(var fa=-1,W=0,C=J.length;W<C;W++)if(J[W].getFullName()==ea.getFullName()){fa=W;break}-1<fa&&(fa+=nb.getHeadRowCount(),(fa=wa.getRow(fa))&&fa.getCell(0).setValue(sb.FieldNumberHelper.getFieldNumber(ea)))}};this.setRemoteImpl=function(ea){};this.protectedClear=function(){J=null};this.reload=
function(){ja.showPreviewContent()};this.protectedRefresh=function(){ja.protectedChangeBackgroundStatus();ja.isCurrentNodeValid()&&ja.protectedShowPreviewContent()};this.protectedShowPreviewContent=function(){if(ja.getCurrentNode()){var ea=ja.getCurrentNode().getId();sb.NodeFieldHelper.asynGetFields(ja.getGlobal().getModelerModel(),ja.getCurrentNode(),function(fa){ja.getCurrentNode()&&ea==ja.getCurrentNode().getId()&&(J=fa,Qa())},function(){},X)}};var Ha=function(){wa=nb.createTable();wa.setColumnFitVisibleWidth(!0);
var ea=new na(wa);ea.setOutsideVisible(!1);wa.setCellRender(ea);wa.setSyncUIWhenModelChanged(!0);nb.bindTextEditor(wa,r,M);nb.bindTableListenerForCtrl(wa);La=$(wa.getUI());sa.layoutCtrlWithLRTB(La,10,10,null,10,10,null);La.appendTo(X)},Qa=function(){wa||Ha();nb.clear(wa);wa.addColumns(5);var ea=wa.getColumn(0),fa=wa.getColumn(1),W=wa.getColumn(3),C=wa.getColumn(2),ia=wa.getColumn(4);ea.setWidth(200);fa.setWidth(200);W.setWidth(140);C.setWidth(140);ia.setWidth(140);ea.setUserObject(0);fa.setUserObject(1);
W.setUserObject(3);C.setUserObject(2);ia.setUserObject(4);ea=nb.createHeadRow(wa);ea.getCell(0).setValue(Aa.get("fieldName","\u5b57\u6bb5\u540d\u79f0"));ea.getCell(1).setValue(Aa.get("fieldAlias","\u663e\u793a\u540d\u79f0"));ea.getCell(3).setValue(Aa.get("tableSource","\u6765\u6e90\u8868"));ea.getCell(2).setValue(Aa.get("dataType","\u6570\u636e\u7c7b\u578b"));ea.getCell(4).setValue(Aa.get("fieldSource","\u6765\u6e90\u5b57\u6bb5"));if(J)for(ea=0,fa=J.length;ea<fa;ea++)W=nb.createRow(wa),W.setUserObject(J[ea]),
W.getCell(1).setValue(J[ea].getAlias()),W.getCell(0).setValue(sb.FieldNumberHelper.getFieldNumber(J[ea]));nb.refresh(wa)},r=function(ea,fa){return 1==fa||0==fa?!0:!1},M=function(ea,fa,W,C,ia){if(!(0>wa.getColumnIndex(fa)))if(1==fa.getUserObject()){fa=C;fa=fa?fa.trim():"";ea=ea.getUserObject();C=G(ea);var ha=/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/;if(C.getAlias()!=fa){if(0==fa.length)var $a=Aa.get("fieldAliasIsEmpty","\u663e\u793a\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a");else if(50<fa.length)$a=Aa.get("fieldAliasTooLong",
"\u663e\u793a\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26");else if(fa.match(ha)){C=!1;ha=[];var Ia=ja.getCurrentNode().getFieldSettingConfig();Ia=Ia?Ia.getModifiedField():[];for(var ka=0;ka<J.length;ka++){for(var Ga=J[ka],la=Ga.getAlias(),da=0;da<Ia.length;da++){var z=Ia[da];if(Ga.getFullName()==z.getFullName()){la=z.getAlias();break}}ha.push(la)}for(Ia=0;Ia<ha.length;Ia++)if(ha[Ia]==fa){C=!0;break}C&&($a=Aa.get("duplicateFieldAlias","\u663e\u793a\u540d\u79f0\u5df2\u5b58\u5728"))}else $a=
Aa.get("invalidFieldAlias","\u663e\u793a\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210");$a?($a=ia?$a+Aa.get("punctuation_period","\u3002"):Aa.get("modifyAbandoned","#1\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",$a),Oa&&Oa.showPrompt($a)):(C=G(ea),C.setAlias(fa),ia=new O,ia.setValue(ja.getCurrentNode(),C,O.TYPE_ALIAS),ja.getGlobal().getCommandManager().perform(ia),W.setValue(fa))}}else 0==fa.getUserObject()&&P(ea,fa,
W,C,ia)},P=function(ea,fa,W,C,ia){C=C?C.trim():"";var ha=ea.getUserObject();if(ja.getGlobal().getModelerModel().getFieldNumberMap()[ha.getFullName()]!=C){ea=/^([\u4E00-\u9FA5a-zA-Z_])[\u4E00-\u9FA5a-zA-Z0-9_]{0,}$/;if(0==C.length)var $a=Aa.get("fieldNumberIsEmpty","\u5b57\u6bb5\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a");else if(25<C.length)$a=Aa.get("fieldNumberTooLong","\u5b57\u6bb5\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc725\u4e2a\u5b57\u7b26");else if(C.match(ea))if(com.kingdee.bos.qing.modeler.SpecialWordChecker.isSpecialWord(C))$a=
Aa.get("specialWordAsFieldNumberPrompt","\u201c#1\u201d\u4e3a\u7279\u6b8a\u5173\u952e\u5b57\uff0c\u4e0d\u80fd\u4f5c\u4e3a\u5b57\u6bb5\u540d\u79f0").replace("#1",C);else{ea=ja.getGlobal().getModelerModel().getFieldNumberMap();fa=Object.keys(ea);for(var Ia=0;Ia<fa.length;Ia++)if(ea[fa[Ia]]&&C.toLowerCase()==ea[fa[Ia]].toLowerCase()&&fa[Ia]!=ha.getFullName()){var ka=fa[Ia];break}ka&&($a=Aa.get("duplicateFieldNumber","\u5b57\u6bb5\u540d\u79f0\u5df2\u5b58\u5728"))}else $a=Aa.get("invalidFieldNumber","\u5b57\u6bb5\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e14\u4e0d\u80fd\u4ee5\u6570\u5b57\u5f00\u5934");
var Ga=function(){var la=new R;la.setValue(ja.getGlobal().getModelerModel(),ha,C);ja.getGlobal().getCommandManager().perform(la);W.setValue(C)};$a?ka?sb.FieldNumberHelper.removeFieldNumberIfFieldNotExist(ka,function(la){la?Ga():($a=ia?$a+Aa.get("punctuation_period","\u3002"):Aa.get("modifyAbandoned","#1\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",$a),Oa&&Oa.showPrompt($a))}):($a=ia?$a+Aa.get("punctuation_period","\u3002"):Aa.get("modifyAbandoned","#1\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",
$a),Oa&&Oa.showPrompt($a)):Ga()}},G=function(ea){var fa=ja.getCurrentNode().getFieldSettingConfig();fa=fa?fa.getModifiedField():[];for(var W=0;W<fa.length;W++){var C=fa[W];if(C.getFullName()==ea.getFullName())return C}return ea.clone()},za=function(ea,fa,W){ea=ea.getUserObject().getUserObject();ea=G(ea);ea.setAppointedDataType(W);W=new O;W.setValue(ja.getCurrentNode(),ea,O.TYPE_DATATYPE);ja.getGlobal().getCommandManager().perform(W)}}function cb(){function na(P){KTDefaultCellRender.call(this,P);var G=
this,za=this.paintCellUI;this.paintCellUI=function(ea,fa){var W=G.getCurrentRowIdx(),C=G.getCurrentRow(),ia=G.getCurrentColIdx();C=C.getUserObject();if(W<nb.getHeadRowCount())za(ea,fa);else{W=Oa.getField(ia);fa=W.getOutputDataType();ia=C[ia];if(null==ia||void 0==ia)ia="";else if(fa==Z.DT_DATE)C=new N,C.setFormatString("yyyy-MM-dd"),ia=C.format(ia);else if(fa==Z.DT_DATETIME)C=new N,C.setFormatString("yyyy-MM-dd HH:mm:ss"),ia=C.format(ia);else if(fa==Z.DT_BOOLEAN)ia=void 0===ia?"":ia?"true":"false";
else if(fa==Z.DT_NUMBER&&(C=W.getScale()))for(ia+="",W=ia.split("."),2>W.length?(ia+=".",W=""):W=W[1],C-=W.length,W=0;W<C;W++)ia+="0";C=$("<div>");C.text(ia);C.attr("title",ia);C.css("line-height","28px");C.css("padding-left","2px");C.css("padding-right","2px");fa!=Z.DT_INT&&fa!=Z.DT_NUMBER||C.css("text-align","right");C.appendTo(ea)}}}function ja(){ub.call(this);var P=this.protectedMethod,G=this,za,ea,fa,W,C=!1,ia;(function(){P.setTitle(Aa.get("previewSet","\u9884\u89c8\u8bbe\u7f6e"));P.setSelectable(!0);
P.setContentPaneCreator(function(){G.setSize(440,330);return ha()});P.setFooterPaneCreator(function(ka){var Ga=new Jb(Aa.get("confirm","\u786e\u5b9a"));Ga.setHighlight(!0);var la=Ga.getJqUi();la.addClass("sa-ctrl-dialog-footer-ok");la.appendTo(ka);Ga.addActionListener(function(da){da=za.getValue();var z=ea.getValue();ia&&ia(C,da,z);P.destroy();return!0});Ga=new Jb(Aa.get("cancel","\u53d6\u6d88"));Ga.setHighlight(!1);la=Ga.getJqUi();la.addClass("sa-ctrl-dialog-footer-cancel");la.appendTo(ka);Ga.addActionListener(function(da){P.destroy();
return!0})});P.setClosingAction(function(ka){})})();this.setOriginExtractCount=function(ka){fa=ka};this.setOriginPreviewCount=function(ka){W=ka};this.setAllData=function(ka){C=ka};this.setConfirmCallback=function(ka){ia=ka};var ha=function(){var ka=$("<div>"),Ga=$("<div>");Ga.text(Aa.get("extractSet","\u62bd\u53d6\u8bbe\u7f6e"));sa.layoutCtrl(Ga,30,20,100,24);Ga.appendTo(ka);Ga.css({color:"#333333","line-height":"24px","font-size":"14px"});Ga=$a("extract",Aa.get("extract","\u62bd\u53d6\u524d"),ka);
var la=Ga.getJqUi();sa.layoutCtrlWithLRTB(la,60,null,300,60,null,null);za=new Ab;var da=za.getJqUi();za.setConstraint(1,1E4,1);za.setValue(fa);sa.layoutCtrlWithLRTB(da,122,null,100,49,null,null);da.appendTo(ka);da=$("<div>");da.text(Aa.get("rowDataCalculate","\u884c\u6570\u636e\u8ba1\u7b97"));da.css("color","#666");sa.layoutCtrlWithLRTB(da,170,0);sa.layoutCtrlMiddleAlign(da,22);da.appendTo(la);la=$a("extractAll",Aa.get("all","\u5168\u91cf"),ka);da=la.getJqUi();sa.layoutCtrlWithLRTB(da,60,null,300,
90,null,null);var z=$("<div>");wb.background(z,"warning");z.attr("title",Aa.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"));sa.layoutCtrlWithLRTB(z,110,null,20,80,null,20);z.appendTo(ka);da=new Yb;da.addElement(Ga);da.addElement(la);
da.addChangedListener(function(Ra,Ja){Ja&&("extract"==Ra.getUserObject()?(C=!1,za.setEnabled(!0),z.hide()):(C=!0,za.setEnabled(!1),z.show()))});C?(Ia(da,"extractAll"),za.setEnabled(!1),z.show()):(Ia(da,"extract"),za.setEnabled(!0),z.hide());Ga=$("<div>");Ga.text(Aa.get("dataPreview","\u6570\u636e\u9884\u89c8"));sa.layoutCtrl(Ga,30,115,100,24);Ga.appendTo(ka);Ga.css({color:"#333333","line-height":"24px","font-size":"14px"});var ua=$a("dataPreview",Aa.get("previewResult","\u9884\u89c8\u8ba1\u7b97\u7ed3\u679c\u7684\u524d"),
ka);ua.setChecked(!0);ua.addCheckedListener(function(){ua.setChecked(!0)});Ga=ua.getJqUi();sa.layoutCtrlWithLRTB(Ga,60,null,300,155,null,null);ea=new Ab;la=ea.getJqUi();ea.setConstraint(1,1E3,1);ea.setValue(W);sa.layoutCtrlWithLRTB(la,180,null,100,144,null,null);la.appendTo(ka);la=$("<div>");la.text(Aa.get("rowData","\u884c\u6570\u636e"));la.css("color","#666");sa.layoutCtrlWithLRTB(la,230,0);sa.layoutCtrlMiddleAlign(la,22);la.appendTo(Ga);return ka},$a=function(ka,Ga,la){var da=new Nb;da.setUserObject(ka);
da.setText(Ga);ka=da.getJqUi();la.append(ka);return da},Ia=function(ka,Ga){ka.toCheckTheElement(function(la){return la.getUserObject()===Ga})}}vb.AbstractTabPane.call(this);qa.call(this);var X=this,J,wa,La,Oa,Ha;this.getTitle=function(){return Aa.get("preview","\u9884\u89c8")};this.getJqUi=function(){if(!J){J=$("<div>");var P=$("<div>");P.css("cursor","pointer");P.attr("title",Aa.get("previewSet","\u9884\u89c8\u8bbe\u7f6e"));P.on("click",M);wb.backgroundWithHover(P,"setting");sa.layoutCtrl(P,10,4,
20,20);P.appendTo(J);Ha=$("<div>");sa.layoutCtrlWithLRTB(Ha,40,10,null,5,null,20);Ha.css({"font-size":"14px",color:"#666",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"});Ha.appendTo(J);r();P=new ab;var G=P.getJqUi();X.setMask(P);P.hide();sa.layoutCtrlWithLRTB(G,5,5,null,28,5,null);J.append(G);P=new ta;G=P.getJqUi();X.setInvalidBackgroundPane(P);P.hide();sa.layoutCtrlWithLRTB(G,5,5,null,28,5,null);J.append(G);Qa()}return J};this.setRemoteImpl=function(P){};this.into=function(){!Oa||
X.isDirty()?(X.showPreviewContent(),X.setDirty(!1)):X.afterResize()};this.protectedAfterResize=function(){wa&&Oa&&0!=Oa.getRowCount()&&wa.relayoutViews()};this.protectedClear=function(){Oa=null};this.reload=function(){X.showPreviewContent()};this.protectedRefresh=function(){X.protectedChangeBackgroundStatus();X.protectedChangeMaskStatus()};this.protectedShowPreviewContent=function(){var P=X.getRuntimeModel();if(P){var G=sb.PreviewConfigManager.getPreviewConfig();P.setPreviewConfig(G);(new Date).getTime();
sb.NodeFieldHelper.getPreviewData(P,function(za){var ea=X.getCurrentNode(),fa=za.getPreviewData();if(ea&&ra.treatAsSameNode(za.getNodeId(),ea.getId())&&(Oa=fa,Oa&&0!=Oa.getRowCount()||(X.protectedChangeBackgroundStatus(Aa.get("noData","\u5f53\u524d\u9884\u89c8\u89c4\u5219\u4e0b,\u6ca1\u6709\u7b26\u5408\u6761\u4ef6\u7684\u6570\u636e")),X.protectedChangeMaskStatus(!0)),wa||r(),Oa)){La||(La=$(wa.getUI()),sa.layoutCtrlWithLRTB(La,10,10,null,30,10,null),La.appendTo(J));fa=Oa.getColumnCount();za=Oa.getRowCount();
nb.clear(wa);if(0!=fa&&0!=za){wa.addColumns(fa);var W=nb.createHeadRow(wa);for(ea=0;ea<fa;ea++)wa.getColumn(ea).setWidth(150),W.getCell(ea).setValue(Oa.getField(ea).getAlias());for(ea=0;ea<za;ea++)fa=Oa.getOneRow(ea),nb.createRow(wa).setUserObject(fa)}nb.refresh(wa)}},J)}};var Qa=function(){var P=sb.PreviewConfigManager.getRowCountText();Ha.text(P)},r=function(){wa=nb.createTable();wa.setColumnFitVisibleWidth(!1);var P=new na(wa);P.setOutsideVisible(!1);wa.setCellRender(P);wa.setSyncUIWhenModelChanged(!0)},
M=function(){var P=new ja,G=sb.PreviewConfigManager.getPreviewConfig();P.setOriginExtractCount(G.getExtractCount());P.setOriginPreviewCount(G.getPreviewCount());P.setAllData(G.isExtractAllData());P.setConfirmCallback(function(za,ea,fa){sb.PreviewConfigManager.updatePreviewConfig(za,ea,fa);X.showPreviewContent();Qa()});P.showDialog()}}function ab(){var na=this,ja,X;this.setClickCallback=function(wa){X=wa};this.getJqUi=function(){ja||J();return ja};var J=function(){ja=$("<div>");ja.addClass("modeler-designer-preview-mask");
var wa=$("<div>");wa.text(Aa.get("refreshPreviewData","\u7f16\u8f91\u5b8c\u6210\u540e\uff0c\u70b9\u51fb\u6b64\u5904\u5237\u65b0\u9884\u89c8\u6570\u636e\u3002"));wa.on("click",function(La){na.hide();X&&X()});wa.addClass("modeler-designer-preview-mask-button");wa.appendTo(ja)};this.show=function(){ja.show()};this.hide=function(){ja.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 sb=com.kingdee.bos.qing.modeler.designer;sb.PreviewArea=function(){var na,ja,X,J,wa,La,Oa,Ha,Qa,r,M=!1,P;this.getJqUi=function(){wa||G();return wa};this.setModelerModel=function(ia){na&&na.removePropertyChangeCallback(fa);na=ia;na.addPropertyChangeCallback(fa)};this.setModelerChecker=
function(ia){Qa=ia};this.setNodeStatusMonitor=function(ia){ja&&ja.removeSelectNodeListener(za);ja&&ja.removeInvalidNodeChangeListener(ea);ja=ia;ja.addSelectNodeListener(za);ja.addInvalidNodeChangeListener(ea)};this.setGlobal=function(ia){X=ia;Oa&&Oa.setGlobal(X)};this.setRemoteImpl=function(ia){J=ia};this.setHideListener=function(ia){r=ia};this.show=function(ia){M!=!ia&&((M=!ia)||La.getCurrentTabPane().into())};var G=function(){wa=$("<div>");Oa=new Ca;Ha=new cb;Oa.setRemoteImpl(J);Ha.setRemoteImpl(J);
Ha.setNodeStatusMonitor(ja);Oa.setNodeStatusMonitor(ja);Oa.setGlobal(X);Ha.setModelerChecker(Qa);Oa.setModelerChecker(Qa);La=new vb;La.setTabLevel(vb.SECOND_LEVEL);La.addTab(Oa,!0);La.addTab(Ha);var ia=$("<div>");wb.background(ia,"downArrow");sa.layoutCtrlWithLRTB(ia,null,5,16,8,null,16);ia.css("cursor","pointer");ia.on("click",function(){M=!0;r&&r()});ia.appendTo(wa);wa.append(La.getJqUi())},za=function(ia,ha){Ha.clear();Oa.clear();ha&&(P=ja.getInvalidState(ha),ia=X.getModelerModel(),Oa.setCurrentNode(ha),
Oa.setModelerModel(ia),Oa.setMessageCurtain(X.getMessageCurtain()),Ha.setCurrentNode(ha),Ha.setModelerModel(ia));M||(ha=La.getCurrentTabPane(),(ia=ha.getJqUi().find(".sa-common-loading-modallayer"))&&ia.remove(),ha.showPreviewContent())},ea=function(ia){if(ia=La.getCurrentTabPane())if(ia=ia.getCurrentNode())ia=ja.getInvalidState(ia),P!=ia&&C(),P=ia},fa=function(ia,ha){if(ia==Ka.KEY_REMOVE_NODE){if(ha=ha.getDownwardNode())W(ha)&&C(),console.log("change preview "+ia)}else if(ia==Ka.KEY_LINK_NODE||ia==
Ka.KEY_ADD_NODE||ia==Ka.KEY_BREAK_LINK||ia==Ma.KEY_TABLE_NODE_SELECT_FIELD||0==ia.indexOf(Ka.KEY_CHANGE_TRANSFORM_CONFIG))W(ha)&&C(),console.log("change preview "+ia);else if(ia==Ka.KEY_NODE_CHANGE_ALIAS)ha instanceof Mb&&(ia=La.getCurrentTabPane(),ia==Oa&&Oa.afterResize());else if(ia==Ma.KEY_UPDATE_TABLE)for(ia=0;ia<ha.length;ia++)W(ha[ia])&&C();else ia==Ka.KEY_CHANGE_FIELD_NUMBER&&(ia=La.getCurrentTabPane(),ia==Oa&&(Oa.updateNumberCellValue(ha),Oa.afterResize()))},W=function(ia){var ha=La.getCurrentTabPane().getCurrentNode();
if(-1<sb.ModelConverter.getUpwardNode(na,ha,!1).indexOf(ia))return!0},C=function(){if(!M){var ia=La.getCurrentTabPane();ia.reload();ia==Ha?Oa.setDirty(!0):Ha.setDirty(!0)}};this.afterResize=function(ia){La.getCurrentTabPane().afterResize(ia)}};var vb,Ab,Yb,Nb,ub,Jb,Fa,Aa,nb,wb,sa,N,Ma,Mb,ra,Z,Ka,ta,O,R;(function(){var na=com.kingdee.bos.qing.ui.component;vb=na.TabContainer;Ab=na.Spinner;Yb=na.RadioButtonGroup;Nb=na.RadioButton;ub=na.AbstractModalDialog;Jb=na.Button;Fa=na.ComboBox;na=com.kingdee.bos.qing.common.ui;
nb=na.TableUtil;na=com.kingdee.bos.qing.common;sa=na.DomUtil;N=na.DateFormater;na=com.kingdee.bos.qing.framework.common;Aa=na.MultilanguageManager.createPackageAccessor(sb);Mb=sb.TableNode;Ma=sb.ModelerModel;ra=sb.ModelConverter;Z=sb.Field;Ka=sb.TableModeler;wb=sb.Icons;ta=sb.InvalidBackgroundPane;O=sb.ActionNodeFieldSetting;R=sb.ActionFieldNumberMapping})()})();(function(){function qa(){var na,ja,X,J,wa,La,Oa,Ha,Qa,r,M,P,G={},za=[],ea=!0,fa=!0,W=!0,C,ia,ha,$a,Ia;this.getJqUi=function(){if(!C){z();if(ua())for(var Va=na.getModelerModel(),ob=Va.getAllTable(),Bb=0;Bb<ob.length;Bb++){var Db=ob[Bb];if(Va.getSource(Db.getSourceUid()).getSourceType()!==Z.SOURCE_TYPE_MODELSET_FILE_SOURCE){var Hb=Db.getUid(),qb=da(Va,Hb,!1);0<qb.length&&(za.push(Db),G[Hb]=qb)}}C=$("<div>");Ia=$("<div>");Va=new Aa;J=new nb;wa=new nb;La=new nb;J.setText(Ab.get("neverExtract","\u4e0d\u8fdb\u884c\u7269\u5316\u5b58\u50a8\uff0c\u603b\u662f\u5b9e\u65f6\u6267\u884c\u6a21\u578b"));
wa.setText(Ab.get("onceExtract","\u4ec5\u5728\u90e8\u7f72\u65f6\u7269\u5316\u5b58\u50a8\u4e00\u6b21\uff0c\u4ee5\u540e\u4e0d\u518d\u66f4\u65b0"));La.setText(Ab.get("timingExtract","\u5b9a\u65f6\u8fdb\u884c\u7269\u5316\u5b58\u50a8"));Va.addElement(J);Va.addElement(wa);Va.addElement(La);ob=J.getJqUi();Bb=wa.getJqUi();Db=La.getJqUi();vb.layoutCtrl(ob,0,0,530,23);vb.layoutCtrl(Bb,0,35,530,23);vb.layoutCtrl(Db,0,70,530,23);ob.appendTo(C);Bb.appendTo(C);Db.appendTo(C);Hb=$("<div>");Hb.text(Ab.get("materializationMethod",
"\u7269\u5316\u65b9\u5f0f"));var Cb=new wb;Cb.setIconType(wb.ICON_TYPE_QUESTION);Cb.setTipsSize(300,105);Cb.setTipsHtml(Ab.get("materializationTechniqueTips","\u5168\u91cf\u7269\u5316\uff1a\u6839\u636e\u6267\u884c\u8ba1\u5212\uff0c\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u6267\u884c\u6a21\u578b\uff0c\u5e76\u5c06\u6a21\u578b\u7684\u6267\u884c\u7ed3\u679c\u8fdb\u884c\u7269\u5316\u5b58\u50a8\u3002<br/>\u589e\u91cf\u7269\u5316\uff1a\u6839\u636e\u6267\u884c\u8ba1\u5212\uff0c\u5728\u6307\u5b9a\u7684\u65f6\u95f4\uff0c\u6309\u7167\u6240\u9009\u7684\u4f9d\u636e\u5b57\u6bb5\u8fdb\u884c\u589e\u91cf\u6570\u636e\u63d0\u53d6\u5e76\u6267\u884c\u6a21\u578b\uff0c\u5c06\u6267\u884c\u7ed3\u679c\u66f4\u65b0\u81f3\u5386\u53f2\u7269\u5316\u7ed3\u679c\u4e2d\u3002"));
ob=new Aa;Oa=new nb;Ha=new nb;Oa.setText(Ab.get("fullMaterialize","\u5168\u91cf\u7269\u5316"));Ha.setText(Ab.get("incrementalMaterialize","\u589e\u91cf\u7269\u5316"));ob.addElement(Oa);ob.addElement(Ha);Bb=$("<div>");qb=$("<div>");Db=$("<div>");Cb=Cb.getJqUi();var ma=Oa.getJqUi(),xa=Ha.getJqUi();vb.layoutCtrl(qb,0,0,540,19);vb.layoutCtrl(ma,20,30,250,23);vb.layoutCtrl(Db,20,60,520,23);vb.layoutCtrl(Bb,0,0,540,90);Hb.appendTo(qb);Cb.appendTo(qb);qb.appendTo(Bb);ma.appendTo(Bb);xa.appendTo(Db);Db.appendTo(Bb);
Bb.appendTo(Ia);Hb.addClass("modeler-designer-materialized-method-label");Cb.addClass("modeler-designer-materialized-method-label-tips");qb.css({"border-bottom":"1px solid #CCCCCC"});xa.css({display:"inline-block"});Ha.setCustomStyle("position","relative");qb=new Fa;qb.setText(Ab.get("basedField","\u4f9d\u636e\u5b57\u6bb5"));Qa=Ra();Hb=new wb;Hb.setIconType(wb.ICON_TYPE_QUESTION);Hb.setTipsSize(200,70);Hb.setTipsText(Ab.get("basedFieldHelpTips","\u4ec5\u652f\u6301\u201c\u65e5\u671f\u65f6\u95f4\u201d\u578b\u548c\u201c\u6574\u6570\u201d\u578b\u7684\u81ea\u589e\u5b57\u6bb5\u4f5c\u4e3a\u589e\u91cf\u7269\u5316\u7684\u4f9d\u636e\u5b57\u6bb5\u3002"));
ha=$("<div>");ra.background(ha,"qingWarning");ha.hide();ia=$("<div>");qb=qb.getJqUi();Cb=Qa.getJqUi();Hb=Hb.getJqUi();vb.layoutCtrl(qb,0,0,50,23);vb.layoutCtrl(Hb,52,3,16,16);vb.layoutCtrl(ha,80,3,16,16);vb.layoutCtrl(Cb,80,0,150,23);qb.appendTo(ia);Hb.appendTo(ia);ha.appendTo(ia);Cb.appendTo(ia);ia.appendTo(Db);ia.addClass("modeler-designer-materialized-based-field");Db=new Fa;Db.setText(Ab.get("executePlan","\u6267\u884c\u8ba1\u5212"));r=new Yb;r.isOnlyPeriod(!0);r.setCronAnalysisFacade(Ua);r.setScheduleChangedListener(Ja);
$a=$("<div>");Db=Db.getJqUi();Hb=r.getJqUi();vb.layoutCtrl(Db,0,0,540,23);vb.layoutCtrl(Hb,11,30,300,200);vb.layoutCtrl($a,0,100,540,225);vb.layoutCtrl(Ia,20,105,540,350);Db.appendTo($a);Hb.appendTo($a);$a.appendTo(Ia);Ia.appendTo(C);Db.children(":first-child").css("font-weight","bold");Db.css("border-bottom","1px solid #CCCCCC");Va.addChangedListener(mb);ob.addChangedListener(Gb);M||(J.getJqUi().hide(),wa.getJqUi().css("top","0px"),La.getJqUi().css("top","35px"),Ia.css("top","70px"),Bb.hide(),Db.hide(),
$a.css("top","0px"),Hb.css({left:"-9px",top:"-5px"}));Ga()}return C};this.setGlobal=function(Va){na=Va};this.setRemoteImpl=function(Va){ja=Va};this.setSupportIncrementConfig=function(Va){M=Va};this.setMessageCurtain=function(Va){X=Va};this.setMaterializedConfig=function(Va){P=Va;Ga()};this.getMaterializedConfig=function(){ka();return P};this.checkMaterializedConfig=function(){ka();if(!P)return!0;if(!ea)return X.showPrompt(Ab.get("noDataWarehouseConfig","\u5f53\u524d\u73af\u5883\u672a\u914d\u7f6e\u201c\u8f7b\u6570\u4ed3\u6570\u636e\u6e90\u201d\u53c2\u6570\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u5728MC\u4e2d\u8fdb\u884c\u914d\u7f6e\u3002")),
!1;if(!fa)return X.showPrompt(Ab.get("dataWarehouseConfigParseError","\u201c\u8f7b\u6570\u4ed3\u6570\u636e\u6e90\u201d\u53c2\u6570\u89e3\u6790\u5f02\u5e38\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u5728MC\u4e2d\u91cd\u65b0\u914d\u7f6e\u3002")),!1;if(ta.TYPE_TIMING===P.getType()){if(ta.STRATEGY_INCREMENTAL===P.getStrategy()){if(!ua())return X.showPrompt(Ab.get("noSupportIncrement","\u5f53\u524d\u6a21\u578b\u4e0d\u652f\u6301\u589e\u91cf\u7269\u5316\u3002")),!1;var Va=P.getBasedFields();if(!Va||0===
Va.length)return X.showPrompt(Ab.get("noBasedField","\u4f9d\u636e\u5b57\u6bb5\u4e0d\u80fd\u4e3a\u7a7a\u3002")),!1;for(var ob=0;ob<Va.length;ob++){var Bb=la(Va[ob].getTableId(),Va[ob].getName());if(!Bb||Mb.DT_INT!==Bb.getOriginalDataType()&&Mb.DT_DATETIME!==Bb.getOriginalDataType())return X.showPrompt(Ab.get("incompleteMaterializedConfig","\u7269\u5316\u5b58\u50a8\u8bbe\u7f6e\u4e0d\u5b8c\u6574")+Ab.get("punctuation_period","\u3002")),!1}}Va=P.getSchedule();if(Va.getPeriod()===Nb.Period_Custom){ob=
Va.getCron();if("undefined"==typeof ob||""===ob)return Va=M?Ab.get("cronEmptyError","\u6267\u884c\u8ba1\u5212\u4e2d\u8868\u8fbe\u5f0f\u4e0d\u80fd\u4e3a\u7a7a\uff0c\u683c\u5f0f\u5982 0 0 12 * * ?"):Ab.get("cronEmptyErrorForMetric","\u8868\u8fbe\u5f0f\u4e0d\u80fd\u4e3a\u7a7a\uff0c\u683c\u5f0f\u5982 0 0 12 * * ?"),X.showPrompt(Va),!1;if(!Va.getCronFlag())return Va=M?Ab.get("cornInCheckOrError","\u6267\u884c\u8ba1\u5212\u4e2d\u8868\u8fbe\u5f0f\u6709\u8bef\u6216\u8868\u8fbe\u5f0f\u6b63\u5728\u89e3\u6790\u6821\u9a8c\u3002"):
Ab.get("cornInCheckOrErrorForMetric","\u8868\u8fbe\u5f0f\u6709\u8bef\u6216\u8868\u8fbe\u5f0f\u6b63\u5728\u89e3\u6790\u6821\u9a8c\u3002"),X.showPrompt(Va),!1;if(!W)return Va=M?Ab.get("cronIntervalError","\u6267\u884c\u8ba1\u5212\u7684\u65f6\u95f4\u95f4\u9694\u4e0d\u80fd\u5c0f\u4e8e1\u5c0f\u65f6\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u8868\u8fbe\u5f0f\u3002"):Ab.get("cronIntervalErrorForMetric","\u8868\u8fbe\u5f0f\u7684\u65f6\u95f4\u95f4\u9694\u4e0d\u80fd\u5c0f\u4e8e1\u5c0f\u65f6\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u8868\u8fbe\u5f0f\u3002"),
X.showPrompt(Va),!1}}return!0};var ka=function(){if(La&&La.isChecked()){P=new ta;P.setType(ta.TYPE_TIMING);P.setStrategy(ta.STRATEGY_FULL);if(Ha&&Ha.isChecked()){P.setStrategy(ta.STRATEGY_INCREMENTAL);var Va=Qa.getSelectedModel();if(Va){var ob=new O;ob.setTableId(Va.getTableId());ob.setTableName(Va.getTableName());ob.setName(Va.getField().getName());ob.setAlias(Va.getField().getAlias());P.setBasedFields([ob])}}P.setSchedule(r.getSchedule())}else P=wa&&wa.isChecked()?new ta:null},Ga=function(){Oa.setChecked(!0);
J.setChecked(!0);M||wa.setChecked(!0);if(P)if(ta.TYPE_ONCE===P.getType())wa.setChecked(!0);else{La.setChecked(!0);if(ta.STRATEGY_INCREMENTAL===P.getStrategy()){var Va=P.getBasedFields();if(Va&&0<Va.length){a:{var ob=Va[0].getTableId(),Bb=Va[0].getName(),Db=na.getModelerModel(),Hb=Db.getTable(ob);Db=Db.getPage().getNodesByTableId(ob);if(Hb&&Db&&0<Db.length){if(ob=la(ob,Bb)){Va=new ab(Hb,ob,!1);break a}}else Hb=new Ma,Hb.setUid(ob),Hb.setDisplayName(Va[0].getTableName());ob=new Mb;ob.setName(Bb);ob.setAlias(Va[0].getAlias());
Va=new ab(Hb,ob,!0)}Va&&(Ha.setChecked(!0),Qa.setSelectedModel(Va))}}r.setSchedule(P.getSchedule())}},la=function(Va,ob){Va=da(na.getModelerModel(),Va,!0);for(var Bb=0;Bb<Va.length;Bb++)if(ob===Va[Bb].getName())return Va[Bb]},da=function(Va,ob,Bb){var Db=[];(ob=Va.getPage().getNodesByTableId(ob))&&1===ob.length&&sb.NodeFieldHelper.asynGetFields(Va,ob[0],function(Hb){if(Bb)Db=Hb;else for(var qb=0;qb<Hb.length;qb++){var Cb=Hb[qb].getOriginalDataType();Mb.DT_INT!==Cb&&Mb.DT_DATETIME!==Cb||Db.push(Hb[qb])}});
return Db},z=function(){(new Ka(ja,function(Va){fa=ea=!0},function(Va,ob){return 30001001===Va?(ea=!1,X.showPrompt(Ab.get("noDataWarehouseConfig","\u5f53\u524d\u73af\u5883\u672a\u914d\u7f6e\u201c\u8f7b\u6570\u4ed3\u6570\u636e\u6e90\u201d\u53c2\u6570\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u5728MC\u4e2d\u8fdb\u884c\u914d\u7f6e\u3002")),!0):30001002===Va?(fa=!1,X.showPrompt(Ab.get("dataWarehouseConfigParseError","\u201c\u8f7b\u6570\u4ed3\u6570\u636e\u6e90\u201d\u53c2\u6570\u89e3\u6790\u5f02\u5e38\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u5728MC\u4e2d\u91cd\u65b0\u914d\u7f6e\u3002")),
!0):!1})).checkDataWarehouseConfig()},ua=function(){var Va=na.getModelerModel().getAllTable();return!Va||1<Va.length||1===Va.length&&na.getModelerModel().getSource(Va[0].getSourceUid()).getSourceType()===Z.SOURCE_TYPE_MODELSET_FILE_SOURCE?!1:na.getModelerModel().supportIncrementalMaterialize()},Ra=function(){var Va=new Ca;Va.setTables(za);Va.setTableFieldMap(G);var ob=new sa;ob.setDropdownCreator(function(Bb,Db,Hb){return Va.createJqPopup(Bb,Db,Hb)});ob.addSelectionListener(function(Bb){var Db=Bb.getSelectedModel();
Bb=Qa.getJqUi();Bb.css({left:80,width:150});ha.hide();Db.isDeleted()?(Bb.css({left:96,width:134}),ha.attr("title",Ab.get("basedFieldNotExist","\u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664")),ha.show()):(Db=Db.getField().getOriginalDataType(),Mb.DT_INT!==Db&&Mb.DT_DATETIME!==Db&&(Bb.css({left:96,width:134}),ha.attr("title",Ab.get("basedFieldTypeFail","\u5b57\u6bb5\u7c7b\u578b\u5fc5\u987b\u4e3a\u65e5\u671f\u65f6\u95f4\u6216\u6574\u6570")),ha.show()))});ob.setCustomPainter(function(Bb,
Db){Bb&&(Bb=Bb.getTableName()+"."+Bb.getField().getAlias(),Db.attr("title",Bb),Db.text(Bb))});return ob},Ja=function(){var Va=r.getSchedule(),ob=Va.getCron();if(P&&P.getSchedule()){var Bb=P.getSchedule().getCron();Nb.Period_Custom===Va.getPeriod()&&ob&&ob===Bb&&(Bb=new Ka(ja,function(Db){Va.setCronFlag(!0);W=Db.cronInterval},function(Db,Hb){return 20001008===Db?(Va.setCronFlag(!1),!0):!1}),Bb.setShowBlocking(!1),Bb.cronExpression(ob))}},Ua=function(Va,ob,Bb){(new Ka(ja,function(Db){W=Db.cronInterval;
if(!W){var Hb=M?Ab.get("cronIntervalError","\u6267\u884c\u8ba1\u5212\u7684\u65f6\u95f4\u95f4\u9694\u4e0d\u80fd\u5c0f\u4e8e1\u5c0f\u65f6\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u8868\u8fbe\u5f0f\u3002"):Ab.get("cronIntervalErrorForMetric","\u8868\u8fbe\u5f0f\u7684\u65f6\u95f4\u95f4\u9694\u4e0d\u80fd\u5c0f\u4e8e1\u5c0f\u65f6\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u8868\u8fbe\u5f0f\u3002");X.showPrompt(Hb)}ob&&ob(Db.cronData)},function(Db,Hb){var qb=!1;20001008===Db&&(Hb=Ab.get("cronError","\u53c2\u6570\u9519\u8bef\uff0c\u8868\u8fbe\u5f0f\u6709\u8bef\u3002"),
qb=!0);Bb&&Bb(Db,Hb);return qb})).cronExpression(Va)},mb=function(Va,ob){La&&La.isChecked()?Ia.show():Ia.hide()},Gb=function(Va,ob){if(Oa&&Oa.isChecked())Qa&&Qa.setEnabled(!1);else if(Qa&&Qa.setEnabled(!0),!ua())return Qa&&Qa.setEnabled(!1),X.showPrompt(Ab.get("noSupportIncrement","\u5f53\u524d\u6a21\u578b\u4e0d\u652f\u6301\u589e\u91cf\u7269\u5316\u3002")),!1}}function Ca(){function na(){var Ha,Qa,r,M,P,G,za;this.getJqUi=function(){Ha||ea();return Ha.getJqUi()};this.setSelectedModel=function(ka){G=
ka};this.setSelectedModelSetter=function(ka){za=ka};this.setSearchText=function(ka){M=ka;$a()};this.setTables=function(ka){Qa=ka;$a()};this.setTableFieldMap=function(ka){r=ka;$a()};var ea=function(){Ha=new ub;Ha.setBorderVisible(!0);Ha.setCustomItemPainter(fa);Ha.setMultiSelectable(!1);Ha.setCustomSelectedsPainter(W);Ha.addPressedListener(function(ka,Ga){ka=ka.getSelecteds()[0];ka instanceof ab&&za&&za(ka)})},fa=function(ka,Ga){if(Ga instanceof ab){var la=Ga.getField();ka.css("margin-left","20px");
ka.addClass("modeler-designer-materialized-field-list-item");ka.css("cursor","pointer");var da=$("<div>");da.text(la.getAlias());da.attr("title",la.getAlias());da.addClass("modeler-designer-materialized-table-field-text");ka.append(da);ka.data("model",Ga);la=la.getOriginalDataType();da=$("<div>");da.addClass("modeler-designer-materialized-table-field-icon");vb.layoutCtrl(da,10,3,16,16);ra.background(da,la);da.data("myIconName",la);da.appendTo(ka);G&&Ga&&G.getField().getFullName()===Ga.getField().getFullName()&&
ia(ka,Ga)}else ha(ka,Ga)},W=function(ka,Ga){for(var la=0;la<ka.length;la++){var da=ka[la];C(da,!1)}for(la=0;la<Ga.length;la++)da=Ga[la],C(da,!0)},C=function(ka,Ga){ka=ka.find(".modeler-designer-materialized-table-field-icon");"qingTable"===ka.data("myIconName")&&ra.background(ka,Ga?"qingTableWhite":"qingTable")},ia=function(ka,Ga){if(0<ka.height()){var la=ka.find(".modeler-designer-materialized-table-field-icon"),da=la.data("myIconName");ra.background(la,da+"_hover");ka.css("color","#fff");ka.css("background-color",
"#88a7f6");ka.css("background-color","var(--color-lightish, #88a7f6)");Ha.setSelecteds([Ga]);Ha.scrollSelectedToVisible(Ga)}else setTimeout(function(){ia(ka,Ga)},0)},ha=function(ka,Ga){var la=$("<div>");vb.layoutCtrl(la,0,2,16,16);ra.backgroundWithHover(la,"expanded");la.appendTo(ka);var da=$("<div>");vb.layoutCtrl(da,20,3,16,16);ra.background(da,"qingTable");da.data("myIconName","qingTable");da.addClass("modeler-designer-materialized-table-field-icon");da.appendTo(ka);da=$("<div>");da.text(Ga.getTableName());
da.addClass("modeler-designer-materialized-table-field-text");da.css("left","40px");da.css("font-weight","bold");ka.on("click",function(z){z=$(z.currentTarget).data("model");var ua=!z.isExpand();z.setExpand(ua);ra.backgroundWithHover(la,ua?"expanded":"expand");ua=Ha.getJqUi().find(".modeler-designer-materialized-field-list-item");for(var Ra=z.isExpand(),Ja=0;Ja<ua.length;Ja++){var Ua=$(ua[Ja]);Ua.data("model").getTableId()===z.getTableId()&&Ua.css("display",Ra?"":"none")}});ka.data("model",Ga);ka.append(da)},
$a=function(){if(Ha&&Qa){for(var ka=[],Ga=0;Ga<Qa.length;Ga++){var la=Qa[Ga];ka.push(new cb(la));if(r){var da=r[la.getUid()];if(da)for(var z=0;z<da.length;z++)ka.push(new ab(la,da[z],!1))}}if(Ga=M){la=[];for(da=0;da<ka.length;da++)z=ka[da],z instanceof cb?(0<la.length&&la[la.length-1]instanceof cb&&la.splice(la.length-1),la.push(z)):-1<z.getField().getAlias().toUpperCase().indexOf(Ga)&&la.push(z);la[la.length-1]instanceof cb&&la.splice(la.length-1);ka=la}Ha.setItemModels(ka,Ia);0===ka.length?(P||
(P=$("<div>"),vb.layoutCtrlCenterAlign(P,135),P.css({color:"#c0c0c0",top:"35px","text-align":"center"}),P.appendTo(ja)),ka=M?Ab.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"):Ab.get("noSelectField","\u6682\u65e0\u53ef\u9009\u5b57\u6bb5"),P.text(ka),P.show(),Ha.getJqUi().hide()):(P&&P.hide(),Ha.getJqUi().show())}},Ia=function(ka,Ga){return ka instanceof cb&&Ga instanceof cb||ka instanceof ab&&Ga instanceof ab?ka.equals(Ga):!1}}var ja,X,J,wa,La;this.createJqPopup=
function(Ha,Qa,r){ja=$("<div>");ja.css({"background-color":"#fff",height:"100%",width:"100%"});ja.appendTo(Ha);wa=new N;wa.setShowSearchIcon(!0);wa.setPlaceholder(Ab.get("searchField","\u8bf7\u8f93\u5165\u5b57\u6bb5\u540d\u79f0"));wa.setSearchListenerDelay(800);wa.addSearchListener(Oa);Ha=wa.getJqUi();vb.layoutCtrlWithLRTB(Ha,0,0,null,0,null,25);ja.append(Ha);La=new na;La.setSelectedModel(Qa);La.setSelectedModelSetter(r);La.setTables(X);Qa=La.getJqUi();vb.layoutCtrlWithLRTB(Qa,0,0,null,25,0,null);
ja.append(Qa);La.setTableFieldMap(J);Qa=30;if(X&&J)for(Qa+=20*X.length,r=0;r<X.length;r++)Qa+=20*J[X[r].getUid()].length;90>=Qa?Qa=90:320<Qa&&(Qa=320);return[-1,Qa]};this.setTables=function(Ha){X=Ha};this.setTableFieldMap=function(Ha){J=Ha};var Oa=function(){var Ha=$.trim(wa.getText()).toUpperCase();La.setSearchText(Ha)}}function cb(na){var ja=!0;this.getTableId=function(){return na.getUid()};this.setExpand=function(X){ja=X};this.isExpand=function(){return ja};this.getTableName=function(){return na.getDisplayName()?
na.getDisplayName():na.getTableName()};this.equals=function(X){return na.getUid()===X.getTableId()}}function ab(na,ja,X){this.getField=function(){return ja};this.getTableId=function(){return na.getUid()};this.getTableName=function(){return na.getDisplayName()?na.getDisplayName():na.getTableName()};this.isDeleted=function(){return X};this.equals=function(J){return na.getUid()===J.getTableId()&&ja.equals(J.getField())}}"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 sb=com.kingdee.bos.qing.modeler.designer;sb.MaterializedConfigDialog=function(){Jb.call(this);var na=this,ja=this.protectedMethod,X,J,wa,La=!1,Oa,Ha;(function(){ja.setTitle(Ab.get("materializedConfig",
"\u7269\u5316\u5b58\u50a8\u8bbe\u7f6e"));na.setSize(620,570);ja.setContentPaneCreator(function(){if(!Oa){Oa=$("<div>");wa=new qa;wa.setGlobal(X);wa.setRemoteImpl(J);wa.setSupportIncrementConfig(La);wa.setMessageCurtain(ja.getMessageCurtain());Ha=wa.getJqUi();Ha.appendTo(Oa);var Qa=X.getModelerModel();Qa=Qa.getMaterializedConfig()?Qa.getMaterializedConfig().copy():null;wa.setMaterializedConfig(Qa)}return Oa});ja.setClosingChecker2(function(Qa){Qa=X.getModelerModel();var r=Qa.getMaterializedConfig();
if(!wa.checkMaterializedConfig())return!1;var M=wa.getMaterializedConfig();if(!M&&!r||M&&r&&M.equals(r))return!0;r=new R;r.setValue(Qa,M);X.getCommandManager().perform(r);return!0});ja.setClosingAction(function(Qa){})})();this.setGlobal=function(Qa){X=Qa};this.setRemoteImpl=function(Qa){J=Qa};this.setSupportIncrementConfig=function(Qa){La=Qa}};var vb,Ab,Yb,Nb,ub,Jb,Fa,Aa,nb,wb,sa,N,Ma,Mb,ra,Z,Ka,ta,O,R;(function(){var na=com.kingdee.bos.qing.common;vb=na.DomUtil;na=com.kingdee.bos.qing.framework.common;
Ab=na.MultilanguageManager.createPackageAccessor(sb);na=com.kingdee.bos.qing.schedule;Yb=na.ScheduleSelector;Nb=na.QingSchedule;na=com.kingdee.bos.qing.ui.component;ub=na.List;Jb=na.AbstractModalDialog;Fa=na.Label;Aa=na.RadioButtonGroup;nb=na.RadioButton;wb=na.HelpIcon;sa=na.DropdownSelector;N=na.SearchBox;Ma=sb.Table;Mb=sb.Field;ra=sb.Icons;Z=sb.AbstractModelerSource;Ka=sb.DesignerFacade;ta=sb.MaterializedConfig;O=sb.BasedField;R=sb.ActionChangeMaterializedConfig})()})();(function(){function qa(){var r=1,M=[];this.zoomIn=function(){var G=qa.SUPPORT_SCALES.indexOf(r);G<qa.SUPPORT_SCALES.length-1&&(r=qa.SUPPORT_SCALES[G+1],P())};this.zoomOut=function(){var G=qa.SUPPORT_SCALES.indexOf(r);0<G&&(r=qa.SUPPORT_SCALES[G-1],P())};this.autoAdaptScale=function(G,za,ea,fa){G=Math.max(G/r/ea,za/r/fa);if(1>G)1>r&&(r=1,P());else{G=1/G;za=[];for(ea=0;ea<qa.SUPPORT_SCALES.length;ea++)za.push(qa.SUPPORT_SCALES[ea]);za.sort();for(ea=0;ea<za.length;ea++)if(G<za[ea]){G=za[ea];break}r=
G;P()}};this.isMinScale=function(){return qa.SUPPORT_SCALES[0]==r};this.isMaxScale=function(){return qa.SUPPORT_SCALES[qa.SUPPORT_SCALES.length-1]==r};this.getRatio=function(){return r};this.setCustomRatio=function(G){r=G};this.getScaledSize=function(G){return 1==r?G:r*G};this.getRawSize=function(G){return 1==r?G:G/r};this.getScaledCoordinate=function(G){return 1==r?G:[r*G[0],r*G[1]]};this.getRawCoordinate=function(G){return 1==r?G:[G[0]/r,G[1]/r]};this.addPropertyChangedListener=function(G){M.push(G)};
var P=function(){for(var G=0;G<M.length;G++){var za=M[G];za&&za()}}}function Ca(){var r=new sa,M,P=this,G,za,ea,fa,W,C,ia,ha={},$a={},Ia,ka=!1;this.create=function(z,ua){G=ua;M||(M=r.createNode("svg"),ua=Ia.getScaledSize(z.getWidth()),z=Ia.getScaledSize(z.getHeight()),r.setAttributes(M,{width:ua,height:z}),G[0].appendChild(M))};this.setScaleHelper=function(z){Ia=z};this.setTransformNodeCreator=function(z){ea=z};this.setNodeOperateCreator=function(z){fa=z};this.setNodeRelinkHelper=function(z){C=z};
this.setNodeStatusMonitor=function(z){ia=z};this.setGlobal=function(z){za=z};this.clear=function(){M&&M.remove();M=null;W&&W.release()};this.addNodeUi=function(z){if(M){var ua=N.create(z,Ia,za),Ra=z.getId();Ga(z,ua);ha[Ra]=ua}};this.removeNode=function(z){z=z.getId();var ua=ha[z];ua&&(ua.remove(),ea.release(),ha[z]=null)};this.renameNode=function(z,ua){var Ra=z.getId();if(Ra=ha[Ra])W||(W=new O),W.setCallback(ua),W.hook(z,Ra,G)};this.getTransformCreatorMark=function(){return ea.getMark()};this.changeNodePosition=
function(z){var ua=z.getId();if(ua=ha[ua])ua.changePosition(z.getX(),z.getY()),ea.release(),ea.hook(z,M),W&&W.release()};this.changeNodeDisplayName=function(z){z=z.getId();(z=ha[z])&&z.changeNodeDisplayName()};this.addSelectedNodeUi=function(z){var ua=z.getId();if(ua=ha[ua])ua.setSelected(!0),ua.remove(),Ga(z,ua),ua.isHover()&&la(z)};this.cleanSelectedUi=function(){var z=Object.keys(ha);ea.release();for(var ua=0,Ra=z.length;ua<Ra;ua++){var Ja=z[ua];(Ja=ha[Ja])&&Ja.setSelected(!1)}z=Object.keys($a);
ua=0;for(Ra=z.length;ua<Ra;ua++)Ja=z[ua],(Ja=$a[Ja])&&Ja.setSelected(!1)};this.getNodeIdFromUi=function(z){return z.attr("id")};this.getNodeUiMark=function(){return ja.NODE_UI_CLASS};this.getNodeOperateUiMark=function(){return ja.NODE_OPERATE_ICON_CLASS};this.getNodeNameUiMark=function(){return ja.NODE_NAME_UI_CLASS};this.showNodeOperateSelector=function(){fa&&fa.showOperateList()};this.setNodeHover=function(z){var ua=z.getId();if(ua=ha[ua])ua.setHover(!0),Ga(z,ua),ka=!0,fa.hook(z,G,ua.getOperateIconUi()),
ea.hook(z,M),la(z)};this.cleanHoverUi=function(){if(ka){for(var z=Object.keys(ha),ua=0,Ra=z.length;ua<Ra;ua++){var Ja=ha[z[ua]];Ja&&Ja.setHover(!1);ea.release();C.release();console.log("leave")}ka=!1}};this.setInvalidNodeUi=function(z,ua){z=z.getId();(z=ha[z])&&z.setInvalid(!0,ua)};this.cleanInvalidNodeUi=function(){for(var z=Object.keys(ha),ua=0,Ra=z.length;ua<Ra;ua++){var Ja=ha[z[ua]];Ja&&Ja.setInvalid(!1)}};this.setFieldCount=function(z,ua){z=z.getId();(z=ha[z])&&z.setFieldCount(ua)};var Ga=function(z,
ua){ua=ua.getSvgElement();r.addClass(ua,P.getNodeUiMark());z=z.getId();ua.setAttribute("id",z);M.appendChild(ua)},la=function(z){ia.getInvalidState(z)instanceof na&&C.hook(z,M)};this.addLineUi=function(z,ua,Ra){M&&(ua=new Z(ua,Ra),ua.setScaleHelper(Ia),Ra=z.getId(),$a[Ra]=ua,da(z,ua))};this.updateLineUi=function(z){var ua=$a[z.getId()];ua&&(ua.remove(),da(z,ua))};this.changeLinePosition=function(z){(z=$a[z.getId()])&&z.changePosition()};this.removeLine=function(z){z=z.getId();var ua=$a[z];ua&&($a[z]=
null,ua.remove())};this.addSelectedLineUi=function(z){var ua=$a[z.getId()];ua&&(ua.setSelected(!0),ua.remove(),da(z,ua))};var da=function(z,ua){z=z.getId();ua=ua.getSvgElement();ua.setAttribute("id",z);M.appendChild(ua)}}function cb(){this.adaptSize=function(r){var M=r.getPage();var P=r.getAllNodes(),G=r.getPage();if(1>P.length)var za=[0,0,G.getWidth(),G.getHeight()];else{var ea=P[0];G=ea.getX();var fa=ea.getY();za=G+ea.getWidth();ea=fa+ea.getHeight();for(var W=1;W<P.length;W++){var C=P[W];G=Math.min(G,
C.getX());fa=Math.min(fa,C.getY());za=Math.max(za,C.getX()+C.getWidth());ea=Math.max(ea,C.getY()+C.getHeight())}za=[G-100,fa-100,za+100,ea+100]}fa=M.getWidth();ea=M.getHeight();P=-za[0];G=-za[1];fa=za[2]-fa;za=za[3]-ea;if(0!=P||0!=fa||0!=G||0!=za){if(0!=P||0!=G)for(r=r.getAllNodes(),ea=0;ea<r.length;ea++)W=r[ea],W.setPosition(W.getX()+P,W.getY()+G);M.setExtension(P,G,fa,za);return!0}return!1}}function ab(){var r,M,P,G,za,ea,fa,W;this.startDrag=function(ka,Ga){console.log("start drag page");za=Ga;
M=[ka.clientX,ka.clientY];P=(ka=za.position())?[ka.left,ka.top]:[0,0];ea=$("<div>");ea.css("z-index",999999);ea.appendTo($(document.body));ea.css("cursor","move");ub.layoutCtrlWithLRTB(ea,0,0,null,0,0,null);ea.on("mousemove",C);ea.on("mouseup",ia);ea.on("mouseleave",ha)};this.setMovableArea=function(ka){G=ka};this.setGlobal=function(ka){fa=ka};this.setScaleHelper=function(ka){W=ka};var C=function(ka){var Ga=ka.clientX-M[0];ka=ka.clientY-M[1];if(r)var la=!0;else la=Math.abs(ka),la=5<Math.abs(Ga)||
5<la?r=!0:!1;la&&za.css({left:Ia(P[0]+Ga,!0)+"px",top:Ia(P[1]+ka,!1)+"px"})},ia=function(ka){$a()},ha=function(ka){$a()},$a=function(){console.log("destroy drag page");ea.css("cursor","default");ea&&ea.remove();ea=null},Ia=function(ka,Ga){if(Ga){Ga=9999;var la=za.width();var da=G.width()}else Ga=9999,la=za.height(),da=G.height();Ga=W.getScaledSize(Ga);var z=la>Ga;Ga=0<ka?z?0:Math.min(ka,Ga-la):z?Math.max(ka,da-la):Math.max(ka,da-Ga);Ga!=ka&&fa.getMessageCurtain().showPrompt(Jb.get("svgMaxSize","\u5df2\u8fbe\u5230\u7ed8\u5236\u533a\u57df\u6700\u5927\u5c3a\u5bf8\u3002"));
return Ga}}function sb(){var r,M,P,G,za,ea,fa,W,C=!1,ia,ha;this.setTarget=function(z){P=z};this.setScaleHelper=function(z){ha=z};this.setModelerModel=function(z){ia=z};this.setMovableArea=function(z){r=z};this.startDrag=function(z){console.log("start drag");W=new Ka;W.prepare(ia,r,ha);M=[z.clientX,z.clientY];G=$("<div>");G.css("z-index",999999);G.appendTo($(document.body));ub.layoutCtrlWithLRTB(G,0,0,null,0,0,null);G.on("mousemove",$a);G.on("mouseup",Ia);G.on("mouseleave",la)};this.setEndMoveCallback=
function(z){ea=z};var $a=function(z){if(C)var ua=!0;else ua=Math.abs(z.clientY-M[1]),ua=5<Math.abs(z.clientX-M[0])||5<ua?C=!0:!1;if(ua){if(!za){za=$("<div>");za.addClass("modeler-dragdrop-mask");za.appendTo(r);var Ra=P.getX(),Ja=P.getY(),Ua=P.getWidth();ua=P.getHeight();fa=[Ra,Ja];Ra=ha.getScaledCoordinate(fa);Ua=ha.getScaledSize(Ua);ua=ha.getScaledSize(ua);ub.layoutCtrl(za,Ra[0],Ra[1],Ua,ua)}z=Ga(z);ka(z);z=ha.getScaledCoordinate(z);ub.layoutCtrl(za,z[0],z[1],null,null)}},Ia=function(z){za&&(z=Ga(z),
ka(z),ea&&ea(z[0],z[1]));da()},ka=function(z){if(za){var ua=ha.getRawSize(za.width()),Ra=ha.getRawSize(za.height()),Ja=ha.getRawCoordinate(z);ua=[Ja[0],Ja[1],ua,Ra];W.anchor(ua);z[0]=ua[0];z[1]=ua[1]}},Ga=function(z){var ua=z.clientX-M[0];z=z.clientY-M[1];var Ra=ha.getScaledCoordinate(fa);return[Ra[0]+ua,Ra[1]+z]},la=function(z){da()},da=function(){console.log("destroy");G&&(G.off("mousemove",$a),G.off("mouseup",Ia),G.off("mouseleave",la),G.remove(),G=null);za&&(za&&za.remove(),za=null);W&&W.abort()}}
function vb(){var r,M,P,G,za,ea;this.getJqUi=function(){if(!r){r=$("<div>");r.addClass("modeler-designer-page-toolbar");ea=$("<div>");ea.addClass("modeler-designer-ratio-text");ia();ea.appendTo(r);var Ia=W(),ka=C(),Ga=fa();G=$("<div>");G.on("click",$a);G.attr("title",Jb.get("overallView","\u5168\u5c40\u89c6\u56fe"));Nb.Icons.backgroundWithHover(G,"upArrow");G.css("cursor","pointer");var la=G;var da=5;ub.layoutCtrl(la,da,5,16,16);ub.layoutCtrl(Ga,da+=26,5,16,16);ub.layoutCtrl(ka,da+=26,5,16,16);ub.layoutCtrl(Ia,
da+=26,5,16,16);ub.layoutCtrl(ea,da+26,0,35,25);r.append(Ga);r.append(ka);r.append(Ia);r.append(la)}return r};this.getUiMark=function(){return"modeler-designer-page-toolbar"};this.manage=function(Ia,ka){M=Ia;M.addPropertyChangedListener(ia);P=ka};this.setGlobal=function(Ia){za=Ia};var fa=function(){var Ia=$("<div>");Ia.on("click",function(ka){(new Ab).autoLayout(za)});Ia.attr("title",Jb.get("autoLayout","\u81ea\u52a8\u5e03\u5c40"));Nb.Icons.backgroundWithHover(Ia,"layout");Ia.css("cursor","pointer");
return Ia},W=function(){var Ia=$("<div>");Nb.Icons.backgroundWithHover(Ia,"zoomOut");Ia.on("click",function(){M.zoomOut()});Ia.attr("title",Jb.get("zoomOut","\u7f29\u5c0f"));Ia.css("cursor","pointer");return Ia},C=function(){var Ia=$("<div>");Nb.Icons.backgroundWithHover(Ia,"zoomIn");Ia.on("click",function(){M.zoomIn()});Ia.attr("title",Jb.get("zoomIn","\u653e\u5927"));Ia.css("cursor","pointer");return Ia},ia=function(){var Ia=M?M.getRatio():1;Ia=parseInt(100*Ia)+"%";ea.text(Ia);ea.attr("title",Jb.get("currentRatio",
"\u5f53\u524d\u6bd4\u4f8b#1").replace("#1",Ia))},ha=!1,$a=function(){var Ia=parseInt(r.css("bottom"))+r.height()+5,ka=parseInt(r.css("left"));P.setPosition(ka,null,null,Ia);ha?(Nb.Icons.backgroundWithHover(G,"upArrow"),P.show(!1),ha=!1):(Nb.Icons.backgroundWithHover(G,"downArrow"),P.show(!0),ha=!0)}}function Ab(){var r={},M=0,P,G,za=[],ea,fa;this.autoLayout=function($a){P=$a;G=P.getModelerModel();ea=[];fa=[];$a=G.getAllNodes();for(var Ia=0;Ia<$a.length;Ia++){var ka=$a[Ia],Ga=G.getRelatedLine(ka,Aa.GET_LINE_STRATEGY_IN);
Ga&&0!=Ga.length||ea.push(ka);(Ga=G.getRelatedLine(ka,Aa.GET_LINE_STRATEGY_OUT))&&0!=Ga.length||fa.push(ka)}for($a=0;$a<ea.length;$a++)C(ea[$a],0);for($a=0;$a<fa.length;$a++){Ia=fa[$a];a:{ka=Ia;for(Ga=0;Ga<za.length;Ga++)if(-1<za[Ga].indexOf(ka)){ka=!0;break a}ka=!1}ka||(ka=[],W(Ia,ka),za.push(ka))}for(Ia=$a=0;Ia<za.length;Ia++)for(ka=za[Ia],Ga=0;Ga<ka.length;Ga++)ia[ka[Ga].getId()]=[0,$a],$a+=120;ha(1);$a=new Qa;$a.setCaption(Jb.get("autoLayout","\u81ea\u52a8\u5e03\u5c40"));$a.setValue(G,ia);P.getCommandManager().perform($a)};
var W=function($a,Ia){if($a){var ka=G.getRelatedLine($a,Aa.GET_LINE_STRATEGY_IN);if(ka&&0!=ka.length)for($a=0;$a<ka.length;$a++)W(G.getNode(ka[$a].getFromId()),Ia);else Ia.push($a)}},C=function($a,Ia){M=Math.max(M,Ia);var ka=$a.getId(),Ga=r[ka];r[ka]=void 0==Ga?Ia:Math.max(Ga,Ia);($a=G.getNextNode($a))&&C($a,++Ia)},ia={},ha=function($a){if(!($a>M)){for(var Ia=Object.keys(r),ka=0;ka<Ia.length;ka++){var Ga=Ia[ka];if(r[Ga]==$a){var la=G.getNode(Ga),da=G.getRelatedLine(la,Aa.GET_LINE_STRATEGY_IN),z=0,
ua=0;if(1==da.length){var Ra=G.getNode(da[0].getFromId()),Ja=ia[Ra.getId()];z=Ja[1]+(Ra.getHeight()-la.getHeight()>>1);ua=Ja[0]+Ra.getWidth()}else if(1<da.length){for(var Ua=z=0;Ua<da.length;Ua++)Ra=G.getNode(da[Ua].getFromId()),Ja=ia[Ra.getId()],ua=Math.max(ua,Ja[0]+Ra.getWidth()),z+=Ja[1]+(Ra.getHeight()>>1);z=z/da.length-(la.getHeight()>>1)}ia[Ga]=[ua+100,z]}}ha(++$a)}}}function Yb(){var r=this,M,P,G,za,ea=!1,fa,W,C,ia,ha,$a,Ia;this.setContainer=function(Ja){fa=Ja};this.manageViewPosition=function(Ja,
Ua){ha=Ja;$a=Ua};this.show=function(Ja){ea=Ja;M||Ga();ea?(M.show(),ka()):M.hide()};this.setGlobal=function(Ja){P=Ja};this.init=function(Ja){G&&G.removePropertyChangeCallback(Ra);G=Ja;G.addPropertyChangeCallback(Ra)};this.setPosition=function(Ja,Ua,mb,Gb){M||Ga();ub.layoutCtrlWithLRTB(M,Ja,Ua,null,mb,Gb,null)};this.getUiMark=function(){return"modeler-designer-overall-view"};var ka=function(){if(ea){za&&za.clear();var Ja=G.getPage(),Ua=Ja.getWidth();var mb=Ja.getHeight();1.5<Ua/mb?(Ja=240/Ua,Ua=240,
mb*=Ja):(Ja=160/mb,mb=160,Ua*=Ja);mb=[Ja,Ua,mb];Ua=mb[0];Ja=mb[1];mb=mb[2];ub.layoutCtrl(W,240-Ja>>1,160-mb>>1,Ja,mb);Ja=za;mb=Ja.setScaleHelper;C||(C=new qa);C.setCustomRatio(Ua);mb.call(Ja,C);za.create(G.getPage(),W);Ua=G.getAllNodes();for(Ja=0;Ja<Ua.length;Ja++){mb=Ua[Ja];za.addNodeUi(Ua[Ja]);var Gb=G.getRelatedLine(mb,Aa.GET_LINE_STRATEGY_OUT);Gb&&0<Gb.length&&(Gb=Gb[0],za.addLineUi(Gb,mb,G.getNode(Gb.getToId())))}}},Ga=function(){M=$("<div>");M.addClass(r.getUiMark());M.css({position:"absolute",
width:"240px",height:"160px"});M.appendTo(fa);ia=$("<div>");ub.layoutCtrlWithLRTB(ia,0,0,null,0,0,null);ia.appendTo(M);ia.css("z-index",99);W=$("<div>");W.appendTo(M);G&&(za=new Ca,za.setGlobal(P),M.on("mousedown",la))},la=function(Ja){Ia||(Ia=$("<div>"),Ia.addClass("modeler-designer-overall-view-capture"),Ia.appendTo(ia));Ia.show();var Ua=ha.width(),mb=ha.height(),Gb=$a.width(),Va=$a.height(),ob=W.width(),Bb=W.height();Ia.css({width:ob/Gb*Ua+"px",height:Bb/Va*mb+"px"});Ua=ub.getCurrentTargetPosition(Ja);
Ua=ub.upwardCoordinate(Ja.target,Ua,M[0]);z(Ua);M.css("cursor","move");M.on("mousemove",da);M.on("mouseup",ua);M.on("mouseleave",ua)},da=function(Ja){var Ua=ub.getCurrentTargetPosition(Ja);Ua=ub.upwardCoordinate(Ja.target,Ua,M[0]);z(Ua);Ua=Ia.position();var mb=W.position();Ja=mb.left-Ua.left;Ua=mb.top-Ua.top;mb=ha.width()/Ia.width();ub.layoutCtrl($a,Ja*mb,Ua*mb,null,null)},z=function(Ja){ub.layoutCtrl(Ia,Ja[0]-(Ia.width()>>1),Ja[1]-(Ia.height()>>1),null,null)},ua=function(){Ia.hide();M.css("cursor",
"default");M.off("mousemove",da);M.off("mouseup",ua);M.off("mouseleave",ua)},Ra=function(Ja,Ua){if(Ja==Aa.KEY_ADD_NODE||Ja==Aa.KEY_REMOVE_NODE||Ja==Fa.KEY_PAGE_SIZE||Ja==Aa.KEY_NODE_CHANGE_POSITION||Ja==Aa.KEY_ADD_LINE||Ja==Aa.KEY_REMOVE_LINE||Ja==Aa.KEY_NODE_CHANGE_ALIAS||Ja==Aa.KEY_NODE_RELAYOUT||Ja==Fa.KEY_TABLE_NODE_SELECT_FIELD)console.log("update overall view"),ka()}}"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 Nb=com.kingdee.bos.qing.modeler.designer;Nb.PageArea=function(){var r,M,P,G,za,ea,fa,W,C,ia=new cb,ha=new Yb,$a,Ia;this.getJqUi=function(){P||ka();return P};this.setFunUpdateTableArea=function(aa){Ia=aa};this.setModelerModel=function(aa){fa&&
fa.removePropertyChangeCallback(Ua);fa=aa;fa.addPropertyChangeCallback(Ua);Nb.NodeHelper.setModeler(aa);Nb.LineCoordinateHelper.setModelerModel(aa);ha.init(fa);da();Hb()};this.repaint=function(){da();Hb()};this.setGlobal=function(aa){r=aa};this.setRemoteImpl=function(aa){M=aa};this.setNodeStatusMonitor=function(aa){ea&&(ea.removeSelectNodeListener(Va),ea.removeInvalidNodeChangeListener(Bb));ea=aa;ea.addSelectNodeListener(Va);ea.addInvalidNodeChangeListener(Bb);Nb.NodeHelper.setNodeStatusMonitor(ea)};
this.setModelerChecker=function(aa){Nb.NodeHelper.setModelerChecker(aa)};this.setDragHandler=function(aa){za=aa};var ka=function(){P=$("<div>");P.on("mousedown",ma);P.on("mousemove",xa);P.addClass("modeler-designer-page");Nb.SvgTextTrimer.init();Nb.NodeResultCache.addCacheChangeListener(function(Y,t){Gb(fa.getNode(Y),t.length)});Ga();la();ha.setContainer(P);ha.setGlobal(r);$a=new vb;$a.manage(C,ha);$a.setGlobal(r);var aa=$a.getJqUi();P.append(aa);G=$("<div>");G.appendTo(P);ub.layoutCtrlWithLRTB(G,
0,0,null,0,0,null);za.bindDropUi(G,z,ua,Ra,C);fa&&Db();ha.manageViewPosition(P,G)},Ga=function(){C=new qa;C.addPropertyChangedListener(function(){var aa=G.width(),Y=G.height();da();var t=G.width(),H=G.height(),Q=G.position();ub.layoutCtrl(G,Q.left+(aa-t>>1),Q.top+(Y-H>>1),null,null)})},la=function(){var aa=new Ma;aa.setScaleHelper(C);aa.addSelectedCallback(function(H,Q){H.getNodeCreator()(Q,r,function(Ta){var ca=Ta.isMultiInDegree()?Ta.getExtraFromNode():null,va=new J;va.setValue(Ta,Q,ca,fa);r.getCommandManager().perform(va)})});
var Y=new Mb;Y.setScaleHelper(C);Y.addSelectedCallback(function(H,Q){H.getType()==ta.TYPE_DELETE?(H=new wa,H.setValue(Q,fa),r.getCommandManager().perform(H)):H.getType()==ta.TYPE_RENAME&&W.renameNode(Q,Pb)});var t=new ra;t.setScaleHelper(C);t.setGlobal(r);t.setLinkCallback(function(H,Q){var Ta=new La;Ta.setValue(H,Q);r.getCommandManager().perform(Ta)});W=new Ca;W.setNodeOperateCreator(Y);W.setTransformNodeCreator(aa);W.setScaleHelper(C);W.setNodeRelinkHelper(t);W.setNodeStatusMonitor(ea);W.setGlobal(r)},
da=function(){W&&W.clear();Db();for(var aa=fa.getAllNodes(),Y=0;Y<aa.length;Y++){var t=aa[Y];W.addNodeUi(aa[Y]);var H=fa.getRelatedLine(t,Aa.GET_LINE_STRATEGY_OUT);H&&0<H.length&&(H=H[0],W.addLineUi(H,t,fa.getNode(H.getToId())))}(Y=ea.getSelected())&&ob(Y);if(aa=ea.getInvalidNodes())for(Y=0;Y<aa.length;Y++)W.setInvalidNodeUi(aa[Y],ea.getInvalidPrompt(aa[Y]))},z=function(){var aa=[0,0];aa=ub.upwardCoordinate(P[0],aa,document.body);var Y=[P.prop("clientWidth"),P.prop("clientHeight")];Y=ub.upwardCoordinate(P[0],
Y,document.body);return new function(t,H,Q,Ta){this.getLeft=function(){return t};this.getRight=function(){return H};this.getTop=function(){return Q};this.getBottom=function(){return Ta}}(aa[0],Y[0],aa[1],Y[1])},ua=function(aa,Y,t){var H=ub.getCurrentTargetPosition(aa);H=ub.upwardCoordinate(aa.target,H,document.body);aa=H[0];H=H[1];if(aa<Y.getLeft()||aa>Y.getRight()||H<Y.getTop()||H>Y.getBottom())return null;Y=[0,0];Y=ub.upwardCoordinate(G[0],Y,document.body);aa-=Y[0];Y=H-Y[1];aa-=parseInt(C.getScaledSize(t.getWidth())>>
1);Y-=parseInt(C.getScaledSize(t.getHeight())>>1);Y=C.getRawCoordinate([aa,Y]);t.setPosition(Y[0],Y[1]);return new wb(G,fa)},Ra=function(aa,Y){var t=aa.getTableNode();aa=aa.getTable();var H=aa.getSourceUid();H=fa.getSource(H);t=new R(M,H,t,aa,fa);t.setFunUpdateTableArea(Ia);t.setGlobal(r);t.setFunFinishCallback(Y);t.setAddNodeCallback(Ja);t.checkBeforeLoadField()},Ja=function(aa,Y){var t=aa.getSelectedFields();if(t){var H=(new Date).getTime();Nb.NodeResultCache.cacheOneNodeField(aa.getId(),t,H)}t=
new X;t.setValue(aa,Y,fa);r.getCommandManager().perform(t)},Ua=function(aa,Y){if(aa==Aa.KEY_ADD_NODE)mb(Y),(aa=ia.adaptSize(fa))||W.addNodeUi(Y);else if(aa==Aa.KEY_REMOVE_NODE){var t=Y.getRemovedNode();(aa=ia.adaptSize(fa))||W.removeNode(t);console.log("remove")}else if(aa==Fa.KEY_PAGE_SIZE){da();aa=G.position();t=C.getScaledSize(Y.getLeftExtension());var H=C.getScaledSize(Y.getTopExtension());ub.layoutCtrl(G,aa.left-t,aa.top-H,null,null);console.log("resize")}else if(aa==Aa.KEY_NODE_CHANGE_POSITION){if(aa=
ia.adaptSize(fa),!aa)for(W.changeNodePosition(Y),t=fa.getRelatedLine(Y,Aa.GET_LINE_STRATEGY_ALL),aa=0,H=t.length;aa<H;aa++)W.changeLinePosition(t[aa])}else if(aa==Aa.KEY_ADD_LINE)(aa=fa.getFromToNode(Y))&&W.addLineUi(Y,aa[0],aa[1]);else if(aa==Aa.KEY_REMOVE_LINE)W.removeLine(Y);else if(aa==Aa.KEY_NODE_CHANGE_ALIAS)W.changeNodeDisplayName(Y);else if(aa==Aa.KEY_TRANSFORM_JOIN)console.log("change node relation"),t=Y.getConfig(),aa=fa.getNode(t.getLeft()),t=fa.getNode(t.getRight()),t=[aa,t],Nb.NodeHelper.reHandleNodeRelation(Y,
t);else if(aa==Aa.KEY_TRANSFORM_UNION){H=Y.getConfig().getNodeItems();t=[];for(aa=0;aa<H.length;aa++){var Q=fa.getNode(H[aa].getNodeId());t.push(Q)}Nb.NodeHelper.reHandleNodeRelation(Y,t)}else aa==Aa.KEY_NODE_RELAYOUT?((aa=ia.adaptSize(fa))||da(),qb(),Hb()):aa==Fa.KEY_TABLE_NODE_SELECT_FIELD&&((aa=Y.getSelectedFields())?Gb(Y,aa.length):Nb.NodeFieldHelper.asynGetFields(fa,Y,function(Ta){Gb(Y,Ta.length)}))},mb=function(aa){var Y=C.getScaledSize(aa.getX()),t=C.getScaledSize(aa.getY()),H=C.getScaledSize(aa.getWidth());
aa=C.getScaledSize(aa.getHeight());var Q=G.position(),Ta=Q.left;Q=Q.top;var ca=P.width(),va=P.height(),Na=0,Za=0;0>Y+Ta?Na=-(Y+Ta)+30:Y+Ta+H>ca&&(Na=ca-(Y+Ta+H)-30);0>t+Q?Za=-(t+Q)+30:t+Q+aa>va&&(Za=va-(t+Q+aa)-30);0==Na&&0==Za||ub.layoutCtrl(G,Ta+Na,Q+Za,null,null)},Gb=function(aa,Y){aa instanceof nb&&W.setFieldCount(aa,Y)},Va=function(aa,Y){W.cleanSelectedUi();Y&&ob(Y)},ob=function(aa){if(fa.getNode(aa.getId())){var Y=fa.getRelatedLine(aa,Aa.GET_LINE_STRATEGY_ALL);if(Y)for(var t=0;t<Y.length;t++)W.addSelectedLineUi(Y[t]);
W.addSelectedNodeUi(aa)}},Bb=function(aa){W.cleanInvalidNodeUi();for(var Y=0;Y<aa.length;Y++){var t=aa[Y];W.setInvalidNodeUi(t,ea.getInvalidPrompt(t))}},Db=function(){var aa=fa.getPage(),Y=C.getScaledSize(aa.getWidth()),t=C.getScaledSize(aa.getHeight());ub.layoutCtrl(G,null,null,Y,t);W.create(aa,G)},Hb=function(){var aa=fa.getPage(),Y=C.getScaledSize(aa.getWidth()),t=C.getScaledSize(aa.getHeight());setTimeout(function(){ub.layoutCtrl(G,-(Y-P.width()>>1),-(t-P.height()>>1),null,null)},0)},qb=function(){var aa=
fa.getPage(),Y=C.getScaledSize(aa.getWidth());aa=C.getScaledSize(aa.getHeight());C.autoAdaptScale(Y,aa,P.width(),P.height())},Cb,ma=function(aa){var Y=$(aa.target);if(!(ub.upwardSearchHasClass(Y,P,W.getTransformCreatorMark())||ub.upwardSearchHasClass(Y,P,$a.getUiMark())||ub.upwardSearchHasClass(Y,P,ha.getUiMark())))if(ub.upwardSearchHasClass(Y,P,W.getNodeOperateUiMark()))W.showNodeOperateSelector(),aa.stopPropagation();else if(Y=ub.upwardSearchHasClass(Y,P,W.getNodeUiMark())){Y=W.getNodeIdFromUi(Y);
var t=fa.getNode(Y);ea.setSelected(t);var H=new sb;H.setTarget(t);H.setEndMoveCallback(function(Q,Ta){var ca=new Oa;ca.setValue(t,[Q,Ta]);r.getCommandManager().perform(ca)});H.setMovableArea(G);H.setScaleHelper(C);H.setModelerModel(fa);H.startDrag(aa);Cb==Y?(ib(aa),Cb=null):(Cb=Y,setTimeout(function(){Cb=null},1E3))}else Y=new ab,Y.setMovableArea(P),Y.setGlobal(r),Y.setScaleHelper(C),Y.startDrag(aa,G)},xa=function(aa){aa=$(aa.target);if(!ub.upwardSearchHasClass(aa,P,ha.getUiMark())){var Y=ub.upwardSearchHasClass(aa,
P,W.getNodeUiMark());if(Y){aa=W.getNodeIdFromUi(Y);aa=fa.getNode(aa);if(Y=fa.getRelatedLine(aa,Aa.GET_LINE_STRATEGY_ALL))for(var t=0;t<Y.length;t++)W.updateLineUi(Y[t]);W.setNodeHover(aa)}else ub.upwardSearchHasClass(aa,P,W.getTransformCreatorMark())||W.cleanHoverUi()}},ib=function(aa){aa=$(aa.target);if(aa=ub.upwardSearchHasClass(aa,P,W.getNodeNameUiMark()))if(aa=ub.upwardSearchHasClass(aa,P,W.getNodeUiMark()))aa=W.getNodeIdFromUi(aa),aa=fa.getNode(aa),W.renameNode(aa,Pb)},Pb=function(aa,Y){var t;
Y=$.trim(Y);var H=/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/;0==Y.length?t=Jb.get("nameIsEmpty","\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a"):50<$.trim(Y).length?t=Jb.get("nameTooLong","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26"):Nb.DisplayNameHelper.isDuplicate(Y,aa)?t=Jb.get("duplicateName","\u540d\u79f0\u91cd\u590d"):Y.match(H)||(t=Jb.get("invalidNodeName","\u8282\u70b9\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210"));
t?(t=Jb.get("modifyAbandoned","#1\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",t),r.getMessageCurtain().showPrompt(t)):(t=new Ha,t.setValue(aa,Y),r.getCommandManager().perform(t))}};var ub,Jb,Fa,Aa,nb,wb,sa,N,Ma,Mb,ra,Z,Ka,ta,O,R,na,ja,X,J,wa,La,Oa,Ha,Qa;(function(){var r=com.kingdee.bos.qing.common;ub=r.DomUtil;r=com.kingdee.bos.qing.framework.common;Jb=r.MultilanguageManager.createPackageAccessor(Nb);wb=Nb.DragInsideCheckResult;sa=Nb.Svg;N=Nb.NodeUIFactory;Fa=Nb.ModelerModel;Aa=Nb.TableModeler;
nb=Nb.TableNode;Ma=Nb.TransformNodeCreator;Mb=Nb.NodeOperateCreator;ra=Nb.NodeRelinkHelper;Z=Nb.LineUi;ja=Nb.AbstractNodeUI;Ka=Nb.DraggingAnchor;ta=Nb.NodeOperateType;O=Nb.NodeRenameHelper;X=Nb.ActionAddTableNode;J=Nb.ActionAddTransformNode;wa=Nb.ActionRemoveNode;La=Nb.ActionLinkNode;Oa=Nb.ActionMoveNode;Ha=Nb.ActionNodeRename;Qa=Nb.ActionRelayout;R=Nb.FieldSelectDialog;na=Nb.LackInputState})();qa.SUPPORT_SCALES=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5]})();(function(){function qa(){var r=this,M,P,G,za,ea,fa,W,C,ia,ha,$a,Ia,ka,Ga,la,da,z,ua,Ra;this.setGlobal=function(t){za=t};this.setNodeStatusMonitor=function(t){fa&&fa.removeSelectNodeListener(Bb);fa=t;fa.addSelectNodeListener(Bb);sb.NodeFieldHelper.setNodeStatusMonitor(fa)};this.setModelerChecker=function(t){W=t};this.updateModelerModel=function(){if(Ga){var t=za.getModelerModel();ea&&ea.removePropertyChangeCallback(Y);ea=t;ea.addPropertyChangeCallback(Y);t=ea;var H=new Oa;H.init(t);com.kingdee.bos.qing.modeler.designer.DisplayNameHelper.registerImpl(H);
sb.UIDHelper.init(ea);Ga.setModelerModel(ea);Ia.setModelerModel(ea);da.setModelerModel(ea);la.setModelerModel(ea);qb()}};this.setRemoteImpl=function(t){P=t};var Ja=!0;this.resize=function(){Va();C&&C.resize();da.afterResize(!0);var t=0<document.body.clientHeight;!Ja&&t&&setTimeout(function(){Ga.repaint()},0);Ja=t};this.getJqUi=function(){M||Ua();return M};this.showDialogIfNoSource=function(){Ia&&Ia.showDialogIfNoSource()};var Ua=function(){M=$("<div>");M.addClass("modeler-designer-main");G=new ta;
mb();la=new ra;la.setGlobal(za);la.setNodeStatusMonitor(fa);la.setHideListener(function(){ob=!0;Hb(!0);ia.collapseSecondHalf(!0);la.show(!1)});Ga=new Z;Ga.setDragHandler(G);Ga.setGlobal(za);Ga.setNodeStatusMonitor(fa);Ga.setRemoteImpl(P);Ga.setModelerChecker(W);Ga.setFunUpdateTableArea(function(t,H){ka&&ka.updateNodeStatus(t,H)});da=new Ka;da.setNodeStatusMonitor(fa);da.setRemoteImpl(P);da.setGlobal(za);da.setModelerChecker(W);da.setHideListener(function(){ma=!0;ib(!0);aa(!0);da.show(!1)});Gb();r.updateModelerModel()},
mb=function(){Ia=new N;Ia.setGlobal(za);Ia.setRemoteImpl(P);ka=new Mb;ka.setGlobal(za);ka.setRemoteImpl(P);ka.setDragHandler(G);ka.setTableNodeCreator(function(t){return La.createTableNode(t)});Ma.setSourceArea(Ia);Ma.setTableArea(ka);Ma.setRemoteImpl(P);Ma.setGlobal(za)},Gb=function(){ha=new Yb;ha.setHorizontalSplit(!1);ha.setSplitLineWide(8);ha.setResizeMode(Yb.RESIZE_MODE_SECOND_FIXED);ha.setSecondSize(-1,60,-1);ha.setFirstChild(Yb.createChildWrapper(Ia.getJqUi()));ha.setSecondChild(Yb.createChildWrapper(ka.getJqUi()));
Va();$a=new Yb;$a.setHorizontalSplit(!1);$a.setSplitLineWide(8);$a.setResizeMode(Yb.RESIZE_MODE_SECOND_FIXED);$a.setFirstSize(-1,120,-1);$a.setSecondSize(240,210,350);$a.setFirstChild(Yb.createChildWrapper(Ga.getJqUi()));$a.setSecondChild(Yb.createChildWrapper(da.getJqUi(),function(){da.afterResize()}));ia=new Yb;ia.setHorizontalSplit(!0);ia.setSplitLineWide(8);ia.setResizeMode(Yb.RESIZE_MODE_SECOND_FIXED);ia.setFirstSize(-1,120,-1);ia.setSecondSize(280,210,450);ia.setFirstChild($a);ia.setSecondChild(Yb.createChildWrapper(la.getJqUi(),
function(){la.afterResize()}));C=new Yb;C.setHorizontalSplit(!0);C.setSplitLineWide(8);C.setResizeMode(Yb.RESIZE_MODE_FIRST_FIXED);C.setFirstSize(206,172,450);C.setSecondSize(-1,600,-1);C.setFirstChild(ha);C.setSecondChild(ia);M=C.getJqUi();M.addClass("modeler-designer-main");Hb(!0);ia.collapseSecondHalf(!0);la.show(!1)},Va=function(){Cb?(ha.setFirstSize(360,60,-1),ha.setSplitLineWide(0)):(ha.setFirstSize(360,60,Math.max(60,.382*M[0].clientHeight)),ha.setSplitLineWide(8))},ob=!1,Bb=function(){ob||
Db()},Db=function(){Hb(!1);ia.collapseSecondHalf(!1);la.show(!0)},Hb=function(t){if(!z){z=$("<div>");z.addClass("modeler-designer-property-show-btn");z.on("click",Db);var H=$("<div>");H.appendTo(z);sa.backgroundWithHover(H,"leftArrow");var Q=$("<div>");Q.text(ub.get("properties","\u5c5e\u6027"));Q.appendTo(z);vb.layoutCtrlCenterAlign(Q,20);vb.layoutCtrlWithLRTB(Q,null,null,null,25,0,null);vb.layoutCtrlCenterAlign(H,16);vb.layoutCtrlWithLRTB(H,null,null,null,5,null,16);z.appendTo(M)}t?(z.show(),ia.setSplitLineWide(33)):
(z.hide(),ia.setSplitLineWide(8))},qb=function(){if(ea){var t=ea.getAllSource();t=!t||0==t.length;Cb!=t&&(Cb=t,Va(),ha.collapseSecondHalf(t));var H=ea.getAllNodes();H=!H||0==H.length;ma||(H?(ib(!0),aa(!0),da.show(!1)):xa());H?(Ra||(Ra=new ab,Ra.setNodeStatusMonitor(fa),Ra.getJqUi().appendTo(ia.getJqUi())),Ra.setNoNode(H),Ra.setNoSource(t),Ra.show(),z&&z.css("z-index",0)):(Ra&&Ra.hide(),z&&z.css("z-index",100))}},Cb=!1,ma=!1,xa=function(){ib(!1);aa(!1);da.show(!0)},ib=function(t){if(!ua){ua=$("<div>");
ua.on("click",xa);ua.addClass("modeler-designer-preview-show-btn");var H=$("<div>");H.appendTo(ua);sa.backgroundWithHover(H,"upArrow");var Q=$("<div>");Q.text(ub.get("fieldAndPreviewData","\u5b57\u6bb5/\u9884\u89c8"));Q.appendTo(ua);vb.layoutCtrlMiddleAlign(Q,20);vb.layoutCtrlMiddleAlign(H,16);vb.layoutCtrlWithLRTB(Q,5,null,120,null,null,null);vb.layoutCtrlWithLRTB(H,null,5,16,null,null,16);ua.appendTo($a.getJqUi())}t?(ua.show(),$a.setSplitLineWide(33)):(ua.hide(),$a.setSplitLineWide(8))},Pb=!1,aa=
function(t){Pb!=t&&($a.collapseSecondHalf(t),Pb=t)},Y=function(t,H){if(t==wb.KEY_ADD_PREPARED_SOURCE||t==wb.KEY_REMOVE_PREPARED_SOURCE||t==wb.KEY_SET_PREPARED_SOURCE||t==nb.KEY_ADD_NODE||t==nb.KEY_REMOVE_NODE)console.log("update main ui"),qb()}}function Ca(){var r,M,P,G,za;this.getJqUi=function(){r||(r=$("<div>"),r.addClass("modeler-designer-statusbar"),M=$("<span>"),M.addClass("modeler-designer-statusbar-name"),M.appendTo(r),P=$("<span>"),P.addClass("modeler-designer-statusbar-dirtystate"),P.appendTo(r),
G=$("<span>"),G.addClass("modeler-designer-statusbar-prompt"),G.appendTo(r));return r};this.setCurrentName=function(fa){M.text(fa)};this.showDirtyState=function(fa){P.text(fa?"*":"")};this.showShortPrompt=function(fa,W,C){clearTimeout(za);G.text(fa);G.css("color",C?C:"");if(W){var ia=0,ha=function(){if(6<ia)ea();else{if(0==ia%2){G.text(fa);var $a=650}else G.text(""),$a=350;za=setTimeout(ha,$a);ia++}};ha()}else ea()};var ea=function(){za=setTimeout(function(){G.text("")},5E3)}}function cb(){var r=
new Ab,M,P=$("<div>"),G=$("<div>"),za=$("<div>");this.getJqUi=function(){M||(M=r.getJqUi(),M.addClass("modeler-designer-toolbar"),ea(P),ea(G),ea(za));return M};this.addButton=function(W,C,ia,ha){return fa(G,!1,W,C,ia,ha)};this.addButtonForHeadCustom=function(W,C,ia,ha){return fa(P,!1,W,C,ia,ha)};this.addButtonForTailCustom=function(W,C,ia,ha){return fa(za,!1,W,C,ia,ha)};this.addMenuButton=function(W,C,ia,ha){return fa(G,!0,W,C,ia,ha)};this.addMenuButtonForHeadCustom=function(W,C,ia,ha){return fa(P,
!0,W,C,ia,ha)};this.addMenuButtonForTailCustom=function(W,C,ia,ha){return fa(za,!0,W,C,ia,ha)};this.getAllBtnWidth=function(){return P.width()+G.width()+za.width()};var ea=function(W){W.css({"float":"left",position:"relative",height:"100%"});W.appendTo(M)},fa=function(W,C,ia,ha,$a,Ia){W=r.createButton(W,C,ia,$a,Ia?Ia:$a);W.setIconSetter(function(ka,Ga){sa.background(ka,Ga)});W.setIconName(ha);return W}}function ab(){var r,M,P,G,za;this.setNodeStatusMonitor=function(C){};this.setNoNode=function(C){W()};
this.setNoSource=function(C){P=C;W()};this.show=function(){r&&r.show()};this.hide=function(){r&&r.hide()};this.getJqUi=function(){r||(r=$("<div>"),r.css("background","#f7f7f7"),r.css("z-index",1E3),vb.layoutCtrlWithLRTB(r,0,0,null,0,0,null),W());return r};var ea=function(){if(!G){G=$("<div>");vb.layoutCtrlMiddleAlign(G,180);vb.layoutCtrlCenterAlign(G,260);G.appendTo(r);M=$("<div>");M.addClass("modeler-designer-no-node-prompt");vb.layoutCtrl(M,10,0,260,20);M.appendTo(G);M.text(ub.get("dragInNode",
"\u62d6\u5165\u8868\uff0c\u5f00\u59cb\u521b\u5efa\u6a21\u578b"));var C=$("<div>");vb.layoutCtrl(C,0,40,253,140);sa.background(C,"drag_node_prompt");C.appendTo(G)}return G},fa=function(){za||(za=$("<div>"),vb.layoutCtrlMiddleAlign(za,170),vb.layoutCtrlCenterAlign(za,210),sa.background(za,"no_node_and_source"),za.appendTo(r));return za},W=function(){P?(ea().hide(),fa().show()):(ea().show(),fa().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 sb=com.kingdee.bos.qing.modeler.designer;sb.Designer=function(){var r=this,M,P=new cb,G=new R,za=new Ca,ea=new O,fa=new J,W,C,ia,ha,$a,Ia,ka,Ga=!0,la;this.setMessageResize=function(ma){la=ma};var da=
new function(){this.getModelerModel=function(){Ia||(Ia=new nb,sb.NodeFieldHelper.init(Ia),fa.init(Ia));return Ia};this.getIntegration=function(){return ka};this.getTopJqUi=function(){return M};this.getMessageCurtain=function(){return C};this.getCommandManager=function(){return G};this.getRemoteImpl=function(){return ia};this.getNodeStatusMonitor=function(){return ea}};this.setEditable=function(ma){Ga=ma};this.isEditable=function(){return Ga};this.setRemoteImpl=function(ma){ia=ma;W&&W.setRemoteImpl(ia);
sb.NodeFieldHelper.setRemoteImpl(ia);fa.setRemoteImpl(ia)};this.setIntegration=function(ma){ka=ma};this.getIntegration=function(){return ka};this.setLockInfo=function(ma,xa,ib){sb.LockHelper.setLockInfo(ma,xa,ib)};this.setLockStateChangeListener=function(ma){sb.LockHelper.setLockStateChangeListener(ma)};this.registerLockRequestSender=function(ma){sb.LockHelper.registerLockRequestSender(ma)};this.createJqUi=function(){M=$("<div onselectstart='return false'>");M.addClass("modeler-designer");C=new Nb;
C.getJqUi().appendTo(M);Hb();Gb();Ga&&(sb.LockHelper.setGlobal(da),sb.LockHelper.show(M));ua();M.append(P.getJqUi());M.append(za.getJqUi());W=new qa;W.setRemoteImpl(ia);W.setGlobal(da);W.setNodeStatusMonitor(ea);W.setModelerChecker(fa);M.append(W.getJqUi());G.addPerformedListener(Ua);return M};this.resize=function(){Cb()};this.clearDirty=function(){Db(!1)};this.isDirty=function(){return ha};this.setDirtyListener=function(ma){$a=ma};this.insertToolbarBtn=function(ma,xa,ib,Pb){return P.addButtonForHeadCustom(ma,
xa,ib,Pb)};this.insertMenuButton=function(ma,xa,ib,Pb){return P.addMenuButtonForHeadCustom(ma,xa,ib,Pb)};this.appendToolbarBtn=function(ma,xa,ib,Pb){return P.addButtonForTailCustom(ma,xa,ib,Pb)};this.getMsgCurtain=function(){return C};this.getJsonModel=function(){var ma=da.getModelerModel(),xa=new Fa;xa.setModelerModel(ma);return xa.toJsonObject()};this.setJsonModel=function(ma){if(ma){var xa=new Fa;xa.fromJsonObject(ma);z(xa.getModelerModel())}else z(new nb);da.getCommandManager().reset();Db(!1);
ka&&!ka.isValidModel()?C.showError(ub.get("modelIsInvalid","\u6a21\u578b\u89e3\u6790\u5f02\u5e38\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u6a21\u578b\u3002")):W.showDialogIfNoSource()};this.setJsonValidity=function(ma,xa){fa&&fa.setGlobalCheckResult(ma,!1,xa)};this.setUndoAbleJsonModel=function(ma,xa){var ib=new Fa;ib.fromJsonObject(ma);ma=ib.getModelerModel();ib=new X;ib.setCaption(xa);ib.setValue(Ia,ma,z);G.perform(ib)};var z=function(ma){sb.NodeResultCache.clear();ea.reset();Ia&&Ia.clearPropertyChangeCallback();
Ia=ma;sb.NodeFieldHelper.init(Ia);fa.init(Ia);W.updateModelerModel();ma=r.getJsonModel();fa&&fa.backgroundCheck(ma);a:if((ma=Ia.getAllNodes())&&0!=ma.length){for(var xa=0;xa<ma.length;xa++){var ib=ma[xa];if(ib instanceof Aa){ea.setSelected(ib);break a}}ea.setSelected(ma[0])}},ua=function(){var ma=P.addButton(Ra,"btn_undo",ub.get("undo","\u64a4\u6d88")),xa=P.addButton(Ja,"btn_redo",ub.get("redo","\u53cd\u64a4\u6d88"));P.addButton(mb,"btn_clean",ub.get("clear","\u6e05\u9664"));ma.setEnabled(G.isCanUndo());
xa.setEnabled(G.isCanRedo());G.addPerformedListener(function(ib,Pb,aa){ma.setEnabled(G.isCanUndo());xa.setEnabled(G.isCanRedo())});r.isEditable()&&P.addButton(Va,"btn_check",ub.get("checkModeler","\u6a21\u578b\u6821\u9a8c"));P.addButton(ob,"btn_preview",ub.get("preview","\u9884\u89c8"));P.addButton(Bb,"btn_materialized_config",ub.get("materializedConfig","\u7269\u5316\u5b58\u50a8\u8bbe\u7f6e"))},Ra=function(){G.isCanUndo()&&G.undo();Ha.occur(Ha.BUTTON_TYPE,Ha.UNDO)},Ja=function(){G.isCanRedo()&&G.redo();
Ha.occur(Ha.BUTTON_TYPE,Ha.REDO)},Ua=function(ma,xa,ib){Db(!0);ma&&(xa=xa?"":(ib?ub.get("undo","\u64a4\u6d88"):ub.get("redo","\u53cd\u64a4\u6d88"))+" ",xa+=ma.getCaption(),za.showShortPrompt(xa),(ma instanceof na||ma instanceof ja)&&ea.setSelected(ma.getNode()))},mb=function(){var ma=new X;ma.setCaption(ub.get("clear","\u6e05\u9664"));var xa=new nb;xa.batchAddSource(Ia.getAllSource());xa.batchAddTable(Ia.getAllUserSqlTables());ma.setValue(Ia,xa,z);G.perform(ma);Ha.occur(Ha.BUTTON_TYPE,Ha.CLEAR)},
Gb=function(){fa.init(da.getModelerModel());fa.setGlobal(da);fa.setNodeStatusMonitor(ea);sb.NodeFieldHelper.setNodeInvalidCallback(function(ma,xa){fa.updateNodeValidity(ma,xa)})},Va=function(){fa.check(r.getJsonModel());Ha.occur(Ha.BUTTON_TYPE,Ha.MODEL_CHECK)},ob=function(){var ma=new wa;ma.setRemoteImpl(ia);ma.setGlobal(da);ma.setNode(ea.getSelected());ma.check(r.getJsonModel());Ha.occur(Ha.BUTTON_TYPE,Ha.MODEL_PREVIEW)},Bb=function(){var ma=new Qa;ma.setGlobal(da);ma.setRemoteImpl(ia);ma.setSupportIncrementConfig(Ia.getType()===
wb.TYPE_TABLE_MODELER);ma.showDialog()},Db=function(ma){ha=ma;za&&za.showDirtyState(ha);$a&&$a(ha)},Hb=function(){qb();var ma=new Jb;ma.setCallbackImmediately(function(){qb()});ma.setDelay(100);ma.setCallback(function(){Cb()});ma.observe()},qb=function(){document.body.style.height=document.documentElement.clientHeight+"px"},Cb=function(){sb.LockHelper.setMaxWidth(M.width()-P.getAllBtnWidth());W.resize();la&&la()}};var vb,Ab,Yb,Nb,ub,Jb,Fa,Aa,nb,wb,sa,N,Ma,Mb,ra,Z,Ka,ta,O,R,na,ja,X,J,wa,La,Oa,Ha,Qa;
(function(){var r=com.kingdee.bos.qing.ui.component;Ab=r.Toolbar;Yb=r.SplitPane;Nb=r.MessageCurtain;r=com.kingdee.bos.qing.common;vb=r.DomUtil;r=sb;Fa=r.QingModeler;Aa=sb.TableNode;wb=r.ModelerModel;sa=r.Icons;N=r.SourceArea;Ma=r.SourceConnectStep;Mb=r.TableArea;ra=r.PropertyArea;Z=r.PageArea;Ka=r.PreviewArea;ta=r.DragHandler;nb=r.TableModeler;O=r.NodeStatusMonitor;R=r.CommandManager;na=r.ActionChangeConfig;ja=r.ActionNodeFieldSetting;J=r.ModelerChecker;X=r.ActionSetModel;wa=r.ModelPreviewDialog;
La=r.TableNodeFactory;Oa=r.TableModelerDisplayNameHelper;Qa=r.MaterializedConfigDialog;Ha=r.UserOperationReporter;r=com.kingdee.bos.qing.framework.common;ub=r.MultilanguageManager.createPackageAccessor(sb);Jb=r.WindowResizeObserver})()})();
//qingVersionTag: 20250415