@pisell/materials 1.0.965 → 1.0.967

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.
Files changed (69) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +160 -144
  7. package/build/lowcode/render/default/view.js +39 -30
  8. package/build/lowcode/view.js +39 -30
  9. package/es/components/dataSourceComponents/dataSourceForm/BaseForm.js +42 -8
  10. package/es/components/dataSourceComponents/dataSourceForm/serve.js +93 -0
  11. package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +43 -20
  12. package/es/components/dataSourceComponents/dataSourceForm/urlUtils.js +129 -0
  13. package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -0
  14. package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +27 -0
  15. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +33 -0
  16. package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +17 -0
  17. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +16 -0
  18. package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  19. package/es/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +5 -0
  20. package/es/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +5 -0
  21. package/es/components/dataSourceComponents/fields/Upload/type.d.ts +38 -0
  22. package/es/components/dataSourceComponents/fields/index.d.ts +11 -11
  23. package/es/components/dataSourceComponents/hooks/useActions.js +20 -14
  24. package/es/components/filter/types.d.ts +46 -0
  25. package/es/components/iconfont/index.js +1 -1
  26. package/es/components/pisellCamera/index.d.ts +4 -0
  27. package/es/components/productCard/cartSkuCard/components/holders/index.js +6 -1
  28. package/es/components/table/Actions/index.d.ts +17 -0
  29. package/es/components/table/Table/index.js +7 -3
  30. package/es/components/table/hooks/useTransColumns.js +1 -1
  31. package/es/components/table/index.js +3 -1
  32. package/es/components/virtual-keyboard/Amount/index.d.ts +5 -0
  33. package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.js +20 -2
  34. package/lib/components/dataSourceComponents/dataSourceForm/serve.js +45 -2
  35. package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +16 -1
  36. package/lib/components/dataSourceComponents/dataSourceForm/urlUtils.js +92 -0
  37. package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -0
  38. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +27 -0
  39. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +33 -0
  40. package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +17 -0
  41. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +16 -0
  42. package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  43. package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +5 -0
  44. package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +5 -0
  45. package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +38 -0
  46. package/lib/components/dataSourceComponents/fields/index.d.ts +11 -11
  47. package/lib/components/dataSourceComponents/hooks/useActions.js +3 -0
  48. package/lib/components/filter/types.d.ts +46 -0
  49. package/lib/components/iconfont/index.js +1 -1
  50. package/lib/components/pisellCamera/index.d.ts +4 -0
  51. package/lib/components/productCard/cartSkuCard/components/holders/index.js +6 -1
  52. package/lib/components/table/Actions/index.d.ts +17 -0
  53. package/lib/components/table/Table/index.js +8 -4
  54. package/lib/components/table/hooks/useTransColumns.js +1 -1
  55. package/lib/components/table/index.js +3 -1
  56. package/lib/components/virtual-keyboard/Amount/index.d.ts +5 -0
  57. package/package.json +1 -1
  58. package/es/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +0 -3
  59. package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +0 -149
  60. package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +0 -39
  61. package/es/components/dataSourceComponents/hooks/useActions.d.ts +0 -18
  62. package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +0 -119
  63. package/es/components/table/hooks/useTransColumns.d.ts +0 -14
  64. package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +0 -3
  65. package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +0 -149
  66. package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +0 -39
  67. package/lib/components/dataSourceComponents/hooks/useActions.d.ts +0 -18
  68. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +0 -119
  69. package/lib/components/table/hooks/useTransColumns.d.ts +0 -14
@@ -4,6 +4,11 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
4
4
  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; }
5
5
  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); } }
6
6
  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); }); }; }
7
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
+ 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; }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
11
+ 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); }
7
12
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
8
13
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
9
14
  import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
@@ -17,6 +22,8 @@ import Form from "../../form";
17
22
  import FormSettingProvider from "./provider/formSetting/FormSettingProvider";
18
23
  import PageHeader from "../../page-header";
