@kp-ui/lowcode 1.0.42 → 1.0.44
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/_virtual/virtual_svg-icons-register.js +2 -2
- package/designer.js +13 -22
- package/index.js +6 -2
- package/package.json +28 -28
- package/render.js +58 -6
- package/src/components/form-designer/designer.js +16 -11
- package/src/components/form-designer/form-widget/field-widget/button-list-widget.vue.js +12 -4
- package/src/components/form-designer/form-widget/index.vue.js +15 -5
- package/src/components/form-designer/setting-panel/form-setting.vue.js +114 -152
- package/src/components/form-designer/setting-panel/property-editor/button-list-editor.vue.js +33 -4
- package/src/components/form-designer/setting-panel/property-editor/button-postion-editor.vue.js +23 -0
- package/src/components/form-designer/setting-panel/property-editor/button-postion-editor.vue2.js +16 -0
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-showButtonsColumn-editor.vue.js +5 -3
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +192 -222
- package/src/components/form-designer/setting-panel/property-editor/index.js +2 -1
- package/src/components/form-designer/setting-panel/propertyRegister.js +2 -1
- package/src/components/form-designer/toolbar-panel/index.vue.js +2 -1
- package/src/components/form-designer/widget-panel/basicFields/buttonList.js +1 -0
- package/src/components/form-render/SubmitButtonRender.vue.js +101 -0
- package/src/components/form-render/SubmitButtonRender.vue2.js +4 -0
- package/src/components/form-render/dynamic-dialog.vue.js +92 -58
- package/src/components/public/methoad-item.vue.js +132 -0
- package/src/components/public/methoad-item.vue2.js +4 -0
- package/src/constants/index.js +13 -0
- package/src/lang/zh-CN.js +2 -0
- package/src/utils/i18n.js +16 -3
- package/src/utils/smart-vue-i18n/index.js +1 -1
- package/src/utils/util.js +6 -0
- package/styles/style.css +1 -1
- package/types/install.d.ts +3 -1
- package/types/install.d.ts.map +1 -1
- package/types/src/components/form-designer/form-widget/index.d.ts.map +1 -1
- package/types/src/components/form-designer/index.d.ts +1 -3
- package/types/src/components/form-designer/index.d.ts.map +1 -1
- package/types/src/components/form-designer/setting-panel/index.d.ts +1 -0
- package/types/src/components/form-designer/widget-panel/basicFields/buttonList.d.ts.map +1 -1
- package/types/src/components/form-render/SubmitButtonRender.d.ts +32 -0
- package/types/src/components/form-render/SubmitButtonRender.d.ts.map +1 -0
- package/types/src/components/form-render/dynamic-dialog.d.ts +129 -0
- package/types/src/components/form-render/dynamic-dialog.d.ts.map +1 -0
- package/types/src/components/form-render/index.d.ts +15 -1
- package/types/src/components/form-render/index.d.ts.map +1 -1
- package/types/src/constants/index.d.ts +4 -0
- package/types/src/constants/index.d.ts.map +1 -1
- package/src/utils/config.js +0 -4
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, resolveComponent, createBlock, openBlock, withCtx, createCommentVNode, createTextVNode, toDisplayString } from "vue";
|
|
2
|
+
import { useI18n } from "../../utils/i18n.js";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "SubmitButtonRender",
|
|
5
|
+
props: {
|
|
6
|
+
options: {},
|
|
7
|
+
ctx: {}
|
|
8
|
+
},
|
|
9
|
+
emits: ["update:dialogVisible"],
|
|
10
|
+
setup(__props, { emit: __emit }) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
const emit = __emit;
|
|
13
|
+
const isSubmitting = ref(false);
|
|
14
|
+
const isClosing = ref(false);
|
|
15
|
+
const { i18nt } = useI18n();
|
|
16
|
+
const cancelBtnLabel = computed(
|
|
17
|
+
() => props.options.cancelButtonLabel || i18nt("designer.hint.cancel")
|
|
18
|
+
);
|
|
19
|
+
const okBtnLabel = computed(
|
|
20
|
+
() => props.options.okButtonLabel || i18nt("designer.hint.confirm")
|
|
21
|
+
);
|
|
22
|
+
const executeCustomFunction = async (ctx, functionBody) => {
|
|
23
|
+
if (!functionBody) return true;
|
|
24
|
+
try {
|
|
25
|
+
const customFn = new Function(functionBody);
|
|
26
|
+
return await customFn.call(ctx);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error("执行自定义函数失败:", error);
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const closeDialog = () => {
|
|
33
|
+
emit("update:dialogVisible", false);
|
|
34
|
+
setTimeout(props.options.deleteWrapperNode, 150);
|
|
35
|
+
};
|
|
36
|
+
const handleCancelClick = async () => {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
if (isClosing.value) return;
|
|
39
|
+
try {
|
|
40
|
+
isClosing.value = true;
|
|
41
|
+
if (!((_b = (_a = props.options).handleBeforeClose) == null ? void 0 : _b.call(_a))) return;
|
|
42
|
+
const result = await executeCustomFunction(
|
|
43
|
+
props.ctx,
|
|
44
|
+
props.options.onCancelButtonClick
|
|
45
|
+
);
|
|
46
|
+
if (result === false) return;
|
|
47
|
+
closeDialog();
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error("取消操作失败:", error);
|
|
50
|
+
} finally {
|
|
51
|
+
isClosing.value = false;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const handleOkClick = async () => {
|
|
55
|
+
if (isSubmitting.value) return;
|
|
56
|
+
try {
|
|
57
|
+
isSubmitting.value = true;
|
|
58
|
+
const result = await executeCustomFunction(props.ctx, props.options.onOkButtonClick);
|
|
59
|
+
if (result === false) return;
|
|
60
|
+
closeDialog();
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.error("提交操作失败:", error);
|
|
63
|
+
} finally {
|
|
64
|
+
isSubmitting.value = false;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return (_ctx, _cache) => {
|
|
68
|
+
const _component_a_button = resolveComponent("a-button");
|
|
69
|
+
const _component_a_space = resolveComponent("a-space");
|
|
70
|
+
return openBlock(), createBlock(_component_a_space, { x: 8 }, {
|
|
71
|
+
default: withCtx(() => [
|
|
72
|
+
_ctx.options.cancelButtonHidden ? (openBlock(), createBlock(_component_a_button, {
|
|
73
|
+
key: "cancelButtonHidden",
|
|
74
|
+
loading: isClosing.value,
|
|
75
|
+
onClick: handleCancelClick
|
|
76
|
+
}, {
|
|
77
|
+
default: withCtx(() => [
|
|
78
|
+
createTextVNode(toDisplayString(cancelBtnLabel.value), 1)
|
|
79
|
+
]),
|
|
80
|
+
_: 1
|
|
81
|
+
}, 8, ["loading"])) : createCommentVNode("", true),
|
|
82
|
+
_ctx.options.okButtonHidden ? (openBlock(), createBlock(_component_a_button, {
|
|
83
|
+
type: "primary",
|
|
84
|
+
key: "okButtonHidden",
|
|
85
|
+
loading: isSubmitting.value,
|
|
86
|
+
onClick: handleOkClick
|
|
87
|
+
}, {
|
|
88
|
+
default: withCtx(() => [
|
|
89
|
+
createTextVNode(toDisplayString(okBtnLabel.value), 1)
|
|
90
|
+
]),
|
|
91
|
+
_: 1
|
|
92
|
+
}, 8, ["loading"])) : createCommentVNode("", true)
|
|
93
|
+
]),
|
|
94
|
+
_: 1
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
export {
|
|
100
|
+
_sfc_main as default
|
|
101
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineAsyncComponent, resolveComponent, createBlock, openBlock, withCtx, createVNode, mergeProps, createElementVNode, createCommentVNode, createTextVNode, toDisplayString } from "vue";
|
|
2
1
|
import i18n from "../../utils/i18n.js";
|
|
3
2
|
import zhCN from "ant-design-vue/es/locale/zh_CN";
|
|
3
|
+
import { defineAsyncComponent, resolveComponent, resolveDirective, createBlock, openBlock, withCtx, createVNode, mergeProps, withDirectives, createElementBlock, createElementVNode } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
6
|
const _sfc_main = {
|
|
@@ -49,24 +49,33 @@ const _sfc_main = {
|
|
|
49
49
|
VFormRender: defineAsyncComponent(() => import("../../../render.js"))
|
|
50
50
|
},
|
|
51
51
|
data() {
|
|
52
|
+
const elLocaleMap = {
|
|
53
|
+
"zh-CN": { ...zhCN },
|
|
54
|
+
"en-US": {}
|
|
55
|
+
};
|
|
52
56
|
return {
|
|
57
|
+
isSubmitting: false,
|
|
58
|
+
// 添加提交状态标记
|
|
59
|
+
isClosing: false,
|
|
60
|
+
// 添加关闭状态标记
|
|
53
61
|
isLoading: true,
|
|
54
62
|
dialogVisible: false,
|
|
55
|
-
elLocaleMap
|
|
56
|
-
"zh-CN": { ...zhCN },
|
|
57
|
-
"en-US": {}
|
|
58
|
-
}
|
|
63
|
+
elLocaleMap
|
|
59
64
|
};
|
|
60
65
|
},
|
|
61
66
|
created() {
|
|
62
67
|
},
|
|
63
68
|
computed: {
|
|
64
69
|
elLocale() {
|
|
65
|
-
const curLocale = localStorage.getItem("
|
|
70
|
+
const curLocale = localStorage.getItem("lowcode_local") || "zh-CN";
|
|
66
71
|
return this.elLocaleMap[curLocale];
|
|
67
72
|
},
|
|
68
73
|
parentForm() {
|
|
69
|
-
return {
|
|
74
|
+
return {
|
|
75
|
+
...this.parentFormRef,
|
|
76
|
+
parentDom: this,
|
|
77
|
+
getParentFormRef: this.getParentFormRef
|
|
78
|
+
};
|
|
70
79
|
},
|
|
71
80
|
otherAttrs() {
|
|
72
81
|
if (this.options.cancelButtonHidden && this.options.okButtonHidden) {
|
|
@@ -89,24 +98,44 @@ const _sfc_main = {
|
|
|
89
98
|
methods: {
|
|
90
99
|
async loadFormCode() {
|
|
91
100
|
if (this.options.formCode) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
101
|
+
this.isLoading = true;
|
|
102
|
+
try {
|
|
103
|
+
const res = await this.$http.get(`/api/tmgc2-query/dataQuery/detail/FormDefinitionManagement`, {
|
|
104
|
+
params: { code: this.options.formCode }
|
|
105
|
+
}).then((res2) => res2.data.object.frontendDefinition || "{}");
|
|
106
|
+
const formJson = JSON.parse(res);
|
|
107
|
+
console.log("formJson: ", formJson);
|
|
108
|
+
this.$refs.dFormRef.setFormJson(formJson);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
}
|
|
111
|
+
this.isLoading = false;
|
|
96
112
|
}
|
|
97
113
|
},
|
|
114
|
+
setLoading(status) {
|
|
115
|
+
this.isLoading = status;
|
|
116
|
+
},
|
|
117
|
+
setFormJson(formJson) {
|
|
118
|
+
this.$refs.dFormRef.setFormJson(formJson);
|
|
119
|
+
},
|
|
98
120
|
setTitle(title) {
|
|
99
121
|
this.options.title = title;
|
|
100
122
|
},
|
|
123
|
+
beforeOpen() {
|
|
124
|
+
this.isLoading = true;
|
|
125
|
+
this.dialogVisible = true;
|
|
126
|
+
},
|
|
101
127
|
show() {
|
|
102
128
|
this.dialogVisible = true;
|
|
103
129
|
this.$nextTick(() => {
|
|
130
|
+
var _a;
|
|
104
131
|
if (!!this.options.readMode) {
|
|
105
132
|
this.$refs["dFormRef"].setReadMode(true);
|
|
106
133
|
}
|
|
107
134
|
this.loadFormCode();
|
|
108
|
-
this.$refs["dFormRef"].setDialogOrDrawerRef(this);
|
|
109
|
-
this.parentFormRef
|
|
135
|
+
(_a = this.$refs["dFormRef"]) == null ? void 0 : _a.setDialogOrDrawerRef(this);
|
|
136
|
+
if (this.parentFormRef) {
|
|
137
|
+
this.parentFormRef.setChildFormRef(this.$refs["dFormRef"]);
|
|
138
|
+
}
|
|
110
139
|
this.handleOpenedEvent();
|
|
111
140
|
});
|
|
112
141
|
},
|
|
@@ -122,7 +151,9 @@ const _sfc_main = {
|
|
|
122
151
|
setTimeout(this.deleteWrapperNode, 150);
|
|
123
152
|
},
|
|
124
153
|
deleteWrapperNode() {
|
|
125
|
-
const wrapperNode = document.getElementById(
|
|
154
|
+
const wrapperNode = document.getElementById(
|
|
155
|
+
"vf-dynamic-dialog-wrapper" + this.wrapperId
|
|
156
|
+
);
|
|
126
157
|
if (!!wrapperNode) {
|
|
127
158
|
document.body.removeChild(wrapperNode);
|
|
128
159
|
}
|
|
@@ -146,19 +177,29 @@ const _sfc_main = {
|
|
|
146
177
|
}
|
|
147
178
|
},
|
|
148
179
|
handleCancelClick() {
|
|
180
|
+
if (this.isClosing) return;
|
|
149
181
|
if (!this.handleBeforeClose()) return;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
182
|
+
try {
|
|
183
|
+
this.isClosing = true;
|
|
184
|
+
if (!!this.options.onCancelButtonClick) {
|
|
185
|
+
const customFn = new Function(this.options.onCancelButtonClick);
|
|
186
|
+
const clickResult = customFn.call(this);
|
|
187
|
+
if (clickResult === false) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
155
190
|
}
|
|
191
|
+
this.dialogVisible = false;
|
|
192
|
+
setTimeout(this.deleteWrapperNode, 150);
|
|
193
|
+
} catch (error) {
|
|
194
|
+
console.log("error: ", error);
|
|
195
|
+
} finally {
|
|
196
|
+
this.isClosing = false;
|
|
156
197
|
}
|
|
157
|
-
this.dialogVisible = false;
|
|
158
|
-
setTimeout(this.deleteWrapperNode, 150);
|
|
159
198
|
},
|
|
160
199
|
async handleOkClick() {
|
|
200
|
+
if (this.isSubmitting) return;
|
|
161
201
|
try {
|
|
202
|
+
this.isSubmitting = true;
|
|
162
203
|
if (!!this.options.onOkButtonClick) {
|
|
163
204
|
const customFn = new Function(this.options.onOkButtonClick);
|
|
164
205
|
const clickResult = await customFn.call(this);
|
|
@@ -170,6 +211,8 @@ const _sfc_main = {
|
|
|
170
211
|
setTimeout(this.deleteWrapperNode, 150);
|
|
171
212
|
} catch (error) {
|
|
172
213
|
console.log("error: ", error);
|
|
214
|
+
} finally {
|
|
215
|
+
this.isClosing = false;
|
|
173
216
|
}
|
|
174
217
|
},
|
|
175
218
|
getParentFormRef() {
|
|
@@ -182,18 +225,25 @@ const _sfc_main = {
|
|
|
182
225
|
getWidgetRef(widgetName, showError = false) {
|
|
183
226
|
return this.$refs["dFormRef"].getWidgetRef(widgetName, showError);
|
|
184
227
|
},
|
|
228
|
+
updateTable() {
|
|
229
|
+
var _a, _b, _c;
|
|
230
|
+
if ((_c = (_b = (_a = this.vfCtx) == null ? void 0 : _a.parent) == null ? void 0 : _b.exposed) == null ? void 0 : _c.updateTable) {
|
|
231
|
+
this.vfCtx.parent.exposed.updateTable();
|
|
232
|
+
}
|
|
233
|
+
},
|
|
185
234
|
getExtraData() {
|
|
186
235
|
return this.extraData;
|
|
187
236
|
}
|
|
188
237
|
}
|
|
189
238
|
};
|
|
190
|
-
const _hoisted_1 =
|
|
191
|
-
const _hoisted_2 = { class: "footer-
|
|
239
|
+
const _hoisted_1 = { class: "dialog-content" };
|
|
240
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("div", { class: "footer-left" }, null, -1);
|
|
241
|
+
const _hoisted_3 = /* @__PURE__ */ createElementVNode("div", { class: "footer-right" }, null, -1);
|
|
192
242
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
193
243
|
const _component_VFormRender = resolveComponent("VFormRender");
|
|
194
|
-
const _component_a_button = resolveComponent("a-button");
|
|
195
244
|
const _component_a_modal = resolveComponent("a-modal");
|
|
196
245
|
const _component_a_config_provider = resolveComponent("a-config-provider");
|
|
246
|
+
const _directive_loading = resolveDirective("loading");
|
|
197
247
|
return openBlock(), createBlock(_component_a_config_provider, {
|
|
198
248
|
locale: $options.elLocale,
|
|
199
249
|
input: { autocomplete: "off" }
|
|
@@ -220,42 +270,26 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
220
270
|
onCancel: $options.handleCloseEvent
|
|
221
271
|
}, $options.otherAttrs), {
|
|
222
272
|
footer: withCtx(() => [
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
!$props.options.cancelButtonHidden ? (openBlock(), createBlock(_component_a_button, {
|
|
226
|
-
key: 0,
|
|
227
|
-
onClick: $options.handleCancelClick
|
|
228
|
-
}, {
|
|
229
|
-
default: withCtx(() => [
|
|
230
|
-
createTextVNode(toDisplayString($options.cancelBtnLabel), 1)
|
|
231
|
-
]),
|
|
232
|
-
_: 1
|
|
233
|
-
}, 8, ["onClick"])) : createCommentVNode("", true),
|
|
234
|
-
!$props.options.okButtonHidden ? (openBlock(), createBlock(_component_a_button, {
|
|
235
|
-
key: 1,
|
|
236
|
-
type: "primary",
|
|
237
|
-
onClick: $options.handleOkClick
|
|
238
|
-
}, {
|
|
239
|
-
default: withCtx(() => [
|
|
240
|
-
createTextVNode(toDisplayString($options.okBtnLabel), 1)
|
|
241
|
-
]),
|
|
242
|
-
_: 1
|
|
243
|
-
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
244
|
-
])
|
|
273
|
+
_hoisted_2,
|
|
274
|
+
_hoisted_3
|
|
245
275
|
]),
|
|
246
276
|
default: withCtx(() => [
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
277
|
+
withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
|
|
278
|
+
createVNode(_component_VFormRender, {
|
|
279
|
+
isLoading: $data.isLoading,
|
|
280
|
+
ref: "dFormRef",
|
|
281
|
+
"form-json": $props.formJson,
|
|
282
|
+
"form-data": $props.formData,
|
|
283
|
+
vfCtx: $props.vfCtx,
|
|
284
|
+
"option-data": $props.optionData,
|
|
285
|
+
"global-dsv": $props.globalDsv,
|
|
286
|
+
"parent-form": $options.parentForm,
|
|
287
|
+
"disabled-mode": $props.options.disabledMode,
|
|
288
|
+
"dynamic-creation": true
|
|
289
|
+
}, null, 8, ["isLoading", "form-json", "form-data", "vfCtx", "option-data", "global-dsv", "parent-form", "disabled-mode"])
|
|
290
|
+
])), [
|
|
291
|
+
[_directive_loading, $data.isLoading]
|
|
292
|
+
])
|
|
259
293
|
]),
|
|
260
294
|
_: 1
|
|
261
295
|
}, 16, ["transitionName", "maskTransitionName", "title", "bodyStyle", "visible", "width", "mask", "maskClosable", "keyboard", "onCancel"])
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { defineComponent, ref, resolveComponent, createElementBlock, openBlock, Fragment, createVNode, withCtx, createTextVNode, normalizeClass, toDisplayString, unref, createElementVNode } from "vue";
|
|
2
|
+
import { useI18n } from "../../utils/i18n.js";
|
|
3
|
+
import CodeEditor from "../code-editor/index.vue.js";
|
|
4
|
+
import { message } from "ant-design-vue";
|
|
5
|
+
const _hoisted_1 = { class: "dialog-footer" };
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "methoad-item",
|
|
8
|
+
props: {
|
|
9
|
+
value: {},
|
|
10
|
+
eventName: {},
|
|
11
|
+
eventParamsMap: {},
|
|
12
|
+
formConfig: {},
|
|
13
|
+
getFormEventHandled: {}
|
|
14
|
+
},
|
|
15
|
+
emits: ["update:value"],
|
|
16
|
+
setup(__props, { emit: __emit }) {
|
|
17
|
+
const { i18nt } = useI18n();
|
|
18
|
+
const props = __props;
|
|
19
|
+
const emit = __emit;
|
|
20
|
+
const ecEditor = ref();
|
|
21
|
+
const formEventHandlerCode = ref("");
|
|
22
|
+
const showFormEventDialogFlag = ref(false);
|
|
23
|
+
const editFormEventHandler = (eventName) => {
|
|
24
|
+
formEventHandlerCode.value = props.formConfig[eventName];
|
|
25
|
+
showFormEventDialogFlag.value = true;
|
|
26
|
+
};
|
|
27
|
+
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
|
+
emit("update:value", formEventHandlerCode.value);
|
|
42
|
+
showFormEventDialogFlag.value = false;
|
|
43
|
+
};
|
|
44
|
+
return (_ctx, _cache) => {
|
|
45
|
+
const _component_a_button = resolveComponent("a-button");
|
|
46
|
+
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
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
50
|
+
createVNode(_component_a_form_item, {
|
|
51
|
+
label: _ctx.eventName,
|
|
52
|
+
"label-width": "150px"
|
|
53
|
+
}, {
|
|
54
|
+
default: withCtx(() => [
|
|
55
|
+
createVNode(_component_a_button, {
|
|
56
|
+
type: "info",
|
|
57
|
+
plain: "",
|
|
58
|
+
shape: "round",
|
|
59
|
+
class: normalizeClass([_ctx.getFormEventHandled(_ctx.eventName) ? "button-text-highlight" : ""]),
|
|
60
|
+
onClick: _cache[0] || (_cache[0] = ($event) => editFormEventHandler(_ctx.eventName))
|
|
61
|
+
}, {
|
|
62
|
+
default: withCtx(() => [
|
|
63
|
+
createTextVNode(toDisplayString(unref(i18nt)("designer.setting.addEventHandler")), 1)
|
|
64
|
+
]),
|
|
65
|
+
_: 1
|
|
66
|
+
}, 8, ["class"]),
|
|
67
|
+
createTextVNode(" " + toDisplayString(_ctx.moduleValue), 1)
|
|
68
|
+
]),
|
|
69
|
+
_: 1
|
|
70
|
+
}, 8, ["label"]),
|
|
71
|
+
createVNode(_component_a_modal, {
|
|
72
|
+
title: unref(i18nt)("designer.setting.editFormEventHandler"),
|
|
73
|
+
visible: showFormEventDialogFlag.value,
|
|
74
|
+
"onUpdate:visible": _cache[3] || (_cache[3] = ($event) => showFormEventDialogFlag.value = $event),
|
|
75
|
+
"show-close": true,
|
|
76
|
+
"custom-class": "drag-dialog small-padding-dialog",
|
|
77
|
+
"append-to-body": "",
|
|
78
|
+
"close-on-click-modal": false,
|
|
79
|
+
"close-on-press-escape": false,
|
|
80
|
+
"destroy-on-close": true,
|
|
81
|
+
width: 800
|
|
82
|
+
}, {
|
|
83
|
+
footer: withCtx(() => [
|
|
84
|
+
createElementVNode("div", _hoisted_1, [
|
|
85
|
+
createVNode(_component_a_button, {
|
|
86
|
+
onClick: _cache[2] || (_cache[2] = ($event) => showFormEventDialogFlag.value = false)
|
|
87
|
+
}, {
|
|
88
|
+
default: withCtx(() => [
|
|
89
|
+
createTextVNode(toDisplayString(unref(i18nt)("designer.hint.cancel")), 1)
|
|
90
|
+
]),
|
|
91
|
+
_: 1
|
|
92
|
+
}),
|
|
93
|
+
createVNode(_component_a_button, {
|
|
94
|
+
type: "primary",
|
|
95
|
+
onClick: saveFormEventHandler
|
|
96
|
+
}, {
|
|
97
|
+
default: withCtx(() => [
|
|
98
|
+
createTextVNode(toDisplayString(unref(i18nt)("designer.hint.confirm")), 1)
|
|
99
|
+
]),
|
|
100
|
+
_: 1
|
|
101
|
+
})
|
|
102
|
+
])
|
|
103
|
+
]),
|
|
104
|
+
default: withCtx(() => [
|
|
105
|
+
createVNode(_component_a_alert, {
|
|
106
|
+
type: "info",
|
|
107
|
+
closable: false,
|
|
108
|
+
message: "form." + _ctx.eventParamsMap[_ctx.eventName]
|
|
109
|
+
}, null, 8, ["message"]),
|
|
110
|
+
createVNode(CodeEditor, {
|
|
111
|
+
mode: "javascript",
|
|
112
|
+
readonly: false,
|
|
113
|
+
modelValue: formEventHandlerCode.value,
|
|
114
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => formEventHandlerCode.value = $event),
|
|
115
|
+
ref_key: "ecEditor",
|
|
116
|
+
ref: ecEditor
|
|
117
|
+
}, null, 8, ["modelValue"]),
|
|
118
|
+
createVNode(_component_a_alert, {
|
|
119
|
+
type: "info",
|
|
120
|
+
closable: false,
|
|
121
|
+
message: "}"
|
|
122
|
+
})
|
|
123
|
+
]),
|
|
124
|
+
_: 1
|
|
125
|
+
}, 8, ["title", "visible"])
|
|
126
|
+
], 64);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
export {
|
|
131
|
+
_sfc_main as default
|
|
132
|
+
};
|
package/src/lang/zh-CN.js
CHANGED
|
@@ -235,6 +235,7 @@ const zhLocale = {
|
|
|
235
235
|
fileTypes: "上传文件类型",
|
|
236
236
|
fileTypesHelp: "支持添加其他文件类型",
|
|
237
237
|
headers: "上传请求头",
|
|
238
|
+
danger: "危险按钮",
|
|
238
239
|
cellWidth: "宽度",
|
|
239
240
|
cellHeight: "高度",
|
|
240
241
|
gridColHeight: "栅格列统一高度(px)",
|
|
@@ -307,6 +308,7 @@ const zhLocale = {
|
|
|
307
308
|
leftPosition: "左边",
|
|
308
309
|
labelAlign: "字段标签对齐",
|
|
309
310
|
buttonList: "按钮组",
|
|
311
|
+
buttonPosition: "按钮组位置",
|
|
310
312
|
leftAlign: "居左",
|
|
311
313
|
centerAlign: "居中",
|
|
312
314
|
rightAlign: "居右",
|
package/src/utils/i18n.js
CHANGED
|
@@ -32,12 +32,12 @@ const langResources = {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
const i18n = createI18n({
|
|
35
|
-
locale: localStorage.getItem("
|
|
35
|
+
locale: localStorage.getItem("lowcode_local") || "zh-CN",
|
|
36
36
|
messages: langResources
|
|
37
37
|
});
|
|
38
38
|
const changeLocale = function(langName) {
|
|
39
39
|
i18n.setLang(langName);
|
|
40
|
-
localStorage.setItem("
|
|
40
|
+
localStorage.setItem("lowcode_local", langName);
|
|
41
41
|
};
|
|
42
42
|
const i18n$1 = {
|
|
43
43
|
methods: {
|
|
@@ -50,7 +50,20 @@ const i18n$1 = {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
function useI18n() {
|
|
54
|
+
const i18nt = (key) => {
|
|
55
|
+
return i18n.$st(key);
|
|
56
|
+
};
|
|
57
|
+
const i18n2t = (key1, key2) => {
|
|
58
|
+
return i18n.$st2(key1, key2);
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
i18nt,
|
|
62
|
+
i18n2t
|
|
63
|
+
};
|
|
64
|
+
}
|
|
53
65
|
export {
|
|
54
66
|
changeLocale,
|
|
55
|
-
i18n$1 as default
|
|
67
|
+
i18n$1 as default,
|
|
68
|
+
useI18n
|
|
56
69
|
};
|
package/src/utils/util.js
CHANGED
|
@@ -305,6 +305,10 @@ function getDefaultFormConfig() {
|
|
|
305
305
|
labelAlign: "right",
|
|
306
306
|
cssCode: "",
|
|
307
307
|
customClass: [],
|
|
308
|
+
okButtonLabel: "",
|
|
309
|
+
okButtonHidden: "",
|
|
310
|
+
cancelButtonHidden: "",
|
|
311
|
+
cancelButtonLabel: "",
|
|
308
312
|
functions: "",
|
|
309
313
|
//全局函数
|
|
310
314
|
layoutType: "PC",
|
|
@@ -321,6 +325,8 @@ function getDefaultFormConfig() {
|
|
|
321
325
|
})
|
|
322
326
|
`,
|
|
323
327
|
onFormDataChange: "",
|
|
328
|
+
onOkButtonClick: "",
|
|
329
|
+
onCancelButtonClick: "",
|
|
324
330
|
serveList: {
|
|
325
331
|
vformUpdate: {
|
|
326
332
|
http: {
|