@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
|
@@ -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="
|
|
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,
|