19
24
  import { transformFormObjToArrayWithUntouched } from "./utils";
25
+ import { getFormSettingMetaData } from "./serve";
26
+ import { getFormSettingParams } from "./urlUtils";
20
27
  import "./index.less";
21
28
  /**
22
29
  * @title: 数据源表单组件
@@ -64,22 +71,49 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
64
71
  });
65
72
  useEffect(function () {
66
73
  if (['edit', 'view'].includes(renderMode || '') && dataSource) {
74
+ if (dataSource !== null && dataSource !== void 0 && dataSource.fromSettingMeta) {
75
+ var _dataSource$fields;
76
+ if (props.__designMode === 'design') return;
77
+ // 从URL获取参数
78
+ var _getFormSettingParams = getFormSettingParams(),
79
+ businessCode = _getFormSettingParams.businessCode,
80
+ channelCode = _getFormSettingParams.channelCode,
81
+ includeBoard = _getFormSettingParams.includeBoard;
82
+ var sectionCodes = Array.from(new Set(dataSource === null || dataSource === void 0 || (_dataSource$fields = dataSource.fields) === null || _dataSource$fields === void 0 ? void 0 : _dataSource$fields.map(function (field) {
83
+ return field.name.split('.').shift();
84
+ })));
85
+
86
+ // 使用API方法获取formSettingMeta数据(必须传入参数)
87
+ getFormSettingMetaData({
88
+ sectionCodes: sectionCodes,
89
+ businessCode: businessCode,
90
+ channelCode: channelCode,
91
+ includeBoard: includeBoard
92
+ }).then(function (res) {
93
+ var _formRef$current2;
94
+ var formattedValues = formatInitialValues ? formatInitialValues(res.data) : res.data || {};
95
+ (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.setFields(transformFormObjToArrayWithUntouched(_objectSpread({}, formattedValues)));
96
+ }).catch(function (error) {
97
+ console.error('获取formSettingMeta数据失败:', error);
98
+ });
99
+ return;
100
+ }
67
101
  get === null || get === void 0 || get.runAsync().then(function (res) {
68
- var _formRef$current2;
102
+ var _formRef$current3;
69
103
  var formattedValues = formatInitialValues ? formatInitialValues(res) : res;
70
- (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.setFields(transformFormObjToArrayWithUntouched(formattedValues));
104
+ (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 || _formRef$current3.setFields(transformFormObjToArrayWithUntouched(formattedValues));
71
105
  });
72
106
  }
73
107
  }, [renderMode, dataSource]);
74
108
 
75
109
  // 检查表单是否可以关闭
76
110
  var checkFormClose = useMemoizedFn( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
77
- var _formRef$current3;
111
+ var _formRef$current4;
78
112
  var isFormChanged;
79
113
  return _regeneratorRuntime().wrap(function _callee$(_context) {
80
114
  while (1) switch (_context.prev = _context.next) {
81
115
  case 0:
82
- isFormChanged = (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.isFieldsTouched();
116
+ isFormChanged = (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.isFieldsTouched();
83
117
  if (!isFormChanged) {
84
118
  _context.next = 3;
85
119
  break;
@@ -91,8 +125,8 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
91
125
  okText: leaveConfirmConfig === null || leaveConfirmConfig === void 0 ? void 0 : leaveConfirmConfig.okText,
92
126
  cancelText: leaveConfirmConfig === null || leaveConfirmConfig === void 0 ? void 0 : leaveConfirmConfig.cancelText,
93
127
  onOk: function onOk() {
94
- var _formRef$current4;
95
- (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 || _formRef$current4.resetFields();
128
+ var _formRef$current5;
129
+ (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 || _formRef$current5.resetFields();
96
130
  resolve(true);
97
131
  },
98
132
  onCancel: function onCancel() {
@@ -118,8 +152,8 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
118
152
  var _getApp;
119
153
  var history = getApp === null || getApp === void 0 || (_getApp = getApp()) === null || _getApp === void 0 || (_getApp = _getApp.history) === null || _getApp === void 0 ? void 0 : _getApp.instance;
120
154
  var unblock = history === null || history === void 0 ? void 0 : history.block(function (location, action) {
121
- var _formRef$current5;
122
- var isFormChanged = (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.isFieldsTouched();
155
+ var _formRef$current6;
156
+ var isFormChanged = (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : _formRef$current6.isFieldsTouched();
123
157
  if (isFormChanged) {
124
158
  PisellModal.confirm({
125
159
  title: leaveConfirmConfig.title,
@@ -267,4 +267,97 @@ export var deleteNocobaseData = /*#__PURE__*/function () {
267
267
  return function deleteNocobaseData(_x8, _x9, _x10) {
268
268
  return _ref12.apply(this, arguments);
269
269
  };
270
+ }();
271
+
272
+ /**
273
+ * 获取formSettingMeta数据
274
+ * @param params 请求参数
275
+ * @param params.sectionCodes 配置段代码数组,如 ['payment']
276
+ * @param params.businessCode 业务代码
277
+ * @param params.channelCode 渠道代码
278
+ * @param params.includeBoard 是否包含board_code参数(当board=1时)
279
+ * @returns Promise<any> 返回设置元数据
280
+ */
281
+ export var getFormSettingMetaData = /*#__PURE__*/function () {
282
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(params) {
283
+ var sectionCodes, businessCode, channelCode, includeBoard, queryParams, url;
284
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
285
+ while (1) switch (_context10.prev = _context10.next) {
286
+ case 0:
287
+ console.log('getFormSettingMetaData', params);
288
+ sectionCodes = params.sectionCodes, businessCode = params.businessCode, channelCode = params.channelCode, includeBoard = params.includeBoard; // 构建查询参数
289
+ queryParams = new URLSearchParams(); // 添加section_code参数(支持多个值)
290
+ sectionCodes.forEach(function (code) {
291
+ queryParams.append('section_code[]', code);
292
+ });
293
+
294
+ // 添加business_code参数
295
+ if (businessCode) {
296
+ queryParams.append('business_code', businessCode);
297
+ }
298
+
299
+ // 添加channel_code参数
300
+ if (channelCode) {
301
+ queryParams.append('channel_code', channelCode);
302
+ }
303
+
304
+ // 当需要包含board_code时,格式为 business_code×channel_code
305
+ if (includeBoard && businessCode && channelCode) {
306
+ queryParams.append('board_code', "".concat(businessCode, "\xD7").concat(channelCode));
307
+ }
308
+ url = "/tenant/setting?".concat(queryParams.toString());
309
+ return _context10.abrupt("return", request.getRequest().get(url, {}, {
310
+ headers: {
311
+ 'Content-Type': 'application/json'
312
+ }
313
+ }));
314
+ case 9:
315
+ case "end":
316
+ return _context10.stop();
317
+ }
318
+ }, _callee10);
319
+ }));
320
+ return function getFormSettingMetaData(_x11) {
321
+ return _ref13.apply(this, arguments);
322
+ };
323
+ }();
324
+
325
+ /**
326
+ * 更新租户设置数据
327
+ * @param params 请求参数
328
+ * @param params.businessCode 业务代码
329
+ * @param params.channelCode 渠道代码
330
+ * @param params.boardCode 板块代码
331
+ * @param params.data 要更新的数据对象,如 {"order.prefix":"","order.suffix":"","payment.number":""}
332
+ * @returns Promise<any> 返回更新结果
333
+ */
334
+ export var updateTenantSetting = /*#__PURE__*/function () {
335
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(params) {
336
+ var business_code, channel_code, board_code, data, requestBody, url;
337
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
338
+ while (1) switch (_context11.prev = _context11.next) {
339
+ case 0:
340
+ console.log('updateTenantSetting', params);
341
+ business_code = params.business_code, channel_code = params.channel_code, board_code = params.board_code, data = params.data; // 构建请求体,按照 curl 请求的格式
342
+ requestBody = {
343
+ business_code: business_code,
344
+ channel_code: channel_code,
345
+ board_code: board_code,
346
+ data: data
347
+ };
348
+ url = '/tenant/setting';
349
+ return _context11.abrupt("return", request.getRequest().post(url, requestBody, {
350
+ headers: {
351
+ 'Content-Type': 'application/json'
352
+ }
353
+ }));
354
+ case 5:
355
+ case "end":
356
+ return _context11.stop();
357
+ }
358
+ }, _callee11);
359
+ }));
360
+ return function updateTenantSetting(_x12) {
361
+ return _ref14.apply(this, arguments);
362
+ };
270
363
  }();
