@zscreate/zhxy-app-component 1.0.345 → 1.0.347

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/README.md CHANGED
@@ -9,4 +9,5 @@
9
9
  浙江安防会议室 zjaf_meeting_20241203
10
10
 
11
11
  浙江安防文件上传预览 zjaf_file_20241216
12
- 滁州学院默认图片以及最少选做多选 czxy_20250423_mobile
12
+ 滁州学院默认图片以及最少选做多选 czxy_20250423_mobile
13
+ 铜陵学院新版h5 tlxy_20250822_mobile 1.0.345
@@ -158,8 +158,8 @@
158
158
  </view>
159
159
  <view class="evan-form-item-container__main" :style="mContentStyle" style="padding: 0;">
160
160
  <view class="uni-list">
161
- <checkbox-group @change="checkboxChange" :disabled="widget.options.disabled">
162
- <label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in checkboxAndRadioOptions"
161
+ <checkbox-group :value="dataModel" @change="checkboxChange" :disabled="widget.options.disabled" :key="checkBoxKey">
162
+ <label class="uni-list-cell uni-list-cell-pd" v-for="item in checkboxAndRadioOptions"
163
163
  :key="item.value">
164
164
  <view>
165
165
  <label>
@@ -853,6 +853,7 @@ export default {
853
853
  correntArray: ['input', 'textarea','date'],
854
854
  checkboxAndRadioOptions: [],
855
855
  selectedData: [],
856
+ checkboxKey:1,
856
857
  locationInfo: {},
857
858
  correctObj: undefined,
858
859
  zbrqshow: false,
@@ -958,7 +959,47 @@ export default {
958
959
  this.valueSet(e.target.value)
959
960
  }
960
961
  this.validateInit()
961
- },
962
+ this.checkboxChangeDesign(e)
963
+ },
964
+ checkboxChangeDesign: function(e) {
965
+ let values = e.detail.value;
966
+ if(this.widget.options.forcedReElection){
967
+ this.handleForcedReElection(values);
968
+ this.checkboxAndRadioOptions = this.checkboxAndRadioOptions.map(item=>{
969
+ if(this.dataModel.includes(item.value)){
970
+ this.$set(item, 'checked', true);
971
+ }else{
972
+ this.$set(item, 'checked', false);
973
+ }
974
+ return item;
975
+ })
976
+ }else{
977
+ this.dataModel = values
978
+ // 原定逻辑,报错太多,合并可能出相关问题,暂不予合并
979
+ for (var i = 0, lenI = this.checkboxAndRadioOptions.length; i < lenI; ++i) {
980
+ const item = this.checkboxAndRadioOptions[i]
981
+ if (this.dataModel.includes(item.value)) {
982
+ this.$set(item, 'checked', true)
983
+ } else {
984
+ this.$set(item, 'checked', false)
985
+ }
986
+ }
987
+ }
988
+ this.checkBoxKey++;//触发页面不渲染bug,触发重新渲染
989
+ },
990
+ // 处理连选逻辑
991
+ handleForcedReElection(checkedValues){
992
+ if(this.dataModel.length > checkedValues.length){
993
+ this.dataModel = this.dataModel.filter(item=>checkedValues.findIndex(c=>c==item)==-1);
994
+ }else{
995
+ let checkedValueIndex = checkedValues.map(item=>{
996
+ return this.checkboxAndRadioOptions.findIndex(_=>_.value == item);
997
+ })
998
+ const startIndex = Math.min(...checkedValueIndex);
999
+ const endIndex = Math.max(...checkedValueIndex);
1000
+ this.dataModel = this.checkboxAndRadioOptions.filter((_,index) => index >= startIndex && index <= endIndex).map(item=>item.value);
1001
+ }
1002
+ },
962
1003
  setRules() {
963
1004
  let widget = this.widget;
964
1005
  // 最多选最少选
@@ -1434,6 +1475,7 @@ export default {
1434
1475
  },
1435
1476
  // 关联表单
1436
1477
  relateSub(widget) {
1478
+ uni.setStorageSync('formData', this.models)
1437
1479
  if (this.widget.options.disabled) return;
1438
1480
  let params = {
1439
1481
  SQL: widget.SQL,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zscreate/zhxy-app-component",
3
- "version": "1.0.345",
3
+ "version": "1.0.347",
4
4
  "private": false,
5
5
  "description": "zhxy-app-component",
6
6
  "main": "index.js",