cloud-web-corejs 1.0.54-dev.260 → 1.0.54-dev.262
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/xform/form-designer/form-widget/field-widget/fieldMixin.js +36 -9
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +35 -20
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +12 -0
package/package.json
CHANGED
@@ -83,6 +83,7 @@ modules = {
|
|
83
83
|
},
|
84
84
|
created() {
|
85
85
|
// this.initFieldAttrs();
|
86
|
+
this.initConfig();
|
86
87
|
this.initValueWatchEvent();
|
87
88
|
if (this.field.options.searchDialogConfig) {
|
88
89
|
if (this.field.options.searchDialogConfig.multipleChoices === void 0) {
|
@@ -182,12 +183,30 @@ modules = {
|
|
182
183
|
this.setReadonly(this.field.options.readonly)
|
183
184
|
},
|
184
185
|
initConfig() {
|
185
|
-
|
186
|
-
|
186
|
+
/*if (this.designState) {
|
187
|
+
let config = this.designer.getFieldWidgetByType(this.field.type);
|
188
|
+
if(config){
|
189
|
+
let defaultOptions = config.options;
|
190
|
+
let options = this.field.options;
|
191
|
+
Object.keys(defaultOptions).forEach(function (k) {
|
192
|
+
if (!options.hasOwnProperty(k)) {
|
193
|
+
let val = defaultOptions[k]
|
194
|
+
if (Array.isArray(val)) {
|
195
|
+
options[k] = []
|
196
|
+
} else {
|
197
|
+
options[k] = null
|
198
|
+
}
|
199
|
+
}
|
200
|
+
})
|
201
|
+
}
|
202
|
+
|
203
|
+
}*/
|
204
|
+
|
205
|
+
/*this.field.options = Object.assign(
|
187
206
|
{},
|
188
207
|
config.options,
|
189
208
|
this.field.options
|
190
|
-
)
|
209
|
+
);*/
|
191
210
|
},
|
192
211
|
findInArray: function (e, t) {
|
193
212
|
if (!Array.isArray(e)) return -1;
|
@@ -935,12 +954,20 @@ modules = {
|
|
935
954
|
handleCustomClickEvent: function (flag) {
|
936
955
|
let tableParam = this.tableParam;
|
937
956
|
let clickBindEvent = !flag ? this.field.options.clickBindEvent : this.field.options.widgetTextLinkConfig?.options?.clickBindEvent;
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
957
|
+
|
958
|
+
const done = () => {
|
959
|
+
if (clickBindEvent == "1") {
|
960
|
+
//打开选择弹框
|
961
|
+
this.openSearchDialog(tableParam, flag);
|
962
|
+
} else if (clickBindEvent == "2") {
|
963
|
+
//列表插入数据
|
964
|
+
this.handleAddTableDataEvent(flag);
|
965
|
+
}
|
966
|
+
}
|
967
|
+
if (clickBindEvent && this.field.options.onBeforeClickButton) {
|
968
|
+
if (this.handleCustomEvent(this.field.options.onBeforeClickButton, ["done"], [done]) !== false) {
|
969
|
+
done();
|
970
|
+
}
|
944
971
|
}
|
945
972
|
},
|
946
973
|
handleAddTableDataEvent(flag) {
|
@@ -6,8 +6,17 @@
|
|
6
6
|
<el-option value="2" label="列表添加数据"></el-option>
|
7
7
|
</el-select>
|
8
8
|
</el-form-item>
|
9
|
-
<
|
10
|
-
|
9
|
+
<el-form-item label="点击前置事件" label-width="150px">
|
10
|
+
<a href="javascript:void(0);" class="a-link link-oneLind"
|
11
|
+
@click="editEventHandler('onBeforeClickButton', evnentParams)">
|
12
|
+
<span>{{ optionModel.onBeforeClickButton }}</span>
|
13
|
+
<i class="el-icon-edit"></i>
|
14
|
+
</a>
|
15
|
+
</el-form-item>
|
16
|
+
<searchDialogEventEditor :designer="designer" :selectedWidget="selectedWidget" :optionModel.sync="optionModel"
|
17
|
+
v-if="optionModel.clickBindEvent=='1'"></searchDialogEventEditor>
|
18
|
+
<addTableDataEventEditor :designer="designer" :selectedWidget="selectedWidget" :optionModel.sync="optionModel"
|
19
|
+
v-if="optionModel.clickBindEvent=='2'"></addTableDataEventEditor>
|
11
20
|
</div>
|
12
21
|
</template>
|
13
22
|
<script>
|
@@ -15,53 +24,59 @@ import searchDialogEventEditor from "./search-dialog-event-editor.vue";
|
|
15
24
|
import addTableDataEventEditor from "./addTableData-event-editor.vue";
|
16
25
|
import {defaultSearchDialogConfig} from "../../../../../../components/xform/form-designer/widget-panel/widgetsConfig";
|
17
26
|
|
18
|
-
|
19
27
|
import i18n from "../../../../../../components/xform/utils/i18n";
|
28
|
+
import eventMixin
|
29
|
+
from "../../../../../../components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin";
|
20
30
|
|
21
31
|
let clickBindEventConfig = {
|
22
|
-
searchDialogConfig:{
|
32
|
+
searchDialogConfig: {
|
23
33
|
...defaultSearchDialogConfig
|
24
34
|
},
|
25
|
-
addTableDataConfig:{
|
26
|
-
tableRef:null,
|
27
|
-
tableData:{}
|
35
|
+
addTableDataConfig: {
|
36
|
+
tableRef: null,
|
37
|
+
tableData: {}
|
28
38
|
}
|
29
39
|
}
|
30
40
|
|
31
41
|
export default {
|
32
42
|
name: "clickBindEvent-editor",
|
33
|
-
mixins: [i18n],
|
43
|
+
mixins: [i18n, eventMixin],
|
34
44
|
props: {
|
35
45
|
designer: Object,
|
36
46
|
selectedWidget: Object,
|
37
47
|
optionModel: Object,
|
38
48
|
},
|
39
|
-
components:{
|
49
|
+
components: {
|
40
50
|
searchDialogEventEditor,
|
41
51
|
addTableDataEventEditor
|
42
52
|
},
|
43
|
-
provide(){
|
53
|
+
provide() {
|
54
|
+
return {
|
55
|
+
defaultClickBindEventConfig: clickBindEventConfig
|
56
|
+
}
|
57
|
+
},
|
58
|
+
data() {
|
44
59
|
return {
|
45
|
-
|
60
|
+
evnentParams: ["dataId", "formCode", "done"]
|
46
61
|
}
|
47
62
|
},
|
48
63
|
created() {
|
49
|
-
if(!this.optionModel.addTableDataConfig){
|
64
|
+
if (!this.optionModel.addTableDataConfig) {
|
50
65
|
this.$set(this.optionModel, 'addTableDataConfig', this.$baseLodash.cloneDeep(clickBindEventConfig.addTableDataConfig));
|
51
66
|
}
|
52
|
-
if(!this.optionModel.searchDialogConfig){
|
67
|
+
if (!this.optionModel.searchDialogConfig) {
|
53
68
|
this.$set(this.optionModel, 'searchDialogConfig', this.$baseLodash.cloneDeep(clickBindEventConfig.searchDialogConfig));
|
54
69
|
}
|
55
|
-
if(this.optionModel.searchDialogConfig.multipleChoices === void 0){
|
56
|
-
if(this.selectedWidget.type=='vabsearch'){
|
57
|
-
this.$set(this.optionModel.searchDialogConfig,'multipleChoices',false);
|
58
|
-
}else{
|
59
|
-
this.$set(this.optionModel.searchDialogConfig,'multipleChoices',true);
|
70
|
+
if (this.optionModel.searchDialogConfig.multipleChoices === void 0) {
|
71
|
+
if (this.selectedWidget.type == 'vabsearch') {
|
72
|
+
this.$set(this.optionModel.searchDialogConfig, 'multipleChoices', false);
|
73
|
+
} else {
|
74
|
+
this.$set(this.optionModel.searchDialogConfig, 'multipleChoices', true);
|
60
75
|
}
|
61
76
|
}
|
62
77
|
},
|
63
|
-
methods:{
|
64
|
-
changeEventType(val){
|
78
|
+
methods: {
|
79
|
+
changeEventType(val) {
|
65
80
|
// this.optionModel.clickBindEventConfig = clickBindEventConfig;
|
66
81
|
// this.$set(this.optionModel, "clickBindEventConfig", clickBindEventConfig);
|
67
82
|
}
|
@@ -845,6 +845,7 @@ const vabsearchConfig = {
|
|
845
845
|
onChange: "",
|
846
846
|
onAppendButtonClick: "",
|
847
847
|
clickBindEvent: '1',
|
848
|
+
onBeforeClickButton:null,
|
848
849
|
searchDialogConfig: {
|
849
850
|
...defaultSearchDialogConfig,
|
850
851
|
multipleChoices: false
|
@@ -1810,6 +1811,7 @@ export const basicFields = [
|
|
1810
1811
|
onClick: "",
|
1811
1812
|
accessType: "1",
|
1812
1813
|
clickBindEvent: null,
|
1814
|
+
onBeforeClickButton:null,
|
1813
1815
|
searchDialogConfig: {
|
1814
1816
|
...defaultSearchDialogConfig
|
1815
1817
|
},
|
@@ -2016,6 +2018,7 @@ export const basicFields = [
|
|
2016
2018
|
onMounted: "",
|
2017
2019
|
onClick: "",
|
2018
2020
|
clickBindEvent: null,
|
2021
|
+
onBeforeClickButton:null,
|
2019
2022
|
searchDialogConfig: {
|
2020
2023
|
...defaultSearchDialogConfig
|
2021
2024
|
},
|
@@ -2050,6 +2053,7 @@ export const basicFields = [
|
|
2050
2053
|
|
2051
2054
|
onClick: "",
|
2052
2055
|
clickBindEvent: null,
|
2056
|
+
onBeforeClickButton:null,
|
2053
2057
|
searchDialogConfig: {
|
2054
2058
|
...defaultSearchDialogConfig
|
2055
2059
|
},
|
@@ -2759,6 +2763,7 @@ export const advancedFields = [
|
|
2759
2763
|
onCreated: "",
|
2760
2764
|
onMounted: "",
|
2761
2765
|
clickBindEvent: '1',
|
2766
|
+
onBeforeClickButton:null,
|
2762
2767
|
searchDialogConfig: {
|
2763
2768
|
...defaultSearchDialogConfig,
|
2764
2769
|
tableEnabled: true
|
@@ -2798,6 +2803,7 @@ export const advancedFields = [
|
|
2798
2803
|
accessType: "1",
|
2799
2804
|
saveButton: true,
|
2800
2805
|
clickBindEvent: null,
|
2806
|
+
onBeforeClickButton:null,
|
2801
2807
|
searchDialogConfig: {
|
2802
2808
|
...defaultSearchDialogConfig
|
2803
2809
|
},
|
@@ -2837,6 +2843,7 @@ export const advancedFields = [
|
|
2837
2843
|
onClick: "this.getFormRef().$baseReload()",
|
2838
2844
|
accessType: "1",
|
2839
2845
|
clickBindEvent: null,
|
2846
|
+
onBeforeClickButton:null,
|
2840
2847
|
searchDialogConfig: {
|
2841
2848
|
...defaultSearchDialogConfig
|
2842
2849
|
},
|
@@ -2900,6 +2907,7 @@ export const advancedFields = [
|
|
2900
2907
|
onMounted: "",
|
2901
2908
|
onClick: "",
|
2902
2909
|
clickBindEvent: null,
|
2910
|
+
onBeforeClickButton:null,
|
2903
2911
|
searchDialogConfig: {
|
2904
2912
|
...defaultSearchDialogConfig
|
2905
2913
|
},
|
@@ -2936,6 +2944,7 @@ export const advancedFields = [
|
|
2936
2944
|
onCreated: "",
|
2937
2945
|
onMounted: "",
|
2938
2946
|
// clickBindEvent: null,
|
2947
|
+
onBeforeClickButton:null,
|
2939
2948
|
searchDialogConfig: {
|
2940
2949
|
...defaultSearchDialogConfig
|
2941
2950
|
},
|
@@ -2982,6 +2991,7 @@ export const advancedFields = [
|
|
2982
2991
|
onCreated: "",
|
2983
2992
|
onMounted: "",
|
2984
2993
|
// clickBindEvent: null,
|
2994
|
+
onBeforeClickButton:null,
|
2985
2995
|
searchDialogConfig: {
|
2986
2996
|
...defaultSearchDialogConfig
|
2987
2997
|
},
|
@@ -3025,6 +3035,7 @@ export const advancedFields = [
|
|
3025
3035
|
onCreated: "",
|
3026
3036
|
onMounted: "",
|
3027
3037
|
// clickBindEvent: null,
|
3038
|
+
onBeforeClickButton:null,
|
3028
3039
|
searchDialogConfig: {
|
3029
3040
|
...defaultSearchDialogConfig
|
3030
3041
|
},
|
@@ -3225,6 +3236,7 @@ export const advancedFields = [
|
|
3225
3236
|
|
3226
3237
|
onClick: "",
|
3227
3238
|
clickBindEvent: null,
|
3239
|
+
onBeforeClickButton:null,
|
3228
3240
|
searchDialogConfig: {
|
3229
3241
|
...defaultSearchDialogConfig
|
3230
3242
|
},
|