@duxweb/dvha-pro 1.0.44 → 1.0.46
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/cjs/component.cjs +1 -1
- package/dist/cjs/components/chart/echart.cjs +1 -1
- package/dist/cjs/components/crop/imageCrop.cjs +1 -1
- package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
- package/dist/cjs/components/data/selectModal.cjs +1 -1
- package/dist/cjs/components/designEditor/components/grid.cjs +1 -1
- package/dist/cjs/components/designEditor/editor/setting.cjs +1 -1
- package/dist/cjs/components/flowEditor/components/jsonEditor.cjs +1 -0
- package/dist/cjs/components/flowEditor/components/nodeCard.cjs +1 -0
- package/dist/cjs/components/flowEditor/components/setting.cjs +1 -0
- package/dist/cjs/components/flowEditor/components/toolbar.cjs +1 -0
- package/dist/cjs/components/flowEditor/flowEditor.cjs +1 -0
- package/dist/cjs/components/flowEditor/nodes/endNode.cjs +1 -0
- package/dist/cjs/components/flowEditor/nodes/index.cjs +1 -0
- package/dist/cjs/components/flowEditor/nodes/processNode.cjs +1 -0
- package/dist/cjs/components/flowEditor/nodes/startNode.cjs +1 -0
- package/dist/cjs/components/flowEditor/utils/nodeDataUtils.cjs +1 -0
- package/dist/cjs/components/form/drawerForm.cjs +1 -1
- package/dist/cjs/components/form/modalForm.cjs +1 -1
- package/dist/cjs/components/form/pageForm.cjs +1 -1
- package/dist/cjs/components/form/pageTabForm.cjs +1 -1
- package/dist/cjs/components/form/settingForm.cjs +1 -1
- package/dist/cjs/components/formEditor/base/base.cjs +1 -1
- package/dist/cjs/components/formEditor/base/setting.cjs +1 -1
- package/dist/cjs/components/formEditor/components/cascader.cjs +1 -1
- package/dist/cjs/components/formEditor/components/cascaderAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/checkbox.cjs +1 -1
- package/dist/cjs/components/formEditor/components/color.cjs +1 -1
- package/dist/cjs/components/formEditor/components/date.cjs +1 -1
- package/dist/cjs/components/formEditor/components/dynamicInput.cjs +1 -1
- package/dist/cjs/components/formEditor/components/dynamicTags.cjs +1 -1
- package/dist/cjs/components/formEditor/components/editor.cjs +1 -1
- package/dist/cjs/components/formEditor/components/fileUpload.cjs +1 -1
- package/dist/cjs/components/formEditor/components/imageUpload.cjs +1 -1
- package/dist/cjs/components/formEditor/components/input.cjs +1 -1
- package/dist/cjs/components/formEditor/components/inputNumber.cjs +1 -1
- package/dist/cjs/components/formEditor/components/mentionAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/radio.cjs +1 -1
- package/dist/cjs/components/formEditor/components/region.cjs +1 -1
- package/dist/cjs/components/formEditor/components/select.cjs +1 -1
- package/dist/cjs/components/formEditor/components/selectAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/sider.cjs +1 -1
- package/dist/cjs/components/formEditor/components/switch.cjs +1 -1
- package/dist/cjs/components/formEditor/components/time.cjs +1 -1
- package/dist/cjs/components/formEditor/components/transferAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/treeSelect.cjs +1 -1
- package/dist/cjs/components/formEditor/components/treeSelectAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/editor.cjs +1 -1
- package/dist/cjs/components/formEditor/renderer.cjs +1 -1
- package/dist/cjs/components/icon/icon.cjs +1 -1
- package/dist/cjs/components/layout/list.cjs +1 -1
- package/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/level/level.cjs +1 -1
- package/dist/cjs/components/posterEditor/pages/RightPanel.cjs +1 -1
- package/dist/cjs/components/posterEditor/posterEditor.cjs +1 -1
- package/dist/cjs/components/table/table.cjs +1 -1
- package/dist/cjs/components/upload/file.cjs +1 -1
- package/dist/cjs/components/upload/image.cjs +1 -1
- package/dist/cjs/components/upload/manage/item.cjs +1 -1
- package/dist/cjs/components/upload/manager.cjs +1 -1
- package/dist/cjs/dvha-pro.css +1 -1
- package/dist/cjs/hooks/dialog.cjs +1 -1
- package/dist/cjs/hooks/drawer.cjs +1 -1
- package/dist/cjs/hooks/modal.cjs +1 -1
- package/dist/cjs/hooks/table/image.cjs +1 -1
- package/dist/cjs/hooks/table/media.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/langs/en-US.json.cjs +1 -1
- package/dist/cjs/langs/zh-CN.json.cjs +1 -1
- package/dist/cjs/main.cjs +1 -1
- package/dist/cjs/pages/authLayout.cjs +1 -1
- package/dist/cjs/pages/layout/page.cjs +1 -1
- package/dist/cjs/pages/login.cjs +1 -1
- package/dist/cjs/pages/menu/avatar.cjs +1 -1
- package/dist/cjs/pages/menu/button.cjs +1 -1
- package/dist/cjs/pages/menu/cmd.cjs +1 -1
- package/dist/cjs/pages/menu/main.cjs +1 -1
- package/dist/cjs/pages/menu/mobile.cjs +1 -1
- package/dist/cjs/pages/page404.cjs +1 -1
- package/dist/cjs/pages/pageStatus.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +75 -3
- package/dist/esm/component.js +5 -2
- package/dist/esm/components/chart/echart.js +5 -2
- package/dist/esm/components/crop/imageCrop.js +13 -10
- package/dist/esm/components/data/dynamicSelect.js +5 -2
- package/dist/esm/components/data/selectModal.js +5 -2
- package/dist/esm/components/designEditor/components/grid.js +5 -2
- package/dist/esm/components/designEditor/editor/setting.js +7 -4
- package/dist/esm/components/flowEditor/components/jsonEditor.js +53 -0
- package/dist/esm/components/flowEditor/components/nodeCard.js +160 -0
- package/dist/esm/components/flowEditor/components/setting.js +319 -0
- package/dist/esm/components/flowEditor/components/toolbar.js +120 -0
- package/dist/esm/components/flowEditor/flowEditor.js +287 -0
- package/dist/esm/components/flowEditor/nodes/endNode.js +144 -0
- package/dist/esm/components/flowEditor/nodes/index.js +66 -0
- package/dist/esm/components/flowEditor/nodes/processNode.js +142 -0
- package/dist/esm/components/flowEditor/nodes/startNode.js +144 -0
- package/dist/esm/components/flowEditor/utils/nodeDataUtils.js +82 -0
- package/dist/esm/components/form/drawerForm.js +5 -2
- package/dist/esm/components/form/modalForm.js +12 -9
- package/dist/esm/components/form/pageForm.js +21 -18
- package/dist/esm/components/form/pageTabForm.js +5 -2
- package/dist/esm/components/form/settingForm.js +11 -8
- package/dist/esm/components/formEditor/base/base.js +8 -5
- package/dist/esm/components/formEditor/base/setting.js +5 -2
- package/dist/esm/components/formEditor/components/cascader.js +6 -3
- package/dist/esm/components/formEditor/components/cascaderAsync.js +6 -3
- package/dist/esm/components/formEditor/components/checkbox.js +17 -14
- package/dist/esm/components/formEditor/components/color.js +6 -3
- package/dist/esm/components/formEditor/components/date.js +6 -3
- package/dist/esm/components/formEditor/components/dynamicInput.js +6 -3
- package/dist/esm/components/formEditor/components/dynamicTags.js +13 -10
- package/dist/esm/components/formEditor/components/editor.js +6 -3
- package/dist/esm/components/formEditor/components/fileUpload.js +6 -3
- package/dist/esm/components/formEditor/components/imageUpload.js +6 -3
- package/dist/esm/components/formEditor/components/input.js +6 -3
- package/dist/esm/components/formEditor/components/inputNumber.js +29 -26
- package/dist/esm/components/formEditor/components/mentionAsync.js +17 -14
- package/dist/esm/components/formEditor/components/radio.js +17 -14
- package/dist/esm/components/formEditor/components/region.js +19 -16
- package/dist/esm/components/formEditor/components/select.js +6 -3
- package/dist/esm/components/formEditor/components/selectAsync.js +12 -9
- package/dist/esm/components/formEditor/components/sider.js +6 -3
- package/dist/esm/components/formEditor/components/switch.js +22 -19
- package/dist/esm/components/formEditor/components/time.js +6 -3
- package/dist/esm/components/formEditor/components/transferAsync.js +26 -23
- package/dist/esm/components/formEditor/components/treeSelect.js +6 -3
- package/dist/esm/components/formEditor/components/treeSelectAsync.js +26 -23
- package/dist/esm/components/formEditor/editor.js +5 -2
- package/dist/esm/components/formEditor/renderer.js +5 -2
- package/dist/esm/components/icon/icon.js +5 -2
- package/dist/esm/components/layout/list.js +5 -2
- package/dist/esm/components/layout/table.js +5 -2
- package/dist/esm/components/level/level.js +5 -2
- package/dist/esm/components/posterEditor/pages/RightPanel.js +5 -2
- package/dist/esm/components/posterEditor/posterEditor.js +5 -2
- package/dist/esm/components/table/table.js +9 -6
- package/dist/esm/components/upload/file.js +5 -2
- package/dist/esm/components/upload/image.js +18 -15
- package/dist/esm/components/upload/manage/item.js +5 -2
- package/dist/esm/components/upload/manager.js +5 -2
- package/dist/esm/dvha-pro.css +1 -1
- package/dist/esm/hooks/dialog.js +5 -2
- package/dist/esm/hooks/drawer.js +5 -2
- package/dist/esm/hooks/modal.js +5 -2
- package/dist/esm/hooks/table/image.js +5 -2
- package/dist/esm/hooks/table/media.js +5 -2
- package/dist/esm/index.js +252 -226
- package/dist/esm/langs/en-US.json.js +5 -5
- package/dist/esm/langs/zh-CN.json.js +6 -6
- package/dist/esm/main.js +4 -2
- package/dist/esm/pages/authLayout.js +5 -2
- package/dist/esm/pages/layout/page.js +9 -6
- package/dist/esm/pages/login.js +10 -7
- package/dist/esm/pages/menu/avatar.js +18 -15
- package/dist/esm/pages/menu/button.js +8 -5
- package/dist/esm/pages/menu/cmd.js +13 -10
- package/dist/esm/pages/menu/main.js +29 -26
- package/dist/esm/pages/menu/mobile.js +5 -2
- package/dist/esm/pages/page404.js +3 -0
- package/dist/esm/pages/pageStatus.js +5 -2
- package/dist/esm/theme/uno.css.js +75 -3
- package/dist/types/components/flowEditor/components/index.d.ts +3 -0
- package/dist/types/components/flowEditor/components/jsonEditor.d.ts +22 -0
- package/dist/types/components/flowEditor/components/nodeCard.d.ts +112 -0
- package/dist/types/components/flowEditor/components/setting.d.ts +16 -0
- package/dist/types/components/flowEditor/components/toolbar.d.ts +11 -0
- package/dist/types/components/flowEditor/flowEditor.d.ts +68 -0
- package/dist/types/components/flowEditor/index.d.ts +5 -0
- package/dist/types/components/flowEditor/nodes/endNode.d.ts +19 -0
- package/dist/types/components/flowEditor/nodes/index.d.ts +8 -0
- package/dist/types/components/flowEditor/nodes/processNode.d.ts +19 -0
- package/dist/types/components/flowEditor/nodes/startNode.d.ts +19 -0
- package/dist/types/components/flowEditor/types/index.d.ts +62 -0
- package/dist/types/components/flowEditor/utils/nodeDataUtils.d.ts +59 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/hooks/table/types.d.ts +1 -0
- package/dist/types/main.d.ts +2 -0
- package/package.json +9 -3
|
@@ -51,6 +51,9 @@ import "@duxweb/dvha-naiveui";
|
|
|
51
51
|
import "../../pages/page404.js";
|
|
52
52
|
import "short-unique-id";
|
|
53
53
|
import "aieditor";
|
|
54
|
+
import "@vue-flow/core";
|
|
55
|
+
import "@vue-flow/background";
|
|
56
|
+
/* empty css */
|
|
54
57
|
import "mime";
|
|
55
58
|
import "@iconify-json/tabler/icons.json";
|
|
56
59
|
import "../posterEditor/elements/index.js";
|
|
@@ -62,7 +65,7 @@ import "pinia";
|
|
|
62
65
|
function c(t) {
|
|
63
66
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !z(t);
|
|
64
67
|
}
|
|
65
|
-
const
|
|
68
|
+
const It = /* @__PURE__ */ y({
|
|
66
69
|
name: "Select",
|
|
67
70
|
props: {
|
|
68
71
|
path: String,
|
|
@@ -156,5 +159,5 @@ const Vt = /* @__PURE__ */ y({
|
|
|
156
159
|
}
|
|
157
160
|
});
|
|
158
161
|
export {
|
|
159
|
-
|
|
162
|
+
It as default
|
|
160
163
|
};
|
|
@@ -26,6 +26,7 @@ import { DuxWidgetEditorPreview as E } from "../editor/preview.js";
|
|
|
26
26
|
import { WidgetEditorSettingCard as y } from "../editor/setting.js";
|
|
27
27
|
import "short-unique-id";
|
|
28
28
|
import "aieditor";
|
|
29
|
+
import "@vue-flow/core";
|
|
29
30
|
import "vee-validate";
|
|
30
31
|
import "@vee-validate/i18n";
|
|
31
32
|
import "colorizr";
|
|
@@ -53,6 +54,8 @@ import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
|
53
54
|
import "vue-command-palette";
|
|
54
55
|
import "@duxweb/dvha-naiveui";
|
|
55
56
|
import "../../../pages/page404.js";
|
|
57
|
+
import "@vue-flow/background";
|
|
58
|
+
/* empty css */
|
|
56
59
|
import "mime";
|
|
57
60
|
import "@iconify-json/tabler/icons.json";
|
|
58
61
|
import "../../posterEditor/elements/index.js";
|
|
@@ -168,7 +171,7 @@ function j(o) {
|
|
|
168
171
|
children: t
|
|
169
172
|
};
|
|
170
173
|
}
|
|
171
|
-
function
|
|
174
|
+
function Ut(o) {
|
|
172
175
|
return {
|
|
173
176
|
name: "dux-grid",
|
|
174
177
|
icon: "i-tabler:grid-4x4",
|
|
@@ -185,5 +188,5 @@ function Dt(o) {
|
|
|
185
188
|
};
|
|
186
189
|
}
|
|
187
190
|
export {
|
|
188
|
-
|
|
191
|
+
Ut as duxFormEditorGrid
|
|
189
192
|
};
|
|
@@ -54,11 +54,14 @@ import "vue-command-palette";
|
|
|
54
54
|
import "../../../pages/page404.js";
|
|
55
55
|
import "short-unique-id";
|
|
56
56
|
import "aieditor";
|
|
57
|
+
import "@vue-flow/core";
|
|
57
58
|
import { DuxFormLayout as a } from "../../form/formLayout.js";
|
|
59
|
+
import "@vue-flow/background";
|
|
60
|
+
/* empty css */
|
|
58
61
|
import "@iconify-json/tabler/icons.json";
|
|
59
62
|
import "../../posterEditor/elements/index.js";
|
|
60
63
|
import "fabric";
|
|
61
|
-
const
|
|
64
|
+
const St = /* @__PURE__ */ m({
|
|
62
65
|
name: "WidgetEditorSetting",
|
|
63
66
|
props: {
|
|
64
67
|
actionRender: Function
|
|
@@ -84,7 +87,7 @@ const gt = /* @__PURE__ */ m({
|
|
|
84
87
|
}
|
|
85
88
|
})]), e?.actionRender?.(t)])]);
|
|
86
89
|
}
|
|
87
|
-
}),
|
|
90
|
+
}), Ct = /* @__PURE__ */ m({
|
|
88
91
|
name: "WidgetEditorSettingCard",
|
|
89
92
|
props: {
|
|
90
93
|
title: String,
|
|
@@ -107,6 +110,6 @@ const gt = /* @__PURE__ */ m({
|
|
|
107
110
|
}
|
|
108
111
|
});
|
|
109
112
|
export {
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
St as WidgetEditorSetting,
|
|
114
|
+
Ct as WidgetEditorSettingCard
|
|
112
115
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent as c, ref as p, createVNode as o, Fragment as m, createTextVNode as l } from "vue";
|
|
2
|
+
import { useMessage as f, NButton as u } from "naive-ui";
|
|
3
|
+
import { useI18n as E } from "@duxweb/dvha-core";
|
|
4
|
+
import { DuxCodeEditor as C } from "../../code/code.js";
|
|
5
|
+
import "@overlastic/vue";
|
|
6
|
+
import v from "../../modal/modalPage.js";
|
|
7
|
+
const N = /* @__PURE__ */ c({
|
|
8
|
+
name: "FlowJsonEditor",
|
|
9
|
+
props: {
|
|
10
|
+
data: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: !0
|
|
13
|
+
},
|
|
14
|
+
onConfirm: {
|
|
15
|
+
type: Function
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(r, {
|
|
19
|
+
emit: i
|
|
20
|
+
}) {
|
|
21
|
+
const n = f(), {
|
|
22
|
+
t: a
|
|
23
|
+
} = E(), t = p(JSON.stringify(r.data, null, 2)), s = () => {
|
|
24
|
+
navigator.clipboard.writeText(t.value), n.success(a("components.flowEditor.jsonEditor.copiedToClipboard") || "");
|
|
25
|
+
}, d = () => {
|
|
26
|
+
try {
|
|
27
|
+
const e = JSON.parse(t.value);
|
|
28
|
+
r.onConfirm && r.onConfirm(e), n.success(a("components.flowEditor.jsonEditor.dataApplied") || ""), i("close");
|
|
29
|
+
} catch {
|
|
30
|
+
n.error(a("components.flowEditor.jsonEditor.jsonFormatError") || "");
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return () => o(v, null, {
|
|
34
|
+
default: () => o("div", null, [o(C, {
|
|
35
|
+
value: t.value,
|
|
36
|
+
"onUpdate:value": (e) => t.value = e
|
|
37
|
+
}, null)]),
|
|
38
|
+
footer: () => o(m, null, [o(u, {
|
|
39
|
+
onClick: s
|
|
40
|
+
}, {
|
|
41
|
+
default: () => [l("复制数据")]
|
|
42
|
+
}), o(u, {
|
|
43
|
+
onClick: d,
|
|
44
|
+
type: "primary"
|
|
45
|
+
}, {
|
|
46
|
+
default: () => [l("应用数据")]
|
|
47
|
+
})])
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
export {
|
|
52
|
+
N as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { defineComponent as k, inject as v, createVNode as e } from "vue";
|
|
2
|
+
import { Position as s, useVueFlow as x, Handle as c } from "@vue-flow/core";
|
|
3
|
+
import d from "clsx";
|
|
4
|
+
import { NDropdown as C } from "naive-ui";
|
|
5
|
+
import { useI18n as N } from "@duxweb/dvha-core";
|
|
6
|
+
import { defaultNodes as D } from "../nodes/index.js";
|
|
7
|
+
const R = /* @__PURE__ */ k({
|
|
8
|
+
name: "FlowNodeCard",
|
|
9
|
+
props: {
|
|
10
|
+
nodeProps: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: !0
|
|
13
|
+
},
|
|
14
|
+
handlePosition: {
|
|
15
|
+
type: Object,
|
|
16
|
+
default: () => ({
|
|
17
|
+
source: s.Right,
|
|
18
|
+
target: s.Left
|
|
19
|
+
})
|
|
20
|
+
},
|
|
21
|
+
showTargetHandle: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !0
|
|
24
|
+
},
|
|
25
|
+
showSourceHandle: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !0
|
|
28
|
+
},
|
|
29
|
+
color: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "primary"
|
|
32
|
+
},
|
|
33
|
+
onClick: {
|
|
34
|
+
type: Function,
|
|
35
|
+
default: void 0
|
|
36
|
+
},
|
|
37
|
+
onDoubleClick: {
|
|
38
|
+
type: Function,
|
|
39
|
+
default: void 0
|
|
40
|
+
},
|
|
41
|
+
// NodeToolbar相关配置
|
|
42
|
+
showToolbar: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !0
|
|
45
|
+
},
|
|
46
|
+
toolbarPosition: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "top"
|
|
49
|
+
},
|
|
50
|
+
toolbarOffset: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: 10
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
setup(o, {
|
|
56
|
+
slots: r
|
|
57
|
+
}) {
|
|
58
|
+
const u = v("flowNodes", {}), {
|
|
59
|
+
removeNodes: p,
|
|
60
|
+
addNodes: f,
|
|
61
|
+
findNode: b
|
|
62
|
+
} = x(), {
|
|
63
|
+
t: i
|
|
64
|
+
} = N(), m = (t) => {
|
|
65
|
+
o.onClick && o.onClick(t);
|
|
66
|
+
}, y = (t) => {
|
|
67
|
+
o.onDoubleClick && o.onDoubleClick(t);
|
|
68
|
+
}, g = (t) => {
|
|
69
|
+
const a = o.nodeProps.id;
|
|
70
|
+
switch (t) {
|
|
71
|
+
case "delete": {
|
|
72
|
+
p([a]);
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
case "copy": {
|
|
76
|
+
const n = b(a);
|
|
77
|
+
if (n) {
|
|
78
|
+
const l = {
|
|
79
|
+
...n,
|
|
80
|
+
id: `${a}-copy-${Date.now()}`,
|
|
81
|
+
position: {
|
|
82
|
+
x: n.position.x + 50,
|
|
83
|
+
y: n.position.y + 50
|
|
84
|
+
},
|
|
85
|
+
data: {
|
|
86
|
+
...n.data,
|
|
87
|
+
label: `${n.data.label} (copy)`
|
|
88
|
+
},
|
|
89
|
+
selected: !1
|
|
90
|
+
};
|
|
91
|
+
f([l]);
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return () => {
|
|
98
|
+
const {
|
|
99
|
+
data: t,
|
|
100
|
+
selected: a,
|
|
101
|
+
type: n
|
|
102
|
+
} = o.nodeProps, l = u || D, w = (l?.value || l)[n || ""]?.meta?.style || {};
|
|
103
|
+
return e("div", {
|
|
104
|
+
class: d(["relative rounded-md border transition-all cursor-pointer min-w-60", "bg-default dark:bg-default/80 backdrop-blur shadow-lg shadow-gray-100 dark:shadow-gray-950/20 hover:shadow-md", a ? "border-primary" : "border-primary-900/20"]),
|
|
105
|
+
onClick: m,
|
|
106
|
+
onDblclick: y
|
|
107
|
+
}, [e("div", {
|
|
108
|
+
class: "bg-linear-to-b from-primary/10 dark:from-transparent via-transparent to-transparent rounded-t p-4 flex items-center justify-between"
|
|
109
|
+
}, [e("div", {
|
|
110
|
+
class: "flex gap-1.5 items-center"
|
|
111
|
+
}, [t.icon && e("div", {
|
|
112
|
+
class: d(["rounded flex-none p-1", w.iconBgClass || "bg-primary"])
|
|
113
|
+
}, [e("div", {
|
|
114
|
+
class: d(["size-3 text-white", t.icon])
|
|
115
|
+
}, null)]), e("div", {
|
|
116
|
+
class: "text-sm truncate"
|
|
117
|
+
}, [t.label])]), e(C, {
|
|
118
|
+
trigger: "click",
|
|
119
|
+
options: [{
|
|
120
|
+
label: i("components.flowEditor.nodeCard.delete") || "",
|
|
121
|
+
key: "delete",
|
|
122
|
+
icon: () => e("div", {
|
|
123
|
+
class: "i-tabler:trash text-sm"
|
|
124
|
+
}, null)
|
|
125
|
+
}, {
|
|
126
|
+
label: i("components.flowEditor.nodeCard.copy") || "",
|
|
127
|
+
key: "copy",
|
|
128
|
+
icon: () => e("div", {
|
|
129
|
+
class: "i-tabler:copy text-sm"
|
|
130
|
+
}, null)
|
|
131
|
+
}],
|
|
132
|
+
onSelect: g
|
|
133
|
+
}, {
|
|
134
|
+
default: () => [e("div", {
|
|
135
|
+
class: "hover:bg-black/5 p-1 rounded cursor-pointer transition-colors",
|
|
136
|
+
onClick: (h) => h.stopPropagation()
|
|
137
|
+
}, [e("div", {
|
|
138
|
+
class: "i-tabler:dots text-sm text-gray-500"
|
|
139
|
+
}, null)])]
|
|
140
|
+
})]), e("div", {
|
|
141
|
+
class: "p-4 pt-0 text-xs text-muted"
|
|
142
|
+
}, [r.default ? r.default() : e("div", {
|
|
143
|
+
class: "bg-elevated rounded p-2"
|
|
144
|
+
}, [t.description])]), o.showTargetHandle && e(c, {
|
|
145
|
+
type: "target",
|
|
146
|
+
position: o.handlePosition.target,
|
|
147
|
+
connectable: !0,
|
|
148
|
+
class: "!bg-primary !border-2 !border-white !size-2.5 !rounded-full"
|
|
149
|
+
}, null), o.showSourceHandle && e(c, {
|
|
150
|
+
type: "source",
|
|
151
|
+
position: o.handlePosition.source,
|
|
152
|
+
connectable: !0,
|
|
153
|
+
class: "!bg-primary !border-2 !border-white !size-2.5 !rounded-full"
|
|
154
|
+
}, null)]);
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
export {
|
|
159
|
+
R as FlowNodeCard
|
|
160
|
+
};
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { defineComponent as P, computed as w, ref as x, watch as m, createVNode as e } from "vue";
|
|
2
|
+
import { useI18n as T } from "@duxweb/dvha-core";
|
|
3
|
+
import { useVueFlow as U, MarkerType as z } from "@vue-flow/core";
|
|
4
|
+
import k from "clsx";
|
|
5
|
+
import { useMessage as A, NScrollbar as G, NButton as c, NRadioGroup as H, NRadio as h } from "naive-ui";
|
|
6
|
+
import "vue-router";
|
|
7
|
+
import "@overlastic/vue";
|
|
8
|
+
import "vue-echarts";
|
|
9
|
+
import "@vueuse/core";
|
|
10
|
+
import "vue3-ace-editor";
|
|
11
|
+
import "ace-builds/src-noconflict/mode-vue";
|
|
12
|
+
import "ace-builds/src-noconflict/mode-javascript";
|
|
13
|
+
import "ace-builds/src-noconflict/mode-html";
|
|
14
|
+
import "ace-builds/src-noconflict/mode-json";
|
|
15
|
+
import "ace-builds/src-noconflict/mode-json5";
|
|
16
|
+
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
17
|
+
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
18
|
+
import "ace-builds/src-noconflict/ext-searchbox";
|
|
19
|
+
import "ace-builds/src-noconflict/ext-language_tools";
|
|
20
|
+
import "ace-builds/src-noconflict/mode-snippets";
|
|
21
|
+
import "vue-cropper";
|
|
22
|
+
import "jinrishici";
|
|
23
|
+
import "lodash-es";
|
|
24
|
+
import "vue-draggable-plus";
|
|
25
|
+
import "@vee-validate/i18n";
|
|
26
|
+
import "colorizr";
|
|
27
|
+
import "echarts";
|
|
28
|
+
import "highlight.js/lib/core";
|
|
29
|
+
import "highlight.js/lib/languages/bash";
|
|
30
|
+
import "highlight.js/lib/languages/css";
|
|
31
|
+
import "highlight.js/lib/languages/go";
|
|
32
|
+
import "highlight.js/lib/languages/java";
|
|
33
|
+
import "highlight.js/lib/languages/javascript";
|
|
34
|
+
import "highlight.js/lib/languages/json";
|
|
35
|
+
import "highlight.js/lib/languages/markdown";
|
|
36
|
+
import "highlight.js/lib/languages/php";
|
|
37
|
+
import "highlight.js/lib/languages/python";
|
|
38
|
+
import "highlight.js/lib/languages/shell";
|
|
39
|
+
import "highlight.js/lib/languages/sql";
|
|
40
|
+
import "highlight.js/lib/languages/typescript";
|
|
41
|
+
import "highlight.js/lib/languages/xml";
|
|
42
|
+
import "@ant-design/colors";
|
|
43
|
+
import "@unocss/preset-icons/browser";
|
|
44
|
+
import "@unocss/preset-typography";
|
|
45
|
+
import "unocss/preset-wind4";
|
|
46
|
+
import "@vee-validate/i18n/dist/locale/en.json";
|
|
47
|
+
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
48
|
+
import "vee-validate";
|
|
49
|
+
import "vue-command-palette";
|
|
50
|
+
import "@duxweb/dvha-naiveui";
|
|
51
|
+
import "../../../pages/page404.js";
|
|
52
|
+
import "short-unique-id";
|
|
53
|
+
import "aieditor";
|
|
54
|
+
import { DuxFormLayout as L } from "../../form/formLayout.js";
|
|
55
|
+
import { DuxFormItem as C } from "../../form/formItem.js";
|
|
56
|
+
import "@vue-flow/background";
|
|
57
|
+
/* empty css */
|
|
58
|
+
import { useModal as W } from "../../../hooks/modal.js";
|
|
59
|
+
import "mime";
|
|
60
|
+
import "@iconify-json/tabler/icons.json";
|
|
61
|
+
import "../../posterEditor/elements/index.js";
|
|
62
|
+
import "fabric";
|
|
63
|
+
import "dayjs";
|
|
64
|
+
import "@tanstack/vue-query";
|
|
65
|
+
import "pinia";
|
|
66
|
+
const y = ({
|
|
67
|
+
icon: s,
|
|
68
|
+
iconBgClass: d = "bg-primary",
|
|
69
|
+
title: u,
|
|
70
|
+
description: o
|
|
71
|
+
}) => e("div", {
|
|
72
|
+
class: "p-4 border-b border-default"
|
|
73
|
+
}, [e("div", {
|
|
74
|
+
class: "flex gap-2 items-center"
|
|
75
|
+
}, [s && e("div", {
|
|
76
|
+
class: k(["rounded p-2 flex-shrink-0", d])
|
|
77
|
+
}, [e("div", {
|
|
78
|
+
class: k(["size-6 text-white", s])
|
|
79
|
+
}, null)]), e("div", {
|
|
80
|
+
class: "flex-1 min-w-0"
|
|
81
|
+
}, [e("h3", {
|
|
82
|
+
class: "text-base font-medium"
|
|
83
|
+
}, [u]), o && e("p", {
|
|
84
|
+
class: "text-sm text-muted mt-1"
|
|
85
|
+
}, [o])])])]), lt = /* @__PURE__ */ P({
|
|
86
|
+
name: "FlowSetting",
|
|
87
|
+
props: {
|
|
88
|
+
nodes: {
|
|
89
|
+
type: Object,
|
|
90
|
+
default: () => ({})
|
|
91
|
+
},
|
|
92
|
+
modelValue: {
|
|
93
|
+
type: Object,
|
|
94
|
+
default: () => ({
|
|
95
|
+
nodes: [],
|
|
96
|
+
edges: []
|
|
97
|
+
})
|
|
98
|
+
},
|
|
99
|
+
onSave: {
|
|
100
|
+
type: Function,
|
|
101
|
+
default: void 0
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
emits: ["update:modelValue"],
|
|
105
|
+
setup(s, {
|
|
106
|
+
emit: d,
|
|
107
|
+
slots: u
|
|
108
|
+
}) {
|
|
109
|
+
const {
|
|
110
|
+
t: o
|
|
111
|
+
} = T(), {
|
|
112
|
+
getSelectedNodes: S,
|
|
113
|
+
getSelectedEdges: N,
|
|
114
|
+
updateNodeData: F,
|
|
115
|
+
updateEdgeData: D,
|
|
116
|
+
getNodes: f,
|
|
117
|
+
getEdges: v,
|
|
118
|
+
removeEdges: V
|
|
119
|
+
} = U(), g = A(), O = W(), l = w(() => {
|
|
120
|
+
const t = S.value;
|
|
121
|
+
return t.length === 1 ? t[0] : null;
|
|
122
|
+
}), r = w(() => {
|
|
123
|
+
const t = N.value;
|
|
124
|
+
return t.length === 1 ? t[0] : null;
|
|
125
|
+
}), a = w(() => !l.value || !l.value.type ? null : s.nodes[l.value.type]), p = x({}), n = x({});
|
|
126
|
+
m(l, (t) => {
|
|
127
|
+
t ? p.value = {
|
|
128
|
+
...t.data
|
|
129
|
+
} : p.value = {};
|
|
130
|
+
}, {
|
|
131
|
+
immediate: !0
|
|
132
|
+
}), m(r, (t) => {
|
|
133
|
+
t ? n.value = {
|
|
134
|
+
...t.data
|
|
135
|
+
} : n.value = {};
|
|
136
|
+
}, {
|
|
137
|
+
immediate: !0
|
|
138
|
+
}), m(p, (t) => {
|
|
139
|
+
l.value && (F(l.value.id, t), d("update:modelValue", {
|
|
140
|
+
nodes: f.value,
|
|
141
|
+
edges: v.value
|
|
142
|
+
}));
|
|
143
|
+
}, {
|
|
144
|
+
deep: !0,
|
|
145
|
+
flush: "post"
|
|
146
|
+
}), m(n, (t) => {
|
|
147
|
+
if (r.value) {
|
|
148
|
+
D(r.value.id, t);
|
|
149
|
+
const i = r.value;
|
|
150
|
+
if (i && t.type) {
|
|
151
|
+
const b = {
|
|
152
|
+
success: {
|
|
153
|
+
stroke: "#10b981",
|
|
154
|
+
markerColor: "#10b981"
|
|
155
|
+
},
|
|
156
|
+
// 通过 - 绿色
|
|
157
|
+
error: {
|
|
158
|
+
stroke: "#ef4444",
|
|
159
|
+
markerColor: "#ef4444"
|
|
160
|
+
}
|
|
161
|
+
// 退回 - 红色
|
|
162
|
+
}, E = b[t.type] || b.success, I = i.style || {};
|
|
163
|
+
i.style = Object.assign({}, I, {
|
|
164
|
+
stroke: E.stroke,
|
|
165
|
+
strokeWidth: 2
|
|
166
|
+
});
|
|
167
|
+
const J = i.markerEnd || {};
|
|
168
|
+
i.markerEnd = Object.assign({}, J, {
|
|
169
|
+
type: z.ArrowClosed,
|
|
170
|
+
width: 12,
|
|
171
|
+
height: 12,
|
|
172
|
+
color: E.markerColor
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}, {
|
|
177
|
+
deep: !0
|
|
178
|
+
});
|
|
179
|
+
const j = () => {
|
|
180
|
+
d("update:modelValue", {
|
|
181
|
+
nodes: [],
|
|
182
|
+
edges: []
|
|
183
|
+
}), g.success(o("components.flowEditor.flowCleared") || "");
|
|
184
|
+
}, B = () => {
|
|
185
|
+
const t = {
|
|
186
|
+
nodes: f.value,
|
|
187
|
+
edges: v.value
|
|
188
|
+
};
|
|
189
|
+
s.onSave ? s.onSave(t) : g.success(o("components.flowEditor.flowSaved") || "");
|
|
190
|
+
}, M = () => {
|
|
191
|
+
const t = {
|
|
192
|
+
nodes: f.value,
|
|
193
|
+
edges: v.value
|
|
194
|
+
};
|
|
195
|
+
O.show({
|
|
196
|
+
title: o("components.flowEditor.editFlowJSON") || "",
|
|
197
|
+
width: "600px",
|
|
198
|
+
component: () => import("./jsonEditor.js"),
|
|
199
|
+
componentProps: {
|
|
200
|
+
data: t,
|
|
201
|
+
onConfirm: (i) => {
|
|
202
|
+
d("update:modelValue", i);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}, R = () => {
|
|
207
|
+
r.value && (V([r.value.id]), g.success(o("components.flowEditor.edgeDeleted") || ""));
|
|
208
|
+
};
|
|
209
|
+
return () => e("div", {
|
|
210
|
+
class: "w-300px h-full flex flex-col"
|
|
211
|
+
}, [!l.value && !r.value && e(y, {
|
|
212
|
+
icon: "i-tabler:settings",
|
|
213
|
+
iconBgClass: "bg-gray-500",
|
|
214
|
+
title: o("components.flowEditor.properties") || "",
|
|
215
|
+
description: o("components.flowEditor.selectNodeOrEdge") || ""
|
|
216
|
+
}, null), l.value && e(y, {
|
|
217
|
+
icon: a.value?.meta.icon,
|
|
218
|
+
iconBgClass: a.value?.meta.style?.iconBgClass || "bg-primary",
|
|
219
|
+
title: a.value?.meta.label || "Node",
|
|
220
|
+
description: a.value?.meta.description
|
|
221
|
+
}, null), r.value && e(y, {
|
|
222
|
+
icon: "i-tabler:arrow-right",
|
|
223
|
+
iconBgClass: "bg-blue-500",
|
|
224
|
+
title: o("components.flowEditor.edgeSettings") || "",
|
|
225
|
+
description: o("components.flowEditor.edgeDescription") || ""
|
|
226
|
+
}, null), e(G, {
|
|
227
|
+
class: "flex-1 min-h-0"
|
|
228
|
+
}, {
|
|
229
|
+
default: () => [e("div", {
|
|
230
|
+
class: "p-4 space-y-4"
|
|
231
|
+
}, [!l.value && !r.value && e("div", {
|
|
232
|
+
class: "space-y-4"
|
|
233
|
+
}, [u.globalSettings?.(), e("div", {
|
|
234
|
+
class: "flex flex-col gap-2"
|
|
235
|
+
}, [e(c, {
|
|
236
|
+
onClick: M,
|
|
237
|
+
type: "default",
|
|
238
|
+
block: !0,
|
|
239
|
+
secondary: !0
|
|
240
|
+
}, {
|
|
241
|
+
icon: () => e("div", {
|
|
242
|
+
class: "i-tabler:code"
|
|
243
|
+
}, null),
|
|
244
|
+
default: () => o("components.flowEditor.editJSON") || ""
|
|
245
|
+
}), e(c, {
|
|
246
|
+
onClick: B,
|
|
247
|
+
type: "primary",
|
|
248
|
+
block: !0,
|
|
249
|
+
secondary: !0
|
|
250
|
+
}, {
|
|
251
|
+
icon: () => e("div", {
|
|
252
|
+
class: "i-tabler:device-floppy"
|
|
253
|
+
}, null),
|
|
254
|
+
default: () => o("components.flowEditor.saveFlow") || ""
|
|
255
|
+
}), e(c, {
|
|
256
|
+
onClick: j,
|
|
257
|
+
type: "warning",
|
|
258
|
+
block: !0,
|
|
259
|
+
secondary: !0
|
|
260
|
+
}, {
|
|
261
|
+
icon: () => e("div", {
|
|
262
|
+
class: "i-tabler:trash"
|
|
263
|
+
}, null),
|
|
264
|
+
default: () => o("components.flowEditor.clearFlow") || ""
|
|
265
|
+
})])]), l.value && a.value?.settingComponent && e(a.value.settingComponent, {
|
|
266
|
+
modelValue: p.value,
|
|
267
|
+
"onUpdate:modelValue": (t) => p.value = t,
|
|
268
|
+
nodeId: l.value.id,
|
|
269
|
+
nodeRegistries: s.nodes
|
|
270
|
+
}, null), r.value && e(L, {
|
|
271
|
+
labelPlacement: "top"
|
|
272
|
+
}, {
|
|
273
|
+
default: () => [e(C, {
|
|
274
|
+
label: o("components.flowEditor.connectionType") || ""
|
|
275
|
+
}, {
|
|
276
|
+
default: () => [e(H, {
|
|
277
|
+
value: n.value.type || "success",
|
|
278
|
+
onUpdateValue: (t) => {
|
|
279
|
+
n.value = {
|
|
280
|
+
...n.value,
|
|
281
|
+
type: t
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
}, {
|
|
285
|
+
default: () => [e("div", {
|
|
286
|
+
class: "space-y-2"
|
|
287
|
+
}, [e(h, {
|
|
288
|
+
value: "success"
|
|
289
|
+
}, {
|
|
290
|
+
default: () => [e("div", {
|
|
291
|
+
class: "flex items-center gap-2"
|
|
292
|
+
}, [e("span", null, [o("components.flowEditor.pass") || ""])])]
|
|
293
|
+
}), e(h, {
|
|
294
|
+
value: "error"
|
|
295
|
+
}, {
|
|
296
|
+
default: () => [e("div", {
|
|
297
|
+
class: "flex items-center gap-2"
|
|
298
|
+
}, [e("span", null, [o("components.flowEditor.reject") || ""])])]
|
|
299
|
+
})])]
|
|
300
|
+
})]
|
|
301
|
+
}), e(C, null, {
|
|
302
|
+
default: () => [e(c, {
|
|
303
|
+
onClick: R,
|
|
304
|
+
type: "error",
|
|
305
|
+
block: !0
|
|
306
|
+
}, {
|
|
307
|
+
icon: () => e("div", {
|
|
308
|
+
class: "i-tabler:trash"
|
|
309
|
+
}, null),
|
|
310
|
+
default: () => o("components.flowEditor.deleteEdge") || ""
|
|
311
|
+
})]
|
|
312
|
+
})]
|
|
313
|
+
})])]
|
|
314
|
+
})]);
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
export {
|
|
318
|
+
lt as FlowSetting
|
|
319
|
+
};
|