cloud-web-corejs 1.0.54-dev.184 → 1.0.54-dev.185

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.184",
4
+ "version": "1.0.54-dev.185",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -467,8 +467,8 @@ modules = {
467
467
  : delete this.refList[e];
468
468
  }
469
469
  },
470
- getOptionKey(){
471
- let key = "optionItems-"+ this.field.options.name
470
+ getOptionKey() {
471
+ let key = "optionItems-" + this.field.options.name
472
472
  return key;
473
473
  },
474
474
  async initOptionItems(gloatFlag) {
@@ -540,13 +540,13 @@ modules = {
540
540
  );
541
541
  },
542
542
  });
543
- }else{
544
- if(tableParam){
543
+ } else {
544
+ if (tableParam) {
545
545
  // tableParam.column.params.optionItems
546
546
  // let key = this.getOptionKey();
547
547
  // let optionItems = tableParam.column.params[key];
548
548
  let optionItems = this.getGloatOptionItems();
549
- if(optionItems!==undefined){
549
+ if (optionItems !== undefined) {
550
550
  return
551
551
  }
552
552
  // tableParam.column.params[key] = this.$baseLodash.cloneDeep(this.field.options.optionItems);
@@ -772,7 +772,7 @@ modules = {
772
772
  },
773
773
  handleCustomClickEvent: function (flag) {
774
774
  let tableParam = this.tableParam;
775
- let clickBindEvent = !flag ? this.field.options.clickBindEvent: this.field.options.widgetTextLinkConfig?.options?.clickBindEvent;
775
+ let clickBindEvent = !flag ? this.field.options.clickBindEvent : this.field.options.widgetTextLinkConfig?.options?.clickBindEvent;
776
776
  if (clickBindEvent == "1") {
777
777
  //打开选择弹框
778
778
  this.openSearchDialog(tableParam, flag);
@@ -782,7 +782,7 @@ modules = {
782
782
  }
783
783
  },
784
784
  handleAddTableDataEvent(flag) {
785
- let optionModel = !flag? this.field.options : (this.field.options.widgetTextLinkConfig?.options || {});
785
+ let optionModel = !flag ? this.field.options : (this.field.options.widgetTextLinkConfig?.options || {});
786
786
 
787
787
  let addTableDataConfig = optionModel.addTableDataConfig || {};
788
788
  if (!addTableDataConfig.tableRef) return;
@@ -807,9 +807,9 @@ modules = {
807
807
  o.call(this, e, t, i, n);
808
808
  }
809
809
  },
810
- handleButtonWidgetClick: function (event,flag) {
810
+ handleButtonWidgetClick: function (event, flag) {
811
811
  if (!this.designState) {
812
- let onClick = !flag? this.field.options.onClick : this.field.options.widgetTextLinkConfig?.options?.onClick
812
+ let onClick = !flag ? this.field.options.onClick : this.field.options.widgetTextLinkConfig?.options?.onClick
813
813
  if (onClick) {
814
814
  let tableParam = this.tableParam;
815
815
  let eventParamNames = ["event"];
@@ -824,7 +824,7 @@ modules = {
824
824
  eventParamValues
825
825
  );
826
826
  } else {
827
- if(!flag)this.dispatch("VFormRender", "buttonClick", [this]);
827
+ if (!flag) this.dispatch("VFormRender", "buttonClick", [this]);
828
828
  }
829
829
  this.handleCustomClickEvent(flag);
830
830
  }
@@ -833,8 +833,8 @@ modules = {
833
833
  let searchDialogConfig = this.field.options.searchDialogConfig || {};
834
834
  let tableData = searchDialogConfig.tableData || [];
835
835
  },
836
- openSearchDialog(tableParam,flag) {
837
- let optionModel = !flag? this.field.options : (this.field.options.widgetTextLinkConfig?.options || {});
836
+ openSearchDialog(tableParam, flag) {
837
+ let optionModel = !flag ? this.field.options : (this.field.options.widgetTextLinkConfig?.options || {});
838
838
  let searchDialogConfig = optionModel.searchDialogConfig || {};
839
839
  let formCode = searchDialogConfig.formCode;
840
840
  let tableData = searchDialogConfig.tableData || [];
@@ -861,7 +861,7 @@ modules = {
861
861
  rows,
862
862
  multiple: searchDialogConfig.multipleChoices || false,
863
863
  confirm: (rows) => {
864
- this.handleConfirmSearchDialog(rows, false ,flag);
864
+ this.handleConfirmSearchDialog(rows, false, flag);
865
865
  /*if(rows.length){
866
866
  let row = rows[0];
867
867
  if(this.field.type == "vabsearch"){
@@ -909,9 +909,9 @@ modules = {
909
909
  let multipleChoices = this.field.options.multipleChoices;
910
910
  return multipleChoices;
911
911
  },
912
- handleConfirmSearchDialog(rows, isClear,flag) {
912
+ handleConfirmSearchDialog(rows, isClear, flag) {
913
913
  if (!isClear && !rows.length) return;
914
- let optionModel = !flag? this.field.options : (this.field.options.widgetTextLinkConfig?.options || {});
914
+ let optionModel = !flag ? this.field.options : (this.field.options.widgetTextLinkConfig?.options || {});
915
915
 
916
916
  let tableParam = this.tableParam;
917
917
  let searchDialogConfig = optionModel.searchDialogConfig || {};
@@ -928,7 +928,7 @@ modules = {
928
928
 
929
929
  if (tableParam) {
930
930
  let rowData = tableParam.row;
931
- if (multipleChoices) {
931
+ if (this.getMultipleChoices()) {
932
932
  if (isClear) {
933
933
  rowData[fieldKeyName] = [];
934
934
  } else {
@@ -963,26 +963,44 @@ modules = {
963
963
  });
964
964
  }
965
965
  } else {
966
- this.fieldModel = !isClear
967
- ? row[searchDialogConfig.valueSourceField]
968
- : null;
969
- if (searchDialogConfig.labelSourceField) {
970
- this.setShowValue(
971
- !isClear ? row[searchDialogConfig.labelSourceField] : null
972
- );
973
- }
974
- tableData.forEach((item) => {
975
- // formModel[item.targetField] = row[item.sourceField]
976
- let value = !isClear ? row[item.sourceField] ?? null : null;
977
- if (item.targetField) {
978
- this.getWidgetRef(item.targetField).setValue(value);
979
- } else if (item.targetFormField) {
980
- formModel[item.targetFormField] = value;
966
+ if (this.getMultipleChoices()) {
967
+ let rowData = [];
968
+ if (isClear) {
969
+ rowData = [];
970
+ } else {
971
+ rowData = rows.map((item) => {
972
+ let newData = {};
973
+ newData[valueField] =
974
+ item[searchDialogConfig.valueSourceField] ?? null;
975
+ newData[vabSearchName] =
976
+ item[searchDialogConfig.labelSourceField] ?? null;
977
+ tableData.forEach((item1) => {
978
+ let targetFormField = item1.targetFormField || item1.targetField
979
+ newData[targetFormField] = item[item1.sourceField];
980
+ });
981
+ return newData;
982
+ });
981
983
  }
982
-
983
- // formModel[item.targetField] = value;
984
- });
985
- // this.$forceUpdate();
984
+ this.setValue(rowData);
985
+ } else {
986
+ this.fieldModel = !isClear
987
+ ? row[searchDialogConfig.valueSourceField]
988
+ : null;
989
+ if (searchDialogConfig.labelSourceField) {
990
+ this.setShowValue(
991
+ !isClear ? row[searchDialogConfig.labelSourceField] : null
992
+ );
993
+ }
994
+ tableData.forEach((item) => {
995
+ // formModel[item.targetField] = row[item.sourceField]
996
+ let value = !isClear ? row[item.sourceField] ?? null : null;
997
+ if (item.targetField) {
998
+ this.getWidgetRef(item.targetField).setValue(value);
999
+ } else if (item.targetFormField) {
1000
+ formModel[item.targetFormField] = value;
1001
+ }
1002
+ });
1003
+ }
986
1004
  }
987
1005
  } else {
988
1006
  if (searchDialogConfig.tableEnabled) {
@@ -1131,7 +1149,7 @@ modules = {
1131
1149
  );
1132
1150
  this.field.options.optionItems = optionItems
1133
1151
  },
1134
- loadOptions: function (e,rowOptionFlag) {
1152
+ loadOptions: function (e, rowOptionFlag) {
1135
1153
  let optionItems = baseRefUtil.translateOptionItems(
1136
1154
  e,
1137
1155
  this.field.type,
@@ -1146,12 +1164,12 @@ modules = {
1146
1164
  }*/
1147
1165
  },
1148
1166
  getGloatOptionItems: function (e, rowOptionFlag) {
1149
- let key = this.getOptionKey()
1167
+ let key = this.getOptionKey()
1150
1168
  return this.getGlobalParam(key);
1151
1169
  },
1152
1170
  setGloatOptionItems: function (optionItems) {
1153
- let key = this.getOptionKey()
1154
- return this.setGlobalParam(key,optionItems);
1171
+ let key = this.getOptionKey()
1172
+ return this.setGlobalParam(key, optionItems);
1155
1173
  },
1156
1174
  reloadOptions: function (e) {
1157
1175
  let optionItems = baseRefUtil.translateOptionItems(
@@ -1162,7 +1180,7 @@ modules = {
1162
1180
  );
1163
1181
  this.field.options.optionItems = optionItems;
1164
1182
  let tableParam = this.tableParam;
1165
- if(tableParam){
1183
+ if (tableParam) {
1166
1184
  // let key = this.getOptionKey();
1167
1185
  // tableParam.column.params[key] = optionItems;
1168
1186
  this.setGloatOptionItems(optionItems)
@@ -1314,19 +1332,19 @@ modules = {
1314
1332
  let name = this.parentWidget?.options?.name ?? null;
1315
1333
  return name ? this.getWidgetRef(name) : null;
1316
1334
  },
1317
- setWidgetTextFlag(val){
1335
+ setWidgetTextFlag(val) {
1318
1336
  this.widgetTextFlag = val;
1319
1337
  },
1320
- showWidget(){
1338
+ showWidget() {
1321
1339
  this.widgetTextFlag = 0;
1322
1340
  },
1323
- showText(){
1341
+ showText() {
1324
1342
  this.widgetTextFlag = 1;
1325
1343
  },
1326
- showEncryptText(){
1344
+ showEncryptText() {
1327
1345
  this.widgetTextFlag = 2;
1328
1346
  },
1329
- showAText(){
1347
+ showAText() {
1330
1348
  this.widgetTextFlag = 3;
1331
1349
  },
1332
1350
  },