var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(ta){var Da=0;return function(){return Da<ta.length?{done:!1,value:ta[Da++]}:{done:!0}}};$jscomp.arrayIterator=function(ta){return{next:$jscomp.arrayIteratorImpl(ta)}};$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(ta,Da,Va){if(ta==Array.prototype||ta==Object.prototype)return ta;ta[Da]=Va.value;return ta};$jscomp.getGlobal=function(ta){ta=["object"==typeof globalThis&&globalThis,ta,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var Da=0;Da<ta.length;++Da){var Va=ta[Da];if(Va&&Va.Math==Math)return Va}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(ta,Da){var Va=$jscomp.propertyToPolyfillSymbol[Da];if(null==Va)return ta[Da];Va=ta[Va];return void 0!==Va?Va:ta[Da]};
$jscomp.polyfill=function(ta,Da,Va,mb){Da&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(ta,Da,Va,mb):$jscomp.polyfillUnisolated(ta,Da,Va,mb))};$jscomp.polyfillUnisolated=function(ta,Da,Va,mb){Va=$jscomp.global;ta=ta.split(".");for(mb=0;mb<ta.length-1;mb++){var Xa=ta[mb];if(!(Xa in Va))return;Va=Va[Xa]}ta=ta[ta.length-1];mb=Va[ta];Da=Da(mb);Da!=mb&&null!=Da&&$jscomp.defineProperty(Va,ta,{configurable:!0,writable:!0,value:Da})};
$jscomp.polyfillIsolated=function(ta,Da,Va,mb){var Xa=ta.split(".");ta=1===Xa.length;mb=Xa[0];mb=!ta&&mb in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var ca=0;ca<Xa.length-1;ca++){var Y=Xa[ca];if(!(Y in mb))return;mb=mb[Y]}Xa=Xa[Xa.length-1];Va=$jscomp.IS_SYMBOL_NATIVE&&"es6"===Va?mb[Xa]:null;Da=Da(Va);null!=Da&&(ta?$jscomp.defineProperty($jscomp.polyfills,Xa,{configurable:!0,writable:!0,value:Da}):Da!==Va&&(void 0===$jscomp.propertyToPolyfillSymbol[Xa]&&(Va=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[Xa]=
$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(Xa):$jscomp.POLYFILL_PREFIX+Va+"$"+Xa),$jscomp.defineProperty(mb,$jscomp.propertyToPolyfillSymbol[Xa],{configurable:!0,writable:!0,value:Da})))};$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(ta){if(ta)return ta;var Da=function(ca,Y){this.$jscomp$symbol$id_=ca;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:Y})};Da.prototype.toString=function(){return this.$jscomp$symbol$id_};var Va="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",mb=0,Xa=function(ca){if(this instanceof Xa)throw new TypeError("Symbol is not a constructor");return new Da(Va+(ca||"")+"_"+mb++,ca)};return Xa},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(ta){if(ta)return ta;ta=Symbol("Symbol.iterator");for(var Da="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),Va=0;Va<Da.length;Va++){var mb=$jscomp.global[Da[Va]];"function"===typeof mb&&"function"!=typeof mb.prototype[ta]&&$jscomp.defineProperty(mb.prototype,ta,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return ta},
"es6","es3");$jscomp.iteratorPrototype=function(ta){ta={next:ta};ta[Symbol.iterator]=function(){return this};return ta};$jscomp.iteratorFromArray=function(ta,Da){ta instanceof String&&(ta+="");var Va=0,mb=!1,Xa={next:function(){if(!mb&&Va<ta.length){var ca=Va++;return{value:Da(ca,ta[ca]),done:!1}}mb=!0;return{done:!0,value:void 0}}};Xa[Symbol.iterator]=function(){return Xa};return Xa};
$jscomp.polyfill("Array.prototype.keys",function(ta){return ta?ta:function(){return $jscomp.iteratorFromArray(this,function(Da){return Da})}},"es6","es3");$jscomp.findInternal=function(ta,Da,Va){ta instanceof String&&(ta=String(ta));for(var mb=ta.length,Xa=0;Xa<mb;Xa++){var ca=ta[Xa];if(Da.call(Va,ca,Xa,ta))return{i:Xa,v:ca}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(ta){return ta?ta:function(Da,Va){return $jscomp.findInternal(this,Da,Va).v}},"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 ta="! $ & * + , - . / : < << = > @ 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(Da){return Da&&0!=Da.length?-1<ta.indexOf(Da.trim().toUpperCase()):!0}}})();(function(){function ta(){var y=this,S,T=[],m=[],r=[],qa;this.setType=function(d){S=d};this.getType=function(){return S};this.supportIncrementalMaterialize=function(){return!1};this.protectedIsTableInUse=function(){throw Error("override me");};this.insertSource=function(d,b){for(var a=!1,l=d.getSourceId(),c=0;c<T.length;c++)if(l==T[c].getSourceId()){a=!0;break}a||(T.splice(b,0,d),k(ta.KEY_ADD_PREPARED_SOURCE,[d]))};this.batchAddSource=function(d){for(var b=[],a=0;a<d.length;a++){for(var l=!1,c=d[a],
e=c.getSourceId(),g=0;g<T.length;g++)if(e==T[g].getSourceId()){l=!0;break}l||(T.push(c),b.push(c))}k(ta.KEY_ADD_PREPARED_SOURCE,b)};this.setSource=function(d,b){T=d;!b&&k(ta.KEY_SET_PREPARED_SOURCE,T)};this.removeSource=function(d){var b=T.indexOf(d);return-1<b?(T.splice(b,1),k(ta.KEY_REMOVE_PREPARED_SOURCE,[d]),b):-1};this.batchRemoveUserSqlTable=function(d){d=y.getUserSqlTables(d);for(var b=0;b<d.length;b++)y.removeTableIfUseless(d[b])};this.batchRemoveSource=function(d){for(var b=0;b<d.length;b++){var a=
T.indexOf(d[b]);-1<a&&T.splice(a,1)}k(ta.KEY_REMOVE_PREPARED_SOURCE,d)};this.getSource=function(d){for(var b=0,a=T.length;b<a;b++)if(T[b].getId()==d)return T[b]};this.getAllSource=function(){return T};this.isSourceUsed=function(d){d=d.getId();for(var b=0,a=m.length;b<a;b++){var l=m[b];if(l.getSourceUid()==d&&y.protectedIsTableInUse(l))return!0}return!1};this.addTable=function(d){for(var b=0,a=m.length;b<a;b++)if(m[b].isSame(d))return;m.push(d);d.addPropertyChangeCallback(k);k(ta.KEY_ADD_TABLE,d)};
this.updateTable=function(d,b){for(var a=-1,l=0,c=m.length;l<c;l++)if(m[l].isSame(b)){a=l;break}-1<a&&(m.splice(a,1),m.splice(a,0,d),b.removePropertyChangeCallback(k),d.addPropertyChangeCallback(k))};this.batchAddTable=function(d){for(var b=0;b<d.length;b++)y.addTable(d[b])};this.setTables=function(d){m=d};this.getTable=function(d){for(var b=0,a=m.length;b<a;b++)if(m[b].getUid()==d)return m[b]};this.removeTable=function(d){var b=m.indexOf(d);-1<b&&(m.splice(b,1),d.removePropertyChangeCallback(k),
k(ta.KEY_REMOVE_TABLE,d));return b};this.batchRemoveTable=function(d){for(var b=0;b<d.length;b++){var a=d[b];y.removeTable(a);a.removePropertyChangeCallback(k)}};this.insertTable=function(d,b){for(var a=0,l=m.length;a<l;a++)if(m[a].isSame(d))return;m.splice(b,0,d);d.addPropertyChangeCallback(k);k(ta.KEY_ADD_TABLE,d)};this.getUserSqlTables=function(d){for(var b=[],a=0,l=m.length;a<l;a++){var c=m[a];c.isUserSql()&&c.getSourceUid()==d&&b.push(c)}return b};this.getAllUserSqlTables=function(){for(var d=
[],b=0,a=m.length;b<a;b++)m[b].isUserSql()&&d.push(m[b]);return d};this.getAllTable=function(d){for(var b=[],a=0,l=m.length;a<l;a++){var c=m[a];d?(y.protectedIsTableInUse(c)||c.isUserSql())&&b.push(c):y.protectedIsTableInUse(c)&&b.push(c)}return b};this.getSameTable=function(d){for(var b=0,a=m.length;b<a;b++)if(m[b].isSame(d))return m[b]};this.isSameTableAndSourceExist=function(d,b,a){for(var l=0;l<m.length;l++){var c=m[l];if(c.getTableName()==b&&c.getNamespace()==a&&y.getSource(c.getSourceUid()).getSourceId()==
d)return!0}return!1};this.setMaterializedConfig=function(d){qa=d};this.getMaterializedConfig=function(){return qa};this.toJsonObject=function(){var d={};d.type=S;for(var b=[],a=0;a<T.length;a++)b.push(T[a].toJsonObject());d.sources=b;b=[];for(a=0;a<m.length;a++){var l=m[a];(y.protectedIsTableInUse(l)||l.isUserSql())&&b.push(l.toJsonObject())}d.tables=b;qa&&(d.materializedConfig=qa.toJsonObject());y.protectedToJsonObject(d);return d};this.fromJsonObject=function(d){S=d.type;var b=d.sources;if(b)for(var a=
0;a<b.length;a++){var l=b[a],c=new Xa;c.fromJsonObject(l);T.push(c)}if(b=d.tables)for(a=0;a<b.length;a++)l=new Va,l.fromJsonObject(b[a]),l.addPropertyChangeCallback(k),m.push(l);(a=d.materializedConfig)?(qa=new Ea,qa.fromJsonObject(a)):qa=null;y.protectedFromJsonObject(d)};this.isUserSqlTableInUse=function(d){d=y.getSameTable(d);return y.protectedIsTableInUse(d)};this.protectedToJsonObject=function(d){};this.protectedFromJsonObject=function(d){};this.addPropertyChangeCallback=function(d){r.push(d)};
this.removePropertyChangeCallback=function(d){d=r.indexOf(d);-1<d&&r.splice(d,1)};this.clearPropertyChangeCallback=function(){r=[]};var k=function(d,b){for(var a=0,l=r.length;a<l;a++)r[a](d,b)};this.protectedMethod={firePropertyChangeEvt:k,copy:function(d){d.setType(S);for(var b=[],a=0;a<T.length;a++)b.push(T[a].copy());d.setSource(b,!0);b=[];for(a=0;a<m.length;a++)b.push(m[a].clone());d.setTables(b);qa&&d.setMaterializedConfig(qa.copy())}}}function Da(){var y=this,S,T,m,r,qa,k,d,b,a=[];this.setId=
function(c){S=c};this.getId=function(){return S};this.setAlias=function(c){T=c;r=void 0;l(ta.KEY_NODE_CHANGE_ALIAS,y)};this.getAlias=function(){return T};this.setNameIndex=function(c){r=c};this.getNameIndex=function(){return r};this.getX=function(){return qa};this.getY=function(){return k};this.getWidth=function(){return d};this.getHeight=function(){return b};this.setPosition=function(c,e){qa=c;k=e};this.changePosition=function(c,e){y.setPosition(c,e);l(ta.KEY_NODE_CHANGE_POSITION,y)};this.setSize=
function(c,e){d=c;b=e};this.setType=function(c){m=c};this.getType=function(c){return m};this.addPropertyChangeCallback=function(c){a.push(c)};this.removePropertyChangeCallback=function(c){c=a.indexOf(c);-1<c&&a.splice(c,1)};this.toJsonObject=function(){var c={};c.id=S;c.alias=T;c.x=qa;c.y=k;c.type=m;r&&(c.nameIndex=r);y.protectedToJson(c);return c};this.fromJsonObject=function(c){S=c.id;T=c.alias;qa=c.x;k=c.y;m=c.type;var e=parseInt(c.nameIndex);isNaN(e)||(r=e);y.protectedFromJson(c)};this.protectedToJson=
function(c){};this.protectedFromJson=function(c){};var l=function(c,e){for(var g=0,v=a.length;g<v;g++)a[g](c,e)};this.protectedMethod={firePropertyChangeEvt:function(c){l(c,y)}}}function Va(){var y=this,S,T,m,r,qa,k,d,b=[],a=[];this.setUid=function(c){S=c};this.getUid=function(){return S};this.isUserSql=function(){return k?!0:!1};this.getUserSql=function(){return k};this.setUserSql=function(c){k=c};this.setTableName=function(c){T=c};this.getTableName=function(){return T};this.setSourceUid=function(c){m=
c};this.getSourceUid=function(){return m};this.setNamespace=function(c){r=c};this.getNamespace=function(){return r};this.setDisplayName=function(c){qa=c};this.getDisplayName=function(){return qa};this.setSelectedFields=function(c){d=c;l(ta.KEY_TABLE_SELECT_FIELD,y)};this.getSelectedFields=function(){return d};this.setFilterItems=function(c){b=c;l(ta.KEY_TABLE_SET_FILTER,y)};this.getFilterItems=function(){return b};this.addPropertyChangeCallback=function(c){a.push(c)};this.removePropertyChangeCallback=
function(c){c=a.indexOf(c);-1<c&&a.splice(c,1)};this.isSame=function(c){return m==c.getSourceUid()&&T==c.getTableName()&&r==c.getNamespace()&&(!y.isUserSql()&&!c.isUserSql()||y.isUserSql()&&c.isUserSql()&&(c=c.getUserSql(),c.getSqlType()==k.getSqlType()&&c.getContent()==k.getContent()))?!0:!1};this.toJsonObject=function(){var c={};c.id=S;c.name=T;c.sourceId=m;c.namespace=r;y.isUserSql()&&(c.userSQL=k.toJsonObject());if(d){for(var e=[],g=0;g<d.length;g++)e.push(d[g].toJsonObject());c.selectedFields=
e}if(b){e=[];for(g=0;g<b.length;g++)e.push(b[g].toJsonObject());c.filterItems=e}return c};this.fromJsonObject=function(c){S=c.id;T=c.name;m=c.sourceId;r=c.namespace;qa=c.displayName;c.userSQL&&(k=new mb,k.fromJsonObject(c.userSQL));var e=c.selectedFields;if(e){for(var g=[],v=0;v<e.length;v++){var u=new ca;u.fromJsonObject(e[v]);g.push(u)}d=g}if(c=c.filterItems){e=[];for(v=0;v<c.length;v++)g=new D,g.fromJsonObject(c[v]),e.push(g);b=e}};this.clone=function(){var c=new Va;c.setUid(S);c.setTableName(T);
c.setNamespace(r);c.setDisplayName(qa);c.setSourceUid(m);k&&c.setUserSql(k.copy());var e=[];if(d){for(var g=0;g<d.length;g++)e.push(d[g].clone());c.setSelectedFields(e)}e=[];for(g=0;g<b.length;g++)e.push(b[g].copy());c.setFilterItems(e);return c};var l=function(c,e){for(var g=0,v=a.length;g<v;g++)a[g](c,e)}}function mb(){var y,S;this.getSqlType=function(){return y};this.setSqlType=function(T){y=T};this.setContent=function(T){S=T};this.getContent=function(){return S};this.fromJsonObject=function(T){y=
T.type;S=T.content};this.toJsonObject=function(){var T={};T.type=y;T.content=S;return T};this.copy=function(){var T=new mb;T.setSqlType(y);T.setContent(S);return T}}function Xa(){var y,S,T,m,r,qa;this.setId=function(k){y=k};this.getId=function(){return y};this.getSourceId=function(){return S};this.setSourceId=function(k){S=k};this.setSourceRefId=function(k){T=sId};this.getSourceRefId=function(){return T};this.getName=function(){return m};this.setName=function(k){m=k};this.setSourceType=function(k){r=
k};this.getSourceType=function(){return r};this.setModelId=function(k){qa=k};this.getModelId=function(){return qa};this.copy=function(){var k=new Xa;k.setId(y);k.setSourceId(S);k.setSourceType(r);k.setName(m);k.setSourceType(r);k.setModelId(qa);return k};this.toJsonObject=function(){var k={};k.id=y;k.modelSetSourceId=S;k.modelSetSourceRefId=T;k.modelId=qa;return k};this.fromJsonObject=function(k){y=k.id;S=k.modelSetSourceId;T=k.modelSetSourceRefId;r=k.type;m=k.name}}function ca(){var y=this,S,T,m,
r,qa,k,d,b,a,l;this.setTableId=function(e){S=e};this.getTableId=function(){return S};this.setFromNode=function(e){T=e};this.getSourceNodeId=function(){return T};this.setName=function(e){m=e};this.getName=function(){return m};this.getFullName=function(){return T?T+"_"+m:S+"_"+m};this.setAlias=function(e){r=e};this.getAlias=function(){return r?r:m};this.setDataType=function(e){c(e);qa=e};this.getDataType=function(){return qa};this.setAppointedDataType=function(e){e&&c(e);k=e==qa?null:e};this.getAppointedDataType=
function(){return k};this.getOutputDataType=function(){return k?k:qa};this.setRoundMode=function(e){b=e};this.getRoundMode=function(){return b};this.setScale=function(e){d=e};this.getScale=function(){return d};this.getFormat=function(){return a};this.setFormat=function(e){a=e};this.setExtensions=function(e){l=e};this.getEnumValue=function(){return l?l[ca.EXTENSION_BIZ_FIELD_ENUM_KEY]:null};this.isMulBaseData=function(){return l?l[ca.EXTENSION_IS_MUL_BASE_DATA]:!1};this.isPk=function(){return l?l[ca.EXTENSION_IS_PK]:
!1};this.isEnum=function(){if(y.isMulBaseData()||y.getOutputDataType()!=ca.DT_STRING)return!1;var e=y.getEnumValue();return 0==(e?Object.keys(e):[]).length?!1:!0};this.fromJsonObject=function(e){m=e.name;r=e.alias;qa=e.dataType;k=e.appointedDataType;T=e.fromNode;void 0!=e.scale&&(d=e.scale);e.roundMode&&(b=e.roundMode);l=e.extensions;e.format&&(a=e.format);e.tableId&&(S=e.tableId)};this.toJsonObject=function(){var e={};e.name=m;e.alias=r;e.dataType=qa;e.fromNode=T;k&&(e.appointedDataType=k);void 0!=
d&&(e.scale=d);b&&(e.roundMode=b);l&&(e.extensions=l);S&&(e.tableId=S);return e};var c=function(e){if(e!==ca.DT_STRING&&e!==ca.DT_INT&&e!==ca.DT_NUMBER&&e!==ca.DT_DATE&&e!==ca.DT_DATETIME&&e!==ca.DT_BOOLEAN)throw Error("IllegalArgument: "+e);};this.clone=function(){var e=new ca;e.setName(m);qa&&e.setDataType(qa);e.setAlias(r);k&&e.setAppointedDataType(k);e.setFromNode(T);void 0!=d&&e.setScale(d);b&&e.setRoundMode(b);e.setExtensions(l);a&&e.setFormat(a);S&&e.setTableId(S);return e};this.equals=function(e){return m==
e.getName()&&r==e.getAlias()&&k==e.getAppointedDataType()&&d==e.getScale()&&b==e.getRoundMode()?!0:!1}}function Y(){var y,S;this.setExtractPartlyData=function(T,m){y=T;S=m};this.setExtractAllData=function(T){y=Y.ALL_DATA_NUMBER;S=T};this.toJsonObject=function(){var T={};T.extractCount=y;T.previewCount=S;return T}}function Ma(){var y=this,S,T;this.setId=function(m){S=m};this.getId=function(){return S};this.toJsonObject=function(){var m={};m.id=S;m.type=T;y.protectedToJson(m);return m};this.protectedToJson=
function(m){};this.protectedMethod={setType:function(m){T=m}}}function oa(){var y=[],S,T=[];this.isValid=function(){return S};this.getCases=function(){return T};this.getCheckedNodeIds=function(){return y};this.fromJsonObject=function(m){S=m.valid;y=m.nodeIds;if(m=m.cases){T=[];for(var r=new A,qa=0;qa<m.length;qa++){var k=m[qa],d=r.getInvalidityCase(k.type);k&&(d.fromJsonObject(k),T.push(d))}}}}function A(){this.getInvalidityCase=function(y){switch(y){case Q.TYPE_MULTI_OUTPUT:return new Z;case Q.TYPE_LACK_OUTPUT:return new O;
case Q.TYPE_INVALID_CONFIG:return new ia;case Q.TYPE_LACK_INPUT:return new ba;case Q.TYPE_INVALID_UPWARDNODE:return new n;case Q.TYPE_INVALID_SOURCE:return new Ba;case Q.TYPE_TABLE_NO_FIELD:return new I;case Q.TYPE_TABLE_NO_AUTHORITY:return new Ha}}}function Q(){var y,S=this;this.getType=function(){return y};this.fromJsonObject=function(T){y=T.type;S.protectedFromJsonObject(T)};this.protectedFromJsonObject=function(T){}}function Z(){Q.call(this);var y=[];this.protectedFromJsonObject=function(S){y=
S.outputNodes};this.getOutputNodeIds=function(){return y}}function O(){Q.call(this)}function ia(){Q.call(this);var y;this.protectedFromJsonObject=function(S){y=S.nodeIds};this.getNodeIds=function(){return y}}function Ha(){Q.call(this);var y;this.protectedFromJsonObject=function(S){y=S.nodeIds};this.getNodeIds=function(){return y}}function ba(){Q.call(this);var y;this.protectedFromJsonObject=function(S){y=S.nodeIds};this.getNodeIds=function(){return y}}function n(){Q.call(this);var y;this.protectedFromJsonObject=
function(S){y=S.nodeIds};this.getNodeIds=function(){return y}}function Ba(){Q.call(this);var y;this.protectedFromJsonObject=function(S){y=S.nodeIds};this.getNodeIds=function(){return y}}function I(){Q.call(this);var y;this.protectedFromJsonObject=function(S){y=S.nodeIds};this.getNodeIds=function(){return y}}function P(){var y,S=[],T=[];this.getField=function(m){return S[m]};this.getAllField=function(){return S};this.getColumnCount=function(){return S?S.length:0};this.getOneRow=function(m){return T[m]};
this.getRowCount=function(){return T?T.length:0};this.getNodeId=function(){return y};this.fromJsonObject=function(m){for(var r=m.fields,qa=0;qa<r.length;qa++){var k=new ca;k.fromJsonObject(r[qa]);S.push(k)}T=m.data;y=m.nodeId}}function D(){var y,S,T,m,r=0,qa=0,k,d=null;this.setField=function(a){(y=a)&&!a.isMulBaseData()&&S&&T&&(a=a.getOutputDataType(),a!==ca.DT_DATE&&a!==ca.DT_DATETIME||D.REG_DATETIME.test(T)||D.isCompareOpWithinOrNotWithinValue(S)||(T=(new Date).getTime()));b()};this.updateNotExistFieldByMyself=
function(){var a=new ca;a.setFromNode(y.getSourceNodeId());a.setName(y.getName());a.setAlias(y.getAlias());y=a};this.updateNotExistField=function(a){var l=new ca;l.setFromNode(a.getSourceNodeId());l.setName(a.getName());l.setAlias(a.getAlias());y=l};this.getField=function(){return y};this.getTargetFieldFullName=function(){return y?y.getFullName():null};this.setCompareOp=function(a){S=a};this.getCompareOp=function(){return S};this.setValue=function(a){T=a;b()};this.getValue=function(){return T};this.setDisplayValue=
function(a){m=a};this.getDisplayValue=function(a){return m?!a&&D.isCompareOpWithinOrNotWithinValue(S)?JSON.parse(m).join(","):D.isCompareOpRelativeDateRangeValue(S)?(a=y.getOutputDataType()===ca.DT_DATETIME,za.modelToDisplayText(d,a)):m:""};this.setLeftBracketCount=function(a){r=a};this.getLeftBracketCount=function(){return r};this.setRightBracketCount=function(a){qa=a};this.getRightBracketCount=function(){return qa};this.setLogicOp=function(a){k=a};this.getLogicOp=function(){return k};this.setRelativeDateRange=
function(a){d=a};this.getRelativeDateRange=function(){return d};this.isEmpty=function(){return 0===r&&0===qa&&!y&&!S&&!T&&!k};var b=function(){if(y&&S){var a=y.getOutputDataType();if(T){var l=y.isEnum(),c=y.isMulBaseData(),e=l?y.getEnumValue():null;if(D.isCompareOpWithinOrNotWithinValue(S))if(l){a=JSON.parse(T);l=[];for(c=0;c<a.length;c++){var g=e[a[c]];g&&l.push(g)}m=JSON.stringify(l)}else m=T;else c?m=T:a===ca.DT_DATE||a===ca.DT_DATETIME?(e=new Date,e.setTime(T),l=new com.kingdee.bos.qing.common.DateFormater,
c=l.setFormatString,a=a===ca.DT_DATE?"yyyy-MM-dd":"yyyy-MM-dd HH:mm:ss",c.call(l,a),m=l.format(e)):a===ca.DT_BOOLEAN?(e=com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(K),m=T===ca.BOOLEAN_TRUE?e.get("dataTypeTrue","\u771f"):T===ca.BOOLEAN_FALSE?e.get("dataTypeFalse","\u5047"):""):m=l?e[T]?e[T]:"":T}else m=D.isCompareOpRelativeDateRangeValue(S)&&null!=d?za.modelToDisplayText(d,a===ca.DT_DATETIME):null}};this.copy=function(){var a=new D;a.setField(y);a.setCompareOp(S);
a.setValue(T);a.setDisplayValue(m);a.setLeftBracketCount(r);a.setRightBracketCount(qa);a.setLogicOp(k);a.setRelativeDateRange(d);return a};this.equals=function(a){if(!a)return!1;var l;if(l=y.equals(a.getField())&&S===a.getCompareOp()&&T===a.getValue()&&r===a.getLeftBracketCount()&&qa===a.getRightBracketCount()&&k===a.getLogicOp())l=d||a.getRelativeDateRange()?d&&a.getRelativeDateRange()?JSON.stringify(d.toJsonObject())===JSON.stringify(a.getRelativeDateRange().toJsonObject()):!1:!0;return l?!0:!1};
this.toJsonObject=function(){if(!y)return null;var a={};a.field=y.toJsonObject();a.compareOp=S;a.value=T;a.displayValue=m;a.leftBrackets=r;a.rightBrackets=qa;a.logicOp=k;d&&(a.relativeDateRange=d.toJsonObject());return a};this.fromJsonObject=function(a){a&&(y=new ca,y.fromJsonObject(a.field),S=a.compareOp,T=a.value,m=a.displayValue,r=a.leftBrackets,qa=a.rightBrackets,k=a.logicOp,a=a.relativeDateRange)&&(d=new pa,d.fromJsonObject(a))}}function W(){var y=this,S,T=[];this.getNodeIdInConfig=function(){return[]};
this.addPropertyChangeCallback=function(m){T.push(m)};this.toJsonObject=function(){var m={};m.type=S;y.protectedToJsonObject(m);return m};this.fromJsonObject=function(m){S=m.type;y.protectedFromJsonObject(m)};this.protectedToJsonObject=function(m){};this.protectedFromJsonObject=function(m){};this.protectedMethod={firePropertyChangeEvt:function(m){for(var r=0,qa=T.length;r<qa;r++)T[r](m)},setType:function(m){S=m}}}function la(){W.call(this);var y=this,S=this.protectedMethod;S.setType(W.TYPE_FILTER);
var T=[];this.getFilterItems=function(){return T};this.setFilterItems=function(m){T=m};this.copyFilterItems=function(){for(var m=[],r=0;r<T.length;r++)m.push(T[r].copy());return m};this.firePropertyChangeEvt=function(){S.firePropertyChangeEvt(TableModeler.KEY_TRANSFORM_FILTER)};this.getNotEmptyFilterItems=function(){for(var m=[],r=0;r<T.length;r++)T[r].isEmpty()||m.push(T[r]);return m};this.protectedToJsonObject=function(m){for(var r=y.getNotEmptyFilterItems(),qa=[],k=0,d=r.length;k<d;k++)qa.push(r[k].toJsonObject());
m.filterItems=qa};this.protectedFromJsonObject=function(m){if(m){m=m.filterItems;for(var r=0;r<m.length;r++){var qa=new D;qa.fromJsonObject(m[r]);T.push(qa)}}};this.clone=function(){var m=new la;m.setFilterItems(y.getNotEmptyFilterItems());return m}}function Ea(){var y=Ea.TYPE_ONCE,S=Ea.STRATEGY_FULL,T,m;this.setType=function(r){if(r===Ea.TYPE_ONCE||r===Ea.TYPE_TIMING)y=r;else throw Error("IllegalArgument: "+r);};this.getType=function(){return y};this.setStrategy=function(r){if(r===Ea.STRATEGY_FULL||
r===Ea.STRATEGY_INCREMENTAL)S=r;else throw Error("IllegalArgument: "+r);};this.getStrategy=function(){return S};this.setSchedule=function(r){T=r};this.getSchedule=function(){return T};this.setBasedFields=function(r){m=r};this.getBasedFields=function(){return m};this.copy=function(){var r=new Ea;r.setType(y);r.setStrategy(S);T&&r.setSchedule(T.copy());if(m){for(var qa=[],k=0;k<m.length;k++)qa.push(m[k].copy());r.setBasedFields(qa)}return r};this.toJsonObject=function(){var r={};r.type=y;r.strategy=
S;T&&(r.schedule=T.toJsonObject());if(m){for(var qa=[],k=0;k<m.length;k++)qa.push(m[k].toJsonObject());r.basedFields=qa}return r};this.fromJsonObject=function(r){y=r.type;S=r.strategy;r.schedule&&(T=new na,T.fromJsonObject(r.schedule));if(r=r.basedFields){m=[];for(var qa=0;qa<r.length;qa++){var k=new ra;k.fromJsonObject(r[qa]);m.push(k)}}};this.equals=function(r){if(r instanceof Ea){if(y!==r.getType()||S!==r.getStrategy())return!1;var qa=r.getSchedule();if(T&&!qa||!T&&qa)return!1;if(T&&qa){var k=
T.toJsonObject();qa=qa.toJsonObject();for(var d in k)if(k[d]!==qa[d])return!1}r=r.getBasedFields();if(!m&&!r)return!0;if(!m||!r||m.length!==r.length)return!1;for(k=0;k<m.length;k++)if(!m[k].equals(r[k]))return!1;return!0}return!1}}function ra(){var y,S,T,m;this.setTableId=function(r){y=r};this.getTableId=function(){return y};this.setTableName=function(r){S=r};this.getTableName=function(){return S};this.setName=function(r){T=r};this.getName=function(){return T};this.setAlias=function(r){m=r};this.getAlias=
function(){return m};this.copy=function(){var r=new ra;r.setTableId(y);r.setTableName(S);r.setName(T);r.setAlias(m);return r};this.toJsonObject=function(){var r={};r.tableId=y;r.tableName=S;r.name=T;r.alias=m;return r};this.fromJsonObject=function(r){y=r.tableId;S=r.tableName;T=r.name;m=r.alias};this.equals=function(r){return r instanceof ra?y===r.getTableId()&&S===r.getTableName()&&T===r.getName()&&m===r.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 K=com.kingdee.bos.qing.modeler.designer;K.QingModeler=function(){var y;this.setModelerModel=function(S){y=S};this.getModelerModel=function(){return y};this.toJsonObject=function(){var S=
{};S.modelerModel=y.toJsonObject();return S};this.fromJsonObject=function(S){(S=S.modelerModel)&&(y=K.ModelerModerParser.parseToModel(S.type,S))}};K.AbstractModelerModelParser=function(){this.parseToModel=function(y){throw Error("override me");}};K.ModelerModel=ta;K.AbstractPage=function(){function y(k,d,b,a){this.getLeftExtension=function(){return k};this.getTopExtension=function(){return d};this.getHorizonExtension=function(){return k+b};this.getVerticalExtension=function(){return d+a}}var S=this,
T=1024,m=768,r=[];this.getWidth=function(){return T};this.getHeight=function(){return m};this.addPropertyChangeCallback=function(k){r.push(k)};this.setExtension=function(k,d,b,a){k=new y(k,d,b,a);T+=k.getHorizonExtension();m+=k.getVerticalExtension();qa(ta.KEY_PAGE_SIZE,k)};this.toJsonObject=function(){var k={};k.width=T;k.height=m;S.protectedToJsonObject(k);return k};this.fromJsonObject=function(k){T=k.width;m=k.height;S.protectedFromJsonObject(k)};this.protectedToJsonObject=function(k){};this.protectedFromJsonObject=
function(k){};var qa=function(k,d){for(var b=0,a=r.length;b<a;b++)r[b](k,d)};this.protectedMethod={firePropertyChangeEvt:qa}};K.Node=Da;K.Table=Va;K.DesignTimeSource=Xa;K.Field=ca;K.UserSQL=mb;K.PreviewConfig=Y;K.RuntimeModel=function(){var y,S=[],T=[],m;this.setOutputVertexId=function(r){y=r};this.addEdge=function(r){S.push(r)};this.addVertex=function(r){T.push(r)};this.getVertexes=function(){return T};this.setPreviewConfig=function(r){m=r};this.toJsonObject=function(){for(var r={},qa=[],k=[],d=
0,b=S.length;d<b;d++)qa.push(S[d].toJsonObject());d=0;for(b=T.length;d<b;d++)k.push(T[d].toJsonObject());r.edges=qa;r.vertexes=k;r.outputVertexId=y;r.previewConfig=m?m.toJsonObject():null;return r}};K.Edge=function(y,S){this.toJsonObject=function(){var T={};T.fromId=y;T.toId=S;return T}};K.SourceVertex=function(){Ma.call(this);var y,S,T;this.protectedMethod.setType(Ma.TYPE_SOURCE);this.setTable=function(m){y=m};this.setSource=function(m){S=m};this.setSelectedFields=function(m){T=m};this.protectedToJson=
function(m){m.table=y.toJsonObject();m.source=S.toJsonObject();if(T){for(var r=[],qa=0;qa<T.length;qa++)r.push(T[qa].toJsonObject());m.selectedFields=r}}};K.ExecuteResult=function(){var y,S=[],T,m;this.getNodeId=function(){return y};this.getValidity=function(){return m};this.getPreviewData=function(){return T};this.getFields=function(){return S};this.fromJsonObject=function(r){y=r.nodeId;var qa=r.validity;qa&&(m=new oa,m.fromJsonObject(qa));if(qa=r.previewData)T=new P,T.fromJsonObject(qa);if(r=r.fields)for(qa=
0;qa<r.length;qa++){var k=r[qa],d=new ca;d.fromJsonObject(k);S.push(d)}}};K.PreviewData=P;K.FilterItem=D;K.MaterializedConfig=Ea;K.BasedField=ra;K.FilterConfig=la;var pa,za,na;(function(){var y=com.kingdee.bos.qing.common;pa=y.RelativePeriodModel;y=com.kingdee.bos.qing.common.ui;za=y.RelativePeriodPanel;y=com.kingdee.bos.qing.schedule;na=y.QingSchedule})();K.ModelerModerParser=new function(){var y={};this.registerParser=function(S,T){y[S]=T};this.parseToModel=function(S,T){return(S=y[S])&&S.parseToModel(T)}};
ta.TYPE_TABLE_MODELER="table";ta.TYPE_RELATION_MODELER="relation";ta.TYPE_METRIC_MODELER="metric";ta.KEY_UPDATE_TABLE="update_table";ta.KEY_ADD_TABLE="add_table";ta.KEY_REMOVE_TABLE="remove_table";ta.KEY_TABLE_SELECT_FIELD="table_select_field";ta.KEY_TABLE_SET_FILTER="table_set_filter";ta.KEY_PAGE_SIZE="page_change_size";ta.KEY_ADD_PREPARED_SOURCE="add_prepared_source";ta.KEY_REMOVE_PREPARED_SOURCE="remove_prepared_source";ta.KEY_SET_PREPARED_SOURCE="set_prepared_source";ta.KEY_NODE_CHANGE_ALIAS=
"node_change_alias";ta.KEY_NODE_CHANGE_POSITION="node_change_position";ta.KEY_TABLE_NODE_SELECT_FIELD="table_node_select_field";Da.TYPE_TABLE="table";Da.TYPE_TRANSFORM="transform";ca.DT_BOOLEAN="BOOLEAN";ca.DT_INT="INT";ca.DT_NUMBER="NUMBER";ca.DT_DATE="DATE";ca.DT_DATETIME="DATETIME";ca.DT_STRING="STRING";ca.ROUND_MODE_UP="ROUND_UP";ca.ROUND_MODE_DOWN="ROUND_DOWN";ca.ROUND_MODE_HALF_UP="ROUND_HALF_UP";ca.BOOLEAN_TRUE="true";ca.BOOLEAN_FALSE="false";ca.EXTENSION_BIZ_FIELD_ENUM_KEY="bizFieldEnumKey";
ca.EXTENSION_IS_MUL_BASE_DATA="isMulBaseData";ca.EXTENSION_IS_PK="isPK";K.UIDHelper=new function(){var y,S={};this.init=function(c,e){S={};y=c;e&K.UIDHelper.SUPPORT_TYPE_NODE&&d();e&K.UIDHelper.SUPPORT_TYPE_SOURCE&&b();e&K.UIDHelper.SUPPORT_TYPE_TABLE&&a();e&K.UIDHelper.SUPPORT_TYPE_LINE&&l();e&K.UIDHelper.SUPPORT_TYPE_DIMENSION&&m();e&K.UIDHelper.SUPPORT_TYPE_PUBLIC_DIMENSION&&r();e&K.UIDHelper.SUPPORT_TYPE_METRIC&&qa();e&K.UIDHelper.SUPPORT_TYPE_REFERENCE&&k()};this.getUID=function(c){var e=S[c];
e||(e=0);e+=1;S[c]=e;return c+e};var T=function(c,e,g){for(var v=0,u=0;u<e.length;u++)for(var h=g(e[u]),B=0;B<h.length;B++){var F=h[B];v=Math.max(v,parseInt(F.slice(c.length,F.length)))}S[c]=v},m=function(){var c=y.getAllDimension();c&&T(K.UIDHelper.NS_DIMENSION,c,function(e){return[e.getDimensionId()]})},r=function(){var c=y.getPublicDimensions();c&&T(K.UIDHelper.NS_PUBLIC_DIMENSION,c,function(e){return[e.getId()]});(c=y.getAllDimension())&&T(K.UIDHelper.NS_PUBLIC_DIMENSION,c,function(e){return[e.getPublicDimensionId()]})},
qa=function(){var c=y.getAllMetric();c&&T(K.UIDHelper.NS_METRIC,c,function(e){return[e.getId()]})},k=function(){var c=y.getExprReferences();c&&T(K.UIDHelper.NS_REFERENCE,c,function(e){return[e.getId()]})},d=function(){var c=y.getAllNodes();c&&T(K.UIDHelper.NS_NODE,c,function(e){var g=[];g.push(e.getId());e.getType()==Da.TYPE_TRANSFORM&&(e=e.getNodeIdInConfig(),g=g.concat(e));return g})},b=function(){var c=y.getAllSource();c&&T(K.UIDHelper.NS_SOURCE,c,function(e){return[e.getId()]})},a=function(){var c=
y.getAllTable();c&&T(K.UIDHelper.NS_TABLE,c,function(e){return[e.getUid()]})},l=function(){var c=y.getAllLines();c&&T(K.UIDHelper.NS_LINE,c,function(e){return[e.getId()]})}};K.UIDHelper.NS_NODE="n";K.UIDHelper.NS_LINE="l";K.UIDHelper.NS_TABLE="t";K.UIDHelper.NS_SOURCE="s";K.UIDHelper.NS_DIMENSION="d";K.UIDHelper.NS_PUBLIC_DIMENSION="pd";K.UIDHelper.NS_METRIC="m";K.UIDHelper.NS_REFERENCE="r";K.UIDHelper.SUPPORT_TYPE_NODE=1;K.UIDHelper.SUPPORT_TYPE_LINE=2;K.UIDHelper.SUPPORT_TYPE_TABLE=4;K.UIDHelper.SUPPORT_TYPE_SOURCE=
8;K.UIDHelper.SUPPORT_TYPE_DIMENSION=16;K.UIDHelper.SUPPORT_TYPE_PUBLIC_DIMENSION=32;K.UIDHelper.SUPPORT_TYPE_METRIC=64;K.UIDHelper.SUPPORT_TYPE_REFERENCE=128;K.UIDHelper.METRIC_SCENE=K.UIDHelper.SUPPORT_TYPE_TABLE|K.UIDHelper.SUPPORT_TYPE_SOURCE|K.UIDHelper.SUPPORT_TYPE_DIMENSION|K.UIDHelper.SUPPORT_TYPE_PUBLIC_DIMENSION|K.UIDHelper.SUPPORT_TYPE_METRIC|K.UIDHelper.SUPPORT_TYPE_REFERENCE;Y.ALL_DATA_NUMBER=-1;Ma.TYPE_SOURCE="source";Ma.TYPE_TRANSFORM_FIELD_SELECT="field_select";Ma.TYPE_TRANSFORM_FIELD_SETTING=
"field_setting";Ma.TYPE_TRANSFORM_GROUP_BY="group_by";Ma.TYPE_TRANSFORM_FILTER="filter";Ma.TYPE_TRANSFORM_SORT="sort";Ma.TYPE_TRANSFORM_JOIN="join";Q.TYPE_MULTI_OUTPUT="multiOutput";Q.TYPE_LACK_OUTPUT="lackOutputNode";Q.TYPE_INVALID_CONFIG="invalidConfig";Q.TYPE_LACK_INPUT="lackInputNode";Q.TYPE_INVALID_UPWARDNODE="invalidUpwardNode";Q.TYPE_INVALID_SOURCE="invalidSource";Q.TYPE_TABLE_NO_FIELD="tableNoField";Q.TYPE_TABLE_NO_AUTHORITY="tableNoAuthority";D.REG_NUMBER=/^-?\d+(\.\d+)?$/;D.REG_DATETIME=
/^-?\d+(\.\d+)?$/;D.COMPARE_EQUAL="EQUAL";D.COMPARE_NOT_EQUAL="NOT_EQUAL";D.COMPARE_GREATER="GREATER";D.COMPARE_GREATER_EQUAL="GREATER_EQUAL";D.COMPARE_LESS="LESS";D.COMPARE_LESS_EQUAL="LESS_EQUAL";D.COMPARE_INCLUDE="INCLUDE";D.COMPARE_NOT_INCLUDE="NOT_INCLUDE";D.COMPARE_START_WITH="START_WITH";D.COMPARE_END_WITH="END_WITH";D.COMPARE_NULL="NULL";D.COMPARE_NOT_NULL="NOT_NULL";D.COMPARE_IN="IN";D.COMPARE_NOT_IN="NOT_IN";D.COMPARE_RELATIVE_DATE_RANGE="RELATIVE_DATE_RANGE";D.LOGIC_AND="AND";D.LOGIC_OR=
"OR";D.COMPARES_FOR_STRING=[D.COMPARE_EQUAL,D.COMPARE_NOT_EQUAL,D.COMPARE_INCLUDE,D.COMPARE_NOT_INCLUDE,D.COMPARE_START_WITH,D.COMPARE_END_WITH,D.COMPARE_NULL,D.COMPARE_NOT_NULL,D.COMPARE_IN,D.COMPARE_NOT_IN];D.COMPARES_FOR_ENUM=[D.COMPARE_EQUAL,D.COMPARE_NOT_EQUAL,D.COMPARE_NULL,D.COMPARE_NOT_NULL,D.COMPARE_IN,D.COMPARE_NOT_IN];D.COMPARES_FOR_NUMBER=[D.COMPARE_EQUAL,D.COMPARE_NOT_EQUAL,D.COMPARE_GREATER,D.COMPARE_GREATER_EQUAL,D.COMPARE_LESS,D.COMPARE_LESS_EQUAL,D.COMPARE_NULL,D.COMPARE_NOT_NULL,
D.COMPARE_IN,D.COMPARE_NOT_IN];D.COMPARES_FOR_DATETIME=[D.COMPARE_RELATIVE_DATE_RANGE,D.COMPARE_EQUAL,D.COMPARE_NOT_EQUAL,D.COMPARE_GREATER,D.COMPARE_GREATER_EQUAL,D.COMPARE_LESS,D.COMPARE_LESS_EQUAL,D.COMPARE_NULL,D.COMPARE_NOT_NULL];D.COMPARES_FOR_BOOLEAN=[D.COMPARE_EQUAL,D.COMPARE_NOT_EQUAL,D.COMPARE_NULL,D.COMPARE_NOT_NULL];D.isCompareOpWithoutValue=function(y){return y===D.COMPARE_NULL||y===D.COMPARE_NOT_NULL};D.isCompareOpWithinOrNotWithinValue=function(y){return y===D.COMPARE_IN||y===D.COMPARE_NOT_IN};
D.isCompareOpRelativeDateRangeValue=function(y){return y===D.COMPARE_RELATIVE_DATE_RANGE};D.getSelectableCompares=function(y,S){switch(y){case ca.DT_STRING:return S?D.COMPARES_FOR_ENUM:D.COMPARES_FOR_STRING;case ca.DT_NUMBER:case ca.DT_INT:return D.COMPARES_FOR_NUMBER;case ca.DT_DATE:case ca.DT_DATETIME:return D.COMPARES_FOR_DATETIME;case ca.DT_BOOLEAN:return D.COMPARES_FOR_BOOLEAN;default:throw Error("Unknown DataType");}};D.FiltersCheckingResult=function(y,S){var T=S;this.getFiltersErrorRow=function(){return y};
this.getPrompt=function(){return T};this.setPrompt=function(m){T=m}};W.TYPE_FIELD_SELECT="field_select";W.TYPE_FIELD_SETTING="field_setting";W.TYPE_FILTER="filter";W.TYPE_SORT="sort";W.TYPE_GROUP_BY="group_by";W.TYPE_CALCULATED_FIELD="calculated_field";W.TYPE_CUSTOM_GROUP="custom_group";W.TYPE_JOIN="join";W.TYPE_UNION="union";Ea.TYPE_ONCE="once";Ea.TYPE_TIMING="timing";Ea.STRATEGY_FULL="full";Ea.STRATEGY_INCREMENTAL="incremental";K.ENTITY_SEPARATOR="@#!&@"})();(function(){function ta(){var Xa,ca,Y,Ma,oa;this.setFromTable=function(A){Xa=A};this.getFromTable=function(){return Xa};this.setFromProperty=function(A){Y=A};this.getFromProperty=function(){return Y};this.setToTable=function(A){ca=A};this.getToTable=function(){return ca};this.setToProperty=function(A){Ma=A};this.getToProperty=function(){return Ma};this.setRelated=function(A){oa=A};this.getRelated=function(){return oa};this.fromJsonObject=function(A){Xa=A.fromModel;ca=A.toModel;Y=A.fromField;Ma=A.toField;
oa=A.related};this.toJsonObject=function(A){A={};A.fromModel=Xa;A.toModel=ca;A.fromField=Y;A.toField=Ma;A.related=oa;return A}}function Da(){var Xa=this,ca,Y,Ma;this.setUid=function(oa){ca=oa};this.getUid=function(){return ca};this.setId=function(oa){Ma=oa};this.getId=function(){return Ma};this.getSourceType=function(){return Y};this.fromJsonObject=function(oa){ca=oa.id;Y=oa.type;Xa.protectedFromJsonObject(oa)};this.toJsonObject=function(){var oa={};oa.type=Y;oa.id=ca;Xa.protectedToJsonObject(oa);
return oa};this.protectedToJsonObject=function(oa){};this.protectedFromJsonObject=function(oa){};this.protectedMethod={setSourceType:function(oa){Y=oa}}}"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 Va=com.kingdee.bos.qing.modeler.designer;Va.AbstractModelerSource=Da;Va.ModelSetDataSource=function(){var Xa,ca,Y,Ma,oa,A,Q;this.getErrorMessage=function(){return Q};this.getSpecificType=function(){return A};this.getSourceName=function(){return Xa};this.setSourceName=function(Z){Xa=Z};this.getId=function(){return ca};this.setId=function(Z){ca=Z};this.setCreatorName=function(Z){Y=Z};this.getCreatorName=function(){return Y};this.setCreateTime=function(Z){Ma=
Z};this.getCreateTime=function(){return Ma};this.setSourceType=function(Z){oa=Z};this.getSourceType=function(){return oa};this.fromJsonObject=function(Z){ca=Z.id;Xa=Z.sourceName;oa=Z.sourceType;Ma=Z.createTime;Y=Z.creatorName;var O=Z.source;oa===Da.SOURCE_TYPE_PUBLIC_DATA_SOURCE&&"DB"===O.sourceType?A=O.publicSourceType:oa===Da.SOURCE_TYPE_MODELSET_DB_SOURCE&&O.dbType?A=O.dbType:oa===Da.SOURCE_TYPE_MODELSET_FILE_SOURCE&&O.fileType&&(A=O.fileType);Z.errorMessage&&(Q=Z.errorMessage)}};Va.Meta=function(){var Xa,
ca,Y,Ma,oa;this.setTableNode=function(A){Xa=A};this.getTableNode=function(){return Xa};this.setPropertyMap=function(A){ca=A};this.getPropertyMap=function(){return ca};this.setSourceType=function(A){Y=A};this.getSourceType=function(){return Y};this.setRelations=function(A){Ma=A};this.getRelations=function(){return Ma};this.setErrorMap=function(A){oa=A};this.getErrorMap=function(){return oa};this.fromJsonObject=function(A){Xa=A.tableNode;if(ca=A.propertiesMap)for(var Q in ca){var Z=ca[Q];if(Z&&0<Z.length){for(var O=
[],ia=0;ia<Z.length;ia++){var Ha=new mb,ba=Z[ia];Ha.fromJsonObject(Z[ia]);ba.number&&Ha.setName(ba.number);O.push(Ha)}ca[Q]=O}}Y=A.sourceType;if((Q=A.relations)&&0<Q.length)for(Ma=[],ia=0;ia<Q.length;ia++)Z=new ta,Z.fromJsonObject(Q[ia]),Ma.push(Z);oa=A.errorMap}};var mb=Va.Field;ta.R_1_1="From1To1";ta.R_1_N="From1ToN";ta.R_N_1="FromNTo1";ta.KFW_FROM=1;ta.KFW_TO=2;ta.KEY_FROM_ENTITY="fromEntity";ta.KEY_FROM_PROPERTY="fromProperty";ta.KEY_FROM_PROPERTY_ALIAS_CHANED="fromPropertyAliasChanged";ta.KEY_TO_PROPERTY_ALIAS_CHANED=
"toPropertyAliasChanged";ta.KEY_TO_ENTITY="toEntity";ta.KEY_TO_PROPERTY="toProperty";ta.KEY_RELATED="related";Da.SOURCE_TYPE_PUBLIC_DATA_SOURCE="PublicDBSource";Da.SOURCE_TYPE_CURRENT_ENTITY_SOURCE="ERPCloudEntity";Da.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE="ERPCloudDBCenter";Da.SOURCE_TYPE_MODELSET_FILE_SOURCE="FileSource";Da.SOURCE_TYPE_MODELSET_DB_SOURCE="DBSource";Da.SOURCE_TYPE_MODEL_SET_SOURCE="ModelSet";Da.SOURCE_TYPE_OPEN_API_SOURCE="OpenAPI"})();(function(){function ta(){var Y,Ma,oa,A=!1,Q,Z,O=!1,ia;this.setUid=function(Ha){Z=Ha};this.getUid=function(){return Z};this.setId=function(Ha){ia=Ha};this.getId=function(){return ia};this.setCommentInfo=function(Ha){Q=Ha};this.getCommentInfo=function(){return Q};this.setMatch=function(Ha){A=Ha};this.getMatch=function(){return A};this.setName=function(Ha){Y=Ha};this.getName=function(){return Y};this.setDisplayName=function(Ha){Ma=Ha};this.getDisplayName=function(){return Ma};this.setParentNode=function(Ha){oa=
Ha};this.getParentNode=function(){return oa};this.setChecked=function(Ha){O=Ha};this.isChecked=function(){return O};this.check=function(Ha){};this.getSubNodeLevel=function(){for(var Ha=-1,ba=oa;ba;)Ha++,ba=ba.getParentNode();return Ha}}function Da(){ta.call(this);var Y=this,Ma=[],oa=!0;this.setChildren=function(A){Ma=A};this.getChildren=function(){return Ma};this.setExpanded=function(A){oa=A};this.isExpanded=function(){return oa};this.check=function(A,Q){var Z=function(ia){ia.getParentNode()&&(Q&&
Q(ia.getParentNode()),1==ia.getParentNode().getChildren().length&&Z(ia.getParentNode()))};if(0!==Ma.length&&A!==Y.isChecked()){Y.setChecked(A);for(var O=0;O<Ma.length;O++)Ma[O].check(A,Q);Z(Y)}};this.toJsonObject=function(){var A={};A.children=Ma;return A};this.fromJsonObject=function(A,Q){Y.setName(A.name);Y.setDisplayName(A.displayName);Y.setId(A.id);if(A=A.children)for(var Z=0;Z<A.length;Z++){var O=A[Z];if(O.type){var ia=new Va;ia.fromJsonObject(O);ia.setParentNode(Y);Ma.push(ia);Q&&ia.setCommentInfo(Q)}else ia=
new Da,ia.fromJsonObject(O),ia.setParentNode(Y),Ma.push(ia)}}}function Va(){ta.call(this);var Y=this,Ma,oa,A,Q,Z;this.setNumber=function(O){oa=O};this.getNumber=function(){return oa};this.setUserSql=function(O){Z=O};this.getUserSql=function(){return Z};this.setCommentInfo=function(O){A=O};this.getCommentInfo=function(){return A};this.setType=function(O){Ma=O};this.getType=function(){return Ma};this.setErrorMessage=function(O){Q=O};this.getErrorMessage=function(){return Q};this.fromJsonObject=function(O){Y.setType(O.type);
Y.setName(O.name);Y.setDisplayName(O.displayName);Y.setId(O.id);Y.setNumber(O.number);O.commentInfo&&(Y.setName(O.name),Y.setCommentInfo(O.commentInfo))};this.check=function(O,ia){var Ha=function(ba){ba.getParentNode()&&(ia&&ia(ba.getParentNode()),1==ba.getParentNode().getChildren().length&&Ha(ba.getParentNode()))};O!==Y.isChecked()&&(Y.setChecked(O),Ha(Y))}}function mb(){var Y=!1,Ma=!1,oa=!1,A=ca.get("selectTable","\u9009\u62e9\u8868"),Q=ca.get("metricSearchTable","\u641c\u7d22\u6570\u636e\u8868\u540d\u79f0"),
Z=ca.get("metricSearchTable","\u641c\u7d22\u6570\u636e\u8868\u540d\u79f0"),O=10,ia=360;this.getCodePlaceHolder=function(){return Z};this.getPlaceHolder=function(){return Q};this.isShowAppUi=function(){return Y};this.isShowEntityMark=function(){return Ma};this.isShowModelNumber=function(){return oa};this.getTitle=function(){return A};this.getTop=function(){return O};this.getHeight=function(){return ia};this.protectedMethod={setShowAppUi:function(Ha){Y=Ha},setShowEntityMark:function(Ha){Ma=Ha},setShowModelNumber:function(Ha){oa=
Ha},setTitle:function(Ha){A=Ha},setTop:function(Ha){O=Ha},setHeight:function(Ha){ia=Ha},setPlaceHolder:function(Ha){Q=Ha},setCodePlaceHolder:function(Ha){Z=Ha}}}"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 Xa=com.kingdee.bos.qing.modeler.designer;Xa.FolderNode=Da;Xa.LeafNode=Va;Xa.DraggingTableNode=function(){var Y,Ma;this.setTableNode=function(oa){Y=oa};this.getTableNode=function(){return Y};this.setTable=function(oa){Ma=oa};this.getTable=function(){return Ma}};Xa.NodeStatusMonitor=function(){var Y=this,Ma,oa=[],A=[],Q=[],Z={};this.reset=function(){Y.setSelected(void 0);Y.setInvalidNodes([])};this.addSelectNodeListener=function(ia){oa.push(ia)};this.removeSelectNodeListener=
function(ia){ia=oa.indexOf(ia);-1<ia&&oa.splice(ia,1)};this.setSelected=function(ia){if(Ma!==ia){var Ha=Ma;ia=Ma=ia;for(var ba=0;ba<oa.length;ba++)(0,oa[ba])(Ha,ia)}};this.getSelected=function(){return Ma};this.setInvalidNodes=function(ia,Ha){A=ia;Z={};if(ia&&Ha)for(var ba=Math.min(ia.length,Ha.length),n=0;n<ba;n++){var Ba=ia[n];if(Ba){var I=Ha[n];Z[Ba.getId()]=I}}O()};this.getInvalidNodes=function(){return A};this.isInvalidNode=function(ia){if(!A)return!1;for(var Ha=0;Ha<A.length;Ha++){var ba=A[Ha];
if(ba&&ba.getId()==ia)return!0}return!1};this.getInvalidPrompt=function(ia){if(ia&&(ia=Z[ia.getId()]))return ia.getPrompt()};this.addInvalidNode=function(ia,Ha){ia&&(0>A.indexOf(ia)&&A.push(ia),Ha&&(Z[ia.getId()]=Ha),O())};this.removeInvalidNode=function(ia){var Ha=A.indexOf(ia);-1<Ha&&(A.splice(Ha,1),Z[ia.getId()]=null,O())};this.batchUpdateNodeValidity=function(ia,Ha,ba){if(ia&&Ha)for(var n=Math.min(ia.length,Ha.length),Ba=0;Ba<n;Ba++){var I=ia[Ba];if(I){var P=Ha[Ba],D=A.indexOf(I);0>D&&A.push(I);
Z[I.getId()]=P}}if(ba)for(Ba=0;Ba<ba.length;Ba++)I=ba[Ba],D=A.indexOf(I),-1<D&&(A.splice(D,1),Z[I.getId()]=null);O()};this.addInvalidNodeChangeListener=function(ia){Q.push(ia)};this.removeInvalidNodeChangeListener=function(ia){ia=Q.indexOf(ia);-1<ia&&Q.splice(ia,1)};this.getInvalidState=function(ia){return Z[ia.getId()]};var O=function(){for(var ia=0;ia<Q.length;ia++)(0,Q[ia])(A)}};Xa.MetricEntitySource=function(){mb.call(this);var Y=this.protectedMethod;Y.setShowEntityMark(!0);Y.setTitle(ca.get("selectEntity",
"\u9009\u62e9\u5b9e\u4f53"));Y.setHeight(310);Y.setPlaceHolder(ca.get("metricSearchEntity","\u641c\u7d22\u5b9e\u4f53\u540d\u79f0"));Y.setCodePlaceHolder(ca.get("metricSearchEntityCode","\u641c\u7d22\u5b9e\u4f53\u540d\u79f0/\u5b9e\u4f53\u6807\u8bc6"))};Xa.MetricDataCenterSource=function(){mb.call(this);var Y=this.protectedMethod;Y.setShowAppUi(!0);Y.setTop(15);Y.setHeight(330)};Xa.MetricDefaultSource=function(){mb.call(this)};Xa.MetricModelSetSource=function(){mb.call(this);var Y=this.protectedMethod;
Y.setShowModelNumber(!0);Y.setTitle(ca.get("selectModel","\u9009\u62e9\u6a21\u578b"));Y.setHeight(310);Y.setPlaceHolder(ca.get("metricSearchModel","\u641c\u7d22\u6a21\u578b\u540d\u79f0"));Y.setCodePlaceHolder(ca.get("metricSearchModelCode","\u641c\u7d22\u6a21\u578b\u540d\u79f0/\u6a21\u578b\u7f16\u7801"))};var ca=com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer)})();(function(){function ta(){var ia=1,Ha=[];this.zoomIn=function(){var n=ta.SUPPORT_SCALES.indexOf(ia);n<ta.SUPPORT_SCALES.length-1&&(ia=ta.SUPPORT_SCALES[n+1],ba())};this.zoomOut=function(){var n=ta.SUPPORT_SCALES.indexOf(ia);0<n&&(ia=ta.SUPPORT_SCALES[n-1],ba())};this.isMinScale=function(){return ta.SUPPORT_SCALES[0]==ia};this.isMaxScale=function(){return ta.SUPPORT_SCALES[ta.SUPPORT_SCALES.length-1]==ia};this.getRatio=function(){return ia};this.setCustomRatio=function(n){ia=n};this.getScaledSize=
function(n){return 1==ia?n:ia*n};this.getRawSize=function(n){return 1==ia?n:n/ia};this.getScaledCoordinate=function(n){return 1==ia?n:[ia*n[0],ia*n[1]]};this.getRawCoordinate=function(n){return 1==ia?n:[n[0]/ia,n[1]/ia]};this.addPropertyChangedListener=function(n){Ha.push(n)};var ba=function(){for(var n=0;n<Ha.length;n++){var Ba=Ha[n];Ba&&Ba()}}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==
typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});var Da=com.kingdee.bos.qing.modeler.designer;Da.Toolbar=function(){var ia=new Va,Ha,ba=$("<div>"),n=$("<div>"),Ba=$("<div>");this.getJqUi=function(){Ha||(Ha=ia.getJqUi(),Ha.addClass("modeler-designer-toolbar"),I(ba),I(n),I(Ba));return Ha};this.addButton=function(D,
W,la,Ea){return P(n,!1,D,W,la,Ea)};this.addButtonForHeadCustom=function(D,W,la,Ea){return P(ba,!1,D,W,la,Ea)};this.addButtonForTailCustom=function(D,W,la,Ea){return P(Ba,!1,D,W,la,Ea)};this.addMenuButton=function(D,W,la,Ea){return P(n,!0,D,W,la,Ea)};this.addMenuButtonForHeadCustom=function(D,W,la,Ea){return P(ba,!0,D,W,la,Ea)};this.addMenuButtonForTailCustom=function(D,W,la,Ea){return P(Ba,!0,D,W,la,Ea)};this.getAllBtnWidth=function(){return ba.width()+n.width()+Ba.width()};var I=function(D){D.css({"float":"left",
position:"relative",height:"100%"});D.appendTo(Ha)},P=function(D,W,la,Ea,ra,K){D=ia.createButton(D,W,la,ra,K);D.setIconSetter(function(pa,za){Da.Icons.background(pa,za)});D.setIconName(Ea);return D}};Da.RemoteImpl=function(){Ma.call(this);var ia;this.getRemoteUrl=function(){return ia};this.setRemoteUrl=function(Ha){ia=Ha}};Da.Integration=function(){var ia,Ha,ba,n,Ba,I=!0;this.setMapTableException=function(P){Ba=P};this.getMapTableException=function(){return Ba};this.setMapSourceType=function(P){n=
P};this.getMapSourceType=function(){return n};this.setMapSourcePermission=function(P){ba=P};this.getMapSourcePermission=function(){return ba};this.setModelName=function(P){ia=P};this.getModelName=function(){return ia};this.setModelDesc=function(P){Ha=P};this.getModelDesc=function(){return Ha};this.setModelIsValid=function(P){I=P};this.isValidModel=function(){return I}};Da.StatusBar=function(){var ia,Ha,ba,n,Ba;this.getJqUi=function(){ia||(ia=$("<div>"),ia.addClass("modeler-designer-statusbar"),Ha=
$("<span>"),Ha.addClass("modeler-designer-statusbar-name"),Ha.appendTo(ia),ba=$("<span>"),ba.addClass("modeler-designer-statusbar-dirtystate"),ba.appendTo(ia),n=$("<span>"),n.addClass("modeler-designer-statusbar-prompt"),n.appendTo(ia));return ia};this.setCurrentName=function(P){Ha.text(P)};this.showDirtyState=function(P){ba.text(P?"*":"")};this.showShortPrompt=function(P,D,W){clearTimeout(Ba);n.text(P);n.css("color",W?W:"");if(D){var la=0,Ea=function(){if(6<la)I();else{if(0==la%2){n.text(P);var ra=
650}else n.text(""),ra=350;Ba=setTimeout(Ea,ra);la++}};Ea()}else I()};var I=function(){Ba=setTimeout(function(){n.text("")},5E3)}};Da.DesignerFacade=function(ia,Ha,ba,n){ca.call(this,ia,Ha,ba,n);var Ba=this.protectedMethod;this.loadTables=function(I){I={source:JSON.stringify(I.toJsonObject()),needFilterMetric:!0};Ba.remote("loadTables",I)};this.getMeta=function(I,P){I={source:JSON.stringify(I.toJsonObject()),table:JSON.stringify(P.toJsonObject())};Ba.remote("getMeta",I)};this.getTableField=function(I,
P){for(var D=[],W=[],la=0;la<I.length;la++)D.push(I[la].toJsonObject());for(la=0;la<P.length;la++)W.push(P[la].toJsonObject());I={sources:JSON.stringify(D),tables:JSON.stringify(W)};Ba.remote("getTableField",I)};this.getTableFieldWithCheckModel=function(I){I={model:JSON.stringify(I.toJsonObject())};Ba.remote("getTableFieldWithCheckModel",I)};this.getDBCenterTables=function(I){Ba.remote("getDBCenterTables",{appNumber:I})};this.checkConnection=function(I){Ba.remote("checkConnection",{sourceId:I})};
this.checkMetricFormula=function(I,P,D,W){var la={};if(D)for(var Ea=Object.keys(D),ra=0;ra<Ea.length;ra++){for(var K=Ea[ra],pa=D[K],za=[],na=0;na<pa.length;na++)za.push(pa[na].toJsonObject());la[K]=za}I={expr:I,metricId:W,model:JSON.stringify(P.toJsonObject()),fields:JSON.stringify(la)};Ba.remote("checkMetricFormula",I)};this.previewMetrics=function(I,P,D,W){I={modeler:JSON.stringify(I),filters:JSON.stringify(P),previewConfig:JSON.stringify(D),metricId:W};Ba.remote("previewMetrics",I)};this.getFirstPageMetric=
function(I){I={model:JSON.stringify(I)};Ba.remote("getFirstPageMetric",I)};this.updateMetricByPage=function(I,P,D,W,la){I={model:JSON.stringify(I),jobId:P,jobName:D,startIndex:W,pageSize:la};Ba.remote("updateMetricByPage",I)};this.exportMetricData=function(I,P,D,W){I={model:JSON.stringify(I),jobId:P,jobName:D,totalRowCount:W};Ba.remote("exportMetricData",I)};this.getTotalRowCount=function(I,P){Ba.remote("getTotalRowCount",{jobId:I,jobName:P})};this.deleteResultDataFile=function(I,P){Ba.remote("deleteResultDataFile",
{jobId:I,jobName:P})};this.getMetricDimValues=function(I,P,D){I={modeler:JSON.stringify(I),dimensionId:P,metricId:D};Ba.remote("getMetricDimValues",I)};this.getTablePreviewData=function(I,P,D,W){I={source:JSON.stringify(I.toJsonObject()),table:JSON.stringify(P.toJsonObject()),filters:JSON.stringify(D),rowCount:W};Ba.remote("getTablePreviewData",I)};this.getDataRowCount=function(I,P,D){I={source:JSON.stringify(I.toJsonObject()),table:JSON.stringify(P.toJsonObject()),filters:JSON.stringify(D)};Ba.remote("getDataRowCount",
I)};this.cronExpression=function(I){Ba.remote("cronExpression",{cron:I})};this.checkDataWarehouseConfig=function(){Ba.remote("checkDataWarehouseConfig",{})};this.checkReferencedModel=function(I,P,D){I={source:JSON.stringify(I.toJsonObject()),table:JSON.stringify(P.toJsonObject()),modelId:D};Ba.remote("checkReferencedModel",I)};this.checkModelerValid=function(I){I={model:JSON.stringify(I)};Ba.remote("checkModelerValid",I)};this.checkMetricTableException=function(I,P,D){I={source:JSON.stringify(I.toJsonObject()),
table:JSON.stringify(P.toJsonObject()),modelId:D};Ba.remote("checkMetricTableException",I)}};Da.PageScaleHelper=ta;var Va,mb,Xa,ca,Y,Ma,oa,A,Q,Z;(function(){var ia=com.kingdee.bos.qing.ui.component;Va=ia.Toolbar;mb=ia.SimpleConfirmer;oa=ia.MessageDialog;ia=com.kingdee.bos.qing.framework.common;Xa=ia.AbstractIcons;Y=ia.MultilanguageManager.createPackageAccessor(Da);Ma=ia.AbstractRemoteCall;ca=ia.AbstractFacade;ia=com.kingdee.bos.qing.common;Z=ia.RelativePeriodModel;A=Da.FilterItem;Q=Da.Field})();Da.Icons=
new function(){Xa.call(this);var ia=this.protectedMethod,Ha;this.setComboIconImpl=function(Ba){Ha=Ba};this.protectedInit=function(Ba,I){if(!Ha)throw Error("qing modeler comboIcon not found.");Ha.define(I,"designer");I.setIconSize(16,16);ba(0,0,"edit");ba(0,1,"delete");ba(0,2,"add");ba(0,3,"zoomIn");ba(0,4,"zoomOut");ba(0,5,"layout");ba(0,6,"rightArrow");ba(0,7,"leftArrow");ba(0,8,"upArrow");ba(0,9,"downArrow");n(0,10,"qingWarning");n(0,11,"relation");n(0,12,"qingTable");ba(0,13,"expanded");ba(0,14,
"expand");n(0,15,"btn_edit");ba(0,17,"trial_calc");n(1,12,"qingTable_hover");ba(0,18,"moveUp");n(0,19,"reset");ba(0,20,"createDim");ba(0,21,"publicDimension");ba(0,22,"metric_filter");I.setStartPosition(84,35);n(0,0,"select_field");n(0,1,"field_setting");n(0,2,"join");n(0,3,"union");n(0,4,"filter");n(0,5,"sort");n(0,6,"group_by");n(0,7,"calculate_field");ba(0,8,"metric",!0);I.setStartPosition(84,52);n(0,0,"entity-sub");n(0,1,"entity-entry");n(0,2,"unlock");n(0,3,"lock_by_other");n(0,4,"lock_by_me");
n(0,5,"tick");n(0,6,"cross");I.setIconSize(20,20);I.setStartPosition(0,35);n(0,0,"leftJoin");n(0,1,"rightJoin");n(0,2,"innerJoin");n(0,3,"fullJoin");I.setStartPosition(238,35);I.setIconSize(32,32);n(0,0,"metric_icon");I.setStartPosition(288,35);I.setIconSize(16,16);ba(0,0,"table_relation_with_hover");n(1,0,"table_relation");n(0,1,"custom_group");I.setStartPosition(0,55);I.setIconSize(20,20);ba(0,0,"setting");n(0,1,"warning");I.setIconSize(60,80);I.setStartPosition(0,98);n(0,0,"no_source");I.setIconSize(138,
78);I.setStartPosition(240,240);n(0,0,"no_data_cloud");I.setIconSize(253,140);I.setStartPosition(62,71);n(0,0,"drag_node_prompt");I.setIconSize(210,170);I.setStartPosition(0,211);n(0,0,"no_node_and_source");Ha.define(I,"source");I.setStartPosition(0,20);I.setIconSize(16,16);n(0,0,"entity");n(0,1,"data");n(0,2,"modelSet");n(0,3,"file");n(0,4,"data-center");n(0,5,"table");n(0,6,"openapi");I.setStartPosition(85,0);I.setIconSize(16,16);n(0,0,"table_selected");I.setStartPosition(101,0);n(0,0,"f7");I.setStartPosition(0,
40);I.setIconSize(20,20);I.setGap(0,1);n(0,0,"modelset-source-icon");n(0,1,"mysql");n(0,2,"datacenter-source-icon");n(0,3,"entity-source-icon");n(0,4,"oracle");n(0,5,"postgresql");n(0,6,"sqlserver");n(0,7,"greenplum");n(0,8,"access");n(0,9,"db2");n(0,10,"odps");n(0,11,"sparksql");n(1,1,"redshift");n(1,2,"apachedrill");n(1,3,"hive");n(1,4,"impala");n(1,5,"kylin");n(1,6,"dm");n(1,7,"gaussdb");n(1,8,"sybaseiq");n(1,9,"sqlite");n(1,10,"sybase");n(2,2,"doris");n(2,3,"hana");I.setGap(0,0);n(1,0,"excel");
n(2,0,"txt");n(2,1,"csv");n(1,11,"xml");n(2,4,"kingbase");n(2,5,"tdsql");n(2,6,"gbase");n(2,7,"vastbase");n(2,8,"yashandb");n(2,9,"openapi-source-icon");n(2,10,"tidb");I.setStartPosition(120,-1);I.setIconSize(16,16);ba(0,0,"refresh");I.setStartPosition(180,-1);I.setIconSize(16,16);ba(0,0,"menu");I.setStartPosition(0,110);I.setIconSize(120,93);n(0,0,"no-permission");I.setStartPosition(100,100);I.setIconSize(138,84);n(0,0,"search-no-result");Ha.define(I,"metatree");I.setGap(1);I.setStartPosition(1,
1);I.setIconSize(16,16);ba(0,0,"DATE",!0);ba(0,1,"STRING",!0);ba(0,5,"TABLE",!0);ba(0,8,"DATETIME",!0);ba(0,9,"BOOLEAN",!0);ba(0,10,"NUMBER",!0);ba(0,11,"INT",!0);Ha.define(I,"metric");I.setStartPosition(0,0);I.setIconSize(260,160);n(0,0,"add_metric");I.setStartPosition(0,164);I.setIconSize(210,170);n(0,0,"no_metric");I.setStartPosition(230,165);I.setIconSize(12,12);n(0,0,"add_metric_plug_sign")};var ba=function(Ba,I,P,D){var W=P+"_hover";D?(n(Ba,I,P),n(Ba+1,I,W)):(n(Ba,I,W),n(Ba+1,I,P))},n=function(Ba,
I,P){ia.registIcon(Ba,I,P)}};Da.LockHelper=new function(){var ia,Ha,ba,n,Ba,I,P,D,W=!1;this.show=function(Ea){I=$("<div>");I.addClass("modeler-designer-lock-statusbar");P=$("<div>");D=$("<div>");D.addClass("modeler-designer-lock-text");P.addClass("modeler-designer-lock-icon");I.append(D);I.append(P);I.appendTo(Ea);I.on("click",la);W=!0};this.registerLockRequestSender=function(Ea){n=Ea};this.setGlobal=function(Ea){ia=Ea};this.setLockStateChangeListener=function(Ea){Ba=Ea};this.setLockInfo=function(Ea,
ra,K){if(W){ba=ra;Ha=Ea?Da.LockHelper.STATE_LOCK_BY_ME:ra?Da.LockHelper.STATE_LOCK_BY_OTHER:Da.LockHelper.STATE_UNLOCK;Ba&&Ba(Ha==Da.LockHelper.STATE_LOCK_BY_ME);if(!K){if(Ha==Da.LockHelper.STATE_LOCK_BY_OTHER){var pa=Y.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");pa=pa.replace("#1",ba)}else Ha==Da.LockHelper.STATE_UNLOCK&&
(pa=Y.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"));pa?ia.getMessageCurtain().showPrompt(pa,-1):Ha==Da.LockHelper.STATE_LOCK_BY_ME&&ia.getMessageCurtain().showSuccess(Y.get("lockSuccess","\u60a8\u5df2\u6210\u529f\u9501\u5b9a\u8be5\u6a21\u578b"))}Ea="lock_by_other";if(Ha==Da.LockHelper.STATE_UNLOCK){Ea="unlock";var za=Y.get("unlock","\u672a\u9501\u5b9a")}else Ha==Da.LockHelper.STATE_LOCK_BY_OTHER?
za=Y.get("lockedBy","\u5df2\u88ab\u201c#1\u201d\u9501\u5b9a").replace("#1",ba):Ha==Da.LockHelper.STATE_LOCK_BY_ME&&(za=Y.get("lockedBy","\u5df2\u88ab\u201c#1\u201d\u9501\u5b9a").replace("#1",Y.get("me","\u6211")),Ea="lock_by_me");Da.Icons.background(P,Ea);D.text(za);D.attr("title",za)}};this.setMaxWidth=function(Ea){D&&D.css("max-width",Math.max(0,Math.min(Ea-50,250))+"px")};var la=function(){if(n){var Ea=Ha!=Da.LockHelper.STATE_LOCK_BY_ME;if(Ea)n(Ea);else{var ra=new mb;ra.setText(Y.get("confirmUnlock",
"\u786e\u5b9a\u8981\u89e3\u9501\u5f53\u524d\u6a21\u578b\uff1f"));ra.setConfirmedListener(function(K){K&&n(Ea)});ra.show(I)}}}};Da.LockHelper.STATE_LOCK_BY_ME="lock_by_me";Da.LockHelper.STATE_LOCK_BY_OTHER="lock_by_other";Da.LockHelper.STATE_UNLOCK="unlock";Da.DppVersionExceptionHandler=new function(){var ia=!1;this.handle=function(Ha){if(20001101!=Ha)return!1;ia||(ia=!0,Ha=oa.createFeedbackDialog(),Ha.setMsgImageType(oa.MSG_WARNING),Ha.setMessage(Y.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")),
Ha.setOptionType(oa.OPTION_OK),Ha.setButtonText(oa.RETURN_OK,Y.get("iSee","\u6211\u77e5\u9053\u4e86")),Ha.setClosedAction(function(){ia=!1}),Ha.showDialog());return!0}};Da.PropDataTypeUtil=new function(){this.getDataTypeDesc=function(ia){switch(ia){case Q.DT_STRING:ia=Y.get("text","\u6587\u672c");break;case Q.DT_NUMBER:ia=Y.get("number","\u6570\u503c");break;case Q.DT_INT:ia=Y.get("integer","\u6574\u6570");break;case Q.DT_DATE:ia=Y.get("dataTypeDate","\u65e5\u671f");break;case Q.DT_DATETIME:ia=Y.get("dateTime",
"\u65e5\u671f\u65f6\u95f4");break;case Q.DT_BOOLEAN:ia=Y.get("bool","\u5e03\u5c14");break;default:ia=""}return ia}};ta.SUPPORT_SCALES=[.5,.6,.7,.8,.9,1,1.1,1.2,1.3,1.4,1.5];Da.NodeResultCache=new function(){var ia={},Ha={},ba=[];this.cacheOneNodeField=function(n,Ba,I){if(I){var P=Ha[n];if(!P||P<I)for(ia[n]=Ba,I=0;I<ba.length;I++)(P=ba[I])&&P(n,Ba)}};this.removeNodeCache=function(n){ia[n]=void 0;Ha[n]=void 0};this.getOneNodeField=function(n){return ia[n]};this.addCacheChangeListener=function(n){ba.push(n)};
this.clear=function(){ia={};Ha={}}};Da.FilterCheckHelper=new function(){this.checkFilterField=function(ba,n){if(!n)return ba=Y.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5"),new A.FiltersCheckingResult(-1,ba);for(var Ba,I=0;I<ba.length;I++){var P=ba[I];if(!P.isEmpty()){Ba=ia(P,I,n);if(!Ba)if(Ba=I,P=Ha(P)){var D=Y.get("incompleteFilter","\u7b2c#1\u884c\u4e0d\u5b8c\u6574\uff0c");D=D.replace("#1",Ba+1);Ba=new A.FiltersCheckingResult(Ba,D+P)}else Ba=null;if(Ba)break}}return Ba};this.checkFilterLogical=
function(ba){var n=0,Ba=-1,I,P=0;for(I=0;I<ba.length;I++)ba[I].isEmpty()||(P=I);I=P;for(P=0;P<ba.length;P++){var D=ba[P];if(!D.isEmpty()){n+=D.getLeftBracketCount();n-=D.getRightBracketCount();0>Ba&&0!=n&&(Ba=P);if(0>n)return ba=Y.get("bracketMismatch","\u5de6\u53f3\u62ec\u53f7\u4e0d\u5339\u914d\u3002"),new A.FiltersCheckingResult(Ba,ba);if(P!==I&&!D.getLogicOp())return ba=Y.get("lackLogicalSymbol","\u7b2c#1\u884c\u7f3a\u5c11\u903b\u8f91\u7b26"),ba=ba.replace("#1",P+1),new A.FiltersCheckingResult(P,
ba);if(P==I&&D.getLogicOp())return ba=Y.get("logicalSymbolUnnecessary","\u5b58\u5728\u591a\u4f59\u7684\u903b\u8f91\u3002"),new A.FiltersCheckingResult(P,ba)}}return 0<n?(ba=Y.get("bracketMismatch","\u5de6\u53f3\u62ec\u53f7\u4e0d\u5339\u914d\u3002"),new A.FiltersCheckingResult(Ba,ba)):null};this.checkFieldExisted=function(ba,n){return ia(ba,-1,n)?!1:!0};var ia=function(ba,n,Ba){ba=ba.getField();for(var I=0;I<Ba.length;I++)if(ba&&Ba[I].getFullName()===ba.getFullName())return null;Ba=Y.get("lackField",
"\u7b2c#1\u884c\u5b57\u6bb5\u4e0d\u5b58\u5728\u3002");Ba=Ba.replace("#1",n+1);return new A.FiltersCheckingResult(n,Ba)},Ha=function(ba){var n=ba.getCompareOp(),Ba=ba.getField(),I=ba.getValue(),P=Ba?Ba.getOutputDataType():null;Ba=Ba?Ba.isEnum():!1;Ba=A.getSelectableCompares(P,Ba);ba=ba.getRelativeDateRange();if(!n)return Y.get("lackComparisonOperator","\u7f3a\u5c11\u6bd4\u8f83\u7b26\u3002");for(var D=!1,W=0;W<Ba.length;W++)if(n===Ba[W]){D=!0;break}if(!D)return Y.get("comparisonMismatch","\u6bd4\u8f83\u7b26\u4e0d\u5339\u914d\u3002");
if(!A.isCompareOpWithoutValue(n)){if(!I&&!ba)return Y.get("lackValue","\u7f3a\u5c11\u503c\u3002");if(P===Q.DT_NUMBER||P===Q.DT_INT){if(!A.REG_NUMBER.test(I)&&!A.isCompareOpWithinOrNotWithinValue(n))return Y.get("valueMustBeNum","\u503c\u5fc5\u987b\u4e3a\u6570\u5b57\u3002")}else if(P===Q.DT_DATE||P===Q.DT_DATETIME)if(A.isCompareOpRelativeDateRangeValue(n)){if(!(ba instanceof Z))return Y.get("invalidRelativeDateValue","\u65e0\u6548\u7684\u76f8\u5bf9\u65e5\u671f\u503c\u3002")}else{if(!A.REG_DATETIME.test(I))return Y.get("invalidDateValue",
"\u65e0\u6548\u7684\u65e5\u671f\u503c\u3002")}else if(P===Q.DT_BOOLEAN&&I!==Q.BOOLEAN_TRUE&&I!==Q.BOOLEAN_FALSE)return Y.get("wrongBoolean","\u9519\u8bef\u7684\u5e03\u5c14\u503c\u3002")}return null}};var O=new function(){var ia;this.hookCollector=function(Ha){ia=Ha};this.occur=function(Ha,ba){try{ia&&ia(Ha,ba)}catch(n){window.console&&console.warn(n)}}};O.BUTTON_TYPE="button-type";O.FUNCTION="function";O.DATATABLE_MODEL_TRANSFORM_NODE_TYPE="datatable-model-transform-node-type";O.METRIC_MODEL_DIMENSION_TYPE=
"metric-model-dimension-type";O.ENTER_DATA_AUTH_MANAGE="enter-data-auth-manage";O.SAVE="\u4fdd\u5b58";O.REFRESH="\u5237\u65b0";O.DEPLOY="\u90e8\u7f72";O.ROLLBACK_CURRENT_DEPLOY="\u56de\u9000\u5230\u6700\u65b0\u90e8\u7f72\u72b6\u6001";O.UNDO="\u64a4\u9500";O.REDO="\u53cd\u64a4\u9500";O.CLEAR="\u6e05\u9664";O.MODEL_CHECK="\u6a21\u578b\u6821\u9a8c";O.MODEL_PREVIEW="\u6a21\u578b\u9884\u89c8";O.MODEL_PROPERTY="\u6a21\u578b\u5c5e\u6027";O.SOURCE_MANAGE="\u6570\u636e\u6e90\u7ba1\u7406";O.MODEL_PREVIEW_EXPORT_TO_EXCEL=
"\u9884\u89c8-\u5bfc\u51fa\u5230Excel";O.METRIC_DELETE="\u5220\u9664";O.TRIAL_CALCULATE="\u8bd5\u8ba1\u7b97";O.TRIAL_CALCULATE_DIMENSION_FILTER="\u8bd5\u8ba1\u7b97-\u7ef4\u5ea6\u8fc7\u6ee4";O.SOURCE_TABLE_FILTER="\u6e90\u8868\u8fc7\u6ee4";O.SELECT_FIELD="\u9009\u62e9\u5b57\u6bb5";O.METRIC_FILTER="\u6307\u6807\u8fc7\u6ee4";O.NUMBER_FOMMAT="\u6570\u5b57\u683c\u5f0f";O.ADD_DIMENSION="\u65b0\u589e\u7ef4\u5ea6";O.PUBLIC_DIMENSION_SETTING="\u516c\u5171\u7ef4\u5ea6\u8bbe\u7f6e";O.ENTER_DATA_AUTH_MANAGE_AFTER_DEPLOY=
"\u6210\u529f\u90e8\u7f72\u540e\u70b9\u51fb\u8df3\u8f6c\u8fdb\u5165";Da.UserOperationReporter=O})();(function(){function ta(){var Xa;this.setCaption=function(ca){Xa=ca};this.getCaption=function(){return Xa?Xa:""};this.perform=function(){throw Error("Override me.");};this.unperform=function(){throw Error("Override me.");}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler=
{});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});var Da=com.kingdee.bos.qing.modeler.designer;Da.CommandManager=function(){var Xa=[],ca=[],Y=new mb;this.perform=function(A){A.perform();Ma(Xa,A);ca.length=0;oa(A,!0)};this.addPerformedListener=function(A){Y.addListener(A)};this.isCanUndo=function(){return 0<Xa.length};this.isCanRedo=function(){return 0<ca.length};this.undo=function(){var A=Xa.pop();A&&(A.unperform(),Ma(ca,A),oa(A,!1,!0))};this.redo=
function(){var A=ca.pop();A&&(A.perform(),Ma(Xa,A),oa(A,!1,!1))};this.reset=function(){Xa.length=0;ca.length=0;oa(null)};var Ma=function(A,Q){A.push(Q);32<A.length&&A.splice(0,1)},oa=function(A,Q,Z){Y.fireEvent(function(O){O(A,Q,Z)})}};Da.AbstractAction=ta;Da.ActionSetModel=function(){ta.call(this);var Xa,ca,Y;this.setValue=function(Ma,oa,A){ca=Ma;Y=oa;Xa=A};this.perform=function(){Xa(Y)};this.unperform=function(){Xa(ca)}};Da.ActionChangeModelInfo=function(){ta.call(this);var Xa,ca,Y,Ma,oa;this.getCaption=
function(){return Va.get("editModelInfo","\u7f16\u8f91\u6a21\u578b\u5c5e\u6027")};this.setValue=function(A,Q,Z,O,ia){Xa=A;ca=Q;Y=Z;Ma=O;oa=ia};this.perform=function(){Xa.setModelName(ca);Xa.setModelDesc(Ma)};this.unperform=function(){Xa.setModelName(Y);Xa.setModelDesc(oa)}};Da.ActionAddRemoveSource=function(){ta.call(this);var Xa,ca,Y,Ma;this.getCaption=function(){return Xa};this.setValue=function(oa,A,Q){ca=Q.getAllSource();var Z="",O="";Y=[];for(var ia=0;ia<ca.length;ia++){var Ha=ca[ia];-1<A.indexOf(Ha)?
(0<O.length&&(O+="\uff0c"),O+=Ha.getName()):Y.push(Ha)}for(ia=0;ia<oa.length;ia++)A=oa[ia],Y.push(A),0<Z.length&&(Z+="\uff0c"),Z+=A.getName();Xa="";0<Z.length&&(Xa+=Va.get("actionAddSource","\u6dfb\u52a0\u6570\u636e\u6e90\u201c#1\u201d").replace("#1",Z));0<O.length&&(0<Xa.length&&(Xa+="\uff1b"),Xa+=Va.get("actionRemoveSource","\u5220\u9664\u6570\u636e\u6e90\u201c#1\u201d").replace("#1",O));Ma=Q};this.perform=function(){Ma.setSource(Y)};this.unperform=function(){Ma.setSource(ca)}};Da.ActionMoveNode=
function(){ta.call(this);var Xa,ca,Y,Ma;this.getCaption=function(){if(!Ma){var oa=Da.DisplayNameHelper.getNodeDisplayName(Xa);Ma=Va.get("actionMoveNode","\u79fb\u52a8\u8282\u70b9\u201c#1\u201c").replace("#1",oa)}return Ma};this.setValue=function(oa,A){Xa=oa;ca=A;Y=[ca[0]-Xa.getX(),ca[1]-Xa.getY()]};this.perform=function(){Xa.changePosition(ca[0],ca[1])};this.unperform=function(){Xa.changePosition(Xa.getX()-Y[0],Xa.getY()-Y[1])}};Da.ActionChangeMaterializedConfig=function(){ta.call(this);var Xa,ca,
Y;this.getCaption=function(){return Va.get("editMaterializedConfig","\u7f16\u8f91\u7269\u5316\u5b58\u50a8\u8bbe\u7f6e")};this.setValue=function(Ma,oa){Xa=Ma;Y=oa};this.perform=function(){ca=Xa.getMaterializedConfig();Xa.setMaterializedConfig(Y)};this.unperform=function(){Xa.setMaterializedConfig(ca)}};var Va,mb;(function(){var Xa=com.kingdee.bos.qing.framework.common;Va=Xa.MultilanguageManager.createPackageAccessor(Da);Xa=com.kingdee.bos.qing.common;mb=Xa.EventListenerList})()})();(function(){function ta(){var K,pa,za,na,y,S,T,m,r,qa,k,d,b={},a=[],l=!0,c=!0,e=!0,g,v,u,h,B;this.getJqUi=function(){if(!g){f();if(t())for(var x=K.getModelerModel(),U=x.getAllTable(),ua=0;ua<U.length;ua++){var Aa=U[ua];if(x.getSource(Aa.getSourceUid()).getSourceType()!==D.SOURCE_TYPE_MODELSET_FILE_SOURCE){var bb=Aa.getUid(),fa=p(x,bb,!1);0<fa.length&&(a.push(Aa),b[bb]=fa)}}g=$("<div>");B=$("<div>");x=new O;na=new ia;y=new ia;S=new ia;na.setText(Y.get("neverExtract","\u4e0d\u8fdb\u884c\u7269\u5316\u5b58\u50a8\uff0c\u603b\u662f\u5b9e\u65f6\u6267\u884c\u6a21\u578b"));
y.setText(Y.get("onceExtract","\u4ec5\u5728\u90e8\u7f72\u65f6\u7269\u5316\u5b58\u50a8\u4e00\u6b21\uff0c\u4ee5\u540e\u4e0d\u518d\u66f4\u65b0"));S.setText(Y.get("timingExtract","\u5b9a\u65f6\u8fdb\u884c\u7269\u5316\u5b58\u50a8"));x.addElement(na);x.addElement(y);x.addElement(S);U=na.getJqUi();ua=y.getJqUi();Aa=S.getJqUi();ca.layoutCtrl(U,0,0,530,23);ca.layoutCtrl(ua,0,35,530,23);ca.layoutCtrl(Aa,0,70,530,23);U.appendTo(g);ua.appendTo(g);Aa.appendTo(g);bb=$("<div>");bb.text(Y.get("materializationMethod",
"\u7269\u5316\u65b9\u5f0f"));var Oa=new Ha;Oa.setIconType(Ha.ICON_TYPE_QUESTION);Oa.setTipsSize(300,105);Oa.setTipsHtml(Y.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"));
U=new O;T=new ia;m=new ia;T.setText(Y.get("fullMaterialize","\u5168\u91cf\u7269\u5316"));m.setText(Y.get("incrementalMaterialize","\u589e\u91cf\u7269\u5316"));U.addElement(T);U.addElement(m);ua=$("<div>");fa=$("<div>");Aa=$("<div>");Oa=Oa.getJqUi();var aa=T.getJqUi(),wa=m.getJqUi();ca.layoutCtrl(fa,0,0,540,19);ca.layoutCtrl(aa,20,30,250,23);ca.layoutCtrl(Aa,20,60,520,23);ca.layoutCtrl(ua,0,0,540,90);bb.appendTo(fa);Oa.appendTo(fa);fa.appendTo(ua);aa.appendTo(ua);wa.appendTo(Aa);Aa.appendTo(ua);ua.appendTo(B);
bb.addClass("modeler-designer-materialized-method-label");Oa.addClass("modeler-designer-materialized-method-label-tips");fa.css({"border-bottom":"1px solid #CCCCCC"});wa.css({display:"inline-block"});m.setCustomStyle("position","relative");fa=new Z;fa.setText(Y.get("basedField","\u4f9d\u636e\u5b57\u6bb5"));r=q();bb=new Ha;bb.setIconType(Ha.ICON_TYPE_QUESTION);bb.setTipsSize(200,70);bb.setTipsText(Y.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"));
u=$("<div>");P.background(u,"qingWarning");u.hide();v=$("<div>");fa=fa.getJqUi();Oa=r.getJqUi();bb=bb.getJqUi();ca.layoutCtrl(fa,0,0,50,23);ca.layoutCtrl(bb,52,3,16,16);ca.layoutCtrl(u,80,3,16,16);ca.layoutCtrl(Oa,80,0,150,23);fa.appendTo(v);bb.appendTo(v);u.appendTo(v);Oa.appendTo(v);v.appendTo(Aa);v.addClass("modeler-designer-materialized-based-field");Aa=new Z;Aa.setText(Y.get("executePlan","\u6267\u884c\u8ba1\u5212"));qa=new Ma;qa.isOnlyPeriod(!0);qa.setCronAnalysisFacade(L);qa.setScheduleChangedListener(z);
h=$("<div>");Aa=Aa.getJqUi();bb=qa.getJqUi();ca.layoutCtrl(Aa,0,0,540,23);ca.layoutCtrl(bb,11,30,300,200);ca.layoutCtrl(h,0,100,540,225);ca.layoutCtrl(B,20,105,540,350);Aa.appendTo(h);bb.appendTo(h);h.appendTo(B);B.appendTo(g);Aa.children(":first-child").css("font-weight","bold");Aa.css("border-bottom","1px solid #CCCCCC");x.addChangedListener(E);U.addChangedListener(M);k||(na.getJqUi().hide(),y.getJqUi().css("top","0px"),S.getJqUi().css("top","35px"),B.css("top","70px"),ua.hide(),Aa.hide(),h.css("top",
"0px"),bb.css({left:"-9px",top:"-5px"}));J()}return g};this.setGlobal=function(x){K=x};this.setRemoteImpl=function(x){pa=x};this.setSupportIncrementConfig=function(x){k=x};this.setMessageCurtain=function(x){za=x};this.setMaterializedConfig=function(x){d=x;J()};this.getMaterializedConfig=function(){F();return d};this.checkMaterializedConfig=function(){F();if(!d)return!0;if(!l)return za.showPrompt(Y.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(!c)return za.showPrompt(Y.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(la.TYPE_TIMING===d.getType()){if(la.STRATEGY_INCREMENTAL===d.getStrategy()){if(!t())return za.showPrompt(Y.get("noSupportIncrement","\u5f53\u524d\u6a21\u578b\u4e0d\u652f\u6301\u589e\u91cf\u7269\u5316\u3002")),!1;var x=d.getBasedFields();if(!x||0===x.length)return za.showPrompt(Y.get("noBasedField",
"\u4f9d\u636e\u5b57\u6bb5\u4e0d\u80fd\u4e3a\u7a7a\u3002")),!1;for(var U=0;U<x.length;U++){var ua=C(x[U].getTableId(),x[U].getName());if(!ua||I.DT_INT!==ua.getOriginalDataType()&&I.DT_DATETIME!==ua.getOriginalDataType())return za.showPrompt(Y.get("incompleteMaterializedConfig","\u7269\u5316\u5b58\u50a8\u8bbe\u7f6e\u4e0d\u5b8c\u6574")+Y.get("punctuation_period","\u3002")),!1}}x=d.getSchedule();if(x.getPeriod()===oa.Period_Custom){U=x.getCron();if("undefined"==typeof U||""===U)return x=k?Y.get("cronEmptyError",
"\u6267\u884c\u8ba1\u5212\u4e2d\u8868\u8fbe\u5f0f\u4e0d\u80fd\u4e3a\u7a7a\uff0c\u683c\u5f0f\u5982 0 0 12 * * ?"):Y.get("cronEmptyErrorForMetric","\u8868\u8fbe\u5f0f\u4e0d\u80fd\u4e3a\u7a7a\uff0c\u683c\u5f0f\u5982 0 0 12 * * ?"),za.showPrompt(x),!1;if(!x.getCronFlag())return x=k?Y.get("cornInCheckOrError","\u6267\u884c\u8ba1\u5212\u4e2d\u8868\u8fbe\u5f0f\u6709\u8bef\u6216\u8868\u8fbe\u5f0f\u6b63\u5728\u89e3\u6790\u6821\u9a8c\u3002"):Y.get("cornInCheckOrErrorForMetric","\u8868\u8fbe\u5f0f\u6709\u8bef\u6216\u8868\u8fbe\u5f0f\u6b63\u5728\u89e3\u6790\u6821\u9a8c\u3002"),
za.showPrompt(x),!1;if(!e)return x=k?Y.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"):Y.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"),za.showPrompt(x),!1}}return!0};var F=function(){if(S&&S.isChecked()){d=new la;d.setType(la.TYPE_TIMING);
d.setStrategy(la.STRATEGY_FULL);if(m&&m.isChecked()){d.setStrategy(la.STRATEGY_INCREMENTAL);var x=r.getSelectedModel();if(x){var U=new Ea;U.setTableId(x.getTableId());U.setTableName(x.getTableName());U.setName(x.getField().getName());U.setAlias(x.getField().getAlias());d.setBasedFields([U])}}d.setSchedule(qa.getSchedule())}else d=y&&y.isChecked()?new la:null},J=function(){T.setChecked(!0);na.setChecked(!0);k||y.setChecked(!0);if(d)if(la.TYPE_ONCE===d.getType())y.setChecked(!0);else{S.setChecked(!0);
if(la.STRATEGY_INCREMENTAL===d.getStrategy()){var x=d.getBasedFields();if(x&&0<x.length){a:{var U=x[0].getTableId(),ua=x[0].getName(),Aa=K.getModelerModel(),bb=Aa.getTable(U);Aa=Aa.getPage().getNodesByTableId(U);if(bb&&Aa&&0<Aa.length){if(U=C(U,ua)){x=new mb(bb,U,!1);break a}}else bb=new Ba,bb.setUid(U),bb.setDisplayName(x[0].getTableName());U=new I;U.setName(ua);U.setAlias(x[0].getAlias());x=new mb(bb,U,!0)}x&&(m.setChecked(!0),r.setSelectedModel(x))}}qa.setSchedule(d.getSchedule())}},C=function(x,
U){x=p(K.getModelerModel(),x,!0);for(var ua=0;ua<x.length;ua++)if(U===x[ua].getName())return x[ua]},p=function(x,U,ua){var Aa=[];(U=x.getPage().getNodesByTableId(U))&&1===U.length&&Xa.NodeFieldHelper.asynGetFields(x,U[0],function(bb){if(ua)Aa=bb;else for(var fa=0;fa<bb.length;fa++){var Oa=bb[fa].getOriginalDataType();I.DT_INT!==Oa&&I.DT_DATETIME!==Oa||Aa.push(bb[fa])}});return Aa},f=function(){(new W(pa,function(x){c=l=!0},function(x,U){return 30001001===x?(l=!1,za.showPrompt(Y.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===x?(c=!1,za.showPrompt(Y.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()},t=function(){var x=K.getModelerModel().getAllTable();
return!x||1<x.length||1===x.length&&K.getModelerModel().getSource(x[0].getSourceUid()).getSourceType()===D.SOURCE_TYPE_MODELSET_FILE_SOURCE?!1:K.getModelerModel().supportIncrementalMaterialize()},q=function(){var x=new Da;x.setTables(a);x.setTableFieldMap(b);var U=new ba;U.setDropdownCreator(function(ua,Aa,bb){return x.createJqPopup(ua,Aa,bb)});U.addSelectionListener(function(ua){var Aa=ua.getSelectedModel();ua=r.getJqUi();ua.css({left:80,width:150});u.hide();Aa.isDeleted()?(ua.css({left:96,width:134}),
u.attr("title",Y.get("basedFieldNotExist","\u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664")),u.show()):(Aa=Aa.getField().getOriginalDataType(),I.DT_INT!==Aa&&I.DT_DATETIME!==Aa&&(ua.css({left:96,width:134}),u.attr("title",Y.get("basedFieldTypeFail","\u5b57\u6bb5\u7c7b\u578b\u5fc5\u987b\u4e3a\u65e5\u671f\u65f6\u95f4\u6216\u6574\u6570")),u.show()))});U.setCustomPainter(function(ua,Aa){ua&&(ua=ua.getTableName()+"."+ua.getField().getAlias(),Aa.attr("title",ua),Aa.text(ua))});return U},z=
function(){var x=qa.getSchedule(),U=x.getCron();if(d&&d.getSchedule()){var ua=d.getSchedule().getCron();oa.Period_Custom===x.getPeriod()&&U&&U===ua&&(ua=new W(pa,function(Aa){x.setCronFlag(!0);e=Aa.cronInterval},function(Aa,bb){return 20001008===Aa?(x.setCronFlag(!1),!0):!1}),ua.setShowBlocking(!1),ua.cronExpression(U))}},L=function(x,U,ua){(new W(pa,function(Aa){e=Aa.cronInterval;if(!e){var bb=k?Y.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"):
Y.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");za.showPrompt(bb)}U&&U(Aa.cronData)},function(Aa,bb){var fa=!1;20001008===Aa&&(bb=Y.get("cronError","\u53c2\u6570\u9519\u8bef\uff0c\u8868\u8fbe\u5f0f\u6709\u8bef\u3002"),fa=!0);ua&&ua(Aa,bb);return fa})).cronExpression(x)},E=function(x,U){S&&S.isChecked()?B.show():B.hide()},M=function(x,U){if(T&&T.isChecked())r&&r.setEnabled(!1);
else if(r&&r.setEnabled(!0),!t())return r&&r.setEnabled(!1),za.showPrompt(Y.get("noSupportIncrement","\u5f53\u524d\u6a21\u578b\u4e0d\u652f\u6301\u589e\u91cf\u7269\u5316\u3002")),!1}}function Da(){function K(){var m,r,qa,k,d,b,a;this.getJqUi=function(){m||l();return m.getJqUi()};this.setSelectedModel=function(F){b=F};this.setSelectedModelSetter=function(F){a=F};this.setSearchText=function(F){k=F;h()};this.setTables=function(F){r=F;h()};this.setTableFieldMap=function(F){qa=F;h()};var l=function(){m=
new A;m.setBorderVisible(!0);m.setCustomItemPainter(c);m.setMultiSelectable(!1);m.setCustomSelectedsPainter(e);m.addPressedListener(function(F,J){F=F.getSelecteds()[0];F instanceof mb&&a&&a(F)})},c=function(F,J){if(J instanceof mb){var C=J.getField();F.css("margin-left","20px");F.addClass("modeler-designer-materialized-field-list-item");F.css("cursor","pointer");var p=$("<div>");p.text(C.getAlias());p.attr("title",C.getAlias());p.addClass("modeler-designer-materialized-table-field-text");F.append(p);
F.data("model",J);C=C.getOriginalDataType();p=$("<div>");p.addClass("modeler-designer-materialized-table-field-icon");ca.layoutCtrl(p,10,3,16,16);P.background(p,C);p.data("myIconName",C);p.appendTo(F);b&&J&&b.getField().getFullName()===J.getField().getFullName()&&v(F,J)}else u(F,J)},e=function(F,J){for(var C=0;C<F.length;C++){var p=F[C];g(p,!1)}for(C=0;C<J.length;C++)p=J[C],g(p,!0)},g=function(F,J){F=F.find(".modeler-designer-materialized-table-field-icon");"qingTable"===F.data("myIconName")&&P.background(F,
J?"qingTableWhite":"qingTable")},v=function(F,J){if(0<F.height()){var C=F.find(".modeler-designer-materialized-table-field-icon"),p=C.data("myIconName");P.background(C,p+"_hover");F.css("color","#fff");F.css("background-color","#88a7f6");F.css("background-color","var(--color-lightish, #88a7f6)");m.setSelecteds([J]);m.scrollSelectedToVisible(J)}else setTimeout(function(){v(F,J)},0)},u=function(F,J){var C=$("<div>");ca.layoutCtrl(C,0,2,16,16);P.backgroundWithHover(C,"expanded");C.appendTo(F);var p=
$("<div>");ca.layoutCtrl(p,20,3,16,16);P.background(p,"qingTable");p.data("myIconName","qingTable");p.addClass("modeler-designer-materialized-table-field-icon");p.appendTo(F);p=$("<div>");p.text(J.getTableName());p.addClass("modeler-designer-materialized-table-field-text");p.css("left","40px");p.css("font-weight","bold");F.on("click",function(f){f=$(f.currentTarget).data("model");var t=!f.isExpand();f.setExpand(t);P.backgroundWithHover(C,t?"expanded":"expand");t=m.getJqUi().find(".modeler-designer-materialized-field-list-item");
for(var q=f.isExpand(),z=0;z<t.length;z++){var L=$(t[z]);L.data("model").getTableId()===f.getTableId()&&L.css("display",q?"":"none")}});F.data("model",J);F.append(p)},h=function(){if(m&&r){for(var F=[],J=0;J<r.length;J++){var C=r[J];F.push(new Va(C));if(qa){var p=qa[C.getUid()];if(p)for(var f=0;f<p.length;f++)F.push(new mb(C,p[f],!1))}}if(J=k){C=[];for(p=0;p<F.length;p++)f=F[p],f instanceof Va?(0<C.length&&C[C.length-1]instanceof Va&&C.splice(C.length-1),C.push(f)):-1<f.getField().getAlias().toUpperCase().indexOf(J)&&
C.push(f);C[C.length-1]instanceof Va&&C.splice(C.length-1);F=C}m.setItemModels(F,B);0===F.length?(d||(d=$("<div>"),ca.layoutCtrlCenterAlign(d,135),d.css({color:"#c0c0c0",top:"35px","text-align":"center"}),d.appendTo(pa)),F=k?Y.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"):Y.get("noSelectField","\u6682\u65e0\u53ef\u9009\u5b57\u6bb5"),d.text(F),d.show(),m.getJqUi().hide()):(d&&d.hide(),m.getJqUi().show())}},B=function(F,J){return F instanceof Va&&J instanceof
Va||F instanceof mb&&J instanceof mb?F.equals(J):!1}}var pa,za,na,y,S;this.createJqPopup=function(m,r,qa){pa=$("<div>");pa.css({"background-color":"#fff",height:"100%",width:"100%"});pa.appendTo(m);y=new n;y.setShowSearchIcon(!0);y.setPlaceholder(Y.get("searchField","\u8bf7\u8f93\u5165\u5b57\u6bb5\u540d\u79f0"));y.setSearchListenerDelay(800);y.addSearchListener(T);m=y.getJqUi();ca.layoutCtrlWithLRTB(m,0,0,null,0,null,25);pa.append(m);S=new K;S.setSelectedModel(r);S.setSelectedModelSetter(qa);S.setTables(za);
r=S.getJqUi();ca.layoutCtrlWithLRTB(r,0,0,null,25,0,null);pa.append(r);S.setTableFieldMap(na);r=30;if(za&&na)for(r+=20*za.length,qa=0;qa<za.length;qa++)r+=20*na[za[qa].getUid()].length;90>=r?r=90:320<r&&(r=320);return[-1,r]};this.setTables=function(m){za=m};this.setTableFieldMap=function(m){na=m};var T=function(){var m=$.trim(y.getText()).toUpperCase();S.setSearchText(m)}}function Va(K){var pa=!0;this.getTableId=function(){return K.getUid()};this.setExpand=function(za){pa=za};this.isExpand=function(){return pa};
this.getTableName=function(){return K.getDisplayName()?K.getDisplayName():K.getTableName()};this.equals=function(za){return K.getUid()===za.getTableId()}}function mb(K,pa,za){this.getField=function(){return pa};this.getTableId=function(){return K.getUid()};this.getTableName=function(){return K.getDisplayName()?K.getDisplayName():K.getTableName()};this.isDeleted=function(){return za};this.equals=function(na){return K.getUid()===na.getTableId()&&pa.equals(na.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 Xa=com.kingdee.bos.qing.modeler.designer;Xa.MaterializedConfigDialog=function(){Q.call(this);var K=this,pa=this.protectedMethod,za,
na,y,S=!1,T,m;(function(){pa.setTitle(Y.get("materializedConfig","\u7269\u5316\u5b58\u50a8\u8bbe\u7f6e"));K.setSize(620,570);pa.setContentPaneCreator(function(){if(!T){T=$("<div>");y=new ta;y.setGlobal(za);y.setRemoteImpl(na);y.setSupportIncrementConfig(S);y.setMessageCurtain(pa.getMessageCurtain());m=y.getJqUi();m.appendTo(T);var r=za.getModelerModel();r=r.getMaterializedConfig()?r.getMaterializedConfig().copy():null;y.setMaterializedConfig(r)}return T});pa.setClosingChecker2(function(r){r=za.getModelerModel();
var qa=r.getMaterializedConfig();if(!y.checkMaterializedConfig())return!1;var k=y.getMaterializedConfig();if(!k&&!qa||k&&qa&&k.equals(qa))return!0;qa=new ra;qa.setValue(r,k);za.getCommandManager().perform(qa);return!0});pa.setClosingAction(function(r){})})();this.setGlobal=function(r){za=r};this.setRemoteImpl=function(r){na=r};this.setSupportIncrementConfig=function(r){S=r}};var ca,Y,Ma,oa,A,Q,Z,O,ia,Ha,ba,n,Ba,I,P,D,W,la,Ea,ra;(function(){var K=com.kingdee.bos.qing.common;ca=K.DomUtil;K=com.kingdee.bos.qing.framework.common;
Y=K.MultilanguageManager.createPackageAccessor(Xa);K=com.kingdee.bos.qing.schedule;Ma=K.ScheduleSelector;oa=K.QingSchedule;K=com.kingdee.bos.qing.ui.component;A=K.List;Q=K.AbstractModalDialog;Z=K.Label;O=K.RadioButtonGroup;ia=K.RadioButton;Ha=K.HelpIcon;ba=K.DropdownSelector;n=K.SearchBox;Ba=Xa.Table;I=Xa.Field;P=Xa.Icons;D=Xa.AbstractModelerSource;W=Xa.DesignerFacade;la=Xa.MaterializedConfig;Ea=Xa.BasedField;ra=Xa.ActionChangeMaterializedConfig})()})();(function(){function ta(){function d(B,F,J,C){this.getX1=function(){return B};this.getX2=function(){return J};this.getY1=function(){return F};this.getY2=function(){return C}}var b=!1,a,l,c=[],e,g;this.isPrepared=function(){return b};this.prepare=function(B,F,J){g=J;l=F;B=B.getAllNodes();a=[];for(F=0;F<B.length;F++){var C=B[F];J=C.getX();var p=C.getY(),f=J+C.getWidth();C=p+C.getHeight();a.push(new d(J,p,f,C))}b=!0};this.anchor=function(B){h();e=B;var F=!1,J=!1;for(B=0;B<a.length;B++){var C=a[B];if(!F){F=
C;var p=e[1]+(e[3]>>1);var f=F.getY1()+F.getY2()>>1;if(10>=Math.abs(f-p)){p=v(F);var t=g.getScaledSize(f);u(p[0],t,p[1],t);e[1]=f-(e[3]>>1);f=!0}else f=!1;f?F=!0:(p=e[1],f=F.getY1(),10>=Math.abs(f-p)?(p=v(F),t=g.getScaledSize(f),u(p[0],t,p[1],t),e[1]=f,f=!0):f=!1,f?F=!0:(p=e[1]+e[3],f=F.getY2(),10>=Math.abs(p-f)?(F=v(F),p=g.getScaledSize(f),u(F[0],p,F[1],p),e[1]=f-e[3],F=!0):F=!1))}J||(J=C,f=e[0],C=J.getX1(),10>=Math.abs(C-f)?(f=v(J,!0),p=g.getScaledSize(C),u(p,f[0],p,f[1]),e[0]=C,C=!0):C=!1,C||(f=
e[0]+e[2],C=J.getX2(),10>=Math.abs(C-f)?(J=v(J,!0),f=g.getScaledSize(C),u(f,J[0],f,J[1]),e[0]=C-e[2],C=!0):C=!1),J=C);if(F&&J)break}};this.abort=function(){h()};var v=function(B,F){if(F){F=e[1];var J=B.getY1();F<J?B=B.getY2():(F=J,B=e[1]+e[3])}else F=e[0],J=B.getX1(),F<J?B=B.getX2():(F=J,B=e[0]+e[2]);return g.getScaledCoordinate([F-15,B+15])},u=function(B,F,J,C){var p=$("<div>");p.addClass("modeler-designer-auxiliary-line");l.append(p);c.push(p);O.layoutCtrl(p,B,F,J-B,C-F)},h=function(){for(var B=
0;B<c.length;B++)c[B].remove();c=[]}}function Da(){var d=this;this.createNode=function(b){return document.createElementNS("http://www.w3.org/2000/svg",b)};this.createWithAttrs=function(b,a){b=d.createNode(b);d.setAttributes(b,a);return b};this.setText=function(b,a){$(b).empty();a=document.createTextNode(a);b.appendChild(a)};this.setTitle=function(b,a){var l=b.getElementsByTagName("title");0==l.length?(l=d.createNode("title"),b.appendChild(l)):l=l[0];d.setText(l,a)};this.addClass=function(b,a){$(b).addClass(a)};
this.createPath=function(b,a,l,c){var e=d.createNode("path"),g=d.getPathCoordinate(b,a),v=d.getPathCoordinate(b+l,a);l=d.getPathCoordinate(b+l,a+c);b=d.getPathCoordinate(b,a+c);d.setAttributes(e,{d:"M"+g+" L"+v+" L"+l+" L"+b+" Z"});return e};this.setAttributes=function(b,a){for(var l in a)b.setAttribute(l,a[l])};this.getPathCoordinate=function(b,a){return""+b+" "+a}}function Va(){var d,b,a=0,l={},c={},e,g,v;this.getSelectedEntityName=function(){var f,t;for(t in l){var q=l[t];q&&q.isChecked()&&(f=
f?f+A.ENTITY_SEPARATOR+t:t)}return f};this.setFunUpdateProperties=function(f){d=f};this.setMeta=function(f){g=f};this.setSelectedTableNames=function(f){if(g.getTableNode())for(v=f,f=0;f<v.length;f++){var t=v[f],q=l[t];q&&(q.setChecked(!0),p(q,!0),d(c[t],t))}};this.getJqUi=function(){if(!b){b=$("<div>");b.addClass("modeler-designer-selected-field-entry-panel");if(!g.getTableNode()){var f=new Ma;f.setType(Ma.TYPE_NO_SOURCE);f.getJqUi().appendTo(b);return b}var t=new S;t.fromJsonObject(g.getTableNode());
var q=new Y;q.setLevel(0);q.toFolderLevelNode(t);u(q,0);t=g.getPropertyMap();for(f in t)c[f]=t[f]}return b};var u=function(f,t){if(f.getDisplayName()){var q=t,z=$("<div>");z.addClass("modeler-designer-selected-entity-item");var L=new I;L.setUserObject(f);0==q&&f.getName();l[f.getName()]=L;L.addCheckedListener(p);L=L.getJqUi();O.layoutCtrl(L,20*q,30*a,15,20);L.appendTo(z);L=$("<div>");L.addClass("modeler-designer-selected-entity-item-ui");L.attr("entity-name",f.getName());L.on("click",J);O.layoutCtrlWithLRTB(L,
20*q+18,10,null,30*a,0,20);var E=$("<div>");E.addClass("modeler-designer-selected-entity-item-text");E.text(f.getDisplayName());E.attr("title",f.getDisplayName());O.layoutCtrl(E,23,2,null,20);E.appendTo(L);E=$("<span>");E.addClass("modeler-designer-selected-entity-item-icon");y.background(E,"entity-entry");0==q&&y.background(E,"entity-sub");O.layoutCtrl(E,2,2,16,16);E.appendTo(L);L.appendTo(z);z.appendTo(b);a++;++t}if(q=f.getChildren())for(z=0;z<q.length;z++)L=new Y,L.setLevel(t),L.toFolderLevelNode(q[z]),
L.setParentNode(f),u(L,t)},h=function(f,t){if((f=f.getChildren())&&0<f.length)for(var q=0;q<f.length;q++){var z=f[q];t[z.getName()]=z;h(z,t)}},B=function(f,t){if(f=f.getParentNode())t[f.getName()]=f,B(f,t)},F=function(f){var t={};if(!f)return t;if(f=f.getChildren())for(var q=0;q<f.length;q++){var z=f[q];t[z.getName()]=z}return t},J=function(f){f=$(f.currentTarget).attr("entity-name");d(c[f],f);e&&C(!1);e=f;C(!0)},C=function(f){var t=b.find("[entity-name='"+e+"']");t&&(f?t.addClass("modeler-designer-selected-entity-item-ui_selected"):
t.removeClass("modeler-designer-selected-entity-item-ui_selected"))},p=function(f,t){if(t){t=f.getUserObject();d(c[t.getName()],t.getName());var q=t.getParentNode(),z=F(t),L={};h(t,L);var E={};B(t,E);var M=!1;for(U in L){var x=l[U];if(x&&x.isChecked()){M=!0;break}}var U=M;M=!1;for(ua in E)if((x=l[ua])&&x.isChecked()){M=!0;break}var ua=M;if(f.isChecked()){e&&C(!1);e=t.getName();C(!0);q&&(f=l[q.getName()])&&f.setEnabled(!0);for(var Aa in l)f=l[Aa],t.getName()==Aa||q&&Aa==q.getName()||U&&L[Aa]||ua&&
E[Aa]||(z[Aa]?f.setEnabled(!0):f.setEnabled(!1))}else for(Aa in e&&C(!1),e=t.getName(),C(!0),q=F(q),l)f=l[Aa],t.getName()==Aa||ua&&E[Aa]||(q[Aa]?f.setEnabled(!0):(L[Aa]&&f.isChecked()&&f.setChecked(!1),f.setEnabled(!ua)))}}}function mb(){var d,b,a,l;this.setMeta=function(c){d=c};this.setCurrentTableName=function(c){b=c};this.getCurrentTableName=function(){return b};this.setSelectedPropertyName=function(c){a=c};this.getSelectedPropertyName=function(){return a};this.getMeta=function(){return d};this.getJqUi=
function(){};this.getSelectedProperties=function(){return null};this.getSelectedEntityName=function(){};this.getIsEntityView=function(){return!1};this.setWidth=function(c){l=c};this.getWidth=function(c){return l}}function Xa(){mb.call(this);var d=this,b,a,l,c,e,g,v={},u=[];this.setLockPropertyName=function(J){u=J};this.setArrProperties=function(J,C){e=C;c=J;h(!0)};this.getTableFieldMap=function(){return v};var h=function(J){a&&a.hide();if(c&&0!=c.length){g=[];if(v[e])var C=v[e];else{C=c;for(var p=
d.getCurrentTableName().split(A.ENTITY_SEPARATOR),f=0;f<C.length;f++){var t=C[f],q=new oa;q.setField(t);q.setDisplayName(t.getAlias());u&&-1!=u.indexOf(t.getName())&&(q.setEnabled(!1),q.setShowRelationIcon(!0));q.setSelected(!0);-1!=p.indexOf(e)&&d.getSelectedPropertyName()&&-1==d.getSelectedPropertyName().indexOf(t.getName())&&q.setSelected(!1);g.push(q)}v[e]||(v[e]=g);C=g}l.setArrFieldItems(C,J)}else a?a.show():(J=new Ma,J.setType(Ma.TYPE_NO_DATA_WITH_CLOUD),a=J.getJqUi(),l.setJqNoDataUI(a),a.appendTo(b))},
B=function(){var J=d.getMeta().getRelations();if(J&&0<J.length){u=[];for(var C=0;C<J.length;C++){var p=J[C];-1==u.indexOf(p.getFromProperty())&&u.push(p.getFromProperty())}}};this.getJqUi=function(){b||F();return b};var F=function(){b=$("<div>");b.addClass("modeler-designer-selected-field-panel");l=new ca;l.setShowAllCheckbox(!0);l.setFunFieldCheckClick(function(C,p){p.setSelected(C)});var J=l.getJqUi();J.addClass("modeler-designer-selected-field-list-panel");J.appendTo(b);e=d.getCurrentTableName();
d.getMeta().getPropertyMap()&&(c=d.getMeta().getPropertyMap()[e]);B();h()};this.getSelectedProperties=function(){if(!c)return[];var J=[],C={},p=!0,f=v[d.getCurrentTableName()];if(!f)return[];for(var t=0;t<f.length;t++){var q=f[t],z=q.getField();C[z.getFullName()]||(q.getSelected()?(J.push(z),C[z.getFullName()]=!0):p=!1)}return p?null:J}}function ca(){var d=[],b,a,l,c,e=!1,g=!1,v=!0,u=!0,h=!0,B,F,J,C,p,f,t;this.getContentPaneCreator=function(){return z};this.show=function(){b.show()};this.hide=function(){b.hide()};
this.getJqUi=function(){b||z();return b};this.setJqNoDataUI=function(fa){F=fa};this.getArrFieldItems=function(){return d};this.setArrFieldItems=function(fa,Oa){d=[];B.empty();fa&&0!==fa.length?F&&F.hide():F&&F.show();Oa&&(e=!1,l&&l.setChecked(!1),a&&a.clear());if(g){Oa=q(fa);var aa=B,wa=aa.append,Pa=Oa==fa.length,V=$("<div>");V.addClass("modeler-desinger-select-field-lineitem");J=new I;J.setChecked(Pa);J.addCheckedListener(x);Pa=J.getJqUi();Pa.addClass("modeler-designer-field-item-checkbox");Pa.appendTo(V);
Pa=$("<div>");Pa.addClass("modeler-designer-field-item-allcheckbox-text");Pa.text(Q.get("selectAll","\u5168\u9009"));Pa.appendTo(V);C=$("<div>");C.addClass("modeler-designer-field-item-selected-prompt");C.text(Q.get("selectedItemsPrompt","(\u5df2\u9009\u62e9#1\u9879)"));C.appendTo(V);wa.call(aa,V);L(Oa)}for(Oa=0;Oa<fa.length;Oa++)aa=fa[Oa],aa.setFunFieldCheckClick(Aa),d.push(aa),aa.initJqUi(),wa=aa.getJqUi(),wa.appendTo(B),l&&l.isChecked()&&!aa.getSelected()&&wa.hide();E()};this.setFunFieldCheckClick=
function(fa){p=fa};this.setFunAllCheckboxClick=function(fa){f=fa};this.setAllCheckboxSelected=function(fa){J.setChecked(fa)};this.setShowSearchText=function(fa){h=fa};var q=function(fa){for(var Oa=0,aa=0;aa<fa.length;aa++)fa[aa].getSelected()&&Oa++;return Oa},z=function(){if(!b){b=$("<div>");if(h){var fa=$("<div class='modeler-designer-select-field-search-text'>");fa.text(Q.get("search","\u641c\u7d22"));fa.appendTo(b)}fa=b;var Oa=fa.append;a=new P;a.setShowSearchIcon(!0);a.addSearchListener(E);a.setSearchListenerDelay(500);
a.setPlaceholder(Q.get("inputSearchText","\u8f93\u5165\u641c\u7d22\u6587\u672c"));var aa=a.getJqUi();aa.addClass("modeler-designer-select-field-search-box");h?aa.css("left","10px"):aa.css("width","90%");Oa.call(fa,aa);v&&b.append(U);B=$("<div class='modeler-designer-select-field-list'>");u&&B.css("overflow","scroll");F&&b.append(F);b.append(B)}return b},L=function(fa){C&&C.text(Q.get("selectedItemsPrompt","(\u5df2\u9009\u62e9#1\u9879)").replace("#1",fa))},E=function(fa){c=$.trim(a.getText());M(d,
c)},M=function(fa,Oa){if(0==Oa.length){t&&t.hide();fa&&0!==fa.length||F.show();for(var aa=0;aa<fa.length;aa++){var wa=fa[aa];e&&!wa.getSelected()||wa.show(!0)}J&&J.setChecked(bb())}else{var Pa=!0;for(aa=0;aa<fa.length;aa++)if(wa=fa[aa],!e||wa.getSelected())-1===wa.getDisplayName().toLowerCase().indexOf(Oa.toLowerCase())?wa.show(!1):(wa.show(!0),Pa=!1);Pa?(t||(t=$("<div>"),t.addClass("modeler-designer-addsource-noresult-view-container"),fa=$("<div>"),fa.addClass("modeler-designer-addsource-noresult-view-icon"),
y.background(fa,"search-no-result"),fa.appendTo(t),fa=$("<div>"),fa.addClass("modeler-designer-addsource-noresult-view-tip"),fa.text(Q.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),fa.appendTo(t),t.appendTo(b),t.hide()),t.show(),F&&F.hide(),J&&J.setChecked(!1)):(t&&t.hide(),J&&J.setChecked(bb()))}};this.updateSelectedItemsPrompt=function(){L(q(d))};var x=function(fa,Oa){if(Oa){for(var aa=0;aa<d.length;aa++){var wa=d[aa];wa.isShow()&&wa.getEnabled()&&wa.setSelected(fa.isChecked())}f&&
f(fa,Oa);fa=q(d);L(fa)}},U=function(){l=new I;l.setChecked(e);l.addCheckedListener(ua);l.setText(Q.get("showOnlyChecked","\u4ec5\u663e\u793a\u9009\u4e2d\u9879"));var fa=l.getJqUi();O.layoutCtrl(fa,290,5,200,23);return fa},ua=function(fa,Oa){Oa&&((e=fa.isChecked())?d.forEach(function(aa){aa.getSelected()||aa.show(!1)}):d.forEach(function(aa){aa.show(!0)}),M(d,c))};this.setShowAllCheckbox=function(fa){g=fa};this.setShowScroll=function(fa){u=fa};this.setShowOnlyChecked=function(fa){v=fa};var Aa=function(fa,
Oa){p&&p(fa,Oa);fa=q(d);L(fa);J&&J.setChecked(bb())},bb=function(){for(var fa=!0,Oa=0;Oa<d.length;Oa++){var aa=d[Oa];if(aa.isShow()&&!aa.getSelected()){fa=!1;break}}return fa}}function Y(){S.call(this);var d=this,b,a;this.getLevel=function(){return b};this.setLevel=function(l){b=l};this.getParentNode=function(){return a};this.setParentNode=function(l){a=l};this.toFolderLevelNode=function(l){d.setName(l.getName());d.setDisplayName(l.getDisplayName());d.setChildren(l.getChildren());d.setLevel(b)}}function Ma(){var d,
b=Ma.TYPE_TEXT,a=Q.get("noDataTips","\u6682\u65e0\u6570\u636e"),l;this.getJqUi=function(){if(!d)switch(d=$("<div>"),d.addClass("modeler-designer-no-data"),b){case Ma.TYPE_TEXT:e(a,"modeler-designer-no-data-only-text");break;case Ma.TYPE_NO_SOURCE:c("no_source","modeler-designer-no-data-icon");e(a,"modeler-designer-no-data-text");break;case Ma.TYPE_NO_SEARCH_RESULT:c("search-no-result","modeler-designer-node-selection-icon");e(a,"modeler-designer-node-selection-tip");break;case Ma.TYPE_NO_DATA_WITH_CLOUD:c("no_data_cloud",
"modeler-designer-no-data-cloud-icon");e(a,"modeler-designer-no-data-text");break;default:throw Error("The view type error, please set first.");}return d};this.setType=function(g){b=g};this.setText=function(g){a=g?g:"";l&&l.text(a)};var c=function(g,v){var u=$("<div>");u.addClass(v);y.background(u,g);u.appendTo(d)},e=function(g,v){l=$("<div>");l.addClass(v);l.text(g);l.appendTo(d)}}function oa(){var d=this,b,a=!1,l=!0,c=!0,e,g,v,u;this.setField=function(B){b=B};this.getField=function(){return b};
this.setDisplayName=function(B){b&&b.setAlias(B)};this.getDisplayName=function(){return b.getAlias()};this.getFieldType=function(){return b.getOutputDataType()};this.setSelected=function(B){a=B;e&&e.setChecked(B)};this.setShowRelationIcon=function(B){v=B};this.show=function(B){B?g&&g.show():g&&g.hide();c=B};this.isShow=function(){return c};this.getSelected=function(){return e?e.isChecked():a};this.setEnabled=function(B){l=B};this.getEnabled=function(){return l};this.getJqUi=function(){return g};this.setFunFieldCheckClick=
function(B){u=B};this.initJqUi=function(){g=$("<div>");e=new I;e.setUserObject(d);e.setChecked(a);e.setEnabled(d.getEnabled());e.addCheckedListener(function(B,F){F&&u&&u(B.isChecked(),d)});h(d,e);return g};var h=function(B,F){var J=$("<div>");J.addClass("modeler-desinger-select-field-lineitem");F=F.getJqUi();F.addClass("modeler-designer-field-item-checkbox");F.appendTo(J);F=$("<div>");F.addClass("modeler-designer-field-item-checkbox-text");F.text(B.getDisplayName());F.attr("title",B.getDisplayName());
B=B.getFieldType();var C=$("<div>");C.addClass("modeler-designer-field-item-icon");y.background(C,B);C.appendTo(J);F.appendTo(J);v&&(B=$("<div>"),B.addClass("modeler-designer-field-item-relation-icon"),y.background(B,"relation"),B.appendTo(J));J.appendTo(g)}}"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 A=com.kingdee.bos.qing.modeler.designer;A.AbstractDesigner=function(){var d=this,b,a,l=new pa,c=new za,e=new na,g,v,u,h,B=!0,F;this.setMessageResize=function(E){F=E};var J=new function(){this.getModelerModel=function(){return d.protectedGetModelerModel()};this.getIntegration=function(){return b};this.getMessageCurtain=function(){return g};this.getCommandManager=
function(){return e};this.getRemoteImpl=function(){return h}};this.protectedInit=function(){};this.protectedResize=function(){};this.protectedGetModelerModel=function(){throw Error("override me");};this.setJsonModel=function(E){throw Error("override me");};this.protectedUpdateModelerModel=function(E){throw Error("override me");};this.getJsonModel=function(){var E=J.getModelerModel(),M=new Ea;M.setModelerModel(E);return M.toJsonObject()};this.setJsonValidity=function(E,M){throw Error("override me");
};this.setUndoAbleJsonModel=function(E,M){var x=new Ea;x.fromJsonObject(E);E=x.getModelerModel();x=new K;x.setCaption(M);x.setValue(d.protectedGetModelerModel(),E,d.protectedUpdateModelerModel);e.perform(x)};this.setRemoteImpl=function(E){h=E};this.setEditable=function(E){B=E};this.isEditable=function(){return B};this.createJqUi=function(){a=$("<div onselectstart='return false'>");a.addClass("modeler-designer");g=new Ba;g.getJqUi().appendTo(a);p();a.append(l.getJqUi());a.append(c.getJqUi());d.protectedInit();
B&&(A.LockHelper.setGlobal(J),A.LockHelper.show(a));return a};this.resize=function(){f()};this.setIntegration=function(E){b=E};this.getIntegration=function(){return b};this.setLockInfo=function(E,M,x){A.LockHelper.setLockInfo(E,M,x)};this.setLockStateChangeListener=function(E){A.LockHelper.setLockStateChangeListener(E)};this.registerLockRequestSender=function(E){A.LockHelper.registerLockRequestSender(E)};this.insertToolbarBtn=function(E,M,x,U){return l.addButtonForHeadCustom(E,M,x,U)};this.insertMenuButton=
function(E,M,x,U){return l.addMenuButtonForHeadCustom(E,M,x,U)};this.appendToolbarBtn=function(E,M,x,U){return l.addButtonForTailCustom(E,M,x,U)};this.getMsgCurtain=function(){return g};this.clearDirty=function(){C(!1)};this.isDirty=function(){return v};this.setDirtyListener=function(E){u=E};var C=function(E){v=E;c&&c.showDirtyState(v);u&&u(v)},p=function(){t();var E=new Z;E.setCallbackImmediately(function(){t()});E.setDelay(100);E.setCallback(function(){f()});E.observe()},f=function(){A.LockHelper.setMaxWidth(a.width()-
l.getAllBtnWidth());d.protectedResize();F&&F()},t=function(){document.body.style.height=document.documentElement.clientHeight+"px"},q=function(){e.isCanUndo()&&e.undo();k.occur(k.BUTTON_TYPE,k.UNDO)},z=function(){e.isCanRedo()&&e.redo();k.occur(k.BUTTON_TYPE,k.REDO)},L=function(){var E=new qa;E.setGlobal(J);E.setRemoteImpl(h);E.showDialog()};this.protectedMethod={addToolbarButton:function(E,M,x,U){return l.addButton(E,M,x,U)},getGlobal:function(){return J},getMainUi:function(){return a},addUndoRedoBtn:function(E){var M=
l.addButton(q,"btn_undo",Q.get("undo","\u64a4\u6d88")),x=l.addButton(z,"btn_redo",Q.get("redo","\u53cd\u64a4\u6d88"));M.setEnabled(e.isCanUndo());x.setEnabled(e.isCanRedo());e.addPerformedListener(function(U,ua,Aa){M.setEnabled(e.isCanUndo());x.setEnabled(e.isCanRedo())});e.addPerformedListener(function(U,ua,Aa){C(!0);U&&(ua=ua?"":(Aa?Q.get("undo","\u64a4\u6d88"):Q.get("redo","\u53cd\u64a4\u6d88"))+" ",ua+=U.getCaption(),c.showShortPrompt(ua),E&&E(U))})},addMaterializedConfigBtn:function(){l.addButton(L,
"btn_materialized_config",Q.get("materializedConfig","\u7269\u5316\u5b58\u50a8\u8bbe\u7f6e"))}}};A.ModelInfoDialog=function(){n.call(this);var d=this.protectedMethod,b=this,a,l,c;(function(){d.setTitle(Q.get("modelProp","\u6a21\u578b\u5c5e\u6027"));b.setSize(400,300);d.setContentPaneCreator(function(){var e=$("<div>"),g=new ia;g.setRequired(!0);g.setText(Q.get("name","\u540d\u79f0"));g=g.getJqUi();a=new Ha;var v=a.getJqUi(),u=c.getIntegration();a.setText(u.getModelName());var h=new ia;h.setText(Q.get("desc",
"\u63cf\u8ff0"));h=h.getJqUi();l=new ba;var B=l.getJqUi();l.setText(u.getModelDesc());g.appendTo(e);v.appendTo(e);h.appendTo(e);B.appendTo(e);O.layoutCtrl(g,8,0,70,23);O.layoutCtrl(v,76,0,280,23);O.layoutCtrl(h,8,48,70,23);O.layoutCtrl(B,76,54,280,120);return e});d.setClosingChecker2(function(e){e=$.trim(a.getText());var g=$.trim(l.getText()),v=c.getIntegration(),u=v.getModelName(),h=v.getModelDesc();if(e==u&&g==h)return!0;var B;0==e.length?B=Q.get("nameIsEmptyPrompt","\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a\u3002"):
50<e.length&&(B=Q.get("nameTooLongPrompt","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"));500<g.length&&(B=Q.get("descTooLongPrompt","\u63cf\u8ff0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7500\u4e2a\u5b57\u7b26\u3002"));if(B)return d.getMessageCurtain().showPrompt(B),!1;B=new ra;B.setValue(v,e,v.getModelName(),g,v.getModelDesc());c.getCommandManager().perform(B);return!0});d.setClosingAction(function(e){})})();this.setGlobal=function(e){c=e}};A.NoNodePromptUi=function(){var d,
b,a,l,c;this.setNoNode=function(u){v()};this.setNoSource=function(u){a=u;v()};this.show=function(){d&&d.show()};this.hide=function(){d&&d.hide()};this.getJqUi=function(){d||(d=$("<div>"),d.css("background","#f7f7f7"),d.css("z-index",1E3),O.layoutCtrlWithLRTB(d,0,0,null,0,0,null),v());return d};var e=function(){if(!l){l=$("<div>");O.layoutCtrlMiddleAlign(l,180);O.layoutCtrlCenterAlign(l,260);l.appendTo(d);b=$("<div>");b.addClass("modeler-designer-no-node-prompt");O.layoutCtrl(b,10,0,260,20);b.appendTo(l);
b.text(Q.get("dragInNode","\u62d6\u5165\u8868\uff0c\u5f00\u59cb\u521b\u5efa\u6a21\u578b"));var u=$("<div>");O.layoutCtrl(u,0,40,253,140);y.background(u,"drag_node_prompt");u.appendTo(l)}return l},g=function(){c||(c=$("<div>"),O.layoutCtrlMiddleAlign(c,170),O.layoutCtrlCenterAlign(c,210),y.background(c,"no_node_and_source"),c.appendTo(d));return c},v=function(){a?(e().hide(),g().show()):(e().show(),g().hide())}};A.DragHandler=function(){var d=$(document.body),b,a,l,c,e,g,v,u,h,B,F;this.bindDragUi=
function(q,z){var L=!1,E=[-1,-1],M=null,x=function(){b=L=!1;M=null;E=[-1,-1]};q.on("mousedown",function(U){L=!0;b=!1;M=$(U.target);E=[U.screenX,U.screenY]});q.on("mouseup",function(U){x()});q.on("mouseleave",function(U){L&&x()});q.on("mousemove",function(U){var ua=!1;L&&(ua=5<Math.abs(U.screenX-E[0])||5<Math.abs(U.screenY-E[1]));ua&&(L=!1,(c=z(M))?(g=new ta,l=u(),e=c.getTableNode(),b=!0,d.on("mousemove",J),d.on("mouseup",C),d.on("mouseleave",f)):x())})};this.bindDropUi=function(q,z,L,E,M){u=z;h=L;
B=E;v=M};var J=function(q){if(b){if(!a){a=$("<div onselectstart='return false'>");a.addClass("modeler-dragdrop-mask");var z=O.getCurrentTargetPosition(q);z=O.upwardCoordinate(q.target,z,d[0]);a.data("target-origin-pos-left",z[0]);a.data("target-origin-pos-top",z[1]);a.appendTo(d)}if(z=h(q,l,e)){var L=z.getJqPhysicalUi();g.isPrepared()||g.prepare(z.getModeler(),L,v);F||(F=$("<div>"),O.layoutCtrlWithLRTB(F,0,0,null,0,0,null),F.css("z-index",999999));F.appendTo(L);p();q=[e.getX(),e.getY()];q=v.getScaledCoordinate(q);
q=O.upwardCoordinate(L[0],q,d[0]);z=v.getScaledSize(e.getWidth());L=v.getScaledSize(e.getHeight());O.layoutCtrl(a,q[0],q[1],z,L)}else console.log("moving"),a.text(""),z=O.getCurrentTargetPosition(q),z=O.upwardCoordinate(q.target,z,d[0]),O.layoutCtrl(a,z[0]-20,z[1]-15,40,30)}},C=function(q){h(q,l,e)?(p(),B(c,function(){a.remove();a=null}),t(!0)):t()},p=function(){var q=[e.getX(),e.getY(),e.getWidth(),e.getHeight()];g.anchor(q);e.setPosition(q[0],q[1])},f=function(){t()},t=function(q){b=!1;!q&&a&&a.animate({left:a.data("target-origin-pos-left"),
top:a.data("target-origin-pos-top"),width:4,height:3},function(){a.remove();a=null});d.off("mousemove",J);d.off("mouseup",C);d.off("mouseleave",f);F&&F.remove();g&&g.abort()}};A.NodeDragHelper=function(){var d,b,a,l,c,e,g,v,u=!1,h,B;this.setTarget=function(q){a=q};this.setScaleHelper=function(q){B=q};this.setModelerModel=function(q){h=q};this.setMovableArea=function(q){d=q};this.startDrag=function(q){console.log("start drag");v=new ta;v.prepare(h,d,B);b=[q.clientX,q.clientY];l=$("<div>");l.css("z-index",
999999);l.appendTo($(document.body));O.layoutCtrlWithLRTB(l,0,0,null,0,0,null);l.on("mousemove",F);l.on("mouseup",J);l.on("mouseleave",f)};this.setEndMoveCallback=function(q){e=q};var F=function(q){if(u)var z=!0;else z=Math.abs(q.clientY-b[1]),z=5<Math.abs(q.clientX-b[0])||5<z?u=!0:!1;if(z){if(!c){c=$("<div>");c.addClass("modeler-dragdrop-mask");c.appendTo(d);var L=a.getX(),E=a.getY(),M=a.getWidth();z=a.getHeight();g=[L,E];L=B.getScaledCoordinate(g);M=B.getScaledSize(M);z=B.getScaledSize(z);O.layoutCtrl(c,
L[0],L[1],M,z)}q=p(q);C(q);q=B.getScaledCoordinate(q);O.layoutCtrl(c,q[0],q[1],null,null)}},J=function(q){c&&(q=p(q),C(q),e&&e(q[0],q[1]));t()},C=function(q){if(c){var z=B.getRawSize(c.width()),L=B.getRawSize(c.height()),E=B.getRawCoordinate(q);z=[E[0],E[1],z,L];v.anchor(z);q[0]=z[0];q[1]=z[1]}},p=function(q){var z=q.clientX-b[0];q=q.clientY-b[1];var L=B.getScaledCoordinate(g);return[L[0]+z,L[1]+q]},f=function(q){t()},t=function(){console.log("destroy");l&&(l.off("mousemove",F),l.off("mouseup",J),
l.off("mouseleave",f),l.remove(),l=null);c&&(c&&c.remove(),c=null);v&&v.abort()}};A.PageDragHelper=function(){var d,b,a,l,c,e,g,v;this.startDrag=function(C,p){console.log("start drag page");c=p;b=[C.clientX,C.clientY];a=(C=c.position())?[C.left,C.top]:[0,0];e=$("<div>");e.css("z-index",999999);e.appendTo($(document.body));e.css("cursor","move");O.layoutCtrlWithLRTB(e,0,0,null,0,0,null);e.on("mousemove",u);e.on("mouseup",h);e.on("mouseleave",B)};this.setMovableArea=function(C){l=C};this.setGlobal=
function(C){g=C};this.setScaleHelper=function(C){v=C};var u=function(C){var p=C.clientX-b[0];C=C.clientY-b[1];if(d)var f=!0;else f=Math.abs(C),f=5<Math.abs(p)||5<f?d=!0:!1;f&&c.css({left:J(a[0]+p,!0)+"px",top:J(a[1]+C,!1)+"px"})},h=function(C){F()},B=function(C){F()},F=function(){console.log("destroy drag page");e.css("cursor","default");e&&e.remove();e=null},J=function(C,p){if(p){p=9999;var f=c.width();var t=l.width()}else p=9999,f=c.height(),t=l.height();p=v.getScaledSize(p);var q=f>p;p=0<C?q?0:
Math.min(C,p-f):q?Math.max(C,t-f):Math.max(C,t-p);p!=C&&g.getMessageCurtain().showPrompt(Q.get("svgMaxSize","\u5df2\u8fbe\u5230\u7ed8\u5236\u533a\u57df\u6700\u5927\u5c3a\u5bf8\u3002"));return p}};A.DragInsideCheckResult=function(d,b){this.getJqPhysicalUi=function(){return d};this.getModeler=function(){return b}};A.FieldSelectDialog=function(d,b,a,l,c){n.call(this);var e=this,g=this.protectedMethod,v,u,h=c,B,F;this.showSelectFieldDialog=function(f,t){e.setSize(f,t);e.setPosition(window.innerWidth-
f>>1,window.innerHeight-t>>1);g.setTitle(Q.get("selectField","\u9009\u62e9\u5b57\u6bb5"));g.setClosingAction(J);g.setClosingChecker(C);g.setContentPaneCreator(p);e.showDialog()};var J=function(f){if(f)if((f=u.getSelectedProperties())&&a.setSelectedFields(f),u.getIsEntityView()){var t=u.getSelectedEntityName();f=l.clone();var q=a.clone();if(t!=l.getTableName()){var z=h.getAllTable(),L=!1;f.setTableName(t);for(t=0;t<z.length;t++){var E=z[t];if(f.isSame(E)){L=!0;f.setUid(E.getUid());q.setTableUid(E.getUid());
break}}L||(z=A.UIDHelper.getUID(A.UIDHelper.NS_TABLE),f.setUid(z),q.setTableUid(z))}z=B;F(q,f);z&&z()}else f=B,F(a,l),f&&f();else B&&B()},C=function(){if(!u)return!1;if(u.getIsEntityView()){var f=u.getSelectedEntityName();if(!f)return g.getMessageCurtain().showPrompt(Q.get("needSelectedEntity","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b9e\u4f53\u6216\u8005\u5206\u5f55\u8868\u3002")),!1;u.setCurrentTableName(f)}return(f=u.getSelectedProperties())&&0==f.length?(g.getMessageCurtain().showPrompt(Q.get("noSelectedField",
"\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b57\u6bb5\u3002")),!1):!0},p=function(){v=$("<div>");var f=new r(d,function(t){var q=new m;q.fromJsonObject(t);u=A.SelectFieldFactory.createSelectFieldToDialog(q.getSourceType());u.setMeta(q);u.setCurrentTableName(l.getTableName());u.setWidth(850);u.getIsEntityView()&&g.setTitle(Q.get("selectEntityAndField","\u9009\u62e9\u6570\u636e\u8868\u53ca\u5b57\u6bb5"));u.getJqUi().appendTo(v)});f.setBlockingJqUi(v);f.setShowBlocking(!0);f.getMeta(b,l);return v};
this.setGlobal=function(f){};this.setModeler=function(f){h=f};this.setFunFinishCallback=function(f){B=f};this.setAddNodeCallback=function(f){F=f}};A.SelectFieldPanel=ca;A.SvgHelper=Da;A.ChooseFieldPanelHelper=function(){function d(){var v=[],u,h,B,F,J,C=!1,p=!0,f;this.setItemModel=function(t){v=t};this.setShowFieldNameEnable=function(t){p=t};this.setRawTypeSwitchListener=function(t){};this.setSearchListener=function(t){u=t};this.setListItemPainter=function(t){h=t};this.setShowFieldNameListener=function(t){B=
t};this.setSearchBoxPlaceholder=function(t){f=t};this.createJqPopup=function(t,q,z){F=$("<div>");F.appendTo(t);J=$("<div>");F.addClass("modeler-designer-field-popup");t=f?f:Q.get("search","\u641c\u7d22");var L=new P;L.setSearchListenerDelay(200);L.setPlaceholder(t);L.addSearchListener(function(){u(v,L.getText(),J,q,h,C)});t=L.getJqUi();t.addClass("modeler-designer-field-popup-search");t.appendTo(F);J.addClass("modeler-designer-field-popup-list-owner");J.on("click",function(x){var U=$(x.currentTarget);
x=$(x.target);if(x=O.upwardSearchHasClass(x,U,"modeler-designer-field-popup-list-item"))x.addClass("modeler-designer-list-item_selected_enabled"),U=x.data("model"),z(U)});J.appendTo(F);t=F.find(".sa-ctrl-textfield-input");t.css("top","0px");t.css("height","100%");if(0==v.length)a(J,Q.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5"));else for(t=0;t<v.length;t++)h(v[t],J,q);if(p){var E=Q.get("showFieldName","\u663e\u793a\u539f\u5b57\u6bb5\u540d\u79f0");t=new ia;t.setText(E);t=t.getJqUi();t.attr("title",
E);t.addClass("modeler-designer-field-popup-show-field-name-label");E=new D;E.addStateChangeListener(function(x,U,ua){(C=ua)?B&&B(J,!0):B&&B(J,!1)});E.setOn(!1);E=E.getJqUi();E.addClass("modeler-designer-field-popup-show-field-name-button");var M=$("<div>");M.addClass("modeler-designer-field-popup-show-field-name");E.appendTo(M);t.appendTo(M);M.appendTo(F)}else J.css("bottom","5px")}}var b;this.createChooseFieldPanel=function(v){b=v;v=new d;v.setListItemPainter(e);v.setSearchListener(l);v.setShowFieldNameListener(c);
return v};var a=function(v,u){var h=new ia;h.setText(u);h.setEnabled(!1);h.setAlign(ia.ALIGN_CENTER);u=h.getJqUi();u.addClass("modeler-designer-field-popup-no-data");u.appendTo(v)},l=function(v,u,h,B,F,J){u=u.toLowerCase();for(var C=[],p,f=0;f<v.length;f++)(p=v[f])&&(p=-1!=p.getAlias().toLowerCase().indexOf(u)?!0:J&&-1!=p.getName().toLowerCase().indexOf(u)?!0:!1)&&C.push(v[f]);h.children().remove();if(0<C.length){for(f=0;f<C.length;f++)F(C[f],h,B);C.length=0}else""==u?a(h,Q.get("noFieldToSelect",
"\u65e0\u53ef\u9009\u5b57\u6bb5")):a(h,Q.get("noSearchResult","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c"));c(h,J)},c=function(v,u){if(u)for(v=v.find(".modeler-designer-field-popup-list-item-text-name"),u=0;u<v.length;u++){var h=v.eq(u);h.css("display","inline-block");var B=h.prev().text()+h.text();h.prev().attr("title",null);h.parent().attr("title",B)}else for(v=v.find(".modeler-designer-field-popup-list-item-text-name"),u=0;u<v.length;u++)h=v.eq(u),h.css("display","none"),h.parent().attr("title",
null),h.prev().attr("title",h.prev().text())},e=function(v,u,h){var B=$("<div>");B.addClass("modeler-designer-field-popup-list-item");B.data("model",v);b(B,v);u.append(B);h&&v&&h.getFullName()==v.getFullName()&&g(u,B)},g=function(v,u){var h=null;0<v.height()?(clearTimeout(h),u.addClass("modeler-designer-list-item_selected_enabled"),v.prop("scrollTop",u.prop("offsetTop"))):h=setTimeout(function(){g(v,u)},0)}};A.CommonSvgIconHelper=function(){this.makeUrl=function(d){return"../qinganalysis/qingmodeler/designer/svgicon/"+
d+".svg"};this.getTableIconColor=function(d){var b="#ffa500";if(d)switch(d.getSourceType()){case T.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:case T.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:b="#A06AE2";break;case T.SOURCE_TYPE_MODEL_SET_SOURCE:b="#40A9FF";break;case T.SOURCE_TYPE_MODELSET_FILE_SOURCE:b="#F67682";break;case T.SOURCE_TYPE_OPEN_API_SOURCE:b="#73D13D"}return b}};A.AbstractDisplayNameHelper=function(){var d=this,b={};this.init=function(l){d.protectedInit(l);l=l.getAllNodes();b={};if(l)for(var c=0;c<
l.length;c++)d.getNodeDisplayName(l[c])};this.protectedInit=function(l){};this.protectedGetDefaultName=function(l){throw Error("override me");};this.getNodeDisplayName=function(l){if(!l)return"";var c=l.getAlias();if(c)return b[l.getId()]=c;c=l.getId();if(c=b[c])return c;var e=d.protectedGetDefaultName(l);c=l.getNameIndex();c=a(e,c);e=c[0];(c=c[1])&&l.setNameIndex(c);return b[l.getId()]=e};this.isDuplicate=function(l,c){for(var e=Object.keys(b),g=!1,v=0,u=e.length;v<u;v++)if(b[e[v]]==l&&(!c||c.getId()!=
e[v])){g=!0;break}return g};var a=function(l,c){var e=c?l+"_"+c:l;var g=[e,c];d.isDuplicate(e)&&(g=a(l,c?c+1:1));return g};this.protectedMethod={cacheDisplayName:function(l,c){b[l]=c}}};A.PageSizeHelper=function(){this.adaptSize=function(d){var b=d.getPage();var a=d.getAllNodes(),l=d.getPage();if(1>a.length)var c=[0,0,l.getWidth(),l.getHeight()];else{var e=a[0];l=e.getX();var g=e.getY();c=l+e.getWidth();e=g+e.getHeight();for(var v=1;v<a.length;v++){var u=a[v];l=Math.min(l,u.getX());g=Math.min(g,u.getY());
c=Math.max(c,u.getX()+u.getWidth());e=Math.max(e,u.getY()+u.getHeight())}c=[l-100,g-100,c+100,e+100]}g=b.getWidth();e=b.getHeight();a=-c[0];l=-c[1];g=c[2]-g;c=c[3]-e;if(0!=a||0!=g||0!=l||0!=c){if(0!=a||0!=l)for(d=d.getAllNodes(),e=0;e<d.length;e++)v=d[e],v.setPosition(v.getX()+a,v.getY()+l);b.setExtension(a,l,g,c);return!0}return!1}};A.SelectFieldView=Xa;A.AbstractLeftRightSelector=function(){var d=this,b,a,l,c,e,g,v;this.getJqUi=function(){b||(c=u(">",!0,!1),e=u(">>",!0,!0),g=u("<",!1,!1),v=u("<<",
!1,!0),a=h(d.protectedCreateLeftJqTitle(),d.protectedGetLeftCtrl()),l=h(d.protectedCreateRightJqTitle(),d.protectedGetRightCtrl()),b=$("<div>"),b.append(a),b.append(l),b.append(c.getJqUi()),b.append(g.getJqUi()),b.append(e.getJqUi()),b.append(v.getJqUi()));return b};this.relayout=function(){var B=b.prop("clientWidth"),F=b.prop("clientHeight");O.layoutCtrlWithLRTB(a,0,(B>>1)+36,null,0,0,null);O.layoutCtrlWithLRTB(l,(B>>1)+36,0,null,0,0,null);O.layoutCtrlWithLRTB(c.getJqUi(),null,null,null,null,(F>>
1)+8,28);O.layoutCtrlCenterAlign(c.getJqUi(),40);O.layoutCtrlWithLRTB(g.getJqUi(),null,null,null,(F>>1)+8,null,28);O.layoutCtrlCenterAlign(g.getJqUi(),40);O.layoutCtrlWithLRTB(e.getJqUi(),null,null,null,null,(F>>1)+56,28);O.layoutCtrlCenterAlign(e.getJqUi(),40);O.layoutCtrlWithLRTB(v.getJqUi(),null,null,null,(F>>1)+56,null,28);O.layoutCtrlCenterAlign(v.getJqUi(),40)};var u=function(B,F,J){B=new W(B);B.getJqUi().css({border:"1px solid #ddd","font-size":"18px"});B.addActionListener(function(C){d.protectedSelect(F,
J)});return B},h=function(B,F){var J=$("<div>");J.append(F.getJqUi());B?(J.append(B),O.layoutCtrlWithLRTB(B,0,0,null,0,null,20),O.layoutCtrlWithLRTB(F.getJqUi(),0,0,null,22,0,null)):O.layoutCtrlWithLRTB(F.getJqUi(),0,0,null,0,0,null);return J};this.protectedCreateLeftJqTitle=function(){return null};this.protectedCreateRightJqTitle=function(){return null};this.protectedGetLeftCtrl=function(){throw Error("Implement");};this.protectedGetRightCtrl=function(){throw Error("Implement");};this.protectedSelect=
function(B){throw Error("Implement");}};A.NoDataView=Ma;var Q,Z,O,ia,Ha,ba,n,Ba,I,P,D,W,la,Ea,ra,K,pa,za,na,y,S,T,m,r,qa,k;(function(){var d=com.kingdee.bos.qing.common;O=d.DomUtil;d=com.kingdee.bos.qing.framework.common;Q=d.MultilanguageManager.createPackageAccessor(A);Z=d.WindowResizeObserver;d=com.kingdee.bos.qing.ui.component;n=d.AbstractModalDialog;ia=d.Label;Ha=d.TextField;ba=d.TextArea;Ba=d.MessageCurtain;I=d.CheckBox;P=d.SearchBox;D=d.SwitchButton;W=d.WorkButton;la=d.SplitPane;ra=A.ActionChangeModelInfo;
K=A.ActionSetModel;pa=A.Toolbar;za=A.StatusBar;na=A.CommandManager;y=A.Icons;S=A.FolderNode;T=A.AbstractModelerSource;m=A.Meta;r=A.DesignerFacade;Ea=A.QingModeler;qa=A.MaterializedConfigDialog;k=A.UserOperationReporter})();A.SvgTextTrimer=new function(){var d,b,a;this.init=function(){a=$("<div>");O.layoutCtrl(a,-10,-10,10,10);d=new Da;var c=d.createNode("svg");d.setAttributes(c,{width:10,height:10});b=d.createNode("text");c.appendChild(b);a.append($(c));$(document.body).append(a);a.hide()};this.trim=
function(c,e,g){a.show();d.setAttributes(b,{"font-size":e+"px"});e=l(c);for(var v=c,u=1;e>g&&u<c.length;)v=c.slice(0,c.length-u)+"...",e=l(v),u++;a.hide();return v};this.measureText=function(c){a.show();c=l(c);a.hide();return c};var l=function(c){d.setText(b,c);return b.getComputedTextLength()}};A.DisplayNameHelper=new function(){var d;this.registerImpl=function(b){d=b};this.isDuplicate=function(b,a){if(!d)throw Error("need register first");return d.isDuplicate(b,a)};this.getNodeDisplayName=function(b){if(!d)throw Error("need register first");
return d.getNodeDisplayName(b)}};Ma.TYPE_TEXT="text";Ma.TYPE_NO_SOURCE="noSource";Ma.TYPE_NO_SEARCH_RESULT="noSearchResult";Ma.TYPE_NO_DATA_WITH_CLOUD="noDataWithCloud";A.SelectFieldFactory=new function(){var d={};this.addSelectFieldToPanel=function(b,a){d[b]=a};this.createSelectFieldToDialog=function(b,a){var l=d[b];b=l?new l(b,a):new Xa;return b}};A.SelectFieldFactory.addSelectFieldToPanel(T.SOURCE_TYPE_CURRENT_ENTITY_SOURCE,function(){mb.call(this);var d=this,b,a,l;this.getJqUi=function(){if(!b){b=
$("<div>");l=new Xa;l.setMeta(d.getMeta());l.setCurrentTableName(d.getCurrentTableName());l.setSelectedPropertyName(d.getSelectedPropertyName());var e=l.getJqUi(),g=new la;g.setHorizontalSplit(!0);g.setSplitLineWide(8);g.setResizeMode(la.RESIZE_MODE_FIRST_FIXED);g.setFirstSize(200,185,300);g.setSecondSize(d.getWidth()-250,350,-1);a=new Va;a.setFunUpdateProperties(c);a.setMeta(d.getMeta());g.setFirstChild(la.createChildWrapper(a.getJqUi()));g.setSecondChild(la.createChildWrapper(e));g.getJqUi().appendTo(b);
a.setSelectedTableNames(d.getCurrentTableName().split(A.ENTITY_SEPARATOR))}return b};this.getIsEntityView=function(){return!0};this.getSelectedProperties=function(){for(var e=[],g={},v=!0,u=d.getCurrentTableName().split(A.ENTITY_SEPARATOR),h=0;h<u.length;h++){var B=u[h];B=l.getTableFieldMap()[B];for(var F=0;F<B.length;F++){var J=B[F],C=J.getField();g[C.getFullName()]||(J.getSelected()?(e.push(C),g[C.getFullName()]=!0):v=!1)}}return v?null:e};this.getSelectedEntityName=function(){return a.getSelectedEntityName()};
var c=function(e,g){l.setArrProperties(e,g)}})})();(function(){function ta(){var la=this,Ea,ra,K,pa,za,na,y,S;this.setCurrentNode=function(qa){Ea=qa};this.getCurrentNode=function(){return Ea};this.setModelerModel=function(qa){ra=qa};this.setNodeStatusMonitor=function(qa){K=qa};this.setDirty=function(qa){pa=qa};this.isDirty=function(){return pa};this.setMask=function(qa){za=qa};this.getMask=function(){return za};this.setInValidBackgroundPanel=function(qa){na=qa};this.getInValidBackgroundPanel=function(){return na};this.setModelerChecker=function(qa){y=
qa};this.protectedGetModelerChecker=function(){return y};this.clear=function(){Ea=null;la.protectedClear()};this.protectedClear=function(){throw Error("Implement me.");};this.showPreviewContent=function(){Ea?la instanceof Da?y.focusNodeValidity(Ea,T):y.focusNodeValidity(Ea,m):(za.hide(),na.setText(O.get("dataLoading","\u6570\u636e\u52a0\u8f7d\u4e2d")),na.show())};this.protectedGetModeler=function(){return ra};var T=function(){la.isCurrentNodeValid()?(na.hide(),la.protectedShowPreviewContent()):(na.setText(r()),
na.show())},m=function(){la.isCurrentNodeValid()?(na.hide(),za.setClickCallback(la.protectedShowPreviewContent),za.show()):(za.hide(),na.setText(r()),na.show())};this.protectedShowPreviewContent=function(){throw Error("Implement me.");};this.afterResize=function(){console.log("preview area resize.....");K&&K.getSelected()&&la.protectedAfterResize()};this.protectedAfterResize=function(){throw Error("Implement me.");};this.setRuntimeModelGetter=function(qa){S=qa};this.getRuntimeModel=function(){if(Ea&&
ra)return S(ra,Ea)};this.isCurrentNodeValid=function(){return Ea?!K.isInvalidNode(Ea.getId()):!0};var r=function(){var qa=K.getInvalidPrompt(Ea);return qa?qa:O.get("invalidNodeConfig","\u8282\u70b9#1\u8bbe\u7f6e\u4e0d\u5b8c\u6574").replace("#1",Ea.getAlias())}}function Da(){function la(y){KTDefaultCellRender.call(this,y);var S=this,T=this.paintCellUI;this.paintCellUI=function(m,r){var qa=S.getCurrentRowIdx(),k=S.getCurrentRow(),d=S.getCurrentColIdx();k=k.getUserObject();if(qa<ia.getHeadRowCount())T(m,
r);else if(0==d)r=$("<div>"),k=k.getName(),r.text(k),r.attr("title",k),r.css("line-height","28px"),r.css("padding-left","2px"),r.css("padding-right","2px"),r.appendTo(m);else if(1==d)r=$("<div>"),k=k.getAlias(),r.text(k),r.attr("title",k),r.css("line-height","28px"),r.css("padding-left","2px"),r.css("padding-right","2px"),r.appendTo(m);else if(2==d){if(k=k.getSourceNodeId(),r=Ea.protectedGetModeler().getNode(k))k=$("<div>"),r=ca.DisplayNameHelper.getNodeDisplayName(r),k.text(r),k.attr("title",r),
k.css("line-height","28px"),k.css("padding-left","2px"),k.css("padding-right","2px"),k.appendTo(m)}else 3==d&&(r=$("<div>"),k=I.getDataTypeDesc(k.getAppointedDataType()),r.text(k),r.attr("title",k),r.css("line-height","28px"),r.css("padding-left","2px"),r.css("padding-right","2px"),r.appendTo(m))}}Y.AbstractTabPane.call(this);ta.call(this);var Ea=this,ra,K,pa,za;this.getTitle=function(){return O.get("field","\u5b57\u6bb5")};this.getJqUi=function(){if(!ra){ra=$("<div>");K&&na();var y=new Xa,S=y.getJqUi();
Ea.setMask(y);y.hide();ba.layoutCtrlWithLRTB(S,0,0,null,0,0,null);ra.append(S);y=new mb;S=y.getJqUi();y.hide();Ea.setInValidBackgroundPanel(y);ba.layoutCtrlWithLRTB(S,0,0,null,0,0,null);ra.append(S)}return ra};this.into=function(){!K||Ea.isDirty()?(Ea.showPreviewContent(),Ea.setDirty(!1)):Ea.afterResize()};this.protectedAfterResize=function(){pa&&K&&0!=K.length&&pa.relayoutViews()};this.setRemoteImpl=function(y){};this.protectedClear=function(){K=null};this.reload=function(){Ea.showPreviewContent()};
this.protectedShowPreviewContent=function(){ca.NodeFieldHelper.asynGetFields(Ea.getGlobal().getModelerModel(),Ea.getCurrentNode(),function(y){K=y;pa||na();ia.clear(pa);pa.addColumns(4);pa.getColumn(0).setWidth(200);pa.getColumn(1).setWidth(200);pa.getColumn(2).setWidth(140);pa.getColumn(3).setWidth(140);y=ia.createHeadRow(pa);y.getCell(0).setValue(O.get("fieldName","\u5b57\u6bb5\u540d\u79f0"));y.getCell(1).setValue(O.get("fieldAlias","\u663e\u793a\u540d\u79f0"));y.getCell(2).setValue(O.get("tableSource",
"\u6765\u6e90\u8868"));y.getCell(3).setValue(O.get("dataType","\u6570\u636e\u7c7b\u578b"));if(K){y=0;for(var S=K.length;y<S;y++)ia.createRow(pa).setUserObject(K[y])}ia.refresh(pa)},function(){},ra)};var na=function(){pa=ia.createTable();pa.setColumnFitVisibleWidth(!0);var y=new la(pa);y.setOutsideVisible(!1);pa.setCellRender(y);pa.setSyncUIWhenModelChanged(!0);za=$(pa.getUI());ba.layoutCtrlWithLRTB(za,10,10,null,10,10,null);za.appendTo(ra)}}function Va(){function la(b){KTDefaultCellRender.call(this,
b);var a=this,l=this.paintCellUI;this.paintCellUI=function(c,e){var g=a.getCurrentRowIdx(),v=a.getCurrentRow(),u=a.getCurrentColIdx();v=v.getUserObject();if(g<ia.getHeadRowCount())l(c,e);else{e=y.getField(u);g=e.getOutputDataType();u=v[u];if(null==u||void 0==u)u="";else if(g==P.DT_DATE)v=new n,v.setFormatString("yyyy-MM-dd"),u=v.format(u);else if(g==P.DT_DATETIME)v=new n,v.setFormatString("yyyy-MM-dd HH:mm:ss"),u=v.format(u);else if(g==P.DT_BOOLEAN)u=void 0===u?"":u?"true":"false";else if(g==P.DT_NUMBER&&
(v=e.getScale()))for(u+="",e=u.split("."),2>e.length?(u+=".",e=""):e=e[1],v-=e.length,e=0;e<v;e++)u+="0";v=$("<div>");v.text(u);v.attr("title",u);v.css("line-height","28px");v.css("padding-left","2px");v.css("padding-right","2px");v.appendTo(c)}}}function Ea(){Q.call(this);var b=this.protectedMethod,a=this,l,c,e,g,v=!1,u;(function(){b.setTitle(O.get("previewSet","\u9884\u89c8\u8bbe\u7f6e"));b.setSelectable(!0);b.setContentPaneCreator(function(){a.setSize(440,330);return h()});b.setFooterPaneCreator(function(J){var C=
new Z(O.get("confirm","\u786e\u5b9a"));C.setHighlight(!0);var p=C.getJqUi();p.addClass("sa-ctrl-dialog-footer-ok");p.appendTo(J);C.addActionListener(function(f){f=l.getValue();var t=c.getValue();u&&u(v,f,t);b.destroy();return!0});C=new Z(O.get("cancel","\u53d6\u6d88"));C.setHighlight(!1);p=C.getJqUi();p.addClass("sa-ctrl-dialog-footer-cancel");p.appendTo(J);C.addActionListener(function(f){b.destroy();return!0})});b.setClosingAction(function(J){})})();this.setOriginExtractCount=function(J){e=J};this.setOriginPreviewCount=
function(J){g=J};this.setAllData=function(J){v=J};this.setConfirmCallback=function(J){u=J};var h=function(){var J=$("<div>"),C=$("<div>");C.text(O.get("extractSet","\u62bd\u53d6\u8bbe\u7f6e"));ba.layoutCtrl(C,30,20,100,24);C.appendTo(J);C.css({color:"#333333","line-height":"24px","font-size":"14px"});C=B("extract",O.get("extract","\u62bd\u53d6\u524d"),J);var p=C.getJqUi();ba.layoutCtrlWithLRTB(p,60,null,300,60,null,null);l=new Ma;var f=l.getJqUi();l.setConstraint(1,1E4,1);l.setValue(e);ba.layoutCtrlWithLRTB(f,
120,null,100,49,null,null);f.appendTo(J);f=$("<div>");f.text(O.get("rowDataCalculate","\u884c\u6570\u636e\u8ba1\u7b97"));f.css("color","#666");ba.layoutCtrlWithLRTB(f,170,0);ba.layoutCtrlMiddleAlign(f,22);f.appendTo(p);p=B("extractAll",O.get("all","\u5168\u91cf"),J);f=p.getJqUi();ba.layoutCtrlWithLRTB(f,60,null,300,90,null,null);var t=$("<div>");Ha.background(t,"warning");t.attr("title",O.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"));
ba.layoutCtrlWithLRTB(t,110,null,20,79,null,20);t.appendTo(J);f=new oa;f.addElement(C);f.addElement(p);f.addChangedListener(function(z,L){L&&("extract"==z.getUserObject()?(v=!1,l.setEnabled(!0),t.hide()):(v=!0,l.setEnabled(!1),t.show()))});v?(F(f,"extractAll"),l.setEnabled(!1),t.show()):(F(f,"extract"),l.setEnabled(!0),t.hide());C=$("<div>");C.text(O.get("dataPreview","\u6570\u636e\u9884\u89c8"));ba.layoutCtrl(C,30,115,100,24);C.appendTo(J);C.css({color:"#333333","line-height":"24px","font-size":"14px"});
var q=B("dataPreview",O.get("previewResult","\u9884\u89c8\u8ba1\u7b97\u7ed3\u679c\u7684\u524d"),J);q.setChecked(!0);q.addCheckedListener(function(){q.setChecked(!0)});C=q.getJqUi();ba.layoutCtrlWithLRTB(C,60,null,300,155,null,null);c=new Ma;p=c.getJqUi();c.setConstraint(1,1E3,1);c.setValue(g);ba.layoutCtrlWithLRTB(p,180,null,100,144,null,null);p.appendTo(J);p=$("<div>");p.text(O.get("rowData","\u884c\u6570\u636e"));p.css("color","#666");ba.layoutCtrlWithLRTB(p,230,0);ba.layoutCtrlMiddleAlign(p,22);
p.appendTo(C);return J},B=function(J,C,p){var f=new A;f.setUserObject(J);f.setText(C);J=f.getJqUi();p.append(J);return f},F=function(J,C){J.toCheckTheElement(function(p){return p.getUserObject()===C})}}Y.AbstractTabPane.call(this);ta.call(this);var ra=this,K,pa,za,na,y,S=1E3,T=100,m=!1,r;this.getTitle=function(){return O.get("preview","\u9884\u89c8")};this.getJqUi=function(){if(!K){K=$("<div>");var b=$("<div>");b.css("cursor","pointer");b.attr("title",O.get("previewSet","\u9884\u89c8\u8bbe\u7f6e"));
b.on("click",d);Ha.backgroundWithHover(b,"setting");ba.layoutCtrl(b,10,3,20,20);b.appendTo(K);r=$("<div>");ba.layoutCtrlWithLRTB(r,40,10,null,5,null,20);r.css({"font-size":"14px",color:"#666",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"});r.appendTo(K);k();b=new Xa;var a=b.getJqUi();ra.setMask(b);b.hide();ba.layoutCtrlWithLRTB(a,5,5,null,28,5,null);K.append(a);b=new mb;a=b.getJqUi();ra.setInValidBackgroundPanel(b);b.hide();ba.layoutCtrlWithLRTB(a,5,5,null,28,5,null);K.append(a);
qa()}return K};this.setRemoteImpl=function(b){pa=b};this.into=function(){!y||ra.isDirty()?(ra.showPreviewContent(),ra.setDirty(!1)):ra.afterResize()};this.protectedAfterResize=function(){za&&y&&0!=y.getRowCount()&&za.relayoutViews()};this.protectedClear=function(){y=null};this.reload=function(){ra.showPreviewContent()};this.protectedShowPreviewContent=function(){var b=ra.getRuntimeModel();if(b){var a=(new Date).getTime(),l=new Ba(pa,function(e){var g=ra.getCurrentNode(),v=new W;v.fromJsonObject(e);
if(e=v.getValidity())ra.protectedGetModelerChecker().updateNodeValidity(e,a);else if(e=v.getPreviewData(),g&&v.getNodeId()==g.getId()&&(y=e,y&&0!=y.getRowCount()||(ra.getMask().hide(),ra.getInValidBackgroundPanel().setText(O.get("noData","\u5f53\u524d\u9884\u89c8\u89c4\u5219\u4e0b,\u6ca1\u6709\u7b26\u5408\u6761\u4ef6\u7684\u6570\u636e")),ra.getInValidBackgroundPanel().show()),za||k(),y)){na||(na=$(za.getUI()),ba.layoutCtrlWithLRTB(na,10,10,null,30,10,null),na.appendTo(K));e=y.getColumnCount();g=y.getRowCount();
ia.clear(za);if(0!=e&&0!=g){za.addColumns(e);var u=ia.createHeadRow(za);for(v=0;v<e;v++)za.getColumn(v).setWidth(150),u.getCell(v).setValue(y.getField(v).getAlias());for(v=0;v<g;v++)e=y.getOneRow(v),ia.createRow(za).setUserObject(e)}ia.refresh(za)}},function(e,g){return ca.DppVersionExceptionHandler.handle(e)}),c=new D;m?c.setExtractAllData(T):c.setExtractPartlyData(S,T);b.setPreviewConfig(c);l.setBlockingJqUi(K);l.getPreviewData(b)}};var qa=function(){var b=m?O.get("extractAllData","\u62bd\u53d6\u5168\u91cf\u6570\u636e\u8fdb\u884c\u8ba1\u7b97, "):
O.get("onlyExtractSomeRows","\u4ec5\u62bd\u53d6\u524d#1\u884c\u8fdb\u884c\u8ba1\u7b97, ").replace("#1",S);b+=O.get("previewRows","\u663e\u793a\u8ba1\u7b97\u7ed3\u679c\u7684\u524d#1\u884c\u6570\u636e").replace("#1",T);r.text(b)},k=function(){za=ia.createTable();za.setColumnFitVisibleWidth(!1);var b=new la(za);b.setOutsideVisible(!1);za.setCellRender(b);za.setSyncUIWhenModelChanged(!0)},d=function(){var b=new Ea;b.setOriginExtractCount(S);b.setOriginPreviewCount(T);b.setAllData(m);b.setConfirmCallback(function(a,
l,c){m=a;S=l;T=c;ra.showPreviewContent();qa()});b.showDialog()}}function mb(){var la,Ea;this.getJqUi=function(){la||(la=$("<div>"),la.addClass("modeler-designer-preview-no-data-background"),Ea=$("<div>"),Ea.addClass("modeler-designer-preview-no-data-text"),Ea.appendTo(la));return la};this.setText=function(ra){Ea.text(ra)};this.hide=function(){la.hide()};this.show=function(){la.show()}}function Xa(){var la=this,Ea,ra;this.setClickCallback=function(pa){ra=pa};this.getJqUi=function(){Ea||K();return Ea};
var K=function(){Ea=$("<div>");Ea.addClass("modeler-designer-preview-mask");var pa=$("<div>");pa.text(O.get("refreshPreviewData","\u7f16\u8f91\u5b8c\u6210\u540e\uff0c\u70b9\u51fb\u6b64\u5904\u5237\u65b0\u9884\u89c8\u6570\u636e\u3002"));pa.on("click",function(za){la.hide();ra&&ra()});pa.addClass("modeler-designer-preview-mask-button");pa.appendTo(Ea)};this.show=function(){Ea.show()};this.hide=function(){Ea.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 ca=com.kingdee.bos.qing.modeler.designer;ca.AbstractPreviewArea=function(){var la=this,Ea,ra,K,pa,za,na,y,S,T,m,r=!1,qa;this.protectedModelerPropChangeListener=function(l,c){};this.protectedGetRuntimeModel=
function(l,c){throw Error("override me");};this.getJqUi=function(){za||k();return za};this.setModelerModel=function(l){Ea&&Ea.removePropertyChangeCallback(a);Ea=l;Ea.addPropertyChangeCallback(a)};this.setModelerChecker=function(l){T=l};this.setNodeStatusMonitor=function(l){ra&&ra.removeSelectNodeListener(d);ra&&ra.removeInvalidNodeChangeListener(b);ra=l;ra.addSelectNodeListener(d);ra.addInvalidNodeChangeListener(b)};this.setGlobal=function(l){K=l};this.setRemoteImpl=function(l){pa=l};this.setHideListener=
function(l){m=l};this.show=function(l){r!=!l&&((r=!l)||na.getCurrentTabPane().into())};var k=function(){za=$("<div>");y=new Da;S=new Va;y.setRemoteImpl(pa);S.setRemoteImpl(pa);S.setNodeStatusMonitor(ra);y.setNodeStatusMonitor(ra);S.setModelerChecker(T);y.setModelerChecker(T);S.setRuntimeModelGetter(la.protectedGetRuntimeModel);y.setRuntimeModelGetter(la.protectedGetRuntimeModel);na=new Y;na.setTabLevel(Y.SECOND_LEVEL);na.addTab(y,!0);na.addTab(S);var l=$("<div>");Ha.background(l,"downArrow");ba.layoutCtrlWithLRTB(l,
null,5,16,8,null,16);l.css("cursor","pointer");l.on("click",function(){r=!0;m&&m()});l.appendTo(za);za.append(na.getJqUi())},d=function(l,c){S.clear();y.clear();c&&(qa=ra.getInvalidState(c),l=K.getModelerModel(),y.setCurrentNode(c),y.setModelerModel(l),S.setCurrentNode(c),S.setModelerModel(l));r||(c=na.getCurrentTabPane(),(l=c.getJqUi().find(".sa-common-loading-modallayer"))&&l.remove(),c.showPreviewContent())},b=function(l){if(l=na.getCurrentTabPane())if(l=l.getCurrentNode()){l=ra.getInvalidState(l);
if(qa!=l&&!r){var c=na.getCurrentTabPane();c.reload();c==S?y.setDirty(!0):S.setDirty(!0)}qa=l}},a=function(l,c){la.protectedModelerPropChangeListener(l,c)};this.afterResize=function(){na.getCurrentTabPane().afterResize()}};var Y,Ma,oa,A,Q,Z,O,ia,Ha,ba,n,Ba,I,P,D,W;(function(){var la=com.kingdee.bos.qing.ui.component;Y=la.TabContainer;Ma=la.Spinner;oa=la.RadioButtonGroup;A=la.RadioButton;Q=la.AbstractModalDialog;Z=la.Button;la=com.kingdee.bos.qing.common.ui;ia=la.TableUtil;la=com.kingdee.bos.qing.common;
ba=la.DomUtil;n=la.DateFormater;la=com.kingdee.bos.qing.framework.common;O=la.MultilanguageManager.createPackageAccessor(ca);Ba=ca.DesignerFacade;P=ca.Field;I=ca.PropDataTypeUtil;D=ca.PreviewConfig;Ha=ca.Icons;W=ca.ExecuteResult})()})();(function(){function ta(){var C,p,f,t,q,z,L,E;this.setTableArea=function(aa){};this.setGlobal=function(aa){L=aa};this.getGlobal=function(){return L};this.setRemoteImpl=function(aa){};this.setModelerModel=function(aa){p&&p.removePropertyChangeCallback(U);p=aa;p.addPropertyChangeCallback(U);M()};this.getJqUi=function(){if(!C){C=$("<div>");C.addClass("modeler-designer-workarea");C.addClass("modeler-designer-common-border");var aa=$("<div>");aa.addClass("modeler-designer-workarea-title");var wa=$("<div>");
wa.addClass("modeler-designer-workarea-title-text");wa.text(na.get("source","\u6570\u636e\u6e90"));aa.append(wa);wa=$("<div>");wa.addClass("modeler-designer-workarea-title-btn");F.backgroundWithHover(wa,"add");wa.on("click",x);wa.attr("title",na.get("selectDataSource","\u9009\u62e9\u6570\u636e\u6e90"));wa.appendTo(C);f=$("<div>");f.addClass("modeler-designer-workarea-container");t=new qa;t.setBorderVisible(!1);t.setToggleSelectingEnabled(!1);t.setCustomItemPainter(Aa);t.setCustomSelectedsPainter(bb);
t.addSelectedChangedListener(fa);q=t.getJqUi();q.appendTo(f);za.layoutCtrlWithLRTB(q,0,0,null,0,0,null);C.append(aa);C.append(f);M()}return C};this.showDialogIfNoSource=function(){var aa=p.getAllSource();if(!aa||0==aa.length){var wa=x();aa=new y;aa.setCallbackImmediately(function(){wa.updateTable()});aa.observe()}};var M=function(){if(p){var aa=p.getAllSource();t.setItemModels(aa);if(aa&&0!=aa.length){z&&z.hide();var wa=!1,Pa=t.getSelecteds();if(Pa)for(var V=0;V<Pa.length;V++)for(var X=Pa[V],ha=0;ha<
aa.length;ha++){var Wa=aa[ha];if(Wa==X){wa=!0;1===aa.length&&(Pa.push(null),t.setSelecteds([Wa]));break}}wa||t.setSelecteds([aa[0]]);q.show()}else q.hide(),z||(z=$("<div>"),z.appendTo(C),z.addClass("modeler-designer-sourcearea-nosource"),aa=$("<div>"),aa.appendTo(z),F.background(aa,"no_data_cloud"),za.layoutCtrlCenterAlign(aa,138),za.layoutCtrl(aa,null,0,null,78),aa=$("<div>"),aa.text(na.get("selectDataSource","\u9009\u62e9\u6570\u636e\u6e90")),aa.attr("title",na.get("selectDataSource","\u9009\u62e9\u6570\u636e\u6e90")),
aa.on("click",x),aa.appendTo(z),aa.addClass("modeler-designer-sourcearea-text-add")),z.show()}},x=function(){var aa=new Da;aa.setGlobal(L);aa.setSelectedCallback(ua);aa.setModeler(p);aa.showDialog();return aa},U=function(aa){if(aa==n.KEY_ADD_PREPARED_SOURCE||aa==n.KEY_REMOVE_PREPARED_SOURCE||aa==n.KEY_SET_PREPARED_SOURCE)console.log("update source area ui"),M()},ua=function(aa,wa){if(aa&&0!=aa.length||wa&&0!=wa.length){var Pa=new la;Pa.setValue(aa,wa,p);L.getCommandManager().perform(Pa)}},Aa=function(aa,
wa){aa.css("height","30px");aa.css("cursor","pointer");var Pa=wa.getSourceType();if(Pa){var V=wa.getName();V||(V=J.createSourceNameByType(Pa),wa.setName(V));aa.attr("name",V);var X=0,ha=L.getIntegration().getMapSourcePermission();if(ha)for(var Wa=Object.keys(ha),G=0;G<Wa.length;G++)if(Wa[G]===wa.getSourceId()){Wa=ha[Wa[G]];if(!Wa)break;ha=Wa.errorCode;ha!=ta.CURRENT_USER_NOPERMISSION_PUBLIC_SOURCE_ERRORCODE&&ha!=ta.CURRENT_USER_NOPERMISSION_DATACENTER_ERRORCODE&&(X=J.createExceptionIcon(Wa.errorMessage),
X.addClass("modeler-designer-sourcearea-exception-icon"),X.appendTo(aa),X=22);aa.data("errorCode",ha);break}ha=$("<div>");ha.addClass("modeler-designer-sourcearea-icon");ha.css("top","9px");F.background(ha,J.getSourceIconName(Pa));ha.css("left",12+X+"px");ha.appendTo(aa);ha=$("<div>");ha.text(V);ha.addClass("modeler-designer-sourcearea-name");ha.css("left",34+X+"px");ha.attr("title",na.get("name","\u540d\u79f0")+"\uff1a"+V+"\n"+na.get("type","\u7c7b\u578b")+"\uff1a"+J.translateSourceType(Pa));ha.appendTo(aa)}else J.updateDeletedSourceStatus(aa);
var Ka=$("<div>");Ka.addClass("modeler-designer-sourcearea-delete-btn");Ka.on("mousedown",function(R){R.stopPropagation();p.isSourceUsed(wa)?L.getMessageCurtain().showPrompt(na.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")):Oa().setClosingChecker(function(va){va==e.RETURN_OK&&(va=new W,va.setValue(wa,
p),L.getCommandManager().perform(va),aa.is(E)&&Q.SourceConnectStep.removeTableTree(),aa.remove());return!0})});F.backgroundWithHover(Ka,"delete");Ka.appendTo(aa);Ka.hide();aa.mouseenter(function(){Ka.show()}).mouseleave(function(){Ka.hide()})},bb=function(aa,wa){wa&&0<wa.length&&(aa&&0<aa.length&&(aa=aa[0],aa.css("background-color",""),aa.css("color","")),wa=wa[0],wa.css("background-color","#eff3fd"),wa.css("color","rgb(130, 130, 130)"))},fa=function(aa,wa,Pa){aa=Pa[0];E=wa=t.getItemUiByModel(aa);
Q.ConnectSourceCreator.getSourceConnector(aa,wa).getFunConnectSource()()},Oa=function(){var aa=e.createFeedbackDialog();aa.setMsgImageType(e.MSG_DELETE);aa.setOptionType(e.OPTION_OK_CANCEL);aa.setMessage(na.get("confirmDeleteSource","\u786e\u5b9a\u5220\u9664\u8be5\u6570\u636e\u6e90\u5417\uff1f"));aa.showDialog();return aa}}function Da(){T.call(this);var C=this,p=this.protectedMethod,f,t,q,z;(function(){p.setTitle(na.get("selectDataSource","\u9009\u62e9\u6570\u636e\u6e90"));C.setSize(791,600);p.setSelectable(!0);
p.setContentPaneCreator(function(){f=new mb;f.setRemoteImpl(Q.ModelSetSourceIntegration.getRemoteImpl());var E=$("<div>");f.setArrExistsSource(q.getAllSource());f.setContainer(E);f.setMultiSelect(!0);f.loadDataSource();return E});p.setFooterPaneCreator(function(E){var M=new S(na.get("confirm","\u786e\u5b9a"));M.setHighlight(!0);var x=M.getJqUi();x.addClass("sa-ctrl-dialog-footer-ok");x.appendTo(E);M.addActionListener(function(U){U=f.getSelected();f.getTable()?L(U):p.destroy()});M=new S(na.get("cancel",
"\u53d6\u6d88"));M.setHighlight(!1);x=M.getJqUi();x.addClass("sa-ctrl-dialog-footer-cancel");x.appendTo(E);M.addActionListener(function(U){p.destroy();return!0})});p.setClosingAction(function(E){})})();this.setGlobal=function(E){z=E};this.updateTable=function(){var E=$(document.body),M=E.prop("clientWidth");E=E.prop("clientHeight");M=Math.max(0,M-791>>1);E=Math.max(0,E-600>>1);p.getDialogCtrl().setBounds(M,E,791,600);f.updateUiByObserver()};this.setSelectedCallback=function(E){t=E};this.setModeler=
function(E){q=E};var L=function(E){(new (Q.ModelSetSourceIntegration.getModelSetSourceFacade())(Q.ModelSetSourceIntegration.getRemoteImpl(),function(M){for(var x,U=0,ua=0;ua<E.length;ua++){for(var Aa=!1,bb=0;bb<M.length;bb++)if(E[ua].getId()==M[bb].id){Aa=!0;break}Aa||(U++,1==U&&(x=E[ua].getSourceName()))}if(0<U){f.rePaintSource(M);if(1<U){var fa=na.get("moreSourceDeleted","\u201c#1\u201d\u7b49#N\u4e2a\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");fa=fa.replace("#N",
""+U)}else fa=na.get("sourceDeleted","\u201c#1\u201d\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002");fa=fa.replace("#1",x);p.getMessageCurtain().showPrompt(fa)}else{U=0;x=[];M=q.getAllSource();for(ua=0;ua<M.length;ua++){Aa=M[ua];bb=!1;for(var Oa=E.length-1;0<=Oa;Oa--)Aa.getSourceId()===E[Oa].getId()&&(bb=!0,E.splice(Oa,1));bb||(q.isSourceUsed(Aa)?(U++,1===U&&(fa=Aa.getName())):x.push(Aa))}if(0<U)1<U?(x=na.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"),
x=x.replace("#N",""+U)):x=na.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"),x=x.replace("#1",fa),p.getMessageCurtain().showPrompt(x),f.rePaintSource();else{if(z.getIntegration()&&(fa=z.getIntegration().getMapSourcePermission()))for(U=Object.keys(fa),M=0;M<E.length;M++)for(ua=0;ua<U.length;ua++)if(U[ua]==
E[M].getId()){fa[U[ua]]=null;break}fa=[];for(U=0;U<E.length;U++)M=new ia,M.setName(E[U].getSourceName()),M.setSourceType(E[U].getSourceType()),M.setId(Q.UIDHelper.getUID(Q.UIDHelper.NS_SOURCE)),M.setSourceId(E[U].getId()),M.setModelId(Q.ModelSetSourceIntegration.getModelId()),fa.push(M);t&&t(fa,x);p.destroy()}}})).designerLoadSources()}}function Va(C,p,f){T.call(this);var t=this,q=this.protectedMethod,z,L,E,M,x,U=[],ua,Aa,bb,fa;(function(){p?q.setTitle(na.get("EditSQL","\u7f16\u8f91SQL/KSQL")):q.setTitle(na.get("customSQL",
"\u81ea\u5b9a\u4e49SQL/KSQL"));t.setSize(590,450);q.setSelectable(!0);var Oa=function(){q.destroy()},aa=function(){E.setTableName(z.getText().trim());E.setDisplayName(z.getText());var wa=new P,Pa=ua.isChecked()?"SQL":"KSQL";wa.setSqlType(Pa);wa.setContent(L.getText());E.setUserSql(wa);(new Ha(C,function(V){for(V=0;V<U.length;V++)(0,U[V])(E,M);Oa()},function(V,X){q.getMessageCurtain().showError(X);return!0})).checkUserSqlExecutable(Pa,L.getText(),x.getSourceId(),E.getNamespace())};q.setContentPaneCreator(function(){var wa=
$("<div>"),Pa=new v;Pa.setText(na.get("name","\u540d\u79f0"));Pa=Pa.getJqUi();z=new u;E.getTableName()&&z.setText(E.getTableName());var V=z.getJqUi(),X=new m;ua=new r;ua.setText("SQL");ua.setChecked(!0);Aa=new r;Aa.setText("KSQL");X.addElement(ua);X.addElement(Aa);X=ua.getJqUi();var ha=Aa.getJqUi(),Wa=new v;Wa.setText(na.get("SQLContent","\u5185\u5bb9"));Wa=Wa.getJqUi();L=new h;if(E&&E.getUserSql()){var G=E.getUserSql();"KSQL"==G.getSqlType()&&Aa.setChecked(!0);L.setText(G.getContent())}G=L.getJqUi();
wa.append(Pa);wa.append(V);wa.append(X);f&&wa.append(ha);wa.append(Wa);wa.append(G);var Ka=12;za.layoutCtrl(Pa,10,Ka,80,23);za.layoutCtrl(V,90,Ka,420,23);za.layoutCtrl(Wa,10,Ka+=50,80,23);za.layoutCtrl(X,90,Ka,80,23);za.layoutCtrl(ha,170,Ka,80,23);za.layoutCtrl(G,90,Ka+50,420,200);return wa});q.setFooterPaneCreator(function(wa){var Pa=new S(na.get("confirm","\u786e\u5b9a"));Pa.setHighlight(!0);var V=Pa.getJqUi();V.addClass("sa-ctrl-dialog-footer-ok");V.appendTo(wa);Pa.addActionListener(function(X){X=
"";var ha=z.getText().trim(),Wa=L.getText().toLowerCase();0==ha.length?X=na.get("nameIsEmptyPrompt","\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a\u3002"):50<ha.length?X=na.get("nameTooLongPrompt","\u540d\u79f0\u4e0d\u53ef\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"):0<ha.indexOf(" ")?X=na.get("nameWithSpace","\u540d\u79f0\u4e0d\u80fd\u643a\u5e26\u7a7a\u683c\u3002"):/^[\u4E00-\u9FA5A-Za-z0-9_]+$/.test(ha)?Wa&&""!=$.trim(Wa)?0!=Wa.trim().toLowerCase().indexOf("select")?X=na.get("onlyAllowSelection","\u53ea\u5141\u8bb8\u67e5\u8be2\u64cd\u4f5c\u3002"):
-1==Wa.indexOf("from")&&-1==Wa.indexOf("FROM")&&(X=na.get("sqlError","sql\u6267\u884c\u51fa\u9519\uff0c\u8bf7\u68c0\u67e5sql\u8bed\u53e5\u3002")):X=na.get("noQuery","\u8bf7\u8f93\u5165\u67e5\u8be2\u8bed\u53e5\u3002"):X=na.get("invalidName","\u540d\u79f0\u53ea\u80fd\u4f7f\u7528\u4e2d\u6587\u3001\u6570\u5b57\u3001\u5b57\u6bcd\u6216\u4e0b\u5212\u7ebf\u3002");0<X.length?q.getMessageCurtain().showPrompt(X):(X=z.getText().trim(),p?(ha=M.getTableName(),X=bb(X,ha)):X=bb(X,void 0),X?q.getMessageCurtain().showPrompt(na.get("duplicateNameTips",
"\u540d\u79f0\u91cd\u590d\u3002")):fa&&fa(aa,Oa,p))});Pa=new S(na.get("cancel","\u53d6\u6d88"));Pa.setHighlight(!1);V=Pa.getJqUi();V.addClass("sa-ctrl-dialog-footer-cancel");V.appendTo(wa);Pa.addActionListener(function(X){q.destroy();return!0})});q.setClosingAction(function(wa){})})();this.setModel=function(Oa){E=Oa;p&&(M=Oa.clone())};this.getModel=function(){return E};this.setSource=function(Oa){x=Oa};this.addConfirmListener=function(Oa){U.push(Oa)};this.setTableNameChecker=function(Oa){bb=Oa};this.setPermAndConnChecker=
function(Oa){fa=Oa}}function mb(){function C(H){KTDefaultCellRender.call(this,H);var ea=this,Ja=this.paintCellUI;this.paintCellUI=function(N,xa){var Ya=ea.getCurrentRowIdx(),La=ea.getCurrentRow(),db=ea.getCurrentColIdx();La=La.getUserObject();var sa=new b;sa.setFormatString("yyyy-MM-dd HH:mm:ss");ea.setPaddingHV(8,1);if(Ya<d.getHeadRowCount()){if(Ja(N,xa),0===db&&1===Ya){if(!wa)return;La=Aa&&Aa.isChecked();Aa=new a;Aa.setChecked(La);Aa.addCheckedListener(function(ja,Ca){if(Ca){Ca=Object.keys(bb);
for(var Ta=0;Ta<Ca.length;Ta++)bb[Ca[Ta]].setChecked(ja.isChecked())}});La=Aa.getJqUi();za.layoutCtrl(La,12,0,14,18);La.appendTo(N)}}else if(0===db)La=wa?w(La):da(La),za.layoutCtrl(La,12,4,14,18),La.appendTo(N);else if(1===db){sa=$("<div class='modeler-designer-addsource-name-info'>");Ya=$("<span class='modeler-designer-addsource-cell-item-name'>");db=La.getSourceName();var Na=La.getErrorMessage(),Fa=Za(La);Na&&(Na=J.createExceptionIcon(Na),za.layoutCtrlWithLRTB(Na,5,null,16,8,null,16),Na.appendTo(sa),
Fa.css("margin-left","23px"));Fa.appendTo(sa);db||(db=La.getSourceType(),db=J.createSourceNameByType(db),La.setSourceName(db));aa&&""!=$.trim(ua.getText())?ya(Ya,db,$.trim(ua.getText())):Ya.text(db);Ya.attr("title",db);Ya.appendTo(sa);sa.appendTo(N)}else 2===db?(sa=$("<div class='modeler-designer-addsource-cell-item'>"),db=J.translateSourceType(La.getSourceType()),aa&&""!=$.trim(ua.getText())?ya(sa,db,ua.getText()):sa.text(db),sa.attr("title",db),sa.appendTo(N)):3===db?(sa=$("<div class='modeler-designer-addsource-cell-item'>"),
La=La.getCreatorName(),aa&&""!=$.trim(ua.getText())?ya(sa,La,ua.getText()):sa.text(La),sa.attr("title",La),sa.appendTo(N)):4===db&&(Ya=$("<div class='modeler-designer-addsource-cell-item'>"),La=La.getCreateTime(),La=sa.format(La),Ya.text(La),Ya.attr("title",La),Ya.appendTo(N));Ja(N,xa)};var Za=function(N){var xa=$("<span>");xa.addClass("modeler-designer-addsource-source-icon");switch(N.getSourceType()){case Z.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:N="entity-source-icon";break;case Z.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:N=
"datacenter-source-icon";break;case Z.SOURCE_TYPE_MODEL_SET_SOURCE:N="modelset-source-icon";break;case Z.SOURCE_TYPE_OPEN_API_SOURCE:N="openapi-source-icon";break;default:if(N.getSpecificType())N=N.getSpecificType().toLowerCase();else throw Error("unknown type");}F.background(xa,N);return xa},w=function(N){var xa=N.getErrorMessage(),Ya=N.getId(),La=new a,db=!1,sa=La.getJqUi(),Na=!1;if(0<Oa.length)for(var Fa=Oa.length-1;0<=Fa;Fa--)if(Ya===Oa[Fa].getSourceId()){Na=db=!0;break}if(!Na&&xa)return La.setEnabled(!1),
La.setChecked(db),sa;xa=Object.keys(bb);for(Na=0;Na<xa.length;Na++)if(Ya===xa[Na]){db=bb[xa[Na]].isChecked();break}bb[Ya]=La;La.setChecked(db);La.setUserObject(N);La.addCheckedListener(function(ja){ja=ja.isChecked();var Ca=Object.keys(bb);if(ja)for(var Ta=0;Ta<Ca.length;Ta++)if(!bb[Ca[Ta]].isChecked())return;Aa.setChecked(ja)});return sa},da=function(N){var xa=new r,Ya=!1,La=xa.getJqUi();if(N.getErrorMessage())xa.setEnabled(!1),La.children().eq(0).css("background-color","#ddd");else{for(var db=N.getId(),
sa=Object.keys(bb),Na=0;Na<sa.length;Na++)db===sa[Na]&&(Ya=bb[sa[Na]].isChecked());bb[db]=xa;xa.addCheckedListener(function(Fa,ja){if(ja&&Fa.isChecked())for(Fa=0;Fa<sa.length;Fa++)db!=sa[Fa]&&bb[sa[Fa]].setChecked(!1)})}xa.setChecked(Ya);xa.setUserObject(N);return La}}var p,f,t,q,z,L,E,M,x,U,ua,Aa,bb={},fa=[],Oa,aa=!1,wa,Pa=!1;this.setMultiSelect=function(H){wa=H};this.setContainer=function(H){M=H};this.setArrExistsSource=function(H){Oa=H};this.getJqUi=function(){p||ka();return p};this.setRemoteImpl=
function(H){x=H};this.getTable=function(){return U};this.getSelected=function(){for(var H=Object.keys(bb),ea=[],Ja=0;Ja<H.length;Ja++){var Za=bb[H[Ja]];if(Za.isChecked()&&(ea.push(Za.getUserObject()),!wa))break}return ea};this.updateUiByObserver=function(){Pa&&(0===fa.length?Ia():Ka(fa))};this.rePaintSource=function(H){H?V(H):(Ka(fa),wa&&Sa())};var V=function(H){if(0==H.length)bb={},fa=[],q&&q.css("right","15px"),L&&(L.hide(),ua.clear()),p&&p.remove(),Ia();else{t&&t.hide();L&&L.show();ua&&ua.clear();
q&&q.css("right","205px");fa=[];bb={};for(var ea=0;ea<H.length;ea++){var Ja=new D;Ja.fromJsonObject(H[ea]);fa.push(Ja)}Ka(fa);wa&&Sa()}},X=function(){q=$("<div>");q.attr("title",na.get("refresh","\u5237\u65b0"));F.backgroundWithHover(q,"refresh");q.addClass("modeler-designer-addsource-btn-refresh");q.on("click",ha);q.appendTo(M)},ha=function(){(new (Q.ModelSetSourceIntegration.getModelSetSourceFacade())(x,function(H){V(H)})).designerLoadSources()},Wa=function(){L=$("<div>");L.css("display","flex");
var H=$("<div class = 'modeler-designer-addsource-modelset-source-link'>");H.text(na.get("modelSetSourceManage","\u6570\u636e\u6e90\u7ba1\u7406"));H.attr("title",na.get("modelSetSourceManage","\u6570\u636e\u6e90\u7ba1\u7406"));H.on("click",function(){K&&K.occur(K.BUTTON_TYPE,K.SOURCE_MANAGE);Q.ModelSetSourceIntegration.getDataSourceManageEntrance()()});H.appendTo(L);H=new c;H.setIconType(c.ICON_TYPE_QUESTION);H.setTipsSize(380,54);var ea=H.getJqUi();ea.css("position","relative");var Ja="<span>"+na.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>";H.setTipsHtml(Ja);ea.appendTo(L);R();L.appendTo(M)},G=function(H){if(""===H)aa&&(aa=!1,Ka(fa));else{aa=!0;H=H.toLowerCase();for(var ea=[],Ja=0;Ja<fa.length;Ja++){var Za=fa[Ja],
w=Za.getSourceName(),da=Za.getSourceType(),N=J.translateSourceType(da),xa=Za.getCreatorName();w||(w=J.createSourceNameByType(da));-1==w.toLowerCase().indexOf(H)&&-1==N.toLowerCase().indexOf(H)&&-1==xa.toLowerCase().indexOf(H)||ea.push(Za)}Ka(ea)}},Ka=function(H){f&&f.remove();ka();if(H&&0<H.length){for(var ea=0;ea<H.length;ea++)va(H[ea]);z&&z.hide()}else z?z.show():(z=$("<div>"),z.addClass("modeler-designer-addsource-noresult-view-container"),H=$("<div>"),H.addClass("modeler-designer-addsource-noresult-view-icon"),
F.background(H,"search-no-result"),H.appendTo(z),H=$("<div>"),H.addClass("modeler-designer-addsource-noresult-view-tip"),H.text(na.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),H.appendTo(z),z.appendTo(M));p.appendTo(M);d.refresh(U)},R=function(){E||(ua=new k,ua.setShowSearchIcon(!0),ua.setPlaceholder(na.get("searchContent","\u8bf7\u8f93\u5165\u540d\u79f0/\u7c7b\u578b/\u521b\u5efa\u4eba")),ua.setSearchListenerDelay(1E3),ua.addSearchListener(function(){G($.trim(ua.getText()))}),
E=ua.getJqUi(),E.find(":input").on("keydown",function(H){13==(H.keyCode||H.which||H.charCode)&&G($.trim(ua.getText()))}),E.addClass("modeler-designer-addsource-search-box"));E.appendTo(L)},va=function(H){if(H){var ea=d.createRow(U,!1),Ja=new KTBorderStyle;Ja.setBottomBorderWidth(1);Ja.setBottomBorderPen("solid");Ja.setBottomBorderColor("#e5e5e5");ea.setBorder(Ja);ea.setUserObject(H)}},Ia=function(){if(t)t.show();else{t=$("<div>");t.addClass("modeler-designer-addsource-nodata-view-container");var H=
$("<div>");H.addClass("modeler-designer-addsource-nodata-view-icon");F.background(H,"no_data_cloud");H.appendTo(t);H=$("<div>");H.addClass("modeler-designer-addsource-nodata-view-tip");H.text(na.get("pleaseCreateSource","\u8bf7\u5148\u5728\u201c\u6570\u636e\u6e90\u7ba1\u7406\u201d\u4e2d\u521b\u5efa\u6570\u636e\u6e90\u8fde\u63a5\u4fe1\u606f"));H.appendTo(t);H=$("<a>");H.addClass("modeler-designer-addsource-nodata-view-text");H.text(na.get("modelSetSourceManage","\u6570\u636e\u6e90\u7ba1\u7406"));H.attr("title",
na.get("modelSetSourceManage","\u6570\u636e\u6e90\u7ba1\u7406"));H.on("click",function(){Q.ModelSetSourceIntegration.getDataSourceManageEntrance()()});H.appendTo(t);t.appendTo(M);q||X();q.css("right","15px")}},Sa=function(){for(var H=Object.keys(bb),ea=0;ea<H.length;ea++)if(!bb[H[ea]].isChecked()){Aa.setChecked(!1);return}Aa.setChecked(!0)};this.loadDataSource=function(){(new (Q.ModelSetSourceIntegration.getModelSetSourceFacade())(x,function(H){Pa||(Pa=!0);if(0===H.length)Ia();else{ka();for(var ea=
0;ea<H.length;ea++){var Ja=new D;Ja.fromJsonObject(H[ea]);fa.push(Ja);va(Ja)}d.refresh(U);wa&&Sa()}})).designerLoadSources()};var ka=function(){p=$("<div class='modeler-designer-addsource-list-table'>");U=d.createTable();U.setColumnFitVisibleWidth(!0);U.addColumns(5);U.getColumn(0).setWidth(40);U.getColumn(1).setWidth(190);U.getColumn(2).setWidth(190);U.getColumn(3).setWidth(95);U.getColumn(4).setWidth(215);U.setScrollerVisible("hidden");var H=d.createHeadRow(U);H.getCell(1).setValue(na.get("name",
"\u540d\u79f0"));H.getCell(2).setValue(na.get("type","\u7c7b\u578b"));H.getCell(3).setValue(na.get("creator","\u521b\u5efa\u4eba"));H.getCell(4).setValue(na.get("createTime","\u521b\u5efa\u65f6\u95f4"));H=new C(U);H.setOutsideVisible(!1);U.setCellRender(H);U.setSyncUIWhenModelChanged(!0);f=$(U.getUI());f.appendTo(p);p.appendTo(M);L||Wa();q||X();q.css("right","255px")},ya=function(H,ea,Ja){if(H&&ea&&Ja){Ja=Ja.toUpperCase();for(var Za=ea.toUpperCase(),w=Za.split(Ja),da=Ja.length,N=0;N<w.length;N++){var xa=
Za.indexOf(w[N]),Ya=ea.substr(0,w[N].length);xa+=w[N].length;var La=Za.length-xa;Za=Za.substr(xa,La);ea=ea.substr(xa,La);xa=$("<span>");xa.text(Ya);xa.appendTo(H);N!=w.length-1&&1<w.length&&(xa=Za.indexOf(Ja),Ya=ea.substr(xa,da),xa+=da,La=Za.length-xa,Za=Za.substr(xa,La),ea=ea.substr(xa,La),xa=$("<span>"),xa.text(Ya),xa.css("color","red"),xa.clone().appendTo(H))}}}}function Xa(C){var p,f,t,q=!1,z=[],L,E,M,x=[];this.getJqUi=function(){t||(p=new l,p.setRootVisible(!1),p.setNodePainter(ua),f=Oa(C),p.setRoot(f),
f.setExpanded(!0),f.setSelectable(!1),p.setLineHeight(30),t=p.getJqUi(),za.layoutCtrl(t,0,1,"100%",118),p.addSelectingListener(U),t.css({top:"31px",background:"white",height:"auto",width:"100%",bottom:"30px",overflow:"hidden auto"}));return t};var U=function(wa,Pa){wa=p.searchUiByModel(Pa);wa.attr("id","modeler-designer-tablearea-table-selected");wa.siblings().removeAttr("id")};this.scrollNodeToVisibleByName=function(wa){for(var Pa,V=0;V<x.length;V++)x[V].getUserObject().getName()==wa&&(Pa=x[V]);
if(wa=p.searchUiByModel(Pa))wa.attr("id","modeler-designer-tablearea-table-selected"),wa.siblings().removeAttr("id"),document.querySelector(".sa-ctrl-tree").scrollTop=wa.prop("offsetTop")};this.updateExceptionNodeUi=function(wa,Pa){for(var V=t.children(),X,ha,Wa=0;Wa<V.length;Wa++){var G=V.eq(Wa),Ka=G.data("model"),R=Ka.getUserObject();if(Ka.isLeafNode()&&R.getCommentInfo()==wa){X=G;ha=R;break}}if(X){wa=X.children().eq(0);V=wa.children(".modeler-designer-tablearea-table-exception-icon");X=0;0<V.length&&
V.remove();if(Pa=J.getModelExceptionTips(Pa))X+=20,wa.css("margin-left","20px"),V=J.createExceptionIcon(Pa),V.addClass("modeler-designer-tablearea-table-exception-icon"),V.appendTo(wa);ha.setErrorMessage(Pa);wa.css("margin-left",X+"px")}};var ua=function(wa,Pa){var V=function(Ka){var R=$("<div>");za.layoutCtrlWithLRTB(R,"",0,50,0,0,16);var va=$("<div class='modeler-designer-tablearea-table-name-edit'>");F.backgroundWithHover(va,"edit");va.on("click",function(){E&&E(Pa.getUserObject())});var Ia=$("<div class='modeler-designer-tablearea-table-name-delete'>");
F.backgroundWithHover(Ia,"delete");Ia.on("click",function(){M&&M(Pa.getUserObject(),Ia)});ha.getErrorMessage()&&(va.css("right","72px"),Ia.css("right","34px"));va.appendTo(R);Ia.appendTo(R);R.appendTo(Ka);R.hide();Ka.on("mouseenter",function(){R.show();ha.getErrorMessage()?Wa.css("right","90px"):Wa.css("right","70px")});Ka.on("mouseleave",function(){R.hide();ha.getErrorMessage()?Wa.css("right","50px"):Wa.css("right","30px")})},X=20*Pa.getLevel();wa.css("padding-left","4px");wa.css("padding-right",
"4px");wa.css("width","calc(100% - "+X+"px)");var ha=Pa.getUserObject(),Wa=$("<div>");Wa.addClass("modeler-designer-tablearea-table-name");Wa.text(ha.getDisplayName());Wa.attr("title",ha.getDisplayName());Wa.appendTo(wa);if(Pa.isLeafNode()){X=$("<div>");X.addClass("modeler-designer-tablearea-table-icon");var G=ha.getUserSql()?ha.getUserSql().getSqlType():"entity"==ha.getType()?"entity-sub":"table";F.background(X,G);X.appendTo(wa);wa.css("overflow","");ha.getErrorMessage()&&(wa.css("margin-left","20px"),
X=J.createExceptionIcon(ha.getErrorMessage()),X.addClass("modeler-designer-tablearea-table-exception-icon"),X.appendTo(wa));ha.getUserSql()&&(V(wa),x.push(Pa))}};this.doSearch=function(wa){L&&L.hide();if(""===wa)q&&(fa(),bb(),p.setRoot(f),q=!1);else if(t){wa=wa.toLowerCase();q&&bb();var Pa=Oa(C);Pa.deepFirstVisiting(function(V){var X=V.getUserObject().getDisplayName();if(X&&-1!=X.toLowerCase().indexOf(wa))for(V=V.getTreePath(),X=0;X<V.length;X++){var ha=V[X];!ha.isLeafNode()&&V[X+1]&&ha.setExpanded(!0);
ha=ha.getUserObject();ha.setMatch(!0);z.push(ha)}},!1);Aa(Pa);p.setRoot(Pa);0===z.length&&(L=$("<div>"),L.text(na.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),L.addClass("modeler-designer-tablearea-noresult-tip"),L.appendTo(t));q=!0}};var Aa=function(wa){if(wa.isExpanded())for(var Pa=wa.getAllChildren(),V=0;V<Pa.length;V++){var X=Pa[V];X.getUserObject().getMatch()?X.isLeafNode()||Aa(X):wa.removeChild(X)}},bb=function(){if(0<z.length)for(var wa=0;wa<z.length;wa++)z[wa].setMatch(!1);
z=[]},fa=function(){f.deepFirstVisiting(function(wa){wa!=f&&(wa.isLeafNode()||wa.setExpanded(!1))},!1)};this.setUserSqlDeleteListener=function(wa){M=wa};this.setUserSqlEditListener=function(wa){E=wa};var Oa=function(wa){var Pa=new l.BranchNode;Pa.setUserObject(wa);if((wa=wa.getChildren())&&0<wa.length)for(var V=0;V<wa.length;V++){var X=wa[V];if(X instanceof ba){var ha=Pa;X=X.getChildren()?Oa(X):aa(X);ha.addChild(X)}else Pa.addChild(aa(X))}return Pa},aa=function(wa){var Pa=new l.LeafNode;Pa.setUserObject(wa);
return Pa};this.setSelectedNode=function(){}}function ca(C){var p,f,t,q,z,L=!1,E=[],M=[],x;this.setUserSqlDeleteListener=function(fa){z=fa};this.setUserSqlEditListener=function(fa){q=fa};var U=function(){var fa=L?E:C.getChildren();p.getJqUi().empty();p.setItemCount(fa.length);p.setItemUiCreator(ua);p.repaint()},ua=function(fa){var Oa=function(X){var ha=$("<div>");za.layoutCtrlWithLRTB(ha,"",0,50,0,0,16);var Wa=$("<div class='modeler-designer-tablearea-table-name-edit'>");F.backgroundWithHover(Wa,
"edit");Wa.on("click",function(){q&&q(aa)});var G=$("<div class='modeler-designer-tablearea-table-name-delete'>");F.backgroundWithHover(G,"delete");G.on("click",function(){z&&z(aa,G)});aa.getErrorMessage()&&(Wa.css("right","72px"),G.css("right","34px"));Wa.appendTo(ha);G.appendTo(ha);ha.appendTo(X);ha.hide();X.on("mouseenter",function(){ha.show();aa.getErrorMessage()?Pa.css("right","90px"):Pa.css("right","70px")});X.on("mouseleave",function(){ha.hide();aa.getErrorMessage()?Pa.css("right","50px"):
Pa.css("right","30px")})},aa=(L?E:C.getChildren())[fa],wa=$("<div class='modeler-designer-tablearea-dbCenter-item'>");wa.css("padding-left","4px");wa.css("padding-right","4px");wa.css("height","30px");wa.css("width","calc(100% - 10px)");wa.data("model",aa);wa.on("click",function(){Aa(wa)});wa.on("mouseenter",function(){wa.addClass("modeler-designer-tablearea-dbCenter-table-hover")});wa.on("mouseleave",function(){wa.removeClass("modeler-designer-tablearea-dbCenter-table-hover")});var Pa=$("<div>");
Pa.addClass("modeler-designer-tablearea-dbCenter-table-name");Pa.text(aa.getDisplayName());Pa.attr("title",aa.getDisplayName());Pa.appendTo(wa);fa=$("<div class='modeler-designer-tablearea-dbCenter-table-icon'>");var V=aa.getUserSql()?aa.getUserSql().getSqlType():"table";F.background(fa,V);fa.appendTo(wa);wa.css("overflow","");aa.getErrorMessage()&&(wa.css("margin-left","20px"),fa=J.createExceptionIcon(aa.getErrorMessage()),fa.addClass("modeler-designer-tablearea-dbCenter-table-exception-icon"),fa.appendTo(wa));
aa.getUserSql()&&Oa(wa);return wa},Aa=function(fa){for(var Oa=0;Oa<M.length;Oa++)M[Oa].removeClass("modeler-designer-tablearea-table-selected");M=[fa];fa.addClass("modeler-designer-tablearea-table-selected")};this.setSelectedNode=function(fa){if(fa){fa=fa.getDisplayName();for(var Oa=p.getPaintedItems(),aa=0;aa<Oa.length;aa++){var wa=Oa[aa],Pa=wa.data("model");if(Pa&&Pa.getDisplayName()===fa){Aa(wa);break}}}};var bb=function(fa,Oa){for(var aa=0;aa<fa.length;aa++){var wa=fa[aa];if(wa.getDisplayName()===
Oa)return wa}};this.updateExceptionNodeUi=function(fa,Oa){Oa=J.getModelExceptionTips(Oa);for(var aa=p.getPaintedItems(),wa,Pa,V=0;V<aa.length;V++){var X=aa[V],ha=X.data("model");if(ha&&ha.getDisplayName()===fa){wa=X;Pa=ha;break}}wa?wa&&(fa=wa.children(".modeler-designer-tablearea-dbCenter-table-exception-icon"),aa=0,0<fa.length&&fa.remove(),Oa&&(aa+=20,wa.css("margin-left","20px"),fa=J.createExceptionIcon(Oa),fa.addClass("modeler-designer-tablearea-dbCenter-table-exception-icon"),fa.appendTo(wa)),
Pa.setErrorMessage(Oa),wa.css("margin-left",aa+"px")):(wa=C.getChildren(),(Pa=bb(wa,fa))&&Pa.setErrorMessage(Oa))};this.scrollNodeToVisibleByName=function(fa){var Oa=L?E:C.getChildren(),aa=bb(Oa,fa);if(aa)for(Oa=30*Oa.indexOf(aa),p.repaint(Oa),Oa=p.getPaintedItems(),aa=0;aa<Oa.length;aa++){var wa=Oa[aa],Pa=wa.data("model");if(Pa&&Pa.getDisplayName()===fa){Aa(wa);break}}};this.setSearchClearCallBack=function(fa){x=fa};this.doSearch=function(fa){fa=$.trim(fa).toLowerCase();t&&t.hide();var Oa=C.getChildren();
if(0===fa.length)L=!1,U();else{L=!0;E=[];for(var aa=0;aa<Oa.length;aa++){var wa=Oa[aa],Pa=wa.getDisplayName();Pa&&-1!==Pa.toLowerCase().indexOf(fa)&&E.push(wa)}U();0===E.length&&(t=$("<div>"),t.text(na.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),t.addClass("modeler-designer-tablearea-noresult-tip"),t.appendTo(f))}};this.getJqUi=function(){f||(p=new B,p.setItemHeight(30),f=p.getJqUi(),za.layoutCtrlWithLRTB(f,0,0,"100%",0,30,null),f.addClass("modeler-designer-tablearea-dbCenter"),
x&&x(),U());return f}}function Y(){var C,p,f=Q.SourceConnectStep.getExeSourceChangeCallback(),t=function(){Q.SourceConnectStep.clearTableAreaSearchBox();var q=C.data("errorCode");q?f&&f(p,q):Q.SourceConnectStep.checkSourceConnectivity(p,C)};this.setJqItem=function(q){C=q};this.getJqItem=function(){return C};this.setSource=function(q){p=q};this.getSource=function(){return p};this.getFunConnectSource=function(){return t};this.protectedMethod={setFunConnectSource:function(q){t=q},getFunFailCallback:function(){return f}}}
function Ma(){Y.call(this)}function oa(){Y.call(this);var C=this;this.protectedMethod.setFunConnectSource(function(){Q.SourceConnectStep.checkModelSetSourceConnect(C.getSource(),C.getJqItem());Q.SourceConnectStep.clearTableAreaSearchBox()})}function A(){Y.call(this);var C=this.protectedMethod,p=this;C.setFunConnectSource(function(){Q.SourceConnectStep.clearTableAreaSearchBox();C.getFunFailCallback()(p.getSource(),ta.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 Q=com.kingdee.bos.qing.modeler.designer;Q.SourceArea=ta;Q.TableArea=function(){var C,p,f,t,q,z,L,E,M,x,U,ua,Aa,bb,fa,Oa,aa,wa,Pa,V,X,ha,Wa,G={};this.getSearchBox=
function(){return E};this.getJqTableTree=function(){return x};this.setTableNodeCreator=function(ja){Wa=ja};this.setGlobal=function(ja){z=ja};this.setRemoteImpl=function(ja){t=ja};this.setDragHandler=function(ja){q=ja};this.updateNodeStatus=function(ja,Ca){M&&M.updateExceptionNodeUi(ja,Ca)};this.getJqUi=function(){if(!C){C=$("<div>");C.addClass("modeler-designer-workarea");C.addClass("modeler-designer-common-border");ua=$("<div>");ua.addClass("modeler-designer-workarea-title");U=$("<span>");U.addClass("modeler-designer-tablearea-title-text");
U.text(na.get("table","\u8868"));ua.append(U);p=$("<div>");p.addClass("modeler-designer-workarea-container");var ja=$("<div>"),Ca=$("<div>");Ca.text(na.get("customSQL","\u81ea\u5b9a\u4e49SQL/KSQL"));Ca.attr("title",na.get("customSQL","\u81ea\u5b9a\u4e49SQL/KSQL"));var Ta=$("<div>");F.backgroundWithHover(Ta,"add");ja.append(Ca);ja.append(Ta);za.layoutCtrlWithLRTB(ja,0,0,null,null,0,25);za.layoutCtrlWithLRTB(Ca,5,null,170,5,0,18);za.layoutCtrlWithLRTB(Ta,null,0,18,5,0,18);za.makeTextOmissible(Ca);ja.css({"border-top":"1px solid #e5e5e5"});
Ta.css({cursor:"pointer"});Ta.on("click",R);ha=ja;ha.hide();p.append(ha);p.appendTo(C);ea();C.append(ua)}return C};this.setSource=function(ja){ja&&ja!=f&&(f=ja);G[ja]=void 0;xa()};this.setExceptionSource=function(ja,Ca){Oa=new Date;ja&&ja!=f&&(f=ja);G[f]=Ca;db();x&&x.remove();wa&&wa.hide();N(ja,Ca)};var Ka=function(ja,Ca){x&&x.remove();Ca?(M=new ca(ja),M.setSearchClearCallBack(function(){E&&E.clear()})):M=new Xa(ja);M.setUserSqlDeleteListener(ka);M.setUserSqlEditListener(Ia);x=M.getJqUi();x.appendTo(p);
sa(!1)},R=function(){if(G[f])return va(G[f],!1),!0;if(Na()&&!Pa.getSelectPair())z.getMessageCurtain().showPrompt(na.get("chooseAppWarn","\u8bf7\u5148\u9009\u62e9\u4e00\u4e2a\u5e94\u7528\u3002"));else{var ja=new Ha(t,function(Ta){var ib=new I;ib.setSourceUid(f.getId());var fb=Q.UIDHelper.getUID(Q.UIDHelper.NS_TABLE);ib.setUid(fb);Na()&&ib.setNamespace(Pa.getSelectPair().value);Ta=new Va(t,!1,Ta);Ta.setModel(ib);Ta.setSource(f);Ta.setTableNameChecker(Ja);Ta.setPermAndConnChecker(Sa);Ta.addConfirmListener(function(Ua,
jb){var pb=z.getModelerModel(),qb=new Ea;qb.setValue(Ua,jb,pb,da);z.getCommandManager().perform(qb);z.getMessageCurtain().showSuccess(na.get("CreateSQLSuccess","\u65b0\u5efa\u81ea\u5b9a\u4e49SQL\u6210\u529f\u3002"))});Ta.showDialog()},function(Ta){va(Ta+"",!1);return!0});if(Pa&&Pa.getSelectPair())var Ca=Pa.getSelectPair().value;ja.checkKSQLSupport(f.getSourceId(),Ca)}},va=function(ja,Ca){switch(ja){case ta.PUBLIC_SOURCE_IS_DELETED_ERRORCODE:case ta.SOURCE_CONNECT_FAILED_ERRORCODE:case ta.SOURCE_EXCEPTION_DELETED_ERRORCODE:case ta.SOURCE_EXCEPTION_DELETED_ERRORCODE_1:Ca?
z.getMessageCurtain().showPrompt(na.get("editSQLWithoutSource","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7f16\u8f91\u81ea\u5b9a\u4e49SQL/KSQL\u3002")):z.getMessageCurtain().showPrompt(na.get("createSQLWithoutSource","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u65b0\u5efa\u81ea\u5b9a\u4e49SQL/KSQL\u3002"));break;default:Ca?z.getMessageCurtain().showPrompt(na.get("editWithoutPerm","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650\uff0c\u65e0\u6cd5\u7f16\u8f91\u81ea\u5b9a\u4e49SQL/KSQL\u3002")):
z.getMessageCurtain().showPrompt(na.get("createWithoutPerm","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650\uff0c\u65e0\u6cd5\u65b0\u5efa\u81ea\u5b9a\u4e49SQL/KSQL\u3002"))}},Ia=function(ja){if(G[f]||ja.getErrorMessage())return va(G[f],!0),!0;var Ca=new Ha(t,function(ib){var fb=new I;fb.setSourceUid(f.getId());fb.setTableName(ja.getName());fb.setUserSql(ja.getUserSql());Na()&&fb.setNamespace(ja.getCommentInfo());fb=z.getModelerModel().getSameTable(fb).clone();ib=new Va(t,
!0,ib);ib.setModel(fb);ib.setSource(f);ib.setTableNameChecker(Ja);ib.setPermAndConnChecker(Sa);ib.addConfirmListener(function(Ua,jb){var pb=z.getModelerModel(),qb=new Ea;qb.setValue(Ua,jb,pb,da);z.getCommandManager().perform(qb);z.getMessageCurtain().showSuccess(na.get("EditSQLSuccess","\u7f16\u8f91\u81ea\u5b9a\u4e49SQL\u6210\u529f\u3002"))});ib.showDialog()},function(ib){va(ib+"",!0);return!0});if(Pa&&Pa.getSelectPair())var Ta=Pa.getSelectPair().value;Ca.checkKSQLSupport(f.getSourceId(),Ta)},Sa=
function(ja,Ca,Ta){var ib=na.get("createWithoutPerm","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650\uff0c\u65e0\u6cd5\u65b0\u5efa\u81ea\u5b9a\u4e49SQL/KSQL\u3002");Ta&&(ib=na.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 Ha(t,function(fb){fb?ja():(Ca(),z.getMessageCurtain().showPrompt(ib))},function(){Ca();z.getMessageCurtain().showPrompt(ib);return!0})).checkUserSqlSourcePermission(f.getSourceId())},
ka=function(ja,Ca){var Ta=new g;Ta.setText(na.get("ConfirmDeleteSQL","\u786e\u5b9a\u5220\u9664\u8be5\u81ea\u5b9a\u4e49SQL\u5417\uff1f"));Ta.setConfirmedListener(function(ib){if(ib){ib=new I;ib.setSourceUid(f.getId());ib.setTableName(ja.getName());ib.setUserSql(ja.getUserSql());Na()&&ib.setNamespace(ja.getCommentInfo());var fb=z.getModelerModel();if(fb.isUserSqlTableInUse(ib))z.getMessageCurtain().showPrompt(na.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 Ua=new ra;Ua.setValue(ib,fb,da);z.getCommandManager().perform(Ua);z.getMessageCurtain().showSuccess(na.get("DeleteSQLSuccess","\u5220\u9664\u81ea\u5b9a\u4e49SQL\u6210\u529f\u3002"))}}});Ta.show(Ca,!1)},ya=function(){wa&&wa.hide();L&&L.hide();bb&&bb.hide();x&&x.remove();sa(!0);if(fa)H(),fa.show();else{fa=$("<div>");fa.addClass("modeler-designer-tablearea-notable-view");fa.appendTo(p);var ja=$("<div>");F.background(ja,"no_data_cloud");ja.addClass("modeler-designer-tablearea-notable-icon");
ja.appendTo(fa);V=$("<div>");V.addClass("modeler-designer-tablearea-notable-text");H();V.appendTo(fa)}},H=function(){switch(f.getSourceType()){case Z.SOURCE_TYPE_MODEL_SET_SOURCE:V.text(na.get("noModelTip","\u6682\u65e0\u53ef\u7528\u7684\u6a21\u578b"));break;default:V.text(na.get("noTableTip","\u6682\u65e0\u53ef\u7528\u7684\u6570\u636e\u8868"))}},ea=function(){L||(E=new k,E.setSearchListenerDelay(1E3),E.addSearchListener(function(){M&&M.doSearch($.trim(E.getText()),function(){E.clear()})}),E.setShowSearchIcon(!0),
E.setPlaceholder(na.get("searchTable","\u8bf7\u8f93\u5165\u641c\u7d22\u5185\u5bb9")),L=E.getJqUi(),L.addClass("modeler-designer-tablearea-search-box"),L.find(":input").on("keydown",function(ja){13==(ja.keyCode||ja.which||ja.charCode)&&M&&M.doSearch($.trim(E.getText()))}));L.appendTo(p)},Ja=function(ja,Ca){for(var Ta=Za(),ib=[],fb=0;fb<Ta.length;fb++)ib.push(Ta[fb].getName());Ca&&ib.splice(ib.indexOf(Ca),1);return-1<ib.indexOf(ja)},Za=function(){for(var ja=z.getModelerModel().getUserSqlTables(f.getId()),
Ca=[],Ta=0;Ta<ja.length;Ta++){var ib=ja[Ta];if(!Na()||Pa.getSelectPair()&&Pa.getSelectPair().value&&ib.getNamespace()==Pa.getSelectPair().value){var fb=new O;fb.setName(ib.getTableName());fb.setDisplayName(ib.getTableName());fb.setUserSql(ib.getUserSql());fb.setCommentInfo(ib.getNamespace());Ca.push(fb)}}return Ca},w=function(ja){for(var Ca=Za(),Ta=0;Ta<Ca.length;Ta++)ja.getChildren().push(Ca[Ta])},da=function(ja){x&&x.remove();var Ca=G[f];if(Ca)N(f,Ca);else{0<$.trim(E.getText()).length&&E.clear();
Ca=new ba;var Ta=Na();Ta?Pa.getSelectPair()&&Pa.getSelectPair().value&&Ca.fromJsonObject(X,Pa.getSelectPair().value):Ca.fromJsonObject(X);w(Ca);Ka(Ca,Ta);q.bindDragUi(x,Fa);Ta&&x.css("top","65px");ja&&M.scrollNodeToVisibleByName(ja.getTableName())}},N=function(ja,Ca){for(var Ta=Na(),ib=z.getModelerModel().getAllTable(),fb=[],Ua=0;Ua<ib.length;Ua++)ja.getId()===ib[Ua].getSourceUid()&&fb.push(ib[Ua]);if(fb&&0<fb.length){switch(Ca){case ta.SOURCE_EXCEPTION_DELETED_ERRORCODE:var jb=na.get("tableNotExist",
"\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664");break;case ta.PUBLIC_SOURCE_IS_DELETED_ERRORCODE:case ta.PUBLIC_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case ta.DATACENTER_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case ta.SOURCE_CONNECT_FAILED_ERRORCODE:jb=na.get("tableCanNotUse","\u8be5\u6570\u636e\u6e90\u4e0b\u7684\u8868\u5747\u65e0\u6cd5\u4f7f\u7528")}ja=new ba;ib=ja.getChildren();for(Ua=0;Ua<fb.length;Ua++){var pb=new O;pb.setName(fb[Ua].getTableName());pb.setDisplayName(fb[Ua].getTableName());
pb.setUserSql(fb[Ua].getUserSql());jb&&pb.setErrorMessage(jb);ib.push(pb)}Ka(ja,Ta);Aa&&Aa.remove();switch(Ca){case ta.PUBLIC_SOURCE_IS_DELETED_ERRORCODE:case ta.PUBLIC_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case ta.DATACENTER_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case ta.SOURCE_CONNECT_FAILED_ERRORCODE:var qb=na.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 ta.CURRENT_USER_NOPERMISSION_PUBLIC_SOURCE_ERRORCODE:case ta.CURRENT_USER_NOPERMISSION_DATACENTER_ERRORCODE:qb=
na.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")}qb&&(Aa=J.createExceptionIcon(qb),Aa.addClass("modeler-designer-tablearea-title-exception-icon"),Aa.appendTo(ua));L&&L.show()}else switch(Aa&&Aa.remove(),Ca){case ta.MODELSET_SOURCE_ALL_MODEL_CANCEL_DEPLOY_ERRORCODE:case ta.SOURCE_EXCEPTION_DELETED_ERRORCODE:case ta.PUBLIC_SOURCE_IS_DELETED_ERRORCODE:case ta.SOURCE_CONNECT_FAILED_ERRORCODE:ya();
break;case ta.CURRENT_USER_NOPERMISSION_DATACENTER_ERRORCODE:case ta.CURRENT_USER_NOPERMISSION_PUBLIC_SOURCE_ERRORCODE:case ta.DATACENTER_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:case ta.PUBLIC_SOURCE_CREATOR_NOPERMISSION_ERRORCODE:wa&&wa.hide(),L&&L.hide(),fa&&fa.hide(),sa(!0),bb?bb.show():(bb=$("<div>"),bb.addClass("modeler-designer-tablearea-nopermission-view"),bb.appendTo(p),Ca=$("<div>"),Ca.addClass("modeler-designer-tablearea-nopermission-icon"),F.background(Ca,"no-permission"),Ca.appendTo(bb),
Ca=$("<div>"),Ca.addClass("modeler-designer-tablearea-nopermission-text"),Ca.text(na.get("noPermission","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6743\u9650")),Ca.appendTo(bb))}},xa=function(){var ja=new Date;Oa=ja;if(Na())x&&x.remove(),Ya();else{wa&&wa.hide();var Ca=new Ha(t,function(Ta){if(Oa===ja){X=Ta;var ib=new ba;ib.fromJsonObject(Ta);w(ib);0===ib.getChildren().length?ya():(Ka(ib,!1),q.bindDragUi(x,Fa))}});Ca.setBlockingJqUi(p);f.setModelId(Q.ModelSetSourceIntegration.getModelId());
Ca.loadTables(f)}db();Aa&&Aa.remove();bb&&bb.hide();fa&&fa.hide();L.show()},Ya=function(){sa();wa?(wa.show(),La()):(Pa=new (Q.ModelSetSourceIntegration.getDataCenterSelector()),wa=Pa.getJqUi(),wa.appendTo(p),aa=Pa.getTextField(),Pa.setFunSelectedChangeListener(function(ja){(new Ha(t,function(Ca){var Ta=new ba;Ta.fromJsonObject(Ca,ja);X=Ca;w(Ta);Ka(Ta,!0);x.css("top","65px");q.bindDragUi(x,Fa)})).getDBCenterTables(ja)}))},La=function(){var ja=Pa.getSelectPair();ja&&(aa.setText(ja.text),Pa.getFunSelectedChangeListener()(ja.value))},
db=function(){switch(f.getSourceType()){case Z.SOURCE_TYPE_MODEL_SET_SOURCE:U.text(na.get("model","\u6a21\u578b"));break;case Z.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:U.text(na.get("entity","\u5b9e\u4f53"));break;case Z.SOURCE_TYPE_MODELSET_FILE_SOURCE:U.text(na.get("table","\u8868"));break;default:U.text(na.get("table","\u8868"))}},sa=function(ja){if(ja)ha&&ha.hide(),x&&x.css("bottom","1px");else switch(f.getSourceType()){case Z.SOURCE_TYPE_MODEL_SET_SOURCE:case Z.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:case Z.SOURCE_TYPE_MODELSET_FILE_SOURCE:ha.hide();
x&&x.css("bottom","1px");break;default:ha.show(),x&&x.css("bottom","30px")}},Na=function(){return f.getSourceType()===Z.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE},Fa=function(ja){var Ca=ja.parent();if(Ca&&Ca.hasClass("sa-ctrl-tree-nodeline")){var Ta=Ca.data("model").getUserObject();Ta instanceof O&&Ca.addClass("modeler-designer-tablearea-table-item")}else Ca&&Ca.hasClass("modeler-designer-tablearea-dbCenter")?(ja.addClass("modeler-designer-tablearea-table-item"),(Ta=ja.data("model"))&&M.setSelectedNode(Ta)):
ja.hasClass("modeler-designer-tablearea-table-icon")||ja.hasClass("modeler-designer-tablearea-table-name")?(Ca=ja.parents(".sa-ctrl-tree-nodeline"),Ta=Ca.data("model").getUserObject(),Ta instanceof O&&Ca.addClass("modeler-designer-tablearea-table-item")):ja.hasClass("modeler-designer-tablearea-dbCenter-table-icon")||ja.hasClass("modeler-designer-tablearea-dbCenter-table-name")?(Ca=ja.parents(".modeler-designer-tablearea-dbCenter-item"),(Ta=Ca.data("model"))&&M.setSelectedNode(Ta),Ca.addClass("modeler-designer-tablearea-table-item")):
ja.hasClass("sa-ctrl-tree-nodeline")&&(Ta=ja.data("model").getUserObject(),Ta instanceof O&&ja.addClass("modeler-designer-tablearea-table-item"));return za.upwardSearchHasClass(ja,x,"modeler-designer-tablearea-table-item")?(ja=new I,ja.setSourceUid(f.getId()),ja.setTableName(Ta.getName()),Ta.getCommentInfo()&&ja.setNamespace(Ta.getCommentInfo()),Ta.getName()&&ja.setTableName(Ta.getName()),Ta.getDisplayName()&&ja.setDisplayName(Ta.getDisplayName()),Ta.getUserSql()&&ja.setUserSql(Ta.getUserSql()),(Ta=
z.getModelerModel().getSameTable(ja))?ja=Ta:(Ta=Q.UIDHelper.getUID(Q.UIDHelper.NS_TABLE),ja.setUid(Ta)),Ta=Wa(ja),Ca=new Ba,Ca.setTableNode(Ta),Ca.setTable(ja),Ca):null}};Q.SourceListPanel=mb;var Z=Q.AbstractModelerSource,O=Q.LeafNode,ia=Q.DesignTimeSource,Ha,ba,n,Ba,I,P,D,W,la,Ea,ra,K,pa,za,na,y,S,T,m,r,qa,k,d,b,a,l,c,e,g,v,u,h,B;var F=Q.Icons;(function(){var C=com.kingdee.bos.qing.framework.common;na=C.MultilanguageManager.createPackageAccessor(Q);y=C.WindowResizeObserver;C=com.kingdee.bos.qing.common;
za=C.DomUtil;b=C.DateFormater;C=com.kingdee.bos.qing.ui.component;T=C.AbstractModalDialog;S=C.Button;m=C.RadioButtonGroup;r=C.RadioButton;qa=C.List;k=C.SearchBox;a=C.CheckBox;l=C.Tree;c=C.HelpIcon;e=C.MessageDialog;g=C.SimpleConfirmer;v=C.Label;u=C.TextField;h=C.TextArea;B=C.DynamicScroller;C=com.kingdee.bos.qing.common.ui;d=C.TableUtil;Ha=Q.DesignerFacade;ba=Q.FolderNode;n=Q.ModelerModel;Ba=Q.DraggingTableNode;I=Q.Table;P=Q.UserSQL;D=Q.ModelSetDataSource;W=Q.ActionRemoveSource;la=Q.ActionAddRemoveSource;
Ea=Q.ActionAddUserSqlTable;ra=Q.ActionRemoveUserSqlTable;K=Q.UserOperationReporter;pa=Q.AbstractInvalidityCase})();ta.CURRENT_USER_NOPERMISSION_DATACENTER_ERRORCODE="20002101";ta.CURRENT_USER_NOPERMISSION_PUBLIC_SOURCE_ERRORCODE="20002102";ta.PUBLIC_SOURCE_IS_DELETED_ERRORCODE="20002103";ta.PUBLIC_SOURCE_CREATOR_NOPERMISSION_ERRORCODE="20002104";ta.DATACENTER_SOURCE_CREATOR_NOPERMISSION_ERRORCODE="20002105";ta.MODELSET_SOURCE_ALL_MODEL_CANCEL_DEPLOY_ERRORCODE="20002106";ta.SOURCE_CONNECT_FAILED_ERRORCODE=
"2025008";ta.SOURCE_EXCEPTION_DELETED_ERRORCODE="2025009";ta.SOURCE_EXCEPTION_DELETED_ERRORCODE_1="20001004";var J=new function(){var C=this;this.translateSourceType=function(p){switch(p){case Z.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:return na.get("currentEntity","\u91d1\u8776\u4e91\u00b7\u82cd\u7a79-\u4e1a\u52a1\u5b9e\u4f53");case Z.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:return na.get("currentDataCenter","\u91d1\u8776\u4e91\u00b7\u82cd\u7a79-\u6570\u636e\u4e2d\u5fc3");case Z.SOURCE_TYPE_MODELSET_DB_SOURCE:return na.get("modelSetDBSource",
"\u6570\u636e\u5e93");case Z.SOURCE_TYPE_PUBLIC_DATA_SOURCE:return na.get("publicDBSource","\u516c\u5171\u6570\u636e\u6e90-\u6570\u636e\u5e93");case Z.SOURCE_TYPE_MODEL_SET_SOURCE:return na.get("modelSet","\u6a21\u578b\u96c6");case Z.SOURCE_TYPE_MODELSET_FILE_SOURCE:return na.get("modelSetFile","\u6587\u4ef6");case Z.SOURCE_TYPE_OPEN_API_SOURCE:return na.get("openAPI","OpenAPI")}};this.createExceptionIcon=function(p){var f=$("<div>");F.background(f,"qingWarning");f.attr("title",p);return f};this.createSourceNameByType=
function(p){var f;p===Z.SOURCE_TYPE_CURRENT_ENTITY_SOURCE?f=na.get("businessEntity","\u4e1a\u52a1\u5b9e\u4f53"):p===Z.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE&&(f=na.get("dataCenter","\u6570\u636e\u4e2d\u5fc3"));return f};this.getSourceIconName=function(p){switch(p){case Z.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:return"entity";case Z.SOURCE_TYPE_MODEL_SET_SOURCE:return"modelSet";case Z.SOURCE_TYPE_MODELSET_FILE_SOURCE:return"file";case Z.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:return"data-center";case Z.SOURCE_TYPE_OPEN_API_SOURCE:return"openapi";
default:return"data"}};this.updateSourceItemStatus=function(p,f,t){var q=p.children(".modeler-designer-sourcearea-exception-icon"),z=p.children(".modeler-designer-sourcearea-icon"),L=p.children(".modeler-designer-sourcearea-name"),E=12,M=34;q&&q.remove();f||(q=C.createExceptionIcon(t),q.addClass("modeler-designer-sourcearea-exception-icon"),q.appendTo(p),E+=22,M+=22);z.css("left",E+"px");L.css("left",M+"px")};this.updateDeletedSourceStatus=function(p){var f=C.createExceptionIcon(na.get("sourceExceptionDeleted",
"\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002"));f.addClass("modeler-designer-sourcearea-exception-icon");f.appendTo(p);f=p.children(".modeler-designer-sourcearea-icon");f.length?(f.css("left","34px"),f=p.children(".modeler-designer-sourcearea-name"),f.css("left","56px")):(f=$("<div>"),f.addClass("modeler-designer-sourcearea-name"),f.text(na.get("theSourceIsDeleted","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664")),f.css("left","34px"),f.appendTo(p))};
this.getModelExceptionTips=function(p){if(!p)return null;switch(p){case pa.TYPE_MODEL_DELETED:return na.get("modelDeleted","\u8be5\u6a21\u578b\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");case pa.TYPE_MODEL_NO_DATA_PERMISSION:return na.get("modelNoPermission","\u60a8\u672a\u88ab\u6388\u6743\u4f7f\u7528\u8be5\u6a21\u578b\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");case pa.TYPE_MODEL_INCOMPLETE:return na.get("modelNoComplete","\u8be5\u6a21\u578b\u8bbe\u7f6e\u4e0d\u5b8c\u6574\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");
case pa.TYPE_MODEL_DAMAGE:return na.get("modelBad","\u8be5\u6a21\u578b\u5df2\u635f\u574f\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");case pa.TYPE_MODEL_CYCLE_REFERENCE:return na.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 pa.TYPE_TABLE_NOT_EXISTS:return na.get("tableNotExistCantUse","\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002")}}};
Q.SourceConnectStep=new function(){var C,p,f;this.setGlobal=function(q){C=q};this.setRemoteImpl=function(q){p=q};this.setSourceArea=function(q){};this.setTableArea=function(q){f=q};this.removeTableTree=function(){var q=f.getJqTableTree();q&&q.remove()};this.clearTableAreaSearchBox=function(){f.getSearchBox().clear()};this.getExeSourceChangeCallback=function(){return f.setExceptionSource};var t=function(q,z,L){var E=C.getIntegration().getMapSourcePermission();z?E&&(E[q]=null):(z={},z.errorMessage=
L,E&&(E[q]=z))};this.checkModelSetSourceConnect=function(q,z){(new Ha(p,function(L){var E=L?!1:!0;J.updateSourceItemStatus(z,E,L);f.setSource(q);t(q.getSourceId(),E,L)},function(L){if(20001004===L)return z.data("errorCode",ta.SOURCE_EXCEPTION_DELETED_ERRORCODE),f.setExceptionSource(q,ta.SOURCE_EXCEPTION_DELETED_ERRORCODE),J.updateDeletedSourceStatus(z),!0})).checkModelSetSourceConnect(q.getSourceId())};this.checkSourceConnectivity=function(q,z){(new Ha(p,function(L){if(L)f.setSource(q);else{var E=
na.get("sourceConnectFailed","\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");f.setExceptionSource(q,ta.SOURCE_CONNECT_FAILED_ERRORCODE)}t(q.getSourceId(),L,E);J.updateSourceItemStatus(z,L,E)},function(L,E){var M=L.toString();if(20001004===L)z.data("errorCode",ta.SOURCE_EXCEPTION_DELETED_ERRORCODE),f.setExceptionSource(q,ta.SOURCE_EXCEPTION_DELETED_ERRORCODE),J.updateDeletedSourceStatus(z);else{var x="206"==M.substr(0,3)?na.get("openAPIConnectFailed","OpenAPI\u7684\u8fde\u63a5\u4fe1\u606f\u65e0\u6548\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002"):
-1!=E.indexOf("2030900")?na.get("xmlParseFailed","xml\u6587\u4ef6\u5904\u7406\u5931\u8d25\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002"):na.get("sourceConnectFailed","\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002");f.setExceptionSource(q,ta.SOURCE_CONNECT_FAILED_ERRORCODE)}x&&(t(q.getSourceId(),!1,x),J.updateSourceItemStatus(z,!1,x));return!0})).checkConnection(q.getSourceId())}};Q.ConnectSourceCreator=new function(){var C;this.getSourceConnector=function(p,
f){if(!C){C={};var t=new oa,q=new Ma;C[Z.SOURCE_TYPE_MODEL_SET_SOURCE]=t;C[Z.SOURCE_TYPE_PUBLIC_DATA_SOURCE]=q;C[Z.SOURCE_TYPE_MODELSET_DB_SOURCE]=q;C[Z.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE]=q;C[Z.SOURCE_TYPE_CURRENT_ENTITY_SOURCE]=q;C[Z.SOURCE_TYPE_MODELSET_FILE_SOURCE]=q;C[Z.SOURCE_TYPE_OPEN_API_SOURCE]=q}t=(t=p.getSourceType())?C[t]:new A;t.setSource(p);t.setJqItem(f);return t}};Q.ModelSetSourceIntegration=new function(){var C,p,f,t,q,z;this.setModelId=function(L){z=L};this.getModelId=function(){return z};
this.setDataSourceManageEntrance=function(L){C=L};this.getDataSourceManageEntrance=function(){return C};this.setRemoteImpl=function(L){p=L};this.getRemoteImpl=function(){return p};this.registerDataCenterSelectorConstructor=function(L){f=L};this.getDataCenterSelector=function(){return f};this.registerMetricDataCenterSelector=function(L){t=L};this.getMetricDataCenterSelector=function(){return t};this.setModelSetSourceFacade=function(L){q=L};this.getModelSetSourceFacade=function(){return q}}})();(function(){function ta(){na.call(this);var k=this,d=this.protectedMethod,b=[],a=[],l=[],c=[],e=[];k.setType(na.TYPE_METRIC_MODELER);k.setMaterializedConfig(new qa);this.protectedIsTableInUse=function(u){return!0};this.isTableReferred=function(u){g();for(var h=0;h<c.length;h++){var B=c[h];if(B instanceof Y&&B.getTableId()==u.getUid())return!0}for(h=0;h<b.length;h++){B=b[h].getFilterItems();for(var F=0;F<B.length;F++){var J=B[F].getField();if(J&&J.getTableId()==u.getUid())return!0}}return!1};this.getAllDimension=
function(){return a};this.setDimensions=function(u){a=u};this.addDimension=function(u,h){isNaN(h)?a.push(u):a.splice(h,0,u);d.firePropertyChangeEvt(ta.KEY_ADD_DIMENSION,u)};this.removeDimension=function(u){for(var h=0;h<a.length;h++)if(a[h].isSame(u))return a.splice(h,1),d.firePropertyChangeEvt(ta.KEY_REMOVE_DIMENSION,[u]),h;return-1};this.updateDimension=function(u,h){if(isNaN(h))return!1;a.splice(h,1);a.splice(h,0,u);d.firePropertyChangeEvt(ta.KEY_UPDATE_DIMENSION,a)};this.updateDimensions=function(u){a=
u;d.firePropertyChangeEvt(ta.KEY_BATCH_UPDATE_DIMENSION,u)};this.getDimensionById=function(u){for(var h=0;h<a.length;h++)if(a[h].getDimensionId()==u)return a[h]};this.getDimensionByName=function(u){for(var h=0;h<a.length;h++)if(a[h].getName()==u)return a[h]};this.getPublicDimensions=function(){return l};this.getPublicDimensionById=function(u){for(var h=0;h<l.length;h++)if(l[h].getId()==u)return l[h]};this.getSamePublicDimension=function(u){for(var h=0;h<l.length;h++){var B=l[h];if(B.isSame(u))return B}};
this.setPublicDimensions=function(u){l=u};this.removePublicDimensionById=function(u){for(var h=0;h<l.length;h++)if(l[h].getId()==u)return l.splice(h,1),h;return-1};this.addPublicDimension=function(u,h){isNaN(h)?l.push(u):l.splice(h,0,u)};this.checkDimensionRef=function(u,h){var B=k.getAllTable();if(h&&2<=B.length)return!0;for(h=0;h<a.length;h++)if(a[h].getPublicDimensionId()==u)return!0;return!1};this.checkTableExist=function(u){for(var h=k.getAllTable(),B=0;B<h.length;B++)if(u==h[B].getUid())return!0;
return!1};this.setMetrics=function(u){b=u};this.addMetric=function(u,h){isNaN(h)?b.push(u):b.splice(h,0,u);d.firePropertyChangeEvt(ta.KEY_ADD_METRIC,u)};this.removeMetric=function(u){var h=b.indexOf(u);return-1<h?(b.splice(h,1),d.firePropertyChangeEvt(ta.KEY_REMOVE_METRIC,u),h):-1};this.updateMetric=function(u){var h=k.getMetric(u.getId());h&&(h.update(u),d.firePropertyChangeEvt(ta.KEY_UPDATE_METRIC,h))};this.getAllMetric=function(){return b};this.getMetric=function(u){for(var h=0;h<b.length;h++){var B=
b[h];if(B.getId()==u)return B}};this.setExprReferences=function(u){c=u};this.setUnreferencedRef=function(u){e=u};this.getExprReferences=function(){return c};this.copyExprReferences=function(){for(var u=[],h=0;h<c.length;h++){var B=c[h].copy();u.push(B)}return u};this.getExprReference=function(u){for(var h=0;h<c.length;h++){var B=c[h];if(u==B.getId())return B}};this.repairDimensionRef=function(u){};this.addExprRefIfNotExist=function(u){for(var h=0;h<c.length;h++){var B=c[h];if(B.equals(u))return B}for(h=
0;h<e.length;h++)if(B=e[h],B.equals(u)){u=B;e.splice(h,1);break}c.push(u);return u};this.protectedToJsonObject=function(u){for(var h=[],B=0;B<b.length;B++)h.push(b[B].toJsonObject());u.metrics=h;g();h=[];for(B=0;B<c.length;B++)h.push(c[B].toJsonObject());u.references=h;h=[];for(B=0;B<e.length;B++)h.push(e[B].toJsonObject());u.unreferencedRef=h;h=[];for(B=0;B<a.length;B++)h.push(a[B].toJsonObject());u.dimensions=h;h=[];for(B=0;B<l.length;B++)l[B].isEmpty()||h.push(l[B].toJsonObject());u.publicDimensions=
h;k.getMaterializedConfig()||(B=new qa,u.materializedConfig=B.toJsonObject())};this.protectedFromJsonObject=function(u){var h=u.metrics;if(h)for(var B=0;B<h.length;B++){var F=new Da;F.fromJsonObject(h[B]);b.push(F)}if(h=u.references)for(B=0;B<h.length;B++){F=h[B];switch(F.type){case ca.FIELD_TYPE:var J=new Y;break;case ca.METRIC_TYPE:J=new Ma;break;default:throw Error("unknown type");}J.fromJsonObject(F);c.push(J)}if(h=u.dimensions)for(B=0;B<h.length;B++)F=new Va,F.fromJsonObject(h[B]),a.push(F);
if(u=u.publicDimensions)for(B=0;B<u.length;B++)h=new mb,h.fromJsonObject(u[B]),l.push(h);h=v();B=[];for(u=0;u<h.length;u++)F=h[u],k.getExprReference(F)||B.push(F);for(u=0;u<B.length;u++)for(h=B[u],F=0;F<b.length;F++){J=b[F];var C=J.getExpr();J.setExpr(za.ExprRefHelper.replaceRefText(C,h,""))}};this.copy=function(){var u=new ta;d.copy(u);for(var h=[],B=0;B<b.length;B++)h.push(b[B].clone());u.setMetrics(h);h=[];for(B=0;B<a.length;B++)h.push(a[B].copy());u.setDimensions(h);h=[];for(B=0;B<l.length;B++)h.push(l[B].copy());
u.setPublicDimensions(h);h=[];for(B=0;B<c.length;B++)h.push(c[B].copy());u.setExprReferences(h);h=[];for(B=0;B<e.length;B++)h.push(e[B].copy());u.setUnreferencedRef(h);return u};var g=function(){for(var u=v(),h=[],B=[],F=0;F<c.length;F++){var J=c[F];-1<u.indexOf(J.getId())?h.push(J):B.push(J)}c=h;e=B},v=function(){for(var u=[],h=0;h<b.length;h++){var B=b[h].getExpr();(B=za.ExprRefHelper.getRefTextInExpr(B))&&(u=u.concat(B))}return u}}function Da(){var k,d,b,a,l,c,e=[];this.setNumber=function(g){k=
g};this.getNumber=function(){return k};this.setId=function(g){d=g};this.getId=function(){return d};this.setName=function(g){b=g};this.getName=function(){return b};this.setDesc=function(g){a=g};this.getDesc=function(){return a};this.setExpr=function(g){l=g};this.getExpr=function(){return l};this.setFormat=function(g){c=g};this.getFormat=function(){return c};this.setFilterItems=function(g){e=g};this.getFilterItems=function(){return e};this.update=function(g){k=g.getNumber();l=g.getExpr();b=g.getName();
a=g.getDesc();c=g.getFormat();e=g.getFilterItems()};this.clone=function(){var g=new Da;g.setNumber(k);g.setId(d);g.setExpr(l);g.setName(b);g.setDesc(a);g.setFormat(c);for(var v=[],u=0;u<e.length;u++){var h=e[u].copy();v.push(h)}g.setFilterItems(v);return g};this.equals=function(g){if(g.getName()!==b||g.getDesc()!==a||g.getExpr()!==l||g.getFormat()!==c||g.getNumber()!==k||e.length!==g.getFilterItems().length)return!1;g=g.getFilterItems();for(var v=0;v<e.length;v++)if(!e[v].equals(g[v]))return!1;return!0};
this.toJsonObject=function(){var g={};g.number=k;g.id=d;g.name=b;g.desc=a;g.expr=l;g.format=c;for(var v=[],u=0;u<e.length;u++)v.push(e[u].toJsonObject());g.filterItems=v;return g};this.fromJsonObject=function(g){d=g.id;k=g.number;b=g.name;a=g.desc;l=g.expr;c=g.format;if(g=g.filterItems)for(var v=0;v<g.length;v++){var u=new r;u.fromJsonObject(g[v]);e.push(u)}}}function Va(){var k,d,b,a=!1,l=!1,c,e,g,v,u=this;this.setDimensionId=function(h){k=h};this.getDimensionId=function(){return k};this.setName=
function(h){d=h};this.getName=function(){return d};this.setNumber=function(h){b=h};this.getNumber=function(){return b};this.setNumberModified=function(h){a=h};this.isNumberModified=function(){return a};this.setNameModified=function(h){l=h};this.isNameModified=function(){return l};this.setDimensionType=function(h){c=h};this.getDimensionType=function(){return c};this.setDateFormat=function(h){e=h};this.getDateFormat=function(){return e};this.setRequired=function(h){g=h};this.isRequired=function(){return g};
this.getPublicDimensionId=function(){return v};this.setPublicDimensionId=function(h){v=h};this.copy=function(){var h=new Va;h.setDimensionId(k);h.setName(d);h.setNumber(b);h.setNumberModified(a);h.setNameModified(l);h.setDimensionType(c);e?h.setDateFormat(e):c==Va.TYPE_DATE&&h.setDateFormat(Va.VALUE_YYYY);h.setRequired(g);h.setPublicDimensionId(v);return h};this.isSame=function(h){return h?d==h.getName()&&b==h.getNumber()&&a==h.isNumberModified()&&l==h.isNameModified()&&c==h.getDimensionType()&&k==
h.getDimensionId()&&(e==h.getDateFormat()||null==e&&h.getDateFormat()==Va.VALUE_YYYY)&&v==h.getPublicDimensionId()?!0:!1:!1};this.toJsonObject=function(){var h={};h.id=k;h.name=d;h.number=b;h.isNumberModified=a;h.isNameModified=l;h.dimensionType=c;h.dateFormatType=e;h.required=g;h.publicDimensionId=v;return h};this.fromJsonObject=function(h){k=h.id;d=h.name;b=h.number;a=h.isNumberModified;l=h.isNameModified;c=h.dimensionType;void 0!=h.dateFormatType&&u.setDateFormat(h.dateFormatType);h.required&&
u.setRequired(h.required);v=h.publicDimensionId}}function mb(){var k,d,b=!1,a=[];this.setId=function(c){k=c};this.getId=function(){return k};this.setName=function(c){d=c};this.getName=function(){return d};this.setNameModified=function(c){b=c};this.isNameModified=function(){return b};this.isSame=function(c){if(!c)return!1;c=c.getFields();if(c.length!=a.length)return!1;for(var e=0;e<a.length;e++)if(!a[e].isSame(c[e]))return!1;return!0};this.getDataType=function(){return 0==a.length?null:a[0].getDataType()};
this.setFields=function(c){a=c};this.addField=function(c){a.push(c)};this.insertField=function(c,e){a.splice(c,0,e)};this.getFields=function(){return a};this.getFieldByIndex=function(c){return a[c]};this.getLastField=function(){return a[a.length-1]};this.removeField=function(c){a.splice(c,1)};this.empty=function(c){d=null;c&&(k=null)};this.isEmpty=function(){return!d};this.updateFields=function(c){for(var e=0;e<a.length;e++){var g=a[e];if(g&&g.getName()){var v=g.getTableId();v=c[v]?c[v]:[];for(var u=
!1,h=0;h<v.length;h++)if(v[h]&&v[h].getName()==g.getName()){u=!0;g.update(v[h]);break}u||g.updateWhenNotExist();g.setExist(u)}}};this.isDataTypeConsistent=function(){if(0==a.length)return!1;var c=a[0];if(!c)return!1;for(var e=1;e<a.length;e++){var g=a[e];if(!g||c.getDataType()!=g.getDataType()||!l(c.getField(),g.getField()))return!1}return!0};this.tryGenerateId=function(c){var e=!0;if(c){c=c.getFields();for(var g=0;g<a.length;g++){var v=c[g].getField().getFullName(),u=a[g].getField().getFullName();
if(v==u){e=!1;break}}}else e=!1;if(!k||e)e=com.kingdee.bos.qing.modeler.designer.UIDHelper,k=e.getUID(e.NS_PUBLIC_DIMENSION)};this.tryGenerateName=function(c){if(0!=a.length){var e=a[0];d=b||!e.getAlias()?d:c()}};this.isFieldsCompleted=function(){for(var c=!1,e=0;e<a.length;e++)a[e].getName()&&(c=!0);if(!c&&!d)return!0;for(e=0;e<a.length;e++)if(c=a[e],!c.getName()||!c.isExist())return!1;return!0};this.copy=function(){var c=new mb;c.setId(k);c.setName(d);for(var e=[],g=0;g<a.length;g++){var v=a[g].copy();
e.push(v)}c.setFields(e);c.setNameModified(b);return c};this.toJsonObject=function(){var c={};c.id=k;c.name=d;c.isNameModified=b;for(var e=[],g=0;g<a.length;g++)e.push(a[g].toJsonObject());c.fields=e;return c};this.fromJsonObject=function(c){k=c.id;d=c.name;b=c.isNameModified;if(c=c.fields)for(var e=0;e<c.length;e++){var g=new Xa;g.fromJsonObject(c[e]);a.push(g)}};var l=function(c,e){c=c?c.getEnumValue():null;e=e?e.getEnumValue():null;if(!c&&!e)return!0;if(!c&&e||c&&!e||Object.keys(e).length!=Object.keys(c).length)return!1;
for(var g in e){var v=e[g],u=c[g];if(!u||u!=v)return!1}return!0}}function Xa(){var k=new T,d=!0;this.getField=function(){return k};this.setField=function(b){k=b};this.setName=function(b){k.setName(b)};this.getName=function(){return k.getName()};this.getTableId=function(){return k.getTableId()};this.setTableId=function(b){k.setTableId(b)};this.getDataType=function(){return k.getDataType()};this.setDataType=function(b){k.setDataType(b)};this.getAlias=function(){return k.getAlias()};this.setAlias=function(b){k.setAlias(b)};
this.setExist=function(b){d=b};this.isExist=function(){return d};this.update=function(b){k=b};this.updateWhenNotExist=function(){var b=new T;b.setName(k.getName());b.setTableId(k.getTableId());b.setAlias(k.getAlias());k=b};this.copy=function(){var b=new Xa;b.setField(k);b.setExist(d);return b};this.isSame=function(b){return k.getName()==b.getName()&&k.getTableId()==b.getTableId()?!0:!1};this.toJsonObject=function(){var b={};b.name=k.getName();b.tableId=k.getTableId();b.alias=k.getAlias();return b};
this.fromJsonObject=function(b){k.setName(b.name);k.setTableId(b.tableId);k.setAlias(b.alias)}}function ca(){var k=this,d,b;this.setId=function(a){d=a};this.getId=function(){return d};this.setType=function(a){b=a};this.getType=function(){return b};this.getRefDisplayText=function(a){throw Error("override me");};this.isRightDisplayFormat=function(a,l){throw Error("override me");};this.fromDisplayText=function(a,l,c){throw Error("override me");};this.equals=function(a){throw Error("override me");};this.fromJsonObject=
function(a){d=a.id;b=a.type;k.protectedFromJsonObject(a)};this.toJsonObject=function(){var a={};a.id=d;a.type=b;k.protectedToJsonObject(a);return a};this.protectedFromJsonObject=function(a){};this.protectedToJsonObject=function(a){};this.protectedMethod={copy:function(a){a.setId(d);a.setType(b)}}}function Y(){ca.call(this);var k=this,d=this.protectedMethod,b,a,l;k.setType(ca.FIELD_TYPE);this.copy=function(){var c=new Y;c.setTableId(b);c.setFieldName(a);c.setAlias(l);d.copy(c);return c};this.setTableId=
function(c){b=c};this.getTableId=function(){return b};this.setFieldName=function(c){a=c};this.getFieldName=function(){return a};this.setAlias=function(c){l=c};this.getRefDisplayText=function(c){c=c.getTable(b);var e=l?l:a;return za.TableNameHelper.getDisplayText(c)+"."+e};this.isRightDisplayFormat=function(c){return-1<c.indexOf(".")};this.fromDisplayText=function(c,e,g){var v=c.split(".")[0];b=v;var u=e.getAllTable();for(e=0;e<u.length;e++){var h=u[e];if(za.TableNameHelper.getDisplayText(h)==v){b=
h.getUid();break}}a=c=c.substring(v.length+1);g=g?g[b]:[];for(e=0;e<g.length;e++)if(v=g[e],v.getAlias()==c){a=v.getName();l=c;break}};this.equals=function(c){return c.getType()!=k.getType()?!1:c.getTableId()==b&&c.getFieldName()==a?!0:!1};this.copy=function(){var c=new Y;d.copy(c);c.setTableId(b);c.setFieldName(a);c.setAlias(l);return c};this.protectedFromJsonObject=function(c){b=c.tableId;a=c.fieldName;l=c.alias};this.protectedToJsonObject=function(c){c.tableId=b;c.fieldName=a}}function Ma(){ca.call(this);
var k=this,d=this.protectedMethod,b;k.setType(ca.METRIC_TYPE);this.copy=function(){var a=new Ma;a.setMetricId(b);d.copy(a);return a};this.setMetricId=function(a){b=a};this.getMetricId=function(){return b};this.getRefDisplayText=function(a){return(a=a.getMetric(b))?a.getName():""};this.isRightDisplayFormat=function(a,l){var c=a.match(/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/),e=!1;if(c){l=l.getAllMetric();for(var g=0;g<l.length;g++)l[g].getName()==a&&(e=!0)}return c&&e};this.fromDisplayText=function(a,
l){l=l.getAllMetric();for(var c=0;c<l.length;c++){var e=l[c];if(e.getName()==a){b=e.getId();break}}if(!b)throw Error("invalid ref");};this.equals=function(a){return a.getType()!=k.getType()?!1:b==a.getMetricId()};this.copy=function(){var a=new Ma;d.copy(a);a.setMetricId(b);return a};this.protectedFromJsonObject=function(a){b=a.metricId};this.protectedToJsonObject=function(a){a.metricId=b}}function oa(){ca.call(this);var k=this,d=this.protectedMethod,b,a;k.setType(ca.DIMENSION_TYPE);this.copy=function(){var l=
new Ma;l.setDimensionId(b);l.setDimensionName(a);d.copy(l);return l};this.setDimensionId=function(l){b=l};this.getDimensionId=function(){return b};this.setDimensionName=function(l){a=l};this.getDimensionName=function(){return a};this.getRefDisplayText=function(l){var c=l.getDimensionById(b);c||(c=l.getDimensionByName(a));return c?c.getName():a};this.isRightDisplayFormat=function(l,c){var e=l.match(/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_()]{1,}$/),g=!1;if(e){c=c.getAllDimension();for(var v=0;v<c.length;v++)c[v].getName()==
l&&(g=!0)}return e&&g};this.fromDisplayText=function(l,c){c=c.getAllDimension();for(var e=0;e<c.length;e++){var g=c[e];if(g.getName()==l){b=g.getDimensionId();a=g.getName();break}}if(!b)throw Error("invalid ref");};this.equals=function(l){return l.getType()!=k.getType()?!1:b==l.getDimensionId()&&a==l.getDimensionName()};this.copy=function(){var l=new oa;d.copy(l);l.setDimensionId(b);l.setDimensionName(a);return l};this.protectedFromJsonObject=function(l){b=l.dimensionId;a=l.dimensionName};this.protectedToJsonObject=
function(l){l.dimensionId=b;l.dimensionName=a}}function A(){var k,d,b=[];this.isValid=function(){return k};this.getCases=function(){return b};this.isModelEmpty=function(){return d};this.fromJsonObject=function(a){k=a.valid;d=a.modelIsEmpty;if(a=a.cases){b=[];for(var l=new Q,c=0;c<a.length;c++){var e=a[c],g=l.getInvalidityCase(e.type);e&&(g.fromJsonObject(e),b.push(g))}}}}function Q(){this.getInvalidityCase=function(k){switch(k){case Z.TYPE_NO_METRIC:return new ia;case Z.TYPE_INVALID_FIELD_REF:return new Ha;
case Z.TYPE_INVALID_EXPR:return new Ba;case Z.TYPE_INVALID_FIELD_FILTER_REF:return new ba;case Z.TYPE_INVALID_DIMENSION_REF:return new D;case Z.TYPE_INVALID_DIMENSION_TYPE:return new W;case Z.TYPE_INVALID_PUBLIC_DIMENSION:return new Ea;case Z.TYPE_INVALID_TABLE:return new pa;case Z.TYPE_INVALID_EXPR_DATA_TYPE:return new I;case Z.TYPE_INCOMPLETE_MATERIALIZED_CONFIG:return new ra;case Z.TYPE_INVALID_DIMENSION_NOT_EXIST:case Z.TYPE_INVALID_DIMENSION_GRANULARITY_NOT_MATCH:case Z.TYPE_INVALID_DIMENSION_TYPE_NOT_MATCH:return new n}}}
function Z(){var k,d=this;this.getType=function(){return k};this.fromJsonObject=function(b){k=b.type;d.protectedFromJsonObject(b)};this.protectedFromJsonObject=function(b){}}function O(){Z.call(this);var k=[];this.getMetricIds=function(){return k};this.protectedFromJsonObject=function(d){d&&d.metricIds&&(k=d.metricIds)}}function ia(){Z.call(this)}function Ha(){O.call(this)}function ba(){O.call(this)}function n(){O.call(this)}function Ba(){O.call(this);var k;this.getMetricPrompt=function(b){if(!k)return null;
for(var a=Object.keys(k),l=0;l<a.length;l++)for(var c=a[l],e=k[c],g=0;g<e.length;g++)if(b==e[g])return c};var d=this.protectedFromJsonObject;this.protectedFromJsonObject=function(b){d(b);k=b.promptMap}}function I(){O.call(this);var k=this.protectedFromJsonObject;this.protectedFromJsonObject=function(d){k(d)}}function P(){Z.call(this);var k;this.getDimensionIds=function(){return k};this.protectedFromJsonObject=function(d){d.dimensionIds&&(k=d.dimensionIds)}}function D(){P.call(this)}function W(){P.call(this)}
function la(){Z.call(this);var k;this.getPublicDimensionIds=function(){return k};this.protectedFromJsonObject=function(d){d.publicDimensionIds&&(k=d.publicDimensionIds)}}function Ea(){la.call(this)}function ra(){Z.call(this)}function K(){Z.call(this);var k,d;this.getTableIds=function(){return k};this.getInvalidTableMap=function(){return d};this.protectedFromJsonObject=function(b){b.tableIds&&(k=b.tableIds);b.tableException&&(d=b.tableException)}}function pa(){K.call(this)}"undefined"==typeof com&&
(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.metricdesigner&&(com.kingdee.bos.qing.modeler.designer.metricdesigner={});
var za=com.kingdee.bos.qing.modeler.designer.metricdesigner;za.MetricModeler=ta;za.Metric=Da;za.ExprValidity=function(){var k,d,b;this.isValid=function(){return k};this.getPrompt=function(){return d};this.getExceptionType=function(){return b};this.fromJsonObject=function(a){k=a.valid;d=a.prompt;b=a.exceptionType}};za.Dimension=Va;za.PublicDimension=mb;za.MappingField=Xa;za.DimensionFilterItem=function(){var k,d;this.getDimensionKey=function(){return k};this.setDimensionKey=function(b){k=b};this.getValues=
function(){return d};this.setValues=function(b){d=b};this.fromJsonObject=function(b){k=b.dimensionKey;d=b.values};this.toJsonObject=function(){var b={};b.dimensionKey=k;b.values=d;return b}};za.ModelerValidity=A;za.MetricModelerInvalidityCase=Z;za.TableFieldMeta=function(){var k={},d;this.getTableFieldMap=function(){return k};this.setTableFieldMap=function(b){k=b};this.getValidity=function(){return d};this.setValidity=function(b){d=b};this.fromJsonObject=function(b){if(b){var a=b.validity;a&&(d=new A,
d.fromJsonObject(a));k={};if(b=b.tableFields){a=Object.keys(b);for(var l=0;l<a.length;l++){var c=a[l],e=k,g=c;c=b[c];for(var v=[],u=0;u<c.length;u++){var h=new T;h.fromJsonObject(c[u]);v.push(h)}e[g]=v}}}}};za.DimensionExprReference=oa;var na,y,S,T,m,r,qa;(function(){var k=com.kingdee.bos.qing.modeler.designer;na=k.ModelerModel;y=k.AbstractModelerModelParser;S=k.ModelerModerParser;T=k.Field;m=k.UIDHelper;r=k.FilterItem;qa=k.MaterializedConfig})();S.registerParser(na.TYPE_METRIC_MODELER,new function(){y.call(this);
this.parseToModel=function(k){var d=new ta;d.fromJsonObject(k);return d}});ta.KEY_ADD_METRIC="metric_designer_add_metric";ta.KEY_REMOVE_METRIC="metric_designer_remove_metric";ta.KEY_UPDATE_METRIC="metric_designer_update_metric";ta.KEY_ADD_DIMENSION="metric_designer_add_dimension";ta.KEY_REMOVE_DIMENSION="metric_designer_remove_dimension";ta.KEY_UPDATE_DIMENSION="metric_designer_update_dimension";ta.KEY_BATCH_UPDATE_DIMENSION="metric_designer_batch_update_dimension";Va.TYPE_DATE="DATE";Va.TYPE_NORMAL=
"NORMAL";Va.VALUE_YYYY=0;Va.VALUE_QUARTER=1;Va.VALUE_MONTH=2;Va.VALUE_DAY=3;Va.VALUE_YEAR_QUARTER=4;Va.VALUE_YEAR_MONTH=5;Va.VALUE_YEAR_WEEK=6;Va.VALUE_WEEK_OF_YEAR=7;Va.VALUE_DAY_OF_WEEK=8;Va.VALUE_YEAR_MONTH_DAY=9;za.TableNameHelper=new function(){var k={};this.removeTableName=function(b){b=b.getUid();k[b]&&(k[b]=null)};this.addTableName=function(b,a){b=b.getUid();k[b]=a};this.getDisplayText=function(b){var a=b.getUid(),l=k[a];if(l)return l;for(b=l=(l=b.getDisplayName())?l:b.getTableName();-1<b.indexOf(".");)b=
b.replace(".","_");b=d(b);return k[a]=b};var d=function(b,a){for(var l=a?b+"_"+a:b,c=!1,e=Object.keys(k),g=0;g<e.length;g++)if(k[e[g]]==l){c=!0;break}return c?d(b,a?a+1:1):l}};za.ExprRefHelper=new function(){function k(h){a.call(this,h,"#666")}function d(h){a.call(this,h,"#e8893a")}function b(h){a.call(this,h,"#4071ee")}function a(h,B){this.getText=function(){return h};this.getColor=function(){return B}}var l=this,c,e=[],g=/\[(.+?)\]/g;this.setGlobal=function(h){c=h};this.translateToExeExpr=function(h,
B){for(var F=l.getRefTextInExpr(h),J=0;J<F.length;J++){var C=F[J];a:{var p=C;for(var f=B,t=c.getModelerModel(),q=t.getExprReferences(),z=0;z<q.length;z++){var L=q[z];if(L.getRefDisplayText(t)==p){p=L;break a}}for(z=0;z<e.length;z++)if(q=new e[z],q.isRightDisplayFormat(p,t)){try{q.fromDisplayText(p,t,f)}catch(E){continue}q=t.addExprRefIfNotExist(q);q.getId()||(p=q,f=m.getUID(m.NS_REFERENCE),p.setId(f));p=q;break a}p=void 0}p&&(h=l.replaceRefText(h,C,p.getId()))}return h};this.translateToTextSegment=
function(h){var B=l.getRefTextInExpr(h),F=[],J=c.getModelerModel();v(h,B,function(C,p){C&&0<C.length&&(C=new k(C),F.push(C));p&&(p=J.getExprReference(p),p=p instanceof Y?new b("["+p.getRefDisplayText(J)+"]"):p instanceof Ma?new d("["+p.getRefDisplayText(J)+"]"):new k("[]"),F.push(p))});return F};var v=function(h,B,F){for(var J,C,p=0;p<B.length;p++){var f=B[p],t=h.indexOf("["+f+"]");-1<t&&(void 0==J||J>t)&&(J=t,C=f)}J||0==J?(p=h.substring(0,J),F(p,C,J),h=h.substring(J+("["+C+"]").length),v(h,B,F)):
F(h,null,null)};this.translateToDisplayExpr=function(h){for(var B=l.getRefTextInExpr(h),F=c.getModelerModel(),J=0;J<B.length;J++){var C=B[J],p=F.getExprReference(C);p=p instanceof Y?p.getRefDisplayText(F):p instanceof Ma?p.getRefDisplayText(F):"";h=l.replaceRefText(h,C,p)}return h};this.getRefTextInExpr=function(h){var B=[];h=h.match(g);if(!h)return B;for(var F=0;F<h.length;F++){var J=h[F];J=J.substring(1,J.length-1);0>B.indexOf(J)&&B.push(J)}return B};this.getRefFullDisplayText=function(h){var B=
c.getModelerModel();return"["+h.getRefDisplayText(B)+"]"};this.createFieldReference=function(h,B){var F=new Y;F.setTableId(h);F.setFieldName(B.getName());F.setAlias(B.getAlias());return u(F)};this.createMetricReference=function(h){var B=new Ma;B.setMetricId(h);return u(B)};this.registReference=function(h){0<e.indexOf(h)||e.push(h)};this.getMetricReferredInfo=function(h){var B=[];h=h.getId();for(var F=c.getModelerModel(),J=F.getAllMetric(),C=0;C<J.length;C++){var p=J[C];if(p.getId()!=h)for(var f=l.getRefTextInExpr(p.getExpr()),
t=0;t<f.length;t++){var q=F.getExprReference(f[t]);q instanceof Ma&&q.getMetricId()==h&&B.push(p)}}return B};this.replaceRefText=function(h,B,F){F="["+F+"]";for(B="["+B+"]";-1<h.indexOf(B);)h=h.replace(B,F);return h};var u=function(h){var B=m.getUID(m.NS_REFERENCE);h.setId(B);return c.getModelerModel().addExprRefIfNotExist(h)}};ca.FIELD_TYPE="field";ca.METRIC_TYPE="metric";ca.DIMENSION_TYPE="dimension";za.ExprRefHelper.registReference(Y);za.ExprRefHelper.registReference(Ma);Z.TYPE_NO_METRIC="noMetric";
Z.TYPE_INVALID_FIELD_REF="invalidFieldRef";Z.TYPE_INVALID_EXPR="invalidExpr";Z.TYPE_INVALID_EXPR_DATA_TYPE="invalidExprDataType";Z.TYPE_INVALID_FIELD_FILTER_REF="invalidFieldFilterRef";Z.TYPE_INVALID_DIMENSION_REF="invalidDimensionRef";Z.TYPE_INVALID_DIMENSION_TYPE="invalidDimensionType";Z.TYPE_INVALID_PUBLIC_DIMENSION="invalidPublicDimension";Z.TYPE_INVALID_TABLE="invalidTable";Z.TYPE_INVALID_TABLE_FILTER="invalidTableFilter";Z.TYPE_DB_CONNECTION_FAIL="dbConnectionFail";Z.TYPE_USER_NO_DB_CENTER_PERMISSION=
"userNoDBCenterPermission";Z.TYPE_CREATOR_NO_DB_CENTER_PERMISSION="creatorNoDBCenterPermission";Z.TYPE_USER_NO_PUBLIC_SOURCE_PERMISSION="userNoPublicSourcePermission";Z.TYPE_CREATOR_NO_PUBLIC_SOURCE_PERMISSION="creatorNoPublicSourcePermission";Z.TYPE_USER_NO_ENTITY_PERMISSION="userNoEntityPermission";Z.TYPE_REF_PUBLIC_SOURCE_NOT_EXIST="refPublicSourceNotExist";Z.TYPE_TABLE_NOT_EXIST="tableNotExist";Z.TYPE_MODEL_NOT_EXIST="modelNotExist";Z.TYPE_MODEL_DAMAGE="modelDamage";Z.TYPE_MODEL_NO_DATA_PERMISSION=
"modelNoDataPermission";Z.TYPE_MODEL_CYCLE_REFERENCE="modelCycleReference";Z.TYPE_INCOMPLETE_MATERIALIZED_CONFIG="incompleteMaterializedConfig";Z.TYPE_INVALID_DIMENSION_GRANULARITY_NOT_MATCH="invalidDimensionGranularityNotMatch";Z.TYPE_INVALID_DIMENSION_TYPE_NOT_MATCH="invalidDimensionTypeNotMatch";Z.TYPE_INVALID_DIMENSION_NOT_EXIST="invalidDimensionNotExist"})();(function(){"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.metricdesigner&&(com.kingdee.bos.qing.modeler.designer.metricdesigner=
{});var ta=com.kingdee.bos.qing.modeler.designer.metricdesigner,Da,Va,mb,Xa,ca,Y,Ma,oa,A,Q,Z,O,ia,Ha;(function(){var ba=com.kingdee.bos.qing.framework.common;Da=ba.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer);ba=com.kingdee.bos.qing.ui.component;Va=ba.HelpIcon;ba=com.kingdee.bos.qing.common;mb=ba.DomUtil;ba=com.kingdee.bos.qing.modeler.designer;Xa=ba.Field;ca=ba.DesignerFacade;Y=ba.QingModeler;Ma=ba.ModelSetSourceIntegration;oa=ba.Icons;A=ba.AbstractModelerSource;
ba=com.kingdee.bos.qing.modeler;Ha=ba.SpecialWordChecker;ba=com.kingdee.bos.qing.modeler.designer.metricdesigner;Q=ba.Dimension;Z=ba.MappingField;O=ba.PublicDimension;ia=ba.TableFieldMeta})();ta.FieldLoader=new function(){this.loadTableFields=function(ba,n,Ba,I,P){var D=ba.getModelerModel().copy();I&&D.setTables(I);P&&D.setSource(P,!0);I=new Y;I.setModelerModel(D);ba=new ca(ba.getRemoteImpl(),function(W){var la=new ia;la.fromJsonObject(W);(W=la.getValidity())&&ta.MetricStateMonitor.setModelValidity(W);
la=la.getTableFieldMap();Ba&&Ba(la)},function(W){Ba&&Ba({});return!0});ba.setBlockingJqUi(n);ba.getTableFieldWithCheckModel(I)}};ta.PublicDimensionUtil=new function(){var ba=this;this.addTablesToPublicDimensions=function(P,D,W,la,Ea){var ra=W.getModelerModel(),K=ra.getAllTable().concat(D),pa=ra.getAllSource();P&&(pa=pa.concat([P]));ta.FieldLoader.loadTableFields(W,la,function(za){for(var na=ra.getPublicDimensions(),y=[],S=0;S<na.length;S++){var T=na[S].copy();T.updateFields(za);y.push(T)}Ba(y,K,D,
za);na=y=n(W,y);S={};T=Object.keys(za);for(var m=0;m<T.length;m++){var r=T[m],qa=I(K,r);if(null!=qa){var k=r,d=na;r=za[r];for(var b=[],a=0;a<r.length;a++){for(var l=r[a],c=!0,e=0;e<d.length;e++)if(d[e].getFieldByIndex(qa).getName()==l.getName()){c=!1;break}c&&b.push(l)}S[k]=b}}za=[];Ba(za,K,K,S);for(S=0;S<za.length;S++)y.push(za[S].copy());y=n(W,y);za=ra.getAllDimension();if(1==D.length)for(S=y,na=0;na<S.length;na++)for(T=S[na],m=0;m<za.length;m++)k=za[m],k.getDimensionType()==Q.TYPE_NORMAL&&k.getPublicDimensionId()==
T.getId()&&(T.setName(k.getName()),T.setNameModified(k.isNameModified()));Ea&&Ea(y)},K,pa)};this.loadPublicDimensions=function(P,D){var W=[];D=D.getModelerModel().getPublicDimensions();for(var la=0;la<D.length;la++){var Ea=D[la].copy();Ea.updateFields(P);W.push(Ea)}return W};this.deleteTableForPublicDimensions=function(P,D,W,la){var Ea=D.getModelerModel(),ra=Ea.getAllTable(),K=Ea.getPublicDimensions();ta.FieldLoader.loadTableFields(D,W,function(pa){for(var za=I(ra,P),na=[],y=0;y<K.length;y++){var S=
K[y].copy();S.updateFields(pa);S.removeField(za);if(2==ra.length){if(!Ea.checkDimensionRef(S.getId()))continue;S.setNameModified(!1)}na.push(S)}for(y=0;y<na.length;y++)S=na[y],S.isNameModified()||(pa=ba.getUniquePublicDimensionName(D,na,S,!0),S.setName(pa));la&&la(na)})};this.createTipUi=function(){var P=$("<div>");mb.layoutCtrlWithLRTB(P,0,0,null,null,null,30);var D=$("<span>");D.text(Da.get("publicDIMDesc","\u516c\u5171\u7ef4\u5ea6\u529f\u80fd\u8bf4\u660e"));D.css({position:"relative",left:"0px",
top:"0px","max-width":"100px",color:"#666666","font-size":"12px",height:"18px"});P.append(D);D=$("<span>");D.css({position:"relative",left:"0px",top:"0px","margin-left":"4px",width:"18px",height:"18px"});var W=$("<div>");W.text(Da.get("publicDIMTips","\u516c\u5171\u7ef4\u5ea6\u9002\u7528\u4e8e\u4ee5\u4e0b\u60c5\u51b5\uff1a\n\u4e00\u662f\u6307\u6807\u7684\u8ba1\u7b97\u516c\u5f0f\u4f9d\u8d56\u591a\u4e2a\u6570\u636e\u8868\u4e2d\u7684\u5b57\u6bb5\uff0c\u4e8c\u662f\u6307\u6807\u7684\u8ba1\u7b97\u516c\u5f0f\u4f9d\u8d56\u4e8e\u591a\u4e2a\u6307\u6807\uff0c\u4e14\u8fd9\u4e9b\u6307\u6807\u6765\u6e90\u4e8e\u4e0d\u540c\u7684\u6570\u636e\u8868\u3002\u6b64\u65f6\u9700\u8981\u8bbe\u7f6e\u516c\u5171\u7ef4\u5ea6\u624d\u80fd\u6b63\u786e\u8ba1\u7b97\u51fa\u76f8\u5173\u6307\u6807\u3002"));
W.css({"line-height":"20px"});var la=new Va;la.setIconType(Va.ICON_TYPE_QUESTION);la.setTipsSize(370,105);la.setTipsHtml(W);W=la.getJqUi();D.append(W);mb.layoutCtrl(W,0,0,16,16);P.append(D);return P};this.appendResetButton=function(P,D,W){var la=$("<div>");la.on("mousedown",function(Ea){la.hide();W&&W();Ea.stopPropagation()});la.css("cursor","pointer");la.attr("title",Da.get("reset","\u91cd\u7f6e"));la.addClass("metric-designer-dimension-reset");oa.background(la,"reset");la.hide();P.on("mouseenter",
function(){D?la.show():la.hide()});P.on("mouseleave",function(){la.hide()});la.appendTo(P);return la};this.getUniquePublicDimensionName=function(P,D,W,la){var Ea=W.getFieldByIndex(0);if(Ea){Ea=Ea.getAlias();if(1==W.getFields().length)return Ea;if(!Ea)return"";for(var ra=[],K=P.getModelerModel().getAllDimension(),pa=P.getModelerModel().getPublicDimensions(),za=0;za<K.length;za++){var na=K[za];if(na.getPublicDimensionId()!=W.getId()){var y;if(!(y=!la)){y=void 0;for(var S=na,T=D,m=0;m<T.length;m++)if(S.getPublicDimensionId()==
T[m].getId()){y=T[m];break}y=y&&y.isFieldsCompleted()&&y.isDataTypeConsistent()&&!ba.isPdTypeInvalidWhenDateDimension(y,S)&&!ba.isPdTypeInvalidWhenNormalDimension(y,S)?!1:!0}(y||ba.isDimensionNameModified(na,D,pa))&&ra.push(na.getName())}}P=P.getModelerModel().getAllMetric();for(za=0;za<P.length;za++)ra.push(P[za].getName());for(za=0;za<D.length;za++)P=D[za],P!=W&&(K=D.indexOf(W),la&&za>=K&&!P.isNameModified()||P.getName()&&ra.push(P.getName()));return ba.fixDuplicateValue(ra,Ea,50)}};this.fixDuplicateValue=
function(P,D,W,la,Ea){var ra=la?la.length:0;var K=la?D+la:D;var pa=0;if(Ea){for(var za=[],na=0;na<P.length;na++){var y=P[na];y&&za.push(y.toLowerCase())}P=za}K.length>=W&&(K=D.substr(0,W-ra),la&&(K+=la));for(za=Ea?K.toLowerCase():K;-1<P.indexOf(za);)pa++,za=pa.toString().length,K=la?D+la:D,K.length>=W&&(K=D.substr(0,W-ra-za-1),la&&(K+=la)),K=K+"_"+pa,za=Ea?K.toLowerCase():K;return K};this.isDimensionNameModified=function(P,D,W){return P.getDimensionType()==Q.TYPE_NORMAL?P.isNameModified():P.isNameModified()||
!ba.isPublicDimensionNameModified(P,D,W)};this.isPublicDimensionNameModified=function(P,D,W){P=P.getPublicDimensionId();for(var la,Ea,ra=0;ra<D.length;ra++)if(P==D[ra].getId()){la=D[ra].getName();break}for(ra=0;ra<W.length;ra++)if(P==W[ra].getId()){Ea=W[ra].getName();break}return Ea!=la};this.isPdTypeInvalidWhenDateDimension=function(P,D){P=P.getFieldByIndex(0);if(!P)return!0;P=P.getDataType()!=Xa.DT_DATE&&P.getDataType()!=Xa.DT_DATETIME;return D.getDimensionType()==Q.TYPE_DATE&&P};this.isPdTypeInvalidWhenNormalDimension=
function(P,D){var W=P.getFieldByIndex(0);if(!W)return!0;W=W.getDataType()==Xa.DT_DATE||W.getDataType()==Xa.DT_DATETIME;return 2<=P.getFields().length&&D.getDimensionType()==Q.TYPE_NORMAL&&W};this.isValueDuplicate=function(P,D){for(var W=0;W<P.length;W++)if(P[W]==D)return!0;return!1};this.getAllPublicDimensionName=function(P,D){var W=[];P=P.getPublicDimensions();if(0==P.length||2>P[0].getFields().length)return W;for(var la=0;la<P.length;la++){var Ea=P[la];D&&D==Ea.getId()||W.push(Ea.getName())}return W};
this.getAllMetricName=function(P){var D=[];P=P.getAllMetric();for(var W=0;W<P.length;W++){var la=P[W].getName();D.push(la)}return D};var n=function(P,D){for(var W=[],la=0;la<D.length;la++){var Ea=D[la];Ea.isFieldsCompleted()&&Ea.isDataTypeConsistent()&&W.push(Ea)}for(la=0;la<W.length;la++){var ra=W[la];ra.tryGenerateId();ra.tryGenerateName(function(){return ba.getUniquePublicDimensionName(P,W,ra)})}return W},Ba=function(P,D,W,la){var Ea=0;0!=P.length&&(Ea=P[0].getFields().length);for(var ra=0;ra<
W.length;ra++){var K=W[ra].getUid(),pa=la[K]?la[K]:[],za=I(D,K);if(null!=za){for(var na=[],y=P,S=za,T=K,m=na,r=0;r<y.length;r++){var qa=y[r],k=new Z;k.setTableId(T);qa.insertField(S,k)}for(T=0;T<pa.length;T++){r=pa[T];a:{qa=y;k=r;for(var d=0;d<qa.length;d++){var b=qa[d],a=b.getFieldByIndex(0);if(a.getAlias()==k.getAlias()&&a.getDataType()==k.getDataType()){qa=b;break a}}qa=null}qa?qa.getFieldByIndex(S).update(r):m.push(r)}Ea++;if(0==za)for(y=0;y<na.length;y++){S=Ea;pa=K;m=za;T=na[y];r=new O;for(qa=
0;qa<S;qa++)k=new Z,k.setTableId(pa),qa==m&&k.update(T),r.addField(k);P.push(r)}}}},I=function(P,D){for(var W=null,la=0;la<P.length;la++)if(P[la].getUid()==D){W=la;break}return W}};ta.DimensionUtil=new function(){var ba=this,n="0123456789".split("");this.getDateFormatName=function(D,W){return(D=Ba(D))?W?"("+D+")":D:null};this.fixDimensionDateType=function(D,W,la){for(var Ea={},ra=0;ra<D.length;ra++)if(D[ra].getPublicDimensionId()==la){var K=D[ra].getDateFormat()+"",pa=Ea[K];pa?Ea[K]=++pa:Ea[K]=1}for(ra=
0;ra<n.length;ra++)if(D=n[ra],void 0===Ea[D]){W.setDateFormat(D-0);return}W.setDateFormat(n[n.length-1]-0)};this.getUniqueNumber=function(D,W,la,Ea){var ra=D.getModelerModel();Ea||(Ea=ra.getPublicDimensionById(W.getPublicDimensionId()));if(!Ea||0==Ea.getFields().length)return"";null==la&&(la=ba.getAllNumber(D,W));ra=null;W.getDimensionType()!=Q.TYPE_DATE||!I(D,Ea)&&W.isNameModified()||(ra=ba.getDateFormatName(W.getDateFormat(),!0));var K=Ea.getFieldByIndex(0);D=I(D,Ea)?K.getName():W.isNameModified()?
W.getName():Ea.getName();return ba.fixNumber(la,D,ra)};this.fixNumber=function(D,W,la){W=W.replace(/[^\u3000\u4E00-\u9FA5a-zA-Z0-9_()]/g,"_");Ha.isSpecialWord(W)&&(W+="_");W.match(/^([\u3000\u4E00-\u9FA5a-zA-Z_()])/)||(W="_"+W);return ta.PublicDimensionUtil.fixDuplicateValue(D,W,25,la,!0)};this.fixName=function(D,W,la){la=ba.getDateFormatName(la.getDateFormat(),!0);return ta.PublicDimensionUtil.fixDuplicateValue(D,W,50,la)};this.batchFixDimension=function(D,W,la,Ea){for(var ra=W.getModelerModel().getPublicDimensions(),
K=0;K<D.length;K++){var pa=D[K];if(!ta.MetricStateMonitor.checkDimensionInvalid(pa.getDimensionId())){for(var za,na=0;na<ra.length;na++)if(pa.getPublicDimensionId()==ra[na].getId()){za=ra[na];break}za&&(na=za.getFieldByIndex(0))&&(na=na.getDataType()==Xa.DT_DATE||na.getDataType()==Xa.DT_DATETIME,Ea&&pa.getDimensionType()==Q.TYPE_NORMAL&&na?(pa.setDimensionType(Q.TYPE_DATE),pa.setDateFormat(Q.VALUE_YYYY),pa.isNameModified()||P(D,za,K,W,la)):Ea&&pa.isNameModified()||pa.getDimensionType()!=Q.TYPE_NORMAL?
!pa.isNameModified()&&ta.PublicDimensionUtil.isPublicDimensionNameModified(pa,ra,la)&&P(D,za,K,W,la):P(D,za,K,W,la))}}};this.getAllName=function(D,W,la){var Ea=[];D=D.getModelerModel();for(var ra=D.getAllDimension(),K=0;K<ra.length;K++){var pa=ra[K];W&&W.getDimensionId()==pa.getDimensionId()||Ea.push(pa.getName())}la||(la=ta.PublicDimensionUtil.getAllMetricName(D),Ea=Ea.concat(la),W=ta.PublicDimensionUtil.getAllPublicDimensionName(D,W.getPublicDimensionId()),Ea=Ea.concat(W));return Ea};this.getAllNumber=
function(D,W,la){var Ea=D.getModelerModel(),ra=Ea.getAllDimension();D=[];for(var K=0;K<ra.length;K++){var pa=ra[K];W&&W.getDimensionId()==pa.getDimensionId()||(pa=pa.getNumber())&&D.push(pa)}la||(W=ba.getAllMetricNumber(Ea),D=D.concat(W));return D};this.getAllMetricNumber=function(D,W){var la=[];D=D.getAllMetric();for(var Ea=0;Ea<D.length;Ea++){var ra=D[Ea].getNumber();ra&&(W&&(ra=ra.toLowerCase()),la.push(ra))}return la};var Ba=function(D){switch(D){case 0:return Da.get("year","\u5e74");case 1:return Da.get("quarter",
"\u5b63\u5ea6");case 2:return Da.get("month","\u6708");case 3:return Da.get("day","\u65e5");case 4:return Da.get("yearQuarter","\u5e74\u5b63");case 5:return Da.get("yearMonth","\u5e74\u6708");case 6:return Da.get("yearWeek","\u5e74\u5468");case 7:return Da.get("weeks","\u5468\u6570");case 8:return Da.get("week","\u661f\u671f");case 9:return Da.get("yearMonthDay","\u5e74\u6708\u65e5");default:return null}},I=function(D,W){W=W.getFieldByIndex(0).getTableId();D=ta.SourceUtil.getSourceTypeByTableId(D,
W);return D==A.SOURCE_TYPE_CURRENT_ENTITY_SOURCE||D==A.SOURCE_TYPE_MODEL_SET_SOURCE?!0:!1},P=function(D,W,la,Ea,ra){var K=Ea.getModelerModel(),pa=D[la];pa.getDimensionType()==Q.TYPE_NORMAL&&pa.setNameModified(W.isNameModified());for(var za=D[la],na=[],y=0;y<la;y++)na.push(D[y].getName());var S=K.getPublicDimensions();for(y=la+1;y<D.length;y++){var T=D[y];(ta.MetricStateMonitor.checkDimensionInvalid(T.getDimensionId())||ta.PublicDimensionUtil.isDimensionNameModified(T,S,ra))&&na.push(T.getName())}ra=
ta.PublicDimensionUtil.getAllMetricName(K);na=na.concat(ra);za=ta.PublicDimensionUtil.getAllPublicDimensionName(K,za.getPublicDimensionId());na=na.concat(za);W=ba.fixName(na,W.getName(),pa);pa.setName(W);if(!pa.isNumberModified()){W=[];for(na=0;na<la;na++)W.push(D[na].getNumber());for(na=la+1;na<D.length;na++)la=D[na],(ta.MetricStateMonitor.checkDimensionInvalid(la.getDimensionId())||la.isNumberModified())&&W.push(la.getNumber());D=ba.getAllMetricNumber(K);W=W.concat(D);Ea=ba.getUniqueNumber(Ea,pa,
W);pa.setNumber(Ea)}}};ta.SourceUtil=new function(){var ba=this;this.createExceptionIcon=function(n){var Ba=$("<div>");oa.background(Ba,"qingWarning");Ba.attr("title",n);return Ba};this.updateTableItemStatus=function(n,Ba,I){var P=n.children(".modeler-designer-sourcearea-exception-icon"),D=n.children(".modeler-designer-sourcearea-icon"),W=n.children(".modeler-designer-sourcearea-name"),la=12,Ea=34;P&&P.remove();Ba||(P=ba.createExceptionIcon(I),P.addClass("modeler-designer-sourcearea-exception-icon"),
P.appendTo(n),la+=22,Ea+=22);D.css("left",la+"px");W.css("left",Ea+"px")};this.getTableSource=function(n,Ba){n=n.getModelerModel();Ba=Ba.getSourceUid();Ba=n.getSource(Ba);Ba.setModelId(Ma.getModelId());return Ba};this.getSourceTypeByTableId=function(n,Ba){Ba=n.getModelerModel().getTable(Ba);Ba=ba.getTableSource(n,Ba);return(n=n.getIntegration().getMapSourceType())?n[Ba.getSourceId()]:null};this.getSourceIconName=function(n){if(!n)return"qingWarning";switch(n){case A.SOURCE_TYPE_CURRENT_ENTITY_SOURCE:return"entity-source-icon";
case A.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE:return"datacenter-source-icon";case A.SOURCE_TYPE_MODEL_SET_SOURCE:return"modelset-source-icon";case A.SOURCE_TYPE_OPEN_API_SOURCE:return"openapi-source-icon";default:return n.toLowerCase()}};this.createSourceNameByType=function(n){var Ba;n===A.SOURCE_TYPE_CURRENT_ENTITY_SOURCE?Ba=Da.get("businessEntity","\u4e1a\u52a1\u5b9e\u4f53"):n===A.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE&&(Ba=Da.get("dataCenter","\u6570\u636e\u4e2d\u5fc3"));return Ba}}})();(function(){function ta(ca,Y){var Ma;this.store=function(){var oa=Da.ExprRefHelper.getRefTextInExpr(ca.getExpr());if(!Ma){Ma=[];for(var A=0;A<oa.length;A++)Ma.push(Y.getExprReference(oa[A]))}};this.restore=function(){if(Ma)for(var oa=0;oa<Ma.length;oa++)Y.addExprRefIfNotExist(Ma[oa])}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==
typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.metricdesigner&&(com.kingdee.bos.qing.modeler.designer.metricdesigner={});var Da=com.kingdee.bos.qing.modeler.designer.metricdesigner;Da.AddMetricAction=function(){Va.call(this);var ca,Y,Ma;this.setValue=function(oa,A){ca=oa;Y=A};this.getCaption=function(){return mb.get("createMetricCaption",
"\u65b0\u5efa\u6307\u6807\u201c#1\u201d").replace("#1",ca.getName())};this.perform=function(){var oa=Y.getModelerModel();Ma&&Ma.restore();oa.addMetric(ca)};this.unperform=function(){var oa=Y.getModelerModel();Ma||(Ma=new ta(ca,oa),Ma.store());oa.removeMetric(ca)}};Da.EditMetricAction=function(){Va.call(this);var ca,Y,Ma,oa,A;this.setValue=function(Q,Z,O){Y=Q.clone();ca=Z;Ma=O};this.getCaption=function(){return mb.get("editMetricCaption","\u7f16\u8f91\u6307\u6807\u201c#1\u201d").replace("#1",Y.getName())};
this.perform=function(){var Q=Ma.getModelerModel();oa||(oa=new ta(Y,Q),oa.store());A&&A.restore();Ma.getModelerModel().updateMetric(ca)};this.unperform=function(){var Q=Ma.getModelerModel();oa&&oa.restore();A||(A=new ta(ca,Q),A.store());Ma.getModelerModel().updateMetric(Y)}};Da.DeleteMetricAction=function(){Va.call(this);var ca,Y,Ma,oa;this.setValue=function(A,Q){Y=A;ca=Q};this.getCaption=function(){return mb.get("deleteMetricCaption","\u5220\u9664\u6307\u6807\u201c#1\u201d").replace("#1",Y.getName())};
this.perform=function(){var A=ca.getModelerModel();oa||(oa=new ta(Y,A),oa.store());Ma=A.removeMetric(Y)};this.unperform=function(){var A=ca.getModelerModel();oa&&oa.restore();A.addMetric(Y,Ma)}};Da.RemoveDimensionAction=function(){Va.call(this);var ca,Y,Ma,oa,A=-1,Q;this.setValue=function(Z,O){ca=Z;Ma=O.getModelerModel();Z=ca.getPublicDimensionId();oa=Ma.getPublicDimensionById(Z);Q=Da.MetricStateMonitor.getInvalidDimensionPrompt(ca.getDimensionId())};this.getCaption=function(){return"\u5220\u9664\u7ef4\u5ea6"};
this.perform=function(){Q&&Da.MetricStateMonitor.removeInvalidDimensionId(ca.getDimensionId());Y=Ma.removeDimension(ca);oa&&!Ma.checkDimensionRef(oa.getId(),!0)&&(A=Ma.removePublicDimensionById(oa.getId()))};this.unperform=function(){-1!==Y&&(Q&&Da.MetricStateMonitor.addInvalidDimensionId(ca.getDimensionId(),Q),-1!=A&&Ma.addPublicDimension(oa,A),Ma.addDimension(ca,Y))}};Da.UpdateDimensionAction=function(){Va.call(this);var ca,Y,Ma,oa;this.setValue=function(Q,Z,O){Ma=O.getModelerModel();ca=Z;Q=Ma.getAllDimension();
Z=ca.getDimensionId();for(O=0;O<Q.length;O++)if(Z==Q[O].getDimensionId()){oa=O;Y=Q[O].copy();break}};this.perform=function(){A(ca);Ma.updateDimension(ca,oa)};this.unperform=function(){A(Y);Ma.updateDimension(Y,oa)};var A=function(Q){var Z=Ma.getAllTable();Q.getDimensionType()==Xa.TYPE_NORMAL&&2<=Z.length&&(Z=Ma.getPublicDimensionById(Q.getPublicDimensionId()))&&(Z.setName(Q.getName()),Z.setNameModified(Q.isNameModified()))}};Da.BatchUpdateDimensionAction=function(){Va.call(this);var ca=[],Y=[],Ma=
[],oa=[],A,Q;this.setValue=function(Z,O,ia,Ha){A=Ha.getModelerModel();Ha=A.getAllDimension();for(Z=0;Z<Ha.length;Z++)Y.push(Ha[Z]);ca=O;O=A.getPublicDimensions();for(Z=0;Z<O.length;Z++)oa.push(O[Z]);Ma=ia;Q=Da.MetricStateMonitor.copyInvalidDimensionMap()};this.getCaption=function(){return"\u66f4\u65b0\u7ef4\u5ea6"};this.perform=function(){A.setPublicDimensions(Ma);Da.MetricStateMonitor.copyExistDimensionInvalidStatus(ca);A.updateDimensions(ca)};this.unperform=function(){Da.MetricStateMonitor.setInvalidDimensionMap(Q);
A.setPublicDimensions(oa);A.updateDimensions(Y)}};Da.UpdatePublicDimensionAction=function(){Va.call(this);var ca=[],Y=[],Ma,oa,A,Q=[];this.setValue=function(Z,O){Ma=O;O=O.getModelerModel();for(var ia=O.getPublicDimensions(),Ha=0;Ha<ia.length;Ha++)Y.push(ia[Ha]);ca=Z;oa=Da.MetricStateMonitor.copyInvalidDimensionMap();A=Da.MetricStateMonitor.copyInvalidPublicDimensionMap();Q=O.getAllDimension()};this.getCaption=function(){return mb.get("publicDimensionSetting","\u516c\u5171\u7ef4\u5ea6\u8bbe\u7f6e")};
this.perform=function(){var Z=Ma.getModelerModel();Z.setPublicDimensions(ca);Da.MetricStateMonitor.updateInvalidDimensionMap(Z);Da.MetricStateMonitor.setInvalidPublicDimensionMap({});for(var O=Z.getAllDimension(),ia=[],Ha=0;Ha<O.length;Ha++)ia.push(O[Ha].copy());Da.DimensionUtil.batchFixDimension(ia,Ma,Y,!1);Z.updateDimensions(ia)};this.unperform=function(){var Z=Ma.getModelerModel();Da.MetricStateMonitor.setInvalidDimensionMap(oa);Da.MetricStateMonitor.setInvalidPublicDimensionMap(A);Z.setPublicDimensions(Y);
Z.updateDimensions(Q)}};Da.DeleteTableAction=function(){Va.call(this);var ca,Y,Ma,oa,A=!1,Q,Z,O,ia,Ha,ba;this.setValue=function(n,Ba,I,P){Y=n;ca=Ba;Ma=I;ia=Da.TableNameHelper.getDisplayText(Y);n=Ba.getModelerModel();P&&(Q=P,O=n.getAllDimension(),Z=n.getPublicDimensions(),Ha=Da.MetricStateMonitor.copyInvalidDimensionMap(),ba=Da.MetricStateMonitor.copyInvalidPublicDimensionMap())};this.getCaption=function(){return mb.get("deleteDataTable","\u5220\u9664\u6570\u636e\u8868\u201c#1\u201d").replace("#1",
ia)};this.perform=function(){var n=ca.getModelerModel(),Ba=n.getAllTable();if(Z)if(1==Ba.length)n.setPublicDimensions([]),Da.MetricStateMonitor.setInvalidDimensionMap({}),Da.MetricStateMonitor.setInvalidPublicDimensionMap({}),n.updateDimensions([]);else{n.setPublicDimensions(Q);Da.MetricStateMonitor.updateInvalidDIMMapWhenDeleteTable(n);Da.MetricStateMonitor.updateInvalidPublicDimensionMap(n);for(var I=n.getAllDimension(),P=[],D=0;D<I.length;D++)P.push(I[D].copy());Da.DimensionUtil.batchFixDimension(P,
ca,Z,2==Ba.length);n.updateDimensions(P)}n=ca.getModelerModel();Da.TableNameHelper.removeTableName(Y);oa=n.removeTable(Y);n.isSourceUsed(Ma)||(n.removeSource(Ma),A=!0)};this.unperform=function(){var n=ca.getModelerModel();Q&&(n.setPublicDimensions(Z),Da.MetricStateMonitor.setInvalidDimensionMap(Ha),Da.MetricStateMonitor.setInvalidPublicDimensionMap(ba),n.updateDimensions(O));Da.TableNameHelper.addTableName(Y,ia);A&&(n.batchAddSource([Ma]),A=!1);n.insertTable(Y,oa)}};Da.BatchAddTableAction=function(){Va.call(this);
var ca,Y,Ma,oa,A,Q,Z,O;this.getCaption=function(){return oa};this.setValue=function(ia,Ha,ba,n){ca=ba.getModelerModel();ia&&(Y=ia);ia="";for(ba=0;ba<Ha.length;ba++)ia+=Da.TableNameHelper.getDisplayText(Ha[ba]),ba<Ha.length-1&&(ia+="\uff0c");oa=mb.get("addTable","\u6dfb\u52a0\u6570\u636e\u8868")+"\u201d"+ia+"\u201c";Ma=Ha;n&&(A=n,Q=ca.getPublicDimensions(),Z=Da.MetricStateMonitor.copyInvalidDimensionMap(),O=Da.MetricStateMonitor.copyInvalidPublicDimensionMap())};this.perform=function(){A&&(ca.setPublicDimensions(A),
Da.MetricStateMonitor.updateInvalidDimensionMap(ca),Da.MetricStateMonitor.setInvalidPublicDimensionMap({}));Y&&ca.batchAddSource([Y]);ca.batchAddTable(Ma)};this.unperform=function(){Q&&(ca.setPublicDimensions(Q),Da.MetricStateMonitor.setInvalidDimensionMap(Z),Da.MetricStateMonitor.setInvalidPublicDimensionMap(O));ca.batchRemoveTable(Ma);for(var ia=0;ia<Ma.length;ia++)Da.TableNameHelper.removeTableName(Ma[ia]);Y&&ca.removeSource(Y)}};Da.SelectFieldAction=function(){Va.call(this);var ca,Y,Ma,oa,A;this.getCaption=
function(){return Da.TableNameHelper.getDisplayText(ca)+mb.get("colon","\uff1a")+mb.get("selectField","\u9009\u62e9\u5b57\u6bb5")};this.setValue=function(Q,Z,O,ia,Ha){ca=Q;oa=Z;A=O;Ma=ia;Y=Ha};this.perform=function(){ca.setSelectedFields(A);Y&&ca.setTableName(Y)};this.unperform=function(){ca.setSelectedFields(oa);Ma&&ca.setTableName(Ma)}};Da.ChangeFilterAction=function(){Va.call(this);var ca,Y,Ma;this.setValue=function(oa,A,Q){ca=oa;Y=A;Ma=Q};this.getCaption=function(){return mb.get("filterCaption",
"\u8fc7\u6ee4\u6761\u4ef6\u201c#1\u201d").replace("#1",Da.TableNameHelper.getDisplayText(ca))};this.perform=function(){ca.setFilterItems(Ma)};this.unperform=function(){ca.setFilterItems(Y)}};Da.UpdateRelationsAction=function(){Va.call(this);var ca,Y,Ma;this.setValue=function(oa,A){ca=oa;Ma=A.getModelerModel();Y=Ma.getRelations()};this.getCaption=function(){return"\u66f4\u65b0\u5173\u7cfb"};this.perform=function(){Ma.setRelations(ca)};this.unperform=function(){Ma.setRelations(Y)}};Da.ChangeMetricFilterAction=
function(){var ca,Y,Ma;this.setValue=function(oa,A,Q){ca=oa;Y=A;Ma=Q};this.getCaption=function(){return mb.get("filterCaption","\u8fc7\u6ee4\u6761\u4ef6\u201c#1\u201d").replace("#1",ca.getName())};this.perform=function(){ca.setFilterItems(Ma)};this.unperform=function(){ca.setFilterItems(Y)}};var Va,mb,Xa;(function(){var ca=com.kingdee.bos.qing.modeler.designer;Va=ca.AbstractAction;ca=com.kingdee.bos.qing.framework.common;mb=ca.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer);
ca=com.kingdee.bos.qing.modeler.designer.metricdesigner;Xa=ca.Dimension})()})();(function(){function ta(){var ra=this,K,pa;this.setGlobal=function(y){pa=y;ba.MetricStateMonitor.registGlobal(y)};this.init=function(y){K&&K.removePropertyChangeCallback(na);K=y;K.addPropertyChangeCallback(na)};this.backgroundCheck=function(y){var S=new la(pa.getRemoteImpl(),function(T){var m=new I;m.fromJsonObject(T);ba.MetricStateMonitor.setModelValidity(m)});S.setShowBlocking(!1);S.checkModelerValid(y)};this.firstBackgroundCheck=function(y){var S=new la(pa.getRemoteImpl(),function(T){var m=new I;
m.fromJsonObject(T);ba.MetricStateMonitor.setModelValidity(m);za(m)});S.setShowBlocking(!1);S.checkModelerValid(y)};this.setGlobalCheckResult=function(y,S,T){var m=new I;m.fromJsonObject(y);if(m.isValid())S&&(y=n.createFeedbackDialog(),y.setMessage(Ba.get("tableModelerValid","\u5f53\u524d\u6570\u636e\u8868\u6a21\u578b\u6821\u9a8c\u901a\u8fc7")),y.setTitle(Ba.get("operatingTips","\u64cd\u4f5c\u63d0\u793a")),y.setOptionType(n.OPTION_OK),y.setButtonText(n.RETURN_OK,Ba.get("iSee","\u6211\u77e5\u9053\u4e86")),
y.showDialog());else{S=T?T:Ba.get("tableModelerInvalid","\u5f53\u524d\u6570\u636e\u8868\u6a21\u578b\u6821\u9a8c\u5931\u8d25\uff0c\u65e0\u6cd5\u90e8\u7f72\u6216\u9884\u89c8\u6570\u636e");y=n.createFeedbackDialog();y.setMsgImageType(n.MSG_WARNING);y.setTitle(Ba.get("operatingTips","\u64cd\u4f5c\u63d0\u793a"));y.setMessage(S);S=y.setDetail;T="";if(m.isModelEmpty())T=Ba.get("noModeler","\u5f53\u524d\u6a21\u578b\u672a\u5efa\u6a21");else{for(var r=m.getCases(),qa=new Da,k=[],d=0,b=r.length;d<b;d++){var a=
qa.getHandler(r[d],pa);a&&k.push(a.getDetail())}d=0;for(b=k.length;d<b;d++)T+=d+1+"\u3001"+k[d],d<b-1?(T+="\uff1b",T+="\r\n"):T+=Ba.get("period","\u3002")}S.call(y,T);y.setOptionType(n.OPTION_OK);y.setButtonText(n.RETURN_OK,Ba.get("iSee","\u6211\u77e5\u9053\u4e86"));y.showDialog()}ba.MetricStateMonitor.setModelValidity(m);za(m)};var za=function(y){y=y.getCases();for(var S=0;S<y.length;S++){var T=y[S];if(T.getInvalidTableMap){pa.getIntegration().setMapTableException(T.getInvalidTableMap());break}}(y=
ba.MetricStateMonitor.getFunUpdateTableArea())&&y()},na=function(y,S){if(y===Ea.KEY_ADD_METRIC||y===Ea.KEY_REMOVE_METRIC||y===Ea.KEY_UPDATE_METRIC||y===W.KEY_TABLE_SELECT_FIELD||y===W.KEY_TABLE_SET_FILTER||y===Ea.KEY_UPDATE_DIMENSION||y===Ea.KEY_ADD_DIMENSION||y===Ea.KEY_REMOVE_DIMENSION||y===Ea.KEY_BATCH_UPDATE_DIMENSION)y=pa.getModelerModel(),S=new D,S.setModelerModel(y),ra.backgroundCheck(S.toJsonObject())}}function Da(){this.getHandler=function(ra,K){switch(ra.getType()){case P.TYPE_NO_METRIC:var pa=
new mb;break;case P.TYPE_INVALID_FIELD_REF:pa=new Xa;break;case P.TYPE_INVALID_EXPR:pa=new Y;break;case P.TYPE_INVALID_FIELD_FILTER_REF:pa=new Q;break;case P.TYPE_INVALID_EXPR_DATA_TYPE:pa=new ca;break;case P.TYPE_INVALID_DIMENSION_REF:pa=new Z;break;case P.TYPE_INVALID_DIMENSION_TYPE:pa=new O;break;case P.TYPE_INVALID_PUBLIC_DIMENSION:pa=new ia;break;case P.TYPE_INCOMPLETE_MATERIALIZED_CONFIG:pa=new Ha;break;case P.TYPE_INVALID_DIMENSION_NOT_EXIST:pa=new Ma;break;case P.TYPE_INVALID_DIMENSION_GRANULARITY_NOT_MATCH:pa=
new oa;break;case P.TYPE_INVALID_DIMENSION_TYPE_NOT_MATCH:pa=new A}pa&&(pa.setCase(ra),pa.setGlobal(K));return pa}}function Va(){var ra,K;this.setCase=function(pa){ra=pa};this.setGlobal=function(pa){K=pa};this.getDetail=function(){throw Error("override me");};this.getPrompt=function(pa){throw Error("override me");};this.protectedMethod={getCase:function(){return ra},getGlobal:function(){return K},getDisplayNameString:function(pa){for(var za=K.getModelerModel(),na="",y=0;y<pa.length;y++){var S=za.getMetric(pa[y]).getName();
na+="\u201c"+S+"\u201d";y<pa.length-1&&(na+=Ba.get("comma","\u3001"))}return na}}}function mb(){Va.call(this);this.getDetail=function(){return Ba.get("noMetricPrompt","\u6a21\u578b\u4e2d\u672a\u521b\u5efa\u6307\u6807")};this.getPrompt=function(ra){return Ba.get("noMetricPrompt","\u6a21\u578b\u4e2d\u672a\u521b\u5efa\u6307\u6807")}}function Xa(){Va.call(this);var ra=this.protectedMethod;this.getDetail=function(){var K=ra.getCase().getMetricIds(),pa=Ba.get("invalidFieldRef","\u6307\u6807#1\u5f15\u7528\u7684\u5b57\u6bb5\u4e0d\u5b58\u5728");
K=ra.getDisplayNameString(K);return pa.replace("#1",K)};this.getPrompt=function(K){return Ba.get("invalidFieldRefPrompt","\u8868\u8fbe\u5f0f\u5f15\u7528\u7684\u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664")}}function ca(){Va.call(this);var ra=this.protectedMethod;this.getDetail=function(){var K=ra.getCase().getMetricIds(),pa=Ba.get("invalidExprDataType","\u6307\u6807#1\u5f15\u7528\u7684\u5b57\u6bb5\u6570\u636e\u7c7b\u578b\u4e0d\u5339\u914d");K=ra.getDisplayNameString(K);return pa.replace("#1",
K)};this.getPrompt=function(K){return Ba.get("invalidExprDataTypePrompt","\u8868\u8fbe\u5f0f\u5f15\u7528\u7684\u5b57\u6bb5\u6570\u636e\u7c7b\u578b\u4e0d\u5339\u914d")}}function Y(){Va.call(this);var ra=this.protectedMethod;this.getDetail=function(){var K=ra.getCase().getMetricIds(),pa=Ba.get("invalidExprMetric","\u6307\u6807#1\u7684\u8868\u8fbe\u5f0f\u4e0d\u6b63\u786e");K=ra.getDisplayNameString(K);return pa.replace("#1",K)};this.getPrompt=function(K){return(K=ra.getCase().getMetricPrompt(K))?K:Ba.get("invalidExprMetricPrompt",
"\u6307\u6807\u7684\u8868\u8fbe\u5f0f\u4e0d\u6b63\u786e")}}function Ma(){Va.call(this);var ra=this.protectedMethod;this.getDetail=function(){var K=ra.getCase().getMetricIds(),pa=Ba.get("invalidDimensionNotExist","\u6307\u6807#1\u4e2d\u7684\u8868\u8fbe\u5f0f\u5f15\u7528\u7684\u7ef4\u5ea6\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664");K=ra.getDisplayNameString(K);return pa.replace("#1",K)};this.getPrompt=function(K){return Ba.get("invalidDimensionNotExistPrompt","\u8868\u8fbe\u5f0f\u5f15\u7528\u7684\u7ef4\u5ea6\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664")}}
function oa(){Va.call(this);var ra=this.protectedMethod;this.getDetail=function(){var K=ra.getCase().getMetricIds(),pa=Ba.get("invalidDimensionGranularityNotMatch","\u6307\u6807#1\u4e2d\u7684\u8868\u8fbe\u5f0f\u5f15\u7528\u7684\u65e5\u671f\u7ef4\u7c92\u5ea6\u4e0d\u5339\u914d");K=ra.getDisplayNameString(K);return pa.replace("#1",K)};this.getPrompt=function(K){return Ba.get("invalidDimensionGranularityNotMatchPrompt","\u8868\u8fbe\u5f0f\u5f15\u7528\u7684\u65e5\u671f\u7ef4\u7c92\u5ea6\u4e0d\u5339\u914d")}}
function A(){Va.call(this);var ra=this.protectedMethod;this.getDetail=function(){var K=ra.getCase().getMetricIds(),pa=Ba.get("invalidDimensionTypeNotMatch","\u6307\u6807#1\u4e2d\u7684\u8868\u8fbe\u5f0f\u5f15\u7528\u7684\u7ef4\u5ea6\u7c7b\u578b\u4e0d\u5339\u914d");K=ra.getDisplayNameString(K);return pa.replace("#1",K)};this.getPrompt=function(K){return Ba.get("invalidDimensionTypeNotMatchPrompt","\u8868\u8fbe\u5f0f\u5f15\u7528\u7684\u7ef4\u5ea6\u7c7b\u578b\u4e0d\u5339\u914d")}}function Q(){Va.call(this);
var ra=this.protectedMethod;this.getDetail=function(){var K=ra.getCase().getMetricIds(),pa=Ba.get("invalidFieldFilterRef","\u6307\u6807#1\u8fc7\u6ee4\u6761\u4ef6\u8bbe\u7f6e\u4e0d\u5b8c\u6574");K=ra.getDisplayNameString(K);return pa.replace("#1",K)};this.getPrompt=function(K){return Ba.get("invalidFieldFilterRefPrompt","\u8fc7\u6ee4\u6761\u4ef6\u8bbe\u7f6e\u4e0d\u5b8c\u6574")}}function Z(){Va.call(this);var ra=this.protectedMethod;this.getDetail=function(){return Ba.get("someDimensionInvalid","\u5b58\u5728\u4e0d\u5408\u6cd5\u7684\u7ef4\u5ea6")};
this.getPrompt=function(){return 2<=ra.getGlobal().getModelerModel().getAllTable().length?Ba.get("dimensionInvalid","\u7ef4\u5ea6\u4e0d\u5408\u6cd5"):Ba.get("fieldNotFound","\u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664")}}function O(){Va.call(this);this.getDetail=function(){return Ba.get("someDimensionInvalid","\u5b58\u5728\u4e0d\u5408\u6cd5\u7684\u7ef4\u5ea6")};this.getPrompt=function(){return Ba.get("dimensionInvalid","\u7ef4\u5ea6\u4e0d\u5408\u6cd5")}}function ia(){Va.call(this);
this.getDetail=function(){return Ba.get("somePublicDimensionInvalid","\u516c\u5171\u7ef4\u5ea6\u8bbe\u7f6e\u4e0d\u5b8c\u6574")};this.getPrompt=function(){return""}}function Ha(){Va.call(this);this.getDetail=function(){return Ba.get("incompleteMaterializedConfig","\u7269\u5316\u5b58\u50a8\u8bbe\u7f6e\u4e0d\u5b8c\u6574")};this.getPrompt=function(){return""}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==
typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.metricdesigner&&(com.kingdee.bos.qing.modeler.designer.metricdesigner={});var ba=com.kingdee.bos.qing.modeler.designer.metricdesigner;ba.ModelerChecker=ta;var n,Ba,I,P,D,W,la,Ea;(function(){var ra=com.kingdee.bos.qing.ui.component;
n=ra.MessageDialog;ra=com.kingdee.bos.qing.framework.common;Ba=ra.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer);ra=com.kingdee.bos.qing.modeler.designer;la=ra.DesignerFacade;D=ra.QingModeler;W=ra.ModelerModel;I=ba.ModelerValidity;P=ba.MetricModelerInvalidityCase;Ea=ba.MetricModeler})();ba.MetricStateMonitor=new function(){var ra={},K={},pa={},za={},na=[],y=new Da,S,T,m;this.setFunUpdateTableArea=function(k){T=k};this.setFunUpdateSingleTable=function(k){m=k};this.getFunUpdateTableArea=
function(){return T};this.addStateChangeListener=function(k){na.push(k)};this.registGlobal=function(k){S=k};this.setModelValidity=function(k){ra={};K={};pa={};za={};k=k.getCases();for(var d=0;d<k.length;d++){var b=k[d];if(b.getMetricIds)for(var a=b.getMetricIds(),l=y.getHandler(b,null),c=0;c<a.length;c++){var e=a[c],g=l.getPrompt(e);K[e]=g}if(b.getDimensionIds)for(a=b.getDimensionIds(),l=y.getHandler(b,S),g=l.getPrompt(),c=0;c<a.length;c++)pa[a[c]]=g;if(b.getPublicDimensionIds)for(a=b.getPublicDimensionIds(),
l=y.getHandler(b,S),g=l.getPrompt(),c=0;c<a.length;c++)za[a[c]]=g;b.getInvalidTableMap&&(ra=b.getInvalidTableMap())}qa()};this.addInvalidMetric=function(k,d){K[k]=d;qa()};this.removeInvalidMetric=function(k){K[k]=null;qa()};this.addInvalidFilterTable=function(k,d){var b=k.getIntegration().getMapTableException();b||(b={});b[d.getUid()]||(r(k),m&&m(d))};this.removeInvalidFilterTable=function(k,d){var b=k.getIntegration().getMapTableException();b&&(b=b[d.getUid()])&&b.invalidityType==P.TYPE_INVALID_TABLE_FILTER&&
(r(k),m&&m(d))};this.getInvalidTableMap=function(){return ra};this.getInvalidPrompt=function(k){return K[k]};this.getInvalidMetricMap=function(){return K};this.setInvalidDimensionMap=function(k){pa=k};this.getInvalidDimensionMap=function(){return pa};this.setInvalidPublicDimensionMap=function(k){za=k};this.getInvalidPublicDimensionMap=function(){return za};this.removeInvalidDimensionId=function(k){delete pa[k]};this.addInvalidDimensionId=function(k,d){pa[k]=d};this.checkDimensionInvalid=function(k){return-1<
Object.keys(pa).indexOf(k)};this.getInvalidDimensionPrompt=function(k){return pa[k]};this.copyInvalidDimensionMap=function(){for(var k={},d=Object.keys(pa),b=0;b<d.length;b++){var a=d[b];k[a]=pa[a]}return k};this.copyInvalidPublicDimensionMap=function(){for(var k={},d=Object.keys(za),b=0;b<d.length;b++){var a=d[b];k[a]=za[a]}return k};this.copyExistDimensionInvalidStatus=function(k){for(var d={},b=[],a=0;a<k.length;a++)b.push(k[a].getDimensionId());k=Object.keys(pa);for(a=0;a<k.length;a++){var l=
k[a];-1!=b.indexOf(l)&&(d[l]=pa[l])}pa=d};this.updateInvalidDimensionMap=function(k){var d=k.getAllDimension();pa={};for(var b=0;b<d.length;b++){var a=d[b],l=a.getDimensionId(),c=k.getPublicDimensionById(a.getPublicDimensionId());c?ba.PublicDimensionUtil.isPdTypeInvalidWhenDateDimension(c,a)&&(pa[l]=Ba.get("dimensionInvalid","\u7ef4\u5ea6\u4e0d\u5408\u6cd5")):pa[l]=Ba.get("dimensionInvalid","\u7ef4\u5ea6\u4e0d\u5408\u6cd5")}};this.updateInvalidDIMMapWhenDeleteTable=function(k){var d=k.getAllDimension();
pa={};for(var b=k.getAllTable(),a=0;a<d.length;a++){var l=d[a],c=l.getDimensionId(),e=k.getPublicDimensionById(l.getPublicDimensionId());if(e){var g=e.getFieldByIndex(0);2!=b.length||g.isExist()?!(2<b.length)||e.isFieldsCompleted()&&e.isDataTypeConsistent()?ba.PublicDimensionUtil.isPdTypeInvalidWhenDateDimension(e,l)?pa[c]=Ba.get("dimensionInvalid","\u7ef4\u5ea6\u4e0d\u5408\u6cd5"):ba.PublicDimensionUtil.isPdTypeInvalidWhenNormalDimension(e,l)&&(pa[c]=Ba.get("dimensionInvalid","\u7ef4\u5ea6\u4e0d\u5408\u6cd5")):
pa[c]=Ba.get("dimensionInvalid","\u7ef4\u5ea6\u4e0d\u5408\u6cd5"):pa[c]=Ba.get("fieldNotFound","\u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664")}else pa[c]=2==b.length?Ba.get("fieldNotFound","\u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664"):Ba.get("dimensionInvalid","\u7ef4\u5ea6\u4e0d\u5408\u6cd5")}};this.updateInvalidPublicDimensionMap=function(k){za={};k=k.getPublicDimensions();for(var d=0;d<k.length;d++){var b=k[d];b.isFieldsCompleted()&&b.isDataTypeConsistent()||(za[b.getId()]=
"")}};this.clear=function(){K={};qa()};var r=function(k){var d=new ta;d.setGlobal(k);k=k.getModelerModel();var b=new D;b.setModelerModel(k);d.backgroundCheck(b.toJsonObject())},qa=function(){for(var k=0;k<na.length;k++)na[k](K)}}})();(function(){function ta(){var R=this,va,Ia,Sa,ka,ya,H;this.getJqUi=function(){va||(va=$("<div>"),va.addClass("modeler-designer-sourcearea-delete-btn"),W.backgroundWithHover(va,"menu"),va.on("click",Za),R.updateMenuState(Sa));return va};this.setStatus=function(w){Sa=w};this.setFilterListener=function(w){ka=w};this.setSelectFieldListener=function(w){ya=w};this.setDeleteItemListener=function(w){H=w};var ea=function(w){var da=new y,N=Ja(n.get("filter","\u8fc7\u6ee4"),ka,!0,null,w);w=Ja(n.get("selectField",
"\u9009\u62e9\u5b57\u6bb5"),ya,!0,null,w);var xa=Ja(n.get("delete","\u5220\u9664"),H,!1,"delete",!0);da.addItemModel(N);da.addItemModel(w);da.addSeperator();da.addItemModel(xa);return da};this.updateMenuState=function(w){w=ea(w);Ia=new na;Ia.setModel(w);Ia.setIconSetter(function(da,N){W.background(da,N)})};var Ja=function(w,da,N,xa,Ya){w=na.createActionMenuItem(w+(N?"...":""),da);w.setEnabled(Ya);xa&&w.setIconName(xa);return w},Za=function(){if(Ia.isShowing())Ia.hide();else{var w=va.outerHeight(),
da=$(document.body),N=[0,w];N=I.upwardCoordinate(va[0],N,da[0]);Ia.show(da,N[0],N[1],va,!0,[0,-w])}}}function Da(R,va){t.call(this);var Ia=this,Sa=this.protectedMethod,ka=R.getSelectedFields(),ya=R.getTableName(),H;this.showSelectFieldDialog=function(){(new d(va.getRemoteImpl(),function(w){var da=new e;da.fromJsonObject(w);ea(da)})).getMeta(ba.SourceUtil.getTableSource(va,R),R)};var ea=function(w){Ia.setSize(800,520);Ia.setPosition(window.innerWidth-800>>1,window.innerHeight-520>>1);Sa.setContentPaneCreator(function(){var N=
$("<div>");H=c.createSelectFieldToDialog(w.getSourceType());if(ka){for(var xa=[],Ya=0;Ya<ka.length;Ya++)xa.push(ka[Ya].getName());H.setSelectedPropertyName(xa)}H.setMeta(w);H.setCurrentTableName(ya);H.setWidth(800);H.getJqUi().appendTo(N);return N});var da=w.getSourceType()==k.SOURCE_TYPE_CURRENT_ENTITY_SOURCE?n.get("selectEntityAndField","\u9009\u62e9\u6570\u636e\u8868\u53ca\u5b57\u6bb5"):n.get("selectField","\u9009\u62e9\u5b57\u6bb5");Sa.setTitle(da);Sa.setClosingAction(Ja);Sa.setClosingChecker(Za);
Ia.showDialog()},Ja=function(w){if(w){w=H.getSelectedProperties();var da;H.getIsEntityView()&&(da=H.getSelectedEntityName());var N=new aa;N.setValue(R,ka,w,ya,da);va.getCommandManager().perform(N);G.occur(G.FUNCTION,G.SELECT_FIELD)}},Za=function(){var w=H.getSelectedEntityName();if(H.getIsEntityView()){if(!w)return Sa.getMessageCurtain().showPrompt(n.get("needSelectedEntity","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b9e\u4f53\u6216\u8005\u5206\u5f55\u8868\u3002")),!1;H.setCurrentTableName(w)}return(w=
H.getSelectedProperties())&&0==w.length?(Sa.getMessageCurtain().showPrompt(n.get("noSelectedField","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5b57\u6bb5\u3002")),!1):!0}}function Va(){Ea.AbstractWizardStep.call(this);var R=this,va,Ia,Sa,ka;this.getSubTitle=function(){return n.get("selectDataSource","\u9009\u62e9\u6570\u636e\u6e90")};this.setGlobal=function(H){ka=H};this.getJqUi=function(H){va||(Ia=H,va=$("<div>"),Sa=new la,Sa.setRemoteImpl(qa.getRemoteImpl()),Sa.setMultiSelect(!1),Sa.setContainer(va),
Sa.loadDataSource());return va};this.updateUi=function(){Sa&&Sa.updateUiByObserver()};this.intoThisStep=function(H,ea){ea&&Sa&&Sa.updateUiByObserver()};this.outThisStep=function(H,ea){if((H=Sa.getSelected())&&0!=H.length){var Ja=H[0];H=new (qa.getModelSetSourceFacade())(qa.getRemoteImpl(),function(Za){for(var w=!1,da=0;da<Za.length;da++)if(Za[da].id==Ja.getId()){w=!0;break}w?ya(ea,Ja):(w=n.get("sourceDeleted","\u201c#1\u201d\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u3002"),
w=w.replace("#1",Ja.getSourceName()),Ia.getMessageCurtain().showPrompt(w),Sa.rePaintSource(Za),ea(R))});H.setBlockingJqUi(va);H.designerLoadSources()}else Ia.getMessageCurtain().showPrompt(n.get("noSourceSelected","\u8bf7\u9009\u62e9\u53ef\u7528\u7684\u6570\u636e\u6e90\u3002")),ea(R)};var ya=function(H,ea){var Ja=n.get("sourceCanNotSelect","\u6570\u636e\u6e90\u8fde\u63a5\u5f02\u5e38\uff0c\u65e0\u6cd5\u9009\u62e9\u3002"),Za=new d(ka.getRemoteImpl(),function(w){w?H(ba.ImportTableStepCreator.getSteps(ea,
ka)):(Ia.getMessageCurtain().showPrompt(Ja),H(R))},function(w,da){"206"==w.toString().substr(0,3)?Ja=n.get("openAPINotSelect","OpenAPI\u7684\u8fde\u63a5\u4fe1\u606f\u65e0\u6548\uff0c\u65e0\u6cd5\u9009\u62e9\u3002"):-1!=da.indexOf("2030900")&&(Ja=n.get("xmlCanNotSelect","xml\u6587\u4ef6\u5904\u7406\u5931\u8d25\uff0c\u65e0\u6cd5\u9009\u62e9\u3002"));Ia.getMessageCurtain().showPrompt(Ja);H(R);return!0});Za.setBlockingJqUi(va);Za.checkConnection(ea.getId())}}function mb(){Ea.AbstractWizardStep.call(this);
var R;this.setSource=function(va){R=va};this.getSource=function(){return R}}function Xa(){function R(){function $a(zb){KTDefaultCellRender.call(this,zb);var Eb=this,Jb=this.paintCellUI;this.paintCellUI=function(Ab,Bb){var Lb=Eb.getCurrentRowIdx(),xb=Eb.getCurrentRow(),wb=Eb.getCurrentColIdx();xb=xb.getUserObject();if(Lb<r.getHeadRowCount())Jb(Ab,Bb),Ab&&(Ab=$(Ab).children(),Ab.css({"text-align":"left","padding-left":"8px","padding-right":"8px"}),Ab.children()&&Ab.children().css("right",""));else if(xb){Bb=
sb.getField(wb);Lb=Bb.getOutputDataType();wb=xb[wb];if(null==wb||void 0==wb)wb="";else if(Lb==v.DT_DATE)xb=new P,xb.setFormatString("yyyy-MM-dd"),wb=xb.format(wb);else if(Lb==v.DT_DATETIME)xb=new P,xb.setFormatString("yyyy-MM-dd HH:mm:ss"),wb=xb.format(wb);else if(Lb==v.DT_BOOLEAN)wb=wb?"true":"false";else if(Lb==v.DT_NUMBER&&(xb=Bb.getScale()))for(wb+="",Bb=wb.split("."),2>Bb.length?(wb+=".",Bb=""):Bb=Bb[1],xb-=Bb.length,Bb=0;Bb<xb;Bb++)wb+="0";xb=$("<div>");xb.text(wb);xb.attr("title",wb);xb.css({"padding-left":"8px",
"padding-right":"8px",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap","text-align":"left","line-height":"28px"});xb.appendTo(Ab)}else Jb(Ab,Bb),Ab&&(Ab=$(Ab).children())&&Ab.css({overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"})}}var gb=this,nb,hb,kb,sb,ub,Cb,Hb,Fb;this.getJqUi=function(){nb||Vb();return nb};this.updateTableUi=function(){r.refresh(kb)};this.updatePreviewTable=function(zb,Eb){var Jb=new Date;Hb=Jb;var Ab=rb(Ia.getSource()),Bb=pb(Ab),Lb=new d(N.getRemoteImpl(),
function(xb){var wb=new f;wb.fromJsonObject(xb);if(0==wb.getAllField().length)wb=n.get("tableNoData","\u8be5\u8868\u6ca1\u6709\u6570\u636e\uff0c\u65e0\u6cd5\u88ab\u9009\u4e2d\u3002"),Sa.getMessageCurtain().showPrompt(wb),H.showWaitingTips(wb),Ob(zb,Eb);else if(Hb==Jb){sb=wb;Fb&&Fb.hide();Cb&&Cb.show();ub.setOutsideVisible(!1);var Qb=r.createHeadRow(kb),Pb=wb.getAllField(),Rb=Math.min(Pb.length,50);for(xb=0;xb<Rb;xb++){var Sb=Pb[xb],Tb=Sb.getOutputDataType(),Wb=Tb==v.DT_INT||Tb==v.DT_NUMBER,Ub=kb.addColumn(Sb.getAlias());
Ub.setStyle(r.getColumnStyle(Wb));Ub.setWidth(Xb(Tb));Qb.getCell(xb).setValue(Sb.getAlias())}Qb=Math.min(wb.getRowCount(),10);for(xb=0;xb<Qb;xb++)Pb=r.createRow(kb),Rb=wb.getOneRow(xb),Pb.setUserObject(Rb);r.refresh(kb);ub.setOutsideVisible(!0);0==sb.getRowCount()?(wb=n.get("noPreviewData","\u6ca1\u6709\u6570\u636e"),Mb(wb,!1)):(wb=10<sb.getRowCount(),xb=50<=sb.getColumnCount(),wb||xb?!wb&&xb?(wb=n.get("totalRowsData","\u603b\u5171#1\u884c\u6570\u636e").replace("#1",sb.getRowCount()),wb+=n.get("previewTipsComma",
",")+n.get("dataShownCols","\u4ec5\u9884\u89c8\u524d#1\u5217\u6570\u636e").replace("#1",50),Mb(wb,!1)):(wb&&!xb?wb=n.get("dataShownRows","\u4ec5\u9884\u89c8\u524d#1\u884c\u6570\u636e").replace("#1",10):(wb=n.get("dataShownRowsAndCols","\u4ec5\u9884\u89c8\u524d#1\u884c\u3001\u524d#2\u5217\u6570\u636e"),wb=wb.replace("#1",10),wb=wb.replace("#2",50)),Yb(wb,Jb)):(wb=n.get("totalRowsData","\u603b\u5171#1\u884c\u6570\u636e").replace("#1",sb.getRowCount()),Mb(wb,!1)))}},function(xb){Cb&&Cb.hide();if(2030800==
xb)return Sa.getMessageCurtain().showError(n.get("fileEncodingSelectTips","\u7f16\u7801\u4e0d\u6b63\u786e\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u6587\u4ef6\u7f16\u7801\u3002")),!0});Lb.setShowBlocking(!1);Lb.getTablePreviewData(Ab,Bb,[],11);gb.showWaitingTips(n.get("loadingPreviewData","\u6b63\u5728\u83b7\u53d6\u9884\u89c8\u6570\u636e\uff0c\u8bf7\u7a0d\u5019\u2026\u2026"))};this.isEnablePreview=function(){return hb.isChecked()};this.showWaitingTips=function(zb){r.clear(kb);r.refresh(kb);Cb&&Cb.show();
Fb||(Fb=$("<div>"),Fb.css({position:"absolute",left:"0","padding-left":"20px","line-height":"30px","white-space":"pre-wrap",color:"#666",top:"10px"}),Fb.appendTo(Cb));Fb.text(zb);Fb.show()};var Mb=function(zb,Eb){Eb?(Eb=kb.getRowsCount()-1,kb.getRow(Eb).getCell(0).setValue(zb)):(Eb=r.createRow(kb),Eb.getCell(0).setValue(zb),zb=new KTStyle,zb.setBackgroundColor(com.kingdee.bos.qing.common.CommonTableSkin.ODD_ROW_BACKGROUND_COLOR),Eb.setStyle(zb),zb=new KTStyle,zb.setTextAlign("left"),Eb.getCell(0).setStyle(zb));
r.refresh(kb)},Yb=function(zb,Eb){var Jb=rb(Ia.getSource()),Ab=pb(Jb),Bb=new d(N.getRemoteImpl(),function(Lb){if(Eb==Hb)try{zb=n.get("totalRowsData","\u603b\u5171#1\u884c\u6570\u636e").replace("#1",Lb+"")+n.get("previewTipsComma",",")+zb,Mb(zb,!0)}catch(xb){r.refresh(kb)}});Bb.setShowBlocking(!1);Bb.getDataRowCount(Jb,Ab,[]);Mb(n.get("loadingTotalRows","\u6b63\u5728\u8ba1\u7b97\u603b\u884c\u6570\uff0c\u8bf7\u7a0d\u5019\u2026\u2026"),!1)},Xb=function(zb){switch(zb){case v.DT_INT:case v.DT_NUMBER:return 90;
case v.DT_DATE:return 80;case v.DT_DATETIME:return 130;case v.DT_BOOLEAN:return 40;default:return 120}},Vb=function(){nb=$("<div>");var zb=(new za(n.get("preview","\u9884\u89c8"))).getJqUi();zb.addClass("metric-designer-select-table-preview-label");hb=new pa;hb.setText(n.get("enablePreview","\u542f\u7528\u9884\u89c8"));hb.setChecked(!0);hb.addCheckedListener(function(Jb,Ab){var Bb=Jb.isChecked();Ab&&(Bb?jb(Jb,Ab):Cb&&Cb.hide())});var Eb=hb.getJqUi();Eb.addClass("metric-designer-select-table-preview-checkbox");
kb=r.createTable();kb.setColumnFitVisibleWidth(!1);kb.setSyncUIWhenModelChanged(!0);ub=new $a(kb);ub.setOutsideVisible(!1);kb.setCellRender(ub);Cb=$(kb.getUI());Cb.addClass("metric-designer-select-table-preview-table");zb.appendTo(nb);Eb.appendTo(nb);Cb.appendTo(nb)}}function va($a){KTDefaultCellRender.call(this,$a);var gb=this;this.paintCellUI=function(nb,hb){var kb=gb.getCell().getValue(),sb=kb.getDisplayName(),ub=$("<div>");ub.attr("title",sb);ub.addClass("metric-designer-table-item-container");
var Cb=$("<div>");Cb.addClass("metric-designer-table-item-text");nb=$(nb);if(kb instanceof b)Cb.text(sb),Cb.css("left","0px"),Cb.css("top","-2px"),ub.append(Cb),nb.css("left","4px"),nb.append(ub);else{var Hb=Na.isShowEntityMark()?kb.getName():kb.getNumber();Hb=sb+"("+Hb+")";Cb.text(ib?Hb:sb);Hb=ib?sb:Hb;Cb.data("mark",Hb);ub.css("margin-left","-16px");sb=Db(kb);ub.append(sb.getJqUi());Hb=$("<div>");Hb.addClass("metric-designer-table-item-icon");var Fb=kb.getType(),Mb="entity"==Fb?"entity-sub":"table";
kb==ja&&(Mb="entity"==Fb?"entity-sub":"table_selected");W.background(Hb,Mb);Fb=$("<div>");Fb.addClass("metric-designer-table-item");Fb.append(Hb);Fb.append(Cb);ub.append(Fb);ub.on("click",{jqTableItem:Fb,jqIcon:Hb,node:kb,checkBox:sb},Ib);ja==kb&&Fb.addClass("metric-designer-table-item-container_selected");nb.css("overflow","visible")}hb?(hb=$(hb),hb.css("overflow","visible"),ub.appendTo(hb)):ub.appendTo(nb)}}mb.call(this);var Ia=this,Sa,ka,ya,H,ea,Ja,Za,w,da,N,xa=[],Ya=[],La=[],db={},sa={},Na,Fa,
ja,Ca=!1,Ta=!1,ib=!1;this.setSourceUiModel=function($a){Na=$a};this.getSubTitle=function(){return Na.getTitle()};this.setGlobal=function($a){N=$a};this.getJqUi=function($a){if(!ka){ka=$("<div>");ea=$("<div>");Ua();ma();da=$("<div>");var gb=Na.isShowEntityMark()||Na.isShowModelNumber()?75:25;da.addClass("metric-designer-select-table-button-area");da.css("height",gb+"px");(Na.isShowEntityMark()||Na.isShowModelNumber())&&cb();eb();Ja.appendTo(ea);da.appendTo(ea);H=new R;w=H.getJqUi();w.css("border-left",
"1px solid #CBCBCB");fb();gb=new ra;gb.setHorizontalSplit(!0);gb.setEnabled(!0);gb.setFirstSize(200,185,300);gb.setSecondSize(520,0,-1);gb.setResizeMode(ra.RESIZE_MODE_SECOND_FIXED);gb.setFirstChild(ra.createChildWrapper(ea));gb.setSecondChild(ra.createChildWrapper(w));ka.append(gb.getJqUi());Sa=$a}return ka};this.intoThisStep=function($a,gb){gb&&H.updateTableUi()};this.outThisStep=function($a,gb){if($a)gb(null);else{var nb=Ia.getSelectedTableNode();if(0==nb.length)Sa.getMessageCurtain().showPrompt(n.get("needSelectedEntity",
"\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u6570\u636e\u8868\u3002"));else{var hb=N.getModelerModel(),kb=Ia.getSource().getId();for($a=0;$a<nb.length;$a++){var sb=nb[$a].getName();if(hb.isSameTableAndSourceExist(kb,sb)){var ub=ub?ub+"\uff0c":"";ub+=sb}}if(ub)gb=n.get("tableExist","\u8868#1\u5df2\u5b58\u5728\u3002").replace("#1",ub),Sa.getMessageCurtain().showPrompt(gb);else{for($a=0;$a<La.length;$a++)if(ub=La[$a].getUid(),!db[ub]||!sa[ub])return;gb(null)}}}};this.getSelectedTableNode=function(){return La};
this.getSelectedMeta=function(){for(var $a={},gb=0;gb<La.length;gb++){var nb=La[gb].getUid();$a[nb]=db[nb]}return $a};this.getSelectedNode=function(){for(var $a=[],gb=0;gb<La.length;gb++)$a=$a.concat(sa[La[gb].getUid()]);return $a};var fb=function(){var $a=new Ba;$a.setCallbackImmediately(function(){H.updateTableUi()});$a.observe()},Ua=function(){ya=new K;ya.setShowSearchIcon(!0);ya.setPlaceholder(Na.getPlaceHolder());ya.setSearchListenerDelay(1E3);ya.addSearchListener(function(){qb($.trim(ya.getText()))});
var $a=ya.getJqUi();$a.addClass("metric-designer-select-table-search-box");$a.find(":input").on("keydown",function(nb){13==(nb.keyCode||nb.which||nb.charCode)&&qb($.trim(ya.getText()))});var gb=Na.isShowAppUi()?5:0;$a.css("top",gb+"px");$a.appendTo(ea)},jb=function($a,gb){ja&&$a.isChecked()&&($a=new d(N.getRemoteImpl(),function(nb){var hb=new e;hb.fromJsonObject(nb);(nb=hb.getErrorMap())?(hb=Kb(nb.metricInvalidityType),Sa.getMessageCurtain().showPrompt(hb),H.showWaitingTips(hb)):(Gb(hb,ja),H.updatePreviewTable())},
function(nb){return 2030800==nb}),gb=new g,gb.setNamespace(ja.getCommentInfo()),gb.setTableName(ja.getName()),gb.setDisplayName(ja.getDisplayName()),$a.getMeta(rb(Ia.getSource()),gb))},pb=function($a){var gb=ja.getName(),nb=new g;nb.setSourceUid($a.getId());$a=u.getUID(u.NS_TABLE);nb.setTableName(gb);nb.setUid($a);nb.setDisplayName(ja.getDisplayName());ja.getCommentInfo()&&nb.setNamespace(ja.getCommentInfo());return nb},qb=function($a){if(0!=xa.length)if(""==$a)Ca&&(Ca=!1,Ta?($a=ob(lb()),tb($a),0==
$a.length&&Ra(n.get("noDataTips","\u6682\u65e0\u6570\u636e"))):tb(xa));else{Ca=!0;var gb=Ta?lb():Ya;$a=vb($a,gb);$a=ob($a);tb($a);0==$a.length&&Ra(n.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"))}},tb=function($a){Za&&Za.empty();Ga($a)},ma=function(){Ja=$("<div>");Za=$("<div>");var $a=Na.getTop(),gb=Na.getHeight();Za.css({position:"relative",top:$a+"px",height:gb+"px",overflow:"auto"});Za.appendTo(Ja);Na.isShowAppUi()?Qa():(new d(N.getRemoteImpl(),function(nb){Fa=
new b;Fa.fromJsonObject(nb);nb=Fa.getChildren();if(0===nb.length)Ra(n.get("noDataTable","\u6682\u65e0\u6570\u636e\u8868"));else{for(var hb=0;hb<nb.length;hb++)yb(nb[hb]);Ga(xa)}},function(nb,hb){if(hb&&-1!=hb.indexOf("2030900"))return Sa.getMessageCurtain().showError("xml\u6587\u4ef6\u5904\u7406\u5931\u8d25"),!0})).loadTables(rb(Ia.getSource()))},Qa=function(){var $a=new (qa.getMetricDataCenterSelector()),gb=$a.getJqUi();ea.prepend(gb);$a.setFunSelectedChangeListener(function(nb){(new d(N.getRemoteImpl(),
function(hb){Fa=new b;Fa.fromJsonObject(hb,nb);hb=Fa.getChildren();if(0===hb.length)Ra(n.get("noDataTable","\u6682\u65e0\u6570\u636e\u8868"));else{xa=[];for(var kb=0;kb<hb.length;kb++)yb(hb[kb]);Ga(xa)}})).getDBCenterTables(nb)})},Ga=function($a){if(0!=$a.length){var gb=new KTable,nb=$(gb.getUI());nb.children().css("overflow-x","hidden");gb.setCellRender(new va(gb));gb.setSyncUIWhenModelChanged(!1);gb.setLargeDataMode(!0,!1);gb.addColumn().setWidth(300);gb.addTreeExpandListener(function(){var hb=
gb.keepScrollStatus();hb.v&&(hb.v+=1);gb.restoreScrollStatus(hb)});ab(gb,$a);gb.updateUI();nb.appendTo(Za)}},ab=function($a,gb){for(var nb=0;nb<gb.length;nb++){var hb=gb[nb],kb=$a.addRow();kb.setHeight(23);var sb=kb.getCell(0);sb.setValue(hb);hb=hb.getSubNodeLevel();var ub=new KTCellTreeModel(hb);ub.setExpanded(Ca||Ta);!Ta&&!Ca&&0<hb&&kb.setHide(!0);sb.setTreeModel(ub)}},Ra=function($a){$a=new za($a);$a.setAlign(za.ALIGN_CENTER);$a=$a.getJqUi();$a.css({position:"absolute",top:"50%",left:"50%",width:"180px",
"margin-left":"-95px","margin-top":"-20px"});$a.children().eq(0).css("color","#999999");$a.appendTo(Za)},cb=function(){var $a=new za,gb=Na.isShowModelNumber()?n.get("displayModelNumber","\u663e\u793a\u6a21\u578b\u7f16\u7801"):n.get("displayEntityMark","\u663e\u793a\u5b9e\u4f53\u6807\u8bc6");$a.setText(gb);$a=$a.getJqUi();$a.attr("title",gb);I.layoutCtrlWithLRTB($a,8,null,105,10,null,23);$a.appendTo(da);gb=new T;gb.setOn(!1);gb.addStateChangeListener(function(nb,hb,kb){nb=(ib=kb)?Na.getCodePlaceHolder():
Na.getPlaceHolder();ya.setPlaceholder(nb);if(hb)for(hb=$(".metric-designer-table-item-text"),nb=0;nb<hb.length;nb++)if(kb=hb.eq(nb),kb.data("mark")){var sb=kb.data("mark"),ub=kb.text();kb.text(sb);kb.parents(".metric-designer-table-item").attr("title",sb);kb.data("mark",ub)}});gb=gb.getJqUi();I.layoutCtrlWithLRTB(gb,120,null,35,10,null,23);gb.appendTo(da)},eb=function(){var $a=new za,gb=n.get("showOnlyChecked","\u4ec5\u663e\u793a\u9009\u4e2d\u9879");$a.setText(gb);$a=$a.getJqUi();$a.attr("title",
gb);gb=new T;gb.setOn(!1);gb.addStateChangeListener(function(hb,kb,sb){Ta=sb;kb&&0!=xa.length&&(Ta||Ca?(hb=Ya,Ta&&(hb=lb()),Ca&&(hb=vb(ya.getText(),hb)),hb=ob(hb),tb(hb),0==hb.length&&Ra(n.get("noDataTips","\u6682\u65e0\u6570\u636e"))):(hb=xa,tb(hb)))});gb=gb.getJqUi();var nb=Na.isShowEntityMark()||Na.isShowModelNumber()?40:2;I.layoutCtrlWithLRTB($a,8,null,105,nb,null,23);I.layoutCtrlWithLRTB(gb,120,null,35,nb,null,23);$a.appendTo(da);gb.appendTo(da)},ob=function($a){for(var gb=[],nb=[],hb=0;hb<$a.length;hb++){for(var kb=
[],sb=$a[hb],ub=sb;ub;){ub=ub.getParentNode();if(ub==Fa)break;-1==gb.indexOf(ub)&&(kb.unshift(ub),gb.push(ub))}kb.push(sb);nb=0==hb?kb:nb.concat(kb)}return nb},vb=function($a,gb){$a=$a.toLowerCase();for(var nb=[],hb=0;hb<gb.length;hb++){var kb=gb[hb];ib?(-1!=(Na.isShowEntityMark()?kb.getName():kb.getNumber()).toLowerCase().indexOf($a)||-1!=kb.getDisplayName().toLowerCase().indexOf($a))&&nb.push(kb):-1!=kb.getDisplayName().toLowerCase().indexOf($a)&&nb.push(kb)}return nb},lb=function(){return 0==La.length?
[]:Ya.filter(function($a){return-1!=La.indexOf($a)})},rb=function($a){var gb=new l;gb.setName($a.getSourceName());gb.setSourceType($a.getSourceType());gb.setSourceId($a.getId());gb.setModelId(qa.getModelId());return gb},yb=function($a){xa.push($a);if($a instanceof a)Ya.push($a);else if($a=$a.getChildren())for(var gb=0;gb<$a.length;gb++)yb($a[gb])},Db=function($a){var gb=new pa;gb.setUserObject($a);for(var nb=0;nb<La.length;nb++)if(La[nb]==$a){gb.setChecked(!0);break}gb.addCheckedListener(function(hb,
kb){if(kb)if(hb.isChecked())La.push($a);else for(hb=0;hb<La.length;hb++)if(La[hb]==$a){La.splice(hb,1);break}});gb.getJqUi().addClass("metric-designer-table-item-checkbox");return gb},Ib=function($a){var gb=$a.data.node,nb=Za.find(".metric-designer-table-item-container_selected");nb.removeClass("metric-designer-table-item-container_selected");"entity"!=gb.getType()&&(nb=nb.children().eq(0),W.background(nb,"table"),W.background($a.data.jqIcon,"table_selected"));$a.data.jqTableItem.addClass("metric-designer-table-item-container_selected");
if(ja!=gb){ja=gb;nb=new d(N.getRemoteImpl(),function(kb){var sb=$a.data.checkBox,ub=new e;ub.fromJsonObject(kb);(kb=ub.getErrorMap())?(Ob(sb,gb),sb=Kb(kb.metricInvalidityType),Sa.getMessageCurtain().showPrompt(sb),H.showWaitingTips(sb)):(H.isEnablePreview()&&H.updatePreviewTable(sb,gb),Gb(ub,gb))},function(kb){return 2030800==kb});var hb=new g;hb.setNamespace(gb.getCommentInfo());hb.setTableName(gb.getName());hb.setDisplayName(gb.getDisplayName());nb.getMeta(rb(Ia.getSource()),hb)}},Gb=function($a,
gb){var nb=(new Date).getTime();gb.setUid(nb);db[nb]=$a;gb=gb.getCommentInfo();var hb=$a.getTableNode();$a=[];if(hb){var kb=new b;kb.fromJsonObject(hb);kb.setCommentInfo(gb);kb.setUid(nb);kb.getName()&&$a.push(kb);hb=kb.getChildren();if(0<hb.length)for(kb=0;kb<hb.length;kb++)hb[kb].setUid(nb),hb[kb].setCommentInfo(gb),Nb(hb[kb],$a)}0<$a.length&&(sa[nb]=$a)},Ob=function($a,gb){$a.setChecked(!1);$a.setEnabled(!1);for($a=0;$a<La.length;$a++)if(La[$a]==gb){La.splice($a,1);break}},Kb=function($a){if(!$a)return n.get("tableNoSelect",
"\u8be5\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u88ab\u9009\u4e2d\u3002");switch($a){case X.TYPE_MODEL_CYCLE_REFERENCE:return n.get("modelCycleNoSelect","\u8be5\u6a21\u578b\u5b58\u5728\u5faa\u73af\u5f15\u7528\uff0c\u65e0\u6cd5\u88ab\u9009\u4e2d\u3002");default:return n.get("modelNoSelect","\u8be5\u6a21\u578b\u5df2\u635f\u574f\uff0c\u65e0\u6cd5\u88ab\u9009\u4e2d\u3002")}},Nb=function($a,gb){gb.push($a);if($a instanceof b&&($a=$a.getChildren()))for(var nb=0;nb<$a.length;nb++)Nb($a[nb],
gb)}}function ca(){Ea.AbstractWizardStep.call(this);var R,va,Ia,Sa,ka,ya,H=[],ea,Ja,Za,w,da;this.getSubTitle=function(){return n.get("selectField","\u9009\u62e9\u5b57\u6bb5")};this.setGlobal=function(sa){va=sa};this.getJqUi=function(sa){Ia||(R=sa,Ia=$("<div>"),ea=$("<div>"),sa=(new za(n.get("selected","\u5df2\u9009"))).getJqUi(),sa.addClass("metric-designer-select-field-label"),ea.append(sa),Ja=$("<div>"),Ja.addClass("metric-designer-select-field-table-area"),Ja.appendTo(ea),Za=$("<div>"),Za.css("border-left",
"1px solid #CBCBCB"),sa=new ra,sa.setHorizontalSplit(!0),sa.setEnabled(!0),sa.setFirstSize(200,185,300),sa.setSecondSize(520,-1,530),sa.setResizeMode(ra.RESIZE_MODE_SECOND_FIXED),sa.setFirstChild(ra.createChildWrapper(ea)),sa.setSecondChild(ra.createChildWrapper(Za)),sa.getJqUi().appendTo(Ia),N());return Ia};this.intoThisStep=function(sa,Na){Sa=sa.getSource();da=sa.getSelectedMeta();ka=sa.getSelectedNode();N()};this.outThisStep=function(sa,Na){if(!sa)if(Sa.getSourceType()==k.SOURCE_TYPE_CURRENT_ENTITY_SOURCE){for(sa=
0;sa<ya.length;sa++){var Fa=ya[sa];Fa.getCheckBox().isChecked()&&!w[Fa.getIdx()]&&db(Fa)}a:{for(sa=0;sa<H.length;sa++)if(H[sa].isChecked()){sa=!0;break a}sa=!1}if(!sa){R.getMessageCurtain().showPrompt(n.get("needSelectedEntity","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u6570\u636e\u8868\u3002"));return}a:{for(sa=0;sa<H.length;sa++)if(Fa=H[sa],Fa.isChecked()&&(Fa=Fa.getSelectedField(w))&&0==Fa.length){sa=!1;break a}sa=!0}if(!sa){R.getMessageCurtain().showPrompt(n.get("ensureHasSelectedField","\u8bf7\u786e\u4fdd\u6bcf\u4e2a\u6570\u636e\u8868\u90fd\u6709\u9009\u4e2d\u5b57\u6bb5\u3002"));
return}}else{for(sa=0;sa<ya.length;sa++)Fa=ya[sa],w[Fa.getIdx()]||(Fa=db(Fa),Fa.appendTo(Za),Fa.hide());Fa=Object.keys(w);for(sa=0;sa<Fa.length;sa++){var ja=w[Fa[sa]].getSelectedProperties();if(ja&&0==ja.length){R.getMessageCurtain().showPrompt(n.get("ensureHasSelectedField","\u8bf7\u786e\u4fdd\u6bcf\u4e2a\u6570\u636e\u8868\u90fd\u6709\u9009\u4e2d\u5b57\u6bb5\u3002"));return}}}Na(null)};this.isLastStep=function(){return!0};this.over=function(sa){if(sa){sa=va.getModelerModel();for(var Na=sa.getAllSource(),
Fa,ja=0;ja<Na.length;ja++){var Ca=Na[ja];if(Ca.getSourceId()==Sa.getId()){Fa=Ca;break}}if(!Fa){Fa=new l;Fa.setId(u.getUID(u.NS_SOURCE));Fa.setSourceId(Sa.getId());Fa.setName(Sa.getSourceName());var Ta=Fa}Na=Sa.getSpecificType()?Sa.getSpecificType():Sa.getSourceType();(ja=va.getIntegration().getMapSourceType())||(ja={});ja[Sa.getId()]=Na;va.getIntegration().setMapSourceType(ja);var ib=xa(Fa);0!=ib.length&&(0==sa.getAllTable().length&&1==ib.length?(Fa=new Oa,Fa.setValue(Ta,ib,va),va.getCommandManager().perform(Fa)):
ba.PublicDimensionUtil.addTablesToPublicDimensions(Ta,ib,va,Ia,function(fb){var Ua=new Oa;Ua.setValue(Ta,ib,va,fb);va.getCommandManager().perform(Ua)}))}};var N=function(){if(Ia&&(ya=[],w={},ka&&Sa))if(Ja.empty(),Za.empty(),Sa.getSourceType()==k.SOURCE_TYPE_CURRENT_ENTITY_SOURCE){var sa=new A;H.push(sa);for(var Na=0;Na<ka.length;Na++){var Fa=ka[Na],ja=Fa.getSubNodeLevel(),Ca=new oa(Na,ja);0==ja&&0!=Na&&(sa=new A,H.push(sa));sa.pushEntityItem(Ca);Ca.setCheckCallback(sa.getCheckListener());Ya(Ca,Fa);
0==Na&&Ca.setSelected(!0)}}else{for(sa=0;sa<ka.length;sa++)Na=ka[sa],Fa=new Ma(sa),Ya(Fa,Na);ya[0].setSelected(!0)}},xa=function(sa){var Na=va.getModelerModel().getAllTable(),Fa=[];if(Sa.getSourceType()==k.SOURCE_TYPE_CURRENT_ENTITY_SOURCE)for(var ja=0;ja<H.length;ja++){var Ca=H[ja];if(Ca.isChecked()){var Ta=Fa,ib=Ta.push,fb=sa,Ua=new g;Ua.setSourceUid(fb.getId());fb=u.getUID(u.NS_TABLE);Ua.setSelectedFields(Ca.getSelectedField(w));Ua.setTableName(Ca.getTableName());Ua.setUid(fb);Ua.setDisplayName(Ca.getDisplayName());
Ua.setNamespace(Ca.getCommentInfo());ib.call(Ta,Ua)}}else for(ja=0;ja<ya.length;ja++)ib=ya[ja],fb=sa,Ca=ib.getTableNode(),Ua=Ca.getName(),Ta=new g,Ta.setSourceUid(fb.getId()),fb=u.getUID(u.NS_TABLE),Ta.setTableName(Ua),Ta.setUid(fb),Ta.setDisplayName(Ca.getDisplayName()),Ca.getCommentInfo()&&Ta.setNamespace(Ca.getCommentInfo()),Ca=w[ib.getIdx()],Ca||(db(ib),Ca=w[ib.getIdx()]),ib=Ca.getSelectedProperties(),Ta.setSelectedFields(ib),Fa.push(Ta);sa=[];for(ja=0;ja<Fa.length;ja++){Ta=Fa[ja];a:{ib=Na;Ca=
Ta;for(Ua=0;Ua<ib.length;Ua++)if(Ca.isSame(ib[Ua])){ib=!0;break a}ib=!1}ib||sa.push(Ta)}return sa},Ya=function(sa,Na){sa.setTableNode(Na);sa.getJqUi().appendTo(Ja);sa.setSelectedCallback(La);ya.push(sa)},La=function(sa){if(sa.isSelected()){for(var Na=0;Na<ya.length;Na++){var Fa=ya[Na];Fa!=sa&&Fa.setSelected(!1)}Na=sa.getIdx();Fa=Object.keys(w);for(var ja=0;ja<Fa.length;ja++)w[Fa[ja]].getJqUi().hide();(Na=w[Na])?Na.getJqUi().show():db(sa).appendTo(Za)}},db=function(sa){var Na=sa.getTableNode(),Fa=
Na.getName(),ja=Na.getUid(),Ca=new p;if(0<Na.getSubNodeLevel()){for(var Ta=Na;0!=Ta.getSubNodeLevel();)Ta=Ta.getParentNode();Ta=Ta.getUid();Ca.setMeta(da[Ta])}else Ca.setMeta(da[ja]);Ca.setCurrentTableName(Fa);Na=Ca.getJqUi();Ta&&(Ta=da[Ta].getPropertyMap()[Fa],Ca.setArrProperties(Ta,Fa));w[sa.getIdx()]=Ca;return Na}}function Y(){var R=this,va,Ia,Sa,ka,ya,H,ea="table",Ja="table_selected";this.setTableNode=function(w){Sa=w};this.setSelected=function(w){ka=w;ya&&ya(R);w?(va.addClass("metric-designer-select-field-table-item_selected"),
W.background(Ia,Ja)):(va.removeClass("metric-designer-select-field-table-item_selected"),W.background(Ia,ea))};this.isSelected=function(){return ka};this.getTableNode=function(){return Sa};this.setSelectedCallback=function(w){ya=w};this.getIdx=function(){return H};var Za=function(w,da){H=w;va=$("<div>");va.on("click",function(){ka||R.setSelected(!0)});var N=Sa.getDisplayName();va.addClass("metric-designer-select-field-table-item");w&&va.css("top",26*w+"px");va.attr("title",N);Ia=$("<div>");Ia.addClass("metric-designer-select-field-table-icon");
void 0!=da&&(ea=0<da?"entity-entry":"entity-sub",va.css("margin-left",20*da+25+"px"),Ja=ea);W.background(Ia,ea);w=$("<div>");w.addClass("metric-designer-select-field-table-name");w.text(N);Ia.appendTo(va);w.appendTo(va)};this.protectedMethod={getJqUi:function(w,da){va||Za(w,da);return va}}}function Ma(R){Y.call(this);var va=this.protectedMethod;this.getJqUi=function(){return va.getJqUi(R)}}function oa(R,va){Y.call(this);var Ia=this,Sa=this.protectedMethod,ka,ya,H,ea;this.getJqUi=function(){ka||Ja();
return ka};this.getIdx=function(){return ea};this.getCheckBox=function(){return ya};this.setCheckCallback=function(Za){H=Za};var Ja=function(){ea=R;ka=$("<div>");ka.addClass("metric-designer-select-field-table-item-container");ka.css("top",26*R+"px");ya=new pa;ya.setUserObject(Ia.getTableNode());ya.addCheckedListener(function(da,N){N&&H(Ia)});var Za=ya.getJqUi();Za.addClass("metric-designer-select-field-table-check-box");Za.css("margin-left",20*va+"px");var w=!1;0==va?w=!0:1<va&&ya.setEnabled(!1);
ya.setChecked(w);w=Sa.getJqUi(null,va);Za.appendTo(ka);w.appendTo(ka)}}function A(){var R=[],va="",Ia=function(ea){var Ja=ea.getTableNode(),Za=ea.getCheckBox().isChecked(),w=Ja.getParentNode();ea={};ka(Ja,ea);var da={};ya(Ja,da);var N=!1;for(Ya in da){var xa=Sa(da[Ya]);if(xa&&xa.isChecked()){N=!0;break}}var Ya=N;if(Za){Za=!1;for(La in ea)if((N=Sa(ea[La]))&&N.isChecked()){Za=!0;break}var La=Za;Za=H(Ja);w&&0!=w.getSubNodeLevel()&&(N=Sa(w))&&N.setEnabled(!0);for(N=0;N<R.length;N++){xa=R[N].getTableNode().getName();
var db=R[N].getCheckBox();Ja.getName()==xa||w&&xa==w.getName()||La&&ea[xa]||Ya&&da[xa]||(Za[xa]?db.setEnabled(!0):db.setEnabled(!1))}}else for(w=H(w),N=0;N<R.length;N++)xa=R[N].getTableNode().getName(),db=R[N].getCheckBox(),Ja.getName()==xa||Ya&&da[xa]||(w[xa]?db.setEnabled(!0):(ea[xa]&&db.isChecked()&&db.setChecked(!1),db.setEnabled(!Ya)))};this.isChecked=function(){for(var ea=0;ea<R.length;ea++)if(R[ea].getCheckBox().isChecked())return!0;return!1};this.getCheckListener=function(){return Ia};this.getSelectedField=
function(ea){for(var Ja={},Za=[],w=!0,da=0;da<R.length;da++){var N=R[da];if(N.getCheckBox().isChecked()){var xa=ea[N.getIdx()];N=N.getTableNode().getName();xa=xa.getTableFieldMap()[N];for(var Ya=0;Ya<xa.length;Ya++){var La=xa[Ya],db=La.getField();Ja[db.getFullName()]||(La.getSelected()?(Za.push(db),Ja[db.getFullName()]=!0):w=!1)}va=0==va.length?N:va+(com.kingdee.bos.qing.modeler.designer.ENTITY_SEPARATOR+N)}}return w?null:Za};this.getTableName=function(){return va};this.getDisplayName=function(){return R[0].getTableNode().getDisplayName()};
this.getCommentInfo=function(){return R[0].getTableNode().getCommentInfo()};this.pushEntityItem=function(ea){R.push(ea)};var Sa=function(ea){for(var Ja=0;Ja<R.length;Ja++)if(R[Ja].getTableNode()==ea)return R[Ja].getCheckBox()},ka=function(ea,Ja){if((ea=ea.getChildren())&&0<ea.length)for(var Za=0;Za<ea.length;Za++){var w=ea[Za];Ja[w.getName()]=w;ka(w,Ja)}},ya=function(ea,Ja){if(ea=ea.getParentNode())Ja[ea.getName()]=ea,ya(ea,Ja)},H=function(ea){var Ja={};if(!ea)return Ja;if(ea=ea.getChildren())for(var Za=
0;Za<ea.length;Za++){var w=ea[Za];Ja[w.getName()]=w}return Ja}}function Q(R,va){t.call(this);var Ia=this.protectedMethod,Sa=this,ka;(function(){Sa.setSize(800,600);Ia.setTitle(n.get("filter","\u8fc7\u6ee4"));Ia.setSelectable(!0);Ia.getDialogCtrl().setMinSize(800,600);Ia.getDialogCtrl().setFullScreenEnabled();Ia.getDialogCtrl().setResizeEnabled();Ia.getDialogCtrl().addResizeListener(function(){ka.resize()});Ia.setContentPaneCreator(function(){ka=new Z;ka.setGlobal(R);ka.setSourceTable(va);return ka.getJqUi()});
Ia.setClosingAction(function(ya){});Ia.setClosingChecker(function(){var ya=ka.checkFilterConditionValid();if(ya)return Ia.getMessageCurtain().showPrompt(ya),!1;ya=ka.getFilterItems();var H=va.getFilterItems()?va.clone().getFilterItems():[],ea;a:if(H&&ya&&H.length===ya.length){for(ea=0;ea<H.length;ea++)if(!H[ea].equals(ya[ea])){ea=!1;break a}ea=!0}else ea=!1;ea||(ea=new V,ea.setValue(va,H,ya),R.getCommandManager().perform(ea));va.setFilterItems(ya);G.occur(G.FUNCTION,G.SOURCE_TABLE_FILTER);Ia.destroy();
return!0})})()}function Z(){var R=this,va,Ia,Sa,ka,ya,H,ea;this.getJqUi=function(){Ia||Ya();return Ia};this.setGlobal=function(sa){va=sa};this.setSourceTable=function(sa){H=sa};this.checkFilterConditionValid=function(){return ya.checkFilterValid()};this.resize=function(){ka.afterResize();ya.afterResize()};this.getFilterItems=function(){return ya.getFilterItems()};this.updateFilterPanel=function(sa){Za(function(Na){ka.hidePreviewPrompt();var Fa=[];Na=Na[H.getUid()];for(var ja=0;ja<Na.length;ja++){var Ca=
new v;Ca.fromJsonObject(Na[ja]);Fa.push(Ca)}if(Na=H.getSelectedFields()){ja=[];for(Ca=0;Ca<Na.length;Ca++)for(var Ta=Na[Ca],ib=0;ib<Fa.length;ib++){var fb=Fa[ib];Ta.getName()===fb.getName()&&ja.push(fb)}Na=ja}else Na=Fa;ja=Na;for(Ca=0;Ca<sa.length;Ca++)if(Ta=ja,ib=sa[Ca],!ib.isEmpty())for(fb=0;fb<Ta.length;fb++){var Ua=Ta[fb];if(ib.getField().getName()===Ua.getName()){ib.setField(Ua);break}}ya.setFilterItems(sa);ya.setFields(Na);ya.updateUi();a:{if(Na=H.getSelectedFields())for(ja=0;ja<sa.length;ja++){Ta=
sa[ja];if(Ca=!Ta.isEmpty()){b:{Ca=Na;Ta=Ta.getField();for(ib=0;ib<Ca.length;ib++)if(Ta.getName()===Ca[ib].getName()){Ca=!0;break b}Ca=!1}Ca=!Ca}if(Ca){Na=!1;break a}}Na=!0}if(Na)a:{for(Na=0;Na<sa.length;Na++){Ca=sa[Na];if(ja=!Ca.isEmpty()){b:{ja=Fa;Ca=Ca.getField();for(Ta=0;Ta<ja.length;Ta++)if(Ca.getName()===ja[Ta].getName()){ja=!0;break b}ja=!1}ja=!ja}if(ja){Na=!1;break a}}Na=!0}Na?(Fa=ya.checkFilterValid())?ka.showPreviewPrompt(Fa):Ja(sa):(Fa=ya.checkFilterValid(),ka.showPreviewPrompt(Fa))},function(Na,
Fa){ka.showErrorTips(n.get("tableNotExist","\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002"));ya.setFilterItems(sa);ya.updateUi();ya.checkFilterValid()})};var Ja=function(sa){w(sa,function(Na){ka.hidePreviewPrompt();var Fa=new f;Fa.fromJsonObject(Na);ka.setPreviewData(Fa);ka.setFilterItems(sa);ka.updateUi()})},Za=function(sa,Na){var Fa=ba.SourceUtil.getTableSource(va,H),ja=new d(va.getRemoteImpl(),function(Ca){sa&&sa(Ca);ka.showWaitingTips()},function(Ca,Ta){Na&&Na(Ca,Ta);return!0});
ja.setShowBlocking(!1);ja.getTableField([Fa],[H])},w=function(sa,Na,Fa){var ja=va.getModelerModel().getSource(H.getSourceUid()),Ca=new d(va.getRemoteImpl(),function(Ta){Na&&Na(Ta)},function(){Fa&&Fa();return!0});Ca.setShowBlocking(!1);Ca.getTablePreviewData(ja,H,N(sa),11);da();ka.showWaitingTips()},da=function(){var sa=ka.getKTable();r.clear(sa);r.refresh(sa)},N=function(sa){if(!sa||0===sa.length)return null;for(var Na=[],Fa=0;Fa<sa.length;Fa++)sa[Fa].isEmpty()||Na.push(sa[Fa].toJsonObject());return Na},
xa=function(){db();var sa=R.getFilterItems();w(sa,function(Na){ka.hidePreviewPrompt();var Fa=new f;Fa.fromJsonObject(Na);ka.setPreviewData(Fa);ka.setFilterItems(sa);ka.updateUi()},function(Na,Fa){ka.hidePreviewPrompt();ka.showErrorTips(n.get("tableNotExist","\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002"))})},Ya=function(){Ia=$("<div>");Ia.addClass("metric-data-filter-panel");ka=new O;ka.setGlobal(va);ka.setSourceTable(H);var sa=ka.getJqUi(),Na=H.getFilterItems()?H.clone().getFilterItems():
[];ya=new ia;ya.setPreviewRefreshRequestListener(La);var Fa=ya.getJqUi();R.updateFilterPanel(Na);Sa=new ra;Sa.setHorizontalSplit(!1);Sa.setFirstSize(225,150,300);Sa.setSecondSize(250,150,300);Sa.setFirstChild(ra.createChildWrapper(sa,function(){ka.afterResize()}));Sa.setSecondChild(ra.createChildWrapper(Fa,function(){ya.afterResize()}));Ia.append(Sa.getJqUi())},La=function(){db();ea=$("<div>");ea.addClass("metric-data-filter-preview-mask");ea.on("click",function(Na){Ka&&xa()});var sa=ka.getJqUi().parent();
ea.appendTo(sa);sa=$("<div>");sa.text(n.get("refreshPreviewData","\u7f16\u8f91\u5b8c\u6210\u540e\uff0c\u70b9\u51fb\u6b64\u5904\u5237\u65b0\u9884\u89c8\u6570\u636e\u3002"));sa.addClass("metric-data-filter-mask-text");sa.appendTo(ea)},db=function(){R.getJqUi().find(".metric-data-filter-preview-mask").remove()}}function O(){var R=this,va,Ia,Sa,ka,ya,H;this.getJqUi=function(){if(!va){va=$("<div>");va.addClass("metric-data-filter-preview");var da=n.get("preview","\u9884\u89c8"),N=$("<div class='metric-data-filter-preview-title'>"),
xa=$("<div>");xa.appendTo(N);I.layoutCtrlWithLRTB(xa,0,0,null,0,0,null);xa.css("border-left","3px solid #5582f3");xa=$("<div>");xa.text(da);I.layoutCtrl(xa,10,null,200,null);I.layoutCtrlMiddleAlign(xa,15);xa.appendTo(N);xa.css({"font-weight":"bold",color:"#666"});va.append(N);Ia=r.createTable();da=$(Ia.getUI());da.addClass("metric-data-filter-preview-table");va.append(da)}return va};this.afterResize=function(){Ia.relayoutViews()};this.setGlobal=function(da){Sa=da};this.setSourceTable=function(da){ka=
da};this.setFilterItems=function(da){H=da};this.setPreviewData=function(da){ya=da};this.getKTable=function(){return Ia};this.updateUi=function(){r.clear(Ia);for(var da=r.createHeadRow(Ia),N=Math.min(ya.getColumnCount(),50),xa=0;xa<N;xa++){var Ya=ya.getField(xa),La=Ia.addColumn(Ya.getAlias()),db=Ya.getOutputDataType();La.setStyle(r.getColumnStyle(db===v.DT_INT||db===v.DT_NUMBER));La.setWidth(w(db));da.getCell(xa).setValue(Ya.getAlias())}da=Math.min(ya.getRowCount(),10);for(xa=0;xa<da;xa++){La=r.createRow(Ia);
db=ya.getOneRow(xa);for(var sa=0;sa<N;sa++){Ya=ya.getField(sa);var Na=db[sa],Fa=La.getCell(sa),ja=Fa.setValue;var Ca=Ya.getOutputDataType();if(null==Na||void 0==Na)Na="";else if(Ca===v.DT_DATE)Ya=new P,Ya.setFormatString("yyyy-MM-dd"),Na=Ya.format(Na);else if(Ca===v.DT_DATETIME)Ya=new P,Ya.setFormatString("yyyy-MM-dd HH:mm:ss"),Na=Ya.format(Na);else if(Ca===v.DT_BOOLEAN)Na=Na?"true":"false";else if(Ca===v.DT_NUMBER&&(Ya=Ya.getScale()))for(Na+="",Ca=Na.split("."),2>Ca.length?(Na+=".",Ca=""):Ca=Ca[1],
Ya-=Ca.length,Ca=0;Ca<Ya;Ca++)Na+="0";ja.call(Fa,Na)}}0===ya.getRowCount()?(N=n.get("noPreviewData","\u6ca1\u6709\u6570\u636e"),Za(N,!1)):(N=10<ya.getRowCount(),xa=50<=ya.getColumnCount(),N||xa)?N&&!xa?(N=n.get("dataShownRows","\u4ec5\u9884\u89c8\u524d#1\u884c\u6570\u636e").replace("#1",10),ea(N)):!N&&xa?(N=n.get("totalRowsData","\u603b\u5171#1\u884c\u6570\u636e").replace("#1",ya.getRowCount()),N+=n.get("previewTipsComma",",")+n.get("dataShownCols","\u4ec5\u9884\u89c8\u524d#1\u5217\u6570\u636e").replace("#1",
50),Za(N,!1)):N&&xa&&(N=n.get("dataShownRowsAndCols","\u4ec5\u9884\u89c8\u524d#1\u884c\u3001\u524d#2\u5217\u6570\u636e"),N=N.replace("#1",10),N=N.replace("#2",50),ea(N)):(N=n.get("totalRows","\u603b\u5171#1\u884c\u6570\u636e").replace("#1",ya.getRowCount()),Za(N,!1))};this.showPreviewPrompt=function(da){R.hidePreviewPrompt();var N=$("<div>");N.addClass("metric-data-filter-preview-waiting");N.text(da);da=$(Ia.getUI());N.appendTo(da)};this.showWaitingTips=function(){R.showPreviewPrompt(n.get("loadingPreviewData",
"\u6b63\u5728\u83b7\u53d6\u9884\u89c8\u6570\u636e\uff0c\u8bf7\u7a0d\u5019\u2026\u2026"))};this.showErrorTips=function(da){R.showPreviewPrompt(da)};this.hidePreviewPrompt=function(){R.getJqUi().find(".metric-data-filter-preview-waiting").remove()};var ea=function(da){var N=new Date,xa=Sa.getModelerModel().getSource(ka.getSourceUid()),Ya=new d(Sa.getRemoteImpl(),function(La){if(N===N)try{da=n.get("totalRowsData","\u603b\u5171#1\u884c\u6570\u636e").replace("#1",La+"")+n.get("previewTipsComma",",")+da,
Za(da,!0)}catch(db){r.refresh(Ia)}});Ya.setShowBlocking(!1);Ya.getDataRowCount(xa,ka,Ja(H));Za(n.get("loadingTotalRows","\u6b63\u5728\u8ba1\u7b97\u603b\u884c\u6570\uff0c\u8bf7\u7a0d\u5019\u2026\u2026"),!1)},Ja=function(da){if(!da||0===da.length)return null;for(var N=[],xa=0;xa<da.length;xa++)da[xa].isEmpty()||N.push(da[xa].toJsonObject());return N},Za=function(da,N){N?(N=Ia.getRowsCount()-1,Ia.getRow(N).getCell(0).setValue(da)):(N=r.createRow(Ia),N.getCell(0).setValue(da),da=new KTStyle,da.setBackgroundColor(com.kingdee.bos.qing.common.CommonTableSkin.ODD_ROW_BACKGROUND_COLOR),
N.setStyle(da),da=new KTStyle,da.setTextAlign("left"),N.getCell(0).setStyle(da));r.refresh(Ia)},w=function(da){switch(da){case v.DT_INT:case v.DT_NUMBER:return 90;case v.DT_DATE:return 80;case v.DT_DATETIME:return 130;case v.DT_BOOLEAN:return 40;default:return 120}}}function ia(){function R(ma){KTDefaultCellRender.call(this,ma);var Qa=this,Ga=this.paintCellUI;this.paintCellUI=function(ab,Ra){if(Qa.getCurrentRowIdx()<r.getHeadRowCount()||!Qa.getCell())Ga(ab,Ra);else{var cb=Qa.getCellWidth(),eb=Qa.getCellHeight(),
ob=Qa.getCurrentRow();if(0===Qa.getCurrentColIdx())ob=Qa.getCell().getValue(),ab=$(ab),ab.find(".modeler-designer-filter-table-prompt").remove(),ob&&(cb=z.createWarning(),cb.addClass("modeler-designer-filter-table-prompt"),cb.attr("title",ob),cb.appendTo(ab));else if(1===Qa.getCurrentColIdx()||5===Qa.getCurrentColIdx()){Ra=1===Qa.getCurrentColIdx();var vb=Qa.getCell().getValue();pb(ab,cb,eb,Ra,vb,ob)}else if(2===Qa.getCurrentColIdx())Ra=Qa.getCell().getValue(),Ua(ab,cb,eb,Ra,ob);else if(3===Qa.getCurrentColIdx()){Ra=
Qa.getCell().getValue();var lb=ob.getUserObject().getField();vb=lb?lb.getOutputDataType():null;lb=lb?lb.isEnum():!1;ab=r.createCtrlInCell(ab,cb,eb,L);ab.setSelected(Ra);ab.setItemModels(vb?E.getSelectableCompares(vb,lb):[]);ab.setUserObject(ob);ab.setCustomPainter(Na);ab.addSelectedChangedListener(db)}else 4===Qa.getCurrentColIdx()?(Ra=Qa.getCell().getValue(),Fa(ab,cb,eb,Ra,ob)):6===Qa.getCurrentColIdx()?(Ra=Qa.getCell().getValue(),Ya(ab,cb,eb,Ra,ob)):Ga(ab,Ra)}}}function va(){t.call(this);var ma=
this,Qa=this.protectedMethod,Ga;this.edit=function(ab,Ra,cb){Qa.setTitle(n.get("relativeDateRange","\u76f8\u5bf9\u65e5\u671f"));Ga||(ma.setSize(450,430),Ga=new Aa,Ga.setContainsTime(Ra),Ra=new bb,Ra.fromJsonObject(ab.toJsonObject()),Ga.setModel(Ra),Qa.setContentPaneCreator(function(){return Ga.getJqUi()}),Qa.setClosingAction(function(eb){eb&&(eb=Ga.getModel(),cb(eb))}))}}function Ia(){var ma=[],Qa,Ga,ab=[],Ra=[],cb;this.setItemModel=function(lb,rb){cb=rb;ma=lb};this.setListItemPainter=function(lb){};
this.setSelectedItemModel=function(lb){ab=lb;Ra=ab.slice(0)};this.setLastTimeSelectedModel=function(lb){Ra=lb};this.getSelectedItemModel=function(){return ab};this.createJqPopup=function(lb,rb,yb,Db){Qa=$("<div>");Qa.appendTo(lb);Ga=$("<div>");Qa.addClass("modeler-designer-field-popup");Ga.addClass("modeler-designer-enum-popup-list-owner");for(lb=0;lb<ma.length;lb++)ob(ma[lb],Ga,rb,!1);rb=new q;rb.setHighlight(!0);rb.setText(n.get("ok","\u786e\u5b9a"));rb=rb.getJqUi();rb.css("z-index",3);rb.css("margin-left",
10);I.layoutCtrlWithLRTB(rb,"50%",null,50,null,8,28);rb.on("click",function(Ib){Ra=ab.slice(0);yb(ab)});lb=new q(n.get("cancle","\u53d6\u6d88"));lb.setHighlight(!1);lb=lb.getJqUi();lb.css("z-index",3);lb.css("margin-left",-80);I.layoutCtrlWithLRTB(lb,"50%",null,50,null,8,28);lb.on("click",function(Ib){ab=Ra.slice(0);Db()});Ga.appendTo(Qa);rb.appendTo(Qa);lb.appendTo(Qa);Ga.css("height","77%");return[-1,260]};var eb=function(lb,rb){rb=lb.getUserObject();lb=lb.isChecked();rb&&lb?(lb=vb(rb),0>lb&&ab.push(rb)):
rb&&!lb&&(lb=vb(rb),-1<lb&&ab.splice(lb,1))},ob=function(lb,rb,yb){var Db=vb(lb);yb=$("<div>");yb.addClass("modeler-designer-field-popup-list-item");yb.data("model",lb);var Ib=$("<div>"),Gb=new pa;Gb.setUserObject(lb);Gb.setChecked(-1<Db);Gb.addCheckedListener(eb);Db=Gb.getJqUi();Db.addClass("modeler-designer-field-selection-checkbox-icon");Db.data("model",Gb);Gb=$("<div>");Gb.text(lb.fieldValue);Gb.addClass("modeler-designer-field-selection-checkbox-text");Ib.append(Db);Ib.append(Gb);yb.append(Ib);
rb.append(yb)},vb=function(lb){for(var rb=0;rb<ab.length;rb++)if(cb(lb,ab[rb]))return rb;return-1}}function Sa(){t.call(this);var ma=this,Qa=this.protectedMethod,Ga=new za,ab=new za,Ra=new Pa,cb,eb;this.setCaption=function(lb,rb){Qa.setTitle(lb);Ga.setText(rb)};this.setText=function(lb,rb){Ra.setText(lb);var yb=0;lb&&(lb=lb.split("\n").length,yb=1E3<lb?1E3:lb);ab.setText(yb+"/1000\u9879");eb=function(Db){var Ib=Db?$.trim(Ra.getText()):null;rb(Db,Ib)};Qa.setClosingAction(eb)};this.showDialogLeftAnchorTo=
function(lb){lb&&(ma.setSize(470,450),lb=I.upwardCoordinate(document.body,[0,0],document.body),ma.setPosition(Math.max(0,lb[0]-10),Math.max(6,lb[1]-450+40)));Ra.addEditedListener(vb);Qa.setContentPaneCreator(ob);ma.showDialog();Ra.requestFocus()};this.setClosingChecker=function(lb){lb&&(cb=function(){var rb=lb($.trim(Ra.getText()));rb&&Qa.getMessageCurtain().showPrompt(rb);return rb?!1:!0},Qa.setClosingChecker(cb))};var ob=function(){ab.setAlign(za.ALIGN_RIGHT);I.layoutCtrlWithLRTB(Ga.getJqUi(),0,
0,null,0,null,23);I.layoutCtrlWithLRTB(Ra.getJqUi(),0,0,null,30,null,260);I.layoutCtrlWithLRTB(ab.getJqUi(),290,0,null,287,null,23);var lb=$("<div>");lb.append(Ga.getJqUi());lb.append(Ra.getJqUi());lb.append(ab.getJqUi());return lb},vb=function(lb){var rb=lb.getText(),yb=[];rb&&(yb=rb.trim().replace(/(\n\s*)+/g,"\n").split("\n"));rb=yb.length;1E3<rb&&(lb.setText(yb.slice(0,1E3).join("\n")),rb=1E3);ab.setText(rb+"/1000\u9879");Qa.getMessageCurtain().hide()}}var ka=this,ya,H,ea=[],Ja=[],Za,w;this.getJqUi=
function(){if(!ya){ya=$("<div>");ya.addClass("metric-data-filter-condition");var ma=n.get("filterCondition","\u8fc7\u6ee4\u6761\u4ef6"),Qa=$("<div class='metric-data-filter-condition-title'>"),Ga=$("<div>");Ga.appendTo(Qa);I.layoutCtrlWithLRTB(Ga,0,0,null,0,0,null);Ga.css("border-left","3px solid #5582f3");Ga=$("<div>");Ga.text(ma);I.layoutCtrl(Ga,10,null,200,null);I.layoutCtrlMiddleAlign(Ga,15);Ga.appendTo(Qa);Ga.css({"font-weight":"bold",color:"#666"});ya.append(Qa);H=r.createTable();H.setDraggableAdjusting(!0);
H.setSyncUIWhenModelChanged(!0);H.setColumnFitVisibleWidth(!1);H.setAutoAdjustRowHeight(!0);H.setScrollerVisible("hidden","auto");r.bindTextEditor(H,da,N);r.bindTableListenerForCtrl(H,xa);ma=new R(H);ma.setOutsideVisible(!1);H.setCellRender(ma);H.addColumns(8);H.getColumn(0).setWidth(23);H.getColumn(1).setWidth(60);H.getColumn(2).setWidth(170);H.getColumn(3).setWidth(95);H.getColumn(4).setWidth(200);H.getColumn(5).setWidth(60);H.getColumn(6).setWidth(60);H.getColumn(7).setWidth(100);ma=r.createHeadRow(H);
ma.getCell(1).setValue(n.get("leftBracket","\u5de6\u62ec\u53f7"));ma.getCell(2).setValue(n.get("field","\u5b57\u6bb5"));ma.getCell(3).setValue(n.get("compare","\u6bd4\u8f83"));ma.getCell(4).setValue(n.get("value","\u503c"));ma.getCell(5).setValue(n.get("rightBracket","\u53f3\u62ec\u53f7"));ma.getCell(6).setValue(n.get("logic","\u903b\u8f91"));ma=$(H.getUI());ma.addClass("metric-data-filter-condition-table");ya.append(ma)}return ya};this.getFilterItems=function(){for(var ma=[],Qa=0;Qa<Ja.length;Qa++){var Ga=
Ja[Qa];Ga.isEmpty()||ma.push(Ga)}return ma};this.setFilterItems=function(ma){Ja=ma};this.setFields=function(ma){ea=ma};this.afterResize=function(){H.relayoutViews()};this.setPreviewRefreshRequestListener=function(ma){Za=ma};this.firePreviewRefreshWithOnlyRepaint=function(){Za()};this.updateUi=function(){if(H){for(var ma=Ja.length-1;0<=ma;ma--)if(Ja[ma].isEmpty())Ja.splice(ma,1);else break;r.clearWithoutHead(H);ma=Math.max(6,Ja.length+1);for(var Qa=0;Qa<ma;Qa++){var Ga=Ja[Qa];Qa>=Ja.length&&(Ga=new E,
Ja.push(Ga));var ab=r.createRow(H);ab.setUserObject(Ga);ab.getCell(0).setValue("");ab.getCell(1).setValue(Ga.getLeftBracketCount());ab.getCell(2).setValue(Ga.getField());ab.getCell(3).setValue(Ga.getCompareOp());E.isCompareOpRelativeDateRangeValue(Ga.getCompareOp())?ab.getCell(4).setValue(Ga.getRelativeDateRange()?Ga.getRelativeDateRange():""):ab.getCell(4).setValue(Ga.getValue()?Ga.getValue():"");ab.getCell(5).setValue(Ga.getRightBracketCount());ab.getCell(6).setValue(Ga.getLogicOp()?Ga.getLogicOp():
"")}r.refresh(H)}};this.checkFilterValid=function(){var ma=wa.checkFilterField(Ja,ea);if(ma||(ma=wa.checkFilterLogical(Ja)))return Ka=!1,ka.locateToErrorRow(ma.getFiltersErrorRow(),ma.getPrompt()),ma.getPrompt();Ka=!0;ka.locateToErrorRow(-1);return null};this.locateToErrorRow=function(ma,Qa){for(var Ga=r.getHeadRowCount();Ga<H.getRowsCount();Ga++)H.getRow(Ga).getCell(0).setValue("");-1!==ma&&H.getRow(ma+r.getHeadRowCount()).getCell(0).setValue(Qa)};var da=function(ma,Qa){if(4!==Qa)return!1;ma=H.getRow(ma).getUserObject();
Qa=ma.getCompareOp();if(E.isCompareOpWithoutValue(Qa)||E.isCompareOpWithinOrNotWithinValue(Qa)||!wa.checkFieldExisted(ma,ea))return!1;ma=ma.getField();return Ta(ma)},N=function(ma,Qa,Ga,ab,Ra){ma=ma.getUserObject();ma.getValue()!==ab&&(ma.setValue(ab),Ga.setValue(ab),ka.checkFilterValid(),ka.firePreviewRefreshWithOnlyRepaint());return!0},xa=function(ma,Qa,Ga,ab){ma=null;if(Qa){Qa=KTableUIAbstractView.createCellId(H.getRow(Ga),H.getColumn(H.getColumnsCount()-1));ma=ka.getJqUi().find("#"+Qa);var Ra=
Ga-r.getHeadRowCount();Ga=$("<div>");Ga.text(n.get("insertRow","\u63d2\u5165"));Ga.addClass("modeler-designer-filter-table-op");Ga.css("left","10px");Ga.appendTo(ma);Ga.on("click",function(cb){cb=new E;Ja.splice(Ra,0,cb);ka.updateUi();ka.checkFilterValid();ka.firePreviewRefreshWithOnlyRepaint()});Ga=$("<div>");Ga.text(n.get("deleteRow","\u5220\u9664"));Ga.addClass("modeler-designer-filter-table-op");Ga.css("left","52px");Ga.appendTo(ma);Ga.on("click",function(cb){Ja.splice(Ra,1);ka.updateUi();ka.checkFilterValid();
ka.firePreviewRefreshWithOnlyRepaint()})}else w&&w.find(".modeler-designer-filter-table-op").remove();w=ma},Ya=function(ma,Qa,Ga,ab,Ra){ma=r.createCtrlInCell(ma,Qa,Ga,L);ma.setSelected(ab?ab:null);ma.setItemModels([null,E.LOGIC_AND,E.LOGIC_OR]);ma.setUserObject(Ra);ma.setCustomPainter(function(cb,eb,ob){cb="";ob===E.LOGIC_AND?cb=n.get("and","\u4e14"):ob===E.LOGIC_OR&&(cb=n.get("or","\u6216"));eb.text(cb)});ma.addSelectedChangedListener(La)},La=function(ma,Qa,Ga){ma=ma.getUserObject();ma.getUserObject().setLogicOp(Ga);
ma.getCell(6).setValue(Ga);ka.checkFilterValid();ka.firePreviewRefreshWithOnlyRepaint()},db=function(ma,Qa,Ga){ma=ma.getUserObject();var ab=ma.getUserObject();ab.setCompareOp(Ga);ma.getCell(3).setValue(Ga);if(E.isCompareOpWithoutValue(Qa)!==E.isCompareOpWithoutValue(Ga)||E.isCompareOpRelativeDateRangeValue(Qa)!==E.isCompareOpRelativeDateRangeValue(Ga)||E.isCompareOpWithinOrNotWithinValue(Qa)!==E.isCompareOpWithinOrNotWithinValue(Ga))ab.setValue(null),ab.setRelativeDateRange(null),sa(ma.getCell(4),
" ");ka.checkFilterValid();ka.firePreviewRefreshWithOnlyRepaint()},sa=function(ma,Qa){ma.setValue(""===Qa?" ":"");ma.setValue(Qa)},Na=function(ma,Qa,Ga){switch(Ga){case E.COMPARE_EQUAL:ma=n.get("equal","\u7b49\u4e8e");break;case E.COMPARE_NOT_EQUAL:ma=n.get("notEqual","\u4e0d\u7b49\u4e8e");break;case E.COMPARE_GREATER:ma=n.get("greater","\u5927\u4e8e");break;case E.COMPARE_GREATER_EQUAL:ma=n.get("equalOrGreater","\u5927\u4e8e\u7b49\u4e8e");break;case E.COMPARE_LESS:ma=n.get("less","\u5c0f\u4e8e");
break;case E.COMPARE_LESS_EQUAL:ma=n.get("equalOrLess","\u5c0f\u4e8e\u7b49\u4e8e");break;case E.COMPARE_INCLUDE:ma=n.get("include","\u5305\u542b");break;case E.COMPARE_NOT_INCLUDE:ma=n.get("notInclude","\u4e0d\u5305\u542b");break;case E.COMPARE_START_WITH:ma=n.get("startWith","\u5f00\u5934\u662f");break;case E.COMPARE_END_WITH:ma=n.get("endWith","\u7ed3\u5c3e\u662f");break;case E.COMPARE_NULL:ma=n.get("compareNull","\u4e3a\u7a7a");break;case E.COMPARE_NOT_NULL:ma=n.get("compareNotNull","\u4e0d\u4e3a\u7a7a");
break;case E.COMPARE_IN:ma=n.get("compareIn","\u5728......\u4e4b\u5185");break;case E.COMPARE_NOT_IN:ma=n.get("compareNotIn","\u4e0d\u5728......\u4e4b\u5185");break;case E.COMPARE_RELATIVE_DATE_RANGE:ma=n.get("relativeDateRange","\u76f8\u5bf9\u65e5\u671f");break;default:ma=""}Qa.text(ma)},Fa=function(ma,Qa,Ga,ab,Ra){var cb=Ra.getUserObject(),eb=$(ma);eb.empty();if(wa.checkFieldExisted(cb,ea)){eb.css("cursor","");var ob=cb.getCompareOp(),vb=cb.getField(),lb=vb?vb.getOutputDataType():"",rb=vb?vb.getEnumValue():
null,yb=vb?vb.isEnum():!1;if(!E.isCompareOpWithoutValue(ob))if(E.isCompareOpWithinOrNotWithinValue(ob))if(yb){var Db=[],Ib;for(Ib in rb)Db.push({fieldValue:rb[Ib],fieldName:Ib});var Gb=[];(ab=JSON.parse(cb.getValue()))&&ab.forEach(function(hb){Db.forEach(function(kb){hb===kb.fieldName&&Gb.push({fieldValue:kb.fieldValue,fieldName:kb.fieldName})})});var Ob=new Ia;Ob.setItemModel(Db,function(hb,kb){return hb&&kb&&hb.fieldName===kb.fieldName});Ob.setSelectedItemModel(Gb);ma=r.createCtrlInCell(ma,Qa,Ga,
M);ma.setUserObject(Ra);ma.setSelectedModel(Gb);ma.setDropdownCreator(function(hb,kb,sb,ub){return Ob.createJqPopup(hb,kb,sb,ub)});ma.addSelectionListener(function(hb){var kb=hb.getSelectedModel();hb=hb.getUserObject().getUserObject();if(null==kb||0===kb.length)hb.setValue(null);else{JSON.parse(hb.getValue());var sb=[],ub;for(ub in kb)sb.push(kb[ub].fieldName);hb.setValue(JSON.stringify(sb))}ka.checkFilterValid();ka.firePreviewRefreshWithOnlyRepaint()});ma.setCustomPainter(function(hb,kb){var sb=
[],ub;for(ub in hb)sb.push(hb[ub].fieldValue);kb.text(sb.join(","))})}else{var Kb=r.createCtrlInCell(ma,Qa,Ga,x);Kb.setClearable(!0);Kb.setUserObject(Ra);Kb.getJqUi().find(".sa-ctrl-f7selector-text").on("click",function(){ib(cb,Kb)});Kb.addActionListener(function(hb){ib(cb,Kb)});null!=ab&&""!==ab&&" "!==ab&&ab&&Kb.setModel(JSON.parse(ab).join(","));Kb.setCustomPainter(function(hb){return hb});Kb.addClearListener(function(hb){fb(hb,cb,null)})}else if(Ta(vb))ma=$("<div>"),ma.text(ab),ma.addClass("modeler-designer-common-table-cell-editable"),
ma.appendTo(eb),eb.css("cursor","pointer");else if(lb===v.DT_DATE||lb===v.DT_DATETIME)if(E.isCompareOpRelativeDateRangeValue(ob)){var Nb=lb===v.DT_DATETIME;eb="";var $a=ab;$a instanceof bb?eb=Aa.modelToDisplayText($a,Nb):($a=new bb,$a.setPeriod(bb.PERIOD_DAY),$a.setWhichPeriod(0));var gb=r.createCtrlInCell(ma,Qa,Ga,za);eb&&18<eb.length&&(gb.getJqUi().attr("title",eb),eb=eb.substring(0,18)+"...");gb.setText(eb);gb.setUserObject(Ra);ma=gb.getJqUi();ma.css("line-height","28px");ma.on("click",function(hb){hb=
$a;var kb=nb,sb=new va;sb.edit(hb,Nb,kb);sb.showDialog()});Qa=$("<div>");W.background(Qa,"btn_edit");Qa.addClass("modeler-designer-filter-item-format-icon");Qa.appendTo(ma);var nb=function(hb){cb.setRelativeDateRange(hb);cb.setDisplayValue(Aa.modelToDisplayText(hb,Nb));gb.setText(Aa.modelToDisplayText(hb,Nb));Ra.getCell(4).setValue(hb);ka.checkFilterValid();ka.firePreviewRefreshWithOnlyRepaint()}}else eb=new Date,ab=ab?parseInt(ab):null,isNaN(ab)||null==ab?(cb=Ra.getUserObject(),cb.setValue(eb.getTime())):
eb.setTime(ab),ma=r.createCtrlInCell(ma,Qa,Ga,lb===v.DT_DATETIME?ua:U),ma.setDateObject(eb),ma.setUserObject(Ra),ma.addModelChangedListener(ja);else if(lb===v.DT_BOOLEAN)ma=r.createCtrlInCell(ma,Qa,Ga,L),ma.setSelected(ab),ma.setItemModels([v.BOOLEAN_TRUE,v.BOOLEAN_FALSE]),ma.setUserObject(Ra),ma.setCustomPainter(function(hb,kb,sb){hb=sb===v.BOOLEAN_TRUE?n.get("dataTypeTrue","\u771f"):sb===v.BOOLEAN_FALSE?n.get("dataTypeFalse","\u5047"):"";kb.text(hb)}),ma.addSelectedChangedListener(Ca);else if(yb){Db=
[];for(Ib in rb)Db=Db.concat(Ib);ma=r.createCtrlInCell(ma,Qa,Ga,L);ma.setSelected(ab);ma.setItemModels(Db);ma.setUserObject(Ra);ma.setCustomPainter(function(hb,kb,sb){kb.text(rb[sb])});ma.addSelectedChangedListener(Ca)}}else ma=$("<div>"),Qa=cb.getDisplayValue(!1),ma.text(Qa),ma.attr("title",Qa),ma.addClass("modeler-designer-common-table-cell-not-editable"),ma.appendTo(eb)},ja=function(ma){var Qa=""+ma.getDateObject().getTime();ma=ma.getUserObject();ma.getUserObject().setValue(Qa);ma.getCell(4).setValue(Qa);
ka.checkFilterValid();ka.firePreviewRefreshWithOnlyRepaint()},Ca=function(ma,Qa,Ga){ma=ma.getUserObject();ma.getUserObject().setValue(Ga);ma.getCell(4).setValue(Ga);ka.checkFilterValid();ka.firePreviewRefreshWithOnlyRepaint()},Ta=function(ma){var Qa=ma?ma.getOutputDataType():null;return ma&&ma.isMulBaseData()?!0:Qa?(ma=ma?ma.isEnum():!1,(Qa===v.DT_STRING||Qa===v.DT_NUMBER||Qa===v.DT_INT)&&!ma):!1},ib=function(ma,Qa){var Ga=n.get("enterSplit","\u7cbe\u786e\u5339\u914d\u591a\u503c\uff0c\u5404\u9879\u4e4b\u95f4\u4f7f\u7528\u56de\u8f66\u4f5c\u4e3a\u5206\u9694\u7b26"),
ab=ma.getCompareOp()===E.COMPARE_IN?n.get("compareIn","\u5728......\u4e4b\u5185"):n.get("compareNotIn","\u4e0d\u5728......\u4e4b\u5185"),Ra=JSON.parse(ma.getValue());Ra=Ra?Ra.join("\n"):"";var cb=new Sa;cb.setCaption(ab,Ga);cb.setClosingChecker(function(eb){if(eb&&5E4<eb.length)return n.get("matchTooLong","\u5339\u914d\u9879\u4e0d\u80fd\u8d85\u8fc750000\u4e2a\u5b57\u7b26")});cb.setText(Ra,function(eb,ob){eb&&fb(Qa,ma,ob)});cb.showDialogLeftAnchorTo(Qa.getJqUi())},fb=function(ma,Qa,Ga){null!=Ga&&ma.setModel(Ga.replace(/(\s*\n\s*)+/g,
","));if(null==Ga||Qa.getValue()!==JSON.stringify(Ga.split("\n"))){ma=ma.getUserObject();if(null!=Ga&&""!==Ga){Ga=JSON.parse(JSON.stringify(Ga.split("\n")));var ab=[];Ga&&Ga.forEach(function(Ra){""!==Ra.trim()&&ab.push($.trim(Ra))});Ga=JSON.stringify(ab);Qa.setValue(Ga);ma.getCell(4).setValue(Ga)}else Qa.setValue(null),ma.getCell(4).setValue(null);ka.checkFilterValid();ka.firePreviewRefreshWithOnlyRepaint()}},Ua=function(ma,Qa,Ga,ab,Ra){var cb=(new Ha).createChooseFieldPanel(jb);cb.setItemModel(ea);
ma=r.createCtrlInCell(ma,Qa,Ga,M);ma.setUserObject(Ra);ma.setSelectedModel(ab);ma.setDropdownCreator(function(eb,ob,vb){return cb.createJqPopup(eb,ob,vb)});ma.addSelectionListener(function(eb){var ob=eb.getSelectedModel();eb=eb.getUserObject();var vb=eb.getUserObject(),lb=vb.getField(),rb=lb?lb.getOutputDataType():"",yb=ob?ob.getOutputDataType():"";vb.setField(ob);eb.getCell(2).setValue(ob);if(rb!==yb||lb.getEnumValue()!==ob.getEnumValue()){lb=vb.getCompareOp();ob=ob?ob.isEnum():!1;ob=E.getSelectableCompares(yb,
ob);yb=!1;for(rb=0;rb<ob.length;rb++)if(lb===ob[rb]){yb=!0;break}yb||(lb=E.COMPARE_EQUAL);vb.setCompareOp(lb);sa(eb.getCell(3),lb);vb.setValue(null);sa(eb.getCell(4)," ")}ka.checkFilterValid();ka.firePreviewRefreshWithOnlyRepaint()});ma.setCustomPainter(function(eb,ob){ob.text(eb?eb.getAlias():"")})},jb=function(ma,Qa){var Ga=Qa?Qa.getAlias():"",ab=$("<span>");ab.text(Ga);ab.attr("title",Ga);ab.addClass("modeler-designer-field-popup-list-item-text-alias");Qa=Qa?Qa.getName():"";Ga=$("<span>");Ga.addClass("modeler-designer-field-popup-list-item-text-name");
Ga.text("("+Qa+")");ma.append(ab);ma.append(Ga)},pb=function(ma,Qa,Ga,ab,Ra,cb){ma=r.createCtrlInCell(ma,Qa,Ga,L);ma.setSelected(Ra);ma.setItemModels([0,1,2,3,4]);ma.setUserObject(cb);ma.setCustomPainter(function(eb,ob,vb){eb=ab?"(":")";for(var lb="",rb=0;rb<vb;rb++)lb+=eb;ob.text(lb)});ma.addSelectedChangedListener(ab?qb:tb)},qb=function(ma,Qa,Ga){ma=ma.getUserObject();ma.getUserObject().setLeftBracketCount(Ga);ma.getCell(1).setValue(Ga);ka.checkFilterValid();ka.firePreviewRefreshWithOnlyRepaint()},
tb=function(ma,Qa,Ga){ma=ma.getUserObject();ma.getUserObject().setRightBracketCount(Ga);ma.getCell(5).setValue(Ga);ka.checkFilterValid();ka.firePreviewRefreshWithOnlyRepaint()}}function Ha(){function R(){var ea=[],Ja,Za,w,da,N,xa=!1,Ya=!0;this.setItemModel=function(La){ea=La};this.setShowFieldNameEnable=function(La){Ya=La};this.setRawTypeSwitchListener=function(La){};this.setSearchListener=function(La){Ja=La};this.setListItemPainter=function(La){Za=La};this.setShowFieldNameListener=function(La){w=
La};this.createJqPopup=function(La,db,sa){da=$("<div>");da.appendTo(La);N=$("<div>");da.addClass("modeler-designer-field-popup");La=n.get("search","\u641c\u7d22");var Na=new K;Na.setSearchListenerDelay(200);Na.setPlaceholder(La);Na.addSearchListener(function(){Ja(ea,Na.getText(),N,db,Za,xa)});La=Na.getJqUi();La.addClass("modeler-designer-field-popup-search");La.appendTo(da);N.addClass("modeler-designer-field-popup-list-owner");N.on("click",function(Ca){var Ta=$(Ca.currentTarget);Ca=$(Ca.target);if(Ca=
I.upwardSearchHasClass(Ca,Ta,"modeler-designer-field-popup-list-item"))Ca.addClass("modeler-designer-list-item_selected_enabled"),Ta=Ca.data("model"),sa(Ta)});N.appendTo(da);La=da.find(".sa-ctrl-textfield-input");La.css("top","0px");La.css("height","100%");if(0===ea.length)Ia(N,n.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5"));else for(La=0;La<ea.length;La++)Za(ea[La],N,db);if(Ya){var Fa=n.get("showFieldName","\u663e\u793a\u539f\u5b57\u6bb5\u540d\u79f0");La=new za;La.setText(Fa);La=La.getJqUi();
La.attr("title",Fa);La.addClass("modeler-designer-field-popup-show-field-name-label");Fa=new T;Fa.addStateChangeListener(function(Ca,Ta,ib){(xa=ib)?w&&w(N,!0):w&&w(N,!1)});Fa.setOn(!1);Fa=Fa.getJqUi();Fa.addClass("modeler-designer-field-popup-show-field-name-button");var ja=$("<div>");ja.addClass("modeler-designer-field-popup-show-field-name");Fa.appendTo(ja);La.appendTo(ja);ja.appendTo(da)}else N.css("bottom","5px")}}var va;this.createChooseFieldPanel=function(ea){va=ea;ea=new R;ea.setListItemPainter(ya);
ea.setSearchListener(Sa);ea.setShowFieldNameListener(ka);return ea};var Ia=function(ea,Ja){var Za=new za;Za.setText(Ja);Za.setEnabled(!1);Za.setAlign(za.ALIGN_CENTER);Ja=Za.getJqUi();Ja.addClass("modeler-designer-field-popup-no-data");Ja.appendTo(ea)},Sa=function(ea,Ja,Za,w,da,N){Ja=Ja.toLowerCase().trim();for(var xa=[],Ya,La=0;La<ea.length;La++)(Ya=ea[La])&&(Ya=-1!==Ya.getAlias().toLowerCase().indexOf(Ja)?!0:N&&-1!==Ya.getName().toLowerCase().indexOf(Ja)?!0:!1)&&xa.push(ea[La]);Za.children().remove();
if(0<xa.length){for(La=0;La<xa.length;La++)da(xa[La],Za,w);xa.length=0}else""===Ja?Ia(Za,n.get("noFieldToSelect","\u65e0\u53ef\u9009\u5b57\u6bb5")):Ia(Za,n.get("noSearchResult","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c"));ka(Za,N)},ka=function(ea,Ja){if(Ja)for(ea=ea.find(".modeler-designer-field-popup-list-item-text-name"),Ja=0;Ja<ea.length;Ja++){var Za=ea.eq(Ja);Za.css("display","inline-block");var w=Za.prev().text()+Za.text();Za.prev().attr("title",null);Za.parent().attr("title",w)}else for(ea=
ea.find(".modeler-designer-field-popup-list-item-text-name"),Ja=0;Ja<ea.length;Ja++)Za=ea.eq(Ja),Za.css("display","none"),Za.parent().attr("title",null),Za.prev().attr("title",Za.prev().text())},ya=function(ea,Ja,Za){var w=$("<div>");w.addClass("modeler-designer-field-popup-list-item");w.data("model",ea);va(w,ea);Ja.append(w);Za&&ea&&Za.getFullName()===ea.getFullName()&&H(Ja,w)},H=function(ea,Ja){var Za=null;0<ea.height()?(clearTimeout(Za),Ja.addClass("modeler-designer-list-item_selected_enabled"),
ea.prop("scrollTop",Ja.prop("offsetTop"))):Za=setTimeout(function(){H(ea,Ja)},0)}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.metricdesigner&&
(com.kingdee.bos.qing.modeler.designer.metricdesigner={});var ba=com.kingdee.bos.qing.modeler.designer.metricdesigner;ba.TableArea=function(){var R,va,Ia,Sa,ka,ya,H,ea,Ja,Za;this.getJqUi=function(){if(!R){R=$("<div>");R.addClass("modeler-designer-workarea");R.addClass("modeler-designer-common-border");va=$("<div>");va.addClass("modeler-designer-workarea-title");var Ua=$("<span>");Ua.addClass("modeler-designer-workarea-title-text");Ua.text(n.get("table","\u8868"));va.append(Ua);Ua=$("<div>");Ua.addClass("modeler-designer-workarea-title-btn");
W.backgroundWithHover(Ua,"add");Ua.on("click",w);Ua.attr("title",n.get("addTable","\u6dfb\u52a0\u6570\u636e\u8868"));Ua.appendTo(R);Ia=$("<div>");Ia.addClass("modeler-designer-workarea-container");Sa=new D;Sa.setBorderVisible(!1);Sa.setToggleSelectingEnabled(!1);Sa.setCustomItemPainter(da);Sa.setCustomSelectedsPainter(db);Sa.addSelectedChangedListener(sa);ka=Sa.getJqUi();ka.appendTo(Ia);I.layoutCtrlWithLRTB(ka,0,0,null,0,0,null);Ia.appendTo(R);R.append(va);ba.MetricStateMonitor.setFunUpdateTableArea(ib);
ba.MetricStateMonitor.setFunUpdateSingleTable(Ta)}return R};this.setGlobal=function(Ua){H=Ua};this.setModelerModel=function(Ua){ea&&ea.removePropertyChangeCallback(Ca);ea=Ua;ea.addPropertyChangeCallback(Ca);ja(!0)};this.setTableChangeCallback=function(Ua){Ja=Ua};this.setExceptionTableChangeCallback=function(Ua){Za=Ua};this.showDialogIfNoTable=function(){var Ua=ea.getAllTable(!0);if(!Ua||0==Ua.length){var jb=w();Ua=new Ba;Ua.setCallbackImmediately(function(){jb.updateUi()});Ua.observe()}};var w=function(){var Ua=
new Va;Ua.setGlobal(H);var jb=new Ea;jb.setTitle(n.get("addTable","\u6dfb\u52a0\u6570\u636e\u8868"));jb.setSteps([Ua]);jb.show(760,540);return Ua},da=function(Ua,jb){var pb=N(jb),qb=0,tb=!0;pb&&(tb=ba.SourceUtil.createExceptionIcon(pb.errorMessage),tb.addClass("modeler-designer-sourcearea-exception-icon"),tb.appendTo(Ua),qb=22,tb=pb.invalidityType==X.TYPE_INVALID_TABLE_FILTER);Ua.css("height","30px");Ua.css("cursor","pointer");pb=$("<div>");pb.appendTo(Ua);pb.addClass("modeler-designer-sourcearea-icon");
pb.css("top","8px");pb.css("left",12+qb+"px");W.background(pb,"qingTable");pb.appendTo(Ua);pb=$("<div>");var ma=ba.TableNameHelper.getDisplayText(jb);pb.text(ma);pb.addClass("modeler-designer-sourcearea-name");pb.css("left",34+qb+"px");pb.appendTo(Ua);qb=new ta;qb.setStatus(tb);qb.setDeleteItemListener(function(){ea.isTableReferred(jb)?H.getMessageCurtain().showPrompt(n.get("tableIsUsed","\u8be5\u6570\u636e\u8868\u5df2\u88ab\u6307\u6807\u4f7f\u7528\uff0c\u8bf7\u5148\u5728\u8bbe\u8ba1\u7a97\u53e3\u5220\u9664\u6307\u6807\uff0c\u518d\u5220\u9664\u6570\u636e\u8868\u3002")):
Fa(ma).setClosingChecker(function(Ga){Ga==S.RETURN_OK&&Ya(Ua,jb);return!0})});qb.setSelectFieldListener(function(){(new Da(jb,H)).showSelectFieldDialog()});qb.setFilterListener(function(){(new Q(H,jb)).showDialog()});var Qa=qb.getJqUi();Qa.appendTo(Ua);Qa.hide();Ua.mouseenter(function(){Qa.show()}).mouseleave(function(){Qa.hide()});Ua.data("menu",qb);xa(pb,jb)},N=function(Ua){var jb=H.getIntegration().getMapTableException();return jb?jb[Ua.getUid()]:null},xa=function(Ua,jb){var pb=new m,qb=$("<div>"),
tb=$("<div>");tb.addClass("metric-designer-table-area-tips-name-container");var ma=$("<span>");ma.text(n.get("nameWithColon","\u540d\u79f0\uff1a"));ma.css("font-weight","bold");ma.appendTo(tb);ma=$("<span>");ma.text(ba.TableNameHelper.getDisplayText(jb));ma.appendTo(tb);ma=$("<div>");ma.addClass("metric-designer-table-area-tips-source-container");var Qa=$("<span>");Qa.text(n.get("sourceWithColon","\u6570\u636e\u6e90\uff1a"));Qa.css("font-weight","bold");Qa.appendTo(ma);Qa=$("<span>");jb=ba.SourceUtil.getTableSource(H,
jb);var Ga=H.getIntegration().getMapSourceType()[jb.getSourceId()],ab=ba.SourceUtil.getSourceIconName(Ga),Ra=$("<span>");Ra.addClass("metric-designer-table-area-tips-source-name");var cb=jb.getName();cb=cb?cb:ba.SourceUtil.createSourceNameByType(jb.getSourceType());Ga?Qa.addClass("modeler-designer-addsource-source-icon"):(cb=n.get("sourceExceptionDeleted","\u8be5\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4f7f\u7528\u3002"),Qa.addClass("metric-designer-table-area-tips-exception-icon"));
W.background(Qa,ab);Qa.appendTo(ma);Ra.text(cb);Ra.appendTo(ma);tb.appendTo(qb);ma.appendTo(qb);pb.setSuggestedSize(250,90);pb.setHtml(qb);pb.mounting(Ua)},Ya=function(Ua,jb){var pb=H.getModelerModel();0==pb.getPublicDimensions().length?La(Ua,jb):1==pb.getAllTable().length?La(Ua,jb,[]):ba.PublicDimensionUtil.deleteTableForPublicDimensions(jb.getUid(),H,R,function(qb){La(Ua,jb,qb)})},La=function(Ua,jb,pb){var qb=new fa,tb=ba.SourceUtil.getTableSource(H,jb);qb.setValue(jb,H,tb,pb);H.getCommandManager().perform(qb);
Ua.remove()},db=function(Ua,jb){jb&&0<jb.length&&(Ua&&0<Ua.length&&(Ua=Ua[0],Ua.css("background-color",""),Ua.css("color","")),jb=jb[0],jb.css("background-color","#eff3fd"),jb.css("color","rgb(130, 130, 130)"))},sa=function(Ua,jb,pb){var qb=pb[0];Ua=ba.SourceUtil.getTableSource(H,qb);var tb=Sa.getItemUiByModel(qb),ma=tb.data("menu");(new d(H.getRemoteImpl(),function(Qa){var Ga=Qa.isValid,ab=!1;if(Ga)Ja&&Ja(qb),ab=Ga;else{Za&&Za(qb,Qa.invalidityType);var Ra=Qa.errorMessage;Qa.invalidityType===X.TYPE_INVALID_TABLE_FILTER&&
(ab=!0)}ba.SourceUtil.updateTableItemStatus(tb,Ga,Ra);ma&&ma.updateMenuState(ab);Ga=H.getIntegration().getMapTableException();Ga||(Ga={},H.getIntegration().setMapTableException(Ga));ab=qb.getUid();Ga[ab]&&!Qa.isValid||!Ga[ab]&&Qa.isValid||(Ga=new ha,Ga.setGlobal(H),ab=H.getModelerModel(),Ra=new Wa,Ra.setModelerModel(ab),Ga.backgroundCheck(Ra.toJsonObject()));Na(qb,Qa)})).checkMetricTableException(Ua,qb,qa.getModelId())},Na=function(Ua,jb){var pb=H.getIntegration().getMapTableException();if(jb.isValid)var qb=
null;else qb={},qb.invalidityType=jb.invalidityType,qb.errorMessage=jb.errorMessage;pb[Ua.getUid()]=qb},Fa=function(Ua){var jb=S.createFeedbackDialog();jb.setMsgImageType(S.MSG_DELETE);jb.setOptionType(S.OPTION_OK_CANCEL);var pb=n.get("confirmDeleteTable","\u786e\u5b9a\u5220\u9664\u8be5\u6570\u636e\u8868\u5417\uff1f");pb=pb.replace("#1",Ua);jb.setMessage(pb);jb.showDialog();return jb},ja=function(Ua){var jb=ea.getAllTable();Sa.setItemModels(jb);if(jb&&0!=jb.length){if(ya&&ya.hide(),!Ua){Ua=!1;var pb=
Sa.getSelecteds();if(pb)for(var qb=0;qb<pb.length;qb++)for(var tb=pb[qb],ma=0;ma<jb.length;ma++){var Qa=jb[ma];if(Qa==tb){Ua=!0;1===jb.length&&(pb.push(null),Sa.setSelecteds([Qa]));break}}Ua||Sa.setSelecteds([jb[0]]);ka.show()}}else ka.hide(),fb()},Ca=function(Ua,jb){Ua!==h.KEY_ADD_TABLE&&Ua!==h.KEY_REMOVE_TABLE||ja(!1);Ua!==h.KEY_TABLE_SELECT_FIELD&&Ua!==h.KEY_TABLE_SET_FILTER||Ta(jb)},Ta=function(Ua){var jb=ba.SourceUtil.getTableSource(H,Ua),pb=Sa.getItemUiByModel(Ua),qb=pb.data("menu");(new d(H.getRemoteImpl(),
function(tb){var ma=tb.isValid,Qa=!1;if(ma)Qa=ma,Ja&&Ja(Ua);else{Za&&Za(Ua,tb.invalidityType);var Ga=tb.errorMessage;tb.invalidityType===X.TYPE_INVALID_TABLE_FILTER&&(Qa=!0)}ba.SourceUtil.updateTableItemStatus(pb,ma,Ga);qb&&qb.updateMenuState(Qa);Na(Ua,tb)})).checkMetricTableException(jb,Ua,qa.getModelId())},ib=function(){var Ua=ea.getAllTable();Sa.setItemModels(Ua);if(Ua&&0!=Ua.length){ya&&ya.hide();var jb=!1,pb=Sa.getSelecteds();if(pb)for(var qb=0;qb<pb.length;qb++)for(var tb=pb[qb],ma=0;ma<Ua.length;ma++){var Qa=
Ua[ma];if(Qa==tb){jb=!0;pb.push(null);Sa.setSelecteds([Qa]);break}}jb||Sa.setSelecteds([Ua[0]]);ka.show()}else ka.hide(),fb()},fb=function(){if(!ya){ya=$("<div>");ya.appendTo(R);ya.addClass("modeler-designer-sourcearea-nosource");var Ua=$("<div>");Ua.appendTo(ya);W.background(Ua,"no_data_cloud");I.layoutCtrlCenterAlign(Ua,138);I.layoutCtrl(Ua,null,0,null,80);Ua=$("<div>");Ua.text(n.get("addTable","\u6dfb\u52a0\u6570\u636e\u8868"));Ua.attr("title",n.get("addTable","\u6dfb\u52a0\u6570\u636e\u8868"));
Ua.on("click",w);Ua.appendTo(ya);Ua.addClass("modeler-designer-sourcearea-text-add")}ya.show()}};ba.FieldArea=function(){var R,va,Ia,Sa,ka,ya,H,ea,Ja,Za,w,da,N,xa,Ya=!1,La=[];this.getJqUi=function(){if(!R){R=$("<div>");R.addClass("modeler-designer-workarea");R.addClass("modeler-designer-common-border");Ia=$("<div>");Ia.addClass("modeler-designer-workarea-title");var fb=$("<div>");fb.addClass("metric-designer-field-area-title-text");fb.text(n.get("field","\u5b57\u6bb5"));Ia.append(fb);va=$("<div>");
va.addClass("modeler-designer-workarea-container");Ja=new D;Ja.setBorderVisible(!1);Ja.setToggleSelectingEnabled(!1);Ja.setCustomItemPainter(ja);Ja.setCustomSelectedsPainter(Ca);Ja.addSelectedChangedListener(Ta);Za=Ja.getJqUi();Za.appendTo(va);I.layoutCtrlWithLRTB(Za,0,0,null,30,0,null);R.append(Ia);R.append(va);Na();Ja.setItemModels(La)}return R};this.setGlobal=function(fb){w=fb};this.setModelerModel=function(fb){N&&N.removePropertyChangeCallback(ib);N=fb;N.addPropertyChangeCallback(ib)};this.setTable=
function(fb){da=fb;db();sa()};this.setExceptionTable=function(fb,Ua){da=fb;db();switch(Ua){case X.TYPE_TABLE_NOT_EXIST:case X.TYPE_MODEL_DAMAGE:case X.TYPE_MODEL_NOT_EXIST:case X.TYPE_MODEL_CYCLE_REFERENCE:case X.TYPE_REF_PUBLIC_SOURCE_NOT_EXIST:Za&&Za.hide();Sa&&Sa.hide();ea?ea.show():(ea=$("<div>"),ea.addClass("metric-designer-field-area-no-data-view"),ea.appendTo(va),fb=$("<div>"),W.background(fb,"no_data_cloud"),fb.addClass("modeler-designer-tablearea-notable-icon"),fb.appendTo(ea),fb=$("<div>"),
fb.addClass("metric-designer-field-area-no-data-text"),fb.text(n.get("noFieldInfo","\u65e0\u6cd5\u83b7\u53d6\u5b57\u6bb5\u4fe1\u606f")),fb.appendTo(ea));break;case X.TYPE_DB_CONNECTION_FAIL:fb=da.getSelectedFields();Ja.setItemModels(fb);H?H.show():(H=ba.SourceUtil.createExceptionIcon(n.get("showUsedField","\u8be5\u6570\u636e\u8868\u65e0\u6cd5\u4f7f\u7528\uff0c\u4ec5\u5c55\u793a\u5728\u6a21\u578b\u8bbe\u8ba1\u4e2d\u5df2\u4f7f\u7528\u7684\u5b57\u6bb5\u3002")),H.addClass("metric-designer-field-area-title-exception-icon"),
H.appendTo(Ia));break;case X.TYPE_INVALID_TABLE_FILTER:sa();break;default:Za&&Za.hide(),Sa&&Sa.hide(),ya?ya.show():(ya=$("<div>"),ya.addClass("metric-designer-field-area-no-permission-view"),ya.appendTo(va),fb=$("<div>"),fb.addClass("modeler-designer-tablearea-nopermission-icon"),W.background(fb,"no-permission"),fb.appendTo(ya),fb=$("<div>"),fb.addClass("metric-designer-field-area-no-permission-text"),fb.text(n.get("noTablePermission","\u60a8\u6ca1\u6709\u8be5\u6570\u636e\u8868\u7684\u6743\u9650")),
fb.appendTo(ya))}};var db=function(){ya&&ya.hide();ea&&ea.hide();xa&&xa.clear();La=[];H&&H.hide()},sa=function(){var fb=ba.SourceUtil.getTableSource(w,da),Ua=new d(w.getRemoteImpl(),function(jb){var pb=jb[da.getUid()];jb=[];for(var qb=0;qb<pb.length;qb++){var tb=new v;tb.fromJsonObject(pb[qb]);jb.push(tb)}if(pb=da.getSelectedFields())for(La=[],qb=0;qb<pb.length;qb++)for(tb=0;tb<jb.length;tb++){if(pb[qb].getName()==jb[tb].getName()){La.push(jb[tb]);break}}else La=jb;Ja.setItemModels(La);Za&&Za.show();
Sa&&Sa.show()});Ua.setShowBlocking(!1);fb&&da&&Ua.getTableField([fb],[da])},Na=function(){xa=new K;xa.setSearchListenerDelay(1E3);xa.setShowSearchIcon(!0);xa.setPlaceholder(n.get("searchField","\u8bf7\u8f93\u5165\u5b57\u6bb5\u540d\u79f0"));xa.addSearchListener(function(){Fa($.trim(xa.getText()))});Sa=xa.getJqUi();Sa.addClass("modeler-designer-tablearea-search-box");Sa.appendTo(va);Sa.find(":input").on("keydown",function(fb){13==(fb.keyCode||fb.which||fb.charCode)&&Fa($.trim(xa.getText()))})},Fa=function(fb){if(0!=
La.length)if(ka&&ka.hide(),""===fb)Ya&&(Ya=!1,Ja.setItemModels(La));else{Ya=!0;fb=fb.toLowerCase();for(var Ua=[],jb=0;jb<La.length;jb++)-1!=La[jb].getAlias().toLowerCase().indexOf(fb)&&Ua.push(La[jb]);0==Ua.length&&(ka?ka.show():(ka=$("<div>"),ka.addClass("modeler-designer-tablearea-noresult-tip"),ka.text(n.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),ka.appendTo(Za)));Ja.setItemModels(Ua)}},ja=function(fb,Ua){fb.css("height","23px");fb.css("cursor",
"pointer");var jb=Ua.getAlias();Ua=Ua.getOutputDataType();var pb=$("<div>");pb.text(jb);if(Ua){var qb=$("<div>");qb.addClass("metric-designer-field-area-icon");W.background(qb,Ua);qb.appendTo(fb);pb.addClass("metric-designer-field-area-text")}else pb.css("position","absolute"),pb.css("top","2px");fb.attr("title",jb);pb.appendTo(fb)},Ca=function(fb,Ua){Ua&&0<Ua.length&&(fb&&0<fb.length&&(fb=fb[0],fb.css("background-color",""),fb.css("color","")),Ua=Ua[0],Ua.css("background-color","#eff3fd"),Ua.css("color",
"rgb(130, 130, 130)"))},Ta=function(){},ib=function(fb,Ua){fb==h.KEY_REMOVE_TABLE&&0==w.getModelerModel().getAllTable(!1).length?(da=null,La=[],Ja.setItemModels(La),ka&&ka.hide()):fb==h.KEY_TABLE_SELECT_FIELD&&Ua==da&&ka&&ka.hide()}};var n,Ba,I,P,D,W,la,Ea,ra,K,pa,za,na,y,S,T,m,r,qa,k,d,b,a,l,c,e,g,v,u,h,B,F,J,C,p,f,t,q,z,L,E,M,x,U,ua,Aa,bb,fa,Oa,aa,wa,Pa,V,X,ha,Wa,G;(function(){var R=com.kingdee.bos.qing.framework.common;n=R.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer);
Ba=R.WindowResizeObserver;R=com.kingdee.bos.qing.common;I=R.DomUtil;P=R.DateFormater;bb=R.RelativePeriodModel;R=com.kingdee.bos.qing.common.ui;r=R.TableUtil;z=R.CommonIconUtil;Aa=R.RelativePeriodPanel;R=com.kingdee.bos.qing.ui.component;D=R.List;Ea=R.WizardDialog;ra=R.SplitPane;K=R.SearchBox;pa=R.CheckBox;za=R.Label;na=R.Menu;y=R.MenuModel;S=R.MessageDialog;T=R.SwitchButton;t=R.AbstractModalDialog;q=R.Button;L=R.ComboBox;M=R.DropdownSelector;x=R.F7Selector;U=R.DateSelector;ua=R.DateTimeSelector;Pa=
R.TextArea;m=R.Tips;R=com.kingdee.bos.qing.modeler.designer.metricdesigner;fa=R.DeleteTableAction;Oa=R.BatchAddTableAction;aa=R.SelectFieldAction;V=R.ChangeFilterAction;X=R.MetricModelerInvalidityCase;ha=R.ModelerChecker;R=com.kingdee.bos.qing.modeler.designer;W=R.Icons;la=R.SourceListPanel;qa=R.ModelSetSourceIntegration;k=R.AbstractModelerSource;d=R.DesignerFacade;b=R.FolderNode;a=R.LeafNode;l=R.DesignTimeSource;c=R.SelectFieldFactory;e=R.Meta;g=R.Table;u=R.UIDHelper;h=R.ModelerModel;B=R.MetricEntitySource;
F=R.MetricDataCenterSource;J=R.MetricDefaultSource;C=R.MetricModelSetSource;p=R.SelectFieldView;v=R.Field;f=R.PreviewData;E=R.FilterItem;wa=R.FilterCheckHelper;Wa=R.QingModeler;G=R.UserOperationReporter})();ba.ImportTableStepCreator=new function(){var R;this.registerCreator=function(va,Ia){R[va]=Ia};this.getSteps=function(va,Ia){if(!R){R={};var Sa=new B,ka=new F,ya=new J,H=new C;R[k.SOURCE_TYPE_PUBLIC_DATA_SOURCE]=ya;R[k.SOURCE_TYPE_CURRENT_ENTITY_SOURCE]=Sa;R[k.SOURCE_TYPE_CURRENT_DATACENTER_SOURCE]=
ka;R[k.SOURCE_TYPE_MODELSET_FILE_SOURCE]=ya;R[k.SOURCE_TYPE_MODELSET_DB_SOURCE]=ya;R[k.SOURCE_TYPE_MODEL_SET_SOURCE]=H;R[k.SOURCE_TYPE_OPEN_API_SOURCE]=ya}Sa=va.getSourceType();ka=R[Sa];Sa=new Xa;Sa.setGlobal(Ia);Sa.setSource(va);Sa.setSourceUiModel(ka);va=new ca;va.setGlobal(Ia);return[Sa,va]}};var Ka=!1})();(function(){function ta(){na.call(this);var m=this.protectedMethod,r=P.get("aggregate","\u805a\u5408"),qa=m.createType([mb,Xa,ca,Y,Ma,oa]),k=I.get("func_type_business","\u4e1a\u52a1"),d=m.createType([A]),b=I.get("func_type_predefine","\u8de8\u7ef4\u5ea6\u9884\u8ba1\u7b97"),a=m.createType([Q,Z,O,ia,Ha]),l=I.get("func_type_derivative","\u89c6\u56fe\u8ba1\u7b97"),c=m.createType([ba,n]),e=[m.Type_All,m.Type_String,m.Type_Date,m.Type_Logic,m.Type_Math,m.Type_Conversion,r],g=m.joinTypes([m.Functions_String,
m.Functions_Date,m.Functions_Logic,m.Functions_Math,m.Functions_Conversion,a,c,qa]);this.getTypes=function(){return e};this.getFunctions=function(u){var h=m.getBasicFunctions(u)||v(u);if(!h){if(u==m.Type_All)return g;throw Error("Unknown function type.");}return h};var v=function(u){switch(u){case r:return qa;case k:return d;case b:return a;case l:return c;default:return null}}}function Da(){var m=[],r=[],qa;this.add=function(k,d){m.push(k);r.push(d)};this.getCount=function(){return m.length};this.getName=
function(k){return m[k]};this.getDesc=function(k){return r[k]};this.setExtraDesc=function(k){qa=k};this.getExtraDesc=function(){return qa}}function Va(){var m,r=this;this.getName=function(){throw Error("Override me.");};this.getDesc=function(){throw Error("Override me.");};this.getSyntax=function(){return null};this.getReturn=function(){return null};this.getExample=function(){return null};this.getParameters=function(){m||null===m||(m=r.protectedCreateParamsImpl());return m};this.protectedCreateParamsImpl=
function(){return null};this.getTyping=function(){return r.getName()+"()"};this.protectedMethod={Tab:"&nbsp;&nbsp;&nbsp;&nbsp;",NextLine:"<br/>",NextLineTab:"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"}}function mb(){Va.call(this);this.protectedCreateParamsImpl=function(){var m=new Da;m.add("exp",P.get("SUM_PARAM","\u6570\u503c\u8868\u8fbe\u5f0f\u3002"));return m};this.getName=function(){return"SUM"};this.getDesc=function(){return P.get("SUM_DESC","\u8fd4\u56de\u6570\u503c\u8868\u8fbe\u5f0f\u6240\u6709\u503c\u7684\u603b\u8ba1\uff0c\u4e14\u4f1a\u5ffd\u7565null\u503c\u3002")};
this.getSyntax=function(){return"SUM(exp)"};this.getExample=function(){return P.get("SUM_EXAMPLE",'SUM([\u9500\u552e\u989d])\uff0c\u8fd4\u56de"\u9500\u552e\u989d"\u5b57\u6bb5\u5bf9\u5e94\u7684\u6240\u6709\u975e\u7a7a\u503c\u7684\u603b\u548c\u3002')}}function Xa(){Va.call(this);this.protectedCreateParamsImpl=function(){var m=new Da;m.add("exp",P.get("AVG_PARAM","\u6570\u503c\u8868\u8fbe\u5f0f\u3002"));return m};this.getName=function(){return"AVG"};this.getDesc=function(){return P.get("AVG_DESC","\u8fd4\u56de\u6570\u503c\u8868\u8fbe\u5f0f\u6240\u6709\u503c\u7684\u5e73\u5747\u503c\uff0c\u4e14\u4f1a\u5ffd\u7565null\u503c\u3002")};
this.getSyntax=function(){return"AVG(exp)"};this.getExample=function(){return P.get("AVG_EXAMPLE",'AVG([\u9500\u552e\u989d])\uff0c\u8fd4\u56de"\u9500\u552e\u989d"\u5b57\u6bb5\u5bf9\u5e94\u7684\u6240\u6709\u975e\u7a7a\u503c\u7684\u5e73\u5747\u503c\u3002')}}function ca(){Va.call(this);this.protectedCreateParamsImpl=function(){var m=new Da;m.add("exp",P.get("COUNT_PARAM","\u8868\u8fbe\u5f0f\u3002"));return m};this.getName=function(){return"COUNT"};this.getDesc=function(){return P.get("COUNT_DESC","\u8fd4\u56de\u6570\u636e\u6761\u76ee\u6570\uff0c\u4e14\u8868\u8fbe\u5f0f\u7684\u503c\u4e3anull\u65f6\u4e0d\u4f1a\u8ba1\u6570\u3002")};
this.getSyntax=function(){return"COUNT(exp)"};this.getExample=function(){return P.get("COUNT_EXAMPLE",'COUNT([\u9500\u552e\u989d]),\u8fd4\u56de"\u9500\u552e\u989d"\u5b57\u6bb5\u5bf9\u5e94\u7684\u6240\u6709\u975e\u7a7a\u503c\u7684\u6570\u636e\u6761\u76ee\u6570\u3002\u5982\u9500\u552e\u989d\u5b57\u6bb5\u67091000\uff0c1000\uff0c500 \u5171\u4e09\u4e2a\u6570\u503c\uff0c\u5219COUNT([\u9500\u552e\u989d])\u7ed3\u679c\u4e3a3\u3002')}}function Y(){Va.call(this);this.protectedCreateParamsImpl=function(){var m=
new Da;m.add("exp",P.get("MAX_PARAM","\u6570\u503c\u8868\u8fbe\u5f0f\u3002"));return m};this.getName=function(){return"MAX"};this.getDesc=function(){return P.get("MAX_DESC","\u8fd4\u56de\u6570\u503c\u8868\u8fbe\u5f0f\u6240\u6709\u503c\u7684\u6700\u5927\u503c\u3002")};this.getSyntax=function(){return"MAX(exp)"};this.getExample=function(){return P.get("MAX_EXAMPLE",'MAX([\u9500\u552e\u989d])\uff0c\u8fd4\u56de"\u9500\u552e\u989d"\u5b57\u6bb5\u5bf9\u5e94\u503c\u7684\u6700\u5927\u503c\u3002')}}function Ma(){Va.call(this);
this.protectedCreateParamsImpl=function(){var m=new Da;m.add("exp",P.get("MIN_PARAM","\u6570\u503c\u8868\u8fbe\u5f0f\u3002"));return m};this.getName=function(){return"MIN"};this.getDesc=function(){return P.get("MIN_DESC","\u8fd4\u56de\u6570\u503c\u8868\u8fbe\u5f0f\u6240\u6709\u503c\u7684\u6700\u5c0f\u503c\u3002")};this.getSyntax=function(){return"MIN(exp)"};this.getExample=function(){return P.get("MIN_EXAMPLE",'MIN([\u9500\u552e\u989d])\uff0c\u8fd4\u56de"\u9500\u552e\u989d"\u5b57\u6bb5\u5bf9\u5e94\u503c\u7684\u6700\u5c0f\u503c\u3002')}}
function oa(){Va.call(this);this.protectedCreateParamsImpl=function(){var m=new Da;m.add("exp",P.get("COUNTD_PARAM","\u8868\u8fbe\u5f0f\u3002"));return m};this.getName=function(){return"COUNTD"};this.getDesc=function(){return P.get("COUNTD_DESC","\u8fd4\u56de\u6307\u5b9a\u5b57\u6bb5\u4e0d\u91cd\u590d\u7684\u503c\u7684\u4e2a\u6570\uff0c\u5f53\u503c\u4e3anull\u65f6\u4e0d\u53c2\u4e0e\u8ba1\u6570\u3002")};this.getSyntax=function(){return"COUNTD(exp)"};this.getExample=function(){return P.get("COUNTD_EXAMPLE",
'\u5047\u8bbe\u82e5\u5e72\u884c\u6570\u636e\u4e2d\uff0c"\u6027\u522b"\u5b57\u6bb5\u6709"\u7537"\u3001"\u5973"\u4e24\u4e2a\u4e0d\u540c\u7684\u503c\uff0c\u5219COUNTD([\u6027\u522b])\uff0c\u8fd4\u56de2\u3002')}}function A(){Va.call(this);this.protectedCreateParamsImpl=function(){var m=new Da;m.add("org",I.get("ACCT_param","\u6838\u7b97\u7ec4\u7ec7\uff1a\u4e0d\u53ef\u4e3a\u7a7a\u3002"));m.add("accountBooksType",I.get("ACCT_param","\u8d26\u7c3f\u7c7b\u578b\uff1a\u53ef\u4e3a\u7a7a\u3002"));m.add("account",
I.get("ACCT_param","\u79d1\u76ee\u53ca\u6838\u7b97\u7ef4\u5ea6\u6210\u5458\uff1a\u4e0d\u53ef\u4e3a\u7a7a\uff0c\u6838\u7b97\u7ef4\u5ea6\u6210\u5458\u652f\u6301@\u901a\u914d\u7b26\uff0c\u9700\u8981\u5728\u5408\u5e76\u62a5\u8868\u7684\u96c6\u6210\u89c4\u5219\u4e2d\u914d\u7f6e\u7ef4\u5ea6\u6620\u5c04\u3002"));m.add("fetchType",I.get("ACCT_param","\u53d6\u6570\u7c7b\u578b\uff1a\u4e0d\u53ef\u4e3a\u7a7a\u3002"));m.add("fy",I.get("ACCT_param","\u4f1a\u8ba1\u5e74\u5ea6\uff1a\u4e0d\u53ef\u4e3a\u7a7a\uff0c\u652f\u6301\u76f8\u5bf9\u503c\uff0c\u5f55\u5165\u56db\u4f4d\u8868\u793a\u7edd\u5bf9\u5e74\u5ea6\uff0c\u5f55\u5165\u5c0f\u4e8e\u56db\u4f4d\u7684\u6574\u6570\u30010\u6216\u8005\u8d1f\u6574\u6570\u8868\u793a\u76f8\u5bf9\u503c\u3002"));
m.add("period",I.get("ACCT_param","\u4f1a\u8ba1\u671f\u95f4\uff1a\u4e0d\u53ef\u4e3a\u7a7a\uff0c\u652f\u6301\u76f8\u5bf9\u503c\uff0c\u5f55\u5165\u5927\u4e8e0\u7684\u6b63\u6574\u6570\u8868\u793a\u7edd\u5bf9\u671f\u95f4\uff0c\u5f55\u51650\u6216\u8005\u8d1f\u6574\u6570\u8868\u793a\u76f8\u5bf9\u503c\u3002"));m.add("currency",I.get("ACCT_param","\u5e01\u522b\uff1a\u53ef\u4e3a\u7a7a\u3002"));m.add("reClassParam",I.get("ACCT_param","\u91cd\u5206\u7c7b\u53c2\u6570\uff1a\u53ef\u4e3a\u7a7a\u3002"));m.add("contraAccount",
I.get("ACCT_param","\u79d1\u76ee\u62b5\u9500\uff1a\u53ef\u4e3a\u7a7a\u3002"));m.add("commonAssist",I.get("ACCT_param","\u516c\u5171\u7ef4\u5ea6\uff1a\u53ef\u4e3a\u7a7a\u3002"));return m};this.getName=function(){return"ACCT"};this.getDesc=function(){return I.get("ACCT_DESC","\u83b7\u53d6\u603b\u8d26\u4f1a\u8ba1\u79d1\u76ee\u6570\u636e\u3002\u53ef\u5728\u5e94\u7528\u5408\u5e76\u62a5\u8868->\u7cfb\u7edf\u914d\u7f6e->\u62a5\u8868\u6a21\u7248\u4e2d\u63d2\u5165\u51fd\u6570\u4e2d\u7f16\u8f91\u597d\u516c\u5f0f\u3002")};
this.getSyntax=function(){return"ACCT(org, accountBooksType, account, fetchType, fy, period, currency, reClassParam, contraAccount, commonAssist)"};this.getExample=function(){return I.get("ACCT_EXAMPLE",'SUM(ACCT([\u6838\u7b97\u7ec4\u7ec7],[\u8d26\u7c3f\u7c7b\u578b],"0316|0001|country:001","LY",[\u4f1a\u8ba1\u5e74\u5ea6],"[\u4f1a\u8ba1\u671f\u95f4]","CNY20783","6","N",""))\uff0c\u8fd4\u56de\u201c\u6838\u7b97\u7ec4\u7ec7\u201d\u3001\u201d\u8d26\u7c3f\u7c7b\u578b\u201c\u3001\u201d\u4f1a\u8ba1\u5e74\u5ea6\u201c\u3001\u201d\u4f1a\u8ba1\u671f\u95f4\u201c\u5b57\u6bb5\u5bf9\u5e94\u7684\u6240\u6709\u603b\u8d26\u4f1a\u8ba1\u6570\u636e\u4e4b\u548c\u3002')}}
function Q(){Va.call(this);this.protectedCreateParamsImpl=function(){};this.getName=function(){return"PREDEFINE"};this.getDesc=function(){};this.getSyntax=function(){};this.getExample=function(){}}function Z(){Va.call(this);this.protectedCreateParamsImpl=function(){};this.getName=function(){return"DIMENSIONS"};this.getDesc=function(){};this.getSyntax=function(){};this.getExample=function(){}}function O(){Va.call(this);this.protectedCreateParamsImpl=function(){};this.getName=function(){return"MOREDIMENSIONS"};
this.getDesc=function(){};this.getSyntax=function(){};this.getExample=function(){}}function ia(){Va.call(this);this.protectedCreateParamsImpl=function(){};this.getName=function(){return"LESSDIMENSIONS"};this.getDesc=function(){};this.getSyntax=function(){};this.getExample=function(){}}function Ha(){Va.call(this);this.protectedCreateParamsImpl=function(){};this.getName=function(){return"DATEPART"};this.getDesc=function(){};this.getSyntax=function(){};this.getExample=function(){}}function ba(){Va.call(this);
var m=this.protectedMethod;this.protectedCreateParamsImpl=function(){var r=new Da;r.add("exp",I.get("SPLY_PARAM1","\u8868\u8fbe\u5f0f\uff0c\u53ef\u4f7f\u7528\u6307\u6807\u6216\u81ea\u5b9a\u4e49\u7684\u805a\u5408\u51fd\u6570\u8868\u8fbe\u5f0f\u3002"));r.add("dateDimension",I.get("SPLY_PARAM2","\u65e5\u671f\u7ef4\u5ea6\u3002"));r.add("type",I.get("SPLY_PARAM3",'\u7f3a\u7701\u76f8\u5f53\u4e8e"ratio"\uff0c\u8868\u793a\u540c\u6bd4\u589e\u957f\u7387\uff1b"value"\u8868\u793a\u53d6\u53bb\u5e74\u540c\u671f\u503c\uff1b"diff"\u8868\u793a\u540c\u6bd4\u5dee\u989d\u3002'));
return r};this.getName=function(){return"SAMEPERIODLASTYEAR"};this.getDesc=function(){return I.get("SPLY_DESC","\u57fa\u4e8e\u6307\u5b9a\u65e5\u671f\u7ef4\u5ea6\u7684\u540c\u6bd4\u8ba1\u7b97\u3002")};this.getSyntax=function(){return"SAMEPERIODLASTYEAR(exp, dateDimension [,type])"};this.getExample=function(){return I.get("SPLY_EXAMPLE","\u4f8b1\uff1aSAMEPERIODLASTYEAR([\u9500\u552e\u989d], [\u8ba2\u5355\u65e5\u671f(\u5e74)]) \u8ba1\u7b97\u9500\u552e\u989d\u6309\u8ba2\u5355\u65e5\u671f(\u5e74)\u7684\u540c\u6bd4\u589e\u957f\u7387\u3002"+
m.NextLineTab+'\u4f8b2\uff1aSAMEPERIODLASTYEAR(SUM([\u91d1\u989d]), [\u8ba2\u5355\u65e5\u671f(\u5e74)], "value") \u8ba1\u7b97\u91d1\u989d\u5408\u8ba1\u503c\u6309\u8ba2\u5355\u65e5\u671f(\u5e74)\u7684\u53bb\u5e74\u540c\u671f\u503c\u3002')}}function n(){Va.call(this);var m=this.protectedMethod;this.protectedCreateParamsImpl=function(){var r=new Da;r.add("exp",I.get("LP_PARAM1","\u8868\u8fbe\u5f0f\uff0c\u53ef\u4f7f\u7528\u6307\u6807\u6216\u81ea\u5b9a\u4e49\u7684\u805a\u5408\u51fd\u6570\u8868\u8fbe\u5f0f\u3002"));
r.add("dateDimension",I.get("LP_PARAM2","\u65e5\u671f\u7ef4\u5ea6\u3002"));r.add("type",I.get("LP_PARAM3",'\u7f3a\u7701\u76f8\u5f53\u4e8e"ratio"\uff0c\u8868\u793a\u73af\u6bd4\u589e\u957f\u7387\uff1b"value"\u8868\u793a\u53d6\u4e0a\u671f\u503c\uff1b"diff"\u8868\u793a\u73af\u6bd4\u5dee\u989d\u3002'));return r};this.getName=function(){return"LASTPERIOD"};this.getDesc=function(){return I.get("LP_DESC","\u57fa\u4e8e\u6307\u5b9a\u65e5\u671f\u7ef4\u5ea6\u7684\u73af\u6bd4\u8ba1\u7b97\u3002")};this.getSyntax=
function(){return"LASTPERIOD(exp, dateDimension [,type])"};this.getExample=function(){return I.get("LP_EXAMPLE","\u4f8b1\uff1aLASTPERIOD([\u9500\u552e\u989d], [\u8ba2\u5355\u65e5\u671f(\u5e74)]) \u8ba1\u7b97\u9500\u552e\u989d\u6309\u8ba2\u5355\u65e5\u671f(\u5e74)\u7684\u73af\u6bd4\u3002"+m.NextLineTab+'\u4f8b2\uff1aLASTPERIOD(SUM([\u91d1\u989d]), [\u8ba2\u5355\u65e5\u671f(\u5e74)], "diff") \u8ba1\u7b97\u91d1\u989d\u5408\u8ba1\u503c\u6309\u8ba2\u5355\u65e5\u671f(\u5e74)\u7684\u73af\u6bd4\u5dee\u989d\u3002')}}
"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.metricdesigner&&(com.kingdee.bos.qing.modeler.designer.metricdesigner=
{});var Ba=com.kingdee.bos.qing.modeler.designer.metricdesigner;Ba.ExprPane=function(){function m(){var p,f,t;this.getJqUi=function(){p||(p=$("<div>"),f=$("<div>"),t=$("<div>"),W.layoutCtrl(t,0,null,16,16),W.layoutCtrlMiddleAlign(t,16),W.layoutCtrlMiddleAlign(f,16),W.makeTextOmissible(f),f.css("max-width","380px"),f.css("left","20px"),t.appendTo(p),f.appendTo(p));return p};this.setValidity=function(q){q.isValid()?(f.text(I.get("formulaValid","\u8868\u8fbe\u5f0f\u5408\u6cd5")),f.attr("title",I.get("formulaValid",
"\u8868\u8fbe\u5f0f\u5408\u6cd5")),f.css("color","#80ba55"),za.background(t,"tick")):(f.text(q.getPrompt()),f.attr("title",q.getPrompt()),f.css("color","#fd6c6a"),za.background(t,"cross"))}}var r,qa,k,d,b,a,l,c,e=!1;this.getJqUi=function(){if(!r){r=$("<div>");var p=new la(I.get("expression","\u8868\u8fbe\u5f0f"));p.setRequired(!0);p=p.getJqUi();W.layoutCtrl(p,0,0,70,20);d=new Ea;d.addEditedListener(F);var f=d.getJqUi();W.layoutCtrlWithLRTB(f,0,0,null,30,270,null);l=new m;var t=l.getJqUi();W.layoutCtrlWithLRTB(t,
70,0,null,0,null,20);var q=(new la(I.get("function","\u51fd\u6570"))).getJqUi();W.layoutCtrlWithLRTB(q,0,null,230,null,240,23);var z=(new la(I.get("functionDescription","\u51fd\u6570\u8bf4\u660e"))).getJqUi();W.layoutCtrlWithLRTB(z,250,0,null,null,240,23);b=$("<div>");b.addClass("sa-common-border");b.css("overflow-y","auto");W.layoutCtrlWithLRTB(b,250,0,null,null,0,233);var L=g();W.layoutCtrlWithLRTB(L,0,null,230,null,0,240);p.appendTo(r);f.appendTo(r);t.appendTo(r);q.appendTo(r);z.appendTo(r);b.appendTo(r);
L.appendTo(r)}return r};this.getExpr=function(){return Ba.ExprRefHelper.translateToExeExpr($.trim(d.getText()),c?c():{})};this.setExpr=function(p){p&&(d.setText(Ba.ExprRefHelper.translateToDisplayExpr(p)),C(p))};this.setFieldMapGetter=function(p){c=p};this.setGlobal=function(p){qa=p};this.setCurrentMetricId=function(p){k=p};this.addExprReference=function(p){p=Ba.ExprRefHelper.getRefFullDisplayText(p);h(p)};this.checkValidity=function(){if(0==$.trim(d.getText()).length)return I.get("exprEmpty","\u8868\u8fbe\u5f0f\u4e0d\u80fd\u4e3a\u7a7a\u3002");
if(e)return I.get("exprChecking","\u8868\u8fbe\u5f0f\u6821\u9a8c\u4e2d\uff0c\u8bf7\u7a0d\u7b49\u3002");if(a&&!a.isValid())return I.get("checkExprFirst","#1\uff0c\u8bf7\u586b\u5199\u6b63\u786e\u7684\u8868\u8fbe\u5f0f\u3002").replace("#1",a.getPrompt())};var g=function(){var p=$("<div>"),f=Ba.QingModelerFunctionProvider.getAllTypes(),t=f[f.length-1],q=new pa;q.setBorderVisible(!1);q.setMultiSelectable(!1);q.setCustomItemPainter(function(x,U){x.text(U.getName())});q.addDBLClickListener(function(x){x=
q.getSelecteds()[0];h(x.getTyping())});q.addPressedListener(function(x,U){x=q.getSelecteds()[0];v(x)});var z=Ba.QingModelerFunctionProvider.getFunctions(t);q.setItemModels(z);q.setSelecteds([z[0]]);v(z[0]);var L=new ra;L.setItemModels(f);L.setSelected(t);L.addSelectedChangedListener(function(x,U,ua){E.clear();x=Ba.QingModelerFunctionProvider.getFunctions(L.getSelected());q.setItemModels(x)});var E=new K;E.setPlaceholder(D.get("searchboxPlaceholder","\u641c\u7d22"));E.addSearchListener(function(x){x=
$.trim(E.getText()).toUpperCase();var U=[],ua=Ba.QingModelerFunctionProvider.getFunctions(L.getSelected());if(x)for(var Aa=0;Aa<ua.length;Aa++)0<=ua[Aa].getName().indexOf(x)&&U.push(ua[Aa]);else U=ua;q.setItemModels(U)});f=$("<div>");f.addClass("sa-common-border");t=E.getJqUi();z=q.getJqUi();var M=L.getJqUi();W.layoutCtrlWithLRTB(t,0,0,null,0,null,23);W.layoutCtrlWithLRTB(z,0,0,null,24,0,null);t.appendTo(f);z.appendTo(f);W.layoutCtrlWithLRTB(M,0,0,null,0,null,23);W.layoutCtrlWithLRTB(f,0,0,null,30,
0,null);f.appendTo(p);M.appendTo(p);return p},v=function(p){if(p){var f="<div style=padding:10px;color:#666>";p.getDesc()&&(f+=D.get("descFeature","\u529f\u80fd\uff1a"),f=f+"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+u(p.getDesc()));p.getSyntax()&&(f=f+"<br/><br/>"+D.get("descGrammar","\u8bed\u6cd5\uff1a"),f=f+"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+u(p.getSyntax()));var t=p.getParameters();if(t){f=f+"<br/><br/>"+D.get("descParams","\u53c2\u6570\uff1a");for(var q=0;q<t.getCount();q++)f+=
"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",f+=t.getName(q),f+=" ",f+=u(t.getDesc(q));(t=t.getExtraDesc())&&(f=f+"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+u(t))}t=p.getReturn();q=p.getExample();t&&(f=f+"<br/><br/>"+D.get("descReturn","\u8fd4\u56de\u503c\uff1a"),f=f+"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+u(p.getReturn()));q&&(f=f+"<br/><br/>"+D.get("descExamples","\u793a\u4f8b\uff1a"),f=f+"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+u(p.getExample()));
b.html(f+"</div>")}},u=function(p){for(;-1!=p.indexOf("<");)p=p.replace("<","&lt;");for(;-1!=p.indexOf("&lt;br/>");)p=p.replace("&lt;br/>","<br/>");return p},h=function(p){var f=d.getSelectingScope(),t=f[0];f=f[1];var q=d.getText();q=q.substring(0,t)+p+q.substring(f);d.setText(q);t+=p.length;p.match("\\(\\)")&&--t;d.setSelectingScope(t,t);d.requestFocus();F()},B,F=function(){clearTimeout(B);e=!0;B=setTimeout(function(){var p=Ba.ExprRefHelper.translateToExeExpr($.trim(d.getText()),c?c():{});C(p)},
1E3)},J,C=function(p){var f=new y(qa.getRemoteImpl(),function(z){J==p&&(a=new T,a.fromJsonObject(z),l.setValidity(a),e=!1)}),t=new S,q=qa.getModelerModel();t.setModelerModel(q);f.setShowBlocking(!1);q=c?c():{};J=p;f.checkMetricFormula(p,t,q,k)}};var I,P,D,W,la,Ea,ra,K,pa,za,na,y,S,T;(function(){var m=com.kingdee.bos.qing.framework.common;I=m.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer);P=m.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.functions);
D=m.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.common.ui);m=com.kingdee.bos.qing.common;W=m.DomUtil;m=com.kingdee.bos.qing.ui.component;la=m.Label;Ea=m.TextArea;ra=m.ComboBox;K=m.SearchBox;pa=m.List;m=com.kingdee.bos.qing.functions;na=m.AbstractFunctionProvider;m=com.kingdee.bos.qing.modeler.designer;S=m.QingModeler;y=m.DesignerFacade;za=m.Icons;T=Ba.ExprValidity})();Ba.QingModelerFunctionProvider=new function(){var m;this.getAllTypes=function(){m||(m=new ta);return m.getTypes()};
this.getFunctions=function(r){m||(m=new ta);return m.getFunctions(r)}}})();(function(){function ta(){var m=this,r,qa,k,d;this.getJqUi=function(){r||(r=$("<div>"),b(r,a().getJqUi()));return r};var b=function(l,c){var e=new D;e.setText(oa.get("search","\u641c\u7d22"));var g=m.createAllSearchImpl();m.changeSearchImpl(g[0],!1);var v=new P;v.setItemModels(g);v.setSelected(g[0]);v.setCustomPainter(function(u,h,B){B&&h.text(B.getCaption())});v.addSelectedChangedListener(function(u,h,B){m.changeSearchImpl(B,!0)});e=e.getJqUi();v=v.getJqUi();A.layoutCtrlWithLRTB(e,0,null,40,0,null,
23);A.layoutCtrlWithLRTB(v,40,null,80,0,null,23);A.layoutCtrlWithLRTB(c,130,0,null,0,null,23);l.append(e);l.append(v);l.append(c)};this.setSearchingHandler=function(l){d=l};this.isSearching=function(){return m.getSearchText()?!0:!1};this.check=function(l){return!m.getSearchText()||k.check(l.toLowerCase(),m.getSearchText().toLowerCase())};this.clear=function(){qa&&qa.clear()};this.createAllSearchImpl=function(){return[new Va(!0),new Va(!1),new Xa(!0),new Xa(!1),new ca(!0),new ca(!1),new mb(!0),new mb(!1)]};
var a=function(){qa=new Ba;qa.setShowSearchIcon(!0);qa.setPlaceholder(oa.get("searcherTips","\u641c\u7d22\u5185\u5bb9"));qa.addSearchListener(function(l){d()});qa.setSearchListenerDelay(1E3);return qa};this.changeSearchImpl=function(l,c){k=l;c&&d()};this.getSearchText=function(){return qa?qa.getText():null};this.search=function(l,c){return k.doMatch(l,c)}}function Da(m){var r=this;this.getCaption=function(){return r.protectedGetCaption(!m)};this.protectedGetCaption=function(qa){throw Error("Override");
};this.check=function(qa,k){qa=r.protectedCheckImpl(qa,k);return m?qa:!qa};this.protectedCheckImpl=function(qa,k){throw Error("Override");};this.doMatch=function(qa,k){k+="";return m?r.protectedCheckImpl(k,qa):!r.protectedCheckImpl(k,qa)}}function Va(m){Da.call(this,m);this.protectedGetCaption=function(r){return r?oa.get("searchNotInclude","\u4e0d\u5305\u542b"):oa.get("searchInclude","\u5305\u542b")};this.protectedCheckImpl=function(r,qa){return 0<=r.indexOf(qa)}}function mb(m){Da.call(this,m);this.protectedGetCaption=
function(r){return r?oa.get("searchNotEqual","\u4e0d\u7b49\u4e8e"):oa.get("searchEqual","\u7b49\u4e8e")};this.protectedCheckImpl=function(r,qa){return r===qa}}function Xa(m){Da.call(this,m);this.protectedGetCaption=function(r){return r?oa.get("searchNotStartOf","\u5f00\u5934\u4e0d\u662f"):oa.get("searchStartOf","\u5f00\u5934\u662f")};this.protectedCheckImpl=function(r,qa){return 0==r.indexOf(qa)}}function ca(m){Da.call(this,m);this.protectedGetCaption=function(r){return r?oa.get("searchNotEndOf",
"\u7ed3\u5c3e\u4e0d\u662f"):oa.get("searchEndOf","\u7ed3\u5c3e\u662f")};this.protectedCheckImpl=function(r,qa){var k=r.lastIndexOf(qa);return 0<=k&&k==r.length-qa.length}}function Y(){var m,r=Y.TYPE_TEXT,qa=oa.get("noDataTips","\u6682\u65e0\u6570\u636e"),k;this.getJqUi=function(){if(!m)switch(m=$("<div>"),m.addClass("modeler-designer-no-data"),r){case Y.TYPE_TEXT:b(qa,"modeler-designer-no-data-only-text");break;case Y.TYPE_NO_SOURCE:d("no_source","modeler-designer-no-data-icon");b(qa,"modeler-designer-no-data-text");
break;case Y.TYPE_NO_SEARCH_RESULT:d("search-no-result","modeler-designer-node-selection-icon");b(qa,"modeler-designer-node-selection-tip");break;case Y.TYPE_NO_DATA_WITH_CLOUD:d("no_data_cloud","modeler-designer-no-data-cloud-icon");b(qa,"modeler-designer-no-data-text");break;default:throw Error("The view type error, please set first.");}return m};this.setType=function(a){r=a};this.setText=function(a){qa=a?a:"";k&&k.text(qa)};var d=function(a,l){var c=$("<div>");c.addClass(l);ra.background(c,a);
c.appendTo(m)},b=function(a,l){k=$("<div>");k.addClass(l);k.text(a);k.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={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.metricdesigner&&
(com.kingdee.bos.qing.modeler.designer.metricdesigner={});var Ma=com.kingdee.bos.qing.modeler.designer.metricdesigner;Ma.MetricsCalculateDialog=function(){function m(V){KTDefaultCellRender.call(this,V);var X=this,ha=this.paintCellUI;this.paintCellUI=function(Wa,G){var Ka=X.getCurrentRowIdx(),R=X.getCurrentRow(),va=X.getCurrentColIdx(),Ia=R.getUserObject();Ka<la.getHeadRowCount()?ha(Wa,G):(G=F.getField(va),Ka=G.getOutputDataType(),Ia=Ia[va],null===Ia||void 0===Ia?Ia="":"DATE"===Ka?(R=new Q,R.setFormatString("yyyy-MM-dd"),
Ia=R.format(Ia)):"DATETIME"===Ka?(R=new Q,R.setFormatString("yyyy-MM-dd HH:mm:ss"),Ia=R.format(Ia)):"BOOLEAN"===Ka?Ia=Ia?"true":"false":"NUMBER"===Ka&&(Ka=new KTStyle,Ka.setTextAlign("right"),R.getCell(va).setStyle(Ka),R=G.getFormat())&&(va=new Z,va.setFormatString(R),Ia=va.format(Ia)),R=$("<div class='metric-designer-trial-calculate-table-cell'>"),R.text(Ia),R.attr("title",Ia),R.appendTo(Wa))}}function r(V,X){function ha(ka,ya,H){function ea(){var Ra,cb,eb;this.setValue=function(ob){Ra=ob};this.getValue=
function(){return Ra};this.setText=function(ob){cb=ob};this.getText=function(){return cb};this.setChecked=function(ob){eb=ob};this.isChecked=function(){return eb}}function Ja(Ra){var cb,eb=new I;this.getJqUi=function(){cb||(eb.setUserObject(Ra.getValue()),eb.setText(Ra.getText()),eb.setChecked(Ra.isChecked()),eb.addCheckedListener(ob),cb=eb.getJqUi(),cb.css("position","relative"));return cb};var ob=function(vb,lb){Ra.setChecked(vb.isChecked());Ga(vb,lb)}}O.call(this);var Za=this,w=this.protectedMethod,
da,N,xa=[],Ya=[],La=!1,db,sa,Na,Fa,ja=new Q,Ca;(function(){w.setTitle(ka.getDimensionModel().getName());w.setSelectable(!0);w.setContentPaneCreator(function(){var Ra=ya.length,cb=Math.max(60,Math.min(parseInt(.9*$(document.body).innerHeight())-180,420));Ra=Math.min(cb,Math.max(60,23*Ra));Ra=Math.max(Ra+180,305);Za.setSize(600,Ra);if(!da){da=$("<div>");Ta(da);Ra=da;cb=$("<div>");A.layoutCtrlWithLRTB(cb,0,0,null,0,null,55);N=new ta;N.setSearchingHandler(pb);var eb=N.getJqUi();A.layoutCtrlWithLRTB(eb,
0,200,null,0,null,23);eb.appendTo(cb);eb=new I;eb.setText(oa.get("showOnlySelected","\u4ec5\u663e\u793a\u9009\u4e2d\u9879"));eb.setChecked(La);eb.addCheckedListener(qb);eb=eb.getJqUi();A.layoutCtrlWithLRTB(eb,null,0,120,4,null,21);eb.appendTo(cb);db=new I;db.setText(oa.get("selectAll","\u5168\u9009"));db.setChecked(0===H.length?!0:H.length===ya.length);db.addCheckedListener(ma);eb=db.getJqUi();A.layoutCtrlWithLRTB(eb,0,null,80,30,null,21);eb.appendTo(cb);sa=new D;eb=sa.getJqUi();A.layoutCtrlWithLRTB(eb,
80,0,null,30,null,21);eb.appendTo(cb);cb.appendTo(Ra);Qa()}return da});w.setClosingChecker(function(){return 0===jb().length?(w.getMessageCurtain().showPrompt(oa.get("noSelectValue","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u7ef4\u5ea6\u503c\u3002"),2E3),!1):!0});w.setClosingAction(function(Ra){if(Ra){Ra=jb();var cb=Ia(Ra);bb(cb);ka.updateSelectedDimensionValue(Ra);T.occur(T.FUNCTION,T.TRIAL_CALCULATE_DIMENSION_FILTER)}})})();var Ta=function(Ra){var cb=$("<div>");A.layoutCtrlWithLRTB(cb,0,0,null,
55,10,null);fb(ya,cb);Ca=new W;Ca.setItemHeight(23);var eb=Ca.getJqUi();Ca.setItemUiCreator(function(ob){var vb=$("<div>");vb.css("width","100%");ob=new Ja(Ya[ob]);vb.append(ob.getJqUi());return vb});A.layoutCtrlWithLRTB(eb,0,0,null,0,0,null);cb.append(eb);ib();Ra.append(cb)},ib=function(){Ca.setItemCount(Ya.length);setTimeout(Ca.repaint,0)},fb=function(Ra,cb){Fa=new Y;Fa.setType(Y.TYPE_NO_SEARCH_RESULT);Fa.setText(oa.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"));
var eb=Fa.getJqUi();eb.hide();eb.appendTo(cb);Na=new Y;Na.setType(Y.TYPE_NO_DATA_WITH_CLOUD);Na.setText(oa.get("noDataTips","\u6682\u65e0\u6570\u636e"));eb=Na.getJqUi();eb.appendTo(cb);eb.hide();if(Ra&&0!==Ra.length){cb=ka.getDimensionModel();eb=cb.getDimensionType();for(var ob=0;ob<Ra.length;ob++){var vb=Ra[ob],lb=0===H.length?!0:-1!==H.indexOf(vb);var rb=vb;if(null===rb||0===rb.length)var yb=oa.get("emptyValue","\uff08\u7a7a\uff09");else if(pa.TYPE_DATE===eb){yb=cb.getDateFormat();if(0!==$.trim(rb).length)switch(yb){case pa.VALUE_YEAR_MONTH_DAY:ja.setFormatString("yyyy-MM-dd"),
rb=ja.format(rb)}yb=rb}else yb=rb;rb=new ea;rb.setValue(vb);rb.setChecked(lb);rb.setText(yb);xa.push(rb)}Ya=xa}else eb.show()},Ua=function(Ra,cb){if(0===cb.length)Fa.getJqUi().hide(),0===Ra.length?Na.getJqUi().show():Na.getJqUi().hide(),Ya=Ra,db.setChecked(La?!0:tb(Ra));else{for(var eb=!0,ob=[],vb=0;vb<Ra.length;vb++){var lb=Ra[vb];N.search(cb,lb.getText())&&(eb=!1,ob.push(lb))}eb?(db.setChecked(!1),Na.getJqUi().hide(),Fa.getJqUi().show()):(db.setChecked(La?!0:tb(ob)),Na.getJqUi().hide(),Fa.getJqUi().hide());
Ya=ob}ib()},jb=function(){for(var Ra=[],cb=0;cb<xa.length;cb++){var eb=xa[cb];eb.isChecked()&&Ra.push(eb)}return Ra},pb=function(){for(var Ra=[],cb=$.trim(N.getSearchText()),eb=0;eb<xa.length;eb++){var ob=xa[eb];La&&!ob.isChecked()||Ra.push(ob)}Ua(Ra,cb)},qb=function(Ra,cb){if(cb){var eb=[];La=Ra.isChecked();xa.forEach(function(ob){La&&!ob.isChecked()||eb.push(ob)});Ra=$.trim(N.getSearchText());Ua(eb,Ra)}},tb=function(Ra){for(var cb=!0,eb=0;eb<Ra.length;eb++)if(!Ra[eb].isChecked()){cb=!1;break}return cb},
ma=function(Ra,cb){if(cb){var eb=Ra.isChecked();ab().forEach(function(ob){ob.setChecked(eb)});Qa();Ca.keepState();Ca.repaint();Ca.restoreState()}},Qa=function(){var Ra=jb().length;Ra=oa.get("selectedCount","\uff08\u5df2\u9009\u62e9#1\u9879\uff09").replace("#1",Ra);sa.setText(Ra)},Ga=function(Ra,cb){if(cb){Ra=ab();var eb=0;Ra.forEach(function(ob){ob.isChecked()&&eb++});db.setChecked(eb===Ra.length)}Qa()},ab=function(){var Ra=$.trim(N.getSearchText());if(0===Ra.length)return xa;for(var cb=[],eb=0;eb<
xa.length;eb++){var ob=xa[eb];N.search(Ra,ob.getText())&&cb.push(ob)}return cb}}var Wa=this,G,Ka,R=[];this.getJqUi=function(){G||va();return G};this.getDimensionFilterItem=function(){if(!R||0==R.length)return null;var ka=new y;ka.setDimensionKey(V.getDimensionId());for(var ya=[],H=0;H<R.length;H++)ya.push(R[H]);ka.setValues(ya);return ka};this.getDimensionModel=function(){return V};var va=function(){G=$("<div class='metric-designer-trial-calculate-dimension-item'>");var ka=$("<div class='metric-designer-trial-calculate-dimension-item-name'>");
ka.text(V.getName());ka.attr("title",V.getName());var ya=$("<div class='metric-designer-trial-calculate-dimension-value-container'>");Ka=$("<div class='metric-designer-trial-calculate-dimension-value-text'>");Ka.text(oa.get("allWithBracket","\uff08\u5168\u90e8\uff09"));Ka.attr("title",oa.get("allWithBracket","\uff08\u5168\u90e8\uff09"));var H=$("<div class='metric-designer-trial-calculate-dimension-value-btn'>");ra.background(H,"btn_edit");H.attr("title",oa.get("selectDimensionValue","\u9009\u62e9\u7ef4\u5ea6\u503c"));
H.on("click",function(){Sa(Wa)});Ka.appendTo(ya);H.appendTo(ya);G.append(ka);G.append(ya)};this.updateSelectedDimensionValue=function(ka){var ya=q[V.getDimensionId()],H=[],ea=[];ka.forEach(function(Ja){H.push(Ja.getValue());ea.push(Ja.getText())});R=H.slice();ka=ka.length===ya.length?oa.get("allWithBracket","\uff08\u5168\u90e8\uff09"):ea.join(",");Ka.text(ka);Ka.attr("title",ka)};var Ia=function(ka){var ya=q[V.getDimensionId()];if(!R.length)return ka.length!==ya.length;if(R.length!==ka.length)return!0;
for(ya=0;ya<ka.length;ya++)if(-1===R.indexOf(ka[ya].getValue()))return!0;return!1},Sa=function(ka){if(q[V.getDimensionId()])(new ha(ka,q[V.getDimensionId()],R)).showDialog();else{var ya=new za;ya.setModelerModel(e);var H=new Ea(c.getRemoteImpl(),function(ea){q[V.getDimensionId()]=ea;ea=new ha(ka,ea,R);b.is(":visible")&&ea.showDialog()},function(ea){});H.setBlockingJqUi(b);H.getMetricDimValues(ya.toJsonObject(),V.getDimensionId(),X.getId())}}}function qa(){O.call(this);var V=this.protectedMethod,X=
this,ha,Wa,G,Ka,R=!1,va;(function(){V.setTitle(oa.get("previewSet","\u9884\u89c8\u8bbe\u7f6e"));V.setSelectable(!0);V.setContentPaneCreator(function(){X.setSize(440,330);return Ia()});V.setFooterPaneCreator(function(ya){var H=new ia(oa.get("confirm","\u786e\u5b9a"));H.setHighlight(!0);var ea=H.getJqUi();ea.addClass("sa-ctrl-dialog-footer-ok");ea.appendTo(ya);H.addActionListener(function(Ja){Ja=ha.getValue();var Za=Wa.getValue();va&&va(R,Ja,Za);V.destroy();return!0});H=new ia(oa.get("cancel","\u53d6\u6d88"));
H.setHighlight(!1);ea=H.getJqUi();ea.addClass("sa-ctrl-dialog-footer-cancel");ea.appendTo(ya);H.addActionListener(function(Ja){V.destroy();return!0})});V.setClosingAction(function(ya){})})();this.setOriginExtractCount=function(ya){G=ya};this.setOriginPreviewCount=function(ya){Ka=ya};this.setAllData=function(ya){R=ya};this.setConfirmCallback=function(ya){va=ya};var Ia=function(){var ya=$("<div>"),H=$("<div>");H.text(oa.get("extractSet","\u62bd\u53d6\u8bbe\u7f6e"));A.layoutCtrl(H,30,20,100,24);H.appendTo(ya);
H.css({color:"#333333","line-height":"24px","font-size":"14px"});H=Sa("extract",oa.get("extract","\u62bd\u53d6\u524d"),ya);var ea=H.getJqUi();A.layoutCtrlWithLRTB(ea,60,null,300,60,null,null);ha=new Ha;var Ja=ha.getJqUi();ha.setConstraint(1,1E4,1);ha.setValue(G);A.layoutCtrlWithLRTB(Ja,122,null,100,49,null,null);Ja.appendTo(ya);Ja=$("<div>");Ja.text(oa.get("rowDataCalculate","\u884c\u6570\u636e\u8ba1\u7b97"));Ja.css("color","#666");A.layoutCtrlWithLRTB(Ja,170,0);A.layoutCtrlMiddleAlign(Ja,22);Ja.appendTo(ea);
ea=Sa("extractAll",oa.get("all","\u5168\u91cf"),ya);Ja=ea.getJqUi();A.layoutCtrlWithLRTB(Ja,60,null,300,90,null,null);var Za=$("<div>");ra.background(Za,"warning");Za.attr("title",oa.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"));
A.layoutCtrlWithLRTB(Za,110,null,20,80,null,20);Za.appendTo(ya);Ja=new ba;Ja.addElement(H);Ja.addElement(ea);Ja.addChangedListener(function(da,N){N&&("extract"==da.getUserObject()?(R=!1,ha.setEnabled(!0),Za.hide()):(R=!0,ha.setEnabled(!1),Za.show()))});R?(ka(Ja,"extractAll"),ha.setEnabled(!1),Za.show()):(ka(Ja,"extract"),ha.setEnabled(!0),Za.hide());H=$("<div>");H.text(oa.get("dataPreview","\u6570\u636e\u9884\u89c8"));A.layoutCtrl(H,30,115,100,24);H.appendTo(ya);H.css({color:"#333333","line-height":"24px",
"font-size":"14px"});var w=Sa("dataPreview",oa.get("previewResult","\u9884\u89c8\u8ba1\u7b97\u7ed3\u679c\u7684\u524d"),ya);w.setChecked(!0);w.addCheckedListener(function(){w.setChecked(!0)});H=w.getJqUi();A.layoutCtrlWithLRTB(H,60,null,300,155,null,null);Wa=new Ha;ea=Wa.getJqUi();Wa.setConstraint(1,1E3,1);Wa.setValue(Ka);A.layoutCtrlWithLRTB(ea,180,null,100,144,null,null);ea.appendTo(ya);ea=$("<div>");ea.text(oa.get("rowData","\u884c\u6570\u636e"));ea.css("color","#666");A.layoutCtrlWithLRTB(ea,230,
0);A.layoutCtrlMiddleAlign(ea,22);ea.appendTo(H);return ya},Sa=function(ya,H,ea){var Ja=new n;Ja.setUserObject(ya);Ja.setText(H);ya=Ja.getJqUi();ea.append(ya);return Ja},ka=function(ya,H){ya.toCheckTheElement(function(ea){return ea.getUserObject()===H})}}O.call(this);var k=this,d=this.protectedMethod,b,a,l,c,e,g,v,u=[],h,B,F,J,C=!1,p=100,f=100,t,q=[];(function(){k.setSize(900,675);d.setSelectable(!0);d.getDialogCtrl().setFullScreenEnabled();d.getDialogCtrl().addResizeListener(function(){J&&J.relayoutViews()});
d.setContentPaneCreator(function(){d.setTitle(g);b=$("<div>");h?h(function(V){V=V.modeler;var X=new za;X.fromJsonObject(V);var ha=new Ea(c.getRemoteImpl(),function(Wa){var G=new S;G.fromJsonObject(Wa);G&&G.isValid()?(e=X.getModelerModel(),u=e.getAllDimension(),M(b,!0)):U(b)});ha.setShowBlocking(!0);ha.checkModelerValid(V)}):M(b,!1);return b});d.setFooterPaneCreator(function(V){var X=new ia(oa.get("close","\u5173\u95ed"));X.setHighlight(!0);var ha=X.getJqUi();ha.addClass("sa-ctrl-dialog-footer-ok");
ha.appendTo(V);A.layoutCtrl(ha,"calc(50% - 60px)",null,null,null);X.addActionListener(function(Wa){d.destroy();return!0})});d.setClosingAction(function(V){})})();this.setMetric=function(V){l=V};this.setTitle=function(V){g=V};this.setGlobal=function(V){c=V};this.setButtonName=function(V){v=V};this.setFunLoadModelerInfo=function(V){h=V};this.setFunEntryDesignerFromMainPage=function(V){B=V};this.setModeler=function(V){e=V;u=V.getAllDimension()};var z=function(V){var X=$("<div class='metric-designer-trial-calculate-property-title'>"),
ha=$("<div>");ha.appendTo(X);A.layoutCtrlWithLRTB(ha,0,0,null,2,2,null);ha.css("border-left","3px solid #5582f3");ha=$("<div>");ha.text(V);A.layoutCtrl(ha,10,null,200,null);A.layoutCtrlMiddleAlign(ha,16);ha.appendTo(X);ha.css({"font-weight":"bold",color:"#666"});return X},L=function(V){t=[];for(var X=$(document.createDocumentFragment()),ha=0;ha<u.length;ha++){var Wa=new r(u[ha],l);Wa.getJqUi().appendTo(X);t.push(Wa)}X.appendTo(V)},E=function(){if(!t||0==t.length)return null;for(var V=[],X=0;X<t.length;X++){var ha=
t[X].getDimensionFilterItem();ha&&V.push(ha.toJsonObject())}return V},M=function(V,X){if(!X){var ha;X=Ma.MetricStateMonitor.getInvalidDimensionMap();var Wa=Ma.MetricStateMonitor.getInvalidPublicDimensionMap();0!==Object.keys(X).length?ha=oa.get("dimensionException","\u7ef4\u5ea6\u5f02\u5e38\uff0c\u65e0\u6cd5\u8fdb\u884c\u6307\u6807\u8bd5\u8ba1\u7b97"):0!==Object.keys(Wa).length?ha=oa.get("publicDimensionException","\u516c\u5171\u7ef4\u5ea6\u8bbe\u7f6e\u4e0d\u5b8c\u6574\uff0c\u65e0\u6cd5\u8fdb\u884c\u8bd5\u8ba1\u7b97"):
Ma.MetricStateMonitor.getInvalidPrompt(l.getId())?ha=oa.get("metricException","\u6307\u6807\u5f02\u5e38\uff0c\u65e0\u6cd5\u8fdb\u884c\u6307\u6807\u8bd5\u8ba1\u7b97"):0<x().length&&(ha=oa.get("metricException","\u6307\u6807\u5f02\u5e38\uff0c\u65e0\u6cd5\u8fdb\u884c\u6307\u6807\u8bd5\u8ba1\u7b97"));if(ha){X=new Y;X.setType(Y.TYPE_NO_DATA_WITH_CLOUD);X.setText(ha);ha=X.getJqUi();V.append(ha);return}}ha=$("<div class='metric-designer-trial-calculate-metric-icon'>");ra.background(ha,"metric_icon");X=$("<div class='metric-designer-trial-calculate-metric-info'>");
X.text(l.getName());ha.appendTo(V);X.appendTo(V);X=$("<div class='metric-designer-trial-calculate-dimension-filter-container'>");X.appendTo(V);z(oa.get("dimensionFilter","\u7ef4\u5ea6\u8fc7\u6ee4")).appendTo(X);ha=0;u&&0<u.length?(ha=Math.min(68*Math.ceil(u.length/3)+44,180),Wa=$("<div class='metric-designer-trial-calculate-dimension-list'>"),L(Wa),Wa.appendTo(X)):(ha=86,Wa=$("<div class='metric-designer-trial-calculate-no-dimension-tips'>"),Wa.text(oa.get("noDimension","\u6682\u672a\u6dfb\u52a0\u7ef4\u5ea6")),
Wa.attr("title",oa.get("noDimension","\u6682\u672a\u6dfb\u52a0\u7ef4\u5ea6")),Wa.appendTo(X));A.layoutCtrlWithLRTB(X,0,0,null,47,null,ha);X=$("<div>");A.layoutCtrlWithLRTB(X,0,0,null,ha+32+15+2,0,null);ha=$("<div class='metric-designer-trial-calculate-button'>");ha.text(v);ha.attr("title",v);ha.on("click",function(){bb(!1);aa();T.occur(T.BUTTON_TYPE,T.TRIAL_CALCULATE)});ha.appendTo(X);ua(X);X.appendTo(V)},x=function(){for(var V=Ma.MetricStateMonitor.getInvalidTableMap(),X=[],ha=Object.keys(V),Wa=
0;Wa<ha.length;Wa++){var G=ha[Wa];V[ha[Wa]]&&X.push(G)}return X},U=function(V){var X=new Y;X.setType(Y.TYPE_NO_DATA_WITH_CLOUD);X.setText(oa.get("metricError","\u6307\u6807\u5f02\u5e38\uff0c\u65e0\u6cd5\u67e5\u770b\u6307\u6807\u6570\u636e"));X=X.getJqUi();var ha=$("<div class='metric-designer-trial-calculate-entry-designer'>");ha.text(oa.get("enterDesigner","\u8fdb\u5165\u8bbe\u8ba1\u5668"));ha.on("click",function(){B&&B()});var Wa=$("<span class='metric-designer-trial-calculate-view-exception-reason'>");
Wa.text(oa.get("viewExceptionReason","\u67e5\u770b\u5f02\u5e38\u539f\u56e0"));ha.append(Wa);X.append(ha);V.append(X)},ua=function(V){var X=z(oa.get("resultPreview","\u7ed3\u679c\u9884\u89c8"));X.css("top","51px");var ha=$("<div class='metric-designer-trial-calculate-result-preview-setting'>"),Wa=$("<div class='metric-designer-trial-calculate-result-preview-setting-text'>");Pa(Wa);var G=$("<div class='metric-designer-trial-calculate-result-preview-setting-btn'>");G.attr("title",oa.get("previewSet",
"\u9884\u89c8\u8bbe\u7f6e"));G.on("click",function(){wa(Wa)});ra.backgroundWithHover(G,"setting");ha.append(G);ha.append(Wa);V.append(X);V.append(ha);fa(V);Aa(V)},Aa=function(V){var X=$("<div class='metric-data-calculate-preview-mask'>"),ha=$("<div>");ha.text(oa.get("refreshPreviewData","\u7f16\u8f91\u5b8c\u6210\u540e\uff0c\u70b9\u51fb\u6b64\u5904\u5237\u65b0\u9884\u89c8\u6570\u636e\u3002"));ha.addClass("metric-data-calculate-mask-text");ha.on("click",function(){bb(!1);aa()});X.hide();ha.appendTo(X);
X.appendTo(V)},bb=function(V){if(F){var X=b.find(".metric-data-calculate-preview-mask");V?X.show():X.hide()}},fa=function(V){var X=$("<div class='metric-designer-trial-calculate-result-table'>");J=la.createTable();J.setColumnFitVisibleWidth(!1);J.setAutoAdjustRowHeight(!0);var ha=$(J.getUI());A.layoutCtrlWithLRTB(ha,0,0,"100%",5,1<Math.ceil(u.length/3)?0:5,null);X.append(ha);V.append(X)},Oa=function(){if(F){la.clear(J);var V=F.getColumnCount();J.addColumns(V);for(var X=la.createHeadRow(J),ha=0;ha<
V;ha++){var Wa=X.getCell(ha);J.getColumn(ha).setWidth(120);var G=F.getField(ha).getAlias();Wa.setValue(G?G:F.getField(ha).getName())}V=F.getRowCount();a&&a.remove();if(0===V)la.refresh(J),a=$("<div class='metric-designer-trial-calculate-no-result'>"),a.text(oa.get("calculateNoResult","\u6ca1\u6709\u6570\u636e")),$(J.getUI()).append(a);else{ha=new m(J);ha.setOutsideVisible(!1);J.setCellRender(ha);X=new KTBorderStyle;X.setBottomBorderWidth(1);X.setBottomBorderPen("solid");X.setBottomBorderColor("#e5e5e5");
for(ha=0;ha<V;ha++)Wa=F.getOneRow(ha),G=la.createRow(J,!1),G.setBorder(X),G.setUserObject(Wa);la.refresh(J)}}},aa=function(){var V=new K;C?V.setExtractAllData(f):V.setExtractPartlyData(p,f);var X=new za;X.setModelerModel(e);var ha=new Ea(c.getRemoteImpl(),function(Wa){F=new na;F.fromJsonObject(Wa);Oa()},function(Wa){Oa()});ha.setBlockingJqUi(b);ha.previewMetrics(X.toJsonObject(),E(),V.toJsonObject(),l.getId())},wa=function(V){var X=new qa;X.setOriginExtractCount(p);X.setOriginPreviewCount(f);X.setAllData(C);
X.setConfirmCallback(function(ha,Wa,G){C=ha;p=Wa;f=G;Pa(V);aa()});X.showDialog()},Pa=function(V){var X=C?oa.get("extractAllData","\u62bd\u53d6\u5168\u91cf\u6570\u636e\u8fdb\u884c\u8ba1\u7b97, "):oa.get("onlyExtractSomeRows","\u4ec5\u62bd\u53d6\u524d#1\u884c\u8fdb\u884c\u8ba1\u7b97, ").replace("#1",p);X+=oa.get("previewRows","\u663e\u793a\u8ba1\u7b97\u7ed3\u679c\u7684\u524d#1\u884c\u6570\u636e").replace("#1",f);V.text(X);V.attr("title",X)}};var oa,A,Q,Z,O,ia,Ha,ba,n,Ba,I,P,D,W,la,Ea,ra,K,pa,za,na,
y,S,T;(function(){var m=com.kingdee.bos.qing.framework.common;oa=m.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer);m=com.kingdee.bos.qing.common;A=m.DomUtil;Q=m.DateFormater;Z=m.NumberFormater;m=com.kingdee.bos.qing.ui.component;O=m.AbstractModalDialog;ia=m.Button;Ha=m.Spinner;ba=m.RadioButtonGroup;n=m.RadioButton;Ba=m.SearchBox;I=m.CheckBox;P=m.ComboBox;D=m.Label;W=m.DynamicScroller;m=com.kingdee.bos.qing.common.ui;la=m.TableUtil;m=com.kingdee.bos.qing.modeler.designer;
Ea=m.DesignerFacade;ra=m.Icons;K=m.PreviewConfig;za=m.QingModeler;na=m.PreviewData;T=m.UserOperationReporter;m=com.kingdee.bos.qing.modeler.designer.metricdesigner;S=m.ModelerValidity;y=m.DimensionFilterItem;pa=m.Dimension})();Y.TYPE_TEXT="text";Y.TYPE_NO_SOURCE="noSource";Y.TYPE_NO_SEARCH_RESULT="noSearchResult";Y.TYPE_NO_DATA_WITH_CLOUD="noDataWithCloud"})();(function(){function ta(){na.call(this);var g,v,u,h=[],B=[],F,J;this.setLeftModel=function(p){B=p};this.setRightModel=function(p){h=p};this.setGlobal=function(p){u=p};this.setCreatePublicDIMEntrance=function(p){F=p};this.getDimensions=function(){return h};this.getPublicDimensions=function(){return B};this.setMessageCurtain=function(p){J=p};this.checkDimensionsValid=function(){return 20<=h.length?(J&&J.showPrompt(O.get("moreDimension","\u7ef4\u5ea6\u4e2a\u6570\u4e0d\u80fd\u8d85\u8fc720\u4e2a\u3002")),
!1):!0};this.protectedGetLeftCtrl=function(){g=new Va;g.setModel(B);g.setGlobal(u);g.setCreatePublicDIMEntrance(F);return g};this.protectedGetRightCtrl=function(){v=new mb;v.setMessageCurtain(J);v.setModel(h);return v};this.protectedSelect=function(p,f){if(p){var t=B;if(!f){if(t=g.getSelected(),0===t.length){J&&J.showPrompt(O.get("atLeastSelectAField","\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\u5b57\u6bb5\u3002"));return}}else if(0===t.length){J&&J.showPrompt(O.get("noFieldToAdd","\u6ca1\u6709\u5b57\u6bb5\u53ef\u4ee5\u6dfb\u52a0\u3002"));
return}f=[];p=[];for(var q=0;q<t.length;q++){var z=t[q],L;if(L=z.getDataType()!=za.DT_DATE&&z.getDataType()!=za.DT_DATETIME)a:{L=z.getId();for(var E=0;E<h.length;E++)if(h[E].getPublicDimensionId()==L){L=!0;break a}L=!1}L?f.push(z):p.push(z)}for(q=0;q<p.length;q++){z=p[q];t=new r;L=com.kingdee.bos.qing.modeler.designer.UIDHelper;L=L.getUID(L.NS_DIMENSION);t.setDimensionId(L);t.setPublicDimensionId(z.getId());switch(z.getDataType()){case za.DT_DATE:case za.DT_DATETIME:t.setDimensionType(r.TYPE_DATE);
t.setDateFormat(r.VALUE_YYYY);Z.DimensionUtil.fixDimensionDateType(h,t,z.getId());break;default:t.setDimensionType(r.TYPE_NORMAL),t.setNumberModified(!0),t.setNameModified(z.isNameModified())}E=z;L=[];for(var M=0;M<h.length;M++)L.push(h[M].getName());M=u.getModelerModel();var x=Z.PublicDimensionUtil.getAllMetricName(M);L=L.concat(x);E=Z.PublicDimensionUtil.getAllPublicDimensionName(M,E.getId());L=L.concat(E);L=Z.DimensionUtil.fixName(L,z.getName(),t);t.setName(L);L=[];for(E=0;E<h.length;E++)L.push(h[E].getNumber());
E=Z.DimensionUtil.getAllMetricNumber(u.getModelerModel());L=L.concat(E);z=Z.DimensionUtil.getUniqueNumber(u,t,L,z);t.setNumber(z);h.push(t)}v.updateUI(h);1==f.length&&(p=f[0],p=O.get("oneFieldAbandonSelect","\u4ec5\u201c\u65e5\u671f\u201c\u3001\u201d\u65e5\u671f\u65f6\u95f4\u201c\u7c7b\u578b\u7684\u5b57\u6bb5\u652f\u6301\u91cd\u590d\u9009\u62e9\uff0c\u5df2\u653e\u5f03\u9009\u62e9\u201c#1\u201d\u5b57\u6bb5\u3002").replace("#1",p.getName()),J&&J.showPrompt(p));2<=f.length&&(p=f[0],q=f[1],p=O.get("moreFieldAbandonSelect",
"\u4ec5\u201c\u65e5\u671f\u201c\u3001\u201d\u65e5\u671f\u65f6\u95f4\u201c\u7c7b\u578b\u7684\u5b57\u6bb5\u652f\u6301\u91cd\u590d\u9009\u62e9\uff0c\u5df2\u653e\u5f03\u9009\u62e9\u201c#1\u201d\u3001\u201c#2\u201d\u7b49#3\u4e2a\u5b57\u6bb5\u3002").replace("#1",p.getName()).replace("#2",q.getName()).replace("#3",f.length),J&&J.showPrompt(p))}else{t=v.getModel();if(f){if(p=t,0===p.length){J&&J.showPrompt(O.get("noFieldDelete","\u6ca1\u6709\u5b57\u6bb5\u53ef\u4ee5\u79fb\u9664\u3002"));return}}else if(p=
v.getSelected(),0===p.length){J&&J.showPrompt(O.get("atLeastSelectAField","\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\u5b57\u6bb5\u3002"));return}z=[];for(q=0;q<t.length;q++)z.push(t[q].copy());for(q=p.length-1;0<=q;q--)L=t.indexOf(p[q]),t.splice(L,1);f?v.setSelecteds([]):v.setSelecteds(C(p,t,z));v.updateUI(t)}};var C=function(p,f,t){if(0===f.length)return[];for(var q={},z=0;z<t.length;z++){var L=t[z].getDimensionId();q[L]=z}var E=[];for(z=0;z<p.length;z++)L=p[z].getDimensionId(),E.push(q[L]);z=-1;for(p=
0;p<E.length;p++)z<E[p]&&(z=E[p]);q=z;if(0>=q)return[f[0]];p={};for(z=0;z<f.length;z++){var M=f[z];p[M.getDimensionId()]=M}if(q===t.length)return f[f.length-1];if(q<t.length){for(z=q;-1<E.indexOf(z);)--z;if(!M)return[f[0]];f=t[z].getDimensionId();M=p[f];return[M]}}}function Da(){function g(z){var L,E,M,x,U,ua,Aa,bb,fa=z,Oa=function(){var X=$("<div>");U=Pa();var ha=U.getJqUi();ha.find(":input").on("keydown",function(G){13==(G.keyCode||G.which||G.charCode)&&console.log("do searching")});Ha.layoutCtrlWithLRTB(ha,
8,0,290,0,null,30);X.append(ha);ha=$("<div>");Ha.layoutCtrlWithLRTB(ha,0,0,null,31,0,null);X.append(ha);if(fa){x=wa(fa);var Wa=x.getJqUi();Ha.layoutCtrlWithLRTB(Wa,0,0,306,0,0,null);ha.append(Wa)}(M=bb())&&ha.append(M);fa&&0!=fa.length&&M&&M.hide();E=aa();E.hide();E.appendTo(ha);return X},aa=function(){var X=new l;X.setText(O.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"));return X.getJqUi()},wa=function(X){var ha=new la;ha.setBorderVisible(!1);ha.setMultiSelectable(!0);
ha.setToggleSelectingEnabled(!0);ha.setContinuousSelectingEnabled(!0);ha.setCustomItemPainter(ua);ha.setItemModels(X);ha.setCustomSelectedsPainter(Aa);return ha};this.setNoDataViewPainter=function(X){bb=X};this.setListSelectedsPainter=function(X){Aa=X};this.setCustomPainter=function(X){ua=X};this.setListSelects=function(X){x.setSelecteds(X)};this.getSelectedField=function(){return x?x.getSelecteds():[]};this.updateListContentUI=function(X){fa=X;V()};this.getJqUi=function(){L||(L=Oa());return L};var Pa=
function(){var X=new ra;X.setShowSearchIcon(!0);X.setPlaceholder(O.get("searchField","\u8bf7\u8f93\u5165\u5b57\u6bb5\u540d\u79f0"));X.setSearchListenerDelay(0);X.addSearchListener(V);return X},V=function(X){if((X=$.trim(U.getText()))&&0<X.length){for(var ha=fa,Wa=[],G=0;G<ha.length;G++)-1<$.trim(ha[G].getName()).toLowerCase().indexOf(X.toLowerCase())&&Wa.push(ha[G]);0==Wa.length?E.show():E.hide();M&&M.hide();x.setItemModels(Wa)}else 0==fa.length&&M&&M.show(),E.hide(),x.setItemModels(fa)}}var v,u=
this,h=[],B,F,J;this.protectGetTitle=function(){throw Error("override me");};this.showSortBtn=function(){throw Error("override me");};this.protectGetNoDataViewJqUi=function(){return null};this.setMessageCurtain=function(z){F=z};this.getMessageCurtain=function(){return F};this.getSelected=function(){return B.getSelectedField()};this.setSelecteds=function(z){B.setListSelects(z)};var C=function(){var z=f();if(z)F&&F.showPrompt(z);else{z=u.getSelected()[0];var L=h.indexOf(z);0==L?F&&F.showPrompt(O.get("currentFirstRecord",
"\u5f53\u524d\u8bb0\u5f55\u5df2\u7ecf\u662f\u7b2c\u4e00\u6761\u8bb0\u5f55\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4e0a\u79fb\u3002")):(h.splice(L,1),h.splice(L-1,0,z),B.updateListContentUI(h))}},p=function(){var z=f();if(z)F&&F.showPrompt(z);else{z=u.getSelected()[0];var L=h.indexOf(z);L==h.length-1?F&&F.showPrompt(O.get("currentLastRecord","\u5f53\u524d\u8bb0\u5f55\u5df2\u7ecf\u662f\u6700\u540e\u4e00\u6761\u8bb0\u5f55\uff0c\u65e0\u6cd5\u7ee7\u7eed\u4e0b\u79fb\u3002")):(h.splice(L,1),h.splice(L+1,0,z),B.updateListContentUI(h))}};
this.protectGetIconName=function(z){throw Error("override me");};this.setGlobal=function(z){J=z};this.getGlobal=function(){return J};var f=function(){if(0==h.length)return O.get("noFieldForSort","\u6ca1\u6709\u201c\u5df2\u9009\u5b57\u6bb5\u201d\u53ef\u4f9b\u6392\u5e8f\u3002");if(0==u.getSelected().length)return O.get("selectNoMappingField","\u672a\u9009\u4e2d\u201c\u5df2\u9009\u5b57\u6bb5\u201d\u3002");if(1<u.getSelected().length)return O.get("selectSingleField","\u8bf7\u9009\u62e9\u4e00\u4e2a\u5b57\u6bb5\u8fdb\u884c\u6392\u5e8f\u3002")};
this.getJqUi=function(){if(!v){var z=$("<div>"),L=$("<div>");L.text(u.protectGetTitle());Ha.layoutCtrlWithLRTB(L,0,40,null,0,0,20);z.append(L);L=new K;L.setText("\u2191");L.addActionListener(C);L=L.getJqUi();var E=new K;E.setText("\u2193");E.addActionListener(p);E=E.getJqUi();B=new g(h);B.setCustomPainter(t);B.setNoDataViewPainter(u.protectGetNoDataViewJqUi);B.setListSelectedsPainter(q);var M=B.getJqUi();M.css({position:"absolute",border:"1px solid #dbdbdb"});Ha.layoutCtrl(M,0,20,306,340);Ha.layoutCtrl(L,
266,0,20,20);Ha.layoutCtrl(E,286,0,20,20);z.append(M);u.showSortBtn()&&(z.append(L),z.append(E));v=z}return v};var t=function(z,L){z.css("height","30px");z.css("cursor","pointer");var E=$("<div>"),M=u.protectGetIconName(L);ba.background(E,M);E.appendTo(z);E.addClass("modeler-designer-dimension-dialog-item-icon");M=$("<div>");M.text(L.getName());M.attr("title",L.getName());M.addClass("modeler-designer-dimension-dialog-item modeler-designer-dimension-item-noselect");E.appendTo(z);M.appendTo(z)},q=function(z,
L){for(var E=0;E<z.length;E++){var M=z[E],x=M.data("model");x=u.protectGetIconName(x);M=$(M.find(".modeler-designer-dimension-dialog-item-icon"));ba.background(M,x)}for(E=0;E<L.length;E++)z=L[E],M=z.data("model"),M=u.protectGetIconName(M)+"_hover",z=$(z.find(".modeler-designer-dimension-dialog-item-icon")),ba.background(z,M)};this.setModel=function(z){h=z};this.getModel=function(){return h};this.updateUI=function(z){h=z;B&&B.updateListContentUI(h)}}function Va(){Da.call(this);var g=this,v;this.protectGetNoDataViewJqUi=
function(){var h=g.getGlobal().getModelerModel().getAllTable();return v&&1!=h.length?u():(h=new l,h.setText(O.get("noOptionalField","\u6682\u65e0\u53ef\u9009\u62e9\u7684\u5b57\u6bb5")),h.getJqUi())};this.showSortBtn=function(){return!1};this.setCreatePublicDIMEntrance=function(h){v=h};this.protectGetTitle=function(){return O.get("optionalDimFields","\u53ef\u9009\u5b57\u6bb5")};this.protectGetIconName=function(h){return h.getDataType()};var u=function(){var h=$("<div>");h.addClass("metric-designer-public-dimension-box");
var B=$("<div>");B.addClass("metric-designer-public-dimension-text");B.text(O.get("noCanSelectField","\u6682\u65e0\u53ef\u9009\u62e9\u7684\u5b57\u6bb5\uff0c\u73b0\u5728\u53bb\u8bbe\u7f6e"));var F=$("<div>");F.addClass("metric-designer-public-dimension-text-link");var J=O.get("publicDimension","\u516c\u5171\u7ef4\u5ea6");F.text(J);F.attr("title",J);F.css("cursor","pointer");F.css("color","#0E5FD8");F.on("click",function(C){v&&v()});h.append(B);h.append(F);return h}}function mb(){Da.call(this);this.protectGetTitle=
function(){return O.get("selectedDimFields","\u5df2\u9009\u5b57\u6bb5")};this.showSortBtn=function(){return!0};this.protectGetIconName=function(g){switch(g.getDimensionType()){case r.TYPE_DATE:return"DATE";case r.TYPE_NORMAL:return"STRING";default:throw Error("unknown dimension type");}}}function Xa(){P.call(this);var g=this,v=this.protectedMethod,u,h,B;(function(){v.setTitle(O.get("createDimension","\u65b0\u589e\u7ef4\u5ea6"));g.setSize(720,480);v.setSelectable(!0);v.setContentPaneCreator(function(){for(var J=
u.getModelerModel().getAllDimension(),C=[],p=0;p<J.length;p++){var f=J[p];Z.MetricStateMonitor.checkDimensionInvalid(f.getDimensionId())||C.push(f.copy())}h=new ta;h.setMessageCurtain(v.getMessageCurtain());h.setLeftModel(B);h.setRightModel(C);h.setGlobal(u);h.setCreatePublicDIMEntrance(F);return h.getJqUi()});v.setClosingChecker2(function(J){if(h.checkDimensionsValid()){J=u.getModelerModel();var C=h.getDimensions(),p=[];if(2>J.getAllTable().length){p=[];for(var f=0;f<C.length;f++){var t=C[f].getPublicDimensionId();
-1<p.indexOf(t)||p.push(t)}t=[];for(f=0;f<B.length;f++)-1<p.indexOf(B[f].getId())&&t.push(B[f]);p=t}else for(f=J.getPublicDimensions(),t=0;t<f.length;t++)p.push(f[t].copy());f=new m;t=J.copyExprReferences();J.repairDimensionRef(C);f.setValue(t,C,p,u);u.getCommandManager().perform(f);return!0}});v.setClosingAction(function(J){J&&e.occur(e.FUNCTION,e.ADD_DIMENSION)})})();var F=function(){var J=new Ma;J.setGlobal(u);var C=new pa;C.setSteps([J]);C.show(720,480);v.destroy()};this.setPublicDimensions=function(J){B=
J};this.setGlobal=function(J){u=J};this.showDimensionDialog=function(){g.showDialog();h.relayout()}}function ca(g){P.call(this);var v=this,u=this.protectedMethod,h,B=1===g.getModelerModel().getAllTable().length;(function(){u.setTitle(O.get("publicDimensionSetting","\u516c\u5171\u7ef4\u5ea6\u8bbe\u7f6e"));v.setSize(720,480);u.setSelectable(!0);u.setContentPaneCreator(function(){var p=$("<div>");if(B){p.append(Z.PublicDimensionUtil.createTipUi());var f=$("<div>");f.text(O.get("oneTablePromptTips","\u5f53\u524d\u6a21\u578b\u53ea\u9009\u62e9\u4e861\u5f20\u8868\uff0c\u65e0\u9700\u8bbe\u7f6e\u516c\u5171\u7ef4\u5ea6\u3002"));
f.css({color:"#C0C0C0","text-align":"center","font-size":"14px"});Ha.layoutCtrlCenterAlign(f,400);Ha.layoutCtrlMiddleAlign(f,18);Ha.makeSelectable(f);p.append(f);return p}J(p);return p});u.setFooterPaneCreator(function(p){F.createPanel(p)});u.setClosingAction(function(p){C()})})();var F=new function(){this.createPanel=function(t){B?p(t):f(t)};var p=function(t){var q=new D(O.get("close","\u5173\u95ed"));q.setHighlight(!0);var z=q.getJqUi();z.appendTo(t);Ha.layoutCtrlCenterAlign(z,70);q.addActionListener(function(){C()})},
f=function(t){var q=new D(O.get("confirm","\u786e\u5b9a"));q.setHighlight(!0);var z=q.getJqUi();z.addClass("sa-ctrl-dialog-footer-ok");z.appendTo(t);q.addActionListener(function(L){if(h.checkPublicDimensionValid()){var E=h.getPublicDimensions();L=[];for(var M=0;M<E.length;M++){var x=E[M],U=g.getModelerModel().getPublicDimensionById(x.getId());x.tryGenerateId(U);L.push(x)}E=new T;E.setValue(L,g);g.getCommandManager().perform(E);L=!0}else L=void 0;L&&(C(),e.occur(e.FUNCTION,e.PUBLIC_DIMENSION_SETTING))});
q=new D(O.get("cancel","\u53d6\u6d88"));q.setHighlight(!1);z=q.getJqUi();z.addClass("sa-ctrl-dialog-footer-cancel");z.appendTo(t);q.addActionListener(function(L){C()})}},J=function(p){Z.FieldLoader.loadTableFields(g,p,function(f){var t=Z.PublicDimensionUtil.loadPublicDimensions(f,g);h=new oa;h.setGlobal(g);h.setPublicDimensions(t);h.setTableFieldMap(f);h.setMessageCurtain(u.getMessageCurtain());p.append(h.getJqUi());h.setPublicDimensionColVisible()})},C=function(){u.destroy();B||h.destroy()}}function Y(){pa.AbstractWizardStep.call(this);
var g,v=this;this.getJqUi=function(u){g||(g=v.protectedCreateUi(u));return g};this.protectedCreateUi=function(){throw Error("Override me.");};this.protectedMethod={getTopJqUi:function(){return g}}}function Ma(){Y.call(this);var g,v,u;this.protectedCreateUi=function(B){u=B.getMessageCurtain();B=$("<div>");h(B);return B};this.setGlobal=function(B){g=B};this.isLastStep=function(){return!1};this.isReturnable=function(){return!0};this.getSubTitle=function(){return O.get("publicDimensionSetting","\u516c\u5171\u7ef4\u5ea6\u8bbe\u7f6e")};
this.outThisStep=function(B,F){if(v.checkPublicDimensionValid()){B=v.getPublicDimensions();var J=new A;J.setGlobal(g);for(var C=[],p=0;p<B.length;p++){var f=B[p],t=g.getModelerModel().getPublicDimensionById(f.getId());f.tryGenerateId(t);C.push(f)}J.setCompletedPublicDimension(C);F(J);v.unobserveWindow()}};this.intoThisStep=function(B,F){F&&v.observeWindow()};this.over=function(){v.destroy()};var h=function(B){Z.FieldLoader.loadTableFields(g,B,function(F){var J=Z.PublicDimensionUtil.loadPublicDimensions(F,
g);v=new oa;v.setMessageCurtain(u);v.setPublicDimensions(J);v.setGlobal(g);v.setTableFieldMap(F);B.append(v.getJqUi());v.setPublicDimensionColVisible()})}}function oa(){function g(G){KTDefaultCellRender.call(this,G);var Ka=this,R=this.paintCellUI,va=new u,Ia=new v;this.getTable=function(){return G};this.paintCellUI=function(Sa,ka){var ya=Ka.getCurrentRowIdx(),H=Ka.getCurrentColIdx();ya<U?H==G.getColumnsCount()-2?R(Sa,ka):0!=H&&H!=G.getColumnsCount()-1&&Ia.paintTableCell(Ka,Sa,ka,R):0==H?va.paintPromptCell(Ka,
Sa):H==G.getColumnsCount()-2?va.paintMappingFieldCell(Ka,Sa):H==G.getColumnsCount()-1?R(Sa,ka):va.paintChildrenCell(Ka,Sa)}}function v(){this.paintTableCell=function(G,Ka,R,va){R=G.getCell();G=G.getCurrentCol().getUserObject();R&&(G.isTableExist()||(R=Ba.createWarning(),R.addClass("metric-designer-public-dimension-table-error"),R.attr("title",O.get("invalidSourcePrompt","\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664")),$(Ka).append(R)),R=$("<div>"),ba.background(R,"table"),R.addClass("modeler-designer-table-item-icon"),
$(Ka).append(R),G=Z.TableNameHelper.getDisplayText(G.getTable()),R=$("<div>"),R.addClass("modeler-designer-table-item-name"),R.text(G),R.attr("title",G),$(Ka).append(R))}}function u(){this.paintPromptCell=function(va,Ia){va=va.getCurrentRow().getUserObject();va.isFieldsCompleted()&&!va.isDataTypeConsistent()&&(va=R(O.get("dataTypeNotConsistent","\u5b57\u6bb5\u7684\u6570\u636e\u7c7b\u578b\u4e0d\u4e00\u81f4")),va.css("left","50%"),va.css("margin-left","-5px"),va.appendTo($(Ia)))};this.paintMappingFieldCell=
function(va,Ia){var Sa=va.getCurrentRow().getUserObject(),ka=va.getCurrentRow(),ya=va.getCurrentRowIdx(),H=va.getCell();va=Sa.getName();Ia=$(Ia);Ia.empty();var ea=$("<div>");ea.appendTo(Ia);ea.text(va);ea.attr("title",va);ea.addClass("metric-designer-dimension-tablecell-editable");va||ya-U!=x&&Oa(Sa)?((ya=Sa.getFieldByIndex(0).getName()&&Sa.isNameModified())&&ea.css("padding-right","20px"),Z.PublicDimensionUtil.appendResetButton(Ia,ya,function(){var Ja=Z.PublicDimensionUtil.getUniquePublicDimensionName(t,
q,Sa);Sa.setName(Ja);Sa.setNameModified(!1);ka.setUserObject(Sa);H.setValue(Ja);n.refresh(C)})):(ea.text(O.get("pleaseInputName","\u8bf7\u8f93\u5165\u540d\u79f0")),ea.css("color","#C0C0C0"))};this.paintChildrenCell=function(va,Ia){var Sa=va.getCellWidth(),ka=va.getCellHeight(),ya=va.getCurrentColIdx(),H=va.getCurrentRowIdx(),ea=va.getCell(),Ja=va.getCurrentCol(),Za=va.getCurrentRow().getUserObject();va=ea.getUserObject();var w=Ja.getUserObject(),da=(new b).createChooseFieldPanel(G);Ja=f[va.getTableId()];
Ja=X(q,Ja?Ja:[],ya-1);da.setItemModel(Ja?Ja:[]);da.setShowFieldNameEnable(!1);da.setSearchBoxPlaceholder(O.get("searchField","\u8bf7\u8f93\u5165\u5b57\u6bb5\u540d\u79f0"));Sa=n.createCtrlInCell($(Ia),Sa,ka,Ea);Sa.setUserObject(Za);Sa.getJqUi().attr("data-colIndex",ya);ya=va.getField();Sa.setSelectedModel(ya);Sa.setDropdownCreator(function(N,xa,Ya){return da.createJqPopup(N,xa,Ya)});Sa.addSelectionListener(V);Sa.setCustomPainter(function(N,xa){xa.text("");if(N&&N.getName()){var Ya;w.isTableExist()||
(Ya=4);G(xa,N,Ya)}else N=$("<div>"),N.text(O.get("pleaseSelectField","\u8bf7\u9009\u62e9\u5b57\u6bb5")),N.addClass("metric-designer-field-mapping-select-text"),N.css("color","#C0C0C0"),H-U==x&&(N.css("padding-left","4px"),N.appendTo(xa)),Oa(Za)||(N.css("padding-left","24px"),Ka($(Ia),O.get("noFieldSelect","\u672a\u9009\u62e9\u5b57\u6bb5"),8),N.appendTo(xa))});w.isTableExist()&&H-U!=x&&(ya=null,va.isExist()||(ya=O.get("fieldNotFound","\u5b57\u6bb5\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664")),
ya&&Ka($(Ia),ya,8))};var G=function(va,Ia,Sa){if(Ia&&Ia.getName()){if(Ia.getDataType()){var ka=$("<div>"),ya=Ia.getDataType();ba.background(ka,ya);ka.addClass("modeler-designer-select-field-dataType-icon");ka.appendTo(va)}ka=Ia.getAlias();Ia.isEnum()&&(ka+="("+O.get("enumField","\u679a\u4e3e\u5b57\u6bb5")+")");Ia=$("<div>");Ia.text(ka);Ia.attr("title",ka);Ia.addClass("metric-designer-field-mapping-select-text");null==Sa&&void 0==Sa||Ia.css("padding-left",Sa+"px");Ia.appendTo(va)}},Ka=function(va,
Ia,Sa){Ia=R(Ia);Ia.appendTo(va);Ia.css("left",Sa+"px")},R=function(va){var Ia=$("<div>");Ia.text("!");Ia.addClass("modeler-designer-field-notmatch-prompt");Ia.attr("title",va);return Ia}}function h(){var G,Ka;this.setTable=function(R){G=R};this.getTable=function(){return G};this.setTableExist=function(R){Ka=R};this.isTableExist=function(){return Ka}}function B(){KTableUIDraggableAdjustingHandler.CustomExpendor.call(this);this.getTailBlankForDragging=function(){return 0}}var F=this,J,C,p,f={},t,q,
z,L,E=[],M,x=0,U=n.getHeadRowCount();this.getJqUi=function(){if(!J){J=$("<div>");Ha.layoutCtrlWithLRTB(J,0,0,null,0,0,null);J.append(Z.PublicDimensionUtil.createTipUi());C=n.createTable();n.bindTextEditor(C,ha,Wa);C.setDraggableAdjusting(!0,3,0,new B);n.bindTableListenerForCtrl(C,Pa);p=new g(C);p.setOutsideVisible(!1);C.setCellRender(p);var G=$(C.getUI());Ha.layoutCtrlWithLRTB(G,0,0,null,30,0,null);G.appendTo(J);G=t.getModelerModel().getAllTable();for(var Ka=0;Ka<G.length;Ka++){var R=G[Ka];var va=
R;var Ia=Z.MetricStateMonitor.getInvalidTableMap();va=-1===Object.keys(Ia).indexOf(va.getUid());Ia=new h;Ia.setTable(R);Ia.setTableExist(va);E.push(Ia)}C.addColumns(E.length+3);C.getColumn(E.length+2).setWidth(30);C.getColumn(E.length+1).setWidth(200);C.getColumn(0).setWidth(30);for(G=0;G<E.length;G++)R=E[G],C.getColumn(G+1).setWidth(200),C.getColumn(G+1).setUserObject(R);Ka=n.createHeadRow(C);for(G=0;G<E.length;G++)R=E[G],R=Z.TableNameHelper.getDisplayText(R.getTable()),Ka.getCell(G+1).setValue(R);
Ka.getCell(E.length+1).setValue(O.get("publicDimensionName","\u516c\u5171\u7ef4\u5ea6\u540d\u79f0"));G=new KTStyle;G.setBackgroundColor("#F7D49F");G.setBold(!0);G.setTextAlign("center");C.getRow(0).getCell(E.length+1).setStyle(G);C.getRow(1).getCell(E.length+1).setStyle(G);C.getRow(2).getCell(E.length+1).setStyle(G);C.getRow(0).getCell(E.length+2).setStyle(G);C.getRow(1).getCell(E.length+2).setStyle(G);C.getRow(2).getCell(E.length+2).setStyle(G);Aa();bb();ua()}return J};this.setGlobal=function(G){t=
G};this.setMessageCurtain=function(G){z=G};this.setPublicDimensions=function(G){q=G};this.getPublicDimensions=function(){for(var G=[],Ka=0;Ka<q.length;Ka++){var R=q[Ka];R.isEmpty()||G.push(R)}return G};this.checkPublicDimensionValid=function(){for(var G=[],Ka=0;Ka<E.length;Ka++)E[Ka].isTableExist()||G.push(E[Ka]);if(1==G.length)return G=Z.TableNameHelper.getDisplayText(G[0].getTable()),z.showPrompt(O.get("oneTableNotExist","\u201c#1\u201d\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002").replace("#1",
G)),!1;if(2<=G.length){Ka=Z.TableNameHelper.getDisplayText(G[0].getTable());var R=Z.TableNameHelper.getDisplayText(G[1].getTable());z.showPrompt(O.get("moreTableNotExist","\u201c#1\u201c\u3001\u201d#2\u201c\u7b49#3\u4e2a\u8868\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002").replace("#1",Ka).replace("#2",R).replace("#3",G.length));return!1}for(Ka=0;Ka<q.length;Ka++){G=q[Ka];if(!G.isFieldsCompleted())return z.showPrompt(O.get("publicDimensionNotComplete","\u7b2c#1\u884c\u8bbe\u7f6e\u4e0d\u5b8c\u6574\u3002").replace("#1",
Ka+1)),!1;if(!G.isDataTypeConsistent())return z.showPrompt(O.get("publicDimensionDataTypeNotConsistent","\u7b2c#1\u884c\u7684\u5b57\u6bb5\u6570\u636e\u7c7b\u578b\u4e0d\u4e00\u81f4\u3002").replace("#1",Ka+1)),!1}return!0};this.setTableFieldMap=function(G){for(var Ka=Object.keys(G),R=0;R<Ka.length;R++){var va=Ka[R],Ia=G[va].slice();Ia.unshift(null);f[va]=Ia}};this.setPublicDimensionColVisible=function(){2<E.length&&(n.refresh(C),C.scrollCellVisible(0,C.getColumnsCount()-2,!1))};var ua=function(){var G=
$("<div>");G.text(O.get("clearMetricSetting","\u6e05\u7a7a\u8bbe\u7f6e"));G.css({color:"#5582F3","text-align":"right","font-size":"12px",cursor:"pointer","margin-right":"0px","pointer-events":"auto"});Ha.layoutCtrlWithLRTB(G,null,0,null,0,null,null);G.on("click",function(){0!=q.length&&(q.splice(0,q.length),Aa())});G.appendTo(J)};this.destroy=function(){F.unobserveWindow()};this.unobserveWindow=function(){L.unobserve()};this.observeWindow=function(){L.observe()};var Aa=function(){n.clearWithoutHead(C);
for(var G=q.length-1;0<=G;G--){var Ka=q[G];if(Oa(Ka))q.splice(G,1);else break}var R=q.length+4;for(G=0;G<R;G++){G>=q.length?(Ka=fa(),q.push(Ka)):Ka=q[G];var va=n.createRow(C);aa(Ka,va)}wa();setTimeout(function(){n.refresh(C)},0)},bb=function(){L=new ia;L.setCallback(function(){C.relayoutViews()});L.observe()},fa=function(){for(var G=t.getModelerModel().getAllTable(),Ka=new qa,R=0;R<G.length;R++){var va=new k;va.setTableId(G[R].getUid());Ka.addField(va)}return Ka},Oa=function(G){if(G.getName())return!1;
G=G.getFields();for(var Ka=0;Ka<G.length;Ka++)if(G[Ka].getName())return!1;return!0},aa=function(G,Ka){Ka.setUserObject(G);for(var R=G.getFields(),va=0;va<R.length;va++){var Ia=R[va];Ka.getCell(va+1).setUserObject(Ia);Ka.getCell(va+1).setValue(Ia.getName())}Ka.getCell(R.length+1).setValue(G.getName())},wa=function(){for(var G=x=0;G<q.length;G++){a:{var Ka=q[G];if(Ka.getName()){Ka=Ka.getFields();for(var R=0;R<Ka.length;R++)if(!Ka[R].getName()){Ka=!1;break a}Ka=!0}else Ka=!1}if(Ka)x++;else break}},Pa=
function(G,Ka,R,va){G=KTableUIAbstractView.createCellId(C.getRow(R),C.getColumn(C.getColumnsCount()-1));G=F.getJqUi().find("#"+G);Ka?(Ka=$("<div>"),ba.backgroundWithHover(Ka,"delete"),Ka.addClass("modeler-metric-dimension-table-operation"),Ka.on("click",function(){q.splice(R-U,1);Aa()}),Ka.appendTo(G),G.css("text-align","center"),M=G):M&&M.find(".modeler-metric-dimension-table-operation").remove()},V=function(G,Ka){if(Ka){var R=G.getUserObject();Ka=G.getSelectedModel();G=G.getJqUi().attr("data-colIndex")-
1;G=R.getFieldByIndex(G);Ka&&G.getName()==Ka.getName()||(G.update(Ka),G.setExist(!0),R.tryGenerateName(function(){return Z.PublicDimensionUtil.getUniquePublicDimensionName(t,q,R)}),Aa())}},X=function(G,Ka,R){for(var va=[],Ia=0;Ia<Ka.length;Ia++){var Sa=Ka[Ia];if(Sa){for(var ka=!0,ya=0;ya<G.length;ya++)if(G[ya].getFieldByIndex(R).getName()==Sa.getName()){ka=!1;break}ka&&va.push(Sa)}}return va},ha=function(G,Ka){return Ka==C.getColumnsCount()-2},Wa=function(G,Ka,R,va){Ka=G.getUserObject();var Ia=O.get("publicDimensionName",
"\u516c\u5171\u7ef4\u5ea6\u540d\u79f0");va=va?va.trim():"";G=(G=G.getUserObject().getName())?G.trim():"";var Sa=/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/;if(G!=va){if(G&&0==va.length)var ka=O.get("valueCanNotBeEmpty","#1\u4e0d\u53ef\u4e3a\u7a7a").replace("#1",Ia);else if(50<va.length)ka=O.get("valueTooLong","#1\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7#2\u4e2a\u5b57\u7b26").replace("#1",Ia).replace("#2",50);else if(0<va.length&&!va.match(Sa))ka=O.get("invalidDimensionName","#1\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210").replace("#1",
Ia);else{G=q;Sa=[];for(var ya=0;ya<G.length;ya++)Ka&&Ka==G[ya]||Sa.push(G[ya].getName());if(Z.PublicDimensionUtil.isValueDuplicate(Sa,va)){ka=O.get("duplicateValue","#1\u5df2\u5b58\u5728\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",Ia);z.showPrompt(ka);return}}if(ka)ka=O.get("modifyAbandoned","#1\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",ka),z.showPrompt(ka);else{ka=va;Ia=t.getModelerModel().getAllDimension();G=[];for(Sa=0;Sa<Ia.length;Sa++)ya=Ia[Sa],ya.getPublicDimensionId()!=
Ka.getId()&&G.push(ya.getName());Z.PublicDimensionUtil.isValueDuplicate(G,ka)?(ka=O.get("duplicateDimensionNameInPd","\u516c\u5171\u7ef4\u5ea6\u540d\u79f0\u4e0e\u5df2\u6709\u7ef4\u5ea6\u540d\u79f0\u91cd\u590d\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002"),z.showPrompt(ka),ka=!1):ka=!0;(ka=!ka)||(ka=va,Ia=t.getModelerModel(),Ia=Z.PublicDimensionUtil.getAllMetricName(Ia),Z.PublicDimensionUtil.isValueDuplicate(Ia,ka)?(ka=O.get("duplicateDimensionNameInMetric","#1\u4e0e\u6307\u6807\u540d\u79f0\u91cd\u590d\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",
O.get("publicDimensionName","\u516c\u5171\u7ef4\u5ea6\u540d\u79f0")),z.showPrompt(ka),ka=!1):ka=!0,ka=!ka);ka||(Ka.setName(va),Ka.setNameModified(!0),R.setValue(va),Aa())}}}}function A(){Y.call(this);var g=this.protectedMethod,v,u,h,B;this.protectedCreateUi=function(F){B=F.getMessageCurtain();v=new ta;v.setGlobal(u);v.setMessageCurtain(B);F=[];for(var J=0;J<h.length;J++){var C=h[J].copy();F.push(C)}v.setLeftModel(F);v.setRightModel([]);F=v.getJqUi();F.css({height:"100%"});return F};this.setGlobal=
function(F){u=F};this.setCompletedPublicDimension=function(F){h=F};this.getSubTitle=function(){return O.get("createDimension","\u65b0\u589e\u7ef4\u5ea6")};this.intoThisStep=function(){v.relayout()};this.isLastStep=function(){return!0};this.isReturnable=function(){return!0};this.outThisStep=function(F,J){if(F)g.getTopJqUi()&&g.getTopJqUi().remove(),J(null);else if(v.checkDimensionsValid()){F=v.getDimensions();var C=v.getPublicDimensions(),p=u.getModelerModel(),f=new m,t=p.copyExprReferences();p.repairDimensionRef(F);
f.setValue(t,F,C,u);u.getCommandManager().perform(f);J(null)}}}function Q(){var g,v,u,h=[],B=this,F,J=[r.VALUE_YYYY=0,r.VALUE_QUARTER=1,r.VALUE_MONTH=2,r.VALUE_DAY=3,r.VALUE_YEAR_QUARTER=4,r.VALUE_YEAR_MONTH=5,r.VALUE_YEAR_WEEK=6,r.VALUE_WEEK_OF_YEAR=7,r.VALUE_DAY_OF_WEEK=8,r.VALUE_YEAR_MONTH_DAY=9],C=function(M){KTDefaultCellRender.call(this,M);var x=this,U=this.paintCellUI;this.paintCellUI=function(ua,Aa){var bb=x.getCurrentRow(),fa=bb.getUserObject(),Oa=x.getCell(),aa=x.getCurrentRowIdx(),wa=x.getCurrentColIdx(),
Pa=x.getCellWidth(),V=x.getCellHeight();(new I).setFormatString("yyyy-MM-dd HH:mm:ss");if(aa<n.getHeadRowCount())U(ua,Aa);else if(0===wa)Pa=Z.MetricStateMonitor.getInvalidDimensionPrompt(fa.getDimensionId()),V=$("<div class='modeler-metric-dimension-error-prompt'>"),V.text("!"),Pa&&V.attr("title",Pa),Pa&&V.appendTo(ua);else if(1===wa)V=fa.getNumber(),ua=$(ua),ua.empty(),Pa=$("<div>"),Pa.text(V),Pa.attr("title",V),Pa.addClass("metric-designer-dimension-tablecell-editable"),V=fa.getDimensionType(),
(V=fa.isNumberModified()&&V==r.TYPE_DATE&&!Z.MetricStateMonitor.checkDimensionInvalid(fa.getDimensionId()))&&Pa.css("padding-right","20px"),fa.isNumberModified()?Pa.css("color","#333333"):Pa.css("color","#C0C0C0"),Z.PublicDimensionUtil.appendResetButton(ua,V,function(){var X=z(fa,!0);t(!0,fa,X,!1);fa.setNumberModified(!1);bb.setUserObject(fa);Oa.setValue(X);E(fa)}),Pa.appendTo(ua);else if(2===wa)Pa=fa.getName(),ua=$(ua),ua.empty(),Aa=$("<div>"),Aa.text(Pa),Aa.attr("title",Pa),Aa.addClass("metric-designer-dimension-tablecell-editable"),
(V=fa.isNameModified()&&!Z.MetricStateMonitor.checkDimensionInvalid(fa.getDimensionId()))&&Aa.css("padding-right","20px"),Z.PublicDimensionUtil.appendResetButton(ua,V,function(){fa.setNameModified(!1);var X=z(fa,!1);t(!1,fa,X,!1);bb.setUserObject(fa);Oa.setValue(X);E(fa)}),Aa.appendTo(ua);else if(3===wa)switch(Aa=$("<div class='metric-designer-dimension-table-field'>"),wa=fa.getDimensionType(),aa=fa.getDateFormat(),wa){case r.TYPE_DATE:ua=n.createCtrlInCell(ua,Pa,V,W);void 0!==aa?ua.setSelected(aa):
ua.setSelected(J[0]);ua.setUserObject(bb);ua.setItemModels(J);ua.showFeature(!0);ua.setCustomPainter(function(X,ha,Wa){Wa=Z.DimensionUtil.getDateFormatName(Wa);X&&(Wa=O.get("dateDimension","\u65e5\u671f\u7ef4")+"_"+Wa);ha.text(Wa);ha.attr("title",Wa)});ua.addSelectedChangedListener(function(X,ha,Wa){fa.setDateFormat(Wa);fa.isNameModified()||(X=z(fa,!1),t(!1,fa,X,!1));E(fa)});Z.MetricStateMonitor.checkDimensionInvalid(fa.getDimensionId())&&ua.setEnabled(!1);break;case r.TYPE_NORMAL:Pa=$("<div>");V=
O.get("normalDimension","\u666e\u901a\u7ef4");Pa.text(V);Pa.attr("title",V);Pa.css({position:"absolute",left:"4px"});Pa.appendTo(Aa);Aa.appendTo(ua);break;default:throw Error("unknown dimension type");}}};this.getJqUi=function(){if(!v){g=n.createTable();g.setDraggableAdjusting(!1);g.setColumnFitVisibleWidth(!0);n.bindTextEditor(g,p,f);n.bindTableListenerForCtrl(g,L);var M=new C(g);M.setOutsideVisible(!1);g.setCellRender(M);g.setSyncUIWhenModelChanged(!0);g.setScrollerVisible("hidden","auto");v=$("<div class='modeler-metric-dimension-table'>");
Ha.layoutCtrlWithLRTB(v,10,10,null,70,0,null);v.append($(g.getUI()))}return v};this.setGlobal=function(M){F=M};this.updateTable=function(){var M=g.keepScrollStatus();n.clear(g);g.addColumns(5);g.getColumn(0).setWidth(25);g.getColumn(1).setWidth(100);g.getColumn(2).setWidth(100);g.getColumn(3).setWidth(100);g.getColumn(4).setWidth(30);var x=n.createHeadRow(g);x.getCell(1).setValue(O.get("dimensionNumber","\u7ef4\u5ea6\u7f16\u7801"));x.getCell(2).setValue(O.get("dimensionName","\u7ef4\u5ea6\u540d\u79f0"));
x.getCell(3).setValue(O.get("dimensionType","\u7ef4\u5ea6\u7c7b\u578b"));x=F.getModelerModel().getAllDimension();for(var U=[],ua=0;ua<x.length;ua++)U.push(x[ua].copy());h=U;for(x=0;x<h.length;x++)U=h[x],ua=n.createRow(g,!0),ua.setUserObject(U),ua.getCell(1).setValue(U.getNumber()),ua.getCell(2).setValue(U.getName()),ua.setHeight(30);B.refreshTable();g.restoreScrollStatus(M)};var p=function(M,x){if(M<n.getHeadRowCount()||1!==x&&2!==x)return!1;M=g.getRow(M).getUserObject();return!Z.MetricStateMonitor.checkDimensionInvalid(M.getDimensionId())},
f=function(M,x,U,ua){ua||(ua="");M=M.getUserObject();var Aa=(x=1===g.getColumnIndex(x))?M.getNumber():M.getName();if(ua!=Aa){var bb=x?Z.DimensionUtil.getAllNumber(F,M,!0):Z.DimensionUtil.getAllName(F,M,!0),fa=F.getModelerModel().getAllTable();if(!(Aa=!q(bb,ua,Aa,x))){if(fa=2<=fa.length&&!x)fa=ua,Aa=F.getModelerModel(),Aa=Z.PublicDimensionUtil.getAllPublicDimensionName(Aa,M.getPublicDimensionId()),Z.PublicDimensionUtil.isValueDuplicate(Aa,fa)?(fa=O.get("duplicatePdNameInDimension","\u7ef4\u5ea6\u540d\u79f0\u4e0e\u5df2\u6709\u516c\u5171\u7ef4\u5ea6\u540d\u79f0\u91cd\u590d\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002"),
F.getMessageCurtain().showPrompt(fa),fa=!1):fa=!0,fa=!fa;Aa=fa}(fa=Aa)||(fa=ua,Aa=F.getModelerModel(),Aa=x?Z.DimensionUtil.getAllMetricNumber(Aa,!0):Z.PublicDimensionUtil.getAllMetricName(Aa),x&&(fa=fa.toLowerCase()),Z.PublicDimensionUtil.isValueDuplicate(Aa,fa)?(fa=x?O.get("duplicateDimensionNumberInMetric","\u7ef4\u5ea6\u7f16\u7801\u4e0e\u6307\u6807\u7f16\u7801\u91cd\u590d\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002"):O.get("duplicateDimensionNameInMetric","#1\u4e0e\u6307\u6807\u540d\u79f0\u91cd\u590d\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",
O.get("dimensionName","\u7ef4\u5ea6\u540d\u79f0")),F.getMessageCurtain().showPrompt(fa),fa=!1):fa=!0,fa=!fa);fa||(t(x,M,ua,!0),U.setValue(ua),E(M))}},t=function(M,x,U,ua){M?(x.setNumber(U),ua&&x.setNumberModified(!0)):(x.setName(U),ua&&x.setNameModified(!0),x.getDimensionType()==r.TYPE_NORMAL||x.isNumberModified()||(ua?(M=Z.DimensionUtil.getAllNumber(F,x),U=Z.DimensionUtil.fixNumber(M,U)):U=Z.DimensionUtil.getUniqueNumber(F,x),x.setNumber(U)))},q=function(M,x,U,ua){var Aa=ua?25:50,bb=ua?O.get("dimensionNumber",
"\u7ef4\u5ea6\u7f16\u7801"):O.get("dimensionName","\u7ef4\u5ea6\u540d\u79f0"),fa=/^([\u4E00-\u9FA5a-zA-Z_])[\u4E00-\u9FA5a-zA-Z0-9_]{0,}$/,Oa=/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/;if(U==x)return!1;if(ua)for(x=x.toLowerCase(),U=0;U<M.length;U++)M[U]=M[U].toLowerCase();if(0==x.length)var aa=O.get("valueCanNotBeEmpty","#1\u4e0d\u53ef\u4e3a\u7a7a").replace("#1",bb);else if(x.length>Aa)aa=O.get("valueTooLong","#1\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7#2\u4e2a\u5b57\u7b26").replace("#1",bb).replace("#2",
Aa);else if(ua&&!x.match(fa))aa=O.get("invalidNumber","#1\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").replace("#1",bb);else if(!ua&&!x.match(Oa))aa=O.get("invalidDimensionName","#1\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210").replace("#1",bb);else if(Z.PublicDimensionUtil.isValueDuplicate(M,x))return aa=O.get("duplicateValue",
"#1\u5df2\u5b58\u5728\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",bb),F.getMessageCurtain().showPrompt(aa),!1;return aa?(aa=O.get("modifyAbandoned","#1\uff0c\u5df2\u653e\u5f03\u4fee\u6539\u3002").replace("#1",aa),F.getMessageCurtain().showPrompt(aa),!1):ua&&c.isSpecialWord(x)?(aa=O.get("specialWord","\u201c#1\u201d\u4e3a\u7279\u6b8a\u5173\u952e\u5b57\uff0c\u4e0d\u80fd\u4f5c\u4e3a#2\u3002").replace("#1",x).replace("#2",bb),F.getMessageCurtain().showPrompt(aa),!1):!0},z=function(M,x){var U=
F.getModelerModel().getPublicDimensionById(M.getPublicDimensionId());if(!U)return"";if(x)return Z.DimensionUtil.getUniqueNumber(F,M);x=Z.DimensionUtil.getAllName(F,M);return M.getDimensionType()==r.TYPE_NORMAL?(U=U.getFieldByIndex(0),Z.DimensionUtil.fixName(x,U.getAlias(),M)):Z.DimensionUtil.fixName(x,U.getName(),M)},L=function(M,x,U,ua){M=KTableUIAbstractView.createCellId(g.getRow(U),g.getColumn(g.getColumnsCount()-1));M=B.getJqUi().find("#"+M);x?(x=$("<div>"),ba.backgroundWithHover(x,"delete"),
x.addClass("modeler-metric-dimension-table-operation"),x.on("click",function(){var Aa=g.getRow(U).getUserObject(),bb=new y;bb.setValue(Aa,F);F.getCommandManager().perform(bb)}),x.appendTo(M),M.css("text-align","center"),u=M):u&&u.find(".modeler-metric-dimension-table-operation").remove()};this.refreshTable=function(){n.refresh(g)};var E=function(M){var x=F.getModelerModel(),U=new S,ua=x.copyExprReferences(),Aa=[];Aa.push(M);x.repairDimensionRef(Aa);U.setValue(ua,M,F);F.getCommandManager().perform(U)}}
"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.metricdesigner&&(com.kingdee.bos.qing.modeler.designer.metricdesigner=
{});var Z=com.kingdee.bos.qing.modeler.designer.metricdesigner;Z.PropertyArea=function(){var g,v,u,h,B;this.getJqUi=function(){if(!g){g=$("<div>");g.addClass("modeler-designer-common-border");var q=$("<div>");q.addClass("modeler-propertyarea-lineitem-title");q.appendTo(g);var z=$("<div>");z.appendTo(q);Ha.layoutCtrlWithLRTB(z,5,0,null,2,2,null);z.css("border-left","3px solid #5582f3");z=$("<div>");z.text(O.get("dimension","\u7ef4\u5ea6"));Ha.layoutCtrl(z,15,null,200,null);Ha.layoutCtrlMiddleAlign(z,
16);z.appendTo(q);z.css({"font-weight":"bold",color:"#666"});q=$("<div>");z=f("createDim",O.get("createDimension","\u65b0\u589e\u7ef4\u5ea6"),C);v=f("publicDimension",O.get("publicDimensionSetting","\u516c\u5171\u7ef4\u5ea6\u8bbe\u7f6e"),p);q.append(z);q.append(v);q.addClass("modeler-propertyarea-lineitem-title");q.css({"margin-left":"10px"});g.append(q);h=new Q;h.setGlobal(B);g.append(h.getJqUi());F()}return g};this.setGlobal=function(q){B=q};var F=function(){Z.MetricStateMonitor.addStateChangeListener(function(){h.updateTable()})};
this.afterResize=function(){h.updateTable()};this.setModelerModel=function(q){u&&u.removePropertyChangeCallback(t);u=q;u.addPropertyChangeCallback(t);h.updateTable()};var J=function(q){var z=[],L=B.getModelerModel();$.each(q,function(E,M){for(var x=0;x<M.length;x++){var U=new qa;U.setName(M[x].getAlias());var ua=new k;ua.setTableId(E);ua.setName(M[x].getName());ua.setDataType(M[x].getDataType());ua.setAlias(M[x].getAlias());U.addField(ua);(ua=L.getSamePublicDimension(U))?U.setId(ua.getId()):(ua=com.kingdee.bos.qing.modeler.designer.UIDHelper,
ua=ua.getUID(ua.NS_PUBLIC_DIMENSION),U.setId(ua));z.push(U)}});return z},C=function(){var q=u.getAllTable();0===q.length?B.getMessageCurtain().showPrompt(O.get("needSelectedEntity","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u6570\u636e\u8868\u3002")):1===q.length?Z.FieldLoader.loadTableFields(B,g,function(z){z=J(z);var L=new Xa;L.setPublicDimensions(z);L.setGlobal(B);L.showDimensionDialog()}):Z.FieldLoader.loadTableFields(B,g,function(z){for(var L=u.getPublicDimensions(),E=[],M=0;M<L.length;M++){var x=
L[M].copy();x.updateFields(z);x.isFieldsCompleted()&&x.isDataTypeConsistent()&&E.push(x)}z=new Xa;z.setPublicDimensions(E);z.setGlobal(B);z.showDimensionDialog()})},p=function(){0==B.getModelerModel().getAllTable().length?B.getMessageCurtain().showPrompt(O.get("needSelectedEntity","\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u6570\u636e\u8868\u3002")):(new ca(B)).showDialog()},f=function(q,z,L){var E=$("<span>"),M=$("<span>");ba.background(M,q);M.css({position:"absolute",width:"16px",height:"16px"});
var x=$("<span>");x.text(z);x.css({"margin-left":"18px"});x.attr("title",z);E.append(M);E.append(x);E.css({color:"var(--color-main, #5582f3)","font-size":"12px",cursor:"pointer","margin-right":"15px"});E.on("mouseenter",function(){ba.background(M,q+"_hover")});E.on("mouseleave",function(){ba.background(M,q)});E.on("click",L);return E},t=function(q,z){q==d.KEY_BATCH_UPDATE_DIMENSION||q==d.KEY_ADD_DIMENSION||q==d.KEY_UPDATE_DIMENSION||q==d.KEY_REMOVE_DIMENSION?h.updateTable():(q==a.KEY_ADD_TABLE||q==
a.KEY_REMOVE_TABLE)&&h.updateTable()}};var O,ia,Ha,ba,n,Ba,I,P,D,W,la,Ea,ra,K,pa,za,na,y,S,T,m,r,qa,k,d,b,a,l,c,e;(function(){var g=com.kingdee.bos.qing.framework.common;O=g.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer);ia=g.WindowResizeObserver;g=com.kingdee.bos.qing.common;Ha=g.DomUtil;I=g.DateFormater;g=com.kingdee.bos.qing.modeler;c=g.SpecialWordChecker;g=com.kingdee.bos.qing.ui.component;P=g.AbstractModalDialog;D=g.Button;ra=g.SearchBox;K=g.WorkButton;W=g.ComboBox;
la=g.List;pa=g.WizardDialog;Ea=g.DropdownSelector;g=com.kingdee.bos.qing.common.ui;n=g.TableUtil;Ba=g.CommonIconUtil;g=com.kingdee.bos.qing.modeler.designer.metricdesigner;r=g.Dimension;k=g.MappingField;qa=g.PublicDimension;d=g.MetricModeler;y=g.RemoveDimensionAction;S=g.UpdateDimensionAction;T=g.UpdatePublicDimensionAction;m=g.BatchUpdateDimensionAction;g=com.kingdee.bos.qing.modeler.designer;ba=g.Icons;za=g.Field;a=g.ModelerModel;na=g.AbstractLeftRightSelector;b=g.ChooseFieldPanelHelper;a=g.ModelerModel;
l=g.NoDataView;e=g.UserOperationReporter})()})();(function(){"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.metricdesigner&&(com.kingdee.bos.qing.modeler.designer.metricdesigner=
{});com.kingdee.bos.qing.modeler.designer.metricdesigner.PreviewDialog=function(){ta.call(this);var n=this.protectedMethod,Ba=this,I,P,D,W,la,Ea,ra,K,pa,za,na,y,S=!1;(function(){n.setTitle(Va.get("preview","\u9884\u89c8"));var e=$(document.body),g=e.prop("clientWidth");e=e.prop("clientHeight");var v=Math.min(1,Math.max(.8,1.16-2E-4*g));g=parseInt(v*g);e=parseInt(v*e);Ba.setSize(g,e);n.getDialogCtrl().setMinSize(680,240);n.setSelectable(!0);n.getDialogCtrl().setFullScreenEnabled();n.getDialogCtrl().setResizeEnabled();
n.getDialogCtrl().addResizeListener(function(){ra&&ra.relayoutViews()});n.setFooterPaneCreator(null);n.setClosingAction(function(u){u=new A(P.getRemoteImpl());u.setShowBlocking(!1);u.deleteResultDataFile(y,na)})})();var T=function(e,g){var v=new Ha;v.setText(g);v.setType(Ha.TYPE_NO_DATA_WITH_CLOUD);g=v.getJqUi();g.css("top","calc(50% - 110px)");g.appendTo(e);Ba.setSize(800,600)},m=function(){var e=$("<div>");T(e,Va.get("modelNoData","\u5f53\u524d\u6a21\u578b\u6ca1\u6709\u53ef\u9884\u89c8\u7684\u6570\u636e"));
return e},r=function(e){var g=new A(P.getRemoteImpl(),function(v){I=new Q;I.fromJsonObject(v.resultData);na=v.jobName;y=v.jobId;pa=v=v.totalRowCount;1E5<v&&(S=!0,pa--);v=new KTBorderStyle;v.setBorderWidth(1);v.setBorderPen("solid");v.setBorderColor("#E3E3E3");var u=new KTStyle;u.setVerticalAlign("bottom");ra=new KTable;ra.setBorder(v);ra.setStyle(u);ra.setDraggableAdjusting(!0,1,0);ra.setSyncUIWhenModelChanged(!1);ra.setLargeDataMode(!0);ra.setFrozenRows(1);ra.getCellRender().setOutsideVisible(!1);
ra.setColumnFitVisibleWidth(!1);v=I.getColumnCount();ra.addColumns(v);var h=new KTStyle;h.setTextAlign("center");h.setBold(!0);h.setColor("#666");u=ra.addRow();u.setStyle(h);u.setHeight(22);h=new KTStyle;h.setBackgroundColor("#81D3F8");var B=new KTStyle;B.setBackgroundColor("#FACD91");za=W.getAllDimension().length;for(var F=0;F<v;F++){var J=u.getCell(F),C=ra.getColumn(F);J.setStyle(F<za?h:B);var p=I.getField(F).getAlias();J.setValue(p);C.setWidth(150)}v=$(ra.getUI());v.appendTo(e);ca.layoutCtrlWithLRTB(v,
0,0,null,32,0,null);I&&0==I.getRowCount()?(Xa.refresh(ra),u=$("<div class='metric-designer-preview-no-result'>"),u.text(Va.get("calculateNoResult","\u6ca1\u6709\u6570\u636e")),u.appendTo(v)):(c(),ra.updateUI(),ra.setLargeDataMode(!0));k(e);v=$("<div>");v.addClass("modeler-designer-model-preview-rowcount-container");v.appendTo(la);S?(u=Va.get("showRowCount","\u4ec5\u663e\u793a#1\u884c"),h=$("<span>"),h.text(Va.get("getTotalRowCount","\u603b\u884c\u6570")),h.addClass("modeler-designer-model-preview-rowcount-btn"),
h.css("cursor","pointer"),a(h),h.appendTo(la)):u=Va.get("totalRowCount","\u5171#1\u884c");u=u.replace("#1",pa+"");Ea=$("<span>");Ea.text(u);Ea.appendTo(v);K=new Da;K.getJqUi().appendTo(la);K.addActionListener(b);d(!1);K.getJqUi().addClass("modeler-designer-model-preview-export-btn")});g.setBlockingJqUi(e);g.getFirstPageMetric(D);return e},qa=function(){var e=$("<div>");(new A(P.getRemoteImpl(),function(g){g&&0==g.valid?T(e,Va.get("modelInvalid","\u6a21\u578b\u5f02\u5e38\uff0c\u65e0\u6cd5\u9884\u89c8\u6570\u636e")):
r(e)})).checkModelerValid(D);return e};this.showMetricDialog=function(){0==W.getAllMetric().length?n.setContentPaneCreator(m):n.setContentPaneCreator(qa);Ba.showDialog()};this.setGlobal=function(e){P=e};this.setJsonQingModeler=function(e){D=e;e=new O;e.fromJsonObject(D);W=e.getModelerModel()};var k=function(e){var g=new ia;g.protectedMethod.setTotalSelectedRowAndSelectedAllVisual(!1,!1);g.protectedMethod.setTotalRowVisual(!1);g.protectedMethod.setCurrentPageVisual(!0);g.protectedMethod.setFirstBtnAndEndBtnVisual(!0);
g.setComboBoxItemModelsAndSelectedItem([5,10,20,50,100,500,1E3],4);g.setJumpToPageListener(function(v,u,h){h&&h(pa);l(v,u)});la=g.getJqUi();la.appendTo(e);g.resetPaginationAndJumpToFirstPage(pa)},d=function(e){e?(K.setText(Va.get("exporting","\u6b63\u5728\u5bfc\u51fa...")),K.setEnabled(!1)):(K.setText(Va.get("exportToExcel","\u5bfc\u51fa\u5230Excel")),K.setEnabled(!0))},b=function(){var e=new A(P.getRemoteImpl(),function(g){d(!1);var v=Y.formatDate("yyyyMMdd_HHmmss");mb.downloadFile("QingModeler-"+
v+".xlsx",g)});e.setShowBlocking(!1);d(!0);e.exportMetricData(D,y,na,pa);ba.occur(ba.BUTTON_TYPE,ba.MODEL_PREVIEW_EXPORT_TO_EXCEL)},a=function(e){e.on("click",function(){var g=new A(P.getRemoteImpl(),function(v){var u=Va.get("showRowCount","\u4ec5\u663e\u793a#1\u884c").replace("#1",""+pa);v=Va.get("totalRowCount","\u5171#1\u884c").replace("#1",""+v);Ea.text(u+"/"+v);e.remove()});g.setShowBlocking(!1);g.getTotalRowCount(y,na);e.text(Va.get("calculating","\u8ba1\u7b97\u4e2d..."));e.css("color","#404040");
e.css("cursor","");e.off("click")})},l=function(e,g){e=(e-1)*g;var v=new A(P.getRemoteImpl(),function(u){I=new Q;I.fromJsonObject(u);for(u=ra.getRowsCount()-1;0<u;u--)ra.removeRow(u);c();ra.updateUI();ra.setLargeDataMode(!0)});v.setShowBlocking(!1);v.updateMetricByPage(D,y,na,e,g)},c=function(){var e=new KTStyle;e.setTextAlign("left");var g=new KTStyle;g.setTextAlign("right");var v=new KTStyle;v.setColor("#333");v.setBackgroundColor("#F3F3F3");var u=new KTStyle;u.setColor("#333");u.setBackgroundColor("#fff");
for(var h=0;h<I.getRowCount();h++){var B=1==h%2?v:u,F=ra.addRow();F.setHeight(22);F.setStyle(B);for(B=0;B<I.getColumnCount();B++){var J=F.getCell(B);J.setStyle(B<za?e:g);var C=I.getOneRow(h),p=I.getField(B),f=p.getOutputDataType();C=C[B];null==C||void 0==C?C="":f==Z.DT_DATE?(p=new Ma,p.setFormatString("yyyy-MM-dd"),C=p.format(C)):f==Z.DT_DATETIME?(p=new Ma,p.setFormatString("yyyy-MM-dd HH:mm:ss"),C=p.format(C)):f==Z.DT_BOOLEAN?C=void 0===C?"":C?"true":"false":f==Z.DT_NUMBER&&(p=p.getFormat())&&(f=
new oa,f.setFormatString(p),C=f.format(C));J.setValue(C)}}}};var ta,Da,Va,mb,Xa,ca,Y,Ma,oa,A,Q,Z,O,ia,Ha,ba;(function(){var n=com.kingdee.bos.qing.ui.component;ta=n.AbstractModalDialog;Da=n.WorkButton;n=com.kingdee.bos.qing.framework.common;Va=n.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer);mb=n.RemoteFramework;n=com.kingdee.bos.qing.common.ui;Xa=n.TableUtil;n=com.kingdee.bos.qing.common;ca=n.DomUtil;Ma=n.DateFormater;Y=n.Util;oa=n.NumberFormater;n=com.kingdee.bos.qing.biz.common;
ia=n.ComplexPaginationBar;n=com.kingdee.bos.qing.modeler.designer;A=n.DesignerFacade;Q=n.PreviewData;Z=n.Field;O=n.QingModeler;Ha=n.NoDataView;ba=n.UserOperationReporter})()})();(function(){function ta(f){n.call(this);var t=this.protectedMethod,q=this,z,L;(function(){t.setTitle(A.get("editMetric","\u7f16\u8f91\u6307\u6807"));q.setSize(800,640);t.setSelectable(!0);t.setContentPaneCreator(function(){L=new Va;L.setGlobal(z);L.setMetric(f);L.setExternalMsgCurtain(t.getMessageCurtain());return L.getJqUi()});t.setClosingChecker2(function(E){L.checkValidity(function(M){if(M)t.getMessageCurtain().showPrompt(M),E(!1);else{M=L.getMetric();if(!M.equals(f)){var x=new pa;x.setValue(f,
M,z);z.getCommandManager().perform(x)}E(!0)}})},null,!0);t.setClosingAction(function(E){})})();this.setGlobal=function(E){z=E;L&&L.setGlobal(z)}}function Da(){n.call(this);var f=this.protectedMethod,t=this,q,z,L,E;(function(){f.setTitle(A.get("createMetric","\u65b0\u5efa\u6307\u6807"));t.setSize(800,640);f.setSelectable(!0);f.setContentPaneCreator(function(){z=new Va;z.setGlobal(q);z.setExternalMsgCurtain(f.getMessageCurtain());return z.getJqUi()});f.setClosingChecker2(function(M){z.checkValidity(function(x){x?
(f.getMessageCurtain().showPrompt(x),M(!1)):(x=new K,x.setValue(z.getMetric(),q),q.getCommandManager().perform(x),M(!0))})},null,!0);f.setClosingAction(function(M){M&&(L.hide(),E.show())})})();this.setGlobal=function(M){q=M;z&&z.setGlobal(q)};this.setNoDataContainer=function(M){L=M};this.setAddMetricBtn=function(M){E=M}}function Va(){var f,t,q,z,L,E,M,x,U,ua;this.getJqUi=function(){if(!f){f=$("<div>");var V=fa();Q.layoutCtrlWithLRTB(V,0,null,200,0,0,null);V.appendTo(f);V=Aa();Q.layoutCtrlWithLRTB(V,
220,0,null,0,0,null);f.append(V);Oa()}return f};this.setGlobal=function(V){q=V};this.getMetric=function(){if(t)var V=t.clone();else V=new ra,V.setId(la.getUID(la.NS_METRIC));V.setName($.trim(M.getText()));V.setDesc($.trim(x.getText()));V.setExpr(U.getExpr());V.setFormat(L.getFormat());V.setNumber(Pa());return V};this.setMetric=function(V){t=V;Oa()};this.checkValidity=function(V){var X=M.getText().trim(),ha=x.getText().trim(),Wa=Pa(),G=/^[\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/;if(0==X.length)V(A.get("nameIsEmptyPrompt",
"\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a\u3002"));else if(50<X.length)V(A.get("metricNameTooLong","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002"));else if(X.match(G))if(G=/^([a-zA-Z_])[a-zA-Z0-9_-]{0,}$/,0==Wa.length)V(A.get("metricNumberIsEmptyPrompt","\u6307\u6807\u7f16\u7801\u4e0d\u53ef\u4e3a\u7a7a\u3002"));else if(25<Wa.length)V(A.get("metricNumberTooLongPrompt","\u6307\u6807\u7f16\u7801\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc725\u4e2a\u5b57\u7b26\u3002"));else if(Wa.match(G))if(C.isSpecialWord(Wa))V(A.get("specialWordAsMetricNumber",
"\u201c#1\u201d\u4e3a\u7279\u6b8a\u5173\u952e\u5b57\uff0c\u4e0d\u80fd\u4f5c\u4e3a\u6307\u6807\u7f16\u7801\u3002").replace("#1",Wa));else if(500<ha.length)V(A.get("descTooLongPrompt","\u63cf\u8ff0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7500\u4e2a\u5b57\u7b26\u3002"));else{Wa=q.getModelerModel();G=Wa.getAllMetric();for(ha=0;ha<G.length;ha++){var Ka=G[ha];if(t!=Ka&&X==Ka.getName()){V(A.get("duplicateNameTips","\u540d\u79f0\u91cd\u590d\u3002"));return}}Wa=Wa.getAllDimension();for(ha=0;ha<Wa.length;ha++)if(Wa[ha].getName()==
X){V(A.get("duplicateMetricNameInDimension","\u6307\u6807\u540d\u79f0\u4e0e\u7ef4\u5ea6\u540d\u79f0\u91cd\u590d\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002"));return}(X=U.checkValidity())?V(X):wa(V)}else V(A.get("invalidMetricNumberPrompt","\u6307\u6807\u7f16\u7801\u53ea\u80fd\u7531\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u201c-\u201d\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e14\u4e0d\u80fd\u4ee5\u6570\u5b57\u6216\u201c-\u201d\u5f00\u5934\u3002"));else V(A.get("invalidMetricName","\u6307\u6807\u540d\u79f0\u53ea\u80fd\u7531\u6c49\u5b57\u3001\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\u3002"))};
this.setExternalMsgCurtain=function(V){ua=V};var Aa=function(){var V=$("<div>"),X=0,ha=new ia(A.get("metricNumber","\u7f16\u7801"));ha.setRequired(!0);ha=ha.getJqUi();E=new Ha;E.setPlaceholder(A.get("invalidMetricNumberPrompt","\u6307\u6807\u7f16\u7801\u53ea\u80fd\u7531\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u201d-\u201c\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e14\u4e0d\u80fd\u4ee5\u6570\u5b57\u6216\u201c-\u201d\u5f00\u5934\u3002"));E.addEditedListener(function(){aa=!0});var Wa=E.getJqUi();Q.layoutCtrlWithLRTB(Wa,
70,0,null,X,null,23);Q.layoutCtrl(ha,0,X,70,23);var G=new ia(A.get("name","\u540d\u79f0"));G.setRequired(!0);G=G.getJqUi();M=new Ha;var Ka=M.getJqUi();Q.layoutCtrlWithLRTB(Ka,70,0,null,X+=40,null,23);Q.layoutCtrl(G,0,X,70,23);var R=(new ia(A.get("desc","\u63cf\u8ff0"))).getJqUi();x=new Ha;var va=x.getJqUi();Q.layoutCtrlWithLRTB(va,70,0,null,X+=40,null,23);Q.layoutCtrl(R,0,X,70,23);var Ia=bb();Q.layoutCtrlWithLRTB(Ia,0,0,null,X+=40,0,null);L=new mb;var Sa=L.getJqUi();Q.layoutCtrlWithLRTB(Sa,null,0,
150,X,null,20);ha.appendTo(V);Wa.appendTo(V);G.appendTo(V);Ka.appendTo(V);R.appendTo(V);va.appendTo(V);Ia.appendTo(V);Sa.appendTo(V);return V},bb=function(){U=new Ea;U.setGlobal(q);U.setFieldMapGetter(function(){return z.getTableFieldMap()});return U.getJqUi()},fa=function(){z=new Xa;z.setExcludeMetric(t);z.setGlobal(q);z.setIllegalRefAddCallback(function(V){ua&&ua.showPrompt(V)});z.setErrorCallback(function(V){ua&&ua.showError(V)});z.setExprRefCollector(function(V){U&&U.addExprReference(V)});return z.getJqUi()},
Oa=function(){t&&f&&(M.setText(t.getName()),x.setText(t.getDesc()),U.setCurrentMetricId(t.getId()),U.setExpr(t.getExpr()),L.setFormat(t.getFormat()),E.setText(t.getNumber()))},aa=!1,wa=function(V){aa||V();oa.MetricNumberHelper.isImplExist()||V();for(var X=Pa(),ha=t?t.getId():null,Wa=q.getModelerModel().getAllMetric(),G=0;G<Wa.length;G++){var Ka=Wa[G];if(Ka.getNumber().toLowerCase()==X.toLowerCase()&&Ka.getId()!=ha){V(A.get("duplicateMetricNumber","\u6307\u6807\u7f16\u7801\u5df2\u5b58\u5728\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002"));
return}}Wa=q.getModelerModel().getAllDimension();for(G=0;G<Wa.length;G++)if(Wa[G].getNumber().toLowerCase()==X.toLowerCase()){V(A.get("duplicateMetricNumberInDimension","\u6307\u6807\u7f16\u7801\u4e0e\u7ef4\u5ea6\u7f16\u7801\u91cd\u590d\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002"));return}oa.MetricNumberHelper.isNumberExist(ha,X,function(R){R?V(A.get("duplicateMetricNumber","\u6307\u6807\u7f16\u7801\u5df2\u5b58\u5728\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002")):V()},function(){V(A.get("checkMetricNumberFailed",
"\u7f16\u7801\u6821\u9a8c\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\u3002"))})},Pa=function(){return E?E.getText().trim():""}}function mb(){function f(){n.call(this);var L=this,E=this.protectedMethod,M;(function(){E.setTitle(A.get("numberFormat","\u6570\u5b57\u683c\u5f0f"));M||(M=new Z,L.setSize(428,257),E.setContentPaneCreator(function(){var x=new O;x.decode(q?q:"#,##0.00");M.setModel(x);return M.getJqUi()}),E.setClosingChecker(M.isValidToAccepted),E.setClosingAction(function(x){x&&(q=M.getModel().encode(),
p.occur(p.FUNCTION,p.NUMBER_FOMMAT))}))})()}var t,q;this.getJqUi=function(){t||z();return t};this.setFormat=function(L){q=L};this.getFormat=function(){return q};var z=function(){t=$("<div>");t.css("cursor","pointer");var L=$("<div>");L.text(A.get("numberFormat","\u6570\u5b57\u683c\u5f0f"));L.appendTo(t);L.css({color:"#5582F3","text-align":"right"});Q.layoutCtrlWithLRTB(L,0,18,null,null,null,null);Q.layoutCtrlMiddleAlign(L,20);L=$("<div>");L.appendTo(t);W.backgroundWithHover(L,"edit");Q.layoutCtrlWithLRTB(L,
null,0,16,null,null,16);Q.layoutCtrlMiddleAlign(L,16);t.on("click",function(){(new f).showDialog()})}}function Xa(){function f(){function x(){function aa(ka){var ya=!0;this.getTableId=function(){return ka.getUid()};this.setExpand=function(H){ya=H};this.isExpand=function(){return ya};this.getTableName=function(){return oa.TableNameHelper.getDisplayText(ka)}}function wa(ka,ya){this.getField=function(){return ya};this.getTableId=function(){return ka.getUid()}}var Pa,V,X,ha,Wa;this.getJqUi=function(){Pa||
G();return Pa.getJqUi()};this.setSearchText=function(ka){ha=ka;Sa()};var G=function(){Pa=new I;Pa.setBorderVisible(!1);Pa.setCustomItemPainter(Ka);Pa.setMultiSelectable(!1);Pa.setCustomSelectedsPainter(R);Pa.addDBLClickListener(function(ya){ya=ya.getSelecteds()[0];ya instanceof wa&&(ya=oa.ExprRefHelper.createFieldReference(ya.getTableId(),ya.getField()),L&&L(ya))});Wa=new qa;var ka=Wa.getJqUi();U.append(ka);ka.hide()};this.setTables=function(ka){V=ka;Sa()};this.setTableFieldMap=function(ka){X=ka;
Sa()};var Ka=function(ka,ya){if(ya instanceof wa){var H=ya.getField();ka.css("margin-left","20px");ka.addClass("metric-designer-field-listitem");var ea=$("<div>");ea.text(H.getAlias());ea.attr("title",H.getAlias());ea.addClass("metric-designer-table-field-text");ka.append(ea);ka.data("model",ya);ya=H.getOutputDataType();H=$("<div>");H.addClass("metric-designer-table-field-icon");Q.layoutCtrl(H,10,3,16,16);W.background(H,ya);H.data("myIconName",ya);H.appendTo(ka)}else Ia(ka,ya)},R=function(ka,ya){for(var H=
0;H<ka.length;H++){var ea=ka[H];va(ea,!1)}for(H=0;H<ya.length;H++)ea=ya[H],va(ea,!0)},va=function(ka,ya){ka=ka.find(".metric-designer-table-field-icon");var H=ka.data("myIconName");W.background(ka,H+(ya?"_hover":""))},Ia=function(ka,ya){var H=$("<div>");Q.layoutCtrl(H,0,2,16,16);W.backgroundWithHover(H,"expanded");H.appendTo(ka);var ea=$("<div>");Q.layoutCtrl(ea,20,3,16,16);W.background(ea,"qingTable");ea.data("myIconName","qingTable");ea.addClass("metric-designer-table-field-icon");ea.appendTo(ka);
ea=$("<div>");ea.text(ya.getTableName());ea.attr("title",ya.getTableName());ea.addClass("metric-designer-table-field-text");ea.css("left","40px");ea.css("font-weight","bold");ka.on("click",function(Ja){Ja=$(Ja.currentTarget).data("model");var Za=!Ja.isExpand();Ja.setExpand(Za);W.backgroundWithHover(H,Za?"expanded":"expand");Za=Pa.getJqUi().find(".metric-designer-field-listitem");for(var w=Ja.isExpand(),da=0;da<Za.length;da++){var N=$(Za[da]);N.data("model").getTableId()==Ja.getTableId()&&N.css("display",
w?"":"none")}});ka.data("model",ya);ka.append(ea)},Sa=function(){if(Pa&&V){for(var ka=[],ya=0;ya<V.length;ya++){var H=V[ya];ka.push(new aa(H));if(X){var ea=X[H.getUid()];if(ea)for(var Ja=0;Ja<ea.length;Ja++)ka.push(new wa(H,ea[Ja]))}}if(ha||ka.length!=V.length){if(ya=ha){H=[];for(ea=0;ea<ka.length;ea++)Ja=ka[ea],Ja instanceof aa?(0<H.length&&H[H.length-1]instanceof aa&&H.splice(H.length-1),H.push(Ja)):-1<Ja.getField().getAlias().toUpperCase().indexOf(ya)&&H.push(Ja);H[H.length-1]instanceof aa&&H.splice(H.length-
1);ka=H}Pa.setItemModels(ka);0==ka.length?(Wa.setText(A.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),Wa.getJqUi().show(),Pa.getJqUi().hide()):(Wa.getJqUi().hide(),Pa.getJqUi().show())}else Wa.setText(A.get("noOptionalField","\u6682\u65e0\u53ef\u9009\u62e9\u7684\u5b57\u6bb5")),Wa.getJqUi().show(),Pa.getJqUi().hide()}}}Ba.AbstractTabPane.call(this);var U,ua,Aa={},bb;this.getTitle=function(){return A.get("field","\u5b57\u6bb5")};this.getTableFieldMap=function(){return Aa};
this.getJqUi=function(){if(!U){U=$("<div>");ua=new x;ua.setTables(z.getModelerModel().getAllTable());var aa=ua.getJqUi();Q.layoutCtrlWithLRTB(aa,0,0,null,25,0,null);U.append(aa);bb=new S;bb.setShowSearchIcon(!0);bb.setPlaceholder(A.get("searchField","\u8bf7\u8f93\u5165\u5b57\u6bb5\u540d\u79f0"));bb.setSearchListenerDelay(800);bb.addSearchListener(Oa);aa=bb.getJqUi();Q.layoutCtrlWithLRTB(aa,0,0,null,0,null,25);U.append(aa);fa()}return U};var fa=function(){oa.FieldLoader.loadTableFields(z,U,function(aa){var wa=
Object.keys(aa);Aa={};for(var Pa=0;Pa<wa.length;Pa++){for(var V=wa[Pa],X=aa[V],ha=[],Wa=0;Wa<X.length;Wa++){var G=X[Wa],Ka=G.getDataType();Ka==D.DT_INT||Ka==D.DT_NUMBER?ha.unshift(G):ha.push(G)}Aa[V]=ha}ua.setTableFieldMap(Aa)})},Oa=function(){var aa=$.trim(bb.getText()).toUpperCase();ua.setSearchText(aa)}}function t(){Ba.AbstractTabPane.call(this);var x,U,ua,Aa;this.getTitle=function(){return A.get("metric","\u6307\u6807")};this.getJqUi=function(){if(!x){x=$("<div>");var V=Pa();0<V.length?bb(V):
(V=$("<div>"),V.text(A.get("noMetricToRefer","\u6682\u65e0\u53ef\u5f15\u7528\u7684\u6307\u6807")),Q.layoutCtrlMiddleAlign(V,20),V.css({color:"#999",width:"100%","text-align":"center","font-size":"14px"}),V.appendTo(x))}return x};var bb=function(V){U=new I;U.setBorderVisible(!1);U.setCustomItemPainter(wa);U.setMultiSelectable(!1);U.addDBLClickListener(function(X){X=X.getSelecteds()[0];X=oa.ExprRefHelper.createMetricReference(X.getId());L&&L(X)});U.setCustomSelectedsPainter(Oa);U.setItemModels(V);V=
U.getJqUi();Q.layoutCtrlWithLRTB(V,0,0,null,25,0,null);V.appendTo(x);ua=new S;ua.setShowSearchIcon(!0);ua.setPlaceholder(A.get("searchMetric","\u8bf7\u8f93\u5165\u6307\u6807\u540d\u79f0"));ua.setSearchListenerDelay(800);ua.addSearchListener(fa);V=ua.getJqUi();Q.layoutCtrlWithLRTB(V,0,0,null,0,null,25);x.append(V)},fa=function(){for(var V=$.trim(ua.getText()).toUpperCase(),X=Pa(),ha=[],Wa=0;Wa<X.length;Wa++){var G=X[Wa];-1<G.getName().toUpperCase().indexOf(V)&&ha.push(G)}U.setItemModels(ha);0==ha.length?
(Aa||(Aa=$("<div>"),Aa.text(A.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),Q.layoutCtrlMiddleAlign(Aa,20),Aa.css({color:"#999",width:"100%","text-align":"center"}),Aa.appendTo(x)),Aa.show(),U.getJqUi().hide()):(Aa&&Aa.hide(),U.getJqUi().show())},Oa=function(V,X){for(var ha=0;ha<V.length;ha++){var Wa=V[ha];aa(Wa,!1)}for(ha=0;ha<X.length;ha++)Wa=X[ha],aa(Wa,!0)},aa=function(V,X){V.find(".metric-designer-table-field-icon")},wa=function(V,X){var ha=$("<div>");
ha.text(X.getName());ha.attr("title",X.getName());ha.addClass("metric-designer-table-field-text");ha.appendTo(V);var Wa=$("<div>");Q.layoutCtrl(Wa,10,3,16,16);Wa.addClass("metric-designer-table-field-icon");W.background(Wa,"metric");Wa.appendTo(V);var G=oa.MetricStateMonitor.getInvalidMetricMap();-1!=Object.keys(G).indexOf(X.getId())&&G[X.getId()]&&(X=$("<div>"),W.background(X,"qingWarning"),X.css({width:"16px",height:"16px",position:"absolute",top:"3px"}),X.appendTo(V),X.attr("title",A.get("metricEditException",
"\u6307\u6807\u5f02\u5e38")),Wa.css("left","20px"),ha.css("left","40px"))},Pa=function(){var V=z.getModelerModel().getAllMetric();if(!M)return V;for(var X=[],ha=0;ha<V.length;ha++){var Wa=V[ha];Wa.getId()!=M.getId()&&X.push(Wa)}return X}}var q,z,L,E,M;this.getJqUi=function(){if(!q){q=$("<div>");E=new f;var x=new t,U=new Ba;U.setTabLevel(Ba.SECOND_LEVEL);U.addTab(E,!0);U.addTab(x);q.append(U.getJqUi())}return q};this.setExcludeMetric=function(x){M=x};this.getTableFieldMap=function(){return E.getTableFieldMap()};
this.setExprRefCollector=function(x){L=x};this.setErrorCallback=function(x){};this.setGlobal=function(x){z=x};this.setIllegalRefAddCallback=function(x){}}function ca(){var f=this,t,q,z,L,E,M,x,U,ua,Aa,bb,fa;this.setGlobal=function(G){t=G};this.setMetric=function(G){q=G};this.setNoDataContainer=function(G){Aa=G};this.setAddMetricBtn=function(G){bb=G};this.getMetric=function(){return q};this.getJqUi=function(){if(!z){z=$("<div>");z.addClass("metric-card-container");L=$("<div>");L.addClass("metric-card-detail-container");
var G=$("<div>");G.addClass("metric-card-title-container");var Ka=$("<span>");Ka.addClass("metric-card-icon");W.background(Ka,"metric_icon");G.append(Ka);Ka=$("<span>");Ka.addClass("metric-card-name-container");var R="("+q.getNumber()+")",va=q.getName()+" "+R;M=$("<span>");M.addClass("metric-card-name");M.attr("title",va);M.text(q.getName());Ka.append(M);Q.makeTextOmissible(M);var Ia=$("<span>");Q.makeTextOmissible(Ia);Ia.addClass("metric-card-number-container");x=$("<span>");x.addClass("metric-card-number");
x.attr("title",va);x.text(R);Ia.append(x);Ka.append(Ia);G.append(Ka);L.append(G);G=$("<div>");G.addClass("metric-card-desc-container");Ka=$("<span>");Ka.addClass("metric-card-desc-fixed");Ka.text(A.get("metricDescription","\u63cf\u8ff0\uff1a"));U=$("<span>");U.addClass("metric-card-desc");U.attr("title",q.getDesc());U.text(q.getDesc());Q.makeTextOmissible(G);G.append(Ka);G.append(U);L.append(G);G=$("<div>");G.addClass("metric-card-expr-container");Ka=$("<span>");Ka.addClass("metric-card-expr-fixed");
Ka.text(A.get("metricExpression","\u8868\u8fbe\u5f0f\uff1a"));ua=$("<span>");ua.addClass("metric-card-expr");ua.attr("title",f.getDisplayExpression());ua.append(f.getJqExpression());Q.makeTextOmissible(G);G.append(Ka);G.append(ua);L.append(G);z.append(L);E=$("<div>");E.addClass("metric-card-operation-container");G=$("<span>");G.addClass("metric-card-button");G.attr("title",A.get("metricDelete","\u5220\u9664"));G.css("order",2);W.backgroundWithHover(G,"delete");G.on("click",wa);G.appendTo(E);G=$("<span>");
G.addClass("metric-card-button metric-card-button-calc");G.attr("title",A.get("metricCalculate","\u8bd5\u8ba1\u7b97"));G.css("order",3);W.backgroundWithHover(G,"trial_calc");G.on("click",Pa);G.appendTo(E);G=$("<span>");G.addClass("metric-card-button");G.attr("title",A.get("metricEdit","\u7f16\u8f91"));G.css("order",1);W.backgroundWithHover(G,"edit");G.on("click",Oa);G.appendTo(E);G=$("<span>");G.addClass("metric-card-button metric-card-button-filter");G.attr("title",A.get("filter","\u8fc7\u6ee4"));
W.backgroundWithHover(G,"metric_filter");G.on("click",aa);G.appendTo(E);z.append(E);Wa()}return z};this.updateUi=function(){M.attr("title",q.getName());M.text(q.getName());U.attr("title",q.getDesc());U.text(q.getDesc());ua.empty();ua.attr("title",f.getDisplayExpression());ua.append(f.getJqExpression());Wa()};this.getDisplayExpression=function(){for(var G="",Ka=oa.ExprRefHelper.translateToTextSegment(q.getExpr()),R=0;R<Ka.length;R++)G+=Ka[R].getText();return G};this.getJqExpression=function(){for(var G=
$("<span>"),Ka=oa.ExprRefHelper.translateToTextSegment(q.getExpr()),R=0;R<Ka.length;R++){var va=Ka[R];va=$("<span>").text(va.getText()).css("color",va.getColor());G.append(va)}return G};this.setValidPrompt=function(G){fa=G;Wa()};var Oa=function(){(new J).setGlobal(t);var G=new ta(q);G.setGlobal(t);G.showDialog()},aa=function(){var G=new Y(t);G.setMetric(q);G.showDialog()},wa=function(){var G=oa.ExprRefHelper.getMetricReferredInfo(q);0!==G.length?V(q.getName(),G[0].getName(),G.length).setClosingChecker(function(Ka){return!0}):
(G=X(),G.setClosingChecker(function(Ka){Ka===y.RETURN_OK&&(Ka=new za,Ka.setValue(q,t),t.getCommandManager().perform(Ka),p.occur(p.BUTTON_TYPE,p.METRIC_DELETE));return!0}),G.setClosedAction(function(){0===t.getModelerModel().getAllMetric().length&&(Aa.show(),bb.hide())}))},Pa=function(){var G=t.getModelerModel(),Ka=new B;Ka.setModelerModel(G);var R=new P(t.getRemoteImpl(),function(va){var Ia=new F;Ia.fromJsonObject(va);oa.MetricStateMonitor.setModelValidity(Ia);va=new T;va.setMetric(q);va.setModeler(G);
va.setTitle(A.get("metricsTrialCalculate","\u6307\u6807\u8bd5\u8ba1\u7b97"));va.setButtonName(A.get("trialCalculate","\u8bd5\u8ba1\u7b97"));va.setGlobal(t);va.showDialog()});R.setShowBlocking(!0);R.checkModelerValid(Ka.toJsonObject())},V=function(G,Ka,R){var va=y.createFeedbackDialog();va.setMsgImageType(y.MSG_WARNING);va.setOptionType(y.OPTION_OK);if(1===R){var Ia=A.get("confirmWarningOneMetric","\u6307\u6807\u201c#1\u201d\u5df2\u88ab\u6307\u6807\u201c#2\u201d\u5f15\u7528\uff0c\u8bf7\u5148\u5220\u9664\u5f15\u7528\u7684\u6307\u6807\u3002");
Ia=Ia.replace("#1",G);Ia=Ia.replace("#2",Ka)}else Ia=A.get("confirmWarningMetric","\u6307\u6807\u201c#1\u201d\u5df2\u88ab\u201c#2\u201d\u7b49#3\u4e2a\u6307\u6807\u5f15\u7528\uff0c\u8bf7\u5148\u5220\u9664\u5f15\u7528\u7684\u6307\u6807\u3002"),Ia=Ia.replace("#1",G),Ia=Ia.replace("#2",Ka),Ia=Ia.replace("#3",R);va.setMessage(Ia);va.showDialog();return va},X=function(){var G=y.createFeedbackDialog();G.setMsgImageType(y.MSG_DELETE);G.setOptionType(y.OPTION_OK_CANCEL);var Ka=A.get("confirmDeleteMetric",
"\u786e\u5b9a\u5220\u9664\u8be5\u6307\u6807\u5417\uff1f");G.setMessage(Ka);G.showDialog();return G},ha,Wa=function(){if(z)if(ha&&(ha.remove(),ha=null),fa){z.addClass("metric-card-invalid-ui");ha=$("<div>");Q.layoutCtrlWithLRTB(ha,0,0,null,null,-26,26);var G=$("<div>");G.text(fa);G.css("color","#fd6c6a");Q.layoutCtrlMiddleAlign(G,20);Q.layoutCtrl(G,20,null,null,null,null);var Ka=$("<div>");W.background(Ka,"qingWarning");Q.layoutCtrl(Ka,0,null,16,16);Q.layoutCtrlMiddleAlign(Ka,16);G.appendTo(ha);Ka.appendTo(ha);
ha.appendTo(z)}else z.removeClass("metric-card-invalid-ui")}}function Y(f){n.call(this);var t=this.protectedMethod,q=this,z,L;(function(){q.setSize(800,600);t.setTitle(A.get("metricFilter","\u6307\u6807\u8fc7\u6ee4"));t.setSelectable(!0);t.getDialogCtrl().setMinSize(800,600);t.setContentPaneCreator(function(){var M=$("<div>");E(M);return M});t.setClosingAction(function(M){});t.setClosingChecker(function(){var M=L.checkFilterValid();if(M)return t.getMessageCurtain().showPrompt(M),!1;M=L.getFilterItems();
var x=z.getFilterItems()?z.clone().getFilterItems():[],U;a:if(x&&M&&x.length===M.length){for(U=0;U<x.length;U++)if(!x[U].equals(M[U])){U=!1;break a}U=!0}else U=!1;U||(U=new h,U.setValue(z,x,M),f.getCommandManager().perform(U));z.setFilterItems(M);p.occur(p.FUNCTION,p.METRIC_FILTER);M=new J;M.setGlobal(f);x=f.getModelerModel();U=new B;U.setModelerModel(x);M.backgroundCheck(U.toJsonObject());t.destroy();return!0})})();this.setMetric=function(M){z=M};var E=function(M){oa.FieldLoader.loadTableFields(f,
M,function(x){for(var U=Object.keys(x),ua={},Aa=[],bb=0;bb<U.length;bb++){for(var fa=U[bb],Oa=x[fa],aa=[],wa=0;wa<Oa.length;wa++){var Pa=Oa[wa];Pa.setFromNode(fa);var V=Pa.getDataType();V===D.DT_INT||V===D.DT_NUMBER?aa.unshift(Pa):aa.push(Pa)}ua[fa]=aa;Aa=Aa.concat(aa)}x=z.getFilterItems()?z.clone().getFilterItems():[];U=Aa;for(bb=0;bb<x.length;bb++)if(fa=U,Oa=x[bb],!Oa.isEmpty())for(aa=0;aa<fa.length;aa++)if(wa=fa[aa],Oa.getField().getFullName()===wa.getFullName()){Oa.setField(wa);break}L=new Ma;
L.setGlobal(f);L.setMessageCurtain(t.getMessageCurtain());L.setFields(Aa);L.setFilterItems(x);L.setTableFieldMap(ua);M.append(L.getJqUi())})}}function Ma(){function f(w){KTDefaultCellRender.call(this,w);var da=this,N=this.paintCellUI;this.setGlobal=function(xa){};this.paintCellUI=function(xa,Ya){if(da.getCurrentRowIdx()<m.getHeadRowCount()||!da.getCell())N(xa,Ya);else{var La=da.getCellWidth(),db=da.getCellHeight(),sa=da.getCurrentRow();if(0===da.getCurrentColIdx())sa=da.getCell().getValue(),xa=$(xa),
xa.find(".modeler-designer-filter-table-prompt").remove(),sa&&(La=d.createWarning(),La.addClass("modeler-designer-filter-table-prompt"),La.attr("title",sa),La.appendTo(xa));else if(1===da.getCurrentColIdx()||5===da.getCurrentColIdx()){Ya=1===da.getCurrentColIdx();var Na=da.getCell().getValue();ea(xa,La,db,Ya,Na,sa)}else if(2===da.getCurrentColIdx())Ya=da.getCell().getValue(),H(xa,La,db,Ya,sa);else if(3===da.getCurrentColIdx()){Ya=da.getCell().getValue();var Fa=sa.getUserObject().getField();Na=Fa?
Fa.getOutputDataType():null;Fa=Fa?Fa.isEnum():!1;xa=m.createCtrlInCell(xa,La,db,b);xa.setSelected(Ya);xa.setItemModels(Na?a.getSelectableCompares(Na,Fa):[]);xa.setUserObject(sa);xa.setCustomPainter(Ka);xa.addSelectedChangedListener(Wa)}else 4===da.getCurrentColIdx()?(Ya=da.getCell().getValue(),R(xa,La,db,Ya,sa)):6===da.getCurrentColIdx()?(Ya=da.getCell().getValue(),X(xa,La,db,Ya,sa)):N(xa,Ya)}}}function t(){n.call(this);var w=this,da=this.protectedMethod,N;this.edit=function(xa,Ya,La){da.setTitle(A.get("relativeDateRange",
"\u76f8\u5bf9\u65e5\u671f"));N||(w.setSize(450,430),N=new v,N.setContainsTime(Ya),Ya=new u,Ya.fromJsonObject(xa.toJsonObject()),N.setModel(Ya),da.setContentPaneCreator(function(){return N.getJqUi()}),da.setClosingAction(function(db){db&&(db=N.getModel(),La(db))}))}}function q(){var w=[],da,N,xa=[],Ya=[],La;this.setItemModel=function(Fa,ja){La=ja;w=Fa};this.setListItemPainter=function(Fa){};this.setSelectedItemModel=function(Fa){xa=Fa;Ya=xa.slice(0)};this.setLastTimeSelectedModel=function(Fa){Ya=Fa};
this.getSelectedItemModel=function(){return xa};this.createJqPopup=function(Fa,ja,Ca,Ta){da=$("<div>");da.appendTo(Fa);N=$("<div>");da.addClass("modeler-designer-field-popup");N.addClass("modeler-designer-enum-popup-list-owner");for(Fa=0;Fa<w.length;Fa++)sa(w[Fa],N,ja,!1);ja=new k;ja.setHighlight(!0);ja.setText(A.get("ok","\u786e\u5b9a"));ja=ja.getJqUi();ja.css("z-index",3);ja.css("margin-left",10);Q.layoutCtrlWithLRTB(ja,"50%",null,50,null,8,28);ja.on("click",function(ib){Ya=xa.slice(0);Ca(xa)});
Fa=new k(A.get("cancle","\u53d6\u6d88"));Fa.setHighlight(!1);Fa=Fa.getJqUi();Fa.css("z-index",3);Fa.css("margin-left",-80);Q.layoutCtrlWithLRTB(Fa,"50%",null,50,null,8,28);Fa.on("click",function(ib){xa=Ya.slice(0);Ta()});N.appendTo(da);ja.appendTo(da);Fa.appendTo(da);N.css("height","77%");return[-1,260]};var db=function(Fa,ja){ja=Fa.getUserObject();Fa=Fa.isChecked();ja&&Fa?(Fa=Na(ja),0>Fa&&xa.push(ja)):ja&&!Fa&&(Fa=Na(ja),-1<Fa&&xa.splice(Fa,1))},sa=function(Fa,ja,Ca){var Ta=Na(Fa);Ca=$("<div>");
Ca.addClass("modeler-designer-field-popup-list-item");Ca.data("model",Fa);var ib=$("<div>"),fb=new CheckBox;fb.setUserObject(Fa);fb.setChecked(-1<Ta);fb.addCheckedListener(db);Ta=fb.getJqUi();Ta.addClass("modeler-designer-field-selection-checkbox-icon");Ta.data("model",fb);fb=$("<div>");fb.text(Fa.fieldValue);fb.addClass("modeler-designer-field-selection-checkbox-text");ib.append(Ta);ib.append(fb);Ca.append(ib);ja.append(Ca)},Na=function(Fa){for(var ja=0;ja<xa.length;ja++)if(La(Fa,xa[ja]))return ja;
return-1}}function z(){n.call(this);var w=this,da=this.protectedMethod,N=new ia,xa=new ia,Ya=new ba,La,db;this.setCaption=function(Fa,ja){da.setTitle(Fa);N.setText(ja)};this.setText=function(Fa,ja){Ya.setText(Fa);var Ca=0;Fa&&(Fa=Fa.split("\n").length,Ca=1E3<Fa?1E3:Fa);xa.setText(Ca+"/1000\u9879");db=function(Ta){var ib=Ta?$.trim(Ya.getText()):null;ja(Ta,ib)};da.setClosingAction(db)};this.showDialogLeftAnchorTo=function(Fa){Fa&&(w.setSize(470,450),Fa=Q.upwardCoordinate(document.body,[0,0],document.body),
w.setPosition(Math.max(0,Fa[0]-10),Math.max(6,Fa[1]-450+40)));Ya.addEditedListener(Na);da.setContentPaneCreator(sa);w.showDialog();Ya.requestFocus()};this.setClosingChecker=function(Fa){Fa&&(La=function(){var ja=Fa($.trim(Ya.getText()));ja&&da.getMessageCurtain().showPrompt(ja);return ja?!1:!0},da.setClosingChecker(La))};var sa=function(){xa.setAlign(ia.ALIGN_RIGHT);Q.layoutCtrlWithLRTB(N.getJqUi(),0,0,null,0,null,23);Q.layoutCtrlWithLRTB(Ya.getJqUi(),0,0,null,30,null,260);Q.layoutCtrlWithLRTB(xa.getJqUi(),
290,0,null,287,null,23);var Fa=$("<div>");Fa.append(N.getJqUi());Fa.append(Ya.getJqUi());Fa.append(xa.getJqUi());return Fa},Na=function(Fa){var ja=Fa.getText(),Ca=[];ja&&(Ca=ja.trim().replace(/(\n\s*)+/g,"\n").split("\n"));ja=Ca.length;1E3<ja&&(Fa.setText(Ca.slice(0,1E3).join("\n")),ja=1E3);xa.setText(ja+"/1000\u9879");da.getMessageCurtain().hide()}}function L(){function w(){var sa,Na,Fa,ja,Ca,Ta,ib;this.getJqUi=function(){sa||fb();return sa.getJqUi()};this.setSelectedModel=function(Ga){Ta=Ga};this.setSelectedModelSetter=
function(Ga){ib=Ga};this.setSearchText=function(Ga){ja=Ga;ma()};this.setTables=function(Ga){Na=Ga;ma()};this.setTableFieldMap=function(Ga){Fa=Ga;ma()};var fb=function(){sa=new I;sa.setBorderVisible(!0);sa.setCustomItemPainter(Ua);sa.setMultiSelectable(!1);sa.setCustomSelectedsPainter(jb);sa.addPressedListener(function(Ga,ab){Ga=Ga.getSelecteds()[0];Ga instanceof M&&ib&&ib(Ga.getField())})},Ua=function(Ga,ab){if(ab instanceof M){var Ra=ab.getField();Ga.css("margin-left","20px");Ga.addClass("metric-filter-field-list-item");
Ga.css("cursor","pointer");var cb=$("<div>");cb.text(Ra.getAlias());cb.attr("title",Ra.getAlias());cb.addClass("metric-designer-table-field-text");Ga.append(cb);Ga.data("model",ab);Ra=Ra.getOutputDataType();cb=$("<div>");cb.addClass("metric-designer-table-field-icon");Q.layoutCtrl(cb,10,3,16,16);W.background(cb,Ra);cb.data("myIconName",Ra);cb.appendTo(Ga);Ta&&ab&&Ta.getFullName()===ab.getField().getFullName()&&qb(Ga,ab)}else tb(Ga,ab)},jb=function(Ga,ab){for(var Ra=0;Ra<Ga.length;Ra++){var cb=Ga[Ra];
pb(cb,!1)}for(Ra=0;Ra<ab.length;Ra++)cb=ab[Ra],pb(cb,!0)},pb=function(Ga,ab){Ga=Ga.find(".metric-designer-table-field-icon");var Ra=Ga.data("myIconName");W.background(Ga,Ra+(ab?"_hover":""))},qb=function(Ga,ab){var Ra=null;if(0<Ga.height()){clearTimeout(Ra);Ra=Ga.find(".metric-designer-table-field-icon");var cb=Ra.data("myIconName");W.background(Ra,cb+"_hover");Ga.css("color","#fff");Ga.css("background-color","#88a7f6");Ga.css("background-color","var(--color-lightish, #88a7f6)");sa.setSelecteds([ab]);
sa.scrollSelectedToVisible(ab)}else Ra=setTimeout(function(){qb(Ga,ab)},0)},tb=function(Ga,ab){var Ra=$("<div>");Q.layoutCtrl(Ra,0,2,16,16);W.backgroundWithHover(Ra,"expanded");Ra.appendTo(Ga);var cb=$("<div>");Q.layoutCtrl(cb,20,3,16,16);W.background(cb,"qingTable");cb.data("myIconName","qingTable");cb.addClass("metric-designer-table-field-icon");cb.appendTo(Ga);cb=$("<div>");cb.text(ab.getTableName());cb.attr("title",ab.getTableName());cb.addClass("metric-designer-table-field-text");cb.css("left",
"40px");cb.css("font-weight","bold");Ga.on("click",function(eb){eb=$(eb.currentTarget).data("model");var ob=!eb.isExpand();eb.setExpand(ob);W.backgroundWithHover(Ra,ob?"expanded":"expand");ob=sa.getJqUi().find(".metric-filter-field-list-item");for(var vb=eb.isExpand(),lb=0;lb<ob.length;lb++){var rb=$(ob[lb]);rb.data("model").getTableId()===eb.getTableId()&&rb.css("display",vb?"":"none")}});Ga.data("model",ab);Ga.append(cb)},ma=function(){if(sa&&Na){for(var Ga=[],ab=0;ab<Na.length;ab++){var Ra=Na[ab];
Ga.push(new E(Ra));if(Fa){var cb=Fa[Ra.getUid()];if(cb)for(var eb=0;eb<cb.length;eb++)Ga.push(new M(Ra,cb[eb]))}}if(ab=ja){Ra=[];for(cb=0;cb<Ga.length;cb++)eb=Ga[cb],eb instanceof E?(0<Ra.length&&Ra[Ra.length-1]instanceof E&&Ra.splice(Ra.length-1),Ra.push(eb)):-1<eb.getField().getAlias().toUpperCase().indexOf(ab)&&Ra.push(eb);Ra[Ra.length-1]instanceof E&&Ra.splice(Ra.length-1);Ga=Ra}sa.setItemModels(Ga,Qa);0===Ga.length?(Ca||(Ca=$("<div>"),Ca.text(A.get("noSearchResult","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c")),
Q.layoutCtrlMiddleAlign(Ca,20),Ca.css({color:"#999",width:"100%","text-align":"center"}),Ca.appendTo(da)),Ca.show(),sa.getJqUi().hide()):(Ca&&Ca.hide(),sa.getJqUi().show())}},Qa=function(Ga,ab){return Ga instanceof E&&ab instanceof E||Ga instanceof M&&ab instanceof M?Ga.equals(ab):!1}}var da,N,xa,Ya,La;this.createJqPopup=function(sa,Na,Fa){da=$("<div>");da.appendTo(sa);Ya=new S;Ya.setShowSearchIcon(!0);Ya.setPlaceholder(A.get("searchField","\u8bf7\u8f93\u5165\u5b57\u6bb5\u540d\u79f0"));Ya.setSearchListenerDelay(800);
Ya.addSearchListener(db);sa=Ya.getJqUi();Q.layoutCtrlWithLRTB(sa,0,0,null,0,null,25);da.append(sa);La=new w;La.setSelectedModel(Na);La.setSelectedModelSetter(Fa);La.setTables(N.getModelerModel().getAllTable());Na=La.getJqUi();Q.layoutCtrlWithLRTB(Na,0,0,null,25,0,null);da.append(Na);La.setTableFieldMap(xa)};this.setTableFieldMap=function(sa){xa=sa};this.setGlobal=function(sa){N=sa};var db=function(){var sa=$.trim(Ya.getText()).toUpperCase();La.setSearchText(sa)}}function E(w){var da=!0;this.getTableId=
function(){return w.getUid()};this.setExpand=function(N){da=N};this.isExpand=function(){return da};this.getTableName=function(){return oa.TableNameHelper.getDisplayText(w)};this.equals=function(N){return this.getTableId()===N.getTableId()}}function M(w,da){this.getField=function(){return da};this.getTableId=function(){return w.getUid()};this.equals=function(N){return this.getTableId()===N.getTableId()&&this.getField().equals(N.getField())}}var x=this,U,ua,Aa,bb=[],fa={},Oa=[],aa;this.getJqUi=function(){if(!ua){ua=
$("<div>");ua.addClass("metric-filter-condition");Aa=m.createTable();Aa.setDraggableAdjusting(!0);Aa.setSyncUIWhenModelChanged(!0);Aa.setColumnFitVisibleWidth(!1);Aa.setAutoAdjustRowHeight(!0);Aa.setScrollerVisible("hidden","auto");Aa.setFrozenRows(0);m.bindTextEditor(Aa,wa,Pa);m.bindTableListenerForCtrl(Aa,V);var w=new f(Aa);w.setGlobal(U);w.setOutsideVisible(!1);Aa.setCellRender(w);Aa.addColumns(8);Aa.getColumn(0).setWidth(23);Aa.getColumn(1).setWidth(60);Aa.getColumn(2).setWidth(170);Aa.getColumn(3).setWidth(95);
Aa.getColumn(4).setWidth(200);Aa.getColumn(5).setWidth(60);Aa.getColumn(6).setWidth(60);Aa.getColumn(7).setWidth(100);w=m.createHeadRow(Aa);w.getCell(1).setValue(A.get("leftBracket","\u5de6\u62ec\u53f7"));w.getCell(2).setValue(A.get("field","\u5b57\u6bb5"));w.getCell(3).setValue(A.get("compare","\u6bd4\u8f83"));w.getCell(4).setValue(A.get("value","\u503c"));w.getCell(5).setValue(A.get("rightBracket","\u53f3\u62ec\u53f7"));w.getCell(6).setValue(A.get("logic","\u903b\u8f91"));w=$(Aa.getUI());w.addClass("metric-filter-condition-table");
ua.append(w);x.updateUi();x.checkFilterValid()}return ua};this.getFilterItems=function(){for(var w=[],da=0;da<Oa.length;da++){var N=Oa[da];N.isEmpty()||w.push(N)}return w};this.setFilterItems=function(w){Oa=w};this.setFields=function(w){bb=w};this.setGlobal=function(w){U=w};this.setMessageCurtain=function(w){};this.setTableFieldMap=function(w){fa=w};this.afterResize=function(){Aa.relayoutViews()};this.updateUi=function(){if(Aa){for(var w=Oa.length-1;0<=w;w--)if(Oa[w].isEmpty())Oa.splice(w,1);else break;
m.clearWithoutHead(Aa);w=Math.max(14,Oa.length+1);for(var da=0;da<w;da++){var N=Oa[da];da>=Oa.length&&(N=new a,Oa.push(N));var xa=m.createRow(Aa);xa.setUserObject(N);xa.getCell(0).setValue("");xa.getCell(1).setValue(N.getLeftBracketCount());xa.getCell(2).setValue(N.getField());xa.getCell(3).setValue(N.getCompareOp());a.isCompareOpRelativeDateRangeValue(N.getCompareOp())?xa.getCell(4).setValue(N.getRelativeDateRange()?N.getRelativeDateRange():""):xa.getCell(4).setValue(N.getValue()?N.getValue():"");
xa.getCell(5).setValue(N.getRightBracketCount());xa.getCell(6).setValue(N.getLogicOp()?N.getLogicOp():"")}m.refresh(Aa)}};this.checkFilterValid=function(){var w=r.checkFilterField(Oa,bb);if(w||(w=x.checkFieldTableIsJoined(U,Oa))||(w=r.checkFilterLogical(Oa)))return x.locateToErrorRow(w.getFiltersErrorRow(),w.getPrompt()),w.getPrompt();x.locateToErrorRow(-1);return null};x.checkFieldTableIsJoined=function(w,da){for(w=0;w<da.length;w++)da[w].isEmpty();return null};this.locateToErrorRow=function(w,da){for(var N=
m.getHeadRowCount();N<Aa.getRowsCount();N++)Aa.getRow(N).getCell(0).setValue("");-1!==w&&Aa.getRow(w+m.getHeadRowCount()).getCell(0).setValue(da)};var wa=function(w,da){if(4!==da)return!1;w=Aa.getRow(w).getUserObject();da=w.getCompareOp();if(a.isCompareOpWithoutValue(da)||a.isCompareOpWithinOrNotWithinValue(da)||!r.checkFieldExisted(w,bb))return!1;w=w.getField();return Sa(w)},Pa=function(w,da,N,xa,Ya){w=w.getUserObject();w.getValue()!==xa&&(w.setValue(xa),N.setValue(xa),x.checkFilterValid());return!0},
V=function(w,da,N,xa){w=null;if(da){da=KTableUIAbstractView.createCellId(Aa.getRow(N),Aa.getColumn(Aa.getColumnsCount()-1));w=x.getJqUi().find("#"+da);var Ya=N-m.getHeadRowCount();N=$("<div>");N.text(A.get("insertRow","\u63d2\u5165"));N.addClass("modeler-designer-filter-table-op");N.css("left","10px");N.appendTo(w);N.on("click",function(La){La=new a;Oa.splice(Ya,0,La);x.updateUi();x.checkFilterValid()});N=$("<div>");N.text(A.get("deleteRow","\u5220\u9664"));N.addClass("modeler-designer-filter-table-op");
N.css("left","52px");N.appendTo(w);N.on("click",function(La){Oa.splice(Ya,1);x.updateUi();x.checkFilterValid()})}else aa&&aa.find(".modeler-designer-filter-table-op").remove();aa=w},X=function(w,da,N,xa,Ya){w=m.createCtrlInCell(w,da,N,b);w.setSelected(xa?xa:null);w.setItemModels([null,a.LOGIC_AND,a.LOGIC_OR]);w.setUserObject(Ya);w.setCustomPainter(function(La,db,sa){La="";sa===a.LOGIC_AND?La=A.get("and","\u4e14"):sa===a.LOGIC_OR&&(La=A.get("or","\u6216"));db.text(La)});w.addSelectedChangedListener(ha)},
ha=function(w,da,N){w=w.getUserObject();w.getUserObject().setLogicOp(N);w.getCell(6).setValue(N);x.checkFilterValid()},Wa=function(w,da,N){w=w.getUserObject();var xa=w.getUserObject();xa.setCompareOp(N);w.getCell(3).setValue(N);if(a.isCompareOpWithoutValue(da)!==a.isCompareOpWithoutValue(N)||a.isCompareOpRelativeDateRangeValue(da)!==a.isCompareOpRelativeDateRangeValue(N)||a.isCompareOpWithinOrNotWithinValue(da)!==a.isCompareOpWithinOrNotWithinValue(N))xa.setValue(null),xa.setRelativeDateRange(null),
G(w.getCell(4)," ");x.checkFilterValid()},G=function(w,da){w.setValue(""===da?" ":"");w.setValue(da)},Ka=function(w,da,N){switch(N){case a.COMPARE_EQUAL:w=A.get("equal","\u7b49\u4e8e");break;case a.COMPARE_NOT_EQUAL:w=A.get("notEqual","\u4e0d\u7b49\u4e8e");break;case a.COMPARE_GREATER:w=A.get("greater","\u5927\u4e8e");break;case a.COMPARE_GREATER_EQUAL:w=A.get("equalOrGreater","\u5927\u4e8e\u7b49\u4e8e");break;case a.COMPARE_LESS:w=A.get("less","\u5c0f\u4e8e");break;case a.COMPARE_LESS_EQUAL:w=A.get("equalOrLess",
"\u5c0f\u4e8e\u7b49\u4e8e");break;case a.COMPARE_INCLUDE:w=A.get("include","\u5305\u542b");break;case a.COMPARE_NOT_INCLUDE:w=A.get("notInclude","\u4e0d\u5305\u542b");break;case a.COMPARE_START_WITH:w=A.get("startWith","\u5f00\u5934\u662f");break;case a.COMPARE_END_WITH:w=A.get("endWith","\u7ed3\u5c3e\u662f");break;case a.COMPARE_NULL:w=A.get("compareNull","\u4e3a\u7a7a");break;case a.COMPARE_NOT_NULL:w=A.get("compareNotNull","\u4e0d\u4e3a\u7a7a");break;case a.COMPARE_IN:w=A.get("compareIn","\u5728......\u4e4b\u5185");
break;case a.COMPARE_NOT_IN:w=A.get("compareNotIn","\u4e0d\u5728......\u4e4b\u5185");break;case a.COMPARE_RELATIVE_DATE_RANGE:w=A.get("relativeDateRange","\u76f8\u5bf9\u65e5\u671f");break;default:w=""}da.text(w)},R=function(w,da,N,xa,Ya){var La=Ya.getUserObject(),db=$(w);db.empty();if(r.checkFieldExisted(La,bb)){db.css("cursor","");var sa=La.getCompareOp(),Na=La.getField(),Fa=Na?Na.getOutputDataType():"",ja=Na?Na.getEnumValue():null,Ca=Na?Na.isEnum():!1;if(!a.isCompareOpWithoutValue(sa))if(a.isCompareOpWithinOrNotWithinValue(sa))if(Ca){var Ta=
[],ib;for(ib in ja)Ta.push({fieldValue:ja[ib],fieldName:ib});var fb=[];(xa=JSON.parse(La.getValue()))&&xa.forEach(function(Qa){Ta.forEach(function(Ga){Qa===Ga.fieldName&&fb.push({fieldValue:Ga.fieldValue,fieldName:Ga.fieldName})})});var Ua=new q;Ua.setItemModel(Ta,function(Qa,Ga){return Qa&&Ga&&Qa.fieldName===Ga.fieldName});Ua.setSelectedItemModel(fb);w=m.createCtrlInCell(w,da,N,l);w.setUserObject(Ya);w.setSelectedModel(fb);w.setDropdownCreator(function(Qa,Ga,ab,Ra){return Ua.createJqPopup(Qa,Ga,
ab,Ra)});w.addSelectionListener(function(Qa){var Ga=Qa.getSelectedModel();Qa=Qa.getUserObject().getUserObject();if(null==Ga||0===Ga.length)Qa.setValue(null);else{JSON.parse(Qa.getValue());var ab=[],Ra;for(Ra in Ga)ab.push(Ga[Ra].fieldName);Qa.setValue(JSON.stringify(ab))}x.checkFilterValid()});w.setCustomPainter(function(Qa,Ga){var ab=[],Ra;for(Ra in Qa)ab.push(Qa[Ra].fieldValue);Ga.text(ab.join(","))})}else{var jb=m.createCtrlInCell(w,da,N,c);jb.setClearable(!0);jb.setUserObject(Ya);jb.getJqUi().find(".sa-ctrl-f7selector-text").on("click",
function(){ka(La,jb)});jb.addActionListener(function(Qa){ka(La,jb)});null!=xa&&""!==xa&&" "!==xa&&xa&&jb.setModel(JSON.parse(xa).join(","));jb.setCustomPainter(function(Qa){return Qa});jb.addClearListener(function(Qa){ya(Qa,La,null)})}else if(Sa(Na))w=$("<div>"),w.text(xa),w.addClass("modeler-designer-common-table-cell-editable"),w.appendTo(db),db.css("cursor","pointer");else if(Fa===D.DT_DATE||Fa===D.DT_DATETIME)if(a.isCompareOpRelativeDateRangeValue(sa)){var pb=Fa===D.DT_DATETIME;db="";var qb=xa;
qb instanceof u?db=v.modelToDisplayText(qb,pb):(qb=new u,qb.setPeriod(u.PERIOD_DAY),qb.setWhichPeriod(0));var tb=m.createCtrlInCell(w,da,N,ia);db&&18<db.length&&(tb.getJqUi().attr("title",db),db=db.substring(0,18)+"...");tb.setText(db);tb.setUserObject(Ya);w=tb.getJqUi();w.css("line-height","28px");w.on("click",function(Qa){Qa=qb;var Ga=ma,ab=new t;ab.edit(Qa,pb,Ga);ab.showDialog()});da=$("<div>");W.background(da,"btn_edit");da.addClass("modeler-designer-filter-item-format-icon");da.appendTo(w);var ma=
function(Qa){La.setRelativeDateRange(Qa);La.setDisplayValue(v.modelToDisplayText(Qa,pb));tb.setText(v.modelToDisplayText(Qa,pb));Ya.getCell(4).setValue(Qa);x.checkFilterValid()}}else db=new Date,xa=xa?parseInt(xa):null,isNaN(xa)||null==xa?(La=Ya.getUserObject(),La.setValue(db.getTime())):db.setTime(xa),w=m.createCtrlInCell(w,da,N,Fa===D.DT_DATETIME?g:e),w.setDateObject(db),w.setUserObject(Ya),w.addModelChangedListener(va);else if(Fa===D.DT_BOOLEAN)w=m.createCtrlInCell(w,da,N,b),w.setSelected(xa),
w.setItemModels([D.BOOLEAN_TRUE,D.BOOLEAN_FALSE]),w.setUserObject(Ya),w.setCustomPainter(function(Qa,Ga,ab){Qa=ab===D.BOOLEAN_TRUE?A.get("dataTypeTrue","\u771f"):ab===D.BOOLEAN_FALSE?A.get("dataTypeFalse","\u5047"):"";Ga.text(Qa)}),w.addSelectedChangedListener(Ia);else if(Ca){Ta=[];for(ib in ja)Ta=Ta.concat(ib);w=m.createCtrlInCell(w,da,N,b);w.setSelected(xa);w.setItemModels(Ta);w.setUserObject(Ya);w.setCustomPainter(function(Qa,Ga,ab){Ga.text(ja[ab])});w.addSelectedChangedListener(Ia)}}else w=$("<div>"),
da=La.getDisplayValue(!1),w.text(da),w.attr("title",da),w.addClass("modeler-designer-common-table-cell-not-editable"),w.appendTo(db)},va=function(w){var da=""+w.getDateObject().getTime();w=w.getUserObject();w.getUserObject().setValue(da);w.getCell(4).setValue(da);x.checkFilterValid()},Ia=function(w,da,N){w=w.getUserObject();w.getUserObject().setValue(N);w.getCell(4).setValue(N);x.checkFilterValid()},Sa=function(w){var da=w?w.getOutputDataType():null;return w&&w.isMulBaseData()?!0:da?(w=w?w.isEnum():
!1,(da===D.DT_STRING||da===D.DT_NUMBER||da===D.DT_INT)&&!w):!1},ka=function(w,da){var N=A.get("enterSplit","\u7cbe\u786e\u5339\u914d\u591a\u503c\uff0c\u5404\u9879\u4e4b\u95f4\u4f7f\u7528\u56de\u8f66\u4f5c\u4e3a\u5206\u9694\u7b26"),xa=w.getCompareOp()===a.COMPARE_IN?A.get("compareIn","\u5728......\u4e4b\u5185"):A.get("compareNotIn","\u4e0d\u5728......\u4e4b\u5185"),Ya=JSON.parse(w.getValue());Ya=Ya?Ya.join("\n"):"";var La=new z;La.setCaption(xa,N);La.setClosingChecker(function(db){if(db&&5E4<db.length)return A.get("matchTooLong",
"\u5339\u914d\u9879\u4e0d\u80fd\u8d85\u8fc750000\u4e2a\u5b57\u7b26")});La.setText(Ya,function(db,sa){db&&ya(da,w,sa)});La.showDialogLeftAnchorTo(da.getJqUi())},ya=function(w,da,N){null!=N&&w.setModel(N.replace(/(\s*\n\s*)+/g,","));if(null==N||da.getValue()!==JSON.stringify(N.split("\n"))){w=w.getUserObject();if(null!=N&&""!==N){N=JSON.parse(JSON.stringify(N.split("\n")));var xa=[];N&&N.forEach(function(Ya){""!==Ya.trim()&&xa.push($.trim(Ya))});N=JSON.stringify(xa);da.setValue(N);w.getCell(4).setValue(N)}else da.setValue(null),
w.getCell(4).setValue(null);x.checkFilterValid()}},H=function(w,da,N,xa,Ya){var La=new L;La.setGlobal(U);La.setTableFieldMap(fa);w=m.createCtrlInCell(w,da,N,l);w.setSelectedModel(xa);w.setUserObject(Ya);w.setDropdownCreator(function(db,sa,Na){return La.createJqPopup(db,sa,Na)});w.addSelectionListener(function(db){var sa=db.getSelectedModel();if(sa){db=db.getUserObject();var Na=db.getUserObject(),Fa=Na.getField(),ja=Fa?Fa.getOutputDataType():"",Ca=sa?sa.getOutputDataType():"";Na.setField(sa);db.getCell(2).setValue(sa);
if(ja!==Ca||Fa.getEnumValue()!==sa.getEnumValue()){Fa=Na.getCompareOp();sa=sa?sa.isEnum():!1;sa=a.getSelectableCompares(Ca,sa);Ca=!1;for(ja=0;ja<sa.length;ja++)if(Fa===sa[ja]){Ca=!0;break}Ca||(Fa=a.COMPARE_EQUAL);Na.setCompareOp(Fa);G(db.getCell(3),Fa);Na.setValue(null);G(db.getCell(4)," ")}x.checkFilterValid()}});w.setCustomPainter(function(db,sa){if(db){var Na=db.getTableId();Na=U.getModelerModel().getTable(Na);db=oa.TableNameHelper.getDisplayText(Na)+"."+db.getAlias();sa.text(db)}})},ea=function(w,
da,N,xa,Ya,La){w=m.createCtrlInCell(w,da,N,b);w.setSelected(Ya);w.setItemModels([0,1,2,3,4]);w.setUserObject(La);w.setCustomPainter(function(db,sa,Na){db=xa?"(":")";for(var Fa="",ja=0;ja<Na;ja++)Fa+=db;sa.text(Fa)});w.addSelectedChangedListener(xa?Ja:Za)},Ja=function(w,da,N){w=w.getUserObject();w.getUserObject().setLeftBracketCount(N);w.getCell(1).setValue(N);x.checkFilterValid()},Za=function(w,da,N){w=w.getUserObject();w.getUserObject().setRightBracketCount(N);w.getCell(5).setValue(N);x.checkFilterValid()}}
"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.metricdesigner&&(com.kingdee.bos.qing.modeler.designer.metricdesigner=
{});var oa=com.kingdee.bos.qing.modeler.designer.metricdesigner;oa.MetricCardArea=function(){var f,t,q,z,L,E,M={};this.getJqUi=function(){if(!f){f=$("<div>");f.addClass("modeler-designer-common-border");var Oa=$("<div>");Oa.appendTo(f);Q.layoutCtrlWithLRTB(Oa,0,0,null,8,null,23);var aa=$("<div>");aa.appendTo(Oa);Q.layoutCtrl(aa,30,null,null,null);Q.layoutCtrlMiddleAlign(aa,20);aa.css("border-left","3px solid #5582f3");aa=$("<div>");aa.text(A.get("metric","\u6307\u6807"));Q.layoutCtrl(aa,40,null,200,
null);Q.layoutCtrlMiddleAlign(aa,16);aa.appendTo(Oa);aa.css({"font-weight":"bold",color:"#666"});U();t=$("<div>");t.addClass("metric-card-area-container");t.appendTo(f);Q.layoutCtrlWithLRTB(t,14,0,null,70,0,null);Aa();oa.MetricStateMonitor.addStateChangeListener(x)}return f};this.setGlobal=function(Oa){E=Oa};this.setModelerModel=function(Oa){L&&L.removePropertyChangeCallback(fa);L=Oa;L.addPropertyChangeCallback(fa);z.hide();q.hide();Aa()};var x=function(Oa){for(var aa=Object.keys(M),wa=0;wa<aa.length;wa++){var Pa=
aa[wa];M[Pa].setValidPrompt(Oa[Pa])}},U=function(){z=$("<div>");z.addClass("metric-card-create-metric");var Oa=$("<span>"),aa=$("<span>");W.background(aa,"createDim");aa.css({position:"absolute",width:"16px",height:"16px"});var wa=$("<span>"),Pa=A.get("createMetric","\u65b0\u5efa\u6307\u6807");wa.text(Pa);wa.css({"margin-left":"18px"});wa.attr("title",Pa);Oa.append(aa);Oa.append(wa);Oa.css({color:"var(--color-main, #5582f3)","font-size":"12px",cursor:"pointer","margin-right":"15px"});Oa.on("mouseenter",
function(){W.background(aa,"createDim_hover")});Oa.on("mouseleave",function(){W.background(aa,"createDim")});Oa.on("click",ua);z.append(Oa);z.appendTo(f);z.hide()},ua=function(){var Oa=new Da;Oa.setGlobal(E);Oa.setNoDataContainer(q);Oa.setAddMetricBtn(z);Oa.showDialog()},Aa=function(){M={};t.empty();var Oa=E.getModelerModel().getAllMetric();if(0===Oa.length){if(!q){q=$("<div>");Q.layoutCtrlCenterAlign(q,260);Q.layoutCtrlMiddleAlign(q,160);q.css({"line-height":"12px"});Oa=$("<div>");Q.layoutCtrlCenterAlign(Oa,
261);Q.layoutCtrl(Oa,null,0,null,161);W.background(Oa,"add_metric");Oa.on("click",ua);var aa=$("<div>");aa.css({display:"inline-block",width:"12px",height:"12px"});W.background(aa,"add_metric_plug_sign");var wa=$("<div>");Q.makeTextOmissible(wa);wa.css({display:"inline-block",color:"#ffffff","font-size":"14px","margin-left":"8px","max-width":"85px"});wa.text(A.get("addMetric","\u6dfb\u52a0\u6307\u6807"));var Pa=$("<div>");Pa.css({position:"absolute",left:"50%",transform:"translateX(-50%)",top:"120px"});
Pa.append(aa);Pa.append(wa);Oa.append(Pa);q.append(Oa);f.append(q)}q.show()}else{for(aa=0;aa<Oa.length;aa++)bb(Oa[aa]);z.show()}},bb=function(Oa){var aa=new ca;aa.setGlobal(E);aa.setMetric(Oa);aa.setNoDataContainer(q);aa.setAddMetricBtn(z);aa.setValidPrompt(oa.MetricStateMonitor.getInvalidPrompt(Oa.getId()));t.prepend(aa.getJqUi());M[Oa.getId()]=aa},fa=function(Oa,aa){Oa===na.KEY_ADD_METRIC?bb(aa):Oa===na.KEY_REMOVE_METRIC?((Oa=M[aa.getId()])&&Oa.getJqUi().remove(),delete M[aa.getId()]):Oa===na.KEY_UPDATE_METRIC&&
(Oa=M[aa.getId()],Oa.setMetric(aa),Oa&&Oa.updateUi());z.hide();q.hide();Aa()}};oa.AbstractNumberCheck=function(){this.isNumberExist=function(f,t,q,z,L){throw Error("override me");}};var A,Q,Z,O,ia,Ha,ba,n,Ba,I,P,D,W,la,Ea,ra,K,pa,za,na,y,S,T,m,r,qa,k,d,b,a,l,c,e,g,v,u,h,B,F,J,C,p;(function(){var f=com.kingdee.bos.qing.framework.common;A=f.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer);f=com.kingdee.bos.qing.common;Q=f.DomUtil;u=f.RelativePeriodModel;f=com.kingdee.bos.qing.common.ui;
Z=f.NumberFormatSettingPanel;O=f.NumberFormatModel;m=f.TableUtil;d=f.CommonIconUtil;v=f.RelativePeriodPanel;f=com.kingdee.bos.qing.ui.component;ia=f.Label;Ha=f.TextField;ba=f.TextArea;n=f.AbstractModalDialog;Ba=f.TabContainer;I=f.List;y=f.MessageDialog;S=f.SearchBox;k=f.Button;b=f.ComboBox;l=f.DropdownSelector;c=f.F7Selector;e=f.DateSelector;g=f.DateTimeSelector;f=com.kingdee.bos.qing.modeler.designer;P=f.DesignerFacade;D=f.Field;W=f.Icons;la=f.UIDHelper;a=f.FilterItem;r=f.FilterCheckHelper;qa=f.NoDataView;
B=f.QingModeler;p=f.UserOperationReporter;f=com.kingdee.bos.qing.modeler.designer.metricdesigner;h=f.ChangeMetricFilterAction;f=com.kingdee.bos.qing.modeler;C=f.SpecialWordChecker;Ea=oa.ExprPane;ra=oa.Metric;K=oa.AddMetricAction;pa=oa.EditMetricAction;za=oa.DeleteMetricAction;na=oa.MetricModeler;T=oa.MetricsCalculateDialog;F=oa.ModelerValidity;J=oa.ModelerChecker})();oa.MetricNumberHelper=new function(){var f;this.setInstance=function(t){f=t};this.isImplExist=function(){return f?!0:!1};this.isNumberExist=
function(t,q,z,L,E){f?f.isNumberExist(t,q,z,L,E):z&&z()}}})();(function(){function ta(){var I,P,D,W,la,Ea,ra,K,pa,za,na;this.setGlobal=function(k){D=k};this.getJqUi=function(){I||(I=$("<div>"),y(),Ea=new Q,Ea.setGlobal(D),ra=new A,ra.setGlobal(D),S());return I};this.updateModelerModel=function(){I&&(P&&P.removePropertyChangeCallback(qa),P=D.getModelerModel(),P.addPropertyChangeCallback(qa),Xa.init(P,Xa.METRIC_SCENE),W.setModelerModel(P),la.setModelerModel(P),ra.setModelerModel(P),Ea.setModelerModel(P),T())};this.resize=function(){r();K&&K.resize()};this.showDialogIfNoTable=
function(){W&&W.showDialogIfNoTable()};var y=function(){W=new Ma;W.setGlobal(D);W.setTableChangeCallback(function(k){la&&la.setTable(k)});W.setExceptionTableChangeCallback(function(k,d){la&&la.setExceptionTable(k,d)});la=new oa;la.setGlobal(D)},S=function(){pa=new n;pa.setHorizontalSplit(!1);pa.setSplitLineWide(8);pa.setResizeMode(n.RESIZE_MODE_SECOND_FIXED);pa.setSecondSize(-1,60,-1);pa.setFirstChild(n.createChildWrapper(W.getJqUi()));pa.setSecondChild(n.createChildWrapper(la.getJqUi()));r();za=
new n;za.setHorizontalSplit(!0);za.setSplitLineWide(8);za.setResizeMode(n.RESIZE_MODE_SECOND_FIXED);za.setFirstSize(-1,120,-1);za.setSecondSize(350,280,450);za.setFirstChild(n.createChildWrapper(ra.getJqUi()));za.setSecondChild(n.createChildWrapper(Ea.getJqUi(),function(){Ea.afterResize()}));K=new n;K.setHorizontalSplit(!0);K.setSplitLineWide(8);K.setResizeMode(n.RESIZE_MODE_FIRST_FIXED);K.setFirstSize(206,100,450);K.setSecondSize(-1,600,-1);K.setFirstChild(pa);K.setSecondChild(za);I=K.getJqUi();
I.addClass("modeler-designer-main")},T=function(){if(P){var k=P.getAllTable(!0);k=!k||0==k.length;m!=k&&(m=k,r(),pa.collapseSecondHalf(k));if(k){if(!na){na=$("<div>");k=$("<div>");Ha.layoutCtrlCenterAlign(k,210);Ha.layoutCtrlMiddleAlign(k,170);var d=$("<div>");Ha.layoutCtrlCenterAlign(d,212);Ha.layoutCtrl(d,null,0,null,172);ia.background(d,"no_metric");k.append(d);k.appendTo(na);na.css({background:"#f7f7f7","z-index":1E3});Ha.layoutCtrlWithLRTB(na,0,0,null,0,0,null);na.appendTo(za.getJqUi())}na.show()}else na&&
na.hide()}},m=!1,r=function(){m?(pa.setFirstSize(360,60,-1),pa.setSplitLineWide(0)):(pa.setFirstSize(360,60,Math.max(60,.382*I[0].clientHeight)),pa.setSplitLineWide(8))},qa=function(k,d){k!=ca.KEY_ADD_TABLE&&k!=ca.KEY_REMOVE_TABLE||T()}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler=
{});"undefined"==typeof com.kingdee.bos.qing.modeler.designer&&(com.kingdee.bos.qing.modeler.designer={});"undefined"==typeof com.kingdee.bos.qing.modeler.designer.metricdesigner&&(com.kingdee.bos.qing.modeler.designer.metricdesigner={});var Da=com.kingdee.bos.qing.modeler.designer.metricdesigner;Da.Designer=function(){Va.call(this);var I=this,P=this.protectedMethod,D=new O,W,la;this.setNumberChecker=function(K){Da.MetricNumberHelper.setInstance(K)};this.getMetricName=function(K){var pa=la.getMetric(K);
return pa?pa.getName():K};this.protectedInit=function(){W=new ta;W.setGlobal(P.getGlobal());W.getJqUi().appendTo(P.getMainUi());Da.ExprRefHelper.setGlobal(P.getGlobal());D.setGlobal(P.getGlobal());D.init(P.getGlobal().getModelerModel());P.addUndoRedoBtn();P.addToolbarButton(Ea,"btn_preview",ba.get("preview","\u9884\u89c8"));P.addMaterializedConfigBtn()};this.protectedResize=function(){W&&W.resize()};this.protectedGetModelerModel=function(){la||(la=new Y,D.init(la));return la};this.protectedUpdateModelerModel=
function(K){ra(K)};this.setJsonModel=function(K){if(K){var pa=new mb;pa.fromJsonObject(K);ra(pa.getModelerModel())}else ra(new Y);P.getGlobal().getCommandManager().reset();I.clearDirty();W.showDialogIfNoTable()};this.setJsonValidity=function(K,pa){D&&D.setGlobalCheckResult(K,!1,pa)};var Ea=function(){var K=new Z;K.setJsonQingModeler(I.getJsonModel());K.setGlobal(P.getGlobal());K.showMetricDialog();Ba.occur(Ba.BUTTON_TYPE,Ba.MODEL_PREVIEW)},ra=function(K){la&&la.clearPropertyChangeCallback();la=K;
W.updateModelerModel();D.init(la);K=I.getJsonModel();D&&D.firstBackgroundCheck(K)}};var Va,mb,Xa,ca,Y,Ma,oa,A,Q,Z,O,ia,Ha,ba,n,Ba;(function(){var I=com.kingdee.bos.qing.modeler.designer;Va=I.AbstractDesigner;mb=I.QingModeler;Xa=I.UIDHelper;ca=I.ModelerModel;ia=I.Icons;Ba=I.UserOperationReporter;I=com.kingdee.bos.qing.common;Ha=I.DomUtil;Y=Da.MetricModeler;A=Da.MetricCardArea;Ma=Da.TableArea;oa=Da.FieldArea;Q=Da.PropertyArea;Z=Da.PreviewDialog;O=Da.ModelerChecker;I=com.kingdee.bos.qing.framework.common;
ba=I.MultilanguageManager.createPackageAccessor(com.kingdee.bos.qing.modeler.designer);I=com.kingdee.bos.qing.ui.component;n=I.SplitPane})()})();
//qingVersionTag: 20250415