service-flow-designer 2.1.32 → 2.1.36

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.
Files changed (27) hide show
  1. package/dist/es/designer/common/components/sql-view/index.d.ts +4 -0
  2. package/dist/es/designer/common/components/sql-view/sql-view-dialog.vue.d.ts +36 -0
  3. package/dist/es/designer/common/components/sql-view/sql-view-dialog.vue.js +63 -0
  4. package/dist/es/designer/common/components/sql-view/sql-view-dialog.vue2.js +4 -0
  5. package/dist/es/designer/common/components/sql-view/sql-view.vue.d.ts +32 -0
  6. package/dist/es/designer/common/components/sql-view/sql-view.vue.js +4 -0
  7. package/dist/es/designer/common/components/sql-view/sql-view.vue2.js +98 -0
  8. package/dist/es/designer/service-components/database/aggregate-query/config.vue.d.ts +18 -0
  9. package/dist/es/designer/service-components/database/aggregate-query/config.vue.js +1 -1
  10. package/dist/es/designer/service-components/database/aggregate-query/config.vue2.js +55 -12
  11. package/dist/es/designer/service-components/database/regular-query/config.vue.d.ts +18 -0
  12. package/dist/es/designer/service-components/database/regular-query/config.vue.js +1 -1
  13. package/dist/es/designer/service-components/database/regular-query/config.vue2.js +70 -25
  14. package/dist/es/designer/service-flow-view/flow-util.d.ts +2 -0
  15. package/dist/es/designer/service-flow-view/flow-util.js +16 -0
  16. package/dist/es/designer/service-flow-view/service-node-config.vue.d.ts +9 -0
  17. package/dist/es/designer/service-flow-view/service-node-config.vue.js +1 -1
  18. package/dist/es/designer/service-flow-view/service-node-config.vue2.js +6 -1
  19. package/dist/es/designer/service-flow-view/service-test/service-test.vue.js +0 -1
  20. package/dist/es/designer/service-flow-view/service-update-log.vue.js +1 -1
  21. package/dist/es/designer/service-flow-view/service-update-log.vue2.js +47 -21
  22. package/dist/es/designer/service-flow-view/view-index.vue.js +1 -1
  23. package/dist/es/designer/service-flow-view/view-index.vue2.js +3 -2
  24. package/dist/es/style.css +252 -252
  25. package/dist/es/utils/common-util.d.ts +1 -0
  26. package/dist/es/utils/common-util.js +13 -0
  27. package/package.json +2 -2
