@kp-ui/lowcode 1.0.88 → 1.0.89
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/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kp-ui/lowcode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.89",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"module": "index.js",
|
|
8
8
|
"dependencies": {
|
|
9
|
+
"ace-builds": "1.42.0",
|
|
9
10
|
"@kp-ui/tool": "1.0.27",
|
|
10
11
|
"@surely-vue/table": "^5.0.3",
|
|
11
12
|
"animate.css": "^4.1.1",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { basicFieldsEnums } from "./basicFieldsEnums.js";
|
|
2
|
-
import * as index$1 from "./business/index.js";
|
|
3
|
-
import * as index from "./containers/index.js";
|
|
4
2
|
import { advancedFieldsEnums } from "./advancedFieldsEnums.js";
|
|
3
|
+
import * as index from "./containers/index.js";
|
|
4
|
+
import * as index$1 from "./business/index.js";
|
|
5
5
|
const containers = Object.values(index).map((fn) => fn());
|
|
6
6
|
const basicFields = Object.values(basicFieldsEnums).map((fn) => fn());
|
|
7
7
|
const businessFields = Object.values(index$1).map((fn) => fn());
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { defineComponent, ref, resolveComponent, createElementBlock, openBlock, Fragment, createVNode, withCtx, normalizeClass, createTextVNode, toDisplayString, unref
|
|
1
|
+
import { defineComponent, ref, resolveComponent, createElementBlock, openBlock, Fragment, createVNode, withCtx, normalizeClass, createTextVNode, toDisplayString, unref } from "vue";
|
|
2
2
|
import { useI18n } from "../../utils/i18n.js";
|
|
3
|
-
import
|
|
4
|
-
import { message } from "ant-design-vue";
|
|
5
|
-
const _hoisted_1 = { class: "dialog-footer" };
|
|
3
|
+
import { TpfCodeEditor } from "tmgc2-share";
|
|
6
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
5
|
__name: "methoad-item",
|
|
8
6
|
props: {
|
|
@@ -17,35 +15,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
15
|
const { i18nt } = useI18n();
|
|
18
16
|
const props = __props;
|
|
19
17
|
const emit = __emit;
|
|
20
|
-
const
|
|
18
|
+
const codeEditorRef = ref();
|
|
19
|
+
ref();
|
|
21
20
|
const formEventHandlerCode = ref("");
|
|
22
|
-
const showFormEventDialogFlag = ref(false);
|
|
23
21
|
const editFormEventHandler = (eventName) => {
|
|
22
|
+
var _a;
|
|
24
23
|
formEventHandlerCode.value = props.formConfig[eventName];
|
|
25
|
-
|
|
24
|
+
(_a = codeEditorRef.value) == null ? void 0 : _a.open();
|
|
26
25
|
};
|
|
27
26
|
const saveFormEventHandler = () => {
|
|
28
|
-
const codeHints = ecEditor.value.getEditorAnnotations();
|
|
29
|
-
let syntaxErrorFlag = false;
|
|
30
|
-
if (!!codeHints && codeHints.length > 0) {
|
|
31
|
-
codeHints.forEach((chItem) => {
|
|
32
|
-
if (chItem.type === "error") {
|
|
33
|
-
syntaxErrorFlag = true;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
if (syntaxErrorFlag) {
|
|
37
|
-
message.error(i18nt("designer.setting.syntaxCheckWarning"));
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
27
|
emit("update:value", formEventHandlerCode.value);
|
|
42
|
-
showFormEventDialogFlag.value = false;
|
|
43
28
|
};
|
|
44
29
|
return (_ctx, _cache) => {
|
|
45
30
|
const _component_a_button = resolveComponent("a-button");
|
|
46
31
|
const _component_a_form_item = resolveComponent("a-form-item");
|
|
47
|
-
const _component_a_alert = resolveComponent("a-alert");
|
|
48
|
-
const _component_a_modal = resolveComponent("a-modal");
|
|
49
32
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
50
33
|
createVNode(_component_a_form_item, {
|
|
51
34
|
label: _ctx.eventName,
|
|
@@ -67,61 +50,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
67
50
|
]),
|
|
68
51
|
_: 1
|
|
69
52
|
}, 8, ["label"]),
|
|
70
|
-
createVNode(
|
|
53
|
+
createVNode(unref(TpfCodeEditor), {
|
|
54
|
+
isShowEventHeader: true,
|
|
55
|
+
ref_key: "codeEditorRef",
|
|
56
|
+
ref: codeEditorRef,
|
|
57
|
+
"event-header": "form." + _ctx.eventParamsMap[_ctx.eventName],
|
|
58
|
+
modelValue: formEventHandlerCode.value,
|
|
59
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => formEventHandlerCode.value = $event),
|
|
60
|
+
mode: "javascript",
|
|
61
|
+
readonly: false,
|
|
71
62
|
title: unref(i18nt)("designer.setting.editFormEventHandler"),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"show-close": true,
|
|
75
|
-
"custom-class": "drag-dialog small-padding-dialog",
|
|
76
|
-
"append-to-body": "",
|
|
77
|
-
"close-on-click-modal": false,
|
|
78
|
-
"close-on-press-escape": false,
|
|
79
|
-
"destroy-on-close": true,
|
|
80
|
-
width: 800
|
|
81
|
-
}, {
|
|
82
|
-
footer: withCtx(() => [
|
|
83
|
-
createElementVNode("div", _hoisted_1, [
|
|
84
|
-
createVNode(_component_a_button, {
|
|
85
|
-
onClick: _cache[2] || (_cache[2] = ($event) => showFormEventDialogFlag.value = false)
|
|
86
|
-
}, {
|
|
87
|
-
default: withCtx(() => [
|
|
88
|
-
createTextVNode(toDisplayString(unref(i18nt)("designer.hint.cancel")), 1)
|
|
89
|
-
]),
|
|
90
|
-
_: 1
|
|
91
|
-
}),
|
|
92
|
-
createVNode(_component_a_button, {
|
|
93
|
-
type: "primary",
|
|
94
|
-
onClick: saveFormEventHandler
|
|
95
|
-
}, {
|
|
96
|
-
default: withCtx(() => [
|
|
97
|
-
createTextVNode(toDisplayString(unref(i18nt)("designer.hint.confirm")), 1)
|
|
98
|
-
]),
|
|
99
|
-
_: 1
|
|
100
|
-
})
|
|
101
|
-
])
|
|
102
|
-
]),
|
|
103
|
-
default: withCtx(() => [
|
|
104
|
-
createVNode(_component_a_alert, {
|
|
105
|
-
type: "info",
|
|
106
|
-
closable: false,
|
|
107
|
-
message: "form." + _ctx.eventParamsMap[_ctx.eventName]
|
|
108
|
-
}, null, 8, ["message"]),
|
|
109
|
-
createVNode(CodeEditor, {
|
|
110
|
-
mode: "javascript",
|
|
111
|
-
readonly: false,
|
|
112
|
-
modelValue: formEventHandlerCode.value,
|
|
113
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => formEventHandlerCode.value = $event),
|
|
114
|
-
ref_key: "ecEditor",
|
|
115
|
-
ref: ecEditor
|
|
116
|
-
}, null, 8, ["modelValue"]),
|
|
117
|
-
createVNode(_component_a_alert, {
|
|
118
|
-
type: "info",
|
|
119
|
-
closable: false,
|
|
120
|
-
message: "}"
|
|
121
|
-
})
|
|
122
|
-
]),
|
|
123
|
-
_: 1
|
|
124
|
-
}, 8, ["title", "visible"])
|
|
63
|
+
onSetCode: saveFormEventHandler
|
|
64
|
+
}, null, 8, ["event-header", "modelValue", "title"])
|
|
125
65
|
], 64);
|
|
126
66
|
};
|
|
127
67
|
}
|