@pisell/private-materials 3.0.31 → 3.0.33

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.
@@ -89,23 +89,26 @@ var Forms = Provider(function (props) {
89
89
  };
90
90
  }();
91
91
  var getFormData = /*#__PURE__*/function () {
92
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(formList) {
93
- var all;
92
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
93
+ var formList,
94
+ all,
95
+ _args2 = arguments;
94
96
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
95
97
  while (1) switch (_context2.prev = _context2.next) {
96
98
  case 0:
99
+ formList = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : [];
97
100
  all = [];
98
101
  all = formList.map(function (d) {
99
102
  return getFormDataById(d);
100
103
  });
101
104
  return _context2.abrupt("return", Promise.all(all));
102
- case 3:
105
+ case 4:
103
106
  case "end":
104
107
  return _context2.stop();
105
108
  }
106
109
  }, _callee2);
107
110
  }));
108
- return function getFormData(_x3) {
111
+ return function getFormData() {
109
112
  return _ref2.apply(this, arguments);
110
113
  };
111
114
  }();
@@ -141,15 +144,16 @@ var Forms = Provider(function (props) {
141
144
  });
142
145
  case 4:
143
146
  data = _context3.sent;
147
+ data = data || [];
144
148
  if (params.type === "form") {
145
149
  // 去除预约主体
146
150
  data = data.filter(function (d) {
147
151
  return d.form_id !== (params === null || params === void 0 ? void 0 : params.form_id);
148
152
  });
149
153
  }
150
- _context3.next = 8;
154
+ _context3.next = 9;
151
155
  return getFormData(data);
152
- case 8:
156
+ case 9:
153
157
  formData = _context3.sent;
154
158
  dispatch({
155
159
  type: "setForm",
@@ -159,17 +163,18 @@ var Forms = Provider(function (props) {
159
163
  }
160
164
  });
161
165
  setLoading(false);
162
- _context3.next = 16;
166
+ _context3.next = 18;
163
167
  break;
164
- case 13:
165
- _context3.prev = 13;
168
+ case 14:
169
+ _context3.prev = 14;
166
170
  _context3.t0 = _context3["catch"](1);
171
+ setLoading(false);
167
172
  console.log("form_error", _context3.t0);
168
- case 16:
173
+ case 18:
169
174
  case "end":
170
175
  return _context3.stop();
171
176
  }
172
- }, _callee3, null, [[1, 13]]);
177
+ }, _callee3, null, [[1, 14]]);
173
178
  }));
174
179
  return function geForms() {
175
180
  return _ref3.apply(this, arguments);
@@ -223,7 +228,7 @@ var Forms = Provider(function (props) {
223
228
  }
224
229
  }, _callee4, null, [[0, 8]]);
225
230
  }));
226
- return function saveBookingFormData(_x4) {
231
+ return function saveBookingFormData(_x3) {
227
232
  return _ref4.apply(this, arguments);
228
233
  };
229
234
  }();
@@ -272,7 +277,7 @@ var Forms = Provider(function (props) {
272
277
  }
273
278
  }, _callee5);
274
279
  }));
275
- return function addCallback(_x5) {
280
+ return function addCallback(_x4) {
276
281
  return _ref5.apply(this, arguments);
277
282
  };
278
283
  }();
@@ -78,7 +78,7 @@ var Forms = (0, import_model.Provider)((props) => {
78
78
  options
79
79
  };
80
80
  };
81
- const getFormData = async (formList) => {
81
+ const getFormData = async (formList = []) => {
82
82
  let all = [];
83
83
  all = formList.map((d) => getFormDataById(d));
84
84
  return Promise.all(all);
@@ -98,6 +98,7 @@ var Forms = (0, import_model.Provider)((props) => {
98
98
  relation_id: state.bookingDetail.bookings.id
99
99
  // _config: { useCache: true },
100
100
  });
101
+ data = data || [];
101
102
  if (params.type === "form") {
102
103
  data = data.filter((d) => d.form_id !== (params == null ? void 0 : params.form_id));
103
104
  }
@@ -111,6 +112,7 @@ var Forms = (0, import_model.Provider)((props) => {
111
112
  });
112
113
  setLoading(false);
113
114
  } catch (err) {
115
+ setLoading(false);
114
116
  console.log("form_error", err);
115
117
  }
116
118
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.31",
3
+ "version": "3.0.33",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -58,8 +58,8 @@
58
58
  "ahooks": "^3.7.6",
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
- "@pisell/utils": "1.0.23",
62
61
  "@pisell/date-picker": "1.0.68",
62
+ "@pisell/utils": "1.0.23",
63
63
  "@pisell/icon": "0.0.8"
64
64
  },
65
65
  "peerDependencies": {