@pisell/private-materials 3.0.49 → 3.0.51
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +6 -6
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +2 -1
- package/es/components/booking/components/customSelect/index.js +6 -3
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +2 -1
- package/es/components/booking/forms/single/index.js +2 -1
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/model.d.ts +2 -1
- package/es/components/booking/info/pet/index.js +172 -69
- package/es/components/booking/model.d.ts +2 -1
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +2 -1
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +2 -1
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +2 -1
- package/lib/components/booking/components/customSelect/index.js +3 -3
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +2 -1
- package/lib/components/booking/forms/single/index.js +2 -1
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/model.d.ts +2 -1
- package/lib/components/booking/info/pet/index.js +127 -49
- package/lib/components/booking/model.d.ts +2 -1
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +2 -1
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +2 -1
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -142,6 +142,9 @@ var CustomSelect = function CustomSelect(props, ref) {
|
|
|
142
142
|
if (disabled) {
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
|
+
if (addButtonProps !== null && addButtonProps !== void 0 && addButtonProps.addCallback) {
|
|
146
|
+
addButtonProps === null || addButtonProps === void 0 ? void 0 : addButtonProps.addCallback();
|
|
147
|
+
}
|
|
145
148
|
// 打开
|
|
146
149
|
setOpen(true);
|
|
147
150
|
// 初始化value
|
|
@@ -342,9 +345,9 @@ var CustomSelect = function CustomSelect(props, ref) {
|
|
|
342
345
|
showSub: isMore
|
|
343
346
|
}, addButtonProps, {
|
|
344
347
|
onClick: function onClick() {
|
|
345
|
-
if (addButtonProps.addCallback) {
|
|
346
|
-
|
|
347
|
-
}
|
|
348
|
+
// if (addButtonProps.addCallback) {
|
|
349
|
+
// addButtonProps?.addCallback();
|
|
350
|
+
// }
|
|
348
351
|
if (addButtonProps.onClick) {
|
|
349
352
|
addButtonProps.onClick();
|
|
350
353
|
return;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -205,7 +205,8 @@ var Single = function Single(_ref) {
|
|
|
205
205
|
name: ((_form$form3 = form.form) === null || _form$form3 === void 0 ? void 0 : _form$form3.title) || "-",
|
|
206
206
|
addButtonProps: _addButtonProps,
|
|
207
207
|
drawerProps: {
|
|
208
|
-
title: "".concat(locales.getText("pisell2.text.select"), " ").concat(((_form$form4 = form.form) === null || _form$form4 === void 0 ? void 0 : _form$form4.title) || "-")
|
|
208
|
+
title: "".concat(locales.getText("pisell2.text.select"), " ").concat(((_form$form4 = form.form) === null || _form$form4 === void 0 ? void 0 : _form$form4.title) || "-"),
|
|
209
|
+
destroyOnClose: true
|
|
209
210
|
},
|
|
210
211
|
optionRender: _optionRender,
|
|
211
212
|
rowKey: "form_record_id"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Booking: (props: any) =>
|
|
1
|
+
declare const Booking: (props: any) => any;
|
|
2
2
|
export default Booking;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
3
|
export declare const walkInData: {
|
|
3
4
|
id: number;
|
|
4
5
|
nickname: string;
|
|
5
6
|
};
|
|
6
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
7
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
7
8
|
state: FormState;
|
|
8
9
|
} & {
|
|
9
10
|
dispatch: (params: {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
5
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
6
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
7
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
8
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
12
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
13
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
14
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
14
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
15
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
16
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
17
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -21,31 +21,45 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
21
21
|
import React, { useContext, useEffect, useMemo, useState } from "react";
|
|
22
22
|
import User01 from "@pisell/icon/es/User01";
|
|
23
23
|
import { Context } from "../model";
|
|
24
|
-
import { Avatar, Skeleton } from "antd";
|
|
24
|
+
import { Avatar, Skeleton, Button } from "antd";
|
|
25
25
|
import "./index.less";
|
|
26
26
|
import { locales } from "@pisell/utils";
|
|
27
27
|
import FormsCom from "../../forms/forms";
|
|
28
28
|
import { changeFormValues } from "../../forms/format";
|
|
29
29
|
import { isWalkIn } from "../../utils";
|
|
30
30
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
31
|
+
var defaultParams = {
|
|
32
|
+
skip: 1,
|
|
33
|
+
num: 100,
|
|
34
|
+
total: 0,
|
|
35
|
+
keyword: ""
|
|
36
|
+
};
|
|
31
37
|
var Pet = function Pet() {
|
|
32
|
-
var _context$appHelper, _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$client$value2, _state$client8, _state$client8$value, _state$client9;
|
|
38
|
+
var _context$appHelper, _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$bookingConfig6, _state$client$value2, _state$client8, _state$client8$value, _state$pet5, _state$pet5$formData, _state$pet5$formData$, _state$pet5$formData$2, _state$client9;
|
|
33
39
|
var _useState = useState(false),
|
|
34
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
loadLoading = _useState2[0],
|
|
42
|
+
setLoadLoading = _useState2[1];
|
|
43
|
+
var _useState3 = useState(false),
|
|
44
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
45
|
+
loading = _useState4[0],
|
|
46
|
+
setLoading = _useState4[1];
|
|
37
47
|
var _useContext = useContext(Context),
|
|
38
48
|
state = _useContext.state,
|
|
39
49
|
dispatch = _useContext.dispatch;
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
valueLoading =
|
|
43
|
-
setValueLoading =
|
|
50
|
+
var _useState5 = useState(false),
|
|
51
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
52
|
+
valueLoading = _useState6[0],
|
|
53
|
+
setValueLoading = _useState6[1];
|
|
44
54
|
var context = useEngineContext();
|
|
45
55
|
var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
|
46
56
|
isTerminal = _ref.isTerminal;
|
|
57
|
+
var _useState7 = useState(defaultParams),
|
|
58
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
59
|
+
params = _useState8[0],
|
|
60
|
+
setParams = _useState8[1];
|
|
47
61
|
// board设置, 获取预约主体
|
|
48
|
-
var
|
|
62
|
+
var boardParams = useMemo(function () {
|
|
49
63
|
var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2;
|
|
50
64
|
return (state === null || state === void 0 ? void 0 : (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 ? void 0 : (_state$bookingConfig$ = _state$bookingConfig.config) === null || _state$bookingConfig$ === void 0 ? void 0 : (_state$bookingConfig$2 = _state$bookingConfig$.basic) === null || _state$bookingConfig$2 === void 0 ? void 0 : _state$bookingConfig$2.appointment_subject) || {};
|
|
51
65
|
}, [state === null || state === void 0 ? void 0 : (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 ? void 0 : (_state$bookingConfig3 = _state$bookingConfig2.config) === null || _state$bookingConfig3 === void 0 ? void 0 : (_state$bookingConfig4 = _state$bookingConfig3.basic) === null || _state$bookingConfig4 === void 0 ? void 0 : _state$bookingConfig4.appointment_subject]);
|
|
@@ -59,8 +73,19 @@ var Pet = function Pet() {
|
|
|
59
73
|
* @Date: 2024-01-27 14:22
|
|
60
74
|
*/
|
|
61
75
|
var petForm = useMemo(function () {
|
|
62
|
-
|
|
63
|
-
|
|
76
|
+
var _state$bookingConfig5;
|
|
77
|
+
var _holder = (_state$bookingConfig5 = state.bookingConfig) === null || _state$bookingConfig5 === void 0 ? void 0 : _state$bookingConfig5.holder;
|
|
78
|
+
if (!_holder) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return _objectSpread(_objectSpread(_objectSpread({}, _holder), _holder === null || _holder === void 0 ? void 0 : _holder.form), {}, {
|
|
82
|
+
options: [],
|
|
83
|
+
form_id: _holder.form.id,
|
|
84
|
+
field: _holder.form.form_field,
|
|
85
|
+
relation_type: "appointment_booking",
|
|
86
|
+
form_record: []
|
|
87
|
+
});
|
|
88
|
+
}, [(_state$bookingConfig6 = state.bookingConfig) === null || _state$bookingConfig6 === void 0 ? void 0 : _state$bookingConfig6.holder]);
|
|
64
89
|
|
|
65
90
|
/**
|
|
66
91
|
* @title: 获取表单数据
|
|
@@ -73,32 +98,47 @@ var Pet = function Pet() {
|
|
|
73
98
|
var getFormData = /*#__PURE__*/function () {
|
|
74
99
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
|
75
100
|
var _state$client, _state$client$value;
|
|
76
|
-
var formData,
|
|
101
|
+
var formData,
|
|
102
|
+
_params,
|
|
103
|
+
_list,
|
|
104
|
+
noClient,
|
|
105
|
+
_values,
|
|
106
|
+
_state$client2,
|
|
107
|
+
_state$client2$value,
|
|
108
|
+
data,
|
|
109
|
+
_args = arguments;
|
|
77
110
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
78
111
|
while (1) switch (_context.prev = _context.next) {
|
|
79
112
|
case 0:
|
|
80
113
|
formData = _ref2.formData;
|
|
114
|
+
_params = _args.length > 1 && _args[1] !== undefined ? _args[1] : defaultParams;
|
|
81
115
|
setLoading(true);
|
|
82
116
|
_list = []; // 只要不是 客户表单并且没选择客户, 都获取数据
|
|
83
117
|
noClient = formData.data_range === "customer" && isWalkIn((_state$client = state.client) === null || _state$client === void 0 ? void 0 : (_state$client$value = _state$client.value) === null || _state$client$value === void 0 ? void 0 : _state$client$value.id);
|
|
84
118
|
if (noClient) {
|
|
85
|
-
_context.next =
|
|
119
|
+
_context.next = 14;
|
|
86
120
|
break;
|
|
87
121
|
}
|
|
88
|
-
|
|
89
|
-
form_id:
|
|
90
|
-
|
|
91
|
-
num: 999
|
|
92
|
-
};
|
|
122
|
+
_values = _objectSpread({
|
|
123
|
+
form_id: boardParams.form_id
|
|
124
|
+
}, _params);
|
|
93
125
|
if (formData.data_range === "customer") {
|
|
94
|
-
|
|
126
|
+
_values.customer_id = (_state$client2 = state.client) === null || _state$client2 === void 0 ? void 0 : (_state$client2$value = _state$client2.value) === null || _state$client2$value === void 0 ? void 0 : _state$client2$value.id;
|
|
95
127
|
}
|
|
96
|
-
_context.next =
|
|
97
|
-
return state.apis.getPetsData(
|
|
98
|
-
case
|
|
128
|
+
_context.next = 10;
|
|
129
|
+
return state.apis.getPetsData(_values);
|
|
130
|
+
case 10:
|
|
99
131
|
data = _context.sent;
|
|
100
|
-
_list = (
|
|
101
|
-
|
|
132
|
+
_list = _toConsumableArray(formData.options);
|
|
133
|
+
if (_params.skip === 1) {
|
|
134
|
+
_list = (data === null || data === void 0 ? void 0 : data.list) || [];
|
|
135
|
+
} else {
|
|
136
|
+
_list = _list.concat((data === null || data === void 0 ? void 0 : data.list) || []);
|
|
137
|
+
}
|
|
138
|
+
setParams(_objectSpread(_objectSpread(_objectSpread({}, params), _params), {}, {
|
|
139
|
+
total: (data === null || data === void 0 ? void 0 : data.count) || 0
|
|
140
|
+
}));
|
|
141
|
+
case 14:
|
|
102
142
|
dispatch({
|
|
103
143
|
type: "setPet",
|
|
104
144
|
payload: {
|
|
@@ -109,7 +149,7 @@ var Pet = function Pet() {
|
|
|
109
149
|
}
|
|
110
150
|
});
|
|
111
151
|
setLoading(false);
|
|
112
|
-
case
|
|
152
|
+
case 16:
|
|
113
153
|
case "end":
|
|
114
154
|
return _context.stop();
|
|
115
155
|
}
|
|
@@ -129,13 +169,17 @@ var Pet = function Pet() {
|
|
|
129
169
|
*/
|
|
130
170
|
var getForms = /*#__PURE__*/function () {
|
|
131
171
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
172
|
+
var _state$bookingDetail, _state$bookingDetail$, _state$bookingDetail$2;
|
|
132
173
|
var isUpdateValue,
|
|
133
174
|
values,
|
|
134
175
|
isSetValue,
|
|
135
|
-
_state$bookingDetail,
|
|
136
|
-
_state$bookingDetail$,
|
|
137
176
|
formData,
|
|
177
|
+
_state$bookingDetail2,
|
|
178
|
+
_state$bookingDetail3,
|
|
138
179
|
payload,
|
|
180
|
+
_state$bookingDetail4,
|
|
181
|
+
_state$bookingDetail5,
|
|
182
|
+
records,
|
|
139
183
|
_args2 = arguments;
|
|
140
184
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
141
185
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -143,54 +187,70 @@ var Pet = function Pet() {
|
|
|
143
187
|
isUpdateValue = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : true;
|
|
144
188
|
// setLoading(true);
|
|
145
189
|
values = _objectSpread({}, state.pet.value);
|
|
146
|
-
isSetValue = isUpdateValue && values[
|
|
190
|
+
isSetValue = isUpdateValue && values[boardParams === null || boardParams === void 0 ? void 0 : boardParams.form_id] === undefined && ((_state$bookingDetail = state.bookingDetail) === null || _state$bookingDetail === void 0 ? void 0 : (_state$bookingDetail$ = _state$bookingDetail.holder) === null || _state$bookingDetail$ === void 0 ? void 0 : (_state$bookingDetail$2 = _state$bookingDetail$.form_record) === null || _state$bookingDetail$2 === void 0 ? void 0 : _state$bookingDetail$2.length);
|
|
147
191
|
if (isSetValue) {
|
|
148
192
|
setValueLoading(true);
|
|
149
193
|
}
|
|
150
194
|
_context2.prev = 4;
|
|
151
|
-
|
|
195
|
+
formData = petForm;
|
|
196
|
+
if (!(state.renderType === "eventBooking")) {
|
|
197
|
+
_context2.next = 12;
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
_context2.next = 9;
|
|
152
201
|
return state.apis.getForms({
|
|
153
|
-
relation_type:
|
|
154
|
-
relation_id: ((_state$
|
|
202
|
+
relation_type: "event_booking_v2",
|
|
203
|
+
relation_id: ((_state$bookingDetail2 = state.bookingDetail) === null || _state$bookingDetail2 === void 0 ? void 0 : (_state$bookingDetail3 = _state$bookingDetail2.bookings) === null || _state$bookingDetail3 === void 0 ? void 0 : _state$bookingDetail3.id) || 0
|
|
155
204
|
// _config: { useCache: true },
|
|
156
205
|
});
|
|
157
|
-
case
|
|
206
|
+
case 9:
|
|
158
207
|
formData = _context2.sent;
|
|
159
208
|
// 只要预约主体
|
|
160
209
|
formData = (formData || []).filter(function (d) {
|
|
161
210
|
return d.form_id === (params === null || params === void 0 ? void 0 : params.form_id);
|
|
162
211
|
})[0];
|
|
163
|
-
|
|
212
|
+
formData = _objectSpread(_objectSpread(_objectSpread({}, formData), formData.form), {}, {
|
|
213
|
+
form_id: formData.form.id,
|
|
214
|
+
options: [],
|
|
215
|
+
type: formData.type
|
|
216
|
+
});
|
|
217
|
+
case 12:
|
|
164
218
|
// 获取当前预约中填写的值, 只在第一次执行
|
|
165
219
|
payload = {
|
|
166
|
-
formData: [
|
|
167
|
-
form_id: formData.form.id,
|
|
168
|
-
options: [],
|
|
169
|
-
type: formData.type
|
|
170
|
-
})]
|
|
220
|
+
formData: [formData]
|
|
171
221
|
};
|
|
172
|
-
if (isSetValue) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
setValueLoading(false);
|
|
222
|
+
if (!isSetValue) {
|
|
223
|
+
_context2.next = 21;
|
|
224
|
+
break;
|
|
176
225
|
}
|
|
226
|
+
_context2.next = 16;
|
|
227
|
+
return state.apis.getFormRecords({
|
|
228
|
+
form_record_ids: (_state$bookingDetail4 = state.bookingDetail) === null || _state$bookingDetail4 === void 0 ? void 0 : (_state$bookingDetail5 = _state$bookingDetail4.holder) === null || _state$bookingDetail5 === void 0 ? void 0 : _state$bookingDetail5.form_record
|
|
229
|
+
});
|
|
230
|
+
case 16:
|
|
231
|
+
records = _context2.sent;
|
|
232
|
+
console.log("records", records);
|
|
233
|
+
values[boardParams === null || boardParams === void 0 ? void 0 : boardParams.form_id] = records;
|
|
234
|
+
payload.value = values;
|
|
235
|
+
setValueLoading(false);
|
|
236
|
+
case 21:
|
|
177
237
|
dispatch({
|
|
178
238
|
type: "setPet",
|
|
179
239
|
payload: payload
|
|
180
240
|
});
|
|
181
|
-
_context2.next =
|
|
241
|
+
_context2.next = 29;
|
|
182
242
|
break;
|
|
183
|
-
case
|
|
184
|
-
_context2.prev =
|
|
243
|
+
case 24:
|
|
244
|
+
_context2.prev = 24;
|
|
185
245
|
_context2.t0 = _context2["catch"](4);
|
|
186
246
|
setValueLoading(false);
|
|
187
247
|
setLoading(false);
|
|
188
248
|
console.log("form_error", _context2.t0);
|
|
189
|
-
case
|
|
249
|
+
case 29:
|
|
190
250
|
case "end":
|
|
191
251
|
return _context2.stop();
|
|
192
252
|
}
|
|
193
|
-
}, _callee2, null, [[4,
|
|
253
|
+
}, _callee2, null, [[4, 24]]);
|
|
194
254
|
}));
|
|
195
255
|
return function getForms() {
|
|
196
256
|
return _ref4.apply(this, arguments);
|
|
@@ -236,7 +296,7 @@ var Pet = function Pet() {
|
|
|
236
296
|
onValueChange({
|
|
237
297
|
values: _defineProperty({}, petForm.form_id, cur)
|
|
238
298
|
});
|
|
239
|
-
|
|
299
|
+
_addCallback();
|
|
240
300
|
}
|
|
241
301
|
});
|
|
242
302
|
};
|
|
@@ -254,7 +314,7 @@ var Pet = function Pet() {
|
|
|
254
314
|
type: "pisell1.editCustomFormRecord",
|
|
255
315
|
data: _data,
|
|
256
316
|
callback: function callback() {
|
|
257
|
-
|
|
317
|
+
_addCallback();
|
|
258
318
|
}
|
|
259
319
|
});
|
|
260
320
|
};
|
|
@@ -288,35 +348,69 @@ var Pet = function Pet() {
|
|
|
288
348
|
clientId: (_state$client7 = state.client) === null || _state$client7 === void 0 ? void 0 : (_state$client7$value = _state$client7.value) === null || _state$client7$value === void 0 ? void 0 : _state$client7$value.id,
|
|
289
349
|
forms: ((_state$pet2 = state.pet) === null || _state$pet2 === void 0 ? void 0 : _state$pet2.formData) || []
|
|
290
350
|
});
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
351
|
+
setTimeout(function () {
|
|
352
|
+
dispatch({
|
|
353
|
+
type: "setPet",
|
|
354
|
+
payload: {
|
|
355
|
+
value: changeFormValuesData
|
|
356
|
+
}
|
|
357
|
+
});
|
|
296
358
|
});
|
|
297
359
|
}, [(_state$client$value2 = state.client.value) === null || _state$client$value2 === void 0 ? void 0 : _state$client$value2.id]);
|
|
298
|
-
|
|
299
|
-
// 只有预约主体是表单的时候 才获取数据, 当客户id发生变化时, 也需要重新获取
|
|
300
|
-
useEffect(function () {
|
|
360
|
+
var handleUpdateForm = function handleUpdateForm() {
|
|
301
361
|
if (state.bookingId) {
|
|
302
362
|
// 编辑时 必须获取详情后在获取预约主体信息
|
|
303
363
|
if (!state.bookingDetail) {
|
|
304
364
|
return;
|
|
305
365
|
}
|
|
306
366
|
}
|
|
307
|
-
if (
|
|
367
|
+
if (boardParams.form_id && boardParams.type === "form") {
|
|
308
368
|
getForms(true);
|
|
309
369
|
}
|
|
310
|
-
}
|
|
311
|
-
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
// 只有预约主体是表单的时候 才获取数据, 当客户id发生变化时, 也需要重新获取
|
|
373
|
+
useEffect(function () {
|
|
374
|
+
setTimeout(function () {
|
|
375
|
+
handleUpdateForm();
|
|
376
|
+
}, 10);
|
|
377
|
+
}, [state.bookingId, state.bookingDetail, boardParams.form_id, boardParams.type, (_state$client8 = state.client) === null || _state$client8 === void 0 ? void 0 : (_state$client8$value = _state$client8.value) === null || _state$client8$value === void 0 ? void 0 : _state$client8$value.id, state.renderType, petForm]);
|
|
378
|
+
var _addCallback = function addCallback(_params) {
|
|
312
379
|
var _state$pet3, _state$pet3$formData;
|
|
313
380
|
var _formData = (_state$pet3 = state.pet) === null || _state$pet3 === void 0 ? void 0 : (_state$pet3$formData = _state$pet3.formData) === null || _state$pet3$formData === void 0 ? void 0 : _state$pet3$formData[0];
|
|
314
|
-
if (
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
381
|
+
// if (_formData?.type === "multiple" || _formData?.type === "single") {
|
|
382
|
+
getFormData({
|
|
383
|
+
formData: _formData
|
|
384
|
+
}, _params);
|
|
385
|
+
// }
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
var searchChange = function searchChange(keyword) {
|
|
389
|
+
var _params = _objectSpread(_objectSpread({}, params), {}, {
|
|
390
|
+
skip: 1,
|
|
391
|
+
keyword: keyword
|
|
392
|
+
});
|
|
393
|
+
_addCallback(_params);
|
|
319
394
|
};
|
|
395
|
+
var loadMore = useMemo(function () {
|
|
396
|
+
var _state$pet4, _state$pet4$formData, _state$pet4$formData$, _state$pet4$formData$2;
|
|
397
|
+
var show = ((_state$pet4 = state.pet) === null || _state$pet4 === void 0 ? void 0 : (_state$pet4$formData = _state$pet4.formData) === null || _state$pet4$formData === void 0 ? void 0 : (_state$pet4$formData$ = _state$pet4$formData[0]) === null || _state$pet4$formData$ === void 0 ? void 0 : (_state$pet4$formData$2 = _state$pet4$formData$.options) === null || _state$pet4$formData$2 === void 0 ? void 0 : _state$pet4$formData$2.length) < params.total || 0;
|
|
398
|
+
return show ? /*#__PURE__*/React.createElement("div", {
|
|
399
|
+
className: "",
|
|
400
|
+
style: {
|
|
401
|
+
textAlign: "center",
|
|
402
|
+
padding: "16px 0"
|
|
403
|
+
}
|
|
404
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
405
|
+
loading: loadLoading,
|
|
406
|
+
onClick: function onClick() {
|
|
407
|
+
var _params = _objectSpread(_objectSpread({}, params), {}, {
|
|
408
|
+
skip: params.skip + 1
|
|
409
|
+
});
|
|
410
|
+
_addCallback(_params);
|
|
411
|
+
}
|
|
412
|
+
}, locales.getText("pisell2.text.load-more"))) : null;
|
|
413
|
+
}, [loadLoading, params, (_state$pet5 = state.pet) === null || _state$pet5 === void 0 ? void 0 : (_state$pet5$formData = _state$pet5.formData) === null || _state$pet5$formData === void 0 ? void 0 : (_state$pet5$formData$ = _state$pet5$formData[0]) === null || _state$pet5$formData$ === void 0 ? void 0 : (_state$pet5$formData$2 = _state$pet5$formData$.options) === null || _state$pet5$formData$2 === void 0 ? void 0 : _state$pet5$formData$2.length]);
|
|
320
414
|
return /*#__PURE__*/React.createElement("div", {
|
|
321
415
|
className: "pisell-lowcode__booking-pet-wraps"
|
|
322
416
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
@@ -343,7 +437,16 @@ var Pet = function Pet() {
|
|
|
343
437
|
handleViewItem: handleViewItem,
|
|
344
438
|
virtualListHeight: window.innerHeight - 213 - 57 - 16,
|
|
345
439
|
disabled: state.disabledEdit,
|
|
346
|
-
autoFocus: !state.isTerminal
|
|
440
|
+
autoFocus: !state.isTerminal,
|
|
441
|
+
closeCallback: function closeCallback() {
|
|
442
|
+
searchChange("");
|
|
443
|
+
},
|
|
444
|
+
searchChange: searchChange,
|
|
445
|
+
searchValue: params.search,
|
|
446
|
+
loadMore: loadMore,
|
|
447
|
+
filterItem: function filterItem() {
|
|
448
|
+
return true;
|
|
449
|
+
}
|
|
347
450
|
},
|
|
348
451
|
optionRender: function optionRender(item) {
|
|
349
452
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface FormState {
|
|
2
3
|
amountSymbol: string;
|
|
3
4
|
apis: {
|
|
@@ -88,7 +89,7 @@ export declare const walkInData: {
|
|
|
88
89
|
id: number;
|
|
89
90
|
nickname: string;
|
|
90
91
|
};
|
|
91
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
92
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
92
93
|
state: FormState;
|
|
93
94
|
} & {
|
|
94
95
|
dispatch: (params: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
2
3
|
import dayjs from "dayjs";
|
|
3
4
|
export interface FormState {
|
|
@@ -68,7 +69,7 @@ export interface FormState {
|
|
|
68
69
|
};
|
|
69
70
|
setGlobalState: Function | null;
|
|
70
71
|
}
|
|
71
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
72
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
72
73
|
state: FormState;
|
|
73
74
|
} & {
|
|
74
75
|
dispatch: (params: {
|