cloud-web-corejs 1.0.54-dev.687 → 1.0.54-dev.689
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/fileLibrary/index.vue +113 -33
- package/src/components/table/CellSlot.vue +12 -10
- package/src/components/xform/docs//345/220/216/345/217/260/345/255/227/346/256/265/357/274/210/345/212/250/346/200/201/347/224/237/346/210/220/357/274/211JSON /350/257/264/346/230/216.md" +1261 -0
- package/src/components/xform/docs//346/225/260/346/215/256/350/241/250/346/240/274/345/212/250/346/200/201/345/210/227 JSON /350/257/264/346/230/216.md" +657 -0
- package/src/components/xform/form-designer/designer.js +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +157 -105
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +98 -18
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +18 -13
- package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +11 -8
- package/src/components/xform/form-designer/form-widget/field-widget/script-input-widget.vue +143 -0
- package/src/components/xform/form-designer/indexMixin.js +837 -13
- package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +69 -21
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +87 -25
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +5 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +80 -34
- package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/checkStrictly-editor.vue +11 -13
- package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/showAllLevels-editor.vue +21 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +54 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +15 -4
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +2 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +117 -2
- package/src/components/xform/form-render/container-item/data-table-mixin.js +296 -118
- package/src/components/xform/form-render/container-item/dynamicFieldMixin.js +50 -36
- package/src/components/xform/form-render/container-item/list-h5-item.vue +5 -1
- package/src/components/xform/form-render/indexMixin.js +197 -12
- package/src/components/xform/lang/en-US.js +1 -0
- package/src/components/xform/lang/zh-CN.js +86 -99
- package/src/components/xform/utils/dynamicSchemaUtil.js +312 -0
- package/src/components/xform/utils/tableCellValidateUtil.js +148 -0
- package/src/components/xform/utils/tableColumnHelper.js +21 -1
- package/src/components/xform/utils/util.js +126 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<form-item-wrapper
|
|
3
|
+
:designer="designer"
|
|
4
|
+
:field="field"
|
|
5
|
+
:rules="rules"
|
|
6
|
+
:design-state="designState"
|
|
7
|
+
:parent-widget="parentWidget"
|
|
8
|
+
:parent-list="parentList"
|
|
9
|
+
:index-of-parent-list="indexOfParentList"
|
|
10
|
+
:sub-form-row-index="subFormRowIndex"
|
|
11
|
+
:sub-form-col-index="subFormColIndex"
|
|
12
|
+
:sub-form-row-id="subFormRowId"
|
|
13
|
+
>
|
|
14
|
+
<div v-if="designState" class="script-input-design-placeholder">
|
|
15
|
+
{{ getI18nLabel(field.options.placeholder) || "脚本输入框" }}
|
|
16
|
+
<span class="script-input-mode">({{ editorMode }})</span>
|
|
17
|
+
</div>
|
|
18
|
+
<template v-else-if="isReadMode">
|
|
19
|
+
<pre class="readonly-mode-field script-input-readonly">{{ fieldModel }}</pre>
|
|
20
|
+
</template>
|
|
21
|
+
<code-editor
|
|
22
|
+
v-else
|
|
23
|
+
v-model="fieldModel"
|
|
24
|
+
:mode="editorMode"
|
|
25
|
+
:readonly="field.options.readonly || field.options.disabled"
|
|
26
|
+
:height="editorHeight"
|
|
27
|
+
:min-lines="editorMinLines"
|
|
28
|
+
:max-lines="editorMaxLines"
|
|
29
|
+
:user-worker="userWorker"
|
|
30
|
+
:resize="!field.options.disabled && !field.options.readonly"
|
|
31
|
+
@input="onEditorInput"
|
|
32
|
+
/>
|
|
33
|
+
</form-item-wrapper>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import FormItemWrapper from "./form-item-wrapper";
|
|
38
|
+
import emitter from "../../../utils/emitter";
|
|
39
|
+
import i18n from "../../../utils/i18n";
|
|
40
|
+
import fieldMixin from "./fieldMixin";
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
name: "script-input-widget",
|
|
44
|
+
componentName: "FieldWidget",
|
|
45
|
+
mixins: [emitter, fieldMixin, i18n],
|
|
46
|
+
props: {
|
|
47
|
+
field: Object,
|
|
48
|
+
parentWidget: Object,
|
|
49
|
+
parentList: Array,
|
|
50
|
+
indexOfParentList: Number,
|
|
51
|
+
designer: Object,
|
|
52
|
+
designState: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
56
|
+
subFormRowIndex: {
|
|
57
|
+
type: Number,
|
|
58
|
+
default: -1,
|
|
59
|
+
},
|
|
60
|
+
subFormColIndex: {
|
|
61
|
+
type: Number,
|
|
62
|
+
default: -1,
|
|
63
|
+
},
|
|
64
|
+
subFormRowId: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
components: {
|
|
70
|
+
FormItemWrapper,
|
|
71
|
+
},
|
|
72
|
+
inject: ["refList", "globalOptionData", "globalModel"],
|
|
73
|
+
data() {
|
|
74
|
+
return {
|
|
75
|
+
oldFieldValue: null,
|
|
76
|
+
fieldModel: null,
|
|
77
|
+
rules: [],
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
computed: {
|
|
81
|
+
editorMode() {
|
|
82
|
+
return this.field.options.editorMode || "javascript";
|
|
83
|
+
},
|
|
84
|
+
editorHeight() {
|
|
85
|
+
return this.field.options.editorHeight || "200px";
|
|
86
|
+
},
|
|
87
|
+
editorMinLines() {
|
|
88
|
+
return this.field.options.editorMinLines || 8;
|
|
89
|
+
},
|
|
90
|
+
editorMaxLines() {
|
|
91
|
+
return this.field.options.editorMaxLines || 30;
|
|
92
|
+
},
|
|
93
|
+
userWorker() {
|
|
94
|
+
return this.field.options.userWorker === true;
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
created() {
|
|
98
|
+
this.initFieldModel();
|
|
99
|
+
this.registerToRefList();
|
|
100
|
+
this.initEventHandler();
|
|
101
|
+
this.buildFieldRules();
|
|
102
|
+
this.handleOnCreated();
|
|
103
|
+
},
|
|
104
|
+
mounted() {
|
|
105
|
+
this.handleOnMounted();
|
|
106
|
+
},
|
|
107
|
+
beforeDestroy() {
|
|
108
|
+
this.unregisterFromRefList();
|
|
109
|
+
},
|
|
110
|
+
methods: {
|
|
111
|
+
onEditorInput(val) {
|
|
112
|
+
this.handleInputCustomEvent(val);
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<style lang="scss" scoped>
|
|
119
|
+
@import "~@/styles/global.scss";
|
|
120
|
+
|
|
121
|
+
.script-input-design-placeholder {
|
|
122
|
+
min-height: 120px;
|
|
123
|
+
padding: 12px;
|
|
124
|
+
border: 1px dashed #c0c4cc;
|
|
125
|
+
border-radius: 4px;
|
|
126
|
+
color: #909399;
|
|
127
|
+
font-size: 13px;
|
|
128
|
+
background: #fafafa;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.script-input-mode {
|
|
132
|
+
margin-left: 6px;
|
|
133
|
+
color: #336699;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.script-input-readonly {
|
|
137
|
+
margin: 0;
|
|
138
|
+
white-space: pre-wrap;
|
|
139
|
+
word-break: break-all;
|
|
140
|
+
font-family: Consolas, Monaco, monospace;
|
|
141
|
+
font-size: 12px;
|
|
142
|
+
}
|
|
143
|
+
</style>
|