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

feat: 插件更新

上级 7c5c42c5
var O = Object.defineProperty;
var A = (e, i, o) => i in e ? O(e, i, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[i] = o;
var y = (e, i, o) => (A(e, typeof i != "symbol" ? i + "" : i, o), o);
import { PluginStaticResource as E } from "@ibiz-template/runtime";
var A = Object.defineProperty;
var E = (e, i, n) => i in e ? A(e, i, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[i] = n;
var P = (e, i, n) => (E(e, typeof i != "symbol" ? i + "" : i, n), n);
import { PluginStaticResource as O } from "@ibiz-template/runtime";
import { GridModel as I } from "@ibiz-template/model";
import { useNamespace as G, useControlController as M, usePropsWatch as U } from "@ibiz-template/vue-util";
import { ref as b, computed as w, defineComponent as k, h as u, getCurrentInstance as H, watch as T, onUnmounted as L } from "vue";
import { GridController as $, GridRowController as j, GridNotifyState as B } from "@ibiz-template/controller";
const F = new E(import.meta.url);
class q {
import { useNamespace as S, useControlController as M, usePropsWatch as U } from "@ibiz-template/vue-util";
import { ref as w, computed as b, defineComponent as G, h as c, getCurrentInstance as H, watch as T, onUnmounted as L } from "vue";
import { GridController as $, GridRowController as j, GridNotifyState as F } from "@ibiz-template/controller";
const q = new O(import.meta.url);
class B {
constructor() {
y(this, "component", "RfpgGridControl");
P(this, "component", "RfpgGridControl");
}
}
function z(e, i) {
var n;
const o = [];
var o;
const n = [];
e.source.columnType === "GROUPGRIDCOLUMN" && e.children.forEach((s) => {
o.push(z(s, i));
n.push(z(s, i));
});
const t = {
title: e.title,
width: e.source.widthUnit === "STAR" ? void 0 : e.width,
minWidth: e.width,
align: ((n = e.source.align) == null ? void 0 : n.toLowerCase()) || "center",
align: ((o = e.source.align) == null ? void 0 : o.toLowerCase()) || "center",
slot: e.codeName,
key: e.codeName,
fieldName: e.deFieldName,
......@@ -35,20 +35,20 @@ function z(e, i) {
tree: e.id === "pfzbname",
className: e.id === "pfzbname" ? "pfzbname" : ""
};
return o.length > 0 && Object.assign(t, { children: o }), t;
return n.length > 0 && Object.assign(t, { children: n }), t;
}
function _(e) {
const i = e.model, o = [], t = i.columns.map((n) => z(n, e));
return i.children.forEach((n) => {
const s = t.find((r) => r.key === n.codeName);
s && n.id !== "lb" && o.push(s);
}), e.singleSelect || o.splice(0, 0, { type: "selection", width: 60 }), o;
const i = e.model, n = [], t = i.columns.map((o) => z(o, e));
return i.children.forEach((o) => {
const s = t.find((r) => r.key === o.codeName);
s && o.id !== "lb" && n.push(s);
}), e.singleSelect || n.splice(0, 0, { type: "selection", width: 60 }), n;
}
function V(e) {
const i = b([]);
const i = w([]);
return e.nerve.self.evt.on("created", () => {
i.value = _(e);
}), [w(() => {
}), [b(() => {
const t = [...i.value];
if (!t.find((r) => !r.width)) {
let r = t.length - 1;
......@@ -63,41 +63,41 @@ function V(e) {
}
function W(e) {
const i = (r) => e.items.find((a) => a.srfkey === r.srfkey);
function o(r) {
function n(r) {
const a = i(r);
e.singleSelect && e.onSelectionChange([a]), e.onRowClick(a);
}
function t(r) {
e.onDbRowClick(i(r));
}
function n(r) {
function o(r) {
if (!e.singleSelect) {
const a = [];
r.forEach((l) => {
const h = i(l);
h && a.push(h);
r.forEach((d) => {
const f = i(d);
f && a.push(f);
}), e.onSelectionChange(a);
}
}
function s(r) {
const { column: a, order: l } = r, h = l === "asc" || l === "desc" ? l : void 0;
e.setSort(a.fieldName, h), e.load();
const { column: a, order: d } = r, f = d === "asc" || d === "desc" ? d : void 0;
e.setSort(a.fieldName, f), e.load();
}
return { onRowClick: o, onDbRowClick: t, onSelectionChange: n, onSortChange: s };
return { onRowClick: n, onDbRowClick: t, onSelectionChange: o, onSortChange: s };
}
function J(e) {
function i(n) {
!n || n === e.curPage || (e.curPage = n, e.load());
function i(o) {
!o || o === e.curPage || (e.curPage = o, e.load());
}
function o(n) {
!n || n === e.size || (e.size = n, e.curPage === 1 && e.load());
function n(o) {
!o || o === e.size || (e.size = o, e.curPage === 1 && e.load());
}
function t() {
e.curPage = 1, e.load();
}
return { onPageChange: i, onPageSizeChange: o, onPageReset: t };
return { onPageChange: i, onPageSizeChange: n, onPageReset: t };
}
const K = k({
const K = G({
name: "AppGridPagination",
props: {
total: {
......@@ -114,10 +114,10 @@ const K = k({
}
},
setup(e) {
const i = G("grid-page"), o = w(() => (e.curPage - 1) * e.size + 1), t = w(() => e.curPage * e.size);
const i = S("grid-page"), n = b(() => (e.curPage - 1) * e.size + 1), t = b(() => e.curPage * e.size);
return {
ns: i,
start: o,
start: n,
end: t
};
},
......@@ -133,9 +133,9 @@ const K = k({
}
},
render() {
return u("div", {
return c("div", {
class: this.ns.b()
}, [u("i-page", {
}, [c("i-page", {
attrs: {
transfer: !0,
total: this.total,
......@@ -150,9 +150,9 @@ const K = k({
"on-change": this.onPageChange,
"on-page-size-change": this.onPageSizeChange
}
}, [u("span", {
}, [c("span", {
class: this.ns.b("btn")
}, [u("i-button", {
}, [c("i-button", {
attrs: {
icon: "md-refresh",
title: "刷新"
......@@ -160,7 +160,7 @@ const K = k({
on: {
click: this.pageReset
}
})]), u("span", ["显示 ", this.start, " - ", this.end, " 条,共 ", this.total, " 条数据"])])]);
})]), c("span", ["显示 ", this.start, " - ", this.end, " 条,共 ", this.total, " 条数据"])])]);
}
});
class Q extends $ {
......@@ -172,7 +172,7 @@ class Q extends $ {
* @author: zhujiamin
* @Date: 2023-10-09 14:00:38
*/
y(this, "groups", []);
P(this, "groups", []);
}
/**
* 部件加载后处理
......@@ -180,15 +180,15 @@ class Q extends $ {
* @author lxm
* @date 2022-08-19 14:08:50
*/
async afterLoad(o) {
async afterLoad(n) {
return await Promise.allSettled(
Object.values(this.fieldColumns).map(async (t) => {
await t.loadCodeList();
})
), this.rows = o.map((t) => {
const n = new j(t, this);
return this.gridStateNotify(n, B.LOAD), n;
}), this.handleGroup(o), o;
), this.rows = n.map((t) => {
const o = new j(t, this);
return this.gridStateNotify(o, F.LOAD), o;
}), this.handleGroup(n), n;
}
/**
* 处理分组数据
......@@ -197,49 +197,27 @@ class Q extends $ {
* @author: zhujiamin
* @Date: 2023-10-09 14:03:17
*/
handleGroup(o) {
handleGroup(n) {
const t = /* @__PURE__ */ new Map();
if (o.forEach((n) => {
const s = n.lb;
t.has(s) || t.set(s, []), t.has(s) && t.get(s).push(n);
}), this.groups = [], t.forEach((n, s) => {
n.forEach((o) => {
const s = o.lb;
t.has(s) || t.set(s, []), t.has(s) && t.get(s).push(o);
}), this.groups = [], t.forEach((o, s) => {
this.groups.push({
caption: `${s}`,
key: s,
children: n
children: o
});
}), this.groups.length > 0) {
const n = [
"一",
"二",
"三",
"四",
"五",
"六",
"七",
"八",
"九",
"十"
], s = (r, a) => {
const l = n.indexOf(r.key.substr(0, 1)), h = n.indexOf(a.key.substr(0, 1));
return l === -1 || h === -1 ? r.key.substr(0, 1).localeCompare(a.key.substr(0, 1)) : l - h;
};
this.groups = this.groups.sort(s), this.groups.forEach((r) => {
r.children.sort((a, l) => {
const h = +a.pfzbname.split("、")[0], R = +l.pfzbname.split("、")[0];
return h - R;
});
});
}
});
}
}
function X(e, i, o, t = {}) {
function X(e, i, n, t = {}) {
return M(e, () => {
const n = new Q(i, o, t);
return U(e, "gridRowActiveMode", n.setGridRowActiveMode.bind(n)), n;
const o = new Q(i, n, t);
return U(e, "gridRowActiveMode", o.setGridRowActiveMode.bind(o)), o;
});
}
const Y = k({
const Y = G({
props: {
modelData: I,
context: {
......@@ -269,68 +247,68 @@ const Y = k({
setup(e) {
const {
proxy: i
} = H(), o = G("grid"), t = X(i, e.modelData, e.context, e.params), [n] = V(t), {
} = H(), n = S("grid"), t = X(i, e.modelData, e.context, e.params), [o] = V(t), {
onRowClick: s,
onDbRowClick: r,
onSelectionChange: a,
onSortChange: l
onSortChange: d
} = W(t), {
onPageChange: h,
onPageReset: R,
onPageSizeChange: x
} = J(t), D = (d, c) => {
const g = i.$refs.grid;
g && (g.toggleSelect && g.toggleSelect(c), g.highlightCurrentRow && g.highlightCurrentRow(c)), s(d);
}, p = b(0), f = b(null), P = b(null);
let m = null, v = 0;
const S = () => {
var d;
if (f.value && ((d = e.modal) == null ? void 0 : d.mode) !== "EMBED")
if (t.model.source.enablePagingBar && P.value) {
const c = P.value.$el, g = c.offsetHeight + parseFloat(window.getComputedStyle(c).paddingTop);
p.value = f.value.offsetHeight - g;
onPageChange: f,
onPageReset: k,
onPageSizeChange: D
} = J(t), N = (u, l) => {
const h = i.$refs.grid;
h && (h.toggleSelect && h.toggleSelect(l), h.highlightCurrentRow && h.highlightCurrentRow(l)), s(u);
}, p = w(0), g = w(null), R = w(null);
let m = null, y = 0;
const v = () => {
var u;
if (g.value && ((u = e.modal) == null ? void 0 : u.mode) !== "EMBED")
if (t.model.source.enablePagingBar && R.value) {
const l = R.value.$el, h = l.offsetHeight + parseFloat(window.getComputedStyle(l).paddingTop);
p.value = g.value.offsetHeight - h;
} else
p.value = f.value.offsetHeight;
p.value = g.value.offsetHeight;
t.model.source.height > 0 && (p.value = t.model.source.height);
};
T(f, (d, c) => {
d && d !== c && (S(), window.ResizeObserver && f.value && (m = new ResizeObserver((g) => {
const C = g[0].contentRect.height;
C !== v && (S(), v = C);
}), m.observe(f.value)));
T(g, (u, l) => {
u && u !== l && (v(), window.ResizeObserver && g.value && (m = new ResizeObserver((h) => {
const C = h[0].contentRect.height;
C !== y && (v(), y = C);
}), m.observe(g.value)));
}), L(() => {
m && m.disconnect();
});
const N = w(() => {
const d = [];
return t.groups.forEach((c) => {
if (!c.children.length)
const x = b(() => {
const u = [];
return t.groups.forEach((l) => {
if (!l.children.length)
return;
const C = [...c.children].shift();
d.push({
srfkey: c.caption,
const C = [...l.children].shift();
u.push({
srfkey: l.caption,
isGroupData: !0,
first: C,
children: c.children,
children: l.children,
_showChildren: !0
});
}), d;
}), u;
});
return {
c: t,
ns: o,
columns: n,
tableData: N,
ns: n,
columns: o,
tableData: x,
onDbRowClick: r,
onUIRowClick: D,
onUIRowClick: N,
onSelectionChange: a,
onSortChange: l,
onPageChange: h,
onPageSizeChange: x,
onPageReset: R,
onSortChange: d,
onPageChange: f,
onPageSizeChange: D,
onPageReset: k,
tableHeight: p,
gridRef: f,
girdPaginationRef: P
gridRef: g,
girdPaginationRef: R
};
},
render() {
......@@ -340,37 +318,37 @@ const Y = k({
return this.c.model.columns.forEach((i) => {
if (i.source.columnType === "GROUPGRIDCOLUMN")
return;
const o = i.codeName;
e[o] = (t) => {
const n = i.codeName;
e[n] = (t) => {
const {
row: n,
row: o,
column: s
} = t;
if (n.isGroupData && s._index === 1)
return u("div", {
if (o.isGroupData && s._index === 1)
return c("div", {
class: this.ns.b("sum"),
attrs: {
title: n.first.lb
title: o.first.lb
}
}, [u("span", [n.first.lb])]);
const r = this.c.rows.find((a) => a.data.srfkey === n.srfkey);
}, [c("span", [o.first.lb])]);
const r = this.c.rows.find((a) => a.data.srfkey === o.srfkey);
if (r)
return u(this.c.providers[o].component, {
return c(this.c.providers[n].component, {
props: {
controller: this.c.columns[o],
controller: this.c.columns[n],
row: r
},
key: n.srfkey + o
key: o.srfkey + n
});
};
}), u("control-layout", {
}), c("control-layout", {
attrs: {
modelData: this.c.model
}
}, [u("div", {
}, [c("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 && u("i-table", {
}, [this.c.groups.length > 0 && c("i-table", {
ref: "grid",
attrs: {
height: this.tableHeight,
......@@ -388,7 +366,7 @@ const Y = k({
"on-sort-change": this.onSortChange
},
scopedSlots: e
}), this.c.model.source.enablePagingBar && u(K, {
}), this.c.model.source.enablePagingBar && c(K, {
ref: "girdPaginationRef",
attrs: {
total: this.c.total,
......@@ -405,9 +383,9 @@ const Y = k({
}), re = {
mateUrl: import.meta.url,
install(e) {
F.loadStyle(["/style.css"]), e.component("RfpgGridControl", Y), ibiz.register.control.register(
q.loadStyle(["/style.css"]), e.component("RfpgGridControl", Y), ibiz.register.control.register(
"GRID_RENDER_RfpgGird",
new q()
new B()
);
}
};
......
!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,s=!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(l){s=!0,o=l}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)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",s=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(L){l=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 k(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={};l(y,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(E([])));b&&b!==n&&o.call(b,c)&&(y=b);var w=v.prototype=d.prototype=Object.create(y);function O(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function P(e,r){function n(i,a,c,u){var s=h(e[i],e,a);if("throw"!==s.type){var l=s.arg,f=l.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){l.value=t,c(l)}),(function(t){return n("throw",t,c,u)}))}u(s.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 k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function E(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=l(v,s,"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,l(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},O(P.prototype),l(P.prototype,u,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new P(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(w),l(w,s,"Generator"),l(w,c,(function(){return this})),l(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=E,k.prototype={constructor:k,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:E(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(s){return void r(s)}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=s(t);if(e){var o=s(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 s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function l(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?l(Object(r),!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(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,s,l,p,d,g,b,w,O,P,S,C,j,R,k;return{setters:[function(t){c=t.PluginStaticResource},function(t){s=t.GridModel},function(t){l=t.useNamespace,p=t.useControlController,d=t.usePropsWatch},function(t){g=t.ref,b=t.computed,w=t.defineComponent,O=t.h,P=t.getCurrentInstance,S=t.watch,C=t.onUnmounted},function(t){j=t.GridController,R=t.GridRowController,k=t.GridNotifyState}],execute:function(){var E=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:l("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 O("div",{class:this.ns.b()},[O("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}},[O("span",{class:this.ns.b("btn")},[O("i-button",{attrs:{icon:"md-refresh",title:"刷新"},on:{click:this.pageReset}})]),O("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,k.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;if(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})})),this.groups.length>0){var n=["一","二","三","四","五","六","七","八","九","十"];this.groups=this.groups.sort((function(t,e){var r=n.indexOf(t.key.substr(0,1)),o=n.indexOf(e.key.substr(0,1));return-1===r||-1===o?t.key.substr(0,1).localeCompare(e.key.substr(0,1)):r-o})),this.groups.forEach((function(t){t.children.sort((function(t,e){return+t.pfzbname.split("、")[0]-+e.pfzbname.split("、")[0]}))}))}}}]),c}(j);var _=w({props:{modelData:s,context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}},gridRowActiveMode:{type:Number,default:2},modal:{type:Object}},setup:function(t){var r=P().proxy,n=l("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,s=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,O=m.onPageReset,j=m.onPageSizeChange,R=g(0),k=g(null),E=g(null),x=null,L=0,N=function(){var e;if(k.value&&"EMBED"!==(null===(e=t.modal)||void 0===e?void 0:e.mode))if(o.model.source.enablePagingBar&&E.value){var r=E.value.$el,n=r.offsetHeight+parseFloat(window.getComputedStyle(r).paddingTop);R.value=k.value.offsetHeight-n}else R.value=k.value.offsetHeight;o.model.source.height>0&&(R.value=o.model.source.height)};S(k,(function(t,e){t&&t!==e&&(N(),window.ResizeObserver&&k.value&&(x=new ResizeObserver((function(t){var e=t[0].contentRect.height;e!==L&&(N(),L=e)}))).observe(k.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:s,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:O,tableHeight:R,gridRef:k,girdPaginationRef:E}},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 O("div",{class:t.ns.b("sum"),attrs:{title:r.first.lb}},[O("span",[r.first.lb])]);var i=t.c.rows.find((function(t){return t.data.srfkey===r.srfkey}));return i?O(t.c.providers[n].component,{props:{controller:t.c.columns[n],row:i},key:r.srfkey+n}):void 0}}})),O("control-layout",{attrs:{modelData:this.c.model}},[O("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&&O("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&&O(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){E.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&&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)}})}}}))}();
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册