@@ -0,0 +1,4 @@
1
+ import { default as SqlView } from './sql-view.vue';
2
+ import { default as SqlViewDialog } from './sql-view-dialog.vue';
3
+
4
+ export { SqlView, SqlViewDialog };
@@ -0,0 +1,36 @@
1
+ declare const _default: import('vue').DefineComponent<{
2
+ sql: {
3
+ type: StringConstructor;
4
+ default: any;
5
+ };
6
+ appendToBody: {
7
+ type: BooleanConstructor;
8
+ default: boolean;
9
+ };
10
+ modelValue: {
11
+ type: BooleanConstructor;
12
+ default: boolean;
13
+ };
14
+ }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
15
+ "update:modelValue": (...args: any[]) => void;
16
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
17
+ sql: {
18
+ type: StringConstructor;
19
+ default: any;
20
+ };
21
+ appendToBody: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
25
+ modelValue: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ }>> & {
30
+ "onUpdate:modelValue"?: (...args: any[]) => any;
31
+ }, {
32
+ modelValue: boolean;
33
+ appendToBody: boolean;
34
+ sql: string;
35
+ }, {}>;
36
+ export default _default;
@@ -0,0 +1,63 @@
1
+ import { ElDialog } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/dialog/style/css";
4
+ import { defineComponent, ref, watch, openBlock, createBlock, withCtx, createVNode } from "vue";
5
+ import _sfc_main$1 from "./sql-view.vue2.js";
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ ...{
8
+ name: "SqlViewDialog",
9
+ inheritAttrs: false
10
+ },
11
+ __name: "sql-view-dialog",
12
+ props: {
13
+ sql: {
14
+ type: String,
15
+ default: null
16
+ },
17
+ appendToBody: {
18
+ type: Boolean,
19
+ default: true
20
+ },
21
+ modelValue: {
22
+ type: Boolean,
23
+ default: false
24
+ }
25
+ },
26
+ emits: ["update:modelValue"],
27
+ setup(__props, { emit: __emit }) {
28
+ const props = __props;
29
+ const emits = __emit;
30
+ const showJsonVisible = ref(false);
31
+ watch(
32
+ () => props.modelValue,
33
+ (newVal) => {
34
+ if (newVal) {
35
+ showJsonVisible.value = true;
36
+ }
37
+ }
38
+ );
39
+ const close = () => {
40
+ showJsonVisible.value = false;
41
+ emits("update:modelValue", false);
42
+ };
43
+ return (_ctx, _cache) => {
44
+ const _component_el_dialog = ElDialog;
45
+ return openBlock(), createBlock(_component_el_dialog, {
46
+ modelValue: showJsonVisible.value,
47
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => showJsonVisible.value = $event),
48
+ "append-to-body": __props.appendToBody,
49
+ title: "SQL预览",
50
+ width: "600",
51
+ onClose: close
52
+ }, {
53
+ default: withCtx(() => [
54
+ createVNode(_sfc_main$1, { sql: __props.sql }, null, 8, ["sql"])
55
+ ]),
56
+ _: 1
57
+ }, 8, ["modelValue", "append-to-body"]);
58
+ };
59
+ }
60
+ });
61
+ export {
62
+ _sfc_main as default
63
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./sql-view-dialog.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,32 @@
1
+ declare const _default: import('vue').DefineComponent<{
2
+ sql: {
3
+ type: StringConstructor;
4
+ default: any;
5
+ };
6
+ height: {
7
+ type: NumberConstructor;
8
+ default: number;
9
+ };
10
+ theme: {
11
+ type: StringConstructor;
12
+ default: any;
13
+ };
14
+ }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
15
+ sql: {
16
+ type: StringConstructor;
17
+ default: any;
18
+ };
19
+ height: {
20
+ type: NumberConstructor;
21
+ default: number;
22
+ };
23
+ theme: {
24
+ type: StringConstructor;
25
+ default: any;
26
+ };
27
+ }>>, {
28
+ height: number;
29
+ theme: string;
30
+ sql: string;
31
+ }, {}>;
32
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./sql-view.vue2.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,98 @@
1
+ import { defineComponent, ref, onMounted, nextTick, openBlock, createElementBlock } from "vue";
2
+ import { EditorView, basicSetup } from "codemirror";
3
+ import { sql } from "@codemirror/lang-sql";
4
+ import { Facet, EditorState } from "@codemirror/state";
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ ...{
7
+ name: "SqlView",
8
+ inheritAttrs: false
9
+ },
10
+ __name: "sql-view",
11
+ props: {
12
+ sql: {
13
+ type: String,
14
+ default: null
15
+ },
16
+ height: {
17
+ type: Number,
18
+ default: 0
19
+ },
20
+ theme: {
21
+ type: String,
22
+ default: null
23
+ }
24
+ },
25
+ setup(__props) {
26
+ const props = __props;
27
+ const editor = ref(null);
28
+ const cfCodemirrorJsonViewRef = ref();
29
+ const codemirrorHeight = ref("400px");
30
+ onMounted(() => {
31
+ nextTick(() => {
32
+ loadEditor();
33
+ });
34
+ });
35
+ function loadEditor() {
36
+ if (editor.value) {
37
+ editor.value.destroy();
38
+ }
39
+ if (props.height) {
40
+ codemirrorHeight.value = props.height + "px";
41
+ } else {
42
+ if (cfCodemirrorJsonViewRef.value) {
43
+ const rect = cfCodemirrorJsonViewRef.value.getBoundingClientRect();
44
+ if (rect.y || rect.y === 0) {
45
+ console.log("window.innerHeight - rect.y", window.innerHeight, rect.y);
46
+ codemirrorHeight.value = window.innerHeight - rect.y - 100 + "px";
47
+ }
48
+ }
49
+ }
50
+ const state = getEditorState();
51
+ let element = document.getElementById("cf-codemirror-view-json");
52
+ if (element) {
53
+ editor.value = new EditorView({
54
+ state,
55
+ parent: element
56
+ });
57
+ }
58
+ }
59
+ const readOnlyFacet = Facet.define({ combine: (values) => values.some((a) => a) });
60
+ function getEditorState() {
61
+ const mytheme = EditorView.theme({});
62
+ const baseTheme = EditorView.theme({
63
+ ".cm-content, .cm-gutter": { minHeight: codemirrorHeight.value },
64
+ "&": {
65
+ height: codemirrorHeight.value,
66
+ maxHeight: codemirrorHeight.value,
67
+ fontSize: "12px"
68
+ }
69
+ });
70
+ return EditorState.create({
71
+ doc: props.sql,
72
+ extensions: [
73
+ EditorState.tabSize.of(16),
74
+ basicSetup,
75
+ sql(),
76
+ mytheme,
77
+ baseTheme,
78
+ readOnlyFacet.of(true),
79
+ EditorView.updateListener.of(function(value) {
80
+ })
81
+ ]
82
+ });
83
+ }
84
+ return (_ctx, _cache) => {
85
+ return openBlock(), createElementBlock("div", {
86
+ style: {
87
+ width: "100%"
88
+ },
89
+ ref_key: "cfCodemirrorJsonViewRef",
90
+ ref: cfCodemirrorJsonViewRef,
91
+ id: "cf-codemirror-view-json"
92
+ }, null, 512);
93
+ };
94
+ }
95
+ });
96
+ export {
97
+ _sfc_main as default
98
+ };
@@ -15,6 +15,14 @@ declare const _default: import('vue').DefineComponent<{
15
15
  type: ObjectConstructor;
16
16
  default: () => {};
17
17
  };
