@kp-ui/lowcode-pc-v2 0.0.4 → 0.0.6
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/assets/styles/style.css +102 -27
- package/core/src/components/common/render/RenderWidgetList.vue_vue_type_script_setup_true_lang.js +6 -4
- package/core/src/components/common/render/usePageContext.js +11 -8
- package/core/src/hooks/useAppRef.js +5 -3
- package/core/src/hooks/useField.js +0 -4
- package/core/src/hooks/useFieldRules.js +36 -9
- package/core/src/hooks/useRemoteData.js +4 -3
- package/core/src/hooks/useSelect.js +4 -13
- package/core/src/lang/en-US.js +22 -0
- package/core/src/lang/zh-CN.js +23 -1
- package/install.js +1 -0
- package/package.json +1 -1
- package/src/components/public/ConfigView/CustomPageRender.vue_vue_type_script_setup_true_lang.js +3 -4
- package/src/hooks/useTableWidget.js +48 -15
- package/src/render/index.js +1 -1
- package/src/render/index.vue_vue_type_script_setup_true_lang.js +4 -3
- package/src/schemas/defaults/field.js +1 -0
- package/src/widgets/advanced/code-editor/index.js +1 -1
- package/src/widgets/advanced/code-editor/index.vue_vue_type_script_setup_true_lang.js +9 -2
- package/src/widgets/advanced/data-table/index.js +1 -1
- package/src/widgets/advanced/data-table/index.vue_vue_type_script_setup_true_lang.js +10 -12
- package/src/widgets/advanced/data-table/schema.js +2 -1
- package/src/widgets/base/time/index.js +1 -1
- package/src/widgets/base/time/index.vue_vue_type_script_setup_true_lang.js +1 -1
- package/src/widgets/containers/dialog/index-render.js +3 -1
- package/src/widgets/containers/dialog/index-render.vue_vue_type_script_setup_true_lang.js +5 -4
- package/src/widgets/containers/dialog/schema.js +1 -0
- package/src/widgets/containers/flex/index-render.js +7 -0
- package/src/widgets/containers/flex/index-render.vue_vue_type_script_setup_true_lang.js +93 -0
- package/src/widgets/containers/flex/schema.js +35 -0
- package/src/widgets/containers/space/schema.js +1 -0
- package/src/widgets/render.js +7 -3
- package/src/widgets/widgetTypes.js +1 -0
- package/src/widgets/wrapper/form-item-wrapper.js +1 -1
- package/src/widgets/wrapper/form-item-wrapper.vue_vue_type_script_setup_true_lang.js +15 -10
- package/stats.html +1 -1
package/assets/styles/style.css
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
/* 全局css变量 */
|
|
2
|
+
.primary-color {
|
|
3
|
+
color: var(--ant-primary-color);
|
|
4
|
+
}
|
|
5
|
+
.auto-full-width > div {
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
.background-opacity {
|
|
9
|
+
background: var(--ant-primary-4);
|
|
10
|
+
}
|
|
11
|
+
.form-widget-list .ghost {
|
|
12
|
+
content: '';
|
|
13
|
+
font-size: 0;
|
|
14
|
+
height: 3px;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
background: var(--ant-primary-4);
|
|
17
|
+
border: 2px solid var(--ant-primary-4);
|
|
18
|
+
outline-width: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
/* 滚动条样式 end */
|
|
23
|
+
.button-text-highlight.ant-btn {
|
|
24
|
+
font-weight: bold;
|
|
25
|
+
color: var(--ant-primary-color);
|
|
26
|
+
}
|
|
27
|
+
.custom-divider.ant-divider {
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
margin: 5px;
|
|
30
|
+
}
|
|
31
|
+
.field-wrapper .full-width-input {
|
|
32
|
+
width: 100% !important;
|
|
33
|
+
}
|
|
34
|
+
@tailwind components;
|
|
35
|
+
@tailwind utilities;
|
|
1
36
|
/* 调试面板样式 */
|
|
2
37
|
.debug-panel[data-v-db68aa3b] {
|
|
3
38
|
position: absolute;
|
|
@@ -100,35 +135,66 @@
|
|
|
100
135
|
border-radius: 4px;
|
|
101
136
|
color: #333;
|
|
102
137
|
}
|
|
103
|
-
.field-wrapper[data-v-
|
|
138
|
+
.field-wrapper[data-v-254940bd] {
|
|
104
139
|
position: relative;
|
|
105
140
|
}
|
|
106
|
-
.field-wrapper.hidden[data-v-
|
|
141
|
+
.field-wrapper.hidden[data-v-254940bd] {
|
|
107
142
|
display: none;
|
|
108
143
|
}
|
|
109
|
-
.ant-form-item[data-v-
|
|
144
|
+
.ant-form-item[data-v-254940bd] {
|
|
110
145
|
position: relative;
|
|
111
146
|
}
|
|
112
|
-
.ant-form-item[data-v-
|
|
147
|
+
.ant-form-item[data-v-254940bd] .ant-form-item-label {
|
|
113
148
|
white-space: nowrap;
|
|
114
149
|
text-overflow: ellipsis;
|
|
115
150
|
}
|
|
116
|
-
.ant-form-item .label-box[data-v-
|
|
151
|
+
.ant-form-item .label-box[data-v-254940bd] {
|
|
117
152
|
display: flex;
|
|
118
153
|
align-items: center;
|
|
154
|
+
width: 100%;
|
|
155
|
+
height: auto;
|
|
156
|
+
min-height: 30px;
|
|
157
|
+
min-width: 0;
|
|
119
158
|
}
|
|
120
|
-
.ant-form-item .label-box .label-text[data-v-
|
|
121
|
-
|
|
122
|
-
|
|
159
|
+
.ant-form-item .label-box .label-text[data-v-254940bd] {
|
|
160
|
+
min-width: 0;
|
|
161
|
+
display: inline;
|
|
162
|
+
overflow: visible;
|
|
163
|
+
text-overflow: initial;
|
|
164
|
+
white-space: normal;
|
|
165
|
+
text-align: inherit;
|
|
166
|
+
word-break: break-all;
|
|
167
|
+
-webkit-line-clamp: initial;
|
|
168
|
+
-webkit-box-orient: initial;
|
|
169
|
+
}
|
|
170
|
+
.ant-form-item .label-box--left[data-v-254940bd] {
|
|
171
|
+
justify-content: flex-start;
|
|
172
|
+
}
|
|
173
|
+
.ant-form-item .label-box--left .label-text[data-v-254940bd] {
|
|
174
|
+
text-align: start;
|
|
175
|
+
}
|
|
176
|
+
.ant-form-item .label-box--right[data-v-254940bd] {
|
|
177
|
+
justify-content: flex-end;
|
|
123
178
|
}
|
|
124
|
-
.ant-form-item .
|
|
125
|
-
|
|
179
|
+
.ant-form-item .label-box--right .label-text[data-v-254940bd] {
|
|
180
|
+
text-align: end;
|
|
181
|
+
}
|
|
182
|
+
.ant-form-item .custom-label[data-v-254940bd] {
|
|
183
|
+
display: inline-flex;
|
|
126
184
|
align-items: center;
|
|
185
|
+
width: 100%;
|
|
186
|
+
min-width: 0;
|
|
127
187
|
gap: 4px;
|
|
128
|
-
}
|
|
188
|
+
}
|
|
189
|
+
.ant-form-item .custom-label .label-text[data-v-254940bd] {
|
|
190
|
+
flex: 1 1 auto;
|
|
191
|
+
}
|
|
192
|
+
.ant-form-item .custom-label[data-v-254940bd] .svg-icon {
|
|
193
|
+
flex: 0 0 auto;
|
|
194
|
+
}.designer[data-v-8c04a069] {
|
|
129
195
|
position: relative;
|
|
130
196
|
}
|
|
131
|
-
.designer[data-v-
|
|
197
|
+
.designer[data-v-8c04a069]::before {
|
|
132
198
|
position: absolute;
|
|
133
199
|
z-index: 99;
|
|
134
200
|
content: "";
|
|
@@ -240,11 +306,13 @@
|
|
|
240
306
|
}
|
|
241
307
|
.button-list-container .button-icon[data-v-37429548] {
|
|
242
308
|
margin-right: 4px;
|
|
243
|
-
}.talbe-wrapper[data-v-
|
|
244
|
-
width: 100%;
|
|
309
|
+
}.talbe-wrapper[data-v-19607d37] {
|
|
245
310
|
position: relative;
|
|
311
|
+
height: var(--0622be28);
|
|
312
|
+
display: flex;
|
|
313
|
+
flex: var(--3bd67a87);
|
|
246
314
|
}
|
|
247
|
-
.talbe-wrapper .table-toolbar[data-v-
|
|
315
|
+
.talbe-wrapper .table-toolbar[data-v-19607d37] {
|
|
248
316
|
padding: 8px 0;
|
|
249
317
|
margin-bottom: 8px;
|
|
250
318
|
position: absolute;
|
|
@@ -253,10 +321,10 @@
|
|
|
253
321
|
right: 0;
|
|
254
322
|
width: 30px;
|
|
255
323
|
}
|
|
256
|
-
.talbe-wrapper .vxe-grid[data-v-
|
|
324
|
+
.talbe-wrapper .vxe-grid[data-v-19607d37] {
|
|
257
325
|
width: 100%;
|
|
258
326
|
}
|
|
259
|
-
.talbe-wrapper__pagination[data-v-
|
|
327
|
+
.talbe-wrapper__pagination[data-v-19607d37] {
|
|
260
328
|
margin-top: 10px;
|
|
261
329
|
display: flex;
|
|
262
330
|
justify-content: end;
|
|
@@ -358,14 +426,8 @@
|
|
|
358
426
|
overflow-y: auto;
|
|
359
427
|
}.readonly-mode-time-range[data-v-a6cdcc75] .ant-picker {
|
|
360
428
|
display: none;
|
|
361
|
-
}.readonly-mode-time[data-v-
|
|
429
|
+
}.readonly-mode-time[data-v-7b5d160f] .ant-picker {
|
|
362
430
|
display: none;
|
|
363
|
-
}
|
|
364
|
-
.auto-full-width[data-v-887d6c03] {
|
|
365
|
-
width: 100%;
|
|
366
|
-
}
|
|
367
|
-
.auto-full-width[data-v-887d6c03] .ant-picker {
|
|
368
|
-
width: 100% !important;
|
|
369
431
|
}.vf-box-widget[data-v-d52cfec5] {
|
|
370
432
|
width: 100%;
|
|
371
433
|
}
|
|
@@ -408,7 +470,15 @@
|
|
|
408
470
|
background-color: #fff;
|
|
409
471
|
padding: 16px;
|
|
410
472
|
}
|
|
411
|
-
|
|
473
|
+
[data-v-17ae4bcb] .ant-modal-body .ime-table {
|
|
474
|
+
height: 100%;
|
|
475
|
+
}.flex-container[data-v-4ac728a4] {
|
|
476
|
+
width: 100%;
|
|
477
|
+
min-height: 42px;
|
|
478
|
+
}
|
|
479
|
+
.flex-container[data-v-4ac728a4] .ant-form-item {
|
|
480
|
+
margin-bottom: 0;
|
|
481
|
+
}.form-widget[data-v-4c8924c1] {
|
|
412
482
|
width: 100%;
|
|
413
483
|
min-height: 60px;
|
|
414
484
|
}.grid-cell[data-v-598209c1] {
|
|
@@ -461,11 +531,16 @@
|
|
|
461
531
|
.page-template-widget[data-v-dc2a06fa] .addInfoLayout-footer .ant-form-item {
|
|
462
532
|
margin-bottom: 0;
|
|
463
533
|
}
|
|
464
|
-
.
|
|
534
|
+
.layout-render-wrapper[data-v-464184f3] {
|
|
535
|
+
overflow-y: auto;
|
|
536
|
+
overflow-x: hidden;
|
|
537
|
+
background: var(--4a7fb80b);
|
|
538
|
+
}
|
|
539
|
+
.loading-wrapper[data-v-464184f3] {
|
|
465
540
|
min-height: 300px;
|
|
466
541
|
padding: 20px;
|
|
467
542
|
}
|
|
468
|
-
.ant-form .ant-form-item-explain.ant-form-item-explain-connected[data-v-
|
|
543
|
+
.ant-form .ant-form-item-explain.ant-form-item-explain-connected[data-v-464184f3] {
|
|
469
544
|
display: none;
|
|
470
545
|
}
|
|
471
546
|
/*$vite$:1*/
|
package/core/src/components/common/render/RenderWidgetList.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, createBlock, createElementBlock, defineComponent, inject, mergeModels, openBlock, provide, renderList, resolveDynamicComponent, toRef, unref, useModel } from "vue";
|
|
1
|
+
import { Fragment, createBlock, createElementBlock, defineComponent, inject, mergeModels, normalizeStyle, openBlock, provide, renderList, resolveDynamicComponent, toRef, unref, useModel } from "vue";
|
|
2
2
|
//#region ../core/src/components/common/render/RenderWidgetList.vue?vue&type=script&setup=true&lang.ts
|
|
3
3
|
var RenderWidgetList_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
4
4
|
inheritAttrs: false,
|
|
@@ -12,7 +12,8 @@ var RenderWidgetList_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
12
12
|
},
|
|
13
13
|
allowTypes: { default: () => [] },
|
|
14
14
|
notAllowTypes: { default: () => [] },
|
|
15
|
-
parentWidget: {}
|
|
15
|
+
parentWidget: {},
|
|
16
|
+
itemStyle: {}
|
|
16
17
|
}, {
|
|
17
18
|
"list": {
|
|
18
19
|
type: Array,
|
|
@@ -28,16 +29,17 @@ var RenderWidgetList_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
28
29
|
const list = useModel(__props, "list");
|
|
29
30
|
return (_ctx, _cache) => {
|
|
30
31
|
return openBlock(true), createElementBlock(Fragment, null, renderList(list.value, (widget, index) => {
|
|
32
|
+
var _ctx$itemStyle;
|
|
31
33
|
return openBlock(), createBlock(resolveDynamicComponent(unref(getWidget)(widget)), {
|
|
32
34
|
key: `${widget.id}_${index}`,
|
|
33
35
|
id: widget.id,
|
|
34
|
-
|
|
36
|
+
style: normalizeStyle([widget.style, (_ctx$itemStyle = _ctx.itemStyle) === null || _ctx$itemStyle === void 0 ? void 0 : _ctx$itemStyle.call(_ctx, widget, index)]),
|
|
35
37
|
widget,
|
|
36
38
|
field: widget,
|
|
37
39
|
index
|
|
38
40
|
}, null, 8, [
|
|
39
41
|
"id",
|
|
40
|
-
"
|
|
42
|
+
"style",
|
|
41
43
|
"widget",
|
|
42
44
|
"field",
|
|
43
45
|
"index"
|
|
@@ -26,6 +26,7 @@ var usePageContext = ({ props }) => {
|
|
|
26
26
|
const childFormRef = ref();
|
|
27
27
|
const serveList = computed(() => formConfig.value.serveList);
|
|
28
28
|
const formWidgetId = Symbol("formWidget");
|
|
29
|
+
const formCustomCodeId = "vfRender" + generateId();
|
|
29
30
|
const dialogOrDrawerRef = ref();
|
|
30
31
|
const { context, execHttpFunction, asyncExecuteFunction } = useExecFunction();
|
|
31
32
|
const { getPageInstance, getInstance, registerToRefList } = useAppRef(widgetRefList, formWidgetId);
|
|
@@ -122,16 +123,18 @@ var usePageContext = ({ props }) => {
|
|
|
122
123
|
* @param formId 表单ID
|
|
123
124
|
*/
|
|
124
125
|
const insertCustomCode = () => {
|
|
125
|
-
const formId = "vfRender" + generateId();
|
|
126
126
|
const { cssCode, functions } = formConfig.value;
|
|
127
|
-
if (cssCode) insertCustomCssToHead(cssCode,
|
|
128
|
-
|
|
127
|
+
if (cssCode) insertCustomCssToHead(cssCode, formCustomCodeId);
|
|
128
|
+
else removeCustomCssToHead(formCustomCodeId);
|
|
129
|
+
if (functions) {
|
|
130
|
+
removeScriptToHead(formCustomCodeId);
|
|
131
|
+
insertGlobalFunctionsToHtml(functions, formCustomCodeId);
|
|
132
|
+
} else removeScriptToHead(formCustomCodeId);
|
|
129
133
|
};
|
|
130
134
|
const removeCustomCode = () => {
|
|
131
|
-
const formId = "vfRender" + generateId();
|
|
132
135
|
const { cssCode, functions } = formConfig.value;
|
|
133
|
-
if (cssCode) removeCustomCssToHead(
|
|
134
|
-
if (functions) removeScriptToHead(
|
|
136
|
+
if (cssCode) removeCustomCssToHead(formCustomCodeId);
|
|
137
|
+
if (functions) removeScriptToHead(formCustomCodeId);
|
|
135
138
|
};
|
|
136
139
|
const reload = () => {
|
|
137
140
|
var _context$value;
|
|
@@ -153,7 +156,7 @@ var usePageContext = ({ props }) => {
|
|
|
153
156
|
const getFieldValue = (field) => {
|
|
154
157
|
return formDataModel.value[field];
|
|
155
158
|
};
|
|
156
|
-
const
|
|
159
|
+
const setFieldValue = (field, value) => {
|
|
157
160
|
formDataModel.value[field] = value;
|
|
158
161
|
};
|
|
159
162
|
const setVfCtx = (vfCtx) => {
|
|
@@ -195,7 +198,7 @@ var usePageContext = ({ props }) => {
|
|
|
195
198
|
setPageJson,
|
|
196
199
|
setLoading,
|
|
197
200
|
formDataModel,
|
|
198
|
-
|
|
201
|
+
setFieldValue,
|
|
199
202
|
isLoading,
|
|
200
203
|
vfCtx: props.vfCtx,
|
|
201
204
|
formConfig,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useI18n } from "../utils/i18n.js";
|
|
2
|
-
import { computed, getCurrentInstance, inject, ref } from "vue";
|
|
2
|
+
import { computed, getCurrentInstance, inject, proxyRefs, ref } from "vue";
|
|
3
3
|
import { message } from "ant-design-vue";
|
|
4
4
|
//#region ../core/src/hooks/useAppRef.ts
|
|
5
5
|
function useAppRef(widgetRefList, formWidgetId) {
|
|
@@ -18,12 +18,14 @@ function useAppRef(widgetRefList, formWidgetId) {
|
|
|
18
18
|
return foundRef;
|
|
19
19
|
};
|
|
20
20
|
const registerToRefList = (widgetName) => {
|
|
21
|
-
|
|
21
|
+
const list = isRoot ? widgetRefList === null || widgetRefList === void 0 ? void 0 : widgetRefList.value : refList.value;
|
|
22
|
+
const exposed = {
|
|
22
23
|
instance,
|
|
23
24
|
proxy: instance === null || instance === void 0 ? void 0 : instance.proxy,
|
|
24
25
|
...instance === null || instance === void 0 ? void 0 : instance.appContext.config.globalProperties,
|
|
25
26
|
...instance === null || instance === void 0 ? void 0 : instance.exposed
|
|
26
|
-
}
|
|
27
|
+
};
|
|
28
|
+
list.set(widgetName || widgetId.value, proxyRefs(exposed));
|
|
27
29
|
};
|
|
28
30
|
/**
|
|
29
31
|
* 从引用列表中注销
|
|
@@ -202,10 +202,6 @@ function useField(widget) {
|
|
|
202
202
|
if (eq(fieldModel.value, newValue)) return;
|
|
203
203
|
const oldValue = deepClone(fieldModel.value);
|
|
204
204
|
if (widget.type === "file-upload") newValue = showFileList(newValue || []);
|
|
205
|
-
else if (widget.type === "code-editor") {
|
|
206
|
-
var _getFieldEditor;
|
|
207
|
-
(_getFieldEditor = getFieldEditor()) === null || _getFieldEditor === void 0 || _getFieldEditor.setValue(newValue);
|
|
208
|
-
}
|
|
209
205
|
fieldModel.value = newValue;
|
|
210
206
|
if (!disableChangeEvent) emitFieldDataChange(newValue, oldValue);
|
|
211
207
|
};
|
|
@@ -15,23 +15,24 @@ function useFieldRules({ widget, getPropName, getPageInstance, designState }) {
|
|
|
15
15
|
});
|
|
16
16
|
/** 构建字段规则 */
|
|
17
17
|
const buildFieldRules = () => {
|
|
18
|
-
var _widget$props, _widget$validation, _widget$validation2, _widget$
|
|
18
|
+
var _widget$props, _widget$validation, _widget$events, _widget$validation2, _widget$validation3, _widget$validation6, _widget$validation8;
|
|
19
19
|
if (!("formItemFlag" in widget) || !widget.formItemFlag || ((_widget$props = widget.props) === null || _widget$props === void 0 ? void 0 : _widget$props.hidden)) return;
|
|
20
20
|
rules.value = [];
|
|
21
|
-
|
|
21
|
+
const customValidate = ((_widget$validation = widget.validation) === null || _widget$validation === void 0 ? void 0 : _widget$validation.onValidate) || ((_widget$events = widget.events) === null || _widget$events === void 0 ? void 0 : _widget$events.onValidate);
|
|
22
|
+
if ((_widget$validation2 = widget.validation) === null || _widget$validation2 === void 0 ? void 0 : _widget$validation2.required) rules.value.push({
|
|
22
23
|
required: true,
|
|
23
24
|
trigger: ["blur"],
|
|
24
25
|
message: widget.validation.requiredHint || i18nt("render.hint.fieldRequired")
|
|
25
26
|
});
|
|
26
|
-
if ((_widget$
|
|
27
|
-
var _widget$
|
|
28
|
-
const rulesFn = unref(rulesMap)[(_widget$
|
|
27
|
+
if ((_widget$validation3 = widget.validation) === null || _widget$validation3 === void 0 ? void 0 : _widget$validation3.validation) {
|
|
28
|
+
var _widget$validation4;
|
|
29
|
+
const rulesFn = unref(rulesMap)[(_widget$validation4 = widget.validation) === null || _widget$validation4 === void 0 ? void 0 : _widget$validation4.validation];
|
|
29
30
|
if (rulesFn) {
|
|
30
|
-
var _widget$
|
|
31
|
-
rules.value.push(rulesFn((_widget$
|
|
31
|
+
var _widget$validation5;
|
|
32
|
+
rules.value.push(rulesFn((_widget$validation5 = widget.validation) === null || _widget$validation5 === void 0 ? void 0 : _widget$validation5.validationHint));
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
(_widget$
|
|
35
|
+
(_widget$validation6 = widget.validation) === null || _widget$validation6 === void 0 || (_widget$validation6 = _widget$validation6.rules) === null || _widget$validation6 === void 0 || _widget$validation6.forEach((rule) => {
|
|
35
36
|
if (rule.type === "pattern" && rule.value) rules.value.push({
|
|
36
37
|
pattern: new RegExp(rule.value),
|
|
37
38
|
trigger: rule.trigger || ["blur", "change"],
|
|
@@ -42,7 +43,33 @@ function useFieldRules({ widget, getPropName, getPageInstance, designState }) {
|
|
|
42
43
|
trigger: rule.trigger || ["blur"]
|
|
43
44
|
});
|
|
44
45
|
});
|
|
45
|
-
if (
|
|
46
|
+
if (customValidate) rules.value.push({
|
|
47
|
+
validator: async (rule, value) => {
|
|
48
|
+
let executeError;
|
|
49
|
+
let result = await Promise.resolve(executeFunction({
|
|
50
|
+
functionBody: customValidate,
|
|
51
|
+
params: {
|
|
52
|
+
rule,
|
|
53
|
+
value
|
|
54
|
+
},
|
|
55
|
+
keys: ["rule", "value"],
|
|
56
|
+
errorCallback: (error) => {
|
|
57
|
+
executeError = error;
|
|
58
|
+
}
|
|
59
|
+
}));
|
|
60
|
+
if (typeof result === "function") result = await result();
|
|
61
|
+
if (executeError) return Promise.reject(executeError);
|
|
62
|
+
if (result === false) {
|
|
63
|
+
var _widget$validation7;
|
|
64
|
+
return Promise.reject(new Error(((_widget$validation7 = widget.validation) === null || _widget$validation7 === void 0 ? void 0 : _widget$validation7.validationHint) || rule.message || ""));
|
|
65
|
+
}
|
|
66
|
+
if (typeof result === "string") return Promise.reject(new Error(result));
|
|
67
|
+
if (result instanceof Error) return Promise.reject(result);
|
|
68
|
+
return Promise.resolve();
|
|
69
|
+
},
|
|
70
|
+
trigger: ["blur", "change"]
|
|
71
|
+
});
|
|
72
|
+
if ((_widget$validation8 = widget.validation) === null || _widget$validation8 === void 0 ? void 0 : _widget$validation8.rules) {}
|
|
46
73
|
};
|
|
47
74
|
/** 清除字段规则 */
|
|
48
75
|
const clearFieldRules = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { usePagination } from "./usePagination.js";
|
|
2
2
|
import { computed, ref, watch } from "vue";
|
|
3
3
|
import { useExecFunction } from "tmgc2-share";
|
|
4
|
-
import { debounce } from "lodash-es";
|
|
4
|
+
import { debounce, isArray } from "lodash-es";
|
|
5
5
|
//#region ../core/src/hooks/useRemoteData.ts
|
|
6
6
|
function useRemoteData({ widget, onLoaded, formConfig }) {
|
|
7
7
|
var _widget$dataSource;
|
|
@@ -68,8 +68,9 @@ function useRemoteData({ widget, onLoaded, formConfig }) {
|
|
|
68
68
|
pagination.value.total = result.total || 0;
|
|
69
69
|
pagination.value.totalPage = result.totalPage || 0;
|
|
70
70
|
}
|
|
71
|
-
data.value = result
|
|
72
|
-
|
|
71
|
+
if (isArray(result)) data.value = result;
|
|
72
|
+
else data.value = result.list;
|
|
73
|
+
onLoaded === null || onLoaded === void 0 || onLoaded(data.value);
|
|
73
74
|
} catch (err) {
|
|
74
75
|
console.error("remote data load error:", err);
|
|
75
76
|
} finally {
|
|
@@ -12,18 +12,9 @@ function findInArray(arrayObject, element) {
|
|
|
12
12
|
}
|
|
13
13
|
function useSelect({ widget, designState, fieldModel, formConfig }) {
|
|
14
14
|
const keyword = ref({ val: "" });
|
|
15
|
-
const
|
|
16
|
-
const onLoaded = (result) => {
|
|
17
|
-
const data = result.data || {};
|
|
18
|
-
if (data) apiResult.value = isArray(data) ? { list: [...unref(apiResult).list, ...data] } : {
|
|
19
|
-
...data,
|
|
20
|
-
list: [...unref(apiResult).list, ...data.list]
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
const { loadData, loadMore, refresh, data, pager, loading } = useRemoteData({
|
|
15
|
+
const { loadData, loadMore, refresh, data, pagination, loading } = useRemoteData({
|
|
24
16
|
widget,
|
|
25
17
|
designState,
|
|
26
|
-
onLoaded,
|
|
27
18
|
formConfig
|
|
28
19
|
});
|
|
29
20
|
const mapping = computed(() => {
|
|
@@ -57,7 +48,6 @@ function useSelect({ widget, designState, fieldModel, formConfig }) {
|
|
|
57
48
|
keyword.value.val = _keyword;
|
|
58
49
|
};
|
|
59
50
|
const selectOps = computed(() => {
|
|
60
|
-
var _apiResult$value;
|
|
61
51
|
const showSearch = true;
|
|
62
52
|
const useServer = widget.props.showSearch;
|
|
63
53
|
return {
|
|
@@ -68,7 +58,7 @@ function useSelect({ widget, designState, fieldModel, formConfig }) {
|
|
|
68
58
|
onSearch: remoteQuery,
|
|
69
59
|
filterOption: !useServer && filterOption,
|
|
70
60
|
listHeight: 240,
|
|
71
|
-
options: cloneDeep(
|
|
61
|
+
options: cloneDeep(data.value) || []
|
|
72
62
|
};
|
|
73
63
|
});
|
|
74
64
|
const getOptionItems = () => {
|
|
@@ -106,6 +96,7 @@ function useSelect({ widget, designState, fieldModel, formConfig }) {
|
|
|
106
96
|
};
|
|
107
97
|
return {
|
|
108
98
|
selectDefineExpose: {
|
|
99
|
+
loadData,
|
|
109
100
|
loadOptions: loadData,
|
|
110
101
|
initOptionItems: loadData,
|
|
111
102
|
getSelectedItem,
|
|
@@ -128,7 +119,7 @@ function useSelect({ widget, designState, fieldModel, formConfig }) {
|
|
|
128
119
|
optionLabel,
|
|
129
120
|
filterOption,
|
|
130
121
|
keyword,
|
|
131
|
-
pager,
|
|
122
|
+
pager: pagination,
|
|
132
123
|
loading,
|
|
133
124
|
selectOps,
|
|
134
125
|
initOptionItems: loadData,
|
package/core/src/lang/en-US.js
CHANGED
|
@@ -45,6 +45,7 @@ var en_US_default = {
|
|
|
45
45
|
popover: "Popover",
|
|
46
46
|
"custom-render": "Custom Render",
|
|
47
47
|
space: "Space",
|
|
48
|
+
flex: "Flex",
|
|
48
49
|
image: "Image",
|
|
49
50
|
cell: "Cell",
|
|
50
51
|
input: "Input",
|
|
@@ -209,6 +210,7 @@ var en_US_default = {
|
|
|
209
210
|
alignEnd: "End",
|
|
210
211
|
alignCenter: "Center",
|
|
211
212
|
alignBaseline: "Baseline",
|
|
213
|
+
alignStretch: "Stretch",
|
|
212
214
|
wrap: "Wrap",
|
|
213
215
|
fill: "Fill",
|
|
214
216
|
defaultExpand: "Default Expand",
|
|
@@ -231,6 +233,7 @@ var en_US_default = {
|
|
|
231
233
|
buttonListConfig: "Button Group Config",
|
|
232
234
|
buttonPosition: "Position",
|
|
233
235
|
autoWidth: "Auto Width",
|
|
236
|
+
autoHeight: "Auto Height",
|
|
234
237
|
dataSoureEdit: "dataSoure Edit",
|
|
235
238
|
fixed: "Fixed Position",
|
|
236
239
|
fixedRight: "Fixed Right",
|
|
@@ -344,9 +347,12 @@ var en_US_default = {
|
|
|
344
347
|
gridJustify: "Horizontal Align",
|
|
345
348
|
justifyStart: "Start",
|
|
346
349
|
justifyEnd: "End",
|
|
350
|
+
justifyFlexStart: "Flex Start",
|
|
351
|
+
justifyFlexEnd: "Flex End",
|
|
347
352
|
justifyCenter: "Center",
|
|
348
353
|
justifySpaceAround: "Space Around",
|
|
349
354
|
justifySpaceBetween: "Space Between",
|
|
355
|
+
justifySpaceEvenly: "Space Evenly",
|
|
350
356
|
gridAlign: "Vertical Align",
|
|
351
357
|
alignTop: "Top",
|
|
352
358
|
alignCenter: "Center",
|
|
@@ -426,6 +432,14 @@ var en_US_default = {
|
|
|
426
432
|
leftAlign: "Left",
|
|
427
433
|
centerAlign: "Center",
|
|
428
434
|
rightAlign: "Right",
|
|
435
|
+
rowReverse: "Row Reverse",
|
|
436
|
+
columnReverse: "Column Reverse",
|
|
437
|
+
flexHeightMode: "Height Mode",
|
|
438
|
+
inheritHeight: "Inherit",
|
|
439
|
+
fixedHeight: "Fixed",
|
|
440
|
+
flexHeight: "Fixed Height",
|
|
441
|
+
componentSort: "Component Sort",
|
|
442
|
+
noSortableComponents: "No sortable components",
|
|
429
443
|
formCss: "Form CSS",
|
|
430
444
|
addCss: "Edit",
|
|
431
445
|
customClass: "Custom Class",
|
|
@@ -452,6 +466,7 @@ var en_US_default = {
|
|
|
452
466
|
drawDirection: "Direction",
|
|
453
467
|
tableWidth: "Width(px/%)",
|
|
454
468
|
tableHeight: "Height(px/%)",
|
|
469
|
+
tableHeightMode: "Height Mode",
|
|
455
470
|
showCheckBox: "Show CheckBox",
|
|
456
471
|
showColumnManager: "Column Manager",
|
|
457
472
|
showIndex: "Show Row Number",
|
|
@@ -611,8 +626,15 @@ var en_US_default = {
|
|
|
611
626
|
justifyContent: "Justify Content",
|
|
612
627
|
alignItems: "Align Items",
|
|
613
628
|
flexWrap: "Flex Wrap",
|
|
629
|
+
flexBlockConfig: "Block Config",
|
|
614
630
|
flexGrow: "Flex Grow",
|
|
615
631
|
flexShrink: "Flex Shrink",
|
|
632
|
+
flexItemWidthMode: "Item Width",
|
|
633
|
+
flexItemWidth: "Fixed Width",
|
|
634
|
+
fixedWidth: "Fixed",
|
|
635
|
+
fullWidth: "Full",
|
|
636
|
+
flexItemWidthPlaceholder: "e.g. 240px, 50%, calc(50% - 8px)",
|
|
637
|
+
flexItemHeightPlaceholder: "e.g. 240px, 50%, calc(100% - 8px)",
|
|
616
638
|
gap: "Gap",
|
|
617
639
|
positionOffset: "Position Offset",
|
|
618
640
|
top: "Top",
|
package/core/src/lang/zh-CN.js
CHANGED
|
@@ -42,6 +42,7 @@ var zh_CN_default = {
|
|
|
42
42
|
drawer: "侧滑抽屉",
|
|
43
43
|
box: "盒容器",
|
|
44
44
|
space: "间距",
|
|
45
|
+
flex: "弹性布局",
|
|
45
46
|
cell: "单元格",
|
|
46
47
|
"cell-group": "单元格组",
|
|
47
48
|
popup: "弹出层",
|
|
@@ -250,6 +251,7 @@ var zh_CN_default = {
|
|
|
250
251
|
alignEnd: "终点对齐",
|
|
251
252
|
alignCenter: "居中对齐",
|
|
252
253
|
alignBaseline: "基线对齐",
|
|
254
|
+
alignStretch: "拉伸",
|
|
253
255
|
wrap: "自动换行",
|
|
254
256
|
fill: "充满父容器",
|
|
255
257
|
defaultExpand: "默认展开",
|
|
@@ -310,7 +312,7 @@ var zh_CN_default = {
|
|
|
310
312
|
fixedLeft: "左",
|
|
311
313
|
fixedRight: "右",
|
|
312
314
|
fixedNull: "无",
|
|
313
|
-
preserveSelectedRowKeys: "
|
|
315
|
+
preserveSelectedRowKeys: "分页保留勾选",
|
|
314
316
|
customColumnWidth: "自定义列表选择框宽度",
|
|
315
317
|
customColumnTitle: "自定义列表选择框标题",
|
|
316
318
|
selectRow: "点击行选中",
|
|
@@ -402,9 +404,12 @@ var zh_CN_default = {
|
|
|
402
404
|
gridJustify: "水平对齐",
|
|
403
405
|
justifyStart: "起点",
|
|
404
406
|
justifyEnd: "终点",
|
|
407
|
+
justifyFlexStart: "主轴起点",
|
|
408
|
+
justifyFlexEnd: "主轴终点",
|
|
405
409
|
justifyCenter: "居中",
|
|
406
410
|
justifySpaceAround: "环绕",
|
|
407
411
|
justifySpaceBetween: "两端",
|
|
412
|
+
justifySpaceEvenly: "均匀分布",
|
|
408
413
|
gridAlign: "垂直对齐",
|
|
409
414
|
alignTop: "顶部",
|
|
410
415
|
alignCenter: "居中对齐",
|
|
@@ -481,6 +486,14 @@ var zh_CN_default = {
|
|
|
481
486
|
leftAlign: "居左",
|
|
482
487
|
centerAlign: "居中",
|
|
483
488
|
rightAlign: "居右",
|
|
489
|
+
rowReverse: "水平反向",
|
|
490
|
+
columnReverse: "垂直反向",
|
|
491
|
+
flexHeightMode: "高度模式",
|
|
492
|
+
inheritHeight: "继承",
|
|
493
|
+
fixedHeight: "固定",
|
|
494
|
+
flexHeight: "固定高度",
|
|
495
|
+
componentSort: "组件排序",
|
|
496
|
+
noSortableComponents: "暂无可排序组件",
|
|
484
497
|
formCss: "全局CSS",
|
|
485
498
|
addCss: "编写CSS",
|
|
486
499
|
customClass: "自定义CSS样式名称",
|
|
@@ -507,8 +520,10 @@ var zh_CN_default = {
|
|
|
507
520
|
drawDirection: "抽屉滑出方向",
|
|
508
521
|
isEnterSubmit: "回车键提交",
|
|
509
522
|
autoWidth: "自动宽度",
|
|
523
|
+
autoHeight: "自动高度",
|
|
510
524
|
tableWidth: "宽度(px/%)",
|
|
511
525
|
tableHeight: "高度(px/%)",
|
|
526
|
+
tableHeightMode: "高度模式",
|
|
512
527
|
showColumnManager: "列管理",
|
|
513
528
|
showIndex: "是否显示行号",
|
|
514
529
|
showPagination: "是否显示分页",
|
|
@@ -670,8 +685,15 @@ var zh_CN_default = {
|
|
|
670
685
|
justifyContent: "主轴对齐",
|
|
671
686
|
alignItems: "侧轴对齐",
|
|
672
687
|
flexWrap: "换行",
|
|
688
|
+
flexBlockConfig: "栅格块配置",
|
|
673
689
|
flexGrow: "放大比例",
|
|
674
690
|
flexShrink: "缩小比例",
|
|
691
|
+
flexItemWidthMode: "子项宽度",
|
|
692
|
+
flexItemWidth: "固定宽度",
|
|
693
|
+
fixedWidth: "固定",
|
|
694
|
+
fullWidth: "撑满",
|
|
695
|
+
flexItemWidthPlaceholder: "如:240px、50%、calc(50% - 8px)",
|
|
696
|
+
flexItemHeightPlaceholder: "如:240px、50%、calc(100% - 8px)",
|
|
675
697
|
gap: "间距",
|
|
676
698
|
positionOffset: "位置偏移",
|
|
677
699
|
top: "上",
|
package/install.js
CHANGED
package/package.json
CHANGED
package/src/components/public/ConfigView/CustomPageRender.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useLowcode } from "../../../../core/src/hooks/useLowcode.js";
|
|
2
2
|
import render_default from "../../../render/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { createBlock, defineComponent, onMounted, openBlock, ref, unref } from "vue";
|
|
4
4
|
import { getLocat } from "@kp-ui/tool";
|
|
5
5
|
//#region src/components/public/ConfigView/CustomPageRender.vue?vue&type=script&setup=true&lang.tsx
|
|
6
|
-
var _hoisted_1 = { class: "t-bg-[#fff] t-h-full" };
|
|
7
6
|
var CustomPageRender_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
7
|
__name: "CustomPageRender",
|
|
9
8
|
props: { title: {
|
|
@@ -21,7 +20,7 @@ var CustomPageRender_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
21
20
|
await getPageJson();
|
|
22
21
|
});
|
|
23
22
|
return (_ctx, _cache) => {
|
|
24
|
-
return openBlock(),
|
|
23
|
+
return openBlock(), createBlock(render_default, {
|
|
25
24
|
ref_key: "vfdRef",
|
|
26
25
|
ref: vfdRef,
|
|
27
26
|
vfCtx: {
|
|
@@ -30,7 +29,7 @@ var CustomPageRender_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
30
29
|
goBack: unref(goBack),
|
|
31
30
|
setAnchorList
|
|
32
31
|
}
|
|
33
|
-
}, null, 8, ["vfCtx"])
|
|
32
|
+
}, null, 8, ["vfCtx"]);
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
35
|
});
|