service-flow-designer 2.0.21 → 2.0.29

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.
@@ -2,7 +2,7 @@ import { ElDialog } from "element-plus/es";
2
2
  import "element-plus/es/components/base/style/css";
3
3
  import "element-plus/es/components/dialog/style/css";
4
4
  import { defineComponent, ref, watch, openBlock, createBlock, withCtx, createVNode } from "vue";
5
- import _sfc_main$1 from "./json-view.vue.js";
5
+ import _sfc_main$1 from "./json-view.vue2.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  ...{
8
8
  name: "JsonViewDialog",
@@ -1,142 +1,4 @@
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
- });
1
+ import _sfc_main from "./json-view.vue2.js";
140
2
  export {
141
3
  _sfc_main as default
142
4
  };
@@ -1,4 +1,142 @@
1
- import _sfc_main from "./json-view.vue.js";
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
  };
@@ -14,7 +14,7 @@ import { json } from "@codemirror/lang-json";
14
14
  import { EditorState } from "@codemirror/state";
15
15
  import http from "agilebuilder-ui/src/utils/request";
16
16
  import LogicFlow from "@logicflow/core";
17
- import _sfc_main$2 from "../../common/components/json-view/json-view.vue.js";
17
+ import _sfc_main$2 from "../../common/components/json-view/json-view.vue2.js";
18
18
  import { vscodeDark } from "@uiw/codemirror-themes-all";
19
19
  import _sfc_main$1 from "./request-params.vue.js";
20
20
  const _hoisted_1 = { class: "dialog-footer" };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./view-index.vue2.js";
2
2
  import "./view-index.vue3.js";
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const ServiceFlowView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ff04c7d7"]]);
4
+ const ServiceFlowView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c4ef30f9"]]);
5
5
  export {
6
6
  ServiceFlowView as default
7
7
  };
@@ -18,7 +18,7 @@ import "../service-components/index.js";
18
18
  import { findServcieByCode, isDeepEqual } from "../common/util/node-util.js";
19
19
  import { useServiceFlowStore } from "../../stores/page-store.js";
20
20
  import { ElMessageBox, ElMessage } from "element-plus";