18
+ pageContext: {
19
+ type: ObjectConstructor;
20
+ default: () => {};
21
+ };
22
+ service: {
23
+ type: ObjectConstructor;
24
+ default: () => {};
25
+ };
18
26
  }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
19
27
  properties: {
20
28
  type: ObjectConstructor;
@@ -32,8 +40,18 @@ declare const _default: import('vue').DefineComponent<{
32
40
  type: ObjectConstructor;
33
41
  default: () => {};
34
42
  };
43
+ pageContext: {
44
+ type: ObjectConstructor;
45
+ default: () => {};
46
+ };
47
+ service: {
48
+ type: ObjectConstructor;
49
+ default: () => {};
50
+ };
35
51
  }>>, {
52
+ pageContext: Record<string, any>;
36
53
  properties: Record<string, any>;
54
+ service: Record<string, any>;
37
55
  logicFlowInstance: Record<string, any>;
38
56
  currentNode: Record<string, any>;
39
57
  }, {}>;
@@ -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-ac2ec342"]]);
4
+ const config = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dac15197"]]);
5
5
  export {
6
6
  config as default
7
7
  };
@@ -8,13 +8,13 @@ import "element-plus/es/components/alert/style/css";
8
8
  import "element-plus/es/components/form-item/style/css";
9
9
  import "element-plus/es/components/input/style/css";
10
10
  import "element-plus/es/components/button/style/css";
11
- import { defineComponent, ref, onMounted, openBlock, createElementBlock, createVNode, withCtx, unref, createTextVNode, createElementVNode, pushScopeId, popScopeId } from "vue";
12
- import { Search, Check } from "@element-plus/icons-vue";
11
+ import { defineComponent, ref, onMounted, openBlock, createElementBlock, createVNode, withCtx, unref, createElementVNode, createTextVNode, pushScopeId, popScopeId } from "vue";
12
+ import { Search, View, Check } from "@element-plus/icons-vue";
13
13
  import ValueSetInput from "../../../common/components/value-set-input/value-set-input.vue.js";
