var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(n,u,x){n instanceof String&&(n=String(n));for(var B=n.length,A=0;A<B;A++){var E=n[A];if(u.call(x,E,A,n))return{i:A,v:E}}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(n,u,x){if(n==Array.prototype||n==Object.prototype)return n;n[u]=x.value;return n};$jscomp.getGlobal=function(n){n=["object"==typeof globalThis&&globalThis,n,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var u=0;u<n.length;++u){var x=n[u];if(x&&x.Math==Math)return x}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(n,u){var x=$jscomp.propertyToPolyfillSymbol[u];if(null==x)return n[u];x=n[x];return void 0!==x?x:n[u]};
$jscomp.polyfill=function(n,u,x,B){u&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(n,u,x,B):$jscomp.polyfillUnisolated(n,u,x,B))};$jscomp.polyfillUnisolated=function(n,u,x,B){x=$jscomp.global;n=n.split(".");for(B=0;B<n.length-1;B++){var A=n[B];if(!(A in x))return;x=x[A]}n=n[n.length-1];B=x[n];u=u(B);u!=B&&null!=u&&$jscomp.defineProperty(x,n,{configurable:!0,writable:!0,value:u})};
$jscomp.polyfillIsolated=function(n,u,x,B){var A=n.split(".");n=1===A.length;B=A[0];B=!n&&B in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var E=0;E<A.length-1;E++){var H=A[E];if(!(H in B))return;B=B[H]}A=A[A.length-1];x=$jscomp.IS_SYMBOL_NATIVE&&"es6"===x?B[A]:null;u=u(x);null!=u&&(n?$jscomp.defineProperty($jscomp.polyfills,A,{configurable:!0,writable:!0,value:u}):u!==x&&(void 0===$jscomp.propertyToPolyfillSymbol[A]&&(x=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[A]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(A):$jscomp.POLYFILL_PREFIX+x+"$"+A),$jscomp.defineProperty(B,$jscomp.propertyToPolyfillSymbol[A],{configurable:!0,writable:!0,value:u})))};$jscomp.polyfill("Array.prototype.find",function(n){return n?n:function(u,x){return $jscomp.findInternal(this,u,x).v}},"es6","es3");$jscomp.arrayIteratorImpl=function(n){var u=0;return function(){return u<n.length?{done:!1,value:n[u++]}:{done:!0}}};$jscomp.arrayIterator=function(n){return{next:$jscomp.arrayIteratorImpl(n)}};
$jscomp.initSymbol=function(){};$jscomp.polyfill("Symbol",function(n){if(n)return n;var u=function(E,H){this.$jscomp$symbol$id_=E;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:H})};u.prototype.toString=function(){return this.$jscomp$symbol$id_};var x="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",B=0,A=function(E){if(this instanceof A)throw new TypeError("Symbol is not a constructor");return new u(x+(E||"")+"_"+B++,E)};return A},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(n){if(n)return n;n=Symbol("Symbol.iterator");for(var u="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),x=0;x<u.length;x++){var B=$jscomp.global[u[x]];"function"===typeof B&&"function"!=typeof B.prototype[n]&&$jscomp.defineProperty(B.prototype,n,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return n},"es6",
"es3");$jscomp.iteratorPrototype=function(n){n={next:n};n[Symbol.iterator]=function(){return this};return n};$jscomp.iteratorFromArray=function(n,u){n instanceof String&&(n+="");var x=0,B=!1,A={next:function(){if(!B&&x<n.length){var E=x++;return{value:u(E,n[E]),done:!1}}B=!0;return{done:!0,value:void 0}}};A[Symbol.iterator]=function(){return A};return A};$jscomp.polyfill("Array.prototype.keys",function(n){return n?n:function(){return $jscomp.iteratorFromArray(this,function(u){return u})}},"es6","es3");
(function(){function n(){A.call(this);var E;this.getRemoteUrl=function(){return E};this.setRemoteUrl=function(H){E=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.system&&(com.kingdee.bos.qing.modeler.metriclibrary.system={});var u=com.kingdee.bos.qing.modeler.metriclibrary.system;u.Facade=function(E,H,K,M){x.call(this,E,H,K,M);var z=this.protectedMethod;this.checkMetricSystemPerm=function(){z.remote("checkPermission",{})};this.loadMetricSystem=function(){z.remote("loadMetricSystem",{})};this.loadSystemPermissionInfo=function(L){z.remote("loadSystemPermissionInfo",{id:L})};this.saveOrUpdatePermissionInfo=
function(L){L={model:JSON.stringify(L.toJsonObject())};z.remote("updateSystemPermission",L)};this.copySystem=function(L,aa){L={includeMetric:aa,model:JSON.stringify(L.toJsonObject())};z.remote("copyMetricSystem",L)};this.checkCopyMetricSystem=function(L){L={model:JSON.stringify(L.toJsonObject())};z.remote("checkCopyMetricSystem",L)};this.saveOrUpdateMetricStandard=function(L){L={model:JSON.stringify(L.toJsonObject())};z.remote("saveOrUpdateMetricSystem",L)};this.deleteMetricStandard=function(L){z.remote("deleteMetricSystem",
{id:L})};this.enableMetricSystem=function(L,aa){z.remote("enableMetricSystem",{id:L,isEnable:aa})}};var x,B,A;(function(){var E=com.kingdee.bos.qing.framework.common;x=E.AbstractFacade;B=E.AbstractIcons;A=E.AbstractRemoteCall;E.MultilanguageManager.createPackageAccessor(u)})();u.Icons=new function(){B.call(this);var E=this.protectedMethod;this.protectedInit=function(M,z){M=com.kingdee.bos.qing.modeler.metriclibrary.ComboIcon;if(!M)throw Error("com.kingdee.bos.qing.modeler.metriclibrary.ComboIcon not found.");
M.define(z,"icon_f7");H(0,0,"icon_f7");M.define(z,"table-view");H(0,0,"table-view");M.define(z,"table-view-on");H(0,0,"table-view-on");M.define(z,"card-view");H(0,0,"card-view");M.define(z,"card-view-on");H(0,0,"card-view-on");M.define(z,"model-common");z.setGap(1);z.setStartPosition(0,117);z.setIconSize(16,16);K(0,1,"btn-delete");K(0,2,"btn-edit");z.setStartPosition(0,500);z.setStartPosition(0,151);z.setIconSize(170,98);H(0,0,"icon-empty");z.setStartPosition(1,62);z.setIconSize(20,20);H(0,1,"icon-enable");
H(0,0,"icon-disabled");z.setStartPosition(0,285);z.setIconSize(52,52);H(0,0,"btn-new-image");H(0,1,"btn-new-image_hover");z.setStartPosition(56,337);z.setIconSize(50,50);H(0,0,"icon-preset-big");M.define(z,"model-common2x");z.setStartPosition(0,0);z.setIconSize(32,32);K(0,0,"auth");K(0,1,"disable");K(0,2,"enable");K(0,3,"btn-copy");M.define(z,"metricLibrary");z.setStartPosition(0,0);z.setIconSize(32,32);H(0,0,"metricLibrary")};var H=function(M,z,L){E.registIcon(M,z,L)},K=function(M,z,L){H(M+1,z,L);
H(M,z,L+"_hover")}};u.Integration=new function(){var E=new n,H,K;this.setParamPathPrefix=function(M){H=M};this.getParamPathPrefix=function(){return H};this.getRemoteImpl=function(){return E};this.setRemoteUrl=function(M){E.setRemoteUrl(M)};this.setMetricLibraryEntrance=function(M){K=M};this.getMetricLibraryEntrance=function(){return K}}})();(function(){function n(){var B,A,E,H,K,M,z,L,aa,ja=[],ka=[],X=this;this.setId=function(t){B=t};this.getId=function(){return B};this.setCodeNumber=function(t){A=t};this.getCodeNumber=function(){return A};this.setName=function(t){E=t};this.getName=function(){return E};this.setDesc=function(t){H=t};this.getDesc=function(){return H};this.setCreatorId=function(t){K=t};this.getCreatorId=function(){return K};this.setCreatorName=function(t){M=t};this.getCreatorName=function(){return M};this.setEnabled=function(t){z=
t};this.isEnabled=function(){return z};this.getUsers=function(){return ja};this.setUsers=function(t){ja=t};this.getRoles=function(){return ka};this.setRoles=function(t){ka=t};this.setShared=function(t){L=t};this.isShared=function(){return L};this.isPreset=function(){return aa};this.setPreset=function(t){aa=t};this.copy=function(){var t=new n;t.setId(B);t.setCodeNumber(A);t.setName(E);t.setDesc(H);t.setEnabled(z);t.setCreatorId(K);t.setCreatorName(M);t.setShared(L);t.setPreset(aa);return t};this.fromJsonObject=
function(t){X.setId(t.id);X.setCodeNumber(t.number);X.setName(t.name);X.setDesc(t.desc);X.setEnabled(!t.disabled);X.setCreatorId(t.creatorId);X.setCreatorName(t.creatorName);X.setPreset(t.preset);var W=[],T=t.users;if(T){for(var V=0;V<T.length;V++){var ba=new u;ba.fromJsonObject(T[V]);W.push(ba)}X.setUsers(W)}W=[];if(T=t.roles){for(V=0;V<T.length;V++)ba=new u,ba.fromJsonObject(T[V]),W.push(ba);X.setRoles(W)}L=t.shared};this.toJsonObject=function(){var t={};t.number=A;t.name=E;t.desc=H;t.disabled=
!z;t.id=B;t.creatorId=K;t.preset=aa;for(var W=[],T=0;T<ja.length;T++)W.push(ja[T].toJsonObject());t.users=W;W=[];for(T=0;T<ka.length;T++)W.push(ka[T].toJsonObject());t.roles=W;t.shared=L;return t}}function u(){var B=this,A,E,H;this.getValue=function(){return A};this.setValue=function(K){A=K};this.getText=function(){return E};this.setText=function(K){E=K};this.getUserObject=function(){return H};this.setUserObject=function(K){H=K};this.toJsonObject=function(){var K={};K.value=A;K.text=E;return K};this.fromJsonObject=
function(K){K&&(K.value&&B.setValue(K.value),K.text&&B.setText(K.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 x=com.kingdee.bos.qing.modeler.metriclibrary.system;x.MetricSystem=n;x.ValueTextPair=u;com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(x);n.NOT_PRESET_SYSTEM=1;n.PRESET_SYSTEM=2})();(function(){function n(a,c){ma.call(this);var g=this,d=this.protectedMethod,e,q,f;(function(){var r=h.get("authoritySystem","\u6388\u6743");d.setTitle(r);a?d.setTitle(h.get("editStandard","\u7f16\u8f91\u6307\u6807\u4f53\u7cfb")):d.setTitle(h.get("createStandard","\u65b0\u5efa\u6307\u6807\u4f53\u7cfb"));d.setSelectable(!0);g.setSize(460,360);d.setContentPaneCreator(function(){e=new u(c);return e.getJqUi()});d.setClosingChecker2(function(k){var v=e.checkInput();v?(d.getMessageCurtain().showPrompt(v),
k(!1)):(new ea(ca.getRemoteImpl(),function(b){k(!0);if(a)c.fromJsonObject(b),f&&f(),b=h.get("editSuccess","\u7f16\u8f91\u6307\u6807\u4f53\u7cfb#1\u6210\u529f\u3002").replace("#1",c.getName());else{var m=new da;m.fromJsonObject(b);f&&f(m);b=h.get("createSuccess","\u65b0\u5efa\u6307\u6807\u4f53\u7cfb\u201c#1\u201d\u6210\u529f\u3002").replace("#1",m.getName())}q.showSuccess(b)},function(b,m){return 20011005==b?(q.showPrompt(h.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),
k(!1),!0):20011E3==b?(b=h.get("nameExist",h.get("nameExist","\u540d\u79f0\u201c#1\u201d\u5df2\u5b58\u5728\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002")).replace("#1",m),d.getMessageCurtain().showPrompt(b),k(!1),!0):20011004==b?(b=h.get("codeExist","\u7f16\u7801\u201c#1\u201d\u5df2\u5b58\u5728\uff0c \u8bf7\u91cd\u65b0\u8f93\u5165\u3002").replace("#1",m),d.getMessageCurtain().showPrompt(b),k(!1),!0):20011009==b?(d.getMessageCurtain().showPrompt(h.get("metricSystemDisappeared","\u8be5\u6307\u6807\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),
k(!1),!0):!1})).saveOrUpdateMetricStandard(e.getModel())},function(k){k(!0)},!0);d.setClosingAction(function(k){if(k)return d.destroy(),!0;e.rollBackModel()})})();this.setMessageCurtain=function(r){q=r};this.setSuccessCallBack=function(r){f=r}}function u(a){var c=/^([a-zA-Z_])[a-zA-Z0-9_]{0,}$/,g,d,e,q,f=a,r;this.getJqUi=function(){if(!g){f&&(r=f.copy());var k=$("<div>"),v=new V;v.setRequired(!0);v.setText(h.get("code","\u7f16\u7801"));v=v.getJqUi();d=new ba;f&&d.setReadonly(f.isPreset());d.setPlaceholder(h.get("numberPlaceholder",
"\u5fc5\u987b\u7531\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e0d\u80fd\u4ee5\u6570\u5b57\u5f00\u5934"));f&&d.setText(f.getCodeNumber());var b=d.getJqUi(),m=b.find(".sa-ctrl-textfield-input");f&&f.isPreset()&&m.css("color","#ccc");m=new V;m.setRequired(!0);m.setText(h.get("name","\u540d\u79f0"));m=m.getJqUi();e=new ba;f&&e.setReadonly(f.isPreset());f&&e.setText(f.getName());var C=e.getJqUi(),D=C.find(".sa-ctrl-textfield-input");f&&f.isPreset()&&D.css("color","#ccc");
D=new V;D.setText(h.get("description","\u63cf\u8ff0"));D=D.getJqUi();q=new pa;f&&q.setText(f.getDesc());var I=q.getJqUi();v.appendTo(k);b.appendTo(k);m.appendTo(k);C.appendTo(k);D.appendTo(k);I.appendTo(k);G.layoutCtrl(v,8,0,90,23);G.layoutCtrl(b,76,0,340,23);G.layoutCtrl(m,8,50,90,23);G.layoutCtrl(C,76,50,340,23);G.layoutCtrl(D,8,100,90,23);G.layoutCtrl(I,76,106,340,120);g=k}return g};this.checkInput=function(){var k=$.trim(d.getText());if(0==k.length)return h.get("codeEmpty","\u8bf7\u8f93\u5165\u7f16\u7801\u3002");
if(25<k.length)return h.get("codeTooLong","\u7f16\u7801\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc725\u4e2a\u5b57\u7b26\u3002");if(!k.match(c))return h.get("numberPlaceholderPromt","\u7f16\u7801\u5fc5\u987b\u7531\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e0d\u80fd\u4ee5\u6570\u5b57\u5f00\u5934\u3002");k=$.trim(e.getText());if(0==k.length)return h.get("nameEmpty","\u8bf7\u8f93\u5165\u540d\u79f0\u3002");if(50<k.length)return h.get("nameTooLong","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002");
if(500<$.trim(q.getText()).length)return h.get("descriptionTooLong","\u63cf\u8ff0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7500\u4e2a\u5b57\u7b26\u3002")};this.getModel=function(){a||(f=new da,f.setShared(!1),f.setPreset(!1),f.setEnabled(!0));f.setCodeNumber($.trim(d.getText()));f.setName($.trim(e.getText()));f.setDesc($.trim(q.getText()));return f};this.rollBackModel=function(){r&&f.fromJsonObject(r.toJsonObject())}}function x(){var a,c,g=[],d={},e,q=!1,f=!1,r,k;this.getJqUi=function(){a||v();return a};
this.setMessageCurtain=function(p){c=p};this.getModels=function(){return g};this.setModels=function(p){g=p};this.getSearchHitModel=function(p,w){for(var l=[],F=0;F<g.length;F++)if((!w||g[F].isEnabled())&&q==g[F].isPreset()){var N=g[F].getName().toUpperCase(),U=g[F].getCodeNumber().toUpperCase(),Q=g[F].getDesc().toUpperCase();(-1<N.indexOf(p)||-1<U.indexOf(p)||-1<Q.indexOf(p))&&l.push(g[F])}return l};this.refreshPanel=function(){P()};this.getCardItemById=function(p){return d[p]};var v=function(){a=
$("<div class='metric-library-system-content'>");b();var p=new E;p.setMessageCurtain(c);p.setCreatorListener(function(w){g.unshift(w);w=D(w);r.after(w)});r=p.getJqUi();a.append(r);G.layoutCtrlWithLRTB(a,0,0,null,46,0,null);P()},b=function(){k=$("<div class='metric-library-system-content-empty-preset'>");k.css({"background-color":"white"});var p=$("<div>");G.layoutCtrlWithLRTB(p,0,null,250,0,null,130);var w=$("<div>");w.addClass("no-Preset-System-icon");w.css({position:"absolute",width:"168px",height:"96px",
left:"0",right:"0",bottom:"0",top:"10px"});R.background(w,"icon-empty");var l=$("<div>");l.text(h.get("noPresetSystem","\u6682\u65e0\u9884\u7f6e\u7684\u6307\u6807\u4f53\u7cfb"));p.append(w);p.append(l);k.append(p);k.hide();G.layoutCtrlWithLRTB(k,10,10,null,10,10,null);G.layoutCtrlCenterAlign(w,168);l.css({position:"absolute",width:"100%",bottom:"-52px","text-align":"center","letter-spacing":"1px",color:"#999999","font-size":"14px"});G.layoutCtrlCenterAlign(l,250);G.layoutCtrlCenterAlign(p,250);G.layoutCtrlMiddleAlign(p,
130);a.append(k)},m=function(){var p=Object.keys(d);if(0!==p.length)for(var w=0;w<p.length;w++){var l=d[p[w]];l&&l.removeCard()}};this.updatePanelUi=function(p,w){k.hide();q=p;f=w;var l;if(l=q&&!f){a:{for(l=0;l<g.length;l++)if(g[l].isPreset()){l=!0;break a}l=!1}l=!l}l&&k&&k.show();p?r.hide():r.show();m();for(l=0;l<g.length;l++)if((!w||g[l].isEnabled())&&p==g[l].isPreset()){var F=D(g[l]);a.append(F)}};this.setCardItemSelected=function(p){C(p)};var C=function(p){e&&d[e]&&d[e].setSelected(!1);e=p;d[p]&&
d[p].setSelected(!0)},D=function(p){var w=new H(p);w.setSelectedGroupListener(C);w.setMessageCurtain(c);w.setCopyListener(O);w.setRemoveListener(I);d[p.getId()]=w;return w.getJqUi()},I=function(p){for(var w=0;w<g.length;w++){var l=g[w].getId();if(l==p.getId()){d[l]=void 0;g.splice(w,1);break}}},O=function(p){var w=new da;w.fromJsonObject(p);g.unshift(w);p=D(w);q?a.prepend(p):r.after(p)},P=function(){(new ea(ca.getRemoteImpl(),function(p){m();for(var w=[],l=0;l<p.length;l++){var F=p[l],N=new da;N.fromJsonObject(F);
w.push(N);F=D(N);!N.isEnabled()&&f||q!=N.isPreset()||a.append(F)}g=w},function(p){if(20011005==p)return c.showPrompt(h.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0})).loadMetricSystem()}}function B(){var a,c,g;this.setTips=function(d){a=d};this.setConfirmListener=function(d){c=d};this.setIsConfirmMsg=function(d){g=d};this.showDialog=function(){var d=Y.createFeedbackDialog();d.setOptionType(Y.OPTION_OK_CANCEL);g?d.setMsgImageType(Y.MSG_CONFIRM):d.setMsgImageType(Y.MSG_DELETE);
d.setMessage(a);d.setClosingChecker(function(e){e==Y.RETURN_OK&&c&&c();return!0});d.showDialog()}}function A(){var a;this.setMessageCurtain=function(c){a=c};this.getMessageCurtain=function(){return a}}function E(){A.call(this);var a,c,g=this,d,e;this.setCreatorListener=function(k){a=k};var q=function(k){k?(k=new n(!1),k.setSuccessCallBack(a),k.setMessageCurtain(g.getMessageCurtain()),k.showDialog()):g.getMessageCurtain().showPrompt(h.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002"))},
f=function(){(new ea(ca.getRemoteImpl(),q,function(k){if(20011005==k)return g.getMessageCurtain().showPrompt(h.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0})).checkMetricSystemPerm()},r=function(){c=$("<div class='metric-library-system-card'>");c.on("mouseenter",function(){e.css("color","#276FF5");R.background(d,"btn-new-image_hover")});c.on("mouseleave",function(){e.css("color","#999999");R.background(d,"btn-new-image")});d=$("<div class='metric-library-system-card-creator-icon'>");
d.addClass("metric-library-system-card-creator-icon");R.background(d,"btn-new-image");c.append(d);G.layoutCtrlCenterAlign(d,50);e=$('<div class="metric-library-system-card-creator">');e.text(h.get("createStandard","\u65b0\u5efa\u6307\u6807\u4f53\u7cfb"));e.attr(h.get("createStandard","\u65b0\u5efa\u6307\u6807\u4f53\u7cfb"));c.append(e);c.on("click",f);return c};this.getJqUi=function(){c||(c=r());return c}}function H(a){A.call(this);var c,g,d=this,e,q,f,r=!1,k,v,b;this.removeCard=function(){c&&c.remove()};
this.setSelected=function(l,F){r!=l&&((r=l)?c.addClass("metric-library-system-card-selected"):c.removeClass("metric-library-system-card-selected"))};this.setSelectedGroupListener=function(l){k=l};this.setCopyListener=function(l){v=l};this.setRemoveListener=function(l){b=l};this.getModel=function(){return a};var m=function(){var l=$("<div class='metric-library-system-card-pic'>");R.background(l,"metricLibrary");G.layoutCtrlWithLRTB(l,-10,null,100,5,null,100);c.append(l)},C=function(){e=$("<div class='metric-library-system-card-title'>");
e.text(a.getName());e.attr("title",a.getName());e.on("click",function(){var l=ca.getMetricLibraryEntrance();l&&l(a.getId(),a.getName())});c.append(e);a.isPreset()?e.css({width:"200px"}):(c.on("mouseenter",function(){g&&g.show();e.css({width:"180px"})}),c.on("mouseleave",function(){g&&g.hide();e.css({width:"220px"})}))},D=function(){var l=$("<div class='metric-library-system-card-preset-tag'>"),F=$("<div class='metric-library-system-card-preset-text'>");G.makeSelectable(F);F.text(h.get("presetTag",
"\u9884 \u7f6e"));var N=$("<div class='metric-library-system-card-preset-icon'>");R.background(N,"icon-preset-big");F.appendTo(l);N.appendTo(l);c.append(l)},I=function(){g=$("<div class='metric-library-system-card-operation'>");var l=$("<span class='metric-library-system-card-operation-edit'>");l.attr("title",h.get("edit","\u7f16\u8f91"));l.on("click",function(){var F=new n(!0,a);F.setMessageCurtain(d.getMessageCurtain());F.setSuccessCallBack(p);F.showDialog()});R.backgroundWithHover(l,"btn-edit");
l.appendTo(g);l=$("<span class='metric-library-system-card-operation-delete'>");l.attr("title",h.get("del","\u5220\u9664"));l.on("click",function(){var F=a.getName();F=h.get("delMetricStandardConfirm","\u5220\u9664\u201c#1\u201d\u6307\u6807\u4f53\u7cfb\u540e\u5c06\u65e0\u6cd5\u6062\u590d\uff08\u5305\u62ec\u4f53\u7cfb\u4e0b\u7684\u76ee\u5f55\uff09\uff0c\u786e\u5b9a\u5220\u9664\u5417\uff1f").replace("#1",F);var N=new B;N.setTips(F);N.setConfirmListener(function(){(new ea(ca.getRemoteImpl(),function(U){U=
h.get("deleteOneSuccess","\u5220\u9664\u6307\u6807\u4f53\u7cfb\u6210\u529f\u3002");d.getMessageCurtain().showSuccess(U);d.removeCard();b&&b(a)},function(U){return 20011005==U?(d.getMessageCurtain().showPrompt(h.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):20011003==U?(d.getMessageCurtain().showPrompt(h.get("deleteMetricStandardBefore","\u8bf7\u5148\u79fb\u9664\u8be5\u6307\u6807\u4f53\u7cfb\u4e0b\u7684\u6307\u6807\uff0c\u518d\u5220\u9664\u6307\u6807\u4f53\u7cfb\u3002")),
!0):!1})).deleteMetricStandard(a.getId())});N.showDialog()});R.backgroundWithHover(l,"btn-delete");l.appendTo(g);g.hide();c.append(g)},O=function(){var l=$("<div class='metric-library-system-card-body'>");f=$("<div class='metric-library-system-card-body-item'>");f.text(h.get("codeWithColon","\u7f16\u7801\uff1a")+a.getCodeNumber());f.attr("title",a.getCodeNumber());q=$("<div class='metric-library-system-card-body-item'>");q.text(h.get("descriptionWithColon","\u63cf\u8ff0\uff1a")+a.getDesc());q.attr("title",
a.getDesc());l.append(f);l.append(q);c.append(l)},P=function(){var l=$("<div>");G.layoutCtrlWithLRTB(l,0,0,null,null,0,30);var F=$("<span class='metric-library-system-card-pic'>"),N=a.isEnabled();F.attr("title",N?h.get("disabledCLick","\u70b9\u51fb\u7981\u7528"):h.get("enableClick","\u70b9\u51fb\u542f\u7528"));F.css({cursor:"pointer"});F.on("click",function(){var Q=function(){(new ea(ca.getRemoteImpl(),function(Z){Z=a.isEnabled()?h.get("disableOneSuccess","\u6307\u6807\u4f53\u7cfb#1\u7981\u7528\u6210\u529f\u3002"):
h.get("enableOneSuccess","\u6307\u6807\u4f53\u7cfb#1\u542f\u7528\u6210\u529f\u3002");Z=Z.replace("#1",a.getName());a.setEnabled(!a.isEnabled());a.isEnabled()?R.backgroundWithHover(F,"enable"):R.backgroundWithHover(F,"disable");F.attr("title",a.isEnabled()?h.get("disabledCLick","\u70b9\u51fb\u7981\u7528"):h.get("enableClick","\u70b9\u51fb\u542f\u7528"));d.getMessageCurtain().showSuccess(Z,2E3)},function(Z){if(20011005==Z)return d.getMessageCurtain().showPrompt(h.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),
!0;if(20011009==Z)return d.getMessageCurtain().showPrompt(h.get("metricSystemDisappeared","\u8be5\u6307\u6807\u4f53\u7cfb\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),!0})).enableMetricSystem(a.getId(),!a.isEnabled())};if(a.isEnabled()){var fa=h.get("disableConfirm","\u201c#1\u201d\u6307\u6807\u4f53\u7cfb\u7981\u7528\u540e\uff0c\u8be5\u4f53\u7cfb\u4e0b\u7684\u6307\u6807\u5c06\u65e0\u6cd5\u4f7f\u7528\uff0c\u786e\u8ba4\u7981\u7528\u5417\uff1f").replace("#1",a.getName());var ia=new B;ia.setTips(fa);
ia.setIsConfirmMsg(!0);ia.setConfirmListener(Q);ia.showDialog()}else Q()});R.backgroundWithHover(F,N?"enable":"disable");G.layoutCtrlWithLRTB(F,null,68,34,null,-4,34);N=$("<span class='metric-library-system-card-pic'>");N.css({cursor:"pointer"});N.attr("title",h.get("copy","\u590d\u5236"));N.on("click",function(){(new ea(ca.getRemoteImpl(),function(Q){var fa=new da;fa.fromJsonObject(Q);Q=new t(fa);Q.setCopyListener(v);Q.setOutMessageCurtain(d.getMessageCurtain());Q.showDialog()},function(Q){if(20011005==
Q)return d.getMessageCurtain().showPrompt(h.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0;if(20011009==Q)return d.getMessageCurtain().showPrompt(h.get("metricSystemDisappeared","\u8be5\u6307\u6807\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),!0})).checkCopyMetricSystem(a)});R.backgroundWithHover(N,"btn-copy");G.layoutCtrlWithLRTB(N,null,39,34,null,-4,34);var U=$("<span class='metric-library-system-card-pic'>");U.attr("title",h.get("authoritySystem",
"\u6388\u6743"));U.css({cursor:"pointer"});R.backgroundWithHover(U,"auth");G.layoutCtrlWithLRTB(U,null,10,34,null,-4,34);U.on("click",function(){(new ea(ca.getRemoteImpl(),function(Q){a.fromJsonObject(Q);Q=new L(a);Q.setMessageCurtain(d.getMessageCurtain());Q.showDialog()},function(Q,fa){return"20011005"==Q?(d.getMessageCurtain().showPrompt(h.get("noDbManagePerm","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):20011009==Q?(d.getMessageCurtain().showPrompt(h.get("metricSystemDisappeared",
"\u8be5\u6307\u6807\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),!0):!1})).loadSystemPermissionInfo(a.getId())});l.append(F);l.append(N);l.append(U);c.append(l)},p=function(){e.text(a.getName());e.attr("title",a.getName());f.text(h.get("codeWithColon","\u7f16\u7801\uff1a")+a.getCodeNumber());f.attr("title",a.getCodeNumber());q.text(h.get("descriptionWithColon","\u63cf\u8ff0\uff1a")+a.getDesc());q.attr("title",a.getDesc())},w=function(){c=$("<div class='metric-library-system-card'>");c.on("click",
function(){k&&k(a.getId())});a&&(c.attr("id",a.getId()),m(),C(),a.isPreset()?D():I(),O(),P());return c};this.getJqUi=function(){c||(c=w());return c}}function K(){var a=350,c=250,g=6,d=!1,e,q;this.setDuration=function(f,r){a=f;c=r};this.setTimes=function(f,r){g=2*f+(r?1:0);d=r};this.setAction=function(f){e=f};this.blink=function(f,r,k){if(0>=g)throw Error("Illegal usage");clearTimeout(q);var v=function(){if(0==g)e&&e();else{if(g%2==(d?0:1)){f.addClass(r);var b=a}else f.removeClass(r),f.addClass(k),
b=c;q=setTimeout(v,b);g--}};v()}}function M(){var a,c=[],g,d,e,q;this.getJqUi=function(){a||f();return a};this.setFunCloseSearchResultPanel=function(b){d=b};this.refresh=function(){var b=a.find(".sa-ctrl-list-owner");b.empty();b.css("top","40px");for(var m=$(document.createDocumentFragment()),C=k,D=0;D<c.length;D++){var I=$("<div>");I.addClass("sa-ctrl-list-item");I.addClass("sa-ctrl-list-item_enabled");I.addClass("sa-ctrl-list-item-defaultlayout");var O=c[D];I.data("model",O);C(I,O);m.append(I)}b.append(m);
0==c.length&&(m=b.append,C=(new qa).getJqUi(),m.call(b,C))};var f=function(){a=$("<div>");a.addClass("metric-system-search-lists");a.css({"float":"right",right:"0px",height:"100%",width:"300px",position:"absolute",top:"56px",background:"white","z-index":"99999"});e||(e=new ra,e.scrollSelectedToVisible(),e.setCustomItemPainter(k),e.addSelectedChangedListener(r),e.setUserObject(c),e.setItemModels(c));var b=e.getJqUi();b.find(".sa-ctrl-list-owner").css({top:"40px",bottom:"100px","overflow-x":"hidden"});
a.append(b);b=$("<div>");b.addClass("metric-system-search-close");b.css({width:"100px",height:"28px",left:"0",right:"0",bottom:"24px",margin:"auto",position:"absolute","font-size":"14px",color:"white","text-align":"center","line-height":"28px","border-radius":"2px","margin-bottom":"45px","background-color":"var(--color-main, #5582f3)",cursor:"pointer"});var m=$("<div>");m.text(h.get("close","\u5173\u95ed"));m.appendTo(b);b.on("click",function(){d&&d()});a.append(b)};this.setSearchText=function(b){g=
b};this.setFunItemSelectedListener=function(b){q=b};this.setArrItemModel=function(b){c=b};var r=function(b,m,C){C&&0<C.length&&(b=C[0],q&&q(b))},k=function(b,m){b.addClass("metric-system-search-item");b.css({width:"270px",height:"75px","border-bottom":"1px solid #E2E7EF",left:"6px",top:"0px"});var C=$("<span class='metric-system-search-item-type'>");R.background(C,"metricLibrary");C.css({position:"absolute",width:"96px",height:"96px","transform-origin":"top",top:"6px",left:"-36px"});var D=$("<div class='metric-library-system-card-preset-tag'>"),
I=$("<div class='metric-library-system-card-preset-text'>");G.makeSelectable(I);I.text(h.get("presetTag","\u9884 \u7f6e"));var O=$("<div class='metric-library-system-card-preset-icon'>");R.background(O,"icon-preset-big");I.appendTo(D);O.appendTo(D);I=$("<span>");I.addClass("metric-system-search-item-name");I.css({position:"absolute","font-size":"14px",color:"black",width:"200px",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis",top:"5px","margin-left":"27px"});I.attr("title",m.getName());
O=$("<div class='metric-system-search-item-code'>");var P=$("<span>");P.text(h.get("codeWithColon","\u7f16\u7801\uff1a"));var p=$("<span>");O.append(P);O.append(p);O.css({position:"absolute",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis",width:"220px",top:"28px"});b.append(O);P=$("<div class='metric-system-search-item-description'>");p=$("<span>");p.text(h.get("descriptionWithColon","\u63cf\u8ff0\uff1a"));p.css({top:"22px"});var w=$("<span>"),l=m.getDesc().trim();w.addClass("metric-system-search-item-desc");
w.css({width:"220px","white-space":"nowrap",height:"20px",overflow:"hidden","text-overflow":"ellipsis"});w.attr("title",m.getDesc());P.css({position:"absolute",top:"50px"});P.append(p);P.append(w);b.append(C);m.isPreset()&&b.append(D);b.append(I);l&&0<l.length&&b.append(P);g&&(v(I,m.getName(),g),v(O,m.getCodeNumber(),g),v(w,l,g));b.on("click",function(F){e.setSelecteds([])})},v=function(b,m,C){if(b&&m&&C){C=C.toUpperCase();var D=m.toUpperCase(),I=D.split(C),O=C.length,P;for(P in I){var p=D.indexOf(I[P]),
w=m.substr(0,I[P].length);p+=I[P].length;var l=D.length-p;D=D.substr(p,l);m=m.substr(p,l);p=$("<span>");p.text(w);p.appendTo(b);P!=I.length-1&&1<I.length&&(p=D.indexOf(C),w=m.substr(p,O),p+=O,l=D.length-p,D=D.substr(p,l),m=m.substr(p,l),p=$("<span>"),p.text(w),p.css("color","red"),p.clone().appendTo(b))}}}}function z(a){var c,g,d,e,q=function(){var f=$("<div>"),r=$("<div>");r.css("color","#666666");var k=$("<span>"),v=$("<span class='metric-library-system-card-perm-tip'>");r.text(h.get("authExplain",
"\u6388\u6743\u529f\u80fd\u8bf4\u660e"));var b=new sa;b.setTipsSize(350,90);b.setTipsHtml(h.get("authPermHelpTip","1\u3001\u6388\u6743\u540e\uff0c\u7528\u6237\u6216\u89d2\u8272\u53ef\u4ee5\u5728\u6570\u636e\u5de5\u4f5c\u53f0\u7b49\u5e94\u7528\u4e2d\u4f7f\u7528\u8be5\u6307\u6807\u4f53\u7cfb\uff1b<br/>2\u3001\u88ab\u6388\u6743\u6307\u6807\u4f53\u7cfb\u5e76\u4e0d\u610f\u5473\u7740\u80fd\u4f7f\u7528\u4f53\u7cfb\u4e0b\u7684\u6240\u6709\u6307\u6807\uff0c\u7528\u6237\u6216\u89d2\u8272\u53ef\u4f7f\u7528\u7684\u6307\u6807\u4ecd\u53d7\u6570\u636e\u6743\u9650\u63a7\u5236\u3002"));
b=b.getJqUi();v.append(b);G.layoutCtrl(b,0,0,16,16);r.append(k);r.append(v);k=new ta;v=new V;v.setText(h.get("ByUser","\u7528\u6237"));v=v.getJqUi();d=new ka;b=d.getJqUi();var m=new V;m.setText(h.get("ByRole","\u89d2\u8272"));g=new ja;m=m.getJqUi();var C=g.getJqUi();d.setSelectedValue(a.getUsers());d.setDisabled(!1);g.setSelectedValue(a.getRoles());g.setDisabled(!1);var D=new na;D.setText(h.get("authSpecified","\u6388\u6743\u7ed9\u6307\u5b9a\u89d2\u8272\u6216\u7528\u6237"));D.addCheckedListener(function(P,
p){P.isChecked()&&(d.setDisabled(!1),g.setDisabled(!1))});var I=D.getJqUi();$(I.find(".sa-ctrl-common-foreground_enabled")).css({"font-size":"14px","font-weight":"500","margin-top":"-10px"});e=new na;e.setText(h.get("authAll","\u6388\u6743\u7ed9\u6240\u6709\u7528\u6237"));e.addCheckedListener(function(P,p){P.isChecked()&&(d.setDisabled(!0),g.setDisabled(!0))});var O=e.getJqUi();$(O.find(".sa-ctrl-common-foreground_enabled")).css({"font-size":"14px","font-weight":"500","margin-top":"-10px"});k.addElement(D);
k.addElement(e);a.isShared()?e.setChecked(!0):D.setChecked(!0);G.layoutCtrl(r,20,9,300,23);G.layoutCtrl(I,20,40,300,23);G.layoutCtrl(m,40,85,64,23);G.layoutCtrl(C,120,85,200,23);G.layoutCtrl(v,40,135,64,23);G.layoutCtrl(b,120,135,200,23);G.layoutCtrl(O,20,183,164,23);f.append(r);f.append(I);f.append(v);f.append(b);f.append(m);f.append(C);f.append(O);return f};this.udpateModelAfterCallBack=function(f){f?(a.setUsers([]),a.setRoles([]),a.setShared(!0)):a.setShared(!1)};this.getJqUi=function(){c||(c=
q());return c};this.isAuthToAll=function(){return e.isChecked()};this.getSelectedUsers=function(){return d.getSelectedValue()};this.getSelectedRoles=function(){return g.getSelectedValue()}}function L(a){ma.call(this);var c=this.protectedMethod,g,d;(function(){var e=h.get("authoritySystem","\u6388\u6743");c.setTitle(e);c.setSelectable(!0);c.setMinSize(400,350);c.setContentPaneCreator(function(){g=new z(a);return g.getJqUi()});c.setClosingAction(function(q){if(q){var f=g.isAuthToAll();a.setUsers(g.getSelectedUsers());
a.setRoles(g.getSelectedRoles());a.setShared(f);(new ea(ca.getRemoteImpl(),function(){g.udpateModelAfterCallBack(f);c.destroy();d.showSuccess(h.get("authorizationSucceeds","\u6388\u6743\u6210\u529f\u3002"));return!0},function(r){if(20011009==r)return d.showPrompt(h.get("metricSystemDisappeared","\u8be5\u6307\u6807\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),!0;c.destroy();d.showPrompt(h.get("authorizationFailed","\u6388\u6743\u5931\u8d25\u3002"));return!1})).saveOrUpdatePermissionInfo(a)}})})();
this.setMessageCurtain=function(e){d=e}}function aa(){var a=this,c,g,d;this.setDisabled=function(e){e?g.css("color","#ccc"):g.css("color","#666");d=e};this.getDisabled=function(){return d};this.getJqUi=function(){if(!c){c=$("<div>");c.addClass("metric-library-system-card-perm-dialog");g=$("<input readonly=readonly>");g.addClass("metric-library-system-card-perm-dialog-input");g.on("click",a.protectedClickEvent);var e=$("<span>");e.addClass("metric-library-system-card-perm-dialog-icon");R.background(e,
"icon_f7");e.appendTo(c);g.appendTo(c);a.updateUI();e.on("click",a.protectedClickEvent)}return c};this.setSelectedValue=function(){throw Error("override me");};this.getSelectedValue=function(){throw Error("override me");};this.getDisplayText=function(){throw Error("override me");};this.protectedClickEvent=function(){throw Error("override me");};this.updateUI=function(){g.val(a.getDisplayText());g.attr("title",a.getDisplayText())};this.getPermissionCallBack=function(e){if(e&&e.content){var q=e.content;
e=q.selecteds;if("cancel"!=q.operation&&"undefined"!=e){q=Object.keys(e);for(var f=[],r=0;r<q.length;r++){var k=q[r],v=e[k],b=new ua;b.setValue(k);b.setText(v);f.push(b)}return f}}}}function ja(){aa.call(this);var a=this,c=[],g=!1,d,e,q;this.setSelectedListener=function(b){q=b};var f=a.getJqUi;this.getJqUi=function(){d||(d=f(),r(),d.on("mouseover",function(){0<c.length&&!a.getDisabled()&&e.show()}),d.on("mouseleave",function(){e.hide()}));return d};this.protectedClickEvent=function(){g||!a.getDisabled()&&
k()};this.setSelectedValue=function(b){c=b;a.updateUI()};this.getSelectedValue=function(){return c};this.getDisplayText=function(){if(0==c.length||0<c.length&&!c[0])var b=h.get("selectNoRole","\u5c1a\u672a\u9009\u62e9\u89d2\u8272");else{var m=c[0].getText();b=h.get("selectMultiRole","\u5df2\u9009\u62e9#1\u7b49#2\u4e2a\u89d2\u8272").replace("#2",c.length);var C=h.get("selectSingleRole","\u5df2\u9009\u62e9\u89d2\u8272#1");b=1==c.length?C:b;b=b.replace("#1",m)}return b};var r=function(){e=$("<div>");
e.css({position:"absolute",bottom:"6px",height:"18px",width:"18px",right:"25px",cursor:"pointer",display:"none"});R.backgroundWithHover(e,"btn-delete");e.on("click",function(){var b=new Y.createFeedbackDialog;b.setMsgImageType(Y.MSG_CONFIRM);b.setMessage(h.get("confirmClearAuthority","\u786e\u5b9a\u6e05\u7a7a\u6388\u6743\uff1f"));b.setClosingChecker(function(m){m==Y.RETURN_OK&&(c=[],q&&q(c),a.updateUI());return!0});b.showDialog()});e.appendTo(d)},k=function(){g=!0;var b=oa;b.setCallBack(function(m){g=
!1;if(m=a.getPermissionCallBack(m))c=m,a.updateUI(),q&&q(c)});b.openRoleForm(v())},v=function(){for(var b=[],m=0;m<c.length;m++){var C=c[m].getValue();b.push(C)}return b}}function ka(){aa.call(this);var a=this,c=[],g=!1,d,e,q;this.setSelectedListener=function(b){q=b};var f=a.getJqUi;this.getJqUi=function(){d||(d=f(),r(),d.on("mouseover",function(){0<c.length&&!a.getDisabled()&&e.show()}),d.on("mouseleave",function(){e.hide()}));return d};this.setSelectedValue=function(b){c=b;a.updateUI()};this.getSelectedValue=
function(){return c};this.protectedClickEvent=function(){g||!a.getDisabled()&&k()};this.getDisplayText=function(){if(0==c.length||0<c.length&&!c[0])var b=h.get("selectNoUser","\u5c1a\u672a\u9009\u62e9\u7528\u6237");else{var m=c[0].getText();b=h.get("selectMultiUser","\u5df2\u9009\u62e9#1\u7b49#2\u4e2a\u7528\u6237").replace("#2",c.length);var C=h.get("selectSingleUser","\u5df2\u9009\u62e9\u7528\u6237#1");b=1==c.length?C:b;b=b.replace("#1",m)}return b};var r=function(){e=$("<div>");e.css({position:"absolute",
bottom:"6px",height:"18px",width:"18px",right:"25px",cursor:"pointer",display:"none"});R.backgroundWithHover(e,"btn-delete");e.on("click",function(){var b=Y.createFeedbackDialog();b.setMsgImageType(Y.MSG_CONFIRM);b.setMessage(h.get("confirmClearAuthority","\u786e\u5b9a\u6e05\u7a7a\u6388\u6743\uff1f"));b.setClosingChecker(function(m){m==Y.RETURN_OK&&(c=[],q&&q(c),a.updateUI());return!0});b.showDialog()});e.appendTo(d)},k=function(){g=!0;var b=oa;b.setCallBack(function(m){g=!1;if(m=a.getPermissionCallBack(m))c=
m,a.updateUI(),q&&q(c)});b.openUserForm(v())},v=function(){for(var b=[],m=0;m<c.length;m++){var C=c[m].getValue();b.push(C)}return b}}function X(a){var c,g,d,e,q=/^([a-zA-Z_])[a-zA-Z0-9_]{0,}$/;this.getJqUi=function(){if(!d){d=$("<div>");var f=new V;f.setRequired(!0);f.setText(h.get("code","\u7f16\u7801"));f=f.getJqUi();c=new ba;c.setPlaceholder(h.get("numberPlaceholder","\u5fc5\u987b\u7531\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e0d\u80fd\u4ee5\u6570\u5b57\u5f00\u5934"));
c.setText(a.getCodeNumber());var r=c.getJqUi(),k=new V;k.setRequired(!0);k.setText(h.get("name","\u540d\u79f0"));k=k.getJqUi();g=new ba;g.setText(a.getName());var v=g.getJqUi();e=new va;e.setChecked(!0);e.setText(h.get("copySystemWithMetric","\u540c\u65f6\u643a\u5e26\u6307\u6807\u4f53\u7cfb\u4e0b\u7684\u6240\u6709\u6307\u6807"));var b=e.getJqUi();d.append(f);d.append(r);d.append(k);d.append(v);d.append(b);G.layoutCtrl(f,8,15,90,23);G.layoutCtrl(r,76,15,280,23);G.layoutCtrl(k,8,65,90,23);G.layoutCtrl(v,
76,65,280,23);G.layoutCtrl(b,8,115,350,23)}return d};this.checkInput=function(){var f=$.trim(c.getText());if(0===f.length)return h.get("codeEmpty","\u8bf7\u8f93\u5165\u7f16\u7801\u3002");if(25<f.length)return h.get("codeTooLong","\u7f16\u7801\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc725\u4e2a\u5b57\u7b26\u3002");if(!f.match(q))return h.get("numberPlaceholderPromt","\u7f16\u7801\u5fc5\u987b\u7531\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e0d\u80fd\u4ee5\u6570\u5b57\u5f00\u5934\u3002");
f=$.trim(g.getText());if(0===f.length)return h.get("nameEmpty","\u8bf7\u8f93\u5165\u540d\u79f0\u3002");if(50<f.length)return h.get("nameTooLong","\u540d\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002")};this.isCopyMetricChecked=function(){return e.isChecked()};this.getCopyModel=function(){a.setCodeNumber($.trim(c.getText()));a.setName($.trim(g.getText()));a.setShared(!1);a.setUsers([]);a.setRoles([]);a.setPreset(!1);a.setEnabled(!0);return a}}function t(a){ma.call(this);var c=
this.protectedMethod,g,d,e;(function(){var f=h.get("copySystem","\u590d\u5236\u6307\u6807\u4f53\u7cfb");c.setTitle(f);c.setSelectable(!0);c.setMinSize(400,280);c.setContentPaneCreator(function(){d=new X(a);return d.getJqUi()});c.setClosingChecker2(function(r){(r=d.checkInput())?c.getMessageCurtain().showPrompt(r):q()});c.setClosingAction(function(r){})})();this.setCopyListener=function(f){e=f};var q=function(){var f=d.getCopyModel(),r=d.isCopyMetricChecked();(new ea(ca.getRemoteImpl(),function(k){c.destroy();
e&&e(k);g.showSuccess(h.get("copySystemSuccess","\u590d\u5236\u6307\u6807\u4f53\u7cfb\u6210\u529f\u3002"))},function(k,v){return 20011005==k?(c.getMessageCurtain().showPrompt(h.get("noMenuPermission","\u60a8\u6ca1\u6709\u5f53\u524d\u83dc\u5355\u6743\u9650\u3002")),!0):20011009==k?(c.getMessageCurtain().showPrompt(h.get("metricSystemDisappeared","\u8be5\u6307\u6807\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),!0):20011E3==k?(c.getMessageCurtain().showPrompt(h.get("nameExist","\u540d\u79f0\u5df2\u5b58\u5728\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002").replace("#1",
v)),!0):20011004==k?(c.getMessageCurtain().showPrompt(h.get("codeExist","\u7f16\u7801\u5df2\u5b58\u5728\uff0c \u8bf7\u91cd\u65b0\u8f93\u5165\u3002").replace("#1",v)),!0):!1})).copySystem(f,r)};this.setOutMessageCurtain=function(f){g=f}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.modeler&&(com.kingdee.bos.qing.modeler=
{});"undefined"==typeof com.kingdee.bos.qing.modeler.metriclibrary&&(com.kingdee.bos.qing.modeler.metriclibrary={});"undefined"==typeof com.kingdee.bos.qing.modeler.metriclibrary.system&&(com.kingdee.bos.qing.modeler.metriclibrary.system={});com.kingdee.bos.qing.modeler.metriclibrary.system.Main=function(){var a=new wa,c=new T,g,d,e,q,f,r,k,v,b,m,C,D=!1;this.getJqUi=function(){b||I();return b};var I=function(){b=$("<div class='metric-library-manage'>");G.layoutCtrlWithLRTB(b,0,0,null,0,0,null);P(b);
d=new x;d.setMessageCurtain(c);b.append(c.getJqUi());r=d.getJqUi();b.append(r);O();var y=new xa;y.setCallbackImmediately(function(){O();r&&r.css({width:ia()+"px"})});y.setDelay(250);y.observe()},O=function(){document.body.style.height=document.documentElement.clientHeight+"px"},P=function(y){m=a.getJqUi();m.addClass("metric-library-manage-toolbar");p(!1,N,"btn_refresh",h.get("refresh","\u5237\u65b0"),h.get("refresh","\u5237\u65b0"));var J=$("<div>");J.text(h.get("showOnlyEnable","\u4ec5\u663e\u793a\u5df2\u542f\u7528\u7684\u6307\u6807\u4f53\u7cfb"));
G.layoutCtrlWithLRTB(J,null,402,null,16,null,20);J.appendTo(m);e=new ya;e.setOn(!1);e.addStateChangeListener(l);J=e.getJqUi();J.addClass("metric-library-manage-toolbar-enableBtn");J.appendTo(m);G.layoutCtrlWithLRTB(J,null,358,35,14,null,20);w();F();y.append(m)},p=function(y,J,S,ha,la){J=a.createButton(m,y,J,ha,la);J.setIconSetter(function(Ba,Ca){R.background(Ba,Ca)});J.setIconName(S);y&&J.setShowDropdownArrow(!0);return J},w=function(){var y=[da.NOT_PRESET_SYSTEM,da.PRESET_SYSTEM];v=new za;v.setItemModels(y);
v.setSelected(y[0]);v.addSelectedChangedListener(function(J,S,ha){J=ha==da.PRESET_SYSTEM;S=e.isOn();d.updatePanelUi(J,S);D&&Z()});v.setCustomPainter(function(J,S,ha){ha===da.NOT_PRESET_SYSTEM?S.text(h.get("publicSystem","\u516c\u5171\u6307\u6807\u4f53\u7cfb")):S.text(h.get("presetSystem","\u9884\u7f6e\u6307\u6807\u4f53\u7cfb"))});y=v.getJqUi();y.appendTo(m);G.layoutCtrlWithLRTB(y,null,234,108,4,null,40)},l=function(y,J,S){J&&(y=v.getSelected()==da.PRESET_SYSTEM,d.updatePanelUi(y,S),D&&Z(),console.log("switch the button: "+
S))},F=function(){g=new Aa;g.addSearchListener(Z);g.setSearchListenerDelay(1E3);g.setPlaceholder(h.get("searchBoxPlaceholder","\u641c\u7d22\u7f16\u7801/\u540d\u79f0/\u63cf\u8ff0"));g.setShowSearchIcon(!0);C=g.getJqUi();C.addClass("metric-system-toolbar-searchBox");C.appendTo(m);C.find(":input").on("keydown",function(y){13==(y.keyCode||y.which||y.charCode)&&Z()})},N=function(){d.refreshPanel()},U=function(y){var J=$(document.body).children(".sa-ctrl-common-popup"),S=$(document.body).find(".metric-library-manage-toolbar-enableBtn");
for(y=y.target;y!=document.body;){if(y==C[0]||r&&y==r[0]||q&&y==q.getJqUi()[0]||v&&y==v.getJqUi()[0]||J&&y==J[0]||S&&y==S[0])return;y=y.parentNode}q&&fa(!1);document.body.removeEventListener("mousedown",U,!0)},Q=function(y,J,S){J=J.prop("offsetTop");document.querySelector("."+y).scrollTop=0>=J?0:J-20},fa=function(y){(D=y)?q.getJqUi().show():q.getJqUi().hide();y=ia(y);r.css("width",y+"px")},ia=function(y){var J=document.documentElement.clientWidth;q&&(y||"block"==q.getJqUi().css("display"))&&(J-=q.getJqUi().width());
return J},Z=function(){var y=function(S){var ha=$("#"+S.getId());if(d.getCardItemById(S.getId())){Q("metric-library-system-content",ha);var la=new K;la.setTimes(2,!0);la.blink(ha,"metric-library-system-card-twinkle-high-light","metric-library-system-card-selected");la.setAction(function(){d.setCardItemSelected(S.getId())})}};f=g.getText();var J=0;q||(q=new M,q.setFunCloseSearchResultPanel(function(){q&&fa(!1)}),q.setFunItemSelectedListener(y),q.getJqUi().appendTo(b));k||(k=$("<div>"),k.addClass("metric-system-search-total-records"),
k.text(h.get("searchTotalRecords","\u5171\u627e\u5230\u201c#1\u201d\u4e2a\u7ed3\u679c").replace("#1",J)),k.css({"margin-top":"16px","margin-left":"10px",height:"20px",width:"300px","border-bottom":"2px solid rgb(226, 231, 239)"}),k.appendTo(q.getJqUi()));document.body.addEventListener("mousedown",U,!0);fa(!0);y=[];f&&f.trim()?(f=f.trim().toUpperCase(),q.setSearchText(f),y=e.isOn(),y=d.getSearchHitModel(f,y),q.setArrItemModel(y),J=y.length,k.text(h.get("searchTotalRecords","\u5171\u627e\u5230#1\u4e2a\u7ed3\u679c").replace("#1",
J)),q.refresh()):fa(!1)}};var W=com.kingdee.bos.qing.modeler.metriclibrary,T,V,ba,pa,wa,Aa,va,Y,sa,ma,ta,na,ya,ra,h,xa,G,ea,da,ua,qa,za,oa,R,ca;(function(){var a=com.kingdee.bos.qing.ui.component;T=a.MessageCurtain;V=a.Label;ba=a.TextField;pa=a.TextArea;wa=a.Toolbar;Aa=a.SearchBox;va=a.CheckBox;Y=a.MessageDialog;sa=a.HelpIcon;ma=a.AbstractModalDialog;za=a.ComboBox;ta=a.RadioButtonGroup;na=a.RadioButton;ya=a.SwitchButton;ra=a.List;a=com.kingdee.bos.qing.framework.common;h=a.MultilanguageManager.createPackageAccessor(W);
xa=a.WindowResizeObserver;a=com.kingdee.bos.qing.integration;oa=a.UserAndRoleForm;a=com.kingdee.bos.qing.modeler.common.ui;qa=a.SearchNoDataContainer;a=com.kingdee.bos.qing.common;G=a.DomUtil;a=com.kingdee.bos.qing.modeler.metriclibrary.system;ca=a.Integration;ea=a.Facade;da=a.MetricSystem;ua=a.ValueTextPair;R=a.Icons})()})();
//qingVersionTag: 20250415