var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(C,b,k){C instanceof String&&(C=String(C));for(var u=C.length,D=0;D<u;D++){var B=C[D];if(b.call(k,B,D,C))return{i:D,v:B}}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(C,b,k){if(C==Array.prototype||C==Object.prototype)return C;C[b]=k.value;return C};$jscomp.getGlobal=function(C){C=["object"==typeof globalThis&&globalThis,C,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<C.length;++b){var k=C[b];if(k&&k.Math==Math)return k}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(C,b){var k=$jscomp.propertyToPolyfillSymbol[b];if(null==k)return C[b];k=C[k];return void 0!==k?k:C[b]};
$jscomp.polyfill=function(C,b,k,u){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(C,b,k,u):$jscomp.polyfillUnisolated(C,b,k,u))};$jscomp.polyfillUnisolated=function(C,b,k,u){k=$jscomp.global;C=C.split(".");for(u=0;u<C.length-1;u++){var D=C[u];if(!(D in k))return;k=k[D]}C=C[C.length-1];u=k[C];b=b(u);b!=u&&null!=b&&$jscomp.defineProperty(k,C,{configurable:!0,writable:!0,value:b})};
$jscomp.polyfillIsolated=function(C,b,k,u){var D=C.split(".");C=1===D.length;u=D[0];u=!C&&u in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var B=0;B<D.length-1;B++){var w=D[B];if(!(w in u))return;u=u[w]}D=D[D.length-1];k=$jscomp.IS_SYMBOL_NATIVE&&"es6"===k?u[D]:null;b=b(k);null!=b&&(C?$jscomp.defineProperty($jscomp.polyfills,D,{configurable:!0,writable:!0,value:b}):b!==k&&(void 0===$jscomp.propertyToPolyfillSymbol[D]&&(k=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[D]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(D):$jscomp.POLYFILL_PREFIX+k+"$"+D),$jscomp.defineProperty(u,$jscomp.propertyToPolyfillSymbol[D],{configurable:!0,writable:!0,value:b})))};$jscomp.polyfill("Array.prototype.find",function(C){return C?C:function(b,k){return $jscomp.findInternal(this,b,k).v}},"es6","es3");$jscomp.arrayIteratorImpl=function(C){var b=0;return function(){return b<C.length?{done:!1,value:C[b++]}:{done:!0}}};$jscomp.arrayIterator=function(C){return{next:$jscomp.arrayIteratorImpl(C)}};
$jscomp.initSymbol=function(){};$jscomp.polyfill("Symbol",function(C){if(C)return C;var b=function(B,w){this.$jscomp$symbol$id_=B;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:w})};b.prototype.toString=function(){return this.$jscomp$symbol$id_};var k="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",u=0,D=function(B){if(this instanceof D)throw new TypeError("Symbol is not a constructor");return new b(k+(B||"")+"_"+u++,B)};return D},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(C){if(C)return C;C=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),k=0;k<b.length;k++){var u=$jscomp.global[b[k]];"function"===typeof u&&"function"!=typeof u.prototype[C]&&$jscomp.defineProperty(u.prototype,C,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return C},"es6",
"es3");$jscomp.iteratorPrototype=function(C){C={next:C};C[Symbol.iterator]=function(){return this};return C};$jscomp.iteratorFromArray=function(C,b){C instanceof String&&(C+="");var k=0,u=!1,D={next:function(){if(!u&&k<C.length){var B=k++;return{value:b(B,C[B]),done:!1}}u=!0;return{done:!0,value:void 0}}};D[Symbol.iterator]=function(){return D};return D};$jscomp.polyfill("Array.prototype.keys",function(C){return C?C:function(){return $jscomp.iteratorFromArray(this,function(b){return b})}},"es6","es3");
$jscomp.polyfill("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991},"es6","es3");
(function(){function C(){var B,w,E,J,P,q,l,h,p,e,A,Q,G,F,x,a,d,n,v,m,O,H,M,S,T;this.setId=function(r){B=r};this.getId=function(){return B};this.setAnimate=function(r){w=r};this.getAnimate=function(){return w};this.setFloat=function(r){E=r};this.getFloat=function(){return E};this.setCellHeightMode=function(r){J=r};this.getCellHeightMode=function(){return J};this.setCellScale=function(r){P=r};this.getCellScale=function(){return P};this.setCellHeight=function(r){q=r};this.getCellHeight=function(){return q};
this.setColumn=function(r){l=r};this.getColumn=function(){return l};this.setWidgetDragCancelClass=function(r){m=r};this.getWidgetDragCancelClass=function(){return m};this.setMinRow=function(r){h=r};this.getMinRow=function(){return h};this.setMaxRow=function(r){p=r};this.getMaxRow=function(){return p};this.setDisableDrag=function(r){e=r};this.getDisableDrag=function(){return e};this.setDisableResize=function(r){A=r};this.getDisableResize=function(){return A};this.setMargin=function(r,V,z,y){Q=r;G=
V;F=z;x=y};this.getMarginTop=function(){return Q};this.getMarginLeft=function(){return G};this.getMarginRight=function(){return F};this.getMarginBottom=function(){return x};this.setGridClass=function(r){a=r};this.getGridClass=function(){return a};this.setGridParentClass=function(r){d=r};this.getGridParentClass=function(){return d};this.setWidgetItemClass=function(r){n=r};this.getWidgetItemClass=function(){return n};this.setWidgetPlaceholderClass=function(r){v=r};this.getWidgetPlaceholderClass=function(){return v};
this.setWidgetDragCancelClass=function(r){m=r};this.getWidgetDragCancelClass=function(){return m};this.setWidgetResizeHandles=function(r){O=r};this.getWidgetResizeHandles=function(){return O};this.setWidgetDragHandleHide=function(r){M=r};this.getWidgetDragHandleHide=function(){return M};this.setWidgetDragHandleAutoHide=function(r){S=r};this.getWidgetDragHandleAutoHide=function(){return S};this.setWidgetResizeHandleAutoHide=function(r){H=r};this.getWidgetResizeHandleAutoHide=function(){return H};this.setFunAcceptWidget=
function(r){T=r};this.getFunAcceptWidget=function(){return T};this.toJsonObject=function(){var r={};r.id=B;r.animate=w;r["float"]=E;r.cellHeightMode=J;r.cellScale=P;r.cellHeight=q;r.column=l;r.minRow=h;r.maxRow=p;r.disableDrag=e;r.disableResize=A;r.marginTop=Q;r.marginLeft=G;r.marginRight=F;r.marginBottom=x;r.gridClass=a;r.gridParentClass=d;r.widgetItemClass=n;r.widgetPlaceholderClass=v;r.widgetDragCancelClass=m;r.widgetResizeHandles=O;r.widgetResizeHandleAutoHide=H;r.widgetDragHandleHide=M;r.widgetDragHandleAutoHide=
S;r.funAcceptWidget=T;return r};this.fromJsonObject=function(r){B=r.id;w=r.animate;E=r["float"];J=r.cellHeightMode;P=r.cellScale;q=r.cellHeight;l=r.column;h=r.minRow;p=r.maxRow;e=r.disableDrag;A=r.disableResize;Q=r.marginTop;G=r.marginLeft;F=r.marginRight;x=r.marginBottom;a=r.gridClass;d=r.gridParentClass;n=r.widgetItemClass;v=r.widgetPlaceholderClass;m=r.widgetDragCancelClass;O=r.widgetResizeHandles;H=r.widgetResizeHandleAutoHide;M=r.widgetDragHandleHide;S=r.widgetDragHandleAutoHide;T=r.funAcceptWidget}}
function b(){var B,w,E,J;this.setX=function(l){B=l};this.getX=function(){return B};this.setY=function(l){w=l};this.getY=function(){return w};this.setW=function(l){E=l};this.getW=function(){return E};this.setH=function(l){J=l};this.getH=function(){return J};var P=function(){var l={};l.x=B;l.y=w;l.w=E;l.h=J;return l},q=function(l){B=l.x;w=l.y;E=l.w;J=l.h};this.toJsonObject=function(){return P()};this.fromJsonObject=function(l){q(l)};this.protectedMethod={fromJsonObject:q,toJsonObject:P}}function k(){b.call(this);
var B=this.protectedMethod,w,E,J,P,q,l,h,p,e,A,Q;this.setMinW=function(a){w=a};this.getMinW=function(){return w};this.setMaxW=function(a){E=a};this.getMaxW=function(){return E};this.setMinH=function(a){J=a};this.getMinH=function(){return w};this.setMaxH=function(a){P=a};this.getMaxH=function(){return P};this.setId=function(a){q=a};this.getId=function(){return q};this.setName=function(a){l=a};this.getName=function(){return l};this.setDisplayName=function(a){h=a};this.getDisplayName=function(){return h};
this.setContent=function(a){p=a};this.getContent=function(){return p};this.setAutoPosition=function(a){e=a};this.getAutoPosition=function(){return e};this.setType=function(a){A=a};this.getType=function(){return A};this.setExtInfo=function(a){Q=a};this.getExtInfo=function(){return Q};var G=function(){var a=B.toJsonObject();a.minW=w;a.maxW=E;a.minH=J;a.maxH=P;a.id=q;a.name=l;a.displayName=h;a.content=p;a.autoPosition=e;a.type=A;a.extInfo=Q;return a},F=function(a){B.fromJsonObject(a);w=a.minW;E=a.maxW;
J=a.minH;P=a.maxH;q=a.id;l=a.name;h=a.displayName;p=a.content;e=a.autoPosition;A=a.type;Q=a.extInfo},x=function(a){var d=new k;d.fromJsonObject(G(a));return d};this.toJsonObject=function(){return G()};this.fromJsonObject=function(a){F(a)};this.clone=function(){return x()};this.protectedMethod={fromJsonObject:F,toJsonObject:G,clone:x}}function u(){var B=this;k.call(this);var w=this.protectedMethod,E,J,P,q,l,h,p,e,A,Q,G,F,x,a,d,n,v;this.setEl=function(m){E=m};this.getEl=function(){return E};this.setGrid=
function(m){J=m};this.getGrid=function(){return J};this.setDirty=function(m){P=m};this.getDirty=function(){return P};this.setUpdating=function(m){q=m};this.getUpdating=function(){return q};this.setExternal=function(m){l=m};this.getExternal=function(){return l};this.setMoving=function(m){h=m};this.getMoving=function(){return h};this.setResizing=function(m){p=m};this.getResizing=function(){return p};this.setSkipDown=function(m){e=m};this.getSkipDown=function(){return e};this.setLastUiPosition=function(m){x=
m};this.getLastUiPosition=function(){return x};this.setLastTried=function(m){a=m};this.getLastTried=function(){return a};this.setTemporaryRemoved=function(m){A=m};this.getTemporaryRemoved=function(){return A};this.setTemporaryStopDrag=function(m){Q=m};this.getTemporaryStopDrag=function(){return Q};this.setRemoveDOM=function(m){G=m};this.getRemoveDOM=function(){return G};this.setInitDD=function(m){F=m};this.getInitDD=function(){return F};this.setWillFitPos=function(m){d=m};this.getWillFitPos=function(){return d};
this.setOrigPosition=function(m){n=m};this.getOrigPosition=function(){return n};this.setRectPosition=function(m){v=m};this.getRectPosition=function(){return v};this.toWidgetJsonObject=function(){return w.toJsonObject()};this.toJsonObject=function(){var m=w.toJsonObject();m.el=E;m.grid=J;m.dirty=P;m.updating=q;m.external=l;m.moving=h;m.resizing=p;m.skipDown=e;m.temporaryRemoved=A;m.temporaryStopDrag=Q;m.removeDOM=G;m.initDD=F;m.lastUiPosition=x;m.lastTried=a;m.willFitPos=d;m.origPosition=n;m.rectPosition=
v;return m};this.fromJsonObject=function(m){w.fromJsonObject(m);E=m.el;J=m.grid;P=m.dirty;q=m.updating;l=m.external;h=m.moving;p=m.resizing;e=m.skipDown;A=m.temporaryRemoved;Q=m.temporaryStopDrag;G=m.removeDOM;F=m.initDD;x=m.lastUiPosition;a=m.lastTried;d=m.willFitPos;n=m.origPosition;v=m.rectPosition};this.clone=function(){var m=new u;m.fromJsonObject(B.toJsonObject());return m};this.clean=function(){F=G=Q=A=e=p=h=l=q=P=null}}"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.ui&&(com.kingdee.bos.qing.ui={});"undefined"==typeof com.kingdee.bos.qing.ui.grid&&(com.kingdee.bos.qing.ui.grid={});"undefined"==typeof com.kingdee.bos.qing.ui.grid.model&&(com.kingdee.bos.qing.ui.grid.model={});var D=com.kingdee.bos.qing.ui.grid.model;D.QingGridOptions=C;D.QingGridDraggableOptions=function(){var B,w,E,J,P,q,l,
h;this.setAppendTo=function(p){B=p};this.getAppendTo=function(){return B};this.setHelperCreator=function(p){w=p};this.getHelperCreator=function(){return w};this.setDragCancelClass=function(p){E=p};this.getDragCancelClass=function(){return E};this.setDragHandleAutoHide=function(p){J=p};this.getDragHandleAutoHide=function(){return J};this.setShowDragHandle=function(p){P=p};this.getShowDragHandle=function(){return P};this.setFunDragStart=function(p){q=p};this.getFunDragStart=function(){return q};this.setFunDragStop=
function(p){l=p};this.getFunDragStop=function(){return l};this.setFunDragging=function(p){h=p};this.getFunDragging=function(){return h};this.updateOption=function(p){p.appendTo&&(B=p.appendTo);p.helperCreator&&(w=p.helperCreator);p.dragCancelClass&&(E=p.dragCancelClass);p.dragHandleAutoHide&&(J=p.dragHandleAutoHide);p.showDragHandle&&(P=p.showDragHandle);p.funDragStart&&(q=p.funDragStart);p.funDragStop&&(l=p.funDragStop);p.funDragging&&(h=p.funDragging)}};D.QingGridResizableOptions=function(){var B,
w,E,J,P,q,l,h,p;this.setResizeHandleAutoHide=function(e){B=e};this.getResizeHandleAutoHide=function(){return B};this.setResizeHandles=function(e){w=e};this.getResizeHandles=function(){return w};this.setMinWidth=function(e){E=e};this.getMinWidth=function(){return E};this.setMaxWidth=function(e){J=e};this.getMaxWidth=function(){return J};this.setMinHeight=function(e){P=e};this.getMinHeight=function(){return P};this.setMaxHeight=function(e){q=e};this.getMaxHeight=function(){return q};this.setFunResizeStart=
function(e){l=e};this.getFunResizeStart=function(){return l};this.setFunResizeStop=function(e){h=e};this.getFunResizeStop=function(){return h};this.setFunResizing=function(e){p=e};this.getFunResizing=function(){return p};this.updateOption=function(e){e.minWidth&&(E=e.minWidth);e.maxWidth&&(J=e.maxWidth);e.minHeight&&(P=e.minHeight);e.maxHeight&&(q=e.maxHeight);e.resizeHandleAutoHide&&(B=e.resizeHandleAutoHide);e.resizeHandles&&(w=e.resizeHandles);e.funResizeStart&&(l=e.funResizeStart);e.funResizeStop&&
(h=e.funResizeStop);e.funResizing&&(p=e.funResizing)}};D.QingGridDroppableOptions=function(){var B,w,E,J,P;this.setAccept=function(q){B=q};this.getAccept=function(){return B};this.setExcludeClass=function(q){w=q};this.getExcludeClass=function(){return w};this.setFunDropOver=function(q){E=q};this.getFunDropOver=function(){return E};this.setFunDropOut=function(q){J=q};this.getFunDropOut=function(){return J};this.setFunDropped=function(q){P=q};this.getFunDropped=function(){return P};this.updateOption=
function(q){q.oAccept&&(B=q.oAccept);q.excludeClass&&(w=q.excludeClass);q.funDropOver&&(E=q.funDropOver);q.funDropOut&&(J=q.funDropOut);q.funDropped&&(P=q.funDropped)}};D.QingGridEngineOptions=function(){var B,w,E,J,P;this.setColumn=function(q){B=q};this.getColumn=function(){return B};this.setMaxRow=function(q){w=q};this.getMaxRow=function(){return w};this.setFloat=function(q){E=q};this.getFloat=function(){return E};this.setNodes=function(q){J=q};this.getNodes=function(){return J};this.setFunOnChange=
function(q){P=q};this.getFunOnChange=function(){return P}};D.QingGridUiData=function(){var B,w,E,J;this.setPosition=function(P,q){B=P;w=q};this.setSize=function(P,q){E=P;J=q};this.getPosition=function(){return{left:B,top:w}};this.getSize=function(){return{width:E,height:J}};this.getLeft=function(){return B};this.getTop=function(){return w};this.getWidth=function(){return E};this.getHeight=function(){return J}};D.QingGridMoveOpt=function(){b.call(this);var B=this.protectedMethod,w,E,J,P,q,l;this.setPosition=
function(h,p,e,A){this.setX(h);this.setY(p);this.setW(e);this.setH(A)};this.setSkip=function(h){P=h};this.getSkip=function(){return P};this.setPack=function(h){w=h};this.getPack=function(){return w};this.setNested=function(h){E=h};this.getNested=function(){return E};this.setResizing=function(h){J=h};this.getResizing=function(){return J};this.setCollide=function(h){q=h};this.getCollide=function(){return q};this.setMoveRect=function(h){l=h};this.getMoveRect=function(){return l};this.toJsonObject=function(){var h=
B.toJsonObject();h.pack=w;h.nested=E;h.resizing=J;h.skip=P;h.collide=q;h.moveRect=l;return h}};D.QingGridPosition=b;D.QingGridWidget=k;D.QingGridNode=u;C.DEFAULT_JSON_OBJECT={animate:!0,"float":!1,cellHeightMode:"fixed",cellScale:.9,cellHeight:null,column:15,minRow:0,maxRow:0,disableDrag:!1,disableResize:!1,marginTop:5,marginLeft:5,marginRight:5,marginBottom:5,gridClass:"qing-grid",gridParentClass:null,widgetItemClass:"qing-grid-item",widgetPlaceholderClass:"qing-grid-placeholder",widgetDragCancelClass:".qing-grid-item-content",
widgetResizeHandles:"n,e,s,w,se,sw,ne,nw",widgetResizeHandleAutoHide:!0,widgetDragHandleHide:!1,widgetDragHandleAutoHide:!0,funAcceptWidget:function(){return!0}}})();(function(){"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.ui&&(com.kingdee.bos.qing.ui={});"undefined"==typeof com.kingdee.bos.qing.ui.grid&&(com.kingdee.bos.qing.ui.grid={});"undefined"==typeof com.kingdee.bos.qing.ui.grid.util&&(com.kingdee.bos.qing.ui.grid.util={});com.kingdee.bos.qing.ui.grid.util.QingGridUtil=
new function(){this.isNullOrUndefined=function(b){return null===b||void 0===b};this.initEvent=function(b,k){var u={type:k.type};k={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:k.target?k.target:b.target};for(var D="pageX pageY clientX clientY screenX screenY".split(" "),B=0;B<D.length;B++){var w=D[B];u[w]=b&&b[w]}return this.combineObj(u,k)};this.addElStyles=function(b,k){k instanceof Object&&$.each(k,function(u,D){$(b).css(u,D)})};this.cloneNode=function(b){return $(b).clone().removeAttr("id")[0]};
this.getElement=function(b,k){if("string"!==typeof b)return b;"."!==b.charAt(0)&&(b="."+b);"string"===typeof k&&"."!==k.charAt(0)&&(k="."+k);return k?$(k).find(b).first()[0]:$(b)[0]};this.getElements=function(b,k){if("string"!==typeof b)return[b];"."!==b.charAt(0)&&(b="."+b);"string"===typeof k&&"."!==k.charAt(0)&&(k="."+k);return k?$(k).find(b).toArray():$(b).toArray()};this.isIntercepted=function(b,k){return!(b.getY()>=k.getY()+k.getH()||b.getY()+b.getH()<=k.getY()||b.getX()+b.getW()<=k.getX()||
b.getX()>=k.getX()+k.getW())};this.sort=function(b,k,u){return k?b.sort(function(D,B){return D.getX()+D.getY()*u-(B.getX()+B.getY()*u)}):b.sort(function(D,B){return B.getX()+B.getY()*u-(D.getX()+D.getY()*u)})};this.defaults=function(b,k){for(var u in k){if(!k.hasOwnProperty(u))return;null===b[u]||void 0===b[u]?b[u]=k[u]:"object"===typeof k[u]&&"object"===typeof b[u]&&this.defaults(b[u],k[u])}return b};this.sanitizeMinMax=function(b){b.getMinW()||b.setMinW(null);b.getMinH()||b.setMinH(null);b.getMaxW()||
b.setMaxW(null);b.getMaxH()||b.setMaxH(null)};this.samePos=function(b,k){return b&&k&&b.getX()===k.getX()&&b.getY()===k.getY()&&b.getW()===k.getW()&&b.getH()===k.getH()};this.clone=function(b){if(null===b||void 0===b||"object"!==typeof b)return b;if("function"===typeof b.clone)return b.clone();if(b instanceof Array){for(var k=[],u=0;u<b.length;u++)k.push(b[u]);return k}k={};for(u in b)b.hasOwnProperty(u)&&(k[u]=b[u]);return k};this.combineObj=function(){for(var b={},k=0;k<arguments.length;k++){var u=
arguments[k];if(u)for(var D in u)u.hasOwnProperty(D)&&(b[D]=u[D])}return b};this.toNumber=function(b){return null===b||0===b.length?void 0:Number(b)};this.parseHeight=function(b){var k=0;"string"===typeof b?(b=b.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|%)?$/))&&(k=parseFloat(b[1])):k=b;return k};this.addCSSRule=function(b,k,u){"function"===typeof b.addRule?b.addRule(k,u):"function"===typeof b.insertRule&&b.insertRule(k+"{"+u+"}")};this.createStylesheet=function(b,k){b=$("<style>").attr("type",
"text/css").attr("gs-style-id",b).appendTo(k||"head");b[0].appendChild(document.createTextNode(""));return b[0].sheet};this.removeStylesheet=function(b){$("style[gs-style-id="+b+"]").remove()};this.toBool=function(b){return"boolean"===typeof b?b:"string"===typeof b?(b=b.toLowerCase(),!(""===b||"no"===b||"false"===b||"0"===b)):!!b};this.same=function(b,k){if(typeof b!==typeof k)return!1;if("object"!==typeof b)return b===k;if(Object.keys(b).length!==Object.keys(k).length)return!1;for(var u in b)if(b[u]!==
k[u])return!1;return!0};this.removePositioningStyles=function(b){$(b).css({position:"",left:"",top:"",width:"",height:""})};this.throttle=function(b,k){var u=!1;return function(){u||(u=!0,setTimeout(function(){b(arguments);u=!1},k))}};this.updateScrollResize=function(b,k,u){k=this.getScrollElement(k);var D=k.clientHeight,B=k===this.getScrollElement()?0:k.getBoundingClientRect().top;b=b.clientY-B;B=b>D-u;k.scrollBy&&(b<u?k.scrollBy({behavior:"smooth",top:b-u}):B&&k.scrollBy({behavior:"smooth",top:u-
(D-b)}))};this.getScrollElement=function(b){if(!b)return document.scrollingElement||document.documentElement;var k=getComputedStyle(b);return/(auto|scroll)/.test(k.overflow+k.overflowY)?b:this.getScrollElement(b.parentElement)};this.getPositionFromTarget=function(b){return this.createPosition(b.getX(),b.getY(),b.getW(),b.getH())};this.setPositionToTarget=function(b,k,u){b.setX(k.getX());b.setY(k.getY());b.setW(k.getW());b.setH(k.getH());u&&(k.getMinW()&&b.setMinW(k.getMinW()),k.getMinH()&&b.setMinH(k.getMinH()),
k.getMaxW()&&b.setMaxW(k.getMaxW()),k.getMaxH()&&b.setMaxH(k.getMaxH()))};this.setDefaultsPositionToTarget=function(b,k){this.isNullOrUndefined(b.getX())&&b.setX(k.getX());this.isNullOrUndefined(b.getY())&&b.setY(k.getY());this.isNullOrUndefined(b.getW())&&b.setW(k.getW());this.isNullOrUndefined(b.getH())&&b.setH(k.getH())};this.createPosition=function(b,k,u,D){var B=new C;B.setX(b);B.setY(k);B.setW(u);B.setH(D);return B}};var C=com.kingdee.bos.qing.ui.grid.model.QingGridPosition})();(function(){function C(){var q={},l;this.disabled=function(){return l};this.on=function(h,p){q[h]=p};this.off=function(h){delete q[h]};this.triggerEvent=function(h,p,e){if(!this.disabled()&&q&&q[h])return q[h](p,e)};this.protectedMethod={enable:function(){l=!1},disable:function(){l=!0},destroy:function(){q=null}}}function b(q,l){C.call(this);var h=this.protectedMethod,p=this,e="transition pointerEvents position left top minWidth willChange".split(" "),A=q,Q=l||{},G,F,x,a,d;this.enable=function(){!1!==
p.disabled()&&(h.enable(),$(A).removeClass("ui-draggable-disabled"),$(A).on("mousedown",m))};this.disable=function(){!0!==p.disabled&&(h.disable(),M(!1),$(A).addClass("ui-draggable-disabled"),$(A).off("mousedown",m))};this.destroy=function(){G&&H({originalEvent:G});this.disable();x=A=null;h.destroy()};this.updateOption=function(z){Q.updateOption(z)};this.getEl=function(){return A};this.getHelper=function(){return x};this.createNewHelper=function(z){r();$(z).appendTo($(A.parentElement));x=z;T()};this.removeHelper=
function(){$(x).remove()};this.resetHelper=function(){$(x).remove();x=S();T()};var n=function(z){!0===Q.getShowDragHandle()&&$(A).removeClass("ui-draggable-autohide")},v=function(z){E.QingGridManager.getDraggable()!==p&&!0===Q.getShowDragHandle()&&$(A).addClass("ui-draggable-autohide")},m=function(z){var y=z.originalEvent;if(0!==y.button)return!0;if(!E.QingGridManager.getMouseHandled()){a:{var I=Q.getDragCancelClass();if(I){var R=[];Array.isArray(I)?Array.prototype.push.apply(R,I):R.push(I);for(I=
0;I<R.length;I++){var W=R[I];if(0<$(z.target).closest(W).length){z=!0;break a}}z=!1}else z=void 0}if(z)return!0;E.QingGridManager.setDraggable(null);E.QingGridManager.setDroppable(null);$(document).on("mousemove",O);$(document).on("mouseup",H);y.preventDefault();$(document.activeElement).blur();E.QingGridManager.setMouseHandled(!0);G=y;F=!1;return!0}},O=function(z){var y=z.originalEvent;if(F)V(y),z=J.initEvent(z,{target:A,type:"drag"}),p.triggerEvent("drag",z,p.ui());else if(3<Math.abs(y.x-G.x)+Math.abs(y.y-
G.y)){E.QingGridManager.setDraggable(p);F=!0;x=S(y);if(!x){H(G);return}z=A.getBoundingClientRect();a={left:z.left,top:z.top,width:z.width,height:z.height,offsetLeft:-y.clientX+z.left,offsetTop:-y.clientY+z.top};T(y);z=J.initEvent(y,{target:A,type:"dragStart"});p.triggerEvent("dragStart",z,p.ui())}y.preventDefault();return!0},H=function(z){z=z.originalEvent;$(document).off("mousemove",O);$(document).off("mouseup",H);if(F){F=!1;x===A?r():$(x).remove();var y=E.QingGridManager.getDroppable();y&&y.drop(z);
y=J.initEvent(z,{target:A,type:"dragStop"});p.triggerEvent("dragStop",y)}G=x=null;E.QingGridManager.setDraggable(null);E.QingGridManager.setDroppable(null);E.QingGridManager.setMouseHandled(!1);z&&z.preventDefault();v();return!0},M=function(z){!0===Q.getShowDragHandle()&&(z?($(A).addClass("ui-draggable-autohide"),$(A).on("mouseover",n),$(A).on("mouseout",v)):($(A).removeClass("ui-draggable-autohide"),$(A).off("mouseover",n),$(A).off("mouseout",v)))},S=function(z){var y=A,I=Q.getHelperCreator();"function"===
typeof I?y=I(z):"clone"===I&&(y=J.cloneNode(A));if(!y)return null;document.body.contains(y)||(z=Q.getAppendTo(),z="parent"===z?A.parentElement:z,$(y).appendTo($(z)));if(y===A)for(d={},z=0;z<e.length;z++)I=e[z],d[I]=A.style[I];return y},T=function(z){var y=$(x);y.addClass("ui-draggable-dragging");!x.style.width&&y.css("width",a.width+"px");!x.style.height&&y.css("height",a.height+"px");y.css("pointerEvents","none");y.css("willChange","left, top");y.css("position","fixed");y.css("transition","none");
V(z);setTimeout(function(){y.css("transition","")},0)},r=function(){var z=$(x);z.removeClass("ui-draggable-dragging");if(d){var y=d.transition||"";z.css("transition","none");for(var I=0;I<e.length;I++){var R=e[I];"transition"!==R&&z.css(R,d[R])}setTimeout(function(){z.css("transition",y)},50)}d=null},V=function(z){if(z){var y=x.style,I=a;y.left=z.clientX+I.offsetLeft+"px";y.top=z.clientY+I.offsetTop+"px"}};this.ui=function(){var z=A.parentElement.getBoundingClientRect(),y=x.getBoundingClientRect(),
I=y.top-z.top;z=y.left-z.left;y=new P;y.setPosition(z,I);return y};p.enable();(function(){if(!0===Q.getShowDragHandle()){var z=$("<div>");z.addClass("ui-draggable-handle");z.css("zIndex","99");z.css("userSelect","none");z.on("mousedown",m);z.appendTo(A)}})();M(Q.getDragHandleAutoHide())}function k(q,l){C.call(this);var h=this.protectedMethod,p=this,e=l||{},A;this.enable=function(){!1!==p.disabled()&&(h.enable(),$(q).removeClass("ui-droppable-disabled"),$(q).addClass("ui-droppable"),$(q).on("mouseenter",
Q),$(q).on("mouseleave",G))};this.disable=function(){!0!==p.disabled()&&(h.disable(),$(q).removeClass("ui-droppable"),$(q).addClass("ui-droppable-disabled"),$(q).off("mouseenter",Q),$(q).off("mouseleave",G))};this.destroy=function(){this.disable();$(q).removeClass("ui-droppable");$(q).removeClass("ui-droppable-disabled");h.destroy()};this.updateOption=function(x){e.updateOption(x);F()};this.drop=function(x){x.preventDefault();x=J.initEvent(x,{target:q,type:"drop"});p.triggerEvent("drop",x,p.ui(E.QingGridManager.getDraggable()))};
var Q=function(x){var a=E.QingGridManager.getDraggable();x=x.originalEvent;if(a){var d=a.getEl();var n=e.getExcludeClass();d=d&&n&&$(d).hasClass(n)?!0:!1;d||(d=a.getEl(),d=!d||A&&!A(d)?!1:!0,d&&(x.preventDefault(),x.stopPropagation(),E.QingGridManager.setDroppable(p),x=J.initEvent(x,{target:q,type:"dropOver"}),p.triggerEvent("dropOver",x,p.ui(a)),$(q).addClass("ui-droppable-over")))}},G=function(x){var a=E.QingGridManager.getDraggable(),d=E.QingGridManager.getDroppable();x=x.originalEvent;a&&d===
p&&(x.preventDefault(),x.stopPropagation(),E.QingGridManager.setDroppable(null),d=J.initEvent(x,{target:q,type:"dropOut"}),p.triggerEvent("dropOut",d,p.ui(a)))},F=function(){var x=e.getAccept();x&&(A="string"===typeof x?function(a){return $(a).hasClass(x)||$(a).is(x)}:x)};this.ui=function(x){return x.ui()};p.enable();F()}function u(q,l){C.call(this);var h=this.protectedMethod,p=this,e=q,A=l||{},Q=[],G,F,x,a,d,n,v="width height position left top opacity zIndex".split(" "),m;this.enable=function(){h.enable();
$(e).removeClass("ui-resizable-disabled")};this.disable=function(){h.disable();$(e).addClass("ui-resizable-disabled");r(!1)};this.destroy=function(){V();r(!1);V();e=null;h.destroy()};this.updateOption=function(y){A.updateOption(y)};var O=function(y){E.QingGridManager.getResizable()||E.QingGridManager.getDraggable()||(E.QingGridManager.setResizable(p),$(e).removeClass("ui-resizable-autohide"))},H=function(y){E.QingGridManager.getResizable()===p&&(E.QingGridManager.setResizable(null),$(e).addClass("ui-resizable-autohide"))},
M=function(y){G=e.getBoundingClientRect();F=J.getScrollElement(e);x=F.scrollTop;a=0;d=y;m={};for(var I=0;I<v.length;I++){var R=v[I];m[R]=e.style[R]}$(e).css("position","absolute");$(e).css("opacity","0.8");z();$(e).addClass("ui-resizable-resizing");y=J.initEvent(y,{type:"resizeStart",target:e});p.triggerEvent("resizeStart",y,p.ui())},S=function(y){$(e).removeClass("ui-resizable-resizing");y=J.initEvent(y,{type:"resizeStop",target:e});p.triggerEvent("resizeStop",y);if(m)for(y=0;y<v.length;y++){var I=
v[y];$(e).css(I,m[I])}a=x=n=G=d=null},T=function(y,I){a=F.scrollTop-x;var R={width:G.width,height:G.height+a,left:G.left,top:G.top-a},W=y.clientX-d.clientX,Y=y.clientY-d.clientY;-1<I.indexOf("e")?R.width+=W:-1<I.indexOf("w")&&(R.width-=W,R.left+=W);-1<I.indexOf("s")?R.height+=Y:-1<I.indexOf("n")&&(R.height-=Y,R.top+=Y);var aa=R.width;W=R.height;var ba=A.getMaxWidth()||Number.MAX_SAFE_INTEGER||aa;var da=A.getMinWidth()||aa;Y=A.getMaxHeight()||Number.MAX_SAFE_INTEGER||W;var ia=A.getMinHeight()||W;aa=
Math.min(ba,Math.max(da,aa));ba=Math.min(Y,Math.max(ia,W));Math.round(R.width)!==Math.round(aa)&&(-1<I.indexOf("w")&&(R.left+=R.width-aa),R.width=aa);Math.round(R.height)!==Math.round(ba)&&(-1<I.indexOf("n")&&(R.top+=R.height-ba),R.height=ba);n=R;z();I=0;G&&n&&(0<G.top-n.top&&(I=-1),0>G.top-n.top&&(I=1));n.top+=I;y=J.initEvent(y,{type:"resize",target:e});p.triggerEvent("resize",y,p.ui())},r=function(y){y?($(e).addClass("ui-resizable-autohide"),$(e).on("mouseover",O),$(e).on("mouseout",H)):($(e).removeClass("ui-resizable-autohide"),
$(e).off("mouseover",O),$(e).off("mouseout",H),E.QingGridManager.getResizable()===p&&E.QingGridManager.setResizable(null))},V=function(){if(Q)for(var y=0;y<Q.length;y++)Q[y].destory();Q=[]},z=function(){var y={left:0,top:0,width:0,height:0};if("absolute"===e.style.position){var I=e.parentElement.getBoundingClientRect();y.left=I.left;y.top=I.top}if(n)for(var R in n)I=n[R]-y[R],$(e).css(R,I+"px")};p.ui=function(){var y=e.parentElement.getBoundingClientRect(),I={width:G.width,height:G.height+a,left:G.left,
top:G.top-a};I=n||I;var R=I.left-y.left;y=I.top-y.top;var W=new P;W.setPosition(R,y);W.setSize(I.width,I.height);return W};p.enable();r(A.getResizeHandleAutoHide());(function(){var y="n e s w se sw ne nw".split(" ");A.getResizeHandles()&&(y=A.getResizeHandles().split(","));for(var I=0;I<y.length;I++){var R=new D(e,y[I],{start:M,stop:S,move:T});Q.push(R)}})()}function D(q,l,h){var p=q,e=null,A=null,Q=!1;this.destory=function(){Q&&x(A);e.removeEventListener("mousedown",G);p.removeChild(e);p=e=null};
var G=function(d){A=d=d.originalEvent;$(document).on("mousemove",F);$(document).on("mouseup",x);d.stopPropagation();d.preventDefault()},F=function(d){d=d.originalEvent;Q?a("move",d):2<Math.abs(d.x-A.x)+Math.abs(d.y-A.y)&&(Q=!0,a("start",A),a("move",d));d.stopPropagation();d.preventDefault()},x=function(d){d=d.originalEvent;Q&&a("stop",d);$(document).off("mousemove",F);$(document).off("mouseup",x);Q=!1;A=null;d.stopPropagation();d.preventDefault()},a=function(d,n){if(h[d])h[d](n,l)};(function(){var d=
$("<div>");d.addClass("ui-resizable-handle");d.addClass("ui-resizable-"+l);d.css("zIndex","100");d.css("userSelect","none");d.on("mousedown",G);d.appendTo(p);e=d[0]})()}function B(q){var l=null,h=null,p=null;this.getEl=function(){return q};this.on=function(e,A){if(l&&-1<["drag","dragStart","dragStop"].indexOf(e))l.on(e,A);else if(h&&-1<["drop","dropOver","dropOut"].indexOf(e))h.on(e,A);else if(p&&-1<["resizeStart","resize","resizeStop"].indexOf(e))p.on(e,A)};this.off=function(e,A){l&&-1<["drag","dragStart",
"dragStop"].indexOf(e)?l.off(e,A):h&&-1<["drop","dropOver","dropOut"].indexOf(e)?h.off(e,A):p&&-1<["resizeStart","resize","resizeStop"].indexOf(e)&&p.off(e,A)};this.setupDraggable=function(e){l=new b(q,e)};this.updateDraggable=function(e){l.updateOption(e)};this.cleanDraggable=function(){l&&(l.destroy(),l=null)};this.enableDraggable=function(e){e?l&&l.enable():l&&l.disable()};this.getDraggable=function(){return l};this.setupDroppable=function(e){h?h.updateOption(e):h=new k(q,e)};this.cleanDroppable=
function(){h&&(h.destroy(),h=null)};this.enableDroppable=function(e){e?h&&h.enable():h&&h.disable()};this.getDroppable=function(){return h};this.setupResizable=function(e){p=new u(q,e)};this.updateResizable=function(e){p.updateOption(e)};this.cleanResizable=function(){p&&(p.destroy(),p=null)};this.enableResizable=function(e){e?p&&p.enable():p&&p.disable()};this.getResizeable=function(){return p}}function w(){this.resizable=function(l,h,p,e){l=q(l);"disable"===h||"enable"===h?l.enableResizable("enable"===
h):"destroy"===h?l.cleanResizable():"option"===h?(h={},h[p]=e,l.updateResizable(h)):(l.setupResizable(h),h.getFunResizeStart()&&l.on("resizeStart",h.getFunResizeStart()),h.getFunResizeStop()&&l.on("resizeStop",h.getFunResizeStop()),h.getFunResizing()&&l.on("resize",h.getFunResizing()))};this.draggable=function(l,h,p,e){l=q(l);"disable"===h||"enable"===h?l.enableDraggable("enable"===h):"destroy"===h?l.cleanDraggable():"option"===h?(h={},h[p]=e,l.updateDraggable(h)):(l.setupDraggable(h),h.getFunDragStart()&&
l.on("dragStart",h.getFunDragStart()),h.getFunDragStop()&&l.on("dragStop",h.getFunDragStop()),h.getFunDragging()&&l.on("drag",h.getFunDragging()))};this.droppable=function(l,h,p,e){var A=q(l);"disable"===h||"enable"===h?A.enableDroppable("enable"===h):"destroy"===h?A.cleanDroppable():"option"===h?(l={},l[p]=e,A.setupDroppable(l)):(A.setupDroppable(h),h.getFunDropOver()&&w.on(l,"dropOver",h.getFunDropOver()),h.getFunDropOver()&&w.on(l,"dropOut",h.getFunDropOut()),h.getFunDropOver()&&w.on(l,"drop",
h.getFunDropped()))};this.dragIn=function(l,h){l=q(l);l.setupDraggable(h);h.getFunDragStart()&&l.on("dragStart",h.getFunDragStart());h.getFunDragStop()&&l.on("dragStop",h.getFunDragStop())};this.isDroppable=function(l){return l&&l.qingGridElement&&l.qingGridElement.getDroppable()&&!l.qingGridElement.getDroppable().disabled()?!0:!1};this.isDraggable=function(l){return l&&l.qingGridElement&&l.qingGridElement.getDraggable()&&!l.qingGridElement.getDraggable().disabled()?!0:!1};this.isResizable=function(l){return l&&
l.qingGridElement&&l.qingGridElement.getResizeable()&&!l.qingGridElement.getResizeable().disabled()?!0:!1};this.on=function(l,h,p){q(l).on(h,function(e){var A=E.QingGridManager.getDraggable()?E.QingGridManager.getDraggable().getEl():e.target,Q=E.QingGridManager.getDraggable()?E.QingGridManager.getDraggable().getHelper():null;p(e,A,Q)})};this.off=function(l,h){q(l).off(h)};var q=function(l){l=J.getElement(l);if(!l)return null;var h=l.qingGridElement;h||(h=B.init(l));return h}}"undefined"==typeof com&&
(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.ui&&(com.kingdee.bos.qing.ui={});"undefined"==typeof com.kingdee.bos.qing.ui.grid&&(com.kingdee.bos.qing.ui.grid={});"undefined"==typeof com.kingdee.bos.qing.ui.grid.core&&(com.kingdee.bos.qing.ui.grid.core={});var E=com.kingdee.bos.qing.ui.grid.core;E.QingGridBaseImpl=C;E.QingGridDroppable=
k;E.QingGridResizable=u;E.QingGridDraggable=b;E.QingGirdElement=B;E.QingGridManager=new function(){var q=!1,l=null,h=null,p=null;this.setMouseHandled=function(e){q=e};this.getMouseHandled=function(){return q};this.setDraggable=function(e){l=e};this.getDraggable=function(){return l};this.setDroppable=function(e){h=e};this.getDroppable=function(){return h};this.setResizable=function(e){p=e};this.getResizable=function(){return p}};E.QingGridIntegration=new w;var J,P;(function(){w=E.QingGridIntegration;
var q=com.kingdee.bos.qing.ui.grid.model;P=q.QingGridUiData;q=com.kingdee.bos.qing.ui.grid.util;J=q.QingGridUtil})();B.init=function(q){q.qingGridElement||(q.qingGridElement=new B(q));return q.qingGridElement}})();(function(){function C(D){var B=this,w=D.getNodes()||[],E=[],J=[],P=D.getFunOnChange(),q=D.getColumn()||15,l=D.getMaxRow(),h,p=b.isNullOrUndefined(D.getFloat())?!0:D.getFloat(),e=p;this.save=function(a){Q(!0);for(var d=[],n=0;n<w.length;n++){var v=w[n],m=v.toWidgetJsonObject();a&&(m.el=v.getEl());d.push(m)}return d};this.batchUpdate=function(a){!!h!==a&&((h=a)?(e=p,p=!0,B.saveInitial()):(p=e,e=null,A()))};this.saveInitial=function(){for(var a=0;a<w.length;a++){var d=w[a],n=b.getPositionFromTarget(d);
d.setOrigPosition(n);d.setDirty(null)}};this.restoreInitial=function(){for(var a=0;a<w.length;a++){var d=w[a];b.samePos(d,d.getOrigPosition())||(b.setPositionToTarget(d,d.getOrigPosition()),d.setDirty(!0))}A()};this.collide=function(a,d,n){a=a&&a.getId();n=n&&n.getId();for(var v=0;v<w.length;v++){var m=w[v];if(m.getId()!==a&&m.getId()!==n&&b.isIntercepted(m,d))return m}};this.collideAll=function(a,d,n){a=a&&a.getId();n=n&&n.getId();for(var v=[],m=0;m<w.length;m++){var O=w[m];O.getId()!==a&&O.getId()!==
n&&b.isIntercepted(O,d)&&v.push(O)}return v};var A=function(a){!h&&P&&(a=(a||[]).concat(B.getDirtyNodes()),P(a))},Q=function(a){w=b.sort(w,a,q)},G=function(){if(!h){Q(!0);for(var a=0;a<w.length;a++)for(var d=w[a];0<d.getY();){var n=0===a?0:d.getY()-1,v=b.getPositionFromTarget(d);v.setY(n);if(0!==a&&B.collide(d,v))break;d.getY()!==n&&d.setDirty(!0);d.setY(n)}}};this.cleanNodes=function(){if(!h)for(var a=0;a<w.length;a++){var d=w[a];d.setDirty(null);d.setLastTried(null)}};this.beginUpdate=function(a){a.getUpdating()||
(a.setUpdating(!0),h||B.saveInitial())};this.endUpdate=function(){for(var a,d=0;d<w.length;d++)w[d].getUpdating()&&(a=w[d]);a&&a.setUpdating(null)};this.prepareNode=function(a,d){b.isNullOrUndefined(a.getId())&&a.setId(C._idSeq++);(b.isNullOrUndefined(a.getX())||isNaN(a.getX())||b.isNullOrUndefined(a.getY())||isNaN(a.getY()))&&a.setAutoPosition(!0);var n=b.createPosition(0,0,1,1);b.setDefaultsPositionToTarget(a,n);b.sanitizeMinMax(a);isNaN(a.getW())&&a.setW(n.getW());isNaN(a.getH())&&a.setH(n.getH());
B.nodeBoundFix(a,d);return a};this.nodeBoundFix=function(a,d){var n=a.getOrigPosition()||b.getPositionFromTarget(a);a.getMaxW()&&a.setW(Math.min(a.getW(),a.getMaxW()));a.getMinW()&&a.getMinW()<=q&&a.setW(Math.max(a.getW(),a.getMinW()));a.getMaxH()&&a.setH(Math.min(a.getH(),a.getMaxH()));a.getMinH()&&a.setH(Math.max(a.getH(),a.getMinH()));a.getW()>q?a.setW(q):1>a.getW()&&a.setW(1);l&&a.getH()>l?a.setH(l):1>a.getH()&&a.setH(1);0>a.getX()&&a.setX(0);0>a.getY()&&a.setY(0);a.getX()+a.getW()>q&&(d?a.setW(q-
a.getX()):a.setX(q-a.getW()));l&&a.getY()+a.getH()>l&&(d?a.setH(l-a.getY()):a.setY(l-a.getH()));b.samePos(a,n)||a.setDirty(!0)};this.addNode=function(a,d){for(var n=!1,v=0;v<w.length;v++)w[v].getId()===a.getId()&&(n=!0);if(n)return n;B.prepareNode(a);a.setTemporaryRemoved(null);a.setRemoveDOM(null);var m;if(n=a.getAutoPosition()){n=w;v=!1;for(var O=0;!v;++O){var H=O%q,M=Math.floor(O/q);if(!(H+a.getW()>q)){for(var S=b.createPosition(H,M,a.getW(),a.getH()),T=!1,r=0;r<n.length;r++)b.isIntercepted(S,
n[r])&&(T=!0);T||(a.getX()===H&&a.getY()===M||a.setDirty(!0),a.setX(H),a.setY(M),a.setAutoPosition(null),v=!0)}}n=v}n&&(m=!0);w.push(a);d&&E.push(a);m||x(a);h||(G(),A());return a};this.removeNode=function(a,d,n){b.isNullOrUndefined(d)&&(d=!0);for(var v,m=0;m<w.length;m++)w[m].getId()===a.getId()&&(v=w[m]);if(v){n&&J.push(a);d&&a.setRemoveDOM(!0);d=[];for(m=0;m<w.length;m++)w[m].getId()!==a.getId()&&d.push(w[m]);w=d;G();A([a])}};this.getNodeCount=function(){return w.length};var F=function(a,d){function n(){var m=
d.getX(),O=d.getY();d.setX(a.getX());d.setY(a.getY());a.getH()!==d.getH()?(a.setX(m),a.setY(d.getY()+d.getH())):(a.getW()!==d.getW()?a.setX(d.getX()+d.getW()):a.setX(m),a.setY(O));a.setDirty(!0);d.setDirty(!0);return!0}if(!a||!d)return!1;if(a.getW()===d.getW()&&a.getH()===d.getH()&&(a.getX()===d.getX()||a.getY()===d.getY()))return n();if(a.getW()===d.getW()&&a.getX()===d.getX()){if(d.getY()<a.getY()){var v=a;a=d;d=v}return n()}return a.getH()===d.getH()&&a.getY()===d.getY()?(d.getX()<a.getX()&&(v=
a,a=d,d=v),n()):!1};this.cacheRects=function(a,d,n,v,m,O){for(var H=0;H<w.length;H++){var M=w[H],S=M.getX()*a+O,T=M.getY()*d+n,r=M.getW()*a-O-v,V=M.getH()*d-n-m;S=b.createPosition(S,T,r,V);M.setRectPosition(S)}};this.cleanupNode=function(a){a.clean()};this.moveNodeCheck=function(a,d){b.isNullOrUndefined(d.getW())&&d.setW(a.getW());b.isNullOrUndefined(d.getH())&&d.setH(a.getH());if(a.getX()!==d.getX()||a.getY()!==d.getY())var n=!0;else a.getMaxW()&&d.setW(Math.min(d.getW(),a.getMaxW())),a.getMaxH()&&
d.setH(Math.min(d.getH(),a.getMaxH())),a.getMinW()&&d.setW(Math.max(d.getW(),a.getMinW())),a.getMinH()&&d.setH(Math.max(d.getH(),a.getMinH())),n=a.getW()!==d.getW()||a.getH()!==d.getH()?!0:!1;if(!n)return!1;d.setPack(!0);var v,m=[];for(n=0;n<w.length;n++){var O=b.clone(w[n]);O.getId()===a.getId()&&(v=O);m.push(O)}n=new k;n.setColumn(q);n.setFloat(p);n.setNodes(m);n=new C(n);if(!v)return!1;v=n.moveNode(v,d)&&n.getRow()<=l;if(!v&&!d.getResizing()&&d.getCollide()&&(d=d.getCollide().getEl().qingGridNode,
F(a,d)))return A(),!0;if(!v)return!1;a=n.getNodes();for(n=0;n<a.length;n++)if(a[n].getDirty()){var H;for(d=0;d<w.length;d++)w[d].getId()===a[n].getId()&&(H=w[d]);H&&(b.setPositionToTarget(H,a[n]),H.setDirty(!0))}A();return!0};this.willItFit=function(a){a.setWillFitPos(null);if(!l)return!0;for(var d=[],n=0;n<w.length;n++){var v=b.clone(w[n]);d.push(v)}v=new k;v.setColumn(q);v.setFloat(p);v.setNodes(d);d=new C(v);v=b.clone(a);B.cleanupNode(v);v.setEl(null);v.setContent(null);v.setGrid(null);d.addNode(v);
return d.getRow()<=l?(a.setWillFitPos(b.getPositionFromTarget(v)),!0):!1};this.moveNode=function(a,d){if(!a||!d)return!1;if(void 0===d.getPack()&&!h){d.setPack(!0);var n=!0}"number"!==typeof d.getX()&&d.setX(a.getX());"number"!==typeof d.getY()&&d.setY(a.getY());"number"!==typeof d.getW()&&d.setW(a.getW());"number"!==typeof d.getH()&&d.setH(a.getH());var v=a.getW()!==d.getW()||a.getH()!==d.getH(),m=b.clone(a);b.setPositionToTarget(m,d);B.nodeBoundFix(m,v);b.setPositionToTarget(d,m);if(b.samePos(a,
d))return!1;v=b.getPositionFromTarget(a);var O=B.collideAll(a,m,d.getSkip()),H=!0;if(O.length){if(a.getMoving()&&!d.getNested())a:if(d.getMoveRect()&&a.getRectPosition()){H=a.getRectPosition();var M=b.getPositionFromTarget(d.getMoveRect());M.getY()>H.getY()?(M.setH(M.getH()+M.getY()-H.getY()),M.setY(H.getY())):M.setH(M.getH()+H.getY()-M.getY());M.getX()>H.getX()?(M.setW(M.getW()+M.getX()-H.getX()),M.setX(H.getX())):M.setW(M.getW()+H.getX()-M.getX());for(var S=.5,T=0;T<O.length;T++){var r=O[T];if(!r.getRectPosition()){var V=
void 0;break a}var z=r.getRectPosition(),y=Number.MAX_VALUE,I=Number.MAX_VALUE;H.getY()<z.getY()?y=(M.getY()+M.getH()-z.getY())/z.getH():H.getY()+H.getH()>z.getY()+z.getH()&&(y=(z.getY()+z.getH()-M.getY())/z.getH());H.getX()<z.getX()?I=(M.getX()+M.getW()-z.getX())/z.getW():H.getX()+H.getW()>z.getX()+z.getW()&&(I=(z.getX()+z.getW()-M.getX())/z.getW());z=Math.min(I,y);z>S&&(S=z,V=r)}d.setCollide(V)}else V=void 0;else V=O[0];V?H=!x(a,m,V,d):(H=!1,n&&d.setPack(null))}H&&(a.setDirty(!0),b.setPositionToTarget(a,
m));d.getPack()&&(G(),A());return!b.samePos(a,v)};var x=function(a,d,n,v){b.isNullOrUndefined(d)&&(d=a);b.isNullOrUndefined(v)&&(v=new u);Q(!1);n=n||B.collide(a,d);if(!n)return!1;if(a.getMoving()&&!p&&!v.getNested()&&F(a,n))return!0;var m=!1,O=new u;O.setNested(!0);for(O.setPack(!1);n=n||B.collide(a,d,v.getSkip());){var H=b.getPositionFromTarget(n);H.setY(a.getY());H=B.collide(n,H,a);var M=b.getPositionFromTarget(n);M.setY(d.getY()-n.getH());M=B.collide(n,M,a);if(!(a.getMoving()&&!a.getSkipDown()&&
d.getY()>a.getY())||p||H&&M)H=n.getX(),M=d.getY()+d.getH(),S=n.getW(),T=n.getH(),O.setPosition(H,M,S,T),O.setSkip(a),H=B.moveNode(n,O);else{a.setSkipDown(a.getSkipDown()||d.getY()>a.getY());H=d.getX();M=n.getY()+n.getH();var S=d.getW(),T=d.getH();O.setPosition(H,M,S,T);(H=B.moveNode(a,O))&&v.getPack()&&(G(),d.setY(n.getY()+n.getH()),b.setPositionToTarget(a,d));m=m||H}if(!H)break;n=void 0}return m};this.getRow=function(){for(var a=0,d=0;d<w.length;d++){var n=w[d].getY()+w[d].getH();n>a&&(a=n)}return a};
this.getDirtyNodes=function(a){for(var d=[],n=0;n<w.length;n++){var v=w[n];a?v.getDirty()&&!b.samePos(v,v.getOrigPosition())&&d.push(v):v.getDirty()&&d.push(v)}return d};this.getNodes=function(){return w};this.getAddedNodes=function(){return E};this.getRemovedNodes=function(){return J};this.resetAddedNodes=function(){E=[]};this.resetRemovedNodes=function(){J=[]};this.getBatchMode=function(){return h}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==
typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.ui&&(com.kingdee.bos.qing.ui={});"undefined"==typeof com.kingdee.bos.qing.ui.grid&&(com.kingdee.bos.qing.ui.grid={});"undefined"==typeof com.kingdee.bos.qing.ui.grid.engine&&(com.kingdee.bos.qing.ui.grid.engine={});com.kingdee.bos.qing.ui.grid.engine.QingGridEngine=C;var b,k,u;(function(){var D=com.kingdee.bos.qing.ui.grid.util;b=D.QingGridUtil;
D=com.kingdee.bos.qing.ui.grid.model;k=D.QingGridEngineOptions;u=D.QingGridMoveOpt})();C._idSeq=0})();(function(){function C(e,A){function Q(c){for(var g=0,f=F.getNodes(),t=0;t<f.length;t++)g=Math.max(g,f[t].y+f[t].h);for(t=0;t<c.length;t++){f=c[t];var L=f.getEl();if(!L)return;f.getRemoveDOM()?(L&&$(L).remove(),f.setRemoveDOM(null)):Y(L,c[t])}ja(!1,g)}var G=this,F,x=e,a=A||{},d={},n=0,v,m,O,H,M,S,T=function(){if(!O){var c=$("<div>");c.addClass(a.getWidgetPlaceholderClass());c.addClass(a.getWidgetItemClass());var g=$("<div>");g.addClass("placeholder-content");g.appendTo(c);O=c[0]}return O};this.destroy=
function(){x&&(G.offAll(),ma(!1),W(!1),v&&(b.removeStylesheet(m),v=null),F=O=a=null,x=x.qingGrid=null,$(x).remove())};this.load=function(c,g){g?ia(!0):da(!0);for(var f=0;f<c.length;f++){var t=new h;t.fromJsonObject(c[f]);G.addWidget(t)}g?ia(!1):da(!1)};this.loadOne=function(c){var g=new h;g.fromJsonObject(c);return G.addWidget(g)};this.save=function(){return F.save(!1)};this.getCellHeight=function(){return a.getCellHeight()};this.cellHeight=function(c,g){if(null===g||void 0===g)g=!0;if(void 0===c||
null===c)c=-a.getMarginRight()-a.getMarginLeft()+a.getMarginTop()+a.getMarginBottom(),c=G.getCellWidth()+c,c*=a.getCellScale();c=b.parseHeight(c);if(a.getCellHeight()===c||"fixed"===a.getCellHeightMode()&&a.getCellHeight())return!1;a.setCellHeight(c);g&&ja(!0)};this.getCellWidth=function(){return(x.clientWidth||x.parentElement.clientWidth||window.innerWidth)/a.getColumn()};this.getRow=function(){return Math.max(F.getRow(),a.getMinRow())};this.createDraggingHelper=function(c){var g=D.getDraggable();
if(g){var f=g.getEl(),t=f.qingGridNode;t.setTemporaryStopDrag(!0);c=c(t.getId(),f);g.createNewHelper(c);F.restoreInitial();$(O).hide()}};this.resetDraggingHelper=function(){var c=D.getDraggable();c&&(c.resetHelper(),c.getEl().qingGridNode.setTemporaryStopDrag(null),$(O).show())};this.removeDraggingHelper=function(){var c=D.getDraggable();c&&(c.removeHelper(),c.getEl().qingGridNode.setTemporaryStopDrag(null))};this.on=function(c,g){-1!==$.inArray(c,["change","added","removed","enable","disable"])&&
(d[c]="enable"===c||"disable"===c?function(f){g(f)}:function(f,t){g(f,t)});-1!==$.inArray(c,"drag dragStart dragStop resizeStart resize resizeStop dropped dropOver dropOut cellResize".split(" "))&&(d[c]=g)};this.off=function(c){-1!==$.inArray(c,["change","added","removed","enable","disable"])&&d[c]&&x.removeEventListener(c,d[c]);delete d[c]};this.offAll=function(){for(var c in d)G.off(c)};var r=function(){if(!F.getBatchMode()){var c=F.getDirtyNodes(!0);c&&c.length&&y("change",c);F.cleanNodes()}},
V=function(){if(!F.getBatchMode()){var c=F.getAddedNodes();if(c&&c.length){for(var g=0;g<c.length;g++)c[g].setDirty(null);y("added",c);F.resetAddedNodes()}}},z=function(){if(!F.getBatchMode()){var c=F.getRemovedNodes();c&&c.length&&(y("removed",c),F.resetRemovedNodes())}},y=function(c,g){var f=d[c];f&&f(c,g)};this.disable=function(){I(!1);R(!1);y("disable")};this.enable=function(){I(!0);R(!0);y("enable")};var I=function(c){c?a.setDisableDrag(!1):a.setDisableDrag(!0);c=F.getNodes();for(var g=0;g<c.length;g++)ka(c[g])},
R=function(c){c?a.setDisableResize(!1):a.setDisableResize(!0);c=F.getNodes();for(var g=0;g<c.length;g++)ka(c[g])},W=function(c){c?(M=b.throttle(function(){if(x)if(x&&0===x.clientWidth)S=0;else if(S!==x.clientWidth&&(S=x.clientWidth,da(!0),G.cellHeight()||ja(!0),da(!1),d.cellResize)){var g=G.getCellWidth(),f=G.getCellHeight();d.cellResize(x,g,f)}},100),H||("function"==typeof window.ResizeObserver&&(H=new ResizeObserver(function(){M()}),H.observe(x)),$(x).on("resize",M))):H&&(H.disconnect(),M=H=null)},
Y=function(c,g){b.isNullOrUndefined(g.getX())||c.setAttribute("gs-x",String(g.getX()));b.isNullOrUndefined(g.getY())||c.setAttribute("gs-y",String(g.getY()));1<g.getW()?c.setAttribute("gs-w",String(g.getW())):c.removeAttribute("gs-w");1<g.getH()?c.setAttribute("gs-h",String(g.getH())):c.removeAttribute("gs-h")},aa=function(c,g){g&&(Y(c,g),c.setAttribute("gs-id",String(g.getId())))},ba=function(c,g){if(null===g||void 0===g)g=!0;var f=new h;f.setX(b.toNumber(c.getAttribute("gs-x")));f.setY(b.toNumber(c.getAttribute("gs-y")));
f.setW(b.toNumber(c.getAttribute("gs-w")));f.setH(b.toNumber(c.getAttribute("gs-h")));f.setId(c.getAttribute("gs-id"));f.setMaxW(b.toNumber(c.getAttribute("gs-max-w")));f.setMinW(b.toNumber(c.getAttribute("gs-min-w")));f.setMaxH(b.toNumber(c.getAttribute("gs-max-h")));f.setMinH(b.toNumber(c.getAttribute("gs-min-h")));g&&(1===f.getW()&&c.removeAttribute("gs-w"),1===f.getH()&&c.removeAttribute("gs-h"),f.getMaxW()&&c.removeAttribute("gs-max-w"),f.getMinW()&&c.removeAttribute("gs-min-w"),f.getMaxH()&&
c.removeAttribute("gs-max-h"),f.getMinH()&&c.removeAttribute("gs-min-h"));return f},da=function(c){F.batchUpdate(c);c||(ca(),z(),V(),r())},ia=function(c){F.batchUpdate(c);c||(ca(),F.resetRemovedNodes(),F.resetAddedNodes(),F.saveInitial())},ma=function(c){c?$(x).addClass("qing-grid-animate"):$(x).removeClass("qing-grid-animate")},ja=function(c,g){c&&v&&(b.removeStylesheet(m),v=null);g||(g=G.getRow());ca();if(0!==a.getCellHeight()){c=a.getCellHeight();var f="."+m+" > ."+a.getWidgetItemClass();if(!v){v=
b.createStylesheet(m,x.parentNode);if(!v)return;v._max=0;var t=a.getMarginTop(),L=a.getMarginBottom(),N=a.getMarginRight(),K=a.getMarginLeft();t="top:"+t+"px;right:"+N+"px;bottom:"+L+"px;left:"+K+"px;";L=f+"> .qing-grid-item-content";var U="."+m+" > .qing-grid-placeholder > .placeholder-content";b.addCSSRule(v,f,"height: "+c+"px");b.addCSSRule(v,L,t);b.addCSSRule(v,U,t);b.addCSSRule(v,f+" > .ui-draggable-handle","left: "+K+"px; right: "+N+"px; top: "+(a.getMarginTop()-10)+"px");t=a.getMarginTop()+
2;L=a.getMarginBottom()+2;N=a.getMarginRight()+2;K=a.getMarginLeft()+2;b.addCSSRule(v,f+" > .ui-resizable-n","top: "+t+"px");b.addCSSRule(v,f+" > .ui-resizable-s","bottom: "+L+"px");b.addCSSRule(v,f+" > .ui-resizable-e","right: "+N+"px");b.addCSSRule(v,f+" > .ui-resizable-w","left: "+K+"px");b.addCSSRule(v,f+" > .ui-resizable-ne","right: "+N+"px; top: "+t+"px");b.addCSSRule(v,f+" > .ui-resizable-se","right: "+N+"px; bottom: "+L+"px");b.addCSSRule(v,f+" > .ui-resizable-nw","left: "+K+"px; top: "+t+
"px");b.addCSSRule(v,f+" > .ui-resizable-sw","left: "+K+"px; bottom: "+L+"px")}g=g||v._max;if(g>v._max){for(N=v._max+1;N<=g;N++)b.addCSSRule(v,f+"[gs-y='"+N+"']","top:"+c*N+"px"),b.addCSSRule(v,f+"[gs-h='"+(N+1)+"']","height:"+c*(N+1)+"px");v._max=g}}},ca=function(){if(F&&!F.getBatchMode()){var c=G.getCellHeight();if(c){var g=G.getRow()+n,f=$(x).css("minHeight");f=b.parseHeight(f);0<f&&(f=Math.floor(f/c),g<f&&(g=f));$(x).attr("gs-current-row",String(g));$(x).css("height","");$(x).css("min-height",
g*c+"px")}}};this.willItFit=function(c){return F.willItFit(c)};this.getWidgetCount=function(){return F.getNodeCount()};this.addWidget=function(c){var g=$("<div>");g.addClass("qing-grid-item-content");g.html(c.getContent()||"");var f=$("<div>");f.addClass("qing-grid-item");f.append(g);g=f[0];c=b.clone(c);c=F.prepareNode(c);aa(g,c);var t=b.getPositionFromTarget(c);$(g).addClass(a.getWidgetItemClass());c=(g.qingGridNode=c)||ba(g);c.setEl(g);c.setGrid(G);c=F.addNode(c,!0);b.same(c,t)||aa(g,c);ka(c);ca();
V();r();$(x).append(f);return g};this.updateWidget=function(c,g){for(var f=null,t=F.getNodes(),L=0;L<t.length;L++)t[L].getId()===c&&(f=t[L]);(c=g.content)?(f=$(f.getEl()).find("."+a.getWidgetItemClass()+"-content"),f.children().remove(),f.append(c)):(c=g.name)?f.setName(c):(c=g.displayName)?f.setDisplayName(c):(g=g.id)&&f.setId(g)};this.removeWidgetById=function(c){for(var g=null,f=F.getNodes(),t=0;t<f.length;t++)if(f[t].getId()===c){g=f[t];break}return g?G.removeWidget(g,!0,!0):!1};this.removeWidget=
function(c,g,f){if(null===f||void 0===f)f=!0;if(!c||!c.getId())return!1;for(var t=null,L=F.getNodes(),N=0;N<L.length;N++)L[N].getId()===c.getId()&&(t=L[N]);if(!t)return!1;la(t.getEl());F.removeNode(t,g,f);g&&t.getEl().parentElement&&t.getEl().remove();f&&(z(),r());return!0};var ka=function(c){var g=c.getEl(),f=a.getDisableDrag(),t=a.getDisableResize();if(f&&t)c.getInitDD()&&(la(g),c.setInitDD(null)),$(g).addClass("ui-draggable-disabled"),$(g).addClass("ui-resizable-disabled");else{if(!c.getInitDD()){f=
function(K,U){if(d[K.type])d[K.type](K,K.target);na(g,K,U,c)};t=function(K,U){oa(g,K,U,c)};var L=function(K){$(O).remove();O=null;c.setMoving(null);c.setLastTried(null);var U=K.target;if(U.qingGridNode){c.setEl(U);b.removePositioningStyles(U);c.getTemporaryRemoved()?(b.setPositionToTarget(c,c.getOrigPosition()),Y(U,c),F.addNode(c)):Y(U,c);if(d[K.type])d[K.type](K,U);n=0;ca();r();F.endUpdate()}},N=new w;N.setAppendTo("body");N.setDragCancelClass(a.getWidgetDragCancelClass());N.setDragHandleAutoHide(a.getWidgetDragHandleAutoHide());
N.setShowDragHandle(!a.getWidgetDragHandleHide());N.setFunDragStart(f);N.setFunDragging(t);N.setFunDragStop(L);u.draggable(g,N);N=new E;N.setResizeHandleAutoHide(a.getWidgetResizeHandleAutoHide());N.setResizeHandles(a.getWidgetResizeHandles());N.setFunResizeStart(f);N.setFunResizeStop(L);N.setFunResizing(t);u.resizable(g,N);c.setInitDD(!0)}u.draggable(g,"enable");u.resizable(g,"enable");return this}},la=function(c){u.draggable(c,"destroy");u.resizable(c,"destroy");c.qingGridNode&&c.qingGridNode.setInitDD(null);
delete c.qingGridElement;return this};this.setupDragIn=function(c,g,f){f||(f=document);if((c="string"===typeof c?b.getElements(c,f):c)&&c.length)for(f=0;f<c.length;f++)u.draggable(c[f],"destroy"),u.dragIn(c[f],g)};var qa=function(c){var g=c.qingGridNode;if(g&&g.getGrid()===G)return!0;var f=a.getFunAcceptWidget();if(!f)return!1;(c=f(c))&&g&&a.getMaxRow()&&(c=new h,c.setW(g.getW()),c.setH(g.getH()),c.setMinW(g.getMinW()),c.setMinH(g.getMinH()),c=F.willItFit(c));return c},ra=function(c,g){var f=D.getDraggable(),
t=f?f.getEl():c.target,L=f?f.getHelper():null;f=t.qingGridNode;if(!f||f.getGrid()!==G||f.getTemporaryRemoved()){f||(f=ba(t,!1));f.getGrid()||(f.setExternal(!0),t.qingGridNode=f);L=L||t;var N=f.getW()||Math.round(L.offsetWidth/G.getCellWidth())||1;L=f.getH()||Math.round(L.offsetHeight/G.getCellHeight())||1;f.setW(N);f.setH(L);f.setTemporaryRemoved(!0);if(d[c.type])d[c.type](c,t);u.on(t,"drag",pa);pa(c,g)}},sa=function(c,g){var f=D.getDraggable();g=f?f.getEl():c.target;f=f?f.getHelper():null;var t=
g.qingGridNode;if(t){if(!t.getGrid()||t.getGrid()===G){u.off(g,"drag");if(t.getTemporaryRemoved())return;t.setTemporaryRemoved(!0);F.removeNode(t);t.setEl(t.getExternal()&&f?f:g);t.getExternal()&&(t.setEl(null),delete g.qingGridNode,F.restoreInitial())}if(d[c.type])d[c.type](c,g)}},ta=function(c,g){var f=D.getDraggable();g=f?f.getEl():c.target;f=f?f.getHelper():null;var t=T(),L=g.qingGridNode;if((!L||L.getGrid()!==G||L.getExternal())&&L){var N=!!t.parentElement;$(O).remove();O=null;N&&(F.cleanupNode(L),
L.setGrid(G));u.off(g,"drag");f!==g?($(f).remove(),g.qingGridNode=void 0,N&&(g=g.cloneNode(!0))):($(g).remove(),la(g));N&&(g.qingGridNode=L,L.setEl(g),b.setPositionToTarget(L,ba(t)),b.removePositioningStyles(g),aa(g,L),$(g).addClass(a.getWidgetItemClass()),$(g).appendTo(x),ka(L),ca(),F.getAddedNodes().push(L),V(),r(),F.endUpdate(),d.dropped&&d.dropped(c,L))}},pa=function(c,g){var f=D.getDraggable(),t=f?f.getEl():c.target;f=f?f.getHelper():null;var L=G.getCellHeight(),N=G.getCellWidth(),K=t.qingGridNode;
if(K){f=f||t;g=x.getBoundingClientRect();var U=f.getBoundingClientRect().top,Z=f.getBoundingClientRect().left;Z-=g.left;U-=g.top;g=new q;g.setPosition(Z,U);if(K.getTemporaryRemoved()){K.setX(Math.max(0,Math.round(Z/N)));K.setY(Math.max(0,Math.round(U/L)));K.setAutoPosition(null);F.nodeBoundFix(K);if(!F.willItFit(K)){K.setAutoPosition(!0);if(!F.willItFit(K)){u.off(t,"drag");return}K.getWillFitPos()&&(b.setPositionToTarget(K,K.getWillFitPos()),K.setWillFitPos(null))}na(f,c,g,K)}else oa(f,c,g,K)}};this.setupDroppable=
function(c,g,f){f||(f=document);c="string"===typeof c?b.getElement(c,f):c;u.isDroppable(c)||u.droppable(c,g)};var na=function(c,g,f,t){var L=G.getCellWidth(),N=G.getCellHeight();F.cleanNodes();F.beginUpdate(t);var K=T();Y(K,t);$(x).append(K);t.getExternal()&&t.getY()&&setTimeout(function(){var U=t.getY()*G.getCellHeight(),Z=b.getScrollElement(x);$(Z).animate({scrollTop:U},500)},200);t.setEl(K);t.setLastUiPosition(f.getPosition());t.setMoving("dragStart"===g.type);t.setLastTried(null);"dropOver"===
g.type&&t.getTemporaryRemoved()&&(F.addNode(t),t.setMoving(!0));F.cacheRects(L,N,a.getMarginTop(),a.getMarginRight(),a.getMarginBottom(),a.getMarginLeft());"resizeStart"===g.type&&(u.resizable(c,"option","minWidth",L*(t.getMinW()||1)),u.resizable(c,"option","minHeight",N*(t.getMinH()||1)),t.getMaxW()&&u.resizable(c,"option","maxWidth",L*t.getMaxW()),t.getMaxH()&&u.resizable(c,"option","maxHeight",N*t.getMaxH()))},oa=function(c,g,f,t){var L=G.getCellWidth(),N=G.getCellHeight(),K=new l;t.getOrigPosition()&&
(K=b.getPositionFromTarget(t.getOrigPosition()));var U=Math.round(.1*N),Z=Math.round(.1*L),ea=Math.min(a.getMarginLeft(),Z);Z=Math.min(a.getMarginRight(),Z);var fa=Math.min(a.getMarginTop(),U);U=Math.min(a.getMarginBottom(),U);if("drag"===g.type){if(t.getTemporaryRemoved())return;if(t.getTemporaryStopDrag()){g=g.target;b.setPositionToTarget(t,t.getOrigPosition());Y(g,t);return}c=f.getLeft()+(f.getLeft()>t.getLastUiPosition().left?-Z:ea);var X=f.getTop()+(f.getTop()>t.getLastUiPosition().top?-U:fa);
K.setX(Math.round(c/L));K.setY(Math.round(X/N));c=n;if(F.collide(t,K)){X=F.getRow();var ha=Math.max(0,K.getY()+t.getH()-X);a.getMaxRow()&&X+ha>a.getMaxRow()&&(ha=Math.max(0,a.getMaxRow()-X));n=ha}else n=0;n!==c&&ca();if(t.getX()===K.getX()&&t.getY()===K.getY())return}else if("resize"===g.type){if(0>K.getX())return;b.updateScrollResize(g,c,N);K.setW(Math.round((f.getWidth()-ea)/L));K.setH(Math.round((f.getHeight()-fa)/N));if(t.getW()===K.getW()&&t.getH()===K.getH()||t.getLastTried()&&t.getLastTried().getW()===
K.getW()&&t.getLastTried().getH()===K.getH())return;c=f.getLeft()+ea;X=f.getTop()+fa;K.setX(Math.round(c/L));K.setY(Math.round(X/N));var ua=!0}t.setLastTried(K);c=f.getLeft()+ea;X=f.getTop()+fa;ha=(f.getWidth()?f.getWidth():t.getW()*L)-ea-Z;var va=(f.getHeight()?f.getHeight():t.getH()*N)-fa-U;c=new b.createPosition(c,X,ha,va);X=new p;X.setPosition(K.getX(),K.getY(),K.getW(),K.getH());X.setMoveRect(c);X.setResizing(ua);if(F.moveNodeCheck(t,X)&&(t.setLastUiPosition(f.getPosition()),F.cacheRects(L,N,
fa,Z,U,ea),t.setSkipDown(null),n=0,ca(),f=g.target,Y(f,t),d[g.type]))d[g.type](g,f)};this.getOpts=function(){return a};this.getEl=function(){return x};(function(){a=A;m="gs-id-0";$(x).addClass(m);$(x).addClass("qing-grid");$(x).addClass("gs-"+a.getColumn());var c=new P;c.setColumn(a.getColumn());c.setFloat(a.getFloat());c.setMaxRow(a.getMaxRow());c.setFunOnChange(Q);F=new k(c);G.cellHeight(a.getCellHeight(),!1);W(!0);ma(!0);ja();c=new J;c.setAccept(qa);c.setExcludeClass(a.getWidgetItemClass());c.setFunDropOver(ra);
c.setFunDropOut(sa);c.setFunDropped(ta);u.droppable(x,c)})()}"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.ui&&(com.kingdee.bos.qing.ui={});"undefined"==typeof com.kingdee.bos.qing.ui.grid&&(com.kingdee.bos.qing.ui.grid={});com.kingdee.bos.qing.ui.grid.QingGridFramework=C;var b,k,u,D,B,w,E,J,P,q,
l,h,p;(function(){var e=com.kingdee.bos.qing.ui.grid.util;b=e.QingGridUtil;e=com.kingdee.bos.qing.ui.grid.core;u=e.QingGridIntegration;D=e.QingGridManager;e=com.kingdee.bos.qing.ui.grid.engine;k=e.QingGridEngine;e=com.kingdee.bos.qing.ui.grid.model;B=e.QingGridOptions;w=e.QingGridDraggableOptions;E=e.QingGridResizableOptions;J=e.QingGridDroppableOptions;P=e.QingGridEngineOptions;q=e.QingGridUiData;l=e.QingGridPosition;h=e.QingGridNode;p=e.QingGridMoveOpt})();C.init=function(e){D.setDroppable(null);
D.setResizable(null);D.setDraggable(null);e=b.defaults(e,B.DEFAULT_JSON_OBJECT);var A=new B;A.fromJsonObject(e);e=A.getGridClass();var Q=A.getGridParentClass();e||(e=".qing-grid");e=b.getElement(e,Q);if(!e)return null;e.qingGrid||(e.qingGrid=new C(e,A));return e.qingGrid}})();
//qingVersionTag: 20250415