!function(){functiont(e){returnt="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},t(e)}functione(t,e){returnfunction(t){if(Array.isArray(t))returnt}(t)||function(t,e){varr=null==t?null:"undefined"!=typeofSymbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){varn,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}elsefor(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(s){l=!0,o=s}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throwo}}returnc}}(t,e)||p(t,e)||function(){thrownewTypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functionr(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r=function(){returne};vare={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeofSymbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";functions(t,e,r){returnObject.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(L){s=function(t,e,r){returnt[e]=r}}functionf(t,e,r,n){varo=e&&e.prototypeinstanceofd?e:d,a=Object.create(o.prototype),c=newE(n||[]);returni(a,"_invoke",{value:S(t,r,c)}),a}functionh(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=f;varp={};functiond(){}functiong(){}functionv(){}vary={};s(y,c,(function(){returnthis}));varm=Object.getPrototypeOf,b=m&&m(m(k([])));b&&b!==n&&o.call(b,c)&&(y=b);varw=v.prototype=d.prototype=Object.create(y);functionP(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){returnthis._invoke(e,t)}))}))}functionO(e,r){functionn(i,a,c,u){varl=h(e[i],e,a);if("throw"!==l.type){vars=l.arg,f=s.value;returnf&&"object"==t(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){returnn("throw",t,c,u)}))}u(l.arg)}vara;i(this,"_invoke",{value:function(t,e){functiono(){returnnewr((function(r,o){n(t,e,r,o)}))}returna=a?a.then(o,o):o()}})}functionS(t,e,r){varn="suspendedStart";returnfunction(o,i){if("executing"===n)thrownewError("Generator is already running");if("completed"===n){if("throw"===o)throwi;returnx()}for(r.method=o,r.arg=i;;){vara=r.delegate;if(a){varc=C(a,r);if(c){if(c===p)continue;returnc}}if("next"===r.method)r.sent=r._sent=r.arg;elseif("throw"===r.method){if("suspendedStart"===n)thrown="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";varu=h(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}functionC(t,e){varr=e.method,n=t.iterator[r];if(void0===n)returne.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void0,C(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=newTypeError("The iterator does not provide a '"+r+"' method")),p;varo=h(n,t.iterator,e.arg);if("throw"===o.type)returne.method="throw",e.arg=o.arg,e.delegate=null,p;vari=o.arg;returni?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void0),e.delegate=null,p):i:(e.method="throw",e.arg=newTypeError("iterator result is not an object"),e.delegate=null,p)}functionj(t){vare={tryLoc:t[0]};1int&&(e.catchLoc=t[1]),2int&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}functionR(t){vare=t.completion||{};e.type="normal",deletee.arg,t.completion=e}functionE(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}functionk(t){if(t){vare=t[c];if(e)returne.call(t);if("function"==typeoft.next)returnt;if(!isNaN(t.length)){varr=-1,n=functione(){for(;++r<t.length;)if(o.call(t,r))returne.value=t[r],e.done=!1,e;returne.value=void0,e.done=!0,e};returnn.next=n}}return{next:x}}functionx(){return{value:void0,done:!0}}returng.prototype=v,i(w,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:g,configurable:!0}),g.displayName=s(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){vare="function"==typeoft&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){returnObject.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},P(O.prototype),s(O.prototype,u,(function(){returnthis})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void0===i&&(i=Promise);vara=newO(f(t,r,n,o),i);returne.isGeneratorFunction(r)?a:a.next().then((function(t){returnt.done?t.value:a.next()}))},P(w),s(w,l,"Generator"),s(w,c,(function(){returnthis})),s(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){vare=Object(t),r=[];for(varnine)r.push(n);returnr.reverse(),functiont(){for(;r.length;){varn=r.pop();if(nine)returnt.value=n,t.done=!1,t}returnt.done=!0,t}},e.values=k,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void0,this.done=!1,this.delegate=null,this.method="next",this.arg=void0,this.tryEntries.forEach(R),!t)for(vareinthis)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void0)},stop:function(){this.done=!0;vart=this.tryEntries[0].completion;if("throw"===t.type)throwt.arg;returnthis.rval},dispatchException:function(t){if(this.done)throwt;vare=this;functionr(r,n){returna.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void0),!!n}for(varn=this.tryEntries.length-1;n>=0;--n){vari=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)returnr("end");if(i.tryLoc<=this.prev){varc=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)returnr(i.catchLoc,!0);if(this.prev<i.finallyLoc)returnr(i.finallyLoc)}elseif(c){if(this.prev<i.catchLoc)returnr(i.catchLoc,!0)}else{if(!u)thrownewError("try statement without catch or finally");if(this.prev<i.finallyLoc)returnr(i.finallyLoc)}}}},abrupt:function(t,e){for(varr=this.tryEntries.length-1;r>=0;--r){varn=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){vari=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);vara=i?i.completion:{};returna.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throwt.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.finallyLoc===t)returnthis.complete(r.completion,r.afterLoc),R(r),p}},catch:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.tryLoc===t){varn=r.completion;if("throw"===n.type){varo=n.arg;R(r)}returno}}thrownewError("illegal catch attempt")},delegateYield:function(t,e,r){returnthis.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void0),p}},e}functionn(t,e,r,n,o,i,a){try{varc=t[i](a),u=c.value}catch(l){returnvoidr(l)}c.done?e(u):Promise.resolve(u).then(n,o)}functiono(t){returnfunction(){vare=this,r=arguments;returnnewPromise((function(o,i){vara=t.apply(e,r);functionc(t){n(a,o,i,c,u,"next",t)}functionu(t){n(a,o,i,c,u,"throw",t)}c(void0)}))}}functioni(t,e){returni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){returnt.__proto__=e,t},i(t,e)}functiona(t){vare=function(){if("undefined"==typeofReflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeofProxy)return!0;try{returnBoolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();returnfunction(){varr,n=l(t);if(e){varo=l(this).constructor;r=Reflect.construct(n,arguments,o)}elser=n.apply(this,arguments);returnc(this,r)}}functionc(e,r){if(r&&("object"===t(r)||"function"==typeofr))returnr;if(void0!==r)thrownewTypeError("Derived constructors may only return object or undefined");returnu(e)}functionu(t){if(void0===t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returnt}functionl(t){returnl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){returnt.__proto__||Object.getPrototypeOf(t)},l(t)}functions(t,e){varr=Object.keys(t);if(Object.getOwnPropertySymbols){varn=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){returnObject.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}returnr}functionf(t){for(vare=1;e<arguments.length;e++){varr=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}returnt}functionh(t){returnfunction(t){if(Array.isArray(t))returnd(t)}(t)||function(t){if("undefined"!=typeofSymbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])returnArray.from(t)}(t)||p(t)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functionp(t,e){if(t){if("string"==typeoft)returnd(t,e);varr=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void0}}functiond(t,e){(null==e||e>t.length)&&(e=t.length);for(varr=0,n=newArray(e);r<e;r++)n[r]=t[r];returnn}functiong(t,e){for(varr=0;r<e.length;r++){varn=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}functionv(t,e,r){returne&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}functiony(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functionm(t,e,r){return(e=b(e))int?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}functionb(e){varr=function(e,r){if("object"!==t(e)||null===e)returne;varn=e[Symbol.toPrimitive];if(void0!==n){varo=n.call(e,r||"default");if("object"!==t(o))returno;thrownewTypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===t(r)?r:String(r)}System.register(["@ibiz-template/runtime","@ibiz-template/model","@ibiz-template/vue-util","vue","@ibiz-template/controller"],(function(t,n){"use strict";varc,l,s,p,d,g,b,w,P,O,S,C,j,R,E;return{setters:[function(t){c=t.PluginStaticResource},function(t){l=t.GridModel},function(t){s=t.useNamespace,p=t.useControlController,d=t.usePropsWatch},function(t){g=t.ref,b=t.computed,w=t.defineComponent,P=t.h,O=t.getCurrentInstance,S=t.watch,C=t.onUnmounted},function(t){j=t.GridController,R=t.GridRowController,E=t.GridNotifyState}],execute:function(){vark=newc(n.meta.url),x=v((functiont(){y(this,t),m(this,"component","RfpgGridControl")}));functionL(t,e){varr,n=[];"GROUPGRIDCOLUMN"===t.source.columnType&&t.children.forEach((function(t){n.push(L(t,e))}));varo={title:t.title,width:"STAR"===t.source.widthUnit?void0:t.width,minWidth:t.width,align:(null===(r=t.source.align)||void0===r?void0:r.toLowerCase())||"center",slot:t.codeName,key:t.codeName,fieldName:t.deFieldName,ellipsis:!0,tooltip:!1,resizable:!0,sortable:!(e.noSort||!t.source.enableSort)&&"custom",columnType:t.source.columnType,tree:"pfzbname"===t.id,className:"pfzbname"===t.id?"pfzbname":""};returnn.length>0&&Object.assign(o,{children:n}),o}functionz(t){vare=t.model,r=[],n=e.columns.map((function(e){returnL(e,t)}));returne.children.forEach((function(t){vare=n.find((function(e){returne.key===t.codeName}));e&&"lb"!==t.id&&r.push(e)})),t.singleSelect||r.splice(0,0,{type:"selection",width:60}),r}varN=w({name:"AppGridPagination",props:{total:{type:Number,required:!0},curPage:{type:Number,required:!0},size:{type:Number,required:!0}},setup:function(t){return{ns:s("grid-page"),start:b((function(){return(t.curPage-1)*t.size+1})),end:b((function(){returnt.curPage*t.size}))}},methods:{onPageChange:function(t){this.$emit("change",t)},onPageSizeChange:function(t){this.$emit("page-size-change",t)},pageReset:function(){this.$emit("page-reset")}},render:function(){returnP("div",{class:this.ns.b()},[P("i-page",{attrs:{transfer:!0,total:this.total,"show-sizer":!0,"show-elevator":!0,current:this.curPage,"page-size":this.size,"page-size-opts":[10,20,30,40,50,60,70,80,90,100],"show-total":!0},on:{"on-change":this.onPageChange,"on-page-size-change":this.onPageSizeChange}},[P("span",{class:this.ns.b("btn")},[P("i-button",{attrs:{icon:"md-refresh",title:"刷新"},on:{click:this.pageReset}})]),P("span",["显示 ",this.start," - ",this.end," 条,共 ",this.total," 条数据"])])])}}),G=function(t){!function(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(c,t);vare,n=a(c);functionc(){vart;y(this,c);for(vare=arguments.length,r=newArray(e),o=0;o<e;o++)r[o]=arguments[o];returnm(u(t=n.call.apply(n,[this].concat(r))),"groups",[]),t}returnv(c,[{key:"afterLoad",value:(e=o(r().mark((functiont(e){varn=this;returnr().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnt.next=2,Promise.allSettled(Object.values(this.fieldColumns).map(function(){vart=o(r().mark((functiont(e){returnr().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnt.next=2,e.loadCodeList();case2:case"end":returnt.stop()}}),t)})));returnfunction(e){returnt.apply(this,arguments)}}()));case2:returnthis.rows=e.map((function(t){vare=newR(t,n);returnn.gridStateNotify(e,E.LOAD),e})),this.handleGroup(e),t.abrupt("return",e);case5:case"end":returnt.stop()}}),t,this)}))),function(t){returne.apply(this,arguments)})},{key:"handleGroup",value:function(t){vare=this,r=newMap;t.forEach((function(t){vare=t.lb;r.has(e)||r.set(e,[]),r.has(e)&&r.get(e).push(t)})),this.groups=[],r.forEach((function(t,r){e.groups.push({caption:"".concat(r),key:r,children:t})}))}}]),c}(j);var_=w({props:{modelData:l,context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}},gridRowActiveMode:{type:Number,default:2},modal:{type:Object}},setup:function(t){varr=O().proxy,n=s("grid"),o=function(t,e,r){varn=arguments.length>3&&void0!==arguments[3]?arguments[3]:{};returnp(t,(function(){varo=newG(e,r,n);returnd(t,"gridRowActiveMode",o.setGridRowActiveMode.bind(o)),o}))}(r,t.modelData,t.context,t.params),i=function(t){vare=g([]);returnt.nerve.self.evt.on("created",(function(){e.value=z(t)})),[b((function(){vart=h(e.value);if(!t.find((function(t){return!t.width}))){varr=t.length-1;"rowEdit"===t[r].key&&(r-=1),t[r]=f(f({},t[r]),{},{width:void0})}varn=t.find((function(t){return"UAGRIDCOLUMN"===t.columnType}));returnn&&(n.fixed="right"),t})),e]}(o),a=e(i,1)[0],c=function(t){vare=function(e){returnt.items.find((function(t){returnt.srfkey===e.srfkey}))};return{onRowClick:function(r){varn=e(r);t.singleSelect&&t.onSelectionChange([n]),t.onRowClick(n)},onDbRowClick:function(r){t.onDbRowClick(e(r))},onSelectionChange:function(r){if(!t.singleSelect){varn=[];r.forEach((function(t){varr=e(t);r&&n.push(r)})),t.onSelectionChange(n)}},onSortChange:function(e){varr=e.column,n=e.order,o="asc"===n||"desc"===n?n:void0;t.setSort(r.fieldName,o),t.load()}}}(o),u=c.onRowClick,l=c.onDbRowClick,v=c.onSelectionChange,y=c.onSortChange,m=function(t){return{onPageChange:function(e){e&&e!==t.curPage&&(t.curPage=e,t.load())},onPageSizeChange:function(e){e&&e!==t.size&&(t.size=e,1===t.curPage&&t.load())},onPageReset:function(){t.curPage=1,t.load()}}}(o),w=m.onPageChange,P=m.onPageReset,j=m.onPageSizeChange,R=g(0),E=g(null),k=g(null),x=null,L=0,N=function(){vare;if(E.value&&"EMBED"!==(null===(e=t.modal)||void0===e?void0:e.mode))if(o.model.source.enablePagingBar&&k.value){varr=k.value.$el,n=r.offsetHeight+parseFloat(window.getComputedStyle(r).paddingTop);R.value=E.value.offsetHeight-n}elseR.value=E.value.offsetHeight;o.model.source.height>0&&(R.value=o.model.source.height)};S(E,(function(t,e){t&&t!==e&&(N(),window.ResizeObserver&&E.value&&(x=newResizeObserver((function(t){vare=t[0].contentRect.height;e!==L&&(N(),L=e)}))).observe(E.value))})),C((function(){x&&x.disconnect()}));var_=b((function(){vart=[];returno.groups.forEach((function(e){if(e.children.length){varr=h(e.children).shift();t.push({srfkey:e.caption,isGroupData:!0,first:r,children:e.children,_showChildren:!0})}})),t}));return{c:o,ns:n,columns:a,tableData:_,onDbRowClick:l,onUIRowClick:function(t,e){varn=r.$refs.grid;n&&(n.toggleSelect&&n.toggleSelect(e),n.highlightCurrentRow&&n.highlightCurrentRow(e)),u(t)},onSelectionChange:v,onSortChange:y,onPageChange:w,onPageSizeChange:j,onPageReset:P,tableHeight:R,gridRef:E,girdPaginationRef:k}},render:function(){vart=this;if(this.c.complete){vare={};returnthis.c.model.columns.forEach((function(r){if("GROUPGRIDCOLUMN"!==r.source.columnType){varn=r.codeName;e[n]=function(e){varr=e.row,o=e.column;if(r.isGroupData&&1===o._index)returnP("div",{class:t.ns.b("sum"),attrs:{title:r.first.lb}},[P("span",[r.first.lb])]);vari=t.c.rows.find((function(t){returnt.data.srfkey===r.srfkey}));returni?P(t.c.providers[n].component,{props:{controller:t.c.columns[n],row:i},key:r.srfkey+n}):void0}}})),P("control-layout",{attrs:{modelData:this.c.model}},[P("div",{ref:"gridRef",class:[this.ns.b(),this.ns.b("rfpg-grid"),this.ns.is("show-header",!this.c.model.source.hideHeader),this.ns.is("enable-page",this.c.model.source.enablePagingBar)]},[this.c.groups.length>0&&P("i-table",{ref:"grid",attrs:{height:this.tableHeight,"show-header":!this.c.model.source.hideHeader,"highlight-row":!0,data:this.tableData,columns:this.columns,"row-key":"srfkey"},class:this.ns.b("content"),on:{"on-row-click":this.onUIRowClick,"on-row-dblclick":this.onDbRowClick,"on-selection-change":this.onSelectionChange,"on-sort-change":this.onSortChange},scopedSlots:e}),this.c.model.source.enablePagingBar&&P(N,{ref:"girdPaginationRef",attrs:{total:this.c.total,curPage:this.c.curPage,size:this.c.size},on:{change:this.onPageChange,"page-size-change":this.onPageSizeChange,"page-reset":this.onPageReset}})])])}}});t("default",{mateUrl:n.meta.url,install:function(t){k.loadStyle(["/style.css"]),t.component("RfpgGridControl",_),ibiz.register.control.register("GRID_RENDER_RfpgGird",newx)}})}}}))}();
!function(){functiont(e){returnt="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},t(e)}functione(t,e){returnfunction(t){if(Array.isArray(t))returnt}(t)||function(t,e){varr=null==t?null:"undefined"!=typeofSymbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){varn,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}elsefor(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(s){l=!0,o=s}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throwo}}returnc}}(t,e)||p(t,e)||function(){thrownewTypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functionr(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r=function(){returne};vare={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeofSymbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";functions(t,e,r){returnObject.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(L){s=function(t,e,r){returnt[e]=r}}functionf(t,e,r,n){varo=e&&e.prototypeinstanceofd?e:d,a=Object.create(o.prototype),c=newE(n||[]);returni(a,"_invoke",{value:S(t,r,c)}),a}functionh(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=f;varp={};functiond(){}functiong(){}functionv(){}vary={};s(y,c,(function(){returnthis}));varm=Object.getPrototypeOf,b=m&&m(m(k([])));b&&b!==n&&o.call(b,c)&&(y=b);varw=v.prototype=d.prototype=Object.create(y);functionP(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){returnthis._invoke(e,t)}))}))}functionO(e,r){functionn(i,a,c,u){varl=h(e[i],e,a);if("throw"!==l.type){vars=l.arg,f=s.value;returnf&&"object"==t(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){returnn("throw",t,c,u)}))}u(l.arg)}vara;i(this,"_invoke",{value:function(t,e){functiono(){returnnewr((function(r,o){n(t,e,r,o)}))}returna=a?a.then(o,o):o()}})}functionS(t,e,r){varn="suspendedStart";returnfunction(o,i){if("executing"===n)thrownewError("Generator is already running");if("completed"===n){if("throw"===o)throwi;returnx()}for(r.method=o,r.arg=i;;){vara=r.delegate;if(a){varc=C(a,r);if(c){if(c===p)continue;returnc}}if("next"===r.method)r.sent=r._sent=r.arg;elseif("throw"===r.method){if("suspendedStart"===n)thrown="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";varu=h(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}functionC(t,e){varr=e.method,n=t.iterator[r];if(void0===n)returne.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void0,C(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=newTypeError("The iterator does not provide a '"+r+"' method")),p;varo=h(n,t.iterator,e.arg);if("throw"===o.type)returne.method="throw",e.arg=o.arg,e.delegate=null,p;vari=o.arg;returni?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void0),e.delegate=null,p):i:(e.method="throw",e.arg=newTypeError("iterator result is not an object"),e.delegate=null,p)}functionj(t){vare={tryLoc:t[0]};1int&&(e.catchLoc=t[1]),2int&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}functionR(t){vare=t.completion||{};e.type="normal",deletee.arg,t.completion=e}functionE(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}functionk(t){if(t){vare=t[c];if(e)returne.call(t);if("function"==typeoft.next)returnt;if(!isNaN(t.length)){varr=-1,n=functione(){for(;++r<t.length;)if(o.call(t,r))returne.value=t[r],e.done=!1,e;returne.value=void0,e.done=!0,e};returnn.next=n}}return{next:x}}functionx(){return{value:void0,done:!0}}returng.prototype=v,i(w,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:g,configurable:!0}),g.displayName=s(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){vare="function"==typeoft&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){returnObject.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},P(O.prototype),s(O.prototype,u,(function(){returnthis})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void0===i&&(i=Promise);vara=newO(f(t,r,n,o),i);returne.isGeneratorFunction(r)?a:a.next().then((function(t){returnt.done?t.value:a.next()}))},P(w),s(w,l,"Generator"),s(w,c,(function(){returnthis})),s(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){vare=Object(t),r=[];for(varnine)r.push(n);returnr.reverse(),functiont(){for(;r.length;){varn=r.pop();if(nine)returnt.value=n,t.done=!1,t}returnt.done=!0,t}},e.values=k,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void0,this.done=!1,this.delegate=null,this.method="next",this.arg=void0,this.tryEntries.forEach(R),!t)for(vareinthis)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void0)},stop:function(){this.done=!0;vart=this.tryEntries[0].completion;if("throw"===t.type)throwt.arg;returnthis.rval},dispatchException:function(t){if(this.done)throwt;vare=this;functionr(r,n){returna.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void0),!!n}for(varn=this.tryEntries.length-1;n>=0;--n){vari=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)returnr("end");if(i.tryLoc<=this.prev){varc=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)returnr(i.catchLoc,!0);if(this.prev<i.finallyLoc)returnr(i.finallyLoc)}elseif(c){if(this.prev<i.catchLoc)returnr(i.catchLoc,!0)}else{if(!u)thrownewError("try statement without catch or finally");if(this.prev<i.finallyLoc)returnr(i.finallyLoc)}}}},abrupt:function(t,e){for(varr=this.tryEntries.length-1;r>=0;--r){varn=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){vari=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);vara=i?i.completion:{};returna.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throwt.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.finallyLoc===t)returnthis.complete(r.completion,r.afterLoc),R(r),p}},catch:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.tryLoc===t){varn=r.completion;if("throw"===n.type){varo=n.arg;R(r)}returno}}thrownewError("illegal catch attempt")},delegateYield:function(t,e,r){returnthis.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void0),p}},e}functionn(t,e,r,n,o,i,a){try{varc=t[i](a),u=c.value}catch(l){returnvoidr(l)}c.done?e(u):Promise.resolve(u).then(n,o)}functiono(t){returnfunction(){vare=this,r=arguments;returnnewPromise((function(o,i){vara=t.apply(e,r);functionc(t){n(a,o,i,c,u,"next",t)}functionu(t){n(a,o,i,c,u,"throw",t)}c(void0)}))}}functioni(t,e){returni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){returnt.__proto__=e,t},i(t,e)}functiona(t){vare=function(){if("undefined"==typeofReflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeofProxy)return!0;try{returnBoolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();returnfunction(){varr,n=l(t);if(e){varo=l(this).constructor;r=Reflect.construct(n,arguments,o)}elser=n.apply(this,arguments);returnc(this,r)}}functionc(e,r){if(r&&("object"===t(r)||"function"==typeofr))returnr;if(void0!==r)thrownewTypeError("Derived constructors may only return object or undefined");returnu(e)}functionu(t){if(void0===t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returnt}functionl(t){returnl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){returnt.__proto__||Object.getPrototypeOf(t)},l(t)}functions(t,e){varr=Object.keys(t);if(Object.getOwnPropertySymbols){varn=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){returnObject.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}returnr}functionf(t){for(vare=1;e<arguments.length;e++){varr=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}returnt}functionh(t){returnfunction(t){if(Array.isArray(t))returnd(t)}(t)||function(t){if("undefined"!=typeofSymbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])returnArray.from(t)}(t)||p(t)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functionp(t,e){if(t){if("string"==typeoft)returnd(t,e);varr=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void0}}functiond(t,e){(null==e||e>t.length)&&(e=t.length);for(varr=0,n=newArray(e);r<e;r++)n[r]=t[r];returnn}functiong(t,e){for(varr=0;r<e.length;r++){varn=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}functionv(t,e,r){returne&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}functiony(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functionm(t,e,r){return(e=b(e))int?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}functionb(e){varr=function(e,r){if("object"!==t(e)||null===e)returne;varn=e[Symbol.toPrimitive];if(void0!==n){varo=n.call(e,r||"default");if("object"!==t(o))returno;thrownewTypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===t(r)?r:String(r)}System.register(["@ibiz-template/runtime","@ibiz-template/model","@ibiz-template/vue-util","vue","@ibiz-template/controller"],(function(t,n){"use strict";varc,l,s,p,d,g,b,w,P,O,S,C,j,R,E;return{setters:[function(t){c=t.PluginStaticResource},function(t){l=t.GridModel},function(t){s=t.useNamespace,p=t.useControlController,d=t.usePropsWatch},function(t){g=t.ref,b=t.computed,w=t.defineComponent,P=t.h,O=t.getCurrentInstance,S=t.watch,C=t.onUnmounted},function(t){j=t.GridController,R=t.GridRowController,E=t.GridNotifyState}],execute:function(){vark=newc(n.meta.url),x=v((functiont(){y(this,t),m(this,"component","RfpgGridControl")}));functionL(t,e){varr,n=[];"GROUPGRIDCOLUMN"===t.source.columnType&&t.children.forEach((function(t){n.push(L(t,e))}));varo={title:t.title,width:"STAR"===t.source.widthUnit?void0:t.width,minWidth:t.width,align:(null===(r=t.source.align)||void0===r?void0:r.toLowerCase())||"center",slot:t.codeName,key:t.codeName,fieldName:t.deFieldName,ellipsis:!0,tooltip:!1,resizable:!0,sortable:!(e.noSort||!t.source.enableSort)&&"custom",columnType:t.source.columnType,tree:"pfzbname"===t.id,className:"pfzbname"===t.id?"pfzbname":""};returnn.length>0&&Object.assign(o,{children:n}),o}functionz(t){vare=t.model,r=[],n=e.columns.map((function(e){returnL(e,t)}));returne.children.forEach((function(t){vare=n.find((function(e){returne.key===t.codeName}));e&&"lb"!==t.id&&r.push(e)})),t.singleSelect||r.splice(0,0,{type:"selection",width:60}),r}varN=w({name:"AppGridPagination",props:{total:{type:Number,required:!0},curPage:{type:Number,required:!0},size:{type:Number,required:!0}},setup:function(t){return{ns:s("grid-page"),start:b((function(){return(t.curPage-1)*t.size+1})),end:b((function(){returnt.curPage*t.size}))}},methods:{onPageChange:function(t){this.$emit("change",t)},onPageSizeChange:function(t){this.$emit("page-size-change",t)},pageReset:function(){this.$emit("page-reset")}},render:function(){returnP("div",{class:this.ns.b()},[P("i-page",{attrs:{transfer:!0,total:this.total,"show-sizer":!0,"show-elevator":!0,current:this.curPage,"page-size":this.size,"page-size-opts":[10,20,30,40,50,60,70,80,90,100],"show-total":!0},on:{"on-change":this.onPageChange,"on-page-size-change":this.onPageSizeChange}},[P("span",{class:this.ns.b("btn")},[P("i-button",{attrs:{icon:"md-refresh",title:"刷新"},on:{click:this.pageReset}})]),P("span",["显示 ",this.start," - ",this.end," 条,共 ",this.total," 条数据"])])])}}),G=function(t){!function(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(c,t);vare,n=a(c);functionc(){vart;y(this,c);for(vare=arguments.length,r=newArray(e),o=0;o<e;o++)r[o]=arguments[o];returnm(u(t=n.call.apply(n,[this].concat(r))),"groups",[]),t}returnv(c,[{key:"afterLoad",value:(e=o(r().mark((functiont(e){varn=this;returnr().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnt.next=2,Promise.allSettled(Object.values(this.fieldColumns).map(function(){vart=o(r().mark((functiont(e){returnr().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnt.next=2,e.loadCodeList();case2:case"end":returnt.stop()}}),t)})));returnfunction(e){returnt.apply(this,arguments)}}()));case2:returnthis.rows=e.map((function(t){vare=newR(t,n);returnn.gridStateNotify(e,E.LOAD),e})),this.handleGroup(e),t.abrupt("return",e);case5:case"end":returnt.stop()}}),t,this)}))),function(t){returne.apply(this,arguments)})},{key:"handleGroup",value:function(t){vare=this,r=newMap;t.forEach((function(t){vare=t.lb;r.has(e)||r.set(e,[]),r.has(e)&&r.get(e).push(t)})),this.groups=[],r.forEach((function(t,r){e.groups.push({caption:"".concat(r),key:r,children:t})}))}}]),c}(j);var_=w({props:{modelData:l,context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}},gridRowActiveMode:{type:Number,default:2},modal:{type:Object}},setup:function(t){varr=O().proxy,n=s("grid"),o=function(t,e,r){varn=arguments.length>3&&void0!==arguments[3]?arguments[3]:{};returnp(t,(function(){varo=newG(e,r,n);returnd(t,"gridRowActiveMode",o.setGridRowActiveMode.bind(o)),o}))}(r,t.modelData,t.context,t.params),i=function(t){vare=g([]);returnt.nerve.self.evt.on("created",(function(){e.value=z(t)})),[b((function(){vart=h(e.value);if(!t.find((function(t){return!t.width}))){varr=t.length-1;"rowEdit"===t[r].key&&(r-=1),t[r]=f(f({},t[r]),{},{width:void0})}varn=t.find((function(t){return"UAGRIDCOLUMN"===t.columnType}));returnn&&(n.fixed="right"),t})),e]}(o),a=e(i,1)[0],c=function(t){vare=function(e){returnt.items.find((function(t){returnt.srfkey===e.srfkey}))};return{onRowClick:function(r){varn=e(r);t.singleSelect&&t.onSelectionChange([n]),t.onRowClick(n)},onDbRowClick:function(r){t.onDbRowClick(e(r))},onSelectionChange:function(r){if(!t.singleSelect){varn=[];r.forEach((function(t){varr=e(t);r&&n.push(r)})),t.onSelectionChange(n)}},onSortChange:function(e){varr=e.column,n=e.order,o="asc"===n||"desc"===n?n:void0;t.setSort(r.fieldName,o),t.load()}}}(o),u=c.onRowClick,l=c.onDbRowClick,v=c.onSelectionChange,y=c.onSortChange,m=function(t){return{onPageChange:function(e){e&&e!==t.curPage&&(t.curPage=e,t.load())},onPageSizeChange:function(e){e&&e!==t.size&&(t.size=e,1===t.curPage&&t.load())},onPageReset:function(){t.curPage=1,t.load()}}}(o),w=m.onPageChange,P=m.onPageReset,j=m.onPageSizeChange,R=g(0),E=g(null),k=g(null),x=null,L=0,N=function(){vare;if(E.value&&"EMBED"!==(null===(e=t.modal)||void0===e?void0:e.mode))if(o.model.source.enablePagingBar&&k.value){varr=k.value.$el,n=r.offsetHeight+parseFloat(window.getComputedStyle(r).paddingTop);R.value=E.value.offsetHeight-n}elseR.value=E.value.offsetHeight;o.model.source.height>0&&(R.value=o.model.source.height)};S(E,(function(t,e){t&&t!==e&&(N(),window.ResizeObserver&&E.value&&(x=newResizeObserver((function(t){vare=t[0].contentRect.height;e!==L&&(N(),L=e)}))).observe(E.value))})),C((function(){x&&x.disconnect()}));var_=b((function(){vart=[];returno.groups.forEach((function(e){if(e.children.length){varr=h(e.children).shift();t.push({srfkey:e.caption,isGroupData:!0,first:r,children:e.children,_showChildren:!0})}})),t}));return{c:o,ns:n,columns:a,tableData:_,onDbRowClick:l,onUIRowClick:function(t,e){varn=r.$refs.grid;n&&(n.toggleSelect&&n.toggleSelect(e),n.highlightCurrentRow&&n.highlightCurrentRow(e)),u(t)},onSelectionChange:v,onSortChange:y,onPageChange:w,onPageSizeChange:j,onPageReset:P,tableHeight:R,gridRef:E,girdPaginationRef:k}},render:function(){vart=this;if(this.c.complete){vare={};returnthis.c.model.columns.forEach((function(r){if("GROUPGRIDCOLUMN"!==r.source.columnType){varn=r.codeName;e[n]=function(e){varr=e.row,o=e.column;if(r.isGroupData&&0===o._index)returnP("div",{class:t.ns.b("sum"),attrs:{title:r.first.lb}},[P("span",[r.first.lb])]);vari=t.c.rows.find((function(t){returnt.data.srfkey===r.srfkey}));returni?P(t.c.providers[n].component,{props:{controller:t.c.columns[n],row:i},key:r.srfkey+n}):void0}}})),P("control-layout",{attrs:{modelData:this.c.model}},[P("div",{ref:"gridRef",class:[this.ns.b(),this.ns.b("rfpg-grid"),this.ns.is("show-header",!this.c.model.source.hideHeader),this.ns.is("enable-page",this.c.model.source.enablePagingBar)]},[this.c.groups.length>0&&P("i-table",{ref:"grid",attrs:{height:this.tableHeight,"show-header":!this.c.model.source.hideHeader,"highlight-row":!0,data:this.tableData,columns:this.columns,"row-key":"srfkey"},class:this.ns.b("content"),on:{"on-row-click":this.onUIRowClick,"on-row-dblclick":this.onDbRowClick,"on-selection-change":this.onSelectionChange,"on-sort-change":this.onSortChange},scopedSlots:e}),this.c.model.source.enablePagingBar&&P(N,{ref:"girdPaginationRef",attrs:{total:this.c.total,curPage:this.c.curPage,size:this.c.size},on:{change:this.onPageChange,"page-size-change":this.onPageSizeChange,"page-reset":this.onPageReset}})])])}}});t("default",{mateUrl:n.meta.url,install:function(t){k.loadStyle(["/style.css"]),t.component("RfpgGridControl",_),ibiz.register.control.register("GRID_RENDER_RfpgGird",newx)}})}}}))}();