@@ -17,7 +17,9 @@ import useFormSetting from "../provider/hooks/useFormSetting";
17
17
  import useCtxActions from "../../hooks/useCtxActions";
18
18
  import useDataSource from "../../hooks/useDataSource";
19
19
  import { filterSystemFields, setFormFieldsUntouched } from "../utils";
20
+ import { getUrlParams } from "../urlUtils";
20
21
  import "./index.less";
22
+ import { updateTenantSetting } from "../serve";
21
23
  // 表单提交按钮
22
24
  var SubmitButton = function SubmitButton(props) {
23
25
  var children = props.children,
@@ -49,53 +51,73 @@ var SubmitButton = function SubmitButton(props) {
49
51
  refreshTableData = _useCtxActions.refreshTableData;
50
52
  var _useDataSource = useDataSource(),
51
53
  create = _useDataSource.create,
52
- update = _useDataSource.update;
54
+ update = _useDataSource.update,
55
+ dataSource = _useDataSource.dataSource;
53
56
  var isDisabled = status === 'disabled';
54
57
  var onSubmit = /*#__PURE__*/function () {
55
58
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
56
- var res;
59
+ var urlParams, business_code, channel_code, board_code, res;
57
60
  return _regeneratorRuntime().wrap(function _callee$(_context) {
58
61
  while (1) switch (_context.prev = _context.next) {
59
62
  case 0:
60
63
  setLoading(true);
61
64
  _context.prev = 1;
65
+ if (!(dataSource !== null && dataSource !== void 0 && dataSource.fromSettingMeta)) {
66
+ _context.next = 10;
67
+ break;
68
+ }
69
+ // 从URL查询字符串获取参数
70
+ urlParams = getUrlParams();
71
+ business_code = urlParams.business_code;
72
+ channel_code = urlParams.channel_code; // 只有当isBoard参数为1时才设置boardCode
73
+ board_code = urlParams.isBoard === '1' && channel_code && channel_code ? "".concat(business_code, "x").concat(channel_code) : undefined;
74
+ _context.next = 9;
75
+ return updateTenantSetting({
76
+ business_code: business_code,
77
+ channel_code: channel_code,
78
+ board_code: board_code,
79
+ data: values
80
+ });
81
+ case 9:
82
+ return _context.abrupt("return", _context.sent);
83
+ case 10:
62
84
  if (!customSubmit) {
63
- _context.next = 6;
85
+ _context.next = 14;
64
86
  break;
65
87
  }
66
- _context.next = 5;
88
+ _context.next = 13;
67
89
  return customSubmit(values);
68
- case 5:
90
+ case 13:
69
91
  return _context.abrupt("return", _context.sent);
70
- case 6:
92
+ case 14:
71
93
  if (!(renderMode === 'edit')) {
72
- _context.next = 12;
94
+ _context.next = 20;
73
95
  break;
74
96
  }
75
- _context.next = 9;
97
+ _context.next = 17;
76
98
  return update.runAsync(values);
77
- case 9:
99
+ case 17:
78
100
  return _context.abrupt("return", _context.sent);
79
- case 12:
101
+ case 20:
80
102
  if (!(renderMode === 'add')) {
81
- _context.next = 18;
103
+ _context.next = 26;
82
104
  break;
83
105
  }
84
- _context.next = 15;
106
+ _context.next = 23;
85
107
  return create.runAsync(values);
86
- case 15:
108
+ case 23:
87
109
  res = _context.sent;
88
110
  form === null || form === void 0 || form.resetFields();
89
111
  return _context.abrupt("return", res);
90
- case 18:
91
- _context.prev = 18;
112
+ case 26:
113
+ _context.prev = 26;
92
114
  setLoading(false);
93
- return _context.finish(18);
94
- case 21:
115
+ return _context.finish(26);
116
+ case 29:
95
117
  case "end":
96
118
  return _context.stop();
97
119
  }
98
- }, _callee, null, [[1,, 18, 21]]);
120
+ }, _callee, null, [[1,, 26, 29]]);
99
121
  }));
