var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(P,ia,na){P instanceof String&&(P=String(P));for(var ra=P.length,oa=0;oa<ra;oa++){var ta=P[oa];if(ia.call(na,ta,oa,P))return{i:oa,v:ta}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(P,ia,na){if(P==Array.prototype||P==Object.prototype)return P;P[ia]=na.value;return P};$jscomp.getGlobal=function(P){P=["object"==typeof globalThis&&globalThis,P,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var ia=0;ia<P.length;++ia){var na=P[ia];if(na&&na.Math==Math)return na}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(P,ia){var na=$jscomp.propertyToPolyfillSymbol[ia];if(null==na)return P[ia];na=P[na];return void 0!==na?na:P[ia]};
$jscomp.polyfill=function(P,ia,na,ra){ia&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(P,ia,na,ra):$jscomp.polyfillUnisolated(P,ia,na,ra))};$jscomp.polyfillUnisolated=function(P,ia,na,ra){na=$jscomp.global;P=P.split(".");for(ra=0;ra<P.length-1;ra++){var oa=P[ra];if(!(oa in na))return;na=na[oa]}P=P[P.length-1];ra=na[P];ia=ia(ra);ia!=ra&&null!=ia&&$jscomp.defineProperty(na,P,{configurable:!0,writable:!0,value:ia})};
$jscomp.polyfillIsolated=function(P,ia,na,ra){var oa=P.split(".");P=1===oa.length;ra=oa[0];ra=!P&&ra in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var ta=0;ta<oa.length-1;ta++){var qa=oa[ta];if(!(qa in ra))return;ra=ra[qa]}oa=oa[oa.length-1];na=$jscomp.IS_SYMBOL_NATIVE&&"es6"===na?ra[oa]:null;ia=ia(na);null!=ia&&(P?$jscomp.defineProperty($jscomp.polyfills,oa,{configurable:!0,writable:!0,value:ia}):ia!==na&&(void 0===$jscomp.propertyToPolyfillSymbol[oa]&&(na=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[oa]=
$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(oa):$jscomp.POLYFILL_PREFIX+na+"$"+oa),$jscomp.defineProperty(ra,$jscomp.propertyToPolyfillSymbol[oa],{configurable:!0,writable:!0,value:ia})))};$jscomp.polyfill("Array.prototype.find",function(P){return P?P:function(ia,na){return $jscomp.findInternal(this,ia,na).v}},"es6","es3");$jscomp.arrayIteratorImpl=function(P){var ia=0;return function(){return ia<P.length?{done:!1,value:P[ia++]}:{done:!0}}};$jscomp.arrayIterator=function(P){return{next:$jscomp.arrayIteratorImpl(P)}};
$jscomp.initSymbol=function(){};$jscomp.polyfill("Symbol",function(P){if(P)return P;var ia=function(ta,qa){this.$jscomp$symbol$id_=ta;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:qa})};ia.prototype.toString=function(){return this.$jscomp$symbol$id_};var na="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",ra=0,oa=function(ta){if(this instanceof oa)throw new TypeError("Symbol is not a constructor");return new ia(na+(ta||"")+"_"+ra++,ta)};return oa},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(P){if(P)return P;P=Symbol("Symbol.iterator");for(var ia="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),na=0;na<ia.length;na++){var ra=$jscomp.global[ia[na]];"function"===typeof ra&&"function"!=typeof ra.prototype[P]&&$jscomp.defineProperty(ra.prototype,P,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return P},
"es6","es3");$jscomp.iteratorPrototype=function(P){P={next:P};P[Symbol.iterator]=function(){return this};return P};$jscomp.iteratorFromArray=function(P,ia){P instanceof String&&(P+="");var na=0,ra=!1,oa={next:function(){if(!ra&&na<P.length){var ta=na++;return{value:ia(ta,P[ta]),done:!1}}ra=!0;return{done:!0,value:void 0}}};oa[Symbol.iterator]=function(){return oa};return oa};
$jscomp.polyfill("Array.prototype.keys",function(P){return P?P:function(){return $jscomp.iteratorFromArray(this,function(ia){return ia})}},"es6","es3");
(function(){function P(){var ra,oa,ta,qa,V,wa,X,r,ya,Fa=[],Ha=[],Oa=this;this.setId=function(da){ra=da};this.getId=function(){return ra};this.setCodeNumber=function(da){oa=da};this.getCodeNumber=function(){return oa};this.setName=function(da){ta=da};this.getName=function(){return ta};this.setDesc=function(da){qa=da};this.getDesc=function(){return qa};this.setCreatorId=function(da){V=da};this.getCreatorId=function(){return V};this.setCreatorName=function(da){wa=da};this.getCreatorName=function(){return wa};
this.setEnabled=function(da){X=da};this.isEnabled=function(){return X};this.getUsers=function(){return Fa};this.setUsers=function(da){Fa=da};this.getRoles=function(){return Ha};this.setRoles=function(da){Ha=da};this.setShared=function(da){r=da};this.isShared=function(){return r};this.isPreset=function(){return ya};this.setPreset=function(da){ya=da};this.copy=function(){var da=new P;da.setId(ra);da.setCodeNumber(oa);da.setName(ta);da.setDesc(qa);da.setEnabled(X);da.setCreatorId(V);da.setCreatorName(wa);
da.setShared(r);da.setPreset(ya);return da};this.fromJsonObject=function(da){Oa.setId(da.id);Oa.setCodeNumber(da.number);Oa.setName(da.name);Oa.setDesc(da.desc);Oa.setEnabled(!da.disabled);Oa.setCreatorId(da.creatorId);Oa.setCreatorName(da.creatorName);Oa.setPreset(da.preset);var Ra=[],ua=da.users;if(ua){for(var Va=0;Va<ua.length;Va++){var H=new ia;H.fromJsonObject(ua[Va]);Ra.push(H)}Oa.setUsers(Ra)}Ra=[];if(ua=da.roles){for(Va=0;Va<ua.length;Va++)H=new ia,H.fromJsonObject(ua[Va]),Ra.push(H);Oa.setRoles(Ra)}r=
da.shared};this.toJsonObject=function(){var da={};da.number=oa;da.name=ta;da.desc=qa;da.disabled=!X;da.id=ra;da.creatorId=V;da.preset=ya;for(var Ra=[],ua=0;ua<Fa.length;ua++)Ra.push(Fa[ua].toJsonObject());da.users=Ra;Ra=[];for(ua=0;ua<Ha.length;ua++)Ra.push(Ha[ua].toJsonObject());da.roles=Ra;da.shared=r;return da}}function ia(){var ra=this,oa,ta,qa;this.getValue=function(){return oa};this.setValue=function(V){oa=V};this.getText=function(){return ta};this.setText=function(V){ta=V};this.getUserObject=
function(){return qa};this.setUserObject=function(V){qa=V};this.toJsonObject=function(){var V={};V.value=oa;V.text=ta;return V};this.fromJsonObject=function(V){V&&(V.value&&ra.setValue(V.value),V.text&&ra.setText(V.text))}}"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.metriclibrary&&(com.kingdee.bos.qing.modeler.metriclibrary={});"undefined"==typeof com.kingdee.bos.qing.modeler.metriclibrary.system&&(com.kingdee.bos.qing.modeler.metriclibrary.system={});var na=com.kingdee.bos.qing.modeler.metriclibrary.system;na.MetricSystem=P;na.ValueTextPair=ia;com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(na);P.NOT_PRESET_SYSTEM=1;P.PRESET_SYSTEM=2})();(function(){function P(){var H,L,R,M;this.setId=function(E){H=E};this.getId=function(){return H};this.setName=function(E){L=E};this.getName=function(){return L};this.setType=function(E){R=E};this.getType=function(){return R};this.setLevel=function(E){M=E};this.getLevel=function(){return M};this.protectedMethod={toJsonObject:function(){var E={};E.id=H;E.name=L;E.type=R;E.level=M;return E},fromJsonObject:function(E){H=E.id;L=E.name;R=E.type;M=E.level}}}function ia(){P.call(this);var H=this.protectedMethod,
L=this,R,M,E=[],Q,ca=0;this.setParentId=function(Y){R=Y};this.getParentId=function(){return R};this.setParentNode=function(Y){M=Y};this.getParentNode=function(){return M};this.setChildren=function(Y){E=Y};this.getChildren=function(){return E};this.setMetrics=function(Y){Q=Y};this.getMetrics=function(){return Q};this.setTotalRow=function(Y){ca=Y};this.getTotalRow=function(){return ca};this.getAllChildId=function(Y){for(var Ma=L.getChildren(),va=0;va<Ma.length;va++){var Ea=Ma[va];Y.push(Ea.getId());
Ea.getAllChildId(Y)}};this.fromJsonObject=function(Y){H.fromJsonObject(Y);if((Y=Y.children)&&0<Y.length)for(var Ma=0;Ma<Y.length;Ma++){var va=Y[Ma],Ea=new ia;Ea.fromJsonObject(va);Ea.setParentNode(L);E.push(Ea)}Ha.CatalogNodeCacheHelper.addCatalogNode(L)};this.toJsonObject=function(){var Y=H.toJsonObject();Y.parentId=R;return Y}}function na(){var H,L,R,M,E,Q,ca,Y,Ma,va=!1,Ea,za,Ua,f,Xa,Ya,ja=!1,Za,Aa=[];this.setId=function(W){H=W};this.getId=function(){return H};this.setMetricId=function(W){L=W};
this.getMetricId=function(){return L};this.setModelId=function(W){R=W};this.getModelId=function(){return R};this.setCatalogId=function(W){M=W};this.getCatalogId=function(){return M};this.setNumber=function(W){E=W};this.getNumber=function(){return E};this.setMetricName=function(W){Q=W};this.getMetricName=function(){return Q};this.setDesc=function(W){ca=W};this.getDesc=function(){return ca};this.setExpr=function(W){Y=W};this.getExpr=function(){return Y};this.setDimension=function(W){Ma=W};this.getDimension=
function(){return Ma};this.setDigest=function(W){va=W};this.isDigest=function(){return va};this.setWholeDimension=function(W){Ea=W};this.getWholeDimension=function(){return Ea};this.setPath=function(W){za=W};this.getPath=function(){return za};this.setMetricCreator=function(W){Ua=W};this.getMetricCreator=function(){return Ua};this.setAddTime=function(W){Xa=W};this.getAddTime=function(){return Xa};this.getAddPeople=function(){return f};this.setDataUpdateTime=function(W){Ya=W};this.getDataUpdateTime=
function(){return Ya};this.isPreset=function(){return ja};this.hasLicence=function(){return Za};this.setPreset=function(W){ja=W};this.getFilterItems=function(){return Aa};this.toJsonObject=function(){var W={};W.id=H;W.metricId=L;W.modelId=R;W.catalogId=M;W.number=E;W.metricName=Q;W.desc=ca;W.expr=Y;W.dimension=Ma;W.isDigest=va;W.path=za;W.metricCreator=Ua;W.addTime=Xa;W.dataUpdateTime=Ya;W.isPreset=ja;return W};this.fromJsonObject=function(W){H=W.id;L=W.metricId;R=W.modelId;M=W.catalogId;E=W.number;
Q=W.metricName;ca=W.desc;W.expr&&(Y=new ra,Y.fromJsonObject(W.expr));if(W.filterConfig)for(var fb=W.filterConfig.filterItems,cb=0;cb<fb.length;cb++){var hb=new V;hb.fromJsonObject(fb[cb]);Aa.push(hb)}Ma=W.dimension;va="0"===W.isDigest;za=W.path;Ua=W.metricCreator;f=W.addPeople;Xa=W.addTime;Ya=W.dataUpdateTime;ja=W.isPreset;Za=W.hasLicence}}function ra(){var H=this,L=[];this.setExprSegments=function(R){L=R};this.getExprSegments=function(){return L};this.fromJsonObject=function(R){R=R.exprSegments;
for(var M=0;M<R.length;M++){var E=R[M],Q=new oa;Q.fromJsonObject(E);L.push(Q)}};this.getDisplayExpr=function(){for(var R="",M=0;M<L.length;M++){var E=L[M].getContent();R+=E}return R};this.getDisplayExprJqUi=function(){var R=$("<span>"),M=H.getExprSegments(),E=H.getDisplayExpr();R.attr("title",E);for(E=0;E<M.length;E++){var Q=M[E].getTextSegment();Q=$("<span>").text(Q.getText()).css("color",Q.getColor());R.append(Q)}return R}}function oa(){function H(ca){M.call(this,ca,"#666")}function L(ca){M.call(this,
ca,"#e8893a")}function R(ca){M.call(this,ca,"#16B0F1")}function M(ca,Y){this.getText=function(){return ca};this.getColor=function(){return Y}}var E,Q;this.setType=function(ca){E=ca};this.getType=function(){return E};this.setContent=function(ca){Q=ca};this.getContent=function(){return Q};this.getTextSegment=function(){switch(E){case oa.TEXT:return new H(Q);case oa.FIELD:return new R(Q);case oa.METRIC:return new L(Q)}};this.fromJsonObject=function(ca){E=ca.contentType;Q=ca.content}}function ta(){var H=
0,L=1,R,M=[];this.getTotalRow=function(){return H};this.getCurrentPage=function(){return L};this.getPageSize=function(){return R};this.getMetrics=function(){return M};this.fromJsonObject=function(E){if(E&&(H=E.totalRow,L=E.currentPage,R=E.pageSize,(E=E.metrics)&&0<E.length))for(var Q=0;Q<E.length;Q++){var ca=E[Q],Y=new na;Y.fromJsonObject(ca);M.push(Y)}}}function qa(){var H,L,R,M,E,Q,ca,Y,Ma,va,Ea,za,Ua,f,Xa,Ya=[];this.isPresetMetric=function(){return Ua};this.equals=function(ja){return H==ja.getId()};
this.getId=function(){return H};this.getModelSetId=function(){return L};this.getModelId=function(){return R};this.getMetricId=function(){return M};this.getNumber=function(){return E};this.getName=function(){return Q};this.getDesc=function(){return ca};this.setPath=function(ja){Y=ja};this.getPath=function(){return Y};this.setDataUpdateTime=function(ja){za=ja};this.getDataUpdateTime=function(){return za};this.setDimension=function(ja){Ma=ja};this.getDimension=function(){return Ma};this.setWholeDimension=
function(ja){va=ja};this.getWholeDimension=function(){return va};this.setDigest=function(ja){f=ja==qa.DIMENSION_IS_DIGEST};this.isDigest=function(){return f};this.getExpr=function(){return Xa};this.getFilterItems=function(){return Ya};this.getCreator=function(){return Ea};this.fromJsonObject=function(ja){H=ja.id;L=ja.modelSetId;R=ja.modelId;M=ja.metricId;E=ja.number;Q=ja.name;ca=ja.desc;Ea=ja.creator;Ua=ja.preset;!E&&(E="");!ca&&(ca="");ja.expr&&(Xa=new ra,Xa.fromJsonObject(ja.expr));if(ja.filterConfig){ja=
ja.filterConfig.filterItems;for(var Za=0;Za<ja.length;Za++){var Aa=new V;Aa.fromJsonObject(ja[Za]);Ya.push(Aa)}}};this.toJsonObject=function(){var ja={};ja.id=H;ja.modelSetId=L;ja.modelId=R;ja.metricId=M;ja.number=E;ja.name=Q;return ja}}function V(){var H,L,R,M=0,E=0,Q,ca=null;this.fromJsonObject=function(va){va&&(H=va.fieldName,L=va.compareOp,R=va.displayValue,M=va.leftBrackets,E=va.rightBrackets,Q=va.logicOp,va=va.relativeDateRange)&&(ca=new Oa,ca.fromJsonObject(va))};this.getDisplayText=function(){var va=
Ma(!0,M),Ea=H+" ";switch(L){case V.COMPARE_EQUAL:var za=ua.get("equal","\u7b49\u4e8e");break;case V.COMPARE_NOT_EQUAL:za=ua.get("notEqual","\u4e0d\u7b49\u4e8e");break;case V.COMPARE_GREATER:za=ua.get("greater","\u5927\u4e8e");break;case V.COMPARE_GREATER_EQUAL:za=ua.get("equalOrGreater","\u5927\u4e8e\u7b49\u4e8e");break;case V.COMPARE_LESS:za=ua.get("less","\u5c0f\u4e8e");break;case V.COMPARE_LESS_EQUAL:za=ua.get("equalOrLess","\u5c0f\u4e8e\u7b49\u4e8e");break;case V.COMPARE_INCLUDE:za=ua.get("include",
"\u5305\u542b");break;case V.COMPARE_NOT_INCLUDE:za=ua.get("notInclude","\u4e0d\u5305\u542b");break;case V.COMPARE_START_WITH:za=ua.get("startWith","\u5f00\u5934\u662f");break;case V.COMPARE_END_WITH:za=ua.get("endWith","\u7ed3\u5c3e\u662f");break;case V.COMPARE_NULL:za=ua.get("compareNull","\u4e3a\u7a7a");break;case V.COMPARE_NOT_NULL:za=ua.get("compareNotNull","\u4e0d\u4e3a\u7a7a");break;case V.COMPARE_IN:za=ua.get("compareIn","\u5728......\u4e4b\u5185");break;case V.COMPARE_NOT_IN:za=ua.get("compareNotIn",
"\u4e0d\u5728......\u4e4b\u5185");break;case V.COMPARE_RELATIVE_DATE_RANGE:za=ua.get("relativeDateRange","\u76f8\u5bf9\u65e5\u671f");break;default:za=""}Ea=Ea+za+" ";za=Y(!0);Ea=L==V.COMPARE_IN||L==V.COMPARE_NOT_IN?Ea.replace("......",za):L==V.COMPARE_RELATIVE_DATE_RANGE?H+" "+ua.get("equalRelativeDateRange","\u7b49\u4e8e\uff08\u76f8\u5bf9\u65e5\u671f\uff09")+za:Ea+za;va=va+Ea+Ma(!1,E)+" ";Q?(Ea="",Q==V.LOGIC_AND?Ea=ua.get("and","\u4e14"):Q==V.LOGIC_OR&&(Ea=ua.get("or","\u6216"))):Ea="";return va+
Ea+" "};var Y=function(va){if(R){if(!va&&(L==V.COMPARE_IN||L==V.COMPARE_NOT_IN))return JSON.parse(R).join(",");if(L==V.COMPARE_RELATIVE_DATE_RANGE)return da.modelToDisplayText(ca,!0)}else return"";return R},Ma=function(va,Ea){va=va?"(":")";for(var za="",Ua=0;Ua<Ea;Ua++)za+=va;return za}}function wa(){var H,L=this;this.fromJsonObject=function(R){H=R.failType;var M=L.protectedFromJson;M&&M(R)};this.getFailType=function(){return H}}function X(){wa.call(this)}function r(){wa.call(this)}function ya(){wa.call(this)}
function Fa(){wa.call(this);var H;this.protectedFromJson=function(L){H=L.failMap};this.getFailMap=function(){return H}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.metriclibrary&&(com.kingdee.bos.qing.modeler.metriclibrary=
{});"undefined"==typeof com.kingdee.bos.qing.modeler.metriclibrary.model&&(com.kingdee.bos.qing.modeler.metriclibrary.model={});var Ha=com.kingdee.bos.qing.modeler.metriclibrary.model;Ha.Catalog=function(){var H=this,L,R,M,E,Q;this.setCatalogId=function(ca){L=ca};this.getCatalogId=function(){return L};this.setSystemId=function(ca){R=ca};this.getSystemId=function(){return R};this.setCatalogName=function(ca){M=ca};this.getCatalogName=function(){return M};this.setParentId=function(ca){E=ca};this.getParentId=
function(){return E};this.setSeq=function(ca){Q=ca};this.getSeq=function(){return Q};this.fromJsonObject=function(ca){H.setCatalogId(ca.catalogId);H.setSystemId(ca.systemId);H.setCatalogName(ca.catalogName);H.setParentId(ca.parentId);H.setSeq(ca.seq)};this.toJsonObject=function(){var ca={};ca.catalogId=L;ca.systemId=R;ca.catalogName=M;ca.parentId=E;ca.seq=Q;return ca}};Ha.CatalogNode=ia;Ha.MetricVO=na;Ha.MetricLibraryRequest=function(){var H,L=[],R=1,M=20,E;this.setSystemId=function(Q){H=Q};this.getSystemId=
function(){return H};this.setCatalogIds=function(Q){L=Q};this.getCatalogIds=function(){return L};this.setTargetPage=function(Q){R=Q};this.getTargetPage=function(){return R};this.setPageSize=function(Q){M=Q};this.getPageSize=function(){return M};this.setSearchText=function(Q){E=Q};this.getSearchText=function(){return E};this.toJsonObject=function(){var Q={};Q.systemId=H;Q.catalogIdList=L;Q.targetPage=R;Q.pageSize=M;Q.searchText=E;return Q}};Ha.MetricLibraryResponse=function(){var H,L,R=[],M;this.getMetricPagination=
function(){return H};this.getCatalogNode=function(){return L};this.getSystems=function(){return R};this.isPresetSystem=function(){return M};this.fromJsonObject=function(E){var Q=E.metricPageInfo;H=new ta;Q&&H.fromJsonObject(Q);Q=E.catalogNode;L=new ia;Q&&L.fromJsonObject(Q);M=E.presetSystem;if((E=E.systemList)&&0<E.length)for(Q=0;Q<E.length;Q++){var ca=E[Q],Y=new Ra;Y.fromJsonObject(ca);R.push(Y)}}};Ha.MetricPagination=ta;Ha.ModelSet=function(){var H,L,R=!1;this.isAll=function(){return R};this.setIsAll=
function(M){R=M};this.setId=function(M){H=M};this.getId=function(){return H};this.setName=function(M){L=M};this.getName=function(){return L};this.fromJsonObject=function(M){H=M.modelSetId;L=M.modelSetName}};Ha.MetricModelInfo=function(){var H=[];this.getMetricInfos=function(){return H};this.fromJsonObject=function(L){var R=L.metricInfos;if(R)for(var M=0;M<R.length;M++){var E=R[M],Q=new qa;Q.fromJsonObject(E);Q.setPath(L.path);Q.setDataUpdateTime(L.dataUpdateTime);Q.setDigest(L.isDigest);Q.setDimension(L.dimensionsName);
H.push(Q)}}};Ha.MetricInfo=qa;Ha.Expr=ra;Ha.ExprSegment=oa;Ha.AddMetricResponse=function(){var H,L,R=function(M){switch(M){case wa.FAIL_TYPE_SYSTEM_NOTEXIST:return new r;case wa.FAIL_TYPE_CATALOG_NOTEXIST:return new X;case wa.FAIL_TYPE_INVALID_METRIC:return new Fa;case wa.FAIL_TYPE_SYSTEM_WITHOUT_AUTH:return new ya}};this.fromJsonObject=function(M){H=M.success;if(M=M.invalidityCase){var E=R(M.failType);E.fromJsonObject(M);L=E}};this.isSuccess=function(){return H};this.getInvalidCase=function(){return L}};
Ha.AbstractAddMetricInvalidityCase=wa;Ha.DetailMetricInvalidityCase=Fa;Ha.AddMetricQueryRequest=function(){var H,L,R,M,E,Q,ca;this.setModelSetId=function(Y){H=Y};this.setSystemId=function(Y){L=Y};this.setSearchText=function(Y){R=Y};this.setShowNoAddMetric=function(Y){M=Y};this.setPreset=function(Y){E=Y};this.setTargetPage=function(Y){Q=Y};this.setPageSize=function(Y){ca=Y};this.toJsonObject=function(){var Y={};Y.modelSetId=H;Y.systemId=L;Y.searchText=R;Y.showNoAddMetric=M;Y.preset=E;Y.targetPage=
Q;Y.pageSize=ca;return Y}};var Oa,da,Ra,ua,Va=com.kingdee.bos.qing.modeler.metriclibrary;(function(){var H=com.kingdee.bos.qing.common;Oa=H.RelativePeriodModel;H=com.kingdee.bos.qing.common.ui;da=H.RelativePeriodPanel;H=com.kingdee.bos.qing.framework.common;ua=H.MultilanguageManager.createPackageAccessor(Va);H=com.kingdee.bos.qing.modeler.metriclibrary.system;Ra=H.MetricSystem})();Ha.CatalogNodeCacheHelper=new function(){var H=[];this.getAllCatalogNodeBySystem=function(){return H};this.addCatalogNode=
function(L){H.push(L)};this.getCatalogNodeById=function(L){for(var R=0;R<H.length;R++)if(H[R].getId()===L)return H[R]};this.removeCatalogNode=function(L){for(var R=0;R<H.length;R++)if(H[R].getId()===L.getId()){H.splice(R,1);break}};this.clearCatalogNodeCache=function(){H=[]}};ia.ROOT_NODE_ID="0";oa.TEXT="text";oa.FIELD="field";oa.METRIC="metric";qa.DIMENSION_IS_DIGEST="1";V.COMPARE_EQUAL="EQUAL";V.COMPARE_NOT_EQUAL="NOT_EQUAL";V.COMPARE_GREATER="GREATER";V.COMPARE_GREATER_EQUAL="GREATER_EQUAL";V.COMPARE_LESS=
"LESS";V.COMPARE_LESS_EQUAL="LESS_EQUAL";V.COMPARE_INCLUDE="INCLUDE";V.COMPARE_NOT_INCLUDE="NOT_INCLUDE";V.COMPARE_START_WITH="START_WITH";V.COMPARE_END_WITH="END_WITH";V.COMPARE_NULL="NULL";V.COMPARE_NOT_NULL="NOT_NULL";V.COMPARE_IN="IN";V.COMPARE_NOT_IN="NOT_IN";V.COMPARE_RELATIVE_DATE_RANGE="RELATIVE_DATE_RANGE";V.LOGIC_AND="AND";V.LOGIC_OR="OR";wa.FAIL_TYPE_SYSTEM_NOTEXIST="SYSTEM_NOT_EXIST";wa.FAIL_TYPE_CATALOG_NOTEXIST="CATALOG_NOT_EXIST";wa.FAIL_TYPE_INVALID_METRIC="INVALID_METRIC";wa.FAIL_TYPE_SYSTEM_WITHOUT_AUTH=
"SYSTEM_WITHOUT_AUTH";Fa.FAIL_TYPE_NO_DATA_AUTH="NO_DATA_AUTH";Fa.FAIL_TYPE_NOT_EXIST="NOT_EXIST";Fa.FAIL_TYPE_IS_ADDED="IS_ADDED"})();(function(){function P(){oa.call(this);var ta;this.getRemoteUrl=function(){return ta};this.setRemoteUrl=function(qa){ta=qa}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler={});"undefined"==typeof com.kingdee.bos.qing.modeler.metriclibrary&&(com.kingdee.bos.qing.modeler.metriclibrary=
{});"undefined"==typeof com.kingdee.bos.qing.modeler.metriclibrary.common&&(com.kingdee.bos.qing.modeler.metriclibrary.common={});var ia=com.kingdee.bos.qing.modeler.metriclibrary.common;ia.Facade=function(ta,qa,V,wa){na.call(this,ta,qa,V,wa);var X=this.protectedMethod;this.loadFirstSystemCatalogAndMetric=function(r,ya,Fa){X.remote("loadFirstSystemCatalogAndMetric",{systemId:r,targetPage:ya,pageSize:Fa})};this.loadCatalogAndMetricBySystemId=function(r){r={metricLibraryRequest:JSON.stringify(r.toJsonObject())};
X.remote("loadCatalogAndMetricBySystemId",r)};this.loadMetricLibraryMetric=function(r){r={metricLibraryRequest:JSON.stringify(r.toJsonObject())};X.remote("loadMetricLibraryMetric",r)};this.createCatalog=function(r){r={catalog:JSON.stringify(r.toJsonObject())};X.remote("createCatalog",r)};this.updateCatalog=function(r){r={catalog:JSON.stringify(r.toJsonObject())};X.remote("updateCatalog",r)};this.deleteCatalog=function(r,ya){X.remote("deleteCatalog",{systemId:r,catalogId:ya})};this.updateCatalogSequence=
function(r,ya){r={systemId:r,catalogList:JSON.stringify(ya)};X.remote("updateCatalogSequence",r)};this.deleteSystemMetric=function(r){X.remote("deleteSystemMetric",{systemId:r})};this.deleteCatalogsMetric=function(r,ya){r={systemId:r,catalogIdList:JSON.stringify(ya)};X.remote("deleteCatalogsMetric",r)};this.deleteMetric=function(r,ya){r={systemId:r,metricIdList:JSON.stringify(ya)};X.remote("deleteMetric",r)};this.moveMetric=function(r,ya,Fa){r={systemId:r,metricIdList:JSON.stringify(ya),targetCatalogId:Fa};
X.remote("moveMetric",r)};this.moveSystemMetric=function(r,ya){X.remote("moveSystemMetric",{systemId:r,targetCatalogId:ya})};this.moveCatalogMetric=function(r,ya,Fa){r={systemId:r,catalogIdList:JSON.stringify(ya),targetCatalogId:Fa};X.remote("moveCatalogMetric",r)};this.loadAllMetricIds=function(r){r={metricLibraryRequest:JSON.stringify(r.toJsonObject())};X.remote("loadAllMetricIds",r)};this.loadFirstPageMetric=function(r){X.remote("loadFirstPageMetric",{systemId:r})};this.getMetricByPage=function(r){r=
{addMetricQueryRequest:JSON.stringify(r.toJsonObject())};X.remote("getMetricByPage",r)};this.getAllSelectMetric=function(r){r={addMetricQueryRequest:JSON.stringify(r.toJsonObject())};X.remote("getAllSelectMetric",r)};this.cancelAllSelectedMetric=function(r){r={addMetricQueryRequest:JSON.stringify(r.toJsonObject())};X.remote("cancelAllSelectedMetric",r)};this.addMetricToSystem=function(r,ya,Fa){for(var Ha=[],Oa=0;Oa<r.length;Oa++)Ha.push(r[Oa].toJsonObject());r={metricList:JSON.stringify(Ha),systemId:ya,
catalogId:Fa};X.remote("addMetricToSystem",r)};this.loadWholeDimensionInfo=function(r){X.remote("loadWholeDimensionInfo",{modelId:r})}};ia.RemoteImpl=P;var na,ra,oa;(function(){var ta=com.kingdee.bos.qing.framework.common;na=ta.AbstractFacade;ra=ta.AbstractIcons;oa=ta.AbstractRemoteCall})();ia.Icons=new function(){ra.call(this);var ta=this.protectedMethod;this.protectedInit=function(wa,X){wa=com.kingdee.bos.qing.modeler.metriclibrary.ComboIcon;if(!wa)throw Error("com.kingdee.bos.qing.modeler.metriclibrary.ComboIcon not found.");
wa.define(X,"model-common");X.setGap(1);X.setStartPosition(104,285);X.setIconSize(16,16);V(0,0,"add_subDir");V(0,1,"add_dir");V(0,2,"move_up");V(0,3,"move_down");X.setStartPosition(0,117);X.setIconSize(16,16);qa(1,1,"btn-delete");qa(0,1,"btn-delete_hover");qa(1,2,"btn-edit");qa(0,2,"btn-edit_hover");X.setStartPosition(171,188);X.setIconSize(24,24);qa(0,4,"metric-card-icon");X.setStartPosition(120,117);X.setIconSize(32,32);qa(0,0,"metric-card-tips-icon");X.setIconSize(16,16);X.setStartPosition(11,
-3);qa(5,9,"metric-icon-small");X.setStartPosition(0,151);X.setIconSize(170,98);qa(0,0,"icon-empty");X.setStartPosition(169,385);X.setIconSize(170,98);qa(0,0,"invalid-metric-card-icon");X.setStartPosition(210,335);X.setIconSize(73,48);qa(0,0,"no-licence-metric-card-icon");X.setStartPosition(169,229);X.setIconSize(13,13);qa(0,0,"sort");qa(0,1,"sort-desc");qa(0,2,"sort-asc");X.setStartPosition(0,0);X.setIconSize(20,20);wa.define(X,"table-view");qa(0,0,"table-view");wa.define(X,"table-view-on");qa(0,
0,"table-view-on");wa.define(X,"card-view");qa(0,0,"card-view");wa.define(X,"card-view-on");qa(0,0,"card-view-on");wa.define(X,"switch-button");qa(0,0,"icon-side-close");X.setStartPosition(33,0);X.setIconSize(17,14);qa(0,0,"icon-side-open")};var qa=function(wa,X,r){ta.registIcon(wa,X,r)},V=function(wa,X,r){qa(wa,X,r);qa(wa+1,X,r+"_hover")}};ia.Integration=new function(){var ta=new P,qa,V,wa;this.setParamPathPrefix=function(X){qa=X};this.getParamPathPrefix=function(){return qa};this.getRemoteImpl=
function(){return ta};this.setRemoteUrl=function(X){ta.setRemoteUrl(X)};this.setMetricSystemEntrance=function(X){V=X};this.getMetricSystemEntrance=function(){return V};this.setModelSetHomePageEntrance=function(X){wa=X};this.getModelSetHomePageEntrance=function(){return wa}}})();(function(){function P(){var c=this,w,A=new Va,N,m=!1,g,h;this.getJqUi=function(){w||(w=A.getJqUi(),w.addClass("metric-library-manage-toolbar"),c.protectedInitToolbarUi(w),N=ub(w,g,!0,f.get("searchContent","\u8bf7\u8f93\u5165\u641c\u7d22\u5185\u5bb9"),"metric-library-manage-toolbar-search-box"),u());return w};this.getSearchText=function(){var y="";N&&(y=$.trim(N.getText()));return y};this.setSearchListener=function(y){g=y};this.getIsTableView=function(){return m};this.setViewSwitchListener=function(y){h=
y};var u=function(){var y=$("<div class='metric-library-manage-card-view-icon'>");Sa.background(y,"card-view-on");y.attr("title",f.get("cardView","\u5361\u7247\u89c6\u56fe"));var B=$("<div class='metric-library-manage-toolbar-view-switch'>"),p=$("<div class='metric-library-manage-table-view-icon'>");Sa.background(p,"table-view");p.attr("title",f.get("tableView","\u5217\u8868\u89c6\u56fe"));B.append(y);B.append(p);p.on("click",function(){Sa.background(y,"card-view");Sa.background(p,"table-view-on");
!0!==m&&(m=!0,h&&h(m))});y.on("click",function(){Sa.background(y,"card-view-on");Sa.background(p,"table-view");!1!==m&&(m=!1,h&&h(m))});w.append(B)};this.clearSearchStatus=function(){N.clear();N.getJqUi().find("input").blur()};this.protectedMethod={appendButton:function(y,B,p,D){y=A.createButton(w,!1,y,p,D);y.setIconSetter(function(T,O){Sa.background(T,O)});y.setIconName(B);return y}}}function ia(){var c=this,w,A,N=new Q,m,g,h,u,y,B=!1,p,D,T,O,ea=!1;this.setGlobal=function(C){A=C};this.getGlobal=
function(){return A};this.setCatalogToolBar=function(C){m=C};this.setCatalogNoData=function(C){u=C};this.setContainSubLevel=function(C){B=C};this.getContainSubLevel=function(){return B};this.getJqUi=function(){if(!w){w=$("<div class='metric-library-catalog-container'>");var C=m.getJqUi();w.append(C);g=ub(w,K,!0,f.get("inputCatalogName","\u8bf7\u8f93\u5165\u76ee\u5f55\u540d\u79f0"),"metric-library-catalog-search-box");C=u.getJqUi();w.append(C);u.hide();y=new oa;y.setContainSubLevelListener(O);C=y.getUi();
w.append(C)}return w};this.setCatalogFolderNode=function(C){D=C};this.getCatalogFolderNode=function(){return D};this.setTreeNodeClickListener=function(C){T=C};this.setContainSubLevelListener=function(C){O=C};this.updateUi=function(C,ka,la){D&&0!==D.getChildren().length?ka?(u&&u.hide(),y.setContainChildStatus(!1,!0,!0),m.onlyShowAddChildCatalogBtn(),Wa&&m.hideAllButton()):(u&&u.hide(),y.setContainChildStatus(!0,B,!0),!Wa&&m.showAllButton()):(m.hideAllButton(),u&&u.show(),y.setContainChildStatus(!1,
B,!1));C&&(h?U(la):fa())};this.getCatalogTree=function(){return h};this.resetCatalogTree=function(){h&&h.getJqUi().remove();h=null};this.createNodeOnBranch=function(C,ka){ka=h.createLeafNode(ka);h.addChild(C,ka,C.getChildCount());U(ka)};this.createNodeOnLeaf=function(C){var ka=h.getSelectedNode(),la=ka.getParent();C=h.createLeafNode(C);for(var Ca=h.createBranch(ka.getUserObject()),Ba,ha=la.getAllChildren(),Z=0;Z<ha.length;Z++)if(ha[Z].getUserObject().getId()===ka.getUserObject().getId()){Ba=Z;break}la.removeChild(ka);
h.addChild(la,Ca,Ba);h.addChild(Ca,C,0);U(C)};this.removeCatalogLeafNode=function(){var C=h.getSelectedNode(),ka=C.getUserObject(),la=ka.getId(),Ca=ka.getParentNode().getChildren();for(ka=0;ka<Ca.length;ka++)if(Ca[ka].getId()===la){Ca.splice(ka,1);break}la=C.getParent();h.removeChild(la,C);C=la.getUserObject();if(0===la.getChildCount()&&Ta.ROOT_NODE_ID!==C.getId()){Ca=h.createLeafNode(C);var Ba=la.getParent(),ha=Ba.getAllChildren();for(ka=0;ka<ha.length;ka++)if(ha[ka].getUserObject().getId()===C.getId()){Ba.removeChild(la);
h.addChild(Ba,Ca,ka);break}}c.updateUi(!0,!0)};this.clearSearchStatus=function(){g.clear();g.getJqUi().find("input").blur()};this.resizeAfterObserver=function(C){if(!(u instanceof pb)){C=document.documentElement.clientHeight-C-20;var ka=m.getJqUi().height(),la=N.getJqUi().height(),Ca=g.getJqUi().height(),Ba=u.getJqUi().height();Ba=ka+la+Ca+Ba;C=0<C-Ba?(w.height()-Ba>>1)+ka+la+Ca:Ba+10;u.getJqUi().css({top:C})}};var fa=function(){h=new hb;h.addExpandedListener(function(ka,la){la.isExpanded()&&K($.trim(g.getText()).toLowerCase())});
h.setDataModel(D);h.setFunTreeNodeClick(ba);p=h.getRootGroup();var C=h.getJqUi();Aa.layoutCtrlWithLRTB(C,0,0,"100%",65,41,"auto");w.append(C)},U=function(C){C||(C=h.getRootGroup(),C.setUserObject(D));p=C;var ka=D.getChildren();h.setDataModel(D);h.setFunTreeNodeClick(ba);h.setSelectedNode([C]);h.setRootVisible(0<ka.length);h.getTree().expandToNode(C,!1);h.refresh()},ba=function(C,ka){var la=ka.getUserObject();C.getSelecteds()[0].getUserObject().getId()!==la.getId()&&(p=ka,T&&T(la))},K=function(C){if(h)if(""===
C){if(ea){var ka=h.getSelectedNode().getUserObject().getId();p&&(ka=p.getUserObject().getId());var la;h.getRootGroup().visiting(function(aa){if(aa.getUserObject().getId()===ka)return la=aa,!0});U(la);ea=!1}}else{ea=!0;var Ca=[],Ba=[];h.getRootGroup().deepFirstVisiting(function(aa){var I=aa.getUserObject();-1!==I.getName().toLowerCase().indexOf(C)&&(Ca.push(aa),Ba.push(I.getId()))},!1);for(var ha=0;ha<Ca.length;ha++){var Z=Ca[ha];F(Z,Ba);Ia(Z,Ba);h.getTree().expandToNode(Z,!1)}h.getTree().searchAllNodeUi(function(aa,
I){aa=aa.getUserObject();var sa=aa.getId();sa!==Ta.ROOT_NODE_ID&&(-1!==aa.getName().toLowerCase().indexOf(C)?I.show():-1===Ba.indexOf(sa)?I.hide():I.show())})}},F=function(C,ka,la){if(!C.isLeafNode()){C=C.getAllChildren();for(var Ca=0;Ca<C.length;Ca++){var Ba=C[Ca].getUserObject();-1!==Ba.getName().toLowerCase().indexOf(la)&&(ka.push(Ba.getId()),F(C[Ca],ka))}}},Ia=function(C,ka){C.getUserObject().getId()!==Ta.ROOT_NODE_ID&&(C=C.getParent(),ka.push(C.getUserObject().getId()),Ia(C,ka))}}function na(){var c,
w,A,N,m,g,h,u,y,B,p,D,T,O;this.getJqUi=function(){if(!c){c=$("<div class='metric-library-catalog-tool-bar'>");var fa=$("<div class='metric-library-catalog-text'>");fa.text(f.get("catalog","\u76ee\u5f55"));c.append(fa);u&&(w=ea("metric-library-catalog-add-btn",y,"add_dir",f.get("addDir","\u65b0\u589e\u540c\u7ea7")),A=ea("metric-library-catalog-add-btn",B,"add_subDir",f.get("addSubDir","\u65b0\u589e\u5b50\u7ea7")),N=ea("metric-library-catalog-edit-btn",p,"btn-edit",f.get("editCatalog","\u7f16\u8f91\u76ee\u5f55")),
m=ea("metric-library-catalog-del-btn",D,"btn-delete",f.get("deleteCatalog","\u5220\u9664\u76ee\u5f55")),g=ea("metric-library-catalog-move-up-btn",T,"move_up",f.get("moveUp","\u4e0a\u79fb")),h=ea("metric-library-catalog-move-down-btn",O,"move_down",f.get("moveDown","\u4e0b\u79fb")),c.append(w),c.append(A),c.append(N),c.append(m),c.append(g),c.append(h))}return c};this.setCatalogEditable=function(fa){u=fa};this.setCreateSameLevelCatalog=function(fa){y=fa};this.setCreateSubLevelCatalog=function(fa){B=
fa};this.setEditCatalog=function(fa){p=fa};this.setDeleteCatalog=function(fa){D=fa};this.setMoveUpCatalog=function(fa){T=fa};this.setMoveDownCatalog=function(fa){O=fa};this.hideAllButton=function(){u&&(w&&w.hide(),A&&A.hide(),N&&N.hide(),m&&m.hide(),g&&g.hide(),h&&h.hide())};this.showAllButton=function(){u&&(w&&w.css("right","140px")&&w.show(),A&&A.css("right","116px")&&A.show(),N&&N.show(),m&&m.show(),g&&g.show(),h&&h.show())};this.onlyShowAddChildCatalogBtn=function(){u&&(w&&w.hide(),N&&N.hide(),
m&&m.hide(),g&&g.hide(),h&&h.hide(),A&&A.css("right","20px")&&A.show())};this.hide=function(){c&&c.hide()};this.show=function(){c&&c.show()};var ea=function(fa,U,ba,K){var F=$("<div>");F.addClass(fa);F.on("click",U);Sa.backgroundWithHover(F,ba);F.attr("title",K);F.hide();return F}}function ra(){var c,w;this.getJqUi=function(){if(!c){c=$("<div class='metric-library-catalog-no-data'>");var A=f.get("addCatalog","\u65b0\u5efa\u76ee\u5f55");c.on("click",w);c.text("+"+A);c.attr("title",A);c.hide()}return c};
this.setCreateSubLevelCatalog=function(A){w=A};this.show=function(){c&&c.show()};this.hide=function(){c&&c.hide()}}function oa(){var c,w,A;this.getUi=function(){if(!c){c=$("<div class='metric-library-catalog-contain-sub-level'>");w=new M;w.setEnabled(!1);w.setChecked(!0);w.setText(f.get("containSubLevel","\u5305\u542b\u4e0b\u7ea7"));w.setCustomStyle("font-size","14px");var m=w.getJqUi();Aa.layoutCtrlWithLRTB(m,20,null,135,8,null);m.on("click",N);m.appendTo(c);c.hide()}return c};this.setContainChildStatus=
function(m,g,h){w.setEnabled(m);w.setChecked(g);h?c&&c.show():c&&c.hide()};this.setContainSubLevelListener=function(m){A=m};this.hide=function(){c&&c.hide()};this.show=function(){c&&c.show()};var N=function(){w.isEnabled()&&A&&A(w.isChecked())}}function ta(){var c=this,w,A,N=new Ua,m,g,h,u,y,B,p,D,T=!1,O=[],ea;this.setGlobal=function(U){A=U};this.getGlobal=function(){return A};this.setShowMetrics=function(U){O=U};this.getPaginationBar=function(){return N};this.setSelectedAll=function(U){T=U};this.getSelectedAll=
function(){return T};this.getJqUi=function(){w||fa();return w};this.clearSelectedMetric=function(){u&&u.setSelectedMetricsMap({});y&&y.setSelectedMetricsMap({})};this.setViewSelectedMetricsMap=function(U){u&&u.setSelectedMetricsMap(U);y&&y.setSelectedMetricsMap(U)};this.updateUi=function(){c.updateJumpLink();c.showMetrics(O)};this.showMetrics=function(U){0!==U.length?(p.hide(),B.hide()):""!==A.getSearchText()?(B.hide(),p.show()):(B.show(),p.hide());A.getIsTableView()?(c.showTableView(),u.setMetrics(U)):
(c.showCardView(),y.setMetrics(U));ea=D.getNonemptyFirstWide()};this.updateJumpLink=function(){g&&g.is(":visible")||(g=$("<span class='metric-library-guide-enter-qing-modeler'>"),g.text(f.get("openQingModeler","\u53bb\u8f7b\u5efa\u6a21 ")),h=$("<span class='metric-library-guide-create-metric'>"),h.text(f.get("createMetric","\u65b0\u5efa\u6307\u6807")+">>"),h.on("click",function(){var U=db.getModelSetHomePageEntrance();U&&U()}),m.append(h),m.append(g))};this.setCatalogContainerWidth=function(U){ea=
U};this.getCatalogContainerWidth=function(){return ea?ea:D.getNonemptyFirstWide()};this.getSelectedMetrics=function(){return(A.getIsTableView()?u:y).getSelectedMetrics()};this.getMetricTableView=function(){return u};this.getMetricCardView=function(){return y};this.showTableView=function(){y.hide();u.show()};this.showCardView=function(){u.hide();y.show()};this.setSplitPane=function(U){D=U};this.resizeAfterObserver=function(){D.setSecondSize(document.documentElement.clientWidth-D.getNonemptyFirstWide()-
20-8);A.getIsTableView()&&u.updateUi(!0)};var fa=function(){w=$("<div class='metric-library-metric-container'>");u=new V;u.setGlobal(A);var U=u.getJqUi();w.append(U);u.hide();y=new wa;y.setGlobal(A);U=y.getJqUi();w.append(U);y.show();B=new pb(f.get("noMetric","\u6682\u65e0\u6307\u6807"));U=B.getJqUi();w.append(U);U.hide();p=new qb;U=p.getJqUi();w.append(U);U.hide();U=new Xa;U.setCallbackImmediately(function(){document.body.style.height=document.documentElement.clientHeight+"px";c.resizeAfterObserver();
A.getCatalogContainer().resizeAfterObserver(45)});U.setDelay(250);U.observe()};this.updatePaginationBar=function(U){m||(N.protectedMethod.setTotalSelectedRowAndSelectedAllVisual(!Wa,!Wa),N.setJumpToPageListener(function(ba,K,F){Bb(ba,K,F,A.getCatalogContainer().getContainSubLevel(),c)}),N.setSelectedAllOrNotListener(function(ba,K){Cb(ba,K,A.getCatalogContainer(),c)}),m=N.getJqUi(),Aa.layoutCtrlWithLRTB(m,0,0,null,4,null,null),w.append(m));N.resetPaginationAndJumpToFirstPage(U)}}function qa(){var c=
this,w,A,N=[],m={};this.getJqUi=function(){w||(w=c.protectedInitViewUi());return w};this.setGlobal=function(g){A=g};this.show=function(){w&&w.show()};this.hide=function(){w&&w.hide()};this.setMetrics=function(g){N=g;c.updateUi()};this.getMetrics=function(){return N};this.setSelectedMetricsMap=function(g){m=g};this.getSelectedMetricsMap=function(){return m};this.getSelectedMetrics=function(){return Object.keys(m)};this.updateUi=function(g){c.protectedUpdateViewUi(w,g)};this.updateSelectedAll=function(g){c.protectedUpdateSelectedAllUi(g)};
this.protectedMethod={getGlobal:function(){return A},getMetrics:function(){return N},getSelectedMetricsMap:function(){return m},doHighLightText:function(g,h,u){if(g&&h&&u){u=u.toUpperCase();for(var y=h.toUpperCase(),B=y.split(u),p=u.length,D=0;D<B.length;D++){var T=y.indexOf(B[D]),O=h.substr(0,B[D].length);T+=B[D].length;var ea=y.length-T;y=y.substr(T,ea);h=h.substr(T,ea);T=$("<span>");T.text(O);T.appendTo(g);D!=B.length-1&&1<B.length&&(T=y.indexOf(u),O=h.substr(T,p),T+=p,ea=y.length-T,y=y.substr(T,
ea),h=h.substr(T,ea),T=$("<span>"),T.text(O),T.css("color","red"),T.clone().appendTo(g))}}},getDisplayExprJqUi:function(g){if(!g)return $("<span>");var h=$("<span>"),u=g.getExprSegments();g=g.getDisplayExpr();h.attr("title",g);for(g=0;g<u.length;g++){var y=u[g].getTextSegment();y=$("<span>").text(y.getText()).css("color",y.getColor());h.append(y)}return h}}}function V(){function c(){var S=this,a,e,l;this.reInit=function(){a=null;k()};this.getJqIcon=function(){return a};this.setOrder=function(t){e=
t;k()};this.getOrder=function(){return e};this.setColIdx=function(t){l=t};this.getColIdx=function(){return l};var k=function(){z();a.addClass("metric-library-add-metric-sort-icon");a.on("click",function(){e?e==c.ASC_ORDER?e=c.DESC_ORDER:(O=null,a.remove()):(O=S,e=c.ASC_ORDER);z();T&&T[0]!==a[0]&&T.remove();T=a;Ka()})},z=function(){switch(e){case c.ASC_ORDER:var t="sort-asc";break;case c.DESC_ORDER:t="sort-desc";break;default:t="sort"}!a&&(a=$("<div>"));a.attr("title","\u6392\u5e8f");Sa.background(a,
t)}}function w(){this.getTailBlankForDragging=function(){return-1};this.isRowDraggable=function(S,a){return!1};this.isColumnDraggable=function(S,a){return S.getColumnsCount()==a+1?!1:!0};this.getMinRowHeightLimited=function(S,a){return 3};this.getMinColumnWidthLimited=function(S,a){return 4};this.rowDraggedAction=function(S,a,e){var l=S.isSyncUIWhenModelChanged();S.setSyncUIWhenModelChanged(!0);a=S.getRow(a);a.setHeight(a.getHeight()+e);S.setSyncUIWhenModelChanged(l)};this.setMinColumnWidth=function(S){};
this.columnDraggedAction=function(S,a,e){var l=S.isSyncUIWhenModelChanged();S.setSyncUIWhenModelChanged(!0);a=S.getColumn(a);a.setWidth(a.getWidth()+e);S.setSyncUIWhenModelChanged(l);u&&u.hasSelected()&&(S=u.getSelected(),u.removeAllSelecteds(),S&&u.addSelected(S),S=S.getRowIdx()-ja.getHeadRowCount(),g.scrollCellVisible(S,0,!1))}}function A(S){KTDefaultCellRender.call(this,S);var a=this,e=new Ma,l=this.paintCellUI;this.paintCellUI=function(z,t){var d=a.getCurrentRowIdx(),b=a.getCurrentRow(),v=a.getCurrentColIdx(),
x=b.getUserObject();b=m.getGlobal().getSearchText();var G=x&&x.getExpr()&&x.hasLicence(),n=new W;n.setFormatString("yyyy-MM-dd HH:mm:ss");var J=function(q){var ma=m.getSelectedMetricsMap(),xa=x.getId();q?ma[xa]=xa:(delete ma[xa],m.getGlobal().getMetricContainer().setSelectedAll(!1));ma=Object.keys(ma);m.getGlobal().getMetricContainer().getPaginationBar().refreshSelectedRowTotal(ma.length);h[xa].setChecked(q);q=!0;xa=Object.keys(h);for(ma=0;ma<xa.length;ma++)if(!h[xa[ma]].isChecked()){q=!1;break}y.setChecked(q)};
$(z).on("click",function(q){d<ja.getHeadRowCount()||Aa.isDescendent(q.target,h[x.getId()].getJqUi()[0])||(q=h[x.getId()].isChecked(),J(!q))});if(d<ja.getHeadRowCount())(l(z,t),0!==v||1!==d||Wa)?O&&O.getColIdx()===v&&1===d?(O.reInit(),b=O.getJqIcon(),b.appendTo($(z)),b.data("sortModel",O),T=b):v===C&&1===d&&(b=new Y,b.setIconType(Y.ICON_TYPE_QUESTION),b.setTipsText(f.get("pathTips",'"\u8def\u5f84\u683c\u5f0f\u4e3a\uff1a\u6a21\u578b\u96c6\u540d\u79f0/\u76ee\u5f55\u540d\u79f0/\u6a21\u578b\u540d\u79f0\u3002\u76ee\u5f55\u53ef\u80fd\u5b58\u5728\u591a\u5c42\u7ea7\uff0c\u5404\u5c42\u7ea7\u4e4b\u95f4\u7531\u201c/\u201d\u5206\u9694\u3002"')),
b.setTipsSize(310,60),b=b.getJqUi(),Aa.layoutCtrlWithLRTB(b,($(z).outerWidth()>>1)+((new cb).measureWidth(f.get("path","\u8def\u5f84"))>>1)+7,null,null,6,null,null),b.appendTo($(z))):(b=y&&y.isChecked(),y=new M,y.setChecked(m.getGlobal().getMetricContainer().getSelectedAll()||b),y.addCheckedListener(function(q,ma){if(ma){(q=q.isChecked())||m.getGlobal().getMetricContainer().setSelectedAll(!1);ma=m.getSelectedMetricsMap();for(var xa=Object.keys(h),Na=0;Na<xa.length;Na++)h[xa[Na]].setChecked(q),q?ma[xa[Na]]=
xa[Na]:delete ma[xa[Na]];q=Object.keys(ma);m.getGlobal().getMetricContainer().getPaginationBar().refreshSelectedRowTotal(q.length)}}),b=y.getJqUi(),Aa.layoutCtrlCenterAlign(b,14),Aa.layoutCtrlMiddleAlign(b,22),$(z).append(b));else if(0!==v||Wa)if(v===fa)n=$("<div class='metric-library-table-view-cell'>"),G=x.getNumber(),n.attr("title",G),""!==b?m.doHighLightText(n,G,b):n.text(G),$(z).append(n);else if(v===U)n=$("<div class='metric-library-table-view-cell'>"),x.isPreset()&&(t=$("<div class='metric-table-item-preset'>"),
t.text(f.get("preset","\u9884\u7f6e")),$(z).append(t)),t=x.getMetricName(),n.attr("title",t),G=k(G,x),$(z).append(G),n.css({display:"inline-block"}),""!==b?m.doHighLightText(n,t,b):n.text(t),$(z).append(n),$(z).css({display:"flex","align-items":"center"});else if(v===ba)G&&(n=$("<div class='metric-library-table-view-cell'>"),G=x.getDesc(),n.attr("title",G),""!==b?m.doHighLightText(n,G,b):n.text(G),$(z).append(n));else if(v===K)G&&(b=x.getExpr(),b=m.getDisplayExprJqUi(b),b.addClass("metric-library-table-view-cell"),
Aa.layoutCtrlWithLRTB(b,0,0,null,null,null,40),$(z).append(b));else if(v===Ca){if(G&&(b=$("<div class='metric-library-table-view-cell'>"),n=x.getDimension(),b.attr("title",n),b.text(n),$(z).append(b),!x.isDigest())){b.addClass("metric-library-table-dimension-info");var pa=$("<div class='metric-library-table-dimension-detail-info'>");pa.text(f.get("dimensionDetailInfo","\u8be6\u60c5>"));pa.on("click",function(q){q.stopPropagation();e.setSuggestedSize(265,125);e.mounting(pa);x.getWholeDimension()?e.setText(x.getWholeDimension()):
(q=m.getGlobal().createFacade(function(ma){x.setWholeDimension(ma);e.setText(x.getWholeDimension())}),q.setBlockingJqUi($(g.getUI())),q.loadWholeDimensionInfo(x.getModelId()))});$(z).append(pa)}}else if(v===Ba){if(G){b=$("<div class='metric-library-table-view-cell'>");n="";G=x.getFilterItems();for(t=0;t<G.length;t++)n+=G[t].getDisplayText(),n+="\r\n";b.attr("title",n);b.text(n);$(z).append(b)}}else v===C?(b=$("<div class='metric-library-table-view-cell'>"),n=x.getPath(),b.attr("title",n),b.text(n),
$(z).append(b)):v===Ia?G&&(n=$("<div class='metric-library-table-view-cell'>"),G=x.getMetricCreator(),n.attr("title",G),""!==b?m.doHighLightText(n,G,b):n.text(G),$(z).append(n)):v===ka?G&&(n=$("<div class='metric-library-table-view-cell'>"),G=x.getAddPeople(),n.attr("title",G),""!==b?m.doHighLightText(n,G,b):n.text(G),$(z).append(n)):v===la?G&&(b=$("<div class='metric-library-table-view-cell'>"),G=x.getAddTime(),G=n.format(G),b.text(G),b.attr("title",G),$(z).append(b)):v===F&&G&&(b=$("<div class='metric-library-table-view-cell'>"),
G=x.getDataUpdateTime(),G=n.format(G),b.text(G),b.attr("title",G),$(z).append(b));else b=m.getSelectedMetricsMap(),n=x.getId(),G=new M,G.setUserObject(x),G.setChecked(m.getGlobal().getMetricContainer().getSelectedAll()||void 0!==b[n]&&null!==b[n]),G.addCheckedListener(function(q,ma){ma&&(q=q.isChecked(),J(q))}),h[n]=G,b=G.getJqUi(),Aa.layoutCtrlCenterAlign(b,14),Aa.layoutCtrlWithLRTB(b,null,null,16,10,null,null),$(z).append(b)};var k=function(z,t){z?(z=$("<div>"),Sa.background(z,"metric-icon-small"),
z.css({height:"16px",width:"16px",margin:"0 2px","flex-shrink":"0"})):(z=Za.createWarning(),t=t.hasLicence()?f.get("metricTableInValidTips","\u6307\u6807\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664"):f.get("noLicenceTips","\u5f53\u524d\u7cfb\u7edf\u6ca1\u6709\u3010\u8f7b\u5efa\u6a21\u3011\u6a21\u5757\u7684\u4f7f\u7528\u8bb8\u53ef\uff0c\u8bf7\u4e0e\u7cfb\u7edf\u7ba1\u7406\u5458\u8054\u7cfb"),z.attr("title",t));return z}}qa.call(this);var N=this.protectedMethod,m=N,g,h={},u,y,B,p,D=[],T,O,ea,fa=
1,U=2,ba=3,K=4,F=5,Ia=6,C=7,ka=8,la=9,Ca=10,Ba=11,ha,Z=[],aa=[{width:80,text:f.get("code","\u7f16\u7801")},{width:100,text:f.get("metricName","\u540d\u79f0")},{width:150,text:f.get("metricDesc","\u63cf\u8ff0")},{width:150,text:f.get("expr","\u8868\u8fbe\u5f0f")},{width:120,text:f.get("dataUpdateTime","\u6570\u636e\u66f4\u65b0\u65f6\u95f4")},{width:100,text:f.get("metricCreator","\u6307\u6807\u521b\u5efa\u4eba")},{width:100,text:f.get("path","\u8def\u5f84")},{width:120,text:f.get("addPeople","\u6dfb\u52a0\u4eba")},
{width:120,text:f.get("addTime","\u6dfb\u52a0\u65f6\u95f4")},{width:120,text:f.get("dimension","\u7ef4\u5ea6")},{width:120,text:f.get("filterCondition","\u8fc7\u6ee4\u6761\u4ef6")}],I=[{width:50},{width:80,text:f.get("code","\u7f16\u7801")},{width:100,text:f.get("metricName","\u540d\u79f0")},{width:150,text:f.get("metricDesc","\u63cf\u8ff0")},{width:150,text:f.get("expr","\u8868\u8fbe\u5f0f")},{width:120,text:f.get("dataUpdateTime","\u6570\u636e\u66f4\u65b0\u65f6\u95f4")},{width:100,text:f.get("metricCreator",
"\u6307\u6807\u521b\u5efa\u4eba")},{width:100,text:f.get("path","\u8def\u5f84")},{width:120,text:f.get("addPeople","\u6dfb\u52a0\u4eba")},{width:120,text:f.get("addTime","\u6dfb\u52a0\u65f6\u95f4")},{width:120,text:f.get("dimension","\u7ef4\u5ea6")},{width:120,text:f.get("filterCondition","\u8fc7\u6ee4\u6761\u4ef6")}];this.protectedInitViewUi=function(){ea=$("<div class='metric-library-table-view'>");g=ja.createTable();g.setDraggableAdjusting(!0,3,0,new w);u=g.getSelectionModel();g.setColumnFitVisibleWidth(!1);
g.setScrollerVisible("auto");var S=$(g.getUI());ja.setupSingleRowSelection(g);g.setCellAcrossListener(Ga);Aa.layoutCtrlWithLRTB(S,5,5,null,0,5,null);ea.append(S);return ea};this.setScrollerVisible=function(S){g.setScrollerVisible(S)};this.setHeadRowMap=function(S){B=S};this.protectedUpdateViewUi=function(S,a){a||(h={});Ka()};this.relayoutViews=function(){g&&g.relayoutViews()};this.protectedUpdateSelectedAllUi=function(S){y.setChecked(S);$.each(h,function(a,e){e.setChecked(S)})};var sa=function(S){ja.clear(g);
Wa?(B=aa,fa=0,U=1,ba=2,K=3,F=4,Ia=5,C=6,ka=7,la=8,Ca=9,Ba=10):(B=I,fa=1,U=2,ba=3,K=4,F=5,Ia=6,C=7,ka=8,la=9,Ca=10,Ba=11);ha=[fa,U,la];var a=ea.width()-10;Z=Wa?[.08*a,.1*a,.18*a,.15*a,.08*a,.07*a,.19*a,.07*a,.08*a,.11*a,.11*a]:[.03*a,.08*a,.1*a,.17*a,.14*a,.08*a,.07*a,.18*a,.07*a,.08*a,.11*a,.11*a];var e=B.length;g.addColumns(e);var l=ja.createHeadRow(g);l.setHeight(28);for(a=0;a<e;a++)g.getColumn(a).setWidth(Z[a]),B[a].text&&l.getCell(a).setValue(B[a].text);a=new A(g);a.setEllipsis(!0);a.setOutsideVisible(!1);
g.setCellRender(a);e=new KTBorderStyle;e.setBottomBorderWidth(1);e.setBottomBorderPen("solid");e.setBottomBorderColor("#e5e5e5");for(a=0;a<S.length;a++){l=S[a];var k=ja.createRow(g,!1);k.setBorder(e);k.setUserObject(l);k.setHeight(40)}ja.refresh(g);y&&y.setChecked(Pa())},Ga=function(S,a,e,l){S=S&&0<S.length?S[0]:null;if(p!==S){if(p)for(var k=0;k<D.length;k++){var z=D[k][0],t=z["qdm-bg"];delete z["qdm-bg"];t&&$(z).css("background-color",t)}k=$(p);k=Da(k);k.removeClass("metric-library-add-metric-sort-icon_hover");
(z=k.data("sortModel"))&&!z.getOrder()&&k.remove();if(S&&a>=ja.getHeadRowCount())for(e=g.getColumnsCount(),k=0;k<e;k++)z=l(a,k),z[0]["qdm-bg"]=z.css("background-color"),z.css("background-color","rgb(240, 240, 240)"),D.push(z);else-1<ha.indexOf(e)?(a=Da($(S)),0===a.length&&(a=$(S),l=new c,l.setOrder(null),l.setColIdx(e),e=l.getJqIcon(),e.appendTo(a),e.data("sortModel",l),a=e),a.addClass("metric-library-add-metric-sort-icon_hover")):(p=null,D=[]);p=S}},Da=function(S){return S.find(".metric-library-add-metric-sort-icon")},
Ka=function(){if(O){var S=O.getOrder()===c.ASC_ORDER,a=[].concat(N.getMetrics());a.sort($a(S));for(var e=[],l=[],k=[],z=[],t=[],d=0;d<a.length;d++){var b=La(a[d]);b||0===b?/^\d+?.*$/.test(b)?(l=l||[],l.push(a[d])):/^[a-zA-Z]+?.*$/.test(b)?(k=k||[],k.push(a[d])):/^[\u4e00-\u9fa5]+?.*$/.test(b)?(z=z||[],z.push(a[d])):(t=t||[],t.push(a[d])):(e=e||[],e.push(a[d]))}a=S?[].concat(l||[]).concat(k||[]).concat(z||[]).concat(t||[]).concat(e||[]):[].concat(e||[]).concat(t||[]).concat(z||[]).concat(k||[]).concat(l||
[]);sa(a)}else sa(N.getMetrics())},$a=function(S){return function(a,e){a=La(a);e=La(e);var l=a-e;isNaN(l)&&(l=String(a).localeCompare(String(e),"zh-CN",{sensitivity:"accent"}));return S?l:-l}},La=function(S){return O.getColIdx()===fa?S.getNumber():O.getColIdx()===U?S.getMetricName():S.getAddTime()};c.DESC_ORDER="desc";c.ASC_ORDER="asc";var Pa=function(){var S=Object.keys(h);if(0===S.length)return!1;for(var a=0;a<S.length;a++)if(!h[S[a]].isChecked())return!1;return!0}}function wa(){function c(m){var g,
h;this.getJqUi=function(){g||u();return g};this.setSelected=function(B){h&&h.setChecked(B)};this.getSelected=function(){return h.isChecked()};this.setSelectedStatus=function(B){B?g.addClass("metric-card-item-selected"):g.removeClass("metric-card-item-selected")};this.getMetric=function(){return m};var u=function(){var B=w.getGlobal().getSearchText();g=$("<div class='metric-library-metric-card-item'>");g.on("click",function(K){A.showClickStatus(m)});var p=$("<div class='metric-card-item-icon'>");Sa.background(p,
"metric-card-icon");var D=$("<div class='metric-card-item-name'>"),T=m.getMetricName(),O=$("<span>");O.appendTo(D);D.attr("title",T);""!==B?w.doHighLightText(O,T,B):O.text(T);m.isPreset()&&(O=$("<div class='metric-item-preset'>"),Aa.layoutCtrl(O,15,16,null,null),O.text(f.get("preset","\u9884\u7f6e")),g.append(O),p.css("left","58px"),D.css("left","97px"));if(!Wa){h=new M;var ea=m.getId(),fa=w.getSelectedMetricsMap();h.setChecked(w.getGlobal().getMetricContainer().getSelectedAll()||void 0!==fa[ea]&&
null!==fa[ea]);O=h.getJqUi();Aa.layoutCtrlWithLRTB(O,null,15,15,16,null,null);h.addCheckedListener(function(K,F){F&&(fa=w.getSelectedMetricsMap(),h.setChecked(K.isChecked()),K.isChecked()?fa[ea]=ea:(delete fa[ea],w.getGlobal().getMetricContainer().setSelectedAll(!1)),K=Object.keys(fa),w.getGlobal().getMetricContainer().getPaginationBar().refreshSelectedRowTotal(K.length))});g.append(O)}O=function(K,F,Ia){var C=$("<div>");C.addClass(K);C.attr("title",Ia);""!==B?(C.text(F),w.doHighLightText(C,Ia,B)):
C.text(F+" "+Ia);return C};g.append(p);g.append(D);p=new Y;p.setIconType(Y.ICON_TYPE_INFO);p.setTipsSize(310,290);p.setTipsHtml(y(m));p=p.getJqUi();Aa.layoutCtrlWithLRTB(p,null,Wa?15:45,null,19,null,null);var U=m.getNumber(),ba=function(){var K=$("<span>"),F="("+U+")";""!==B?w.doHighLightText(K,F,B):K.text(F);K.css({"margin-left":"10px",color:"#C0C0C0"});K.appendTo(D);D.attr("title",T+F);F=$("<div>");if(m.hasLicence()){K=f.get("metricCardInValidTips","\u8be5\u6307\u6807\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664");
var Ia="invalid-metric-card-icon";Aa.layoutCtrlWithLRTB(F,75,0,150,45,0,93)}else K=f.get("noLicenceTips","\u5f53\u524d\u7cfb\u7edf\u6ca1\u6709\u3010\u8f7b\u5efa\u6a21\u3011\u6a21\u5757\u7684\u4f7f\u7528\u8bb8\u53ef\uff0c\u8bf7\u4e0e\u7cfb\u7edf\u7ba1\u7406\u5458\u8054\u7cfb"),Ia="no-licence-metric-card-icon",Aa.layoutCtrlWithLRTB(F,110,0,73,70,0,48);Sa.background(F,Ia);Ia=$("<div class='metric-card-item-invalid-text'>");Ia.text(K);g.append(F);g.append(Ia)};m&&m.getExpr()&&m.hasLicence()?(g.append(O("metric-card-item-code",
f.get("tipsCode","\u7f16\u7801\uff1a"),U)),g.append(O("metric-card-item-desc",f.get("tipsDesc","\u63cf\u8ff0\uff1a"),m.getDesc())),g.append(O("metric-card-item-expr",f.get("tipsExpr","\u8868\u8fbe\u5f0f\uff1a"),"").append(w.getDisplayExprJqUi(m.getExpr()))),g.append(p)):ba();return g},y=function(B){var p=$("<div>");p.css("overflow","auto hidden");Aa.layoutCtrl(p,null,null,280,260);var D=function(ea,fa){var U=$("<div class='metric-card-item-tips-info'>"),ba=$("<span>");ba.text(ea);ea=$("<span>");ea.text(fa);
U.attr("title",fa);U.append(ba);U.append(ea);return U};p.append(D(f.get("tipsCode","\u7f16\u7801\uff1a"),B.getNumber()));p.append(D(f.get("tipsName","\u540d\u79f0\uff1a"),B.getMetricName()));p.append(D(f.get("tipsDesc","\u63cf\u8ff0\uff1a"),B.getDesc()));p.append(D(f.get("tipsExpr","\u8868\u8fbe\u5f0f\uff1a"),"").append(w.getDisplayExprJqUi(m.getExpr())));var T=new W;T.setFormatString("yyyy/MM/dd HH:mm:ss");var O=T.format(B.getDataUpdateTime());p.append(D(f.get("tipsDataUpdateTime","\u6570\u636e\u66f4\u65b0\u65f6\u95f4\uff1a"),
O));p.append(D(f.get("tipsMetricCreator","\u6307\u6807\u521b\u5efa\u4eba\uff1a"),B.getMetricCreator()));p.append(D(f.get("tipsPath","\u8def\u5f84\uff1a"),B.getPath()));p.append(D(f.get("tipsAddPeople","\u6dfb\u52a0\u4eba\uff1a"),B.getAddPeople()));T=T.format(B.getAddTime());p.append(D(f.get("tipsAddTime","\u6dfb\u52a0\u65f6\u95f4\uff1a"),T));p.append(D(f.get("tipsDimension","\u7ef4\u5ea6\uff1a"),B.getDimension()));T="";B=B.getFilterItems();for(O=0;O<B.length;O++)T+=B[O].getDisplayText(),T+="\r\n";
p.append(D(f.get("tipsFilterCondition","\u8fc7\u6ee4\u6761\u4ef6\uff1a"),T));return p}}qa.call(this);var w=this.protectedMethod,A=this,N=[];this.protectedInitViewUi=function(){return $("<div class='metric-library-card-view'>")};this.protectedUpdateSelectedAllUi=function(m){N.forEach(function(g){g.setSelected(m)})};this.protectedUpdateViewUi=function(m){m.empty();N=[];for(var g=w.getMetrics(),h=$(document.createDocumentFragment()),u=0;u<g.length;u++){var y=new c(g[u]);N.push(y);y.getJqUi().appendTo(h)}h.appendTo(m)};
this.showClickStatus=function(m){N.forEach(function(g){g.getMetric().getId()===m.getId()?g.setSelectedStatus(!0):g.setSelectedStatus(!1)})}}function X(c){va.call(this);var w=this,A=this.protectedMethod,N,m,g,h;(function(){A.setTitle(f.get("addMetric","\u6dfb\u52a0\u6307\u6807"));var u=.8*c.getMetricContainer().getJqUi().width();u=Math.max(1250,u);w.setSize(u,700);A.setSelectable(!0);A.setContentPaneCreator(function(){m=$("<div>");N=new ya;N.setContainer(m);N.setGlobal(c);N.loadMetric();return m});
A.setFooterPaneCreator(function(B){var p=new L(f.get("confirm","\u786e\u5b9a"));p.setHighlight(!0);var D=p.getJqUi();D.addClass("sa-ctrl-dialog-footer-ok");D.appendTo(B);p.addActionListener(function(T){h=N.getSelectedMetric();0<h.length?c.createFacade(function(O){var ea=new vb;ea.fromJsonObject(O);y(ea)},function(O){(O=Fa.OperateExceptionPrompt.getOperateExceptionDetail(O))?(A.destroy(),O.showPrompt(),O=!0):O=!1;return O}).addMetricToSystem(h,Qa,c.getSelectedCatalog().getId()):A.destroy()});p=new L(f.get("cancel",
"\u53d6\u6d88"));p.setHighlight(!1);D=p.getJqUi();D.addClass("sa-ctrl-dialog-footer-cancel");D.appendTo(B);p.addActionListener(function(T){A.destroy();return!0})});var y=function(B){if(B.isSuccess())g&&g(!0),A.destroy();else{B=B.getInvalidCase();var p=B.getFailType();if(p==ib.FAIL_TYPE_INVALID_METRIC){var D=B.getFailMap(),T=function(K){for(var F=0;F<h.length;F++)if(K==h[F].getId())return h[F]},O=function(K){return K.getName()+"("+K.getNumber()+")"},ea=Object.keys(D);B=0;for(var fa="",U=0;U<ea.length;U++){p=
ea[U];var ba=D[p];B+=ba.length;a:{switch(p){case lb.FAIL_TYPE_NOT_EXIST:p=f.get("metricNotExist","\u6307\u6807\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\uff1a");break a;case lb.FAIL_TYPE_NO_DATA_AUTH:p=f.get("metricNoAuth","\u6307\u6807\u65e0\u6570\u636e\u6743\u9650\uff1a");break a;case lb.FAIL_TYPE_IS_ADDED:p=f.get("metricIsExist","\u6307\u6807\u5df2\u5b58\u5728\uff1a");break a}p=void 0}fa+=U+1+"\u3001";fa+=p;fa+=O(T(ba[0]));for(p=1;p<ba.length;p++)fa+="\u3001",fa+=O(T(ba[p]));fa+="\r\n"}p=
E.createFeedbackDialog();p.setMsgImageType(E.MSG_WARNING);p.setTitle(f.get("operatingTips","\u64cd\u4f5c\u63d0\u793a"));D=f.get("someFail","\u5171#1\u4e2a\u6307\u6807\uff0c\u6dfb\u52a0\u6210\u529f#2\u4e2a\uff0c\u5931\u8d25#3\u4e2a\u3002");D=D.replace("#1",h.length+"");D=D.replace("#2",h.length-B+"");D=D.replace("#3",B+"");p.setMessage(D);p.setDetail(fa);p.setOptionType(E.OPTION_OK);p.setButtonText(E.RETURN_OK,f.get("iSee","\u6211\u77e5\u9053\u4e86"));A.destroy();p.showDialog();g&&g(!1)}else{B=f.get("addFail",
"\u6dfb\u52a0\u5931\u8d25\u3002");switch(p){case ib.FAIL_TYPE_SYSTEM_NOTEXIST:B+=f.get("systemNotExist","\u201c#1\u201d\u6307\u6807\u4f53\u7cfb\u4e0d\u5b58\u5728\u3002").replace("#1",eb);break;case ib.FAIL_TYPE_CATALOG_NOTEXIST:B+=f.get("catalogNotExist","\u201c#1\u201d\u76ee\u5f55\u4e0d\u5b58\u5728\u3002").replace("#1",c.getSelectedCatalog().getName());break;case ib.FAIL_TYPE_SYSTEM_WITHOUT_AUTH:B+=f.get("operateWithoutAuth","\u60a8\u6ca1\u6709\u6743\u9650\u64cd\u4f5c\u8be5\u6307\u6807\u4f53\u7cfb\u3002")}A.destroy();
c.getMessageCurtain().showPrompt(B,2E3)}}};A.setClosingAction(function(B){})})();this.setAddSuccessCallback=function(u){g=u};this.show=function(){w.showDialog();m.css("left","0px");m.css("right","0px");m.css("top","0px")}}function r(){function c(d){KTDefaultCellRender.call(this,d);var b=this,v=this.paintCellUI;this.paintCellUI=function(n,J){var pa=b.getCurrentRowIdx(),q=b.getCurrentRow(),ma=b.getCurrentColIdx(),xa=q.getUserObject();q=new W;q.setFormatString("yyyy-MM-dd HH:mm:ss");b.setPaddingHV(8,
1);if(pa<ja.getHeadRowCount())v(n,J),0===ma&&1===pa?(T=new M,l(),T.addCheckedListener(function(Na,Ja){if(Ja){Na=Na.isChecked();for(Ja=0;Ja<K.length;Ja++){var ab=K[Ja];if(!a(ab)){var bb=ka[ab.getId()];bb&&bb.setChecked(Na);Na&&S(ab)||(Na?e(ab):A.protectedDeleteSelectedMetric(ab))}}D.refreshSelectedRowTotal(C);La()}}),q=T.getJqUi(),Aa.layoutCtrl(q,12,0,14,18),q.appendTo(n)):fa&&fa.getColIdx()===ma&&1===pa?(fa.reInit(),q=fa.getJqIcon(),q.appendTo($(n)),q.data("sortModel",fa),h=q):ma===la[r.SOURCE_IDX_KEY]&&
1===pa&&(q=new Y,q.setIconType(Y.ICON_TYPE_QUESTION),q.setTipsText(f.get("pathTips",'"\u8def\u5f84\u683c\u5f0f\u4e3a\uff1a\u6a21\u578b\u96c6\u540d\u79f0/\u76ee\u5f55\u540d\u79f0/\u6a21\u578b\u540d\u79f0\u3002\u76ee\u5f55\u53ef\u80fd\u5b58\u5728\u591a\u5c42\u7ea7\uff0c\u5404\u5c42\u7ea7\u4e4b\u95f4\u7531\u201c/\u201d\u5206\u9694\u3002"')),q.setTipsSize(310,60),q=q.getJqUi(),Aa.layoutCtrlWithLRTB(q,($(n).outerWidth()>>1)+((new cb).measureWidth(f.get("path","\u8def\u5f84"))>>1)+7,null,null,3,null,null),
q.appendTo($(n)));else if(ma===la[r.CHECKBOX_IDX_KEY])J=new M,q=J.getJqUi(),a(xa)?(pa=!0,J.setEnabled(!1),q.attr("title",f.get("metricExist","\u8be5\u6307\u6807\u5df2\u88ab\u6dfb\u52a0\u5230\u5f53\u524d\u6307\u6807\u4f53\u7cfb\u7684\u76ee\u5f55\u4e2d\u3002"))):(pa=S(xa),ka[xa.getId()]=J,J.setUserObject(xa),J.addCheckedListener(function(Na,Ja){Ja&&(Na.isChecked()?e(xa):A.protectedDeleteSelectedMetric(xa),D.refreshSelectedRowTotal(C),l(),La())})),J.setChecked(pa),Aa.layoutCtrl(q,12,4,14,18),q.appendTo(n);
else if(ma===la[r.METRIC_CODE_IDX_KEY])q=$("<div class='metric-library-add-metric-cell-item'>"),J=xa.getNumber(),Ia&&""!=$.trim(ea.getText())?G(q,J,$.trim(ea.getText())):q.text(J),q.attr("title",J),$(n).append(q);else if(ma===la[r.METRIC_NAME_IDX_KEY])q=$("<div class='metric-library-add-metric-cell-item'>"),J=$("<span>"),J.addClass("metric-library-add-metric-cell-name"),pa=xa.getName(),Ia&&""!=$.trim(ea.getText())?G(J,pa,$.trim(ea.getText())):J.text(pa),q.attr("title",pa),pa=$("<span>"),Sa.background(pa,
"metric-icon-small"),pa.css({"padding-right":"16px"}),pa.appendTo(q),J.appendTo(q),$(n).append(q);else if(ma===la[r.METRIC_DESC_IDX_KEY])q=$("<div class='metric-library-add-metric-cell-item'>"),J=xa.getDesc(),q.attr("title",J),Ia&&""!=$.trim(ea.getText())?G(q,J,$.trim(ea.getText())):q.text(J),$(n).append(q);else if(ma===la[r.EXPR_IDX_KEY])q=xa.getExpr().getDisplayExprJqUi(),q.addClass("metric-library-add-metric-cell-item"),Aa.layoutCtrlWithLRTB(q,0,0,null,null,null,28),J=xa.getExpr().getDisplayExpr(),
q.attr("title",J),$(n).append(q);else if(ma===la[r.DIMENSION_IDX_KEY])q=$("<span class='metric-library-add-metric-cell-item'>"),J=xa.getDimension(),Aa.layoutCtrlWithLRTB(q,0,0,null,null,null,28),xa.isDigest()&&x(xa,q,n),q.attr("title",J),q.text(J),$(n).append(q);else if(ma===la[r.SOURCE_IDX_KEY])q=$("<div class='metric-library-add-metric-cell-item'>"),J=xa.getPath(),q.attr("title",J),q.text(J),$(n).append(q);else if(ma===la[r.FILTER_IDX_KEY]){q=$("<div class='metric-library-add-metric-cell-item'>");
J="";pa=xa.getFilterItems();for(ma=0;ma<pa.length;ma++)J+=pa[ma].getDisplayText(),J+="\r\n";q.attr("title",J);q.text(J);$(n).append(q)}else ma===la[r.CREATOR_IDX_KEY]?(q=xa.getCreator(),J=$("<div class='metric-library-add-metric-cell-item'>"),J.text(q),J.attr("title",q),$(n).append(J)):ma===la[r.DATA_UPDATE_TIME_IDX_KEY]&&(J=$("<div class='metric-library-add-metric-cell-item'>"),pa=xa.getDataUpdateTime())&&(pa=q.format(pa),J.text(pa),J.attr("title",pa),$(n).append(J))};var x=function(n,J,pa){var q=
$("<span>");q.text(f.get("dimensionDetailInfo","\u8be6\u60c5>"));q.addClass("metric-library-add-metric-cell-detail");q.on("click",function(){var ma=q.data("tips");ma||(ma=new Ma,ma.setSuggestedSize(265,100),ma.mounting(q),q.data("tips",ma));n.getWholeDimension()?ma.setText(n.getWholeDimension()):B.createFacade(function(xa){ma.setText(xa);n.setWholeDimension(xa)}).loadWholeDimensionInfo(n.getModelId())});J.css("right","32px");q.appendTo($(pa))},G=function(n,J,pa){if(n&&J&&pa){pa=pa.toUpperCase();for(var q=
J.toUpperCase(),ma=q.split(pa),xa=pa.length,Na=0;Na<ma.length;Na++){var Ja=q.indexOf(ma[Na]),ab=J.substr(0,ma[Na].length);Ja+=ma[Na].length;var bb=q.length-Ja;q=q.substr(Ja,bb);J=J.substr(Ja,bb);Ja=$("<span>");Ja.text(ab);Ja.appendTo(n);Na!=ma.length-1&&1<ma.length&&(Ja=q.indexOf(pa),ab=J.substr(Ja,xa),Ja+=xa,bb=q.length-Ja,q=q.substr(Ja,bb),J=J.substr(Ja,bb),Ja=$("<span>"),Ja.text(ab),Ja.css("color","red"),Ja.clone().appendTo(n))}}}}function w(){var d=this,b,v,x;this.reInit=function(){b=null;G()};
this.getJqIcon=function(){return b};this.setOrder=function(J){v=J;G()};this.getOrder=function(){return v};this.setColIdx=function(J){x=J};this.getColIdx=function(){return x};var G=function(){n();b.addClass("metric-library-add-metric-sort-icon");b.on("click",function(){v?v==w.ASC_ORDER?v=w.DESC_ORDER:(fa=null,b.remove()):(fa=d,v=w.ASC_ORDER);n();h&&h[0]!=b[0]&&h.remove();h=b;k()})},n=function(){switch(v){case w.ASC_ORDER:var J="sort-asc";break;case w.DESC_ORDER:J="sort-desc";break;default:J="sort"}!b&&
(b=$("<div>"));b.attr("title","\u6392\u5e8f");Sa.background(b,J)}}var A=this,N,m,g,h,u,y,B,p,D=new Ua,T,O,ea,fa,U,ba=[],K=[],F,Ia=!1,C=0,ka={},la,Ca=[],Ba,ha;this.loadMetric=function(){A.protectedLoadMetric()};this.setGlobal=function(d){B=d};this.setContainer=function(d){N=d};this.getSelectedMetric=function(){return ba};var Z=function(){u=$("<span>");u.css({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)","z-index":"2"});var d=$("<span>"),b=f.get("noSelectMetric","\u6682\u65e0\u53ef\u9009\u7684\u6307\u6807\uff0c\u73b0\u5728\u53bb")+
" ";d.text(b);d.appendTo(u);d=$("<span>");d.css({color:"#2B87F3",cursor:"pointer"});d.text(f.get("createMetric","\u65b0\u5efa\u6307\u6807"));d.on("click",function(){var v=db.getModelSetHomePageEntrance();v&&v()});d.appendTo(u);u.appendTo(g);u.hide()},aa=function(){g.width()&&I();var d=A.protectedGetHearRowInfo();O=ja.createTable();O.setColumnFitVisibleWidth(!1);O.addColumns(d.length);for(var b=ja.createHeadRow(O),v=0;v<d.length;v++){var x=d[v],G=0<Ca.length?Ca[v]:x.width;O.getColumn(v).setWidth(G);
x.name&&b.getCell(v).setValue(x.name)}d=new c(O);d.setOutsideVisible(!1);O.setCellRender(d);O.setSyncUIWhenModelChanged(!0);O.setCellAcrossListener(function(n,J,pa){n=n&&0<n.length?n[0]:null;if(Ba!=n){if(Ba){var q=$(Ba);q=Ka(q);q.removeClass("metric-library-add-metric-sort-icon_hover");var ma=q.data("sortModel");ma&&!ma.getOrder()&&q.remove();Ba=null}1==J&&-1<ha.indexOf(pa)&&(J=Ka($(n)),0==J.length&&(J=$(n),q=new w,q.setOrder(null),q.setColIdx(pa),pa=q.getJqIcon(),pa.appendTo(J),pa.data("sortModel",
q),J=pa),J.addClass("metric-library-add-metric-sort-icon_hover"),Ba=n)}});d=$(O.getUI());d.addClass("metric-library-add-metric-list-table");d.appendTo(g)},I=function(){var d=g.width()-10;Ca=[.04*d,.12*d,.15*d,.2*d,.1*d,.28*d,.11*d,.2*d,.2*d,.2*d]},sa=function(){var d=$("<div>");d.addClass("metric-library-add-metric-right-container");p=new da;p.setText(f.get("selectedMetric","\u5df2\u9009\u6307\u6807")+"("+ba.length+")");var b=p.getJqUi();b.addClass("metric-library-add-metric-selected-label");b.appendTo(d);
b=new da;b.setText(f.get("allClear","\u5168\u90e8\u6e05\u9664"));b=b.getJqUi();b.on("click",function(){ba=[];for(var v=Object.keys(ka),x=0;x<v.length;x++)ka[v[x]].setChecked(!1);La();C=0;D.refreshSelectedRowTotal(C);l()});b.addClass("metric-library-add-metric-clear-all-label");b.appendTo(d);Ga(d);d.appendTo(N)},Ga=function(d){m=$("<div>");m.addClass("metric-library-add-metric-selected-metric-list");m.appendTo(d)},Da=function(d){ja.clear(O);aa();$a(d);ja.refresh(O);0<K.length?(u.hide(),y.hide()):Ia?
(y.show(),u.hide()):(y.hide(),u.show())},Ka=function(d){return d.find(".metric-library-add-metric-sort-icon")},$a=function(d){if(d&&0<d.length){var b=new KTBorderStyle;b.setBottomBorderWidth(1);b.setBottomBorderPen("solid");b.setBottomBorderColor("#e5e5e5");for(var v=0;v<d.length;v++){var x=ja.createRow(O,!1);x.setBorder(b);x.setUserObject(d[v])}}},La=function(){m.empty();if(0<ba.length){for(var d=$(document.createDocumentFragment()),b=0;b<ba.length;b++)Pa(ba[b]).appendTo(d);d.appendTo(m)}p.setText(f.get("selectedMetric",
"\u5df2\u9009\u6307\u6807")+"("+ba.length+")")},Pa=function(d){var b=d.getName()+"("+d.getNumber()+")",v=$("<div>");v.addClass("metric-library-add-metric-selected-item");var x=$("<div>");x.text(d.getName());x.attr("title",b);x.addClass("metric-library-add-metric-selected-item-name");b=$("<div>");Aa.makeTextOmissible(b);b.css("color","rgb(192, 192, 192)");var G=$("<span>");G.css("color","rgb(192, 192, 192)");G.text("("+d.getNumber()+")");G.appendTo(b);b.appendTo(x);x.appendTo(v);var n=$("<div>");n.on("click",
function(){A.protectedDeleteSelectedMetric(d);var J=ka[d.getId()];J&&J.setChecked(!1);D.refreshSelectedRowTotal(C);l();La()});Sa.background(n,"btn-delete");n.addClass("metric-library-add-metric-selected-item-icon");n.appendTo(v);v.mouseenter(function(){n.show()}).mouseleave(function(){n.hide()});return v},S=function(d){for(var b=0;b<ba.length;b++)if(ba[b].equals(d))return!0;return!1},a=function(d){for(var b=0;b<F.length;b++)if(F[b]==d.getId())return!0;return!1},e=function(d){ba.push(d);C++},l=function(){for(var d=
!0,b=0;b<K.length;b++)if(!a(K[b])&&!S(K[b])){d=!1;break}T.setChecked(d)},k=function(){if(fa){var d=fa.getOrder()==w.ASC_ORDER,b=[].concat(K);b.sort(z(d));for(var v=[],x=[],G=[],n=[],J=[],pa=0;pa<b.length;pa++){var q=t(b[pa]);q||0===q?/^\d+?.*$/.test(q)?(x=x||[],x.push(b[pa])):/^[a-zA-Z]+?.*$/.test(q)?(G=G||[],G.push(b[pa])):/^[\u4e00-\u9fa5]+?.*$/.test(q)?(n=n||[],n.push(b[pa])):(J=J||[],J.push(b[pa])):(v=v||[],v.push(b[pa]))}b=d?[].concat(x||[]).concat(G||[]).concat(n||[]).concat(J||[]).concat(v||
[]):[].concat(v||[]).concat(J||[]).concat(n||[]).concat(G||[]).concat(x||[]);Da(b)}else Da(K)},z=function(d){return function(b,v){b=t(b);v=t(v);var x=b-v;isNaN(x)&&(x=String(b).localeCompare(String(v),"zh-CN",{sensitivity:"accent"}));return d?x:-x}},t=function(d){switch(fa.getColIdx()){case la[r.METRIC_CODE_IDX_KEY]:return d.getNumber();case la[r.METRIC_NAME_IDX_KEY]:return d.getName();case la[r.CREATOR_IDX_KEY]:return d.getCreator()}};w.DESC_ORDER="desc";w.ASC_ORDER="asc";this.protectedMethod={getPaginationBar:function(){return D},
getMetricTable:function(){return O},getMapMetricCheckBox:function(){return ka},getSelectedCount:function(){return C},setSelectedCount:function(d){C=d},setExistMetricId:function(d){F=d},checkMetricIsExist:a,getSelectAllCheckBox:function(){return T},getCurrentPageMetric:function(){return K},setCurrentPageMetric:function(d){K=d},getSearchStatus:function(){return Ia},setSearchStatus:function(d){Ia=d},getSearchBox:function(){return ea},getSwitchButton:function(){return U},getGlobal:function(){return B},
updateCurrentPageMetric:function(d){K=[];for(var b=0;b<d.length;b++){var v=new wb;v.fromJsonObject(d[b]);v=v.getMetricInfos();K=K.concat(v)}},updateMetricTable:Da,checkMetricIsSelected:S,addMetricToSelectedList:e,updateSelectAllCheckBox:l,updateSelectedMetricList:La,createMetricRow:$a,doSortMetric:k,init:function(){N.css("display","flex");la=A.protectedGetColumnIndexMap();ha=[la[r.METRIC_CODE_IDX_KEY],la[r.METRIC_NAME_IDX_KEY],la[r.CREATOR_IDX_KEY]];var d=$("<div>");d.css({width:"80%",height:"100%"});
var b=$("<div>");b.addClass("metric-library-add-metric-manage-bar");ea=new H;ea.setSearchListenerDelay(1E3);ea.setShowSearchIcon(!0);ea.setPlaceholder(f.get("searchContent","\u8bf7\u8f93\u5165\u641c\u7d22\u5185\u5bb9"));ea.getJqUi().addClass("metric-library-add-metric-search-box");var v=$("<div>");v.addClass("metric-library-add-metric-switch-button-container");var x=$("<div>");x.text(f.get("showNoAddMetric","\u4ec5\u663e\u793a\u5c1a\u672a\u6dfb\u52a0\u7684\u6307\u6807"));x.addClass("metric-library-add-metric-switch-button-text");
x.appendTo(v);U=new R;U.setOn(!0);x=U.getJqUi();x.addClass("metric-library-add-metric-switch-button");x.appendTo(v);v.appendTo(b);A.protectedInitManageBar(b);b.appendTo(d);g=$("<div>");g.addClass("metric-library-add-metric-list-view");Z();y=(new qb).getJqUi();y.appendTo(g);y.hide();A.protectedInitPaginationBar(g);aa();g.appendTo(d);d.appendTo(N);sa()}}}function ya(){r.call(this);var c=this.protectedMethod,w=this,A,N,m,g=[],h=[],u,y=[ya.METRIC_TYPE_SELF_BULD,ya.METRIC_TYPE_PRESET],B=[{width:40},{width:145,
name:f.get("code","\u7f16\u7801")},{width:150,name:f.get("name","\u540d\u79f0")},{width:180,name:f.get("metricDesc","\u63cf\u8ff0")},{width:120,name:f.get("metricCreator","\u6307\u6807\u521b\u5efa\u4eba")},{width:235,name:f.get("path","\u8def\u5f84")},{width:130,name:f.get("dataUpdateTime","\u6570\u636e\u66f4\u65b0\u65f6\u95f4")},{width:160,name:f.get("expr","\u8868\u8fbe\u5f0f")},{width:120,name:f.get("dimension","\u7ef4\u5ea6")},{width:110,name:f.get("filterCondition","\u8fc7\u6ee4\u6761\u4ef6")}],
p={},D,T,O;this.protectedLoadMetric=function(){c.getGlobal().createFacade(function(ha){var Z=ha.presetModelSet,aa=ha.normalModelSet,I=new mb;I.setIsAll(!0);I.setName(f.get("all","\u5168\u90e8"));g.push(I);h.push(I);for(I=0;I<Z.length;I++){var sa=new mb;sa.fromJsonObject(Z[I]);g.push(sa)}for(I=0;I<aa.length;I++)sa=new mb,sa.fromJsonObject(aa[I]),h.push(sa);c.updateCurrentPageMetric(ha.metricModel);c.setExistMetricId(ha.existMetric);T=ha.count;p[r.CHECKBOX_IDX_KEY]=0;p[r.METRIC_CODE_IDX_KEY]=1;p[r.METRIC_NAME_IDX_KEY]=
2;p[r.METRIC_DESC_IDX_KEY]=3;p[r.CREATOR_IDX_KEY]=4;p[r.SOURCE_IDX_KEY]=5;p[r.DATA_UPDATE_TIME_IDX_KEY]=6;p[r.EXPR_IDX_KEY]=7;p[r.DIMENSION_IDX_KEY]=8;p[r.FILTER_IDX_KEY]=9;c.init();c.updateMetricTable(c.getCurrentPageMetric())}).loadFirstPageMetric(Qa)};this.protectedGetColumnIndexMap=function(){return p};this.protectedGetHearRowInfo=function(){return B};this.protectedInitManageBar=function(ha){ea(ha);Ca(ha);fa(ha);c.getSwitchButton().addStateChangeListener(function(Z,aa,I){F()})};this.protectedInitPaginationBar=
function(ha){var Z=c.getPaginationBar();Z.setComboBoxItemModelsAndSelectedItem([5,10,20,50,100,500,1E3],2);Z.setJumpToPageListener(function(aa,I,sa){ba(aa,I,sa)});Z.resetPaginationAndJumpToFirstPage(T);Z.refreshPagination();Z.setSelectedAllOrNotListener(function(aa,I){aa?C(I):ka()});Z=Z.getJqUi();Z.addClass("metric-library-add-metric-pagination-bar");Z.appendTo(ha)};this.protectedDeleteSelectedMetric=function(ha){for(var Z=w.getSelectedMetric(),aa=c.getSelectedCount(),I=0;I<Z.length;I++)if(Z[I].equals(ha)){Z.splice(I,
1);(N.isAll()||ha.getModelSetId()==N.getId())&&la(ha)&&D==ya.METRIC_TYPE_PRESET==ha.isPresetMetric()&&(aa--,c.setSelectedCount(aa));break}};var ea=function(ha){var Z=$("<div>");Z.addClass("metric-library-add-metric-selector-container");var aa=$("<div>");aa.addClass("metric-library-add-metric-selector-text");aa.text(f.get("modelSet","\u6a21\u578b\u96c6"));aa.appendTo(Z);m=new Q;u=h;m.setSelectedModel(u[0]);m.setDropdownCreator(function(I,sa,Ga){sa=$("<div>");sa.appendTo(I);sa.css({width:"100%",height:"100%",
"z-index":"999999"});var Da=new H;Da.setPlaceholder(f.get("search","\u641c\u7d22"));Da.addSearchListener(function(){$a()});I=new da(f.get("noMatchModelSet","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"));I.setEnabled(!1);var Ka=I.getJqUi();Ka.css({position:"absolute","text-align":"center",top:"10px",width:"100%",height:"12px","justify-content":"center"});Ka.hide();var $a=function(){var Pa=$.trim(Da.getText());if(Pa&&""!=Pa){Pa=Pa.toLowerCase();for(var S=[],a=0;a<u.length;a++)-1!=
u[a].getName().toLowerCase().indexOf(Pa)&&S.push(u[a]);La.setItemModels(S);0==S.length?Ka.show():Ka.hide()}else Ka.hide(),La.setItemModels(u),La.scrollSelectedToVisible()};I=Da.getJqUi();I.css({position:"absolute",height:"25px",top:"0px",left:"0px",right:"0px"});I.find("input").on("keydown",function(Pa){13===(Pa.keyCode||Pa.which||Pa.charCode)&&$a()});I.appendTo(sa);var La=new za;La.setToggleSelectingEnabled(!1);La.setItemModels(u);La.setSelecteds(m.getSelectedModel()?[m.getSelectedModel()]:[]);La.setCustomItemPainter(function(Pa,
S){S&&(Pa.text(S.getName()),Pa.attr("title",S.getName()))});La.addSelectedChangedListener(function(Pa,S,a){Ga(0<a.length?a[0]:null)});I=La.getJqUi();I.css({position:"absolute",top:"25px",bottom:"0px",width:"100%"});setTimeout(function(){La.scrollSelectedToVisible()},0);I.appendTo(sa);Ka.appendTo(I);return[150,-1]});m.setCustomPainter(function(I,sa){I&&(sa.text(I.getName()),sa.attr("title",I.getName()))});m.addSelectionListener(function(I){N=I.getSelectedModel();F()});aa=m.getJqUi();aa.css({width:"150px",
position:"relative"});aa.appendTo(Z);A=new Ea;A.setItemModels(h);A.setCustomPainter(function(I,sa,Ga){Ga&&(sa.text(Ga.getName()),sa.attr("title",Ga.getName()))});A.setSelected(h[0]);N=h[0];A.addSelectedChangedListener(Ia);A.getJqUi().css({position:"relative",width:"150px"});Z.appendTo(ha)},fa=function(ha){var Z=c.getSearchBox();Z.addSearchListener(function(){U($.trim(Z.getText()))});var aa=Z.getJqUi();aa.find("input").on("keydown",function(I){13===(I.keyCode||I.which||I.charCode)&&U($.trim(Z.getText()))});
aa.appendTo(ha)},U=function(ha){var Z=c.getSearchStatus();""==ha?Z&&(c.setSearchStatus(!1),F()):(c.setSearchStatus(!0),F())},ba=function(ha,Z,aa){var I=(new Date).getTime();O=I;var sa=c.getGlobal().createFacade(function(Da){if(O==I){var Ka=Da.count;aa&&aa(Ka);c.updateCurrentPageMetric(Da.metricModel);c.doSortMetric()}}),Ga=c.getSwitchButton().isOn()?Qa:null;sa.getMetricByPage(K(ha,Z,Ga))},K=function(ha,Z,aa){var I=new xb;I.setModelSetId(N.getId());I.setSystemId(aa);I.setSearchText($.trim(c.getSearchBox().getText()));
I.setPreset(D==ya.METRIC_TYPE_PRESET);I.setTargetPage(ha);I.setPageSize(Z);I.setShowNoAddMetric(c.getSwitchButton().isOn());return I},F=function(){var ha=c.getPaginationBar();ba(1,ha.getPageSize(),function(Z){for(var aa=0,I=c.getPaginationBar(),sa=w.getSelectedMetric(),Ga=sa.length-1;0<=Ga;Ga--){var Da=sa[Ga];(N.isAll()||Da.getModelSetId()==N.getId())&&la(Da)&&D==ya.METRIC_TYPE_PRESET==Da.isPresetMetric()&&aa++}I.resetPaginationAndJumpToFirstPage(Z);I.refreshSelectedRowTotal(aa);I.refreshPagination();
c.setSelectedCount(aa)})},Ia=function(ha,Z,aa){N=aa;F()},C=function(ha){var Z=c.getGlobal(),aa=c.getMapMetricCheckBox();Z.createFacade(function(I){for(var sa=I.selectedMetric,Ga=0;Ga<sa.length;Ga++){var Da=new yb;Da.fromJsonObject(sa[Ga]);var Ka=aa[Da.getId()];Ka&&Ka.setChecked(!0);c.checkMetricIsSelected(Da)||c.addMetricToSelectedList(Da)}c.updateSelectAllCheckBox();c.updateSelectedMetricList();c.getPaginationBar().refreshTotalRow(I.count);c.setSelectedCount(sa.length);ha&&ha(sa.length)}).getAllSelectMetric(K(null,
null,Qa))},ka=function(){var ha=c.getGlobal(),Z=w.getSelectedMetric(),aa=c.getMapMetricCheckBox();ha.createFacade(function(I){if(0!=I.length){for(var sa=c.getSelectedCount(),Ga=0;Ga<I.length;Ga++)for(var Da=0;Da<Z.length;Da++){var Ka=Z[Da];if(Ka.getId()==I[Ga]){Z.splice(Da,1);(Da=aa[Ka.getId()])&&Da.setChecked(!1);sa--;break}}c.setSelectedCount(sa);c.updateSelectAllCheckBox();c.updateSelectedMetricList()}}).cancelAllSelectedMetric(K(null,null,Qa))},la=function(ha){if(!c.getSearchStatus())return!0;
var Z=c.getSearchBox();Z=$.trim(Z.getText()).toLowerCase();var aa=ha.getName(),I=ha.getNumber();ha=ha.getDesc();return-1!=aa.toLowerCase().indexOf(Z)||-1!=I.toLowerCase().indexOf(Z)||-1!=ha.toLowerCase().indexOf(Z)},Ca=function(ha){var Z=$("<div>");Z.addClass("metric-library-add-metric-selector-container");var aa=$("<div>");aa.addClass("metric-library-add-metric-selector-text");aa.text(f.get("metricType","\u6307\u6807\u7c7b\u578b"));aa.appendTo(Z);aa=new Ea;aa.setItemModels(y);aa.setCustomPainter(function(I,
sa,Ga){Ga&&(I=Ga==ya.METRIC_TYPE_PRESET?f.get("presetMetric","\u9884\u7f6e\u6307\u6807"):f.get("enterpriseBuild","\u81ea\u5efa\u6307\u6807"),sa.text(I),sa.attr("title",I))});aa.setSelected(y[0]);D=y[0];aa.addSelectedChangedListener(Ba);aa=aa.getJqUi();aa.css({position:"relative",width:"80px"});aa.appendTo(Z);Z.appendTo(ha)},Ba=function(ha,Z,aa){D=aa;u=D==ya.METRIC_TYPE_PRESET?g:h;m.setSelectedModel(u[0]);N=u[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.metriclibrary&&(com.kingdee.bos.qing.modeler.metriclibrary={});"undefined"==typeof com.kingdee.bos.qing.modeler.metriclibrary.ui&&(com.kingdee.bos.qing.modeler.metriclibrary.ui={});var Fa=com.kingdee.bos.qing.modeler.metriclibrary.ui;Fa.Main=function(){function c(){P.call(this);
var a=this,e=this.protectedMethod,l,k,z,t,d;this.protectedInitToolbarUi=function(){l=e.appendButton(ka,"addMetric",f.get("addMetric","\u6dfb\u52a0\u6307\u6807"),f.get("addMetric","\u6dfb\u52a0\u6307\u6807"));k=e.appendButton(la,"removeMetric",f.get("removeMetric","\u79fb\u9664\u6307\u6807"),f.get("removeMetric","\u79fb\u9664\u6307\u6807"));z=e.appendButton(Ba,"moveMetric",f.get("moveMetric","\u79fb\u52a8\u5230"),f.get("moveMetric","\u79fb\u52a8\u5230"));t=e.appendButton(function(){var x=U,G=ba,n=
K;x.clearSearchStatus();n.clearSelectedMetric();n.setSelectedAll(!1);n.getPaginationBar().refreshSelectedRowTotal(0);G.clearSearchStatus();G.setContainSubLevel(!1);nb.clearCatalogNodeCache();zb(x,G,n)},"refresh",f.get("refresh","\u5237\u65b0"),f.get("refresh","\u5237\u65b0"));d=e.appendButton(Db,"exit",f.get("exit","\u9000\u51fa"),f.get("exit","\u9000\u51fa"))};this.showAvailableToolbarButton=function(){Wa?(v(),a.protectedInitToolbarUi(),b()):(v(),a.protectedInitToolbarUi())};var b=function(){l.getJqUi().remove();
k.getJqUi().remove();z.getJqUi().remove()},v=function(){b();t.getJqUi().remove();d.getJqUi().remove()}}function w(){var a=this;this.deleteMetric=function(){a.protectedDeleteMetric()};this.protectedMethod={funSuccessCallBack:function(e){e=f.get("removeMetricSuccess","\u79fb\u9664\u6307\u6807\u6210\u529f\u3002");F.getMessageCurtain().showSuccess(e,2E3);e=F.getSelectedCatalog();K.clearSelectedMetric();var l=K.getPaginationBar();gb(e,ba.getContainSubLevel(),K,null);l.refreshSelectedRowTotal(0)},funErrorCallBack:function(e,
l){return(e=Fa.OperateExceptionPrompt.getOperateExceptionDetail(e,null,null))?(e.showPrompt(),!0):!1}}}function A(){w.call(this);var a=this.protectedMethod;this.protectedDeleteMetric=function(){var e=F.createFacade(function(l){a.funSuccessCallBack(l);K.setSelectedAll(!1)},function(l,k){return a.funErrorCallBack(l,k)});e.setShowBlocking(!0);e.deleteSystemMetric(Qa)}}function N(a){w.call(this);var e=this.protectedMethod;this.protectedDeleteMetric=function(){var l=F.createFacade(function(k){e.funSuccessCallBack(k);
K.setSelectedAll(!1)},function(k,z){return e.funErrorCallBack(k,z)});l.setShowBlocking(!0);l.deleteCatalogsMetric(Qa,a)}}function m(a){w.call(this);var e=this.protectedMethod;this.protectedDeleteMetric=function(){var l=F.createFacade(function(k){e.funSuccessCallBack(k)},function(k,z){return e.funErrorCallBack(k,z)});l.setShowBlocking(!0);l.deleteMetric(Qa,a)}}function g(){va.call(this);var a=this.protectedMethod,e=this,l,k,z;(function(){a.setSelectable(!0);a.setContentPaneCreator(function(){e.setSize(360,
270);var t=$("<div>"),d=new da;d.setRequired(!0);d.setText(f.get("catalogName","\u540d\u79f0"));d=d.getJqUi();k=new Ra;l&&k.setText(l);var b=k.getJqUi();d.appendTo(t);b.appendTo(t);Aa.layoutCtrl(d,34,40,70,23);Aa.layoutCtrl(b,34,70,260,23);return t});a.setFooterPaneCreator(function(t){var d=new L(f.get("confirm","\u786e\u5b9a"));d.setHighlight(!0);var b=d.getJqUi();b.addClass("sa-ctrl-dialog-footer-ok");b.appendTo(t);d.addActionListener(function(v){z&&z.operateCatalog($.trim(k.getText()),a);return!0});
d=new L(f.get("cancel","\u53d6\u6d88"));d.setHighlight(!1);b=d.getJqUi();b.addClass("sa-ctrl-dialog-footer-cancel");b.appendTo(t);d.addActionListener(function(v){a.destroy();return!0})});a.setClosingAction(function(t){})})();this.setOldName=function(t){l=t};this.setTitle=function(t){a.setTitle(t)};this.setOperateCatalogImpl=function(t){z=t};this.textFieldFocus=function(){k&&k.requestFocus()}}function h(){var a=this;this.operateCatalog=function(e,l){var k=!1;if(""!==e&&50<e.length)var z=f.get("catalogNameTooLong",
"\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002");else if(""===e)z=f.get("catalogNameCannotEmpty","\u8bf7\u8f93\u5165\u76ee\u5f55\u540d\u79f0\u3002");else for(var t=nb.getAllCatalogNodeBySystem(),d=0;d<t.length;d++){var b=t[d];if(F.getSelectedCatalog().getId()!==b.getId()&&e===b.getName()){z=f.get("duplicateName","\u540d\u79f0\u91cd\u590d\u3002");break}}z?l.getMessageCurtain().showPrompt(z):k=a.protectedCheck(e,l);k&&(k=new rb,k.setSystemId(Qa),k.setCatalogName(e),a.protectedOperateCatalog(k,
l))}}function u(a,e){h.call(this);this.protectedCheck=function(l,k){return!0};this.protectedOperateCatalog=function(l,k){l.setParentId(a.getId());var z=F.createFacade(function(t){k.destroy();var d=f.get("createCatalogSuccess","\u65b0\u5efa\u76ee\u5f55\u6210\u529f\u3002");F.getMessageCurtain().showSuccess(d,2E3);d=new Ta;d.fromJsonObject(t);d.setLevel(a.getLevel()+1);d.setParentNode(a);a.getChildren().push(d);e instanceof ca.LeafNode?ba.createNodeOnLeaf(d):ba.createNodeOnBranch(e,d);t=K.getPaginationBar();
t.refreshTotalRow(0);t.refreshSelectedRowTotal(0);ba.updateUi(!1,!1);K.showMetrics([])},function(t,d){return(t=Fa.OperateExceptionPrompt.getOperateExceptionDetail(t,a.getName(),k))?(t.showPrompt(),!0):!1});z.setShowBlocking(!0);z.createCatalog(l)}}function y(){h.call(this);this.protectedCheck=function(a,e){return a===F.getSelectedCatalog().getName()?(e.destroy(),!1):!0};this.protectedOperateCatalog=function(a,e){var l=F.getSelectedCatalog();a.setCatalogId(l.getId());var k=F.createFacade(function(z){e.destroy();
z=f.get("editCatalogSuccess","\u7f16\u8f91\u76ee\u5f55\u6210\u529f\u3002");F.getMessageCurtain().showSuccess(z,2E3);l.setName(a.getCatalogName());ba.getCatalogTree().refresh()},function(z,t){return(z=Fa.OperateExceptionPrompt.getOperateExceptionDetail(z,l.getName(),e))?(z.showPrompt(),!0):!1});k.setShowBlocking(!0);k.updateCatalog(a)}}function B(){va.call(this);var a=this.protectedMethod,e=this,l,k=new Q;(function(){a.setTitle(f.get("moveTo","\u79fb\u52a8\u5230"));a.setSelectable(!0);a.setContentPaneCreator(function(){e.setSize(400,
300);return z()});a.setFooterPaneCreator(function(t){var d=new L(f.get("confirm","\u786e\u5b9a"));d.setHighlight(!0);var b=d.getJqUi();b.addClass("sa-ctrl-dialog-footer-ok");b.appendTo(t);d.addActionListener(function(v){l&&l.moveMetric(k.getSelectedModel().getSelectedGroup(),a);return!0});d=new L(f.get("cancel","\u53d6\u6d88"));d.setHighlight(!1);b=d.getJqUi();b.addClass("sa-ctrl-dialog-footer-cancel");b.appendTo(t);d.addActionListener(function(v){a.destroy();return!0})});a.setClosingAction(function(t){})})();
this.setMoveMetricImpl=function(t){l=t};var z=function(){var t=$("<div>"),d=new da;d.setText(f.get("catalog","\u76ee\u5f55"));d=d.getJqUi();d.appendTo(t);Aa.layoutCtrl(d,25,50,70,23);d=ba.getCatalogTree().getRootGroup().getUserObject();var b=new p(d.getChildren()),v=new fa;v.setSelectedGroup(d.getChildren()[0]);v.setPath(d.getChildren()[0].getName());k.setSelectedModel(v);k.setDropdownCreator(function(x,G,n){return b.createJqPopup(x,G,n)});k.setCustomPainter(function(x,G){G.text(x?x.getPath():"");
G.attr("title",x?x.getPath():"")});d=k.getJqUi();d.appendTo(t);Aa.layoutCtrl(d,100,50,240,23);return t}}function p(a){var e;this.createJqPopup=function(v,x,G){e=G;x=new ca;x.setRootVisible(!1);x.setNodePainter(l);G=x.setRoot;var n=new Ab;n.setName(" ");n.setId("0");n=z(n);d(n,a);G.call(x,n);x.hookLoadingHandler(b);x.addSelectingListener(k);x.getRoot().setExpanded(!0);x.getRoot().setSelectable(!1);x.setLineHeight(30);x.getJqUi().css({overflow:"hidden auto",border:"1px solid rgba(138, 153, 170, 0.4)",
width:"100%",position:"absolute","max-height":"162px",background:"white"});x.getJqUi().appendTo(v);return[-1,Math.min(30*a.length,162)]};var l=function(v,x){x=x.getUserObject().getName();v.css("width","calc(100% - 30px)");v.css("padding-left","4px");v.css("padding-right","4px");v.text(x);v.attr("title",x)},k=function(v,x){var G=x.getTreePath();v="";for(var n=1;n<G.length;n++)1<n&&(v+="/"),v+=G[n].getUserObject().getName();G=new fa;G.setSelectedGroup(x.getUserObject());G.setPath(v);e(G)},z=function(v){var x=
new ca.BranchNode;x.setUserObject(v);return x},t=function(v){var x=new ca.LeafNode;x.setUserObject(v);return x},d=function(v,x){if(x)for(var G=0;G<x.length;G++){var n=x[G];if(n instanceof Ta){var J=n.getChildren();J&&0<J.length?(n=z(n),v.addChild(n)):v.addChild(t(n))}else v.addChild(t(n))}},b=function(v,x){d(v,v.getUserObject().getChildren());x()}}function D(){var a=this;this.moveMetric=function(e,l){a.protectedMoveMetric(e,l)};this.protectedMethod={funMoveSuccessCallBack:function(e,l){e.destroy();
e=f.get("moveMetricSuccess","\u79fb\u52a8\u6307\u6807\u6210\u529f\u3002");F.getMessageCurtain().showSuccess(e,2E3);K.clearSelectedMetric();K.getPaginationBar().refreshSelectedRowTotal(0);e=F.getSelectedCatalog();gb(e,ba.getContainSubLevel(),K,null)},funMoveFailedCallBack:function(e,l,k){return(e=Fa.OperateExceptionPrompt.getOperateExceptionDetail(e,l,k))?(e.showPrompt(),!0):!1}}}function T(){D.call(this);var a=this.protectedMethod,e=[];this.setMoveMetrics=function(l){e=l};this.protectedMoveMetric=
function(l,k){var z=F.createFacade(function(t){a.funMoveSuccessCallBack(k,t)},function(t,d){return a.funMoveFailedCallBack(t,l.getName(),k)});z.setShowBlocking(!0);z.moveMetric(Qa,e,l.getId())}}function O(){D.call(this);var a=this.protectedMethod;this.protectedMoveMetric=function(e,l){var k=F.createFacade(function(z){a.funMoveSuccessCallBack(l,z)},function(z,t){return a.funMoveFailedCallBack(z,e.getName(),l)});k.setShowBlocking(!0);k.moveSystemMetric(Qa,e.getId())}}function ea(){D.call(this);var a=
this.protectedMethod,e;this.setCatalogIds=function(l){e=l};this.protectedMoveMetric=function(l,k){var z=F.createFacade(function(t){a.funMoveSuccessCallBack(k,t)},function(t,d){return a.funMoveFailedCallBack(t,l.getName(),k)});z.setShowBlocking(!0);z.moveCatalogMetric(Qa,e,l.getId())}}function fa(){var a,e;this.setSelectedGroup=function(l){a=l};this.getSelectedGroup=function(){return a};this.setPath=function(l){e=l};this.getPath=function(){return e}}var U,ba,K,F=new function(){var a,e=!1;this.getSelectedCatalog=
function(){return ba&&ba.getCatalogTree()?ba.getCatalogTree().getSelectedNode().getUserObject():ba.getCatalogFolderNode()};this.getMessageCurtain=function(){a||(a=new Oa,a.getJqUi().appendTo($("body")));return a};this.getSearchText=function(){return U.getSearchText()};this.getIsTableView=function(){return U.getIsTableView()};this.setSearchStatus=function(l){e=l};this.getSearchStatus=function(){return e};this.createFacade=function(l,k,z,t){t||(t=db.getRemoteImpl());return new jb(t,l,function(d,b,v){return k?
k(d,b,v):!1},z)};this.getCatalogContainer=function(){return ba};this.getMetricContainer=function(){return K}};this.getJqUi=function(){var a=$("<div class='metric-library-manage'>");U=new c;U.setSearchListener(function(t){var d=ba,b=K,v=d.getCatalogTree();v&&(0!==t.length||b.getGlobal().getSearchStatus())&&(b.getGlobal().setSearchStatus(0<t.length),b.clearSelectedMetric(),b.setSelectedAll(!1),b.getPaginationBar().refreshSelectedRowTotal(0),t=v.getSelectedNode().getUserObject(),d=d.getContainSubLevel(),
gb(t,d,b,null))});U.setViewSwitchListener(function(t){var d=K;t=t?d.getMetricCardView():d.getMetricTableView();d.setViewSelectedMetricsMap(t.getSelectedMetricsMap());d.showMetrics(t.getMetrics())});a.append(U.getJqUi());ba=Ia();ba.setGlobal(F);ba.setTreeNodeClickListener(function(t){var d=ba,b=K,v=b.getPaginationBar(),x=t.getId()===Ta.ROOT_NODE_ID;v.refreshSelectedRowTotal(0);b.setSelectedAll(!1);d.updateUi(!1,x);d=d.getContainSubLevel();b.clearSelectedMetric();gb(t,d,b,null)});ba.setContainSubLevelListener(function(t){ba.setContainSubLevel(t);
var d=F.getSelectedCatalog(),b=K;b.getPaginationBar().refreshSelectedRowTotal(0);gb(d,t,b,null)});var e=ba.getJqUi();K=C();var l=K.getJqUi(),k=new ua;k.setHorizontalSplit(!0);k.setSplitLineWide(8);k.setResizeMode(ua.RESIZE_MODE_FIRST_FIXED);k.setFirstChild(ua.createChildWrapper(e,function(){e.css({width:k.getNonemptyFirstWide()+"px"});l.css({width:document.documentElement.clientWidth-k.getNonemptyFirstWide()-20-8+"px"})}));k.setSecondChild(ua.createChildWrapper(l));K.setSplitPane(k);k.setFirstSize(250,
224,400);k.setSecondSize(document.documentElement.clientWidth-250-20-8,document.documentElement.clientWidth-400-20-8,document.documentElement.clientWidth-224-20-8);var z=k.getJqUi();z.addClass("metric-library-manage-main");a.append(z);zb(U,ba,K);return a};var Ia=function(){var a=new na;a.setCatalogEditable(!0);a.setCreateSameLevelCatalog(Z);a.setCreateSubLevelCatalog(aa);a.setEditCatalog(Ga);a.setDeleteCatalog(Da);a.setMoveUpCatalog($a);a.setMoveDownCatalog(La);var e=new ra;e.setCreateSubLevelCatalog(I);
var l=new ia;l.setCatalogToolBar(a);l.setCatalogNoData(e);return l},C=function(){var a=new ta;a.setGlobal(F);a.setCatalogContainerWidth(250);return a},ka=function(){var a=F.getSelectedCatalog();a?a.getId()!==Ta.ROOT_NODE_ID?(a=new X(F),a.setAddSuccessCallback(function(e){var l=F.getSelectedCatalog(),k=K.getPaginationBar();gb(l,ba.getContainSubLevel(),K,[k.resetPaginationAndJumpToFirstPage]);e&&F.getMessageCurtain().showSuccess(f.get("addMetricSuccess","\u6dfb\u52a0\u6210\u529f\u3002"));e=K.getSelectedMetrics().length;
k.refreshSelectedRowTotal(e)}),a.show()):0===a.getChildren().length?F.getMessageCurtain().showPrompt(f.get("createCatalogTips","\u8bf7\u5148\u521b\u5efa\u76ee\u5f55\uff0c\u518d\u6dfb\u52a0\u6307\u6807\u3002")):F.getMessageCurtain().showPrompt(f.get("rootNodeNotAddMetric","\u4e0d\u80fd\u5728\u6839\u8282\u70b9\u4e0a\u6dfb\u52a0\u6307\u6807\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u76ee\u5f55\u3002")):F.getMessageCurtain().showPrompt(f.get("systemNotExist","\u201c#1\u201d\u6307\u6807\u4f53\u7cfb\u4e0d\u5b58\u5728\u3002").replace("#1",
eb))},la=function(){if(0===K.getSelectedMetrics().length){var a=f.get("removeMetricTips","\u8bf7\u9009\u62e9\u9700\u8981\u79fb\u9664\u7684\u6307\u6807\u3002");F.getMessageCurtain().showPrompt(a)}else a=f.get("confirmDeleteMetric","\u79fb\u9664\u6307\u6807\u540e\uff0c\u901a\u8fc7\u8be5\u6307\u6807\u4f53\u7cfb\u4f7f\u7528\u6307\u6807\u7684\u529f\u80fd\u5c06\u53d7\u5230\u5f71\u54cd\uff0c\u786e\u5b9a\u79fb\u9664\u5417\uff1f"),Pa(a,function(e){Ca().deleteMetric()})},Ca=function(){if(!K.getSelectedAll()){var a=
K.getSelectedMetrics();return new m(a)}a=F.getSelectedCatalog();if(a.getId()===Ta.ROOT_NODE_ID)return new A;var e=[];e.push(a.getId());ba.getContainSubLevel()&&a.getAllChildId(e);return new N(e)},Ba=function(){if(0===K.getSelectedMetrics().length){var a=f.get("moveMetricTips","\u8bf7\u9009\u62e9\u9700\u8981\u79fb\u52a8\u7684\u6307\u6807\u3002");F.getMessageCurtain().showPrompt(a)}else{a=ha();var e=new B;e.setMoveMetricImpl(a);e.showDialog()}},ha=function(){if(!K.getSelectedAll()){var a=K.getSelectedMetrics(),
e=new T;e.setMoveMetrics(a);return e}a=F.getSelectedCatalog();e=a.getId();if(e===Ta.ROOT_NODE_ID)return new O;e=[e];ba.getContainSubLevel()&&a.getAllChildId(e);a=new ea;a.setCatalogIds(e);return a},Z=function(){var a=new g,e=F.getSelectedCatalog(),l=ba.getCatalogTree().getSelectedNode();a.setOperateCatalogImpl(new u(e.getParentNode(),l.getParent()));a.setTitle(f.get("addSameLevelCatalog","\u65b0\u5efa\u540c\u7ea7"));a.showDialog();a.textFieldFocus()},aa=function(){4<=F.getSelectedCatalog().getLevel()?
F.getMessageCurtain().showPrompt(f.get("modelGroupMaxLevel","\u6700\u591a\u53ef\u652f\u63014\u7ea7\u76ee\u5f55\uff0c\u5f53\u524d\u76ee\u5f55\u4e3a\u7b2c4\u7ea7\u76ee\u5f55\uff0c\u65e0\u6cd5\u65b0\u589e\u4e0b\u7ea7\u76ee\u5f55\u3002")):sa(f.get("addSubDir","\u65b0\u5efa\u5b50\u7ea7"))},I=function(){sa(f.get("addCatalog","\u65b0\u5efa\u76ee\u5f55"))},sa=function(a){var e=new g;e.setTitle(a);a=F.getSelectedCatalog();var l=ba.getCatalogTree().getSelectedNode();e.setOperateCatalogImpl(new u(a,l));e.showDialog();
e.textFieldFocus()},Ga=function(){var a=new g,e=F.getSelectedCatalog().getName();a.setOldName(e);a.setTitle(f.get("updateModelCatalogText","\u7f16\u8f91\u76ee\u5f55"));a.setOperateCatalogImpl(new y);a.showDialog();a.textFieldFocus()},Da=function(){var a=ba.getCatalogTree().getSelectedNode();a instanceof ca.BranchNode?(a=f.get("deleteChildCatalog","\u8bf7\u5148\u5220\u9664\u76ee\u5f55\u4e0b\u7684\u5b50\u76ee\u5f55\u518d\u5220\u9664\u76ee\u5f55\u3002"),F.getMessageCurtain().showPrompt(a)):(a=a.getUserObject(),
0<a.getTotalRow()?(a=f.get("deleteMetricBeforeCatalog","\u8bf7\u5148\u79fb\u9664\u76ee\u5f55\u4e0b\u7684\u6307\u6807\u518d\u5220\u9664\u76ee\u5f55\u3002"),F.getMessageCurtain().showPrompt(a)):(a=a.getName(),a=f.get("confirmToDelCatalogPrefix","\u5220\u9664\u201c").concat(a).concat(f.get("confirmToDelCatalogSuffix","\u201d\u540e\u5c06\u65e0\u6cd5\u6062\u590d\uff0c\u786e\u5b9a\u5220\u9664\u5417\uff1f")),Pa(a,S)))},Ka=function(a,e){var l=ba.getCatalogTree().getSelectedNode();if(l){var k=l.getUserObject(),
z=l.getParent(),t=z.getUserObject().getChildren();if(a?t[0].getId()!==k.getId():t[t.length-1].getId()!==k.getId()){e=t.concat([]);var d=t.indexOf(k),b=a?d-1:d+1;e[d]=e.splice(b,1,e[d])[0];a=[];k=t.length;for(var v=0;v<e.length;v++){var x=e[v],G=new rb;G.setCatalogId(x.getId());G.setSeq(k);a.push(G.toJsonObject());k--}(new jb(db.getRemoteImpl(),function(n){t[d]=t.splice(b,1,t[d])[0];z.removeChild(l);z.insertChild(l,b);ba.updateUi(!0,!1,l)},function(n,J){return(n=Fa.OperateExceptionPrompt.getOperateExceptionDetail(n,
null,null))?(n.showPrompt(),!0):!1})).updateCatalogSequence(Qa,a)}else F.getMessageCurtain().showPrompt(e)}},$a=function(){Ka(!0,f.get("unableMoveUp","\u540c\u5c42\u7ea7\u7b2c\u4e00\u4e2a\u76ee\u5f55\u4e0d\u652f\u6301\u4e0a\u79fb\u3002"))},La=function(){Ka(!1,f.get("unableMoveDown","\u540c\u5c42\u7ea7\u6700\u540e\u4e00\u4e2a\u76ee\u5f55\u4e0d\u652f\u6301\u4e0b\u79fb\u3002"))};Fa.OperateExceptionPrompt=new function(){function a(e,l,k,z){this.showPrompt=function(){k.showPrompt(e.replace("#1",l));z&&
z()}}this.getOperateExceptionDetail=function(e,l,k){switch(e){case 20010001:return new a(f.get("duplicateName","\u540d\u79f0\u91cd\u590d\u3002"),null,k.getMessageCurtain(),null);case 20010002:return new a(f.get("deleteMetricBeforeCatalog","\u8bf7\u5148\u79fb\u9664\u76ee\u5f55\u4e0b\u7684\u6307\u6807\u518d\u5220\u9664\u76ee\u5f55\u3002"),null,F.getMessageCurtain(),k&&k.destroy());case 20010003:return new a(f.get("catalogNotExist","\u201c#1\u201d\u76ee\u5f55\u4e0d\u5b58\u5728\u3002"),l,F.getMessageCurtain(),
k&&k.destroy());case 20010004:return new a(f.get("deleteChildCatalog","\u8bf7\u5148\u5220\u9664\u76ee\u5f55\u4e0b\u7684\u5b50\u76ee\u5f55\u518d\u5220\u9664\u76ee\u5f55\u3002"),null,F.getMessageCurtain(),k&&k.destroy());case 20010301:return new a(f.get("systemNotExist","\u201c#1\u201d\u6307\u6807\u4f53\u7cfb\u4e0d\u5b58\u5728\u3002"),eb,F.getMessageCurtain(),k&&k.destroy());case 20010302:return new a(f.get("systemDisabled","\u201c#1\u201d\u6307\u6807\u4f53\u7cfb\u5df2\u88ab\u7981\u7528\u3002"),eb,
F.getMessageCurtain(),k&&k.destroy());case 20010303:return new a(f.get("operateWithoutAuth","\u60a8\u6ca1\u6709\u6743\u9650\u64cd\u4f5c\u8be5\u6307\u6807\u4f53\u7cfb\u3002"),null,F.getMessageCurtain(),k&&k.destroy());case 20011005:return new a(f.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002"),null,F.getMessageCurtain(),k&&k.destroy())}return null}};var Pa=function(a,e){var l=E.createFeedbackDialog();l.setMsgImageType(E.MSG_DELETE);l.setMessage(a);l.showDialog();
l.setClosingChecker(function(k){k===E.RETURN_OK&&e&&e(l);return!0})},S=function(a){var e=F.getSelectedCatalog();a=e.getId();var l=e.getName();e=F.createFacade(function(k){k=f.get("deleteCatalogSuccess","\u5220\u9664\u76ee\u5f55\u6210\u529f\u3002");F.getMessageCurtain().showSuccess(k,2E3);ba.removeCatalogLeafNode();K.clearSelectedMetric();K.getPaginationBar().refreshSelectedRowTotal(0);nb.clearCatalogNodeCache();Eb(U,ba,K)},function(k,z){return(k=Fa.OperateExceptionPrompt.getOperateExceptionDetail(k,
l,null))?(k.showPrompt(),!0):!1});e.setShowBlocking(!0);e.deleteCatalog(Qa,a)}};var Ha=com.kingdee.bos.qing.modeler.metriclibrary,Oa,da,Ra,ua,Va,H,L,R,M,E,Q,ca,Y,Ma,va,Ea,za,Ua,f,Xa,Ya,ja,Za,Aa,W,fb,cb,hb,pb,qb,Sa,jb,db,mb,wb,yb,Ta,rb,kb,sb,tb,nb,Ab,vb,ib,lb,xb,Qa,eb,Wa;(function(){var c=com.kingdee.bos.qing.ui.component;Oa=c.MessageCurtain;da=c.Label;Ra=c.TextField;ua=c.SplitPane;Va=c.Toolbar;H=c.SearchBox;L=c.Button;R=c.SwitchButton;M=c.CheckBox;E=c.MessageDialog;Q=c.DropdownSelector;ca=c.Tree;
Y=c.HelpIcon;Ma=c.Tips;va=c.AbstractModalDialog;Ea=c.ComboBox;za=c.List;c=com.kingdee.bos.qing.biz.common;Ua=c.ComplexPaginationBar;c=com.kingdee.bos.qing.framework.common;f=c.MultilanguageManager.createPackageAccessor(Ha);Xa=c.WindowResizeObserver;Ya=c.TabbedUiUtil;c=com.kingdee.bos.qing.common.ui;ja=c.TableUtil;Za=c.CommonIconUtil;c=com.kingdee.bos.qing.common;Aa=c.DomUtil;W=c.DateFormater;fb=c.Util;cb=c.TextMeasurer;c=com.kingdee.bos.qing.modeler.common.ui;hb=c.CatalogTree;pb=c.NoDataContainer;
qb=c.SearchNoDataContainer;c=com.kingdee.bos.qing.modeler.metriclibrary.common;Sa=c.Icons;jb=c.Facade;db=c.Integration;c=com.kingdee.bos.qing.modeler.metriclibrary.model;Ta=c.CatalogNode;rb=c.Catalog;kb=c.MetricLibraryRequest;sb=c.MetricLibraryResponse;tb=c.MetricPagination;nb=c.CatalogNodeCacheHelper;mb=c.ModelSet;wb=c.MetricModelInfo;yb=c.MetricInfo;vb=c.AddMetricResponse;ib=c.AbstractAddMetricInvalidityCase;lb=c.DetailMetricInvalidityCase;xb=c.AddMetricQueryRequest;c=com.kingdee.bos.qing.modeler.metriclibrary.system;
Ab=c.MetricSystem;Qa=fb.decodeParamFromUrl(location.search,"systemId");eb=fb.decodeParamFromUrl(location.search,"systemName")})();var ub=function(c,w,A,N,m){var g=new H;g.setSearchListenerDelay(1E3);g.addSearchListener(function(){w($.trim(g.getText()).toLowerCase())});g.setShowSearchIcon(A);g.setPlaceholder(N);A=g.getJqUi();A.addClass(m);A.find("input").on("keydown",function(h){13===(h.keyCode||h.which||h.charCode)&&w($.trim(g.getText()).toLowerCase())});c.append(A);return g},Db=function(){Ya.closeCurrentTab()},
ob=function(c){return(c=Fa.OperateExceptionPrompt.getOperateExceptionDetail(c))?(c.showPrompt(),!0):!1},zb=function(c,w,A){var N=A.getPaginationBar().getPageSize();(new jb(db.getRemoteImpl(),function(m){w.resetCatalogTree();var g=new sb,h=new Ta,u=0,y=[];m&&(g.fromJsonObject(m),h=g.getCatalogNode(),m=g.getMetricPagination(),u=m.getTotalRow(),y=m.getMetrics(),(Wa=g.isPresetSystem())&&A.getGlobal().getMessageCurtain().showPrompt(f.get("presetSystemTips","\u201c\u9884\u7f6e\u7684\u6307\u6807\u4f53\u7cfb\u4e0d\u5141\u8bb8\u6dfb\u52a0\u6307\u6807\u3001\u7f16\u8f91\u76ee\u5f55\u7b49\u64cd\u4f5c\uff0c\u5982\u6709\u9700\u8981\uff0c\u53ef\u590d\u5236\u540e\u518d\u8fdb\u884c\u64cd\u4f5c\u3002")));
A.updatePaginationBar(u);h.setId(Ta.ROOT_NODE_ID);h.setLevel(0);h.setName(eb);h.setTotalRow(u);w.setCatalogFolderNode(h);w.updateUi(!0,!0);A.setShowMetrics(y);A.updateUi();c.showAvailableToolbarButton()},ob)).loadFirstSystemCatalogAndMetric(Qa,1,N)},Eb=function(c,w,A){var N=A.getPaginationBar(),m=new jb(db.getRemoteImpl(),function(h){w.resetCatalogTree();var u=new sb;u.fromJsonObject(h);h=u.getCatalogNode();var y=u.getMetricPagination();u=y.getTotalRow();y=y.getMetrics();N.resetPaginationAndJumpToFirstPage(u);
h.setId(Ta.ROOT_NODE_ID);h.setLevel(0);h.setName(eb);h.setTotalRow(u);w.setCatalogFolderNode(h);w.updateUi(!0,!0);c.showAvailableToolbarButton();A.setShowMetrics(y);A.updateUi()},ob),g=new kb;g.setSystemId(Qa);g.setTargetPage(1);g.setPageSize(N.getPageSize());m.loadCatalogAndMetricBySystemId(g)},gb=function(c,w,A,N){var m=A.getGlobal().getSearchText(),g=A.getPaginationBar(),h=A.getGlobal().createFacade(function(B){var p=new tb;p.fromJsonObject(B);B=p.getMetrics();p=p.getTotalRow();c.setTotalRow(p);
if(N&&0<N.length)for(var D=0;D<N.length;D++){var T=N[D];T&&T(p)}g.refreshTotalRow(p);A.setShowMetrics(B);A.updateUi()},function(B,p){return ob(B)}),u=new kb;if(Ta.ROOT_NODE_ID===c.getId())u.setSystemId(Qa);else{var y=[];y.push(c.getId());w&&c.getAllChildId(y);u.setCatalogIds(y)}u.setTargetPage(g.getCurrentPage());u.setPageSize(g.getPageSize());u.setSearchText(m);h.loadMetricLibraryMetric(u)},Bb=function(c,w,A,N,m){var g=m.getPaginationBar(),h=m.getGlobal(),u=h.getSelectedCatalog(),y=[];A?y.push(A):
y.push(g.refreshPagination);A=h.getSearchText();h=h.createFacade(function(D){var T=new tb;T.fromJsonObject(D);D=T.getMetrics();T=T.getTotalRow();if(y&&0<y.length)for(var O=0;O<y.length;O++){var ea=y[O];ea&&ea(T)}g.refreshTotalRow(T);m.setShowMetrics(D);m.updateUi()});var B=new kb;if(Ta.ROOT_NODE_ID===u.getId())B.setSystemId(Qa);else{var p=[];p.push(u.getId());N&&u.getAllChildId(p);B.setCatalogIds(p)}B.setTargetPage(c);B.setPageSize(w);B.setSearchText(A);h.loadMetricLibraryMetric(B);c=m.getSelectedMetrics().length;
g.refreshSelectedRowTotal(c)},Cb=function(c,w,A,N){var m=N.getGlobal(),g=m.getIsTableView()?N.getMetricTableView():N.getMetricCardView();N.setSelectedAll(c);A=A.getContainSubLevel();if(c){N=m.createFacade(function(B){for(var p={},D=0;D<B.length;D++){var T=B[D];p[T]=T}g.setSelectedMetricsMap(p)},function(B,p){return ob(B)});var h=new kb,u=m.getSelectedCatalog();if(Ta.ROOT_NODE_ID===u.getId())h.setSystemId(Qa);else{var y=[];y.push(u.getId());A&&u.getAllChildId(y);h.setCatalogIds(y)}h.setSearchText(m.getSearchText());
N.loadAllMetricIds(h)}else N.clearSelectedMetric();g.updateSelectedAll(c);w&&w(u.getTotalRow())};r.CHECKBOX_IDX_KEY="CHECKBOX_IDX_KEY";r.METRIC_CODE_IDX_KEY="METRIC_CODE_IDX_KEY";r.METRIC_NAME_IDX_KEY="METRIC_NAME_IDX_KEY";r.METRIC_DESC_IDX_KEY="METRIC_DESC_IDX_KEY";r.EXPR_IDX_KEY="EXPR_IDX_KEY";r.DIMENSION_IDX_KEY="DIMENSION_IDX_KEY";r.SOURCE_IDX_KEY="SOURCE_IDX_KEY";r.FILTER_IDX_KEY="FILTER_IDX_KEY";r.CREATOR_IDX_KEY="CREATOR_IDX_KEY";r.DATA_UPDATE_TIME_IDX_KEY="DATA_UPDATE_TIME_IDX_KEY";ya.METRIC_TYPE_SELF_BULD=
"build";ya.METRIC_TYPE_PRESET="preset"})();
//qingVersionTag: 20250415