cloud-web-corejs 1.1.0-dev.62 → 1.1.0-dev.64
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 +1 -1
- package/src/components/Tinymce/index.vue +59 -6
- package/src/components/xform/form-designer/form-widget/field-widget/rich-editor-widget.vue +67 -26
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +27 -23
- package/src/components/xform/form-designer/setting-panel/property-editor/contentHeight-editor.vue +23 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +46 -0
- package/src/components/xform/form-render/container-item/data-table-mixin.js +33 -19
- package/src/components/xform/form-render/indexMixin.js +1 -0
- package/src/components/xform/lang/en-US.js +1 -0
- package/src/components/xform/lang/zh-CN.js +1 -0
- package/src/components/xform/utils/sfc-generator.js +5 -3
package/package.json
CHANGED
|
@@ -43,6 +43,24 @@ import plugins from "./plugins";
|
|
|
43
43
|
import toolbar from "./toolbar";
|
|
44
44
|
import load from "./dynamicLoadScript";
|
|
45
45
|
import { richTextResourcePath } from "../../utils/featureResources";
|
|
46
|
+
|
|
47
|
+
function isBlankRichText(val) {
|
|
48
|
+
if (val == null) return true;
|
|
49
|
+
const html = String(val);
|
|
50
|
+
if (!html.trim()) return true;
|
|
51
|
+
const text = html
|
|
52
|
+
.replace(/<br\s*\/?>/gi, "")
|
|
53
|
+
.replace(/ /gi, " ")
|
|
54
|
+
.replace(/<[^>]+>/g, "")
|
|
55
|
+
.trim();
|
|
56
|
+
if (text) return false;
|
|
57
|
+
return !/<(img|video|audio|iframe|table|hr)\b/i.test(html);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function sameRichText(a, b) {
|
|
61
|
+
if ((a || "") === (b || "")) return true;
|
|
62
|
+
return isBlankRichText(a) && isBlankRichText(b);
|
|
63
|
+
}
|
|
46
64
|
// import EditorImage from './components/EditorImage.vue'
|
|
47
65
|
|
|
48
66
|
// why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one
|
|
@@ -98,6 +116,7 @@ export default {
|
|
|
98
116
|
initializing: false,
|
|
99
117
|
initGeneration: 0,
|
|
100
118
|
hasChange: false,
|
|
119
|
+
applyingExternal: false,
|
|
101
120
|
hasInit: false,
|
|
102
121
|
isActivated: true,
|
|
103
122
|
tinymceId: this.id,
|
|
@@ -122,12 +141,13 @@ export default {
|
|
|
122
141
|
},
|
|
123
142
|
watch: {
|
|
124
143
|
value(val) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
144
|
+
this.syncEditorContent(val);
|
|
145
|
+
},
|
|
146
|
+
readonly() {
|
|
147
|
+
this.applyReadonly();
|
|
148
|
+
},
|
|
149
|
+
height() {
|
|
150
|
+
this.applyHeight();
|
|
131
151
|
},
|
|
132
152
|
},
|
|
133
153
|
mounted() {
|
|
@@ -222,10 +242,19 @@ export default {
|
|
|
222
242
|
}
|
|
223
243
|
_this.hasInit = true;
|
|
224
244
|
_this.initializing = false;
|
|
245
|
+
_this.applyReadonly();
|
|
246
|
+
_this.applyHeight();
|
|
225
247
|
editor.on("NodeChange Change KeyUp SetContent", () => {
|
|
248
|
+
if (this.applyingExternal) return;
|
|
226
249
|
this.hasChange = true;
|
|
227
250
|
this.$emit("input", editor.getContent());
|
|
228
251
|
});
|
|
252
|
+
editor.on("focus", (event) => {
|
|
253
|
+
this.$emit("focus", event);
|
|
254
|
+
});
|
|
255
|
+
editor.on("blur", (event) => {
|
|
256
|
+
this.$emit("blur", event);
|
|
257
|
+
});
|
|
229
258
|
},
|
|
230
259
|
setup(editor) {
|
|
231
260
|
editor.on("FullscreenStateChanged", (e) => {
|
|
@@ -309,6 +338,30 @@ export default {
|
|
|
309
338
|
}
|
|
310
339
|
}
|
|
311
340
|
},
|
|
341
|
+
syncEditorContent(val) {
|
|
342
|
+
if (!this.hasInit || this.applyingExternal) return;
|
|
343
|
+
this.$nextTick(() => {
|
|
344
|
+
const editor = window.tinymce && window.tinymce.get(this.tinymceId);
|
|
345
|
+
if (!editor || this.applyingExternal) return;
|
|
346
|
+
const incoming = val == null ? "" : String(val);
|
|
347
|
+
if (sameRichText(incoming, editor.getContent())) return;
|
|
348
|
+
this.applyingExternal = true;
|
|
349
|
+
editor.setContent(incoming);
|
|
350
|
+
this.applyingExternal = false;
|
|
351
|
+
});
|
|
352
|
+
},
|
|
353
|
+
applyReadonly() {
|
|
354
|
+
const editor = window.tinymce && window.tinymce.get(this.tinymceId);
|
|
355
|
+
if (editor && typeof editor.setMode === "function") {
|
|
356
|
+
editor.setMode(this.readonly ? "readonly" : "design");
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
applyHeight() {
|
|
360
|
+
const editor = window.tinymce && window.tinymce.get(this.tinymceId);
|
|
361
|
+
const height = parseInt(this.height, 10);
|
|
362
|
+
if (!editor || !editor.iframeElement || !height) return;
|
|
363
|
+
editor.iframeElement.style.height = height + "px";
|
|
364
|
+
},
|
|
312
365
|
setContent(value) {
|
|
313
366
|
const editor = window.tinymce && window.tinymce.get(this.tinymceId);
|
|
314
367
|
if (editor) editor.setContent(value);
|
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<form-item-wrapper :designer="designer" :field="field" :rules="rules" :design-state="designState"
|
|
3
3
|
:parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
|
|
4
4
|
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex" :sub-form-row-id="subFormRowId">
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
<div class="rich-editor-host">
|
|
6
|
+
<tinymce ref="fieldEditor" :value="designState ? '' : (fieldModel || '')" :readonly="!designState && isReadonly"
|
|
7
|
+
:height="editorHeight" @input="handleRichEditorInput" @focus="handleRichEditorFocus"
|
|
8
|
+
@blur="handleRichEditorBlur">
|
|
9
|
+
</tinymce>
|
|
10
|
+
<div v-if="designState" class="rich-editor-mask"></div>
|
|
11
|
+
</div>
|
|
12
|
+
</form-item-wrapper>
|
|
11
13
|
</template>
|
|
12
14
|
|
|
13
15
|
<script>
|
|
14
16
|
import FormItemWrapper from './form-item-wrapper'
|
|
15
|
-
/* import {VueEditor} from 'vue2-editor'//vue2-editor */
|
|
16
17
|
import emitter from '../../../../../components/xform/utils/emitter'
|
|
17
18
|
import i18n from "../../../../../components/xform/utils/i18n"
|
|
18
19
|
import {deepClone} from "../../../../../components/xform/utils/util"
|
|
19
20
|
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin"
|
|
20
21
|
|
|
22
|
+
function isBlankRichText(val) {
|
|
23
|
+
if (val == null) return true
|
|
24
|
+
const html = String(val)
|
|
25
|
+
if (!html.trim()) return true
|
|
26
|
+
const text = html
|
|
27
|
+
.replace(/<br\s*\/?>/gi, "")
|
|
28
|
+
.replace(/ /gi, " ")
|
|
29
|
+
.replace(/<[^>]+>/g, "")
|
|
30
|
+
.trim()
|
|
31
|
+
if (text) return false
|
|
32
|
+
return !/<(img|video|audio|iframe|table|hr)\b/i.test(html)
|
|
33
|
+
}
|
|
34
|
+
|
|
21
35
|
export default {
|
|
22
36
|
name: "rich-editor-widget",
|
|
23
37
|
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
@@ -50,10 +64,7 @@
|
|
|
50
64
|
},
|
|
51
65
|
components: {
|
|
52
66
|
FormItemWrapper,
|
|
53
|
-
|
|
54
|
-
// VueEditor: resolve => { //懒加载!!
|
|
55
|
-
// require(['vue2-editor'], ({VueEditor}) => resolve(VueEditor))
|
|
56
|
-
// }
|
|
67
|
+
Tinymce: () => import('@base/components/Tinymce'),
|
|
57
68
|
},
|
|
58
69
|
inject: ['refList', 'globalOptionData', 'globalModel'],
|
|
59
70
|
data() {
|
|
@@ -61,13 +72,17 @@
|
|
|
61
72
|
oldFieldValue: null, //field组件change之前的值
|
|
62
73
|
fieldModel: null,
|
|
63
74
|
rules: [],
|
|
64
|
-
|
|
65
|
-
customToolbar: [], //富文本编辑器自定义工具栏
|
|
66
|
-
valueChangedFlag: false, //vue2-editor数据值是否改变标志
|
|
75
|
+
changeTimer: null,
|
|
67
76
|
}
|
|
68
77
|
},
|
|
69
78
|
computed: {
|
|
70
|
-
|
|
79
|
+
isReadonly() {
|
|
80
|
+
return !!(this.field.options.readonly || this.field.options.disabled)
|
|
81
|
+
},
|
|
82
|
+
editorHeight() {
|
|
83
|
+
const height = Number(this.field.options.contentHeight)
|
|
84
|
+
return height > 0 ? height : 300
|
|
85
|
+
},
|
|
71
86
|
},
|
|
72
87
|
beforeCreate() {
|
|
73
88
|
/* 这里不能访问方法和属性!! */
|
|
@@ -89,24 +104,40 @@
|
|
|
89
104
|
},
|
|
90
105
|
|
|
91
106
|
beforeDestroy() {
|
|
107
|
+
clearTimeout(this.changeTimer)
|
|
92
108
|
this.unregisterFromRefList()
|
|
93
109
|
},
|
|
94
110
|
|
|
95
111
|
methods: {
|
|
96
|
-
|
|
97
|
-
this.
|
|
98
|
-
|
|
112
|
+
handleRichEditorInput(val) {
|
|
113
|
+
if (this.designState) return
|
|
114
|
+
const next = isBlankRichText(val) ? "" : (val || "")
|
|
115
|
+
if (this.fieldModel === next) return
|
|
116
|
+
this.fieldModel = next
|
|
117
|
+
this.syncUpdateFormModel(next)
|
|
118
|
+
clearTimeout(this.changeTimer)
|
|
119
|
+
this.changeTimer = setTimeout(() => {
|
|
120
|
+
this.flushRichEditorChange()
|
|
121
|
+
}, 200)
|
|
99
122
|
},
|
|
100
123
|
|
|
101
|
-
|
|
124
|
+
flushRichEditorChange() {
|
|
125
|
+
this.changeTimer = null
|
|
126
|
+
this.emitFieldDataChange(this.fieldModel, this.oldFieldValue)
|
|
102
127
|
this.oldFieldValue = deepClone(this.fieldModel)
|
|
128
|
+
this.dispatch("VFormRender", "fieldValidation", [this.getPropName()])
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
handleRichEditorFocus(event) {
|
|
132
|
+
this.handleFocusCustomEvent(event)
|
|
103
133
|
},
|
|
104
134
|
|
|
105
|
-
|
|
106
|
-
if (this.
|
|
107
|
-
|
|
108
|
-
this.
|
|
135
|
+
handleRichEditorBlur(event) {
|
|
136
|
+
if (this.changeTimer) {
|
|
137
|
+
clearTimeout(this.changeTimer)
|
|
138
|
+
this.flushRichEditorChange()
|
|
109
139
|
}
|
|
140
|
+
this.handleBlurCustomEvent(event)
|
|
110
141
|
},
|
|
111
142
|
|
|
112
143
|
}
|
|
@@ -116,8 +147,18 @@
|
|
|
116
147
|
<style lang="scss" scoped>
|
|
117
148
|
@import "~@base/styles/theme-variables.scss"; //* form-item-wrapper已引入,还需要重复引入吗? *//
|
|
118
149
|
|
|
119
|
-
.
|
|
120
|
-
|
|
150
|
+
.rich-editor-host {
|
|
151
|
+
position: relative;
|
|
152
|
+
width: 100%;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.rich-editor-mask {
|
|
156
|
+
position: absolute;
|
|
157
|
+
top: 0;
|
|
158
|
+
right: 0;
|
|
159
|
+
bottom: 0;
|
|
160
|
+
left: 0;
|
|
161
|
+
z-index: 3;
|
|
121
162
|
}
|
|
122
163
|
|
|
123
164
|
</style>
|
|
@@ -534,7 +534,7 @@
|
|
|
534
534
|
<el-form-item :label="i18nt('designer.setting.visibleColumn')">
|
|
535
535
|
<el-switch v-model="rowData.show"></el-switch>
|
|
536
536
|
</el-form-item>
|
|
537
|
-
<el-form-item label="动态显示脚本">
|
|
537
|
+
<el-form-item label="动态显示脚本">
|
|
538
538
|
<a
|
|
539
539
|
href="javascript:void(0);"
|
|
540
540
|
class="a-link link-oneLind"
|
|
@@ -542,21 +542,21 @@
|
|
|
542
542
|
>
|
|
543
543
|
<span>{{ rowData.columnShow }}</span>
|
|
544
544
|
<i class="el-icon-edit"></i>
|
|
545
|
-
</a>
|
|
546
|
-
</el-form-item>
|
|
547
|
-
<el-form-item
|
|
548
|
-
label="单元格可编辑条件"
|
|
549
|
-
v-if="rowData.editFormatS"
|
|
550
|
-
>
|
|
551
|
-
<a
|
|
552
|
-
href="javascript:void(0);"
|
|
553
|
-
class="a-link link-oneLind"
|
|
554
|
-
@click="editFormEventHandler(rowData, rowDataIndex, 'cellEditable')"
|
|
555
|
-
>
|
|
556
|
-
<span>{{ rowData.cellEditable }}</span>
|
|
557
|
-
<i class="el-icon-edit"></i>
|
|
558
|
-
</a>
|
|
559
|
-
</el-form-item>
|
|
545
|
+
</a>
|
|
546
|
+
</el-form-item>
|
|
547
|
+
<el-form-item
|
|
548
|
+
label="单元格可编辑条件"
|
|
549
|
+
v-if="rowData.editFormatS"
|
|
550
|
+
>
|
|
551
|
+
<a
|
|
552
|
+
href="javascript:void(0);"
|
|
553
|
+
class="a-link link-oneLind"
|
|
554
|
+
@click="editFormEventHandler(rowData, rowDataIndex, 'cellEditable')"
|
|
555
|
+
>
|
|
556
|
+
<span>{{ rowData.cellEditable }}</span>
|
|
557
|
+
<i class="el-icon-edit"></i>
|
|
558
|
+
</a>
|
|
559
|
+
</el-form-item>
|
|
560
560
|
<el-form-item :label="i18nt('designer.setting.sortableColumn')">
|
|
561
561
|
<el-switch v-model="rowData.sortable"></el-switch>
|
|
562
562
|
</el-form-item>
|
|
@@ -1034,10 +1034,10 @@ export default {
|
|
|
1034
1034
|
curEventRow: null,
|
|
1035
1035
|
|
|
1036
1036
|
eventParamsMap: {
|
|
1037
|
-
footerMethodConfg: "footerMethodConfg(dataId,formCode,param) {",
|
|
1038
|
-
columnShow: "columnShow(dataId,formCode,columnConfig) {",
|
|
1039
|
-
cellEditable:
|
|
1040
|
-
"cellEditable(dataId,formCode,tableParam,columnConfig) {",
|
|
1037
|
+
footerMethodConfg: "footerMethodConfg(dataId,formCode,param) {",
|
|
1038
|
+
columnShow: "columnShow(dataId,formCode,columnConfig) {",
|
|
1039
|
+
cellEditable:
|
|
1040
|
+
"cellEditable(dataId,formCode,tableParam,columnConfig) {",
|
|
1041
1041
|
},
|
|
1042
1042
|
|
|
1043
1043
|
showColumnRenderDialog: false,
|
|
@@ -1403,9 +1403,9 @@ export default {
|
|
|
1403
1403
|
rowAddAuthName: this.createRowAuthName("Add"),
|
|
1404
1404
|
rowEditAuthName: this.createRowAuthName("Edit"),
|
|
1405
1405
|
rowAddShow: null,
|
|
1406
|
-
rowEditShow: null,
|
|
1407
|
-
columnShow: null,
|
|
1408
|
-
cellEditable: null,
|
|
1406
|
+
rowEditShow: null,
|
|
1407
|
+
columnShow: null,
|
|
1408
|
+
cellEditable: null,
|
|
1409
1409
|
utcTransformEnabled: false,
|
|
1410
1410
|
labelIconClass: null,
|
|
1411
1411
|
labelIconPosition: "rear",
|
|
@@ -1632,6 +1632,10 @@ export default {
|
|
|
1632
1632
|
row.widget = null;
|
|
1633
1633
|
}
|
|
1634
1634
|
row.utcTransformEnabled = false;
|
|
1635
|
+
// 组件渲染才使用 widgetList。切到 text 等格式时清掉,避免旧的必填组件继续留在列配置里。
|
|
1636
|
+
if (row.formatS !== "widgetRender") {
|
|
1637
|
+
row.widgetList = [];
|
|
1638
|
+
}
|
|
1635
1639
|
} else {
|
|
1636
1640
|
if (row.prop && row.prop.startsWith(attachmentPrefix)) {
|
|
1637
1641
|
let suffix = row.prop.replace(attachmentPrefix, "");
|
package/src/components/xform/form-designer/setting-panel/property-editor/contentHeight-editor.vue
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form-item :label="i18nt('designer.setting.contentHeight')" class="form-item-label-top">
|
|
3
|
+
<el-input-number v-model="optionModel.contentHeight" :min="120" :step="20" style="width: 100%"></el-input-number>
|
|
4
|
+
</el-form-item>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import i18n from "../../../../../components/xform/utils/i18n"
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: "contentHeight-editor",
|
|
12
|
+
mixins: [i18n],
|
|
13
|
+
props: {
|
|
14
|
+
designer: Object,
|
|
15
|
+
selectedWidget: Object,
|
|
16
|
+
optionModel: Object,
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style scoped>
|
|
22
|
+
|
|
23
|
+
</style>
|
|
@@ -1342,6 +1342,51 @@ export const basicFields = [
|
|
|
1342
1342
|
...defaultTextFlagConfig,
|
|
1343
1343
|
},
|
|
1344
1344
|
},
|
|
1345
|
+
{
|
|
1346
|
+
type: "rich-editor",
|
|
1347
|
+
icon: "rich-editor-field",
|
|
1348
|
+
commonFlag: !0,
|
|
1349
|
+
formItemFlag: !0,
|
|
1350
|
+
columnFlag: false,
|
|
1351
|
+
tableField: null,
|
|
1352
|
+
options: {
|
|
1353
|
+
name: "",
|
|
1354
|
+
keyNameEnabled: !1,
|
|
1355
|
+
keyName: "",
|
|
1356
|
+
label: "",
|
|
1357
|
+
labelColor: "",
|
|
1358
|
+
submitFlag: true,
|
|
1359
|
+
labelAlign: "",
|
|
1360
|
+
defaultValue: "",
|
|
1361
|
+
contentHeight: 300,
|
|
1362
|
+
columnWidth: "200px",
|
|
1363
|
+
labelWidth: null,
|
|
1364
|
+
labelHidden: !1,
|
|
1365
|
+
readonly: !1,
|
|
1366
|
+
disabled: !1,
|
|
1367
|
+
hidden: !1,
|
|
1368
|
+
required: !1,
|
|
1369
|
+
requiredHint: "",
|
|
1370
|
+
validation: "",
|
|
1371
|
+
validationHint: "",
|
|
1372
|
+
customClass: "",
|
|
1373
|
+
labelIconClass: null,
|
|
1374
|
+
labelIconPosition: "rear",
|
|
1375
|
+
labelTooltip: null,
|
|
1376
|
+
onCreated: "",
|
|
1377
|
+
onMounted: "",
|
|
1378
|
+
onChange: "",
|
|
1379
|
+
onFocus: "",
|
|
1380
|
+
onBlur: "",
|
|
1381
|
+
onValidate: "",
|
|
1382
|
+
accessType: "1",
|
|
1383
|
+
...defaultWfConfig,
|
|
1384
|
+
|
|
1385
|
+
showRuleFlag: 1,
|
|
1386
|
+
showRuleEnabled: 1,
|
|
1387
|
+
showRules: [],
|
|
1388
|
+
},
|
|
1389
|
+
},
|
|
1345
1390
|
{
|
|
1346
1391
|
type: "script-input",
|
|
1347
1392
|
icon: "component",
|
|
@@ -4734,6 +4779,7 @@ export const widgetPanelOrder = {
|
|
|
4734
4779
|
"a-link2",
|
|
4735
4780
|
"button",
|
|
4736
4781
|
"divider",
|
|
4782
|
+
"rich-editor",
|
|
4737
4783
|
],
|
|
4738
4784
|
/* 图表 → 展示 → 按钮 */
|
|
4739
4785
|
advancedFields: [
|
|
@@ -1726,9 +1726,28 @@ modules = {
|
|
|
1726
1726
|
const index = rows.indexOf(row);
|
|
1727
1727
|
return index >= 0 ? index : fallbackIndex;
|
|
1728
1728
|
},
|
|
1729
|
+
/**
|
|
1730
|
+
* 单元格实际挂载的是 widgetList,还是列格式组件 widget。
|
|
1731
|
+
* 与建列插槽一致:有 widget 时走 #widget;只有 formatS 为组件渲染且没有 widget 时才走 #widgetList。
|
|
1732
|
+
* 格式从组件渲染改成 text 等之后,旧的 widgetList 会留在列配置里,不能再参与校验。
|
|
1733
|
+
* @param {Object} column 列配置。
|
|
1734
|
+
* @returns {Boolean}
|
|
1735
|
+
*/
|
|
1736
|
+
isWidgetListColumn(column) {
|
|
1737
|
+
return column?.formatS === "widgetRender" && !column.widget;
|
|
1738
|
+
},
|
|
1729
1739
|
/** @param {Object} column 列配置。@param {Boolean} isEditTable 是否编辑表。@param {Array} entries 输出数组。 */
|
|
1730
1740
|
collectColumnValidateEntries(column, isEditTable, entries) {
|
|
1731
|
-
if (column
|
|
1741
|
+
if (this.isWidgetListColumn(column)) {
|
|
1742
|
+
if (column.widgetList?.length) {
|
|
1743
|
+
loopHandleWidget(column.widgetList, (w) => {
|
|
1744
|
+
entries.push({
|
|
1745
|
+
column,
|
|
1746
|
+
templateWidget: w,
|
|
1747
|
+
});
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
} else if (column.widget) {
|
|
1732
1751
|
entries.push({
|
|
1733
1752
|
column,
|
|
1734
1753
|
templateWidget: column.widget,
|
|
@@ -1740,14 +1759,6 @@ modules = {
|
|
|
1740
1759
|
templateWidget: column.editWidget,
|
|
1741
1760
|
});
|
|
1742
1761
|
}
|
|
1743
|
-
if (column.widgetList?.length) {
|
|
1744
|
-
loopHandleWidget(column.widgetList, (w) => {
|
|
1745
|
-
entries.push({
|
|
1746
|
-
column,
|
|
1747
|
-
templateWidget: w,
|
|
1748
|
-
});
|
|
1749
|
-
});
|
|
1750
|
-
}
|
|
1751
1762
|
},
|
|
1752
1763
|
/** @param {Object} row 行数据。@param {Object} templateWidget 组件模板。@returns {Object} 当前行组件 schema。 */
|
|
1753
1764
|
resolveRowFieldWidget(row, templateWidget) {
|
|
@@ -4712,6 +4723,19 @@ modules = {
|
|
|
4712
4723
|
checkRows.forEach((row) => {
|
|
4713
4724
|
let fieldSchema = this.getRowFieldSchema(row) || {};
|
|
4714
4725
|
tableColumns.forEach((column) => {
|
|
4726
|
+
if (this.isWidgetListColumn(column)) {
|
|
4727
|
+
if (column.widgetList) {
|
|
4728
|
+
column.widgetList.forEach((itemWidget) => {
|
|
4729
|
+
let widget = fieldSchema[itemWidget.id];
|
|
4730
|
+
let required = widget?.options?.required || false;
|
|
4731
|
+
if (required) {
|
|
4732
|
+
let propName = this.getColumnWidgetProp(widget, row);
|
|
4733
|
+
fieldsToValidate.push(propName);
|
|
4734
|
+
}
|
|
4735
|
+
});
|
|
4736
|
+
}
|
|
4737
|
+
return;
|
|
4738
|
+
}
|
|
4715
4739
|
if (column.widget) {
|
|
4716
4740
|
// 列未就绪时 getRowFieldSchema 会给 null,取不到行级组件就按"不必填"跳过,
|
|
4717
4741
|
// 而不是在这里抛异常把整个校验打断
|
|
@@ -4722,16 +4746,6 @@ modules = {
|
|
|
4722
4746
|
fieldsToValidate.push(propName);
|
|
4723
4747
|
}
|
|
4724
4748
|
}
|
|
4725
|
-
if (column.widgetList) {
|
|
4726
|
-
column.widgetList.forEach((itemWidget) => {
|
|
4727
|
-
let widget = fieldSchema[itemWidget.id];
|
|
4728
|
-
let required = widget?.options?.required || false;
|
|
4729
|
-
if (required) {
|
|
4730
|
-
let propName = this.getColumnWidgetProp(widget, row);
|
|
4731
|
-
fieldsToValidate.push(propName);
|
|
4732
|
-
}
|
|
4733
|
-
});
|
|
4734
|
-
}
|
|
4735
4749
|
});
|
|
4736
4750
|
});
|
|
4737
4751
|
let formRef = this.getFormRef();
|
|
@@ -331,9 +331,11 @@ const elTemplates = { //字段组件属性
|
|
|
331
331
|
},
|
|
332
332
|
|
|
333
333
|
'rich-editor': (widget, formConfig) => {
|
|
334
|
-
const {vModel
|
|
335
|
-
|
|
336
|
-
|
|
334
|
+
const {vModel} = getElAttrs(widget, formConfig)
|
|
335
|
+
const wop = widget.options
|
|
336
|
+
const readonly = (wop.readonly || wop.disabled) ? `:readonly="true"` : ''
|
|
337
|
+
const height = isNotNull(wop.contentHeight) ? `:height="${wop.contentHeight}"` : ':height="300"'
|
|
338
|
+
return `<tinymce ${vModel} ${readonly} ${height}></tinymce>`
|
|
337
339
|
},
|
|
338
340
|
|
|
339
341
|
'cascader': (widget, formConfig) => {
|