var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(U,da,ia){U instanceof String&&(U=String(U));for(var qa=U.length,sa=0;sa<qa;sa++){var wa=U[sa];if(da.call(ia,wa,sa,U))return{i:sa,v:wa}}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(U,da,ia){if(U==Array.prototype||U==Object.prototype)return U;U[da]=ia.value;return U};$jscomp.getGlobal=function(U){U=["object"==typeof globalThis&&globalThis,U,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var da=0;da<U.length;++da){var ia=U[da];if(ia&&ia.Math==Math)return ia}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(U,da){var ia=$jscomp.propertyToPolyfillSymbol[da];if(null==ia)return U[da];ia=U[ia];return void 0!==ia?ia:U[da]};
$jscomp.polyfill=function(U,da,ia,qa){da&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(U,da,ia,qa):$jscomp.polyfillUnisolated(U,da,ia,qa))};$jscomp.polyfillUnisolated=function(U,da,ia,qa){ia=$jscomp.global;U=U.split(".");for(qa=0;qa<U.length-1;qa++){var sa=U[qa];if(!(sa in ia))return;ia=ia[sa]}U=U[U.length-1];qa=ia[U];da=da(qa);da!=qa&&null!=da&&$jscomp.defineProperty(ia,U,{configurable:!0,writable:!0,value:da})};
$jscomp.polyfillIsolated=function(U,da,ia,qa){var sa=U.split(".");U=1===sa.length;qa=sa[0];qa=!U&&qa in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var wa=0;wa<sa.length-1;wa++){var ua=sa[wa];if(!(ua in qa))return;qa=qa[ua]}sa=sa[sa.length-1];ia=$jscomp.IS_SYMBOL_NATIVE&&"es6"===ia?qa[sa]:null;da=da(ia);null!=da&&(U?$jscomp.defineProperty($jscomp.polyfills,sa,{configurable:!0,writable:!0,value:da}):da!==ia&&(void 0===$jscomp.propertyToPolyfillSymbol[sa]&&(ia=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[sa]=
$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(sa):$jscomp.POLYFILL_PREFIX+ia+"$"+sa),$jscomp.defineProperty(qa,$jscomp.propertyToPolyfillSymbol[sa],{configurable:!0,writable:!0,value:da})))};$jscomp.polyfill("Array.prototype.find",function(U){return U?U:function(da,ia){return $jscomp.findInternal(this,da,ia).v}},"es6","es3");
(function(){function U(Y,va,ya,O){sa.call(this,Y,va,ya,O);var P=this.protectedMethod,S=xa.getAppId(),f=function(m){m.appId=S;return m};this.checkPermission=function(){P.remote("checkPermission",f({}))};this.checkPublicPermission=function(){P.remote("checkPublicPermission",f({}))};this.saveImageInfo=function(m,A){m={model:JSON.stringify(m),isPublic:A};f(m);P.remote("saveImageInfo",m)};this.moveImage=function(m,A){m={model:JSON.stringify(m),groupId:A};f(m);P.remote("moveImage",m)};this.renameImage=
function(m,A){m={imageModel:JSON.stringify(m),imageName:A};f(m);P.remote("renameImage",m)};this.deleteImage=function(m){m={model:JSON.stringify(m)};f(m);P.remote("deleteImage",m)};this.getAllImage=function(){P.remote("getAllImage",{})};this.getAllImageOfCategory=function(m,A){P.remote("getAllImageOfCategory",{categoryId:m,isPreset:A})};this.getAllCategory=function(){P.remote("getAllCategory",f({}))};this.getAllCategoryAndImage=function(){P.remote("getAllCategoryAndImage",{})};this.saveOrUpdateCategory=
function(m){m={model:JSON.stringify(m)};f(m);P.remote("saveOrUpdateCategory",m)};this.saveOrderCategory=function(m,A){m={categories:JSON.stringify({imageCategories:m}),isPublic:A};f(m);P.remote("saveOrderCategory",m)};this.deleteCategory=function(m,A,aa){m={categoryId:m,categoryName:A,isPublic:aa};f(m);P.remote("deleteCategory",m)};this.getRefTimeOfImage=function(m){P.remote("getRefTimeOfImage",{imageFileName:m})};this.getImageModelByImageFileName=function(m){P.remote("getImageModelByImageFileName",
{imageFileName:m})};this.loadImageModelByImagePath=function(m){P.remote("loadImageModelByImagePath",{imagePath:m})};this.exportImages=function(m){m={images:JSON.stringify({images:m})};P.remote("exportSelectedImages",m)};this.parseFileToImages=function(m){m={fileName:m};f(m);P.remote("parseFileToImages",m)};this.importSelectedImages=function(m,A){m={images:JSON.stringify({images:m}),cacheFileName:A};f(m);P.remote("importSelectedImages",m)};this.conflictHanding=function(m,A){m={images:JSON.stringify({images:m}),
cacheFileName:A};f(m);P.remote("conflictHanding",m)};this.checkImageExist=function(m){P.remote("checkImageExist",{imageFileName:m})};this.importGalleryImages=function(m){var A=com.kingdee.bos.qing.behavior.BehaviorManager;A.interestInBehavior(A.CLOUD_GALLERY_DOWNLOAD,1);m={fileName:m};f(m);P.remote("importGalleryImages",m)};this.uploadGalleryTmpFile=function(m){m={tmpFile:m};f(m);P.remote("uploadGalleryTmpFile",m)};this.splitJointGalleryTmpFile=function(m){m={uploadBuffer:JSON.stringify(m)};f(m);
P.remote("splitJointGalleryTmpFile",m)}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.imagelib&&(com.kingdee.bos.qing.imagelib={});"undefined"==typeof com.kingdee.bos.qing.imagelib.common&&(com.kingdee.bos.qing.imagelib.common={});var da=com.kingdee.bos.qing.imagelib.common;da.ImagelibFacade=U;da.ImageLibRemoteImpl=
function(){wa.call(this);var Y;this.getRemoteUrl=function(){return Y};this.setRemoteUrl=function(va){Y=va}};var ia,qa,sa,wa,ua;(function(){var Y=com.kingdee.bos.qing.common;ia=Y.Util;Y=com.kingdee.bos.qing.framework.common;qa=Y.MultilanguageManager.createPackageAccessor(da);sa=Y.AbstractFacade;wa=Y.AbstractRemoteCall;ua=Y.RemoteFramework})();var xa=da.ImageLibUtil=new function(){var Y=this,va=!1,ya,O,P;(function(){var S=com.kingdee.bos.qing.common.Util.decodeParamFromUrl(window.location.search,"path");
S=(S?S:"/ierp")+"/qing/imagelib.do";var f=new com.kingdee.bos.qing.imagelib.common.ImageLibRemoteImpl;f.setRemoteUrl(S);ya=f})();this.setHasPublicPermission=function(S){va=!!S};this.hasPublicPermission=function(){return va};this.setAppId=function(S){P=S};this.getAppId=function(){return P};this.setMessageCurtain=function(S){O=S};this.getMessageCurtain=function(){return O};this.checkPermission=function(S){xa.createFacade(function(f){S(f)},function(){return!1}).checkPermission()};this.checkPublicPermission=
function(S){xa.createFacade(function(f){S(f)},function(){return!1}).checkPublicPermission()};this.createFacade=function(S,f,m){return new U(ya,S,function(A,aa){return f(A,aa)?!0:1100010===A?(Y.getMessageCurtain().showPrompt(qa.get("noPublicCategoryPermission","\u6ca1\u6709\u64cd\u4f5c\u516c\u5171\u76ee\u5f55\u7684\u6743\u9650\u3002")),!0):!1},m)};this.downloadExportFile=function(S){var f=ia.formatDate("yyyyMMdd_HHmmss");ua.downloadFile("Qing-"+f+".qing-pic",S)};this.highlightKeyWords=function(S,f,
m){if(f&&m){f=f.toUpperCase();var A=m.toUpperCase(),aa=A.split(f),ea=f.length,M;for(M in aa){var ba=A.indexOf(aa[M]),T=m.substr(oa,aa[M].length);ba+=aa[M].length;var ja=A.length-ba;A=A.substr(ba,ja);m=m.substr(ba,ja);ba=$("<span>");ba.text(T);ba.appendTo(S);if(M!==aa.length-1&&1<aa.length){var oa=A.indexOf(f);T=m.substr(oa,ea);ba=oa+ea;ja=A.length-ba;A=A.substr(ba,ja);m=m.substr(ba,ja);ba=$("<span>");ba.text(T);ba.css("color","red");ba.clone().appendTo(S)}}}else S.text(m)}}})();(function(){function U(){}function da(){var O=this,P,S,f,m,A=!1,aa=!1,ea=!1;this.setId=function(M){P=M};this.getId=function(){return P};this.setName=function(M){S=M};this.getName=function(){return S};this.setOrder=function(M){f=M};this.getOrder=function(){return f};this.setPreset=function(M){A=M};this.isPreset=function(){return A};this.setPublic=function(M){aa=M};this.isPublic=function(){return aa};this.setGallery=function(M){ea=M};this.isGallery=function(){return ea};this.setParentId=function(M){m=
M};this.getParentId=function(){return m};this.getFullPath=function(){var M=aa?Y.PERSISTENT_NAMESPACE_COMMON:Y.PERSISTENT_NAMESPACE_USER;M=A?Y.PERSISTENT_NAMESPACE_SYSTEM:M;return M+O.getName()};this.getNameSpace=function(){var M=aa?ea?Y.PERSISTENT_NAMESPACE_GALLERY_COMMON:Y.PERSISTENT_NAMESPACE_COMMON:ea?Y.PERSISTENT_NAMESPACE_GALLERY_USER:Y.PERSISTENT_NAMESPACE_USER;return M=A?Y.PERSISTENT_NAMESPACE_SYSTEM:M};this.shallowCopy=function(){var M=new da;M.fromJsonObject(O.toJsonObject());return M};this.fromJsonObject=
function(M){O.setId(M.id);O.setName(M.name);O.setOrder(M.order);O.setParentId(M.parentId);A=M.isPreset;aa=M.isPublic;ea=M.isGallery};this.toJsonObject=function(){var M={};M.id=O.getId();M.name=O.getName();M.order=O.getOrder();M.parentId=O.getParentId();M.isPublic=O.isPublic();M.isPreset=O.isPreset();M.isGallery=O.isGallery();return M}}function ia(){ua.call(this);var O=this,P;this.setCardType=function(S){P=S};this.getCardType=function(){return P};this.isNameDuplicate=function(S){return S===O.getName()}}
function qa(){var O=this,P,S,f,m,A,aa,ea,M,ba;this.setId=function(T){P=T};this.getId=function(){return P};this.setName=function(T){S=T};this.getName=function(){return S};this.setType=function(T){f=T};this.getType=function(){return f};this.setWidth=function(T){m=T};this.getWidth=function(){return m};this.setHeight=function(T){A=T};this.getHeight=function(){return A};this.setFileName=function(T){aa=T};this.getFileName=function(){return aa};this.setHasContent=function(T){M=T};this.hasContent=function(){return M};
this.setCategoryId=function(T){ea=T};this.getCategoryId=function(){return ea};this.getThumbnailFileName=function(){return ba};this.setNameAndType=function(T){O.setName(T.substring(0,T.lastIndexOf(".")));f=T.substring(T.lastIndexOf(".")+1)};this.getFullName=function(){return O.getName()+"."+f};this.getAspectRatio=function(){return m/A};this.getWidthAtSameRatio=function(T){var ja=O.getAspectRatio();return Math.floor(ja*T)};this.getHeightAtSameRatio=function(T){var ja=O.getAspectRatio();return Math.floor(T/
ja)};this.isSameType=function(T){return T===U.ALL?!0:-1<T.indexOf(f)};this.getThumbnailUrl=function(){return ya.getLoadImgUrl(ba,qa.FILE_TYPE)+"&contentType=image/"+f};this.getImageUrl=function(){return ya.getLoadImgUrl(aa,qa.FILE_TYPE)+"&contentType=image/"+f};this.getFullPath=function(){return O.getParent().getName()+"/"+O.getName()+"."+O.getType()};this.shallowCopy=function(){var T=new qa;T.fromJsonObject(this.toJsonObject());return T};this.fromJsonObject=function(T){P=T.fId;var ja=T.imageName;
O.setName(ja.substring(0,ja.lastIndexOf(".")));f=ja.substring(ja.lastIndexOf(".")+1);ea=T.categoryId;m=T.imageWidth;A=T.imageHeight;aa=T.imageFileName;M=T.hasContent;ba=T.thumbnailFileName};this.toJsonObject=function(){var T={};T.fId=O.getId();T.categoryId=O.getCategoryId();T.imageName=O.getFullName();T.imageWidth=m;T.imageHeight=A;T.imageFileName=aa;T.thumbnailFileName=ba;return T}}function sa(){var O=this,P,S=!1,f=!0,m=!1,A=!1,aa;this.getId=function(){return aa&&aa.getId()};this.getName=function(){return aa&&
aa.getName()};this.setUserObject=function(M){aa=M};this.getUserObject=function(){return aa};this.setParent=function(M){P=M};this.getParent=function(){return P};this.setVisible=function(M,ba,T){if(M!==O.isVisible()){f=M;if(T&&O.getChildren&&(T=O.getChildren())&&0<T.length)for(var ja=0;ja<T.length;ja++)T[ja].setVisible(M,!1,!0);if(ba&&(ba=O.getParent()))if(M)ba.setVisible(M,!0,!1),ea(ba);else{T=M=!1;ja=!0;var oa=ba.getChildren();if(oa&&0<oa.length)for(var la=0;la<oa.length;la++){var fa=oa[la],ha=fa.isVisible();
fa.isVisible()&&(M=!0,ja=ja&&fa.isChecked());T=T||ha}M&&ba.setChecked(ja,!0,!1);ba.setVisible(T,!0,!1)}}};this.isVisible=function(){return f};this.setChecked=function(M,ba,T){if(M!==O.isChecked()){m=M;if(T&&O.getChildren&&(T=O.getChildren())&&0<T.length)for(var ja=0;ja<T.length;ja++){var oa=T[ja];oa.isGrey()||oa.isVisible()&&oa.setChecked(M,!1,!0)}ba&&(M=O.getParent())&&ea(M)}};this.isChecked=function(){return m};this.setVisited=function(M){A=M};this.isVisited=function(){return A};this.setGrey=function(M){S=
M};this.isGrey=function(){return S};this.equals=function(M){return M&&M.equals?O.getId()===M.getId():!1};this.isHide=function(){var M=!1;if(f)for(var ba=O.getParent();ba;){if(!ba.isExpanded()){M=!0;break}ba=ba.getParent()}else M=!0;return M};var ea=function(M){var ba=!0,T=!1,ja=M.getChildren();if(ja&&0<ja.length)for(var oa=0;oa<ja.length;oa++){var la=ja[oa];!la.isGrey()&&la.isVisible()&&(T=!0,ba=ba&&la.isChecked())}T&&M.setChecked(ba,!0,!1)};this.getSubNodeLevel=function(){for(var M=0,ba=O.getParent();ba;)M++,
ba=ba.getParent();return M}}function wa(){sa.call(this);var O=this,P=!0,S=[],f=[];this.shallowCopy=function(){var m=this.getUserObject().shallowCopy(),A=new wa;A.setUserObject(m);A.setVisited(O.isVisited());return A};this.isDuplicate=function(m,A){for(var aa=0;aa<S.length;aa++)if(A(m)===A(S[aa]))return!0;return!1};this.setExpanded=function(m){O.isExpanded()!==m&&(P=m)};this.isExpanded=function(){return P};this.setChildren=function(m){if(!m)throw Error("Parameter 'arrChildren' must not be undefined.");
S=m};this.getChildren=function(){return S};this.setDirChildren=function(m){f=m};this.getDirChildren=function(){return f};this.addDirChildren=function(m){m&&f.push(m)};this.addDirTo=function(m,A){m&&f.splice(A,0,m)};this.deleteDirChildren=function(m){if(m)for(var A=0;A<f.length;A++)if(m.equals(f[A])){f.splice(A,1);break}};this.check=function(m,A){if(m!==O.isChecked()){O.setChecked(m);var aa,ea=O.getChildren();if(ea&&0<ea.length)for(aa=0;aa<ea.length;aa++)ea[aa].check(m);A&&A(O.getParent())}};this.add=
function(m){m&&S.push(m)};this.addTo=function(m,A){m&&S.splice(A,0,m)};this.deleteByEquals=function(m){if(m)for(var A=0;A<S.length;A++)if(m.equals(S[A])){S.splice(A,1);break}};this.deleteFrom=function(m){0>m||m>S.length-1||S.splice(m,1)};this.fromJsonObject=function(m){if(m=m.children)for(var A=0;A<m.length;A++){var aa=m[A],ea=new wa,M=new da;M.fromJsonObject(aa);ea.fromJsonObject(aa);ea.setParent(O);ea.setUserObject(M);f.push(ea)}};this.fromJsonObjectForExport=function(m){if(m=m.children)for(var A=
0;A<m.length;A++){var aa=m[A],ea=new wa,M=new da;M.fromJsonObject(aa);ea.fromJsonObjectForExport(aa);ea.setParent(O);ea.setUserObject(M);ea.setExpanded(!1);S.push(ea)}}}function ua(){sa.call(this);var O=this,P;this.setParent=function(S){P=S};this.getParent=function(){return P};this.shallowCopy=function(){var S=this.getUserObject().shallowCopy(),f=new ua;f.setUserObject(S);return f};this.check=function(S,f){S!==O.isChecked()&&(O.setChecked(S),f&&f(O.getParent()))}}function xa(){var O,P,S,f,m=xa.CONFLICT_STRATEGY_IGNORE;
this.isPublic=function(){return Y.PERSISTENT_NAMESPACE_COMMON===O||Y.PERSISTENT_NAMESPACE_GALLERY_COMMON===O};this.isGallery=function(){return Y.PERSISTENT_NAMESPACE_GALLERY_COMMON===O||Y.PERSISTENT_NAMESPACE_GALLERY_USER===O};this.isPreset=function(){return Y.PERSISTENT_NAMESPACE_SYSTEM===O};this.setNameSpace=function(A){O=A};this.getNameSpace=function(){return O};this.getImageName=function(){return P};this.getImageFileName=function(){return f};this.getCategoryName=function(){return S};this.setConflictStrategy=
function(A){m=A};this.getConflictStrategy=function(){return m};this.fromJsonObject=function(A){O=A.nameSpace;P=A.imageName;S=A.categoryName;f=A.imageFileName};this.toJsonObject=function(){var A={};A.nameSpace=O;A.imageName=P;A.categoryName=S;A.imageFileName=f;A.conflictStrategy=m;return A}}function Y(){var O,P,S;this.getNameSpace=function(){return O};this.setNameSpace=function(f){O=f};this.getCategoryName=function(){return P};this.setCategoryName=function(f){P=f};this.getName=function(){return S};
this.setName=function(f){S=f};this.getImageFullPath=function(){return O+Y.SEPERATOR+P+Y.SEPERATOR+S};this.fromJsonObject=function(f){O=f.nameSpace;P=f.groupName;S=f.name};this.toJsonObject=function(){var f={};f.nameSpace=O;f.groupName=P;f.name=S;return f};this.getPathString=function(){var f;O&&P&&S&&(f=O+Y.SEPERATOR+P+Y.SEPERATOR+S);return 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.imagelib&&(com.kingdee.bos.qing.imagelib={});"undefined"==typeof com.kingdee.bos.qing.imagelib.model&&(com.kingdee.bos.qing.imagelib.model={});var va=com.kingdee.bos.qing.imagelib.model;va.ImageCategory=da;va.Image=qa;va.ImageType=U;va.UploadOpModel=function(){ia.call(this);this.setVisible(!1);this.setCardType(ia.UPLOAD_CARD);this.setVisible=function(O){};this.isSameType=function(){return!0};this.isNameDuplicate=function(O){return!1};
this.copy=function(){return new this}};va.FolderNode=wa;va.ImportImage=xa;va.ImportResult=function(){var O,P=[],S=[];this.setAllSuccess=function(f){O=f};this.isAllSuccess=function(){return O};this.setSuccessIds=function(f){P=f};this.getSuccessIds=function(){return P};this.setConflictImages=function(f){S=f};this.getConflictImages=function(){return S};this.getSuccessCount=function(){return P.length};this.fromJsonObject=function(f){var m=[],A=f.conflictImages;P=f.successfulIds;O=f.allSuccess;for(f=0;f<
A.length;f++){var aa=new xa;aa.fromJsonObject(A[f]);m.push(aa)}S=m}};va.LeafNode=ua;va.PathModel=Y;va.ThumbnailUrlModel=function(){var O,P,S,f,m=this;this.setImageFileName=function(A){O=A};this.getImageFileName=function(){return O};this.setQingFileType=function(A){P=A};this.getQingFileType=function(){return P};this.setImageType=function(A){S=A};this.getImageType=function(){return S};this.setImageFullPathModel=function(A){f=A};this.getImageFullPathModel=function(){return f};this.fromJsonObject=function(A){O=
A.imageFileName;P=A.qingFileType;S=A.imageType;if(A=A.imageFullPathModel)f=new Y,f.fromJsonObject(A)};this.toJsonObject=function(){var A={};A.imageFileName=O;A.qingFileType=P;A.imageType=S;f&&(A.imageFullPathModel=f.toJsonObject());return A};this.getImagePathFromJson=function(A){if(A){if(A=JSON.parse(A),m.fromJsonObject(A),O){var aa=com.kingdee.bos.qing.framework.common.RemoteFramework.getLoadImgUrl(O,P);aa=aa+"&contentType=image/"+S}}else aa=com.kingdee.bos.qing.CodeLoader.getIconUrl("lightapp/common",
"icon_dashboard_building.png");return aa};this.getImagePathFromUrl=function(A){A||(A=com.kingdee.bos.qing.CodeLoader.getIconUrl("lightapp/common","icon_dashboard_building.png"));return A};this.getJsonImagePath=function(){return O||f?JSON.stringify(m.toJsonObject()):null};this.checkHasImage=function(A,aa){if(A){var ea=document.createElement("img");ea.crossOrigin="anonymous";ea.setAttribute("crossOrigin","Anonymous");ea.onerror=function(){aa(!1)};ea.onload=function(){0<ea.fileSize||0<ea.width||0<ea.height?
aa(!0):aa(!1)};ea.src=A}else aa(!1)}};var ya=com.kingdee.bos.qing.framework.common.RemoteFramework;U.PNG="png";U.JPG="jpg";U.JPEG="jpeg";U.BMP="bmp";U.GIF="gif";U.ALL="all";va.ImageLibModelUtil=new function(){var O=[],P=[];O.push(U.ALL);O.push(U.PNG);O.push(U.JPG);O.push(U.BMP);O.push(U.GIF);P.push(U.ALL);P.push(U.PNG);P.push(U.JPG+"/"+U.JPEG);P.push(U.BMP);P.push(U.GIF);this.getAllTypeWithSeparator=function(S){var f=P.concat();f.splice(0,1);var m,A="";for(m=0;m<f.length;m++)A+=f[m],m!==f.length-
1&&(A+=S);return A};this.getAllType=function(){return P}};da.GROUP_NAME_MAX_LENGTH=50;da.GROUP_TYPE_PRIVATE=0;da.GROUP_TYPE_PUBLIC=1;da.GROUP_TYPE_PRESET=2;ia.IMAGE_CARD="image";ia.UPLOAD_CARD="upload";qa.FILE_TYPE="image-library";xa.CONFLICT_STRATEGY_IGNORE=0;xa.CONFLICT_STRATEGY_OVERWRITE=1;xa.CONFLICT_STRATEGY_RENAME=2;Y.SEPERATOR="/";Y.NAMESPACE_SYSTEM="system";Y.PERSISTENT_NAMESPACE_SYSTEM="$system$";Y.NAMESPACE_COMMON="common";Y.PERSISTENT_NAMESPACE_COMMON="$common$";Y.NAMESPACE_USER="user";
Y.PERSISTENT_NAMESPACE_USER="$user$";Y.NAMESPACE_GALLERY_USER="gallery_user";Y.PERSISTENT_NAMESPACE_GALLERY_USER="$gallery_user$";Y.NAMESPACE_GALLERY_COMMON="gallery_common";Y.PERSISTENT_NAMESPACE_GALLERY_COMMON="$gallery_common$"})();(function(){function U(){S||(S=com.kingdee.bos.qing.imagelib.MyIcons);return S}function da(q){var c=this,a,b,d,t,g,e,k=!1,l=[],u=[],K=q,E=q,h=K[1],x=[],D,V=function(){a=$("<div>");a.addClass("manage-card-list");B(K);var p=$("<div>");p.addClass("img-lib-mange-lists-dir");p.addClass("img-lib-mange-lists-dir-head");p.data("oNode",x[0]);p.css("cursor","pointer");var v=$("<div>"),F=G.get("userUploadFile","\u4e0a\u4f20\u7684\u56fe\u7247");v.text(F);v.addClass("img-lib-mange-lists-dir-text");v.css("margin-right",
"74px");v.css("color","#666666");p.append(v);var N=$("<div>");N.addClass("select-tree-menu-head-icon");N.css("position","absolute");ha.background(N,"arrow-down");p.append(N);d=z();d.setItemModels(l,Z);var H=d.getJqUi();H.addClass("img-lib-mange-lists-dir-imglist");H.appendTo(a);p.on("click",function(na){e(!1)});var ka=$("<div>");ka.addClass("img-lib-mange-lists-dir");ka.addClass("img-lib-mange-lists-dir-head-gallery");ka.data("oNode",x[1]);ka.css("cursor","pointer");v=$("<div>");F=G.get("downloadGallery",
"\u6765\u81ea\u4e91\u7d20\u6750");v.text(F);v.addClass("img-lib-mange-lists-dir-text");v.css("color","#666666");ka.append(v);var Q=$("<div>");Q.addClass("select-tree-menu-head-icon");Q.css("position","absolute");ha.background(Q,"arrow-up");Q.addClass("select-tree-menu-head-icon-transform");ka.append(Q);t=z();t.setItemModels(u,Z);var ca=t.getJqUi();ca.addClass("img-lib-mange-lists-dir-gallery");ca.hide();ca.appendTo(a);ka.on("click",function(na){e(!0)});p.appendTo(a);x[1]?ka.appendTo(a):H.css("bottom",
"0px");b=d;K=l;c.setFunOpenOrCloseList(function(na){na?"none"==ca.css("display")?(H.hide(),ca.show(),ha.background(N,"arrow-up"),N.addClass("select-tree-menu-head-icon-transform"),ha.background(Q,"arrow-down"),Q.removeClass("select-tree-menu-head-icon-transform"),ka.css("position","relative"),b=t,k=!0,K=u,c.refreshList(K)):(ca.hide(),ha.background(Q,"arrow-up"),Q.addClass("select-tree-menu-head-icon-transform"),"block"==H.css("display")&&ka.css("position","absolute")):"none"==H.css("display")?(H.show(),
ca.hide(),ha.background(N,"arrow-down"),ha.background(Q,"arrow-up"),Q.addClass("select-tree-menu-head-icon-transform"),N.removeClass("select-tree-menu-head-icon-transform"),ka.css("position","absolute"),b=d,k=!1,K=l,c.refreshList(K)):(H.hide(),ha.background(N,"arrow-up"),N.addClass("select-tree-menu-head-icon-transform"),ka.css("position","relative"))})},Z=function(p,v){p=p.getUserObject();v=v.getUserObject();return p.getId()==v.getId()},B=function(p){var v;E=p;x=[];u=[];l=[];for(v=0;v<p.length;v++)p[v].getParent()||
x.push(p[v]),p[v].getUserObject().isGallery()?u.push(p[v]):l.push(p[v])},z=function(){var p=new pa;p.setCustomItemPainter(c.listItemPainter);p.setBorderVisible(!1);p.addSelectedChangedListener(function(v,F,N){N&&0<N.length&&(v=N[0],v.getParent()&&((k?d:t).setSelecteds(x),c.itemClick(v),h=v))});return p};this.setFunOpenOrCloseList=function(p){e=p};this.setSelected=function(p){k!=p.getUserObject().isGallery()&&(p.getUserObject().isGallery()&&0< !u.length?p=l[1]:e&&e(p.getUserObject().isGallery()));
var v=[];v.push(p);b.setSelecteds(v)};this.getSelected=function(){var p=b.getSelecteds();return 0===p.length?null:p[0]};this.addModel=function(p){K.push(p);c.updateUi()};this.setModels=function(p){B(p);K=l;c.updateUi()};this.getList=function(){return b};this.deleteByModel=function(p){if(!p)throw Error("Model is null.");for(var v,F=0;F<K.length;F++)if(K[F].equals(p)){a:{v=p;var N=v.getParent(),H=N.getDirChildren();if(1==H.length)v=N;else{for(N=0;N<H.length;N++)if(H[N].equals(v)){v=N+1>=H.length?H[N-
1]:H[N+1];break a}v=void 0}}K.splice(F,1);p.equals(c.getCurrent())&&(b.setItemModels(K,Z),c.setSelected(v));break}p.getParent()&&p.getParent().deleteDirChildren(p);E=c.getAllModels();c.updateUi()};this.updateListAndUi=function(){B(E);K=k?u:l;c.updateUi()};this.updateUi=function(){if(K&&0!==K.length||g)if(K&&0!==K.length){if(g&&g.hide(),b.setItemModels(K,Z),0==document.body.clientHeight||0==document.body.clientWidth)D=new ma,D.setDelay(250),D.setCallbackImmediately(function(){D&&D.unobserve();b.scrollSelectedToVisible()}),
D.observe()}else g&&g.show();else g=w(),g.appendTo(a)};this.getJqUi=function(){a||V();return a};this.getModels=function(){return K};this.getAllModels=function(){var p,v=[];for(p=0;p<l.length;p++)v.push(l[p]);for(p=0;p<u.length;p++)v.push(u[p]);return v};this.getCurrent=function(){return h};this.getHeight=function(){return q.length*da.ITEM_HEIGHT};this.bindChildrenIntoCategories=function(p){if(p&&0!==p.length){var v=c.getAllModels(),F,N;for(F=0;F<v.length;F++){var H=[],ka=v[F];for(N=0;N<p.length;N++){var Q=
p[N];Q.getUserObject().getCategoryId()===ka.getId()&&(H.push(Q),Q.setParent(ka))}ka.setChildren(H);ka.setVisited(!0)}}};this.updateCurrent=function(p){h=p};var w=function(){var p=$("<div>");p.css({position:"absolute",top:"0",left:"0",right:"0",bottom:"0","z-index":"2",color:"rgb(102, 102, 102)"});var v=$("<div>");v.text(c.getNoDataPrompt());f.layoutCtrlCenterAlign(v,500);v.css({height:"20px","line-height":"20px","text-align":"center","font-size":"16px",color:"#BBBBBB",top:"50%","margin-top":"33.5px"});
v.appendTo(p);v=$("<div>");U().background(v,"no-data");f.layoutCtrlCenterAlign(v,187);v.css({"background-size":"contain",top:"50%",height:"187px","margin-top":"-178.5px"});v.appendTo(p);return p};this.getNoDataPrompt=function(){throw Error("Override me!");};this.itemClick=function(p){throw Error("Override me!");};this.refreshList=function(p){throw Error("Override me!");};this.listItemPainter=function(p,v){throw Error("Override me!");};this.abstractProtectMethod={getIndex:function(p){if(!p)throw Error("Model is null.");
for(var v=0;v<K.length&&!K[v].equals(p);v++);return v},funItemModelEqualsChecker:Z}}function ia(){var q=this,c,a,b,d,t,g,e,k;this.setFunJumpToImage=function(E){e=E};this.setFunWidthChangedCallback=function(E){k=E};this.updateUi=function(E,h){q.emptyList();var x=0;if(0===E.length)t||l(b),t.show();else{t&&t.hide();var D;for(D=0;D<E.length;D++){var V=E[D],Z=(new qa(V,h)).getJqUi();Z.data("oModel",V);Z.on("click",function(B){B=$(B.currentTarget).data("oModel");e&&e(B.getParent(),B)});Z.css("margin","2px");
Z.appendTo(b);x++}}u(x)};var l=function(){t=$("<div>");t.addClass("image-lib-search-panel-no-data");g=$("<div>");g.text(G.get("noSearchedResults","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"));f.layoutCtrlCenterAlign(g,500);g.addClass("image-lib-search-panel-no-data-prompt");g.css({height:"20px","line-height":"20px","margin-top":"98.5px"});g.appendTo(t);var E=$("<div>");U().background(E,"no-data");f.layoutCtrlCenterAlign(E,187);E.addClass("image-lib-search-panel-no-data-icon");
E.css({height:"187px","margin-top":"-113.5px"});E.appendTo(t);c.append(t)};this.showOrHide=function(E){E?c.show():c.hide()};this.emptyList=function(){b.empty()};this.getWidth=function(){return 314};this.isHidden=function(){return c.is(":hidden")};this.getJqUi=function(){return c};this.init=function(){c=$("<div>");c.addClass("manage-search");f.layoutCtrlWithLRTB(c,null,0,314,0,null,null);c.css("z-index","1");c.height("100%");var E=c,h=$("<div>");h.addClass("manage-search-header");f.layoutCtrlWithLRTB(h,
0,0,null,0,null,36);h.appendTo(E);a=$("<div>");a.addClass("manage-search-header-hits-prompt");a.appendTo(h);E=c;b=$("<div>");f.layoutCtrlWithLRTB(b,0,0,null,36,40,null);b.width(291);b.addClass("manage-search-list");b.appendTo(E);K(c)};var u=function(E){a.text(G.get("allHitsNumberPrompt","\u5171\u641c\u7d22\u5230 \u201c#1\u201d \u4e2a\u7ed3\u679c").replace("#1",E))},K=function(E){var h=$("<div>");h.addClass("manage-search-footer");f.layoutCtrlWithLRTB(h,0,0,null,null,0,40);h.appendTo(E);d=new fa;d.setText(G.get("close",
"\u5173\u95ed"));d.setHighlight(!0);d.addActionListener(function(){q.showOrHide(!1);k()});E=d.getJqUi();E.addClass("manage-search-footer-btn");E.appendTo(h)}}function qa(q,c){var a,b;this.getJqUi=function(){a||d();return a};var d=function(){a=$("<div>");a.addClass("manage-search-result-item");a.width(135);a.height(158);a.on("mousedown",function(k){$(k.currentTarget).css("background-color","var(--color-main, #5582f3)");b.css("color","#fff")});a.on("mouseup",function(k){$(k.currentTarget).css("background-color",
"");b.css("color","")});t(a);g(a);e(a)},t=function(k){for(var l=q.getParent(),u=l.getUserObject(),K=l.getName();l.getParent();)l=l.getParent(),K=l.getName()+"/"+K;l=K;u=(u.isPublic()?G.get("public","\u516c\u5171"):G.get("private","\u4e2a\u4eba"))+"/"+l;b=$("<div>");b.addClass("image-lib-search-item-category");b.text(u);b.attr("title",u);b.appendTo(k)},g=function(k){var l=q.getUserObject(),u=l.getName(),K=l.getThumbnailUrl(),E=135/113;if(l.hasContent()){var h=$("<img>");h.addClass("image-lib-search-item-image");
h.css({"max-width":135,"max-height":113});h.attr("src",K);h.attr("alt",u);E<l.getAspectRatio()?(h.css("width",135),l=l.getHeightAtSameRatio(135),h.css("top",Math.floor((113-l)/2))):(h.css("height",113),l=l.getWidthAtSameRatio(113),h.css("left",Math.floor((135-l)/2)))}else h=$("<div>"),h.addClass("image-lib-choose-no-image"),h.css({width:135,height:113}),l=$("<div>"),l.addClass("image-lib-choose-no-image-icon"),U().background(l,"icon-no-image"),l.appendTo(h),l=$("<div>"),l.addClass("image-lib-choose-no-image-text"),
u=G.get("imageCanNotBeFind","\u627e\u4e0d\u5230\u5bf9\u5e94\u7684\u56fe\u7247"),l.attr("title",u),l.text(u),l.appendTo(h);l=$("<div>");f.layoutCtrlWithLRTB(l,0,0,null,20,25,null);h.appendTo(l);q.getParent().getUserObject().isPreset()&&(h=$("<div>"),h.addClass("image-lib-transform_-35"),U().background(h,"icon-preset"),u=$("<div>"),u.addClass("manage-search-result-item-preset-icon"),u.text(G.get("preset","\u9884\u7f6e")),f.layoutCtrlWithLRTB(h,null,0,39,0,null,40),h.css("z-index","1"),u.appendTo(h),
h.appendTo(l));l.appendTo(k)},e=function(k){var l=q.getName(),u=$("<div>");u.addClass("image-lib-search-item-title");C.highlightKeyWords(u,c,l);u.attr("title",l);u.appendTo(k)}}function sa(){var q=this,c,a,b,d;this.preview=function(g){if(!g)throw Error("Do not know which picture to preview.");c||t();d&&d.hide();b.show();var e=g.getName(),k=g.getImageUrl(),l=g.getName(),u=g.getWidth();g=g.getHeight();a.text(l+"\u00a0\u00a0\u00a0\u00a0"+u+" * "+g);b.attr("src",k);b.attr("alt",e);c.show()};var t=function(){c=
$("<div>");c.addClass("image-preview-modallayer");var g=$("<div>");f.layoutCtrlWithLRTB(g,10,100,null,10,10);g.appendTo(c);a=$("<div>");a.addClass("image-preview-title");a.appendTo(g);var e=$("<div>");f.layoutCtrlWithLRTB(e,5,5,null,35,5);e.appendTo(g);d=$("<div>");d.addClass("image-lib-align_margin_auto");d.css("width","100px");d.css("height","60px");g=$("<div>");f.layoutCtrlWithLRTB(g,"50%",0,36,0,0,36);f.layoutCtrlCenterAlign(g,36);U().background(g,"icon-no-image");g.appendTo(d);g=$("<div>");f.layoutCtrl(g,
0,40,"100%",20);g.css("text-align","center");g.css("font-size","14px");g.text(G.get("previewImageFail","\u56fe\u7247\u9884\u89c8\u5931\u8d25"));g.appendTo(d);d.appendTo(e);b=$("<img>");b.addClass("image-lib-align_margin_auto image-lib-max-size_top");b.on("error",function(k){(k=$(k.target))&&k.hide();d.show()});b.appendTo(e);e=$("<div>");e.addClass("image-preview-close-btn");e.attr("title",G.get("exit","\u9000\u51fa"));e.on("click",function(){q.hideOrRemove(!1)});e.appendTo(c);g=$("<div>");g.addClass("image-preview-close-btn-icon");
g.appendTo(e);c.appendTo(document.body)};this.hideOrRemove=function(g){b.attr("src",null);g?c&&c.remove():c&&c.hide()}}function wa(){var q=this,c,a,b,d,t=250,g=250,e=36,k=!1,l;this.getJqUi=function(){return c};this.setFooterHeight=function(u){e=u};this.setModel=function(u){l=u};this.getModel=function(){return l};this.getContentWidth=function(){return t-10-2};this.getContentHeight=function(){return g-10-e-2};this.setClickable=function(u){k=u};this.setHasHoverStyle=function(u){};this.updateUi=function(){throw Error("Override me!");
};this.doClick=function(){throw Error("Override me!");};this.protectedMethod={init:function(){c=$("<div>");c.addClass("manage-card");c.css({"border-width":"1px","border-style":"solid","border-radius":"1px"});c.width(t);c.height(g);k&&(c.css("cursor","pointer"),c.on("click",q.doClick));var u=c;a=$("<div>");a.addClass("manage-card-content");a.css("bottom",e+"px");a.css("padding","5px");a.appendTo(u);u=c;b=$("<div>");b.addClass("manage-card-footer");b.css({height:e+"px","line-height":e+"px"});b.appendTo(u);
d=$("<div>");d.addClass("manage-card-footer-tail");d.appendTo(b)},rename:function(u){u=u.trim();l.setName(u)},remove:function(){l=null;c&&c.remove()},doCopy:function(u){var K=document.createElement("textarea");K.value=u;K.setAttribute("readonly","");K.style.position="absolute";K.style.left="-9999px";document.body.appendChild(K);K.select();document.execCommand("copy");document.body.removeChild(K)},setSize:function(u,K){t=u;g=K},addCustomJq2Content:function(u){u.css({"max-width":q.getContentWidth()+
"px","max-height":q.getContentHeight()+"px"});u.appendTo(a)},addOpIcon2FooterTail:function(u){u.addClass("manage-card-op-common");u.appendTo(d)},addCustomJq2FooterHead:function(u){u.css("float","left");u.css("max-width",t-78-2-10+"px");u.prependTo(b)},addCustomJq2FooterTail:function(u){u.appendTo(d)},setPresetIconBack:function(){var u=$("<div>");u.addClass("image-lib-transform_-35");U().background(u,"icon-preset-big");var K=$("<div>");K.addClass("image-card-preset-icon-text");K.text(G.get("preset",
"\u9884\u7f6e"));f.layoutCtrlWithLRTB(u,null,0,54,0,null,54);K.appendTo(u);u.appendTo(c)}}}function ua(){m.call(this);var q=this,c=this.protectedMethod,a,b,d,t,g,e,k,l=!1;this.setFunClosingCallBack=function(h){t=h};this.getInputCtrlTop=function(){return 50};this.getMessageCurtain=function(){return c.getMessageCurtain()};this.init=function(){$("<div>");q.setSize(400,300);c.setSelectable(!0);c.setTitle(g);c.setContentPaneCreator(u);c.setClosingChecker(E,!0);c.setClosingAction(K)};this.setLabelRequired=
function(h){l=h};var u=function(){b=$("<div>");a=new ja;a.setRequired(l);a.setText(e);var h=a.getJqUi();f.layoutCtrlWithLRTB(h,null,null,null,q.getInputCtrlTop(),null,null);h.css({"float":"left","margin-left":"25px"});b.append(h);q.inputCtrlCreator(b);d=$("<div>");d.addClass("manage-op-message-tip");d.appendTo(b);return b};this.inputCtrlCreator=function(h){throw Error("Override me!");};this.getCtrlText=function(){throw Error("Override me!");};this.closingChecker=function(){throw Error("Override me!");
};this.getSelectedCtrl=function(){throw Error("Override me!");};this.showMessageTip=function(h){d.text(h);k&&clearTimeout(k);k=setTimeout(function(){d.text("")},5E3)};var K=function(h){h&&t(q.getCtrlText())},E=function(h){if(null==q.getSelectedCtrl())return q.getMessageCurtain().showPrompt(G.get("selectPathTips","\u8bf7\u9009\u62e9\u76ee\u5f55\u3002")),h(!1),!1;var x=q.getCtrlText();if(!x)return q.getMessageCurtain().showPrompt(G.get("inputImageNameFirst","\u8bf7\u8f93\u5165\u56fe\u7247\u540d\u79f0\u3002")),
h(!1),!1;h(q.closingChecker(x))};this.protectedMethod={setTitle:function(h){g=h},setInputPrompt:function(h){e=h}}}function xa(q){ua.call(this);var c=this.protectedMethod,a=this,b,d,t;a.setLabelRequired(!0);c.setInputPrompt(q);c.setTitle(G.get("renameImageName","\u4fee\u6539\u56fe\u7247\u540d\u79f0"));this.setModel=function(g){d=g};this.setFolderNode=function(g){t=g};this.requestFocus=function(){b.requestFocus()};this.inputCtrlCreator=function(g){b=new oa;b.setText(d.getName());var e=b.getJqUi();f.layoutCtrlWithLRTB(e,
110,null,240,a.getInputCtrlTop(),null,null);e.css({"margin-right":"35px",height:"22px"});e.appendTo(g)};this.getCtrlText=function(){return b.getText().trim()};this.getSelectedCtrl=function(){return b.getText()};this.closingChecker=function(g){var e=g+"."+d.getType(),k=new n,l=new I;l.setNameAndType(e);k.setUserObject(l);e=t.isDuplicate(k,function(u){u=u.getUserObject();return u.getFullName&&u.getFullName()});return 50<g.length?(a.getMessageCurtain().showPrompt(G.get("imageNameToLong","\u56fe\u7247\u540d\u79f0\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26\u3002")),
!1):e?(d.getName()===g?a.getMessageCurtain().showPrompt(G.get("imageNameNoChange","\u56fe\u7247\u540d\u79f0\u672a\u4fee\u6539\u3002")):a.getMessageCurtain().showPrompt(G.get("imageNameExist","\u56fe\u7247\u540d\u79f0\u5df2\u5b58\u5728\u3002")),!1):-1!=g.indexOf("/")?(a.getMessageCurtain().showPrompt(G.get("imageNameRule",'\u56fe\u7247\u540d\u79f0\u4e0d\u80fd\u5305\u542b"/"\u3002')),!1):!0}}function Y(q){ua.call(this);var c=this.protectedMethod,a=this,b,d,t,g;c.setInputPrompt(q);c.setTitle(G.get("moveTo",
"\u79fb\u52a8\u5230"));this.getSelectedModel=function(){a:{var e=b.getSelectedTreePath().getValue();for(var k=0;k<t.length;k++)if(t[k].getId()===e){e=t[k];break a}e=void 0}return e};this.setTargetModels=function(e){var k;g=[];for(k=0;k<e.length;k++)e[k].getParent()||g.push(e[k]);t=e};this.setModel=function(e){d=e};this.inputCtrlCreator=function(e){b=new ya;b.setPlaceholder(G.get("selectPath","\u8bf7\u9009\u62e9\u76ee\u5f55"));b.setMaxHeight(118);b.setArrFolderNode(g);b.getJqUi().css("background",
"white");var k=b.getJqUi();k.css("background","white");f.layoutCtrl(k,100,50,215,23);k.appendTo(e)};this.getCtrlText=function(){return b.getSelectedTreePath().getText()};this.getSelectedCtrl=function(){return b.getSelectedTreePath()};this.closingChecker=function(){if(d.getCategoryId()==a.getSelectedModel().getId())return!0;var e=d.getFullName(),k=new n,l=new I;l.setNameAndType(e);k.setUserObject(l);return a.getSelectedModel().isDuplicate(k,function(u){u=u.getUserObject();return u.getFullName&&u.getFullName()})?
(a.getMessageCurtain().showPrompt(G.get("imageNameExist","\u56fe\u7247\u540d\u79f0\u5df2\u5b58\u5728\u3002")),!1):!0}}function va(){var q=this,c,a,b,d,t,g=!0,e;this.setEnable=function(h){g=h};this.getDropDownContent=function(h){throw Error("orrive me");};this.getPopupHeight=function(){throw Error("orrive me");};this.showRefreshBtn=function(){return!1};this.getJqUi=function(){c||k();return c};this.setPlaceholder=function(h){k();"placeholder"in a[0]?(a.attr("placeholder",h),a.css("font-size","12px")):
(t&&t.remove(),t=$("<div>"),t.text(h),t.css("color","#ccc"),t.css("font-size","12px"),t.on("mousedown",function(x){a.focus()}),t.appendTo(q.getJqUi()),f.layoutCtrlWithLRTB(t,4,4,null,2,2,null),E())};var k=function(){if(!c){c=$("<div>");c.addClass("sa-ctrl-combobox");if(g)c.on("click",u);c.css("border-bottom","1px solid #ccc");a=$("<input readonly=readonly>");a.addClass("sa-ctrl-textfield-input");a.css("max-width","200px");a.css("color","#666");a.appendTo(c);b=$("<div>");b.addClass("sa-ctrl-combobox-arrow sa-ctrl-combobox-arrow_enabled");
b.appendTo(c);b.on("mouseenter",function(h){l(!0)});b.on("mouseleave",function(h){l(!1)});l(!1)}},l=function(h){var x=d?"arrow-up":"arrow-down";h&&(x+="_hover");ha.background(b,x)},u=function(){if(g){if(d)$(document.body).off("mousedown",K),d.detach(),d=null;else{var h=$(document.body),x=d=$("<div>"),D=$("<div>");D.addClass("sa-ctrl-common-border");D.appendTo(x);d.addClass("sa-qing-publish-dropdown-selector");e=q.getDropDownContent(!1);e.appendTo(d);var V=q.getPopupHeight();d.css("z-index",999999);
d.appendTo(h);var Z=h.prop("clientHeight"),B=c.outerHeight();x=c.outerWidth();var z=[0,B-1];z=f.upwardCoordinate(c[0],z,h[0]);D=z[0];var w=z[1];V=0>V?Math.max(0,(Z>>1)-B):V;w+V>Z&&(z=[0,0],z=f.upwardCoordinate(c[0],z,h[0]),h=z[1]-V+1,0<=h&&(w=h));f.layoutCtrl(d,D,w,x,V);$(document.body).on("mousedown",K)}l(!1)}},K=function(h){for(var x=$(document.body),D=$(h.target);D[0]!=x[0];){if(D[0]==c[0])return;D=D.parent()}for(D=$(h.target);D[0]!=x[0];){if(D[0]==d[0])return;D=D.parent()}u()},E=function(){t&&
setTimeout(function(){t.css("display",a.val()?"none":"")},0)};this.protectedMethod={updateText:function(h){k();a.val(h?h:"");h&&a.attr("title",h);"placeholder"in a[0]||E()},doDropdown:u}}function ya(){va.call(this);var q=this,c=this.protectedMethod,a,b=[],d;this.getDropDownContent=function(h){q.initTreeSelector();return a.getJqUi()};this.setSelectedTreePath=function(h){d=h;c.updateText(d?d.getText():"")};this.getSelectedTreePath=function(){return d};this.initTreeSelector=function(){if(b){a=new ta;
a.setRootVisible(!1);a.setNodePainter(u);var h=a,x=h.setRoot,D=b,V=new y;V=t(V);e(V,D);V.getChild(0).setExpanded(!0);x.call(h,V);a.hookLoadingHandler(l);a.addSelectingListener(K);a.getRoot().setExpanded(!0);a.getRoot().setSelectable(!1);a.setLineHeight(30);f.layoutCtrl(a.getJqUi(),0,1,"100%",118);a.getJqUi().css("border","1px solid rgba(138, 153, 170, 0.4)");a.getJqUi().css("background","white");a.getJqUi().appendTo($(document.body))}else return null};this.setArrFolderNode=function(h){b=h};this.getArrFolderNode=
function(){return b};var t=function(h){var x=new ta.BranchNode;x.setUserObject(h);""==h.getId()&&x.setSelectable(!1);return x},g=function(h){var x=new ta.LeafNode;x.setUserObject(h);return x},e=function(h,x){if(x&&0<x.length)for(var D=0;D<x.length;D++){var V=x[D];0<V.getDirChildren().length?k(h,V):h.addChild(g(V.getUserObject()))}},k=function(h,x){if(0<x.getDirChildren().length)var D=t(x.getUserObject());else{if(x.getUserObject().isPreset())return;D=g(x.getUserObject())}h.addChild(D);h=x.getDirChildren();
if(0!=h.length)for(x=0;x<h.length;x++)h[x].getChildren()?k(D,h[x]):D.addChild(g(h[x]).getUserObject())},l=function(h,x){setTimeout(function(){e(h);x()},500)},u=function(h,x){h.css("padding-left","4px");h.css("padding-right","4px");h.text(x.getUserObject().getName())},K=function(h,x){if(x.isSelectable()){x=x.getTreePath();for(var D=h="",V=1;V<x.length;V++)1<V&&(h+="/"),D=x[V],h+=D.getUserObject().getName(),D=D.getUserObject().getId();x=new O;x.setValue(D);x.setText(h);d=x;c.updateText(d?d.getText():
"");c.doDropdown()}},E=200;this.setMaxHeight=function(h){E=h};this.getPopupHeight=function(){return null==b||0==b.length?22:Math.min(30*b.length+2,E+2)}}function O(){var q=this,c,a,b,d,t;this.getIsShow=function(){return t};this.setIsShow=function(g){t=g};this.getValue=function(){return c};this.setValue=function(g){c=g};this.getText=function(){return a};this.setText=function(g){a=g};this.getUserObject=function(){return b};this.setUserObject=function(g){b=g};this.isPreset=function(){return d};this.setIsPreset=
function(g){d=g};this.toJsonObject=function(){var g={};g.value=c;g.text=a;return g};this.fromJsonObject=function(g){g&&(g.value&&q.setValue(g.value),g.text&&q.setText(g.text),g.isPreset&&q.setIsPreset(g.isPreset))}}"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.imagelib&&(com.kingdee.bos.qing.imagelib=
{});"undefined"==typeof com.kingdee.bos.qing.imagelib.common&&(com.kingdee.bos.qing.imagelib.common={});"undefined"==typeof com.kingdee.bos.qing.imagelib.common.ui&&(com.kingdee.bos.qing.imagelib.common.ui={});var P=com.kingdee.bos.qing.imagelib.common.ui;P.AbstractManagePanel=function(){var q=this,c,a,b,d,t,g,e,k,l,u=!1,K=[];this.getJqUi=function(){return c};this.setCategoryAndCardContainer=function(v,F){e=v;k=F;k.setDeleteCategory(e.setDeleteCategory);k.setRefreshSearchPanel(function(){d.getJqUi().is(":visible")&&
z()})};var E=function(v){a=new A;var F=a.getJqUi();F.addClass("manage-toolbar");a.createButton(F,!1,function(){g.click()},G.get("import","\u5bfc\u5165"));a.createButton(F,!1,q.exportImage,G.get("export","\u5bfc\u51fa"));"qing"==C.getAppId()&&a.createButton(F,!1,q.galleryCloud,G.get("gallery","\u4e91\u7d20\u6750"));a.createButton(F,!1,q.refresh,G.get("refresh","\u5237\u65b0"));a.createButton(F,!1,function(){R.closeCurrentTab()},G.get("exit","\u9000\u51fa"));$("<div>").addClass("manage-toolbar-search-bar");
F.appendTo(v)},h=function(v){g=$("<input type='file' id='uploadBtn'>");g.addClass("import-image-file");g.on("change",function(F){q.importImage(F);g.val("")});g.appendTo(v)},x=function(v){var F=$("<div>");F.addClass("manage-managed-container");F.appendTo(v);if(!k||!e)throw Error("Card container or list container is not be set.");var N=e.getJqUi(),H=k.getJqUi();t=new T;t.setHorizontalSplit(!0);t.setEnabled(!0);t.setSplitLineWide(8);t.setResizeMode(T.RESIZE_MODE_FIRST_FIXED);t.setFirstSize(230,200,640);
t.setSecondSize($(document).width()-230,0,-1);e.setFunItemClick(k.setModelAndUpdateUi);e.setLoadImages(k.loadModels);e.updateListUi();k.setFunCategoriesProvider(e.provideCategories);k.setFunGetDynamicWidth(D);k.setSelectCategory(e.setSelected);v=t.getJqUi();t.setFirstChild(T.createChildWrapper(N,function(){N&&N.css({width:t.getNonemptyFirstWide()+"px"})}));t.setSecondChild(T.createChildWrapper(H,function(){k.updateWidth();H&&H.css({width:document.documentElement.clientWidth-t.getNonemptyFirstWide()+
"px"})}));var ka=new ma;ka.setCallbackImmediately(function(){t.resize()});ka.setDelay(500);ka.observe();v.children(".sa-ctrl-splitpane-part").css("z-index","auto");v.appendTo(F)},D=function(){var v=document.body.clientWidth,F=0;if(l&&!l.isHidden()){var N=4;F=l.getWidth()}else N=19;return v-e.getJqUi().width()-F-N},V=function(v){b=new la;var F=L.getAllType();b.setItemModels(F);b.setSelected(F[0]);b.addSelectedChangedListener(function(H,ka,Q){k.updateUi(Q)});b.setCustomPainter(function(H,ka,Q){H=Q===
J.ALL?G.get("allType","\u5168\u90e8\u7c7b\u578b"):Q;ka.text(H)});k.setFunGetCurrentType(b.getSelected);F=b.getJqUi();F.addClass("manage-search-combo-box");F.appendTo(v);d=new ba;d.setSearchListenerDelay(1E3);d.addSearchListener(z);d.addCloseListener(function(){l&&(l.showOrHide(!1),k.updateWidth())});d.setAlwaysShowCleanIcon(!0);d.setShowSearchIcon(!0);d.setPlaceholder(G.get("searchImageName","\u641c\u7d22\u56fe\u7247\u540d\u79f0"));var N=d.getJqUi();N.addClass("manage-search-box");N.find(":input").on("keydown",
function(H){13===(H.keyCode||H.which||H.charCode)&&z()});N.hide();N.appendTo(v);F=$("<div>");F.addClass("manage-search-icon");U().background(F,"icon-search");F.appendTo(v);F.on("mouseenter",function(){N.show();d.setFoucs()});a.getJqUi().on("mousedown",function(H){H=$(H.target);N.find(H)[0]||Z()});e.getJqUi().on("click",Z)},Z=function(){d.getJqUi().hide();l&&(l.emptyList(),l.showOrHide(!1),k.updateWidth())},B=function(){l=new ia;l.init();l.setFunJumpToImage(p);l.setFunWidthChangedCallback(function(){k.updateWidth()});
l.getJqUi().appendTo(k.getJqUi())},z=function(){u&&!l?(B(),w()):u||l?u?w():q.getAllModels(function(){w()}):q.getAllModels(function(){B();w()})},w=function(){var v=d.getText();if(v){K=e.getAllChildren();var F=v,N,H=[];F=F&&F.trim();var ka=b.getSelected();ka=ka?ka:J.ALL;if(F)for(F=F.toUpperCase(),N=0;N<K.length;N++){var Q=K[N],ca=Q.getUserObject();-1<q.getFunGetSearchValue(ca).indexOf(F)&&ca.isSameType(ka)&&H.push(Q)}l.updateUi(H,v);l.showOrHide(!0);e.updateListAndUi()}else l.showOrHide(!1);k.updateWidth()},
p=function(v,F){e.setSelected(v);k.setModelAndUpdateUi(v);k.selectTargetCard(F)};this.jumpToImageByImageModel=function(v){k.setTargetId(v.getId());e.setSelectedId(v.getCategoryId())};this.appendToolBarButton=function(v,F,N,H){a.addButton(v,F,N,H)};this.refresh=function(v){u=!1};this.importImage=function(v){throw Error("Override me!");};this.exportImage=function(){throw Error("Override me!");};this.galleryCloud=function(){throw Error("Override me!");};this.getFunGetSearchValue=function(v){throw Error("Override me!");
};this.getAllModels=function(){u=!0};this.protectedMethod={init:function(){c=$("<div>");c.addClass("manage-main");h(c);E(c);x(c);V(a.getJqUi())},getUploadBtn:function(){return g},hasAllChildren:function(){return u},getCategoryContainer:function(){return e}}};P.ManagedSearchPanel=ia;P.AbstractCard=wa;P.AbstractTextOpDialog=ua;P.AbstractCategoryList=da;P.AbstractCategoryContainer=function(){var q=this,c,a,b,d,t,g,e,k=!1,l=[],u;this.getJqUi=function(){return c};this.setFunItemClick=function(w){g=w};
this.afterCreateList=function(w,p){throw Error("Override me!");};this.updateListUi=function(w){d&&t&&!w?z(function(p){p.updateUi();p.getSelected()&&p.getSelected().equals(p.getCurrent())||!p.getCurrent()?g&&g(p.getCurrent()):p.setSelected(p.getCurrent());e&&(p=e,e=null,p())}):(a&&a.empty(),h())};this.setRefreshCallBack=function(w){e=w};this.bindImagesIntoCategories=function(w){d&&d.bindChildrenIntoCategories(w);t&&t.bindChildrenIntoCategories(w)};this.getAllModels=function(){var w=d?d.getAllModels().concat():
[];return[t?t.getAllModels().concat():[],w]};this.getAllChildren=function(){var w=d?d.getAllModels():[],p=d?d.getAllModels():[];return E(w).concat(E(p))};this.updateListAndUi=function(){t.updateListAndUi();d.updateListAndUi()};this.setSelectedByFullPath=function(w){a:{var p=w.split(r.SEPERATOR)[0],v=p===r.PERSISTENT_NAMESPACE_SYSTEM;p=p===r.PERSISTENT_NAMESPACE_COMMON||p===r.PERSISTENT_NAMESPACE_GALLERY_COMMON||v?t.getAllModels():d.getAllModels();for(v=0;v<p.length;v++){for(var F=p[v],N=F.getUserObject().getNameSpace()+
"/",H=F,ka=H.getUserObject().getName();H.getParent()&&H.getParent().isVisible();)H=H.getParent(),ka=H.getUserObject().getName()+"/"+ka;if(w===N+ka){w=F;break a}}w=p[0]}q.setSelected(w)};this.setSelected=function(w){var p=w.getUserObject();k=p.isPublic();p.isPublic()||p.isPreset()?t.updateCurrent(w):d.updateCurrent(w);B();q.updateListUi(!1)};this.setSelectedId=function(w){u=w;K()};var K=function(){if(!d||!t||!u)return!1;var w=u;var p=d.getAllModels(),v=t.getAllModels();p=p.concat(v);v=null;for(var F=
0;F<p.length;F++){var N=p[F];if(N.getId()===w){v=N;break}}(w=v)&&q.setSelected(w);u=null;return!!w};this.setDeleteCategory=function(w){var p=w.getUserObject();p.isPublic()||p.isPreset()?t.deleteByModel(w):d.deleteByModel(w);B();q.updateListUi(!1)};var E=function(w){for(var p=[],v=0;v<w.length;v++)for(var F=w[v].getChildren(),N=0;N<F.length;N++){var H=F[N];H instanceof I&&p.push(H)}return p},h=function(){C.createFacade(function(w){var p=0,v=[],F=[],N=[],H=[],ka=[],Q=x(G.get("userUploadFile","\u4e0a\u4f20\u7684\u56fe\u7247"),
"",!1,!1);N.push(Q);var ca=x(G.get("userUploadFile","\u4e0a\u4f20\u7684\u56fe\u7247"),"",!0,!1);v.push(ca);var na=x(G.get("downloadGallery","\u6765\u81ea\u4e91\u7d20\u6750"),"",!1,!0);H.push(na);var Ba=x(G.get("downloadGallery","\u6765\u81ea\u4e91\u7d20\u6750"),"",!0,!0);F.push(Ba);for(p=0;p<w.length;p++){var za=new y,Aa=new W;Aa.fromJsonObject(w[p]);za.setUserObject(Aa);za.fromJsonObject(w[p]);Aa.isPreset()?(ka.push(za),za.setParent(ca)):Aa.isPublic()?Aa.isGallery()?(Ba.addDirChildren(za),za.setParent(Ba)):
(ca.addDirChildren(za),za.setParent(ca)):Aa.isGallery()?(na.addDirChildren(za),za.setParent(na)):(Q.addDirChildren(za),za.setParent(Q))}for(p=0;p<ka.length;p++)ca.addDirTo(ka[p],0);if(0<Ba.getDirChildren().length)for(p=0;p<F.length;p++)v.push(F[p]);if(0<na.getDirChildren().length)for(p=0;p<H.length;p++)N.push(H[p]);var Da=z(function(Ca){return Ca&&Ca.getCurrent()});Da&&Da.setVisited(!1);w=[];p=[];D(w,N);D(p,v);d=new l[0](w);d.setFunItemClick(g);t=new l[1](p);t.setFunItemClick(g);Da&&z(function(Ca){Ca.updateCurrent(Da)});
d.getJqUi().appendTo(a);t.getJqUi().appendTo(a);q.afterCreateList(d,t);u&&K()||(B(),q.updateListUi())},function(){return!1}).getAllCategory()},x=function(w,p,v,F){var N=new y,H=new W;H.setId(p);H.setName(w);H.setPublic(v);H.setGallery(F);N.setUserObject(H);N.setVisible(!1,!0,!1);return N},D=function(w,p){if(null!=p)if(Array.isArray(p))for(var v=0;v<p.length;v++)p[v].getParent()&&p[v].setExpanded(!1),w.push(p[v]),D(w,p[v].getDirChildren());else w.push(p),D(w,p.getDirChildren())},V=function(w,p,v){var F=
$("<div>");F.addClass("image-lib-group-tab");F.text(p);F.attr("title",p);F.on("click",Z);F.data("index",v);0===v&&F.addClass("image-lib-group-tab-active");F.appendTo(w)},Z=function(w){k=$(w.target).data("index")===W.GROUP_TYPE_PUBLIC;B();q.switchTabCallback();q.updateListUi()},B=function(){var w=b.find(".image-lib-group-tab");w.each(function(F){var N=w.eq(F);N.removeClass("image-lib-group-tab-active");(k&&1===F||!k&&0===F)&&N.addClass("image-lib-group-tab-active")});var p=t.getJqUi(),v=d.getJqUi();
k?(v.hide(),p.show()):(p.hide(),v.show())};this.switchTabCallback=function(){};var z=function(w){return k?w(t):w(d)};this.protectedMethod={init:function(){c=$("<div>");c.addClass("image-lib-group-container");b=$("<div>");b.addClass("image-lib-group-tab-container");V(b,G.get("private","\u4e2a\u4eba"),0);V(b,G.get("public","\u516c\u5171"),1);b.appendTo(c);a=$("<div>");a.addClass("image-lib-group-list");a.appendTo(c)},setPublic:function(w){k=w},isPublic:function(){return k},getJqCategoryList:function(){return a},
operateCategoryList:z,setCategoryListClass:function(w,p){l=[];l.push(w);p?l.push(p):l.push(w)},getPrivateCategoryList:function(){return d},getPublicCategoryList:function(){return t}}};P.AbstractCardContainer=function(){var q=this,c,a,b,d,t,g,e,k,l;this.setFunGetCurrentType=function(E){t=E;q.protectedMethod.getCurrentType=E};this.getJqUi=function(){c||(c=$("<div>"),c.addClass("manage-card-container"),b=$("<div>"),b.addClass("manage-card-list"),b.appendTo(c));return c};this.setSearchKey=function(E){g=
E?E.toUpperCase():""};this.previewImage=function(E){d||(d=new sa);d.preview(E)};this.setModelAndUpdateUi=function(E){E&&!E.isVisited()?q.loadModels(E,!0):(e=E?E.getChildren():[],q.updateUi(t&&t()))};this.createNoDataUi=function(E){throw Error("Override me!");};this.updateUi=function(E){b&&b.empty();E=E?E:J.ALL;E=u(E);for(var h=[],x=0;E&&x<E.length;x++){var D=E[x];g?-1<D.getName().toUpperCase().indexOf(g)&&h.push(D):h.push(D)}(E=h)&&0!==E.length||a?E&&0!==E.length?(a&&a.hide(),b.show()):(a&&a.show(),
b.hide()):(a=q.createNoDataUi(),a.appendTo(c),b.hide());for(h=0;h<E.length;h++)q.addCard(E[h]);if(e&&!(0>=e.length)&&k){E=k;h=null;for(x=0;x<e.length;x++)if(D=e[x].getUserObject(),D.getId()==E){h=D;break}(E=h)&&q.selectTargetCard(E);k=null}};var u=function(E){var h=[],x;for(x=0;x<e.length;x++){var D=e[x];D.getUserObject().isSameType(E)&&h.push(D)}return h};this.selectTargetCard=function(E){E&&(0==document.body.clientHeight||0==document.body.clientWidth?(l=new ma,l.setDelay(250),l.setCallbackImmediately(function(){K(E)}),
l.observe()):K(E))};var K=function(E){l&&l.unobserve();E=b.find("#"+E.getId());b[0].scrollTop=E[0].offsetTop;q.selectedUIFeedback(E)};this.setTargetId=function(E){k=E};this.selectedUIFeedback=function(E){throw Error("Override me!");};this.addCard=function(E){throw Error("Override me!");};this.loadModels=function(E,h,x){throw Error("Override me!");};this.protectedMethod={getModelsByType:u,setModels:function(E){E||(E=[]);e=E},getModels:function(){return e},isNameDuplicate:function(E){var h;for(h=0;h<
e.length;h++)if(e[h].getName()===E)return!0;return!1},getCardList:function(){return b},getSearchKey:function(){return g}}};P.PreviewPanel=sa;P.ImageCard=function(q,c,a){wa.call(this);var b=this.protectedMethod,d=this,t,g,e,k,l,u,K,E=!1,h=!1,x=!1,D="";(function(){var Q=a.getUserObject();E=Q.isPreset();if(c)h=!1;else{var ca=C.hasPublicPermission(),na=Q.isPublic();x=Q.isGallery();h=E?!1:na?ca:!0}})();this.setFunDuplicateNameChecker=function(Q){};this.setCategoriesProvider=function(Q){u=Q};this.setFunCardOpCallBack=
function(Q){K=Q};this.setFunPreview=function(Q){l=Q};this.setSearchKey=function(Q){D=Q?Q.toUpperCase():"";d.updateUi()};this.init=function(){d.setModel(q);c&&b.setSize(200,200);b.init();E&&b.setPresetIconBack();var Q=d.getModel(),ca=Q.getName(),na=Q.getFullName(),Ba=Q.getThumbnailUrl(),za=d.getContentWidth()/d.getContentHeight();d.getJqUi().attr("id",Q.getId());if(d.getModel().hasContent()){var Aa=$("<img>");Aa.addClass("image-card-image");Aa.attr("src",Ba);Aa.attr("alt",ca);za<Q.getAspectRatio()?
(Aa.css("width",d.getContentWidth()),Q=Q.getHeightAtSameRatio(d.getContentWidth()),Aa.css("top",Math.floor((d.getContentHeight()-Q)/2))):(Aa.css("height",d.getContentHeight()),Q=Q.getWidthAtSameRatio(d.getContentHeight()),Aa.css("left",Math.floor((d.getContentWidth()-Q)/2)))}else Aa=V();b.addCustomJq2Content(Aa);g=$("<div>");g.addClass("image-card-title");g.text(na);g.attr("title",na);b.addCustomJq2FooterHead(g);na=$("<div>");na.on("click",function(){l(d.getModel())});na.attr("title",G.get("preview",
"\u9884\u89c8"));U().backgroundWithHover(na,"icon-preview");b.addOpIcon2FooterTail(na);!h||c||x?h&&x&&B():Z()};var V=function(){var Q=$("<div>");Q.addClass("image-lib-choose-no-image");var ca=$("<div>");ca.addClass("image-lib-choose-no-image-icon");U().background(ca,"icon-no-image");ca.appendTo(Q);ca=$("<div>");ca.addClass("image-lib-choose-no-image-text");var na=G.get("imageCanNotBeFind","\u627e\u4e0d\u5230\u5bf9\u5e94\u7684\u56fe\u7247");ca.attr("title",na);ca.text(na);ca.appendTo(Q);return Q},
Z=function(){var Q=$("<div>");U().backgroundWithHover(Q,"icon-more");Q.attr("title",G.get("moreOp","\u66f4\u591a\u64cd\u4f5c"));t=new ra;t.setIconSetter(U().backgroundWithHover);var ca=new aa;z(ca,G.get("rename","\u91cd\u547d\u540d"),w);z(ca,G.get("moveTo","\u79fb\u52a8\u5230"),v);z(ca,G.get("remove","\u5220\u9664"),N,"icon-small-delete");t.setModel(ca);Q.on("click",function(){t.show(Q.parent(),10,30,null,null)});b.addOpIcon2FooterTail(Q)},B=function(){var Q=$("<div>");U().backgroundWithHover(Q,"icon-small-delete");
Q.attr("title",G.get("remove","\u5220\u9664"));Q.on("click",function(){N()});b.addOpIcon2FooterTail(Q)},z=function(Q,ca,na,Ba){na=new ea(na);Ba&&na.setIconName(Ba);na.setText(ca);Q.addItemModel(na)};this.updateUi=function(){g&&g.empty();var Q=d.getModel(),ca=Q.getFullName(),na=Q.getName();Q=Q.getType();C.highlightKeyWords(g,D,na);na=$("<span>");na.text("."+Q);g.append(na);g.attr("title",ca)};var w=function(){e=new xa(G.get("imageName","\u56fe\u7247\u540d\u79f0"));e.setFunClosingCallBack(p);e.init();
e.setFolderNode(a);e.setModel(d.getModel());e.showDialog();e.requestFocus()},p=function(Q){var ca=d.getModel();C.createFacade(function(na){!0===na&&(b.rename(Q),d.updateUi(),C.getMessageCurtain().showSuccess(G.get("renameImageName","\u4fee\u6539\u56fe\u7247\u540d\u79f0")+G.get("success","\u6210\u529f")+G.get("fullPoint","\u3002")))},function(na,Ba){return 1100042===na?(C.getMessageCurtain().showPrompt(G.get("imageNameExist","\u56fe\u7247\u540d\u79f0\u5df2\u5b58\u5728\u3002")),!0):1100041===na?(C.getMessageCurtain().showPrompt(G.get("imageNotExist",
"\u56fe\u7247\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),!0):!1}).renameImage(ca.toJsonObject(),Q+"."+ca.getType());return!0},v=function(){var Q=u();Q&&0!==Q.length?(k=new Y(G.get("category","\u76ee\u5f55")),k.setModel(d.getModel()),k.setTargetModels(Q),k.setFunClosingCallBack(F),k.init(),k.showDialog()):C.getMessageCurtain().showPrompt(G.get("noCategoriesToMove","\u6ca1\u6709\u53ef\u4f9b\u79fb\u52a8\u7684\u5206\u7ec4\u3002"))},F=function(){var Q=d.getModel(),ca=k.getSelectedModel(),
na=ca.getUserObject();if(Q.getCategoryId()==na.getId())return!0;var Ba=new n;Ba.setUserObject(Q);Ba.setParent(ca);ca.addTo(Ba,1);a.setVisited(!1);C.createFacade(function(za){!0===za&&(Q.setCategoryId(na.getId()),d.updateUi(),C.getMessageCurtain().showSuccess(G.get("move","\u79fb\u52a8")+G.get("success","\u6210\u529f")+G.get("fullPoint","\u3002")));K(a,!0)},function(za,Aa){ca.deleteFrom(1);return 1100042===za?(C.getMessageCurtain().showPrompt(G.get("imageNameExist","\u56fe\u7247\u540d\u79f0\u5df2\u5b58\u5728\u3002")),
!0):1100041===za?(C.getMessageCurtain().showPrompt(G.get("imageNotExist","\u56fe\u7247\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),!0):!1}).moveImage(Q.toJsonObject(),na.getId());return!0},N=function(Q){C.createFacade(function(ca){H(ca)},function(){return!1}).getRefTimeOfImage(d.getModel().getFileName())},H=function(Q){Q=0<Q?G.get("confirmDeleteImageHasRef","\u8be5\u56fe\u7247\u88ab\u5f15\u7528\u4e86#1\u6b21\uff0c\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f").replace("#1",Q):G.get("confirmDeleteImage",
"\u786e\u5b9a\u8981\u5220\u9664\u8be5\u56fe\u7247\u5417\uff1f");var ca=M.createFeedbackDialog();ca.setOptionType(M.OPTION_OK_CANCEL);ca.setMsgImageType(M.MSG_DELETE);ca.setMessage(Q);ca.setClosingChecker(function(na){na===M.RETURN_OK&&ka(d.getModel());return!0});ca.showDialog()},ka=function(){C.createFacade(function(){C.getMessageCurtain().showSuccess(G.get("deleteImageSuccess","\u5220\u9664\u56fe\u7247\u6210\u529f\u3002"));K(a,!0)},function(Q,ca){return 1100041===Q?(C.getMessageCurtain().showPrompt(G.get("imageNotExist",
"\u56fe\u7247\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002")),!0):!1}).deleteImage(d.getModel().toJsonObject())}};var S,f,m,A,aa,ea,M,ba,T,ja,oa,la,fa,ha,pa,ra,ta,G,ma,R,X,L,J,W,y,n,I,r,C;(function(){var q=com.kingdee.bos.qing.common;f=q.DomUtil;q=com.kingdee.bos.qing.ui.component;m=q.AbstractModalDialog;ja=q.Label;aa=q.MenuModel;ea=q.MenuItemModel;M=q.MessageDialog;ba=q.SearchBox;A=q.Toolbar;T=q.SplitPane;oa=q.TextField;la=q.ComboBox;fa=q.Button;ha=q.Icons;pa=q.List;ra=q.Menu;ta=q.Tree;
q=com.kingdee.bos.qing.framework.common;ma=q.WindowResizeObserver;R=q.TabbedUiUtil;X=q.MultilanguageManager;q=com.kingdee.bos.qing.imagelib.model;L=q.ImageLibModelUtil;J=q.ImageType;y=q.FolderNode;W=q.ImageCategory;n=q.LeafNode;I=q.Image;r=q.PathModel;q=com.kingdee.bos.qing.imagelib.common;G=X.createPackageAccessor(q);C=q.ImageLibUtil})()})();(function(){function U(){ea||(ea=com.kingdee.bos.qing.imagelib.MyIcons);return ea}function da(R,X){ya.call(this);var L=this,J=L.protectedMethod,W,y,n,I,r,C,q,c,a=!1,b=!1;this.selectImage=function(h,x){if(x)try{var D=JSON.parse(x),V=D.nameSpace;var Z=V===la.PERSISTENT_NAMESPACE_SYSTEM?m.get("preset","\u9884\u7f6e")+"/":V===la.PERSISTENT_NAMESPACE_COMMON?m.get("public","\u516c\u5171")+"/"+m.get("userUploadFile","\u4e0a\u4f20\u7684\u56fe\u7247")+"/":V===la.PERSISTENT_NAMESPACE_GALLERY_USER?m.get("private",
"\u4e2a\u4eba")+"/"+m.get("downloadGallery","\u6765\u81ea\u4e91\u7d20\u6750")+"/":V===la.PERSISTENT_NAMESPACE_GALLERY_COMMON?m.get("public","\u516c\u5171")+"/"+m.get("downloadGallery","\u6765\u81ea\u4e91\u7d20\u6750")+"/":m.get("private","\u4e2a\u4eba")+"/"+m.get("userUploadFile","\u4e0a\u4f20\u7684\u56fe\u7247")+"/";Z+=D.groupName+"/"+D.name}catch(B){Z=void 0,console.error("JSON.parse() error:"+B)}void 0===R?(h(),Z&&J.getMessageCurtain().showPrompt(m.get("imageNotExistWithPath","\u56fe\u7247\u201c#1\u201d\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002").replace("#1",
Z))):R?G.createFacade(function(B){if(B){var z=new M;z.fromJsonObject(B);c=z}else Z?J.getMessageCurtain().showPrompt(m.get("imageNotExistWithPath","\u56fe\u7247\u201c#1\u201d\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002").replace("#1",Z)):J.getMessageCurtain().showPrompt(m.get("imageNotExist","\u56fe\u7247\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002"));h()},function(){return!1}).getImageModelByImageFileName(R):(h(),Z&&J.getMessageCurtain().showPrompt(m.get("imageNotExistWithPath",
"\u56fe\u7247\u201c#1\u201d\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664\u3002").replace("#1",Z)))};this.setHasOnlyClose=function(h){b=h};this.setSelectedImage=function(h){c=h};this.show=function(){W||g();L.showDialog()};this.setFunSelected=function(h){C=h};this.setFunClosedCallback=function(h){q=h};var d=function(h){G.createFacade(function(x){var D,V=[];for(D=0;D<x.length;D++){var Z=x[D],B=new ja,z=new M;z.fromJsonObject(Z);B.setUserObject(z);V.push(B)}r.bindImagesIntoCategories(V);h&&h();a=!0},
function(x,D){return!1}).getAllImage()},t=function(){var h=y.getText().trim();a?r.searchKey(h):d(function(){r.searchKey(h)})},g=function(){G.setAppId("qing");G.setMessageCurtain(J.getMessageCurtain());J.setTitle(b?m.get("imageManagement","\u56fe\u7247\u7ba1\u7406"):m.get("chooseImage","\u9009\u62e9\u56fe\u7247"));L.setSize(902,606);J.setFooterClosingOnly(b);J.setContentPaneCreator(k);J.setClosingChecker2(function(h){var x=I.getSelected();x?(x=x.getUserObject().getFileName(),G.createFacade(function(D){D||
J.getMessageCurtain().showPrompt(m.get("imageNotExistReSelect","\u56fe\u7247\u4e0d\u5b58\u5728\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u56fe\u7247\u3002"));h(D)},function(D,V){J.getMessageCurtain().showPrompt(m.get("imageNotExistReSelect","\u56fe\u7247\u4e0d\u5b58\u5728\uff0c\u8bf7\u91cd\u65b0\u9009\u62e9\u56fe\u7247\u3002"));h(!1);return!0}).checkImageExist(x)):h(!1)},function(h){h(!0)},!0);J.setClosingAction(e)},e=function(h){if(h){var x=I.getSelected();h=x.getUserObject();x=x.getParent();var D=x.getUserObject().isPublic()?
la.PERSISTENT_NAMESPACE_COMMON:la.PERSISTENT_NAMESPACE_USER;D=x.getUserObject().isPreset()?la.PERSISTENT_NAMESPACE_SYSTEM:D;x=D+la.SEPERATOR+x.getName()+la.SEPERATOR+h.getFullName();C&&C(h,x)}else q&&q()},k=function(){W=$("<div>");W.addClass("image-lib-choose-container");Y.layoutCtrlWithLRTB(W,0,0,null,0,null,null);var h=$("<div>");h.addClass("image-lib-choose-content");h.css("border","1px solid #f1f1f1");Y.layoutCtrlWithLRTB(h,0,0,null,40,0,null);E(h);var x=$("<div>");x.addClass("image-lib-choose-header");
x.appendTo(W);l(x);y=new O;y.setShowSearchIcon(!0);y.addSearchListener(t);y.setSearchListenerDelay(500);y.setPlaceholder(m.get("searchImageName","\u641c\u7d22\u56fe\u7247\u540d\u79f0"));var D=y.getJqUi();D.addClass("image-lib-choose-search-box");D.appendTo(x);u(x);r.setFunItemClick(I.setModelAndUpdateUi);r.updateListUi();h.appendTo(W);return W},l=function(h){n=new P;var x=T.getAllType();n.setItemModels(x);n.setSelected(x[0]);n.addSelectedChangedListener(function(D,V,Z){r.searchKey(y.getText())});
n.setCustomPainter(function(D,V,Z){D=Z===ba.ALL?m.get("allType","\u5168\u90e8\u7c7b\u578b"):Z;V.text(D)});I.setFunGetCurrentType(n.getSelected);r.setFunGetCurrentType(n.getSelected);x=n.getJqUi();x.addClass("image-lib-choose-combo-box");x.appendTo(h)},u=function(h){var x=$("<div>");x.on("click",function(V){r.updateListUi(!0);t()});x.addClass("image-lib-choose-btn-image-library");var D=$("<div>");D.addClass("image-lib-choose-btn-image-library-icon");D.css("margin-top","5px");U().background(D,"refresh");
D.appendTo(x);D=$("<div>");D.addClass("image-lib-choose-btn-image-library-text");D.text(m.get("refresh","\u5237\u65b0"));D.appendTo(x);x.appendTo(h);x=$("<div>");x.on("click",function(V){V=m.get("imageLibrary","\u56fe\u7247\u5e93");var Z=va.decodeParamFromUrl(location.search,"pageId");Z&&0<=Z.indexOf("qing_workbench")?A.openNewTabInAppId(V,K(),"1535516017197902848",A.QING_ANALYSIS):A.openNewTab(V,K(),"1535516017197902848")});x.addClass("image-lib-choose-btn-image-library");D=$("<div>");D.addClass("image-lib-choose-btn-image-library-icon");
U().background(D,"icon-image-library");D.appendTo(x);D=$("<div>");D.addClass("image-lib-choose-btn-image-library-text");D.text(m.get("imageLibrary","\u56fe\u7247\u5e93"));D.appendTo(x);x.appendTo(h)},K=function(){var h=va.decodeParamFromUrl(location.search,"path");return(h?h:"/ierp")+"/qing/imageLibEntrance.do"},E=function(h){var x=new S;x.setHorizontalSplit(!0);x.setEnabled(!0);x.setSplitLineWide(1);x.setResizeMode(S.RESIZE_MODE_FIRST_FIXED);x.setFirstSize(200,200,640);x.setSecondSize(702,0,-1);
r=new ia;r.init();c&&r.setSelectedCategoryId(c.getCategoryId());var D=r.getJqUi();I=new sa;!1===X&&I.setSupportGif(X);b&&I.setSelectedCardBlank(b);c&&I.setSelectedImage(c);var V=I.getJqUi();r.setFunSetKeyToCardContainer(I.setSearchKey);var Z=x.getJqUi();x.getJqSplitLine().css("background-color","#e3e3e3");x.setFirstChild(S.createChildWrapper(D,function(){D&&D.css({width:x.getNonemptyFirstWide()+"px"})}));x.setSecondChild(S.createChildWrapper(V,function(){V&&V.css({width:902-x.getNonemptyFirstWide()+
"px"})}));Z.appendTo(h)}}function ia(){pa.call(this);var R=this,X=R.protectedMethod,L,J,W;this.setSelectedCategoryId=function(y){W=y};this.setFunGetCurrentType=function(y){L=y};this.setFunSetKeyToCardContainer=function(y){J=y};this.init=function(){X.setCategoryListClass(qa);X.init();X.getJqCategoryList().css("top","45px");R.getJqUi().find(".image-lib-group-tab-container").css("background-color","#ffffff")};this.afterCreateList=function(y,n){y.setFunGetCurrentType(L);n.setFunGetCurrentType(L);if(W){var I=
y.getAllModels(),r=n.getAllModels();I=I.concat(r);for(r=0;r<I.length;r++){var C=I[r];if(C.getId()===W){var q=C;break}}q&&q.getUserObject().isPublic()?(X.setPublic(!0),n.updateCurrent(q)):!q&&I[1]?y.updateCurrent(I[1]):y.updateCurrent(q)}};this.searchKey=function(y){X.getPrivateCategoryList().setKeyWord(y);X.getPublicCategoryList().setKeyWord(y);J(y);X.operateCategoryList(function(n){n.updateUi();n.itemClick(n.getCurrent())})}}function qa(R){ha.call(this,R);var X=this,L;this.setFunGetCurrentType=function(n){};
this.setFunItemClick=function(n){L=n};this.itemClick=function(n){var I,r=X.getJqUi().find(".img-lib-mange-lists-dir"),C=n.getUserObject().isPreset(),q=X.getList().getJqUi().find(".img-lib-mange-lists-dir-preset_selected");q&&q.removeClass("img-lib-mange-lists-dir-preset_selected");r.each(function(c){c=$(r[c]);var a=c.data("oNode");if(a&&a.equals(n)&&n.getParent()){for(a=a.getParent();a&&!a.isExpanded();)J(a),a=a.getParent();I=c}});C&&(C=I.find(".img-lib-mange-lists-dir-preset"))&&C.addClass("img-lib-mange-lists-dir-preset_selected");
I&&I.addClass("sa-ctrl-list-item_selected_enabled");X.updateCurrent(n);L&&L(n)};this.setKeyWord=function(n){n&&n.toUpperCase()};this.getNoDataPrompt=function(){return m.get("noImage","\u6682\u65e0\u56fe\u7247")};this.listItemPainter=function(n,I){n.addClass("img-lib-mange-lists-dir");n.data("oNode",I);var r=$("<div>"),C=I.getUserObject(),q=C.getName();r.text(q);r.addClass("img-lib-mange-lists-dir-text");r.css("margin-left",14*I.getSubNodeLevel()+"px");r.css("margin-right","23px");n.attr("title",q);
n.addClass("image-lib-manage-list-item-across");var c=$("<div>");c.addClass("select-tree-menu-icon-click");c.css("margin-left",14*I.getSubNodeLevel()+"px");c.data("oItemModel",I);var a=$("<div>");a.addClass("select-tree-menu-icon");a.css("cursor","pointer");c.append(a);I.isHide()?n.hide():I.getParent()?(n.show(),c.on("mousedown",function(d){d.stopPropagation();d=$(d.currentTarget).data("oItemModel");J(d)})):n.show();var b=I.isExpanded();(q=I.getDirChildren())&&0<q.length&&I.getParent()&&(y(b,a),n.append(c));
n.append(r);c=$("<div>");C.isPreset()?(c=$("<div>"),c.text(m.get("preset","\u9884\u7f6e")),c.addClass("img-lib-mange-lists-dir-preset"),c.css("margin-left",14*I.getSubNodeLevel()+24+"px"),"preset"==c.text()?r.css("margin-left",14*I.getSubNodeLevel()+45+"px"):r.css("margin-left",14*I.getSubNodeLevel()+33+"px"),n.append(c)):C.isGallery()&&0<q.length&&(n.removeClass("sa-ctrl-list-item"),n.removeClass("image-lib-manage-list-item-across"));I.equals(X.getCurrent())&&I.getParent()?(n.addClass("sa-ctrl-list-item_selected_enabled"),
c&&c.addClass("img-lib-mange-lists-dir-preset_selected")):(n.on("mouseenter",function(d){X.getCurrent()}),n.on("mouseleave",function(d){X.getCurrent()}))};var J=function(n){if(n){if(n.getDirChildren()&&0<n.getDirChildren().length){var I=n.isExpanded();n.setExpanded(!I)}else n.setExpanded(!0);W(n);X.refreshList(X.getModels())}},W=function(n){if(n=n instanceof oa&&n.getDirChildren())for(var I=0;I<n.length;I++)n[I].getParent().isExpanded(),W(n[I])},y=function(n,I){n?(I.addClass("lower-triangle"),I.removeClass("select-tree-menu-icon"),
I.css({top:"7px",left:"4px"})):(I.addClass("right-triangle"),I.removeClass("lower-triangle"),I.css({top:"3px",left:"7px"}))};this.refreshList=function(n){var I=n[0].getUserObject().isGallery()?X.getJqUi().find(".img-lib-mange-lists-dir-gallery"):X.getJqUi().find(".img-lib-mange-lists-dir-imglist");I=I.find(".sa-ctrl-list-owner");I.empty();for(var r=$(document.createDocumentFragment()),C=X.listItemPainter,q=0;q<n.length;q++){var c=$("<div>"),a=n[q];c.addClass("sa-ctrl-list-item");c.addClass("sa-ctrl-list-item_enabled");
c.addClass("sa-ctrl-list-item-defaultlayout");a.equals(X.getCurrent())&&c.addClass("sa-ctrl-list-item_selected_enabled");c.data("model",a);C(c,a);r.append(c)}I.append(r)}}function sa(){ra.call(this);var R=this,X=R.protectedMethod,L,J,W=!0,y=!1;this.setSelectedImage=function(r){J=r};this.setSupportGif=function(r){W=r};this.setSelectedCardBlank=function(r){y=r};var n=R.setSearchKey;this.setSearchKey=function(r){n(r);I()};var I=function(){var r=X.getSearchKey()?m.get("noSearchData","\u6ca1\u6709\u7b26\u5408\u641c\u7d22\u6761\u4ef6\u7684\u7ed3\u679c"):
m.get("noImage","\u6682\u65e0\u56fe\u7247");L&&L.text(r)};this.getSelected=function(){var r=X.getCardList().find(".image-lib-image-card-selected"),C=r.data("oModel");if(0===r.length)return G.getMessageCurtain().showPrompt(m.get("noImageSelected","\u672a\u9009\u4e2d\u4efb\u4f55\u56fe\u7247\u3002")),null;r=C.getUserObject();return W||r.getType()!==ba.GIF?C:(G.getMessageCurtain().showPrompt(m.get("thumbnailNotSupportGif","\u7f29\u7565\u56fe\u4e0d\u652f\u6301 gif \u56fe\u7247\u683c\u5f0f\u3002")),null)};
this.createNoDataUi=function(){var r=$("<div>");r.css({position:"absolute",top:"26px",left:"0",right:"0",bottom:"0","z-index":"2",color:"rgb(102, 102, 102)"});L=$("<div>");I();Y.layoutCtrlCenterAlign(L,500);L.css({height:"20px","line-height":"20px","text-align":"center","font-size":"16px",color:"#BBBBBB",top:"50%","margin-top":"98.5px"});L.appendTo(r);var C=$("<div>");U().background(C,"no-data");Y.layoutCtrlCenterAlign(C,187);C.css({"background-size":"contain",top:"50%",height:"187px","margin-top":"-113.5px"});
C.appendTo(r);return r};this.selectedUIFeedback=function(r){r.addClass("image-lib-image-card-selected");y&&(r.addClass("image-lib-choose-card-blink"),setTimeout(function(){r.removeClass("image-lib-choose-card-blink")},2E3))};this.loadModels=function(r,C,q){var c=r.getUserObject();G.createFacade(function(a){for(var b=[],d=0;d<a.length;d++){var t=new ja,g=new M;g.fromJsonObject(a[d]);t.setUserObject(g);t.setParent(r);b.push(t)}r.setChildren(b);r.setVisited(!0);C&&(X.setModels(b),C&&R.updateUi(X.getCurrentType()));
q&&q();J&&c.getId()===J.getCategoryId()&&(R.selectTargetCard(J),J=null)},function(){return!1}).getAllImageOfCategory(c.getId(),c.isPreset())};this.addCard=function(r){var C=r.getUserObject(),q=X.getCardList();C=new ta(C,!0,r.getParent());C.setFunPreview(R.previewImage);C.init();C.setSearchKey(X.getSearchKey());var c=C.getJqUi();c.on("click",function(a){a.stopPropagation();q.find(".image-lib-image-card-selected").removeClass("image-lib-image-card-selected");c.addClass("image-lib-image-card-selected")});
c.data("oModel",r);c.appendTo(q)}}function wa(){var R,X,L,J,W=new fa,y,n,I,r=!1,C;this.setImageFileName=function(e){W.setImageFileName(e)};this.init=function(e){n=!!e;e&&(I=0==e.indexOf("./"));y=e?e:W.getImagePathFromUrl();R=$("<div class='sa-publish-thumbnailcut'>");R.on("mouseenter",c);R.on("mouseleave",a);R.css("cursor","pointer");J=$("<img class='image-lib-choose-dashboard-publish-thumbnail-img'>");q(y,function(k){k?(J.attr("src",y),J&&J.show(),R.find(".image-lib-choose-thumbnail-error").remove()):
(J&&J.hide(),W.getImageFullPathModel()?g(W.getImageFullPathModel().getImageFullPath()):g())});J.appendTo(R);return R};this.setFunCurrentFileNameGetter=function(e){};var q=function(e,k){if(e){var l=document.createElement("img");l.crossOrigin="anonymous";l.setAttribute("crossOrigin","Anonymous");l.onerror=function(){k(!1)};l.onload=function(){0<l.fileSize||0<l.width||0<l.height?k(!0):k(!1)};l.src=e}else k(!1)},c=function(e){a();e=$(e.currentTarget);L=$("<div>");L.addClass("image-lib-choose-hover-btns");
var k=b(m.get("choosePicture","\u9009\u62e9\u56fe\u7247"),t,"icon-round-edit");L.append(k);if(n&&!I){var l=b(m.get("deletePicture","\u5220\u9664\u56fe\u7247"),d,"icon-round-delete");L.append(l);k.css("left","0");l.css("left","80px")}else k.css("left","40px");L.appendTo(e);J.css("opacity","0.5");k=e.width();X=$("<div>");X.addClass("image-lib-choose-edit-detail");l=$("<div>");l.addClass("image-lib-choose-edit-detail-tip");l.text(m.get("uploadImageTips","\u5efa\u8bae\u9009\u62e9\u957f\u5bbd\u6bd42 : 1\u7684\u56fe\u7247"));
l.appendTo(X);X.css("width",k-8+"px");X.appendTo(e)},a=function(e){J.css("opacity","1");X&&X.remove();X=null;L&&L.remove();L=null},b=function(e,k,l){var u=$("<div>");u.on("click",k);u.attr("title",e);u.addClass("image-lib-choose-hover-btn");U().backgroundWithHover(u,l);return u},d=function(){var e=f.createFeedbackDialog();e.setOptionType(f.OPTION_OK_CANCEL);e.setMsgImageType(f.MSG_DELETE);e.setMessage(m.get("deleteThumbnailConfirm","\u5220\u9664\u7f29\u7565\u56fe\u540e\u5c06\u6062\u590d\u4f7f\u7528\u7cfb\u7edf\u9884\u7f6e\u7f29\u7565\u56fe\uff0c\u786e\u5b9a\u8981\u5220\u9664\u8be5\u7f29\u7565\u56fe\u5417\uff1f"));
e.setClosingChecker(function(k){k===f.RETURN_OK&&(J.attr("src",com.kingdee.bos.qing.CodeLoader.getIconUrl("lightapp/common","icon_dashboard_building.png")),J&&J.show(),R.find(".image-lib-choose-thumbnail-error").remove(),W.setImageFileName(),W.setQingFileType(),W.setImageType(),W.setImageFullPathModel(),r=!0,n=!1,C&&C());return!0});e.showDialog()},t=function(){var e=new da(W.getImageFileName(),!1);e.setFunClosedCallback(function(){});e.setFunSelected(function(k,l){var u=k.getType(),K=k.getFileName(),
E=k.getImageUrl();q(k.getImageUrl(),function(h){h?(J.attr("src",E),J&&J.show(),R.find(".image-lib-choose-thumbnail-error").remove(),C&&C()):(J&&J.hide(),g(l));W.setImageFileName(K);W.setQingFileType(M.FILE_TYPE);W.setImageType(u);W.setImageFullPathModel();n=r=!0;I=!1})});e.selectImage(function(){e.show()})};this.setDsbThumbnailDeleteCallBack=function(e){};this.setRemoveImgNotExistIconCallBack=function(e){C=e};this.getThumbnailUrlModel=function(){return W};this.isImageChange=function(){return r};this.getDashboardThumbnailUrl=
function(){return W?W.getJsonImagePath():null};var g=function(e){R.find(".image-lib-choose-thumbnail-error").remove();var k=$("<div>");k.addClass("image-lib-choose-thumbnail-error");var l=$("<div>");l.text(m.get("imageCanNotBeFind","\u627e\u4e0d\u5230\u5bf9\u5e94\u7684\u56fe\u7247"));var u=$("<div>");u.css("fontSize","12px");if(e){var K=e.split(la.SEPERATOR);e=K[0];K=(e===la.PERSISTENT_NAMESPACE_USER?m.get("private","\u4e2a\u4eba"):m.get("public","\u516c\u5171"))+la.SEPERATOR+K[1]+la.SEPERATOR+K[2];
e=e===la.PERSISTENT_NAMESPACE_SYSTEM;u.text(K);u.attr("title",K);e&&(e=$("<span>"),e.addClass("image-lib-choose-preset-icon"),e.text(m.get("preset","\u9884\u7f6e")),e.prependTo(u))}l.appendTo(k);u.appendTo(k);k.appendTo(R)}}function ua(){this.changeToBase64=function(R,X,L,J,W){var y,n=document.createElement("img");n.crossOrigin="anonymous";n.setAttribute("crossOrigin","Anonymous");n.src=R;var I=document.createElement("canvas"),r,C;n.onload=function(){r=n.width;C=n.height;J&&(r=J);W&&(C=W);var q=1;
window.devicePixelRatio&&0<window.devicePixelRatio&&(q=window.devicePixelRatio);var c=r*q;q*=C;ma.createContext2d(I,c,q).drawImage(n,0,0,n.width,n.height,0,0,c,q);X="png";y=I.toDataURL("image/"+X);L(y)}};this.compareBsae64Image=function(R,X,L){var J=-1<R.indexOf("data:image"),W=-1<X.indexOf("data:image");if(R===X)L(!0);else if(J&&W)L(!1);else{var y=0,n=function(){0>=y&&(R===X?L(!0):L(!1))};J||(y++,J=R.lastIndexOf("."),J=R.substring(J+1),this.changeToBase64(R,J,function(I){R=I;y--;n()}));W||(y++,J=
X.lastIndexOf("."),J=X.substring(J+1),this.changeToBase64(X,J,function(I){X=I;y--;n()}))}}}"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.imagelib&&(com.kingdee.bos.qing.imagelib={});"undefined"==typeof com.kingdee.bos.qing.imagelib.choose&&(com.kingdee.bos.qing.imagelib.choose={});"undefined"==typeof com.kingdee.bos.qing.imagelib.choose.ui&&
(com.kingdee.bos.qing.imagelib.choose.ui={});var xa=com.kingdee.bos.qing.imagelib.choose.ui;xa.ChooseImagePanel=da;xa.ChooseThumbnailPane=wa;xa.ChooseThumbnailDialog=function(R,X,L){ya.call(this);var J=this.protectedMethod,W=this,y=new wa,n=R,I=X,r=new ua;this.show=function(){W.setSize(440,340);J.setTitle(m.get("setThumbnail","\u8bbe\u7f6e\u7f29\u7565\u56fe"));J.setSelectable(!0);J.setContentPaneCreator(q);J.setClosingAction(function(c){if(c){var a=y.getThumbnailUrlModel(),b=y.isImageChange();if(b)if(a.getImageFileName()){I=
a.getJsonImagePath();c=a.getImageFileName();var d=a.getQingFileType();a=a.getImageType();n=com.kingdee.bos.qing.framework.common.RemoteFramework.getLoadImgUrl(c,d);n=n+"&contentType=image/"+a;r.changeToBase64(n,a,function(t){L(t,I,b)},800,400)}else L("","",b);else L(R,X,b)}});J.setClosingChecker(function(c){C()?(J.getMessageCurtain().showPrompt(m.get("reSetThumbnailBecauseOfDeleted","\u8be5\u56fe\u7247\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u7f29\u7565\u56fe\u3002")),c(!1)):c(!0)},
!0);W.showDialog()};var C=function(){var c=y.getDashboardThumbnailUrl(),a=new fa;a.getImagePathFromJson(c);c=a.getImageFileName();a=a.getImageFullPathModel();return!c&&a?!0:!1},q=function(){var c=function(){var g=CommonIconUtil.createWarning();g.addClass("dm-entity-list-item-notexist");g.attr("title",m.get("reSetThumbnailBecauseOfDeleted","\u8be5\u56fe\u7247\u5df2\u88ab\u5220\u9664\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u7f29\u7565\u56fe"));Y.layoutCtrl(g,25,45);g.appendTo(a)},a=$("<div>"),b=y.getThumbnailUrlModel();
b.getImagePathFromJson(I);n=b.getImagePathFromUrl(n);y.setDsbThumbnailDeleteCallBack(function(g,e,k){b.getImageFileName()===g&&c();var l=new fa;l.getImagePathFromJson(I);l.getImageFileName()===g&&(g=new la,g.setNameSpace("$user$"),g.setCategoryName(e),g.setName(k),l.setImageFullPathModel(g),l.setImageFileName(""),I=l.getJsonImagePath(),L(null,I,!1))});y.setRemoveImgNotExistIconCallBack(function(){a.find(".dm-entity-list-item-notexist").remove()});if(C()){var d=y.init(I);c()}else d=y.init(n);Y.layoutCtrl(d,
45,45,318,160);var t=$("<span>");t.addClass("set-dashboard-image-dialog");t.text(m.get("setThumbnailTipsForYourDsb","\u8bf7\u4e3a\u60a8\u7684\u4eea\u8868\u677f\u8bbe\u7f6e\u7f29\u7565\u56fe\uff08\u5982\u672a\u8bbe\u7f6e\uff0c\u5219\u4f7f\u7528\u7cfb\u7edf\u9884\u7f6e\u7f29\u7565\u56fe\uff09\uff1a"));d.appendTo(a);t.appendTo(a);return a}};xa.ImageBase64Tool=ua;var Y,va,ya,O,P,S,f,m,A,aa,ea,M,ba,T,ja,oa,la,fa,ha,pa,ra,ta,G,ma;(function(){var R=com.kingdee.bos.qing.common;Y=R.DomUtil;va=R.Util;ma=R.CanvasUtil;
R=com.kingdee.bos.qing.ui.component;ya=R.AbstractModalDialog;O=R.SearchBox;P=R.ComboBox;S=R.SplitPane;f=R.MessageDialog;R=com.kingdee.bos.qing.framework.common;m=R.MultilanguageManager.createPackageAccessor(xa);A=R.TabbedUiUtil;aa=R.MultilanguageManager;R=com.kingdee.bos.qing.imagelib.model;M=R.Image;oa=R.FolderNode;ba=R.ImageType;ja=R.LeafNode;la=R.PathModel;fa=R.ThumbnailUrlModel;T=R.ImageLibModelUtil;R=com.kingdee.bos.qing.imagelib.common.ui;ha=R.AbstractCategoryList;pa=R.AbstractCategoryContainer;
ra=R.AbstractCardContainer;ta=R.ImageCard;R=com.kingdee.bos.qing.imagelib.common;m=aa.createPackageAccessor(R);G=R.ImageLibUtil})()})();(function(){function U(){A||(A=com.kingdee.bos.qing.imagelib.MyIcons);return A}function da(fa){function ha(){KTDefaultCellRender.call(this,ta);var c=this;this.paintCellUI=function(a,b){var d=c.getCurrentRow().getUserObject(),t=d.getUserObject(),g=d.getId(),e=new P,k=e.getJqUi(),l=$("<div>"),u=$(a);a=$("<div>");var K=d.isGrey();a.addClass("image-lib-im-export-item");ua.layoutCtrlWithLRTB(k,7,null,20,null,null,20);k.css("line-height","23px");k.appendTo(a);e.setEnabled(!K);e.setChecked(d.isChecked());
e.setUserObject(d);e.addCheckedListener(q);t.isPreset&&t.isPreset()?(e=a.append,k=$("<span>"),k.addClass("image-lib-im-export-item-text-preset"),k.text(f.get("preset","\u9884\u7f6e")),e.call(a,k),l.css("margin-left","10px")):l.css("margin-left","30px");d=t instanceof ea?t.getFullName():d.getName();l.addClass("image-lib-im-export-item-text");if(X&&d){t=X.toUpperCase();e=d.toUpperCase();k=e.split(t);var E=t.length;for(Z in k){var h=e.indexOf(k[Z]),x=d.substr(V,k[Z].length);h+=k[Z].length;var D=e.length-
h;e=e.substr(h,D);d=d.substr(h,D);h=$("<span>");h.text(x);h.appendTo(l);if(Z!=k.length-1&&1<k.length){var V=e.indexOf(t);x=d.substr(V,E);h=V+E;D=e.length-h;e=e.substr(h,D);d=d.substr(h,D);h=$("<span>");h.text(x);h.css("color","red");h.clone().appendTo(l)}}}else l.text(d);K&&l.css("color","#b2b2b2");a.append(l);if("public_id"===g&&!la.hasPublicPermission()&&I){g=a.append;l=$("<div>");l.css("color","#f9c43a");ua.layoutCtrlWithLRTB(l,60,0,null,0,null,20);var Z=$("<div>");ua.layoutCtrlWithLRTB(Z,0,null,
16,4,0,16);U().background(Z,"icon-error-tips");Z.appendTo(l);Z=$("<div>");ua.layoutCtrlWithLRTB(Z,20,0,null,0,0,20);Z.text(f.get("importNoPermPrompt","\u6ca1\u6709\u516c\u5171\u76ee\u5f55\u7f16\u8f91\u6743\u9650\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u5206\u914d\u6743\u9650\u3002"));Z.appendTo(l);g.call(a,l)}b?(b=$(b),b.css("overflow","visible"),a.appendTo(b)):a.appendTo(u);ua.layoutCtrlWithLRTB(a,0,0,null,0,0,null)}}var pa=this,ra,ta,G,ma,R,X,L=[],J=[],W=!1,y=!1,n=!1,I=!1;(function(){var c=function(a){L.push(a);
if(a instanceof M)J.push(a);else{var b=a.getChildren();for(a=0;a<b.length;a++)c(b[a])}};c(fa)})();this.getSelectedLeafs=function(c){for(var a=[],b=0;b<J.length;b++){var d=J[b];d.isChecked()&&(d=c?c(d):d,a.push(d))}return a};this.setRootDisplay=function(c){W=c};this.setShowOnlyChecked=function(c){n=c};this.setOperatePublic=function(c){I=c};this.getJqUi=function(){return ra};this.init=function(){ra=$("<div>");ra.addClass("image-lib-tree-selection-container");var c=ra;R=$("<div>");ua.layoutCtrlWithLRTB(R,
0,null,200,0,null,23);R.prependTo(c);ta=new KTable;c=new ha;ta.setCellRender(c);ta.setSyncUIWhenModelChanged(!1);ta.addTreeExpandListener(r);ta.addColumn().setWidth(500);c=$(ta.getUI());ua.layoutCtrlWithLRTB(c,0,0,null,23,0,null);ra.append(c);pa.updateUi();C()};var r=function(c,a){(c=ta.getRow(a.getRowIdx()).getUserObject())&&c.setExpanded(a.isExpanded())},C=function(){for(var c=0,a=0;a<J.length;a++){var b=J[a];b instanceof M&&b.isChecked()&&c++}c=f.get("hitsNumberPrompt","(\u5df2\u9009\u62e9 #1 \u9879)").replace("#1",
c);R.text(c)};this.searchKey=function(c){X=c;y=!!X;for(c=0;c<J.length;c++){var a=J[c];var b=a.isChecked();if(X){var d=-1<a.getName().toUpperCase().indexOf(X.toUpperCase());b=n?d&&b:d}else b=n?a.isChecked():!0;a.setVisible(b,!0,!0)}pa.updateUi()};this.updateUi=function(){Y.clear(ta);ta.addColumn().setWidth(500);for(var c=!1,a=0;a<J.length;a++)c=c||J[a].isVisible();if(c)for(G&&G.hide(),c=0;c<L.length;c++){a=L[c];var b=a.getId();if(a.isVisible()&&(W||"root_id"!==b)){b=Y.createRow(ta,!1);b.setHeight(23);
b.setUserObject(a);var d=b.getCell(0),t=a.getSubNodeLevel();t=W?t:t-1;t=new KTCellTreeModel(t);if(a.getChildren){var g=y?!0:a.isExpanded();t.setExpanded(g)}a.getParent()&&(a=y?!1:a.isHide(),b.setHide(a));d.setTreeModel(t)}}else G||(G=$("<div>"),G.addClass("image-lib-im-export-no-data"),ma=$("<div>"),ma.text(f.get("noQualifiedResults","\u6ca1\u6709\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c")),ua.layoutCtrlCenterAlign(ma,500),ma.addClass("image-lib-im-export-no-data-prompt"),ma.css({height:"20px","line-height":"20px",
"margin-top":"98.5px"}),ma.appendTo(G),c=$("<div>"),U().background(c,"no-data"),ua.layoutCtrlCenterAlign(c,187),c.addClass("image-lib-im-export-no-data-icon"),c.css({height:"187px","margin-top":"-113.5px"}),c.appendTo(G),ra.append(G)),G.show();Y.refresh(ta)};var q=function(c,a){a&&(c.getUserObject().setChecked(c.isChecked(),!0,!0),pa.updateUi(),C())}}function ia(fa){va.call(this);var ha=this,pa=this.protectedMethod,ra,ta,G,ma=!1;this.show=function(){xa.setCallback(function(){ha.setSize(640,480);ha.setPosition(window.innerWidth-
640>>1,window.innerHeight-480>>1);pa.setContentPaneCreator(R);pa.setClosingChecker(ha.isValidToAccepted,!0);pa.setClosingAction(J);ha.showDialog()});xa.loadJs("common/qing-table.js")};var R=function(){var W=$("<div>");W.css("color","#666");var y=$("<div>");ua.layoutCtrlWithLRTB(y,0,0,null,0,0,null);y.appendTo(W);ra=new ya;ra.addSearchListener(X);ra.setSearchListenerDelay(400);ra.setPlaceholder(f.get("searchImageName","\u641c\u7d22\u56fe\u7247\u540d\u79f0"));ra.setShowSearchIcon(!0);var n=ra.getJqUi();
n.addClass("image-lib-im-export-search-box");n.appendTo(y);n=new P;n.setChecked(!1);n.addCheckedListener(L);n.setText(f.get("showOnlyChecked","\u4ec5\u663e\u793a\u9009\u4e2d\u9879"));n=n.getJqUi();ua.layoutCtrl(n,250,2,200,23);n.appendTo(y);G=new da(fa);G.setOperatePublic(ma);G.setRootDisplay(!1);G.init();n=G.getJqUi();y.append(n);return W},X=function(){ta=ra.getText().trim();G.searchKey(ta)},L=function(W,y){y&&(G.setShowOnlyChecked(W.isChecked()),G.searchKey(ta))};this.isValidToAccepted=function(W){throw Error("Override me!");
};var J=function(W){W&&ha.confirm()};this.confirm=function(){throw Error("Override me!");};this.protectedMethod={setTitle:pa.setTitle,getSelectedLeafs:function(W){return G.getSelectedLeafs(W)},getMessageCurtain:pa.getMessageCurtain,setOperatePublic:function(W){ma=W}}}function qa(fa){ia.call(this,fa);var ha=this.protectedMethod,pa,ra;ha.setTitle(f.get("importImage","\u5bfc\u5165\u56fe\u7247"));ha.setOperatePublic(!0);this.setFunImportSuccess=function(G){pa=G};this.setCacheFileName=function(G){ra=G};
this.initHeader=function(G){if(!la.hasPublicPermission()){var ma=$("<div>");ma.css("color","#f9c43a");ua.layoutCtrlWithLRTB(ma,0,0,null,0,null,20);var R=$("<div>");ua.layoutCtrlWithLRTB(R,0,null,20,0,0,20);R.appendTo(ma);R=$("<div>");ua.layoutCtrlWithLRTB(R,30,0,null,0,0,20);R.text(f.get("importNoPermPrompt","\u8bf7\u4e3a\u60a8\u7684\u8d26\u6237\u5206\u914d\u8f7b\u5206\u6790\u7ba1\u7406\u5458\u89d2\u8272\uff0c\u4ee5\u4fbf\u5bfc\u5165\u516c\u5171\u7684\u76ee\u5f55\u53ca\u56fe\u7247\u3002"));R.appendTo(ma);
ma.appendTo(G);return ma}return null};this.isValidToAccepted=function(G){var ma=ha.getSelectedLeafs();if(0===ma.length)ha.getMessageCurtain().showPrompt(f.get("notSelectImages","\u672a\u9009\u4e2d\u56fe\u7247\u3002")),G(!1);else{for(var R=!1,X=0;X<ma.length;X++){var L=ma[X].getParent().getUserObject();L=L.isPublic()||L.isPreset();R=R||L}R?la.checkPublicPermission(function(J){J?G(!0):(ha.getMessageCurtain().showPrompt(f.get("importNoPermPrompt","\u6ca1\u6709\u516c\u5171\u76ee\u5f55\u7f16\u8f91\u6743\u9650\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u5206\u914d\u6743\u9650\u3002")),
G(!1))}):G(!0)}};this.confirm=function(){for(var G,ma=ha.getSelectedLeafs(),R=[],X=0;X<ma.length;X++){var L=ma[X],J=L.getUserObject(),W=L.getParent().getUserObject();J=J.toJsonObject();J.categoryName=ta(L.getParent());L=W.getNameSpace();J.nameSpace=L;R.push(J);0===X&&(G=L+oa.SEPERATOR+W.getName())}la.createFacade(function(y){var n=y.cacheFileName,I=new ja;I.fromJsonObject(y.importResult);I.isAllSuccess()?pa(G):(y=new sa,y.setImportSuccess(pa),y.setCacheFileName(n),y.setImportResult(I),y.show())},
function(y,n){return 1100021===y?(la.getMessageCurtain().showPrompt(n,5E3),!0):!1}).importSelectedImages(R,ra)};var ta=function(G){for(var ma=G.getUserObject().getName();!G.getParent().isVisited();)G=G.getParent(),ma=G.getUserObject().getName()+"/"+ma;return ma}}function sa(){function fa(r){KTDefaultCellRender.call(this,r);var C=this,q=this.paintCellUI;this.paintCellUI=function(a,b){var d=C.getCurrentRowIdx(),t=C.getCurrentRow(),g=C.getCurrentColIdx(),e=t.getUserObject();d<Y.getHeadRowCount()?q(a,
b):0===g?(b=$("<div>"),d=e.isPublic()?f.get("public","\u516c\u5171"):f.get("private","\u4e2a\u4eba"),d=d+"-"+(e.isGallery()?f.get("downloadGallery","\u6765\u81ea\u4e91\u7d20\u6750"):f.get("userUploadFile","\u4e0a\u4f20\u7684\u56fe\u7247")),c(b,d),b.appendTo(a)):1===g?(b=$("<div>"),c(b,e.getCategoryName()),b.appendTo(a)):2===g?(b=$("<div>"),c(b,e.getImageName()),b.appendTo(a)):3===g&&(b=d-Y.getHeadRowCount(),a=Y.createCtrlInCell(a,C.getCellWidth(),C.getCellHeight(),O),a.setItemModels(e.isGallery()?
[T.CONFLICT_STRATEGY_IGNORE,T.CONFLICT_STRATEGY_OVERWRITE]:[T.CONFLICT_STRATEGY_IGNORE,T.CONFLICT_STRATEGY_OVERWRITE,T.CONFLICT_STRATEGY_RENAME]),a.setSelected(e.getConflictStrategy()),a.setUserObject(e),a.setCustomPainter(function(k,l,u){switch(u){case T.CONFLICT_STRATEGY_IGNORE:var K=f.get("ignore","\u5ffd\u7565");break;case T.CONFLICT_STRATEGY_OVERWRITE:K=f.get("overwrite","\u8986\u76d6");break;case T.CONFLICT_STRATEGY_RENAME:e.isGallery()||(K=f.get("rename","\u91cd\u547d\u540d"));break;default:K=
""}k=$("<div>");k.text(K);k.appendTo(l)}),a.addSelectedChangedListener(function(k,l,u){k.getUserObject().setConflictStrategy(u)}),R[b]=a)};var c=function(a,b){a.text(b);a.attr("title",b);a.addClass("image-lib-import-conflict-handing-cell")}}function ha(){this.isRowDraggable=function(r,C){return!0};this.isColumnDraggable=function(r,C){return!0};this.getMinRowHeightLimited=function(r,C){return 3};this.getMinColumnWidthLimited=function(r,C){return 4};this.rowDraggedAction=function(r,C,q){var c=r.isSyncUIWhenModelChanged();
r.setSyncUIWhenModelChanged(!0);C=r.getRow(C);C.setHeight(C.getHeight()+q);r.setSyncUIWhenModelChanged(c)};this.columnDraggedAction=function(r,C,q){var c=r.isSyncUIWhenModelChanged();r.setSyncUIWhenModelChanged(!0);C=r.getColumn(C);C.setWidth(C.getWidth()+q);r.setSyncUIWhenModelChanged(c)};this.getTailBlankForDragging=function(){return 0}}va.call(this);var pa=this,ra=this.protectedMethod,ta,G,ma,R=[],X,L,J;pa.setSize(640,480);ra.setTitle(f.get("importImage","\u5bfc\u5165\u56fe\u7247"));this.show=
function(){ra.setContentPaneCreator(pa.getJqUi);ra.setClosingChecker(pa.isValidToAccepted,!0);ra.setClosingAction(W);pa.showDialog();pa.updateUi()};this.getJqUi=function(){if(!ta){ta=$("<div>");ta.css("color","#666");ma=new S;n(ta);var r=ta;G=new KTable;G.setFrozenRows(3);G.setColumnFitVisibleWidth(!0);G.setSyncUIWhenModelChanged(!1);G.setDraggableAdjusting(!0,2,0,new ha);Y.bindTableListenerForCtrl(G);var C=new fa(G);C.setOutsideVisible(!1);G.setCellRender(C);C=$(G.getUI());ua.layoutCtrlWithLRTB(C,
0,0,null,64,0,null);C.appendTo(r)}return ta};this.setImportSuccess=function(r){X=r};this.setCacheFileName=function(r){L=r};this.setImportResult=function(r){J=r};this.isValidToAccepted=function(r){r(!0)};var W=function(r){if(r){r=[];for(var C,q=J.getConflictImages(),c=0;c<q.length;c++){var a=q[c];r.push(a.toJsonObject());0===c&&(C=a.getNameSpace()+oa.SEPERATOR+a.getCategoryName())}la.createFacade(function(b){b&&X(C)},function(b,d){return 1100021===b?(la.getMessageCurtain().showPrompt(d,5E3),!0):!1}).conflictHanding(r,
L)}},y=function(r,C,q){var c=$("<div>");c.text(r);c.addClass("image-import-conflict-all-operate");c.on("click",q);C&&(r=$("<div>"),r.addClass("image-import-conflict-btn-split-line"),r.appendTo(c));return c},n=function(r){var C=function(q,c,a){a=y(a,c!==T.CONFLICT_STRATEGY_RENAME,function(){for(var b=!1,d=J.getConflictImages(),t=0,g=d.length;t<g;t++)d[t].isGallery()&&c==T.CONFLICT_STRATEGY_RENAME?b=!0:d[t].setConflictStrategy(c);b&&ra.getMessageCurtain().showPrompt(f.get("downloadGalleryNotAllowedRename",
"\u6765\u81ea\u4e91\u7d20\u6750\u7684\u56fe\u7247\u4e0d\u5141\u8bb8\u91cd\u547d\u540d\u3002"),2E3);b=J.getConflictImages();for(d=0;d<R.length;d++)b[d].isGallery()&&c==T.CONFLICT_STRATEGY_RENAME||R[d].setSelected(c)});ua.layoutCtrl(a,80*c,30,50,23);a.appendTo(q)};C(r,T.CONFLICT_STRATEGY_IGNORE,f.get("allIgnore","\u5168\u90e8\u5ffd\u7565"));C(r,T.CONFLICT_STRATEGY_OVERWRITE,f.get("allOverwrite","\u5168\u90e8\u8986\u76d6"));I()&&C(r,T.CONFLICT_STRATEGY_RENAME,f.get("allRename","\u5168\u90e8\u91cd\u547d\u540d"))},
I=function(){for(var r=J.getConflictImages(),C=0,q=r.length;C<q;C++)if(!r[C].isGallery())return!0;return!1};this.updateUi=function(){if(J){var r=ma.getJqUi();ua.layoutCtrl(r,0,0,400,20);r.appendTo(ta);r=f.get("conflictHandingPrompt","\u6210\u529f\u5bfc\u5165#1\u5f20\u56fe\u7247\u3002\u4ee5\u4e0b\u56fe\u7247\u8def\u5f84\u51b2\u7a81\uff0c\u8bf7\u5904\u7406\u3002").replace("#1",J.getSuccessCount());ma.setText(r);Y.clear(G);G.addColumns(4);G.getColumn(0).setWidth(80);G.getColumn(1).setWidth(130);G.getColumn(2).setWidth(130);
G.getColumn(3).setWidth(50);r=Y.createHeadRow(G);r.getCell(0).setValue(f.get("categoryType","\u76ee\u5f55\u7c7b\u578b"));r.getCell(1).setValue(f.get("categoryName","\u76ee\u5f55\u540d\u79f0"));r.getCell(2).setValue(f.get("imageName","\u56fe\u7247\u540d\u79f0"));r.getCell(3).setValue(f.get("handleStrategy","\u5904\u7406\u7b56\u7565"));r=J.getConflictImages();for(var C=0;C<r.length;C++){var q=r[C];Y.createRow(G).setUserObject(q)}Y.refresh(G)}}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&
(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.imagelib&&(com.kingdee.bos.qing.imagelib={});"undefined"==typeof com.kingdee.bos.qing.imagelib.imexport&&(com.kingdee.bos.qing.imagelib.imexport={});"undefined"==typeof com.kingdee.bos.qing.imagelib.imexport.ui&&(com.kingdee.bos.qing.imagelib.imexport.ui={});var wa=com.kingdee.bos.qing.imagelib.imexport.ui;wa.UploadPane=
function(){var fa,ha,pa,ra;this.createJqUi=function(J,W){fa=W;W=$("<div>");W.addClass("image-lib-import-upload-main");var y=$(document.body),n=$("<div class='image-lib-import-upload-modallayer'>");n.appendTo(y);ha=$("<progress value='0' max='100'>");ha.addClass("image-lib-import-upload-progress");var I=$("<div>");I.addClass("image-lib-import-uploading-prompt");I.text(f.get("uploading","\u6b63\u5728\u4e0a\u4f20\u4e2d\uff0c\u8bf7\u7a0d\u5019"));W.append(ha);W.append(I);y.append(W);ta(J,W,n)};this.setUploadSuccessCallback=
function(J){pa=J};this.setUploadFailedCallback=function(J){ra=J};var ta=function(J,W,y){var n=new FormData;n.append("filename",J);J=new XMLHttpRequest;J.upload.addEventListener("progress",G,!1);J.addEventListener("error",ma,!1);var I=com.kingdee.bos.qing.framework.common.RemoteFrameworkRegister.getUploadUrl();J.open("post",I,!0);J.onload=function(r){200===this.status&&(r=JSON.parse(this.response),"number"==typeof r.errorCode&&3099003===r.errorCode?fa.showError(r.errorMessage):R(r.data),W.remove(),
y.remove())};J.send(n)},G=function(J){var W=ha.get(0);J.lengthComputable&&(W.max=J.total,W.value=J.loaded)},ma=function(J){ra&&ra(f.get("uploadFail","\u4e0a\u4f20\u5931\u8d25"))},R=function(J){la.createFacade(function(W){var y=W.pictures;if(0===y.length)fa.showPrompt(f.get("noImportableImages","\u672a\u627e\u5230\u53ef\u5bfc\u5165\u7684\u56fe\u7247\u3002"));else{var n=L("root_id",f.get("catalogue","\u76ee\u5f55")),I=L("private_id",f.get("private","\u4e2a\u4eba"),n),r=L("public_id",f.get("public",
"\u516c\u5171"),n),C=L("private_user_id",f.get("userUploadFile","\u4e0a\u4f20\u7684\u56fe\u7247"),I),q=L("public_user_id",f.get("userUploadFile","\u4e0a\u4f20\u7684\u56fe\u7247"),r),c=L("private_gallery_id",f.get("downloadGallery","\u6765\u81ea\u4e91\u7d20\u6750"),I),a=L("public_gallery_id",f.get("downloadGallery","\u6765\u81ea\u4e91\u7d20\u6750"),r);X(r,!0);X(q,!0);X(a,!0);var b={},d={},t;for(t=0;t<y.length;t++){var g=[],e=!1,k=y[t],l=k.nameSpace,u=k.categoryName.split("/"),K=u.length,E=l===oa.PERSISTENT_NAMESPACE_SYSTEM,
h=l===oa.PERSISTENT_NAMESPACE_COMMON||E||l===oa.PERSISTENT_NAMESPACE_GALLERY_COMMON,x=l===oa.PERSISTENT_NAMESPACE_GALLERY_USER||l===oa.PERSISTENT_NAMESPACE_GALLERY_COMMON,D=l+u[K-1]+(K-1)+x;var V=h?d[D]:b[D];if(!V){for(V=0;V<K;V++){D=l+u[V]+V+x;if(!b[D]&&!d[D]){g[V]=new ba;var Z=new aa;Z.setId("group_id_"+V);Z.setName(u[V]);Z.setPreset(E);Z.setPublic(h);Z.setGallery(x);g[V].setUserObject(Z);X(g[V],h);0<V&&(g[V].setParent(g[V-1]),g[V-1].add(g[V]))}h?d[D]?(e=!0,g[V]=d[D]):d[D]=g[V]:b[D]?(e=!0,g[V]=
b[D]):b[D]=g[V]}V=g[K-1];e||(h?x?(g[0].setParent(a),a.add(g[0])):(g[0].setParent(q),q.add(g[0])):x?(g[0].setParent(c),c.add(g[0])):(g[0].setParent(C),C.add(g[0])))}g=new M;e=new ea;e.setId(k.id?k.id:t);e.setNameAndType(k.imageName);e.setFileName(k.id);g.setUserObject(e);g.setParent(V);V.addTo(g,0);X(g,h)}0<C.getChildren().length&&I.add(C);0<q.getChildren().length&&r.add(q);0<a.getChildren().length&&r.add(a);0<c.getChildren().length&&I.add(c);0<r.getChildren().length&&n.add(r);0<I.getChildren().length&&
n.add(I);y=new qa(n);y.setFunImportSuccess(pa);y.setCacheFileName(W.cacheFileName);y.show()}},function(){return!1}).parseFileToImages(J)},X=function(J,W){W&&(la.hasPublicPermission()?J.setGrey(!1):J.setGrey(!0))},L=function(J,W,y){var n=new ba;n.setVisited(!0);"public_id"!==J||la.hasPublicPermission()||n.setExpanded(!1);var I=new aa;J&&I.setId(J);W&&I.setName(W);y&&n.setParent(y);n.setUserObject(I);return n}};wa.ExportDialog=function(fa){ia.call(this,fa);var ha=this.protectedMethod;ha.setTitle(f.get("exportImage",
"\u5bfc\u51fa\u56fe\u7247"));this.isValidToAccepted=function(pa){0===ha.getSelectedLeafs().length?(ha.getMessageCurtain().showPrompt(f.get("notSelectImages","\u672a\u9009\u4e2d\u56fe\u7247\u3002")),pa(!1)):pa(!0)};this.confirm=function(){var pa=ha.getSelectedLeafs(function(ra){return ra.getUserObject().toJsonObject()});la.createFacade(function(ra){la.downloadExportFile(ra)},function(){return!1}).exportImages(pa)}};var ua,xa,Y,va,ya,O,P,S,f,m,A,aa,ea,M,ba,T,ja,oa,la;(function(){var fa=com.kingdee.bos.qing.common;
ua=fa.DomUtil;fa=com.kingdee.bos.qing;xa=fa.CodeLoader;fa=com.kingdee.bos.qing.common.ui;Y=fa.TableUtil;fa=com.kingdee.bos.qing.ui.component;va=fa.AbstractModalDialog;ya=fa.SearchBox;O=fa.ComboBox;P=fa.CheckBox;S=fa.Label;fa=com.kingdee.bos.qing.framework.common;m=fa.MultilanguageManager;fa=com.kingdee.bos.qing.imagelib.model;ea=fa.Image;aa=fa.ImageCategory;M=fa.LeafNode;ba=fa.FolderNode;T=fa.ImportImage;ja=fa.ImportResult;oa=fa.PathModel;fa=com.kingdee.bos.qing.imagelib.common;la=fa.ImageLibUtil;
f=m.createPackageAccessor(fa)})()})();(function(){function U(){M||(M=com.kingdee.bos.qing.imagelib.MyIcons);return M}function da(){ra.call(this);var y=this,n=y.protectedMethod,I,r={},C,q;this.init=function(){var k=new ia;k.init();var l=new wa;y.setCategoryAndCardContainer(k,l);n.init();n.getUploadBtn().attr("accept",[".qing-pic"]);q&&y.jumpToImageByImageModel(q);C=!0};this.setSelectedImage=function(k){q=k;C&&y.jumpToImageByImageModel(q)};this.getFunGetSearchValue=function(k){return k.getName().toUpperCase()};var c=y.getAllModels;this.getAllModels=
function(k){c(k);L.createFacade(function(l){var u,K=[];for(u=0;u<l.length;u++){var E=l[u],h=new pa,x=new oa;x.fromJsonObject(E);h.setUserObject(x);K.push(h)}n.getCategoryContainer().bindImagesIntoCategories(K);k&&k()},function(l,u){return!1}).getAllImage()};var a=function(k){I=new W(k);I.show()},b=function(k){r={};L.createFacade(function(l){var u,K=l.images,E=l.categories;l=d(f.get("public","\u516c\u5171"),"public_id",!0,!0);var h=d(f.get("private","\u4e2a\u4eba"),"private_id",!1,!0),x=d(f.get("userUploadFile",
"\u4e0a\u4f20\u7684\u56fe\u7247"),"",!1,!1),D=d(f.get("userUploadFile","\u4e0a\u4f20\u7684\u56fe\u7247"),"",!0,!1),V=d(f.get("downloadGallery","\u6765\u81ea\u4e91\u7d20\u6750"),"",!1,!1),Z=d(f.get("downloadGallery","\u6765\u81ea\u4e91\u7d20\u6750"),"",!0,!1);for(u=0;u<E.length;u++){var B=new ha,z=new ja;z.fromJsonObject(E[u]);B.setExpanded(!1);B.setUserObject(z);B.fromJsonObjectForExport(E[u]);z.isPreset()?(D.addTo(B,0),B.setParent(D),B.setGrey(!0)):z.isPublic()?z.isGallery()?(Z.add(B),B.setParent(Z)):
(D.add(B),B.setParent(D)):z.isGallery()?(V.add(B),B.setParent(V)):(x.add(B),B.setParent(x))}D.setParent(l);x.setParent(h);l.setChildren([D]);h.setChildren([x]);0<Z.getChildren().length&&(Z.setParent(l),l.add(Z));0<V.getChildren().length&&(V.setParent(h),h.add(V));t(l);t(h);for(u=0;u<K.length;u++)if(x=K[u],E=new pa,D=new oa,D.fromJsonObject(x),E.setUserObject(D),x=r[D.getCategoryId()])x.add(E),E.setParent(x),x.getUserObject().isPreset()&&E.setGrey(!0);K=new ha;u=new ja;u.setId("root_id");u.setName(f.get("catalogue",
"\u76ee\u5f55"));K.setUserObject(u);K.setChildren([l,h]);l.setParent(K);h.setParent(K);g(K);k&&k(K)},function(){return!1}).getAllCategoryAndImage()},d=function(k,l,u,K){var E=new ha,h=new ja;h.setId(l);h.setName(k);h.setPublic(u);E.setUserObject(h);E.setExpanded(K);return E},t=function(k){r[k.getId()]=k;var l=k.getChildren();for(k=0;k<l.length;k++)t(l[k])},g=function(k){var l,u=!1,K=k.getChildren();if(null==K||0===K.length)return!1;for(l=0;l<K.length;l++)if(K[l].getUserObject()instanceof oa){u=!0;
break}var E=[];for(l=0;l<K.length;l++){var h=K[l];h instanceof ha&&(g(h)?u=!0:E.push(h))}for(l=0;l<E.length;l++)k.deleteByEquals(E[l]);return u};this.importImage=function(){var k=n.getUploadBtn(),l=k.get(0).files[0];if(l){var u=l.name,K=l.size,E=u.lastIndexOf(".");u=u.substring(E+1,u.length).toLowerCase();k.val("");"qing-pic"!==u?L.getMessageCurtain().showPrompt(f.get("fileTypeIncorrect","\u6587\u4ef6\u7c7b\u578b\u4e0d\u6b63\u786e\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002"),2E3):0===K?L.getMessageCurtain().showPrompt(f.get("uploadFileIsNull",
"\u4e0a\u4f20\u7684\u6587\u4ef6\u4e3a\u7a7a\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002"),2E3):104857600<=K?L.getMessageCurtain().showPrompt(f.get("fileTooLarge","\u6587\u4ef6\u592a\u5927\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u3002"),2E3):(k=new J,k.createJqUi(l,L.getMessageCurtain()),k.setUploadSuccessCallback(function(h){y.refresh(null,function(){n.getCategoryContainer().setSelectedByFullPath(h)})}))}};this.exportImage=function(){b(a)};this.galleryCloud=function(){var k=com.kingdee.bos.qing.common.Util.decodeParamFromUrl(location.search,
"path");k=k?k:"/ierp";var l=f.get("gallery","\u4e91\u7d20\u6750");m.openNewTab(l,k+"/qing/galleryEntrance.do?isEntrance=true")};var e=y.refresh;this.refresh=function(k,l){e();L.checkPublicPermission(function(u){L.setHasPublicPermission(u);var K=n.getCategoryContainer();K.setPublicPermission(u);K&&K.updateListUi(!0);l&&K.setRefreshCallBack(l)})}}function ia(){ma.call(this);var y=this,n=y.protectedMethod,I,r=L.hasPublicPermission();this.setLoadImages=function(q){I=q};this.bindImagesIntoCategories=function(q){var c=
n.getPrivateCategoryList(),a=n.getPublicCategoryList();c&&c.bindChildrenIntoCategories(q);a&&a.bindChildrenIntoCategories(q)};this.provideCategories=function(){var q=[],c=[];n.operateCategoryList(function(d){q=d.getModels();d.getCurrent()});for(var a=0;a<q.length;a++){var b=q[a];b.getUserObject().isGallery()||b.getUserObject().isPreset()||c.push(b)}return c};this.getAllChildren=function(){var q=n.getPrivateCategoryList();q=q?q.getAllModels():[];var c=n.getPublicCategoryList();c=c?c.getAllModels():
[];return C(q).concat(C(c))};var C=function(q){for(var c=[],a=0;a<q.length;a++)for(var b=q[a].getChildren(),d=0;d<b.length;d++){var t=b[d];t.getUserObject()instanceof oa&&c.push(t)}return c};this.afterCreateList=function(q,c){q.setFunLoadImages&&q.setFunLoadImages(I);c.setFunLoadImages&&c.setFunLoadImages(I)};this.setPublicPermission=function(q){y.setCategoryListClass(q);r=q;y.switchTabCallback()};this.setCategoryListClass=function(q){q?n.setCategoryListClass(sa):n.setCategoryListClass(sa,qa)};this.init=
function(){y.setCategoryListClass(r);n.init();n.getJqCategoryList().css("top","45px")}}function qa(y){G.call(this,y);var n=this,I=n.abstractProtectMethod,r;this.setFunItemClick=function(a){r=a};this.getHeight=function(){var a=n.getModels();return a?a.length*qa.ITEM_HEIGHT:0};this.getNoDataPrompt=function(){return f.get("noCategory","\u6ca1\u6709\u76ee\u5f55")};this.listItemPainter=function(a,b){a.addClass("img-lib-mange-lists-dir");a.data("oNode",b);var d=$("<div>"),t=b.getUserObject(),g=t.getName();
d.text(g);d.addClass("img-lib-mange-lists-dir-text");d.css("margin-left",14*b.getSubNodeLevel()+"px");a.attr("title",g);a.addClass("image-lib-manage-list-item-across");var e=$("<div>");e.addClass("select-tree-menu-icon-click");e.css("margin-left",14*b.getSubNodeLevel()+"px");e.data("oItemModel",b);var k=$("<div>");k.addClass("select-tree-menu-icon");k.css("cursor","pointer");e.append(k);b.isHide()?a.hide():b.getParent()?(a.show(),e.on("mousedown",function(u){u.stopPropagation();u=$(u.currentTarget).data("oItemModel");
C(u)})):a.show();var l=b.isExpanded();(g=b.getDirChildren())&&0<g.length&&b.getParent()&&(c(l,k),a.append(e));a.append(d);e=$("<div>");t.isPreset()?(e=$("<div>"),e.text(f.get("preset","\u9884\u7f6e")),e.addClass("img-lib-mange-lists-dir-preset"),e.css("margin-left",14*b.getSubNodeLevel()+24+"px"),"preset"==e.text()?d.css("margin-left",14*b.getSubNodeLevel()+45+"px"):d.css("margin-left",14*b.getSubNodeLevel()+33+"px"),a.append(e)):t.isGallery()&&0<g.length?(a.removeClass("sa-ctrl-list-item"),a.removeClass("image-lib-manage-list-item-across")):
t.isGallery()||d.css("margin-right","74px");I.funItemModelEqualsChecker(b,n.getCurrent())&&b.getParent()?(a.addClass("sa-ctrl-list-item_selected_enabled"),e&&e.addClass("img-lib-mange-lists-dir-preset_selected")):(a.on("mouseenter",function(u){n.getCurrent()}),a.on("mouseleave",function(u){n.getCurrent()}))};var C=function(a){if(a){if(a.getDirChildren()&&0<a.getDirChildren().length){var b=a.isExpanded();a.setExpanded(!b)}else a.setExpanded(!0);q(a);n.refreshList(n.getModels())}},q=function(a){if(a=
a instanceof ha&&a.getDirChildren())for(var b=0;b<a.length;b++)a[b].getParent().isExpanded(),q(a[b])},c=function(a,b){a?(b.addClass("lower-triangle"),b.removeClass("select-tree-menu-icon"),b.css({top:"7px",left:"4px"})):(b.addClass("right-triangle"),b.removeClass("lower-triangle"),b.css({top:"3px",left:"7px"}))};this.refreshList=function(a){var b=a[0].getUserObject().isGallery()?n.getJqUi().find(".img-lib-mange-lists-dir-gallery"):n.getJqUi().find(".img-lib-mange-lists-dir-imglist");b=b.find(".sa-ctrl-list-owner");
b.empty();for(var d=$(document.createDocumentFragment()),t=n.listItemPainter,g=0;g<a.length;g++){var e=$("<div>"),k=a[g];e.addClass("sa-ctrl-list-item");e.addClass("sa-ctrl-list-item_enabled");e.addClass("sa-ctrl-list-item-defaultlayout");k.equals(n.getCurrent())&&e.addClass("sa-ctrl-list-item_selected_enabled");e.data("model",k);t(e,k);d.append(e)}b.append(d)};this.itemClick=function(a){var b,d=n.getJqUi().find(".img-lib-mange-lists-dir"),t=a.getUserObject().isPreset(),g=n.getList().getJqUi().find(".img-lib-mange-lists-dir-preset_selected");
g&&g.removeClass("img-lib-mange-lists-dir-preset_selected");d.each(function(e){e=$(d[e]);var k=e.data("oNode");if(k&&k.equals(a)&&a.getParent()){for(k=k.getParent();k&&!k.isExpanded();)C(k),k=k.getParent();b=e}});t&&(t=b.find(".img-lib-mange-lists-dir-preset"))&&t.addClass("img-lib-mange-lists-dir-preset_selected");b&&b.addClass("sa-ctrl-list-item_selected_enabled");n.updateCurrent(a);r&&r(a)};this.protectedMethod={listItemPainter:n.listItemPainter}}function sa(y){qa.call(this,y);var n=this,I=n.abstractProtectMethod,
r=n.protectedMethod,C;this.bindChildrenIntoCategories=function(B){if(B&&0!==B.length){var z=n.getAllModels(),w;for(w=0;w<z.length;w++){var p=[],v=z[w],F=v.getUserObject();var N=F.isPreset();F=F.isGallery();if(!N&&!F){N=p;F=v;var H=new pa;H.setUserObject(new la);H.setParent(F);N.push(H)}for(N=0;N<B.length;N++)F=B[N],F.getUserObject().getCategoryId()===v.getId()&&(p.push(F),F.setParent(v));v.setChildren(p);v.setVisited(!0)}}};this.getNoDataPrompt=function(){return f.get("noCategoryAndAdd","\u6ca1\u6709\u76ee\u5f55\uff0c\u8bf7\u5148\u65b0\u5efa\u76ee\u5f55")};
this.listItemPainter=function(B,z){r.listItemPainter(B,z);z.getUserObject().isPreset()||z.getUserObject().isGallery()||!z.getParent()||q(I.getIndex(z),B)};this.setFunLoadImages=function(B){C=B};var q=function(B,z){var w=n.getModels(),p=0!==B,v=$("<div>"),F=p&&w[B-1],N=w[B].getParent()?w[B].getParent().getDirChildren():null;p=p&&!F.getUserObject().isPreset()&&w[B]!=N[0];v.addClass("image-lib-manage-list-item-op-group");var H=$("<div>");H.addClass("image-lib-manage-list-item-op-menu");H.css("top","-1px");
H.attr("title",f.get("moreOp","\u66f4\u591a\u64cd\u4f5c"));H.on("mousedown",function(Q){c(Q,z)});U().background(H,"menu");H.appendTo(v);if(p){var ka=$("<div>");ka.addClass("image-lib-manage-list-item-op-order");ka.attr("title",f.get("orderUp","\u4e0a\u79fb"));ka.on("mousedown",function(Q){e(Q,z)});U().background(ka,"icon-order-up");ka.appendTo(v)}z.on("mouseenter",function(){v.show();n.getCurrent().equals(w[B])?(U().background(H,"menu_hover"),p&&U().background(ka,"icon-order-up_hover")):(U().background(H,
"menu"),p&&U().background(ka,"icon-order-up"))});z.on("mouseleave",function(){v.hide()});z.on("click",function(){var Q=z.data("oNode");n.itemClick(Q);U().background(H,"menu_hover");p&&U().background(ka,"icon-order-up_hover")});v.hide();v.appendTo(z)},c=function(B,z){var w=$(B.currentTarget);if((B=w.data("menu"))&&B.isShowing())w.data("menu",null),B.hide();else{z=new T;z.addItemModel(ba.createActionMenuItem(f.get("addBroCategory","\u65b0\u5efa\u540c\u7ea7\u76ee\u5f55"),a));z.addItemModel(ba.createActionMenuItem(f.get("addChildCategory",
"\u65b0\u5efa\u5b50\u7ea7\u76ee\u5f55"),b));z.addItemModel(ba.createActionMenuItem(f.get("edit","\u7f16\u8f91")+f.get("type","\u76ee\u5f55"),l));z.addItemModel(ba.createActionMenuItem(f.get("remove","\u5220\u9664"),K));B=new ba;B.setModel(z);B.setHideListener(function(){w.data("menu",null)});w.data("menu",B);z=w.outerHeight();var p=n.getJqUi(),v=[0,z];v=Y.upwardCoordinate(w[0],v,p[0]);B.show(p,v[0],v[1],w,!0,[0,-z])}},a=function(){var B=function(H){w.getParent().addDirChildren(H);z.splice(p+1,0,H);
n.setModels(z);n.setSelected(H);n.updateUi()},z=n.getAllModels(),w=n.getSelected();if(w){var p=d(w,"ADD_CURRENT"),v=n.getList().getItemUiByModel(z[p]);if(v&&0<v.length){var F=new S,N=F.getJqUi();N.show();F.setEnabled(!0);N.addClass("img-lib-manager-dir-editing");N.children().css("position","relative");N.children().css("padding-left",14*w.getSubNodeLevel()+25+"px");N.insertAfter(v);F.requestFocus();F.addBlurListener(function(){var H=F.getText();H&&(H=H.trim(),F.getJqUi().attr("title",H));F.getJqUi().remove();
V(H)&&(H=new ha,H.setParent(w.getParent()),Z(!0,F,g,B,H))});N.on("keydown",function(H){if(13==(H.keyCode||H.which||H.charCode)){if(H=F.getText())H=H.trim(),F.getJqUi().attr("title",H);F.getJqUi().remove();V(H)&&(H=new ha,H.setParent(w.getParent()),Z(!0,F,g,B,H))}})}else L.getMessageCurtain().showPrompt(f.get("selectedOneDirectory","\u8bf7\u5148\u9009\u4e2d\u5177\u4f53\u76ee\u5f55\u3002"),2E3)}else 0<z.length&&L.getMessageCurtain().showPrompt(f.get("selectedOneDirectory","\u8bf7\u5148\u9009\u4e2d\u5177\u4f53\u76ee\u5f55\u3002"),
2E3)},b=function(){var B=function(H){w.addDirChildren(H);z.splice(p+1,0,H);n.setModels(z);n.setSelected(H);n.updateUi()},z=n.getAllModels(),w=n.getSelected();if(w){var p=d(w,"ADD_SUB"),v=n.getList().getItemUiByModel(z[p]);if(v&&0<v.length)if(4<=w.getSubNodeLevel())L.getMessageCurtain().showPrompt(f.get("theMaxDirenctoryLevel","\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"),
2E3);else{var F=new S,N=F.getJqUi();N.show();F.setEnabled(!0);N.addClass("img-lib-manager-dir-editing");N.children().css("position","relative");N.children().css("padding-left",14*w.getSubNodeLevel()+40+"px");N.insertAfter(v);F.requestFocus();F.addBlurListener(function(){var H=F.getText();H&&(H=H.trim(),F.getJqUi().attr("title",H));F.getJqUi().remove();V(H)&&(H=new ha,H.setParent(w),Z(!0,F,g,B,H))});N.on("keydown",function(H){if(13==(H.keyCode||H.which||H.charCode)){if(H=F.getText())H=H.trim(),F.getJqUi().attr("title",
H);F.getJqUi().remove();V(H)&&(H=new ha,H.setParent(w),Z(!0,F,g,B,H))}})}else L.getMessageCurtain().showPrompt(f.get("selectedOneDirectory","\u8bf7\u5148\u9009\u4e2d\u5177\u4f53\u76ee\u5f55\u3002"),2E3)}else L.getMessageCurtain().showPrompt(f.get("selectedOneDirectory","\u8bf7\u5148\u9009\u4e2d\u5177\u4f53\u76ee\u5f55\u3002"),2E3)},d=function(B,z){var w=n.getModels().length-1;if("ADD_CURRENT"==z)return B.getParent()&&(z=I.getIndex(B.getParent()),w=[],w=t(w,B.getParent()),w=parseInt(z)+w.length-1),
w;if("ADD_SUB"==z)return B.getDirChildren()&&0<B.getDirChildren().length?(z=I.getIndex(B),w=[],w=t(w,B),w=parseInt(z)+w.length-1):z=I.getIndex(B)},t=function(B,z){B.push(z);if((z=z.getDirChildren())&&0<z.length)for(var w=0;w<z.length;w++)z[w].getDirChildren()&&0<z[w].getDirChildren().length?t(B,z[w]):B.push(z[w]);return B},g=function(B,z,w){var p=w.getParent(),v=p.getUserObject(),F=v.isPublic();p=p.getParent()?v.getId():null;var N=new ja;N.setPublic(F);N.setName(B);N.setParentId(p);L.createFacade(function(H){H&&
(L.getMessageCurtain().showSuccess(f.get("saveCategorySuccess","\u65b0\u589e\u76ee\u5f55\u6210\u529f\u3002")),N.setId(H),w.setVisited(!0),H=new pa,H.setUserObject(new la),H.setParent(w),w.setUserObject(N),w.addTo(H,0),z(w))},function(H,ka){return 1100008===H?(L.getMessageCurtain().showPrompt(f.get("groupNameExist","\u76ee\u5f55\u540d\u79f0\u5df2\u5b58\u5728\u3002")),!0):!1}).saveOrUpdateCategory(N.toJsonObject())},e=function(B,z){var w=z.data("oNode"),p=n.getAllModels(),v=[];B=w.getParent().getDirChildren();
for(z=0;z<p.length;z++)p[z].getParent()||v.push(p[z]);for(z=0;z<B.length;z++)if(w.equals(B[z])&&0!==z){w=B[z];B[z]=B[z-1];B[z-1]=w;break}w=1;p=[];for(z=B.length-1;0<=z;z--){var F=B[z].getUserObject();F.isPreset()||(F.setOrder(w),p.push(F.toJsonObject()),w++)}L.createFacade(function(N){N&&(N=[],k(N,v),n.setModels(N))},function(){return!1}).saveOrderCategory(p,B[0].getUserObject().isPublic())},k=function(B,z){if(null!=z)if(Array.isArray(z))for(var w=0;w<z.length;w++)B.push(z[w]),k(B,z[w].getDirChildren());
else B.push(z),k(B,z.getDirChildren())},l=function(B){var z=function(){v&&v.remove()},w=n.getCurrent();B=n.getList().getItemUiByModel(w);var p=new S;p.setEnabled(!0);p.addBlurListener(function(){Z(!0,p,u,z,w)});p.addAcceptableListener(function(F,N){Z(N,p,u,z,w)});p.setText(w.getName());var v=p.getJqUi();v.addClass("img-lib-manager-dir-editing");v.css("width","101%");v.css("left","-4px");v.children().css("position","relative");v.children().css("padding-left",14*w.getSubNodeLevel()+25+"px");v.on("click",
function(F){F.stopPropagation()});v.appendTo(B);p.requestFocus()},u=function(B,z,w){var p=w.getUserObject();if(!V(B)||D(p))z();else if(p.getName()===B)z();else{var v=p.getName();p.setName(B);L.createFacade(function(){L.getMessageCurtain().showSuccess(f.get("editCategory","\u4fee\u6539\u76ee\u5f55")+f.get("success","\u6210\u529f")+f.get("fullPoint","\u3002"));n.updateUi()},function(F,N){p.setName(v);z();return 1100008===F?(L.getMessageCurtain().showPrompt(f.get("groupNameExist","\u76ee\u5f55\u540d\u79f0\u5df2\u5b58\u5728\u3002")),
!0):!1}).saveOrUpdateCategory(p.toJsonObject())}},K=function(B){var z=n.getCurrent();B=z.getUserObject();D(B)||(z.isVisited()?E(z):C(z,!1,function(){E(z)}))},E=function(B){var z=B.getUserObject(),w=B.getDirChildren();w&&0<w.length?L.getMessageCurtain().showPrompt(f.get("deleteCategoryFirst","\u8bf7\u5148\u5220\u9664\u76ee\u5f55\u4e0b\u7684\u5b50\u76ee\u5f55\u518d\u5220\u9664\u76ee\u5f55\u3002")):(w=B.getChildren())&&1<w.length?L.getMessageCurtain().showPrompt(f.get("deleteImageFirst","\u8bf7\u5148\u5220\u9664\u76ee\u5f55\u4e0b\u7684\u56fe\u7247\u518d\u5220\u9664\u76ee\u5f55\u3002")):
(w=P.createFeedbackDialog(),w.setOptionType(P.OPTION_OK_CANCEL),w.setMsgImageType(P.MSG_DELETE),w.setMessage(f.get("confirmDeleteCategory","\u5220\u9664\u76ee\u5f55\u201c#1\u201d\u540e\u5c06\u65e0\u6cd5\u6062\u590d\uff0c\u786e\u5b9a\u5220\u9664\u8be5\u76ee\u5f55\u5417\uff1f").replace("#1",z.getName())),w.setClosingChecker(function(p){p===P.RETURN_OK&&h(B);return!0}),w.showDialog())},h=function(B){x(B)?L.getMessageCurtain().showPrompt(f.get("deleteLastCategory","\u81f3\u5c11\u9700\u8981\u4fdd\u7559\u4e00\u4e2a\u7528\u6237\u76ee\u5f55\u3002")):
L.createFacade(function(z){z&&(L.getMessageCurtain().showSuccess(f.get("deleteCategory","\u5220\u9664\u76ee\u5f55")+f.get("success","\u6210\u529f")+f.get("fullPoint","\u3002")),n.deleteByModel(B))},function(z,w){return 1100009===z?(L.getMessageCurtain().showPrompt(f.get("deleteImageFirst","\u8bf7\u5148\u5220\u9664\u76ee\u5f55\u4e0b\u7684\u56fe\u7247\u518d\u5220\u9664\u76ee\u5f55\u3002")),!0):!1}).deleteCategory(B.getId(),B.getName(),B.getUserObject().isPublic())},x=function(B){var z=n.getModels();
if(B.getUserObject().isPublic()){B=[];for(var w=0;w<z.length;w++){var p=z[w].getUserObject();p.isPreset()||B.push(p)}if(2>=B.length)return!0}else if(2>=z.length)return!0;return!1},D=function(B){return B&&B.getId()?!1:(L.getMessageCurtain().showError(f.get("groupModelIsNull","\u5f53\u524d\u5206\u7ec4\u4e0d\u5b58\u5728\uff0c\u8bf7\u5237\u65b0\u540e\u91cd\u8bd5\u3002")),!0)},V=function(B){var z=/^[\s\u3000\u4E00-\u9FA5a-zA-Z0-9_]{1,}$/;if(B.length>ja.GROUP_NAME_MAX_LENGTH)return L.getMessageCurtain().showPrompt(f.get("nameExceeded",
"\u540d\u79f0\u4e0d\u80fd\u8d85\u8fc7#1\u4e2a\u5b57\u7b26\u3002").replace("#1",ja.GROUP_NAME_MAX_LENGTH)),!1;if(B){if(0<B.indexOf(" "))return L.getMessageCurtain().showPrompt(f.get("nameWithSpace","\u540d\u79f0\u4e0d\u80fd\u643a\u5e26\u7a7a\u683c\u3002")),!1;if(!B.match(z))return L.getMessageCurtain().showPrompt(f.get("groupNameRule","\u540d\u79f0\u53ea\u80fd\u4f7f\u7528\u4e2d\u6587\u3001\u6570\u5b57\u3001\u5b57\u6bcd\u6216\u4e0b\u5212\u7ebf\u3002")),!1}else return!1;return!0},Z=function(B,z,w,p,
v){z=z.getText().trim();B&&z?w(z,p,v):p()}}function wa(){R.call(this);var y=this,n=y.protectedMethod,I,r,C,q,c,a;this.setFunGetDynamicWidth=function(b){I=b};this.setFunCategoriesProvider=function(b){r=b};this.setSelectCategory=function(b){C=b};this.setDeleteCategory=function(b){q=b};this.setRefreshSearchPanel=function(b){c=b};this.selectedUIFeedback=function(b){b.addClass("image-lib-image-card-selected");(function(d){var t=0;a&&clearInterval(a);var g=function(){d.addClass("manage-card-twinkle");t++;
2===t&&clearInterval(a);setTimeout(function(){d.removeClass("manage-card-twinkle")},200)};a=setInterval(function(){g()},500)})(b)};this.updateWidth=function(){var b=n.getCardList();b&&b.css({width:I()+"px"})};this.loadModels=function(b,d,t){var g=b.getUserObject();L.createFacade(function(e){for(var k=[],l,u=0;u<e.length;u++){l=new pa;var K=new oa;K.fromJsonObject(e[u]);l.setUserObject(K);l.setParent(b);k.push(l)}g.isPublic()&&(!g.isPublic()||g.isPreset()||!L.hasPublicPermission())||g.isGallery()||
(l=new pa,l.setUserObject(new la),l.setParent(b),k.splice(0,0,l));b.setChildren(k);b.setVisited(!0);d&&(n.setModels(k),d&&y.updateUi(n.getCurrentType()),c&&c());t&&t();g.isGallery()&&0==b.getChildren().length&&0==b.getDirChildren().length&&q&&q(b)},function(){return!1}).getAllImageOfCategory(b.getId(),g.isPreset())};this.createNoDataUi=function(){var b=$("<div>");b.addClass("image-lib-manage-list-no-data");var d=$("<div>");U().background(d,"no-data");d.css({height:"220px",marginTop:"210px",backgroundSize:"contain",
backgroundPosition:"center"});var t=$("<div>");t.css({marginTop:"21px",fontSize:"16px"});var g=f.get("noImagesExist","\u6682\u65e0\u56fe\u7247");t.text(g);b.append(d);b.append(t);return b};this.addCard=function(b){var d=b.getUserObject(),t=n.getCardList();if(d instanceof oa){b=new X(d,!1,b.getParent());b.init();b.setFunPreview(y.previewImage);b.setFunDuplicateNameChecker(function(e){return n.isNameDuplicate(e)});b.setCategoriesProvider(r);b.setFunCardOpCallBack(function(e,k){y.loadModels(e,k,function(){C(e)})});
var g=b.getJqUi();g.on("click",function(e){e.stopPropagation();t.find(".image-lib-image-card-selected").removeClass("image-lib-image-card-selected");g.addClass("image-lib-image-card-selected")});g.appendTo(t)}else d instanceof la&&(b=new ua(d,b.getParent()),b.init(),b.setFunCardListUpdateUi(y.setModelAndUpdateUi),b.getJqUi().appendTo(t))}}function ua(y,n){ta.call(this);var I=this.protectedMethod,r=this,C;this.setFunCardListUpdateUi=function(b){C=b};this.init=function(){r.setClickable(!0);r.setFooterHeight(0);
I.init();var b=$("<div>");b.css("position","relative");b.width(r.getContentWidth());b.height(r.getContentHeight());var d=$("<div>");d.addClass("upload-card-icon");Y.layoutCtrlWithLRTB(d,0,0,null,50,null);d.appendTo(b);d=$("<div>");d.addClass("upload-card-title");d.text(f.get("uploadImage","\u4e0a\u4f20\u56fe\u7247"));Y.layoutCtrlWithLRTB(d,0,0,null,140,null);d.appendTo(b);d=$("<div>");d.addClass("upload-card-prompt");Y.layoutCtrlWithLRTB(d,0,0,null,185,null);var t=fa.getAllTypeWithSeparator(f.get("stopSign",
"\u3001")),g=f.get("uploadCardPrompt","\u56fe\u7247\u683c\u5f0f\u652f\u6301#1\uff0c\u6700\u5927\u4e0d\u8d85\u8fc7#2M\u3002");g=g.replace("#1",t);g=g.replace("#2",(20).toString());d.text(g);d.appendTo(b);I.addCustomJq2Content(b)};this.doClick=function(b){b=r.getJqUi();var d=new ya;d.appendInvislbelUiTo(b.parent());d.selectFile(q,".jpg, .jpeg, .png, .bmp, .gif",function(t){return 0===t.indexOf("image/")})};var q=function(b){var d=b.getFile();d&&(b.isSizeLargeThan(20971520)?L.getMessageCurtain().showPrompt(f.get("imageOverSize",
"\u56fe\u7247\u5927\u5c0f\u4e0d\u80fd\u5927\u4e8e#1M\u3002").replace("#1",(20).toString())):b.isTypeMatched()?(b=b.getFileName(),50<b.substring(0,b.lastIndexOf(".")).length?L.getMessageCurtain().showPrompt(f.get("imageNameToLong\u3002","\u56fe\u7247\u540d\u79f0\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26")):c(d,a)):L.getMessageCurtain().showPrompt(f.get("notImage","\u8be5\u6587\u4ef6\u7c7b\u578b\u4e0d\u662f\u56fe\u7247\u3002")))},c=function(b,d){var t=new A;t.setShowBlocking(!0);t.setText(f.get("uploadingImage",
"\u6b63\u5728\u4e0a\u4f20\u56fe\u7247"));t.setRequestPreparer(function(e){e.append("filename",b)});t.setFinishedHandler(function(e){e&&L.getMessageCurtain().showPrompt(f.get("failToUploadImg","\u4e0a\u4f20\u56fe\u7247\u5931\u8d25\u3002"))});t.setSuccessHandler(function(e){e=e.data;var k=b.name,l=new oa;l.setNameAndType(k);l.setCategoryId(n.getId());l.setFileName(e);d(l)});var g=aa.getUploadUrl();t.uploadTo(g)},a=function(b){var d=L.createFacade(function(g){var e=new pa,k=new oa;k.fromJsonObject(g);
k.setHasContent(!0);e.setUserObject(k);e.setParent(n);n.addTo(e,1);L.getMessageCurtain().showSuccess(f.get("uploadImgSuccess","\u4e0a\u4f20\u56fe\u7247\u6210\u529f\u3002"));C(n)},function(g,e){if(1100022===g)return L.getMessageCurtain().showError(f.get("nullImageType","\u65e0\u6cd5\u8bc6\u522b\u56fe\u7247\u7684\u7c7b\u578b\u3002")),!0;if(1100042===g)return L.getMessageCurtain().showPrompt(f.get("imageNameExist","\u56fe\u7247\u540d\u79f0\u5df2\u5b58\u5728\u3002")),!0;if(1100021===g)return g=new P,
g.setOptionType(P.OPTION_OK),g.setButtonText(P.OPTION_OK,"\u786e\u5b9a"),g.setMessage(f.get("qingStorageFileSizeLimit","\u60a8\u7684\u8f7b\u5b58\u50a8\u7a7a\u95f4\u4e0d\u8db3\uff0c\u65e0\u6cd5\u5b8c\u6210\u8be5\u64cd\u4f5c\u3002")),g.showDialog(),!0}),t=n.getUserObject().isPublic();d.saveImageInfo(b.toJsonObject(),t)}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&
(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.imagelib&&(com.kingdee.bos.qing.imagelib={});"undefined"==typeof com.kingdee.bos.qing.imagelib.ui&&(com.kingdee.bos.qing.imagelib.ui={});var xa=com.kingdee.bos.qing.imagelib.ui,Y,va,ya,O,P,S,f,m,A,aa,ea,M,ba,T,ja,oa,la,fa,ha,pa,ra,ta,G,ma,R,X,L,J,W;(function(){var y=com.kingdee.bos.qing;va=y.Seer;y=com.kingdee.bos.qing.common;Y=y.DomUtil;y=com.kingdee.bos.qing.common.ui;ya=y.LocalFileSelector;y=com.kingdee.bos.qing.ui.component;O=
y.MessageCurtain;P=y.MessageDialog;S=y.TextField;ba=y.Menu;T=y.MenuModel;y=com.kingdee.bos.qing.framework.common;A=y.FileUploader;m=y.TabbedUiUtil;aa=y.RemoteFrameworkRegister;ea=y.MultilanguageManager;y=com.kingdee.bos.qing.imagelib.model;oa=y.Image;ja=y.ImageCategory;ha=y.FolderNode;la=y.UploadOpModel;pa=y.LeafNode;fa=y.ImageLibModelUtil;y=com.kingdee.bos.qing.imagelib.common.ui;ra=y.AbstractManagePanel;ta=y.AbstractCard;G=y.AbstractCategoryList;ma=y.AbstractCategoryContainer;R=y.AbstractCardContainer;
X=y.ImageCard;y=com.kingdee.bos.qing.imagelib.common;f=ea.createPackageAccessor(y);L=y.ImageLibUtil;y=com.kingdee.bos.qing.imagelib.imexport.ui;J=y.UploadPane;W=y.ExportDialog})();xa.Main=function(y){var n;this.getJqUi=function(){var r=n.getJqUi();if(!r)throw Error("Main is not start!");return r};this.start=function(){L.setAppId(va.getUrlParamValue("appID"));var r=new O;r.getJqUi().appendTo($("body"));L.setMessageCurtain(r);L.checkPublicPermission(function(C){L.setHasPublicPermission(C);n=new da;
n.setSelectedImage(I());n.init();n.getJqUi().appendTo($(document.body))});r=com.kingdee.bos.qing.behavior.BehaviorManager;r.interestInBehaviorEntrance(r.ENTRANCE_IMAGELIB);window.addEventListener("storage",function(){var C=I();C&&n.setSelectedImage(C)})};var I=function(){var r=sessionStorage.getItem("selectImage");if(!r)return null;sessionStorage.removeItem("selectImage");r=JSON.parse(r);var C=new oa;C.setId(r.id);C.setCategoryId(r.categoryId);return C}};qa.ITEM_HEIGHT=48})();
//qingVersionTag: 20250415