@teamias/rex-design 0.1.13 → 0.1.15
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/dist/components/action-buttons/demo/FilterDemo.d.ts +6 -0
- package/dist/components/action-buttons/demo/FilterDemo.js +117 -0
- package/dist/components/action-buttons/demo/index.d.ts +4 -0
- package/dist/components/action-buttons/demo/index.js +6 -15
- package/dist/components/base-form/demo/Base.js +1 -3
- package/dist/components/base-form/demo/CustomDemo.d.ts +6 -0
- package/dist/components/base-form/demo/CustomDemo.js +85 -0
- package/dist/components/base-form/demo/CustomDescriptionsDemo.d.ts +6 -0
- package/dist/components/base-form/demo/{BaseFormBasicTest.js → CustomDescriptionsDemo.js} +93 -167
- package/dist/components/base-form/demo/DateDemo.d.ts +6 -0
- package/dist/components/base-form/demo/DateDemo.js +52 -0
- package/dist/components/base-form/demo/DependencyDemo.d.ts +6 -0
- package/dist/components/base-form/demo/{BaseFormBasicDepend.js → DependencyDemo.js} +100 -125
- package/dist/components/base-form/demo/DescriptionsDemo.d.ts +6 -0
- package/dist/components/base-form/demo/{BaseProFormSelectDim.js → DescriptionsDemo.js} +84 -232
- package/dist/components/base-form/demo/InputDemo.d.ts +6 -0
- package/dist/components/base-form/demo/InputDemo.js +59 -0
- package/dist/components/base-form/demo/MultipleDemo.d.ts +6 -0
- package/dist/components/base-form/demo/MultipleDemo.js +97 -0
- package/dist/components/base-form/demo/SelectDemo.d.ts +6 -0
- package/dist/components/base-form/demo/SelectDemo.js +141 -0
- package/dist/components/base-list-table/demo/BasicBaseListTable.d.ts +4 -0
- package/dist/components/base-list-table/demo/BasicBaseListTable.js +7 -17
- package/dist/components/base-list-table/demo/NoData.d.ts +4 -0
- package/dist/components/base-list-table/demo/NoData.js +6 -1
- package/dist/components/base-list-table/demo/TableMaxRowCount.d.ts +4 -0
- package/dist/components/base-list-table/demo/TableMaxRowCount.js +7 -11
- package/dist/components/base-list-table/demo/VirtualDemo.d.ts +4 -0
- package/dist/components/base-list-table/demo/VirtualDemo.js +6 -1
- package/dist/components/base-table/demo/BaseTableAll.d.ts +4 -0
- package/dist/components/base-table/demo/BaseTableAll.js +6 -1
- package/dist/components/base-table/demo/BaseTableBasic.d.ts +4 -0
- package/dist/components/base-table/demo/BaseTableBasic.js +6 -1
- package/dist/components/base-table/demo/BaseTableIndex.d.ts +4 -0
- package/dist/components/base-table/demo/BaseTableIndex.js +7 -11
- package/dist/components/base-table/demo/BaseTableRowSelect.d.ts +4 -0
- package/dist/components/base-table/demo/BaseTableRowSelect.js +6 -1
- package/dist/components/base-table/demo/DynamicData.d.ts +4 -0
- package/dist/components/base-table/demo/DynamicData.js +6 -1
- package/dist/components/data-cell/demo/DynamicData.js +1 -2
- package/dist/components/data-cell/demo/GroupDemo.d.ts +6 -0
- package/dist/components/data-cell/demo/GroupDemo.js +68 -0
- package/dist/components/data-cell/demo/GroupV2Demo.d.ts +6 -0
- package/dist/components/data-cell/demo/GroupV2Demo.js +89 -0
- package/dist/components/data-cell/demo/IconDemo.d.ts +6 -0
- package/dist/components/data-cell/demo/IconDemo.js +52 -0
- package/dist/components/{base-form/demo/BaseFormBasicDepend.d.ts → data-cell/demo/ImageDemo.d.ts} +4 -0
- package/dist/components/data-cell/demo/ImageDemo.js +31 -0
- package/dist/components/data-cell/demo/LinkDemo.d.ts +6 -0
- package/dist/components/data-cell/demo/LinkDemo.js +52 -0
- package/dist/components/data-cell/demo/LinkGroupDemo.d.ts +6 -0
- package/dist/components/data-cell/demo/LinkGroupDemo.js +62 -0
- package/dist/components/{base-form/demo/BaseFormCustomContent.d.ts → data-cell/demo/NestedDemo.d.ts} +4 -0
- package/dist/components/data-cell/demo/NestedDemo.js +50 -0
- package/dist/components/data-cell/demo/TagDemo.d.ts +6 -0
- package/dist/components/data-cell/demo/TagDemo.js +47 -0
- package/dist/components/data-cell/demo/TextDemo.d.ts +6 -0
- package/dist/components/data-cell/demo/TextDemo.js +43 -0
- package/dist/components/data-cell/modules/cellItemMap.js +22 -17
- package/dist/components/flow/core/custom-node.js +58 -50
- package/dist/components/flow/core/util.d.ts +4 -14
- package/dist/components/flow/core/util.js +116 -5
- package/dist/components/flow/demo/menu-demo.js +174 -83
- package/dist/components/flow/demo/toolbar-demo.js +0 -2
- package/dist/components/flow/types.d.ts +8 -6
- package/dist/components/simple-modal/demo/Demo.js +34 -4
- package/dist/context/request-fields-container/demo/index.js +6 -2
- package/dist/context/rex-pro-config-provider/demo/index.js +6 -2
- package/dist/hooks/use-state-data/demo/index.d.ts +4 -0
- package/dist/hooks/use-state-data/demo/index.js +6 -1
- package/dist/hooks/use-sync-value-effect/demo/index.js +94 -0
- package/package.json +7 -3
- package/dist/components/base-form/demo/BaseFormBasicTest.d.ts +0 -2
- package/dist/components/base-form/demo/BaseFormCustomContent.js +0 -121
- package/dist/components/base-form/demo/BaseFormCustomDescriptions.d.ts +0 -2
- package/dist/components/base-form/demo/BaseFormCustomDescriptions.js +0 -332
- package/dist/components/base-form/demo/BaseFormCustomFormItem.d.ts +0 -2
- package/dist/components/base-form/demo/BaseFormCustomFormItem.js +0 -72
- package/dist/components/base-form/demo/BaseFormDescriptions.d.ts +0 -2
- package/dist/components/base-form/demo/BaseFormDescriptions.js +0 -325
- package/dist/components/base-form/demo/BaseProFormDateRangePickerV2.d.ts +0 -2
- package/dist/components/base-form/demo/BaseProFormDateRangePickerV2.js +0 -50
- package/dist/components/base-form/demo/BaseProFormDigitRangeV2.d.ts +0 -2
- package/dist/components/base-form/demo/BaseProFormDigitRangeV2.js +0 -59
- package/dist/components/base-form/demo/BaseProFormSelectDim.d.ts +0 -2
- package/dist/components/data-cell/demo/index.js +0 -364
- /package/dist/{components/data-cell → hooks/use-sync-value-effect}/demo/index.d.ts +0 -0
|
@@ -2,172 +2,147 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
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
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
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
|
-
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; }
|
|
6
|
-
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; }
|
|
7
|
-
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; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
-
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); }
|
|
10
|
-
import enUS from "../../../locales/en-US.json";
|
|
11
5
|
import { ProForm } from '@ant-design/pro-components';
|
|
12
|
-
import { RexProConfigProvider } from "../../..";
|
|
13
|
-
import {
|
|
14
|
-
import { createIntl } from 'react-intl';
|
|
15
|
-
import { BaseForm } from "../core";
|
|
16
|
-
import { getFieldsDefaultValues } from "../modules/handlerData";
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
var s1 = function s1(params) {
|
|
19
|
-
// console.log('触发1');
|
|
6
|
+
import { BaseForm, RexProConfigProvider } from "../../..";
|
|
7
|
+
import { sleep } from 'radash';
|
|
20
8
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
setTimeout(function () {
|
|
27
|
-
rel([{
|
|
28
|
-
label: '选项1',
|
|
29
|
-
value: '选项1'
|
|
30
|
-
}, {
|
|
31
|
-
label: '选项2',
|
|
32
|
-
value: '选项2'
|
|
33
|
-
}, {
|
|
34
|
-
label: '选项3',
|
|
35
|
-
value: '选项3'
|
|
36
|
-
}, {
|
|
37
|
-
label: '选项4',
|
|
38
|
-
value: '选项4'
|
|
39
|
-
}]);
|
|
40
|
-
}, 1000);
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
var s2 = function s2(params) {
|
|
44
|
-
// console.log('触发2');
|
|
45
|
-
fetch('/test/s2', {
|
|
46
|
-
method: 'post',
|
|
47
|
-
body: JSON.stringify(params)
|
|
48
|
-
});
|
|
49
|
-
return new Promise(function (rel) {
|
|
50
|
-
setTimeout(function () {
|
|
51
|
-
rel([{
|
|
52
|
-
label: '2-选项1',
|
|
53
|
-
value: '1'
|
|
54
|
-
}, {
|
|
55
|
-
label: '2-选项2',
|
|
56
|
-
value: '2'
|
|
57
|
-
}, {
|
|
58
|
-
label: '2-选项3',
|
|
59
|
-
value: '3'
|
|
60
|
-
}, {
|
|
61
|
-
label: '2-选项4',
|
|
62
|
-
value: '4'
|
|
63
|
-
}]);
|
|
64
|
-
}, 1000);
|
|
65
|
-
});
|
|
66
|
-
};
|
|
9
|
+
/**
|
|
10
|
+
* title: 字段联动
|
|
11
|
+
* description: 使用 dependenciesV2 配置字段间的联动关系,支持 clear、updateData、disabled、hidden、show、syncValue 等操作
|
|
12
|
+
*/
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
67
14
|
export default (function () {
|
|
15
|
+
var mockRequest = /*#__PURE__*/function () {
|
|
16
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(api, params) {
|
|
17
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
18
|
+
while (1) switch (_context.prev = _context.next) {
|
|
19
|
+
case 0:
|
|
20
|
+
_context.next = 2;
|
|
21
|
+
return sleep(500);
|
|
22
|
+
case 2:
|
|
23
|
+
if (!(params.category === 'fruit')) {
|
|
24
|
+
_context.next = 4;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
return _context.abrupt("return", [{
|
|
28
|
+
label: '苹果',
|
|
29
|
+
value: 'apple'
|
|
30
|
+
}, {
|
|
31
|
+
label: '香蕉',
|
|
32
|
+
value: 'banana'
|
|
33
|
+
}, {
|
|
34
|
+
label: '橙子',
|
|
35
|
+
value: 'orange'
|
|
36
|
+
}]);
|
|
37
|
+
case 4:
|
|
38
|
+
return _context.abrupt("return", [{
|
|
39
|
+
label: '白菜',
|
|
40
|
+
value: 'cabbage'
|
|
41
|
+
}, {
|
|
42
|
+
label: '萝卜',
|
|
43
|
+
value: 'radish'
|
|
44
|
+
}, {
|
|
45
|
+
label: '土豆',
|
|
46
|
+
value: 'potato'
|
|
47
|
+
}]);
|
|
48
|
+
case 5:
|
|
49
|
+
case "end":
|
|
50
|
+
return _context.stop();
|
|
51
|
+
}
|
|
52
|
+
}, _callee);
|
|
53
|
+
}));
|
|
54
|
+
return function mockRequest(_x, _x2) {
|
|
55
|
+
return _ref.apply(this, arguments);
|
|
56
|
+
};
|
|
57
|
+
}();
|
|
68
58
|
var fields = [{
|
|
69
|
-
valueType: '
|
|
70
|
-
field: '
|
|
71
|
-
label: '
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
valueType: 'select',
|
|
60
|
+
field: 'category',
|
|
61
|
+
label: '商品类别',
|
|
62
|
+
initialValue: 'fruit',
|
|
63
|
+
options: [{
|
|
64
|
+
label: '水果',
|
|
65
|
+
value: 'fruit'
|
|
66
|
+
}, {
|
|
67
|
+
label: '蔬菜',
|
|
68
|
+
value: 'vegetable'
|
|
69
|
+
}]
|
|
75
70
|
}, {
|
|
76
71
|
valueType: 'select',
|
|
77
|
-
field: '
|
|
78
|
-
label: '
|
|
79
|
-
|
|
72
|
+
field: 'product',
|
|
73
|
+
label: '商品(联动更新)',
|
|
74
|
+
tooltip: '类别改变时自动更新选项',
|
|
75
|
+
api: '/products',
|
|
80
76
|
dependenciesV2: [{
|
|
81
|
-
field: '
|
|
77
|
+
field: 'category',
|
|
82
78
|
action: 'updateData'
|
|
79
|
+
}, {
|
|
80
|
+
field: 'category',
|
|
81
|
+
action: 'clear'
|
|
83
82
|
}]
|
|
84
83
|
}, {
|
|
85
84
|
valueType: 'input',
|
|
86
|
-
field: '
|
|
87
|
-
label: '
|
|
85
|
+
field: 'showField',
|
|
86
|
+
label: '条件显示字段',
|
|
87
|
+
tooltip: '仅当类别为"水果"时显示',
|
|
88
88
|
dependenciesV2: [{
|
|
89
|
-
field: '
|
|
89
|
+
field: 'category',
|
|
90
90
|
action: 'show',
|
|
91
91
|
op: 'eq',
|
|
92
|
-
target: '
|
|
92
|
+
target: 'fruit'
|
|
93
93
|
}]
|
|
94
94
|
}, {
|
|
95
95
|
valueType: 'input',
|
|
96
|
-
field: '
|
|
97
|
-
label: '
|
|
96
|
+
field: 'hiddenField',
|
|
97
|
+
label: '条件隐藏字段',
|
|
98
|
+
tooltip: '当类别为空时隐藏',
|
|
98
99
|
dependenciesV2: [{
|
|
99
|
-
field: '
|
|
100
|
+
field: 'category',
|
|
100
101
|
action: 'hidden',
|
|
101
102
|
op: 'empty'
|
|
102
103
|
}]
|
|
103
104
|
}, {
|
|
104
105
|
valueType: 'input',
|
|
105
|
-
field: '
|
|
106
|
-
label: '
|
|
106
|
+
field: 'disabledField',
|
|
107
|
+
label: '条件禁用字段',
|
|
108
|
+
tooltip: '当类别非空时禁用',
|
|
107
109
|
dependenciesV2: [{
|
|
108
|
-
field: '
|
|
109
|
-
action: '
|
|
110
|
-
|
|
111
|
-
field: 'select.select',
|
|
112
|
-
action: 'clear'
|
|
110
|
+
field: 'category',
|
|
111
|
+
action: 'disabled',
|
|
112
|
+
op: 'notEmpty'
|
|
113
113
|
}]
|
|
114
114
|
}, {
|
|
115
115
|
valueType: 'input',
|
|
116
|
-
field: '
|
|
117
|
-
label: '
|
|
116
|
+
field: 'syncField',
|
|
117
|
+
label: '同步值字段',
|
|
118
|
+
tooltip: '类别改变时同步其值',
|
|
118
119
|
dependenciesV2: [{
|
|
119
|
-
field: '
|
|
120
|
+
field: 'category',
|
|
120
121
|
action: 'syncValue'
|
|
121
122
|
}]
|
|
122
123
|
}, {
|
|
123
124
|
valueType: 'input',
|
|
124
|
-
field: '
|
|
125
|
-
label: '
|
|
125
|
+
field: 'clearField',
|
|
126
|
+
label: '清空值字段',
|
|
127
|
+
tooltip: '类别改变时清空此字段',
|
|
128
|
+
initialValue: '初始值',
|
|
126
129
|
dependenciesV2: [{
|
|
127
|
-
field: '
|
|
128
|
-
action: '
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
// { field: 'selectDim.selectDim', action: 'syncValue' },
|
|
132
|
-
]
|
|
130
|
+
field: 'category',
|
|
131
|
+
action: 'clear'
|
|
132
|
+
}]
|
|
133
133
|
}];
|
|
134
|
-
var initialValues = getFieldsDefaultValues(fields);
|
|
135
|
-
// console.log(initialValues);
|
|
136
|
-
|
|
137
134
|
return /*#__PURE__*/_jsx(RexProConfigProvider, {
|
|
138
|
-
value: {
|
|
139
|
-
intl: createIntl({
|
|
140
|
-
locale: 'en-US',
|
|
141
|
-
messages: _objectSpread({}, crush(enUS))
|
|
142
|
-
})
|
|
143
|
-
// apiClient: (api, params) => {
|
|
144
|
-
// return fetch(api, {method: 'post', body: JSON.stringify(params)}).then((res) => ({data: []}));
|
|
145
|
-
// },
|
|
146
|
-
},
|
|
135
|
+
value: {},
|
|
147
136
|
children: /*#__PURE__*/_jsx(ProForm, {
|
|
148
|
-
|
|
137
|
+
layout: "horizontal",
|
|
149
138
|
onFinish: function onFinish(values) {
|
|
150
|
-
console.log(values);
|
|
139
|
+
return console.log(values);
|
|
151
140
|
},
|
|
152
141
|
children: /*#__PURE__*/_jsx(BaseForm, {
|
|
153
142
|
fields: fields,
|
|
154
143
|
itemWidth: "50%",
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
158
|
-
while (1) switch (_context.prev = _context.next) {
|
|
159
|
-
case 0:
|
|
160
|
-
return _context.abrupt("return", api === '/select1' ? s1(params) : s2(params));
|
|
161
|
-
case 1:
|
|
162
|
-
case "end":
|
|
163
|
-
return _context.stop();
|
|
164
|
-
}
|
|
165
|
-
}, _callee);
|
|
166
|
-
}));
|
|
167
|
-
return function (_x, _x2) {
|
|
168
|
-
return _ref.apply(this, arguments);
|
|
169
|
-
};
|
|
170
|
-
}())
|
|
144
|
+
labelWidth: "140px",
|
|
145
|
+
requestOptions: mockRequest
|
|
171
146
|
})
|
|
172
147
|
})
|
|
173
148
|
});
|
|
@@ -2,251 +2,103 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
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
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
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
|
-
import { RexProConfigProvider } from "../../../context";
|
|
6
5
|
import { ProForm } from '@ant-design/pro-components';
|
|
7
|
-
import { BaseForm } from "../../..";
|
|
8
|
-
import {
|
|
6
|
+
import { BaseForm, RexProConfigProvider } from "../../..";
|
|
7
|
+
import { message } from 'antd';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* title: Descriptions 展示模式
|
|
11
|
+
* description: 设置 type="descriptions" 使用 Ant Design Descriptions 组件展示数据,配合 ProForm 可进行表单提交
|
|
12
|
+
*/
|
|
9
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
var options = [{
|
|
11
|
-
label: '总裁办公室',
|
|
12
|
-
value: 'dept_001'
|
|
13
|
-
}, {
|
|
14
|
-
label: '人力资源部',
|
|
15
|
-
value: 'dept_002'
|
|
16
|
-
}, {
|
|
17
|
-
label: '财务部',
|
|
18
|
-
value: 'dept_003'
|
|
19
|
-
}, {
|
|
20
|
-
label: '市场营销部',
|
|
21
|
-
value: 'dept_004'
|
|
22
|
-
}, {
|
|
23
|
-
label: '销售一部',
|
|
24
|
-
value: 'dept_005'
|
|
25
|
-
}, {
|
|
26
|
-
label: '销售二部',
|
|
27
|
-
value: 'dept_006'
|
|
28
|
-
}, {
|
|
29
|
-
label: '销售三部',
|
|
30
|
-
value: 'dept_007'
|
|
31
|
-
}, {
|
|
32
|
-
label: '客户服务部',
|
|
33
|
-
value: 'dept_008'
|
|
34
|
-
}, {
|
|
35
|
-
label: '技术研发部',
|
|
36
|
-
value: 'dept_009'
|
|
37
|
-
}, {
|
|
38
|
-
label: '产品设计部',
|
|
39
|
-
value: 'dept_010'
|
|
40
|
-
}, {
|
|
41
|
-
label: '前端开发组',
|
|
42
|
-
value: 'dept_011'
|
|
43
|
-
}, {
|
|
44
|
-
label: '后端开发组',
|
|
45
|
-
value: 'dept_012'
|
|
46
|
-
}, {
|
|
47
|
-
label: '移动开发组',
|
|
48
|
-
value: 'dept_013'
|
|
49
|
-
}, {
|
|
50
|
-
label: '测试部',
|
|
51
|
-
value: 'dept_014'
|
|
52
|
-
}, {
|
|
53
|
-
label: '运维部',
|
|
54
|
-
value: 'dept_015'
|
|
55
|
-
}, {
|
|
56
|
-
label: '数据分析部',
|
|
57
|
-
value: 'dept_016'
|
|
58
|
-
}, {
|
|
59
|
-
label: '信息安全部',
|
|
60
|
-
value: 'dept_017'
|
|
61
|
-
}, {
|
|
62
|
-
label: '项目管理部',
|
|
63
|
-
value: 'dept_018'
|
|
64
|
-
}, {
|
|
65
|
-
label: '质量管理部',
|
|
66
|
-
value: 'dept_019'
|
|
67
|
-
}, {
|
|
68
|
-
label: '采购部',
|
|
69
|
-
value: 'dept_020'
|
|
70
|
-
}, {
|
|
71
|
-
label: '供应链管理部',
|
|
72
|
-
value: 'dept_021'
|
|
73
|
-
}, {
|
|
74
|
-
label: '仓储物流部',
|
|
75
|
-
value: 'dept_022'
|
|
76
|
-
}, {
|
|
77
|
-
label: '生产制造部',
|
|
78
|
-
value: 'dept_023'
|
|
79
|
-
}, {
|
|
80
|
-
label: '设备管理部',
|
|
81
|
-
value: 'dept_024'
|
|
82
|
-
}, {
|
|
83
|
-
label: '品牌策划部',
|
|
84
|
-
value: 'dept_025'
|
|
85
|
-
}, {
|
|
86
|
-
label: '公共关系部',
|
|
87
|
-
value: 'dept_026'
|
|
88
|
-
}, {
|
|
89
|
-
label: '法务部',
|
|
90
|
-
value: 'dept_027'
|
|
91
|
-
}, {
|
|
92
|
-
label: '审计部',
|
|
93
|
-
value: 'dept_028'
|
|
94
|
-
}, {
|
|
95
|
-
label: '行政部',
|
|
96
|
-
value: 'dept_029'
|
|
97
|
-
}, {
|
|
98
|
-
label: '后勤保障部',
|
|
99
|
-
value: 'dept_030'
|
|
100
|
-
}, {
|
|
101
|
-
label: '国际业务部',
|
|
102
|
-
value: 'dept_031'
|
|
103
|
-
}, {
|
|
104
|
-
label: '华东区分公司',
|
|
105
|
-
value: 'dept_032'
|
|
106
|
-
}, {
|
|
107
|
-
label: '华南区分公司',
|
|
108
|
-
value: 'dept_033'
|
|
109
|
-
}, {
|
|
110
|
-
label: '华北区分公司',
|
|
111
|
-
value: 'dept_034'
|
|
112
|
-
}, {
|
|
113
|
-
label: '西南区分公司',
|
|
114
|
-
value: 'dept_035'
|
|
115
|
-
}, {
|
|
116
|
-
label: '东北区分公司',
|
|
117
|
-
value: 'dept_036'
|
|
118
|
-
}, {
|
|
119
|
-
label: '战略发展部',
|
|
120
|
-
value: 'dept_037'
|
|
121
|
-
}, {
|
|
122
|
-
label: '投资并购部',
|
|
123
|
-
value: 'dept_038'
|
|
124
|
-
}, {
|
|
125
|
-
label: '企业文化部',
|
|
126
|
-
value: 'dept_039'
|
|
127
|
-
}, {
|
|
128
|
-
label: '培训发展部',
|
|
129
|
-
value: 'dept_040'
|
|
130
|
-
}, {
|
|
131
|
-
label: '招聘管理部',
|
|
132
|
-
value: 'dept_041'
|
|
133
|
-
}, {
|
|
134
|
-
label: '薪酬绩效部',
|
|
135
|
-
value: 'dept_042'
|
|
136
|
-
}, {
|
|
137
|
-
label: '员工关系部',
|
|
138
|
-
value: 'dept_043'
|
|
139
|
-
}, {
|
|
140
|
-
label: '电商运营部',
|
|
141
|
-
value: 'dept_044'
|
|
142
|
-
}, {
|
|
143
|
-
label: '新媒体运营部',
|
|
144
|
-
value: 'dept_045'
|
|
145
|
-
}, {
|
|
146
|
-
label: '用户增长部',
|
|
147
|
-
value: 'dept_046'
|
|
148
|
-
}, {
|
|
149
|
-
label: '商务拓展部',
|
|
150
|
-
value: 'dept_047'
|
|
151
|
-
}, {
|
|
152
|
-
label: '渠道管理部',
|
|
153
|
-
value: 'dept_048'
|
|
154
|
-
}, {
|
|
155
|
-
label: '售后服务部',
|
|
156
|
-
value: 'dept_049'
|
|
157
|
-
}, {
|
|
158
|
-
label: '技术支持部',
|
|
159
|
-
value: 'dept_050'
|
|
160
|
-
}];
|
|
161
14
|
export default (function () {
|
|
15
|
+
var fields = [{
|
|
16
|
+
valueType: 'input',
|
|
17
|
+
field: 'name',
|
|
18
|
+
label: '商品名称',
|
|
19
|
+
rules: [{
|
|
20
|
+
required: true
|
|
21
|
+
}],
|
|
22
|
+
initialValue: 'iPhone 15 Pro Max'
|
|
23
|
+
}, {
|
|
24
|
+
valueType: 'input',
|
|
25
|
+
field: 'code',
|
|
26
|
+
label: '商品编号',
|
|
27
|
+
rules: [{
|
|
28
|
+
required: true
|
|
29
|
+
}],
|
|
30
|
+
initialValue: 'SKU-2024-001'
|
|
31
|
+
}, {
|
|
32
|
+
valueType: 'select',
|
|
33
|
+
field: 'category',
|
|
34
|
+
label: '商品类别',
|
|
35
|
+
initialValue: 'electronics',
|
|
36
|
+
options: [{
|
|
37
|
+
label: '电子产品',
|
|
38
|
+
value: 'electronics'
|
|
39
|
+
}, {
|
|
40
|
+
label: '服装',
|
|
41
|
+
value: 'clothing'
|
|
42
|
+
}]
|
|
43
|
+
}, {
|
|
44
|
+
valueType: 'inputNumber',
|
|
45
|
+
field: 'price',
|
|
46
|
+
label: '价格',
|
|
47
|
+
rules: [{
|
|
48
|
+
required: true
|
|
49
|
+
}],
|
|
50
|
+
initialValue: 9999
|
|
51
|
+
}, {
|
|
52
|
+
valueType: 'inputNumber',
|
|
53
|
+
field: 'stock',
|
|
54
|
+
label: '库存',
|
|
55
|
+
initialValue: 100
|
|
56
|
+
}, {
|
|
57
|
+
valueType: 'datePicker',
|
|
58
|
+
field: 'createTime',
|
|
59
|
+
label: '创建时间',
|
|
60
|
+
initialValue: '2024-01-10'
|
|
61
|
+
}, {
|
|
62
|
+
valueType: 'switch',
|
|
63
|
+
field: 'status',
|
|
64
|
+
label: '上架状态',
|
|
65
|
+
initialValue: true
|
|
66
|
+
}, {
|
|
67
|
+
valueType: 'textArea',
|
|
68
|
+
field: 'description',
|
|
69
|
+
label: '商品描述',
|
|
70
|
+
initialValue: '这是一款高端智能手机,配备 A17 Pro 芯片。',
|
|
71
|
+
span: 2
|
|
72
|
+
}];
|
|
162
73
|
return /*#__PURE__*/_jsx(RexProConfigProvider, {
|
|
163
|
-
value: {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}),
|
|
169
|
-
apiClient: function () {
|
|
170
|
-
var _apiClient = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(api, params) {
|
|
171
|
-
var _ref, keyWords, customKey, id, searchValue;
|
|
74
|
+
value: {},
|
|
75
|
+
children: /*#__PURE__*/_jsx(ProForm, {
|
|
76
|
+
layout: "horizontal",
|
|
77
|
+
onFinish: ( /*#__PURE__*/function () {
|
|
78
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
|
|
172
79
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
173
80
|
while (1) switch (_context.prev = _context.next) {
|
|
174
81
|
case 0:
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
method: 'post',
|
|
179
|
-
body: JSON.stringify(params)
|
|
180
|
-
});
|
|
181
|
-
if (!searchValue) {
|
|
182
|
-
_context.next = 5;
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
return _context.abrupt("return", options.filter(function (ii) {
|
|
186
|
-
return ii.label.includes(searchValue) || ii.value.includes(searchValue);
|
|
187
|
-
}));
|
|
188
|
-
case 5:
|
|
189
|
-
if (!id) {
|
|
190
|
-
_context.next = 7;
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
return _context.abrupt("return", options.filter(function (ii) {
|
|
194
|
-
return ii.value === id;
|
|
195
|
-
}));
|
|
196
|
-
case 7:
|
|
197
|
-
return _context.abrupt("return", options.slice(0, 10));
|
|
198
|
-
case 8:
|
|
82
|
+
console.log('提交数据:', values);
|
|
83
|
+
message.success('提交成功');
|
|
84
|
+
case 2:
|
|
199
85
|
case "end":
|
|
200
86
|
return _context.stop();
|
|
201
87
|
}
|
|
202
88
|
}, _callee);
|
|
203
89
|
}));
|
|
204
|
-
function
|
|
205
|
-
return
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
}()
|
|
209
|
-
},
|
|
210
|
-
children: /*#__PURE__*/_jsx(ProForm
|
|
211
|
-
// initialValues={{}}
|
|
212
|
-
, {
|
|
213
|
-
layout: "horizontal",
|
|
214
|
-
onFinish: function onFinish(values) {
|
|
215
|
-
console.log(values);
|
|
216
|
-
},
|
|
90
|
+
return function (_x) {
|
|
91
|
+
return _ref.apply(this, arguments);
|
|
92
|
+
};
|
|
93
|
+
}()),
|
|
217
94
|
children: /*#__PURE__*/_jsx(BaseForm, {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}, {
|
|
226
|
-
valueType: 'selectDim',
|
|
227
|
-
field: 'selectDim2-1',
|
|
228
|
-
label: '[模式 1(apiSearchKey)]只使用 keyWords 作为搜索条件key',
|
|
229
|
-
api: '/options-2-1',
|
|
230
|
-
apiSearchKey: false
|
|
231
|
-
// apiSearchValueKey: '',
|
|
232
|
-
}, {
|
|
233
|
-
valueType: 'selectDim',
|
|
234
|
-
field: 'selectDim2-2',
|
|
235
|
-
label: '[模式 2(apiSearchKey)]使用 customKey, keyWords 作为搜索条件key',
|
|
236
|
-
api: '/options-2-2',
|
|
237
|
-
apiSearchKey: 'customKey'
|
|
238
|
-
// apiSearchValueKey: '',
|
|
239
|
-
}, {
|
|
240
|
-
valueType: 'selectDim',
|
|
241
|
-
field: 'selectDim3',
|
|
242
|
-
label: '用于数据回显, 使用 id 作为搜索条件key',
|
|
243
|
-
api: '/options-3',
|
|
244
|
-
params: {
|
|
245
|
-
otherData: '1231'
|
|
246
|
-
},
|
|
247
|
-
apiSearchValueKey: 'id',
|
|
248
|
-
initialValue: 'dept_044'
|
|
249
|
-
}]
|
|
95
|
+
type: "descriptions",
|
|
96
|
+
fields: fields,
|
|
97
|
+
descriptionsProps: {
|
|
98
|
+
column: 2,
|
|
99
|
+
bordered: true,
|
|
100
|
+
title: '商品详情'
|
|
101
|
+
}
|
|
250
102
|
})
|
|
251
103
|
})
|
|
252
104
|
});
|