提交 d2748d12 编写于 作者: Cano1997's avatar Cano1997

update: 更新插件代码

上级 2f0aca7f
var $ = Object.defineProperty;
var H = (e, i, n) => i in e ? $(e, i, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[i] = n;
var y = (e, i, n) => (H(e, typeof i != "symbol" ? i + "" : i, n), n);
var H = Object.defineProperty;
var $ = (e, i, n) => i in e ? H(e, i, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[i] = n;
var v = (e, i, n) => ($(e, typeof i != "symbol" ? i + "" : i, n), n);
import { PluginStaticResource as K, ViewMode as q } from "@ibiz-template/runtime";
import { defineComponent as I, ref as D, watch as A, computed as b, getCurrentInstance as G, h as m, toRef as W, onUnmounted as Y } from "vue";
import { getCheckboxProps as X, getEditorEmits as J, useNamespace as R, useControlController as _, useListExpViewController as Q, useRoute as Z, useRouteKey as ee, usePropsWatch as te } from "@ibiz-template/vue-util";
import { defineComponent as I, ref as k, watch as _, computed as b, getCurrentInstance as T, h, toRef as W, onUnmounted as Y } from "vue";
import { getCheckboxProps as X, getEditorEmits as J, useNamespace as R, useControlController as j, useListExpViewController as Q, useRoute as Z, useRouteKey as ee, usePropsWatch as te } from "@ibiz-template/vue-util";
import { isNil as se, clone as ne } from "ramda";
import { CheckBoxListEditorController as ie, SearchFormController as oe, FormNotifyState as re, GridController as ae, GridRowController as ce, GridNotifyState as le } from "@ibiz-template/controller";
import { SearchFormModel as ue, GridModel as de } from "@ibiz-template/model";
import he from "qs";
import { promiseAllSettled as me } from "@ibiz-template/core";
import L from "dayjs";
import G from "dayjs";
const fe = new K(import.meta.url);
const pe = I({
name: "CustomCheckboxList",
......@@ -18,10 +18,10 @@ const pe = I({
setup(e, {
emit: i
}) {
const n = R("checkbox"), t = e.controller, o = t.model.codeList, r = D([]);
A(() => e.data, (d) => {
t.loadCodeList(d).then((h) => {
r.value = h;
const n = R("checkbox"), t = e.controller, o = t.model.codeList, r = k([]);
_(() => e.data, (m) => {
t.loadCodeList(m).then((d) => {
r.value = d;
});
}, {
immediate: !0,
......@@ -34,54 +34,54 @@ const pe = I({
get() {
if (!se(e.value)) {
if (Object.is(a.value, "num") && r) {
const d = [], h = typeof e.value == "string" ? parseInt(e.value, 10) : e.value;
const m = [], d = typeof e.value == "string" ? parseInt(e.value, 10) : e.value;
return r.value.forEach((p) => {
(h & p.value) === p.value && d.push(p.value);
}), d;
(d & p.value) === p.value && m.push(p.value);
}), m;
}
if (Object.is(a.value, "str")) {
const d = e.value;
if (d !== "") {
const m = e.value;
if (m !== "") {
if (o) {
const h = d.split(l);
const d = m.split(l);
if (o.codeItemValueNumber)
for (let p = 0, v = h.length; p < v; p++)
h[p] = Number(h[p]);
return h;
for (let p = 0, y = d.length; p < y; p++)
d[p] = Number(d[p]);
return d;
}
return d.split(",");
return m.split(",");
}
}
}
return [];
},
set(d) {
let h = null;
set(m) {
let d = null;
if (Object.is(a.value, "num")) {
let p = 0;
d.forEach((v) => {
const S = typeof v == "string" ? parseInt(v, 10) : v;
p |= S;
}), h = p;
m.forEach((y) => {
const x = typeof y == "string" ? parseInt(y, 10) : y;
p |= x;
}), d = p;
} else if (Object.is(a.value, "str")) {
const p = [];
r.value.length > 0 && (r.value.forEach((v) => {
d.findIndex((w) => Object.is(v.value, w)) !== -1 && p.push(v.value);
}), h = p.join(l));
r.value.length > 0 && (r.value.forEach((y) => {
m.findIndex((w) => Object.is(y.value, w)) !== -1 && p.push(y.value);
}), d = p.join(l));
}
i("change", h);
i("change", d);
}
}), u = (d) => {
c.value = d;
}, k = b(() => {
const d = Array.isArray(c.value) ? c.value : [c.value];
return r.value.filter((h) => d.includes(h.value)).map((h) => h.text).join("、");
}), u = (m) => {
c.value = m;
}, D = b(() => {
const m = Array.isArray(c.value) ? c.value : [c.value];
return r.value.filter((d) => m.includes(d.value)).map((d) => d.text).join("、");
});
return {
ns: n,
items: r,
selectArray: c,
valueText: k,
valueText: D,
onSelectArrayChange: u,
c: t
};
......@@ -117,7 +117,7 @@ class ge extends ie {
* @type {string[]}
* @memberof CustomCheckboxListController
*/
y(this, "disabledList", []);
v(this, "disabledList", []);
}
async onInit() {
var n, t;
......@@ -138,7 +138,7 @@ class Ce extends oe {
* @type {IData}
* @memberof SearchFormDynamicController
*/
y(this, "filterParams", []);
v(this, "filterParams", []);
}
async onInit() {
await super.onInit();
......@@ -204,7 +204,7 @@ const ye = I({
setup(e) {
const {
proxy: i
} = G(), n = _(i, () => new Ce(e.modelData, e.context, e.params)), t = R("search-form"), s = e.modelData.source.searchButtonStyle;
} = T(), n = j(i, () => new Ce(e.modelData, e.context, e.params)), t = R("search-form"), s = e.modelData.source.searchButtonStyle;
return {
c: n,
ns: t,
......@@ -213,9 +213,9 @@ const ye = I({
},
render() {
if (this.c.complete)
return m("div", {
return h("div", {
class: [this.ns.b(), this.ns.m(this.btntype).toLowerCase()]
}, [m("form-control", {
}, [h("form-control", {
attrs: {
"model-data": this.modelData,
context: this.context,
......@@ -224,14 +224,14 @@ const ye = I({
nativeOn: {
keyup: (e) => this.c.onKeyUp(e)
}
}), this.c.model.source.searchButtonStyle === "NONE" ? null : m("div", {
}), this.c.model.source.searchButtonStyle === "NONE" ? null : h("div", {
class: this.ns.b("buttons")
}, [m("i-button", {
}, [h("i-button", {
class: this.ns.be("buttons", "search"),
on: {
click: () => this.c.onSearchButtonClick()
}
}, ["查询"]), m("i-button", {
}, ["查询"]), h("i-button", {
class: this.ns.be("buttons", "reset"),
on: {
click: () => this.c.reset()
......@@ -241,8 +241,8 @@ const ye = I({
});
class ve {
constructor() {
y(this, "formEditor", "CustomCheckboxList");
y(this, "gridEditor", "CustomCheckboxList");
v(this, "formEditor", "CustomCheckboxList");
v(this, "gridEditor", "CustomCheckboxList");
}
async createController(i, n) {
const t = new ge(i, n);
......@@ -251,7 +251,7 @@ class ve {
}
class we {
constructor() {
y(this, "component", "SearchFormDynamic");
v(this, "component", "SearchFormDynamic");
}
}
const be = I({
......@@ -277,7 +277,7 @@ const be = I({
setup(e) {
const {
proxy: i
} = G(), n = Q(i, e.modelPath), t = D(""), s = D([]), o = R("dataview-exp");
} = T(), n = Q(i, e.modelPath), t = k(""), s = k([]), o = R("dataview-exp");
if (n.context.isRouter === !0) {
const r = Z(i);
n.nerve.self.evt.on("created", () => {
......@@ -306,7 +306,7 @@ const be = I({
} = this.c.model, {
list: s
} = t;
n = t, this.c.providers[s.name] && (i = m(this.c.providers[s.name].component, {
n = t, this.c.providers[s.name] && (i = h(this.c.providers[s.name].component, {
props: {
modelData: s,
context: this.c.context,
......@@ -321,9 +321,9 @@ const be = I({
}
})), n.width = 0;
}
return m("div", {
return h("div", {
class: this.ns.b()
}, [m("exp-view-base", {
}, [h("exp-view-base", {
attrs: {
controller: this.c,
expBarModel: n
......@@ -336,9 +336,9 @@ const be = I({
} = this.c.model, {
list: s
} = t;
return s.navView ? e ? this.routeViewKey ? m("router-view", {
return s.navView ? e ? this.routeViewKey ? h("router-view", {
key: this.routeViewKey
}) : null : m("ViewShell", {
}) : null : h("ViewShell", {
attrs: {
context: this.c.navItem.context,
params: this.c.navItem.params,
......@@ -357,14 +357,14 @@ const be = I({
});
class ke {
constructor() {
y(this, "component", "DataViewExpView");
v(this, "component", "DataViewExpView");
}
}
function j(e, i) {
function B(e, i) {
var s, o;
const n = [];
e.source.columnType === "GROUPGRIDCOLUMN" && e.children.forEach((r) => {
n.push(j(r, i));
n.push(B(r, i));
});
const t = {
title: e.title,
......@@ -386,14 +386,14 @@ function j(e, i) {
return n.length > 0 && Object.assign(t, { children: n }), t;
}
function De(e) {
const i = e.model, n = [], t = i.columns.map((s) => j(s, e));
const i = e.model, n = [], t = i.columns.map((s) => B(s, e));
return i.children.forEach((s) => {
const o = t.find((r) => r.key === s.codeName);
o && n.push(o);
}), e.singleSelect || n.splice(0, 0, { type: "selection", width: 60 }), n;
}
function Se(e) {
const i = D([]);
const i = k([]);
e.nerve.self.evt.on("created", () => {
i.value = De(e);
});
......@@ -470,33 +470,33 @@ class Ie extends ae {
* @type {string[]}
* @memberof CheckInGridController
*/
y(this, "weekDays", ["日", "一", "二", "三", "四", "五", "六"]);
v(this, "weekDays", ["日", "一", "二", "三", "四", "五", "六"]);
/**
* @description 自定义列
* @type {IData[]}
* @memberof CheckinGridController
*/
y(this, "customColumns", []);
v(this, "customColumns", []);
/**
* @description 是否加载完成
* @type {boolean}
* @memberof CheckinGridController
*/
y(this, "loaded", !1);
v(this, "loaded", !1);
/**
* @description 排班数据
* @type {IData[]}
* @memberof CheckInGridController
*/
y(this, "checkinData", []);
v(this, "checkinData", []);
}
async onInit() {
await super.onInit(), await this.initMonthColumns();
}
async initMonthColumns() {
const n = L().daysInMonth(), t = L();
const n = G().daysInMonth(), t = G();
for (let s = 1; s <= n; s++) {
const o = L(`${t.year()}-${t.month() + 1}-${s}`), r = o.day(), a = o.format("YYYY-MM-DD"), l = {
const o = G(`${t.year()}-${t.month() + 1}-${s}`), r = o.day(), a = o.format("YYYY-MM-DD"), l = {
align: "center",
className: void 0,
columnType: "DEFGRIDCOLUMN",
......@@ -565,7 +565,7 @@ ${this.weekDays[r]}`,
}
}
function Re(e, i, n, t = {}) {
return _(e, () => {
return j(e, () => {
const s = new Ie(i, n, t);
return te(e, "gridRowActiveMode", s.setGridRowActiveMode.bind(s)), s;
});
......@@ -602,25 +602,25 @@ const Pe = I({
}
},
setup(e) {
var V;
var A;
const {
proxy: i
} = G(), n = R("grid"), t = Re(i, e.modelData, e.context, e.params), s = t.model.source.getPSControlParam(), o = ((V = s == null ? void 0 : s.ctrlParams) == null ? void 0 : V.IS_NOT_FLEX) === "true", r = D(), [a] = Se(t), l = b(() => [...a.value, ...t.customColumns]), {
} = T(), n = R("grid"), t = Re(i, e.modelData, e.context, e.params), s = t.model.source.getPSControlParam(), o = ((A = s == null ? void 0 : s.ctrlParams) == null ? void 0 : A.IS_NOT_FLEX) === "true", r = k(), [a] = Se(t), l = b(() => [...a.value, ...t.customColumns]), {
onRowClick: c,
onDbRowClick: u,
onSelectionChange: k,
onSortChange: d
onSelectionChange: D,
onSortChange: m
} = xe(t), {
onPageChange: h,
onPageChange: d,
onPageReset: p,
onPageSizeChange: v
} = Ee(t), S = b(() => {
onPageSizeChange: y
} = Ee(t), x = b(() => {
var g, C;
const f = (C = (g = e.modelData) == null ? void 0 : g.source.getPSControlParam()) == null ? void 0 : C.ctrlParams;
return (f == null ? void 0 : f.HIGHLIGHT) !== "false";
});
let w = null;
const B = (f, g) => {
const P = (f, g) => {
w != null && window.clearTimeout(w), w = window.setTimeout(() => {
const C = i.$refs.grid;
C && (t.selectedData.find((z) => z.srfkey === f.srfkey) && C.clearCurrentRow(), C.toggleSelect && C.toggleSelect(g)), c(f);
......@@ -629,25 +629,25 @@ const Pe = I({
w != null && window.clearTimeout(w);
const g = i.$refs.grid;
g && (t.selectedData.find((E) => E.srfkey === f.srfkey) || g.clearCurrentRow()), u(f);
}, P = D(0), x = D(null), N = D(null);
let O = null, T = 0;
const M = () => {
}, O = k(0), S = k(null), L = k(null);
let N = null, M = 0;
const V = () => {
var f;
if (x.value && ((f = e.modal) == null ? void 0 : f.mode) !== "EMBED")
if (t.model.source.enablePagingBar && N.value) {
const g = N.value.$el, C = g.offsetHeight + parseFloat(window.getComputedStyle(g).paddingTop);
P.value = x.value.offsetHeight - C;
if (S.value && ((f = e.modal) == null ? void 0 : f.mode) !== "EMBED")
if (t.model.source.enablePagingBar && L.value) {
const g = L.value.$el, C = g.offsetHeight + parseFloat(window.getComputedStyle(g).paddingTop);
O.value = S.value.offsetHeight - C;
} else
P.value = x.value.offsetHeight;
t.model.source.height > 0 && (P.value = t.model.source.height);
O.value = S.value.offsetHeight;
t.model.source.height > 0 && (O.value = t.model.source.height);
};
A(x, (f, g) => {
f && f !== g && (M(), window.ResizeObserver && x.value && (O = new ResizeObserver((C) => {
_(S, (f, g) => {
f && f !== g && (V(), window.ResizeObserver && S.value && (N = new ResizeObserver((C) => {
const E = C[0].contentRect.height;
E !== T && (M(), T = E);
}), O.observe(x.value)));
E !== M && (V(), M = E);
}), N.observe(S.value)));
}), Y(() => {
O && O.disconnect();
N && N.disconnect();
});
const U = b(() => {
const f = t.items.map((g) => (g._checked = t.selectedData.some((C) => C.srfkey === g.srfkey), g));
......@@ -663,17 +663,17 @@ const Pe = I({
curColumns: l,
tableData: U,
onDbRowClick: u,
onUIRowClick: B,
onUIRowClick: P,
onUIDbRowClick: F,
onSelectionChange: k,
onSortChange: d,
onPageChange: h,
onPageSizeChange: v,
onSelectionChange: D,
onSortChange: m,
onPageChange: d,
onPageSizeChange: y,
onPageReset: p,
tableHeight: P,
gridRef: x,
girdPaginationRef: N,
highlight: S,
tableHeight: O,
gridRef: S,
girdPaginationRef: L,
highlight: x,
isNotFlex: o,
grid: r
};
......@@ -693,11 +693,11 @@ const Pe = I({
}) => {
const r = this.c.rows[o - 1];
if (s.hiddenRow)
return m("span", {
return h("span", {
style: "word-break: break-word;white-space: pre-wrap;"
}, ["隐藏行的列"]);
if (r)
return m(this.c.providers[t].component, {
return h(this.c.providers[t].component, {
props: {
controller: this.c.columns[t],
row: r
......@@ -713,7 +713,7 @@ const Pe = I({
}) => {
const r = this.c.rows[o - 1], a = s.children[t];
if (r && a)
return m("CheckInGridColumn", {
return h("CheckInGridColumn", {
props: {
controller: this.c,
data: s,
......@@ -722,15 +722,15 @@ const Pe = I({
key: s.srfkey + t
});
};
}), m("control-layout", {
}), h("control-layout", {
attrs: {
modelData: this.c.model
}
}, [m("div", {
}, [h("div", {
ref: "gridRef",
class: [this.ns.b(), this.ns.is("show-header", !this.c.model.source.hideHeader), this.ns.is("enable-page", this.c.model.source.enablePagingBar)],
style: this.isNotFlex ? (i = this.grid) == null ? void 0 : i.tableStyle : void 0
}, [m("i-table", {
}, [h("i-table", {
ref: "grid",
attrs: {
height: this.tableHeight,
......@@ -749,7 +749,7 @@ const Pe = I({
"on-sort-change": this.onSortChange
},
scopedSlots: e
}), this.c.model.source.enablePagingBar && m("appGridPagination", {
}), this.c.model.source.enablePagingBar && h("appGridPagination", {
ref: "girdPaginationRef",
attrs: {
total: this.c.total,
......@@ -781,33 +781,36 @@ const Oe = I({
}
},
setup(e) {
const i = R("checkin-column"), n = D(""), t = b(() => {
const i = R("checkin-column"), n = k(""), t = b(() => {
const {
shifts: a = [],
work_time: l = []
} = e.value || {}, {
start_base_time: c,
end_base_time: u
} = l[0] || {}, k = c, d = u, h = {
title: `休息 (${k} - ${d})`,
} = l[0] || {}, D = c, m = u;
let d = "";
D && m && (d = `(${D} - ${m})`);
const p = {
title: `休息${d}`,
value: "rest",
name: "休息"
}, p = {
title: `白班 (${k} - ${d})`,
}, y = {
title: `白班${d}`,
value: "work",
name: "白班"
};
return a.length ? [...a.map((S) => {
return a.length ? [...a.map((w) => {
const {
name: w
} = S;
name: P
} = w;
return {
title: `${w} (${k} - ${d})`,
value: S.id,
name: w,
origin: S
title: `${P}${d}`,
value: w.id,
name: P,
origin: w
};
}), h] : [p, h];
}), p] : [y, p];
}), s = b(() => {
const {
workday: a,
......@@ -818,7 +821,7 @@ const Oe = I({
return c ? c.title : "休息";
}
if (l) {
const c = l.name, u = t.value.find((k) => k.name === c);
const c = l.name, u = t.value.find((D) => D.name === c);
return u ? u.title : c;
}
return "";
......@@ -852,7 +855,7 @@ const Oe = I({
if (!this.value)
return;
const e = this.selectValue || this.curValue;
return m("i-dropdown", {
return h("i-dropdown", {
on: {
"on-click": (i) => this.handleClick(i)
},
......@@ -862,11 +865,11 @@ const Oe = I({
transfer: !0,
trigger: "click"
}
}, [m("div", {
}, [h("div", {
class: this.ns.e("caption")
}, [e.replace(/\(.*\)/g, "")]), m("i-dropdownMenu", {
}, [e.replace(/\(.*\)/g, "")]), h("i-dropdownMenu", {
slot: "list"
}, [this.items.map((i) => m("i-dropdown-item", {
}, [this.items.map((i) => h("i-dropdown-item", {
class: [this.ns.e("item")],
attrs: {
title: i.title,
......@@ -878,7 +881,7 @@ const Oe = I({
});
class Ne {
constructor() {
y(this, "component", "CheckinGridControl");
v(this, "component", "CheckinGridControl");
}
}
const Ue = {
......
!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||r(e)||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 n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(e,t)||r(e,t)||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(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function c(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return a(l,"_invoke",function(n,r,o){var i,a,c,s=0,l=o||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,c=e,d.n=n,u}};function h(n,r){for(a=n,c=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],h=d.p,v=i[2];n>3?(o=v===r)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,d.v=r,d.n=i[1]):h<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,d.n=v,a=0))}if(o||n>1)return u;throw f=!0,r}return function(o,l,v){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,v),a=l,c=v;(t=a<2?e:c)||!f;){i||(a?a<3?(a>1&&(d.n=-1),h(a,c)):d.n=c:d.v=c);try{if(s=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=d.n<0)?c:n.call(r,d))!==u)break}catch(t){i=e,a=1,c=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),l}var u={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(a(t={},r,(function(){return this})),t),h=f.prototype=s.prototype=Object.create(d);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,o,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,o,"GeneratorFunction"),a(h),a(h,o,"Generator"),a(h,r,(function(){return this})),a(h,"toString",(function(){return"[object Generator]"})),(i=function(){return{w:c,m:v}})()}function a(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}a=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{function i(t,n){a(e,t,(function(e){return this._invoke(t,n,e)}))}i("next",0),i("throw",1),i("return",2)}},a(e,t,n,r)}function c(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,u,"next",e)}function u(e){c(i,r,o,a,u,"throw",e)}a(void 0)}))}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,S(r.key),r)}}function f(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(t,n,r){return n=y(n),function(t,n){if(n&&("object"==e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)}(t,h()?Reflect.construct(n,r||[],y(t).constructor):n.apply(t,r))}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function v(e,t,n,r){var o=m(y(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=p(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},m.apply(null,arguments)}function p(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function k(e,t,n){return(t=S(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}System.register(["@ibiz-template/runtime","vue","@ibiz-template/vue-util","ramda","@ibiz-template/controller","@ibiz-template/model","qs","@ibiz-template/core","dayjs"],(function(e,r){"use strict";var o,a,c,l,h,m,p,y,g,w,S,O,P,D,E,R,j,I,x,N,T,_,A,L,G,M,z,B,V,F,U;return{setters:[function(e){o=e.PluginStaticResource,a=e.ViewMode},function(e){c=e.defineComponent,l=e.ref,h=e.watch,m=e.computed,p=e.getCurrentInstance,y=e.h,g=e.toRef,w=e.onUnmounted},function(e){S=e.getCheckboxProps,O=e.getEditorEmits,P=e.useNamespace,D=e.useControlController,E=e.useListExpViewController,R=e.useRoute,j=e.useRouteKey,I=e.usePropsWatch},function(e){x=e.isNil,N=e.clone},function(e){T=e.CheckBoxListEditorController,_=e.SearchFormController,A=e.FormNotifyState,L=e.GridController,G=e.GridRowController,M=e.GridNotifyState},function(e){z=e.SearchFormModel,B=e.GridModel},function(e){V=e.default},function(e){F=e.promiseAllSettled},function(e){U=e.default}],execute:function(){var H=new o(r.meta.url),K=c({name:"CustomCheckboxList",props:S(),emits:O(),setup:function(e,t){var n=t.emit,r=P("checkbox"),o=e.controller,i=o.model.codeList,a=l([]);h((function(){return e.data}),(function(e){o.loadCodeList(e).then((function(e){a.value=e}))}),{immediate:!0,deep:!0});var c=m((function(){return i&&i.orMode?i.orMode.toLowerCase():"str"})),u=",";i&&i.valueSeparator&&(u=i.valueSeparator);var s=m({get:function(){if(!x(e.value)){if(Object.is(c.value,"num")&&a){var t=[],n="string"==typeof e.value?parseInt(e.value,10):e.value;return a.value.forEach((function(e){(n&e.value)===e.value&&t.push(e.value)})),t}if(Object.is(c.value,"str")){var r=e.value;if(""!==r){if(i){var o=r.split(u);if(i.codeItemValueNumber)for(var s=0,l=o.length;s<l;s++)o[s]=Number(o[s]);return o}return r.split(",")}}}return[]},set:function(e){var t=null;if(Object.is(c.value,"num")){var r=0;e.forEach((function(e){var t="string"==typeof e?parseInt(e,10):e;r|=t})),t=r}else if(Object.is(c.value,"str")){var o=[];a.value.length>0&&(a.value.forEach((function(t){-1!==e.findIndex((function(e){return Object.is(t.value,e)}))&&o.push(t.value)})),t=o.join(u))}n("change",t)}}),f=m((function(){var e=Array.isArray(s.value)?s.value:[s.value];return a.value.filter((function(t){return e.includes(t.value)})).map((function(e){return e.text})).join("、")}));return{ns:r,items:a,selectArray:s,valueText:f,onSelectArrayChange:function(e){s.value=e},c:o}},render:function(e){var t=this;return e("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):""]},[[this.readonly&&this.valueText,!this.readonly&&e("ICheckboxGroup",{props:C(C({},this.c.customProps),{},{value:this.selectArray}),on:{"on-change":this.onSelectArrayChange}},[this.items.map((function(n,r){return e("i-checkbox",{key:r,attrs:{label:n.value,disabled:t.disabled||t.c.disabledList.includes(n.value)}},[e("span",{class:t.ns.e("text")},[n.text])])}))])]])}}),q=function(e){function t(){var e;s(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return k(e=d(this,t,[].concat(r)),"disabledList",[]),e}return b(t,e),f(t,[{key:"onInit",value:(n=u(i().m((function e(){var n,r;return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,v(t,"onInit",this,3)([]);case 1:if(null!==(n=this.editorParams)&&void 0!==n&&n.DEFAULTDISABLEDLIST)try{this.disabledList=JSON.parse(null===(r=this.editorParams)||void 0===r?void 0:r.DEFAULTDISABLEDLIST)}catch(o){this.disabledList=[]}case 2:return e.a(2)}}),e,this)}))),function(){return n.apply(this,arguments)})}]);var n}(T),W=function(e){function t(){var e;s(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return k(e=d(this,t,[].concat(r)),"filterParams",[]),e}return b(t,e),f(t,[{key:"onInit",value:(r=u(i().m((function e(){var n;return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,v(t,"onInit",this,3)([]);case 1:if(n=this.controlParams.FILTERPARAMS)try{this.filterParams=JSON.parse(n)}catch(r){this.filterParams=[]}case 2:return e.a(2)}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getParams",value:function(){var e=C({},this.data.getRequestData());if(this.filterParams){var t={};return this.filterParams.forEach((function(n){Object.assign(t,k({},n,e[n]))})),t}return e}},{key:"reset",value:(n=u(i().m((function e(){var t,n=this;return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.service.getDraft(this.context,this.params);case 1:return t=e.v,this.filterParams.forEach((function(e){Object.assign(n.data,k({},e,t.data[e]))})),this.isLoaded=!0,Object.values(this.details).forEach((function(e){n.filterParams.includes(e.model.codeName)&&e.formStateNotify(A.DRAFT)})),this.force(),e.n=2,this.nerve.self.evt.asyncEmit("search");case 2:return e.a(2)}}),e,this)}))),function(){return n.apply(this,arguments)})}]);var n,r}(_),Y=c({name:"SearchFormDynamic",props:{controller:{type:Object,required:!0},modelData:{type:z,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}}},setup:function(e){var t=p().proxy;return{c:D(t,(function(){return new W(e.modelData,e.context,e.params)})),ns:P("search-form"),btntype:e.modelData.source.searchButtonStyle}},render:function(){var e=this;if(this.c.complete)return y("div",{class:[this.ns.b(),this.ns.m(this.btntype).toLowerCase()]},[y("form-control",{attrs:{"model-data":this.modelData,context:this.context,controller:this.c},nativeOn:{keyup:function(t){return e.c.onKeyUp(t)}}}),"NONE"===this.c.model.source.searchButtonStyle?null:y("div",{class:this.ns.b("buttons")},[y("i-button",{class:this.ns.be("buttons","search"),on:{click:function(){return e.c.onSearchButtonClick()}}},["查询"]),y("i-button",{class:this.ns.be("buttons","reset"),on:{click:function(){return e.c.reset()}}},["重置"])])])}}),X=function(){return f((function e(){s(this,e),k(this,"formEditor","CustomCheckboxList"),k(this,"gridEditor","CustomCheckboxList")}),[{key:"createController",value:(e=u(i().m((function e(t,n){var r;return i().w((function(e){for(;;)switch(e.n){case 0:return r=new q(t,n),e.n=1,r.init();case 1:return e.a(2,r)}}),e)}))),function(t,n){return e.apply(this,arguments)})}]);var e}(),$=f((function e(){s(this,e),k(this,"component","SearchFormDynamic")})),J=c({name:"DataViewExpView",props:{context:Object,params:{type:Object},srfnav:String,modelPath:{type:String,required:!0},modal:{type:Object},noLoadDefault:{type:Boolean,required:!1}},setup:function(e){var t=p().proxy,n=E(t,e.modelPath),r=l(""),o=l([]),i=P("dataview-exp");if(!0===n.context.isRouter){var a=R(t);n.nerve.self.evt.on("created",(function(){if(a.params.params1){var e=a.params.params1,i=V.parse(e,{delimiter:";"})[n.model.appEntity.deName];i&&(n.navItem.key=i,o.value=[i])}j(g(n.navItem,"key"),t,r)}))}return{c:n,ns:i,defaultSelectKeys:o,routeViewKey:r}},render:function(){var e=this,t=!0===this.c.context.isRouter,n=null,r=null;if(this.c.complete){var o=this.c.model.listExpBar,i=o.list;r=o,this.c.providers[i.name]&&(n=y(this.c.providers[i.name].component,{props:{modelData:i,context:this.c.context,params:this.c.params,isExpView:!0,isSelectFirstDefault:!0,mdCtrlActiveMode:1,defaultSelectKeys:this.defaultSelectKeys},on:{neuronInit:this.c.nerve.onNeuronInit(i.name)}})),r.width=0}return y("div",{class:this.ns.b()},[y("exp-view-base",{attrs:{controller:this.c,expBarModel:r},scopedSlots:{expView:function(){if(e.c.complete){var n=e.c.model.listExpBar.list;return n.navView?t?e.routeViewKey?y("router-view",{key:e.routeViewKey}):null:y("ViewShell",{attrs:{context:e.c.navItem.context,params:e.c.navItem.params,modal:{mode:a.EMBED},modelPath:n.navView.source.modelPath},key:e.c.navItem.key}):null}}}}),n])}}),Q=f((function e(){s(this,e),k(this,"component","DataViewExpView")}));function Z(e,t){var n,r,o=[];"GROUPGRIDCOLUMN"===e.source.columnType&&e.children.forEach((function(e){o.push(Z(e,t))}));var i={title:e.title,width:"STAR"===e.source.widthUnit?void 0:e.width,minWidth:e.width,align:(null===(n=e.source.align)||void 0===n?void 0:n.toLowerCase())||"center",slot:e.codeName,key:e.codeName,fieldName:e.deFieldName,ellipsis:!0,tooltip:!1,resizable:!0,sortable:!(t.noSort||!e.source.enableSort)&&"custom",columnType:e.source.columnType,userParams:e.source.userParams,className:null===(r=e.source.getCellPSSysCss())||void 0===r?void 0:r.cssName};return o.length>0&&Object.assign(i,{children:o}),i}function ee(e){var t=e.model,n=[],r=t.columns.map((function(t){return Z(t,e)}));return t.children.forEach((function(e){var t=r.find((function(t){return t.key===e.codeName}));t&&n.push(t)})),e.singleSelect||n.splice(0,0,{type:"selection",width:60}),n}var te=function(e){function t(){var e;s(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return k(e=d(this,t,[].concat(r)),"weekDays",["日","一","二","三","四","五","六"]),k(e,"customColumns",[]),k(e,"loaded",!1),k(e,"checkinData",[]),e}return b(t,e),f(t,[{key:"onInit",value:(a=u(i().m((function e(){return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,v(t,"onInit",this,3)([]);case 1:return e.n=2,this.initMonthColumns();case 2:return e.a(2)}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"initMonthColumns",value:(o=u(i().m((function e(){var t,n,r,o,a,c,u;return i().w((function(e){for(;;)switch(e.n){case 0:for(t=U().daysInMonth(),n=U(),r=1;r<=t;r++)o=U("".concat(n.year(),"-").concat(n.month()+1,"-").concat(r)),a=o.day(),c=o.format("YYYY-MM-DD"),u={align:"center",className:void 0,columnType:"DEFGRIDCOLUMN",ellipsis:!0,fieldName:"".concat(c),key:"".concat(c),minWidth:100,resizable:!0,slot:"".concat(c),sortable:"custom",title:"".concat(r,"\n").concat(this.weekDays[a]),tooltip:!1,width:100,userParam:{columnType:"date"}},this.customColumns.push(u);case 1:return e.a(2)}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"afterLoad",value:(r=u(i().m((function e(t){var n=this;return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,F(Object.values(this.fieldColumns).map(function(){var e=u(i().m((function e(t){return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,t.loadCodeList();case 1:return e.a(2)}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:return e.n=2,this.initGroup();case 2:return this.items=this.calcDayData(t),this.items.forEach((function(e,t){e.srfserialnum=t+1})),this.rows=this.items.map((function(e){var t=new G(e,n);return n.gridStateNotify(t,M.LOAD),t})),this.loaded=!0,e.a(2,t)}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"calcDayData",value:function(e){var t=[];return e.forEach((function(e){var n=t.findIndex((function(t){return t.member_id===e.member_id}));-1===n?(e.children=k({},e.checkin_date,C({},e)),t.push(e)):t[n].children[e.checkin_date]=e})),t}},{key:"setCheckInData",value:function(e,t){var n=this.checkinData.findIndex((function(t){return t.id===e}));-1===n?this.checkinData.push(t):this.checkinData[n]=t}},{key:"removeCheckInData",value:function(e){var t=this.checkinData.findIndex((function(t){return t.id===e}));-1!==t&&this.checkinData.splice(t,1)}},{key:"saveCheckInData",value:(n=u(i().m((function e(){return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,ibiz.net.post("/schedules/manual",this.checkinData);case 1:e.v.ok&&(this.loaded=!1,this.checkinData=[],this.load());case 2:return e.a(2)}}),e,this)}))),function(){return n.apply(this,arguments)})}]);var n,r,o,a}(L);var ne=c({props:{controller:{type:Object,required:!0},modelData:B,context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}},gridRowActiveMode:{type:Number,default:2},modal:{type:Object}},setup:function(e){var r,o=p().proxy,i=P("grid"),a=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return D(e,(function(){var o=new te(t,n,r);return I(e,"gridRowActiveMode",o.setGridRowActiveMode.bind(o)),o}))}(o,e.modelData,e.context,e.params),c=a.model.source.getPSControlParam(),u="true"===(null==c||null===(r=c.ctrlParams)||void 0===r?void 0:r.IS_NOT_FLEX),s=l(),f=function(e){var t=l([]);e.nerve.self.evt.on("created",(function(){t.value=ee(e)}));var n=function(t){return t.filter((function(t){return!e.hiddenColumnKeys.includes(t.key)&&(t.children&&t.children.length&&(t.children=n(t.children)),!0)}))};return[m((function(){var r,o=N(t.value),i=(o=n(o)).find((function(e){return!e.width})),a=null===(r=e.model.source.getPSControlParam())||void 0===r?void 0:r.ctrlParams,c="true"===(null==a?void 0:a.IS_NOT_FLEX);if(!i&&!c){var u=o.length-1;"rowEdit"===o[u].key&&(u-=1),o[u]=C(C({},o[u]),{},{width:void 0})}var s=o.find((function(e){return"UAGRIDCOLUMN"===e.columnType}));if(s){var l=s.userParams;l&&"true"===l.fixed&&(s.fixed="right")}return o.forEach((function(t){t.fixed="left","TRUE"!==ibiz.env.enableGridRowBreak&&!0!==ibiz.env.enableGridRowBreak||(t.ellipsis=!1),e.controlParams.ENABLEGRIDROWBREAK&&(t.ellipsis="TRUE"!==e.controlParams.ENABLEGRIDROWBREAK)})),o})),t]}(a),d=n(f,1)[0],v=m((function(){return[].concat(t(d.value),t(a.customColumns))})),y=function(e){var t=function(t){return e.items.find((function(e){return e.srfkey===t.srfkey}))};return{onRowClick:function(n){var r=t(n);if(e.singleSelect){var o=e.selectedData.find((function(e){return e.srfkey===n.srfkey}));e.onSelectionChange(o?[]:[r])}e.onRowClick(r)},onDbRowClick:function(n){e.onDbRowClick(t(n))},onSelectionChange:function(n){if(!e.singleSelect){var r=[];n.forEach((function(e){var n=t(e);n&&r.push(n)})),e.onSelectionChange(r)}},onSortChange:function(t){var n=t.column,r=t.order,o="asc"===r||"desc"===r?r:void 0;e.setSort(n.fieldName,o),e.load()}}}(a),b=y.onRowClick,g=y.onDbRowClick,k=y.onSelectionChange,S=y.onSortChange,O=function(e){return{onPageChange:function(t){t&&t!==e.curPage&&(e.curPage=t,e.load())},onPageSizeChange:function(t){t&&t!==e.size&&(e.size=t,1===e.curPage&&e.load())},onPageReset:function(){e.curPage=1,e.load()}}}(a),E=O.onPageChange,R=O.onPageReset,j=O.onPageSizeChange,x=m((function(){var t,n=null===(t=e.modelData)||void 0===t||null===(t=t.source.getPSControlParam())||void 0===t?void 0:t.ctrlParams;return"false"!==(null==n?void 0:n.HIGHLIGHT)})),T=null,_=l(0),A=l(null),L=l(null),G=null,M=0,z=function(){var t;if(A.value&&"EMBED"!==(null===(t=e.modal)||void 0===t?void 0:t.mode))if(a.model.source.enablePagingBar&&L.value){var n=L.value.$el,r=n.offsetHeight+parseFloat(window.getComputedStyle(n).paddingTop);_.value=A.value.offsetHeight-r}else _.value=A.value.offsetHeight;a.model.source.height>0&&(_.value=a.model.source.height)};h(A,(function(e,t){e&&e!==t&&(z(),window.ResizeObserver&&A.value&&(G=new ResizeObserver((function(e){var t=e[0].contentRect.height;t!==M&&(z(),M=t)}))).observe(A.value))})),w((function(){G&&G.disconnect()}));var B=m((function(){var e=a.items.map((function(e){return e._checked=a.selectedData.some((function(t){return t.srfkey===e.srfkey})),e}));return e.length?(e.unshift({hiddenRow:!0,_checked:a.items.every((function(e){return e._checked}))}),e):e}));return{c:a,ns:i,columns:d,curColumns:v,tableData:B,onDbRowClick:g,onUIRowClick:function(e,t){null!=T&&window.clearTimeout(T),T=window.setTimeout((function(){var n=o.$refs.grid;n&&(a.selectedData.find((function(t){return t.srfkey===e.srfkey}))&&n.clearCurrentRow(),n.toggleSelect&&n.toggleSelect(t));b(e)}),300)},onUIDbRowClick:function(e){null!=T&&window.clearTimeout(T);var t=o.$refs.grid;t&&(a.selectedData.find((function(t){return t.srfkey===e.srfkey}))||t.clearCurrentRow());g(e)},onSelectionChange:k,onSortChange:S,onPageChange:E,onPageSizeChange:j,onPageReset:R,tableHeight:_,gridRef:A,girdPaginationRef:L,highlight:x,isNotFlex:u,grid:s}},render:function(){var e,t=this;if(this.c.complete&&this.c.loaded){var n={};return this.c.model.columns.forEach((function(e){if("GROUPGRIDCOLUMN"!==e.source.columnType){var r=e.codeName;n[r]=function(e){var n=e.row,o=e.index,i=t.c.rows[o-1];return n.hiddenRow?y("span",{style:"word-break: break-word;white-space: pre-wrap;"},["隐藏行的列"]):i?y(t.c.providers[r].component,{props:{controller:t.c.columns[r],row:i},key:n.srfkey+r}):void 0}}})),this.c.customColumns.forEach((function(e){var r=e.fieldName;n[r]=function(e){var n=e.row,o=e.index,i=t.c.rows[o-1],a=n.children[r];if(i&&a)return y("CheckInGridColumn",{props:{controller:t.c,data:n,value:a},key:n.srfkey+r})}})),y("control-layout",{attrs:{modelData:this.c.model}},[y("div",{ref:"gridRef",class:[this.ns.b(),this.ns.is("show-header",!this.c.model.source.hideHeader),this.ns.is("enable-page",this.c.model.source.enablePagingBar)],style:this.isNotFlex?null===(e=this.grid)||void 0===e?void 0:e.tableStyle:void 0},[y("i-table",{ref:"grid",attrs:{height:this.tableHeight,"show-header":!this.c.model.source.hideHeader,"highlight-row":this.c.singleSelect&&this.highlight,data:this.tableData,columns:this.curColumns,"row-class-name":function(e){return e.hiddenRow?"hidden-row":""},"span-method":this.c.spanMethod.bind(this.c)},class:this.ns.b("content"),on:{"on-row-click":this.onUIRowClick,"on-row-dblclick":this.onUIDbRowClick,"on-selection-change":this.onSelectionChange,"on-sort-change":this.onSortChange},scopedSlots:n}),this.c.model.source.enablePagingBar&&y("appGridPagination",{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}})])])}}}),re=c({name:"IBizCheckInGridColumn",props:{value:{type:Object,required:!0},data:{type:Object,required:!0},controller:{type:Object,required:!0}},setup:function(e){var n=P("checkin-column"),r=l(""),o=m((function(){var n=e.value||{},r=n.shifts,o=void 0===r?[]:r,i=n.work_time,a=(void 0===i?[]:i)[0]||{},c=a.start_base_time,u=a.end_base_time,s=c,l=u,f={title:"休息 (".concat(s," - ").concat(l,")"),value:"rest",name:"休息"},d={title:"白班 (".concat(s," - ").concat(l,")"),value:"work",name:"白班"};if(!o.length)return[d,f];var h=o.map((function(e){var t=e.name;return{title:"".concat(t," (").concat(s," - ").concat(l,")"),value:e.id,name:t,origin:e}}));return[].concat(t(h),[f])})),a=m((function(){var t=e.value||{},n=t.workday,r=t.shift_data;if(!n){var i=o.value.find((function(e){return"rest"===e.value}));return i?i.title:"休息"}if(r){var a=r.name,c=o.value.find((function(e){return e.name===a}));return c?c.title:a}return""})),c=m((function(){if(r.value){var e=o.value.find((function(e){return e.value===r.value}));if(e)return e.title}return""})),s=function(){var t=u(i().m((function t(n){var c,u;return i().w((function(t){for(;;)switch(t.n){case 0:if(e.value){t.n=1;break}return t.a(2);case 1:c=e.controller,(u=o.value.find((function(e){return e.value===n}))).title===a.value?(r.value="",c.removeCheckInData(e.value.id)):(r.value=n,c.setCheckInData(e.value.id,{id:e.value.id,workday:"rest"!==n?1:0,choose_shift:u.origin}));case 2:return t.a(2)}}),t)})));return function(e){return t.apply(this,arguments)}}();return{ns:n,curValue:a,selectValue:c,items:o,selected:r,handleClick:s}},render:function(){var e=this;if(this.value){var t=this.selectValue||this.curValue;return y("i-dropdown",{on:{"on-click":function(t){return e.handleClick(t)}},class:[this.ns.b(),this.ns.m("dropdown"),this.ns.is("active",!!this.selected),this.ns.is("manual",this.value.manual)],attrs:{"transfer-class-name":this.ns.b("popper"),transfer:!0,trigger:"click"}},[y("div",{class:this.ns.e("caption")},[t.replace(/\(.*\)/g,"")]),y("i-dropdownMenu",{slot:"list"},[this.items.map((function(t){return y("i-dropdown-item",{class:[e.ns.e("item")],attrs:{title:t.title,name:t.value,disabled:t.title===(e.selectValue||e.curValue)}},[t.title])}))])])}}}),oe=f((function e(){s(this,e),k(this,"component","CheckinGridControl")}));e("default",{mateUrl:r.meta.url,install:function(e){H.loadStyle(["/style.css"]),e.component("CustomCheckboxList",K),ibiz.register.editor.register("EDITOR_CUSTOMSTYLE_CUSTOM_CHECKBOX_LIST",new X),e.component("SearchFormDynamic",Y),ibiz.register.control.register("SEARCHFORM_RENDER_DYNAMIC",new $),e.component("DataViewExpView",J),ibiz.register.view.register("DELISTEXPVIEW_CARD",new Q),e.component("CheckinGridControl",ne),e.component("CheckInGridColumn",re),ibiz.register.control.register("GRID_RENDER_CHECKIN",new oe)}})}}}))}();
!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||r(e)||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 n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(e,t)||r(e,t)||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(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function c(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return a(l,"_invoke",function(n,r,o){var i,a,c,s=0,l=o||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,c=e,d.n=n,u}};function h(n,r){for(a=n,c=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],h=d.p,v=i[2];n>3?(o=v===r)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,d.v=r,d.n=i[1]):h<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,d.n=v,a=0))}if(o||n>1)return u;throw f=!0,r}return function(o,l,v){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,v),a=l,c=v;(t=a<2?e:c)||!f;){i||(a?a<3?(a>1&&(d.n=-1),h(a,c)):d.n=c:d.v=c);try{if(s=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=d.n<0)?c:n.call(r,d))!==u)break}catch(t){i=e,a=1,c=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),l}var u={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(a(t={},r,(function(){return this})),t),h=f.prototype=s.prototype=Object.create(d);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a(e,o,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=f,a(h,"constructor",f),a(f,"constructor",l),l.displayName="GeneratorFunction",a(f,o,"GeneratorFunction"),a(h),a(h,o,"Generator"),a(h,r,(function(){return this})),a(h,"toString",(function(){return"[object Generator]"})),(i=function(){return{w:c,m:v}})()}function a(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}a=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{function i(t,n){a(e,t,(function(e){return this._invoke(t,n,e)}))}i("next",0),i("throw",1),i("return",2)}},a(e,t,n,r)}function c(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,u,"next",e)}function u(e){c(i,r,o,a,u,"throw",e)}a(void 0)}))}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,S(r.key),r)}}function f(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(t,n,r){return n=y(n),function(t,n){if(n&&("object"==e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)}(t,h()?Reflect.construct(n,r||[],y(t).constructor):n.apply(t,r))}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function v(e,t,n,r){var o=m(y(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=p(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},m.apply(null,arguments)}function p(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function k(e,t,n){return(t=S(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}System.register(["@ibiz-template/runtime","vue","@ibiz-template/vue-util","ramda","@ibiz-template/controller","@ibiz-template/model","qs","@ibiz-template/core","dayjs"],(function(e,r){"use strict";var o,a,c,l,h,m,p,y,g,w,S,O,P,D,E,R,j,I,x,N,T,_,A,L,G,M,z,B,V,F,U;return{setters:[function(e){o=e.PluginStaticResource,a=e.ViewMode},function(e){c=e.defineComponent,l=e.ref,h=e.watch,m=e.computed,p=e.getCurrentInstance,y=e.h,g=e.toRef,w=e.onUnmounted},function(e){S=e.getCheckboxProps,O=e.getEditorEmits,P=e.useNamespace,D=e.useControlController,E=e.useListExpViewController,R=e.useRoute,j=e.useRouteKey,I=e.usePropsWatch},function(e){x=e.isNil,N=e.clone},function(e){T=e.CheckBoxListEditorController,_=e.SearchFormController,A=e.FormNotifyState,L=e.GridController,G=e.GridRowController,M=e.GridNotifyState},function(e){z=e.SearchFormModel,B=e.GridModel},function(e){V=e.default},function(e){F=e.promiseAllSettled},function(e){U=e.default}],execute:function(){var H=new o(r.meta.url),K=c({name:"CustomCheckboxList",props:S(),emits:O(),setup:function(e,t){var n=t.emit,r=P("checkbox"),o=e.controller,i=o.model.codeList,a=l([]);h((function(){return e.data}),(function(e){o.loadCodeList(e).then((function(e){a.value=e}))}),{immediate:!0,deep:!0});var c=m((function(){return i&&i.orMode?i.orMode.toLowerCase():"str"})),u=",";i&&i.valueSeparator&&(u=i.valueSeparator);var s=m({get:function(){if(!x(e.value)){if(Object.is(c.value,"num")&&a){var t=[],n="string"==typeof e.value?parseInt(e.value,10):e.value;return a.value.forEach((function(e){(n&e.value)===e.value&&t.push(e.value)})),t}if(Object.is(c.value,"str")){var r=e.value;if(""!==r){if(i){var o=r.split(u);if(i.codeItemValueNumber)for(var s=0,l=o.length;s<l;s++)o[s]=Number(o[s]);return o}return r.split(",")}}}return[]},set:function(e){var t=null;if(Object.is(c.value,"num")){var r=0;e.forEach((function(e){var t="string"==typeof e?parseInt(e,10):e;r|=t})),t=r}else if(Object.is(c.value,"str")){var o=[];a.value.length>0&&(a.value.forEach((function(t){-1!==e.findIndex((function(e){return Object.is(t.value,e)}))&&o.push(t.value)})),t=o.join(u))}n("change",t)}}),f=m((function(){var e=Array.isArray(s.value)?s.value:[s.value];return a.value.filter((function(t){return e.includes(t.value)})).map((function(e){return e.text})).join("、")}));return{ns:r,items:a,selectArray:s,valueText:f,onSelectArrayChange:function(e){s.value=e},c:o}},render:function(e){var t=this;return e("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):""]},[[this.readonly&&this.valueText,!this.readonly&&e("ICheckboxGroup",{props:C(C({},this.c.customProps),{},{value:this.selectArray}),on:{"on-change":this.onSelectArrayChange}},[this.items.map((function(n,r){return e("i-checkbox",{key:r,attrs:{label:n.value,disabled:t.disabled||t.c.disabledList.includes(n.value)}},[e("span",{class:t.ns.e("text")},[n.text])])}))])]])}}),q=function(e){function t(){var e;s(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return k(e=d(this,t,[].concat(r)),"disabledList",[]),e}return b(t,e),f(t,[{key:"onInit",value:(n=u(i().m((function e(){var n,r;return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,v(t,"onInit",this,3)([]);case 1:if(null!==(n=this.editorParams)&&void 0!==n&&n.DEFAULTDISABLEDLIST)try{this.disabledList=JSON.parse(null===(r=this.editorParams)||void 0===r?void 0:r.DEFAULTDISABLEDLIST)}catch(o){this.disabledList=[]}case 2:return e.a(2)}}),e,this)}))),function(){return n.apply(this,arguments)})}]);var n}(T),W=function(e){function t(){var e;s(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return k(e=d(this,t,[].concat(r)),"filterParams",[]),e}return b(t,e),f(t,[{key:"onInit",value:(r=u(i().m((function e(){var n;return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,v(t,"onInit",this,3)([]);case 1:if(n=this.controlParams.FILTERPARAMS)try{this.filterParams=JSON.parse(n)}catch(r){this.filterParams=[]}case 2:return e.a(2)}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getParams",value:function(){var e=C({},this.data.getRequestData());if(this.filterParams){var t={};return this.filterParams.forEach((function(n){Object.assign(t,k({},n,e[n]))})),t}return e}},{key:"reset",value:(n=u(i().m((function e(){var t,n=this;return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.service.getDraft(this.context,this.params);case 1:return t=e.v,this.filterParams.forEach((function(e){Object.assign(n.data,k({},e,t.data[e]))})),this.isLoaded=!0,Object.values(this.details).forEach((function(e){n.filterParams.includes(e.model.codeName)&&e.formStateNotify(A.DRAFT)})),this.force(),e.n=2,this.nerve.self.evt.asyncEmit("search");case 2:return e.a(2)}}),e,this)}))),function(){return n.apply(this,arguments)})}]);var n,r}(_),Y=c({name:"SearchFormDynamic",props:{controller:{type:Object,required:!0},modelData:{type:z,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}}},setup:function(e){var t=p().proxy;return{c:D(t,(function(){return new W(e.modelData,e.context,e.params)})),ns:P("search-form"),btntype:e.modelData.source.searchButtonStyle}},render:function(){var e=this;if(this.c.complete)return y("div",{class:[this.ns.b(),this.ns.m(this.btntype).toLowerCase()]},[y("form-control",{attrs:{"model-data":this.modelData,context:this.context,controller:this.c},nativeOn:{keyup:function(t){return e.c.onKeyUp(t)}}}),"NONE"===this.c.model.source.searchButtonStyle?null:y("div",{class:this.ns.b("buttons")},[y("i-button",{class:this.ns.be("buttons","search"),on:{click:function(){return e.c.onSearchButtonClick()}}},["查询"]),y("i-button",{class:this.ns.be("buttons","reset"),on:{click:function(){return e.c.reset()}}},["重置"])])])}}),X=function(){return f((function e(){s(this,e),k(this,"formEditor","CustomCheckboxList"),k(this,"gridEditor","CustomCheckboxList")}),[{key:"createController",value:(e=u(i().m((function e(t,n){var r;return i().w((function(e){for(;;)switch(e.n){case 0:return r=new q(t,n),e.n=1,r.init();case 1:return e.a(2,r)}}),e)}))),function(t,n){return e.apply(this,arguments)})}]);var e}(),$=f((function e(){s(this,e),k(this,"component","SearchFormDynamic")})),J=c({name:"DataViewExpView",props:{context:Object,params:{type:Object},srfnav:String,modelPath:{type:String,required:!0},modal:{type:Object},noLoadDefault:{type:Boolean,required:!1}},setup:function(e){var t=p().proxy,n=E(t,e.modelPath),r=l(""),o=l([]),i=P("dataview-exp");if(!0===n.context.isRouter){var a=R(t);n.nerve.self.evt.on("created",(function(){if(a.params.params1){var e=a.params.params1,i=V.parse(e,{delimiter:";"})[n.model.appEntity.deName];i&&(n.navItem.key=i,o.value=[i])}j(g(n.navItem,"key"),t,r)}))}return{c:n,ns:i,defaultSelectKeys:o,routeViewKey:r}},render:function(){var e=this,t=!0===this.c.context.isRouter,n=null,r=null;if(this.c.complete){var o=this.c.model.listExpBar,i=o.list;r=o,this.c.providers[i.name]&&(n=y(this.c.providers[i.name].component,{props:{modelData:i,context:this.c.context,params:this.c.params,isExpView:!0,isSelectFirstDefault:!0,mdCtrlActiveMode:1,defaultSelectKeys:this.defaultSelectKeys},on:{neuronInit:this.c.nerve.onNeuronInit(i.name)}})),r.width=0}return y("div",{class:this.ns.b()},[y("exp-view-base",{attrs:{controller:this.c,expBarModel:r},scopedSlots:{expView:function(){if(e.c.complete){var n=e.c.model.listExpBar.list;return n.navView?t?e.routeViewKey?y("router-view",{key:e.routeViewKey}):null:y("ViewShell",{attrs:{context:e.c.navItem.context,params:e.c.navItem.params,modal:{mode:a.EMBED},modelPath:n.navView.source.modelPath},key:e.c.navItem.key}):null}}}}),n])}}),Q=f((function e(){s(this,e),k(this,"component","DataViewExpView")}));function Z(e,t){var n,r,o=[];"GROUPGRIDCOLUMN"===e.source.columnType&&e.children.forEach((function(e){o.push(Z(e,t))}));var i={title:e.title,width:"STAR"===e.source.widthUnit?void 0:e.width,minWidth:e.width,align:(null===(n=e.source.align)||void 0===n?void 0:n.toLowerCase())||"center",slot:e.codeName,key:e.codeName,fieldName:e.deFieldName,ellipsis:!0,tooltip:!1,resizable:!0,sortable:!(t.noSort||!e.source.enableSort)&&"custom",columnType:e.source.columnType,userParams:e.source.userParams,className:null===(r=e.source.getCellPSSysCss())||void 0===r?void 0:r.cssName};return o.length>0&&Object.assign(i,{children:o}),i}function ee(e){var t=e.model,n=[],r=t.columns.map((function(t){return Z(t,e)}));return t.children.forEach((function(e){var t=r.find((function(t){return t.key===e.codeName}));t&&n.push(t)})),e.singleSelect||n.splice(0,0,{type:"selection",width:60}),n}var te=function(e){function t(){var e;s(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return k(e=d(this,t,[].concat(r)),"weekDays",["日","一","二","三","四","五","六"]),k(e,"customColumns",[]),k(e,"loaded",!1),k(e,"checkinData",[]),e}return b(t,e),f(t,[{key:"onInit",value:(a=u(i().m((function e(){return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,v(t,"onInit",this,3)([]);case 1:return e.n=2,this.initMonthColumns();case 2:return e.a(2)}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"initMonthColumns",value:(o=u(i().m((function e(){var t,n,r,o,a,c,u;return i().w((function(e){for(;;)switch(e.n){case 0:for(t=U().daysInMonth(),n=U(),r=1;r<=t;r++)o=U("".concat(n.year(),"-").concat(n.month()+1,"-").concat(r)),a=o.day(),c=o.format("YYYY-MM-DD"),u={align:"center",className:void 0,columnType:"DEFGRIDCOLUMN",ellipsis:!0,fieldName:"".concat(c),key:"".concat(c),minWidth:100,resizable:!0,slot:"".concat(c),sortable:"custom",title:"".concat(r,"\n").concat(this.weekDays[a]),tooltip:!1,width:100,userParam:{columnType:"date"}},this.customColumns.push(u);case 1:return e.a(2)}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"afterLoad",value:(r=u(i().m((function e(t){var n=this;return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,F(Object.values(this.fieldColumns).map(function(){var e=u(i().m((function e(t){return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,t.loadCodeList();case 1:return e.a(2)}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:return e.n=2,this.initGroup();case 2:return this.items=this.calcDayData(t),this.items.forEach((function(e,t){e.srfserialnum=t+1})),this.rows=this.items.map((function(e){var t=new G(e,n);return n.gridStateNotify(t,M.LOAD),t})),this.loaded=!0,e.a(2,t)}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"calcDayData",value:function(e){var t=[];return e.forEach((function(e){var n=t.findIndex((function(t){return t.member_id===e.member_id}));-1===n?(e.children=k({},e.checkin_date,C({},e)),t.push(e)):t[n].children[e.checkin_date]=e})),t}},{key:"setCheckInData",value:function(e,t){var n=this.checkinData.findIndex((function(t){return t.id===e}));-1===n?this.checkinData.push(t):this.checkinData[n]=t}},{key:"removeCheckInData",value:function(e){var t=this.checkinData.findIndex((function(t){return t.id===e}));-1!==t&&this.checkinData.splice(t,1)}},{key:"saveCheckInData",value:(n=u(i().m((function e(){return i().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,ibiz.net.post("/schedules/manual",this.checkinData);case 1:e.v.ok&&(this.loaded=!1,this.checkinData=[],this.load());case 2:return e.a(2)}}),e,this)}))),function(){return n.apply(this,arguments)})}]);var n,r,o,a}(L);var ne=c({props:{controller:{type:Object,required:!0},modelData:B,context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}},gridRowActiveMode:{type:Number,default:2},modal:{type:Object}},setup:function(e){var r,o=p().proxy,i=P("grid"),a=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return D(e,(function(){var o=new te(t,n,r);return I(e,"gridRowActiveMode",o.setGridRowActiveMode.bind(o)),o}))}(o,e.modelData,e.context,e.params),c=a.model.source.getPSControlParam(),u="true"===(null==c||null===(r=c.ctrlParams)||void 0===r?void 0:r.IS_NOT_FLEX),s=l(),f=function(e){var t=l([]);e.nerve.self.evt.on("created",(function(){t.value=ee(e)}));var n=function(t){return t.filter((function(t){return!e.hiddenColumnKeys.includes(t.key)&&(t.children&&t.children.length&&(t.children=n(t.children)),!0)}))};return[m((function(){var r,o=N(t.value),i=(o=n(o)).find((function(e){return!e.width})),a=null===(r=e.model.source.getPSControlParam())||void 0===r?void 0:r.ctrlParams,c="true"===(null==a?void 0:a.IS_NOT_FLEX);if(!i&&!c){var u=o.length-1;"rowEdit"===o[u].key&&(u-=1),o[u]=C(C({},o[u]),{},{width:void 0})}var s=o.find((function(e){return"UAGRIDCOLUMN"===e.columnType}));if(s){var l=s.userParams;l&&"true"===l.fixed&&(s.fixed="right")}return o.forEach((function(t){t.fixed="left","TRUE"!==ibiz.env.enableGridRowBreak&&!0!==ibiz.env.enableGridRowBreak||(t.ellipsis=!1),e.controlParams.ENABLEGRIDROWBREAK&&(t.ellipsis="TRUE"!==e.controlParams.ENABLEGRIDROWBREAK)})),o})),t]}(a),d=n(f,1)[0],v=m((function(){return[].concat(t(d.value),t(a.customColumns))})),y=function(e){var t=function(t){return e.items.find((function(e){return e.srfkey===t.srfkey}))};return{onRowClick:function(n){var r=t(n);if(e.singleSelect){var o=e.selectedData.find((function(e){return e.srfkey===n.srfkey}));e.onSelectionChange(o?[]:[r])}e.onRowClick(r)},onDbRowClick:function(n){e.onDbRowClick(t(n))},onSelectionChange:function(n){if(!e.singleSelect){var r=[];n.forEach((function(e){var n=t(e);n&&r.push(n)})),e.onSelectionChange(r)}},onSortChange:function(t){var n=t.column,r=t.order,o="asc"===r||"desc"===r?r:void 0;e.setSort(n.fieldName,o),e.load()}}}(a),b=y.onRowClick,g=y.onDbRowClick,k=y.onSelectionChange,S=y.onSortChange,O=function(e){return{onPageChange:function(t){t&&t!==e.curPage&&(e.curPage=t,e.load())},onPageSizeChange:function(t){t&&t!==e.size&&(e.size=t,1===e.curPage&&e.load())},onPageReset:function(){e.curPage=1,e.load()}}}(a),E=O.onPageChange,R=O.onPageReset,j=O.onPageSizeChange,x=m((function(){var t,n=null===(t=e.modelData)||void 0===t||null===(t=t.source.getPSControlParam())||void 0===t?void 0:t.ctrlParams;return"false"!==(null==n?void 0:n.HIGHLIGHT)})),T=null,_=l(0),A=l(null),L=l(null),G=null,M=0,z=function(){var t;if(A.value&&"EMBED"!==(null===(t=e.modal)||void 0===t?void 0:t.mode))if(a.model.source.enablePagingBar&&L.value){var n=L.value.$el,r=n.offsetHeight+parseFloat(window.getComputedStyle(n).paddingTop);_.value=A.value.offsetHeight-r}else _.value=A.value.offsetHeight;a.model.source.height>0&&(_.value=a.model.source.height)};h(A,(function(e,t){e&&e!==t&&(z(),window.ResizeObserver&&A.value&&(G=new ResizeObserver((function(e){var t=e[0].contentRect.height;t!==M&&(z(),M=t)}))).observe(A.value))})),w((function(){G&&G.disconnect()}));var B=m((function(){var e=a.items.map((function(e){return e._checked=a.selectedData.some((function(t){return t.srfkey===e.srfkey})),e}));return e.length?(e.unshift({hiddenRow:!0,_checked:a.items.every((function(e){return e._checked}))}),e):e}));return{c:a,ns:i,columns:d,curColumns:v,tableData:B,onDbRowClick:g,onUIRowClick:function(e,t){null!=T&&window.clearTimeout(T),T=window.setTimeout((function(){var n=o.$refs.grid;n&&(a.selectedData.find((function(t){return t.srfkey===e.srfkey}))&&n.clearCurrentRow(),n.toggleSelect&&n.toggleSelect(t));b(e)}),300)},onUIDbRowClick:function(e){null!=T&&window.clearTimeout(T);var t=o.$refs.grid;t&&(a.selectedData.find((function(t){return t.srfkey===e.srfkey}))||t.clearCurrentRow());g(e)},onSelectionChange:k,onSortChange:S,onPageChange:E,onPageSizeChange:j,onPageReset:R,tableHeight:_,gridRef:A,girdPaginationRef:L,highlight:x,isNotFlex:u,grid:s}},render:function(){var e,t=this;if(this.c.complete&&this.c.loaded){var n={};return this.c.model.columns.forEach((function(e){if("GROUPGRIDCOLUMN"!==e.source.columnType){var r=e.codeName;n[r]=function(e){var n=e.row,o=e.index,i=t.c.rows[o-1];return n.hiddenRow?y("span",{style:"word-break: break-word;white-space: pre-wrap;"},["隐藏行的列"]):i?y(t.c.providers[r].component,{props:{controller:t.c.columns[r],row:i},key:n.srfkey+r}):void 0}}})),this.c.customColumns.forEach((function(e){var r=e.fieldName;n[r]=function(e){var n=e.row,o=e.index,i=t.c.rows[o-1],a=n.children[r];if(i&&a)return y("CheckInGridColumn",{props:{controller:t.c,data:n,value:a},key:n.srfkey+r})}})),y("control-layout",{attrs:{modelData:this.c.model}},[y("div",{ref:"gridRef",class:[this.ns.b(),this.ns.is("show-header",!this.c.model.source.hideHeader),this.ns.is("enable-page",this.c.model.source.enablePagingBar)],style:this.isNotFlex?null===(e=this.grid)||void 0===e?void 0:e.tableStyle:void 0},[y("i-table",{ref:"grid",attrs:{height:this.tableHeight,"show-header":!this.c.model.source.hideHeader,"highlight-row":this.c.singleSelect&&this.highlight,data:this.tableData,columns:this.curColumns,"row-class-name":function(e){return e.hiddenRow?"hidden-row":""},"span-method":this.c.spanMethod.bind(this.c)},class:this.ns.b("content"),on:{"on-row-click":this.onUIRowClick,"on-row-dblclick":this.onUIDbRowClick,"on-selection-change":this.onSelectionChange,"on-sort-change":this.onSortChange},scopedSlots:n}),this.c.model.source.enablePagingBar&&y("appGridPagination",{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}})])])}}}),re=c({name:"IBizCheckInGridColumn",props:{value:{type:Object,required:!0},data:{type:Object,required:!0},controller:{type:Object,required:!0}},setup:function(e){var n=P("checkin-column"),r=l(""),o=m((function(){var n=e.value||{},r=n.shifts,o=void 0===r?[]:r,i=n.work_time,a=(void 0===i?[]:i)[0]||{},c=a.start_base_time,u=a.end_base_time,s="";c&&u&&(s="(".concat(c," - ").concat(u,")"));var l={title:"休息".concat(s),value:"rest",name:"休息"},f={title:"白班".concat(s),value:"work",name:"白班"};if(!o.length)return[f,l];var d=o.map((function(e){var t=e.name;return{title:"".concat(t).concat(s),value:e.id,name:t,origin:e}}));return[].concat(t(d),[l])})),a=m((function(){var t=e.value||{},n=t.workday,r=t.shift_data;if(!n){var i=o.value.find((function(e){return"rest"===e.value}));return i?i.title:"休息"}if(r){var a=r.name,c=o.value.find((function(e){return e.name===a}));return c?c.title:a}return""})),c=m((function(){if(r.value){var e=o.value.find((function(e){return e.value===r.value}));if(e)return e.title}return""})),s=function(){var t=u(i().m((function t(n){var c,u;return i().w((function(t){for(;;)switch(t.n){case 0:if(e.value){t.n=1;break}return t.a(2);case 1:c=e.controller,(u=o.value.find((function(e){return e.value===n}))).title===a.value?(r.value="",c.removeCheckInData(e.value.id)):(r.value=n,c.setCheckInData(e.value.id,{id:e.value.id,workday:"rest"!==n?1:0,choose_shift:u.origin}));case 2:return t.a(2)}}),t)})));return function(e){return t.apply(this,arguments)}}();return{ns:n,curValue:a,selectValue:c,items:o,selected:r,handleClick:s}},render:function(){var e=this;if(this.value){var t=this.selectValue||this.curValue;return y("i-dropdown",{on:{"on-click":function(t){return e.handleClick(t)}},class:[this.ns.b(),this.ns.m("dropdown"),this.ns.is("active",!!this.selected),this.ns.is("manual",this.value.manual)],attrs:{"transfer-class-name":this.ns.b("popper"),transfer:!0,trigger:"click"}},[y("div",{class:this.ns.e("caption")},[t.replace(/\(.*\)/g,"")]),y("i-dropdownMenu",{slot:"list"},[this.items.map((function(t){return y("i-dropdown-item",{class:[e.ns.e("item")],attrs:{title:t.title,name:t.value,disabled:t.title===(e.selectValue||e.curValue)}},[t.title])}))])])}}}),oe=f((function e(){s(this,e),k(this,"component","CheckinGridControl")}));e("default",{mateUrl:r.meta.url,install:function(e){H.loadStyle(["/style.css"]),e.component("CustomCheckboxList",K),ibiz.register.editor.register("EDITOR_CUSTOMSTYLE_CUSTOM_CHECKBOX_LIST",new X),e.component("SearchFormDynamic",Y),ibiz.register.control.register("SEARCHFORM_RENDER_DYNAMIC",new $),e.component("DataViewExpView",J),ibiz.register.view.register("DELISTEXPVIEW_CARD",new Q),e.component("CheckinGridControl",ne),e.component("CheckInGridColumn",re),ibiz.register.control.register("GRID_RENDER_CHECKIN",new oe)}})}}}))}();
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册