100
122
  return function onSubmit(_x) {
101
123
  return _ref.apply(this, arguments);
@@ -173,15 +195,16 @@ var SubmitButton = function SubmitButton(props) {
173
195
  }
174
196
  }
175
197
  setFormFieldsUntouched(form);
176
- _context2.next = 21;
198
+ _context2.next = 22;
177
199
  break;
178
200
  case 18:
179
201
  _context2.prev = 18;
180
202
  _context2.t0 = _context2["catch"](0);
203
+ debugger;
181
204
  PisellToast({
182
205
  content: "".concat(_context2.t0.message)
183
206
  });
184
- case 21:
207
+ case 22:
185
208
  case "end":
186
209
  return _context2.stop();
187
210
  }
@@ -0,0 +1,129 @@
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); }); }; }
5
+ /**
6
+ * URL参数处理工具方法
7
+ */
8
+
9
+ import { request } from "../../table/utils";
10
+
11
+ /**
12
+ * 从浏览器URL获取查询参数
13
+ * @returns Record<string, string> URL查询参数对象
14
+ */
15
+ export var getUrlParams = function getUrlParams() {
16
+ var urlSearchParams = new URLSearchParams(window.location.search);
17
+ var urlParams = {};
18
+ urlSearchParams.forEach(function (value, key) {
19
+ urlParams[key] = value;
20
+ });
21
+ return urlParams;
22
+ };
23
+
24
+ /**
25
+ * 从URL参数中提取formSettingMeta相关的参数
26
+ * @param urlParams URL查询参数对象,如果不传则自动从浏览器获取
27
+ * @returns 包含business_code、channel_code和board相关参数的对象
28
+ */
29
+ export var getFormSettingParams = function getFormSettingParams(urlParams) {
30
+ var params = urlParams || getUrlParams();
31
+ return {
32
+ businessCode: params.businessCode || params.business_code,
33
+ channelCode: params.channelCode || params.channel_code,
34
+ board: params.board,
35
+ includeBoard: params.board === '1',
36
+ isBoard: params.isBoard
37
+ };
38
+ };
39
+
40
+ /**
41
+ * 保存formSettingMeta数据
42
+ * @param sectionCodes 配置段代码数组,如 ['payment']
43
+ * @param data 要保存的数据
44
+ * @param businessCode 业务代码
45
+ * @param channelCode 渠道代码
46
+ * @param includeBoard 是否包含board_code参数
47
+ * @returns Promise<any> 返回保存结果
48
+ */
49
+ export var saveFormSettingMeta = /*#__PURE__*/function () {
50
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sectionCodes, data, businessCode, channelCode, includeBoard) {
51
+ var queryParams, url;
52
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
53
+ while (1) switch (_context.prev = _context.next) {
54
+ case 0:
55
+ // 构建查询参数
56
+ queryParams = new URLSearchParams(); // 添加section_code参数(支持多个值)
57
+ sectionCodes.forEach(function (code) {
58
+ queryParams.append('section_code[]', code);
59
+ });
60
+
61
+ // 添加business_code参数
62
+ if (businessCode) {
63
+ queryParams.append('business_code', businessCode);
64
+ }
65
+
66
+ // 添加channel_code参数
67
+ if (channelCode) {
68
+ queryParams.append('channel_code', channelCode);
69
+ }
70
+
71
+ // 当需要包含board_code时,格式为 business_code×channel_code
72
+ if (includeBoard && businessCode && channelCode) {
73
+ queryParams.append('board_code', "".concat(businessCode, "\xD7").concat(channelCode));
74
+ }
75
+ url = "/setting?".concat(queryParams.toString());
76
+ return _context.abrupt("return", request.getRequest().post(url, data, {
77
+ headers: {
78
+ 'Content-Type': 'application/json'
79
+ }
80
+ }));
81
+ case 7:
82
+ case "end":
83
+ return _context.stop();
84
+ }
85
+ }, _callee);
86
+ }));
87
+ return function saveFormSettingMeta(_x, _x2, _x3, _x4, _x5) {
88
+ return _ref.apply(this, arguments);
89
+ };
90
+ }();
91
+
92
+ /**
93
+ * 根据URL参数更新租户设置数据
94
+ * @param data 要更新的数据对象,如 {"order.prefix":"","order.suffix":"","payment.number":""}
95
+ * @returns Promise<any> 返回更新结果
96
+ */
97
+ export var updateTenantSettingFromUrl = /*#__PURE__*/function () {
98
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {
99
+ var urlParams, businessCode, channelCode, boardCode, requestBody, url;
100
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
101
+ while (1) switch (_context2.prev = _context2.next) {
102
+ case 0:
103
+ // 从URL获取参数
104
+ urlParams = getUrlParams();
105
+ businessCode = urlParams.businessCode;
106
+ channelCode = urlParams.channelCode; // 构建board_code(只有当isBoard参数为1时才有)
107
+ boardCode = urlParams.isBoard === '1' && businessCode && channelCode ? "".concat(businessCode, "x").concat(channelCode) : undefined; // 构建请求体,按照 curl 请求的格式
108
+ requestBody = {
109
+ business_code: businessCode || '',
110
+ channel_code: channelCode || '',
111
+ board_code: boardCode || '',
112
+ data: data
113
+ };
114
+ url = '/tenant/setting';
115
+ return _context2.abrupt("return", request.getRequest().post(url, requestBody, {
116
+ headers: {
117
+ 'Content-Type': 'application/json'
118
+ }
119
+ }));
120
+ case 7:
121
+ case "end":
122
+ return _context2.stop();
123
+ }
124
+ }, _callee2);
125
+ }));
126
+ return function updateTenantSettingFromUrl(_x6) {
127
+ return _ref2.apply(this, arguments);
128
+ };
129
+ }();
@@ -89,6 +89,7 @@ var BaseTable = function BaseTable(props, ref) {
89
89
  }, [dataSourceKey]);
