提交 c18a4348 编写于 作者: zhujiamin's avatar zhujiamin

feat: 更新插件

上级 7d88f129
...@@ -324,7 +324,7 @@ const Y = G({ ...@@ -324,7 +324,7 @@ const Y = G({
row: o, row: o,
column: s column: s
} = t; } = t;
if (o.isGroupData && s._index === 1) if (o.isGroupData && s._index === 0)
return c("div", { return c("div", {
class: this.ns.b("sum"), class: this.ns.b("sum"),
attrs: { attrs: {
......
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,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}else for(;!(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)throw o}}return c}}(t,e)||p(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r=function(){return e};var e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(L){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),c=new E(n||[]);return i(a,"_invoke",{value:S(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=f;var p={};function d(){}function g(){}function v(){}var y={};s(y,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(k([])));b&&b!==n&&o.call(b,c)&&(y=b);var w=v.prototype=d.prototype=Object.create(y);function P(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(e,r){function n(i,a,c,u){var l=h(e[i],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"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){return n("throw",t,c,u)}))}u(l.arg)}var a;i(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,o){n(t,e,r,o)}))}return a=a?a.then(o,o):o()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return x()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=C(a,r);if(c){if(c===p)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=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)}}}function C(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,C(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=h(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function k(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:x}}function x(){return{value:void 0,done:!0}}return g.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){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.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(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},P(w),s(w,l,"Generator"),s(w,c,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=k,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(R),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.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)throw t.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(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(l){return void r(l)}c.done?e(u):Promise.resolve(u).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))}}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l(t);if(e){var o=l(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c(this,r)}}function c(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=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))}))}return t}function h(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||p(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){if(t){if("string"==typeof t)return d(t,e);var r=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):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}function v(t,e,r){return e&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!==t(o))return o;throw new TypeError("@@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";var c,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(){var k=new c(n.meta.url),x=v((function t(){y(this,t),m(this,"component","RfpgGridControl")}));function L(t,e){var r,n=[];"GROUPGRIDCOLUMN"===t.source.columnType&&t.children.forEach((function(t){n.push(L(t,e))}));var o={title:t.title,width:"STAR"===t.source.widthUnit?void 0:t.width,minWidth:t.width,align:(null===(r=t.source.align)||void 0===r?void 0: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":""};return n.length>0&&Object.assign(o,{children:n}),o}function z(t){var e=t.model,r=[],n=e.columns.map((function(e){return L(e,t)}));return e.children.forEach((function(t){var e=n.find((function(e){return e.key===t.codeName}));e&&"lb"!==t.id&&r.push(e)})),t.singleSelect||r.splice(0,0,{type:"selection",width:60}),r}var N=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(){return t.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(){return P("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"!=typeof e&&null!==e)throw new TypeError("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);var e,n=a(c);function c(){var t;y(this,c);for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return m(u(t=n.call.apply(n,[this].concat(r))),"groups",[]),t}return v(c,[{key:"afterLoad",value:(e=o(r().mark((function t(e){var n=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.allSettled(Object.values(this.fieldColumns).map(function(){var t=o(r().mark((function t(e){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.loadCodeList();case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 2:return this.rows=e.map((function(t){var e=new R(t,n);return n.gridStateNotify(e,E.LOAD),e})),this.handleGroup(e),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"handleGroup",value:function(t){var e=this,r=new Map;t.forEach((function(t){var e=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){var r=O().proxy,n=s("grid"),o=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return p(t,(function(){var o=new G(e,r,n);return d(t,"gridRowActiveMode",o.setGridRowActiveMode.bind(o)),o}))}(r,t.modelData,t.context,t.params),i=function(t){var e=g([]);return t.nerve.self.evt.on("created",(function(){e.value=z(t)})),[b((function(){var t=h(e.value);if(!t.find((function(t){return!t.width}))){var r=t.length-1;"rowEdit"===t[r].key&&(r-=1),t[r]=f(f({},t[r]),{},{width:void 0})}var n=t.find((function(t){return"UAGRIDCOLUMN"===t.columnType}));return n&&(n.fixed="right"),t})),e]}(o),a=e(i,1)[0],c=function(t){var e=function(e){return t.items.find((function(t){return t.srfkey===e.srfkey}))};return{onRowClick:function(r){var n=e(r);t.singleSelect&&t.onSelectionChange([n]),t.onRowClick(n)},onDbRowClick:function(r){t.onDbRowClick(e(r))},onSelectionChange:function(r){if(!t.singleSelect){var n=[];r.forEach((function(t){var r=e(t);r&&n.push(r)})),t.onSelectionChange(n)}},onSortChange:function(e){var r=e.column,n=e.order,o="asc"===n||"desc"===n?n:void 0;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(){var e;if(E.value&&"EMBED"!==(null===(e=t.modal)||void 0===e?void 0:e.mode))if(o.model.source.enablePagingBar&&k.value){var r=k.value.$el,n=r.offsetHeight+parseFloat(window.getComputedStyle(r).paddingTop);R.value=E.value.offsetHeight-n}else R.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=new ResizeObserver((function(t){var e=t[0].contentRect.height;e!==L&&(N(),L=e)}))).observe(E.value))})),C((function(){x&&x.disconnect()}));var _=b((function(){var t=[];return o.groups.forEach((function(e){if(e.children.length){var r=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){var n=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(){var t=this;if(this.c.complete){var e={};return this.c.model.columns.forEach((function(r){if("GROUPGRIDCOLUMN"!==r.source.columnType){var n=r.codeName;e[n]=function(e){var r=e.row,o=e.column;if(r.isGroupData&&1===o._index)return P("div",{class:t.ns.b("sum"),attrs:{title:r.first.lb}},[P("span",[r.first.lb])]);var i=t.c.rows.find((function(t){return t.data.srfkey===r.srfkey}));return i?P(t.c.providers[n].component,{props:{controller:t.c.columns[n],row:i},key:r.srfkey+n}):void 0}}})),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",new x)}})}}}))}(); !function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,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}else for(;!(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)throw o}}return c}}(t,e)||p(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r=function(){return e};var e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(L){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),c=new E(n||[]);return i(a,"_invoke",{value:S(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=f;var p={};function d(){}function g(){}function v(){}var y={};s(y,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(k([])));b&&b!==n&&o.call(b,c)&&(y=b);var w=v.prototype=d.prototype=Object.create(y);function P(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(e,r){function n(i,a,c,u){var l=h(e[i],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"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){return n("throw",t,c,u)}))}u(l.arg)}var a;i(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,o){n(t,e,r,o)}))}return a=a?a.then(o,o):o()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return x()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=C(a,r);if(c){if(c===p)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=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)}}}function C(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,C(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=h(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function k(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:x}}function x(){return{value:void 0,done:!0}}return g.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){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.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(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},P(w),s(w,l,"Generator"),s(w,c,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=k,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(R),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.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)throw t.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(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(l){return void r(l)}c.done?e(u):Promise.resolve(u).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))}}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l(t);if(e){var o=l(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c(this,r)}}function c(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=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))}))}return t}function h(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||p(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){if(t){if("string"==typeof t)return d(t,e);var r=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):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}function v(t,e,r){return e&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!==t(o))return o;throw new TypeError("@@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";var c,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(){var k=new c(n.meta.url),x=v((function t(){y(this,t),m(this,"component","RfpgGridControl")}));function L(t,e){var r,n=[];"GROUPGRIDCOLUMN"===t.source.columnType&&t.children.forEach((function(t){n.push(L(t,e))}));var o={title:t.title,width:"STAR"===t.source.widthUnit?void 0:t.width,minWidth:t.width,align:(null===(r=t.source.align)||void 0===r?void 0: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":""};return n.length>0&&Object.assign(o,{children:n}),o}function z(t){var e=t.model,r=[],n=e.columns.map((function(e){return L(e,t)}));return e.children.forEach((function(t){var e=n.find((function(e){return e.key===t.codeName}));e&&"lb"!==t.id&&r.push(e)})),t.singleSelect||r.splice(0,0,{type:"selection",width:60}),r}var N=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(){return t.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(){return P("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"!=typeof e&&null!==e)throw new TypeError("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);var e,n=a(c);function c(){var t;y(this,c);for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return m(u(t=n.call.apply(n,[this].concat(r))),"groups",[]),t}return v(c,[{key:"afterLoad",value:(e=o(r().mark((function t(e){var n=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.allSettled(Object.values(this.fieldColumns).map(function(){var t=o(r().mark((function t(e){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.loadCodeList();case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 2:return this.rows=e.map((function(t){var e=new R(t,n);return n.gridStateNotify(e,E.LOAD),e})),this.handleGroup(e),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"handleGroup",value:function(t){var e=this,r=new Map;t.forEach((function(t){var e=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){var r=O().proxy,n=s("grid"),o=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return p(t,(function(){var o=new G(e,r,n);return d(t,"gridRowActiveMode",o.setGridRowActiveMode.bind(o)),o}))}(r,t.modelData,t.context,t.params),i=function(t){var e=g([]);return t.nerve.self.evt.on("created",(function(){e.value=z(t)})),[b((function(){var t=h(e.value);if(!t.find((function(t){return!t.width}))){var r=t.length-1;"rowEdit"===t[r].key&&(r-=1),t[r]=f(f({},t[r]),{},{width:void 0})}var n=t.find((function(t){return"UAGRIDCOLUMN"===t.columnType}));return n&&(n.fixed="right"),t})),e]}(o),a=e(i,1)[0],c=function(t){var e=function(e){return t.items.find((function(t){return t.srfkey===e.srfkey}))};return{onRowClick:function(r){var n=e(r);t.singleSelect&&t.onSelectionChange([n]),t.onRowClick(n)},onDbRowClick:function(r){t.onDbRowClick(e(r))},onSelectionChange:function(r){if(!t.singleSelect){var n=[];r.forEach((function(t){var r=e(t);r&&n.push(r)})),t.onSelectionChange(n)}},onSortChange:function(e){var r=e.column,n=e.order,o="asc"===n||"desc"===n?n:void 0;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(){var e;if(E.value&&"EMBED"!==(null===(e=t.modal)||void 0===e?void 0:e.mode))if(o.model.source.enablePagingBar&&k.value){var r=k.value.$el,n=r.offsetHeight+parseFloat(window.getComputedStyle(r).paddingTop);R.value=E.value.offsetHeight-n}else R.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=new ResizeObserver((function(t){var e=t[0].contentRect.height;e!==L&&(N(),L=e)}))).observe(E.value))})),C((function(){x&&x.disconnect()}));var _=b((function(){var t=[];return o.groups.forEach((function(e){if(e.children.length){var r=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){var n=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(){var t=this;if(this.c.complete){var e={};return this.c.model.columns.forEach((function(r){if("GROUPGRIDCOLUMN"!==r.source.columnType){var n=r.codeName;e[n]=function(e){var r=e.row,o=e.column;if(r.isGroupData&&0===o._index)return P("div",{class:t.ns.b("sum"),attrs:{title:r.first.lb}},[P("span",[r.first.lb])]);var i=t.c.rows.find((function(t){return t.data.srfkey===r.srfkey}));return i?P(t.c.providers[n].component,{props:{controller:t.c.columns[n],row:i},key:r.srfkey+n}):void 0}}})),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",new x)}})}}}))}();
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册