14
14
  import DatatableSelect from "../../../common/components/datatable-select.vue.js";
15
15
  import { useServiceFlowStore } from "../../../../stores/page-store.js";
16
- import { queryTableFields, updateServiceParams, updateServiceReturns } from "../../../../utils/common-util.js";
17
- import "agilebuilder-ui/src/utils/request";
16
+ import { queryTableFields, updateServiceParams, updateServiceReturns, getBaseUrl } from "../../../../utils/common-util.js";
17
+ import http from "agilebuilder-ui/src/utils/request";
18
18
  import "uuid";
19
19
  import _sfc_main$2 from "./dimension-statistical.vue.js";
20
20
  import "element-plus/es/components/table/style/css";
@@ -27,11 +27,17 @@ import _sfc_main$3 from "./statistical-formula.vue.js";
27
27
  import _sfc_main$4 from "./filter-conditions.vue.js";
28
28
  import _sfc_main$5 from "./sort-conditions.vue.js";
29
29
  import _sfc_main$1 from "../../../common/components/node-base-config.vue.js";
30
+ import { getNodeRuntimeObject } from "../../../service-flow-view/flow-util.js";
31
+ import "codemirror";
32
+ import "@codemirror/lang-sql";
33
+ import "@codemirror/state";
34
+ import _sfc_main$6 from "../../../common/components/sql-view/sql-view-dialog.vue.js";
30
35
  import "element-plus/es/components/message/style/css";
31
- const _withScopeId = (n) => (pushScopeId("data-v-ac2ec342"), n = n(), popScopeId(), n);
32
- const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("br", null, null, -1));
36
+ const _withScopeId = (n) => (pushScopeId("data-v-dac15197"), n = n(), popScopeId(), n);
37
+ const _hoisted_1 = { style: { "position": "absolute", "right": "0" } };
33
38
  const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("br", null, null, -1));
