@deepinnet-components/pc 0.0.62 → 0.0.63

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.
@@ -1,4 +1,7 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ 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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ 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); } }
4
+ 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); }); }; }
2
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
6
  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."); }
4
7
  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); }
@@ -10,9 +13,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
10
13
  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
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
15
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
- 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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
14
- 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); } }
15
- 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); }); }; }
16
16
  import { Form, FormButtonGroup, FormItem, Input } from '@formily/antd-v5';
17
17
  import { createForm, onFieldValueChange } from '@formily/core';
18
18
  import { createSchemaField } from '@formily/react';
@@ -161,6 +161,34 @@ var CreateAccount = function CreateAccount(props) {
161
161
  passwordConfig = contextValue.passwordConfig,
162
162
  passwordEncryption = contextValue.passwordEncryption,
163
163
  passwordEncryptionNeedSalt = contextValue.passwordEncryptionNeedSalt;
164
+ var form = useMemo(function () {
165
+ return createForm({
166
+ effects: function effects() {
167
+ onFieldValueChange('orgArr', function (field) {
168
+ form.setFieldState('bindMemberId', function (state) {
169
+ var _field$value, _field$value2;
170
+ state.value = undefined;
171
+ state.componentProps = _objectSpread(_objectSpread({}, state.componentProps), {}, {
172
+ disabled: addOrEdit === 'edit' || !field.value,
173
+ searchParams: {
174
+ departmentId: (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value[((_field$value2 = field.value) === null || _field$value2 === void 0 ? void 0 : _field$value2.length) - 1],
175
+ memberStatus: addOrEdit === 'add' ? 'available' : 'occupied'
176
+ }
177
+ });
178
+ });
179
+ });
180
+ }
181
+ });
182
+ }, [visible]);
183
+ var _useState = useState(addOrEdit === 'edit'),
184
+ _useState2 = _slicedToArray(_useState, 2),
185
+ getDataLoading = _useState2[0],
186
+ setGetDataLoading = _useState2[1];
187
+ var _useState3 = useState(false),
188
+ _useState4 = _slicedToArray(_useState3, 2),
189
+ loading = _useState4[0],
190
+ setLoading = _useState4[1];
191
+ var canSubmit = useRef(true);
164
192
  var getAccountDetail = /*#__PURE__*/function () {
165
193
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
166
194
  var params, _yield$ApiService$get, data, _data$departmentFlatD, _data$userMemberBindD;
@@ -218,34 +246,6 @@ var CreateAccount = function CreateAccount(props) {
218
246
  form.reset();
219
247
  }
220
248
  }, [visible, actionRow]);
221
- var form = useMemo(function () {
222
- return createForm({
223
- effects: function effects() {
224
- onFieldValueChange('orgArr', function (field) {
225
- form.setFieldState('bindMemberId', function (state) {
226
- var _field$value, _field$value2;
227
- state.value = undefined;
228
- state.componentProps = _objectSpread(_objectSpread({}, state.componentProps), {}, {
229
- disabled: addOrEdit === 'edit' || !field.value,
230
- searchParams: {
231
- departmentId: (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value[((_field$value2 = field.value) === null || _field$value2 === void 0 ? void 0 : _field$value2.length) - 1],
232
- memberStatus: addOrEdit === 'add' ? 'available' : 'occupied'
233
- }
234
- });
235
- });
236
- });
237
- }
238
- });
239
- }, [visible]);
240
- var _useState = useState(addOrEdit === 'edit'),
241
- _useState2 = _slicedToArray(_useState, 2),
242
- getDataLoading = _useState2[0],
243
- setGetDataLoading = _useState2[1];
244
- var _useState3 = useState(false),
245
- _useState4 = _slicedToArray(_useState3, 2),
246
- loading = _useState4[0],
247
- setLoading = _useState4[1];
248
- var canSubmit = useRef(true);
249
249
  var handleSubmit = /*#__PURE__*/function () {
250
250
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
251
251
  var values, params, _sm4Encrypt, key, encryptedData, _yield$ApiService$sav, success, _params, _yield$ApiService$sav2, _success;
@@ -8,11 +8,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
8
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
9
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import React, { useContext, useState, useMemo } from 'react';
12
- import { Modal, message } from 'antd';
13
11
  import { Form, FormItem, Input, Select } from '@formily/antd-v5';
14
12
  import { createForm } from '@formily/core';
15
13
  import { createSchemaField } from '@formily/react';
14
+ import { Modal, message } from 'antd';
15
+ import React, { useContext, useMemo, useState } from 'react';
16
16
  import { hashWithCryptoJS, sm4Encrypt } from "../../../utils";
17
17
  import ValueContext from "../../../context";
18
18
  var SchemaField = createSchemaField({
@@ -76,8 +76,7 @@ var schema = {
76
76
  };
77
77
  var EditPasswordModal = function EditPasswordModal(props) {
78
78
  var actionRow = props.actionRow,
79
- onClose = props.onClose,
80
- onSuccess = props.onSuccess;
79
+ onClose = props.onClose;
81
80
  var contextValue = useContext(ValueContext);
82
81
  var ApiService = contextValue.ApiService,
83
82
  passwordConfig = contextValue.passwordConfig,
@@ -87,6 +86,9 @@ var EditPasswordModal = function EditPasswordModal(props) {
87
86
  _useState2 = _slicedToArray(_useState, 2),
88
87
  loading = _useState2[0],
89
88
  setLoading = _useState2[1];
89
+ var form = useMemo(function () {
90
+ return createForm({});
91
+ }, []);
90
92
  function handleOk() {
91
93
  return _handleOk.apply(this, arguments);
92
94
  }
@@ -141,9 +143,6 @@ var EditPasswordModal = function EditPasswordModal(props) {
141
143
  function handleCancel() {
142
144
  onClose === null || onClose === void 0 || onClose();
143
145
  }
144
- var form = useMemo(function () {
145
- return createForm({});
146
- }, []);
147
146
  return /*#__PURE__*/React.createElement(Modal, {
148
147
  title: "\u4FEE\u6539\u5BC6\u7801",
149
148
  open: true,
@@ -1,3 +1,10 @@
1
- import type { FC } from 'react';
2
- declare const AccountList: FC;
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
3
+ export interface AccountPageRef {
4
+ handleAddAccount: () => void;
5
+ }
6
+ export interface AccountPageProps {
7
+ hideTopBtn?: ReactNode;
8
+ }
9
+ declare const AccountList: React.ForwardRefExoticComponent<AccountPageProps & React.RefAttributes<AccountPageRef>>;
3
10
  export default AccountList;
@@ -19,12 +19,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
19
  import { ShenduTable } from "../..";
20
20
  import { Button, message, Tooltip } from 'antd';
21
21
  import dayjs from 'dayjs';
22
- import React, { useContext, useRef, useState } from 'react';
23
- import CreateAccount from "./components/CreateAccount";
24
- import EditPasswordModal from "./components/EditPasswordModal";
22
+ import React, { forwardRef, useContext, useImperativeHandle, useRef, useState } from 'react';
25
23
  import { exportFile } from "../utils";
26
24
  import ValueContext from "../context";
27
25
  import OrgSelect from "../OrgSelect";
26
+ import EditPasswordModal from "./components/EditPasswordModal";
27
+ import CreateAccount from "./components/CreateAccount";
28
28
  var statusMap = {
29
29
  0: {
30
30
  text: '正常',
@@ -35,9 +35,9 @@ var statusMap = {
35
35
  color: '#f50'
36
36
  }
37
37
  };
38
-
39
38
  // 账号管理
40
- var AccountList = function AccountList() {
39
+ var AccountList = /*#__PURE__*/forwardRef(function (_ref, ref) {
40
+ var hideTopBtn = _ref.hideTopBtn;
41
41
  var contextValue = useContext(ValueContext);
42
42
  var ApiService = contextValue.ApiService,
43
43
  Components = contextValue.Components,
@@ -51,6 +51,165 @@ var AccountList = function AccountList() {
51
51
  api = contextValue.api,
52
52
  accountSearchNeedDepartment = contextValue.accountSearchNeedDepartment;
53
53
  var tableRef = useRef(null);
54
+ var tableList = useRef([]);
55
+
56
+ //
57
+ var _useState = useState({
58
+ visible: false,
59
+ addOrEdit: 'add',
60
+ actionRow: undefined
61
+ }),
62
+ _useState2 = _slicedToArray(_useState, 2),
63
+ accountModalInfo = _useState2[0],
64
+ setAccountModalInfo = _useState2[1];
65
+ var _useState3 = useState(),
66
+ _useState4 = _slicedToArray(_useState3, 2),
67
+ editPasswordAccount = _useState4[0],
68
+ setEditPasswordAccount = _useState4[1];
69
+ var _useState5 = useState(false),
70
+ _useState6 = _slicedToArray(_useState5, 2),
71
+ passwordModalShow = _useState6[0],
72
+ setPasswordModalShow = _useState6[1];
73
+ function handleAddAccount() {
74
+ setAccountModalInfo({
75
+ visible: true,
76
+ addOrEdit: 'add',
77
+ actionRow: undefined
78
+ });
79
+ }
80
+ useImperativeHandle(ref, function () {
81
+ return {
82
+ handleAddAccount: handleAddAccount
83
+ };
84
+ });
85
+ function handleEditAccount(row) {
86
+ setAccountModalInfo({
87
+ visible: true,
88
+ addOrEdit: 'edit',
89
+ actionRow: row
90
+ });
91
+ }
92
+
93
+ // 删除账号
94
+ function handleDeleteAccount(_x) {
95
+ return _handleDeleteAccount.apply(this, arguments);
96
+ } // 冻结账号
97
+ function _handleDeleteAccount() {
98
+ _handleDeleteAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(row) {
99
+ var _yield$ApiService$del, success;
100
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
101
+ while (1) switch (_context2.prev = _context2.next) {
102
+ case 0:
103
+ _context2.next = 2;
104
+ return ApiService.deleteAccount({
105
+ accountNo: row.accountNo
106
+ });
107
+ case 2:
108
+ _yield$ApiService$del = _context2.sent;
109
+ success = _yield$ApiService$del.success;
110
+ if (success) {
111
+ message.success('删除成功');
112
+ if (tableList.current.length === 1) {
113
+ tableRef.current.reload();
114
+ } else {
115
+ tableRef.current.reloadCurrentPage();
116
+ }
117
+ }
118
+ case 5:
119
+ case "end":
120
+ return _context2.stop();
121
+ }
122
+ }, _callee2);
123
+ }));
124
+ return _handleDeleteAccount.apply(this, arguments);
125
+ }
126
+ function handleFreezeAccount(_x2) {
127
+ return _handleFreezeAccount.apply(this, arguments);
128
+ } // 解冻账号
129
+ function _handleFreezeAccount() {
130
+ _handleFreezeAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(row) {
131
+ var _yield$ApiService$fre, success;
132
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
133
+ while (1) switch (_context3.prev = _context3.next) {
134
+ case 0:
135
+ _context3.next = 2;
136
+ return ApiService.freezeAccount({
137
+ accountNo: row.accountNo
138
+ });
139
+ case 2:
140
+ _yield$ApiService$fre = _context3.sent;
141
+ success = _yield$ApiService$fre.success;
142
+ if (success) {
143
+ message.success('冻结成功');
144
+ if (tableList.current.length === 1) {
145
+ tableRef.current.reload();
146
+ } else {
147
+ tableRef.current.reloadCurrentPage();
148
+ }
149
+ }
150
+ case 5:
151
+ case "end":
152
+ return _context3.stop();
153
+ }
154
+ }, _callee3);
155
+ }));
156
+ return _handleFreezeAccount.apply(this, arguments);
157
+ }
158
+ function handleUnFreezeAccount(_x3) {
159
+ return _handleUnFreezeAccount.apply(this, arguments);
160
+ }
161
+ function _handleUnFreezeAccount() {
162
+ _handleUnFreezeAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(row) {
163
+ var _yield$ApiService$unF, success;
164
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
165
+ while (1) switch (_context4.prev = _context4.next) {
166
+ case 0:
167
+ _context4.next = 2;
168
+ return ApiService.unFreezeAccount({
169
+ accountNo: row.accountNo
170
+ });
171
+ case 2:
172
+ _yield$ApiService$unF = _context4.sent;
173
+ success = _yield$ApiService$unF.success;
174
+ if (success) {
175
+ message.success('解冻成功');
176
+ if (tableList.current.length === 1) {
177
+ tableRef.current.reload();
178
+ } else {
179
+ tableRef.current.reloadCurrentPage();
180
+ }
181
+ }
182
+ case 5:
183
+ case "end":
184
+ return _context4.stop();
185
+ }
186
+ }, _callee4);
187
+ }));
188
+ return _handleUnFreezeAccount.apply(this, arguments);
189
+ }
190
+ function handleClickOrg(id) {
191
+ navigate("".concat(pageUrl.orgPage, "?id=").concat(id));
192
+ }
193
+
194
+ // 导出账号
195
+ function handleExportAccount() {
196
+ exportFile({
197
+ method: 'post',
198
+ url: api.exportAccount,
199
+ headers: _objectSpread({}, requestHeaders),
200
+ data: {
201
+ userType: userType
202
+ },
203
+ blobType: 'text/csv;charset=utf-8',
204
+ fileName: '账号列表',
205
+ successFn: function successFn() {
206
+ message.success('导出成功');
207
+ },
208
+ failFn: function failFn() {
209
+ message.error('导出失败');
210
+ }
211
+ });
212
+ }
54
213
  var columns = [{
55
214
  title: '姓名',
56
215
  dataIndex: 'name',
@@ -130,7 +289,6 @@ var AccountList = function AccountList() {
130
289
  dataIndex: 'roles',
131
290
  width: 150,
132
291
  render: function render(_) {
133
- var arr = _ === null || _ === void 0 ? void 0 : _[0];
134
292
  if (!(_ !== null && _ !== void 0 && _.length)) return '-';
135
293
  var text = '';
136
294
  _.forEach(function (item, index) {
@@ -230,160 +388,6 @@ var AccountList = function AccountList() {
230
388
  });
231
389
  }
232
390
  }];
233
-
234
- //
235
- var _useState = useState({
236
- visible: false,
237
- addOrEdit: 'add',
238
- actionRow: undefined
239
- }),
240
- _useState2 = _slicedToArray(_useState, 2),
241
- accountModalInfo = _useState2[0],
242
- setAccountModalInfo = _useState2[1];
243
- function handleAddAccount() {
244
- setAccountModalInfo({
245
- visible: true,
246
- addOrEdit: 'add',
247
- actionRow: undefined
248
- });
249
- }
250
- function handleEditAccount(row) {
251
- setAccountModalInfo({
252
- visible: true,
253
- addOrEdit: 'edit',
254
- actionRow: row
255
- });
256
- }
257
-
258
- // 删除账号
259
- function handleDeleteAccount(_x) {
260
- return _handleDeleteAccount.apply(this, arguments);
261
- } // 冻结账号
262
- function _handleDeleteAccount() {
263
- _handleDeleteAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(row) {
264
- var _yield$ApiService$del, success;
265
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
266
- while (1) switch (_context2.prev = _context2.next) {
267
- case 0:
268
- _context2.next = 2;
269
- return ApiService.deleteAccount({
270
- accountNo: row.accountNo
271
- });
272
- case 2:
273
- _yield$ApiService$del = _context2.sent;
274
- success = _yield$ApiService$del.success;
275
- if (success) {
276
- message.success('删除成功');
277
- if (tableList.current.length === 1) {
278
- tableRef.current.reload();
279
- } else {
280
- tableRef.current.reloadCurrentPage();
281
- }
282
- }
283
- case 5:
284
- case "end":
285
- return _context2.stop();
286
- }
287
- }, _callee2);
288
- }));
289
- return _handleDeleteAccount.apply(this, arguments);
290
- }
291
- function handleFreezeAccount(_x2) {
292
- return _handleFreezeAccount.apply(this, arguments);
293
- } // 解冻账号
294
- function _handleFreezeAccount() {
295
- _handleFreezeAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(row) {
296
- var _yield$ApiService$fre, success;
297
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
298
- while (1) switch (_context3.prev = _context3.next) {
299
- case 0:
300
- _context3.next = 2;
301
- return ApiService.freezeAccount({
302
- accountNo: row.accountNo
303
- });
304
- case 2:
305
- _yield$ApiService$fre = _context3.sent;
306
- success = _yield$ApiService$fre.success;
307
- if (success) {
308
- message.success('冻结成功');
309
- if (tableList.current.length === 1) {
310
- tableRef.current.reload();
311
- } else {
312
- tableRef.current.reloadCurrentPage();
313
- }
314
- }
315
- case 5:
316
- case "end":
317
- return _context3.stop();
318
- }
319
- }, _callee3);
320
- }));
321
- return _handleFreezeAccount.apply(this, arguments);
322
- }
323
- function handleUnFreezeAccount(_x3) {
324
- return _handleUnFreezeAccount.apply(this, arguments);
325
- }
326
- function _handleUnFreezeAccount() {
327
- _handleUnFreezeAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(row) {
328
- var _yield$ApiService$unF, success;
329
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
330
- while (1) switch (_context4.prev = _context4.next) {
331
- case 0:
332
- _context4.next = 2;
333
- return ApiService.unFreezeAccount({
334
- accountNo: row.accountNo
335
- });
336
- case 2:
337
- _yield$ApiService$unF = _context4.sent;
338
- success = _yield$ApiService$unF.success;
339
- if (success) {
340
- message.success('解冻成功');
341
- if (tableList.current.length === 1) {
342
- tableRef.current.reload();
343
- } else {
344
- tableRef.current.reloadCurrentPage();
345
- }
346
- }
347
- case 5:
348
- case "end":
349
- return _context4.stop();
350
- }
351
- }, _callee4);
352
- }));
353
- return _handleUnFreezeAccount.apply(this, arguments);
354
- }
355
- var tableList = useRef([]);
356
- function handleClickOrg(id) {
357
- navigate("".concat(pageUrl.orgPage, "?id=").concat(id));
358
- }
359
- var _useState3 = useState(),
360
- _useState4 = _slicedToArray(_useState3, 2),
361
- editPasswordAccount = _useState4[0],
362
- setEditPasswordAccount = _useState4[1];
363
- var _useState5 = useState(false),
364
- _useState6 = _slicedToArray(_useState5, 2),
365
- passwordModalShow = _useState6[0],
366
- setPasswordModalShow = _useState6[1];
367
-
368
- // 导出账号
369
- function handleExportAccount() {
370
- exportFile({
371
- method: 'post',
372
- url: api.exportAccount,
373
- headers: _objectSpread({}, requestHeaders),
374
- data: {
375
- userType: userType
376
- },
377
- blobType: 'text/csv;charset=utf-8',
378
- fileName: '账号列表',
379
- successFn: function successFn() {
380
- message.success('导出成功');
381
- },
382
- failFn: function failFn() {
383
- message.error('导出失败');
384
- }
385
- });
386
- }
387
391
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ShenduTable, {
388
392
  search: {
389
393
  labelWidth: 'auto'
@@ -393,7 +397,7 @@ var AccountList = function AccountList() {
393
397
  },
394
398
  actionRef: tableRef,
395
399
  request: ( /*#__PURE__*/function () {
396
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchInfo) {
400
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchInfo) {
397
401
  var _search$username, _search$phone;
398
402
  var pageNum, pageSize, search, params, _yield$ApiService$get, data;
399
403
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -428,7 +432,7 @@ var AccountList = function AccountList() {
428
432
  }, _callee);
429
433
  }));
430
434
  return function (_x4) {
431
- return _ref.apply(this, arguments);
435
+ return _ref2.apply(this, arguments);
432
436
  };
433
437
  }()),
434
438
  columns: columns,
@@ -437,7 +441,7 @@ var AccountList = function AccountList() {
437
441
  x: 1100
438
442
  },
439
443
  toolbar: {
440
- title: /*#__PURE__*/React.createElement("div", {
444
+ title: hideTopBtn ? undefined : /*#__PURE__*/React.createElement("div", {
441
445
  className: "flex justify-end"
442
446
  }, /*#__PURE__*/React.createElement(Button, {
443
447
  type: "primary",
@@ -482,5 +486,5 @@ var AccountList = function AccountList() {
482
486
  setPasswordModalShow(false);
483
487
  }
484
488
  }));
485
- };
489
+ });
486
490
  export default AccountList;