@zscreate/zhxy-app-component 1.0.356 → 1.0.358

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.
@@ -968,10 +968,21 @@ export default {
968
968
  if(this.widget.options.forcedReElection){
969
969
  this.handleForcedReElection(values);
970
970
  this.checkboxAndRadioOptions = this.checkboxAndRadioOptions.map(item=>{
971
- if(this.dataModel.includes(item.value)){
972
- this.$set(item, 'checked', true);
973
- }else{
974
- this.$set(item, 'checked', false);
971
+ // 区分单选框和复选框的处理逻辑
972
+ if (this.widget.type === 'radio') {
973
+ // 单选框:直接比较值是否相等
974
+ if(this.dataModel === item.value){
975
+ this.$set(item, 'checked', true);
976
+ }else{
977
+ this.$set(item, 'checked', false);
978
+ }
979
+ } else {
980
+ // 复选框:使用 includes 方法检查数组中是否包含该值
981
+ if(this.dataModel.includes(item.value)){
982
+ this.$set(item, 'checked', true);
983
+ }else{
984
+ this.$set(item, 'checked', false);
985
+ }
975
986
  }
976
987
  return item;
977
988
  })
@@ -980,10 +991,21 @@ export default {
980
991
  // 原定逻辑,报错太多,合并可能出相关问题,暂不予合并
981
992
  for (var i = 0, lenI = this.checkboxAndRadioOptions.length; i < lenI; ++i) {
982
993
  const item = this.checkboxAndRadioOptions[i]
983
- if (this.dataModel.includes(item.value)) {
984
- this.$set(item, 'checked', true)
994
+ // 区分单选框和复选框的处理逻辑
995
+ if (this.widget.type === 'radio') {
996
+ // 单选框:直接比较值是否相等
997
+ if (this.dataModel === item.value) {
998
+ this.$set(item, 'checked', true)
999
+ } else {
1000
+ this.$set(item, 'checked', false)
1001
+ }
985
1002
  } else {
986
- this.$set(item, 'checked', false)
1003
+ // 复选框:使用 includes 方法检查数组中是否包含该值
1004
+ if (this.dataModel.includes(item.value)) {
1005
+ this.$set(item, 'checked', true)
1006
+ } else {
1007
+ this.$set(item, 'checked', false)
1008
+ }
987
1009
  }
988
1010
  }
989
1011
  }
@@ -1530,10 +1552,21 @@ export default {
1530
1552
  this.checkboxAndRadioOptions = JSON.parse(JSON.stringify(arr));
1531
1553
  if (!this.dataModel) return false;
1532
1554
  this.checkboxAndRadioOptions.forEach(item => {
1533
- if (this.dataModel.includes(item.value)) {
1534
- this.$set(item, 'checked', true)
1555
+ // 区分单选框和复选框的处理逻辑
1556
+ if (this.widget.type === 'radio') {
1557
+ // 单选框:直接比较值是否相等
1558
+ if (this.dataModel === item.value) {
1559
+ this.$set(item, 'checked', true)
1560
+ } else {
1561
+ this.$set(item, 'checked', false)
1562
+ }
1535
1563
  } else {
1536
- this.$set(item, 'checked', false)
1564
+ // 复选框:使用 includes 方法检查数组中是否包含该值
1565
+ if (this.dataModel.includes(item.value)) {
1566
+ this.$set(item, 'checked', true)
1567
+ } else {
1568
+ this.$set(item, 'checked', false)
1569
+ }
1537
1570
  }
1538
1571
  })
1539
1572
  // console.log('this.checkboxAndRadioOptions', this.checkboxAndRadioOptions)
@@ -2925,17 +2958,11 @@ checkbox-group label {
2925
2958
  }
2926
2959
  ::v-deep .form-input-placeholder-textarea {
2927
2960
  text-align: left !important;
2928
- overflow: hidden;
2929
- text-overflow: ellipsis;
2930
- white-space: nowrap;
2931
2961
  }
2932
2962
  .form-textarea-placeholder {
2933
2963
  padding-top: 28upx;
2934
2964
  font-size: 34upx;
2935
2965
  width: 100%;
2936
- overflow: hidden;
2937
- text-overflow: ellipsis;
2938
- white-space: nowrap;
2939
2966
  }
2940
2967
 
2941
2968
  .evan-form-item-container--top .radio-height {
@@ -720,9 +720,9 @@ export default {
720
720
  },
721
721
  //更新widget 目前应用于子表单关联子组件隐藏 禁用
722
722
  upDateTableWidget(widget, key, tableKey, tableIndex) {
723
- debugger
724
723
  this.tableData[tableKey][tableIndex].columns.splice(key, 1, widget)
725
724
  },
725
+ //更新widget 目前应用于栅格布局关联子组件隐藏 禁用
726
726
  upDateGridWidget(widget) {
727
727
  this.data.list.forEach((item, index) => {
728
728
  if(item.model == widget.parentModel) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zscreate/zhxy-app-component",
3
- "version": "1.0.356",
3
+ "version": "1.0.358",
4
4
  "private": false,
5
5
  "description": "zhxy-app-component",
6
6
  "main": "index.js",