34
- const _hoisted_3 = { style: { "display": "flex" } };
39
+ const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("br", null, null, -1));
40
+ const _hoisted_4 = { style: { "display": "flex" } };
35
41
  const _sfc_main = /* @__PURE__ */ defineComponent({
36
42
  __name: "config",
37
43
  props: {
@@ -52,6 +58,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
52
58
  default: () => {
53
59
  return {};
54
60
  }
61
+ },
62
+ pageContext: {
63
+ type: Object,
64
+ default: () => ({})
65
+ },
66
+ service: {
67
+ type: Object,
68
+ default: () => ({})
55
69
  }
56
70
  },
57
71
  setup(__props, { expose: __expose }) {
@@ -74,6 +88,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
74
88
  props.properties.result.valueSetScope = "all";
75
89
  }
76
90
  const autoCreateFieldType = ref("array");
91
+ const showSqlViewDialog = ref(false);
92
+ const sql = ref("");
77
93
  function valueSetScopeChange() {
78
94
  if (props.properties.result.valueSetScope == "first") {
79
95
  autoCreateFieldType.value = "object";
@@ -106,7 +122,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
106
122
  systemCode.value = props.properties.dataTableSystemCode;
107
123
  updateTableColumns();
108
124
  };
109
- const statisticsColumnChange = (value) => {
125
+ const statisticsColumnChange = () => {
110
126
  sortColumns.value = [];
111
127
  const selectColumns = [];
112
128
  if (props.properties.statistics) {
@@ -153,6 +169,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
153
169
  const fieldType = props.properties.result.valueSetScope == "first" ? "object" : "array";
154
170
  updateServiceReturns(props.properties.result.setTo, fieldType, sortColumns.value);
155
171
  }
172
+ function viewSql() {
173
+ sql.value = "";
174
+ const node = getNodeRuntimeObject(props.logicFlowInstance.getNodeModelById(props.currentNode.data.id), props.service);
175
+ node["props"] = JSON.parse(JSON.stringify(props.properties));
176
+ const baseUrl = getBaseUrl(props.pageContext.backendUrl, props.pageContext.isTest);
177
+ http.post(baseUrl + "/dsc/service-flow/test/database-node/show-sql", node).then((res) => {
178
+ showSqlViewDialog.value = true;
179
+ sql.value = res;
180
+ });
181
+ }
156
182
  __expose({});
157
183
  return (_ctx, _cache) => {
158
184
  const _component_el_button = ElButton;
@@ -187,6 +213,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
187
213
  ]),
188
214
  _: 1
189
215
  }, 8, ["modelValue"]),
216
+ createElementVNode("span", _hoisted_1, [
217
+ createVNode(_component_el_button, {
218
+ type: "primary",
219
+ icon: unref(View),
220
+ onClick: viewSql
221
+ }, {
222
+ default: withCtx(() => [
223
+ createTextVNode("预览sql")
224
+ ]),
225
+ _: 1
226
+ }, 8, ["icon"])
227
+ ]),
190
228
  createVNode(DatatableSelect, {
191
229
  visible: showSelectTable.value,
192
230
  "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => showSelectTable.value = $event),
@@ -218,9 +256,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
218
256
  }, {
219
257
  default: withCtx(() => [
220
258
  createTextVNode("说明:1.支持自定义日期格式,同SimpleDateFormat,yyyy表示年,MM表示2位月..."),
221
- _hoisted_1,
222
- createTextVNode("           2.未指定新字段名时,输出字段名同选择的字段名"),
223
259
  _hoisted_2,
260
+ createTextVNode("           2.未指定新字段名时,输出字段名同选择的字段名"),
261
+ _hoisted_3,
224
262
  createTextVNode("           3.动态维度值有填写时需要匹配才会执行此分组")
225
263
  ]),
226
264
  _: 1
@@ -311,7 +349,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
311
349
  style: { "width": "100%" }
312
350
  }, {
313
351
  default: withCtx(() => [
314
- createElementVNode("div", _hoisted_3, [
352
+ createElementVNode("div", _hoisted_4, [
315
353
  createVNode(unref(ValueSetInput), {
316
354
  width: "260",
317
355
  paramTypes: ["service"],
@@ -347,7 +385,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
347
385
  })
348
386
  ]),
349
387
  _: 1
350
- })
388
+ }),
389
+ createVNode(unref(_sfc_main$6), {
390
+ sql: sql.value,
391
+ "model-value": showSqlViewDialog.value,
392
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => showSqlViewDialog.value = $event)
393
+ }, null, 8, ["sql", "model-value"])
351
394
  ]);
352
395
  };
353
396
  }
@@ -15,6 +15,14 @@ declare const _default: import('vue').DefineComponent<{
15
15
  type: ObjectConstructor;
16
16
  default: () => {};
17
17
  };
18
+ pageContext: {
19
+ type: ObjectConstructor;
20
+ default: () => {};
21
+ };
22
+ service: {
23
+ type: ObjectConstructor;
24
+ default: () => {};
25
+ };
18
26
  }, {
19
27
  onClose: () => Record<string, any>;
20
28
  }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
@@ -34,8 +42,18 @@ declare const _default: import('vue').DefineComponent<{
34
42
  type: ObjectConstructor;
35
43
  default: () => {};
36
44
  };
45
+ pageContext: {
46
+ type: ObjectConstructor;
47
+ default: () => {};
48
+ };
49
+ service: {
50
+ type: ObjectConstructor;
51
+ default: () => {};
52
+ };
37
53
  }>>, {
54
+ pageContext: Record<string, any>;
38
55
  properties: Record<string, any>;
56
+ service: Record<string, any>;
39
57
  logicFlowInstance: Record<string, any>;
40
58
  currentNode: Record<string, any>;
41
59
  }, {}>;
@@ -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-65e38bfb"]]);
4
+ const config = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6fdf85a5"]]);
5
5
  export {
6
6
  config as default
7
7
  };