service-flow-designer 1.1.7 → 1.1.8
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/es/designer/common/components/json-view/json-view-dialog.vue.js +1 -1
- package/dist/es/designer/common/components/json-view/json-view.vue.js +139 -1
- package/dist/es/designer/common/components/json-view/json-view.vue2.js +1 -139
- package/dist/es/designer/desginer-index.css +6 -6
- package/dist/es/designer/desginer-index.vue.js +1 -1
- package/dist/es/designer/desginer-index.vue2.js +1 -1
- package/dist/es/designer/service-flow-view/service-test/service-test.vue.js +1 -1
- package/dist/lib/designer/common/components/json-view/json-view-dialog.vue.js +1 -1
- package/dist/lib/designer/common/components/json-view/json-view.vue.js +140 -2
- package/dist/lib/designer/common/components/json-view/json-view.vue2.js +2 -140
- package/dist/lib/designer/desginer-index.css +6 -6
- package/dist/lib/designer/desginer-index.vue.js +1 -1
- package/dist/lib/designer/desginer-index.vue2.js +1 -1
- package/dist/lib/designer/service-flow-view/service-test/service-test.vue.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, watch, resolveComponent, openBlock, createBlock, withCtx, createVNode } from "vue";
|
|
2
|
-
import _sfc_main$1 from "./json-view.
|
|
2
|
+
import _sfc_main$1 from "./json-view.vue.js";
|
|
3
3
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
4
|
...{
|
|
5
5
|
name: "JsonViewDialog",
|
|
@@ -1,4 +1,142 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent, ref, watch, onMounted, nextTick, openBlock, createElementBlock } from "vue";
|
|
2
|
+
import { EditorView, basicSetup } from "codemirror";
|
|
3
|
+
import { jsonLanguage } from "@codemirror/lang-json";
|
|
4
|
+
import { EditorState, Facet } from "@codemirror/state";
|
|
5
|
+
import { eclipse, githubDark, githubLight, dracula, vscodeDark, xcodeDark, xcodeLight } from "@uiw/codemirror-themes-all";
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
...{
|
|
8
|
+
name: "JsonView",
|
|
9
|
+
inheritAttrs: false
|
|
10
|
+
},
|
|
11
|
+
__name: "json-view",
|
|
12
|
+
props: {
|
|
13
|
+
jsonObject: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: () => {
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
height: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: 0
|
|
21
|
+
},
|
|
22
|
+
theme: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: null
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup(__props) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const editor = ref(null);
|
|
30
|
+
const cfCodemirrorJsonViewRef = ref();
|
|
31
|
+
const codemirrorHeight = ref("400px");
|
|
32
|
+
watch(
|
|
33
|
+
() => props.jsonObject,
|
|
34
|
+
(newVal) => {
|
|
35
|
+
if (editor.value) {
|
|
36
|
+
loadEditor();
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{ deep: true }
|
|
40
|
+
);
|
|
41
|
+
onMounted(() => {
|
|
42
|
+
nextTick(() => {
|
|
43
|
+
loadEditor();
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
function loadEditor() {
|
|
47
|
+
if (editor.value) {
|
|
48
|
+
editor.value.destroy();
|
|
49
|
+
}
|
|
50
|
+
const jsonStr = props.jsonObject ? JSON.stringify(props.jsonObject, null, 2) : "";
|
|
51
|
+
if (props.height) {
|
|
52
|
+
codemirrorHeight.value = props.height + "px";
|
|
53
|
+
} else {
|
|
54
|
+
if (cfCodemirrorJsonViewRef.value) {
|
|
55
|
+
const rect = cfCodemirrorJsonViewRef.value.getBoundingClientRect();
|
|
56
|
+
if (rect.y || rect.y === 0) {
|
|
57
|
+
console.log("window.innerHeight - rect.y", window.innerHeight, rect.y);
|
|
58
|
+
codemirrorHeight.value = window.innerHeight - rect.y - 100 + "px";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const state = getEditorState(jsonStr);
|
|
63
|
+
let element = document.getElementById("cf-codemirror-view-json");
|
|
64
|
+
if (element) {
|
|
65
|
+
editor.value = new EditorView({
|
|
66
|
+
state,
|
|
67
|
+
parent: element
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function getEditorState(jsonStr) {
|
|
72
|
+
const mytheme = getTheme();
|
|
73
|
+
const baseTheme = EditorView.theme({
|
|
74
|
+
".cm-content, .cm-gutter": { minHeight: codemirrorHeight.value },
|
|
75
|
+
"&": {
|
|
76
|
+
height: codemirrorHeight.value,
|
|
77
|
+
maxHeight: codemirrorHeight.value,
|
|
78
|
+
fontSize: "12px"
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
return EditorState.create({
|
|
82
|
+
doc: jsonStr,
|
|
83
|
+
extensions: [
|
|
84
|
+
EditorState.tabSize.of(16),
|
|
85
|
+
basicSetup,
|
|
86
|
+
jsonLanguage,
|
|
87
|
+
mytheme,
|
|
88
|
+
baseTheme,
|
|
89
|
+
readOnlyFacet.of(true),
|
|
90
|
+
preventChanges
|
|
91
|
+
]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const readOnlyFacet = Facet.define({ combine: (values) => values.some((a) => a) });
|
|
95
|
+
const preventChanges = EditorState.transactionFilter.of((tr) => {
|
|
96
|
+
if (tr.isUserEvent && tr.docChanged && tr.state.facet(readOnlyFacet)) {
|
|
97
|
+
return {
|
|
98
|
+
changes: {
|
|
99
|
+
from: tr.changes.from,
|
|
100
|
+
to: tr.changes.to,
|
|
101
|
+
insert: tr.startState.doc.sliceString(tr.changes.from, tr.changes.to)
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return tr;
|
|
106
|
+
});
|
|
107
|
+
function getTheme() {
|
|
108
|
+
if (props.theme) {
|
|
109
|
+
switch (props.theme) {
|
|
110
|
+
case "xcodeLight":
|
|
111
|
+
return xcodeLight;
|
|
112
|
+
case "xcodeDark":
|
|
113
|
+
return xcodeDark;
|
|
114
|
+
case "vscodeDark":
|
|
115
|
+
return vscodeDark;
|
|
116
|
+
case "dracula":
|
|
117
|
+
return dracula;
|
|
118
|
+
case "githubLight":
|
|
119
|
+
return githubLight;
|
|
120
|
+
case "githubDark":
|
|
121
|
+
return githubDark;
|
|
122
|
+
case "eclipse":
|
|
123
|
+
return eclipse;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return EditorView.theme({});
|
|
127
|
+
}
|
|
128
|
+
return (_ctx, _cache) => {
|
|
129
|
+
return openBlock(), createElementBlock("div", {
|
|
130
|
+
style: {
|
|
131
|
+
width: "100%"
|
|
132
|
+
},
|
|
133
|
+
ref_key: "cfCodemirrorJsonViewRef",
|
|
134
|
+
ref: cfCodemirrorJsonViewRef,
|
|
135
|
+
id: "cf-codemirror-view-json"
|
|
136
|
+
}, null, 512);
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
});
|
|
2
140
|
export {
|
|
3
141
|
_sfc_main as default
|
|
4
142
|
};
|
|
@@ -1,142 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { EditorView, basicSetup } from "codemirror";
|
|
3
|
-
import { jsonLanguage } from "@codemirror/lang-json";
|
|
4
|
-
import { EditorState, Facet } from "@codemirror/state";
|
|
5
|
-
import { eclipse, githubDark, githubLight, dracula, vscodeDark, xcodeDark, xcodeLight } from "@uiw/codemirror-themes-all";
|
|
6
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
-
...{
|
|
8
|
-
name: "JsonView",
|
|
9
|
-
inheritAttrs: false
|
|
10
|
-
},
|
|
11
|
-
__name: "json-view",
|
|
12
|
-
props: {
|
|
13
|
-
jsonObject: {
|
|
14
|
-
type: Object,
|
|
15
|
-
default: () => {
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
height: {
|
|
19
|
-
type: Number,
|
|
20
|
-
default: 0
|
|
21
|
-
},
|
|
22
|
-
theme: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: null
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
setup(__props) {
|
|
28
|
-
const props = __props;
|
|
29
|
-
const editor = ref(null);
|
|
30
|
-
const cfCodemirrorJsonViewRef = ref();
|
|
31
|
-
const codemirrorHeight = ref("400px");
|
|
32
|
-
watch(
|
|
33
|
-
() => props.jsonObject,
|
|
34
|
-
(newVal) => {
|
|
35
|
-
if (editor.value) {
|
|
36
|
-
loadEditor();
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
{ deep: true }
|
|
40
|
-
);
|
|
41
|
-
onMounted(() => {
|
|
42
|
-
nextTick(() => {
|
|
43
|
-
loadEditor();
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
function loadEditor() {
|
|
47
|
-
if (editor.value) {
|
|
48
|
-
editor.value.destroy();
|
|
49
|
-
}
|
|
50
|
-
const jsonStr = props.jsonObject ? JSON.stringify(props.jsonObject, null, 2) : "";
|
|
51
|
-
if (props.height) {
|
|
52
|
-
codemirrorHeight.value = props.height + "px";
|
|
53
|
-
} else {
|
|
54
|
-
if (cfCodemirrorJsonViewRef.value) {
|
|
55
|
-
const rect = cfCodemirrorJsonViewRef.value.getBoundingClientRect();
|
|
56
|
-
if (rect.y || rect.y === 0) {
|
|
57
|
-
console.log("window.innerHeight - rect.y", window.innerHeight, rect.y);
|
|
58
|
-
codemirrorHeight.value = window.innerHeight - rect.y - 100 + "px";
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const state = getEditorState(jsonStr);
|
|
63
|
-
let element = document.getElementById("cf-codemirror-view-json");
|
|
64
|
-
if (element) {
|
|
65
|
-
editor.value = new EditorView({
|
|
66
|
-
state,
|
|
67
|
-
parent: element
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function getEditorState(jsonStr) {
|
|
72
|
-
const mytheme = getTheme();
|
|
73
|
-
const baseTheme = EditorView.theme({
|
|
74
|
-
".cm-content, .cm-gutter": { minHeight: codemirrorHeight.value },
|
|
75
|
-
"&": {
|
|
76
|
-
height: codemirrorHeight.value,
|
|
77
|
-
maxHeight: codemirrorHeight.value,
|
|
78
|
-
fontSize: "12px"
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
return EditorState.create({
|
|
82
|
-
doc: jsonStr,
|
|
83
|
-
extensions: [
|
|
84
|
-
EditorState.tabSize.of(16),
|
|
85
|
-
basicSetup,
|
|
86
|
-
jsonLanguage,
|
|
87
|
-
mytheme,
|
|
88
|
-
baseTheme,
|
|
89
|
-
readOnlyFacet.of(true),
|
|
90
|
-
preventChanges
|
|
91
|
-
]
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
const readOnlyFacet = Facet.define({ combine: (values) => values.some((a) => a) });
|
|
95
|
-
const preventChanges = EditorState.transactionFilter.of((tr) => {
|
|
96
|
-
if (tr.isUserEvent && tr.docChanged && tr.state.facet(readOnlyFacet)) {
|
|
97
|
-
return {
|
|
98
|
-
changes: {
|
|
99
|
-
from: tr.changes.from,
|
|
100
|
-
to: tr.changes.to,
|
|
101
|
-
insert: tr.startState.doc.sliceString(tr.changes.from, tr.changes.to)
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
return tr;
|
|
106
|
-
});
|
|
107
|
-
function getTheme() {
|
|
108
|
-
if (props.theme) {
|
|
109
|
-
switch (props.theme) {
|
|
110
|
-
case "xcodeLight":
|
|
111
|
-
return xcodeLight;
|
|
112
|
-
case "xcodeDark":
|
|
113
|
-
return xcodeDark;
|
|
114
|
-
case "vscodeDark":
|
|
115
|
-
return vscodeDark;
|
|
116
|
-
case "dracula":
|
|
117
|
-
return dracula;
|
|
118
|
-
case "githubLight":
|
|
119
|
-
return githubLight;
|
|
120
|
-
case "githubDark":
|
|
121
|
-
return githubDark;
|
|
122
|
-
case "eclipse":
|
|
123
|
-
return eclipse;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return EditorView.theme({});
|
|
127
|
-
}
|
|
128
|
-
return (_ctx, _cache) => {
|
|
129
|
-
return openBlock(), createElementBlock("div", {
|
|
130
|
-
style: {
|
|
131
|
-
width: "100%"
|
|
132
|
-
},
|
|
133
|
-
ref_key: "cfCodemirrorJsonViewRef",
|
|
134
|
-
ref: cfCodemirrorJsonViewRef,
|
|
135
|
-
id: "cf-codemirror-view-json"
|
|
136
|
-
}, null, 512);
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
});
|
|
1
|
+
import _sfc_main from "./json-view.vue.js";
|
|
140
2
|
export {
|
|
141
3
|
_sfc_main as default
|
|
142
4
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
.amb-container-left[data-v-
|
|
1
|
+
.amb-container-left[data-v-a23fcda3] {
|
|
2
2
|
width: 260px;
|
|
3
3
|
padding-right: 20px;
|
|
4
4
|
overflow-y: auto;
|
|
5
5
|
}
|
|
6
|
-
.amb-container-main[data-v-
|
|
6
|
+
.amb-container-main[data-v-a23fcda3] {
|
|
7
7
|
padding: 0 10px 0 0;
|
|
8
8
|
}
|
|
9
|
-
.amb-container-main[data-v-
|
|
9
|
+
.amb-container-main[data-v-a23fcda3]::-webkit-scrollbar {
|
|
10
10
|
width: 1px;
|
|
11
11
|
}
|
|
12
|
-
.amb-container-attr[data-v-
|
|
12
|
+
.amb-container-attr[data-v-a23fcda3] {
|
|
13
13
|
width: 300px;
|
|
14
14
|
padding-left: 20px;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
解决右侧弹出属性配置遮罩层打开后页面其他地方无法点击问题
|
|
18
18
|
*/
|
|
19
|
-
[data-v-
|
|
19
|
+
[data-v-a23fcda3]:v-deep(.el-drawer__header) {
|
|
20
20
|
margin-bottom: 0 !important;
|
|
21
21
|
}
|
|
22
|
-
[data-v-
|
|
22
|
+
[data-v-a23fcda3] .el-overlay {
|
|
23
23
|
position: static;
|
|
24
24
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./desginer-index.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const ServiceFlowDesginer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const ServiceFlowDesginer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a23fcda3"]]);
|
|
5
5
|
export {
|
|
6
6
|
ServiceFlowDesginer as default
|
|
7
7
|
};
|
|
@@ -24,7 +24,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
24
|
});
|
|
25
25
|
const serviceFlowContainerRef = ref();
|
|
26
26
|
onMounted(() => {
|
|
27
|
-
const serviceFlowStoreUtil = useServiceFlowStore();
|
|
27
|
+
const serviceFlowStoreUtil = useServiceFlowStore(window["$pinia"]);
|
|
28
28
|
serviceFlowStoreUtil.setPageContext(props.pageContext);
|
|
29
29
|
loadTreeData();
|
|
30
30
|
if (serviceFlowContainerRef.value) {
|
|
@@ -4,7 +4,7 @@ import { json } from "@codemirror/lang-json";
|
|
|
4
4
|
import { EditorState } from "@codemirror/state";
|
|
5
5
|
import http from "agilebuilder-ui/src/utils/request";
|
|
6
6
|
import LogicFlow from "@logicflow/core";
|
|
7
|
-
import _sfc_main$2 from "../../common/components/json-view/json-view.
|
|
7
|
+
import _sfc_main$2 from "../../common/components/json-view/json-view.vue.js";
|
|
8
8
|
import { vscodeDark } from "@uiw/codemirror-themes-all";
|
|
9
9
|
import _sfc_main$1 from "./request-params.vue.js";
|
|
10
10
|
const _hoisted_1 = { class: "dialog-footer" };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
|
-
const jsonView_vue_vue_type_script_setup_true_lang = require("./json-view.
|
|
3
|
+
const jsonView_vue_vue_type_script_setup_true_lang = require("./json-view.vue.js");
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
5
5
|
...{
|
|
6
6
|
name: "JsonViewDialog",
|
|
@@ -1,3 +1,141 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
|
|
2
|
+
const vue = require("vue");
|
|
3
|
+
const codemirror = require("codemirror");
|
|
4
|
+
const langJson = require("@codemirror/lang-json");
|
|
5
|
+
const state = require("@codemirror/state");
|
|
6
|
+
const codemirrorThemesAll = require("@uiw/codemirror-themes-all");
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
8
|
+
...{
|
|
9
|
+
name: "JsonView",
|
|
10
|
+
inheritAttrs: false
|
|
11
|
+
},
|
|
12
|
+
__name: "json-view",
|
|
13
|
+
props: {
|
|
14
|
+
jsonObject: {
|
|
15
|
+
type: Object,
|
|
16
|
+
default: () => {
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
height: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 0
|
|
22
|
+
},
|
|
23
|
+
theme: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: null
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
setup(__props) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const editor = vue.ref(null);
|
|
31
|
+
const cfCodemirrorJsonViewRef = vue.ref();
|
|
32
|
+
const codemirrorHeight = vue.ref("400px");
|
|
33
|
+
vue.watch(
|
|
34
|
+
() => props.jsonObject,
|
|
35
|
+
(newVal) => {
|
|
36
|
+
if (editor.value) {
|
|
37
|
+
loadEditor();
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{ deep: true }
|
|
41
|
+
);
|
|
42
|
+
vue.onMounted(() => {
|
|
43
|
+
vue.nextTick(() => {
|
|
44
|
+
loadEditor();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
function loadEditor() {
|
|
48
|
+
if (editor.value) {
|
|
49
|
+
editor.value.destroy();
|
|
50
|
+
}
|
|
51
|
+
const jsonStr = props.jsonObject ? JSON.stringify(props.jsonObject, null, 2) : "";
|
|
52
|
+
if (props.height) {
|
|
53
|
+
codemirrorHeight.value = props.height + "px";
|
|
54
|
+
} else {
|
|
55
|
+
if (cfCodemirrorJsonViewRef.value) {
|
|
56
|
+
const rect = cfCodemirrorJsonViewRef.value.getBoundingClientRect();
|
|
57
|
+
if (rect.y || rect.y === 0) {
|
|
58
|
+
console.log("window.innerHeight - rect.y", window.innerHeight, rect.y);
|
|
59
|
+
codemirrorHeight.value = window.innerHeight - rect.y - 100 + "px";
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const state2 = getEditorState(jsonStr);
|
|
64
|
+
let element = document.getElementById("cf-codemirror-view-json");
|
|
65
|
+
if (element) {
|
|
66
|
+
editor.value = new codemirror.EditorView({
|
|
67
|
+
state: state2,
|
|
68
|
+
parent: element
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function getEditorState(jsonStr) {
|
|
73
|
+
const mytheme = getTheme();
|
|
74
|
+
const baseTheme = codemirror.EditorView.theme({
|
|
75
|
+
".cm-content, .cm-gutter": { minHeight: codemirrorHeight.value },
|
|
76
|
+
"&": {
|
|
77
|
+
height: codemirrorHeight.value,
|
|
78
|
+
maxHeight: codemirrorHeight.value,
|
|
79
|
+
fontSize: "12px"
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return state.EditorState.create({
|
|
83
|
+
doc: jsonStr,
|
|
84
|
+
extensions: [
|
|
85
|
+
state.EditorState.tabSize.of(16),
|
|
86
|
+
codemirror.basicSetup,
|
|
87
|
+
langJson.jsonLanguage,
|
|
88
|
+
mytheme,
|
|
89
|
+
baseTheme,
|
|
90
|
+
readOnlyFacet.of(true),
|
|
91
|
+
preventChanges
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
const readOnlyFacet = state.Facet.define({ combine: (values) => values.some((a) => a) });
|
|
96
|
+
const preventChanges = state.EditorState.transactionFilter.of((tr) => {
|
|
97
|
+
if (tr.isUserEvent && tr.docChanged && tr.state.facet(readOnlyFacet)) {
|
|
98
|
+
return {
|
|
99
|
+
changes: {
|
|
100
|
+
from: tr.changes.from,
|
|
101
|
+
to: tr.changes.to,
|
|
102
|
+
insert: tr.startState.doc.sliceString(tr.changes.from, tr.changes.to)
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return tr;
|
|
107
|
+
});
|
|
108
|
+
function getTheme() {
|
|
109
|
+
if (props.theme) {
|
|
110
|
+
switch (props.theme) {
|
|
111
|
+
case "xcodeLight":
|
|
112
|
+
return codemirrorThemesAll.xcodeLight;
|
|
113
|
+
case "xcodeDark":
|
|
114
|
+
return codemirrorThemesAll.xcodeDark;
|
|
115
|
+
case "vscodeDark":
|
|
116
|
+
return codemirrorThemesAll.vscodeDark;
|
|
117
|
+
case "dracula":
|
|
118
|
+
return codemirrorThemesAll.dracula;
|
|
119
|
+
case "githubLight":
|
|
120
|
+
return codemirrorThemesAll.githubLight;
|
|
121
|
+
case "githubDark":
|
|
122
|
+
return codemirrorThemesAll.githubDark;
|
|
123
|
+
case "eclipse":
|
|
124
|
+
return codemirrorThemesAll.eclipse;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return codemirror.EditorView.theme({});
|
|
128
|
+
}
|
|
129
|
+
return (_ctx, _cache) => {
|
|
130
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
131
|
+
style: {
|
|
132
|
+
width: "100%"
|
|
133
|
+
},
|
|
134
|
+
ref_key: "cfCodemirrorJsonViewRef",
|
|
135
|
+
ref: cfCodemirrorJsonViewRef,
|
|
136
|
+
id: "cf-codemirror-view-json"
|
|
137
|
+
}, null, 512);
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
module.exports = _sfc_main;
|
|
@@ -1,141 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
const langJson = require("@codemirror/lang-json");
|
|
5
|
-
const state = require("@codemirror/state");
|
|
6
|
-
const codemirrorThemesAll = require("@uiw/codemirror-themes-all");
|
|
7
|
-
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
8
|
-
...{
|
|
9
|
-
name: "JsonView",
|
|
10
|
-
inheritAttrs: false
|
|
11
|
-
},
|
|
12
|
-
__name: "json-view",
|
|
13
|
-
props: {
|
|
14
|
-
jsonObject: {
|
|
15
|
-
type: Object,
|
|
16
|
-
default: () => {
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
height: {
|
|
20
|
-
type: Number,
|
|
21
|
-
default: 0
|
|
22
|
-
},
|
|
23
|
-
theme: {
|
|
24
|
-
type: String,
|
|
25
|
-
default: null
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
setup(__props) {
|
|
29
|
-
const props = __props;
|
|
30
|
-
const editor = vue.ref(null);
|
|
31
|
-
const cfCodemirrorJsonViewRef = vue.ref();
|
|
32
|
-
const codemirrorHeight = vue.ref("400px");
|
|
33
|
-
vue.watch(
|
|
34
|
-
() => props.jsonObject,
|
|
35
|
-
(newVal) => {
|
|
36
|
-
if (editor.value) {
|
|
37
|
-
loadEditor();
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
{ deep: true }
|
|
41
|
-
);
|
|
42
|
-
vue.onMounted(() => {
|
|
43
|
-
vue.nextTick(() => {
|
|
44
|
-
loadEditor();
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
function loadEditor() {
|
|
48
|
-
if (editor.value) {
|
|
49
|
-
editor.value.destroy();
|
|
50
|
-
}
|
|
51
|
-
const jsonStr = props.jsonObject ? JSON.stringify(props.jsonObject, null, 2) : "";
|
|
52
|
-
if (props.height) {
|
|
53
|
-
codemirrorHeight.value = props.height + "px";
|
|
54
|
-
} else {
|
|
55
|
-
if (cfCodemirrorJsonViewRef.value) {
|
|
56
|
-
const rect = cfCodemirrorJsonViewRef.value.getBoundingClientRect();
|
|
57
|
-
if (rect.y || rect.y === 0) {
|
|
58
|
-
console.log("window.innerHeight - rect.y", window.innerHeight, rect.y);
|
|
59
|
-
codemirrorHeight.value = window.innerHeight - rect.y - 100 + "px";
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
const state2 = getEditorState(jsonStr);
|
|
64
|
-
let element = document.getElementById("cf-codemirror-view-json");
|
|
65
|
-
if (element) {
|
|
66
|
-
editor.value = new codemirror.EditorView({
|
|
67
|
-
state: state2,
|
|
68
|
-
parent: element
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function getEditorState(jsonStr) {
|
|
73
|
-
const mytheme = getTheme();
|
|
74
|
-
const baseTheme = codemirror.EditorView.theme({
|
|
75
|
-
".cm-content, .cm-gutter": { minHeight: codemirrorHeight.value },
|
|
76
|
-
"&": {
|
|
77
|
-
height: codemirrorHeight.value,
|
|
78
|
-
maxHeight: codemirrorHeight.value,
|
|
79
|
-
fontSize: "12px"
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
return state.EditorState.create({
|
|
83
|
-
doc: jsonStr,
|
|
84
|
-
extensions: [
|
|
85
|
-
state.EditorState.tabSize.of(16),
|
|
86
|
-
codemirror.basicSetup,
|
|
87
|
-
langJson.jsonLanguage,
|
|
88
|
-
mytheme,
|
|
89
|
-
baseTheme,
|
|
90
|
-
readOnlyFacet.of(true),
|
|
91
|
-
preventChanges
|
|
92
|
-
]
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
const readOnlyFacet = state.Facet.define({ combine: (values) => values.some((a) => a) });
|
|
96
|
-
const preventChanges = state.EditorState.transactionFilter.of((tr) => {
|
|
97
|
-
if (tr.isUserEvent && tr.docChanged && tr.state.facet(readOnlyFacet)) {
|
|
98
|
-
return {
|
|
99
|
-
changes: {
|
|
100
|
-
from: tr.changes.from,
|
|
101
|
-
to: tr.changes.to,
|
|
102
|
-
insert: tr.startState.doc.sliceString(tr.changes.from, tr.changes.to)
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
return tr;
|
|
107
|
-
});
|
|
108
|
-
function getTheme() {
|
|
109
|
-
if (props.theme) {
|
|
110
|
-
switch (props.theme) {
|
|
111
|
-
case "xcodeLight":
|
|
112
|
-
return codemirrorThemesAll.xcodeLight;
|
|
113
|
-
case "xcodeDark":
|
|
114
|
-
return codemirrorThemesAll.xcodeDark;
|
|
115
|
-
case "vscodeDark":
|
|
116
|
-
return codemirrorThemesAll.vscodeDark;
|
|
117
|
-
case "dracula":
|
|
118
|
-
return codemirrorThemesAll.dracula;
|
|
119
|
-
case "githubLight":
|
|
120
|
-
return codemirrorThemesAll.githubLight;
|
|
121
|
-
case "githubDark":
|
|
122
|
-
return codemirrorThemesAll.githubDark;
|
|
123
|
-
case "eclipse":
|
|
124
|
-
return codemirrorThemesAll.eclipse;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return codemirror.EditorView.theme({});
|
|
128
|
-
}
|
|
129
|
-
return (_ctx, _cache) => {
|
|
130
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
131
|
-
style: {
|
|
132
|
-
width: "100%"
|
|
133
|
-
},
|
|
134
|
-
ref_key: "cfCodemirrorJsonViewRef",
|
|
135
|
-
ref: cfCodemirrorJsonViewRef,
|
|
136
|
-
id: "cf-codemirror-view-json"
|
|
137
|
-
}, null, 512);
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
module.exports = _sfc_main;
|
|
2
|
+
const jsonView_vue_vue_type_script_setup_true_lang = require("./json-view.vue.js");
|
|
3
|
+
module.exports = jsonView_vue_vue_type_script_setup_true_lang;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
.amb-container-left[data-v-
|
|
1
|
+
.amb-container-left[data-v-a23fcda3] {
|
|
2
2
|
width: 260px;
|
|
3
3
|
padding-right: 20px;
|
|
4
4
|
overflow-y: auto;
|
|
5
5
|
}
|
|
6
|
-
.amb-container-main[data-v-
|
|
6
|
+
.amb-container-main[data-v-a23fcda3] {
|
|
7
7
|
padding: 0 10px 0 0;
|
|
8
8
|
}
|
|
9
|
-
.amb-container-main[data-v-
|
|
9
|
+
.amb-container-main[data-v-a23fcda3]::-webkit-scrollbar {
|
|
10
10
|
width: 1px;
|
|
11
11
|
}
|
|
12
|
-
.amb-container-attr[data-v-
|
|
12
|
+
.amb-container-attr[data-v-a23fcda3] {
|
|
13
13
|
width: 300px;
|
|
14
14
|
padding-left: 20px;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
解决右侧弹出属性配置遮罩层打开后页面其他地方无法点击问题
|
|
18
18
|
*/
|
|
19
|
-
[data-v-
|
|
19
|
+
[data-v-a23fcda3]:v-deep(.el-drawer__header) {
|
|
20
20
|
margin-bottom: 0 !important;
|
|
21
21
|
}
|
|
22
|
-
[data-v-
|
|
22
|
+
[data-v-a23fcda3] .el-overlay {
|
|
23
23
|
position: static;
|
|
24
24
|
}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
const desginerIndex_vue_vue_type_script_setup_true_lang = require("./desginer-index.vue2.js");
|
|
3
3
|
;/* empty css */
|
|
4
4
|
const _pluginVue_exportHelper = require("../_virtual/_plugin-vue_export-helper.js");
|
|
5
|
-
const ServiceFlowDesginer = /* @__PURE__ */ _pluginVue_exportHelper(desginerIndex_vue_vue_type_script_setup_true_lang, [["__scopeId", "data-v-
|
|
5
|
+
const ServiceFlowDesginer = /* @__PURE__ */ _pluginVue_exportHelper(desginerIndex_vue_vue_type_script_setup_true_lang, [["__scopeId", "data-v-a23fcda3"]]);
|
|
6
6
|
module.exports = ServiceFlowDesginer;
|
|
@@ -25,7 +25,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
25
25
|
});
|
|
26
26
|
const serviceFlowContainerRef = vue.ref();
|
|
27
27
|
vue.onMounted(() => {
|
|
28
|
-
const serviceFlowStoreUtil = pageStore.useServiceFlowStore();
|
|
28
|
+
const serviceFlowStoreUtil = pageStore.useServiceFlowStore(window["$pinia"]);
|
|
29
29
|
serviceFlowStoreUtil.setPageContext(props.pageContext);
|
|
30
30
|
loadTreeData();
|
|
31
31
|
if (serviceFlowContainerRef.value) {
|
|
@@ -5,7 +5,7 @@ const langJson = require("@codemirror/lang-json");
|
|
|
5
5
|
const state = require("@codemirror/state");
|
|
6
6
|
const http = require("agilebuilder-ui/src/utils/request");
|
|
7
7
|
const LogicFlow = require("@logicflow/core");
|
|
8
|
-
const jsonView_vue_vue_type_script_setup_true_lang = require("../../common/components/json-view/json-view.
|
|
8
|
+
const jsonView_vue_vue_type_script_setup_true_lang = require("../../common/components/json-view/json-view.vue.js");
|
|
9
9
|
const codemirrorThemesAll = require("@uiw/codemirror-themes-all");
|
|
10
10
|
const requestParams_vue_vue_type_script_setup_true_lang = require("./request-params.vue.js");
|
|
11
11
|
const _hoisted_1 = { class: "dialog-footer" };
|