@pisell/materials 6.11.54 → 6.11.55
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.js +4 -4
- package/es/components/PisellCards/index.d.ts +0 -1
- package/es/components/PisellFields/index.d.ts +0 -1
- package/es/components/PisellLayouts/index.d.ts +0 -1
- package/es/components/PisellMetrics/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.js +32 -21
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +2 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +7 -3
- package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +23 -0
- package/es/components/dataSourceComponents/dataSourceForm/serve.js +99 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +35 -20
- package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -2
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +14 -15
- package/es/components/dataSourceComponents/hooks/useActions.js +1 -1
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/es/components/date-picker/index.d.ts +0 -1
- package/es/components/pisellDataSourceContainer/hooks/useDataSourceKey.d.ts +0 -1
- package/es/components/pisellDatePicker/index.d.ts +0 -1
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +4 -4
- package/es/components/pisellFloorMapLayout/components/ViewControls.js +2 -2
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +3 -3
- package/es/components/pisellFloorMapLayout/types.d.ts +1 -1
- package/es/components/pisellModal/components/index.d.ts +0 -1
- package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/BookingCalendarStyle.d.ts +1 -1
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/es/components/productCard/components/Packages/utils.d.ts +1 -1
- package/es/components/table/Table/fields/date/index.d.ts +0 -1
- package/es/components/table/Table/fields/image/index.d.ts +0 -1
- package/es/components/table/Table/fields/index.d.ts +0 -1
- package/es/components/table/Table/fields/link/index.d.ts +0 -1
- package/es/components/table/Table/fields/number/index.d.ts +0 -1
- package/es/components/table/Table/fields/numberRange/index.d.ts +0 -1
- package/es/components/table/Table/fields/oldRangePicker/index.d.ts +0 -1
- package/es/components/table/Table/fields/pSwitch/index.d.ts +0 -1
- package/es/components/table/Table/fields/rangePicker/index.d.ts +0 -1
- package/es/components/table/Table/fields/search/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/index.d.ts +0 -1
- package/es/components/table/Table/fields/treeSelect/index.d.ts +0 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/locales/en-US.d.ts +1 -0
- package/es/locales/en-US.js +1 -0
- package/es/locales/zh-CN.d.ts +1 -0
- package/es/locales/zh-CN.js +1 -0
- package/es/locales/zh-TW.d.ts +1 -0
- package/es/locales/zh-TW.js +1 -0
- package/lib/components/PisellCards/index.d.ts +0 -1
- package/lib/components/PisellFields/index.d.ts +0 -1
- package/lib/components/PisellLayouts/index.d.ts +0 -1
- package/lib/components/PisellMetrics/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.js +30 -14
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +2 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +7 -3
- package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +23 -0
- package/lib/components/dataSourceComponents/dataSourceForm/serve.js +69 -1
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +8 -1
- package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -2
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +14 -15
- package/lib/components/dataSourceComponents/hooks/useActions.js +1 -1
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/lib/components/date-picker/index.d.ts +0 -1
- package/lib/components/pisellDataSourceContainer/hooks/useDataSourceKey.d.ts +0 -1
- package/lib/components/pisellDatePicker/index.d.ts +0 -1
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +3 -3
- package/lib/components/pisellFloorMapLayout/components/ViewControls.js +2 -2
- package/lib/components/pisellFloorMapLayout/types.d.ts +1 -1
- package/lib/components/pisellModal/components/index.d.ts +0 -1
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/BookingCalendarStyle.d.ts +1 -1
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
- package/lib/components/table/Table/fields/date/index.d.ts +0 -1
- package/lib/components/table/Table/fields/image/index.d.ts +0 -1
- package/lib/components/table/Table/fields/index.d.ts +0 -1
- package/lib/components/table/Table/fields/link/index.d.ts +0 -1
- package/lib/components/table/Table/fields/number/index.d.ts +0 -1
- package/lib/components/table/Table/fields/numberRange/index.d.ts +0 -1
- package/lib/components/table/Table/fields/oldRangePicker/index.d.ts +0 -1
- package/lib/components/table/Table/fields/pSwitch/index.d.ts +0 -1
- package/lib/components/table/Table/fields/rangePicker/index.d.ts +0 -1
- package/lib/components/table/Table/fields/search/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/index.d.ts +0 -1
- package/lib/components/table/Table/fields/treeSelect/index.d.ts +0 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/locales/en-US.d.ts +1 -0
- package/lib/locales/en-US.js +1 -0
- package/lib/locales/zh-CN.d.ts +1 -0
- package/lib/locales/zh-CN.js +1 -0
- package/lib/locales/zh-TW.d.ts +1 -0
- package/lib/locales/zh-TW.js +1 -0
- package/lowcode/data-source-form/meta.ts +53 -4
- package/lowcode/data-source-form/utils.ts +43 -5
- package/lowcode/data-source-table/meta.ts +51 -45
- package/lowcode/pisell-record-board-calendar-view/meta.ts +1 -1
- package/package.json +3 -3
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* <PisellFields.Number value={123} viewMode="readonly" />
|
|
10
10
|
* <PisellFields.Currency value={1000} currencySymbol="$" />
|
|
11
11
|
*/
|
|
12
|
-
/// <reference types="react" />
|
|
13
12
|
declare const PisellFields: {
|
|
14
13
|
SingleLineText: import("react").NamedExoticComponent<import("../pisellSingleLineText").PisellSingleLineTextProps>;
|
|
15
14
|
LongText: import("react").NamedExoticComponent<import("../pisellLongText").PisellLongTextProps>;
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* <Content />
|
|
14
14
|
* </PisellLayouts.ScrollView>
|
|
15
15
|
*/
|
|
16
|
-
/// <reference types="react" />
|
|
17
16
|
declare const PisellLayouts: {
|
|
18
17
|
BasicGrid: <T>(props: import("../PisellBasicGrid").PisellBasicGridProps<T>) => import("react").JSX.Element;
|
|
19
18
|
ScrollView: import("react").ForwardRefExoticComponent<Omit<import("../PisellScrollView").PisellScrollViewProps, "ref"> & import("react").RefAttributes<import("../PisellScrollView").PisellScrollViewRef>>;
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* />
|
|
14
14
|
* <PisellMetrics.StatisticList data={[...]} />
|
|
15
15
|
*/
|
|
16
|
-
/// <reference types="react" />
|
|
17
16
|
declare const PisellMetrics: {
|
|
18
17
|
MetricCard: import("react").FC<import("../pisellMetricCard").PisellMetricCardProps>;
|
|
19
18
|
StatisticList: (props: import("../pisellStatisticList").PisellStatisticListProps) => import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
-
var _excluded = ["title", "description", "dataSource", "showTitle", "showDescription", "groupInfoPosition", "variables", "renderMode", "children", "currentValue", "className", "onDataSourceFinish", "formatSubmitValues", "formatInitialValues", "customSubmit", "beforeSubmit", "leaveConfirmConfig"];
|
|
2
|
+
var _excluded = ["title", "description", "dataSource", "showTitle", "showDescription", "groupInfoPosition", "variables", "renderMode", "children", "currentValue", "className", "onDataSourceFinish", "onDataSourceLoaded", "formatSubmitValues", "formatInitialValues", "customSubmit", "beforeSubmit", "leaveConfirmConfig", "scene", "sceneRequestId"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
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); } }
|
|
@@ -13,7 +13,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
13
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; }
|
|
14
14
|
import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
-
import { useMemoizedFn } from 'ahooks';
|
|
16
|
+
import { useMemoizedFn, useDeepCompareEffect } from 'ahooks';
|
|
17
17
|
import PisellModal from "../../pisellModal";
|
|
18
18
|
import useCtxActions from "../hooks/useCtxActions";
|
|
19
19
|
import useDataSource from "../hooks/useDataSource";
|
|
@@ -22,7 +22,7 @@ import Form from "../../form";
|
|
|
22
22
|
import FormSettingProvider from "./provider/formSetting/FormSettingProvider";
|
|
23
23
|
import PageHeader from "../../page-header";
|
|
24
24
|
import { transformFormObjToArrayWithUntouched } from "./utils";
|
|
25
|
-
import { getFormSettingMetaData } from "./serve";
|
|
25
|
+
import { getFormSettingMetaData, getDeviceSettingMetaData } from "./serve";
|
|
26
26
|
import useFormSettingParams from "../hooks/useFormSettingParams";
|
|
27
27
|
import "./index.less";
|
|
28
28
|
import { isArr } from "@pisell/utils";
|
|
@@ -31,7 +31,7 @@ import { isArr } from "@pisell/utils";
|
|
|
31
31
|
* @description: 基于数据源动态生成表单,支持编辑、查看、禁用三种模式
|
|
32
32
|
*/
|
|
33
33
|
var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
34
|
-
var _context$appHelper;
|
|
34
|
+
var _context$pageContext, _context$appHelper;
|
|
35
35
|
var title = props.title,
|
|
36
36
|
description = props.description,
|
|
37
37
|
dataSource = props.dataSource,
|
|
@@ -44,13 +44,17 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
44
44
|
currentValue = props.currentValue,
|
|
45
45
|
className = props.className,
|
|
46
46
|
onDataSourceFinish = props.onDataSourceFinish,
|
|
47
|
+
onDataSourceLoaded = props.onDataSourceLoaded,
|
|
47
48
|
formatSubmitValues = props.formatSubmitValues,
|
|
48
49
|
formatInitialValues = props.formatInitialValues,
|
|
49
50
|
customSubmit = props.customSubmit,
|
|
50
51
|
beforeSubmit = props.beforeSubmit,
|
|
51
52
|
leaveConfirmConfig = props.leaveConfirmConfig,
|
|
53
|
+
scene = props.scene,
|
|
54
|
+
sceneRequestId = props.sceneRequestId,
|
|
52
55
|
others = _objectWithoutProperties(props, _excluded);
|
|
53
56
|
var context = useEngineContext();
|
|
57
|
+
console.log('context_pageProps', context === null || context === void 0 || (_context$pageContext = context.pageContext) === null || _context$pageContext === void 0 ? void 0 : _context$pageContext.props);
|
|
54
58
|
var _useCtxActions = useCtxActions(),
|
|
55
59
|
setBeforeClose = _useCtxActions.setBeforeClose;
|
|
56
60
|
var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
|
|
@@ -74,27 +78,30 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
74
78
|
useImperativeHandle(ref, function () {
|
|
75
79
|
return formRef.current;
|
|
76
80
|
});
|
|
77
|
-
|
|
81
|
+
useDeepCompareEffect(function () {
|
|
78
82
|
if (['edit', 'view'].includes(renderMode || '') && dataSource) {
|
|
79
|
-
if (dataSource !== null && dataSource !== void 0 && dataSource.fromSettingMeta) {
|
|
80
|
-
var _dataSource$fields;
|
|
83
|
+
if (dataSource !== null && dataSource !== void 0 && dataSource.fromSettingMeta || dataSource !== null && dataSource !== void 0 && dataSource.fromDeviceSettingMeta) {
|
|
84
|
+
var _dataSource$fields, _dataSource$fields2;
|
|
81
85
|
if (props.__designMode === 'design') return;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
getFormSettingMetaData({
|
|
89
|
-
sectionCodes:
|
|
86
|
+
var fetchMetaData = dataSource !== null && dataSource !== void 0 && dataSource.fromDeviceSettingMeta ? getDeviceSettingMetaData({
|
|
87
|
+
scene: scene,
|
|
88
|
+
sceneRequestId: sceneRequestId || '',
|
|
89
|
+
items: (dataSource === null || dataSource === void 0 || (_dataSource$fields = dataSource.fields) === null || _dataSource$fields === void 0 ? void 0 : _dataSource$fields.map(function (field) {
|
|
90
|
+
return field.name;
|
|
91
|
+
})) || []
|
|
92
|
+
}) : getFormSettingMetaData({
|
|
93
|
+
sectionCodes: Array.from(new Set(dataSource === null || dataSource === void 0 || (_dataSource$fields2 = dataSource.fields) === null || _dataSource$fields2 === void 0 ? void 0 : _dataSource$fields2.map(function (field) {
|
|
94
|
+
return field.name.split('.').shift();
|
|
95
|
+
}))),
|
|
90
96
|
scope: scope,
|
|
91
97
|
target: target
|
|
92
|
-
})
|
|
93
|
-
|
|
98
|
+
});
|
|
99
|
+
fetchMetaData.then(function (res) {
|
|
100
|
+
var _dataSource$fields3, _formRef$current2;
|
|
94
101
|
var formattedValues = formatInitialValues ? formatInitialValues(res.data) : res.data || {};
|
|
95
102
|
|
|
96
103
|
// 根据 dataSource.fields 筛选 formattedValues
|
|
97
|
-
var fieldNames = new Set((dataSource === null || dataSource === void 0 || (_dataSource$
|
|
104
|
+
var fieldNames = new Set((dataSource === null || dataSource === void 0 || (_dataSource$fields3 = dataSource.fields) === null || _dataSource$fields3 === void 0 ? void 0 : _dataSource$fields3.map(function (field) {
|
|
98
105
|
return field.name;
|
|
99
106
|
})) || []);
|
|
100
107
|
var filteredValues = Object.keys(formattedValues).reduce(function (acc, key) {
|
|
@@ -104,6 +111,7 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
104
111
|
return acc;
|
|
105
112
|
}, {});
|
|
106
113
|
(_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.setFields(transformFormObjToArrayWithUntouched(_objectSpread({}, filteredValues)));
|
|
114
|
+
onDataSourceLoaded === null || onDataSourceLoaded === void 0 || onDataSourceLoaded(filteredValues, res);
|
|
107
115
|
}).catch(function (error) {
|
|
108
116
|
console.error('获取formSettingMeta数据失败:', error);
|
|
109
117
|
});
|
|
@@ -114,9 +122,9 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
114
122
|
var formattedValues = formatInitialValues ? formatInitialValues(res) : res;
|
|
115
123
|
var values = formattedValues;
|
|
116
124
|
if (isArr(dataSource === null || dataSource === void 0 ? void 0 : dataSource.fields)) {
|
|
117
|
-
var _dataSource$
|
|
125
|
+
var _dataSource$fields4;
|
|
118
126
|
// 根据 dataSource.fields 筛选 formattedValues
|
|
119
|
-
var fieldNames = new Set((dataSource === null || dataSource === void 0 || (_dataSource$
|
|
127
|
+
var fieldNames = new Set((dataSource === null || dataSource === void 0 || (_dataSource$fields4 = dataSource.fields) === null || _dataSource$fields4 === void 0 ? void 0 : _dataSource$fields4.map(function (field) {
|
|
120
128
|
return field.name;
|
|
121
129
|
})) || []);
|
|
122
130
|
values = Object.keys(formattedValues).reduce(function (acc, key) {
|
|
@@ -127,6 +135,7 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
127
135
|
}, {});
|
|
128
136
|
}
|
|
129
137
|
(_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 || _formRef$current3.setFields(transformFormObjToArrayWithUntouched(values));
|
|
138
|
+
onDataSourceLoaded === null || onDataSourceLoaded === void 0 || onDataSourceLoaded(values, res);
|
|
130
139
|
});
|
|
131
140
|
}
|
|
132
141
|
}, [renderMode, dataSource]);
|
|
@@ -215,7 +224,9 @@ var BaseForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
215
224
|
formatSubmitValues: formatSubmitValues,
|
|
216
225
|
formatInitialValues: formatInitialValues,
|
|
217
226
|
customSubmit: customSubmit,
|
|
218
|
-
beforeSubmit: beforeSubmit
|
|
227
|
+
beforeSubmit: beforeSubmit,
|
|
228
|
+
scene: scene,
|
|
229
|
+
sceneRequestId: sceneRequestId
|
|
219
230
|
}, /*#__PURE__*/React.createElement(Form, _extends({}, others, {
|
|
220
231
|
className: classNames('pisell-lowcode-data-source-form', className),
|
|
221
232
|
ref: formRef,
|
|
@@ -11,6 +11,8 @@ export interface FormSettingContextType {
|
|
|
11
11
|
formatInitialValues?: (values: Record<string, any>) => Record<string, any>;
|
|
12
12
|
customSubmit?: (values: Record<string, any>) => Promise<any>;
|
|
13
13
|
beforeSubmit?: (values: Record<string, any>) => Promise<boolean> | boolean;
|
|
14
|
+
scene?: 'template' | 'profile' | 'instance';
|
|
15
|
+
sceneRequestId?: string;
|
|
14
16
|
}
|
|
15
17
|
export declare const FormSettingContext: import("react").Context<FormSettingContextType>;
|
|
16
18
|
export default FormSettingContext;
|
|
@@ -15,7 +15,9 @@ var FormSettingProvider = function FormSettingProvider(props) {
|
|
|
15
15
|
formatSubmitValues = props.formatSubmitValues,
|
|
16
16
|
formatInitialValues = props.formatInitialValues,
|
|
17
17
|
customSubmit = props.customSubmit,
|
|
18
|
-
beforeSubmit = props.beforeSubmit
|
|
18
|
+
beforeSubmit = props.beforeSubmit,
|
|
19
|
+
scene = props.scene,
|
|
20
|
+
sceneRequestId = props.sceneRequestId;
|
|
19
21
|
var value = React.useMemo(function () {
|
|
20
22
|
return {
|
|
21
23
|
renderMode: renderMode,
|
|
@@ -26,9 +28,11 @@ var FormSettingProvider = function FormSettingProvider(props) {
|
|
|
26
28
|
formatSubmitValues: formatSubmitValues,
|
|
27
29
|
formatInitialValues: formatInitialValues,
|
|
28
30
|
customSubmit: customSubmit,
|
|
29
|
-
beforeSubmit: beforeSubmit
|
|
31
|
+
beforeSubmit: beforeSubmit,
|
|
32
|
+
scene: scene,
|
|
33
|
+
sceneRequestId: sceneRequestId
|
|
30
34
|
};
|
|
31
|
-
}, [renderMode, groupInfoPosition, currentValue, size, beforeSubmit]);
|
|
35
|
+
}, [renderMode, groupInfoPosition, currentValue, size, beforeSubmit, scene, sceneRequestId]);
|
|
32
36
|
return /*#__PURE__*/React.createElement(FormSettingContext.Provider, {
|
|
33
37
|
value: value
|
|
34
38
|
}, children);
|
|
@@ -175,4 +175,27 @@ export declare const updateTenantSetting: (params: {
|
|
|
175
175
|
target?: string | undefined;
|
|
176
176
|
data: Record<string, any>;
|
|
177
177
|
}) => Promise<any>;
|
|
178
|
+
export declare type DeviceSettingScene = 'template' | 'profile' | 'instance';
|
|
179
|
+
/**
|
|
180
|
+
* 获取设备设置元数据(POST 类型 GET)
|
|
181
|
+
* @param params.scene 场景,默认 template
|
|
182
|
+
* @param params.sceneRequestId URL 中 {id} 占位符的实际取值
|
|
183
|
+
* @param params.items 需要获取的字段列表,例如 ['order.name', 'order.id']
|
|
184
|
+
*/
|
|
185
|
+
export declare const getDeviceSettingMetaData: (params: {
|
|
186
|
+
scene?: DeviceSettingScene | undefined;
|
|
187
|
+
sceneRequestId: string;
|
|
188
|
+
items: string[];
|
|
189
|
+
}) => Promise<any>;
|
|
190
|
+
/**
|
|
191
|
+
* 更新设备设置数据
|
|
192
|
+
* @param params.scene 场景,默认 template
|
|
193
|
+
* @param params.sceneRequestId URL 中 {id} 占位符的实际取值
|
|
194
|
+
* @param params.data 需要更新的字段值对象
|
|
195
|
+
*/
|
|
196
|
+
export declare const updateDeviceSetting: (params: {
|
|
197
|
+
scene?: DeviceSettingScene | undefined;
|
|
198
|
+
sceneRequestId: string;
|
|
199
|
+
data: Record<string, any>;
|
|
200
|
+
}) => Promise<any>;
|
|
178
201
|
export {};
|
|
@@ -366,4 +366,103 @@ export var updateTenantSetting = /*#__PURE__*/function () {
|
|
|
366
366
|
return function updateTenantSetting(_x12) {
|
|
367
367
|
return _ref14.apply(this, arguments);
|
|
368
368
|
};
|
|
369
|
+
}();
|
|
370
|
+
var buildDeviceSettingUrl = function buildDeviceSettingUrl() {
|
|
371
|
+
var scene = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'template';
|
|
372
|
+
var id = arguments.length > 1 ? arguments[1] : undefined;
|
|
373
|
+
switch (scene) {
|
|
374
|
+
case 'profile':
|
|
375
|
+
return "/tenant/device/profile/".concat(id, "/setting");
|
|
376
|
+
case 'instance':
|
|
377
|
+
return "/tenant/device/".concat(id, "/setting");
|
|
378
|
+
case 'template':
|
|
379
|
+
default:
|
|
380
|
+
return "/admin/device/profile/template/".concat(id, "/setting");
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* 获取设备设置元数据(POST 类型 GET)
|
|
386
|
+
* @param params.scene 场景,默认 template
|
|
387
|
+
* @param params.sceneRequestId URL 中 {id} 占位符的实际取值
|
|
388
|
+
* @param params.items 需要获取的字段列表,例如 ['order.name', 'order.id']
|
|
389
|
+
*/
|
|
390
|
+
export var getDeviceSettingMetaData = /*#__PURE__*/function () {
|
|
391
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(params) {
|
|
392
|
+
var scene, sceneRequestId, items, url;
|
|
393
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
394
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
395
|
+
case 0:
|
|
396
|
+
scene = params.scene, sceneRequestId = params.sceneRequestId, items = params.items;
|
|
397
|
+
console.log('getDeviceSettingMetaData', params);
|
|
398
|
+
if (sceneRequestId) {
|
|
399
|
+
_context12.next = 5;
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
PisellToast({
|
|
403
|
+
content: getText('pisell-data-source-form-scene-request-id-message')
|
|
404
|
+
});
|
|
405
|
+
return _context12.abrupt("return", {});
|
|
406
|
+
case 5:
|
|
407
|
+
url = buildDeviceSettingUrl(scene, sceneRequestId);
|
|
408
|
+
return _context12.abrupt("return", request.getRequest().post(url, {
|
|
409
|
+
items: items
|
|
410
|
+
}, {
|
|
411
|
+
headers: {
|
|
412
|
+
'Content-Type': 'application/json'
|
|
413
|
+
},
|
|
414
|
+
isPisell2: true
|
|
415
|
+
}));
|
|
416
|
+
case 7:
|
|
417
|
+
case "end":
|
|
418
|
+
return _context12.stop();
|
|
419
|
+
}
|
|
420
|
+
}, _callee12);
|
|
421
|
+
}));
|
|
422
|
+
return function getDeviceSettingMetaData(_x13) {
|
|
423
|
+
return _ref15.apply(this, arguments);
|
|
424
|
+
};
|
|
425
|
+
}();
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* 更新设备设置数据
|
|
429
|
+
* @param params.scene 场景,默认 template
|
|
430
|
+
* @param params.sceneRequestId URL 中 {id} 占位符的实际取值
|
|
431
|
+
* @param params.data 需要更新的字段值对象
|
|
432
|
+
*/
|
|
433
|
+
export var updateDeviceSetting = /*#__PURE__*/function () {
|
|
434
|
+
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(params) {
|
|
435
|
+
var scene, sceneRequestId, data, url;
|
|
436
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
437
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
438
|
+
case 0:
|
|
439
|
+
scene = params.scene, sceneRequestId = params.sceneRequestId, data = params.data;
|
|
440
|
+
console.log('updateDeviceSetting', params);
|
|
441
|
+
if (sceneRequestId) {
|
|
442
|
+
_context13.next = 5;
|
|
443
|
+
break;
|
|
444
|
+
}
|
|
445
|
+
PisellToast({
|
|
446
|
+
content: getText('pisell-data-source-form-scene-request-id-message')
|
|
447
|
+
});
|
|
448
|
+
return _context13.abrupt("return", {});
|
|
449
|
+
case 5:
|
|
450
|
+
url = buildDeviceSettingUrl(scene, sceneRequestId);
|
|
451
|
+
return _context13.abrupt("return", request.getRequest().put(url, {
|
|
452
|
+
items: data
|
|
453
|
+
}, {
|
|
454
|
+
headers: {
|
|
455
|
+
'Content-Type': 'application/json'
|
|
456
|
+
},
|
|
457
|
+
isPisell2: true
|
|
458
|
+
}));
|
|
459
|
+
case 7:
|
|
460
|
+
case "end":
|
|
461
|
+
return _context13.stop();
|
|
462
|
+
}
|
|
463
|
+
}, _callee13);
|
|
464
|
+
}));
|
|
465
|
+
return function updateDeviceSetting(_x14) {
|
|
466
|
+
return _ref16.apply(this, arguments);
|
|
467
|
+
};
|
|
369
468
|
}();
|
|
@@ -19,7 +19,7 @@ import useDataSource from "../../hooks/useDataSource";
|
|
|
19
19
|
import { filterSystemFields, setFormFieldsUntouched } from "../utils";
|
|
20
20
|
import useFormSettingParams from "../../hooks/useFormSettingParams";
|
|
21
21
|
import "./index.less";
|
|
22
|
-
import { updateTenantSetting } from "../serve";
|
|
22
|
+
import { updateTenantSetting, updateDeviceSetting } from "../serve";
|
|
23
23
|
// 表单提交按钮
|
|
24
24
|
var SubmitButton = function SubmitButton(props) {
|
|
25
25
|
var children = props.children,
|
|
@@ -49,7 +49,9 @@ var SubmitButton = function SubmitButton(props) {
|
|
|
49
49
|
onDataSourceFinish = _useFormSetting.onDataSourceFinish,
|
|
50
50
|
formatSubmitValues = _useFormSetting.formatSubmitValues,
|
|
51
51
|
customSubmit = _useFormSetting.customSubmit,
|
|
52
|
-
beforeSubmit = _useFormSetting.beforeSubmit
|
|
52
|
+
beforeSubmit = _useFormSetting.beforeSubmit,
|
|
53
|
+
scene = _useFormSetting.scene,
|
|
54
|
+
sceneRequestId = _useFormSetting.sceneRequestId;
|
|
53
55
|
var _useCtxActions = useCtxActions(),
|
|
54
56
|
setVisible = _useCtxActions.setVisible,
|
|
55
57
|
refreshTableData = _useCtxActions.refreshTableData;
|
|
@@ -66,56 +68,69 @@ var SubmitButton = function SubmitButton(props) {
|
|
|
66
68
|
case 0:
|
|
67
69
|
setLoading(true);
|
|
68
70
|
_context.prev = 1;
|
|
69
|
-
if (!(dataSource !== null && dataSource !== void 0 && dataSource.
|
|
71
|
+
if (!(dataSource !== null && dataSource !== void 0 && dataSource.fromDeviceSettingMeta)) {
|
|
70
72
|
_context.next = 6;
|
|
71
73
|
break;
|
|
72
74
|
}
|
|
73
75
|
_context.next = 5;
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
return updateDeviceSetting({
|
|
77
|
+
scene: scene,
|
|
78
|
+
sceneRequestId: sceneRequestId || '',
|
|
77
79
|
data: values
|
|
78
80
|
});
|
|
79
81
|
case 5:
|
|
80
82
|
return _context.abrupt("return", _context.sent);
|
|
81
83
|
case 6:
|
|
82
|
-
if (!
|
|
84
|
+
if (!(dataSource !== null && dataSource !== void 0 && dataSource.fromSettingMeta)) {
|
|
83
85
|
_context.next = 10;
|
|
84
86
|
break;
|
|
85
87
|
}
|
|
86
88
|
_context.next = 9;
|
|
87
|
-
return
|
|
89
|
+
return updateTenantSetting({
|
|
90
|
+
scope: scope,
|
|
91
|
+
target: target,
|
|
92
|
+
data: values
|
|
93
|
+
});
|
|
88
94
|
case 9:
|
|
89
95
|
return _context.abrupt("return", _context.sent);
|
|
90
96
|
case 10:
|
|
91
|
-
if (!
|
|
92
|
-
_context.next =
|
|
97
|
+
if (!customSubmit) {
|
|
98
|
+
_context.next = 14;
|
|
93
99
|
break;
|
|
94
100
|
}
|
|
95
101
|
_context.next = 13;
|
|
96
|
-
return
|
|
102
|
+
return customSubmit(values);
|
|
97
103
|
case 13:
|
|
98
104
|
return _context.abrupt("return", _context.sent);
|
|
99
|
-
case
|
|
105
|
+
case 14:
|
|
106
|
+
if (!(renderMode === 'edit')) {
|
|
107
|
+
_context.next = 20;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
_context.next = 17;
|
|
111
|
+
return update.runAsync(values);
|
|
112
|
+
case 17:
|
|
113
|
+
return _context.abrupt("return", _context.sent);
|
|
114
|
+
case 20:
|
|
100
115
|
if (!(renderMode === 'add')) {
|
|
101
|
-
_context.next =
|
|
116
|
+
_context.next = 26;
|
|
102
117
|
break;
|
|
103
118
|
}
|
|
104
|
-
_context.next =
|
|
119
|
+
_context.next = 23;
|
|
105
120
|
return create.runAsync(values);
|
|
106
|
-
case
|
|
121
|
+
case 23:
|
|
107
122
|
res = _context.sent;
|
|
108
123
|
form === null || form === void 0 || form.resetFields();
|
|
109
124
|
return _context.abrupt("return", res);
|
|
110
|
-
case
|
|
111
|
-
_context.prev =
|
|
125
|
+
case 26:
|
|
126
|
+
_context.prev = 26;
|
|
112
127
|
setLoading(false);
|
|
113
|
-
return _context.finish(
|
|
114
|
-
case
|
|
128
|
+
return _context.finish(26);
|
|
129
|
+
case 29:
|
|
115
130
|
case "end":
|
|
116
131
|
return _context.stop();
|
|
117
132
|
}
|
|
118
|
-
}, _callee, null, [[1,,
|
|
133
|
+
}, _callee, null, [[1,, 26, 29]]);
|
|
119
134
|
}));
|
|
120
135
|
return function onSubmit(_x) {
|
|
121
136
|
return _ref.apply(this, arguments);
|
|
@@ -12,6 +12,8 @@ export interface DataSourceFormProps {
|
|
|
12
12
|
variables: any[];
|
|
13
13
|
renderMode?: ModeType;
|
|
14
14
|
currentValue?: 'server' | 'local';
|
|
15
|
+
scene?: 'template' | 'profile' | 'instance';
|
|
16
|
+
sceneRequestId?: string;
|
|
15
17
|
children: React.ReactNode;
|
|
16
18
|
className?: string;
|
|
17
19
|
size?: 'small' | 'middle' | 'large';
|
|
@@ -19,6 +21,7 @@ export interface DataSourceFormProps {
|
|
|
19
21
|
__designMode?: string;
|
|
20
22
|
formatSubmitValues?: (values: Record<string, any>) => Record<string, any>;
|
|
21
23
|
formatInitialValues?: (values: Record<string, any>) => Record<string, any>;
|
|
24
|
+
onDataSourceLoaded?: (values: Record<string, any>, result: any) => void;
|
|
22
25
|
customSubmit?: (values: Record<string, any>) => Promise<any>;
|
|
23
26
|
beforeSubmit?: (values: Record<string, any>) => Promise<boolean> | boolean;
|
|
24
27
|
leaveConfirmConfig?: {
|
|
@@ -44,7 +44,7 @@ export declare const withDataSource: <P extends unknown>(WrappedComponent: React
|
|
|
44
44
|
}) => React.JSX.Element;
|
|
45
45
|
export declare const withOptions: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
|
|
46
46
|
options?: any;
|
|
47
|
-
optionSourceType?: "default" | "
|
|
47
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
48
48
|
labelField: string;
|
|
49
49
|
valueField: string;
|
|
50
50
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -89,7 +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
|
+
if (dataSource !== null && dataSource !== void 0 && dataSource.fromSettingMeta || dataSource !== null && dataSource !== void 0 && dataSource.fromDeviceSettingMeta) return;
|
|
93
93
|
list === null || list === void 0 || list.run(queryPageConfig);
|
|
94
94
|
} else {
|
|
95
95
|
list === null || list === void 0 || list.mutate([]);
|
|
@@ -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: "
|
|
5
|
+
rootDomain: "custom" | "saas" | "xzero";
|
|
6
6
|
customDomain?: string | undefined;
|
|
7
7
|
value?: string | undefined;
|
|
8
8
|
tenantId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const RecordListWrapperWithDataSource: (props: import("./type").RecordListWrapperProps & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps & {
|
|
3
3
|
options?: any;
|
|
4
|
-
optionSourceType?: "default" | "
|
|
4
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
5
5
|
labelField: string;
|
|
6
6
|
valueField: string;
|
|
7
7
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const SelectWithDataSource: (props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps & {
|
|
3
3
|
options?: any;
|
|
4
|
-
optionSourceType?: "default" | "
|
|
4
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
5
5
|
labelField: string;
|
|
6
6
|
valueField: string;
|
|
7
7
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
/** 包装 DataSource 层(提供数据源上下文) */
|
|
3
2
|
declare const FormItemTabs: (props: import("./type").TabsProps & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps & {
|
|
4
3
|
options?: any;
|
|
5
|
-
optionSourceType?: "default" | "
|
|
4
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
6
5
|
labelField: string;
|
|
7
6
|
valueField: string;
|
|
8
7
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -15,4 +15,4 @@ export declare const getFileMetadataParams: (file: RcFile & {
|
|
|
15
15
|
metadata?: MediaMetadata;
|
|
16
16
|
}) => Record<string, any>;
|
|
17
17
|
export declare const isValueEqual: (value: any, fileListValue: any) => boolean;
|
|
18
|
-
export declare const getBaseTime: (size: number) =>
|
|
18
|
+
export declare const getBaseTime: (size: number) => 1000 | 2000 | 4000 | 8000;
|