21
- const _withScopeId = (n) => (pushScopeId("data-v-ff04c7d7"), n = n(), popScopeId(), n);
21
+ const _withScopeId = (n) => (pushScopeId("data-v-c4ef30f9"), n = n(), popScopeId(), n);
22
22
  const _hoisted_1 = {
23
23
  class: "amb-design-content",
24
24
  ref: "ambServiceFlowContent"
@@ -223,7 +223,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
223
223
  saveService2.log = JSON.stringify(saveService2.log);
224
224
  saveService2.flow = JSON.stringify(saveService2.flow);
225
225
  saveService2.returnValues = JSON.stringify(saveService2.returnValues);
226
- http.post("/component/super-page-design/service-flow", { designLog: description, appServiceFlow: saveService2 }).then((res) => {
226
+ http.post(window["$vueApp"].config.globalProperties.baseAPI + "/component/super-page-design/service-flow", {
227
+ designLog: description,
228
+ appServiceFlow: saveService2
229
+ }).then((res) => {
227
230
  if (res) {
228
231
  ElMessage({
229
232
  message: "保存成功",
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./service-list.vue2.js";
2
2
  import "./service-list.vue3.js";
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const ServiceList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2badb0bb"]]);
4
+ const ServiceList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-286d914e"]]);
5
5
  export {
6
6
  ServiceList as default
7
7
  };
@@ -15,8 +15,8 @@ import { v4 } from "uuid";
15
15
  import http from "agilebuilder-ui/src/utils/request";
16
16
  import { findServcieByCode } from "../common/util/node-util.js";
17
17
  import { useServiceFlowStore } from "../../stores/page-store.js";
18
- import { ElMessage } from "element-plus";
19
- const _withScopeId = (n) => (pushScopeId("data-v-2badb0bb"), n = n(), popScopeId(), n);
18
+ import { ElMessage, ElMessageBox } from "element-plus";
19
+ const _withScopeId = (n) => (pushScopeId("data-v-286d914e"), n = n(), popScopeId(), n);
20
20
  const _hoisted_1 = { class: "custom-tree-node" };
21
21
  const _hoisted_2 = { style: { "margin-left": "5px", "line-height": "14px", "font-size": "14px" } };
22
22
  const _hoisted_3 = { class: "dialog-footer" };
@@ -108,9 +108,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
108
108
  ElMessage.warning("名称不能为空");
109
109
  return;
110
110
  }
111
- if (!serviceFlow.value.customCode) {
112
- ElMessage.warning("自定义编码不能为空");
113
- return;
111
+ if ("MENU" !== serviceFlow.value.type) {
112
+ if (!serviceFlow.value.customCode) {
113
+ ElMessage.warning("自定义编码不能为空");
114
+ return;
115
+ }
114
116
  }
115
117
  console.log("保存服务基本信息:", serviceFlow.value);
116
118
  if (!serviceFlow.value.systemCode) {
@@ -150,6 +152,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
150
152
  ElMessage.warning("该节点下存在子节点,不能删除!");
151
153
  return;
152
154
  }
155
+ ElMessageBox.confirm("确定要删除吗?", "确认", {
156
+ confirmButtonText: "确定",
157
+ cancelButtonText: "取消",
158
+ type: "warning"
159
+ }).then(({ value }) => {
160
+ _deleteService();
161
+ });
162
+ };
163
+ const _deleteService = () => {
153
164
  http.delete(window["$vueApp"].config.globalProperties.baseAPI + "/component/super-page-design/service-flow", {
154
165
  data: [contextMenuData.value.id]
155
166
  }).then((res) => {
@@ -247,6 +258,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
247
258
  ref: serviceTreeRef,
248
259
  data: __props.serviceTreeData,
249
260
  props: treeProps,
261
+ "expand-on-click-node": false,
250
262
  "default-expand-all": true,
251
263
  "check-strictly": true,
252
264
  "highlight-current": "",
@@ -308,18 +320,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
308
320
  ])
309
321
  ]),
310
322
  default: withCtx(() => [
311
- createVNode(_component_el_form_item, {
312
- label: "名称:",
313
- required: true
314
- }, {
315
- default: withCtx(() => [
316
- createVNode(_component_el_input, {
317
- modelValue: serviceFlow.value.name,
318
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => serviceFlow.value.name = $event)
319
- }, null, 8, ["modelValue"])
320
- ]),
321
- _: 1
322
- }),
323
323
  editType.value === "SERVICE" ? (openBlock(), createBlock(_component_el_form_item, {
324
324
  key: 0,
325
325
  label: "自定义编码:",
@@ -329,11 +329,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
329
329
  createVNode(_component_el_input, {
330
330
  disabled: serviceFlow.value.id,
331
331
  modelValue: serviceFlow.value.customCode,
332
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => serviceFlow.value.customCode = $event)
332
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => serviceFlow.value.customCode = $event)
333
333
  }, null, 8, ["disabled", "modelValue"])
334
334
  ]),
335
335
  _: 1
336
- })) : createCommentVNode("", true)
336
+ })) : createCommentVNode("", true),
337
+ createVNode(_component_el_form_item, {
338
+ label: "          名称:",
339
+ required: true
340
+ }, {
341
+ default: withCtx(() => [
342
+ createVNode(_component_el_input, {
343
+ modelValue: serviceFlow.value.name,
344
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => serviceFlow.value.name = $event)
345
+ }, null, 8, ["modelValue"])
346
+ ]),
347
+ _: 1
348
+ })
337
349
  ]),
338
350
  _: 1
339
351
  }, 8, ["modelValue", "title"]),