提交 bc007b9c 编写于 作者: zhangpingchuan's avatar zhangpingchuan

feat: 更新插件

上级 8c86ddce
@charset "UTF-8";.ibiz-form-data-comparison{height:calc(100% - 20px);overflow:auto}.ibiz-form-data-comparison__content{display:flex}.ibiz-form-data-comparison__top-hidesame-content{display:flex;place-content:center space-between;align-items:center;height:50px;margin-bottom:10px}.ibiz-form-data-comparison__top-content{display:flex;width:100%;text-align:center;background-color:#f2f2f2;border-left:1px solid lightgray}.ibiz-form-data-comparison__top-content--attr{width:200px;border:1px solid lightgray;padding:5px 10px}.ibiz-form-data-comparison__top-content--left{flex:1;width:calc(100% - 100px);border:1px solid lightgray;padding:5px 10px}.ibiz-form-data-comparison__top-content--right{flex:1;border:1px solid lightgray;width:calc(100% - 100px);padding:5px 10px}.ibiz-form-data-comparison__top-hidesame-content-right{display:flex;flex-flow:row nowrap;place-content:center center;align-items:center}.ibiz-form-data-comparison__top-hidesame-content-right-item{display:flex;flex-direction:row;place-content:center space-around;align-items:center;width:60px;height:30px}.ibiz-form-data-comparison__top-hidesame-content-right-item-add{width:16px;height:16px;background:#d5f3e0}.ibiz-form-data-comparison__top-hidesame-content-right-item-change{width:16px;height:16px;background:#fceecd}.ibiz-form-data-comparison__top-hidesame-content-right-item-delete{width:16px;height:16px;background:#ffd5d5}.ibiz-form-data-comparison__form-grid-item{--ibiz-text-color-readonly: black;display:flex;width:100%}.ibiz-form-data-comparison__form-grid-item--name{border:1px solid lightgray;padding:5px 10px;width:200px;text-align:center}.ibiz-form-data-comparison__form-grid-item--left,.ibiz-form-data-comparison__form-grid-item--right{border:1px solid lightgray;padding:5px 10px;flex:1;text-align:center}.ibiz-form-data-comparison__form-grid-item.is-add .ibiz-form-data-comparison__form-grid-item--left,.ibiz-form-data-comparison__form-grid-item.is-add .ibiz-form-data-comparison__form-grid-item--right{background-color:#d5f3e0}.ibiz-form-data-comparison__form-grid-item.is-update .ibiz-form-data-comparison__form-grid-item--left,.ibiz-form-data-comparison__form-grid-item.is-update .ibiz-form-data-comparison__form-grid-item--right{background-color:#fceecd}.ibiz-form-data-comparison__form-grid-item.is-delete .ibiz-form-data-comparison__form-grid-item--left,.ibiz-form-data-comparison__form-grid-item.is-delete .ibiz-form-data-comparison__form-grid-item--right{background-color:#ffd5d5}.ibiz-form-data-comparison__form-page{width:100%}.ibiz-form-data-comparison__druipart{display:flex}.ibiz-form-data-comparison__druipart--caption{width:200px;border:1px solid lightgray;display:flex;align-items:center;justify-content:center}.ibiz-form-data-comparison__druipart--left{border:1px solid lightgray;padding:16px;flex:1;width:calc(50% - 100px)}.ibiz-form-data-comparison__druipart--right{border:1px solid lightgray;flex:1;padding:16px;width:calc(50% - 100px)}.ibiz-form-data-comparison__druipart.is-add .ibiz-form-data-comparison__druipart--left,.ibiz-form-data-comparison__druipart.is-add .ibiz-form-data-comparison__druipart--right{background-color:#d5f3e0}.ibiz-form-data-comparison__druipart.is-update .ibiz-form-data-comparison__druipart--left,.ibiz-form-data-comparison__druipart.is-update .ibiz-form-data-comparison__druipart--right{background-color:#fceecd}.ibiz-form-data-comparison__druipart.is-delete .ibiz-form-data-comparison__druipart--left,.ibiz-form-data-comparison__druipart.is-delete .ibiz-form-data-comparison__druipart--right{background-color:#ffd5d5}.ibiz-form-data-comparison-group{width:100%}.ibiz-form-data-comparison-group__header{width:100%;border-left:1px solid lightgray;display:flex}.ibiz-form-data-comparison-group__header--name{width:200px;border:1px solid lightgray;max-width:200px;text-align:center;position:relative;font-size:14px;padding:4px}.ibiz-form-data-comparison-group__header div{flex:1;text-align:center;border:1px solid lightgray}.ibiz-form-data-comparison-group__header--icon{position:absolute;font-size:24px;left:4px;cursor:pointer}.ibiz-form-data-comparison-group__header--name-text{flex:1}.ibiz-form-data-comparison-group__header.is-hide-caption{display:none}.ibiz-form-data-comparison-group__content{border-left:1px solid lightgray}.ibiz-form-data-comparison-group__content.is-collapse{display:none}
var k = Object.defineProperty;
var q = (r, a, i) => a in r ? k(r, a, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[a] = i;
var d = (r, a, i) => (q(r, typeof a != "symbol" ? a + "" : a, i), i);
import { EditFormModel as J } from "@ibiz-template/model";
import { useNamespace as W, useControlController as Y, usePropsWatch as _ } from "@ibiz-template/vue-util";
import { defineComponent as $, getCurrentInstance as H, ref as p, watch as K, h as s } from "vue";
import { createUUID as R } from "qx-util";
import { ViewMode as V, PluginStaticResource as Q } from "@ibiz-template/runtime";
import { EditFormController as X } from "@ibiz-template/controller";
import { ControlVO as Z } from "@ibiz-template/service";
class ee extends X {
var q = Object.defineProperty;
var J = (r, a, i) => a in r ? q(r, a, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[a] = i;
var d = (r, a, i) => (J(r, typeof a != "symbol" ? a + "" : a, i), i);
import { EditFormModel as W } from "@ibiz-template/model";
import { useNamespace as Y, useControlController as $, usePropsWatch as _ } from "@ibiz-template/vue-util";
import { defineComponent as H, getCurrentInstance as K, ref as u, watch as Q, h as s } from "vue";
import { createUUID as V } from "qx-util";
import { ViewMode as L, PluginStaticResource as X } from "@ibiz-template/runtime";
import { EditFormController as Z } from "@ibiz-template/controller";
import { ControlVO as ee } from "@ibiz-template/service";
class te extends Z {
constructor() {
super(...arguments);
/**
......@@ -36,7 +36,7 @@ class ee extends X {
* @type {IData}
* @memberof FormController
*/
d(this, "oldData", new Z());
d(this, "oldData", new ee());
/**
* version数据
*
......@@ -110,18 +110,18 @@ class ee extends X {
*/
async loadGridData() {
await this.startLoading();
const i = this.model.source.M.getPSControlParam.ctrlParams, { BASEENTITY: o, COMPAREENTITY: y } = i, h = await ibiz.entityService.getService(o), v = await ibiz.entityService.getService(y), f = Object.assign({}, this.context.clone(), {
const i = this.model.source.M.getPSControlParam.ctrlParams, { BASEENTITY: o, COMPAREENTITY: h } = i, E = await ibiz.entityService.getService(o), v = await ibiz.entityService.getService(h), f = Object.assign({}, this.context.clone(), {
[o.toLowerCase()]: this.params.base_version
}), w = Object.assign({}, this.context.clone(), {
[y.toLowerCase()]: this.params.compare_version
}), D = await h.exec("Get", f, this.params), g = await v.exec(
}), y = Object.assign({}, this.context.clone(), {
[h.toLowerCase()]: this.params.compare_version
}), w = await E.exec("Get", f, this.params), D = await v.exec(
"Get",
w,
y,
this.params
);
return this.isLoaded = !0, {
baseData: D.data.data,
compareData: g.data.data
baseData: w.data.data,
compareData: D.data.data
};
}
/**
......@@ -146,11 +146,11 @@ class ee extends X {
return JSON.stringify(i) !== JSON.stringify(o);
}
}
const te = $({
const se = H({
name: "IBizFormDataComparison",
props: {
modelData: {
type: J,
type: W,
required: !0
},
context: {
......@@ -167,38 +167,38 @@ const te = $({
}
},
setup(r) {
const a = W("form-data-comparison"), {
const a = Y("form-data-comparison"), {
proxy: i
} = H(), o = Y(i, () => {
const e = new ee(r.modelData, r.context, r.params);
} = K(), o = $(i, () => {
const e = new te(r.modelData, r.context, r.params);
return _(i, "enableAutoSave", e.setEnableAutoSave.bind(e)), e;
}), y = p(!1), h = p({}), v = p({}), f = p([]), w = [], D = p([]), g = p([]), B = p([]), L = /* @__PURE__ */ new Map(), P = p(0), I = (e) => {
}), h = u(!0), E = u(!1), v = u({}), f = u({}), y = u([]), w = [], D = u([]), B = u([]), P = u([]), j = /* @__PURE__ */ new Map(), I = u(0), x = (e) => {
const t = [];
if (t.push(e), e && e.children) {
const n = [];
e.children.forEach((c) => {
const u = I(c);
n.push(...u);
const m = x(c);
n.push(...m);
}), t.push(...n);
}
return t;
}, j = I(r.modelData);
w.push(...j);
const x = (e) => {
}, z = x(r.modelData);
w.push(...z);
const O = (e) => {
const t = o.details[e.source.name], n = s("not-supported-editor", {
attrs: {
modelData: e.editor
}
});
return s("div", {
class: [a.e("form-grid-item"), a.is("add", D.value.includes(e.source.name)), a.is("update", B.value.includes(e.source.name)), a.is("delete", g.value.includes(e.source.name))]
class: [a.e("form-grid-item"), a.is("add", D.value.includes(e.source.name)), a.is("update", P.value.includes(e.source.name)), a.is("delete", B.value.includes(e.source.name))]
}, [s("div", {
class: a.em("form-grid-item", "name")
}, [e.source.caption]), s("div", {
class: a.em("form-grid-item", "left")
}, [t.editorProvider ? s(t.editorProvider.formEditor, {
props: {
value: v.value[e.source.name],
value: f.value[e.source.name],
data: t.data,
controller: t.editor,
disabled: t.disabled,
......@@ -208,71 +208,73 @@ const te = $({
class: a.em("form-grid-item", "right")
}, [t.editorProvider ? s(t.editorProvider.formEditor, {
props: {
value: h.value[e.source.name],
value: v.value[e.source.name],
data: t.data,
controller: t.editor,
disabled: t.disabled,
readonly: !0
}
}) : n])]);
}, O = (e, t) => {
L.set(e.source.id, t), t.evt.on("mounted", () => {
o.startLoading(), P.value += 1, t.call.refresh();
}, S = (e, t) => {
j.set(e.source.id, t), t.evt.on("mounted", () => {
h.value && o.startLoading(), I.value += 1, t.call.refresh();
}), t.evt.on("refreshed", () => {
P.value -= 1, setTimeout(() => {
o.endLoading();
I.value -= 1, setTimeout(() => {
h.value && o.endLoading();
}, 500);
});
}, z = (e) => {
const t = w.find((E) => E.id === `${e.source.id}_srfcopy`), n = e.embedView.source.modelPath, c = t == null ? void 0 : t.embedView.source.modelPath, u = o.context.clone(), l = {
}, G = (e) => {
const t = w.find((b) => b.id === `${e.source.id}_srfcopy`), n = e.embedView.source.modelPath, c = t == null ? void 0 : t.embedView.source.modelPath, m = o.context.clone(), l = {
base_version: r.params.base_version
}, m = o.context.clone();
Object.assign(m, {
}, p = o.context.clone();
Object.assign(p, {
gysrlzy_info: r.params.compare_version,
compare_version: r.params.compare_version
});
const b = {
const g = {
compare_version: r.params.compare_version
}, F = h.value[e.source.userTag], C = v.value[t == null ? void 0 : t.source.userTag];
let T = !1, M = !1, A = !1;
return o.isFalseyButNotEmpty(F) && !o.isFalseyButNotEmpty(C) ? T = !0 : !o.isFalseyButNotEmpty(F) && o.isFalseyButNotEmpty(C) ? A = !0 : !o.isFalseyButNotEmpty(F) && !o.isFalseyButNotEmpty(C) && o.compareObjectValues(F, C) && (M = !0), s("div", {
class: [a.e("druipart"), a.is("add", T), a.is("update", M), a.is("delete", A)]
}, F = v.value[e.source.userTag], C = f.value[t == null ? void 0 : t.source.userTag];
let M = !1, A = !1, R = !1;
return o.isFalseyButNotEmpty(F) && !o.isFalseyButNotEmpty(C) ? M = !0 : !o.isFalseyButNotEmpty(F) && o.isFalseyButNotEmpty(C) ? R = !0 : !o.isFalseyButNotEmpty(F) && !o.isFalseyButNotEmpty(C) && o.compareObjectValues(F, C) && (A = !0), s("div", {
class: [a.e("druipart"), a.is("add", M), a.is("update", A), a.is("delete", R)]
}, [s("div", {
class: a.em("druipart", "caption")
}, [e.source.caption]), s("div", {
class: a.em("druipart", "left")
}, [c && s("ViewShell", {
attrs: {
context: m,
params: b,
context: p,
params: g,
modal: {
mode: V.EMBED
mode: L.EMBED
},
modelPath: c,
noLoadDefault: !0
noLoadDefault: !0,
name: t == null ? void 0 : t.source.id
},
key: R(),
key: V(),
on: {
neuronInit: (E) => O(t, E)
neuronInit: (b) => S(t, b)
}
})]), s("div", {
class: a.em("druipart", "right")
}, [n && s("ViewShell", {
attrs: {
context: u,
context: m,
params: l,
modal: {
mode: V.EMBED
mode: L.EMBED
},
modelPath: n,
noLoadDefault: !0
noLoadDefault: !0,
name: e.source.id
},
key: R(),
key: V(),
on: {
neuronInit: (E) => O(e, E)
neuronInit: (b) => S(e, b)
}
})])]);
}, G = (e) => {
}, U = (e) => {
const t = {
modelData: e,
controller: o.details[e.source.name]
......@@ -281,7 +283,7 @@ const te = $({
...t
},
key: e.id
}), u = s(n.component, {
}), m = s(n.component, {
props: {
...t
},
......@@ -295,10 +297,11 @@ const te = $({
class: a.em("mdctrl", "left")
}, [c]), s("div", {
class: a.em("mdctrl", "right")
}, [u])]);
}, S = (e) => {
const t = f.value.findIndex((n) => n === e.source.name);
t > -1 ? f.value.splice(t, 1) : f.value.push(e.source.name);
}, [m])]);
}, T = (e) => {
h.value = !1;
const t = y.value.findIndex((n) => n === e.source.name);
t > -1 ? y.value.splice(t, 1) : y.value.push(e.source.name);
}, N = (e) => {
if (!e.source.hidden) {
if (e.source.detailType === "FORMPAGE")
......@@ -306,11 +309,11 @@ const te = $({
class: a.e("form-page")
}, [e.children.map((t) => N(t))]);
if (e.source.detailType === "FORMITEM") {
const t = D.value.includes(e.source.name), n = g.value.includes(e.source.name), c = B.value.includes(e.source.name);
return y.value && !t && !n && !c ? null : x(e);
const t = D.value.includes(e.source.name), n = B.value.includes(e.source.name), c = P.value.includes(e.source.name);
return E.value && !t && !n && !c ? null : O(e);
}
if (e.source.detailType === "GROUPPANEL") {
const t = f.value.includes(e.source.name);
const t = y.value.includes(e.source.name);
return s("div", {
class: a.b("group")
}, [s("div", {
......@@ -324,7 +327,7 @@ const te = $({
title: "展开"
},
on: {
click: () => S(e)
click: () => T(e)
}
}) : s("i-icon", {
class: a.bem("group", "header", "icon"),
......@@ -333,7 +336,7 @@ const te = $({
title: "收缩"
},
on: {
click: () => S(e)
click: () => T(e)
}
}), s("span", {
class: a.bem("group", "header", "name-text")
......@@ -341,41 +344,41 @@ const te = $({
class: [a.be("group", "content"), a.is("collapse", t)]
}, [e.children.map((n) => N(n))])]);
}
return e.source.detailType === "DRUIPART" && !e.source.name.endsWith("_srfcopy") ? z(e) : e.source.detailType === "MDCTRL" ? G(e) : null;
return e.source.detailType === "DRUIPART" && !e.source.name.endsWith("_srfcopy") ? G(e) : e.source.detailType === "MDCTRL" ? U(e) : null;
}
}, U = (e, t) => {
const n = [], c = [], u = [];
}, k = (e, t) => {
const n = [], c = [], m = [];
return Object.keys(t).forEach((l) => {
const m = e[l], b = t[l];
o.isFalseyButNotEmpty(m) && !o.isFalseyButNotEmpty(b) && n.push(l), !o.isFalseyButNotEmpty(m) && !o.isFalseyButNotEmpty(b) && o.compareObjectValues(m, b) && c.push(l);
const p = e[l], g = t[l];
o.isFalseyButNotEmpty(p) && !o.isFalseyButNotEmpty(g) && n.push(l), !o.isFalseyButNotEmpty(p) && !o.isFalseyButNotEmpty(g) && o.compareObjectValues(p, g) && c.push(l);
}), Object.keys(e).forEach((l) => {
if (!Object.prototype.hasOwnProperty.call(t, l) || o.isFalseyButNotEmpty(t[l])) {
const m = e[l];
o.isFalseyButNotEmpty(m) || u.push(l);
const p = e[l];
o.isFalseyButNotEmpty(p) || m.push(l);
}
}), {
added: n,
modified: c,
deleted: u
deleted: m
};
};
return K(() => r.params, async () => {
return Q(() => r.params, async () => {
const e = await o.loadGridData();
h.value = e.baseData, v.value = e.compareData;
v.value = e.baseData, f.value = e.compareData;
const {
added: t,
modified: n,
deleted: c
} = U(v.value, h.value);
D.value = t, B.value = n, g.value = c;
} = k(f.value, v.value);
D.value = t, P.value = n, B.value = c;
}, {
immediate: !0
}), {
ns: a,
c: o,
switchValue: y,
druipartNum: P,
renderEditor: x,
switchValue: E,
druipartNum: I,
renderEditor: O,
renderByDetailType: N
};
},
......@@ -426,20 +429,20 @@ const te = $({
}, [this.modelData.children.map((r) => this.renderByDetailType(r))])])]) : null;
}
});
class se {
class ae {
constructor() {
d(this, "component", "IBizFormDataComparison");
}
}
const ae = new Q(import.meta.url), me = {
const oe = new X(import.meta.url), pe = {
mateUrl: import.meta.url,
install(r) {
ae.loadStyle(["/style.css"]), r.component("IBizFormDataComparison", te), ibiz.register.control.register(
oe.loadStyle(["/style.css"]), r.component("IBizFormDataComparison", se), ibiz.register.control.register(
"EDITFORM_RENDER_FORM_DATA_COMPARISON",
new se()
new ae()
);
}
};
export {
me as default
pe as default
};
!function(){function t(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 e(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}(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 n(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 o(t){return o="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},o(t)}function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=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(N){l=function(t,e,r){return t[e]=r}}function f(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),c=new S(o||[]);return n(a,"_invoke",{value:j(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(N){return{type:"throw",arg:N}}}t.wrap=f;var d={};function h(){}function m(){}function v(){}var y={};l(y,c,(function(){return this}));var b=Object.getPrototypeOf,g=b&&b(b(_([])));g&&g!==e&&r.call(g,c)&&(y=g);var w=v.prototype=h.prototype=Object.create(y);function O(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function i(n,a,c,s){var u=p(t[n],t,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==o(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,c,s)}),(function(t){i("throw",t,c,s)})):e.resolve(f).then((function(t){l.value=t,c(l)}),(function(t){return i("throw",t,c,s)}))}s(u.arg)}var a;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function j(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 L()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===d)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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function x(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,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;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,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function P(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 D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function _(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 n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return m.prototype=v,n(w,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:m,configurable:!0}),m.displayName=l(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},O(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(w),l(w,u,"Generator"),l(w,c,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),t.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}},t.values=_,S.prototype={constructor:S,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(D),!t)for(var e in this)"t"===e.charAt(0)&&r.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 n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;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,d):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),d},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),D(r),d}},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;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function a(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function c(t){a(i,n,o,c,s,"next",t)}function s(t){a(i,n,o,c,s,"throw",t)}c(void 0)}))}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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,y(n.key),n)}}function l(t,e,r){return e&&u(t.prototype,e),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},f(t,e)}function p(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=m(t);if(e){var o=m(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d(this,r)}}function d(t,e){if(e&&("object"===o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function v(t,e,r){return(e=y(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t){var e=function(t,e){if("object"!==o(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===o(e)?e:String(e)}System.register(["@ibiz-template/model","@ibiz-template/vue-util","vue","qx-util","@ibiz-template/runtime","@ibiz-template/controller","@ibiz-template/service"],(function(t,n){"use strict";var a,u,d,m,y,b,g,w,O,E,j,x,P,D;return{setters:[function(t){a=t.EditFormModel},function(t){u=t.useNamespace,d=t.useControlController,m=t.usePropsWatch},function(t){y=t.defineComponent,b=t.getCurrentInstance,g=t.ref,w=t.watch,O=t.h},function(t){E=t.createUUID},function(t){j=t.ViewMode,x=t.PluginStaticResource},function(t){P=t.EditFormController},function(t){D=t.ControlVO}],execute:function(){var S=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&&f(t,e)}(n,t);var e,r=p(n);function n(){var t;s(this,n);for(var e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];return v(h(t=r.call.apply(r,[this].concat(o))),"baseResData",[]),v(h(t),"compareResData",[]),v(h(t),"oldData",new D),v(h(t),"versionData",[]),v(h(t),"comparisonArr",{}),v(h(t),"gridData",[]),v(h(t),"AllGridData",[]),v(h(t),"removeSameGridData",[]),v(h(t),"AlldruipartData",new Map),v(h(t),"druipartDataSize",0),v(h(t),"newDruipartData",{}),t}return l(n,[{key:"loadGridData",value:(e=c(i().mark((function t(){var e,r,n,o,a,c,s,u,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.startLoading();case 2:return e=this.model.source.M.getPSControlParam.ctrlParams,r=e.BASEENTITY,n=e.COMPAREENTITY,t.next=6,ibiz.entityService.getService(r);case 6:return o=t.sent,t.next=9,ibiz.entityService.getService(n);case 9:return a=t.sent,c=Object.assign({},this.context.clone(),v({},r.toLowerCase(),this.params.base_version)),s=Object.assign({},this.context.clone(),v({},n.toLowerCase(),this.params.compare_version)),t.next=14,o.exec("Get",c,this.params);case 14:return u=t.sent,t.next=17,a.exec("Get",s,this.params);case 17:return l=t.sent,this.isLoaded=!0,t.abrupt("return",{baseData:u.data.data,compareData:l.data.data});case 20:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"isFalseyButNotEmpty",value:function(t){return null==t||"string"==typeof t&&""===t||Array.isArray(t)&&0===t.length||"object"===o(t)&&0===Object.keys(t).length}},{key:"compareObjectValues",value:function(t,e){return JSON.stringify(t)!==JSON.stringify(e)}}]),n}(P),_=y({name:"IBizFormDataComparison",props:{modelData:{type:a,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}},enableAutoSave:{type:Boolean,required:!1}},setup:function(t){var n=u("form-data-comparison"),o=b().proxy,a=d(o,(function(){var e=new S(t.modelData,t.context,t.params);return m(o,"enableAutoSave",e.setEnableAutoSave.bind(e)),e})),s=g(!1),l=g({}),f=g({}),p=g([]),h=[],v=g([]),y=g([]),x=g([]),P=new Map,D=g(0),_=function t(e){var n=[];if(n.push(e),e&&e.children){var o=[];e.children.forEach((function(e){var n=t(e);o.push.apply(o,r(n))})),n.push.apply(n,o)}return n}(t.modelData);h.push.apply(h,r(_));var L=function(t){var e=a.details[t.source.name],r=O("not-supported-editor",{attrs:{modelData:t.editor}});return O("div",{class:[n.e("form-grid-item"),n.is("add",v.value.includes(t.source.name)),n.is("update",x.value.includes(t.source.name)),n.is("delete",y.value.includes(t.source.name))]},[O("div",{class:n.em("form-grid-item","name")},[t.source.caption]),O("div",{class:n.em("form-grid-item","left")},[e.editorProvider?O(e.editorProvider.formEditor,{props:{value:f.value[t.source.name],data:e.data,controller:e.editor,disabled:e.disabled,readonly:!0}}):r]),O("div",{class:n.em("form-grid-item","right")},[e.editorProvider?O(e.editorProvider.formEditor,{props:{value:l.value[t.source.name],data:e.data,controller:e.editor,disabled:e.disabled,readonly:!0}}):r])])},N=function(t,e){P.set(t.source.id,e),e.evt.on("mounted",(function(){a.startLoading(),D.value+=1,e.call.refresh()})),e.evt.on("refreshed",(function(){D.value-=1,setTimeout((function(){a.endLoading()}),500)}))},T=function(t){var e=p.value.findIndex((function(e){return e===t.source.name}));e>-1?p.value.splice(e,1):p.value.push(t.source.name)},F=function(t,e){var r=[],n=[],o=[];return Object.keys(e).forEach((function(o){var i=t[o],c=e[o];a.isFalseyButNotEmpty(i)&&!a.isFalseyButNotEmpty(c)&&r.push(o),a.isFalseyButNotEmpty(i)||a.isFalseyButNotEmpty(c)||!a.compareObjectValues(i,c)||n.push(o)})),Object.keys(t).forEach((function(r){if(!Object.prototype.hasOwnProperty.call(e,r)||a.isFalseyButNotEmpty(e[r])){var n=t[r];a.isFalseyButNotEmpty(n)||o.push(r)}})),{added:r,modified:n,deleted:o}};return w((function(){return t.params}),c(i().mark((function t(){var e,r,n,o,c;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.loadGridData();case 2:e=t.sent,l.value=e.baseData,f.value=e.compareData,r=F(f.value,l.value),n=r.added,o=r.modified,c=r.deleted,v.value=n,x.value=o,y.value=c;case 9:case"end":return t.stop()}}),t)}))),{immediate:!0}),{ns:n,c:a,switchValue:s,druipartNum:D,renderEditor:L,renderByDetailType:function r(o){if(!o.source.hidden){if("FORMPAGE"===o.source.detailType)return O("div",{class:n.e("form-page")},[o.children.map((function(t){return r(t)}))]);if("FORMITEM"===o.source.detailType){var i=v.value.includes(o.source.name),c=y.value.includes(o.source.name),u=x.value.includes(o.source.name);return!s.value||i||c||u?L(o):null}if("GROUPPANEL"===o.source.detailType){var d=p.value.includes(o.source.name);return O("div",{class:n.b("group")},[O("div",{class:[n.be("group","header"),n.is("hide-caption",!o.source.showCaption)]},[O("div",{class:n.bem("group","header","name")},[O("i-icon",d?{class:n.bem("group","header","icon"),attrs:{type:"ios-arrow-forward",title:"展开"},on:{click:function(){return T(o)}}}:{class:n.bem("group","header","icon"),attrs:{type:"ios-arrow-down",title:"收缩"},on:{click:function(){return T(o)}}}),O("span",{class:n.bem("group","header","name-text")},[o.source.caption||o.source.title])]),O("div",["---"]),O("div",["---"])]),O("div",{class:[n.be("group","content"),n.is("collapse",d)]},[o.children.map((function(t){return r(t)}))])])}return"DRUIPART"!==o.source.detailType||o.source.name.endsWith("_srfcopy")?"MDCTRL"===o.source.detailType?(b={modelData:m=o,controller:a.details[m.source.name]},g=a.providers[m.source.name],w=O(g.component,{props:e({},b),key:m.id}),P=O(g.component,{props:e({},b),key:"compare_".concat(m.id)}),O("div",{class:n.e("mdctrl")},[O("div",{class:n.em("mdctrl","caption")},[m.source.caption]),O("div",{class:n.em("mdctrl","left")},[w]),O("div",{class:n.em("mdctrl","right")},[P])])):null:function(e){var r=h.find((function(t){return t.id==="".concat(e.source.id,"_srfcopy")})),o=e.embedView.source.modelPath,i=null==r?void 0:r.embedView.source.modelPath,c=a.context.clone(),s={base_version:t.params.base_version},u=a.context.clone();Object.assign(u,{gysrlzy_info:t.params.compare_version,compare_version:t.params.compare_version});var p={compare_version:t.params.compare_version},d=l.value[e.source.userTag],m=f.value[null==r?void 0:r.source.userTag],v=!1,y=!1,b=!1;return a.isFalseyButNotEmpty(d)&&!a.isFalseyButNotEmpty(m)?v=!0:!a.isFalseyButNotEmpty(d)&&a.isFalseyButNotEmpty(m)?b=!0:a.isFalseyButNotEmpty(d)||a.isFalseyButNotEmpty(m)||!a.compareObjectValues(d,m)||(y=!0),O("div",{class:[n.e("druipart"),n.is("add",v),n.is("update",y),n.is("delete",b)]},[O("div",{class:n.em("druipart","caption")},[e.source.caption]),O("div",{class:n.em("druipart","left")},[i&&O("ViewShell",{attrs:{context:u,params:p,modal:{mode:j.EMBED},modelPath:i,noLoadDefault:!0},key:E(),on:{neuronInit:function(t){return N(r,t)}}})]),O("div",{class:n.em("druipart","right")},[o&&O("ViewShell",{attrs:{context:c,params:s,modal:{mode:j.EMBED},modelPath:o,noLoadDefault:!0},key:E(),on:{neuronInit:function(t){return N(e,t)}}})])])}(o);var m,b,g,w,P}}}},render:function(){var t=this;return this.c.complete?O("control-layout",{attrs:{modelData:this.c.model}},[O("div",{class:this.ns.b()},[O("div",{class:this.ns.e("top")},[O("div",{class:this.ns.e("top-hidesame-content")},[O("div",{class:this.ns.e("top-hidesame-content-left")},["隐藏相同项 ",O("i-switch",{model:{value:this.switchValue,callback:function(e){t.switchValue=e}}})]),O("div",{class:this.ns.e("top-hidesame-content-right")},[O("div",{class:this.ns.e("top-hidesame-content-right-item")},["新增",O("div",{class:this.ns.e("top-hidesame-content-right-item-add")})]),O("div",{class:this.ns.e("top-hidesame-content-right-item")},["修改",O("div",{class:this.ns.e("top-hidesame-content-right-item-change")})]),O("div",{class:this.ns.e("top-hidesame-content-right-item")},["删除",O("div",{class:this.ns.e("top-hidesame-content-right-item-delete")})])])]),O("div",{class:this.ns.e("top-content")},[O("div",{class:this.ns.em("top-content","attr")},["信息项"]),O("div",{class:[this.ns.em("top-content","left")]},["更新前内容"]),O("div",{class:[this.ns.em("top-content","right")]},["更新后内容"])])]),O("div",{class:this.ns.e("content")},[this.modelData.children.map((function(e){return t.renderByDetailType(e)}))])])]):null}}),L=l((function t(){s(this,t),v(this,"component","IBizFormDataComparison")})),N=new x(n.meta.url);t("default",{mateUrl:n.meta.url,install:function(t){N.loadStyle(["/style.css"]),t.component("IBizFormDataComparison",_),ibiz.register.control.register("EDITFORM_RENDER_FORM_DATA_COMPARISON",new L)}})}}}))}();
!function(){function t(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 e(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}(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 n(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 o(t){return o="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},o(t)}function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=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(N){l=function(t,e,r){return t[e]=r}}function f(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),c=new S(o||[]);return n(a,"_invoke",{value:j(t,r,c)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(N){return{type:"throw",arg:N}}}t.wrap=f;var p={};function h(){}function m(){}function v(){}var y={};l(y,c,(function(){return this}));var b=Object.getPrototypeOf,g=b&&b(b(_([])));g&&g!==e&&r.call(g,c)&&(y=g);var w=v.prototype=h.prototype=Object.create(y);function O(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function i(n,a,c,u){var s=d(t[n],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==o(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,c,u)}),(function(t){i("throw",t,c,u)})):e.resolve(f).then((function(t){l.value=t,c(l)}),(function(t){return i("throw",t,c,u)}))}u(s.arg)}var a;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function j(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 L()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(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=d(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 x(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,x(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=d(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 P(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 D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function _(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 n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return m.prototype=v,n(w,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:m,configurable:!0}),m.displayName=l(v,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},O(E.prototype),l(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(f(e,r,n,o),i);return t.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]"})),t.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}},t.values=_,S.prototype={constructor:S,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(D),!t)for(var e in this)"t"===e.charAt(0)&&r.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 n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;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),D(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;D(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function a(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 c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function c(t){a(i,n,o,c,u,"next",t)}function u(t){a(i,n,o,c,u,"throw",t)}c(void 0)}))}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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,y(n.key),n)}}function l(t,e,r){return e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},f(t,e)}function d(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=m(t);if(e){var o=m(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return p(this,r)}}function p(t,e){if(e&&("object"===o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function v(t,e,r){return(e=y(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t){var e=function(t,e){if("object"!==o(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===o(e)?e:String(e)}System.register(["@ibiz-template/model","@ibiz-template/vue-util","vue","qx-util","@ibiz-template/runtime","@ibiz-template/controller","@ibiz-template/service"],(function(t,n){"use strict";var a,s,p,m,y,b,g,w,O,E,j,x,P,D;return{setters:[function(t){a=t.EditFormModel},function(t){s=t.useNamespace,p=t.useControlController,m=t.usePropsWatch},function(t){y=t.defineComponent,b=t.getCurrentInstance,g=t.ref,w=t.watch,O=t.h},function(t){E=t.createUUID},function(t){j=t.ViewMode,x=t.PluginStaticResource},function(t){P=t.EditFormController},function(t){D=t.ControlVO}],execute:function(){var S=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&&f(t,e)}(n,t);var e,r=d(n);function n(){var t;u(this,n);for(var e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];return v(h(t=r.call.apply(r,[this].concat(o))),"baseResData",[]),v(h(t),"compareResData",[]),v(h(t),"oldData",new D),v(h(t),"versionData",[]),v(h(t),"comparisonArr",{}),v(h(t),"gridData",[]),v(h(t),"AllGridData",[]),v(h(t),"removeSameGridData",[]),v(h(t),"AlldruipartData",new Map),v(h(t),"druipartDataSize",0),v(h(t),"newDruipartData",{}),t}return l(n,[{key:"loadGridData",value:(e=c(i().mark((function t(){var e,r,n,o,a,c,u,s,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.startLoading();case 2:return e=this.model.source.M.getPSControlParam.ctrlParams,r=e.BASEENTITY,n=e.COMPAREENTITY,t.next=6,ibiz.entityService.getService(r);case 6:return o=t.sent,t.next=9,ibiz.entityService.getService(n);case 9:return a=t.sent,c=Object.assign({},this.context.clone(),v({},r.toLowerCase(),this.params.base_version)),u=Object.assign({},this.context.clone(),v({},n.toLowerCase(),this.params.compare_version)),t.next=14,o.exec("Get",c,this.params);case 14:return s=t.sent,t.next=17,a.exec("Get",u,this.params);case 17:return l=t.sent,this.isLoaded=!0,t.abrupt("return",{baseData:s.data.data,compareData:l.data.data});case 20:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"isFalseyButNotEmpty",value:function(t){return null==t||"string"==typeof t&&""===t||Array.isArray(t)&&0===t.length||"object"===o(t)&&0===Object.keys(t).length}},{key:"compareObjectValues",value:function(t,e){return JSON.stringify(t)!==JSON.stringify(e)}}]),n}(P),_=y({name:"IBizFormDataComparison",props:{modelData:{type:a,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}},enableAutoSave:{type:Boolean,required:!1}},setup:function(t){var n=s("form-data-comparison"),o=b().proxy,a=p(o,(function(){var e=new S(t.modelData,t.context,t.params);return m(o,"enableAutoSave",e.setEnableAutoSave.bind(e)),e})),u=g(!0),l=g(!1),f=g({}),d=g({}),h=g([]),v=[],y=g([]),x=g([]),P=g([]),D=new Map,_=g(0),L=function t(e){var n=[];if(n.push(e),e&&e.children){var o=[];e.children.forEach((function(e){var n=t(e);o.push.apply(o,r(n))})),n.push.apply(n,o)}return n}(t.modelData);v.push.apply(v,r(L));var N=function(t){var e=a.details[t.source.name],r=O("not-supported-editor",{attrs:{modelData:t.editor}});return O("div",{class:[n.e("form-grid-item"),n.is("add",y.value.includes(t.source.name)),n.is("update",P.value.includes(t.source.name)),n.is("delete",x.value.includes(t.source.name))]},[O("div",{class:n.em("form-grid-item","name")},[t.source.caption]),O("div",{class:n.em("form-grid-item","left")},[e.editorProvider?O(e.editorProvider.formEditor,{props:{value:d.value[t.source.name],data:e.data,controller:e.editor,disabled:e.disabled,readonly:!0}}):r]),O("div",{class:n.em("form-grid-item","right")},[e.editorProvider?O(e.editorProvider.formEditor,{props:{value:f.value[t.source.name],data:e.data,controller:e.editor,disabled:e.disabled,readonly:!0}}):r])])},T=function(t,e){D.set(t.source.id,e),e.evt.on("mounted",(function(){u.value&&a.startLoading(),_.value+=1,e.call.refresh()})),e.evt.on("refreshed",(function(){_.value-=1,setTimeout((function(){u.value&&a.endLoading()}),500)}))},F=function(t){u.value=!1;var e=h.value.findIndex((function(e){return e===t.source.name}));e>-1?h.value.splice(e,1):h.value.push(t.source.name)},A=function(t,e){var r=[],n=[],o=[];return Object.keys(e).forEach((function(o){var i=t[o],c=e[o];a.isFalseyButNotEmpty(i)&&!a.isFalseyButNotEmpty(c)&&r.push(o),a.isFalseyButNotEmpty(i)||a.isFalseyButNotEmpty(c)||!a.compareObjectValues(i,c)||n.push(o)})),Object.keys(t).forEach((function(r){if(!Object.prototype.hasOwnProperty.call(e,r)||a.isFalseyButNotEmpty(e[r])){var n=t[r];a.isFalseyButNotEmpty(n)||o.push(r)}})),{added:r,modified:n,deleted:o}};return w((function(){return t.params}),c(i().mark((function t(){var e,r,n,o,c;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.loadGridData();case 2:e=t.sent,f.value=e.baseData,d.value=e.compareData,r=A(d.value,f.value),n=r.added,o=r.modified,c=r.deleted,y.value=n,P.value=o,x.value=c;case 9:case"end":return t.stop()}}),t)}))),{immediate:!0}),{ns:n,c:a,switchValue:l,druipartNum:_,renderEditor:N,renderByDetailType:function r(o){if(!o.source.hidden){if("FORMPAGE"===o.source.detailType)return O("div",{class:n.e("form-page")},[o.children.map((function(t){return r(t)}))]);if("FORMITEM"===o.source.detailType){var i=y.value.includes(o.source.name),c=x.value.includes(o.source.name),u=P.value.includes(o.source.name);return!l.value||i||c||u?N(o):null}if("GROUPPANEL"===o.source.detailType){var s=h.value.includes(o.source.name);return O("div",{class:n.b("group")},[O("div",{class:[n.be("group","header"),n.is("hide-caption",!o.source.showCaption)]},[O("div",{class:n.bem("group","header","name")},[O("i-icon",s?{class:n.bem("group","header","icon"),attrs:{type:"ios-arrow-forward",title:"展开"},on:{click:function(){return F(o)}}}:{class:n.bem("group","header","icon"),attrs:{type:"ios-arrow-down",title:"收缩"},on:{click:function(){return F(o)}}}),O("span",{class:n.bem("group","header","name-text")},[o.source.caption||o.source.title])]),O("div",["---"]),O("div",["---"])]),O("div",{class:[n.be("group","content"),n.is("collapse",s)]},[o.children.map((function(t){return r(t)}))])])}return"DRUIPART"!==o.source.detailType||o.source.name.endsWith("_srfcopy")?"MDCTRL"===o.source.detailType?(m={modelData:p=o,controller:a.details[p.source.name]},b=a.providers[p.source.name],g=O(b.component,{props:e({},m),key:p.id}),w=O(b.component,{props:e({},m),key:"compare_".concat(p.id)}),O("div",{class:n.e("mdctrl")},[O("div",{class:n.em("mdctrl","caption")},[p.source.caption]),O("div",{class:n.em("mdctrl","left")},[g]),O("div",{class:n.em("mdctrl","right")},[w])])):null:function(e){var r=v.find((function(t){return t.id==="".concat(e.source.id,"_srfcopy")})),o=e.embedView.source.modelPath,i=null==r?void 0:r.embedView.source.modelPath,c=a.context.clone(),u={base_version:t.params.base_version},s=a.context.clone();Object.assign(s,{gysrlzy_info:t.params.compare_version,compare_version:t.params.compare_version});var l={compare_version:t.params.compare_version},p=f.value[e.source.userTag],h=d.value[null==r?void 0:r.source.userTag],m=!1,y=!1,b=!1;return a.isFalseyButNotEmpty(p)&&!a.isFalseyButNotEmpty(h)?m=!0:!a.isFalseyButNotEmpty(p)&&a.isFalseyButNotEmpty(h)?b=!0:a.isFalseyButNotEmpty(p)||a.isFalseyButNotEmpty(h)||!a.compareObjectValues(p,h)||(y=!0),O("div",{class:[n.e("druipart"),n.is("add",m),n.is("update",y),n.is("delete",b)]},[O("div",{class:n.em("druipart","caption")},[e.source.caption]),O("div",{class:n.em("druipart","left")},[i&&O("ViewShell",{attrs:{context:s,params:l,modal:{mode:j.EMBED},modelPath:i,noLoadDefault:!0,name:null==r?void 0:r.source.id},key:E(),on:{neuronInit:function(t){return T(r,t)}}})]),O("div",{class:n.em("druipart","right")},[o&&O("ViewShell",{attrs:{context:c,params:u,modal:{mode:j.EMBED},modelPath:o,noLoadDefault:!0,name:e.source.id},key:E(),on:{neuronInit:function(t){return T(e,t)}}})])])}(o);var p,m,b,g,w}}}},render:function(){var t=this;return this.c.complete?O("control-layout",{attrs:{modelData:this.c.model}},[O("div",{class:this.ns.b()},[O("div",{class:this.ns.e("top")},[O("div",{class:this.ns.e("top-hidesame-content")},[O("div",{class:this.ns.e("top-hidesame-content-left")},["隐藏相同项 ",O("i-switch",{model:{value:this.switchValue,callback:function(e){t.switchValue=e}}})]),O("div",{class:this.ns.e("top-hidesame-content-right")},[O("div",{class:this.ns.e("top-hidesame-content-right-item")},["新增",O("div",{class:this.ns.e("top-hidesame-content-right-item-add")})]),O("div",{class:this.ns.e("top-hidesame-content-right-item")},["修改",O("div",{class:this.ns.e("top-hidesame-content-right-item-change")})]),O("div",{class:this.ns.e("top-hidesame-content-right-item")},["删除",O("div",{class:this.ns.e("top-hidesame-content-right-item-delete")})])])]),O("div",{class:this.ns.e("top-content")},[O("div",{class:this.ns.em("top-content","attr")},["信息项"]),O("div",{class:[this.ns.em("top-content","left")]},["更新前内容"]),O("div",{class:[this.ns.em("top-content","right")]},["更新后内容"])])]),O("div",{class:this.ns.e("content")},[this.modelData.children.map((function(e){return t.renderByDetailType(e)}))])])]):null}}),L=l((function t(){u(this,t),v(this,"component","IBizFormDataComparison")})),N=new x(n.meta.url);t("default",{mateUrl:n.meta.url,install:function(t){N.loadStyle(["/style.css"]),t.component("IBizFormDataComparison",_),ibiz.register.control.register("EDITFORM_RENDER_FORM_DATA_COMPARISON",new L)}})}}}))}();
@charset "UTF-8";.ibiz-form-data-comparison{height:calc(100% - 20px);overflow:auto}.ibiz-form-data-comparison *{animation:none!important;transition:none!important;transform:none!important;will-change:unset!important}.ibiz-form-data-comparison__content{display:flex}.ibiz-form-data-comparison__top-hidesame-content{display:flex;place-content:center space-between;align-items:center;height:50px;margin-bottom:10px}.ibiz-form-data-comparison__top-content{display:flex;width:100%;text-align:center;background-color:#f2f2f2;border-left:1px solid lightgray}.ibiz-form-data-comparison__top-content--attr{width:200px;border:1px solid lightgray;padding:5px 10px}.ibiz-form-data-comparison__top-content--left{flex:1;width:calc(100% - 100px);border:1px solid lightgray;padding:5px 10px}.ibiz-form-data-comparison__top-content--right{flex:1;border:1px solid lightgray;width:calc(100% - 100px);padding:5px 10px}.ibiz-form-data-comparison__top-hidesame-content-right{display:flex;flex-flow:row nowrap;place-content:center center;align-items:center}.ibiz-form-data-comparison__top-hidesame-content-right-item{display:flex;flex-direction:row;place-content:center space-around;align-items:center;width:60px;height:30px}.ibiz-form-data-comparison__top-hidesame-content-right-item-add{width:16px;height:16px;background:#d5f3e0}.ibiz-form-data-comparison__top-hidesame-content-right-item-change{width:16px;height:16px;background:#fceecd}.ibiz-form-data-comparison__top-hidesame-content-right-item-delete{width:16px;height:16px;background:#ffd5d5}.ibiz-form-data-comparison__form-grid-item{--ibiz-text-color-readonly: black;display:flex;width:100%}.ibiz-form-data-comparison__form-grid-item--name{border:1px solid lightgray;padding:5px 10px;width:200px;text-align:center}.ibiz-form-data-comparison__form-grid-item--left,.ibiz-form-data-comparison__form-grid-item--right{border:1px solid lightgray;padding:5px 10px;flex:1;text-align:center}.ibiz-form-data-comparison__form-grid-item.is-add .ibiz-form-data-comparison__form-grid-item--left,.ibiz-form-data-comparison__form-grid-item.is-add .ibiz-form-data-comparison__form-grid-item--right{background-color:#d5f3e0}.ibiz-form-data-comparison__form-grid-item.is-update .ibiz-form-data-comparison__form-grid-item--left,.ibiz-form-data-comparison__form-grid-item.is-update .ibiz-form-data-comparison__form-grid-item--right{background-color:#fceecd}.ibiz-form-data-comparison__form-grid-item.is-delete .ibiz-form-data-comparison__form-grid-item--left,.ibiz-form-data-comparison__form-grid-item.is-delete .ibiz-form-data-comparison__form-grid-item--right{background-color:#ffd5d5}.ibiz-form-data-comparison__form-page{width:100%}.ibiz-form-data-comparison__druipart{display:flex;max-height:360px}.ibiz-form-data-comparison__druipart--caption{width:200px;border:1px solid lightgray;display:flex;align-items:center;justify-content:center}.ibiz-form-data-comparison__druipart--left{border:1px solid lightgray;padding:16px;flex:1;width:calc(50% - 100px)}.ibiz-form-data-comparison__druipart--right{border:1px solid lightgray;flex:1;padding:16px;width:calc(50% - 100px)}.ibiz-form-data-comparison__druipart.is-add .ibiz-form-data-comparison__druipart--left,.ibiz-form-data-comparison__druipart.is-add .ibiz-form-data-comparison__druipart--right{background-color:#d5f3e0}.ibiz-form-data-comparison__druipart.is-update .ibiz-form-data-comparison__druipart--left,.ibiz-form-data-comparison__druipart.is-update .ibiz-form-data-comparison__druipart--right{background-color:#fceecd}.ibiz-form-data-comparison__druipart.is-delete .ibiz-form-data-comparison__druipart--left,.ibiz-form-data-comparison__druipart.is-delete .ibiz-form-data-comparison__druipart--right{background-color:#ffd5d5}.ibiz-form-data-comparison-group{width:100%}.ibiz-form-data-comparison-group__header{width:100%;border-left:1px solid lightgray;display:flex}.ibiz-form-data-comparison-group__header--name{width:200px;border:1px solid lightgray;max-width:200px;text-align:center;position:relative;font-size:14px;padding:4px}.ibiz-form-data-comparison-group__header div{flex:1;text-align:center;border:1px solid lightgray}.ibiz-form-data-comparison-group__header--icon{position:absolute;font-size:24px;left:4px;cursor:pointer}.ibiz-form-data-comparison-group__header--name-text{flex:1}.ibiz-form-data-comparison-group__header.is-hide-caption{display:none}.ibiz-form-data-comparison-group__content{border-left:1px solid lightgray}.ibiz-form-data-comparison-group__content.is-collapse{display:none}
{
"name": "@ibiz-template-plugin/sy-dsf-web",
"version": "0.0.1-beta.1",
"version": "0.0.2",
"description": "ibiz full-dynamic-vue 模板项目扩展插件示例",
"author": "tony001",
"license": "MIT",
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册