@cloudbase/weda-ui-mp 3.7.11 → 3.7.12

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.
@@ -630,8 +630,8 @@ Component({
630
630
  },
631
631
  'dataSourceType,loading,_status': function (d, l, s) {
632
632
  let status = s;
633
- if (d === 'expression') {
634
- status = l ? 'loading' : '';
633
+ if (d === 'expression' && l) {
634
+ status = 'loading';
635
635
  }
636
636
  this.setData({ status });
637
637
  },
@@ -112,7 +112,7 @@ Component({
112
112
  });
113
113
  });
114
114
  },
115
- setReadOnly() {
115
+ setReadOnly(val = true) {
116
116
  Object.keys(this.data._formItemMap).forEach((name) => {
117
117
  const items = this.data._formItemMap[name];
118
118
  items.forEach((item) => {
@@ -120,7 +120,7 @@ Component({
120
120
  console.error('表单组件缺少setReadOnly方法:', item);
121
121
  return;
122
122
  }
123
- item.setReadOnly(true);
123
+ item.setReadOnly(val);
124
124
  });
125
125
  });
126
126
  },
@@ -607,13 +607,14 @@ Component({
607
607
  items = [items];
608
608
  }
609
609
  items.forEach((item) => {
610
- const recoverFn = item.setReadOnly(true);
610
+ const recoverFn = (val) => item.setReadOnly(val);
611
+ recoverFn(true);
611
612
  this.data._recoverFns.push(recoverFn);
612
613
  this.setData({ _recoverFns: this.data._recoverFns });
613
614
  });
614
615
  });
615
616
  } else {
616
- this.data._recoverFns.forEach((fn) => fn());
617
+ this.data._recoverFns.forEach((fn) => fn(false));
617
618
  this.setData({ _recoverFns: [] });
618
619
  }
619
620
  this.setData({ _previousFormType: formType });
@@ -631,6 +632,8 @@ Component({
631
632
  ) {
632
633
  if (formType === 'read') {
633
634
  this.setReadOnly();
635
+ } else {
636
+ this.setReadOnly(false);
634
637
  }
635
638
  const isDataModel = ![
636
639
  'connector',
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "miniprogram": "./",
4
4
  "packageManager": "yarn@3.0.2",
5
5
  "dependencies": {},
6
- "version": "3.7.11",
6
+ "version": "3.7.12",
7
7
  "main": "./",
8
8
  "publishConfig": {
9
9
  "access": "public"