@kp-ui/lowcode 2.14.0-beta → 2.14.0-beta.2
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/install.js +26 -25
- package/package.json +2 -2
- package/src/components/form-designer/form-widget/field-widget/diy-compontent-widget.vue.js +1 -1
- package/src/components/form-designer/index.vue.js +55 -54
- package/src/components/form-designer/setting-panel/form-crud-setting.vue.js +62 -23
- package/src/components/form-designer/setting-panel/index.vue.js +4 -386
- package/src/components/form-designer/setting-panel/index.vue2.js +273 -0
- package/src/components/form-designer/setting-panel/property-editor/button-list-editor.vue2.js +5 -4
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/customRowEvent/data-table-customRow-editor.vue.js +1 -0
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-dsEnabled-editor.vue.js +5 -4
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-pagination-editor.vue.js +1 -0
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-selections-editor.vue2.js +24 -24
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-showButtonsColumn-editor.vue.js +9 -8
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +1 -1
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +7 -6
- package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/bodyStyle-editor.vue2.js +7 -6
- package/src/components/form-designer/setting-panel/property-editor/customRender-editor.vue.js +2 -40
- package/src/components/form-designer/setting-panel/property-editor/customRender-editor.vue2.js +41 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onClickIcon-editor.vue.js +2 -47
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onClickIcon-editor.vue2.js +44 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue.js +2 -47
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue2.js +43 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onOkButtonClick-editor.vue.js +2 -46
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onOkButtonClick-editor.vue2.js +43 -0
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue.js +2 -47
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue2.js +44 -0
- package/src/components/form-designer/setting-panel/property-editor/field-dropdown/dropdown-menuList-editor.vue.js +2 -66
- package/src/components/form-designer/setting-panel/property-editor/field-dropdown/dropdown-menuList-editor.vue2.js +42 -0
- package/src/components/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue.js +5 -4
- package/src/components/form-designer/setting-panel/property-editor/hidden-editor.vue.js +6 -5
- package/src/components/form-designer/setting-panel/property-editor/index.js +146 -152
- package/src/components/form-designer/setting-panel/property-editor/labelIconClass-editor.vue.js +8 -7
- package/src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue.js +38 -35
- package/src/components/form-designer/setting-panel/propertyRegister.js +0 -12
- package/src/components/form-render/container-item/data-table-item.vue.js +149 -0
- package/src/components/form-render/container-item/grid-col-item.vue.js +149 -0
- package/src/components/form-render/container-item/grid-item.vue.js +92 -0
- package/src/components/form-render/container-item/grid-sub-form-item.vue.js +319 -0
- package/src/components/form-render/container-item/index.js +24 -0
- package/src/components/form-render/container-item/sub-form-item.vue.js +429 -0
- package/src/components/form-render/container-item/tab-item.vue.js +160 -0
- package/src/components/form-render/container-item/table-cell-item.vue.js +95 -0
- package/src/components/form-render/container-item/table-item.vue.js +96 -0
- package/src/components/form-render/container-item/vf-collapse-item.vue.js +252 -0
- package/src/components/form-render/container-item/vf-dialog-item.vue.js +12 -0
- package/src/components/form-render/container-item/vf-drawer-item.vue.js +12 -0
- package/src/components/form-render/index.vue.js +12 -14
- package/src/components/http-editor/index.vue.js +10 -10
- package/src/components/public/ActionButtonListRender.vue.js +19 -24
- package/src/lang/en-US.js +1 -3
- package/src/lang/zh-CN.js +0 -3
- package/src/utils/useEmitter.js +57 -0
- package/src/utils/util.js +50 -49
- package/stats.html +1 -1
- package/styles/style.css +1 -1
- package/src/components/form-designer/setting-panel/property-editor/displayStyle-editor.vue.js +0 -46
- package/src/components/form-designer/setting-panel/property-editor/event-handler/onVformAdd-editor.vue.js +0 -49
- package/src/components/form-designer/setting-panel/property-editor/multipleSelect-editor.vue.js +0 -30
- package/src/components/form-designer/setting-panel/property-editor/uploadTip-editor.vue.js +0 -31
- package/src/components/form-designer/setting-panel/property-editor/uploadURL-editor.vue.js +0 -44
- package/src/components/form-designer/setting-panel/property-editor/withCredentials-editor.vue.js +0 -30
|
@@ -1,390 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import D from "./property-editor/index.js";
|
|
3
|
-
import K from "./form-setting.vue.js";
|
|
4
|
-
import O from "./form-crud-setting.vue.js";
|
|
5
|
-
import V, { propertyRegistered as j } from "./propertyRegister.js";
|
|
6
|
-
import { addWindowResizeHandler as U } from "../../../utils/util.js";
|
|
7
|
-
import I from "../../../utils/i18n.js";
|
|
8
|
-
import { get as z } from "../../../utils/smart-vue-i18n/utils.js";
|
|
9
|
-
import B from "../../../utils/emitter.js";
|
|
10
|
-
import L from "../../code-editor/code-modal-editor.vue.js";
|
|
11
|
-
import { resolveComponent as m, createElementBlock as c, openBlock as i, Fragment as u, createVNode as h, withCtx as s, createBlock as g, createCommentVNode as a, createElementVNode as P, normalizeStyle as w, withModifiers as W, renderList as p, resolveDynamicComponent as C } from "vue";
|
|
1
|
+
import t from "./index.vue2.js";
|
|
12
2
|
/* empty css */
|
|
13
3
|
/* empty css */
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
name: "SettingPanel",
|
|
17
|
-
componentName: "SettingPanel",
|
|
18
|
-
mixins: [I, B],
|
|
19
|
-
components: {
|
|
20
|
-
TpfCodeEditor: R,
|
|
21
|
-
FormSetting: K,
|
|
22
|
-
CodeModalEditor: L,
|
|
23
|
-
FormCrudSetting: O,
|
|
24
|
-
...D
|
|
25
|
-
},
|
|
26
|
-
props: {
|
|
27
|
-
designer: Object,
|
|
28
|
-
selectedWidget: Object,
|
|
29
|
-
formConfig: Object,
|
|
30
|
-
globalDsv: {
|
|
31
|
-
type: Object,
|
|
32
|
-
default: () => ({})
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
provide() {
|
|
36
|
-
return {
|
|
37
|
-
isSubFormChildWidget: () => this.subFormChildWidgetFlag,
|
|
38
|
-
getGlobalDsv: () => this.globalDsv
|
|
39
|
-
// 全局数据源变量
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
inject: ["getDesignerConfig"],
|
|
43
|
-
data() {
|
|
44
|
-
return {
|
|
45
|
-
designerConfig: this.getDesignerConfig(),
|
|
46
|
-
scrollerHeight: 0,
|
|
47
|
-
activeTab: "2",
|
|
48
|
-
widgetActiveCollapseNames: ["1", "2", "3"],
|
|
49
|
-
formActiveCollapseNames: ["1", "2"],
|
|
50
|
-
commonProps: x,
|
|
51
|
-
advProps: G,
|
|
52
|
-
eventProps: J,
|
|
53
|
-
showWidgetEventDialogFlag: !1,
|
|
54
|
-
eventHandlerCode: "",
|
|
55
|
-
curEventName: "",
|
|
56
|
-
eventHeader: "",
|
|
57
|
-
subFormChildWidgetFlag: !1
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
computed: {
|
|
61
|
-
optionModel: {
|
|
62
|
-
get() {
|
|
63
|
-
return this.selectedWidget.options;
|
|
64
|
-
},
|
|
65
|
-
set(e) {
|
|
66
|
-
this.selectedWidget.options = e;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
watch: {
|
|
71
|
-
"designer.selectedWidget": {
|
|
72
|
-
handler(e) {
|
|
73
|
-
e && (this.activeTab = "1");
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
"selectedWidget.options": {
|
|
77
|
-
//组件属性变动后,立即保存表单JSON!!
|
|
78
|
-
deep: !0,
|
|
79
|
-
handler() {
|
|
80
|
-
this.designer.saveCurrentHistoryStep();
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
formConfig: {
|
|
84
|
-
deep: !0,
|
|
85
|
-
handler() {
|
|
86
|
-
this.designer.saveCurrentHistoryStep();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
created() {
|
|
91
|
-
this.on$("editEventHandler", (e) => {
|
|
92
|
-
this.editEventHandler(e[0], e[1]);
|
|
93
|
-
}), this.designer.handleEvent("form-css-updated", (e) => {
|
|
94
|
-
this.designer.setCssClassList(e);
|
|
95
|
-
}), this.designer.handleEvent("field-selected", (e) => {
|
|
96
|
-
this.subFormChildWidgetFlag = !!e && e.type === "sub-form";
|
|
97
|
-
});
|
|
98
|
-
},
|
|
99
|
-
mounted() {
|
|
100
|
-
this.designer.selectedWidget ? this.activeTab = "1" : this.activeTab = "2", this.scrollerHeight = window.innerHeight - 56 - 48 + "px", U(() => {
|
|
101
|
-
this.$nextTick(() => {
|
|
102
|
-
this.scrollerHeight = window.innerHeight - 56 - 48 + "px";
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
},
|
|
106
|
-
methods: {
|
|
107
|
-
getEventHandled(e) {
|
|
108
|
-
return !!this.optionModel[e] && this.optionModel[e].length > 0;
|
|
109
|
-
},
|
|
110
|
-
showEventCollapse() {
|
|
111
|
-
return this.designerConfig.eventCollapse === void 0 ? !0 : !!this.designerConfig.eventCollapse;
|
|
112
|
-
},
|
|
113
|
-
hasPropEditor(e, o) {
|
|
114
|
-
if (!o)
|
|
115
|
-
return !1;
|
|
116
|
-
if (e.indexOf("-") <= -1) {
|
|
117
|
-
const d = this.selectedWidget.type + "-" + e;
|
|
118
|
-
if (j(d))
|
|
119
|
-
return !1;
|
|
120
|
-
}
|
|
121
|
-
const n = e.replace(this.selectedWidget.type + "-", "");
|
|
122
|
-
return this.designer.hasConfig(this.selectedWidget, n);
|
|
123
|
-
},
|
|
124
|
-
getPropEditor(e, o) {
|
|
125
|
-
const n = e.replace(this.selectedWidget.type + "-", ""), f = `${this.selectedWidget.type}-${n}-editor`;
|
|
126
|
-
return this.$options.components[f] || this.$root.$.appContext.components[f] ? f : o;
|
|
127
|
-
},
|
|
128
|
-
showCollapse(e) {
|
|
129
|
-
let o = !1;
|
|
130
|
-
for (const n in e)
|
|
131
|
-
if (e.hasOwnProperty(n) && this.hasPropEditor(n, e[n])) {
|
|
132
|
-
o = !0;
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
return o;
|
|
136
|
-
},
|
|
137
|
-
editEventHandler(e, o) {
|
|
138
|
-
this.curEventName = e, this.eventHeader = `${this.optionModel.name}.${e}(${o.join(
|
|
139
|
-
", "
|
|
140
|
-
)}) {`, this.eventHandlerCode = z(this.selectedWidget.options, e) || "", console.log({ eventName: e, eventHandlerCode: this.eventHandlerCode }), e === "onValidate" && !this.optionModel.onValidate && (this.eventHandlerCode = ` /* sample code */
|
|
141
|
-
/*
|
|
142
|
-
if ((value > 100) || (value < 0)) {
|
|
143
|
-
return Promise.reject('error message') //fail
|
|
144
|
-
} else {
|
|
145
|
-
return Promise.resolve(); //pass
|
|
146
|
-
}
|
|
147
|
-
*/`), this.$refs.CodeModalEditorRef.open(this.eventHandlerCode);
|
|
148
|
-
},
|
|
149
|
-
saveEventHandler(e) {
|
|
150
|
-
if (this.curEventName.includes(".")) {
|
|
151
|
-
const [o, n] = this.curEventName.split(".");
|
|
152
|
-
this.selectedWidget.options[o][n] = e;
|
|
153
|
-
} else
|
|
154
|
-
this.selectedWidget.options[this.curEventName] = e;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
function X(e, o, n, f, d, t) {
|
|
159
|
-
const v = m("a-collapse-panel"), _ = m("a-collapse"), b = m("a-form"), H = m("a-empty"), E = m("a-tab-pane"), k = m("form-setting"), M = m("FormCrudSetting"), S = m("a-tabs"), T = m("a-layout"), F = m("a-config-provider"), A = m("TpfCodeEditor");
|
|
160
|
-
return i(), c(u, null, [
|
|
161
|
-
h(F, { componentSize: "small" }, {
|
|
162
|
-
default: s(() => [
|
|
163
|
-
h(T, { class: "panel-container" }, {
|
|
164
|
-
default: s(() => [
|
|
165
|
-
h(S, {
|
|
166
|
-
activeKey: d.activeTab,
|
|
167
|
-
"onUpdate:activeKey": o[6] || (o[6] = (r) => d.activeTab = r),
|
|
168
|
-
style: { height: "100%", width: "100%", overflow: "hidden" }
|
|
169
|
-
}, {
|
|
170
|
-
default: s(() => [
|
|
171
|
-
h(E, {
|
|
172
|
-
tab: e.i18nt("designer.hint.widgetSetting"),
|
|
173
|
-
key: "1"
|
|
174
|
-
}, {
|
|
175
|
-
default: s(() => [
|
|
176
|
-
P("div", {
|
|
177
|
-
class: "setting-scrollbar",
|
|
178
|
-
style: w({ height: d.scrollerHeight })
|
|
179
|
-
}, [
|
|
180
|
-
n.designer.selectedWidget && !n.designer.selectedWidget.category ? (i(), g(b, {
|
|
181
|
-
key: 0,
|
|
182
|
-
model: t.optionModel,
|
|
183
|
-
labelAlign: "left",
|
|
184
|
-
"label-width": "120px",
|
|
185
|
-
class: "setting-form tpf-form",
|
|
186
|
-
onSubmit: o[2] || (o[2] = W(() => {
|
|
187
|
-
}, ["prevent"]))
|
|
188
|
-
}, {
|
|
189
|
-
default: s(() => [
|
|
190
|
-
h(_, {
|
|
191
|
-
activeKey: d.widgetActiveCollapseNames,
|
|
192
|
-
"onUpdate:activeKey": o[1] || (o[1] = (r) => d.widgetActiveCollapseNames = r),
|
|
193
|
-
class: "setting-collapse"
|
|
194
|
-
}, {
|
|
195
|
-
default: s(() => [
|
|
196
|
-
t.showCollapse(d.commonProps) ? (i(), g(v, {
|
|
197
|
-
key: "1",
|
|
198
|
-
header: e.i18nt("designer.setting.常见属性")
|
|
199
|
-
}, {
|
|
200
|
-
default: s(() => [
|
|
201
|
-
(i(!0), c(u, null, p(d.commonProps, (r, l) => (i(), c(u, null, [
|
|
202
|
-
t.hasPropEditor(l, r) ? (i(), g(C(t.getPropEditor(l, r)), {
|
|
203
|
-
key: l,
|
|
204
|
-
designer: n.designer,
|
|
205
|
-
"selected-widget": n.selectedWidget,
|
|
206
|
-
"option-model": t.optionModel,
|
|
207
|
-
"onUpdate:optionModel": o[0] || (o[0] = (y) => t.optionModel = y)
|
|
208
|
-
}, null, 40, ["designer", "selected-widget", "option-model"])) : a("", !0)
|
|
209
|
-
], 64))), 256))
|
|
210
|
-
]),
|
|
211
|
-
_: 1
|
|
212
|
-
}, 8, ["header"])) : a("", !0),
|
|
213
|
-
t.showCollapse(d.advProps) ? (i(), g(v, {
|
|
214
|
-
key: "2",
|
|
215
|
-
header: e.i18nt("designer.setting.高级属性")
|
|
216
|
-
}, {
|
|
217
|
-
default: s(() => [
|
|
218
|
-
(i(!0), c(u, null, p(d.advProps, (r, l) => (i(), c(u, null, [
|
|
219
|
-
t.hasPropEditor(l, r) ? (i(), g(C(t.getPropEditor(l, r)), {
|
|
220
|
-
key: l,
|
|
221
|
-
designer: n.designer,
|
|
222
|
-
"selected-widget": n.selectedWidget,
|
|
223
|
-
"option-model": t.optionModel
|
|
224
|
-
}, null, 8, ["designer", "selected-widget", "option-model"])) : a("", !0)
|
|
225
|
-
], 64))), 256))
|
|
226
|
-
]),
|
|
227
|
-
_: 1
|
|
228
|
-
}, 8, ["header"])) : a("", !0),
|
|
229
|
-
t.showEventCollapse() && t.showCollapse(d.eventProps) ? (i(), g(v, {
|
|
230
|
-
key: "3",
|
|
231
|
-
class: "eventPanel",
|
|
232
|
-
header: e.i18nt("designer.setting.事件属性")
|
|
233
|
-
}, {
|
|
234
|
-
default: s(() => [
|
|
235
|
-
(i(!0), c(u, null, p(d.eventProps, (r, l) => (i(), c(u, null, [
|
|
236
|
-
t.hasPropEditor(l, r) ? (i(), g(C(t.getPropEditor(l, r)), {
|
|
237
|
-
key: l,
|
|
238
|
-
designer: n.designer,
|
|
239
|
-
"selected-widget": n.selectedWidget,
|
|
240
|
-
"option-model": t.optionModel,
|
|
241
|
-
"event-handled": t.getEventHandled(l)
|
|
242
|
-
}, null, 8, ["designer", "selected-widget", "option-model", "event-handled"])) : a("", !0)
|
|
243
|
-
], 64))), 256))
|
|
244
|
-
]),
|
|
245
|
-
_: 1
|
|
246
|
-
}, 8, ["header"])) : a("", !0)
|
|
247
|
-
]),
|
|
248
|
-
_: 1
|
|
249
|
-
}, 8, ["activeKey"])
|
|
250
|
-
]),
|
|
251
|
-
_: 1
|
|
252
|
-
}, 8, ["model"])) : a("", !0),
|
|
253
|
-
n.designer.selectedWidget && n.designer.selectedWidget.category ? (i(), g(b, {
|
|
254
|
-
key: 1,
|
|
255
|
-
model: t.optionModel,
|
|
256
|
-
labelAlign: "left",
|
|
257
|
-
"label-width": "120px",
|
|
258
|
-
class: "setting-form tpf-form",
|
|
259
|
-
onSubmit: o[5] || (o[5] = W(() => {
|
|
260
|
-
}, ["prevent"]))
|
|
261
|
-
}, {
|
|
262
|
-
default: s(() => [
|
|
263
|
-
h(_, {
|
|
264
|
-
activeKey: d.widgetActiveCollapseNames,
|
|
265
|
-
"onUpdate:activeKey": o[4] || (o[4] = (r) => d.widgetActiveCollapseNames = r),
|
|
266
|
-
class: "setting-collapse"
|
|
267
|
-
}, {
|
|
268
|
-
default: s(() => [
|
|
269
|
-
t.showCollapse(d.commonProps) ? (i(), g(v, {
|
|
270
|
-
key: "1",
|
|
271
|
-
header: e.i18nt("designer.setting.常见属性")
|
|
272
|
-
}, {
|
|
273
|
-
default: s(() => [
|
|
274
|
-
(i(!0), c(u, null, p(d.commonProps, (r, l) => (i(), c(u, null, [
|
|
275
|
-
t.hasPropEditor(l, r) ? (i(), g(C(t.getPropEditor(l, r)), {
|
|
276
|
-
key: l,
|
|
277
|
-
designer: n.designer,
|
|
278
|
-
"selected-widget": n.selectedWidget,
|
|
279
|
-
"option-model": t.optionModel,
|
|
280
|
-
"onUpdate:optionModel": o[3] || (o[3] = (y) => t.optionModel = y)
|
|
281
|
-
}, null, 40, ["designer", "selected-widget", "option-model"])) : a("", !0)
|
|
282
|
-
], 64))), 256))
|
|
283
|
-
]),
|
|
284
|
-
_: 1
|
|
285
|
-
}, 8, ["header"])) : a("", !0),
|
|
286
|
-
t.showCollapse(d.advProps) ? (i(), g(v, {
|
|
287
|
-
key: "2",
|
|
288
|
-
header: e.i18nt("designer.setting.高级属性")
|
|
289
|
-
}, {
|
|
290
|
-
default: s(() => [
|
|
291
|
-
(i(!0), c(u, null, p(d.advProps, (r, l) => (i(), c(u, null, [
|
|
292
|
-
t.hasPropEditor(l, r) ? (i(), g(C(t.getPropEditor(l, r)), {
|
|
293
|
-
key: l,
|
|
294
|
-
designer: n.designer,
|
|
295
|
-
"selected-widget": n.selectedWidget,
|
|
296
|
-
"option-model": t.optionModel
|
|
297
|
-
}, null, 8, ["designer", "selected-widget", "option-model"])) : a("", !0)
|
|
298
|
-
], 64))), 256))
|
|
299
|
-
]),
|
|
300
|
-
_: 1
|
|
301
|
-
}, 8, ["header"])) : a("", !0),
|
|
302
|
-
t.showEventCollapse() && t.showCollapse(d.eventProps) ? (i(), g(v, {
|
|
303
|
-
key: "3",
|
|
304
|
-
class: "eventPanel",
|
|
305
|
-
header: e.i18nt("designer.setting.事件属性")
|
|
306
|
-
}, {
|
|
307
|
-
default: s(() => [
|
|
308
|
-
(i(!0), c(u, null, p(d.eventProps, (r, l) => (i(), c(u, null, [
|
|
309
|
-
t.hasPropEditor(l, r) ? (i(), g(C(t.getPropEditor(l, r)), {
|
|
310
|
-
key: l,
|
|
311
|
-
designer: n.designer,
|
|
312
|
-
"selected-widget": n.selectedWidget,
|
|
313
|
-
"option-model": t.optionModel,
|
|
314
|
-
"event-handled": t.getEventHandled(l)
|
|
315
|
-
}, null, 8, ["designer", "selected-widget", "option-model", "event-handled"])) : a("", !0)
|
|
316
|
-
], 64))), 256))
|
|
317
|
-
]),
|
|
318
|
-
_: 1
|
|
319
|
-
}, 8, ["header"])) : a("", !0)
|
|
320
|
-
]),
|
|
321
|
-
_: 1
|
|
322
|
-
}, 8, ["activeKey"])
|
|
323
|
-
]),
|
|
324
|
-
_: 1
|
|
325
|
-
}, 8, ["model"])) : a("", !0),
|
|
326
|
-
n.designer.selectedWidget ? a("", !0) : (i(), g(H, {
|
|
327
|
-
key: 2,
|
|
328
|
-
description: e.i18nt("designer.hint.noSelectedWidgetHint")
|
|
329
|
-
}, null, 8, ["description"]))
|
|
330
|
-
], 4)
|
|
331
|
-
]),
|
|
332
|
-
_: 1
|
|
333
|
-
}, 8, ["tab"]),
|
|
334
|
-
n.designer ? (i(), g(E, {
|
|
335
|
-
tab: e.i18nt("designer.hint.表单设置"),
|
|
336
|
-
key: "2"
|
|
337
|
-
}, {
|
|
338
|
-
default: s(() => [
|
|
339
|
-
P("div", {
|
|
340
|
-
class: "setting-scrollbar",
|
|
341
|
-
style: w({ height: d.scrollerHeight })
|
|
342
|
-
}, [
|
|
343
|
-
h(k, {
|
|
344
|
-
designer: n.designer,
|
|
345
|
-
"form-config": n.formConfig
|
|
346
|
-
}, null, 8, ["designer", "form-config"])
|
|
347
|
-
], 4)
|
|
348
|
-
]),
|
|
349
|
-
_: 1
|
|
350
|
-
}, 8, ["tab"])) : a("", !0),
|
|
351
|
-
h(E, {
|
|
352
|
-
tab: e.i18nt("designer.hint.表单api配置"),
|
|
353
|
-
key: "3"
|
|
354
|
-
}, {
|
|
355
|
-
default: s(() => [
|
|
356
|
-
P("div", {
|
|
357
|
-
class: "ds-setting-scrollbar",
|
|
358
|
-
style: w({ height: d.scrollerHeight })
|
|
359
|
-
}, [
|
|
360
|
-
h(M, {
|
|
361
|
-
designer: n.designer,
|
|
362
|
-
"form-config": n.formConfig
|
|
363
|
-
}, null, 8, ["designer", "form-config"])
|
|
364
|
-
], 4)
|
|
365
|
-
]),
|
|
366
|
-
_: 1
|
|
367
|
-
}, 8, ["tab"])
|
|
368
|
-
]),
|
|
369
|
-
_: 1
|
|
370
|
-
}, 8, ["activeKey"])
|
|
371
|
-
]),
|
|
372
|
-
_: 1
|
|
373
|
-
})
|
|
374
|
-
]),
|
|
375
|
-
_: 1
|
|
376
|
-
}),
|
|
377
|
-
h(A, {
|
|
378
|
-
eventHeader: d.eventHeader,
|
|
379
|
-
ref: "CodeModalEditorRef",
|
|
380
|
-
title: e.i18nt("designer.setting.editWidgetEventHandler"),
|
|
381
|
-
mode: "javascript",
|
|
382
|
-
readonly: !1,
|
|
383
|
-
onSetCode: t.saveEventHandler
|
|
384
|
-
}, null, 8, ["eventHeader", "title", "onSetCode"])
|
|
385
|
-
], 64);
|
|
386
|
-
}
|
|
387
|
-
const ae = /* @__PURE__ */ q(Q, [["render", X], ["__scopeId", "data-v-d315cd31"]]);
|
|
4
|
+
import o from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-2de83fcf"]]);
|
|
388
6
|
export {
|
|
389
|
-
|
|
7
|
+
p as default
|
|
390
8
|
};
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { defineComponent as ue, mergeModels as ce, useModel as B, inject as ve, ref as i, provide as I, computed as j, watchEffect as fe, watch as L, onBeforeMount as ge, resolveComponent as p, createElementBlock as P, openBlock as r, Fragment as w, createVNode as d, withCtx as u, createBlock as y, createCommentVNode as U, unref as _, createElementVNode as K, withModifiers as pe, renderList as z, normalizeClass as me, resolveDynamicComponent as ye } from "vue";
|
|
2
|
+
import D from "./property-editor/index.js";
|
|
3
|
+
import { TpfCodeEditor as _e } from "tmgc2-share";
|
|
4
|
+
import Ce from "./form-setting.vue.js";
|
|
5
|
+
import Ee from "./form-crud-setting.vue.js";
|
|
6
|
+
import be, { propertyRegistered as he } from "./propertyRegister.js";
|
|
7
|
+
import { get as q } from "../../../utils/smart-vue-i18n/utils.js";
|
|
8
|
+
import { useEmitter as Pe } from "../../../utils/useEmitter.js";
|
|
9
|
+
import { useI18n as we } from "../../../utils/i18n.js";
|
|
10
|
+
const Me = { class: "setting-scrollbar" }, $e = { class: "setting-scrollbar" }, He = { class: "ds-setting-scrollbar" }, Te = /* @__PURE__ */ ue({
|
|
11
|
+
name: "SettingPanel",
|
|
12
|
+
componentName: "SettingPanel",
|
|
13
|
+
__name: "index",
|
|
14
|
+
props: /* @__PURE__ */ ce({
|
|
15
|
+
designer: { default: () => {
|
|
16
|
+
} },
|
|
17
|
+
globalDsv: {}
|
|
18
|
+
}, {
|
|
19
|
+
"form-config": {
|
|
20
|
+
default: () => ({})
|
|
21
|
+
},
|
|
22
|
+
"form-configModifiers": {},
|
|
23
|
+
"selected-widget": {
|
|
24
|
+
default: () => ({})
|
|
25
|
+
},
|
|
26
|
+
"selected-widgetModifiers": {}
|
|
27
|
+
}),
|
|
28
|
+
emits: ["update:form-config", "update:selected-widget"],
|
|
29
|
+
setup(M, { expose: G }) {
|
|
30
|
+
const { i18nt: c } = we(), { COMMON_PROPERTIES: O, ADVANCED_PROPERTIES: R, EVENT_PROPERTIES: T } = be, v = M, $ = B(M, "form-config"), C = Pe(), Q = v.globalDsv || {}, X = ve("getDesignerConfig"), W = i(!1);
|
|
31
|
+
I("isSubFormChildWidget", () => W.value), I("getGlobalDsv", () => Q);
|
|
32
|
+
const H = i(), F = i(""), E = i("javascript"), S = i("2"), J = i(["1", "2", "3"]), f = i(""), m = i(""), k = i(""), o = B(M, "selected-widget"), x = j(() => X()), l = j({
|
|
33
|
+
get() {
|
|
34
|
+
var e;
|
|
35
|
+
return ((e = o.value) == null ? void 0 : e.options) || {};
|
|
36
|
+
},
|
|
37
|
+
set(e) {
|
|
38
|
+
o.value.options = e;
|
|
39
|
+
}
|
|
40
|
+
}), Y = (e) => !!l.value[e] && l.value[e].length > 0, Z = () => x.value.eventCollapse === void 0 ? !0 : !!x.value.eventCollapse, A = (e, t) => {
|
|
41
|
+
if (!t)
|
|
42
|
+
return !1;
|
|
43
|
+
if (e.indexOf("-") <= -1) {
|
|
44
|
+
const g = o.value.type + "-" + e;
|
|
45
|
+
if (he(g))
|
|
46
|
+
return !1;
|
|
47
|
+
}
|
|
48
|
+
const n = e.replace(o.value.type + "-", "");
|
|
49
|
+
return v.designer.hasConfig(o.value, n);
|
|
50
|
+
}, ee = (e, t) => {
|
|
51
|
+
const n = e.replace(o.value.type + "-", "") + "-editor", s = `${o.value.type}-${n}-editor`;
|
|
52
|
+
return D[s] ? D[s] : D[n];
|
|
53
|
+
}, V = (e) => {
|
|
54
|
+
let t = !1;
|
|
55
|
+
for (const n in e)
|
|
56
|
+
if (Object.prototype.hasOwnProperty.call(e, n) && A(n, e[n])) {
|
|
57
|
+
t = !0;
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
return t;
|
|
61
|
+
}, te = j(() => {
|
|
62
|
+
const e = V(O), t = V(R), n = Z() && V(T);
|
|
63
|
+
return [
|
|
64
|
+
{
|
|
65
|
+
key: "1",
|
|
66
|
+
headerKey: c("designer.setting.常见属性"),
|
|
67
|
+
props: O,
|
|
68
|
+
className: "",
|
|
69
|
+
visible: e,
|
|
70
|
+
useVModel: !0,
|
|
71
|
+
isEvent: !1
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: "2",
|
|
75
|
+
headerKey: c("designer.setting.高级属性"),
|
|
76
|
+
props: R,
|
|
77
|
+
className: "",
|
|
78
|
+
visible: t,
|
|
79
|
+
useVModel: !1,
|
|
80
|
+
isEvent: !1
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: "3",
|
|
84
|
+
headerKey: c("designer.setting.事件属性"),
|
|
85
|
+
props: T,
|
|
86
|
+
className: "eventPanel",
|
|
87
|
+
visible: n,
|
|
88
|
+
useVModel: !1,
|
|
89
|
+
isEvent: !0
|
|
90
|
+
}
|
|
91
|
+
].filter((s) => s.visible);
|
|
92
|
+
}), ne = () => {
|
|
93
|
+
C.off$("onChangeEventHandler"), C.on$("onChangeEventHandler", ({ title: e, attr: t, eventParams: n = [], mode: s }) => {
|
|
94
|
+
F.value = e || c("designer.setting.editWidgetEventHandler");
|
|
95
|
+
const g = s === "json";
|
|
96
|
+
m.value = t, E.value = s;
|
|
97
|
+
const b = `${l.value.name}.${t}`;
|
|
98
|
+
k.value = g ? `${b}{` : `${b}(${n.join(", ")}) {`, f.value = q(o.value.options, t) || "", s === "json" && (f.value = JSON.stringify(l.value.menuList, null, " ")), t === "onValidate" && !l.value.onValidate && (f.value = ` /* sample code */
|
|
99
|
+
/*
|
|
100
|
+
if ((value > 100) || (value < 0)) {
|
|
101
|
+
return Promise.reject('error message') //fail
|
|
102
|
+
} else {
|
|
103
|
+
return Promise.resolve(); //pass
|
|
104
|
+
}
|
|
105
|
+
*/`), H.value.open(f.value);
|
|
106
|
+
});
|
|
107
|
+
}, oe = (e, t, n = "javascript") => {
|
|
108
|
+
const s = n === "json";
|
|
109
|
+
m.value = e, E.value = n;
|
|
110
|
+
const g = `${l.value.name}.${e}`;
|
|
111
|
+
k.value = s ? `${g}{` : `${g}(${t.join(", ")}) {`, f.value = q(o.value.options, e) || "", n === "json" && (f.value = JSON.stringify(l.value.menuList, null, " ")), e === "onValidate" && !l.value.onValidate && (f.value = ` /* sample code */
|
|
112
|
+
/*
|
|
113
|
+
if ((value > 100) || (value < 0)) {
|
|
114
|
+
return Promise.reject('error message') //fail
|
|
115
|
+
} else {
|
|
116
|
+
return Promise.resolve(); //pass
|
|
117
|
+
}
|
|
118
|
+
*/`), H.value.open(f.value);
|
|
119
|
+
}, se = (e) => {
|
|
120
|
+
if (E.value === "json" && (e = JSON.parse(e)), m.value.includes(".")) {
|
|
121
|
+
const [t, n] = m.value.split(".");
|
|
122
|
+
o.value.options[t][n] = e;
|
|
123
|
+
} else
|
|
124
|
+
o.value.options[m.value] = e;
|
|
125
|
+
};
|
|
126
|
+
return fe(() => {
|
|
127
|
+
o.value && (S.value = "1");
|
|
128
|
+
}), L(
|
|
129
|
+
() => {
|
|
130
|
+
var e;
|
|
131
|
+
return (e = o.value) == null ? void 0 : e.options;
|
|
132
|
+
},
|
|
133
|
+
() => {
|
|
134
|
+
v.designer.saveCurrentHistoryStep();
|
|
135
|
+
},
|
|
136
|
+
{ deep: !0 }
|
|
137
|
+
), L(
|
|
138
|
+
() => v.formConfig,
|
|
139
|
+
() => {
|
|
140
|
+
v.designer.saveCurrentHistoryStep();
|
|
141
|
+
},
|
|
142
|
+
{ deep: !0 }
|
|
143
|
+
), ge(() => {
|
|
144
|
+
C.on$("editEventHandler", (e) => {
|
|
145
|
+
oe(e[0], e[1], e[2]);
|
|
146
|
+
}), ne(), v.designer.handleEvent("form-css-updated", (e) => {
|
|
147
|
+
v.designer.setCssClassList(e);
|
|
148
|
+
}), v.designer.handleEvent("field-selected", (e) => {
|
|
149
|
+
W.value = !!e && e.type === "sub-form";
|
|
150
|
+
});
|
|
151
|
+
}), G({
|
|
152
|
+
emit$: C.emit$
|
|
153
|
+
}), (e, t) => {
|
|
154
|
+
const n = p("a-collapse-panel"), s = p("a-collapse"), g = p("a-form"), b = p("a-empty"), N = p("a-tab-pane"), le = p("a-tabs"), ae = p("a-layout"), ie = p("a-config-provider");
|
|
155
|
+
return r(), P(w, null, [
|
|
156
|
+
d(ie, { componentSize: "small" }, {
|
|
157
|
+
default: u(() => [
|
|
158
|
+
d(ae, { class: "panel-container" }, {
|
|
159
|
+
default: u(() => [
|
|
160
|
+
d(le, {
|
|
161
|
+
activeKey: S.value,
|
|
162
|
+
"onUpdate:activeKey": t[4] || (t[4] = (a) => S.value = a),
|
|
163
|
+
style: { height: "100%", width: "100%", overflow: "hidden" }
|
|
164
|
+
}, {
|
|
165
|
+
default: u(() => [
|
|
166
|
+
d(N, {
|
|
167
|
+
tab: _(c)("designer.hint.widgetSetting"),
|
|
168
|
+
key: "1"
|
|
169
|
+
}, {
|
|
170
|
+
default: u(() => [
|
|
171
|
+
K("div", Me, [
|
|
172
|
+
e.designer.selectedWidget ? (r(), y(g, {
|
|
173
|
+
key: 0,
|
|
174
|
+
model: l.value,
|
|
175
|
+
labelAlign: "left",
|
|
176
|
+
"label-width": "120px",
|
|
177
|
+
class: "setting-form tpf-form",
|
|
178
|
+
onSubmit: t[2] || (t[2] = pe(() => {
|
|
179
|
+
}, ["prevent"]))
|
|
180
|
+
}, {
|
|
181
|
+
default: u(() => [
|
|
182
|
+
d(s, {
|
|
183
|
+
activeKey: J.value,
|
|
184
|
+
"onUpdate:activeKey": t[1] || (t[1] = (a) => J.value = a),
|
|
185
|
+
class: "setting-collapse"
|
|
186
|
+
}, {
|
|
187
|
+
default: u(() => [
|
|
188
|
+
(r(!0), P(w, null, z(te.value, (a) => (r(), y(n, {
|
|
189
|
+
key: a.key,
|
|
190
|
+
class: me(a.className),
|
|
191
|
+
header: a.headerKey
|
|
192
|
+
}, {
|
|
193
|
+
default: u(() => [
|
|
194
|
+
(r(!0), P(w, null, z(a.props, (re, h) => (r(), P(w, null, [
|
|
195
|
+
A(h, re) ? (r(), y(ye(ee(h)), {
|
|
196
|
+
key: h,
|
|
197
|
+
designer: e.designer,
|
|
198
|
+
"selected-widget": o.value,
|
|
199
|
+
"option-model": l.value,
|
|
200
|
+
"onUpdate:optionModel": t[0] || (t[0] = (de) => l.value = de),
|
|
201
|
+
"event-handled": Y(h)
|
|
202
|
+
}, null, 40, ["designer", "selected-widget", "option-model", "event-handled"])) : U("", !0)
|
|
203
|
+
], 64))), 256))
|
|
204
|
+
]),
|
|
205
|
+
_: 2
|
|
206
|
+
}, 1032, ["class", "header"]))), 128))
|
|
207
|
+
]),
|
|
208
|
+
_: 1
|
|
209
|
+
}, 8, ["activeKey"])
|
|
210
|
+
]),
|
|
211
|
+
_: 1
|
|
212
|
+
}, 8, ["model"])) : (r(), y(b, {
|
|
213
|
+
key: 1,
|
|
214
|
+
description: _(c)("designer.hint.noSelectedWidgetHint")
|
|
215
|
+
}, null, 8, ["description"]))
|
|
216
|
+
])
|
|
217
|
+
]),
|
|
218
|
+
_: 1
|
|
219
|
+
}, 8, ["tab"]),
|
|
220
|
+
e.designer ? (r(), y(N, {
|
|
221
|
+
tab: _(c)("designer.hint.表单设置"),
|
|
222
|
+
key: "2"
|
|
223
|
+
}, {
|
|
224
|
+
default: u(() => [
|
|
225
|
+
K("div", $e, [
|
|
226
|
+
d(Ce, {
|
|
227
|
+
designer: e.designer,
|
|
228
|
+
"form-config": $.value
|
|
229
|
+
}, null, 8, ["designer", "form-config"])
|
|
230
|
+
])
|
|
231
|
+
]),
|
|
232
|
+
_: 1
|
|
233
|
+
}, 8, ["tab"])) : U("", !0),
|
|
234
|
+
d(N, {
|
|
235
|
+
tab: _(c)("designer.hint.表单api配置"),
|
|
236
|
+
key: "3"
|
|
237
|
+
}, {
|
|
238
|
+
default: u(() => [
|
|
239
|
+
K("div", He, [
|
|
240
|
+
d(Ee, {
|
|
241
|
+
designer: e.designer,
|
|
242
|
+
"form-config": $.value,
|
|
243
|
+
"onUpdate:formConfig": t[3] || (t[3] = (a) => $.value = a)
|
|
244
|
+
}, null, 8, ["designer", "form-config"])
|
|
245
|
+
])
|
|
246
|
+
]),
|
|
247
|
+
_: 1
|
|
248
|
+
}, 8, ["tab"])
|
|
249
|
+
]),
|
|
250
|
+
_: 1
|
|
251
|
+
}, 8, ["activeKey"])
|
|
252
|
+
]),
|
|
253
|
+
_: 1
|
|
254
|
+
})
|
|
255
|
+
]),
|
|
256
|
+
_: 1
|
|
257
|
+
}),
|
|
258
|
+
d(_(_e), {
|
|
259
|
+
eventHeader: k.value,
|
|
260
|
+
ref_key: "CodeModalEditorRef",
|
|
261
|
+
ref: H,
|
|
262
|
+
title: F.value,
|
|
263
|
+
mode: E.value,
|
|
264
|
+
readonly: !1,
|
|
265
|
+
onSetCode: se
|
|
266
|
+
}, null, 8, ["eventHeader", "title", "mode"])
|
|
267
|
+
], 64);
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
export {
|
|
272
|
+
Te as default
|
|
273
|
+
};
|