service-flow-designer 2.1.43 → 2.1.51

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.
@@ -51,7 +51,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
51
51
  onClose: close
52
52
  }, {
53
53
  default: withCtx(() => [
54
- createVNode(_sfc_main$1, { sql: __props.sql }, null, 8, ["sql"])
54
+ createVNode(_sfc_main$1, {
55
+ sql: __props.sql,
56
+ height: 400
57
+ }, null, 8, ["sql"])
55
58
  ]),
56
59
  _: 1
57
60
  }, 8, ["modelValue", "append-to-body"]);
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, onMounted, nextTick, openBlock, createElementBlock } from "vue";
1
+ import { defineComponent, ref, onMounted, nextTick, watch, openBlock, createElementBlock } from "vue";
2
2
  import { EditorView, basicSetup } from "codemirror";
3
3
  import { sql } from "@codemirror/lang-sql";
4
4
  import { Facet, EditorState } from "@codemirror/state";
@@ -32,6 +32,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
32
32
  loadEditor();
33
33
  });
34
34
  });
35
+ watch(
36
+ () => props.sql,
37
+ () => {
38
+ loadEditor();
39
+ }
40
+ );
35
41
  function loadEditor() {
36
42
  if (editor.value) {
37
43
  editor.value.destroy();
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./config.vue2.js";
2
2
  import "./config.vue3.js";
3
3
  import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const config = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6fdf85a5"]]);
4
+ const config = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-43e78808"]]);
5
5
  export {
6
6
  config as default
7
7
  };
@@ -88,9 +88,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
88
88
  if (!props.properties.dataTable || props.properties.dataTable === serviceFlowStoreUtil.pageContext.tableName) {
89
89
  dataTableColumns.value = serviceFlowStoreUtil.pageContext.modelFields;
90
90
  } else {
91
- http.get("/mms/systems/getPublishVersionsByCode/" + props.properties.dataTableSystemCode).then((systems) => {
91
+ const baseAPI = window["$vueApp"].config.globalProperties.baseAPI;
92
+ http.get(baseAPI + "/mms/systems/getPublishVersionsByCode/" + props.properties.dataTableSystemCode).then((systems) => {
92
93
  http.get(
93
- "/mms/data-tables/table-columns?tableName=" + props.properties.dataTable + "&systemCode=" + props.properties.dataTableSystemCode + "&publishVersion=" + systems[systems.length - 1].publishVersion
94
+ baseAPI + "/mms/data-tables/table-columns?tableName=" + props.properties.dataTable + "&systemCode=" + props.properties.dataTableSystemCode + "&publishVersion=" + systems[systems.length - 1].publishVersion
94
95
  ).then((res) => {
95
96
  dataTableColumns.value = res;
96
97
  });
@@ -100,8 +101,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
100
101
  const rowDblclick = (row, column, event) => {
101
102
  row.$editing = true;
102
103
  };
103
- const handleDelete = (index, row, search) => {
104
- search.conditions.splice(index, 1);
104
+ const handleDelete = (index, row, type) => {
105
+ if (type === "sort") {
106
+ props.properties.sort.splice(index, 1);
107
+ } else if (type === "search") {
108
+ props.properties.search.conditions.splice(index, 1);
109
+ }
105
110
  };
106
111
  const addSortColumn = () => {
107
112
  if (!props.properties.sort) {
@@ -119,7 +124,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
119
124
  props.properties.dataTable = result.dataTable.name;
120
125
  props.properties.dataTableSystemCode = result.system.code;
121
126
  http.get(
122
- "/mms/data-tables/table-columns?tableName=" + result.dataTable.name + "&systemCode=" + result.system.code + "&publishVersion=" + result.system.publishVersion
127
+ window["$vueApp"].config.globalProperties.baseAPI + "/mms/data-tables/table-columns?tableName=" + result.dataTable.name + "&systemCode=" + result.system.code + "&publishVersion=" + result.system.publishVersion
123
128
  ).then((res) => {
124
129
  dataTableColumns.value = res;
125
130
  });
@@ -450,7 +455,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
450
455
  size: "small",
451
456
  icon: unref(Minus),
452
457
  circle: "",
453
- onClick: ($event) => handleDelete(scope.$index, scope.row, __props.properties.search)
458
+ onClick: ($event) => handleDelete(scope.$index, scope.row, "search")
454
459
  }, null, 8, ["icon", "onClick"])
455
460
  ]),
456
461
  _: 2
@@ -591,7 +596,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
591
596
  size: "small",
592
597
  icon: unref(Minus),
593
598
  circle: "",
594
- onClick: ($event) => handleDelete(scope.$index, scope.row, __props.properties.search)
599
+ onClick: ($event) => handleDelete(scope.$index, scope.row, "sort")
595
600
  }, null, 8, ["icon", "onClick"])
596
601
  ]),
597
602
  _: 2
@@ -123,10 +123,12 @@ function getNodeRuntimeObject(node, service) {
123
123
  tempNode.children = node.children;
124
124
  }
125
125
  tempNode.tos = [];
126
- const nextNodes = getNextNodeById(node, service.flow);
127
- nextNodes.forEach((nextNode) => {
128
- tempNode.tos.push({ code: nextNode.id });
129
- });
126
+ if (service.flow) {
127
+ const nextNodes = getNextNodeById(node, service.flow);
128
+ nextNodes.forEach((nextNode) => {
129
+ tempNode.tos.push({ code: nextNode.id });
130
+ });
131
+ }
130
132
  return tempNode;
131
133
  }
132
134
  export {
@@ -30,7 +30,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
30
30
  if (!props.service.returnValues) {
31
31
  props.service.returnValues = [];
32
32
  }
33
- const typeOptions = ["any", "array", "object"];
33
+ const typeOptions = ["any", "array", "object", "string", "number", "date"];
34
34
  let selEditRow = null;
35
35
  const rowDblclick = (row) => {
36
36
  row.$editing = true;
@@ -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-286d914e"]]);
4
+ const ServiceList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-da8fc67a"]]);
5
5
  export {
6
6
  ServiceList as default
7
7
  };
@@ -1,22 +1,22 @@
1
- import { ElIcon, ElInput, ElCol, ElButton, ElTooltip, ElRow, ElTree, ElFormItem, ElDialog } from "element-plus/es";
1
+ import { ElIcon, ElInput, ElCol, ElRow, ElButton, ElTooltip, ElTree, ElFormItem, 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 "element-plus/es/components/form-item/style/css";
5
5
  import "element-plus/es/components/tree/style/css";
6
- import "element-plus/es/components/row/style/css";
7
6
  import "element-plus/es/components/tooltip/style/css";
8
7
  import "element-plus/es/components/button/style/css";
8
+ import "element-plus/es/components/row/style/css";
9
9
  import "element-plus/es/components/col/style/css";
10
10
  import "element-plus/es/components/input/style/css";
11
11
  import "element-plus/es/components/icon/style/css";
12
- import { defineComponent, ref, openBlock, createElementBlock, createVNode, withCtx, unref, createElementVNode, createBlock, toDisplayString, createTextVNode, createCommentVNode, withDirectives, vShow, pushScopeId, popScopeId } from "vue";
12
+ import { defineComponent, ref, openBlock, createElementBlock, createVNode, withCtx, unref, createElementVNode, createTextVNode, createBlock, toDisplayString, createCommentVNode, withDirectives, vShow, pushScopeId, popScopeId } from "vue";
13
13
  import { Search, Plus, Menu, Promotion } from "@element-plus/icons-vue";
14
14
  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
18
  import { ElMessage, ElMessageBox } from "element-plus";
19
- const _withScopeId = (n) => (pushScopeId("data-v-286d914e"), n = n(), popScopeId(), n);
19
+ const _withScopeId = (n) => (pushScopeId("data-v-da8fc67a"), 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" };
@@ -77,11 +77,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
77
77
  };
78
78
  const addRootServiceMenu = () => {
79
79
  editType.value = "MENU";
80
- createService();
80
+ createService("root");
81
81
  };
82
82
  const addServce = (type) => {
83
83
  editType.value = type;
84
- createService();
84
+ createService("leaf");
85
85
  };
86
86
  const editServiceBaseInfo = () => {
87
87
  editType.value = contextMenuData.value.type;
@@ -91,18 +91,89 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
91
91
  }
92
92
  dialogVisible.value = true;
93
93
  };
94
- const createService = () => {
94
+ const createService = (addType) => {
95
95
  serviceFlow.value = {
96
96
  code: v4(),
97
97
  name: "",
98
98
  customCode: "",
99
99
  type: editType.value
100
100
  };
101
- if (contextMenuData.value.id) {
101
+ if (contextMenuData.value.id && addType === "leaf") {
102
102
  serviceFlow.value.parentCode = contextMenuData.value.code;
103
103
  }
104
104
  dialogVisible.value = true;
105
105
  };
106
+ const selectIds = ref([]);
107
+ const handleCheckChange = (data, checked, indeterminate) => {
108
+ if (checked) {
109
+ selectIds.value.push(data.id);
110
+ if (data.children && data.children.length > 0) {
111
+ data.children.forEach((item) => {
112
+ if (selectIds.value.indexOf(item.id) == -1) {
113
+ selectIds.value.push(item.id);
114
+ }
115
+ });
116
+ }
117
+ } else {
118
+ selectIds.value.splice(selectIds.value.indexOf(data.id), 1);
119
+ if (data.children && data.children.length > 0) {
120
+ data.children.forEach((item) => {
121
+ let index = selectIds.value.indexOf(item.id);
122
+ if (index > -1) {
123
+ selectIds.value.splice(index, 1);
124
+ }
125
+ });
126
+ }
127
+ }
128
+ };
129
+ const systemCode = serviceFlowStoreUtil.pageContext.systemCode;
130
+ const publishVersion = serviceFlowStoreUtil.pageContext.systemVersion;
131
+ const derive = () => {
132
+ if (selectIds.value.length > 0) {
133
+ http({
134
+ url: window["$vueApp"].config.globalProperties.baseAPI + `/component/super-page-design/service-flow/export/${systemCode}/${publishVersion}`,
135
+ method: "post",
136
+ data: selectIds.value,
137
+ responseType: "blob"
138
+ }).then((res) => {
139
+ let blob = new Blob([res], {
140
+ type: "application/zip"
141
+ });
142
+ let link = document.createElement("a");
143
+ link.href = window.URL.createObjectURL(blob);
144
+ link.download = "服务编排.zip";
145
+ link.click();
146
+ window.URL.revokeObjectURL(link.href);
147
+ });
148
+ } else {
149
+ ElMessage.warning("请选择服务或菜单");
150
+ }
151
+ };
152
+ const processFile = ref(null);
153
+ const selectDataFile = (command) => {
154
+ processFile.value.click();
155
+ };
156
+ const importPage = () => {
157
+ const fileObj = processFile.value.files[0];
158
+ if (fileObj) {
159
+ processFile.value.value = null;
160
+ const param = new FormData();
161
+ param.append("multipartFile", fileObj);
162
+ http({
163
+ url: window["$vueApp"].config.globalProperties.baseAPI + `/component/super-page-design/service-flow/import/${systemCode}/${publishVersion}`,
164
+ method: "post",
165
+ headers: { "Content-Type": "multipart/form-data" },
166
+ data: param
167
+ }).then(() => {
168
+ ElMessage.success("导入成功");
169
+ emits("load-tree-data");
170
+ }).catch((error) => {
171
+ console.log("error==", error);
172
+ });
173
+ } else {
174
+ ElMessage.warning("未选择文件");
175
+ }
176
+ };
106
177
  const saveServiceBaseInfo = () => {
107
178
  if (!serviceFlow.value.name) {
108
179
  ElMessage.warning("名称不能为空");
@@ -198,16 +269,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
198
269
  const _component_el_icon = ElIcon;
199
270
  const _component_el_input = ElInput;
200
271
  const _component_el_col = ElCol;
272
+ const _component_el_row = ElRow;
201
273
  const _component_el_button = ElButton;
202
274
  const _component_el_tooltip = ElTooltip;
203
- const _component_el_row = ElRow;
204
275
  const _component_el_tree = ElTree;
205
276
  const _component_el_form_item = ElFormItem;
206
277
  const _component_el_dialog = ElDialog;
207
278
  return openBlock(), createElementBlock("div", null, [
208
- createVNode(_component_el_row, null, {
279
+ createVNode(_component_el_row, { style: { "margin-bottom": "10px" } }, {
209
280
  default: withCtx(() => [
210
- createVNode(_component_el_col, { span: 18 }, {
281
+ createVNode(_component_el_col, { span: 24 }, {
211
282
  default: withCtx(() => [
212
283
  createVNode(_component_el_input, {
213
284
  modelValue: search.value,
@@ -226,12 +297,59 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
226
297
  }, 8, ["modelValue"])
227
298
  ]),
228
299
  _: 1
229
- }),
230
- createVNode(_component_el_col, {
231
- span: 6,
232
- style: { "text-align": "right" }
233
- }, {
300
+ })
301
+ ]),
302
+ _: 1
303
+ }),
304
+ createVNode(_component_el_row, null, {
305
+ default: withCtx(() => [
306
+ createVNode(_component_el_col, { span: 24 }, {
234
307
  default: withCtx(() => [
308
+ createVNode(_component_el_tooltip, {
309
+ effect: "dark",
310
+ content: "导入",
311
+ placement: "top"
312
+ }, {
313
+ default: withCtx(() => [
314
+ createVNode(_component_el_button, {
315
+ type: "primary",
316
+ onClick: selectDataFile
317
+ }, {
318
+ default: withCtx(() => [
319
+ createElementVNode("input", {
320
+ ref_key: "processFile",
321
+ ref: processFile,
322
+ accept: ".zip",
323
+ name: "processFile",
324
+ style: { "display": "none" },
325
+ type: "file",
326
+ onChange: importPage
327
+ }, null, 544),
328
+ createTextVNode(" 导入 ")
329
+ ]),
330
+ _: 1
331
+ })
332
+ ]),
333
+ _: 1
334
+ }),
335
+ createVNode(_component_el_tooltip, {
336
+ effect: "dark",
337
+ content: "导出",
338
+ placement: "top"
339
+ }, {
340
+ default: withCtx(() => [
341
+ createVNode(_component_el_button, {
342
+ type: "primary",
343
+ onClick: derive
344
+ }, {
345
+ default: withCtx(() => [
346
+ createTextVNode("导出")
347
+ ]),
348
+ _: 1
349
+ })
350
+ ]),
351
+ _: 1
352
+ }),
235
353
  createVNode(_component_el_tooltip, {
236
354
  effect: "dark",
237
355
  content: "添加根菜单",
@@ -257,13 +375,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
257
375
  ref_key: "serviceTreeRef",
258
376
  ref: serviceTreeRef,
259
377
  data: __props.serviceTreeData,
378
+ "node-key": "id",
260
379
  props: treeProps,
380
+ "show-checkbox": "",
261
381
  "expand-on-click-node": false,
262
382
  "default-expand-all": true,
263
- "check-strictly": true,
264
383
  "highlight-current": "",
265
384
  onNodeClick: nodeClick,
266
- onNodeContextmenu: nodeContextmenu
385
+ onNodeContextmenu: nodeContextmenu,
386
+ onCheckChange: handleCheckChange
267
387
  }, {
268
388
  default: withCtx(({ node, data }) => [
269
389
  createElementVNode("span", _hoisted_1, [