mx-framework-plus 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mx-framework-plus.es.ts +725 -732
- package/dist/mx-framework-plus.umd.ts +9 -9
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { openBlock as
|
|
1
|
+
import { openBlock as L, createElementBlock as I, normalizeStyle as j, normalizeClass as J, createCommentVNode as _, toDisplayString as ee, Fragment as ge, renderList as ve, createElementVNode as le, resolveComponent as Ie, createBlock as me, ref as it, computed as Ae, createApp as rt, h as ot, inject as st, withDirectives as ut, resolveDynamicComponent as Ve, vShow as dt } from "vue";
|
|
2
2
|
import ct from "element-plus";
|
|
3
3
|
import "element-plus/dist/index.css";
|
|
4
4
|
import mt from "yhz-ui-v3";
|
|
@@ -29,15 +29,15 @@ function ue(t, e, l) {
|
|
|
29
29
|
if (De.randomUUID && !t)
|
|
30
30
|
return De.randomUUID();
|
|
31
31
|
t = t || {};
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
32
|
+
const s = t.random ?? ((r = t.rng) == null ? void 0 : r.call(t)) ?? pt();
|
|
33
|
+
if (s.length < 16)
|
|
34
34
|
throw new Error("Random bytes length must be >= 16");
|
|
35
|
-
return
|
|
35
|
+
return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, yt(s);
|
|
36
36
|
}
|
|
37
37
|
const gt = (t, e, l) => {
|
|
38
|
-
let
|
|
38
|
+
let s = ["edit"];
|
|
39
39
|
return t && t.forEach((r) => {
|
|
40
|
-
e.includes(r.code) ? r.disable = !1 :
|
|
40
|
+
e.includes(r.code) ? r.disable = !1 : s.includes(r.code) || (r.disable = !0);
|
|
41
41
|
}), t;
|
|
42
42
|
}, Re = {
|
|
43
43
|
BoundLabels: "icon-binding-label",
|
|
@@ -3915,29 +3915,29 @@ let We = {
|
|
|
3915
3915
|
]
|
|
3916
3916
|
};
|
|
3917
3917
|
const vt = (t, e, l = {}) => {
|
|
3918
|
-
let
|
|
3918
|
+
let s = {};
|
|
3919
3919
|
t == "kitUI:BoundLabelWidget" ? t = "BoundLabels" : t == "kitUI:CanvasWidget" && (t = "Canvas");
|
|
3920
3920
|
let r = We[de[t]];
|
|
3921
3921
|
return r ? (l && Object.keys(l).length > 0 && r.forEach((m) => {
|
|
3922
3922
|
let p = l[m.key];
|
|
3923
3923
|
p && (m = Object.assign(m, p));
|
|
3924
|
-
}),
|
|
3924
|
+
}), s = {
|
|
3925
3925
|
title: de[t],
|
|
3926
3926
|
value: e,
|
|
3927
3927
|
icon: Re[t],
|
|
3928
3928
|
children: r
|
|
3929
|
-
}, JSON.parse(JSON.stringify(
|
|
3930
|
-
}, _e = (t, e, l = {},
|
|
3929
|
+
}, JSON.parse(JSON.stringify(s))) : {};
|
|
3930
|
+
}, _e = (t, e, l = {}, s) => {
|
|
3931
3931
|
let r = {}, m = We[de[t]];
|
|
3932
3932
|
if (m && m.length > 0) {
|
|
3933
|
-
let p = null,
|
|
3933
|
+
let p = null, b = m.find((A) => A.key == "treeData"), x = m.find((A) => A.key == "compType"), v = [], h = [];
|
|
3934
3934
|
if (l && Object.keys(l).length > 0)
|
|
3935
3935
|
m.forEach((A) => {
|
|
3936
3936
|
let z = l[A.key];
|
|
3937
3937
|
z && (A = Object.assign(A, z)), h.push({ ...A });
|
|
3938
3938
|
});
|
|
3939
3939
|
else {
|
|
3940
|
-
let A = ["RefreshButton", "BackButton", "SaveButton"], z =
|
|
3940
|
+
let A = ["RefreshButton", "BackButton", "SaveButton"], z = b && !A.includes(de[t]) && de[t] !== "ActionButton", g = {
|
|
3941
3941
|
text: {
|
|
3942
3942
|
animate: {
|
|
3943
3943
|
isShow: !!z,
|
|
@@ -3967,14 +3967,14 @@ const vt = (t, e, l = {}) => {
|
|
|
3967
3967
|
}
|
|
3968
3968
|
}
|
|
3969
3969
|
};
|
|
3970
|
-
A.includes(de[t]) || (
|
|
3971
|
-
let
|
|
3972
|
-
|
|
3970
|
+
A.includes(de[t]) || (g.text.value = ""), m.forEach((T) => {
|
|
3971
|
+
let D = g[T.key];
|
|
3972
|
+
D && (T = Object.assign(T, D)), h.push({ ...T });
|
|
3973
3973
|
});
|
|
3974
3974
|
}
|
|
3975
|
-
if (
|
|
3976
|
-
let A =
|
|
3977
|
-
|
|
3975
|
+
if (b) {
|
|
3976
|
+
let A = b.value || "ValueBinding";
|
|
3977
|
+
v = [vt(A, e + 1, {
|
|
3978
3978
|
ord: {
|
|
3979
3979
|
value: "null",
|
|
3980
3980
|
realPath: {
|
|
@@ -3989,7 +3989,7 @@ const vt = (t, e, l = {}) => {
|
|
|
3989
3989
|
value: e,
|
|
3990
3990
|
icon: Re[t],
|
|
3991
3991
|
children: h,
|
|
3992
|
-
treeData:
|
|
3992
|
+
treeData: v
|
|
3993
3993
|
};
|
|
3994
3994
|
let k = {};
|
|
3995
3995
|
return r.children.forEach((A) => {
|
|
@@ -4004,11 +4004,11 @@ const vt = (t, e, l = {}) => {
|
|
|
4004
4004
|
return {};
|
|
4005
4005
|
};
|
|
4006
4006
|
function bt(t, e, l) {
|
|
4007
|
-
return new Promise((
|
|
4007
|
+
return new Promise((s, r) => {
|
|
4008
4008
|
let m = t.getDefaultParent(), p = t.getModel();
|
|
4009
4009
|
p.beginUpdate();
|
|
4010
4010
|
try {
|
|
4011
|
-
var
|
|
4011
|
+
var b = t.insertEdge(
|
|
4012
4012
|
m,
|
|
4013
4013
|
null,
|
|
4014
4014
|
"",
|
|
@@ -4019,49 +4019,49 @@ function bt(t, e, l) {
|
|
|
4019
4019
|
// 继承样式
|
|
4020
4020
|
), x = t.getCellGeometry(e);
|
|
4021
4021
|
let h = x.getTerminalPoint(!0), k = l.x - h.x, N = l.y - h.y, A = x.getTerminalPoint(!1);
|
|
4022
|
-
var
|
|
4023
|
-
|
|
4022
|
+
var v = new mxGeometry();
|
|
4023
|
+
v.setTerminalPoint(
|
|
4024
4024
|
new mxPoint(
|
|
4025
4025
|
h.x + k,
|
|
4026
4026
|
h.y + N
|
|
4027
4027
|
),
|
|
4028
4028
|
!0
|
|
4029
|
-
),
|
|
4029
|
+
), v.setTerminalPoint(
|
|
4030
4030
|
new mxPoint(
|
|
4031
4031
|
A.x + k,
|
|
4032
4032
|
A.y + N
|
|
4033
4033
|
),
|
|
4034
4034
|
!1
|
|
4035
|
-
),
|
|
4035
|
+
), b.setGeometry(v), b.value = e.value, b.type = e.type, b.model = "yes", b.type = "edge", b.iconName = e.iconName, s(b);
|
|
4036
4036
|
} finally {
|
|
4037
4037
|
p.endUpdate();
|
|
4038
4038
|
}
|
|
4039
4039
|
});
|
|
4040
4040
|
}
|
|
4041
|
-
async function Ct(t, e, l,
|
|
4041
|
+
async function Ct(t, e, l, s) {
|
|
4042
4042
|
if (e && e.length > 0) {
|
|
4043
4043
|
let N = e[0];
|
|
4044
|
-
var r = t.getCellGeometry(N), m = r.x, p = r.y,
|
|
4044
|
+
var r = t.getCellGeometry(N), m = r.x, p = r.y, b = l.x, x = l.y, v = b - m, h = x - p;
|
|
4045
4045
|
t.getModel().beginUpdate();
|
|
4046
4046
|
try {
|
|
4047
4047
|
var k = t.getDefaultParent();
|
|
4048
4048
|
let A = t.importCells(e, 0, 0, k), z = [];
|
|
4049
4049
|
if (A != null) {
|
|
4050
|
-
for (let
|
|
4051
|
-
const
|
|
4052
|
-
|
|
4050
|
+
for (let g = 0; g < A.length; g++) {
|
|
4051
|
+
const T = A[g];
|
|
4052
|
+
T != null && z.push(T);
|
|
4053
4053
|
}
|
|
4054
|
-
t.moveCells(z,
|
|
4055
|
-
for (let
|
|
4056
|
-
let
|
|
4057
|
-
if (
|
|
4058
|
-
let
|
|
4059
|
-
z.push(
|
|
4054
|
+
t.moveCells(z, v, h);
|
|
4055
|
+
for (let g = 0; g < e.length; g++) {
|
|
4056
|
+
let T = e[g];
|
|
4057
|
+
if (T.type == "edge") {
|
|
4058
|
+
let D = await bt(t, T, l);
|
|
4059
|
+
z.push(D);
|
|
4060
4060
|
}
|
|
4061
4061
|
}
|
|
4062
4062
|
}
|
|
4063
4063
|
setTimeout(() => {
|
|
4064
|
-
t.setSelectionCells(z),
|
|
4064
|
+
t.setSelectionCells(z), s.handelEvent({ key: "paste", val: z });
|
|
4065
4065
|
}, 10);
|
|
4066
4066
|
} finally {
|
|
4067
4067
|
t.getModel().endUpdate();
|
|
@@ -4069,7 +4069,7 @@ async function Ct(t, e, l, o) {
|
|
|
4069
4069
|
}
|
|
4070
4070
|
}
|
|
4071
4071
|
function wt(t, e) {
|
|
4072
|
-
return new Promise((l,
|
|
4072
|
+
return new Promise((l, s) => {
|
|
4073
4073
|
let r = t.getDefaultParent(), m = t.getModel();
|
|
4074
4074
|
m.beginUpdate();
|
|
4075
4075
|
try {
|
|
@@ -4082,18 +4082,18 @@ function wt(t, e) {
|
|
|
4082
4082
|
null,
|
|
4083
4083
|
e.style
|
|
4084
4084
|
// 继承样式
|
|
4085
|
-
),
|
|
4086
|
-
let k =
|
|
4085
|
+
), b = 10, x = 10, v = t.getCellGeometry(e);
|
|
4086
|
+
let k = v.getTerminalPoint(!0), N = v.getTerminalPoint(!1);
|
|
4087
4087
|
var h = new mxGeometry();
|
|
4088
4088
|
h.setTerminalPoint(
|
|
4089
4089
|
new mxPoint(
|
|
4090
|
-
k.x +
|
|
4090
|
+
k.x + b,
|
|
4091
4091
|
k.y + x
|
|
4092
4092
|
),
|
|
4093
4093
|
!0
|
|
4094
4094
|
), h.setTerminalPoint(
|
|
4095
4095
|
new mxPoint(
|
|
4096
|
-
N.x +
|
|
4096
|
+
N.x + b,
|
|
4097
4097
|
N.y + x
|
|
4098
4098
|
),
|
|
4099
4099
|
!1
|
|
@@ -4105,67 +4105,67 @@ function wt(t, e) {
|
|
|
4105
4105
|
}
|
|
4106
4106
|
async function kt(t, e, l) {
|
|
4107
4107
|
mxClipboard.copy(t, []), t.getDefaultParent();
|
|
4108
|
-
let
|
|
4108
|
+
let s = [], r = [];
|
|
4109
4109
|
if (e && e.length > 0) {
|
|
4110
4110
|
for (let m = 0; m < e.length; m++) {
|
|
4111
4111
|
const p = e[m];
|
|
4112
|
-
p.type === "edge" ? r.push(p) :
|
|
4112
|
+
p.type === "edge" ? r.push(p) : s.push(p);
|
|
4113
4113
|
}
|
|
4114
4114
|
if (r.length > 0)
|
|
4115
4115
|
for (let m = 0; m < r.length; m++) {
|
|
4116
4116
|
const p = r[m];
|
|
4117
|
-
let
|
|
4118
|
-
|
|
4117
|
+
let b = await wt(t, p);
|
|
4118
|
+
s.push(b);
|
|
4119
4119
|
}
|
|
4120
|
-
return t.addSelectionCells(
|
|
4120
|
+
return t.addSelectionCells(s), s;
|
|
4121
4121
|
}
|
|
4122
4122
|
}
|
|
4123
4123
|
function xt(t) {
|
|
4124
4124
|
let e = t.getModel().cells, l = [];
|
|
4125
|
-
for (const
|
|
4126
|
-
let r = e[
|
|
4127
|
-
r.type != "kitUI:CanvasWidget" && r.id != "0" && r.id != "1" && l.push(e[
|
|
4125
|
+
for (const s in e) {
|
|
4126
|
+
let r = e[s];
|
|
4127
|
+
r.type != "kitUI:CanvasWidget" && r.id != "0" && r.id != "1" && l.push(e[s]);
|
|
4128
4128
|
}
|
|
4129
4129
|
return l;
|
|
4130
4130
|
}
|
|
4131
4131
|
function St(t) {
|
|
4132
4132
|
t.addAction("toUp", function(e) {
|
|
4133
|
-
let l = t.graph,
|
|
4134
|
-
|
|
4133
|
+
let l = t.graph, s = xt(l);
|
|
4134
|
+
s && s.length > 0 && l.orderCells(!1, s);
|
|
4135
4135
|
}), t.addAction("toDown", function(e) {
|
|
4136
|
-
let l = t.graph,
|
|
4136
|
+
let l = t.graph, s = l.getModel(), r = l.getDefaultParent();
|
|
4137
4137
|
var m = new Array();
|
|
4138
4138
|
m = l.getSelectionCells();
|
|
4139
4139
|
for (let p = 0; p < m.length; p++) {
|
|
4140
|
-
const
|
|
4141
|
-
|
|
4140
|
+
const b = m[p];
|
|
4141
|
+
s.add(r, b, 1);
|
|
4142
4142
|
}
|
|
4143
4143
|
}), t.addAction("upOne", function(e) {
|
|
4144
|
-
let l = t.graph,
|
|
4144
|
+
let l = t.graph, s = l.getModel(), r = l.getDefaultParent();
|
|
4145
4145
|
var m = l.getSelectionCells();
|
|
4146
|
-
let
|
|
4146
|
+
let b = [...r.children];
|
|
4147
4147
|
if (m && m.length > 0)
|
|
4148
4148
|
for (let x = 0; x < m.length; x++) {
|
|
4149
|
-
const
|
|
4150
|
-
let k =
|
|
4151
|
-
|
|
4149
|
+
const v = m[x];
|
|
4150
|
+
let k = b.findIndex((N) => N.id == v.id) + x + 1;
|
|
4151
|
+
b[k] && (k = k + 1), s.add(r, v, k);
|
|
4152
4152
|
}
|
|
4153
4153
|
}), t.addAction("downOne", function(e) {
|
|
4154
|
-
let l = t.graph,
|
|
4154
|
+
let l = t.graph, s = l.getModel(), r = l.getDefaultParent();
|
|
4155
4155
|
var m = l.getSelectionCells();
|
|
4156
4156
|
let p = r.children;
|
|
4157
4157
|
if (m && m.length > 0)
|
|
4158
|
-
for (let
|
|
4159
|
-
const x = m[
|
|
4160
|
-
|
|
4158
|
+
for (let b = 0; b < m.length; b++) {
|
|
4159
|
+
const x = m[b], v = p.findIndex((k) => k.id == x.id), h = v - 1 < 1 ? 1 : v - 1;
|
|
4160
|
+
s.add(r, x, h);
|
|
4161
4161
|
}
|
|
4162
4162
|
});
|
|
4163
4163
|
}
|
|
4164
|
-
async function Be(t, e, l,
|
|
4165
|
-
let { pt: r, style: m, me: p, type:
|
|
4164
|
+
async function Be(t, e, l, s) {
|
|
4165
|
+
let { pt: r, style: m, me: p, type: b, iconCls: x } = l, v = p.editor;
|
|
4166
4166
|
switch (t) {
|
|
4167
4167
|
case "add":
|
|
4168
|
-
let { style: k, compType: N, data: A } = _e(
|
|
4168
|
+
let { style: k, compType: N, data: A } = _e(b, 0, null);
|
|
4169
4169
|
if (!A)
|
|
4170
4170
|
return;
|
|
4171
4171
|
N ? await p.createCustomComponent({
|
|
@@ -4173,12 +4173,12 @@ async function Be(t, e, l, o) {
|
|
|
4173
4173
|
style: myedit.getBaseAttr(A, props.thisTab),
|
|
4174
4174
|
data: A,
|
|
4175
4175
|
pt: r,
|
|
4176
|
-
type:
|
|
4176
|
+
type: b,
|
|
4177
4177
|
tmpType: N,
|
|
4178
|
-
realType:
|
|
4178
|
+
realType: b,
|
|
4179
4179
|
iconName: x.replace("iconfont ", "")
|
|
4180
4180
|
}
|
|
4181
|
-
}) :
|
|
4181
|
+
}) : b == "kitUI:PictureWidget" ? p.createAllVertex(
|
|
4182
4182
|
"img",
|
|
4183
4183
|
[{
|
|
4184
4184
|
iconName: x.replace("iconfont ", ""),
|
|
@@ -4187,7 +4187,7 @@ async function Be(t, e, l, o) {
|
|
|
4187
4187
|
w: k.layout.width,
|
|
4188
4188
|
h: k.layout.height,
|
|
4189
4189
|
pt: r,
|
|
4190
|
-
realType:
|
|
4190
|
+
realType: b
|
|
4191
4191
|
}]
|
|
4192
4192
|
) : p.addVertex({
|
|
4193
4193
|
options: {
|
|
@@ -4197,75 +4197,75 @@ async function Be(t, e, l, o) {
|
|
|
4197
4197
|
w: k.layout.width,
|
|
4198
4198
|
h: k.layout.height,
|
|
4199
4199
|
pt: r,
|
|
4200
|
-
realType:
|
|
4200
|
+
realType: b
|
|
4201
4201
|
}
|
|
4202
4202
|
});
|
|
4203
4203
|
break;
|
|
4204
4204
|
case "del":
|
|
4205
|
-
e.isEnabled() && (e.removeCells(),
|
|
4205
|
+
e.isEnabled() && (e.removeCells(), s.handelEvent({ key: "delete" }));
|
|
4206
4206
|
break;
|
|
4207
4207
|
case "edit":
|
|
4208
4208
|
let z = null;
|
|
4209
4209
|
var h = new Array();
|
|
4210
|
-
h = e.getSelectionCells(), h && h.length > 0 ? z = h[0] : z = p.parent,
|
|
4210
|
+
h = e.getSelectionCells(), h && h.length > 0 ? z = h[0] : z = p.parent, s.handelEvent({ key: "edit", val: z });
|
|
4211
4211
|
break;
|
|
4212
4212
|
case "clone":
|
|
4213
4213
|
var h = new Array();
|
|
4214
|
-
h = e.getSelectionCells(), mxClipboard.copy(e, h), mxClipboard.paste(e), await kt(e, mxClipboard.cells),
|
|
4214
|
+
h = e.getSelectionCells(), mxClipboard.copy(e, h), mxClipboard.paste(e), await kt(e, mxClipboard.cells), s.handelEvent({ key: "clone", val: h });
|
|
4215
4215
|
break;
|
|
4216
4216
|
case "copy":
|
|
4217
4217
|
var h = new Array();
|
|
4218
|
-
h = e.getSelectionCells(), mxClipboard.copy(e, h),
|
|
4218
|
+
h = e.getSelectionCells(), mxClipboard.copy(e, h), s.handelEvent({ key: "copy", val: h });
|
|
4219
4219
|
break;
|
|
4220
4220
|
case "paste":
|
|
4221
|
-
const
|
|
4222
|
-
Ct(e,
|
|
4221
|
+
const g = mxClipboard.cells;
|
|
4222
|
+
Ct(e, g, r, s);
|
|
4223
4223
|
break;
|
|
4224
4224
|
case "cut":
|
|
4225
4225
|
mxClipboard.cut(e, h);
|
|
4226
4226
|
break;
|
|
4227
4227
|
case "alignLeft":
|
|
4228
|
-
|
|
4228
|
+
v.execute("alignCellsLeft");
|
|
4229
4229
|
break;
|
|
4230
4230
|
case "alignRight":
|
|
4231
|
-
|
|
4231
|
+
v.execute("alignCellsRight");
|
|
4232
4232
|
break;
|
|
4233
4233
|
case "alignCenterHorizontal":
|
|
4234
|
-
|
|
4234
|
+
v.execute("alignCellsCenter");
|
|
4235
4235
|
break;
|
|
4236
4236
|
case "alignCenterVertical":
|
|
4237
|
-
|
|
4237
|
+
v.execute("alignCellsMiddle");
|
|
4238
4238
|
break;
|
|
4239
4239
|
case "toUp":
|
|
4240
|
-
|
|
4240
|
+
v.execute("toFront"), s.handelEvent({ key: "toLayer", val: h });
|
|
4241
4241
|
break;
|
|
4242
4242
|
case "toDown":
|
|
4243
|
-
|
|
4243
|
+
v.execute("toDown"), s.handelEvent({ key: "toLayer", val: h });
|
|
4244
4244
|
break;
|
|
4245
4245
|
case "upOne":
|
|
4246
|
-
|
|
4246
|
+
v.execute("upOne"), s.handelEvent({ key: "toLayer", val: h });
|
|
4247
4247
|
break;
|
|
4248
4248
|
case "downOne":
|
|
4249
|
-
|
|
4249
|
+
v.execute("downOne"), s.handelEvent({ key: "toLayer", val: h });
|
|
4250
4250
|
break;
|
|
4251
4251
|
case "alignCellsTop":
|
|
4252
|
-
|
|
4252
|
+
v.execute("alignCellsTop");
|
|
4253
4253
|
break;
|
|
4254
4254
|
case "alignCellsBottom":
|
|
4255
|
-
|
|
4255
|
+
v.execute("alignCellsBottom");
|
|
4256
4256
|
break;
|
|
4257
4257
|
}
|
|
4258
4258
|
}
|
|
4259
4259
|
function Et(t, e, l) {
|
|
4260
4260
|
if (!e) return;
|
|
4261
|
-
const
|
|
4262
|
-
let r =
|
|
4263
|
-
e.type == "kitUI:CanvasWidget" && (r = e.style),
|
|
4261
|
+
const s = t.getModel();
|
|
4262
|
+
let r = s.getStyle(e);
|
|
4263
|
+
e.type == "kitUI:CanvasWidget" && (r = e.style), s.beginUpdate();
|
|
4264
4264
|
try {
|
|
4265
4265
|
if (r === l) return;
|
|
4266
|
-
|
|
4266
|
+
s.setStyle(e, l);
|
|
4267
4267
|
} finally {
|
|
4268
|
-
|
|
4268
|
+
s.endUpdate();
|
|
4269
4269
|
}
|
|
4270
4270
|
const m = {
|
|
4271
4271
|
cell: e,
|
|
@@ -4273,150 +4273,150 @@ function Et(t, e, l) {
|
|
|
4273
4273
|
newStyle: l,
|
|
4274
4274
|
// 撤销操作:恢复旧样式
|
|
4275
4275
|
undo: function() {
|
|
4276
|
-
|
|
4276
|
+
s.beginUpdate();
|
|
4277
4277
|
try {
|
|
4278
|
-
let
|
|
4278
|
+
let b = Fe(this.cell, this.oldStyle), x = t.container.querySelector("canvas");
|
|
4279
4279
|
if (x && this.cell.type == "kitUI:CanvasWidget") {
|
|
4280
|
-
if (
|
|
4281
|
-
let h =
|
|
4280
|
+
if (b && b.viewSize) {
|
|
4281
|
+
let h = b.viewSize.split(",");
|
|
4282
4282
|
if (h && h.length > 0) {
|
|
4283
4283
|
let k = this.cell.geometry;
|
|
4284
|
-
k != null && (k = k.clone(), k.width = h[0], k.height = h[1],
|
|
4284
|
+
k != null && (k = k.clone(), k.width = h[0], k.height = h[1], s.setGeometry(this.cell, k));
|
|
4285
4285
|
}
|
|
4286
4286
|
}
|
|
4287
|
-
|
|
4287
|
+
b["background-image"] ? x.style.background = `${b["background-image"]}center center no-repeat` : x.style.background = "transparent";
|
|
4288
4288
|
}
|
|
4289
|
-
|
|
4289
|
+
b && Object.keys(b).length > 0 && (this.cell.value.style = b, this.cell.value.data = Oe(b, this.cell.value.data), s.setStyle(this.cell, this.oldStyle), t.refresh(this.cell));
|
|
4290
4290
|
} finally {
|
|
4291
|
-
|
|
4291
|
+
s.endUpdate();
|
|
4292
4292
|
}
|
|
4293
4293
|
},
|
|
4294
4294
|
// 重做操作:应用新样式
|
|
4295
4295
|
redo: function() {
|
|
4296
|
-
|
|
4296
|
+
s.beginUpdate();
|
|
4297
4297
|
try {
|
|
4298
|
-
let
|
|
4298
|
+
let b = Fe(this.cell, this.newStyle), x = t.container.querySelector("canvas");
|
|
4299
4299
|
if (x && this.cell.type == "kitUI:CanvasWidget") {
|
|
4300
|
-
if (
|
|
4301
|
-
let h =
|
|
4300
|
+
if (b && b.viewSize) {
|
|
4301
|
+
let h = b.viewSize.split(",");
|
|
4302
4302
|
if (h && h.length > 0) {
|
|
4303
4303
|
let k = this.cell.geometry;
|
|
4304
|
-
k != null && (k = k.clone(), k.width = h[0], k.height = h[1],
|
|
4304
|
+
k != null && (k = k.clone(), k.width = h[0], k.height = h[1], s.setGeometry(this.cell, k));
|
|
4305
4305
|
}
|
|
4306
4306
|
}
|
|
4307
|
-
|
|
4307
|
+
b["background-image"] ? x.style.background = `${b["background-image"]}center center no-repeat` : x.style.background = "transparent";
|
|
4308
4308
|
}
|
|
4309
|
-
this.cell.value.style =
|
|
4309
|
+
this.cell.value.style = b, this.cell.value.data = Oe(b, this.cell.value.data), t.refresh(this.cell);
|
|
4310
4310
|
} finally {
|
|
4311
|
-
|
|
4311
|
+
s.endUpdate();
|
|
4312
4312
|
}
|
|
4313
4313
|
}
|
|
4314
|
-
}, p = new mxUndoableEdit(
|
|
4315
|
-
p.add(m),
|
|
4314
|
+
}, p = new mxUndoableEdit(s);
|
|
4315
|
+
p.add(m), s.fireEvent(new mxEventObject(mxEvent.UNDO, "edit", p)), s.fireEvent(new mxEventObject(mxEvent.REDO, "edit", p));
|
|
4316
4316
|
}
|
|
4317
4317
|
function At(t) {
|
|
4318
4318
|
return t !== null && typeof t == "object";
|
|
4319
4319
|
}
|
|
4320
4320
|
function zt(t) {
|
|
4321
|
-
return t.slice(0, 1) === "-" && (t = t.slice(1)), t.replace(/([^-])(?:-+([^-]))/g, function(e, l,
|
|
4322
|
-
return l +
|
|
4321
|
+
return t.slice(0, 1) === "-" && (t = t.slice(1)), t.replace(/([^-])(?:-+([^-]))/g, function(e, l, s) {
|
|
4322
|
+
return l + s.toUpperCase();
|
|
4323
4323
|
});
|
|
4324
4324
|
}
|
|
4325
4325
|
function Fe(t, e) {
|
|
4326
4326
|
if (At(e)) return e;
|
|
4327
|
-
const l = e.trim().split(";"),
|
|
4327
|
+
const l = e.trim().split(";"), s = {};
|
|
4328
4328
|
l.forEach((x) => {
|
|
4329
4329
|
if (!x.trim()) return;
|
|
4330
|
-
const
|
|
4331
|
-
if (
|
|
4332
|
-
const h = x.substring(0,
|
|
4330
|
+
const v = x.indexOf("=");
|
|
4331
|
+
if (v === -1) return;
|
|
4332
|
+
const h = x.substring(0, v).trim(), k = x.substring(v + 1).trim(), N = zt(h);
|
|
4333
4333
|
let A = k;
|
|
4334
|
-
N === "gap" && (A = k.replace("px", "")),
|
|
4334
|
+
N === "gap" && (A = k.replace("px", "")), s[N] = A;
|
|
4335
4335
|
});
|
|
4336
4336
|
let { style: r, compType: m, data: p } = _e(t.realType, "0", null);
|
|
4337
|
-
return { ...r, ...
|
|
4337
|
+
return { ...r, ...s };
|
|
4338
4338
|
}
|
|
4339
4339
|
function Oe(t, e) {
|
|
4340
|
-
return e ? ((e.children || []).forEach((
|
|
4341
|
-
|
|
4340
|
+
return e ? ((e.children || []).forEach((s) => {
|
|
4341
|
+
s.value = t[s.key] || null;
|
|
4342
4342
|
}), e) : [];
|
|
4343
4343
|
}
|
|
4344
4344
|
function Me(t) {
|
|
4345
4345
|
let e = this;
|
|
4346
4346
|
e.ts = t;
|
|
4347
|
-
function l(
|
|
4347
|
+
function l(v, h) {
|
|
4348
4348
|
if (document.activeElement !== h.srcElement)
|
|
4349
4349
|
return;
|
|
4350
4350
|
let k = 10;
|
|
4351
4351
|
h.ctrlKey && (k = 1);
|
|
4352
|
-
const N =
|
|
4353
|
-
let A =
|
|
4352
|
+
const N = v.getSelectionCells();
|
|
4353
|
+
let A = v.getModel();
|
|
4354
4354
|
A.beginUpdate();
|
|
4355
4355
|
try {
|
|
4356
|
-
let z = 0,
|
|
4357
|
-
h.key === "ArrowUp" ? (
|
|
4356
|
+
let z = 0, g = 0;
|
|
4357
|
+
h.key === "ArrowUp" ? (g = -k, z = 0) : h.key === "ArrowDown" ? (g = k, z = 0) : h.key === "ArrowLeft" ? (z = -k, g = 0) : h.key === "ArrowRight" && (z = k, g = 0), v.moveCells(N, z, g);
|
|
4358
4358
|
} finally {
|
|
4359
4359
|
A.endUpdate();
|
|
4360
4360
|
}
|
|
4361
4361
|
}
|
|
4362
|
-
function
|
|
4363
|
-
let h =
|
|
4364
|
-
return !!(
|
|
4362
|
+
function s(v) {
|
|
4363
|
+
let h = v.indexOfNextAdd;
|
|
4364
|
+
return !!(v.history && v.history.length == 1 && h == 1);
|
|
4365
4365
|
}
|
|
4366
4366
|
e.graph = null;
|
|
4367
4367
|
let r = !1, m = !1;
|
|
4368
|
-
const p = function(
|
|
4368
|
+
const p = function(v, h, k) {
|
|
4369
4369
|
let N = e.graph;
|
|
4370
4370
|
if (!N) return;
|
|
4371
|
-
const A =
|
|
4371
|
+
const A = v.ctrlKey || v.metaKey;
|
|
4372
4372
|
let z = !1;
|
|
4373
4373
|
if (!e.ts.pageShortcuts) {
|
|
4374
4374
|
if (A) {
|
|
4375
|
-
if (
|
|
4376
|
-
|
|
4377
|
-
else if (
|
|
4378
|
-
|
|
4379
|
-
else if (
|
|
4375
|
+
if (v.key === "z" || v.key === "Z")
|
|
4376
|
+
s(h), h.canUndo() && (h.undo(), e.ts.handelEvent({ key: "unre" }), k && k("undo"));
|
|
4377
|
+
else if (v.key === "y" || v.key === "Y")
|
|
4378
|
+
s(h), h.canRedo() && (h.redo(), e.ts.handelEvent({ key: "unre" }), k && k("redo"));
|
|
4379
|
+
else if (v.key === "a" || v.key === "A")
|
|
4380
4380
|
N.selectCells(!0, !1), e.ts.handelEvent({ key: "selectAll" });
|
|
4381
|
-
else if (
|
|
4381
|
+
else if (v.key === "c" || v.key === "C") {
|
|
4382
4382
|
if (r) return;
|
|
4383
|
-
let
|
|
4384
|
-
|
|
4385
|
-
} else if (
|
|
4383
|
+
let g = new Array();
|
|
4384
|
+
g = N.getSelectionCells(), g && g.length > 0 && (mxClipboard.copy(N, g), r = !0, m = !1, e.ts.handelEvent({ key: "copy", evt: v, val: g })), z = !0;
|
|
4385
|
+
} else if (v.key === "v" || v.key === "V") {
|
|
4386
4386
|
if (m) return;
|
|
4387
|
-
let
|
|
4388
|
-
mxClipboard.paste(N),
|
|
4387
|
+
let T = mxClipboard.cells.filter((D) => D.type === "edge");
|
|
4388
|
+
mxClipboard.paste(N), T.length > 0 && b(N, mxClipboard.cells), r = !1, m = !0, setTimeout(() => {
|
|
4389
4389
|
m = !1;
|
|
4390
|
-
}, 10), e.ts.handelEvent({ key: "paste", evt:
|
|
4391
|
-
} else if (
|
|
4392
|
-
let
|
|
4393
|
-
mxClipboard.cut(N,
|
|
4394
|
-
} else if (
|
|
4395
|
-
let
|
|
4396
|
-
mxClipboard.copy(N,
|
|
4397
|
-
} else if (
|
|
4398
|
-
let
|
|
4399
|
-
|
|
4400
|
-
} else if (
|
|
4401
|
-
const
|
|
4402
|
-
if (
|
|
4403
|
-
const
|
|
4404
|
-
N.setSelectionCell(
|
|
4390
|
+
}, 10), e.ts.handelEvent({ key: "paste", evt: v }), z = !0;
|
|
4391
|
+
} else if (v.key === "x" || v.key === "X") {
|
|
4392
|
+
let g = N.getSelectionCells();
|
|
4393
|
+
mxClipboard.cut(N, g), e.ts.handelEvent({ key: "cut", evt: v, val: g });
|
|
4394
|
+
} else if (v.key === "d" || v.key === "D") {
|
|
4395
|
+
let g = N.getSelectionCells();
|
|
4396
|
+
mxClipboard.copy(N, g), mxClipboard.paste(N), b(N, mxClipboard.cells), e.ts.handelEvent({ key: "clone", evt: v, val: g }), z = !0;
|
|
4397
|
+
} else if (v.key === "s" || v.key === "S") {
|
|
4398
|
+
let g = new Array();
|
|
4399
|
+
g = N.getSelectionCells(), e.ts.handelEvent({ key: "save", evt: v, val: g }), v.preventDefault();
|
|
4400
|
+
} else if (v.key === "g" || v.key === "G") {
|
|
4401
|
+
const g = N.getSelectionCells();
|
|
4402
|
+
if (g.length > 0) {
|
|
4403
|
+
const T = N.groupCells(null, 10, g);
|
|
4404
|
+
N.setSelectionCell(T);
|
|
4405
4405
|
} else
|
|
4406
|
-
N.ungroupCells(
|
|
4406
|
+
N.ungroupCells(g);
|
|
4407
4407
|
}
|
|
4408
4408
|
}
|
|
4409
|
-
|
|
4409
|
+
v.key === "Delete" && (N.isEnabled() && N.removeCells(), e.ts.handelEvent({ key: "delete" })), l(N, v), v.preventDefault(), v.stopPropagation();
|
|
4410
4410
|
}
|
|
4411
|
-
z && (
|
|
4411
|
+
z && (v.preventDefault(), v.stopPropagation(), mxEvent.consume(v));
|
|
4412
4412
|
};
|
|
4413
|
-
e.keyUpdown = function(
|
|
4414
|
-
e.graph =
|
|
4415
|
-
}, e.removeListener = function(
|
|
4416
|
-
|
|
4413
|
+
e.keyUpdown = function(v, h, k) {
|
|
4414
|
+
e.graph = v, v.container.addEventListener("keydown", (A) => p(A, h, k));
|
|
4415
|
+
}, e.removeListener = function(v) {
|
|
4416
|
+
v.setSelectionCells([]), e.graph = null, r = !1, m = !1;
|
|
4417
4417
|
};
|
|
4418
|
-
async function v
|
|
4419
|
-
|
|
4418
|
+
async function b(v, h) {
|
|
4419
|
+
v.getDefaultParent();
|
|
4420
4420
|
let k = [], N = [];
|
|
4421
4421
|
if (h && h.length > 0) {
|
|
4422
4422
|
for (let A = 0; A < h.length; A++) {
|
|
@@ -4426,18 +4426,18 @@ function Me(t) {
|
|
|
4426
4426
|
if (N.length > 0)
|
|
4427
4427
|
for (let A = 0; A < N.length; A++) {
|
|
4428
4428
|
const z = N[A];
|
|
4429
|
-
let
|
|
4430
|
-
k.push(
|
|
4429
|
+
let g = await x(v, z);
|
|
4430
|
+
k.push(g);
|
|
4431
4431
|
}
|
|
4432
|
-
|
|
4432
|
+
v.addSelectionCells(k);
|
|
4433
4433
|
}
|
|
4434
4434
|
}
|
|
4435
|
-
function x(
|
|
4435
|
+
function x(v, h) {
|
|
4436
4436
|
return new Promise((k, N) => {
|
|
4437
|
-
let A =
|
|
4437
|
+
let A = v.getDefaultParent(), z = v.getModel();
|
|
4438
4438
|
z.beginUpdate();
|
|
4439
4439
|
try {
|
|
4440
|
-
var
|
|
4440
|
+
var g = v.insertEdge(
|
|
4441
4441
|
A,
|
|
4442
4442
|
null,
|
|
4443
4443
|
"",
|
|
@@ -4446,22 +4446,22 @@ function Me(t) {
|
|
|
4446
4446
|
null,
|
|
4447
4447
|
h.style
|
|
4448
4448
|
// 继承样式
|
|
4449
|
-
),
|
|
4450
|
-
let $ = R.getTerminalPoint(!0),
|
|
4451
|
-
var
|
|
4452
|
-
|
|
4449
|
+
), T = 10, D = 10, R = v.getCellGeometry(h);
|
|
4450
|
+
let $ = R.getTerminalPoint(!0), P = R.getTerminalPoint(!1);
|
|
4451
|
+
var K = new mxGeometry();
|
|
4452
|
+
K.setTerminalPoint(
|
|
4453
4453
|
new mxPoint(
|
|
4454
|
-
$.x +
|
|
4455
|
-
$.y +
|
|
4454
|
+
$.x + T,
|
|
4455
|
+
$.y + D
|
|
4456
4456
|
),
|
|
4457
4457
|
!0
|
|
4458
|
-
),
|
|
4458
|
+
), K.setTerminalPoint(
|
|
4459
4459
|
new mxPoint(
|
|
4460
|
-
|
|
4461
|
-
|
|
4460
|
+
P.x + T,
|
|
4461
|
+
P.y + D
|
|
4462
4462
|
),
|
|
4463
4463
|
!1
|
|
4464
|
-
),
|
|
4464
|
+
), g.setGeometry(K), g.value = h.value, g.type = h.type, g.model = "yes", g.type = "edge", g.iconName = h.iconName, k(g);
|
|
4465
4465
|
} finally {
|
|
4466
4466
|
z.endUpdate();
|
|
4467
4467
|
}
|
|
@@ -4471,8 +4471,8 @@ function Me(t) {
|
|
|
4471
4471
|
const ke = (t, e) => {
|
|
4472
4472
|
let l = { x: 0, y: 0 };
|
|
4473
4473
|
if (t) {
|
|
4474
|
-
let
|
|
4475
|
-
t.horizontalAlign == "start" && (l.x = 0), t.horizontalAlign == "center" && (l.x =
|
|
4474
|
+
let s = e.offsetWidth, r = e.offsetHeight;
|
|
4475
|
+
t.horizontalAlign == "start" && (l.x = 0), t.horizontalAlign == "center" && (l.x = s / 2 - t.width / 2), t.horizontalAlign == "end" && (l.x = s - t.width), t.verticalAlign == "start" && (l.y = 0), t.verticalAlign == "center" && (l.y = r / 2 - t.height / 2), t.verticalAlign == "end" && (l.y = r - t.height);
|
|
4476
4476
|
}
|
|
4477
4477
|
return l;
|
|
4478
4478
|
}, Nt = (t) => {
|
|
@@ -4489,22 +4489,22 @@ function Ee(t) {
|
|
|
4489
4489
|
if (t.attributes.length > 0) {
|
|
4490
4490
|
e.node = {};
|
|
4491
4491
|
for (let l = 0; l < t.attributes.length; l++) {
|
|
4492
|
-
const
|
|
4493
|
-
e.node[
|
|
4492
|
+
const s = t.attributes.item(l);
|
|
4493
|
+
e.node[s.nodeName] = s.nodeValue;
|
|
4494
4494
|
}
|
|
4495
4495
|
}
|
|
4496
4496
|
} else t.nodeType === 3 && (e = t.nodeValue);
|
|
4497
4497
|
if (t.hasChildNodes())
|
|
4498
4498
|
for (let l = 0; l < t.childNodes.length; l++) {
|
|
4499
|
-
const
|
|
4499
|
+
const s = t.childNodes.item(l), r = s.nodeName;
|
|
4500
4500
|
if (typeof e[r] > "u")
|
|
4501
|
-
e[r] = Ee(
|
|
4501
|
+
e[r] = Ee(s);
|
|
4502
4502
|
else {
|
|
4503
4503
|
if (typeof e[r].push > "u") {
|
|
4504
4504
|
const m = e[r];
|
|
4505
4505
|
e[r] = [], e[r].push(m);
|
|
4506
4506
|
}
|
|
4507
|
-
e[r].push(Ee(
|
|
4507
|
+
e[r].push(Ee(s));
|
|
4508
4508
|
}
|
|
4509
4509
|
}
|
|
4510
4510
|
return e;
|
|
@@ -4517,20 +4517,20 @@ function Pt(t) {
|
|
|
4517
4517
|
return e += `<mxGraphModel>
|
|
4518
4518
|
`, e += ` <root>
|
|
4519
4519
|
`, t.root && Array.isArray(t.root.mxCell) && t.root.mxCell.forEach((l) => {
|
|
4520
|
-
e += " <mxCell", l.node && Object.entries(l.node).forEach(([
|
|
4520
|
+
e += " <mxCell", l.node && Object.entries(l.node).forEach(([s, r]) => {
|
|
4521
4521
|
const m = String(r).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
4522
|
-
e += ` ${
|
|
4522
|
+
e += ` ${s}="${m}"`;
|
|
4523
4523
|
}), l.Object || l.mxGeometry ? (e += `>
|
|
4524
4524
|
`, l.Object && (l.Object.node && l.Object.node.as === "value" ? (e += `<Object as="value">
|
|
4525
|
-
`, l.Object.Object && l.Object.Object.node && (e += "<Object ", Object.entries(l.Object.Object.node).forEach(([
|
|
4526
|
-
e += `${
|
|
4525
|
+
`, l.Object.Object && l.Object.Object.node && (e += "<Object ", Object.entries(l.Object.Object.node).forEach(([s, r]) => {
|
|
4526
|
+
e += `${s}="${xe(r)}" `;
|
|
4527
4527
|
}), e += `/>
|
|
4528
4528
|
`), e += `</Object>
|
|
4529
|
-
`) : l.Object.Object && l.Object.Object.node && l.Object.Object.node.as === "style" && (e += ' <Object as="style">', Object.entries(l.Object.Object.node).forEach(([
|
|
4530
|
-
|
|
4529
|
+
`) : l.Object.Object && l.Object.Object.node && l.Object.Object.node.as === "style" && (e += ' <Object as="style">', Object.entries(l.Object.Object.node).forEach(([s, r]) => {
|
|
4530
|
+
s !== "as" && (e += `<${s}>${xe(r)}</${s}>`);
|
|
4531
4531
|
}), e += `</Object>
|
|
4532
|
-
`)), l.mxGeometry && l.mxGeometry.node && (e += " <mxGeometry", Object.entries(l.mxGeometry.node).forEach(([
|
|
4533
|
-
e += ` ${
|
|
4532
|
+
`)), l.mxGeometry && l.mxGeometry.node && (e += " <mxGeometry", Object.entries(l.mxGeometry.node).forEach(([s, r]) => {
|
|
4533
|
+
e += ` ${s}="${xe(r)}"`;
|
|
4534
4534
|
}), e += `/>
|
|
4535
4535
|
`), e += ` </mxCell>
|
|
4536
4536
|
`) : e += `/>
|
|
@@ -4542,50 +4542,50 @@ function xe(t) {
|
|
|
4542
4542
|
return typeof t != "string" && (t = String(t)), t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
4543
4543
|
}
|
|
4544
4544
|
function Tt(t) {
|
|
4545
|
-
let e = this, l = 10,
|
|
4546
|
-
e.createGrid = function(z,
|
|
4547
|
-
if (k = z,
|
|
4548
|
-
var
|
|
4549
|
-
if (!
|
|
4545
|
+
let e = this, l = 10, s = "#dddddd", r = "#ffffff00", m = 1, p = "square", b = 1, x = 0, v = 0, h = 1, k = null;
|
|
4546
|
+
e.createGrid = function(z, g, T) {
|
|
4547
|
+
if (k = z, g) {
|
|
4548
|
+
var D = document.createElement("canvas");
|
|
4549
|
+
if (!D)
|
|
4550
4550
|
return;
|
|
4551
|
-
|
|
4552
|
-
var R = k.getCellBounds(
|
|
4551
|
+
D.style.position = "absolute";
|
|
4552
|
+
var R = k.getCellBounds(g);
|
|
4553
4553
|
if (R) {
|
|
4554
|
-
|
|
4555
|
-
let $ =
|
|
4556
|
-
$.background && $.background.indexOf("files/") > -1 && $["background-image"] ?
|
|
4554
|
+
D.style.top = R.y + "px", D.style.left = R.x + "px", D.style.width = R.width + 1 + "px", D.style.height = R.height + 1 + "px", D.style.zIndex = -1, D.style.pointerEvents = "none", D.id = "gridCanvas_" + g.id, D.dataId = ue();
|
|
4555
|
+
let $ = g.value.style || {};
|
|
4556
|
+
$.background && $.background.indexOf("files/") > -1 && $["background-image"] ? D.style.background = `${$["background-image"]} center center no-repeat` : D.style.background = "";
|
|
4557
4557
|
}
|
|
4558
|
-
let
|
|
4559
|
-
|
|
4558
|
+
let K = k.container.querySelector("#gridCanvas_" + g.id);
|
|
4559
|
+
K && K.remove(), k.container.prepend(D), D.width = D.offsetWidth, D.height = D.offsetHeight, T ? s = "transparent" : s = "#dddddd", A(D), D.addEventListener("wheel", function($) {
|
|
4560
4560
|
$.preventDefault();
|
|
4561
|
-
const
|
|
4562
|
-
h *= ce, h = Math.min(Math.max(0.5, h), 5), x = ye - Z / h,
|
|
4561
|
+
const P = D.getBoundingClientRect(), Z = $.clientX - P.left, te = $.clientY - P.top, ie = 0.1, oe = $.deltaY < 0 ? 1 : -1, ce = Math.exp(oe * ie), ye = Z / h, be = te / h;
|
|
4562
|
+
h *= ce, h = Math.min(Math.max(0.5, h), 5), x = ye - Z / h, v = be - te / h, A(D), k && (k.view.scale = h, k.refresh());
|
|
4563
4563
|
}), k && N();
|
|
4564
4564
|
}
|
|
4565
4565
|
};
|
|
4566
4566
|
function N() {
|
|
4567
4567
|
if (!k) return;
|
|
4568
|
-
k.snapPoint = function(
|
|
4569
|
-
if (!
|
|
4570
|
-
const R = l / h,
|
|
4571
|
-
|
|
4568
|
+
k.snapPoint = function(g, T, D) {
|
|
4569
|
+
if (!D && this.snapToGrid && l > 0) {
|
|
4570
|
+
const R = l / h, K = g.x - x, $ = g.y - v;
|
|
4571
|
+
g.x = Math.round(K / R) * R + x, g.y = Math.round($ / R) * R + v;
|
|
4572
4572
|
}
|
|
4573
|
-
return
|
|
4573
|
+
return g;
|
|
4574
4574
|
};
|
|
4575
4575
|
const z = k.mouseUp;
|
|
4576
|
-
k.mouseUp = function(
|
|
4577
|
-
z.apply(this, arguments), this.selectedCells.length > 0 && this.snapToGrid &&
|
|
4576
|
+
k.mouseUp = function(g, T) {
|
|
4577
|
+
z.apply(this, arguments), this.selectedCells.length > 0 && this.snapToGrid && T.snapCellsToGrid(this.selectedCells);
|
|
4578
4578
|
};
|
|
4579
4579
|
}
|
|
4580
4580
|
e.snapCellsToGrid = function(z) {
|
|
4581
4581
|
if (!(!z || z.length === 0)) {
|
|
4582
4582
|
this.getModel().beginUpdate();
|
|
4583
4583
|
try {
|
|
4584
|
-
for (let
|
|
4585
|
-
const
|
|
4586
|
-
if (
|
|
4587
|
-
const R =
|
|
4588
|
-
R.x =
|
|
4584
|
+
for (let g = 0; g < z.length; g++) {
|
|
4585
|
+
const T = z[g], D = this.getCellGeometry(T);
|
|
4586
|
+
if (D) {
|
|
4587
|
+
const R = D.clone(), K = this.snapPoint({ x: R.x, y: R.y });
|
|
4588
|
+
R.x = K.x, R.y = K.y, this.getModel().setGeometry(T, R);
|
|
4589
4589
|
}
|
|
4590
4590
|
}
|
|
4591
4591
|
} finally {
|
|
@@ -4595,56 +4595,56 @@ function Tt(t) {
|
|
|
4595
4595
|
};
|
|
4596
4596
|
function A(z) {
|
|
4597
4597
|
h = k.view.scale;
|
|
4598
|
-
let
|
|
4599
|
-
|
|
4600
|
-
const
|
|
4601
|
-
if (
|
|
4602
|
-
|
|
4603
|
-
const
|
|
4598
|
+
let g = z.getContext("2d");
|
|
4599
|
+
g.clearRect(0, 0, z.width, z.height), g.fillStyle = r, g.fillRect(0, 0, z.width, z.height);
|
|
4600
|
+
const T = l * h;
|
|
4601
|
+
if (T < 2) return;
|
|
4602
|
+
g.strokeStyle = s, g.lineWidth = m, g.globalAlpha = b;
|
|
4603
|
+
const D = Math.floor(-x * h / T) * T, R = Math.floor(-v * h / T) * T, K = z.width + T, $ = z.height + T;
|
|
4604
4604
|
switch (p) {
|
|
4605
4605
|
case "dotted":
|
|
4606
|
-
|
|
4607
|
-
for (let
|
|
4608
|
-
for (let Z = R; Z < $; Z +=
|
|
4609
|
-
|
|
4606
|
+
g.fillStyle = s;
|
|
4607
|
+
for (let P = D; P < K; P += T)
|
|
4608
|
+
for (let Z = R; Z < $; Z += T)
|
|
4609
|
+
g.beginPath(), g.arc(P + 0.5, Z + 0.5, m, 0, Math.PI * 2), g.fill();
|
|
4610
4610
|
break;
|
|
4611
4611
|
case "dashed":
|
|
4612
|
-
|
|
4613
|
-
for (let
|
|
4614
|
-
|
|
4615
|
-
for (let
|
|
4616
|
-
|
|
4617
|
-
|
|
4612
|
+
g.setLineDash([5, 3]), g.beginPath();
|
|
4613
|
+
for (let P = D; P < K; P += T)
|
|
4614
|
+
g.moveTo(P + 0.5, 0), g.lineTo(P + 0.5, z.height);
|
|
4615
|
+
for (let P = R; P < $; P += T)
|
|
4616
|
+
g.moveTo(0, P + 0.5), g.lineTo(z.width, P + 0.5);
|
|
4617
|
+
g.stroke(), g.setLineDash([]);
|
|
4618
4618
|
break;
|
|
4619
4619
|
case "square":
|
|
4620
|
-
|
|
4621
|
-
for (let
|
|
4622
|
-
|
|
4623
|
-
for (let
|
|
4624
|
-
|
|
4625
|
-
|
|
4620
|
+
g.beginPath();
|
|
4621
|
+
for (let P = D; P < K; P += T)
|
|
4622
|
+
g.moveTo(P + 0.5, 0), g.lineTo(P + 0.5, z.height);
|
|
4623
|
+
for (let P = R; P < $; P += T)
|
|
4624
|
+
g.moveTo(0, P + 0.5), g.lineTo(z.width, P + 0.5);
|
|
4625
|
+
g.stroke();
|
|
4626
4626
|
break;
|
|
4627
4627
|
default:
|
|
4628
|
-
|
|
4629
|
-
for (let
|
|
4630
|
-
|
|
4631
|
-
for (let
|
|
4632
|
-
|
|
4633
|
-
|
|
4628
|
+
g.beginPath();
|
|
4629
|
+
for (let P = D; P < K; P += T)
|
|
4630
|
+
g.moveTo(P + 0.5, 0), g.lineTo(P + 0.5, z.height);
|
|
4631
|
+
for (let P = R; P < $; P += T)
|
|
4632
|
+
g.moveTo(0, P + 0.5), g.lineTo(z.width, P + 0.5);
|
|
4633
|
+
g.stroke();
|
|
4634
4634
|
}
|
|
4635
|
-
|
|
4635
|
+
g.globalAlpha = 1;
|
|
4636
4636
|
}
|
|
4637
4637
|
e.getGridConfig = function() {
|
|
4638
4638
|
return {
|
|
4639
4639
|
gridSize: l,
|
|
4640
4640
|
scale: h,
|
|
4641
4641
|
offsetX: x,
|
|
4642
|
-
offsetY:
|
|
4642
|
+
offsetY: v
|
|
4643
4643
|
};
|
|
4644
4644
|
}, e.setGridSize = function(z) {
|
|
4645
4645
|
l = z;
|
|
4646
|
-
const
|
|
4647
|
-
|
|
4646
|
+
const g = document.getElementById("canvas");
|
|
4647
|
+
g && A(g);
|
|
4648
4648
|
};
|
|
4649
4649
|
}
|
|
4650
4650
|
const It = ["src"], Dt = {
|
|
@@ -4666,63 +4666,63 @@ const It = ["src"], Dt = {
|
|
|
4666
4666
|
},
|
|
4667
4667
|
setup(t) {
|
|
4668
4668
|
const e = t;
|
|
4669
|
-
return (l,
|
|
4669
|
+
return (l, s) => t.style.btntype == "none" ? (L(), I("div", {
|
|
4670
4670
|
key: 0,
|
|
4671
4671
|
class: "btn-index-none",
|
|
4672
4672
|
style: j(t.style)
|
|
4673
4673
|
}, [
|
|
4674
|
-
e.style.isIcon && !e.style.imgUrl ? (
|
|
4674
|
+
e.style.isIcon && !e.style.imgUrl ? (L(), I("i", {
|
|
4675
4675
|
key: 0,
|
|
4676
4676
|
class: J(["iconfont", e.style.iconName])
|
|
4677
4677
|
}, null, 2)) : _("", !0),
|
|
4678
|
-
e.style.imgUrl ? (
|
|
4678
|
+
e.style.imgUrl ? (L(), I("img", {
|
|
4679
4679
|
key: 1,
|
|
4680
4680
|
src: e.style.imgUrl,
|
|
4681
4681
|
style: { "z-index": "0" },
|
|
4682
4682
|
alt: " "
|
|
4683
4683
|
}, null, 8, It)) : _("", !0),
|
|
4684
|
-
e.style.text ? (
|
|
4685
|
-
!e.style.imgUrl && !e.style.text ? (
|
|
4686
|
-
], 4)) : t.style.btntype == "sq" ? (
|
|
4684
|
+
e.style.text ? (L(), I("span", Dt, ee(e.style.text), 1)) : _("", !0),
|
|
4685
|
+
!e.style.imgUrl && !e.style.text ? (L(), I("span", Bt)) : _("", !0)
|
|
4686
|
+
], 4)) : t.style.btntype == "sq" ? (L(), I("div", {
|
|
4687
4687
|
key: 1,
|
|
4688
4688
|
class: "btn-index",
|
|
4689
4689
|
style: j(t.style)
|
|
4690
4690
|
}, [
|
|
4691
|
-
e.style.isIcon && !e.style.imgUrl ? (
|
|
4691
|
+
e.style.isIcon && !e.style.imgUrl ? (L(), I("i", {
|
|
4692
4692
|
key: 0,
|
|
4693
4693
|
class: J(["iconfont", e.style.iconName])
|
|
4694
4694
|
}, null, 2)) : _("", !0),
|
|
4695
|
-
e.style.imgUrl ? (
|
|
4695
|
+
e.style.imgUrl ? (L(), I("img", {
|
|
4696
4696
|
key: 1,
|
|
4697
4697
|
src: e.style.imgUrl,
|
|
4698
4698
|
style: { "z-index": "0" },
|
|
4699
4699
|
alt: " "
|
|
4700
4700
|
}, null, 8, Ft)) : _("", !0),
|
|
4701
|
-
e.style.text ? (
|
|
4702
|
-
!e.style.imgUrl && !e.style.text ? (
|
|
4703
|
-
], 4)) : (
|
|
4701
|
+
e.style.text ? (L(), I("span", Ot, ee(e.style.text), 1)) : _("", !0),
|
|
4702
|
+
!e.style.imgUrl && !e.style.text ? (L(), I("span", Mt)) : _("", !0)
|
|
4703
|
+
], 4)) : (L(), I("div", {
|
|
4704
4704
|
key: 2,
|
|
4705
4705
|
class: "btn-bg-jd",
|
|
4706
4706
|
style: j(t.style)
|
|
4707
4707
|
}, [
|
|
4708
|
-
e.style.isIcon && !e.style.imgUrl ? (
|
|
4708
|
+
e.style.isIcon && !e.style.imgUrl ? (L(), I("i", {
|
|
4709
4709
|
key: 0,
|
|
4710
4710
|
class: J(["iconfont", e.style.iconName])
|
|
4711
4711
|
}, null, 2)) : _("", !0),
|
|
4712
|
-
e.style.imgUrl ? (
|
|
4712
|
+
e.style.imgUrl ? (L(), I("img", {
|
|
4713
4713
|
key: 1,
|
|
4714
4714
|
src: e.style.imgUrl,
|
|
4715
4715
|
style: { "z-index": "0" },
|
|
4716
4716
|
alt: " "
|
|
4717
4717
|
}, null, 8, Vt)) : _("", !0),
|
|
4718
|
-
e.style.text ? (
|
|
4719
|
-
!e.style.imgUrl && !e.style.text ? (
|
|
4718
|
+
e.style.text ? (L(), I("span", Rt, ee(e.style.text), 1)) : _("", !0),
|
|
4719
|
+
!e.style.imgUrl && !e.style.text ? (L(), I("span", Wt)) : _("", !0)
|
|
4720
4720
|
], 4));
|
|
4721
4721
|
}
|
|
4722
4722
|
}, ae = (t, e) => {
|
|
4723
4723
|
const l = t.__vccOpts || t;
|
|
4724
|
-
for (const [
|
|
4725
|
-
l[
|
|
4724
|
+
for (const [s, r] of e)
|
|
4725
|
+
l[s] = r;
|
|
4726
4726
|
return l;
|
|
4727
4727
|
}, _t = {
|
|
4728
4728
|
name: "VerticalRuler",
|
|
@@ -4758,43 +4758,43 @@ const It = ["src"], Dt = {
|
|
|
4758
4758
|
let e = {};
|
|
4759
4759
|
for (const l in t) {
|
|
4760
4760
|
if (!Object.hasOwn(t, l)) continue;
|
|
4761
|
-
const
|
|
4762
|
-
let m =
|
|
4763
|
-
r === "gap" && (m = `${
|
|
4761
|
+
const s = t[l], r = l.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
4762
|
+
let m = s;
|
|
4763
|
+
r === "gap" && (m = `${s}px`), (r === "fontSize" || r === "font-size") && (m = `${s}px`), e[r] = m;
|
|
4764
4764
|
}
|
|
4765
4765
|
return e;
|
|
4766
4766
|
}
|
|
4767
4767
|
},
|
|
4768
4768
|
computed: {
|
|
4769
4769
|
getFontStyle() {
|
|
4770
|
-
let t = this, e = t.style,
|
|
4770
|
+
let t = this, e = t.style, s = {
|
|
4771
4771
|
color: e.color,
|
|
4772
4772
|
...e.valuefont
|
|
4773
4773
|
};
|
|
4774
|
-
return t.convertToStyleString(
|
|
4774
|
+
return t.convertToStyleString(s);
|
|
4775
4775
|
},
|
|
4776
4776
|
getScalesFontStyle() {
|
|
4777
|
-
let t = this, e = t.style,
|
|
4777
|
+
let t = this, e = t.style, s = {
|
|
4778
4778
|
color: e.color,
|
|
4779
4779
|
...e.scalefont
|
|
4780
4780
|
};
|
|
4781
|
-
return t.convertToStyleString(
|
|
4781
|
+
return t.convertToStyleString(s);
|
|
4782
4782
|
},
|
|
4783
4783
|
// 计算chart-bottom的高度(与刻度对应)
|
|
4784
4784
|
ywvalue() {
|
|
4785
|
-
const t = this, e = t.getNumber(t.style.value), l = t.getNumber(t.style.max),
|
|
4786
|
-
return p <= 0 ? 0 : (m -
|
|
4785
|
+
const t = this, e = t.getNumber(t.style.value), l = t.getNumber(t.style.max), s = t.getNumber(t.style.min), r = t.getNumber(t.style.layout.height), m = Math.max(s, Math.min(e, l)), p = l - s;
|
|
4786
|
+
return p <= 0 ? 0 : (m - s) / p * r - 8;
|
|
4787
4787
|
},
|
|
4788
4788
|
// 每个刻度的像素间隔
|
|
4789
4789
|
scaleInterval() {
|
|
4790
|
-
const t = this, e = t.getNumber(t.style.max), l = t.getNumber(t.style.min),
|
|
4791
|
-
return r > 1 ?
|
|
4790
|
+
const t = this, e = t.getNumber(t.style.max), l = t.getNumber(t.style.min), s = t.getNumber(t.style.layout.height), r = Math.floor((e - l) / t.style.scales) + 1;
|
|
4791
|
+
return r > 1 ? s / (r - 1) : 0;
|
|
4792
4792
|
},
|
|
4793
4793
|
// 生成刻度值数组(从上到下从大到小)
|
|
4794
4794
|
scaleValues() {
|
|
4795
|
-
const t = this, e = t.getNumber(t.style.max), l = t.getNumber(t.style.min),
|
|
4795
|
+
const t = this, e = t.getNumber(t.style.max), l = t.getNumber(t.style.min), s = t.getNumber(t.style.scales) || 10;
|
|
4796
4796
|
let r = [];
|
|
4797
|
-
for (let m = e; m >= l; m -=
|
|
4797
|
+
for (let m = e; m >= l; m -= s)
|
|
4798
4798
|
r.push(m.toFixed(0));
|
|
4799
4799
|
return r;
|
|
4800
4800
|
}
|
|
@@ -4802,26 +4802,26 @@ const It = ["src"], Dt = {
|
|
|
4802
4802
|
mounted() {
|
|
4803
4803
|
}
|
|
4804
4804
|
}, jt = { class: "ruler-container" };
|
|
4805
|
-
function Ht(t, e, l,
|
|
4806
|
-
return
|
|
4807
|
-
l.style.scalevisible || l.style.scalevisible == 1 ? (
|
|
4805
|
+
function Ht(t, e, l, s, r, m) {
|
|
4806
|
+
return L(), I("div", jt, [
|
|
4807
|
+
l.style.scalevisible || l.style.scalevisible == 1 ? (L(), I("div", {
|
|
4808
4808
|
key: 0,
|
|
4809
4809
|
class: "vertical-ruler",
|
|
4810
4810
|
style: j(m.getScalesFontStyle)
|
|
4811
4811
|
}, [
|
|
4812
|
-
(
|
|
4813
|
-
key:
|
|
4812
|
+
(L(!0), I(ge, null, ve(m.scaleValues, (p, b) => (L(), I("div", {
|
|
4813
|
+
key: b,
|
|
4814
4814
|
class: "scale-mark",
|
|
4815
|
-
style: j({ top: `${
|
|
4815
|
+
style: j({ top: `${b * m.scaleInterval}px` })
|
|
4816
4816
|
}, [
|
|
4817
|
-
|
|
4817
|
+
b != 0 ? (L(), I("span", {
|
|
4818
4818
|
key: 0,
|
|
4819
4819
|
class: "mark-value",
|
|
4820
4820
|
style: j({ color: l.style.color })
|
|
4821
4821
|
}, ee(p), 5)) : _("", !0),
|
|
4822
|
-
|
|
4822
|
+
b != 0 ? (L(), I("div", {
|
|
4823
4823
|
key: 1,
|
|
4824
|
-
class: J(["mark-line", { "long-mark":
|
|
4824
|
+
class: J(["mark-line", { "long-mark": b % 5 === 0 }]),
|
|
4825
4825
|
style: j({ background: l.style.color })
|
|
4826
4826
|
}, null, 6)) : _("", !0)
|
|
4827
4827
|
], 4))), 128))
|
|
@@ -4830,7 +4830,7 @@ function Ht(t, e, l, o, r, m) {
|
|
|
4830
4830
|
class: "chart-bottom",
|
|
4831
4831
|
style: j({ height: `${m.ywvalue}px`, background: l.style.fillColor })
|
|
4832
4832
|
}, [
|
|
4833
|
-
l.style.valuevisible || l.style.valuevisible == 1 ? (
|
|
4833
|
+
l.style.valuevisible || l.style.valuevisible == 1 ? (L(), I("span", {
|
|
4834
4834
|
key: 0,
|
|
4835
4835
|
class: "value-text",
|
|
4836
4836
|
style: j(m.getFontStyle)
|
|
@@ -4872,67 +4872,67 @@ const $t = /* @__PURE__ */ ae(_t, [["render", Ht], ["__scopeId", "data-v-b14d49d
|
|
|
4872
4872
|
let e = {};
|
|
4873
4873
|
for (const l in t) {
|
|
4874
4874
|
if (!Object.hasOwn(t, l)) continue;
|
|
4875
|
-
const
|
|
4876
|
-
let m =
|
|
4877
|
-
r === "gap" && (m = `${
|
|
4875
|
+
const s = t[l], r = l.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
4876
|
+
let m = s;
|
|
4877
|
+
r === "gap" && (m = `${s}px`), (r === "fontSize" || r === "font-size") && (m = `${s}px`), e[r] = m;
|
|
4878
4878
|
}
|
|
4879
4879
|
return e;
|
|
4880
4880
|
}
|
|
4881
4881
|
},
|
|
4882
4882
|
computed: {
|
|
4883
4883
|
getFontStyle() {
|
|
4884
|
-
let t = this, e = t.style,
|
|
4884
|
+
let t = this, e = t.style, s = {
|
|
4885
4885
|
color: e.color,
|
|
4886
4886
|
...e.valuefont
|
|
4887
4887
|
};
|
|
4888
|
-
return t.convertToStyleString(
|
|
4888
|
+
return t.convertToStyleString(s);
|
|
4889
4889
|
},
|
|
4890
4890
|
getScalesFontStyle() {
|
|
4891
|
-
let t = this, e = t.style,
|
|
4891
|
+
let t = this, e = t.style, s = {
|
|
4892
4892
|
color: e.color,
|
|
4893
4893
|
...e.scalefont
|
|
4894
4894
|
};
|
|
4895
|
-
return t.convertToStyleString(
|
|
4895
|
+
return t.convertToStyleString(s);
|
|
4896
4896
|
},
|
|
4897
4897
|
// 计算chart-bottom的高度(与刻度对应)
|
|
4898
4898
|
ywvalue() {
|
|
4899
|
-
const t = this, e = t.getNumber(t.style.value), l = t.getNumber(t.style.max),
|
|
4900
|
-
return p <= 0 ? 0 : (m -
|
|
4899
|
+
const t = this, e = t.getNumber(t.style.value), l = t.getNumber(t.style.max), s = t.getNumber(t.style.min), r = t.getNumber(t.style.layout.width), m = Math.max(s, Math.min(e, l)), p = l - s;
|
|
4900
|
+
return p <= 0 ? 0 : (m - s) / p * r;
|
|
4901
4901
|
},
|
|
4902
4902
|
// 每个刻度的像素间隔
|
|
4903
4903
|
scaleInterval() {
|
|
4904
|
-
const t = this, e = t.getNumber(t.style.max), l = t.getNumber(t.style.min),
|
|
4905
|
-
return r > 1 ?
|
|
4904
|
+
const t = this, e = t.getNumber(t.style.max), l = t.getNumber(t.style.min), s = t.getNumber(t.style.layout.width), r = Math.floor((e - l) / t.style.scales) + 1;
|
|
4905
|
+
return r > 1 ? s / (r - 1) : 0;
|
|
4906
4906
|
},
|
|
4907
4907
|
// 生成刻度值数组(从上到下从大到小)
|
|
4908
4908
|
scaleValues() {
|
|
4909
|
-
const t = this, e = t.getNumber(t.style.max), l = t.getNumber(t.style.min),
|
|
4910
|
-
for (let m = l; m < e; m +=
|
|
4909
|
+
const t = this, e = t.getNumber(t.style.max), l = t.getNumber(t.style.min), s = t.getNumber(t.style.scales) || 10, r = [];
|
|
4910
|
+
for (let m = l; m < e; m += s)
|
|
4911
4911
|
r.push(m.toFixed(0));
|
|
4912
4912
|
return r;
|
|
4913
4913
|
}
|
|
4914
4914
|
}
|
|
4915
4915
|
}, Kt = { class: "ruler-h-container" };
|
|
4916
|
-
function Yt(t, e, l,
|
|
4917
|
-
return
|
|
4918
|
-
l.style.scalevisible || l.style.scalevisible == 1 ? (
|
|
4916
|
+
function Yt(t, e, l, s, r, m) {
|
|
4917
|
+
return L(), I("div", Kt, [
|
|
4918
|
+
l.style.scalevisible || l.style.scalevisible == 1 ? (L(), I("div", {
|
|
4919
4919
|
key: 0,
|
|
4920
4920
|
class: "h-ruler",
|
|
4921
4921
|
style: j(m.getScalesFontStyle)
|
|
4922
4922
|
}, [
|
|
4923
|
-
(
|
|
4924
|
-
key:
|
|
4923
|
+
(L(!0), I(ge, null, ve(m.scaleValues, (p, b) => (L(), I("div", {
|
|
4924
|
+
key: b,
|
|
4925
4925
|
class: "scale-h-mark",
|
|
4926
|
-
style: j({ left: `${
|
|
4926
|
+
style: j({ left: `${b * m.scaleInterval}px` })
|
|
4927
4927
|
}, [
|
|
4928
|
-
|
|
4928
|
+
b != 0 ? (L(), I("span", {
|
|
4929
4929
|
key: 0,
|
|
4930
4930
|
class: "mark-h-value",
|
|
4931
4931
|
style: j({ color: l.style.color })
|
|
4932
4932
|
}, ee(p), 5)) : _("", !0),
|
|
4933
|
-
|
|
4933
|
+
b != 0 ? (L(), I("div", {
|
|
4934
4934
|
key: 1,
|
|
4935
|
-
class: J(["mark-h-line", { "long-h-mark":
|
|
4935
|
+
class: J(["mark-h-line", { "long-h-mark": b % 5 === 0 }]),
|
|
4936
4936
|
style: j({ background: l.style.color })
|
|
4937
4937
|
}, null, 6)) : _("", !0)
|
|
4938
4938
|
], 4))), 128))
|
|
@@ -4941,7 +4941,7 @@ function Yt(t, e, l, o, r, m) {
|
|
|
4941
4941
|
class: "chart-h-bottom",
|
|
4942
4942
|
style: j({ width: `${m.ywvalue}px`, background: l.style.fillColor })
|
|
4943
4943
|
}, [
|
|
4944
|
-
l.style.valuevisible || l.style.valuevisible == 1 ? (
|
|
4944
|
+
l.style.valuevisible || l.style.valuevisible == 1 ? (L(), I("span", {
|
|
4945
4945
|
key: 0,
|
|
4946
4946
|
class: "value-h-text",
|
|
4947
4947
|
style: j(m.getFontStyle)
|
|
@@ -4969,16 +4969,16 @@ const qt = /* @__PURE__ */ ae(Gt, [["render", Yt], ["__scopeId", "data-v-7f6aaa3
|
|
|
4969
4969
|
}
|
|
4970
4970
|
}
|
|
4971
4971
|
};
|
|
4972
|
-
function Qt(t, e, l,
|
|
4973
|
-
const p = Ie("index-v"),
|
|
4974
|
-
return
|
|
4972
|
+
function Qt(t, e, l, s, r, m) {
|
|
4973
|
+
const p = Ie("index-v"), b = Ie("index-h");
|
|
4974
|
+
return L(), I("div", {
|
|
4975
4975
|
class: "chart-container",
|
|
4976
4976
|
style: j(m.getStyle)
|
|
4977
4977
|
}, [
|
|
4978
|
-
l.style.orientation == "vertical" ? (
|
|
4978
|
+
l.style.orientation == "vertical" ? (L(), me(p, {
|
|
4979
4979
|
key: 0,
|
|
4980
4980
|
style: j(l.style)
|
|
4981
|
-
}, null, 8, ["style"])) : (
|
|
4981
|
+
}, null, 8, ["style"])) : (L(), me(b, {
|
|
4982
4982
|
key: 1,
|
|
4983
4983
|
style: j(l.style)
|
|
4984
4984
|
}, null, 8, ["style"]))
|
|
@@ -5040,8 +5040,8 @@ const Zt = /* @__PURE__ */ ae(Xt, [["render", Qt], ["__scopeId", "data-v-5f295dc
|
|
|
5040
5040
|
key: 2,
|
|
5041
5041
|
style: { "z-index": "0" }
|
|
5042
5042
|
}, al = { key: 3 };
|
|
5043
|
-
function nl(t, e, l,
|
|
5044
|
-
return
|
|
5043
|
+
function nl(t, e, l, s, r, m) {
|
|
5044
|
+
return L(), I("label", {
|
|
5045
5045
|
class: J(["switch-jd", m.switchClasses])
|
|
5046
5046
|
}, [
|
|
5047
5047
|
le("input", {
|
|
@@ -5055,18 +5055,18 @@ function nl(t, e, l, o, r, m) {
|
|
|
5055
5055
|
class: "switch-jd-slider",
|
|
5056
5056
|
style: j(l.style)
|
|
5057
5057
|
}, [
|
|
5058
|
-
l.style.isIcon && !l.style.imgUrl ? (
|
|
5058
|
+
l.style.isIcon && !l.style.imgUrl ? (L(), I("i", {
|
|
5059
5059
|
key: 0,
|
|
5060
5060
|
class: J(["iconfont", l.style.iconName])
|
|
5061
5061
|
}, null, 2)) : _("", !0),
|
|
5062
|
-
l.style.imgUrl ? (
|
|
5062
|
+
l.style.imgUrl ? (L(), I("img", {
|
|
5063
5063
|
key: 1,
|
|
5064
5064
|
src: l.style.imgUrl,
|
|
5065
5065
|
style: { "z-index": "0" },
|
|
5066
5066
|
alt: " "
|
|
5067
5067
|
}, null, 8, tl)) : _("", !0),
|
|
5068
|
-
l.style.text ? (
|
|
5069
|
-
!l.style.imgUrl && !l.style.text ? (
|
|
5068
|
+
l.style.text ? (L(), I("span", ll, ee(l.style.text), 1)) : _("", !0),
|
|
5069
|
+
!l.style.imgUrl && !l.style.text ? (L(), I("span", al)) : _("", !0)
|
|
5070
5070
|
], 4)
|
|
5071
5071
|
], 2);
|
|
5072
5072
|
}
|
|
@@ -5116,9 +5116,9 @@ const il = /* @__PURE__ */ ae(Jt, [["render", nl], ["__scopeId", "data-v-3233cda
|
|
|
5116
5116
|
let e = {};
|
|
5117
5117
|
for (const l in t) {
|
|
5118
5118
|
if (!Object.hasOwn(t, l)) continue;
|
|
5119
|
-
const
|
|
5120
|
-
let m =
|
|
5121
|
-
r === "gap" && (m = `${
|
|
5119
|
+
const s = t[l], r = l.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
5120
|
+
let m = s;
|
|
5121
|
+
r === "gap" && (m = `${s}px`), (r === "fontSize" || r === "font-size") && (m = `${s}px`), e[r] = m;
|
|
5122
5122
|
}
|
|
5123
5123
|
return e;
|
|
5124
5124
|
}
|
|
@@ -5143,8 +5143,8 @@ const il = /* @__PURE__ */ ae(Jt, [["render", nl], ["__scopeId", "data-v-3233cda
|
|
|
5143
5143
|
}
|
|
5144
5144
|
}
|
|
5145
5145
|
}, ol = ["checked", "disabled"];
|
|
5146
|
-
function sl(t, e, l,
|
|
5147
|
-
return
|
|
5146
|
+
function sl(t, e, l, s, r, m) {
|
|
5147
|
+
return L(), I("label", {
|
|
5148
5148
|
class: J(["switch", m.switchClasses])
|
|
5149
5149
|
}, [
|
|
5150
5150
|
le("input", {
|
|
@@ -5177,30 +5177,30 @@ const ul = /* @__PURE__ */ ae(rl, [["render", sl], ["__scopeId", "data-v-41ace2e
|
|
|
5177
5177
|
},
|
|
5178
5178
|
setup(t) {
|
|
5179
5179
|
const e = t, l = it(e.style.realValue === "true");
|
|
5180
|
-
return (
|
|
5180
|
+
return (s, r) => t.style.btntype == "none" ? (L(), I("div", {
|
|
5181
5181
|
key: 0,
|
|
5182
5182
|
class: "switch-none",
|
|
5183
5183
|
style: j(t.style)
|
|
5184
5184
|
}, [
|
|
5185
|
-
e.style.isIcon && !e.style.imgUrl ? (
|
|
5185
|
+
e.style.isIcon && !e.style.imgUrl ? (L(), I("i", {
|
|
5186
5186
|
key: 0,
|
|
5187
5187
|
class: J(["iconfont", e.style.iconName])
|
|
5188
5188
|
}, null, 2)) : _("", !0),
|
|
5189
|
-
e.style.imgUrl ? (
|
|
5189
|
+
e.style.imgUrl ? (L(), I("img", {
|
|
5190
5190
|
key: 1,
|
|
5191
5191
|
src: e.style.imgUrl,
|
|
5192
5192
|
style: { "z-index": "0" },
|
|
5193
5193
|
alt: " "
|
|
5194
5194
|
}, null, 8, dl)) : _("", !0),
|
|
5195
|
-
e.style.text ? (
|
|
5196
|
-
!e.style.imgUrl && !e.style.text ? (
|
|
5197
|
-
], 4)) : t.style.btntype == "sq" ? (
|
|
5195
|
+
e.style.text ? (L(), I("span", cl, ee(e.style.text), 1)) : _("", !0),
|
|
5196
|
+
!e.style.imgUrl && !e.style.text ? (L(), I("span", ml)) : _("", !0)
|
|
5197
|
+
], 4)) : t.style.btntype == "sq" ? (L(), me(ul, {
|
|
5198
5198
|
key: 1,
|
|
5199
5199
|
modelValue: l.value,
|
|
5200
5200
|
"onUpdate:modelValue": r[0] || (r[0] = (m) => l.value = m),
|
|
5201
5201
|
style: j(t.style),
|
|
5202
5202
|
disabled: t.disabled
|
|
5203
|
-
}, null, 8, ["modelValue", "style", "disabled"])) : (
|
|
5203
|
+
}, null, 8, ["modelValue", "style", "disabled"])) : (L(), me(il, {
|
|
5204
5204
|
key: 2,
|
|
5205
5205
|
modelValue: l.value,
|
|
5206
5206
|
"onUpdate:modelValue": r[1] || (r[1] = (m) => l.value = m),
|
|
@@ -5218,17 +5218,17 @@ const ul = /* @__PURE__ */ ae(rl, [["render", sl], ["__scopeId", "data-v-41ace2e
|
|
|
5218
5218
|
},
|
|
5219
5219
|
setup(t) {
|
|
5220
5220
|
const e = t, l = Ae(() => {
|
|
5221
|
-
let
|
|
5221
|
+
let s = e.style.layout || {};
|
|
5222
5222
|
return {
|
|
5223
|
-
width:
|
|
5224
|
-
height:
|
|
5223
|
+
width: s.width + "px",
|
|
5224
|
+
height: s.height + "px",
|
|
5225
5225
|
borderWidth: (e.style.borderValue || 1) + "px",
|
|
5226
5226
|
padding: (e.style.borderValue || 1) + "px",
|
|
5227
5227
|
borderColor: e.style.stroke || "#000000",
|
|
5228
5228
|
backgroundColor: e.style.background || "#D1E7FF"
|
|
5229
5229
|
};
|
|
5230
5230
|
});
|
|
5231
|
-
return (
|
|
5231
|
+
return (s, r) => (L(), I("div", {
|
|
5232
5232
|
class: "gr-circle",
|
|
5233
5233
|
style: j(l.value)
|
|
5234
5234
|
}, [
|
|
@@ -5248,17 +5248,17 @@ const ul = /* @__PURE__ */ ae(rl, [["render", sl], ["__scopeId", "data-v-41ace2e
|
|
|
5248
5248
|
},
|
|
5249
5249
|
setup(t) {
|
|
5250
5250
|
const e = t, l = Ae(() => {
|
|
5251
|
-
let
|
|
5251
|
+
let s = e.style.layout || {};
|
|
5252
5252
|
return {
|
|
5253
|
-
width:
|
|
5254
|
-
height:
|
|
5253
|
+
width: s.width + "px",
|
|
5254
|
+
height: s.height + "px",
|
|
5255
5255
|
borderWidth: (e.style.borderValue || 1) + "px",
|
|
5256
5256
|
padding: (e.style.borderValue || 1) + "px",
|
|
5257
5257
|
borderColor: e.style.stroke || "#000000",
|
|
5258
5258
|
backgroundColor: e.style.background || "#D1E7FF"
|
|
5259
5259
|
};
|
|
5260
5260
|
});
|
|
5261
|
-
return (
|
|
5261
|
+
return (s, r) => (L(), I("div", {
|
|
5262
5262
|
class: "gr-rectangle",
|
|
5263
5263
|
style: j(l.value)
|
|
5264
5264
|
}, [
|
|
@@ -5278,10 +5278,10 @@ const ul = /* @__PURE__ */ ae(rl, [["render", sl], ["__scopeId", "data-v-41ace2e
|
|
|
5278
5278
|
},
|
|
5279
5279
|
setup(t) {
|
|
5280
5280
|
const e = t, l = Ae(() => {
|
|
5281
|
-
let
|
|
5281
|
+
let s = e.style.layout || {}, { x: r, y: m, width: p, height: b } = s, x = e.style.borderValue / 2, v = `${r + p / 2},${m + x}`, h = `${r + x},${m + b - x}`, k = `${r + p - x},${m + b - x}`;
|
|
5282
5282
|
return `
|
|
5283
|
-
<svg width="${p}" height="${
|
|
5284
|
-
<polygon points="${
|
|
5283
|
+
<svg width="${p}" height="${b}" xmlns="http://www.w3.org/2000/svg" viewBox="${r} ${m} ${p} ${b}">
|
|
5284
|
+
<polygon points="${v} ${h} ${k}" fill="${e.style.fillColor || "#D1E7FF"}" stroke="${e.style.stroke || "#000000"}" stroke-width="${e.style.borderValue || 1}"/>
|
|
5285
5285
|
<foreignObject x="${r}" y="${m}" width="100%" height="100%">
|
|
5286
5286
|
<div xmlns="http://www.w3.org/1999/xhtml" style="word-wrap: break-word; display: flex; justify-content: center; align-items: center;width: 100%; height: 100%; padding:${p / 4}px;
|
|
5287
5287
|
overflow-wrap: break-word;
|
|
@@ -5294,13 +5294,13 @@ const ul = /* @__PURE__ */ ae(rl, [["render", sl], ["__scopeId", "data-v-41ace2e
|
|
|
5294
5294
|
</svg>
|
|
5295
5295
|
`;
|
|
5296
5296
|
});
|
|
5297
|
-
return (
|
|
5297
|
+
return (s, r) => (L(), I("div", {
|
|
5298
5298
|
class: "gr-triangle",
|
|
5299
5299
|
innerHTML: l.value
|
|
5300
5300
|
}, null, 8, vl));
|
|
5301
5301
|
}
|
|
5302
5302
|
}, Cl = /* @__PURE__ */ ae(bl, [["__scopeId", "data-v-25fd969b"]]), wl = (t, e, l) => {
|
|
5303
|
-
const
|
|
5303
|
+
const s = document.createDocumentFragment();
|
|
5304
5304
|
let m = kl({}, e.data);
|
|
5305
5305
|
e.style.background === "transparent" && delete e.style.background, e.style.color === "transparent" && delete e.style.color, e.style = { ...e.style, ...m };
|
|
5306
5306
|
let p = "";
|
|
@@ -5328,31 +5328,31 @@ const ul = /* @__PURE__ */ ae(rl, [["render", sl], ["__scopeId", "data-v-41ace2e
|
|
|
5328
5328
|
return h;
|
|
5329
5329
|
}
|
|
5330
5330
|
});
|
|
5331
|
-
return x.use(ct), x.use(mt), x.mount(
|
|
5331
|
+
return x.use(ct), x.use(mt), x.mount(s).$el.outerHTML;
|
|
5332
5332
|
};
|
|
5333
5333
|
function kl(t, e) {
|
|
5334
5334
|
if (!e.children)
|
|
5335
5335
|
return "";
|
|
5336
|
-
let
|
|
5337
|
-
return
|
|
5336
|
+
let s = e.children.filter((r) => r.animate && (r.animate.isShow || r.animate.isShow == 1));
|
|
5337
|
+
return s && s.length > 0 && s.forEach((r) => {
|
|
5338
5338
|
if (r.key === "background" || r.key === "color" || r.key === "image") {
|
|
5339
|
-
let m = r.animate.data, p = r.animate.mpType,
|
|
5339
|
+
let m = r.animate.data, p = r.animate.mpType, b = null;
|
|
5340
5340
|
if (p === "NumericToSimple") {
|
|
5341
|
-
let x = m.find((
|
|
5342
|
-
x ?
|
|
5341
|
+
let x = m.find((v) => xl(r, v.min, v.max));
|
|
5342
|
+
x ? b = x : r.key === "image" ? b = {
|
|
5343
5343
|
value: r.animate.default,
|
|
5344
5344
|
valueUrl: r.animate.defaultVal
|
|
5345
|
-
} :
|
|
5345
|
+
} : b = {
|
|
5346
5346
|
value: r.animate.default
|
|
5347
5347
|
};
|
|
5348
|
-
} else p === "BooleanToSimple" && (
|
|
5349
|
-
|
|
5348
|
+
} else p === "BooleanToSimple" && (b = m.find((x) => x.key === r.value));
|
|
5349
|
+
b && (t[r.key] = b.value, r.key === "image" && (t.imgUrl = `${b.valueUrl}`));
|
|
5350
5350
|
} else
|
|
5351
5351
|
t[r.key] = r.value;
|
|
5352
5352
|
}), t;
|
|
5353
5353
|
}
|
|
5354
5354
|
function xl(t, e, l) {
|
|
5355
|
-
let
|
|
5355
|
+
let s = t.value, r = Sl(s);
|
|
5356
5356
|
return r >= e && r <= l;
|
|
5357
5357
|
}
|
|
5358
5358
|
function Sl(t) {
|
|
@@ -5365,17 +5365,17 @@ function El(t) {
|
|
|
5365
5365
|
function l() {
|
|
5366
5366
|
mxActor.call(this);
|
|
5367
5367
|
}
|
|
5368
|
-
mxUtils.extend(l, mxActor), l.prototype.arrowWidth = 0.3, l.prototype.arrowSize = 0.2, l.prototype.redrawPath = function(r, m, p,
|
|
5369
|
-
var
|
|
5368
|
+
mxUtils.extend(l, mxActor), l.prototype.arrowWidth = 0.3, l.prototype.arrowSize = 0.2, l.prototype.redrawPath = function(r, m, p, b, x) {
|
|
5369
|
+
var v = x * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, "arrowWidth", this.arrowWidth)))), h = b * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, "arrowSize", this.arrowSize)))), k = (x - v) / 2, N = k + v, A = mxUtils.getValue(this.style, mxConstants.STYLE_ARCSIZE, mxConstants.LINE_ARCSIZE) / 2;
|
|
5370
5370
|
this.addPoints(
|
|
5371
5371
|
r,
|
|
5372
5372
|
[
|
|
5373
5373
|
new mxPoint(0, k),
|
|
5374
|
-
new mxPoint(
|
|
5375
|
-
new mxPoint(
|
|
5376
|
-
new mxPoint(
|
|
5377
|
-
new mxPoint(
|
|
5378
|
-
new mxPoint(
|
|
5374
|
+
new mxPoint(b - h, k),
|
|
5375
|
+
new mxPoint(b - h, 0),
|
|
5376
|
+
new mxPoint(b, x / 2),
|
|
5377
|
+
new mxPoint(b - h, x),
|
|
5378
|
+
new mxPoint(b - h, N),
|
|
5379
5379
|
new mxPoint(0, N)
|
|
5380
5380
|
],
|
|
5381
5381
|
this.isRounded,
|
|
@@ -5383,22 +5383,22 @@ function El(t) {
|
|
|
5383
5383
|
!0
|
|
5384
5384
|
), r.end();
|
|
5385
5385
|
}, mxCellRenderer.registerShape("singleArrow", l);
|
|
5386
|
-
function
|
|
5386
|
+
function s() {
|
|
5387
5387
|
mxActor.call(this);
|
|
5388
5388
|
}
|
|
5389
|
-
mxUtils.extend(
|
|
5390
|
-
var
|
|
5389
|
+
mxUtils.extend(s, mxActor), s.prototype.redrawPath = function(r, m, p, b, x) {
|
|
5390
|
+
var v = x * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, "arrowWidth", l.prototype.arrowWidth)))), h = b * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, "arrowSize", l.prototype.arrowSize)))), k = (x - v) / 2, N = k + v, A = mxUtils.getValue(this.style, mxConstants.STYLE_ARCSIZE, mxConstants.LINE_ARCSIZE) / 2;
|
|
5391
5391
|
this.addPoints(
|
|
5392
5392
|
r,
|
|
5393
5393
|
[
|
|
5394
5394
|
new mxPoint(0, x / 2),
|
|
5395
5395
|
new mxPoint(h, 0),
|
|
5396
5396
|
new mxPoint(h, k),
|
|
5397
|
-
new mxPoint(
|
|
5398
|
-
new mxPoint(
|
|
5399
|
-
new mxPoint(
|
|
5400
|
-
new mxPoint(
|
|
5401
|
-
new mxPoint(
|
|
5397
|
+
new mxPoint(b - h, k),
|
|
5398
|
+
new mxPoint(b - h, 0),
|
|
5399
|
+
new mxPoint(b, x / 2),
|
|
5400
|
+
new mxPoint(b - h, x),
|
|
5401
|
+
new mxPoint(b - h, N),
|
|
5402
5402
|
new mxPoint(h, N),
|
|
5403
5403
|
new mxPoint(h, x)
|
|
5404
5404
|
],
|
|
@@ -5406,7 +5406,7 @@ function El(t) {
|
|
|
5406
5406
|
A,
|
|
5407
5407
|
!0
|
|
5408
5408
|
), r.end();
|
|
5409
|
-
}, mxCellRenderer.registerShape("doubleArrow",
|
|
5409
|
+
}, mxCellRenderer.registerShape("doubleArrow", s);
|
|
5410
5410
|
};
|
|
5411
5411
|
}
|
|
5412
5412
|
function je(t) {
|
|
@@ -5435,37 +5435,37 @@ function je(t) {
|
|
|
5435
5435
|
if (e.preview) {
|
|
5436
5436
|
if (u && u.length > 0)
|
|
5437
5437
|
for (let d = 0; d < u.length; d++) {
|
|
5438
|
-
let
|
|
5439
|
-
|
|
5438
|
+
let o = u[d];
|
|
5439
|
+
o && (o.classList.remove("is-hidden"), o.classList.add("is-block"));
|
|
5440
5440
|
}
|
|
5441
5441
|
} else if (u && u.length > 0)
|
|
5442
5442
|
for (let d = 0; d < u.length; d++) {
|
|
5443
|
-
let
|
|
5444
|
-
|
|
5443
|
+
let o = u[d];
|
|
5444
|
+
o && (o.classList.remove("is-block"), o.classList.add("is-hidden"));
|
|
5445
5445
|
}
|
|
5446
5446
|
if (e.preview && n.clearSelection(), e.preview) {
|
|
5447
5447
|
const d = n.container.querySelectorAll(".bg-light");
|
|
5448
5448
|
if (d)
|
|
5449
|
-
for (let
|
|
5450
|
-
d[
|
|
5449
|
+
for (let o = 0; o < d.length; o++)
|
|
5450
|
+
d[o].classList.replace("bg-light", "main-text");
|
|
5451
5451
|
} else {
|
|
5452
5452
|
const d = n.container.querySelectorAll(".main-text");
|
|
5453
5453
|
if (d)
|
|
5454
|
-
for (let
|
|
5455
|
-
d[
|
|
5454
|
+
for (let o = 0; o < d.length; o++)
|
|
5455
|
+
d[o].classList.replace("main-text", "bg-light");
|
|
5456
5456
|
}
|
|
5457
5457
|
if (e.preview) {
|
|
5458
5458
|
const d = n.container.querySelectorAll(".bg-creat-comp");
|
|
5459
5459
|
if (d)
|
|
5460
|
-
for (let
|
|
5461
|
-
const i = d[
|
|
5460
|
+
for (let o = 0; o < d.length; o++) {
|
|
5461
|
+
const i = d[o];
|
|
5462
5462
|
i && i.classList.add("svg-preview-gr");
|
|
5463
5463
|
}
|
|
5464
5464
|
} else {
|
|
5465
5465
|
const d = n.container.querySelectorAll(".svg-preview-gr");
|
|
5466
5466
|
if (d)
|
|
5467
|
-
for (let
|
|
5468
|
-
const i = d[
|
|
5467
|
+
for (let o = 0; o < d.length; o++) {
|
|
5468
|
+
const i = d[o];
|
|
5469
5469
|
i && i.classList.remove("svg-preview-gr");
|
|
5470
5470
|
}
|
|
5471
5471
|
}
|
|
@@ -5473,8 +5473,8 @@ function je(t) {
|
|
|
5473
5473
|
}, e.init = (a) => {
|
|
5474
5474
|
let { container: n } = a;
|
|
5475
5475
|
return new Promise((u, d) => {
|
|
5476
|
-
let
|
|
5477
|
-
n.setAttribute("tabindex", "0"), n.style.outline = "none", n.style.width = "100%", n.style.height = "100%",
|
|
5476
|
+
let o = new mxEditor(), i = o.graph;
|
|
5477
|
+
n.setAttribute("tabindex", "0"), n.style.outline = "none", n.style.width = "100%", n.style.height = "100%", o.setGraphContainer(n), e.container = n, e.editor = o, St(o), mxEvent.disableContextMenu(n);
|
|
5478
5478
|
const c = i.getStylesheet().getDefaultVertexStyle();
|
|
5479
5479
|
Object.assign(c, {
|
|
5480
5480
|
// // 去掉填充色(设置为透明)
|
|
@@ -5502,15 +5502,15 @@ function je(t) {
|
|
|
5502
5502
|
qe(i, f), e.undoMng = f, A(i), Ye(i), Ne(i), Qe(i, n), Je(t.menus, i), Xe(i), e.graph = i, p(i), i.autoSize = !1, i.model.validateGraph = !1, i.model.validateEdge = () => !0, i.model.validateNode = () => !0, i.removeListener(i.listeners), i.view.animate = !1, e.clearUndo(), new El().initShapes(), h(), mxConstants.INVALID_COLOR = "transparent", mxConstants.DEFAULT_INVALID_COLOR = "transparent", mxConstants.INVALID_CONNECT_TARGET_COLOR = "transparent", e.keyUpdownEvt = new Me(t), mxWindow.prototype.closeImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAw0lEQVR4AZyS3RHCIBCEEyuxFO1E36EGsQZ419LsBHd3IHP8jTNmWH4u+x0HyWn78xEYY3xQv3LQk1J60SeQEyjwBcZpK0DIOX9oEOi9f2IRqBlMCMBt3/d38W4CAWwlMMAWcs7d6aUOkIseXkH0NiADFq7l2Z3ooQaQQZzlzJECrMvg3GoAbXkwDmdGTK0BLcTybNn9bR9gDyktuhUskNlwFn0n7gR/02awQLguUJhBiKtVuF6cQASvEP8emVYdPTX5FwAA//+rmaLTAAAABklEQVQDAD/igh3e/xFHAAAAAElFTkSuQmCC ", mxWindow.prototype.normalizeImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAwElEQVR4AcRSwRHCIBAUKkknQidaALSgtgD8tRNIJ1YC7mYSRhgn5Gfmdg7udnNwhzytn/deASWE8FxD1THGHKC2YBVugaNe8i8EBGdg10opE7kEK0awiTv8rgkheA1yI4UJ7Iqc84x9Y6j0RqByuJbGGP0Na+0LicaQfwANjxUb0tHNH4Robexw64/rnLt0nKWrfA0VaPnUC6WUnHHlIK94R42FRsuv8CPjrBc+x5HQ6oRKnNVIOJNLsOKI/DP/AQAA///YhGxbAAAABklEQVQDANQlZDV28KsrAAAAAElFTkSuQmCC", mxWindow.prototype.minimizeImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAwElEQVR4AcRSwRHCIBAUKkknQidaALSgtgD8tRNIJ1YC7mYSRhgn5Gfmdg7udnNwhzytn/deASWE8FxD1THGHKC2YBVugaNe8i8EBGdg10opE7kEK0awiTv8rgkheA1yI4UJ7Iqc84x9Y6j0RqByuJbGGP0Na+0LicaQfwANjxUb0tHNH4Robexw64/rnLt0nKWrfA0VaPnUC6WUnHHlIK94R42FRsuv8CPjrBc+x5HQ6oRKnNVIOJNLsOKI/DP/AQAA///YhGxbAAAABklEQVQDANQlZDV28KsrAAAAAElFTkSuQmCC", mxWindow.prototype.maximizeImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAArklEQVR4AcSSUQrDIBBEG/Eg7U1yIT88QZoT+OGFepP2IEI6b4mwlkD6UWjwmc3MjgomXPSUUq4eScPwHjVmoIgxPj0YHu9Rk7Ed96aH3vcdvYbRdXrMGIIppRXMcRMaSDoMSv9+hJzzS6tNYj2L0SMmMv6oZ7nB/0OQO6m1bmIZznLwQY/YyPzkqLNWW+BzMzSQPgsbfkfE/oeY6aau02OyBVtrN485bvIeNff4BgAA//8HoCv8AAAABklEQVQDAFXqZFJqMF/zAAAAAElFTkSuQmCC", mxWindow.prototype.resizeImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAtklEQVR4AZSS0Q2EIBBEF0MhVwqdnP5DEVZAAvyfnXidaCfcrBcTQFQkIWQ387I7Ezp6eEIIH+fc8gj03s8xxl4IMTWDDBGRYsgYMzaBKaS1HgjnFiwha+0LHvtLsIRQKynlgnXfpyBEMzbaPPF6qBVqDmfFW/cI0SmEaQPC+R4mtkCYSBnYAh0+QAvEmuwDcAPjq0HsnlINPI5d2ijTq0GswZC/RwimvcFNrLOit6XHNV/UmeYHAAD//4CpKLcAAAAGSURBVAMAuzSnSig8bRkAAAAASUVORK5CYII=";
|
|
5503
5503
|
const S = i.getView().setTranslate;
|
|
5504
5504
|
i.getView().setTranslate = function(w, E) {
|
|
5505
|
-
const
|
|
5506
|
-
S.call(this,
|
|
5505
|
+
const U = Math.max(0, Math.min(3e3, w)), O = Math.max(0, Math.min(3e3, E));
|
|
5506
|
+
S.call(this, U, O);
|
|
5507
5507
|
}, i.addListener(mxEvent.PAN, function() {
|
|
5508
5508
|
const w = i.getView().getTranslate();
|
|
5509
|
-
let E = Math.min(0, w.x),
|
|
5510
|
-
(E !== w.x ||
|
|
5511
|
-
}), mxGraph.prototype.setCellStyles = function(w, E,
|
|
5512
|
-
|
|
5513
|
-
}, mxUtils.setCellStyles = function(w, E,
|
|
5509
|
+
let E = Math.min(0, w.x), U = Math.min(0, w.y);
|
|
5510
|
+
(E !== w.x || U !== w.y) && i.getView().setTranslate(E, U);
|
|
5511
|
+
}), mxGraph.prototype.setCellStyles = function(w, E, U, O) {
|
|
5512
|
+
U = U || this.getSelectionCells(), mxUtils.setCellStyles(this.model, U, w, E, O);
|
|
5513
|
+
}, mxUtils.setCellStyles = function(w, E, U, O, M) {
|
|
5514
5514
|
if (E != null && E.length > 0)
|
|
5515
5515
|
if (e.firstStyle) {
|
|
5516
5516
|
w.beginUpdate();
|
|
@@ -5533,10 +5533,10 @@ function je(t) {
|
|
|
5533
5533
|
}
|
|
5534
5534
|
e.firstStyle = !1;
|
|
5535
5535
|
}
|
|
5536
|
-
}, i.view.scaleGrid = !0, i.view.roundPoints = !0, mxSvgCanvas2D.prototype.updateTextNodes = function(w, E,
|
|
5537
|
-
var
|
|
5536
|
+
}, i.view.scaleGrid = !0, i.view.roundPoints = !0, mxSvgCanvas2D.prototype.updateTextNodes = function(w, E, U, O, M, B, F, V, H, W, q) {
|
|
5537
|
+
var G = this.state.scale;
|
|
5538
5538
|
mxSvgCanvas2D.createCss(
|
|
5539
|
-
|
|
5539
|
+
U + 2,
|
|
5540
5540
|
O,
|
|
5541
5541
|
M,
|
|
5542
5542
|
B,
|
|
@@ -5547,18 +5547,18 @@ function je(t) {
|
|
|
5547
5547
|
this.state.fontBorderColor != null ? this.state.fontBorderColor : null,
|
|
5548
5548
|
"display: flex; align-items: unsafe " + (B == mxConstants.ALIGN_TOP ? "flex-start" : B == mxConstants.ALIGN_BOTTOM ? "flex-end" : "center") + "; justify-content: unsafe " + (M == mxConstants.ALIGN_LEFT ? "flex-start" : M == mxConstants.ALIGN_RIGHT ? "flex-end" : "center") + "; ",
|
|
5549
5549
|
this.getTextCss(),
|
|
5550
|
-
|
|
5550
|
+
G,
|
|
5551
5551
|
mxUtils.bind(this, function(ne, re, Y, se, X) {
|
|
5552
5552
|
w += this.state.dx, E += this.state.dy;
|
|
5553
|
-
var
|
|
5554
|
-
et.setAttribute("style", X), Le.setAttribute("style", se),
|
|
5555
|
-
let
|
|
5556
|
-
if (
|
|
5557
|
-
|
|
5553
|
+
var pe = q.firstChild, Ue = pe.firstChild, Le = Ue.firstChild, et = Le.firstChild, Pe = (this.rotateHtml ? this.state.rotation : 0) + (W ?? 0), Ce = (this.foOffset != 0 ? "translate(" + this.foOffset + " " + this.foOffset + ")" : "") + (G != 1 ? "scale(" + G + ")" : "");
|
|
5554
|
+
et.setAttribute("style", X), Le.setAttribute("style", se), pe.setAttribute("width", Math.ceil(1 / Math.min(1, G) * 100) + "%"), pe.setAttribute("height", Math.ceil(1 / Math.min(1, G) * 100) + "%");
|
|
5555
|
+
let he = Math.round(E + re), tt = Math.round(w + ne), lt = s(he), at = s(tt);
|
|
5556
|
+
if (he < 0)
|
|
5557
|
+
pe.setAttribute("y", he);
|
|
5558
5558
|
else {
|
|
5559
|
-
|
|
5560
|
-
let Te =
|
|
5561
|
-
at || lt || (Te =
|
|
5559
|
+
pe.removeAttribute("y");
|
|
5560
|
+
let Te = he;
|
|
5561
|
+
at || lt || (Te = he - 0.5), Y += "padding-top: " + Te + "px; ";
|
|
5562
5562
|
}
|
|
5563
5563
|
Y = Y.replace("width: 1px", "width: 0px"), Y = Y.replace("height: 1px", "height: 0px");
|
|
5564
5564
|
let nt = w + ne;
|
|
@@ -5568,14 +5568,14 @@ function je(t) {
|
|
|
5568
5568
|
}, i.fit(), r(), u(i);
|
|
5569
5569
|
});
|
|
5570
5570
|
};
|
|
5571
|
-
function
|
|
5571
|
+
function s(a) {
|
|
5572
5572
|
let n = !0;
|
|
5573
5573
|
return a % 2 === 0 ? n = !0 : n = !1, n;
|
|
5574
5574
|
}
|
|
5575
5575
|
function r(a) {
|
|
5576
5576
|
mxVertexHandler.prototype.getHandleForEvent = function(n) {
|
|
5577
5577
|
let u = n.getEvent(), d = ["nw-resize", "n-resize", "ne-resize", "w-resize", "e-resize", "sw-resize", "s-resize", "se-resize"];
|
|
5578
|
-
var
|
|
5578
|
+
var o = u.target || u.srcElement, i = window.getComputedStyle(o).cursor;
|
|
5579
5579
|
if (d.indexOf(i) != -1) {
|
|
5580
5580
|
var y = mxEvent.isMouseEvent(n.getEvent()) ? 1 : this.tolerance, c = this.allowHandleBoundsCheck && (mxClient.IS_IE || y > 0) ? new mxRectangle(n.getGraphX() - y, n.getGraphY() - y, 2 * y, 2 * y) : null, f = mxUtils.bind(this, function(S) {
|
|
5581
5581
|
var w = S != null && S.constructor != mxImageShape && this.allowHandleBoundsCheck ? S.strokewidth + S.svgStrokeTolerance : null, E = w != null ? new mxRectangle(
|
|
@@ -5591,14 +5591,14 @@ function je(t) {
|
|
|
5591
5591
|
if (f(this.labelShape))
|
|
5592
5592
|
return mxEvent.LABEL_HANDLE;
|
|
5593
5593
|
if (this.sizers != null) {
|
|
5594
|
-
for (var
|
|
5595
|
-
if (f(this.sizers[
|
|
5596
|
-
return
|
|
5594
|
+
for (var C = 0; C < this.sizers.length; C++)
|
|
5595
|
+
if (f(this.sizers[C]))
|
|
5596
|
+
return C;
|
|
5597
5597
|
}
|
|
5598
5598
|
if (this.customHandles != null && this.isCustomHandleEvent(n)) {
|
|
5599
|
-
for (var
|
|
5600
|
-
if (f(this.customHandles[
|
|
5601
|
-
return mxEvent.CUSTOM_HANDLE -
|
|
5599
|
+
for (var C = this.customHandles.length - 1; C >= 0; C--)
|
|
5600
|
+
if (f(this.customHandles[C].shape))
|
|
5601
|
+
return mxEvent.CUSTOM_HANDLE - C;
|
|
5602
5602
|
}
|
|
5603
5603
|
}
|
|
5604
5604
|
return null;
|
|
@@ -5606,8 +5606,8 @@ function je(t) {
|
|
|
5606
5606
|
}
|
|
5607
5607
|
e.keyUpdownEvent = (a) => {
|
|
5608
5608
|
let n = e.graph, u = e.undoMng;
|
|
5609
|
-
e.keyUpdownEvt.keyUpdown(n, u, function(
|
|
5610
|
-
(
|
|
5609
|
+
e.keyUpdownEvt.keyUpdown(n, u, function(o) {
|
|
5610
|
+
(o === "undo" || o === "redo") && e.changePageSize();
|
|
5611
5611
|
});
|
|
5612
5612
|
}, e.removeKeyUpDown = () => {
|
|
5613
5613
|
let a = e.graph;
|
|
@@ -5617,8 +5617,8 @@ function je(t) {
|
|
|
5617
5617
|
return new Promise((n, u) => {
|
|
5618
5618
|
let d = new Image();
|
|
5619
5619
|
d.src = `${a}`, d.onload = async function() {
|
|
5620
|
-
let
|
|
5621
|
-
n({ w:
|
|
5620
|
+
let o = d.width, i = d.height;
|
|
5621
|
+
n({ w: o, h: i });
|
|
5622
5622
|
};
|
|
5623
5623
|
});
|
|
5624
5624
|
}
|
|
@@ -5626,11 +5626,11 @@ function je(t) {
|
|
|
5626
5626
|
let n = {};
|
|
5627
5627
|
if (a.border) {
|
|
5628
5628
|
let d = a.border.split(",");
|
|
5629
|
-
d.length == 1 ? d.forEach((
|
|
5630
|
-
let y =
|
|
5629
|
+
d.length == 1 ? d.forEach((o, i) => {
|
|
5630
|
+
let y = o.split(" "), c = "";
|
|
5631
5631
|
n["border" + c + "Width"] = y[0], n["border" + c + "Style"] = y[1], n["border" + c + "Color"] = y[2];
|
|
5632
|
-
}) : d.forEach((
|
|
5633
|
-
let y =
|
|
5632
|
+
}) : d.forEach((o, i) => {
|
|
5633
|
+
let y = o.split(" "), c = "Top";
|
|
5634
5634
|
i == 0 ? c = "Top" : i == 1 ? c = "Right" : i == 2 ? c = "Bottom" : i == 3 && (c = "Left"), n["border" + c + "Width"] = y[0], n["border" + c + "Style"] = y[1], n["border" + c + "Color"] = y[2];
|
|
5635
5635
|
});
|
|
5636
5636
|
}
|
|
@@ -5638,72 +5638,72 @@ function je(t) {
|
|
|
5638
5638
|
};
|
|
5639
5639
|
function p(a) {
|
|
5640
5640
|
a.convertValueToString = function(n) {
|
|
5641
|
-
let { width: u, height: d, x:
|
|
5641
|
+
let { width: u, height: d, x: o, y: i } = n.geometry;
|
|
5642
5642
|
if (n.type == "vertex")
|
|
5643
|
-
return
|
|
5643
|
+
return b(n);
|
|
5644
5644
|
if (n.type == "kitUI:CanvasWidget") {
|
|
5645
5645
|
let c = n.value.style, f = document.createElement("div");
|
|
5646
5646
|
f.style.width = u + "px", f.style.height = d + "px", f.className = "bgss-light";
|
|
5647
|
-
let
|
|
5648
|
-
return
|
|
5647
|
+
let C = a.container.querySelector("canvas");
|
|
5648
|
+
return C && (c["background-image"] ? C.style.background = `${c["background-image"]}center center no-repeat` : C.style.background = "transparent"), f;
|
|
5649
5649
|
} else if (n.type == "img") {
|
|
5650
|
-
let c = document.createElement("div"), f = n.value.style,
|
|
5650
|
+
let c = document.createElement("div"), f = n.value.style, C = "";
|
|
5651
5651
|
if (f.scale == "fitRatio" ? (c.style.display = "flex", c.style.alignItems = "center", c.style.justifyContent = "center", c.style.flexDirection = "column", m(f.imgUrl || n.imgUrl).then((S) => {
|
|
5652
5652
|
S && (c.style.aspectRatio = S.w / S.h);
|
|
5653
|
-
}),
|
|
5653
|
+
}), C = "img-vr-fit-ratio") : f.scale == "fit" && (c.style.display = "flex", c.style.alignItems = "center", c.style.justifyContent = "center", C = "img-vr-fit"), c.innerHTML = N({
|
|
5654
5654
|
img: f.imgUrl || n.imgUrl
|
|
5655
5655
|
}), c.style.width = u + "px", c.style.height = d + "px", c.innerHTML += '<div class="svg-edit-gr"></div>', e.preview) {
|
|
5656
|
-
n.hyperlink = "", n.popup = "", c.className = "bg-light svg-preview-gr " +
|
|
5657
|
-
let { url: S, pup: w } =
|
|
5656
|
+
n.hyperlink = "", n.popup = "", c.className = "bg-light svg-preview-gr " + C;
|
|
5657
|
+
let { url: S, pup: w } = fe(n);
|
|
5658
5658
|
S ? (c.style.cursor = "pointer", n.hyperlink = S) : c.style.cursor = "default", w && w.length > 0 ? (c.style.cursor = "pointer", n.popup = w) : c.style.cursor = "default";
|
|
5659
5659
|
} else
|
|
5660
|
-
c.className = "bg-light " +
|
|
5660
|
+
c.className = "bg-light " + C;
|
|
5661
5661
|
return c;
|
|
5662
5662
|
} else if (n.crtype == "creatComp") {
|
|
5663
5663
|
k(n);
|
|
5664
5664
|
let c = document.createElement("div");
|
|
5665
5665
|
if (c.innerHTML = wl(n.cmp, n.value, n.iconName), c.style.width = u + "px", c.style.height = d + "px", c.innerHTML += '<div class="svg-edit-gr"></div>', e.preview) {
|
|
5666
5666
|
n.hyperlink = "", n.popup = "", c.className = "bg-creat-comp svg-preview-gr";
|
|
5667
|
-
let { url: f, pup:
|
|
5668
|
-
f ? (c.style.cursor = "pointer", n.hyperlink = f) : c.style.cursor = "default",
|
|
5667
|
+
let { url: f, pup: C } = fe(n);
|
|
5668
|
+
f ? (c.style.cursor = "pointer", n.hyperlink = f) : c.style.cursor = "default", C && C.length > 0 ? (c.style.cursor = "pointer", n.popup = C) : c.style.cursor = "default";
|
|
5669
5669
|
} else
|
|
5670
5670
|
c.className = "bg-creat-comp";
|
|
5671
5671
|
return c;
|
|
5672
5672
|
} else if (n.crtype == "schedule") {
|
|
5673
5673
|
let c = n.value.style;
|
|
5674
5674
|
k(n);
|
|
5675
|
-
let f = document.createElement("div"), { el:
|
|
5676
|
-
f.innerHTML =
|
|
5675
|
+
let f = document.createElement("div"), { el: C } = n.other || {};
|
|
5676
|
+
f.innerHTML = C.outerHTML;
|
|
5677
5677
|
let S = document.getElementById(n.id);
|
|
5678
5678
|
if (S) {
|
|
5679
5679
|
var y = a.view.getState(n);
|
|
5680
5680
|
S.style.position = "absolute", S.style.width = y.width + "px", S.style.height = y.height + "px", S.style.left = y.x + "px", S.style.top = y.y + "px", e.preview || (f.innerHTML = S.innerHTML);
|
|
5681
5681
|
}
|
|
5682
|
-
return f.style =
|
|
5682
|
+
return f.style = T(c, []), f.style.width = u + "px", f.style.height = d + "px", f.innerHTML += '<div class="svg-edit-gr"></div>', e.preview ? f.className = "bg-creat-comp svg-preview-gr" : f.className = "bg-creat-comp", f;
|
|
5683
5683
|
} else if (n.type == "rect") {
|
|
5684
5684
|
let c = n.value.style, f = n.value.data, S = (f.children || []).find((M) => M.key === "perimeter");
|
|
5685
5685
|
S && (c.background.indexOf("/files") > -1 && (c.background = ""), Number(c.borderValue) === 0 && (c.stroke = "transparent"), n.style = S.value + `fillColor=${c.background || "transparent"};strokeColor=${c.stroke || "#333333"};strokeWidth=${c.borderValue || 0}`);
|
|
5686
5686
|
let w = {}, E = f.children;
|
|
5687
5687
|
E && (w = E.find((M) => M.key === "text"));
|
|
5688
|
-
let
|
|
5689
|
-
|
|
5688
|
+
let U = document.createElement("div");
|
|
5689
|
+
U.innerHTML = N({
|
|
5690
5690
|
text: w.value || c.text,
|
|
5691
|
-
style:
|
|
5692
|
-
}),
|
|
5691
|
+
style: g(c, ["text-", "font-", "color"])
|
|
5692
|
+
}), U.style = T(c, ["background", "stroke", "strokeWidth"]), U.style.width = u + "px", U.style.height = d + "px", U.className = "";
|
|
5693
5693
|
let O = "";
|
|
5694
5694
|
if (f.title === "ShapeTriangle" ? O = "triangle" : f.title === "ShapeRect" ? O = "rectangle" : f.title === "ShapeCircle" && (O = "circle"), e.preview) {
|
|
5695
5695
|
n.hyperlink = "", n.popup = "";
|
|
5696
|
-
let { url: M, pup: B } =
|
|
5697
|
-
M ? (
|
|
5696
|
+
let { url: M, pup: B } = fe(n);
|
|
5697
|
+
M ? (U.style.cursor = "pointer", U.className = "main-text hyperlink-btn custom-rect-p " + O, n.hyperlink = M) : (U.style.cursor = "default", U.className = "main-text custom-rect-p " + O), B && B.length > 0 ? (n.popup = B, U.style.cursor = "pointer") : U.style.cursor = "default";
|
|
5698
5698
|
} else
|
|
5699
|
-
|
|
5700
|
-
return
|
|
5699
|
+
U.className = "bg-light custom-rect " + O;
|
|
5700
|
+
return U.innerHTML += '<div class="svg-edit-gr"></div>', U;
|
|
5701
5701
|
} else if (n.type == "edge") {
|
|
5702
5702
|
if (e.firstFlag) {
|
|
5703
5703
|
a.getModel(), e.firstFlag = !1;
|
|
5704
5704
|
try {
|
|
5705
|
-
let c = n.value.style, f = c.dashWidth || 3,
|
|
5706
|
-
f &&
|
|
5705
|
+
let c = n.value.style, f = c.dashWidth || 3, C = c.dashSpace || 1;
|
|
5706
|
+
f && C && (c.dashPattern = `${f} ${C}`), setTimeout(() => {
|
|
5707
5707
|
c && a.setCellStyles(null, null, [n], c);
|
|
5708
5708
|
}, 1);
|
|
5709
5709
|
} finally {
|
|
@@ -5715,19 +5715,19 @@ function je(t) {
|
|
|
5715
5715
|
return n.value;
|
|
5716
5716
|
};
|
|
5717
5717
|
}
|
|
5718
|
-
function
|
|
5719
|
-
let { width: n, height: u, x: d, y:
|
|
5718
|
+
function b(a) {
|
|
5719
|
+
let { width: n, height: u, x: d, y: o } = a.geometry;
|
|
5720
5720
|
k(a);
|
|
5721
5721
|
let i = a.value.style, y = a.value.data.children, c = {};
|
|
5722
|
-
y && (c = y.find((
|
|
5722
|
+
y && (c = y.find((C) => C.key === "text"));
|
|
5723
5723
|
let f = document.createElement("div");
|
|
5724
5724
|
if (f.innerHTML = N({
|
|
5725
5725
|
img: i.imgUrl || "",
|
|
5726
5726
|
text: c.value || i.text
|
|
5727
|
-
}), f.style =
|
|
5727
|
+
}), f.style = D(i), f.style.width = n + "px", f.style.height = u + "px", f.style.linHeight = u + "px", f.className = "bg-light", e.preview) {
|
|
5728
5728
|
a.hyperlink = "", a.popup = "";
|
|
5729
|
-
let { url:
|
|
5730
|
-
|
|
5729
|
+
let { url: C, pup: S } = fe(a);
|
|
5730
|
+
C ? (f.style.cursor = "pointer", f.className = "main-text hyperlink-btn", a.hyperlink = C) : (f.style.cursor = "default", f.className = "main-text"), S && S.length > 0 ? (f.style.cursor = "pointer", a.popup = S) : f.style.cursor = "default";
|
|
5731
5731
|
} else
|
|
5732
5732
|
f.className = "bg-light";
|
|
5733
5733
|
return f.innerHTML += '<div class="svg-edit-gr"></div>', f;
|
|
@@ -5737,8 +5737,8 @@ function je(t) {
|
|
|
5737
5737
|
return Math.sqrt(u * u + d * d);
|
|
5738
5738
|
}
|
|
5739
5739
|
e.isDragging = !1, e.dragTerminal = null, e.startPos = null, e.dx = null, e.dy = null, e.ctrlKey = !1, e.moveEdgeCells = [];
|
|
5740
|
-
function
|
|
5741
|
-
return new Promise((
|
|
5740
|
+
function v(a, n, u, d) {
|
|
5741
|
+
return new Promise((o, i) => {
|
|
5742
5742
|
let y = a.getDefaultParent(), c = a.getModel();
|
|
5743
5743
|
c.beginUpdate();
|
|
5744
5744
|
try {
|
|
@@ -5751,8 +5751,8 @@ function je(t) {
|
|
|
5751
5751
|
null,
|
|
5752
5752
|
n.style
|
|
5753
5753
|
// 继承样式
|
|
5754
|
-
),
|
|
5755
|
-
let w =
|
|
5754
|
+
), C = a.getCellGeometry(n);
|
|
5755
|
+
let w = C.getTerminalPoint(!0), E = C.getTerminalPoint(!1);
|
|
5756
5756
|
var S = new mxGeometry();
|
|
5757
5757
|
S.setTerminalPoint(
|
|
5758
5758
|
new mxPoint(
|
|
@@ -5766,7 +5766,7 @@ function je(t) {
|
|
|
5766
5766
|
E.y + d
|
|
5767
5767
|
),
|
|
5768
5768
|
!1
|
|
5769
|
-
), f.setGeometry(S), f.value = n.value, f.type = n.type, f.model = "yes", f.type = "edge", f.iconName = n.iconName,
|
|
5769
|
+
), f.setGeometry(S), f.value = n.value, f.type = n.type, f.model = "yes", f.type = "edge", f.iconName = n.iconName, o(f);
|
|
5770
5770
|
} finally {
|
|
5771
5771
|
c.endUpdate();
|
|
5772
5772
|
}
|
|
@@ -5782,27 +5782,27 @@ function je(t) {
|
|
|
5782
5782
|
let i = a.getPointForEvent(d);
|
|
5783
5783
|
e.startPos = i, u.consume();
|
|
5784
5784
|
}
|
|
5785
|
-
let
|
|
5786
|
-
if (
|
|
5787
|
-
let i = a.getPointForEvent(d), y =
|
|
5788
|
-
|
|
5785
|
+
let o = a.getSelectionCell();
|
|
5786
|
+
if (o && o.isEdge()) {
|
|
5787
|
+
let i = a.getPointForEvent(d), y = o.getGeometry(), c = y.getTerminalPoint(!0), f = y.getTerminalPoint(!1), C = x(i, c), S = x(i, f);
|
|
5788
|
+
C < 15 && (e.isDragging = !0, e.dragTerminal = !0, e.startPos = i, u.consume()), S < 15 && (e.isDragging = !0, e.dragTerminal = !1, e.startPos = i, u.consume());
|
|
5789
5789
|
}
|
|
5790
5790
|
u.consume();
|
|
5791
5791
|
},
|
|
5792
5792
|
mouseMove: function(n, u) {
|
|
5793
5793
|
let d = u.evt;
|
|
5794
5794
|
if (e.ctrlKey = d.ctrlKey, e.ctrlKey) {
|
|
5795
|
-
let
|
|
5795
|
+
let o = a.getPointForEvent(d), i = o.x, y = o.y;
|
|
5796
5796
|
e.dx = i, e.dy = y, u.consume();
|
|
5797
5797
|
} else if (e.isDragging && e.dragTerminal !== null) {
|
|
5798
|
-
let
|
|
5798
|
+
let o = a.getPointForEvent(d), i = o.x, y = o.y;
|
|
5799
5799
|
e.dx = i, e.dy = y, u.consume();
|
|
5800
5800
|
}
|
|
5801
5801
|
u.consume();
|
|
5802
5802
|
},
|
|
5803
5803
|
mouseUp: function(n, u) {
|
|
5804
|
-
let d = u.evt,
|
|
5805
|
-
|
|
5804
|
+
let d = u.evt, o = a.getModel();
|
|
5805
|
+
o.beginUpdate();
|
|
5806
5806
|
try {
|
|
5807
5807
|
if (e.ctrlKey && d.ctrlKey && e.dx !== null && e.dy !== null) {
|
|
5808
5808
|
let i = e.moveEdgeCells;
|
|
@@ -5810,8 +5810,8 @@ function je(t) {
|
|
|
5810
5810
|
let y = [];
|
|
5811
5811
|
for (let c = 0; c < i.length; c++) {
|
|
5812
5812
|
let f = i[c];
|
|
5813
|
-
f && f.isEdge() &&
|
|
5814
|
-
y.push(
|
|
5813
|
+
f && f.isEdge() && v(a, f, e.dx - e.startPos.x, e.dy - e.startPos.y).then((C) => {
|
|
5814
|
+
y.push(C);
|
|
5815
5815
|
});
|
|
5816
5816
|
}
|
|
5817
5817
|
}
|
|
@@ -5830,31 +5830,31 @@ function je(t) {
|
|
|
5830
5830
|
}, 1), u.consume();
|
|
5831
5831
|
}
|
|
5832
5832
|
} finally {
|
|
5833
|
-
|
|
5833
|
+
o.endUpdate();
|
|
5834
5834
|
}
|
|
5835
5835
|
u.consume();
|
|
5836
5836
|
}
|
|
5837
5837
|
});
|
|
5838
5838
|
}
|
|
5839
5839
|
const k = (a) => {
|
|
5840
|
-
let { width: n, height: u, x: d, y:
|
|
5840
|
+
let { width: n, height: u, x: d, y: o } = a.geometry, i = a.value.style;
|
|
5841
5841
|
if (i && i.hasOwnProperty("layout")) {
|
|
5842
5842
|
let y = a.value.data, c = {
|
|
5843
5843
|
width: n,
|
|
5844
5844
|
height: u,
|
|
5845
5845
|
x: d,
|
|
5846
|
-
y:
|
|
5846
|
+
y: o
|
|
5847
5847
|
}, f = y.children;
|
|
5848
5848
|
if (f && f.length > 0) {
|
|
5849
|
-
let
|
|
5850
|
-
|
|
5849
|
+
let C = f.find((S) => S.key == "layout");
|
|
5850
|
+
C.value = c;
|
|
5851
5851
|
}
|
|
5852
5852
|
i.layout = c;
|
|
5853
5853
|
}
|
|
5854
5854
|
};
|
|
5855
5855
|
function N(a) {
|
|
5856
|
-
let { img: n, text: u, style: d } = a,
|
|
5857
|
-
return n && (
|
|
5856
|
+
let { img: n, text: u, style: d } = a, o = "";
|
|
5857
|
+
return n && (o += `<img src='${n}' style="z-index: 0;" alt=" " v-if='${n}'>`), u && (d ? o += `<span style="z-index: 0;${d}">${u}</span>` : o += `<span style="z-index: 0;">${u}</span>`), !n && !u ? "<span> </span>" : o;
|
|
5858
5858
|
}
|
|
5859
5859
|
function A(a) {
|
|
5860
5860
|
new Tt().createGrid(a, e.parent, e.preview), a.gridEnabled = !0, a.gridSize = 10;
|
|
@@ -5894,80 +5894,80 @@ function je(t) {
|
|
|
5894
5894
|
}, 1);
|
|
5895
5895
|
}
|
|
5896
5896
|
}
|
|
5897
|
-
function
|
|
5897
|
+
function g(a, n) {
|
|
5898
5898
|
if (!a)
|
|
5899
5899
|
return "";
|
|
5900
5900
|
let u = {};
|
|
5901
5901
|
for (const d in a)
|
|
5902
|
-
n.some((
|
|
5902
|
+
n.some((o) => d.startsWith(o)) && (u[d] = a[d]);
|
|
5903
5903
|
return u && Object.keys(u).length === 0 ? "" : Object.entries(u).filter(
|
|
5904
|
-
([d,
|
|
5905
|
-
).map(([d,
|
|
5904
|
+
([d, o]) => o != null && o !== "" && !(typeof o == "object" && Object.keys(o).length === 0)
|
|
5905
|
+
).map(([d, o]) => {
|
|
5906
5906
|
const i = d.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
5907
|
-
let y =
|
|
5908
|
-
return i === "gap" && (y = `${
|
|
5907
|
+
let y = o;
|
|
5908
|
+
return i === "gap" && (y = `${o}px`), `${i}:${y}`;
|
|
5909
5909
|
}).join("; ") + ";";
|
|
5910
5910
|
}
|
|
5911
|
-
function
|
|
5911
|
+
function T(a, n) {
|
|
5912
5912
|
if (!a)
|
|
5913
5913
|
return "";
|
|
5914
5914
|
let u = {};
|
|
5915
5915
|
for (const d in a)
|
|
5916
5916
|
n.indexOf(d) === -1 && (u[d] = a[d]);
|
|
5917
5917
|
return u && Object.keys(u).length === 0 ? "" : Object.entries(u).filter(
|
|
5918
|
-
([d,
|
|
5919
|
-
).map(([d,
|
|
5918
|
+
([d, o]) => o != null && o !== "" && !(typeof o == "object" && Object.keys(o).length === 0)
|
|
5919
|
+
).map(([d, o]) => {
|
|
5920
5920
|
const i = d.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
5921
|
-
let y =
|
|
5922
|
-
return i === "gap" && (y = `${
|
|
5921
|
+
let y = o;
|
|
5922
|
+
return i === "gap" && (y = `${o}px`), `${i}:${y}`;
|
|
5923
5923
|
}).join("; ") + ";";
|
|
5924
5924
|
}
|
|
5925
|
-
function
|
|
5925
|
+
function D(a) {
|
|
5926
5926
|
return a ? (a.border && a.border.split(",").length === 1 && ["top", "right", "bottom", "left"].forEach((d) => {
|
|
5927
5927
|
delete a["border-" + d + "-width"], delete a["border-" + d + "-style"], delete a["border-" + d + "-color"];
|
|
5928
5928
|
}), Object.entries(a).filter(
|
|
5929
5929
|
([n, u]) => u != null && u !== "" && !(typeof u == "object" && Object.keys(u).length === 0)
|
|
5930
5930
|
).map(([n, u]) => {
|
|
5931
5931
|
const d = n.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
5932
|
-
let
|
|
5933
|
-
return d === "gap" && (
|
|
5932
|
+
let o = u;
|
|
5933
|
+
return d === "gap" && (o = u.toString().indexOf("px") === -1 ? `${u}px` : u), `${d}: ${o}`;
|
|
5934
5934
|
}).join("; ") + ";") : "";
|
|
5935
5935
|
}
|
|
5936
5936
|
function R(a, n) {
|
|
5937
5937
|
return a ? Object.entries(a).filter(
|
|
5938
|
-
([d,
|
|
5939
|
-
).map(([d,
|
|
5938
|
+
([d, o]) => o != null && o !== "" && !(typeof o == "object" && Object.keys(o).length === 0)
|
|
5939
|
+
).map(([d, o]) => {
|
|
5940
5940
|
let i = d;
|
|
5941
5941
|
n || (i = d.replace(/([A-Z])/g, "-$1").toLowerCase());
|
|
5942
|
-
let y =
|
|
5943
|
-
return i === "gap" && (y = `${
|
|
5942
|
+
let y = o;
|
|
5943
|
+
return i === "gap" && (y = `${o}px`), `${i}=${y}`;
|
|
5944
5944
|
}).join("; ") + ";" : "";
|
|
5945
5945
|
}
|
|
5946
|
-
function
|
|
5946
|
+
function K(a) {
|
|
5947
5947
|
const u = String(a).match(/\d+/);
|
|
5948
5948
|
return u ? Number(u[0]) : null;
|
|
5949
5949
|
}
|
|
5950
5950
|
function $(a, n, u) {
|
|
5951
|
-
let d = a.value,
|
|
5952
|
-
return n === "-inf" ?
|
|
5951
|
+
let d = a.value, o = K(d);
|
|
5952
|
+
return n === "-inf" ? o <= u : u === "+inf" ? o >= n : o >= n && o <= u;
|
|
5953
5953
|
}
|
|
5954
|
-
function
|
|
5954
|
+
function P(a, n) {
|
|
5955
5955
|
if (!n.children)
|
|
5956
5956
|
return "";
|
|
5957
|
-
let d = n.children.filter((
|
|
5958
|
-
return d && d.length > 0 && d.forEach((
|
|
5959
|
-
if (
|
|
5960
|
-
let i =
|
|
5957
|
+
let d = n.children.filter((o) => o.animate && (o.animate.isShow || o.animate.isShow == 1));
|
|
5958
|
+
return d && d.length > 0 && d.forEach((o) => {
|
|
5959
|
+
if (o.key === "background" || o.key === "color" || o.key === "image") {
|
|
5960
|
+
let i = o.animate.data, y = o.animate.mpType, c = null;
|
|
5961
5961
|
if (y === "NumericToSimple") {
|
|
5962
|
-
let f = i.find((
|
|
5963
|
-
f ? c = f :
|
|
5964
|
-
value:
|
|
5965
|
-
valueUrl:
|
|
5962
|
+
let f = i.find((C) => $(o, C.min, C.max));
|
|
5963
|
+
f ? c = f : o.key === "image" ? c = {
|
|
5964
|
+
value: o.animate.default,
|
|
5965
|
+
valueUrl: o.animate.defaultVal
|
|
5966
5966
|
} : c = {
|
|
5967
|
-
value:
|
|
5967
|
+
value: o.animate.default
|
|
5968
5968
|
};
|
|
5969
|
-
} else y === "BooleanToSimple" && (c = i.find((f) => f.key ===
|
|
5970
|
-
c && (a[
|
|
5969
|
+
} else y === "BooleanToSimple" && (c = i.find((f) => f.key === o.realValue));
|
|
5970
|
+
c && (a[o.key] = c.value, o.key === "image" && (a.imgUrl = `${c.valueUrl}`));
|
|
5971
5971
|
}
|
|
5972
5972
|
}), a;
|
|
5973
5973
|
}
|
|
@@ -5981,12 +5981,12 @@ function je(t) {
|
|
|
5981
5981
|
if (d.setValue(i, i.value), i.value.style) {
|
|
5982
5982
|
let y = {};
|
|
5983
5983
|
if (i.type === "rect") {
|
|
5984
|
-
const c =
|
|
5984
|
+
const c = P(i.value.style, i.value.data);
|
|
5985
5985
|
y = te(i, c);
|
|
5986
5986
|
} else if (i.type === "edge") {
|
|
5987
|
-
const c =
|
|
5987
|
+
const c = P(i.value.style, i.value.data);
|
|
5988
5988
|
e.firstFlag = !0, y = Z(i, c);
|
|
5989
|
-
} else i.type === "kitUI:CanvasWidget" ? (y =
|
|
5989
|
+
} else i.type === "kitUI:CanvasWidget" ? (y = P(realStyle, i.value.data), e.changePageSize(realStyle)) : y = P(i.value.style, i.value.data);
|
|
5990
5990
|
d.setStyle(i, y);
|
|
5991
5991
|
}
|
|
5992
5992
|
});
|
|
@@ -5996,7 +5996,7 @@ function je(t) {
|
|
|
5996
5996
|
n.refresh();
|
|
5997
5997
|
return;
|
|
5998
5998
|
}
|
|
5999
|
-
const
|
|
5999
|
+
const o = u.undoableEditHappened;
|
|
6000
6000
|
try {
|
|
6001
6001
|
u.undoableEditHappened = function() {
|
|
6002
6002
|
}, d.beginUpdate();
|
|
@@ -6005,12 +6005,12 @@ function je(t) {
|
|
|
6005
6005
|
if (d.setValue(i, i.value), i.value.style) {
|
|
6006
6006
|
let y = {};
|
|
6007
6007
|
if (i.type === "rect") {
|
|
6008
|
-
const c =
|
|
6008
|
+
const c = P(i.value.style, i.value.data);
|
|
6009
6009
|
y = te(i, c);
|
|
6010
6010
|
} else if (i.type === "edge") {
|
|
6011
|
-
const c =
|
|
6011
|
+
const c = P(i.value.style, i.value.data);
|
|
6012
6012
|
e.firstFlag = !0, y = Z(i, c);
|
|
6013
|
-
} else i.type === "kitUI:CanvasWidget" ? (y =
|
|
6013
|
+
} else i.type === "kitUI:CanvasWidget" ? (y = P(realStyle, i.value.data), e.changePageSize(realStyle)) : y = P(i.value.style, i.value.data);
|
|
6014
6014
|
d.setStyle(i, y);
|
|
6015
6015
|
}
|
|
6016
6016
|
});
|
|
@@ -6018,14 +6018,14 @@ function je(t) {
|
|
|
6018
6018
|
d.endUpdate();
|
|
6019
6019
|
}
|
|
6020
6020
|
} finally {
|
|
6021
|
-
u.undoableEditHappened =
|
|
6021
|
+
u.undoableEditHappened = o;
|
|
6022
6022
|
}
|
|
6023
6023
|
}, e.updateCell = (a, n) => {
|
|
6024
6024
|
let u = e.graph;
|
|
6025
6025
|
const d = u.getModel();
|
|
6026
6026
|
d.beginUpdate();
|
|
6027
6027
|
try {
|
|
6028
|
-
let
|
|
6028
|
+
let o = a.value.style;
|
|
6029
6029
|
if (n && n.layout && Object.keys(n.layout).length > 0) {
|
|
6030
6030
|
const y = n.layout;
|
|
6031
6031
|
if (y) {
|
|
@@ -6035,35 +6035,35 @@ function je(t) {
|
|
|
6035
6035
|
}
|
|
6036
6036
|
d.setValue(a, a.value);
|
|
6037
6037
|
let i = "";
|
|
6038
|
-
a.type === "rect" ? i = te(a, n) : a.type === "edge" ? (e.firstFlag = !0, i = Z(a, n)) : a.type === "kitUI:CanvasWidget" ? (i =
|
|
6038
|
+
a.type === "rect" ? i = te(a, n) : a.type === "edge" ? (e.firstFlag = !0, i = Z(a, n)) : a.type === "kitUI:CanvasWidget" ? (i = P(o, a.value.data), e.changePageSize(o)) : i = P(o, a.value.data), Et(e.graph, a, i);
|
|
6039
6039
|
} finally {
|
|
6040
6040
|
d.endUpdate();
|
|
6041
6041
|
}
|
|
6042
6042
|
u.refresh();
|
|
6043
6043
|
};
|
|
6044
6044
|
function Z(a, n) {
|
|
6045
|
-
let u = e.graph, d = "",
|
|
6046
|
-
if (
|
|
6047
|
-
const y = { ...ie(
|
|
6048
|
-
d = R(y, !0), a.value.style = y, a.setStyle(d),
|
|
6045
|
+
let u = e.graph, d = "", o = a.style || "";
|
|
6046
|
+
if (o) {
|
|
6047
|
+
const y = { ...ie(o), ...n };
|
|
6048
|
+
d = R(y, !0), a.value.style = y, a.setStyle(d), P(a.value.style, a.value.data), u.refresh(a);
|
|
6049
6049
|
}
|
|
6050
6050
|
return d;
|
|
6051
6051
|
}
|
|
6052
6052
|
function te(a, n) {
|
|
6053
6053
|
let u = "", d = a.style || "";
|
|
6054
6054
|
if (d) {
|
|
6055
|
-
let
|
|
6056
|
-
|
|
6057
|
-
const i = { ...
|
|
6058
|
-
a.value.style = i,
|
|
6055
|
+
let o = ie(d);
|
|
6056
|
+
o.shape = o.shape, o.perimeter = o.perimeter, n.background.indexOf("/files") > -1 && (n.background = ""), Number(n.borderValue) === 0 && (n.stroke = "transparent"), u = `shape=${o.shape};perimeter=${o.perimeter};fillColor=${n.background || "#D1E7FF"};strokeColor=${n.stroke || "#000000"};strokeWidth=${n.borderValue || 0}`, o.direction && (u += `;direction=${o.direction}`);
|
|
6057
|
+
const i = { ...o, ...n };
|
|
6058
|
+
a.value.style = i, P(a.value.style, a.value.data);
|
|
6059
6059
|
}
|
|
6060
6060
|
return u;
|
|
6061
6061
|
}
|
|
6062
6062
|
function ie(a) {
|
|
6063
6063
|
const n = {};
|
|
6064
6064
|
return a.split(";").filter((d) => d.trim() !== "").forEach((d) => {
|
|
6065
|
-
const [
|
|
6066
|
-
|
|
6065
|
+
const [o, i] = d.split("=");
|
|
6066
|
+
o && i !== void 0 && (n[o.trim()] = i.trim());
|
|
6067
6067
|
}), n;
|
|
6068
6068
|
}
|
|
6069
6069
|
function oe(a) {
|
|
@@ -6072,21 +6072,21 @@ function je(t) {
|
|
|
6072
6072
|
e.addImgVertex = (a) => {
|
|
6073
6073
|
let n = e.graph;
|
|
6074
6074
|
const u = n.getModel();
|
|
6075
|
-
let d = n.getDefaultParent(),
|
|
6075
|
+
let d = n.getDefaultParent(), o = [];
|
|
6076
6076
|
u.beginUpdate();
|
|
6077
6077
|
try {
|
|
6078
6078
|
a.forEach((i) => {
|
|
6079
|
-
const { evt: y = null, data: c = {}, pt: f = { x: 50, y: 50 }, w:
|
|
6079
|
+
const { evt: y = null, data: c = {}, pt: f = { x: 50, y: 50 }, w: C = 48, h: S = 48, style: w = {}, displayName: E = "", imgUrl: U = "", iconName: O = "icon-Imagefile", realWh: M = {} } = i;
|
|
6080
6080
|
let B = f, F = e.graph;
|
|
6081
6081
|
y && (B = F.getPointForEvent(y));
|
|
6082
|
-
let V = F.insertVertex(d, null, i.show ? i.name : "", B.x, B.y,
|
|
6082
|
+
let V = F.insertVertex(d, null, i.show ? i.name : "", B.x, B.y, C, S);
|
|
6083
6083
|
V.type = "img", V.model = "yes", V.imgUrl = i.imgUrl, V.iconName = O, V.value = {
|
|
6084
6084
|
data: c,
|
|
6085
6085
|
style: w,
|
|
6086
6086
|
name: i ? i.displayName : i.getAttribute("label"),
|
|
6087
6087
|
realWh: M
|
|
6088
|
-
},
|
|
6089
|
-
}), n.setSelectionCells(
|
|
6088
|
+
}, o.push(V);
|
|
6089
|
+
}), n.setSelectionCells(o);
|
|
6090
6090
|
} finally {
|
|
6091
6091
|
u.endUpdate();
|
|
6092
6092
|
}
|
|
@@ -6107,26 +6107,26 @@ function je(t) {
|
|
|
6107
6107
|
});
|
|
6108
6108
|
}
|
|
6109
6109
|
e.createAllVertex = (a, n) => {
|
|
6110
|
-
a === "vertex" ? Ke(n) : a === "custom" ?
|
|
6110
|
+
a === "vertex" ? Ke(n) : a === "custom" ? be(n) : a === "edge" ? ye(n) : a === "img" && oe(n);
|
|
6111
6111
|
};
|
|
6112
6112
|
function ye(a) {
|
|
6113
6113
|
e.firstFlag = !0;
|
|
6114
6114
|
const n = mxGraph.prototype.insertEdge;
|
|
6115
|
-
mxGraph.prototype.insertEdge = function(y, c, f,
|
|
6115
|
+
mxGraph.prototype.insertEdge = function(y, c, f, C, S, w) {
|
|
6116
6116
|
return w === null && (w = ""), n.apply(this, arguments);
|
|
6117
6117
|
};
|
|
6118
|
-
let u = e.graph, d = u.getDefaultParent(),
|
|
6119
|
-
|
|
6118
|
+
let u = e.graph, d = u.getDefaultParent(), o = u.getModel(), i = [];
|
|
6119
|
+
o.beginUpdate();
|
|
6120
6120
|
try {
|
|
6121
6121
|
for (let y = 0; y < a.length; y++) {
|
|
6122
|
-
const c = a[y], { evt: f = null, data:
|
|
6122
|
+
const c = a[y], { evt: f = null, data: C = null, pt: S = { x: 50, y: 50 }, style: w, w: E = 30, h: U = 100, iconName: O = "icon-general-icon" } = c;
|
|
6123
6123
|
let M = S;
|
|
6124
6124
|
f && (M = u.getPointForEvent(f));
|
|
6125
6125
|
let B = ue(), F = u.insertEdge(d, null, "", null, null, w.perimeter + `;strokeWidth=${w.strokeWidth || 1};strokeColor=${w.strokeColor || "#333333"}`);
|
|
6126
6126
|
F.id = B;
|
|
6127
|
-
let V = new mxGeometry(), { startX: H, startY: W, endX: q, endY:
|
|
6128
|
-
V.setTerminalPoint(new mxPoint(H, W), !0), V.setTerminalPoint(new mxPoint(q,
|
|
6129
|
-
data: { ...
|
|
6127
|
+
let V = new mxGeometry(), { startX: H, startY: W, endX: q, endY: G } = ze(M, E, U);
|
|
6128
|
+
V.setTerminalPoint(new mxPoint(H, W), !0), V.setTerminalPoint(new mxPoint(q, G), !1), F.setGeometry(V), F.model = "yes", F.type = "edge", F.iconName = O, F.value = {
|
|
6129
|
+
data: { ...C },
|
|
6130
6130
|
//存储对象
|
|
6131
6131
|
style: { ...w }
|
|
6132
6132
|
//存储样式对象
|
|
@@ -6136,17 +6136,17 @@ function je(t) {
|
|
|
6136
6136
|
}
|
|
6137
6137
|
u.setSelectionCells(i);
|
|
6138
6138
|
} finally {
|
|
6139
|
-
|
|
6139
|
+
o.endUpdate();
|
|
6140
6140
|
}
|
|
6141
6141
|
}
|
|
6142
|
-
function
|
|
6142
|
+
function be(a) {
|
|
6143
6143
|
let n = e.graph, u = n.getModel(), d = [];
|
|
6144
6144
|
u.beginUpdate();
|
|
6145
6145
|
try {
|
|
6146
|
-
for (let
|
|
6147
|
-
const i = a[
|
|
6146
|
+
for (let o = 0; o < a.length; o++) {
|
|
6147
|
+
const i = a[o], { evt: y = null, data: c = null, pt: f = { x: 50, y: 50 }, style: C, w: S = 100, h: w = 30, type: E, tmpType: U, codeType: O, iconName: M = "icon-general-icon", realType: B } = i;
|
|
6148
6148
|
let F = S, V = w, H = f;
|
|
6149
|
-
y && (H = n.getPointForEvent(y)),
|
|
6149
|
+
y && (H = n.getPointForEvent(y)), C.layout && (F = C.layout.width, V = C.layout.height);
|
|
6150
6150
|
let W = {
|
|
6151
6151
|
width: F,
|
|
6152
6152
|
height: V,
|
|
@@ -6157,14 +6157,14 @@ function je(t) {
|
|
|
6157
6157
|
let se = q.find((X) => X.key == "layout");
|
|
6158
6158
|
se.value = W;
|
|
6159
6159
|
}
|
|
6160
|
-
|
|
6161
|
-
let
|
|
6160
|
+
C.layout = W;
|
|
6161
|
+
let G = n.getDefaultParent();
|
|
6162
6162
|
ce(n, null);
|
|
6163
|
-
let ne = R(
|
|
6164
|
-
Y.crtype = "creatComp", Y.cmp =
|
|
6163
|
+
let ne = R(C), re = ue(), Y = n.insertVertex(G, re, C.text || "", H.x, H.y, F, V, ne);
|
|
6164
|
+
Y.crtype = "creatComp", Y.cmp = U, Y.codeType = O, Y.type = E, Y.realType = B, Y.model = "yes", Y.name = C.text || "", Y.iconName = M, Y.style = ne, Y.value = {
|
|
6165
6165
|
data: c,
|
|
6166
6166
|
//存储对象
|
|
6167
|
-
style:
|
|
6167
|
+
style: C
|
|
6168
6168
|
//存储样式对象
|
|
6169
6169
|
}, n.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED, {
|
|
6170
6170
|
cells: [Y]
|
|
@@ -6179,8 +6179,8 @@ function je(t) {
|
|
|
6179
6179
|
let n = e.graph, u = n.getModel(), d = [];
|
|
6180
6180
|
u.beginUpdate();
|
|
6181
6181
|
try {
|
|
6182
|
-
for (let
|
|
6183
|
-
const i = a[
|
|
6182
|
+
for (let o = 0; o < a.length; o++) {
|
|
6183
|
+
const i = a[o], { evt: y = null, data: c = null, pt: f = { x: 50, y: 50 }, style: C, w: S = 100, h: w = 20, iconName: E = "iconfont icon-general-icon", realType: U, from: O } = i;
|
|
6184
6184
|
let M = f;
|
|
6185
6185
|
n || (n = e.graph), y && (M = n.getPointForEvent(y));
|
|
6186
6186
|
let B = n.getDefaultParent(), F = n.getModel(), V = {
|
|
@@ -6193,16 +6193,16 @@ function je(t) {
|
|
|
6193
6193
|
let ne = H.find((re) => re.key == "layout");
|
|
6194
6194
|
ne.value = V;
|
|
6195
6195
|
}
|
|
6196
|
-
let W = R(
|
|
6197
|
-
|
|
6198
|
-
let q = ue(),
|
|
6199
|
-
|
|
6196
|
+
let W = R(C);
|
|
6197
|
+
C.gtype == "rect" && (Number(C.borderValue) === 0 && (C.stroke = "transparent"), W = C.perimeter + `;fillColor=${C.background || "transparent"};strokeColor=${C.stroke || "#333333"};strokeWidth=${C.borderWidth || 0}`);
|
|
6198
|
+
let q = ue(), G = n.insertVertex(B, q, C.text || "", M.x, M.y, S, w, W);
|
|
6199
|
+
C.gtype == "rect" ? G.type = "rect" : G.type = "vertex", G.model = "yes", G.name = C.text || "", G.iconName = E, G.value = {
|
|
6200
6200
|
data: { ...c },
|
|
6201
6201
|
//存储对象
|
|
6202
|
-
style: { ...
|
|
6202
|
+
style: { ...C }
|
|
6203
6203
|
//存储样式对象
|
|
6204
|
-
},
|
|
6205
|
-
cells: [
|
|
6204
|
+
}, G.from = O || "other", G.realType = U, G.style = W, d.push(G), n.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED, {
|
|
6205
|
+
cells: [G]
|
|
6206
6206
|
}));
|
|
6207
6207
|
}
|
|
6208
6208
|
n.setSelectionCells(d);
|
|
@@ -6211,14 +6211,14 @@ function je(t) {
|
|
|
6211
6211
|
}
|
|
6212
6212
|
}
|
|
6213
6213
|
e.addVertex = ({ graph: a, options: n = {} }) => new Promise((u, d) => {
|
|
6214
|
-
const { evt:
|
|
6215
|
-
let
|
|
6216
|
-
a || (a = e.graph),
|
|
6214
|
+
const { evt: o = null, data: i = null, pt: y = { x: 50, y: 50 }, style: c, w: f = 100, h: C = 20, iconName: S = "iconfont icon-general-icon", realType: w, from: E } = n;
|
|
6215
|
+
let U = y;
|
|
6216
|
+
a || (a = e.graph), o && (U = a.getPointForEvent(o));
|
|
6217
6217
|
let O = a.getDefaultParent(), M = a.getModel(), B = {
|
|
6218
6218
|
width: f,
|
|
6219
|
-
height:
|
|
6220
|
-
x:
|
|
6221
|
-
y:
|
|
6219
|
+
height: C,
|
|
6220
|
+
x: U.x,
|
|
6221
|
+
y: U.y
|
|
6222
6222
|
}, F = i.children;
|
|
6223
6223
|
if (F && F.length > 0) {
|
|
6224
6224
|
let V = F.find((H) => H.key == "layout");
|
|
@@ -6228,7 +6228,7 @@ function je(t) {
|
|
|
6228
6228
|
try {
|
|
6229
6229
|
let V = R(c);
|
|
6230
6230
|
c.gtype == "rect" && (Number(c.borderValue) === 0 && (c.stroke = "transparent"), V = c.perimeter + `;fillColor=${c.background || "transparent"};strokeColor=${c.stroke || "#333333"};strokeWidth=${c.borderWidth || 0}`);
|
|
6231
|
-
let H = ue(), W = a.insertVertex(O, H, c.text || "",
|
|
6231
|
+
let H = ue(), W = a.insertVertex(O, H, c.text || "", U.x, U.y, f, C, V);
|
|
6232
6232
|
c.gtype == "rect" ? W.type = "rect" : W.type = "vertex", W.model = "yes", W.name = c.text || "", W.iconName = S, W.value = {
|
|
6233
6233
|
data: { ...i },
|
|
6234
6234
|
//存储对象
|
|
@@ -6242,7 +6242,7 @@ function je(t) {
|
|
|
6242
6242
|
}
|
|
6243
6243
|
});
|
|
6244
6244
|
function ze(a, n, u) {
|
|
6245
|
-
const
|
|
6245
|
+
const o = -10 * Math.PI / 180, i = Math.cos(o), y = Math.sin(o), c = u / 2, f = n / 2, S = [
|
|
6246
6246
|
{ x: -c, y: -f },
|
|
6247
6247
|
// V1 左上
|
|
6248
6248
|
{ x: c, y: -f },
|
|
@@ -6251,8 +6251,8 @@ function je(t) {
|
|
|
6251
6251
|
// V3 右下
|
|
6252
6252
|
{ x: -c, y: f }
|
|
6253
6253
|
// V4 左下
|
|
6254
|
-
].map((
|
|
6255
|
-
const O = a.x + (
|
|
6254
|
+
].map((U) => {
|
|
6255
|
+
const O = a.x + (U.x * i - U.y * y), M = a.y + (U.x * y + U.y * i);
|
|
6256
6256
|
return { x: O.toFixed(0), y: M.toFixed(0) };
|
|
6257
6257
|
}), w = S[3], E = S[1];
|
|
6258
6258
|
return { startX: parseFloat(w.x), startY: parseFloat(w.y), endX: parseFloat(E.x), endY: parseFloat(E.y) };
|
|
@@ -6260,18 +6260,18 @@ function je(t) {
|
|
|
6260
6260
|
e.addEdge = ({ graph: a, options: n = {} }) => {
|
|
6261
6261
|
e.firstFlag = !0;
|
|
6262
6262
|
const u = mxGraph.prototype.insertEdge;
|
|
6263
|
-
return mxGraph.prototype.insertEdge = function(d,
|
|
6263
|
+
return mxGraph.prototype.insertEdge = function(d, o, i, y, c, f) {
|
|
6264
6264
|
return f === null && (f = ""), u.apply(this, arguments);
|
|
6265
|
-
}, new Promise((d,
|
|
6266
|
-
const { evt: i = null, data: y = null, pt: c = { x: 50, y: 50 }, style: f, w:
|
|
6265
|
+
}, new Promise((d, o) => {
|
|
6266
|
+
const { evt: i = null, data: y = null, pt: c = { x: 50, y: 50 }, style: f, w: C = 30, h: S = 100, iconName: w = "icon-general-icon" } = n;
|
|
6267
6267
|
let E = c;
|
|
6268
6268
|
a || (a = e.graph), i && (E = a.getPointForEvent(i));
|
|
6269
|
-
let
|
|
6269
|
+
let U = a.getDefaultParent(), O = a.getModel();
|
|
6270
6270
|
O.beginUpdate();
|
|
6271
6271
|
try {
|
|
6272
|
-
let M = ue(), B = a.insertEdge(
|
|
6272
|
+
let M = ue(), B = a.insertEdge(U, null, "", null, null, f.perimeter + `;strokeWidth=${f.strokeWidth || 1};strokeColor=${f.strokeColor || "#333333"}`);
|
|
6273
6273
|
B.id = M;
|
|
6274
|
-
let F = new mxGeometry(), { startX: V, startY: H, endX: W, endY: q } = ze(E,
|
|
6274
|
+
let F = new mxGeometry(), { startX: V, startY: H, endX: W, endY: q } = ze(E, C, S);
|
|
6275
6275
|
F.setTerminalPoint(new mxPoint(V, H), !0), F.setTerminalPoint(new mxPoint(W, q), !1), B.setGeometry(F), B.model = "yes", B.type = "edge", B.iconName = w, B.value = {
|
|
6276
6276
|
data: { ...y },
|
|
6277
6277
|
//存储对象
|
|
@@ -6285,17 +6285,17 @@ function je(t) {
|
|
|
6285
6285
|
}
|
|
6286
6286
|
});
|
|
6287
6287
|
}, e.createCustomComponent = ({ graph: a, options: n = {} }) => new Promise((u, d) => {
|
|
6288
|
-
const { evt:
|
|
6289
|
-
let V =
|
|
6290
|
-
a || (a = e.graph),
|
|
6288
|
+
const { evt: o = null, data: i = null, pt: y = { x: 50, y: 50 }, id: c = null, style: f, w: C = 100, h: S = 30, type: w, tmpType: E, codeType: U, crtype: O = "creatComp", other: M = {}, iconName: B = "icon-general-icon", realType: F } = n;
|
|
6289
|
+
let V = C, H = S, W = y;
|
|
6290
|
+
a || (a = e.graph), o && (W = a.getPointForEvent(o)), f.layout && (V = f.layout.width, H = f.layout.height);
|
|
6291
6291
|
let q = {
|
|
6292
6292
|
width: V,
|
|
6293
6293
|
height: H,
|
|
6294
6294
|
x: W.x,
|
|
6295
6295
|
y: W.y
|
|
6296
|
-
},
|
|
6297
|
-
if (
|
|
6298
|
-
let Y =
|
|
6296
|
+
}, G = i.children;
|
|
6297
|
+
if (G && G.length > 0) {
|
|
6298
|
+
let Y = G.find((se) => se.key == "layout");
|
|
6299
6299
|
Y.value = q;
|
|
6300
6300
|
}
|
|
6301
6301
|
f.layout = q;
|
|
@@ -6303,7 +6303,7 @@ function je(t) {
|
|
|
6303
6303
|
ce(a), re.beginUpdate();
|
|
6304
6304
|
try {
|
|
6305
6305
|
let Y = R(f), se = c || ue(), X = a.insertVertex(ne, se, f.text || "", W.x, W.y, V, H, Y);
|
|
6306
|
-
X.crtype = O || "creatComp", X.other = M, X.cmp = E, X.codeType =
|
|
6306
|
+
X.crtype = O || "creatComp", X.other = M, X.cmp = E, X.codeType = U, X.type = w, X.realType = F, X.model = "yes", X.name = f.text || "", X.iconName = B, X.style = Y, X.value = {
|
|
6307
6307
|
data: i,
|
|
6308
6308
|
//存储对象
|
|
6309
6309
|
style: f
|
|
@@ -6320,8 +6320,8 @@ function je(t) {
|
|
|
6320
6320
|
}, e.fromXmlToView = (a) => {
|
|
6321
6321
|
let n = e.graph;
|
|
6322
6322
|
return new Promise((u, d) => {
|
|
6323
|
-
let
|
|
6324
|
-
|
|
6323
|
+
let o = new mxFastOrganicLayout(n);
|
|
6324
|
+
o.forceConstant = 140;
|
|
6325
6325
|
const i = n.getStylesheet().getDefaultVertexStyle();
|
|
6326
6326
|
i.fill = "none", i[mxConstants.STYLE_STROKE] = "none", n.getModel().beginUpdate();
|
|
6327
6327
|
try {
|
|
@@ -6332,12 +6332,12 @@ function je(t) {
|
|
|
6332
6332
|
});
|
|
6333
6333
|
}, e.main = (a) => {
|
|
6334
6334
|
let { container: n, xml: u } = a;
|
|
6335
|
-
return new Promise((d,
|
|
6335
|
+
return new Promise((d, o) => {
|
|
6336
6336
|
if (!mxClient.isBrowserSupported())
|
|
6337
6337
|
mxUtils.error("Browser is not supported!", 200, !1);
|
|
6338
6338
|
else {
|
|
6339
6339
|
let i = new mxEditor(), y = i.graph;
|
|
6340
|
-
i.setGraphContainer(n), y.setEnabled(!1), y.setPanning(!1), y.setTooltips(!1), y.setHtmlLabels(!0), y.panningHandler.useLeftButtonForPanning = !0, y.isHtmlLabel = function(
|
|
6340
|
+
i.setGraphContainer(n), y.setEnabled(!1), y.setPanning(!1), y.setTooltips(!1), y.setHtmlLabels(!0), y.panningHandler.useLeftButtonForPanning = !0, y.isHtmlLabel = function(C) {
|
|
6341
6341
|
return !0;
|
|
6342
6342
|
}, y.gridSize = 10, e.graph = y, e.preview = !0;
|
|
6343
6343
|
const f = y.getStylesheet().getDefaultVertexStyle();
|
|
@@ -6352,61 +6352,61 @@ function je(t) {
|
|
|
6352
6352
|
fontColor: "#333333",
|
|
6353
6353
|
// 确保标签可见
|
|
6354
6354
|
fontSize: 12
|
|
6355
|
-
}), y.convertValueToString = function(
|
|
6356
|
-
let { width: S, height: w } =
|
|
6357
|
-
if (
|
|
6358
|
-
let { url: E, pup:
|
|
6355
|
+
}), y.convertValueToString = function(C) {
|
|
6356
|
+
let { width: S, height: w } = C.geometry;
|
|
6357
|
+
if (C.type == "vertex") {
|
|
6358
|
+
let { url: E, pup: U } = fe(C), O = C.value.style, M = C.value.data.children, B = {};
|
|
6359
6359
|
M && (B = M.find((V) => V.key === "text"));
|
|
6360
6360
|
let F = document.createElement("div");
|
|
6361
6361
|
return F.innerHTML = N({
|
|
6362
6362
|
img: (O == null ? void 0 : O.imgUrl) || "",
|
|
6363
6363
|
text: B.value || O.text
|
|
6364
|
-
}), F.style =
|
|
6365
|
-
} else if (
|
|
6366
|
-
let { width: E, height:
|
|
6367
|
-
if (O.style.width = E + "px", O.style.height =
|
|
6368
|
-
let M =
|
|
6364
|
+
}), F.style = D(O), F.style.width = S + "px", F.style.height = w + "px", F.style.lineHeight = w + "px", E ? (F.style.cursor = "pointer", F.className = "main-text hyperlink-btn", C.hyperlink = E) : F.className = "main-text", U && (C.popup = U), F;
|
|
6365
|
+
} else if (C.type == "kitUI:CanvasWidget") {
|
|
6366
|
+
let { width: E, height: U } = C.geometry, O = document.createElement("div");
|
|
6367
|
+
if (O.style.width = E + "px", O.style.height = U + "px", C.value) {
|
|
6368
|
+
let M = C.value.style;
|
|
6369
6369
|
M["background-image"] ? O.style.background = `${M["background-image"]} center center no-repeat` : O.style.background = "";
|
|
6370
6370
|
}
|
|
6371
6371
|
return O;
|
|
6372
|
-
} else if (
|
|
6372
|
+
} else if (C.type == "img") {
|
|
6373
6373
|
let E = document.createElement("div");
|
|
6374
6374
|
return E.innerHTML = N({
|
|
6375
|
-
img:
|
|
6375
|
+
img: C.imgUrl || ""
|
|
6376
6376
|
}), E.style.width = S + "px", E.style.height = w + "px", E.className = "main-img", E;
|
|
6377
6377
|
}
|
|
6378
|
-
return
|
|
6378
|
+
return C.value;
|
|
6379
6379
|
}, y.setPanning(!1), y.view.animate = !1, y.gridEnabled = !1, Ne(y), d(y);
|
|
6380
6380
|
}
|
|
6381
6381
|
});
|
|
6382
6382
|
};
|
|
6383
|
-
function
|
|
6383
|
+
function fe(a) {
|
|
6384
6384
|
let n = a.value.data;
|
|
6385
6385
|
if (n) {
|
|
6386
|
-
let u = n.treeData || [], d = [],
|
|
6386
|
+
let u = n.treeData || [], d = [], o = [];
|
|
6387
6387
|
return u.forEach((i) => {
|
|
6388
6388
|
let y = i.children || [], c = y.find((f) => f.key == "hyperlink" && f.value != "null");
|
|
6389
|
-
c && d.push(c), i.title == "PopupBinding" &&
|
|
6389
|
+
c && d.push(c), i.title == "PopupBinding" && o.push(y);
|
|
6390
6390
|
}), {
|
|
6391
6391
|
url: d && d.length > 0 ? d[0].value : "",
|
|
6392
|
-
pup:
|
|
6392
|
+
pup: o
|
|
6393
6393
|
};
|
|
6394
6394
|
}
|
|
6395
6395
|
return null;
|
|
6396
6396
|
}
|
|
6397
|
-
e.addMask = (a, n, u, d,
|
|
6397
|
+
e.addMask = (a, n, u, d, o) => {
|
|
6398
6398
|
let i = l(a.container, "transparentRect");
|
|
6399
6399
|
if (i && i.length > 0)
|
|
6400
6400
|
for (let y = 0; y < i.length; y++) {
|
|
6401
6401
|
let c = i[y];
|
|
6402
|
-
c && (c.style.top = u + "px", c.style.left = n + "px", c.style.width = d + "px", c.style.height =
|
|
6402
|
+
c && (c.style.top = u + "px", c.style.left = n + "px", c.style.width = d + "px", c.style.height = o + "px", c.style.zIndex = "20", e.preview || (c.classList.remove("is-block"), c.classList.add("is-hidden")));
|
|
6403
6403
|
}
|
|
6404
6404
|
}, e.initCanvas = (a) => {
|
|
6405
6405
|
const n = e.graph;
|
|
6406
6406
|
return new Promise((u, d) => {
|
|
6407
|
-
let
|
|
6407
|
+
let o = n.getModel();
|
|
6408
6408
|
const i = n.getDefaultParent();
|
|
6409
|
-
|
|
6409
|
+
o.beginUpdate();
|
|
6410
6410
|
try {
|
|
6411
6411
|
const y = n.insertVertex(
|
|
6412
6412
|
i,
|
|
@@ -6437,7 +6437,7 @@ function je(t) {
|
|
|
6437
6437
|
e.changePageSize(a), e.undoMng && e.clearUndo();
|
|
6438
6438
|
}, 10), u();
|
|
6439
6439
|
} finally {
|
|
6440
|
-
|
|
6440
|
+
o.endUpdate();
|
|
6441
6441
|
}
|
|
6442
6442
|
});
|
|
6443
6443
|
}, e.changeRotationHandleStyle = (a) => {
|
|
@@ -6445,13 +6445,13 @@ function je(t) {
|
|
|
6445
6445
|
}, e.testPosition = () => {
|
|
6446
6446
|
let a = e.graph, n = null, u = e.parent;
|
|
6447
6447
|
u && (n = u.value ? u.value.style : null);
|
|
6448
|
-
let { x: d, y:
|
|
6449
|
-
n.horizontalAlign === "end" && (i = d - 2), n.verticalAlign === "end" && (y =
|
|
6448
|
+
let { x: d, y: o } = ke(n, a.container), i = d, y = o;
|
|
6449
|
+
n.horizontalAlign === "end" && (i = d - 2), n.verticalAlign === "end" && (y = o - 2), e.addMask(a, i, y, n.width, n.height), a.getView().setTranslate(i, y);
|
|
6450
6450
|
}, e.getTranslate = (a) => {
|
|
6451
6451
|
let n = e.graph;
|
|
6452
6452
|
const u = a.value ? a.value.style : null;
|
|
6453
|
-
let { x: d, y:
|
|
6454
|
-
return { x: d, y:
|
|
6453
|
+
let { x: d, y: o } = ke(u, n.container);
|
|
6454
|
+
return { x: d, y: o };
|
|
6455
6455
|
}, e.getFloatingPosition = (a) => {
|
|
6456
6456
|
let n = e.graph;
|
|
6457
6457
|
if (!a) {
|
|
@@ -6465,12 +6465,12 @@ function je(t) {
|
|
|
6465
6465
|
for (let c = 0; c < u.length; c++) {
|
|
6466
6466
|
let f = u[c];
|
|
6467
6467
|
if (e.isPreview) {
|
|
6468
|
-
let
|
|
6469
|
-
for (let S = 0; S <
|
|
6470
|
-
const w =
|
|
6468
|
+
let C = document.getElementsByClassName(f.id);
|
|
6469
|
+
for (let S = 0; S < C.length; S++) {
|
|
6470
|
+
const w = C[S];
|
|
6471
6471
|
if (w) {
|
|
6472
|
-
var
|
|
6473
|
-
w.style.position = "absolute", w.style.width =
|
|
6472
|
+
var o = f.getGeometry();
|
|
6473
|
+
w.style.position = "absolute", w.style.width = o.width + "px", w.style.height = o.height + "px", w.style.left = o.x + i + "px", w.style.top = o.y + y + "px";
|
|
6474
6474
|
}
|
|
6475
6475
|
}
|
|
6476
6476
|
}
|
|
@@ -6490,10 +6490,10 @@ function je(t) {
|
|
|
6490
6490
|
try {
|
|
6491
6491
|
const d = e.parent;
|
|
6492
6492
|
if (d) {
|
|
6493
|
-
let
|
|
6494
|
-
if (
|
|
6493
|
+
let o = n.getCellGeometry(d);
|
|
6494
|
+
if (o) {
|
|
6495
6495
|
let { x: i, y } = ke(a, n.container);
|
|
6496
|
-
|
|
6496
|
+
o.width = a.width, o.height = a.height, u.setGeometry(d, o);
|
|
6497
6497
|
let c = n.container.querySelector("canvas");
|
|
6498
6498
|
if (a.background)
|
|
6499
6499
|
if (a.background.indexOf("files/") > -1) {
|
|
@@ -6517,12 +6517,12 @@ function je(t) {
|
|
|
6517
6517
|
}
|
|
6518
6518
|
else
|
|
6519
6519
|
c && (c.style.background = "transparent");
|
|
6520
|
-
let f = i,
|
|
6521
|
-
a.horizontalAlign === "end" && (f = i - 2), a.verticalAlign === "end" && (
|
|
6520
|
+
let f = i, C = y;
|
|
6521
|
+
a.horizontalAlign === "end" && (f = i - 2), a.verticalAlign === "end" && (C = y - 2), e.addMask(n, f, C, a.width, a.height), n.getView().setTranslate(f, C);
|
|
6522
6522
|
}
|
|
6523
6523
|
n.scrollCellToVisible(d, !1), e.parent = d, n.refresh(d);
|
|
6524
6524
|
}
|
|
6525
|
-
u.setBounds = function(
|
|
6525
|
+
u.setBounds = function(o) {
|
|
6526
6526
|
return new mxRectangle(0, 0, a.width, a.height);
|
|
6527
6527
|
};
|
|
6528
6528
|
} finally {
|
|
@@ -6533,9 +6533,9 @@ function je(t) {
|
|
|
6533
6533
|
function Ne(a) {
|
|
6534
6534
|
a.addListener(mxEvent.CLICK, function(n, u) {
|
|
6535
6535
|
a.container.focus();
|
|
6536
|
-
const
|
|
6537
|
-
if (
|
|
6538
|
-
return t.handelEvent({ key: "click", evt: u, val:
|
|
6536
|
+
const o = u.getProperty("cell");
|
|
6537
|
+
if (o)
|
|
6538
|
+
return t.handelEvent({ key: "click", evt: u, val: o }), !1;
|
|
6539
6539
|
});
|
|
6540
6540
|
}
|
|
6541
6541
|
function Ye(a) {
|
|
@@ -6551,28 +6551,28 @@ function je(t) {
|
|
|
6551
6551
|
};
|
|
6552
6552
|
}
|
|
6553
6553
|
function qe(a, n, u) {
|
|
6554
|
-
let d = a.getModel(),
|
|
6554
|
+
let d = a.getModel(), o = function(i, y) {
|
|
6555
6555
|
n.undoableEditHappened(y.getProperty("edit"));
|
|
6556
6556
|
};
|
|
6557
|
-
d.addListener(mxEvent.UNDO,
|
|
6557
|
+
d.addListener(mxEvent.UNDO, o), a.getView().addListener(mxEvent.UNDO, o);
|
|
6558
6558
|
}
|
|
6559
|
-
e.addCode = ({ code: a, pt: n, style: u, type: d, iconCls:
|
|
6559
|
+
e.addCode = ({ code: a, pt: n, style: u, type: d, iconCls: o }) => {
|
|
6560
6560
|
let i = e.graph;
|
|
6561
|
-
Be(a, i, { pt: n, style: u, me: e, type: d, iconCls:
|
|
6562
|
-
}, e.addEvent = ({ code: a, pt: n, style: u, type: d, iconCls:
|
|
6561
|
+
Be(a, i, { pt: n, style: u, me: e, type: d, iconCls: o }, t);
|
|
6562
|
+
}, e.addEvent = ({ code: a, pt: n, style: u, type: d, iconCls: o }) => {
|
|
6563
6563
|
let i = e.graph;
|
|
6564
|
-
Be(a, i, { pt: n, style: u, me: e, type: d, iconCls:
|
|
6564
|
+
Be(a, i, { pt: n, style: u, me: e, type: d, iconCls: o }, t);
|
|
6565
6565
|
};
|
|
6566
6566
|
function Xe(a) {
|
|
6567
6567
|
a.addListener(mxEvent.RESIZE_CELLS, function(n, u) {
|
|
6568
|
-
const d = u.getProperty("cells"),
|
|
6568
|
+
const d = u.getProperty("cells"), o = u.getProperty("bounds"), i = u.getProperty("previous"), y = a.getSelectionCells();
|
|
6569
6569
|
d.forEach((c) => {
|
|
6570
6570
|
if (a.getChildCells(c), a.getCellGeometry(c)) {
|
|
6571
|
-
const
|
|
6571
|
+
const C = parseFloat(o[0].width / i[0].width), S = parseFloat(o[0].height / i[0].height);
|
|
6572
6572
|
y.forEach((w) => {
|
|
6573
6573
|
if (w.id != c.id) {
|
|
6574
|
-
const
|
|
6575
|
-
|
|
6574
|
+
const U = a.getCellGeometry(w).clone();
|
|
6575
|
+
U.width *= C, U.height *= S, a.getModel().setGeometry(w, U);
|
|
6576
6576
|
}
|
|
6577
6577
|
});
|
|
6578
6578
|
}
|
|
@@ -6590,14 +6590,14 @@ function je(t) {
|
|
|
6590
6590
|
}
|
|
6591
6591
|
function Ze(a, n, u) {
|
|
6592
6592
|
mxEvent.consume(a);
|
|
6593
|
-
const d = n.getView().getScale(),
|
|
6593
|
+
const d = n.getView().getScale(), o = u ? 1.1 : 1 / 1.1, i = d * o;
|
|
6594
6594
|
if (i > 3 || i < 0.1) return;
|
|
6595
|
-
const y = n.container, c = y.offsetWidth, f = y.offsetHeight,
|
|
6595
|
+
const y = n.container, c = y.offsetWidth, f = y.offsetHeight, C = c / 2, S = f / 2;
|
|
6596
6596
|
n.getModel().beginUpdate();
|
|
6597
6597
|
try {
|
|
6598
|
-
const w = n.getView(), E = w.getScale(),
|
|
6598
|
+
const w = n.getView(), E = w.getScale(), U = w.getTranslate(), O = C / E - U.x, M = S / E - U.y;
|
|
6599
6599
|
n.getView().setScale(i);
|
|
6600
|
-
const B =
|
|
6600
|
+
const B = C / i - U.x, F = S / i - U.y, V = B - O, H = F - M;
|
|
6601
6601
|
w.setTranslate(
|
|
6602
6602
|
w.getTranslate().x + V,
|
|
6603
6603
|
w.getTranslate().y + H
|
|
@@ -6607,7 +6607,7 @@ function je(t) {
|
|
|
6607
6607
|
}
|
|
6608
6608
|
}
|
|
6609
6609
|
function Je(a, n) {
|
|
6610
|
-
n.popupMenuHandler.autoExpand = !0, n.popupMenuHandler.factoryMethod = function(u, d,
|
|
6610
|
+
n.popupMenuHandler.autoExpand = !0, n.popupMenuHandler.factoryMethod = function(u, d, o) {
|
|
6611
6611
|
if (e.preview)
|
|
6612
6612
|
return;
|
|
6613
6613
|
let i = mxClipboard.cells;
|
|
@@ -6615,11 +6615,11 @@ function je(t) {
|
|
|
6615
6615
|
return;
|
|
6616
6616
|
let y = [];
|
|
6617
6617
|
d && d.type != "kitUI:CanvasWidget" ? (y = ["new"], i || y.push("paste"), n.getSelectionCells().length < 2 && y.push("order")) : (y = ["copy", "cut", "clone", "del", "order", "toUp", "toDown"], i || y.push("paste")), gt(a, y).forEach((f) => {
|
|
6618
|
-
let
|
|
6619
|
-
f.children && f.children.length > 0 ? (
|
|
6618
|
+
let C = null, S = null;
|
|
6619
|
+
f.children && f.children.length > 0 ? (C = null, S = f.children) : C = function() {
|
|
6620
6620
|
if (f.code) {
|
|
6621
|
-
let E = n.getPointForEvent(
|
|
6622
|
-
t.contextmenus(
|
|
6621
|
+
let E = n.getPointForEvent(o);
|
|
6622
|
+
t.contextmenus(o, {
|
|
6623
6623
|
title: f.title,
|
|
6624
6624
|
code: f.code || "",
|
|
6625
6625
|
type: f.type,
|
|
@@ -6629,18 +6629,18 @@ function je(t) {
|
|
|
6629
6629
|
});
|
|
6630
6630
|
}
|
|
6631
6631
|
};
|
|
6632
|
-
let w = u.addItem(f.title, f.image,
|
|
6632
|
+
let w = u.addItem(f.title, f.image, C, null, f.iconCls, f.disable, null, null, f.isBorder);
|
|
6633
6633
|
S && S.forEach((E) => {
|
|
6634
6634
|
u.addItem(E.title, E.image, function() {
|
|
6635
6635
|
if (E.code) {
|
|
6636
|
-
let
|
|
6637
|
-
t.contextmenus(
|
|
6636
|
+
let U = n.getPointForEvent(o);
|
|
6637
|
+
t.contextmenus(o, {
|
|
6638
6638
|
title: E.title,
|
|
6639
6639
|
code: E.code || "",
|
|
6640
6640
|
type: E.type,
|
|
6641
6641
|
style: E.style,
|
|
6642
6642
|
iconCls: E.iconCls,
|
|
6643
|
-
pt:
|
|
6643
|
+
pt: U
|
|
6644
6644
|
});
|
|
6645
6645
|
}
|
|
6646
6646
|
}, w, E.iconCls, E.disable, null, null, E.isBorder);
|
|
@@ -6674,15 +6674,15 @@ const $e = {
|
|
|
6674
6674
|
"/js/mxClient.js"
|
|
6675
6675
|
];
|
|
6676
6676
|
return new Promise((l) => {
|
|
6677
|
-
const
|
|
6677
|
+
const s = document.getElementsByTagName("script");
|
|
6678
6678
|
let r = !1;
|
|
6679
|
-
for (let
|
|
6680
|
-
|
|
6679
|
+
for (let b = 0; b < s.length; b++)
|
|
6680
|
+
s[b].src.includes("mxClient.js") && (r = !0);
|
|
6681
6681
|
if (r)
|
|
6682
6682
|
return l();
|
|
6683
|
-
let p = e.map((
|
|
6683
|
+
let p = e.map((b) => {
|
|
6684
6684
|
let x = document.createElement("script");
|
|
6685
|
-
return x.type = "text/javascript", x.async = !1, x.src =
|
|
6685
|
+
return x.type = "text/javascript", x.async = !1, x.src = b, document.head.appendChild(x), x;
|
|
6686
6686
|
}).pop();
|
|
6687
6687
|
p.onload = l;
|
|
6688
6688
|
});
|
|
@@ -6975,13 +6975,9 @@ const $e = {
|
|
|
6975
6975
|
handler(t, e) {
|
|
6976
6976
|
let l = this;
|
|
6977
6977
|
l.yhz && (l.yhz.isPreview(!t), l.$nextTick(() => {
|
|
6978
|
-
t ? (l.keys = Math.random().toString(36).substring(2), l.graph.refresh(), l.scheduleUpdateOverlay()
|
|
6979
|
-
o.cell.setVisible(!1);
|
|
6980
|
-
})) : (l.timeLineMap && l.timeLineMap.length > 0 && l.timeLineMap.forEach((o) => {
|
|
6981
|
-
o.cell.setVisible(!0);
|
|
6982
|
-
}), l.centeredWindow && l.centeredWindow.forEach((r) => {
|
|
6978
|
+
t ? (l.keys = Math.random().toString(36).substring(2), l.graph.refresh(), l.scheduleUpdateOverlay()) : l.centeredWindow && l.centeredWindow.forEach((r) => {
|
|
6983
6979
|
r && (r.setVisible(!1), r.destroy());
|
|
6984
|
-
})
|
|
6980
|
+
});
|
|
6985
6981
|
}));
|
|
6986
6982
|
},
|
|
6987
6983
|
immediate: !0,
|
|
@@ -6990,8 +6986,8 @@ const $e = {
|
|
|
6990
6986
|
},
|
|
6991
6987
|
methods: {
|
|
6992
6988
|
getStyle(t) {
|
|
6993
|
-
let e = this,
|
|
6994
|
-
return e.yhz.scheduleBorder(
|
|
6989
|
+
let e = this, s = t.cell.style || {};
|
|
6990
|
+
return e.yhz.scheduleBorder(s);
|
|
6995
6991
|
},
|
|
6996
6992
|
//隐藏并显示
|
|
6997
6993
|
handleshowAndHide(t, e) {
|
|
@@ -7003,8 +6999,8 @@ const $e = {
|
|
|
7003
6999
|
let t = this;
|
|
7004
7000
|
this.updateRaf && cancelAnimationFrame(this.updateRaf), this.updateRaf = requestAnimationFrame(() => {
|
|
7005
7001
|
t.$nextTick(() => {
|
|
7006
|
-
var l = t.graph.getModel().cells,
|
|
7007
|
-
let r =
|
|
7002
|
+
var l = t.graph.getModel().cells, s = Object.values(l);
|
|
7003
|
+
let r = s.filter((m) => m.crtype == "schedule");
|
|
7008
7004
|
for (let m = 0; m < r.length; m++) {
|
|
7009
7005
|
let p = r[m];
|
|
7010
7006
|
t.graph.view.validateCell(p);
|
|
@@ -7016,8 +7012,8 @@ const $e = {
|
|
|
7016
7012
|
async addTimeLine({ cellAry: t, scheduleCombination: e }) {
|
|
7017
7013
|
let l = this;
|
|
7018
7014
|
l.$nextTick(() => {
|
|
7019
|
-
for (let
|
|
7020
|
-
let r = t[
|
|
7015
|
+
for (let s = 0; s < t.length; s++) {
|
|
7016
|
+
let r = t[s], m = {
|
|
7021
7017
|
id: r.id,
|
|
7022
7018
|
cell: r,
|
|
7023
7019
|
other: r.other,
|
|
@@ -7122,20 +7118,20 @@ const $e = {
|
|
|
7122
7118
|
let t = this, e = t.$refs.geEditor;
|
|
7123
7119
|
const l = new je(t);
|
|
7124
7120
|
if (!t.graph) {
|
|
7125
|
-
let
|
|
7121
|
+
let s = await l.init({
|
|
7126
7122
|
container: e,
|
|
7127
7123
|
menus: t.menus,
|
|
7128
7124
|
pageShortcuts: t.pageShortcuts
|
|
7129
7125
|
});
|
|
7130
|
-
t.graph =
|
|
7126
|
+
t.graph = s, t.delCell(s), t.yhz = l, t.$emit("handelEvent", { key: "init", mygraph: s, yhz: l }), setTimeout(() => {
|
|
7131
7127
|
l.isPreview(!t.isPreview);
|
|
7132
7128
|
}, 0);
|
|
7133
7129
|
}
|
|
7134
7130
|
},
|
|
7135
7131
|
delCell(t) {
|
|
7136
7132
|
let e = this;
|
|
7137
|
-
t.addListener(mxEvent.DELETE_CELLS, (l,
|
|
7138
|
-
const r =
|
|
7133
|
+
t.addListener(mxEvent.DELETE_CELLS, (l, s) => {
|
|
7134
|
+
const r = s.properties.cells;
|
|
7139
7135
|
let m = [];
|
|
7140
7136
|
r && r.length > 0 && (r.forEach((p) => {
|
|
7141
7137
|
m.push(p.id);
|
|
@@ -7159,34 +7155,33 @@ const $e = {
|
|
|
7159
7155
|
l.centeredWindow && l.centeredWindow.forEach((m) => {
|
|
7160
7156
|
m && (m.setVisible(!1), m.destroy());
|
|
7161
7157
|
});
|
|
7162
|
-
let
|
|
7158
|
+
let s = [];
|
|
7163
7159
|
t.forEach((r, m) => {
|
|
7164
7160
|
var p = document.createElement("div");
|
|
7165
7161
|
if (r.type === "img") {
|
|
7166
7162
|
p.style.overflow = "auto", p.style.width = "100%", p.style.height = "100%", p.style.display = "flex", p.style.justifyContent = "center", p.style.alignItems = "center";
|
|
7167
|
-
var
|
|
7168
|
-
|
|
7163
|
+
var b = document.createElement("img");
|
|
7164
|
+
b.src = r.path, p.appendChild(b);
|
|
7169
7165
|
} else if (r.type === "time") {
|
|
7170
|
-
let { el:
|
|
7171
|
-
p.style.overflow = "auto", p.style.width = "100%", p.style.height = "100%", p.appendChild(
|
|
7166
|
+
let { el: T } = r.vnode;
|
|
7167
|
+
p.style.overflow = "auto", p.style.width = "100%", p.style.height = "100%", p.appendChild(T);
|
|
7172
7168
|
} else {
|
|
7173
7169
|
p.style.overflow = "auto", p.style.width = "100%", p.style.height = "100%", p.style.display = "flex", p.style.justifyContent = "center", p.style.alignItems = "center";
|
|
7174
7170
|
var x = r.pathHtml;
|
|
7175
7171
|
p.appendChild(x);
|
|
7176
7172
|
}
|
|
7177
|
-
let
|
|
7173
|
+
let v = 0, h = 0;
|
|
7178
7174
|
if (r.isCenter == "false")
|
|
7179
|
-
|
|
7175
|
+
v = r.left, h = r.top;
|
|
7180
7176
|
else {
|
|
7181
7177
|
var k = document.getElementById("app"), N = k.clientWidth, A = k.clientHeight;
|
|
7182
|
-
|
|
7178
|
+
v = (N - r.width) / 2, h = (A - r.height) / 2;
|
|
7183
7179
|
}
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
var U = new mxWindow(
|
|
7180
|
+
v < 0 && (v = 0), h < 0 && (h = 0);
|
|
7181
|
+
var z = document.createElement("div"), g = new mxWindow(
|
|
7187
7182
|
r.title,
|
|
7188
7183
|
p,
|
|
7189
|
-
|
|
7184
|
+
v,
|
|
7190
7185
|
h,
|
|
7191
7186
|
r.width,
|
|
7192
7187
|
r.height,
|
|
@@ -7194,31 +7189,29 @@ const $e = {
|
|
|
7194
7189
|
!0,
|
|
7195
7190
|
"mxWindowTitle"
|
|
7196
7191
|
);
|
|
7197
|
-
|
|
7198
|
-
l.isShowPup = !1,
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
}), U.div && C.length === 0 && (U.div.style.zIndex = 2e3 + m, z.className = "mx-window-mask", z.style.zIndex = 30 + m, document.body.appendChild(z), z.style.display = "block"), o.push(U);
|
|
7205
|
-
}), l.centeredWindow = o, l.wndAry = o;
|
|
7192
|
+
g.setClosable(!0), g.setMaximizable(!0), g.setScrollable(!0), g.setResizable(!0), g.setVisible(e), g.constrainWithinViewport = !0, g.addListener(mxEvent.CLOSE, function(T, D) {
|
|
7193
|
+
l.isShowPup = !1, document.body.removeChild(z), z.style.display = "none";
|
|
7194
|
+
}), g.addListener(mxEvent.MOVE, function(T, D) {
|
|
7195
|
+
var R = g.getX(), K = g.getY(), $ = g.getElement().offsetWidth, P = g.getElement().offsetHeight, Z = document.documentElement.clientWidth, te = document.documentElement.clientHeight, ie = 0, oe = 0, ce = Z - $, ye = te - P;
|
|
7196
|
+
R = Math.max(ie, Math.min(R, ce)), K = Math.max(oe, Math.min(K, ye)), g.setLocation(R, K);
|
|
7197
|
+
}), g.div && (g.div.style.zIndex = 2e3 + m, z.className = "mx-window-mask", z.style.zIndex = 30 + m, document.body.appendChild(z), z.style.display = "block"), s.push(g);
|
|
7198
|
+
}), l.centeredWindow = s, l.wndAry = s;
|
|
7206
7199
|
}
|
|
7207
7200
|
},
|
|
7208
7201
|
getWindowInfo() {
|
|
7209
7202
|
let t = this, e = t.wndAry;
|
|
7210
|
-
e && e.length > 0 && e.forEach((l,
|
|
7203
|
+
e && e.length > 0 && e.forEach((l, s) => {
|
|
7211
7204
|
if (l) {
|
|
7212
|
-
let r = t.pupAry[
|
|
7205
|
+
let r = t.pupAry[s];
|
|
7213
7206
|
r && t.openPupop([r], l.isVisible());
|
|
7214
7207
|
}
|
|
7215
7208
|
});
|
|
7216
7209
|
},
|
|
7217
7210
|
debounce(t, e = 200) {
|
|
7218
7211
|
let l = null;
|
|
7219
|
-
return function(...
|
|
7212
|
+
return function(...s) {
|
|
7220
7213
|
clearTimeout(l), l = setTimeout(() => {
|
|
7221
|
-
t.apply(this,
|
|
7214
|
+
t.apply(this, s);
|
|
7222
7215
|
}, e);
|
|
7223
7216
|
};
|
|
7224
7217
|
},
|
|
@@ -7250,8 +7243,8 @@ const $e = {
|
|
|
7250
7243
|
key: 0,
|
|
7251
7244
|
class: "transparentRect"
|
|
7252
7245
|
}, Ll = ["id"];
|
|
7253
|
-
function Pl(t, e, l,
|
|
7254
|
-
return
|
|
7246
|
+
function Pl(t, e, l, s, r, m) {
|
|
7247
|
+
return L(), I("div", {
|
|
7255
7248
|
class: J(["main-gd", { "show-scroll": l.isPreview }]),
|
|
7256
7249
|
ref: "mainGd"
|
|
7257
7250
|
}, [
|
|
@@ -7260,14 +7253,14 @@ function Pl(t, e, l, o, r, m) {
|
|
|
7260
7253
|
ref: "geEditor",
|
|
7261
7254
|
id: l.currentIndex
|
|
7262
7255
|
}, null, 10, Nl),
|
|
7263
|
-
l.isShow ? (
|
|
7264
|
-
(
|
|
7256
|
+
l.isShow ? (L(), I("div", Ul)) : _("", !0),
|
|
7257
|
+
(L(!0), I(ge, null, ve(r.timeLineMap, (p, b) => ut((L(), I("div", {
|
|
7265
7258
|
key: p.id + r.keys,
|
|
7266
7259
|
id: p.id,
|
|
7267
7260
|
style: j([{ position: "absolute" }, m.getStyle(p)]),
|
|
7268
7261
|
class: J(p.id)
|
|
7269
7262
|
}, [
|
|
7270
|
-
(
|
|
7263
|
+
(L(), me(Ve(m.dynamicComponent(p.compId)), {
|
|
7271
7264
|
id: p.other.timeId + "",
|
|
7272
7265
|
thisTab: p.other.thisTab
|
|
7273
7266
|
}, null, 8, ["id", "thisTab"]))
|
|
@@ -7333,8 +7326,8 @@ const jl = /* @__PURE__ */ ae(zl, [["render", Pl]]), Tl = {
|
|
|
7333
7326
|
let t = this;
|
|
7334
7327
|
this.updateRaf && cancelAnimationFrame(this.updateRaf), this.updateRaf = requestAnimationFrame(() => {
|
|
7335
7328
|
t.$nextTick(() => {
|
|
7336
|
-
var l = t.graph.getModel().cells,
|
|
7337
|
-
let r =
|
|
7329
|
+
var l = t.graph.getModel().cells, s = Object.values(l);
|
|
7330
|
+
let r = s.filter((m) => m.crtype == "schedule");
|
|
7338
7331
|
for (let m = 0; m < r.length; m++) {
|
|
7339
7332
|
let p = r[m];
|
|
7340
7333
|
t.graph.view.validateCell(p);
|
|
@@ -7346,7 +7339,7 @@ const jl = /* @__PURE__ */ ae(zl, [["render", Pl]]), Tl = {
|
|
|
7346
7339
|
async addTimeLine({ cellAry: t, scheduleCombination: e }) {
|
|
7347
7340
|
let l = this;
|
|
7348
7341
|
l.$nextTick(() => {
|
|
7349
|
-
let
|
|
7342
|
+
let s = {};
|
|
7350
7343
|
for (let r = 0; r < t.length; r++) {
|
|
7351
7344
|
let m = t[r], p = {
|
|
7352
7345
|
id: m.id,
|
|
@@ -7355,9 +7348,9 @@ const jl = /* @__PURE__ */ ae(zl, [["render", Pl]]), Tl = {
|
|
|
7355
7348
|
compId: m.id,
|
|
7356
7349
|
show: !0
|
|
7357
7350
|
};
|
|
7358
|
-
l.timeLineMap.push(p),
|
|
7351
|
+
l.timeLineMap.push(p), s[m.id] = e;
|
|
7359
7352
|
}
|
|
7360
|
-
l.compMap = Object.freeze(
|
|
7353
|
+
l.compMap = Object.freeze(s), this.$forceUpdate();
|
|
7361
7354
|
});
|
|
7362
7355
|
},
|
|
7363
7356
|
//删除键盘
|
|
@@ -7447,12 +7440,12 @@ const jl = /* @__PURE__ */ ae(zl, [["render", Pl]]), Tl = {
|
|
|
7447
7440
|
let t = this, e = t.$refs.geEditor;
|
|
7448
7441
|
const l = new je(t);
|
|
7449
7442
|
if (!t.graph) {
|
|
7450
|
-
let
|
|
7443
|
+
let s = await l.init({
|
|
7451
7444
|
container: e,
|
|
7452
7445
|
menus: t.menus,
|
|
7453
7446
|
pageShortcuts: t.pageShortcuts
|
|
7454
7447
|
});
|
|
7455
|
-
t.graph =
|
|
7448
|
+
t.graph = s, t.yhz = l, t.$emit("handelEvent", { key: "init", mygraph: s, yhz: l }), setTimeout(() => {
|
|
7456
7449
|
l.isPreview(!t.isPreview);
|
|
7457
7450
|
}, 0);
|
|
7458
7451
|
}
|
|
@@ -7472,7 +7465,7 @@ const jl = /* @__PURE__ */ ae(zl, [["render", Pl]]), Tl = {
|
|
|
7472
7465
|
window.centeredWindow && window.centeredWindow.forEach((m) => {
|
|
7473
7466
|
m && (m.setVisible(!1), m.destroy());
|
|
7474
7467
|
});
|
|
7475
|
-
let
|
|
7468
|
+
let s = [];
|
|
7476
7469
|
t.forEach((r) => {
|
|
7477
7470
|
var m = document.createElement("div");
|
|
7478
7471
|
if (r.type === "img") {
|
|
@@ -7484,34 +7477,34 @@ const jl = /* @__PURE__ */ ae(zl, [["render", Pl]]), Tl = {
|
|
|
7484
7477
|
m.style.overflow = "auto", m.style.width = "100%", m.style.height = "100%", m.appendChild(z);
|
|
7485
7478
|
} else {
|
|
7486
7479
|
m.style.overflow = "auto", m.style.width = "100%", m.style.height = "100%";
|
|
7487
|
-
var
|
|
7488
|
-
m.appendChild(
|
|
7480
|
+
var b = r.pathHtml;
|
|
7481
|
+
m.appendChild(b);
|
|
7489
7482
|
}
|
|
7490
|
-
let x = 0,
|
|
7483
|
+
let x = 0, v = 0;
|
|
7491
7484
|
if (r.isCenter == "false")
|
|
7492
|
-
x = r.left,
|
|
7485
|
+
x = r.left, v = r.top;
|
|
7493
7486
|
else {
|
|
7494
7487
|
var h = document.getElementById("app"), k = h.clientWidth, N = h.clientHeight;
|
|
7495
|
-
x = (k - r.width) / 2,
|
|
7488
|
+
x = (k - r.width) / 2, v = (N - r.height) / 2;
|
|
7496
7489
|
}
|
|
7497
7490
|
var A = new mxWindow(
|
|
7498
7491
|
r.title,
|
|
7499
7492
|
m,
|
|
7500
7493
|
x,
|
|
7501
|
-
|
|
7494
|
+
v,
|
|
7502
7495
|
r.width,
|
|
7503
7496
|
r.height,
|
|
7504
7497
|
!0,
|
|
7505
7498
|
!0,
|
|
7506
7499
|
"mxWindowTitle"
|
|
7507
7500
|
);
|
|
7508
|
-
A.setClosable(!0), A.setMaximizable(!1), A.setResizable(!0), A.setVisible(e), A.constrainWithinViewport = !0, A.addListener(mxEvent.CLOSE, function(z,
|
|
7501
|
+
A.setClosable(!0), A.setMaximizable(!1), A.setResizable(!0), A.setVisible(e), A.constrainWithinViewport = !0, A.addListener(mxEvent.CLOSE, function(z, g) {
|
|
7509
7502
|
l.isShowPup = !1;
|
|
7510
|
-
}), A.addListener(mxEvent.MOVE, function(z,
|
|
7511
|
-
var
|
|
7512
|
-
|
|
7513
|
-
}),
|
|
7514
|
-
}), window.centeredWindow =
|
|
7503
|
+
}), A.addListener(mxEvent.MOVE, function(z, g) {
|
|
7504
|
+
var T = A.getX(), D = A.getY(), R = A.getElement().offsetWidth, K = A.getElement().offsetHeight, $ = document.documentElement.clientWidth, P = document.documentElement.clientHeight, Z = 0, te = 0, ie = $ - R, oe = P - K;
|
|
7505
|
+
T = Math.max(Z, Math.min(T, ie)), D = Math.max(te, Math.min(D, oe)), A.setLocation(T, D);
|
|
7506
|
+
}), s.push(A);
|
|
7507
|
+
}), window.centeredWindow = s, l.wndAry = s;
|
|
7515
7508
|
}
|
|
7516
7509
|
}
|
|
7517
7510
|
// 监听
|
|
@@ -7522,7 +7515,7 @@ const jl = /* @__PURE__ */ ae(zl, [["render", Pl]]), Tl = {
|
|
|
7522
7515
|
t.init();
|
|
7523
7516
|
}), t.resizeObserver = new ResizeObserver((e) => {
|
|
7524
7517
|
e.forEach((l) => {
|
|
7525
|
-
const { width:
|
|
7518
|
+
const { width: s, height: r } = l.contentRect;
|
|
7526
7519
|
t.onResize(), t.openPupop(t.pupAry);
|
|
7527
7520
|
});
|
|
7528
7521
|
}), t.resizeObserver.observe(t.$refs.geEditor);
|
|
@@ -7540,21 +7533,21 @@ const jl = /* @__PURE__ */ ae(zl, [["render", Pl]]), Tl = {
|
|
|
7540
7533
|
key: 0,
|
|
7541
7534
|
class: "transparentRect"
|
|
7542
7535
|
}, Fl = ["id"];
|
|
7543
|
-
function Ol(t, e, l,
|
|
7544
|
-
return
|
|
7536
|
+
function Ol(t, e, l, s, r, m) {
|
|
7537
|
+
return L(), I("div", Il, [
|
|
7545
7538
|
le("div", {
|
|
7546
7539
|
class: "main-body",
|
|
7547
7540
|
ref: "geEditor",
|
|
7548
7541
|
id: l.currentIndex
|
|
7549
7542
|
}, [
|
|
7550
|
-
l.isShow ? (
|
|
7551
|
-
r.timeLineMap.length > 0 && l.isPreview ? (
|
|
7543
|
+
l.isShow ? (L(), I("div", Bl)) : _("", !0),
|
|
7544
|
+
r.timeLineMap.length > 0 && l.isPreview ? (L(!0), I(ge, { key: 1 }, ve(r.timeLineMap, (p, b) => (L(), I("div", {
|
|
7552
7545
|
key: p.id,
|
|
7553
7546
|
id: p.id,
|
|
7554
7547
|
class: J(p.id),
|
|
7555
7548
|
style: j([{ position: "absolute" }, { zIndex: 0 }])
|
|
7556
7549
|
}, [
|
|
7557
|
-
(
|
|
7550
|
+
(L(), me(Ve(m.dynamicComponent(p.compId)), {
|
|
7558
7551
|
id: p.other.timeId + "",
|
|
7559
7552
|
thisTab: p.other.thisTab
|
|
7560
7553
|
}, null, 8, ["id", "thisTab"]))
|