@gct-paas/core-web 0.1.6-dev.5 → 0.1.6-dev.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/ColorPicker-DGQQb8I7.js +1 -0
- package/dist/{_plugin-vue_export-helper-59SbqtUR.js → _plugin-vue_export-helper-C9hXqKoS.js} +1 -1
- package/dist/{de_DE-BnwOalCV.js → de_DE-B3f8kAv-.js} +1 -1
- package/dist/diagram-config-item-C5Ha2XJq.js +1 -0
- package/dist/diagram-config-item-reverse-ChoxnW-Z.js +1 -0
- package/dist/diagram-config-item-virtual-Cbmggfwt.js +1 -0
- package/dist/{en_US-6Hw6WWah.js → en_US-BSG3Kz6v.js} +1 -1
- package/dist/{es_ES-tAqXFGrR.js → es_ES-BGP8IOmQ.js} +1 -1
- package/dist/{fr_FR-BkDgVS_P.js → fr_FR-Y-6CzjUq.js} +1 -1
- package/dist/hooks-yX21uJ6d.js +1 -0
- package/dist/index.min.css +1 -1
- package/dist/{ja_JP-AsmV92nC.js → ja_JP-CDlH1v8M.js} +1 -1
- package/dist/loader.esm.min.js +1 -1
- package/dist/{monaco-editor-CgESUPw_.js → monaco-editor-BTqXEIZI.js} +1 -1
- package/dist/{pt_PT-CCVWOJzE.js → pt_PT-N-iIoE2_.js} +1 -1
- package/dist/relationship-diagram-config-DstwwXCO.js +1 -0
- package/dist/{ru_RU-w4sUgbzL.js → ru_RU--ESLRHrj.js} +1 -1
- package/dist/template-1ZQd8Z1w.js +1 -0
- package/dist/{tr_TR-CGZch3eB.js → tr_TR-BOIykdZO.js} +1 -1
- package/dist/{vi_VN-DONxIDR7.js → vi_VN-CmVoM2Rw.js} +1 -1
- package/dist/{zh_CN-BxdD8hqG.js → zh_CN-DhsO5Qwx.js} +1 -1
- package/dist/{zh_TW-D5Y8j-oG.js → zh_TW-DWdp2kVo.js} +1 -1
- package/es/components/UserPick/src/user-pick.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/es/components/base-button/base-button.vue.mjs +1 -1
- package/es/components/field-cascader/src/hooks.d.ts +1 -0
- package/es/components/label-design/modal/template.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/es/components/label-design/panels/modals/diff-modal.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/es/components/label-design/panels/panel.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/label-design/panels/widget/controls/ImageData.vue.mjs +2 -2
- package/es/components/label-design/panels/widget/controls/ImageData.vue_vue_type_script_setup_true_name_image-data_lang.mjs +2 -2
- package/es/components/label-design/panels/widget/controls/ImageData.vue_vue_type_style_index_0_scoped_9232a443_lang.css +3 -0
- package/es/components/label-design/stage/stage.vue.d.ts +9 -0
- package/es/components/label-design/stage/stage.vue.mjs +2 -2
- package/es/components/label-design/stage/stage.vue_vue_type_script_setup_true_lang.mjs +2 -1
- package/es/components/label-design/stage/{stage.vue_vue_type_style_index_0_scoped_53b1f897_lang.css → stage.vue_vue_type_style_index_0_scoped_9275e9fb_lang.css} +8 -8
- package/es/components/layout/view-container/view-container.d.ts +1 -11
- package/es/components/layout/view-container/view-container.mjs +10 -14
- package/es/create-app-vue.mjs +4 -2
- package/es/index.d.ts +3 -2
- package/es/index.mjs +25 -24
- package/es/modules/color-picker/src/color-editor.vue.mjs +1 -1
- package/es/modules/gct-form/controller/form-item-basic/form-item-basic.controller.mjs +2 -0
- package/es/modules/gct-form/controller/gct-form/gct-form.controller.mjs +1 -0
- package/es/modules/gct-table/controller/gct-table/gct-table.controller.mjs +1 -0
- package/es/modules/gct-table/controller/table-item/table-item.controller.mjs +2 -0
- package/es/modules/gct-table/controller/table-row/table-row.controller.mjs +3 -0
- package/es/modules/global-modal/src/components/ModalWrapper.vue_vue_type_script_lang.mjs +1 -4
- package/es/modules/print-tmpl/print-tmpl-modal.vue_vue_type_script_setup_true_name_print-tmpl-modal_lang.mjs +2 -2
- package/es/modules/relationship-diagram-config/cache.controller.d.ts +70 -0
- package/es/modules/relationship-diagram-config/cache.controller.mjs +128 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item/diagram-config-item.css +123 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item/diagram-config-item.d.ts +381 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item/diagram-config-item.mjs +98 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-container/diagram-config-item-container.css +71 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-container/diagram-config-item-container.d.ts +28 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-container/diagram-config-item-container.mjs +53 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-info/diagram-config-item-info.d.ts +27 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-info/diagram-config-item-info.mjs +2 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-reverse/diagram-config-item-reverse.css +107 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-reverse/diagram-config-item-reverse.d.ts +34 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-reverse/diagram-config-item-reverse.mjs +198 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-virtual/diagram-config-item-virtual.css +68 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-virtual/diagram-config-item-virtual.d.ts +31 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-virtual/diagram-config-item-virtual.mjs +53 -0
- package/es/modules/relationship-diagram-config/components/index.d.ts +5 -0
- package/es/modules/relationship-diagram-config/components/index.mjs +5 -0
- package/es/modules/relationship-diagram-config/constant/index.d.ts +72 -0
- package/es/modules/relationship-diagram-config/constant/index.mjs +70 -0
- package/es/modules/relationship-diagram-config/hooks/index.d.ts +10 -0
- package/es/modules/relationship-diagram-config/hooks/index.mjs +19 -0
- package/es/modules/relationship-diagram-config/index.d.ts +6 -0
- package/es/modules/relationship-diagram-config/index.mjs +28 -0
- package/es/modules/relationship-diagram-config/interface/i-link-provider/i-link-provider.d.ts +57 -0
- package/es/modules/relationship-diagram-config/interface/i-node-provider/i-node-provider.d.ts +18 -0
- package/es/modules/relationship-diagram-config/interface/i-relationship-diagram-link/i-relationship-diagram-link.d.ts +80 -0
- package/es/modules/relationship-diagram-config/interface/i-relationship-diagram-node/i-relationship-diagram-node.d.ts +82 -0
- package/es/modules/relationship-diagram-config/interface/i-relationship-diagram-options/i-relationship-diagram-options.d.ts +51 -0
- package/es/modules/relationship-diagram-config/interface/i-rule-config/i-rule-config.d.ts +135 -0
- package/es/modules/relationship-diagram-config/interface/index.d.ts +6 -0
- package/es/modules/relationship-diagram-config/link.controller.d.ts +75 -0
- package/es/modules/relationship-diagram-config/link.controller.mjs +121 -0
- package/es/modules/relationship-diagram-config/node.controller.d.ts +102 -0
- package/es/modules/relationship-diagram-config/node.controller.mjs +189 -0
- package/es/modules/relationship-diagram-config/plumb-plugin/arrow-endpoint.d.ts +23 -0
- package/es/modules/relationship-diagram-config/plumb-plugin/arrow-endpoint.mjs +33 -0
- package/es/modules/relationship-diagram-config/plumb-plugin/blank-endpoint-renderer.d.ts +1 -0
- package/es/modules/relationship-diagram-config/plumb-plugin/blank-endpoint-renderer.mjs +27 -0
- package/es/modules/relationship-diagram-config/plumb-plugin/index.d.ts +3 -0
- package/es/modules/relationship-diagram-config/plumb-plugin/index.mjs +2 -0
- package/es/modules/relationship-diagram-config/providers/default-link-provider/default-link-provider.css +132 -0
- package/es/modules/relationship-diagram-config/providers/default-link-provider/default-link-provider.d.ts +21 -0
- package/es/modules/relationship-diagram-config/providers/default-link-provider/default-link-provider.mjs +184 -0
- package/es/modules/relationship-diagram-config/providers/default-node-provider/default-node-provider.d.ts +14 -0
- package/es/modules/relationship-diagram-config/providers/default-node-provider/default-node-provider.mjs +17 -0
- package/es/modules/relationship-diagram-config/providers/index.d.ts +5 -0
- package/es/modules/relationship-diagram-config/providers/index.mjs +5 -0
- package/es/modules/relationship-diagram-config/providers/reverse-node-provider/reverse-node-provider.d.ts +14 -0
- package/es/modules/relationship-diagram-config/providers/reverse-node-provider/reverse-node-provider.mjs +17 -0
- package/es/modules/relationship-diagram-config/providers/virtual-link-provider/virtual-link-provider.d.ts +16 -0
- package/es/modules/relationship-diagram-config/providers/virtual-link-provider/virtual-link-provider.mjs +26 -0
- package/es/modules/relationship-diagram-config/providers/virtual-node-provider/virtual-node-provider.d.ts +14 -0
- package/es/modules/relationship-diagram-config/providers/virtual-node-provider/virtual-node-provider.mjs +17 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.controller.d.ts +119 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.controller.mjs +199 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.css +113 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.d.ts +102 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.mjs +104 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.state.d.ts +44 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.state.mjs +46 -0
- package/es/modules/relationship-diagram-config/utils/index.d.ts +1 -0
- package/es/modules/relationship-diagram-config/utils/register/register.d.ts +71 -0
- package/es/modules/relationship-diagram-config/utils/register/register.mjs +81 -0
- package/es/utils/recursive.mjs +1 -0
- package/package.json +10 -9
- package/dist/components-Dw_doMp_.js +0 -1
- package/dist/template-tzWsbHZE.js +0 -1
- package/es/components/label-design/panels/widget/controls/ImageData.vue_vue_type_style_index_0_scoped_3c4a9733_lang.css +0 -3
- /package/dist/{JsBarcode-DlXSdlvD.js → JsBarcode-DY53cVJ6.js} +0 -0
- /package/dist/{cropper-tw7tUDDe.js → cropper-DK_hFgpO.js} +0 -0
- /package/dist/{icon-next-picker-B_S_yInJ.js → icon-next-picker-DYiHqnNR.js} +0 -0
- /package/dist/{objectSpread2-DxfE1S3_.js → objectSpread2-DARadIQB.js} +0 -0
- /package/dist/{overlayscrollbars-vue-DtKFrHnA.js → overlayscrollbars-vue-Df-3wShc.js} +0 -0
- /package/dist/{rich-editor-K2Pv0Uja.js → rich-editor-DVOriJH0.js} +0 -0
- /package/dist/{useMonacoEditor-BO2ALW-7.js → useMonacoEditor-DqSQTg7b.js} +0 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { ArrowEndpoint } from "../../plumb-plugin/arrow-endpoint.mjs";
|
|
2
|
+
import "../../plumb-plugin/index.mjs";
|
|
3
|
+
import { ConnectionDirection, LinkType, NodeType } from "../../constant/index.mjs";
|
|
4
|
+
import "../../relationship-diagram-config.controller.mjs";
|
|
5
|
+
import './default-link-provider.css';/* empty css */
|
|
6
|
+
import { t, useNamespace } from "@gct-paas/core";
|
|
7
|
+
import { Modal as Modal$1 } from "ant-design-vue";
|
|
8
|
+
import { DotEndpoint, FlowchartConnector } from "@jsplumb/browser-ui";
|
|
9
|
+
//#region src/modules/relationship-diagram-config/providers/default-link-provider/default-link-provider.ts
|
|
10
|
+
/**
|
|
11
|
+
* 默认连线适配器
|
|
12
|
+
*
|
|
13
|
+
* @author zhanghanrui
|
|
14
|
+
* @date 2024-06-25 19:06:34
|
|
15
|
+
* @export
|
|
16
|
+
* @class DefaultLinkProvider
|
|
17
|
+
* @implements {ILinkProvider}
|
|
18
|
+
*/
|
|
19
|
+
var DefaultLinkProvider = class {
|
|
20
|
+
type = LinkType.DEFAULT;
|
|
21
|
+
ns = useNamespace("diagram-config-default-link");
|
|
22
|
+
sourceHandle = "handle-select";
|
|
23
|
+
deleteMessage = "sys.pageDesigner.dataLinkage.confirm.title";
|
|
24
|
+
reverse(c, link) {
|
|
25
|
+
let data = null;
|
|
26
|
+
if (link.reverse) data = c.node.get(link.target, 0, true);
|
|
27
|
+
else data = c.node.get(link.source, 0, true);
|
|
28
|
+
if (data) {
|
|
29
|
+
if (link.reverse !== true) c.node.cache.reverseClear(data, ConnectionDirection.FORWARD);
|
|
30
|
+
else c.node.cache.reverseClear(data, ConnectionDirection.REVERSE);
|
|
31
|
+
c.node.update(Object.assign(data, {
|
|
32
|
+
value: null,
|
|
33
|
+
label: null,
|
|
34
|
+
noSelectField: link.reverse === true ? false : true
|
|
35
|
+
}));
|
|
36
|
+
if (!link.reverse) {
|
|
37
|
+
if (c.node.cache.reverseReset(data, ConnectionDirection.REVERSE)) return;
|
|
38
|
+
} else if (c.node.cache.reverseReset(data, ConnectionDirection.FORWARD)) return;
|
|
39
|
+
if (!link.reverse) c.node.create({
|
|
40
|
+
type: NodeType.REVERSE,
|
|
41
|
+
reverse: true
|
|
42
|
+
}, {
|
|
43
|
+
type: LinkType.VIRTUAL,
|
|
44
|
+
reverse: true,
|
|
45
|
+
dashed: true
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
options(c, link) {
|
|
50
|
+
let anchors = link.reverse ? ["Left", [
|
|
51
|
+
1,
|
|
52
|
+
.5,
|
|
53
|
+
0,
|
|
54
|
+
0,
|
|
55
|
+
0,
|
|
56
|
+
14
|
|
57
|
+
]] : ["Right", [
|
|
58
|
+
0,
|
|
59
|
+
.5,
|
|
60
|
+
0,
|
|
61
|
+
0,
|
|
62
|
+
0,
|
|
63
|
+
14
|
|
64
|
+
]];
|
|
65
|
+
if (link.return) anchors = link.startLine % 2 === 1 ? ["Right", "Right"] : ["Left", "Left"];
|
|
66
|
+
else if (link.startLine % 2 === 0) anchors = link.reverse ? ["Right", [
|
|
67
|
+
0,
|
|
68
|
+
.5,
|
|
69
|
+
0,
|
|
70
|
+
0,
|
|
71
|
+
0,
|
|
72
|
+
14
|
|
73
|
+
]] : ["Left", [
|
|
74
|
+
1,
|
|
75
|
+
.5,
|
|
76
|
+
0,
|
|
77
|
+
0,
|
|
78
|
+
0,
|
|
79
|
+
14
|
|
80
|
+
]];
|
|
81
|
+
let direction = "right";
|
|
82
|
+
if (link.startLine % 2 === 1) direction = link.return || link.reverse ? "left" : "right";
|
|
83
|
+
else direction = link.return || link.reverse ? "right" : "left";
|
|
84
|
+
return {
|
|
85
|
+
hoverClass: this.ns.e("line-hover"),
|
|
86
|
+
paintStyle: {
|
|
87
|
+
strokeWidth: 1,
|
|
88
|
+
stroke: "#3168EC",
|
|
89
|
+
dashstyle: "0"
|
|
90
|
+
},
|
|
91
|
+
endpointStyle: { fill: "#3168EC" },
|
|
92
|
+
anchors,
|
|
93
|
+
connector: {
|
|
94
|
+
type: FlowchartConnector.type,
|
|
95
|
+
options: {
|
|
96
|
+
stub: [0, 25],
|
|
97
|
+
cornerRadius: 10
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
endpoints: [{
|
|
101
|
+
type: DotEndpoint.type,
|
|
102
|
+
options: { radius: 3 }
|
|
103
|
+
}, {
|
|
104
|
+
type: ArrowEndpoint.type,
|
|
105
|
+
options: { direction }
|
|
106
|
+
}],
|
|
107
|
+
overlays: [{
|
|
108
|
+
type: "Custom",
|
|
109
|
+
options: {
|
|
110
|
+
id: "change",
|
|
111
|
+
location: .5,
|
|
112
|
+
create: () => {
|
|
113
|
+
const div = document.createElement("div");
|
|
114
|
+
div.classList.add(this.ns.b("custom-overlay-line"));
|
|
115
|
+
if (link.return === true) div.classList.add(this.ns.be("custom-overlay-line", "special-line"));
|
|
116
|
+
else div.classList.add(this.ns.be("custom-overlay-line", "not-special-line"));
|
|
117
|
+
return div;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
121
|
+
type: "Custom",
|
|
122
|
+
options: {
|
|
123
|
+
id: "delete",
|
|
124
|
+
location: .5,
|
|
125
|
+
create: () => {
|
|
126
|
+
const div = document.createElement("div");
|
|
127
|
+
div.classList.add(this.ns.b("custom-overlay"));
|
|
128
|
+
if (link.return === true) div.classList.add(this.ns.be("custom-overlay", "special-line"));
|
|
129
|
+
else div.classList.add(this.ns.be("custom-overlay", "not-special-line"));
|
|
130
|
+
if (link.type !== LinkType.VIRTUAL || link.reverse === true) {
|
|
131
|
+
const iEl = document.createElement("i");
|
|
132
|
+
iEl.className = "iconfont icon-caiqie1 delete-action";
|
|
133
|
+
iEl.onclick = (e) => {
|
|
134
|
+
e.stopPropagation();
|
|
135
|
+
Modal$1.confirm({
|
|
136
|
+
title: t(this.deleteMessage),
|
|
137
|
+
content: t("sys.pageDesigner.dataLinkage.confirm.content"),
|
|
138
|
+
onOk: () => {
|
|
139
|
+
if (link.reverse !== true) {
|
|
140
|
+
const sourceNode = c.node.get(link.source, 0, true);
|
|
141
|
+
if (sourceNode) {
|
|
142
|
+
c.node.cache.clear(sourceNode);
|
|
143
|
+
c.node.update(Object.assign(sourceNode, {
|
|
144
|
+
value: null,
|
|
145
|
+
label: null
|
|
146
|
+
}));
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
const targetNode = c.node.get(link.target, 0, true);
|
|
150
|
+
if (targetNode) {
|
|
151
|
+
c.node.cache.reverseClear(targetNode);
|
|
152
|
+
c.node.update(Object.assign(targetNode, {
|
|
153
|
+
value: null,
|
|
154
|
+
label: null,
|
|
155
|
+
noSelectField: false
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
div.appendChild(iEl);
|
|
163
|
+
}
|
|
164
|
+
if (c.config.oneDirection === true && link.i === 0 || c.config.oneDirection === false && (c.config.reverseCount == null || link.i >= c.config.reverseCount)) {
|
|
165
|
+
const iEl2 = document.createElement("i");
|
|
166
|
+
iEl2.className = "iconfont icon-qiehuan1 reverse-action";
|
|
167
|
+
iEl2.onclick = (e) => {
|
|
168
|
+
e.stopPropagation();
|
|
169
|
+
this.reverse(c, link);
|
|
170
|
+
};
|
|
171
|
+
div.appendChild(iEl2);
|
|
172
|
+
}
|
|
173
|
+
return div;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}]
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
click(c, link) {
|
|
180
|
+
if (c.config.oneDirection === true && link.i === 0 || c.config.oneDirection === false && (c.config.reverseCount == null || link.i >= c.config.reverseCount)) this.reverse(c, link);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
//#endregion
|
|
184
|
+
export { DefaultLinkProvider };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { INodeProvider } from '../../interface';
|
|
2
|
+
/**
|
|
3
|
+
* 默认节点
|
|
4
|
+
*
|
|
5
|
+
* @author zhanghanrui
|
|
6
|
+
* @date 2024-06-25 20:06:31
|
|
7
|
+
* @export
|
|
8
|
+
* @class DefaultNodeProvider
|
|
9
|
+
* @implements {INodeProvider}
|
|
10
|
+
*/
|
|
11
|
+
export declare class DefaultNodeProvider implements INodeProvider {
|
|
12
|
+
type: string;
|
|
13
|
+
component: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NodeType } from "../../constant/index.mjs";
|
|
2
|
+
//#region src/modules/relationship-diagram-config/providers/default-node-provider/default-node-provider.ts
|
|
3
|
+
/**
|
|
4
|
+
* 默认节点
|
|
5
|
+
*
|
|
6
|
+
* @author zhanghanrui
|
|
7
|
+
* @date 2024-06-25 20:06:31
|
|
8
|
+
* @export
|
|
9
|
+
* @class DefaultNodeProvider
|
|
10
|
+
* @implements {INodeProvider}
|
|
11
|
+
*/
|
|
12
|
+
var DefaultNodeProvider = class {
|
|
13
|
+
type = NodeType.DEFAULT;
|
|
14
|
+
component = "DiagramConfigItem";
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DefaultNodeProvider };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DefaultLinkProvider } from './default-link-provider/default-link-provider';
|
|
2
|
+
export { DefaultNodeProvider } from './default-node-provider/default-node-provider';
|
|
3
|
+
export { ReverseNodeProvider } from './reverse-node-provider/reverse-node-provider';
|
|
4
|
+
export { VirtualLinkProvider } from './virtual-link-provider/virtual-link-provider';
|
|
5
|
+
export { VirtualNodeProvider } from './virtual-node-provider/virtual-node-provider';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "./default-link-provider/default-link-provider.mjs";
|
|
2
|
+
import "./default-node-provider/default-node-provider.mjs";
|
|
3
|
+
import "./reverse-node-provider/reverse-node-provider.mjs";
|
|
4
|
+
import "./virtual-link-provider/virtual-link-provider.mjs";
|
|
5
|
+
import "./virtual-node-provider/virtual-node-provider.mjs";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { INodeProvider } from '../../interface';
|
|
2
|
+
/**
|
|
3
|
+
* 最后的虚拟节点
|
|
4
|
+
*
|
|
5
|
+
* @author zhanghanrui
|
|
6
|
+
* @date 2024-06-25 20:06:31
|
|
7
|
+
* @export
|
|
8
|
+
* @class ReverseNodeProvider
|
|
9
|
+
* @implements {INodeProvider}
|
|
10
|
+
*/
|
|
11
|
+
export declare class ReverseNodeProvider implements INodeProvider {
|
|
12
|
+
type: string;
|
|
13
|
+
component: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NodeType } from "../../constant/index.mjs";
|
|
2
|
+
//#region src/modules/relationship-diagram-config/providers/reverse-node-provider/reverse-node-provider.ts
|
|
3
|
+
/**
|
|
4
|
+
* 最后的虚拟节点
|
|
5
|
+
*
|
|
6
|
+
* @author zhanghanrui
|
|
7
|
+
* @date 2024-06-25 20:06:31
|
|
8
|
+
* @export
|
|
9
|
+
* @class ReverseNodeProvider
|
|
10
|
+
* @implements {INodeProvider}
|
|
11
|
+
*/
|
|
12
|
+
var ReverseNodeProvider = class {
|
|
13
|
+
type = NodeType.REVERSE;
|
|
14
|
+
component = "DiagramConfigItemReverse";
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { ReverseNodeProvider };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ConnectParams } from '@jsplumb/browser-ui';
|
|
2
|
+
import { IRelationshipDiagramLink } from '../../interface';
|
|
3
|
+
import { RelationshipDiagramConfigController } from '../../relationship-diagram-config.controller';
|
|
4
|
+
import { DefaultLinkProvider } from '../default-link-provider/default-link-provider';
|
|
5
|
+
/**
|
|
6
|
+
* 虚拟连线
|
|
7
|
+
*
|
|
8
|
+
* @author zhanghanrui
|
|
9
|
+
* @date 2024-06-27 16:06:04
|
|
10
|
+
* @export
|
|
11
|
+
* @class VirtualLinkProvider
|
|
12
|
+
* @extends {DefaultLinkProvider}
|
|
13
|
+
*/
|
|
14
|
+
export declare class VirtualLinkProvider extends DefaultLinkProvider {
|
|
15
|
+
options(c: RelationshipDiagramConfigController, link: IRelationshipDiagramLink): ConnectParams<Element>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "../../relationship-diagram-config.controller.mjs";
|
|
2
|
+
import { DefaultLinkProvider } from "../default-link-provider/default-link-provider.mjs";
|
|
3
|
+
//#region src/modules/relationship-diagram-config/providers/virtual-link-provider/virtual-link-provider.ts
|
|
4
|
+
/**
|
|
5
|
+
* 虚拟连线
|
|
6
|
+
*
|
|
7
|
+
* @author zhanghanrui
|
|
8
|
+
* @date 2024-06-27 16:06:04
|
|
9
|
+
* @export
|
|
10
|
+
* @class VirtualLinkProvider
|
|
11
|
+
* @extends {DefaultLinkProvider}
|
|
12
|
+
*/
|
|
13
|
+
var VirtualLinkProvider = class extends DefaultLinkProvider {
|
|
14
|
+
options(c, link) {
|
|
15
|
+
const opts = super.options(c, link);
|
|
16
|
+
opts.paintStyle = {
|
|
17
|
+
strokeWidth: 1,
|
|
18
|
+
stroke: "#C3C3C3",
|
|
19
|
+
dashstyle: "4 4"
|
|
20
|
+
};
|
|
21
|
+
opts.endpointStyle = { fill: "#C3C3C3" };
|
|
22
|
+
return opts;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { VirtualLinkProvider };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { INodeProvider } from '../../interface';
|
|
2
|
+
/**
|
|
3
|
+
* 最后的虚拟节点
|
|
4
|
+
*
|
|
5
|
+
* @author zhanghanrui
|
|
6
|
+
* @date 2024-06-25 20:06:31
|
|
7
|
+
* @export
|
|
8
|
+
* @class VirtualNodeProvider
|
|
9
|
+
* @implements {INodeProvider}
|
|
10
|
+
*/
|
|
11
|
+
export declare class VirtualNodeProvider implements INodeProvider {
|
|
12
|
+
type: string;
|
|
13
|
+
component: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NodeType } from "../../constant/index.mjs";
|
|
2
|
+
//#region src/modules/relationship-diagram-config/providers/virtual-node-provider/virtual-node-provider.ts
|
|
3
|
+
/**
|
|
4
|
+
* 最后的虚拟节点
|
|
5
|
+
*
|
|
6
|
+
* @author zhanghanrui
|
|
7
|
+
* @date 2024-06-25 20:06:31
|
|
8
|
+
* @export
|
|
9
|
+
* @class VirtualNodeProvider
|
|
10
|
+
* @implements {INodeProvider}
|
|
11
|
+
*/
|
|
12
|
+
var VirtualNodeProvider = class {
|
|
13
|
+
type = NodeType.VIRTUAL;
|
|
14
|
+
component = "DiagramConfigItemVirtual";
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { VirtualNodeProvider };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { BrowserJsPlumbInstance } from '@jsplumb/browser-ui';
|
|
2
|
+
import { RelationshipDiagramConfigState } from './relationship-diagram-config.state';
|
|
3
|
+
import { NodeController } from './node.controller';
|
|
4
|
+
import { LinkController } from './link.controller';
|
|
5
|
+
import { IRelationshipDiagramLink, IRelationshipDiagramOptions } from './interface';
|
|
6
|
+
import { ModelMetaDTO } from '@gct-paas/api/apaas';
|
|
7
|
+
/**
|
|
8
|
+
* 图形内控制器
|
|
9
|
+
*
|
|
10
|
+
* @author zhanghanrui
|
|
11
|
+
* @date 2024-06-25 09:06:30
|
|
12
|
+
* @export
|
|
13
|
+
* @class RelationshipDiagramConfigController
|
|
14
|
+
*/
|
|
15
|
+
export declare class RelationshipDiagramConfigController {
|
|
16
|
+
/**
|
|
17
|
+
* 组件绘制完成后设置
|
|
18
|
+
*
|
|
19
|
+
* @author zhanghanrui
|
|
20
|
+
* @date 2024-06-25 15:06:08
|
|
21
|
+
* @type {HTMLDivElement}
|
|
22
|
+
*/
|
|
23
|
+
container: HTMLDivElement;
|
|
24
|
+
/**
|
|
25
|
+
* 界面状态
|
|
26
|
+
*
|
|
27
|
+
* @author zhanghanrui
|
|
28
|
+
* @date 2024-06-25 09:06:41
|
|
29
|
+
* @type {RelationshipDiagramConfigState}
|
|
30
|
+
*/
|
|
31
|
+
state: RelationshipDiagramConfigState;
|
|
32
|
+
/**
|
|
33
|
+
* 画线工具实例
|
|
34
|
+
*
|
|
35
|
+
* @author zhanghanrui
|
|
36
|
+
* @date 2024-06-25 14:06:11
|
|
37
|
+
* @type {BrowserJsPlumbInstance}
|
|
38
|
+
*/
|
|
39
|
+
plumb: BrowserJsPlumbInstance;
|
|
40
|
+
readonly node: NodeController;
|
|
41
|
+
readonly link: LinkController;
|
|
42
|
+
/**
|
|
43
|
+
* 组件配置
|
|
44
|
+
*
|
|
45
|
+
* @author zhanghanrui
|
|
46
|
+
* @date 2024-06-28 15:06:35
|
|
47
|
+
* @type {IRelationshipDiagramOptions}
|
|
48
|
+
*/
|
|
49
|
+
readonly config: IRelationshipDiagramOptions;
|
|
50
|
+
/**
|
|
51
|
+
* 临时窗口内加载的模型缓存
|
|
52
|
+
*
|
|
53
|
+
* @author zhanghanrui
|
|
54
|
+
* @date 2024-06-28 10:06:43
|
|
55
|
+
* @protected
|
|
56
|
+
* @type {IData}
|
|
57
|
+
*/
|
|
58
|
+
protected modelMap: IData;
|
|
59
|
+
/**
|
|
60
|
+
* 临时窗口内加载的引用模型清单缓存
|
|
61
|
+
*
|
|
62
|
+
* @author zhanghanrui
|
|
63
|
+
* @date 2024-06-28 10:06:55
|
|
64
|
+
* @protected
|
|
65
|
+
* @type {IData}
|
|
66
|
+
*/
|
|
67
|
+
protected modelListMap: IData;
|
|
68
|
+
/**
|
|
69
|
+
* 初始化画线工具
|
|
70
|
+
*
|
|
71
|
+
* @author zhanghanrui
|
|
72
|
+
* @date 2024-06-25 14:06:25
|
|
73
|
+
* @param {HTMLDivElement} el
|
|
74
|
+
*/
|
|
75
|
+
initPlumb(el: HTMLDivElement): void;
|
|
76
|
+
connectAll(): void;
|
|
77
|
+
connect(link: IRelationshipDiagramLink): void;
|
|
78
|
+
/**
|
|
79
|
+
* 断开连线
|
|
80
|
+
*
|
|
81
|
+
* @author zhanghanrui
|
|
82
|
+
* @date 2024-06-27 17:06:43
|
|
83
|
+
* @param {IRelationshipDiagramLink} link
|
|
84
|
+
*/
|
|
85
|
+
disconnect(link: IRelationshipDiagramLink): void;
|
|
86
|
+
/**
|
|
87
|
+
* 重绘连线
|
|
88
|
+
*
|
|
89
|
+
* @author zhanghanrui
|
|
90
|
+
* @date 2024-06-26 17:06:31
|
|
91
|
+
*/
|
|
92
|
+
redraw(count?: number): void;
|
|
93
|
+
/**
|
|
94
|
+
* 根据标识查询具体模型,并携带属性
|
|
95
|
+
*
|
|
96
|
+
* @author zhanghanrui
|
|
97
|
+
* @date 2024-06-26 13:06:55
|
|
98
|
+
* @param {string} modelKey
|
|
99
|
+
* @return {*} {Promise<ModelMetaDTO>}
|
|
100
|
+
*/
|
|
101
|
+
getModel(modelKey: string): Promise<ModelMetaDTO>;
|
|
102
|
+
/**
|
|
103
|
+
* 获取引用了指定模型的模型列表
|
|
104
|
+
*
|
|
105
|
+
* @author zhanghanrui
|
|
106
|
+
* @date 2024-06-29 18:06:47
|
|
107
|
+
* @param {string} modelKey
|
|
108
|
+
* @param {string} [fieldKey='']
|
|
109
|
+
* @return {*} {Promise<ModelMetaDTO[]>}
|
|
110
|
+
*/
|
|
111
|
+
getModelList(modelKey: string, fieldKey?: string): Promise<ModelMetaDTO[]>;
|
|
112
|
+
/**
|
|
113
|
+
* 清空所有
|
|
114
|
+
*
|
|
115
|
+
* @author zhanghanrui
|
|
116
|
+
* @date 2024-06-29 17:06:11
|
|
117
|
+
*/
|
|
118
|
+
clearAll(): void;
|
|
119
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { RelationshipDiagramConfigState } from "./relationship-diagram-config.state.mjs";
|
|
2
|
+
import { NodeController } from "./node.controller.mjs";
|
|
3
|
+
import { LinkController } from "./link.controller.mjs";
|
|
4
|
+
import { RegisterUtil } from "./utils/register/register.mjs";
|
|
5
|
+
import { EVENT_CONNECTION_CLICK, newInstance } from "@jsplumb/browser-ui";
|
|
6
|
+
//#region src/modules/relationship-diagram-config/relationship-diagram-config.controller.ts
|
|
7
|
+
/**
|
|
8
|
+
* 图形内控制器
|
|
9
|
+
*
|
|
10
|
+
* @author zhanghanrui
|
|
11
|
+
* @date 2024-06-25 09:06:30
|
|
12
|
+
* @export
|
|
13
|
+
* @class RelationshipDiagramConfigController
|
|
14
|
+
*/
|
|
15
|
+
var RelationshipDiagramConfigController = class {
|
|
16
|
+
/**
|
|
17
|
+
* 组件绘制完成后设置
|
|
18
|
+
*
|
|
19
|
+
* @author zhanghanrui
|
|
20
|
+
* @date 2024-06-25 15:06:08
|
|
21
|
+
* @type {HTMLDivElement}
|
|
22
|
+
*/
|
|
23
|
+
container;
|
|
24
|
+
/**
|
|
25
|
+
* 界面状态
|
|
26
|
+
*
|
|
27
|
+
* @author zhanghanrui
|
|
28
|
+
* @date 2024-06-25 09:06:41
|
|
29
|
+
* @type {RelationshipDiagramConfigState}
|
|
30
|
+
*/
|
|
31
|
+
state = new RelationshipDiagramConfigState();
|
|
32
|
+
/**
|
|
33
|
+
* 画线工具实例
|
|
34
|
+
*
|
|
35
|
+
* @author zhanghanrui
|
|
36
|
+
* @date 2024-06-25 14:06:11
|
|
37
|
+
* @type {BrowserJsPlumbInstance}
|
|
38
|
+
*/
|
|
39
|
+
plumb;
|
|
40
|
+
node = new NodeController(this);
|
|
41
|
+
link = new LinkController(this);
|
|
42
|
+
/**
|
|
43
|
+
* 组件配置
|
|
44
|
+
*
|
|
45
|
+
* @author zhanghanrui
|
|
46
|
+
* @date 2024-06-28 15:06:35
|
|
47
|
+
* @type {IRelationshipDiagramOptions}
|
|
48
|
+
*/
|
|
49
|
+
config = {
|
|
50
|
+
lineCount: 3,
|
|
51
|
+
oneDirection: true
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* 临时窗口内加载的模型缓存
|
|
55
|
+
*
|
|
56
|
+
* @author zhanghanrui
|
|
57
|
+
* @date 2024-06-28 10:06:43
|
|
58
|
+
* @protected
|
|
59
|
+
* @type {IData}
|
|
60
|
+
*/
|
|
61
|
+
modelMap = {};
|
|
62
|
+
/**
|
|
63
|
+
* 临时窗口内加载的引用模型清单缓存
|
|
64
|
+
*
|
|
65
|
+
* @author zhanghanrui
|
|
66
|
+
* @date 2024-06-28 10:06:55
|
|
67
|
+
* @protected
|
|
68
|
+
* @type {IData}
|
|
69
|
+
*/
|
|
70
|
+
modelListMap = {};
|
|
71
|
+
/**
|
|
72
|
+
* 初始化画线工具
|
|
73
|
+
*
|
|
74
|
+
* @author zhanghanrui
|
|
75
|
+
* @date 2024-06-25 14:06:25
|
|
76
|
+
* @param {HTMLDivElement} el
|
|
77
|
+
*/
|
|
78
|
+
initPlumb(el) {
|
|
79
|
+
this.container = el;
|
|
80
|
+
this.plumb = newInstance({
|
|
81
|
+
container: el,
|
|
82
|
+
connectionsDetachable: false,
|
|
83
|
+
elementsDraggable: false
|
|
84
|
+
});
|
|
85
|
+
this.plumb.bind(EVENT_CONNECTION_CLICK, (conn) => {
|
|
86
|
+
if (conn) {
|
|
87
|
+
const data = conn.data;
|
|
88
|
+
const p = RegisterUtil.getLink(data.type);
|
|
89
|
+
if (p && p.click) p.click(this, data);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
connectAll() {
|
|
94
|
+
this.plumb.deleteEveryConnection();
|
|
95
|
+
this.state.links.forEach((link) => {
|
|
96
|
+
this.connect(link);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
connect(link) {
|
|
100
|
+
const linkProvider = RegisterUtil.getLink(link.type);
|
|
101
|
+
if (!linkProvider) {
|
|
102
|
+
console.error(`未找到连线适配器类型:[${link.type}]`);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const items = Array.from(this.container.children);
|
|
106
|
+
let source = items.find((el) => el.id === link.source);
|
|
107
|
+
let target = items.find((el) => el.id === link.target);
|
|
108
|
+
if (!source || !target) {
|
|
109
|
+
console.error(`未找到连线源或目标节点:[${link.source}]、[${link.target}]`);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (linkProvider.sourceHandle) source = source.getElementsByClassName(linkProvider.sourceHandle)[0];
|
|
113
|
+
if (linkProvider.targetHandle) target = target.getElementsByClassName(linkProvider.targetHandle)[0];
|
|
114
|
+
const _opts = linkProvider.options(this, link);
|
|
115
|
+
const opts = {
|
|
116
|
+
data: link,
|
|
117
|
+
source,
|
|
118
|
+
target,
|
|
119
|
+
..._opts
|
|
120
|
+
};
|
|
121
|
+
this.plumb.connect(opts);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 断开连线
|
|
125
|
+
*
|
|
126
|
+
* @author zhanghanrui
|
|
127
|
+
* @date 2024-06-27 17:06:43
|
|
128
|
+
* @param {IRelationshipDiagramLink} link
|
|
129
|
+
*/
|
|
130
|
+
disconnect(link) {
|
|
131
|
+
const connection = this.plumb.getConnections().find((c) => c.data.id === link.id);
|
|
132
|
+
if (connection) this.plumb.deleteConnection(connection);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 重绘连线
|
|
136
|
+
*
|
|
137
|
+
* @author zhanghanrui
|
|
138
|
+
* @date 2024-06-26 17:06:31
|
|
139
|
+
*/
|
|
140
|
+
redraw(count = 0) {
|
|
141
|
+
if (count > 10) {
|
|
142
|
+
console.error("重绘失败");
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
setTimeout(() => {
|
|
146
|
+
if (this.state.nodes.length === this.state.nodeCount) this.connectAll();
|
|
147
|
+
else this.redraw(count);
|
|
148
|
+
}, 100);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* 根据标识查询具体模型,并携带属性
|
|
152
|
+
*
|
|
153
|
+
* @author zhanghanrui
|
|
154
|
+
* @date 2024-06-26 13:06:55
|
|
155
|
+
* @param {string} modelKey
|
|
156
|
+
* @return {*} {Promise<ModelMetaDTO>}
|
|
157
|
+
*/
|
|
158
|
+
async getModel(modelKey) {
|
|
159
|
+
if (this.modelMap[modelKey]) return this.modelMap[modelKey];
|
|
160
|
+
const data = await _api.apaas.modelMeta.getDetail({ modelKey });
|
|
161
|
+
if (data) {
|
|
162
|
+
this.modelMap[modelKey] = data;
|
|
163
|
+
return data;
|
|
164
|
+
}
|
|
165
|
+
return Promise.reject(/* @__PURE__ */ new Error(`${modelKey} model not found`));
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* 获取引用了指定模型的模型列表
|
|
169
|
+
*
|
|
170
|
+
* @author zhanghanrui
|
|
171
|
+
* @date 2024-06-29 18:06:47
|
|
172
|
+
* @param {string} modelKey
|
|
173
|
+
* @param {string} [fieldKey='']
|
|
174
|
+
* @return {*} {Promise<ModelMetaDTO[]>}
|
|
175
|
+
*/
|
|
176
|
+
async getModelList(modelKey, fieldKey = "") {
|
|
177
|
+
const tag = `${modelKey}:${fieldKey}`;
|
|
178
|
+
if (this.modelListMap[tag]) return this.modelListMap[tag];
|
|
179
|
+
const data = await _api.apaas.modelMeta.getListModelReferencedBy({ modelKey });
|
|
180
|
+
if (data) {
|
|
181
|
+
this.modelListMap[tag] = data;
|
|
182
|
+
return data;
|
|
183
|
+
}
|
|
184
|
+
return Promise.reject(/* @__PURE__ */ new Error(`${tag} model list not found`));
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* 清空所有
|
|
188
|
+
*
|
|
189
|
+
* @author zhanghanrui
|
|
190
|
+
* @date 2024-06-29 17:06:11
|
|
191
|
+
*/
|
|
192
|
+
clearAll() {
|
|
193
|
+
this.state.links = [];
|
|
194
|
+
this.state.nodes = [];
|
|
195
|
+
if (this.plumb) this.plumb.deleteEveryConnection();
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
//#endregion
|
|
199
|
+
export { RelationshipDiagramConfigController };
|