90
90
  useEffect(function () {
91
91
  if (dataSourceKeyRef.current) {
92
+ if (dataSource !== null && dataSource !== void 0 && dataSource.fromSettingMeta) return;
92
93
  list === null || list === void 0 || list.run(queryPageConfig);
93
94
  } else {
94
95
  list === null || list === void 0 || list.mutate([]);
@@ -0,0 +1,27 @@
1
+ import './index.less';
2
+ interface BaseFilterItem {
3
+ name?: string;
4
+ value: string;
5
+ label?: string;
6
+ type?: string;
7
+ isHidden: boolean;
8
+ isCustom?: boolean;
9
+ }
10
+ interface FilterProps {
11
+ componentId: string;
12
+ filterBy: Record<string, any>;
13
+ quickFilterMaxLength?: number;
14
+ sortButtonShow?: boolean;
15
+ mode?: 'simple' | 'complex';
16
+ items: BaseFilterItem[];
17
+ handleValuesChange: (changedFields: any, allFields: any) => void;
18
+ show: boolean;
19
+ search: {
20
+ show: boolean;
21
+ placeholder: string;
22
+ key: string;
23
+ };
24
+ getInitialValues?: () => Record<string, any>;
25
+ }
26
+ declare const Filter: (props: FilterProps) => JSX.Element;
27
+ export default Filter;
@@ -0,0 +1,33 @@
1
+ import { DataSourceTableProps } from '../type';
2
+ declare type Params = {
3
+ pagination?: {
4
+ page: number;
5
+ size: number;
6
+ };
7
+ order_by?: string;
8
+ tabs?: {
9
+ name: string;
10
+ filterBy: Record<string, any>;
11
+ sortBy: string;
12
+ };
13
+ };
14
+ declare const useTableQuery: (props: DataSourceTableProps, currentSettingHash: string) => {
15
+ queryPageConfig: {
16
+ page: number;
17
+ pageSize: number;
18
+ filter: Record<string, any>;
19
+ sort: string;
20
+ };
21
+ setQueryPageConfig: import("react").Dispatch<import("react").SetStateAction<{
22
+ page: number;
23
+ pageSize: number;
24
+ filter: Record<string, any>;
25
+ sort: string;
26
+ }>>;
27
+ handleValuesChange: (params: Params, allParams: Params) => void;
28
+ refreshData: () => void;
29
+ handleFilterChange: (changedFields: any, allFields: any) => void;
30
+ refreshCurrentPage: () => void;
31
+ getInitialValues: () => Record<string, any>;
32
+ };
33
+ export default useTableQuery;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { InputProps } from 'antd';
3
+ import { ModeType } from '../../dataSourceForm/type';
4
+ declare type PhoneValue = string | {
5
+ phone: string;
6
+ countryCallingCode: string;
7
+ countryCode?: string;
8
+ };
9
+ export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange'> {
10
+ renderMode: ModeType;
11
+ value?: PhoneValue;
12
+ onChange?: (value: PhoneValue) => void;
13
+ returnFormat?: 'string' | 'object';
14
+ inputRef?: any;
15
+ }
16
+ declare const MobileNumberInputWithMode: React.FC<PhoneInputProps & import("../../dataSourceForm/utils").WithModeProps>;
17
+ export default MobileNumberInputWithMode;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { InputProps } from 'antd';
3
+ import { ModeType } from "../../dataSourceForm/type";
4
+ declare type PhoneValue = string | {
5
+ phone: string;
6
+ countryCallingCode: string;
7
+ };
8
+ export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange'> {
9
+ renderMode: ModeType;
10
+ value?: PhoneValue;
11
+ onChange?: (value: PhoneValue) => void;
12
+ returnFormat?: 'string' | 'object';
13
+ inputRef?: any;
14
+ }
15
+ declare const PhoneNumberInputWithMode: React.FC<PhoneInputProps & import("../../dataSourceForm/utils").WithModeProps>;
16
+ export default PhoneNumberInputWithMode;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  declare const Subdomain: React.FC<import("antd").InputProps & {
3
3
  onChange: (value: string) => void;
4
4
  onBlur?: ((e: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
5
- rootDomain: "custom" | "xzero" | "saas";
5
+ rootDomain: "custom" | "saas" | "xzero";
6
6
  customDomain?: string | undefined;
7
7
  value?: string | undefined;
8
8
  tenantId: string;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { UploadProps } from './type';
3
+ import './index.less';
4
+ declare const BaseUpload: React.FC<UploadProps>;
5
+ export default BaseUpload;
@@ -0,0 +1,5 @@
1
+ declare const CameraPopover: (props: {
2
+ onLocalFileClick: () => void;
3
+ onCameraChange: (file: any) => void;
4
+ }) => JSX.Element;
5
+ export default CameraPopover;