cloud-web-corejs 1.0.54-dev.260 → 1.0.54-dev.261

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.260",
4
+ "version": "1.0.54-dev.261",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -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) {
@@ -101,6 +102,9 @@ modules = {
101
102
  }
102
103
  }
103
104
  }
105
+ if (this.hasCofig("a")) {
106
+
107
+ }
104
108
  },
105
109
  mounted() {
106
110
  },
@@ -182,7 +186,18 @@ modules = {
182
186
  this.setReadonly(this.field.options.readonly)
183
187
  },
184
188
  initConfig() {
189
+ let options = this.field.options;
185
190
  let config = this.designer.getFieldWidgetByType(this.field.type);
191
+ Object.keys(config).forEach(function (k) {
192
+ if (!options.hasOwnProperty(k)) {
193
+ let val = config[k]
194
+ if (Array.isArray(val)) {
195
+ options[k] = []
196
+ } else {
197
+ options[k] = null
198
+ }
199
+ }
200
+ })
186
201
  this.field.options = Object.assign(
187
202
  {},
188
203
  config.options,
@@ -935,12 +950,20 @@ modules = {
935
950
  handleCustomClickEvent: function (flag) {
936
951
  let tableParam = this.tableParam;
937
952
  let clickBindEvent = !flag ? this.field.options.clickBindEvent : this.field.options.widgetTextLinkConfig?.options?.clickBindEvent;
938
- if (clickBindEvent == "1") {
939
- //打开选择弹框
940
- this.openSearchDialog(tableParam, flag);
941
- } else if (clickBindEvent == "2") {
942
- //列表插入数据
943
- this.handleAddTableDataEvent(flag);
953
+
954
+ const done = () => {
955
+ if (clickBindEvent == "1") {
956
+ //打开选择弹框
957
+ this.openSearchDialog(tableParam, flag);
958
+ } else if (clickBindEvent == "2") {
959
+ //列表插入数据
960
+ this.handleAddTableDataEvent(flag);
961
+ }
962
+ }
963
+ if (clickBindEvent && this.field.options.onBeforeClickButton) {
964
+ if (this.handleCustomEvent(this.field.options.onBeforeClickButton, ["done"], [done]) !== false) {
965
+ done();
966
+ }
944
967
  }
945
968
  },
946
969
  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
- <searchDialogEventEditor :designer="designer" :selectedWidget="selectedWidget" :optionModel.sync="optionModel" v-if="optionModel.clickBindEvent=='1'"></searchDialogEventEditor>
10
- <addTableDataEventEditor :designer="designer" :selectedWidget="selectedWidget" :optionModel.sync="optionModel" v-if="optionModel.clickBindEvent=='2'"></addTableDataEventEditor>
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
- defaultClickBindEventConfig:clickBindEventConfig
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
  },