@luck-design-biz/luckda 0.0.25-7 → 0.0.25-8
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/es/components/LDActions/index.js +8 -10
- package/es/components/LDActions/index.less +7 -4
- package/es/components/LdAutoForm/index.js +8 -6
- package/es/components/LdFormList/index.js +12 -4
- package/es/components/LdGrid/index.js +11 -5
- package/es/components/LdGridForm/index.js +4 -2
- package/es/components/LdTree/index.js +30 -13
- package/es/helper/form.js +9 -5
- package/es/locales/zh-CN.js +15 -10
- package/es/lowcode/constants/api-url.js +112 -26
- package/es/lowcode/constants/event-topics.js +2 -0
- package/es/lowcode/engine/meta/box.props.json +3 -3
- package/es/lowcode/engine/meta/button.props.json +3 -3
- package/es/lowcode/engine/meta/components-list.json +6 -0
- package/es/lowcode/engine/meta/dialog.props.json +5 -5
- package/es/lowcode/engine/meta/drawer.props.json +8 -20
- package/es/lowcode/engine/meta/form.props.json +13 -7
- package/es/lowcode/engine/meta/imex.props.default.json +8 -1
- package/es/lowcode/engine/meta/imex.props.json +54 -22
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
- package/es/lowcode/engine/meta/layout.props.json +2 -2
- package/es/lowcode/engine/meta/page.props.json +2 -2
- package/es/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/es/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/es/lowcode/engine/meta/section.props.json +2 -2
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +4 -4
- package/es/lowcode/engine/meta/table.props.json +15 -9
- package/es/lowcode/engine/meta/tabs.props.json +3 -3
- package/es/lowcode/engine/meta/tree.props.default.json +1 -0
- package/es/lowcode/engine/meta/tree.props.json +55 -6
- package/es/lowcode/engine/provider/ContextProvider/index.js +12 -3
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +55 -6
- package/es/lowcode/engine/tools/dataProcess.js +4 -0
- package/es/lowcode/engine/tools/usePageDataStore.js +4 -2
- package/es/lowcode/painter/DesignOperator.js +1 -1
- package/es/lowcode/painter/DesignToolbar.js +2 -1
- package/es/lowcode/painter/Panel.js +3 -3
- package/es/lowcode/painter/components/ActionBindModal.js +25 -13
- package/es/lowcode/painter/components/AdvancePanel.js +6 -1
- package/es/lowcode/painter/components/AttrsPanel.js +13 -11
- package/es/lowcode/painter/components/field-setting/CheckFrontRules.js +108 -0
- package/es/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +33 -13
- package/es/lowcode/painter/components/field-setting/SettingUI.js +156 -24
- package/es/lowcode/painter/components/field-setting/index.js +32 -63
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +53 -0
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +6 -9
- package/es/lowcode/painter/panel-section/FieldsSetting.js +53 -12
- package/es/lowcode/painter/panel-section/ImpExp.js +93 -6
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +109 -0
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +95 -0
- package/es/lowcode/painter/panel-section/SplitDisplay.js +25 -110
- package/es/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/es/lowcode/painter/style/action-bind-modal.less +3 -3
- package/es/lowcode/painter/style/page-layout-display.less +28 -0
- package/es/lowcode/painter/style/split-display.less +0 -9
- package/es/lowcode/preview/index.js +4 -2
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/es/lowcode/view/lc-components/Box/meta.json +3 -3
- package/es/lowcode/view/lc-components/Button/index.js +2 -6
- package/es/lowcode/view/lc-components/Button/meta.json +3 -3
- package/es/lowcode/view/lc-components/Dialog/index.js +27 -2
- package/es/lowcode/view/lc-components/Dialog/meta.json +5 -5
- package/es/lowcode/view/lc-components/Drawer/meta.json +8 -20
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
- package/es/lowcode/view/lc-components/Form/index.js +99 -21
- package/es/lowcode/view/lc-components/Form/meta.json +13 -7
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
- package/es/lowcode/view/lc-components/ImEx/index.js +260 -10
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/es/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/es/lowcode/view/lc-components/Page/meta.json +2 -2
- package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +63 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/index.js +32 -0
- package/es/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/es/lowcode/view/lc-components/Section/meta.json +2 -2
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +11 -5
- package/es/lowcode/view/lc-components/Split/index.js +5 -9
- package/es/lowcode/view/lc-components/Split/meta.json +4 -4
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +138 -0
- package/es/lowcode/view/lc-components/Table/index.js +60 -17
- package/es/lowcode/view/lc-components/Table/meta.json +15 -9
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Tabs/index.js +3 -1
- package/es/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
- package/es/lowcode/view/lc-components/Tree/index.js +60 -18
- package/es/lowcode/view/lc-components/Tree/meta.json +55 -7
- package/es/upload/FormItem/index.js +1 -4
- package/lib/components/LDActions/index.js +7 -9
- package/lib/components/LDActions/index.less +7 -4
- package/lib/components/LdAutoForm/index.js +7 -5
- package/lib/components/LdFormList/index.js +11 -3
- package/lib/components/LdGrid/index.js +11 -5
- package/lib/components/LdGridForm/index.js +4 -2
- package/lib/components/LdTree/index.js +30 -13
- package/lib/helper/form.js +8 -4
- package/lib/locales/zh-CN.js +15 -10
- package/lib/lowcode/constants/api-url.js +113 -26
- package/lib/lowcode/constants/event-topics.js +3 -1
- package/lib/lowcode/engine/meta/box.props.json +3 -3
- package/lib/lowcode/engine/meta/button.props.json +3 -3
- package/lib/lowcode/engine/meta/components-list.json +6 -0
- package/lib/lowcode/engine/meta/dialog.props.json +5 -5
- package/lib/lowcode/engine/meta/drawer.props.json +8 -20
- package/lib/lowcode/engine/meta/form.props.json +13 -7
- package/lib/lowcode/engine/meta/imex.props.default.json +8 -1
- package/lib/lowcode/engine/meta/imex.props.json +54 -22
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
- package/lib/lowcode/engine/meta/layout.props.json +2 -2
- package/lib/lowcode/engine/meta/page.props.json +2 -2
- package/lib/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/lib/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/lib/lowcode/engine/meta/section.props.json +2 -2
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +4 -4
- package/lib/lowcode/engine/meta/table.props.json +15 -9
- package/lib/lowcode/engine/meta/tabs.props.json +3 -3
- package/lib/lowcode/engine/meta/tree.props.default.json +1 -0
- package/lib/lowcode/engine/meta/tree.props.json +55 -6
- package/lib/lowcode/engine/provider/ContextProvider/index.js +11 -2
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +54 -5
- package/lib/lowcode/engine/tools/dataProcess.js +4 -0
- package/lib/lowcode/engine/tools/usePageDataStore.js +4 -2
- package/lib/lowcode/painter/DesignOperator.js +1 -1
- package/lib/lowcode/painter/DesignToolbar.js +2 -1
- package/lib/lowcode/painter/Panel.js +3 -3
- package/lib/lowcode/painter/components/ActionBindModal.js +23 -11
- package/lib/lowcode/painter/components/AdvancePanel.js +6 -1
- package/lib/lowcode/painter/components/AttrsPanel.js +12 -10
- package/lib/lowcode/painter/components/field-setting/CheckFrontRules.js +116 -0
- package/lib/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +34 -13
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +153 -21
- package/lib/lowcode/painter/components/field-setting/index.js +32 -63
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +59 -0
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +6 -9
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +53 -12
- package/lib/lowcode/painter/panel-section/ImpExp.js +92 -5
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +115 -0
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +103 -0
- package/lib/lowcode/painter/panel-section/SplitDisplay.js +24 -109
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/lib/lowcode/painter/style/action-bind-modal.less +3 -3
- package/lib/lowcode/painter/style/page-layout-display.less +28 -0
- package/lib/lowcode/painter/style/split-display.less +0 -9
- package/lib/lowcode/preview/index.js +4 -2
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/lib/lowcode/view/lc-components/Box/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Button/index.js +2 -6
- package/lib/lowcode/view/lc-components/Button/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Dialog/index.js +29 -4
- package/lib/lowcode/view/lc-components/Dialog/meta.json +5 -5
- package/lib/lowcode/view/lc-components/Drawer/meta.json +8 -20
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
- package/lib/lowcode/view/lc-components/Form/index.js +96 -18
- package/lib/lowcode/view/lc-components/Form/meta.json +13 -7
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
- package/lib/lowcode/view/lc-components/ImEx/index.js +257 -8
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/lib/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Page/meta.json +2 -2
- package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +71 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/index.js +40 -0
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +12 -6
- package/lib/lowcode/view/lc-components/Split/index.js +2 -6
- package/lib/lowcode/view/lc-components/Split/meta.json +4 -4
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +145 -0
- package/lib/lowcode/view/lc-components/Table/index.js +59 -16
- package/lib/lowcode/view/lc-components/Table/meta.json +15 -9
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +3 -2
- package/lib/lowcode/view/lc-components/Tabs/index.js +3 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +58 -16
- package/lib/lowcode/view/lc-components/Tree/meta.json +55 -7
- package/lib/upload/FormItem/index.js +1 -4
- package/package.json +2 -2
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import React, { useRef, forwardRef, Fragment, useImperativeHandle, useEffect } from 'react';
|
|
4
|
+
import { useMemoizedFn, useCreation, useMount } from 'ahooks';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import { reduce, includes, isNil } from 'lodash';
|
|
6
|
+
import { reduce, includes, isNil, cloneDeep } from 'lodash';
|
|
7
7
|
import { BasicDivider } from 'luck-design';
|
|
8
8
|
import { Collapse } from '@luck-design-biz/base';
|
|
9
|
+
import { formatMessage, getPageQuery } from '@luck-design-biz/base/utils';
|
|
9
10
|
import Wrapper from "../Wrapper";
|
|
10
11
|
import { LdFormList } from "../../../../index";
|
|
11
12
|
import { omitBadProps, executeCode } from "../../../engine/tools/helper";
|
|
@@ -14,6 +15,7 @@ import buildUploadForm from "../../../../upload/Form";
|
|
|
14
15
|
import LdRuntimeCom from "../../../../components/LdRuntimeCom";
|
|
15
16
|
import defaultMeta from "../../../engine/meta/form.props.default.json";
|
|
16
17
|
import styles from "./index.less";
|
|
18
|
+
var _I18N_PREFIX_ = 'lc.form.validator';
|
|
17
19
|
var Header = function Header(_ref) {
|
|
18
20
|
var _ref$header = _ref.header,
|
|
19
21
|
header = _ref$header === void 0 ? 'collapse' : _ref$header,
|
|
@@ -55,6 +57,10 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
55
57
|
var formRef = useRef();
|
|
56
58
|
var ctx = useContext();
|
|
57
59
|
var remoteSource = useRemoteSource();
|
|
60
|
+
var _initData = useCreation(function () {
|
|
61
|
+
return getPageQuery();
|
|
62
|
+
}, []); // 获取主界面传递过来的详情页参数
|
|
63
|
+
|
|
58
64
|
var serials = useCreation(function () {
|
|
59
65
|
var _remoteSource$serials;
|
|
60
66
|
return ((_remoteSource$serials = remoteSource.serials) === null || _remoteSource$serials === void 0 ? void 0 : _remoteSource$serials.map(function (i) {
|
|
@@ -66,21 +72,41 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
66
72
|
instance: (ref || formRef).current
|
|
67
73
|
});
|
|
68
74
|
});
|
|
69
|
-
|
|
70
|
-
ctx
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
useEffect(function () {
|
|
76
|
+
var tid = ctx.$subscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED).on(function (_ref3) {
|
|
77
|
+
var resource = _ref3.resource,
|
|
78
|
+
prevResource = _ref3.prevResource;
|
|
79
|
+
ctx.doAction(advance.events.onPagePublicResourceChanged, {
|
|
80
|
+
resource: resource,
|
|
81
|
+
prevResource: prevResource,
|
|
82
|
+
instance: (ref || formRef).current
|
|
83
|
+
});
|
|
84
|
+
}).watch();
|
|
85
|
+
return function () {
|
|
86
|
+
ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
|
|
87
|
+
ctx.doAction(advance.events.onUnmount, {
|
|
88
|
+
instance: (ref || formRef).current
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
}, []);
|
|
74
92
|
useImperativeHandle(apiRef, function () {
|
|
75
93
|
return {
|
|
76
|
-
|
|
94
|
+
/**
|
|
95
|
+
* 获取表格实例
|
|
96
|
+
* @method
|
|
97
|
+
*/
|
|
98
|
+
getInstance: function getInstance() {
|
|
77
99
|
return (ref || formRef).current;
|
|
78
100
|
},
|
|
101
|
+
/**
|
|
102
|
+
* 提交表格数据
|
|
103
|
+
* @method
|
|
104
|
+
*/
|
|
79
105
|
submit: function submit() {
|
|
80
106
|
var _ctx$pagePublicResour;
|
|
81
107
|
var instance = (ref || formRef).current;
|
|
82
|
-
var
|
|
83
|
-
formMode =
|
|
108
|
+
var _ref4 = ((_ctx$pagePublicResour = ctx.pagePublicResource) === null || _ctx$pagePublicResour === void 0 ? void 0 : _ctx$pagePublicResour[id]) || initData || _initData || {},
|
|
109
|
+
formMode = _ref4.formMode;
|
|
84
110
|
if (formMode === 'add') {
|
|
85
111
|
instance.onAdd();
|
|
86
112
|
} else if (formMode === 'update') {
|
|
@@ -98,11 +124,11 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
98
124
|
};
|
|
99
125
|
return executeCode(ctx, defaultDataSourceFormat, ['defaultValues'], defaultValues);
|
|
100
126
|
});
|
|
101
|
-
var handleDataSourceFormat = useMemoizedFn(function (dataSourceFormat,
|
|
102
|
-
var values =
|
|
103
|
-
submitData =
|
|
104
|
-
if (isNil(dataSourceFormat)) return submitData;
|
|
105
|
-
return executeCode(ctx, dataSourceFormat, ['values', 'submitData'], values, submitData);
|
|
127
|
+
var handleDataSourceFormat = useMemoizedFn(function (dataSourceFormat, dataSetKey, _ref5) {
|
|
128
|
+
var values = _ref5.values,
|
|
129
|
+
submitData = _ref5.submitData;
|
|
130
|
+
if (isNil(dataSourceFormat)) return _defineProperty({}, dataSetKey, submitData);
|
|
131
|
+
return executeCode(ctx, dataSourceFormat, ['dataSetKey', 'values', 'submitData'], dataSetKey, values, submitData);
|
|
106
132
|
});
|
|
107
133
|
var handleResetActionsColumn = useMemoizedFn(function (actionsColumnReset, data, index, actions, params) {
|
|
108
134
|
return executeCode(ctx, actionsColumnReset, ['data', 'index', 'actions', 'params'], data, index, actions, params);
|
|
@@ -132,6 +158,57 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
132
158
|
var renderAffix = useMemoizedFn(function (_render) {
|
|
133
159
|
return _render ? /*#__PURE__*/React.createElement(LdRuntimeCom, null, _render) : null;
|
|
134
160
|
});
|
|
161
|
+
var setVerifyRules = function setVerifyRules(_props, verifyListObj) {
|
|
162
|
+
var _verifyListObj$length, _verifyListObj$min, _verifyListObj$max, _verifyListObj$rules;
|
|
163
|
+
var props = cloneDeep(_props);
|
|
164
|
+
props.config.rules = props.config.rules || [];
|
|
165
|
+
if ((_verifyListObj$length = verifyListObj.length) !== null && _verifyListObj$length !== void 0 && _verifyListObj$length.expression) props.config.rules.push({
|
|
166
|
+
validator: function validator(rule, value, callback) {
|
|
167
|
+
var _current;
|
|
168
|
+
var length = executeCode(ctx, verifyListObj.length.expression, ['cValue'], (_current = (ref || formRef).current) === null || _current === void 0 ? void 0 : _current.getCValue());
|
|
169
|
+
if (value.length > length) callback("".concat(formatMessage({
|
|
170
|
+
id: "".concat(_I18N_PREFIX_, ".maxLength"),
|
|
171
|
+
label: '字数不得超过'
|
|
172
|
+
})).concat(length).concat(formatMessage({
|
|
173
|
+
id: "".concat(_I18N_PREFIX_, ".textNum"),
|
|
174
|
+
label: '个字符'
|
|
175
|
+
})));
|
|
176
|
+
callback();
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
if ((_verifyListObj$min = verifyListObj.min) !== null && _verifyListObj$min !== void 0 && _verifyListObj$min.expression) props.config.rules.push({
|
|
180
|
+
validator: function validator(rule, value, callback) {
|
|
181
|
+
var _current2;
|
|
182
|
+
var min = executeCode(ctx, verifyListObj.min.expression, ['cValue'], (_current2 = (ref || formRef).current) === null || _current2 === void 0 ? void 0 : _current2.getCValue());
|
|
183
|
+
if (value < min) callback(formatMessage({
|
|
184
|
+
id: "".concat(_I18N_PREFIX_, ".numberBelowMin"),
|
|
185
|
+
label: '低于最小值'
|
|
186
|
+
}));
|
|
187
|
+
callback();
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
if ((_verifyListObj$max = verifyListObj.max) !== null && _verifyListObj$max !== void 0 && _verifyListObj$max.expression) props.config.rules.push({
|
|
191
|
+
validator: function validator(rule, value, callback) {
|
|
192
|
+
var _current3;
|
|
193
|
+
var max = executeCode(ctx, verifyListObj.max.expression, ['cValue'], (_current3 = (ref || formRef).current) === null || _current3 === void 0 ? void 0 : _current3.getCValue());
|
|
194
|
+
if (value > max) callback(formatMessage({
|
|
195
|
+
id: "".concat(_I18N_PREFIX_, ".numberExceedMax"),
|
|
196
|
+
label: '超过最大值'
|
|
197
|
+
}));
|
|
198
|
+
callback();
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
if (verifyListObj.email) props.config.type = 'email';
|
|
202
|
+
if (verifyListObj.idcard) props.config.type = 'idcard';
|
|
203
|
+
if (verifyListObj.mobile) props.config.type = 'mobile';
|
|
204
|
+
if ((_verifyListObj$rules = verifyListObj.rules) !== null && _verifyListObj$rules !== void 0 && _verifyListObj$rules.expression) props.config.rules.push({
|
|
205
|
+
validator: function validator(rule, value, callback) {
|
|
206
|
+
var _current4;
|
|
207
|
+
executeCode(ctx, verifyListObj.rules.expression, ['cValue', 'rule', 'value', 'callback'], (_current4 = (ref || formRef).current) === null || _current4 === void 0 ? void 0 : _current4.getCValue(), rule, value, callback);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
return props;
|
|
211
|
+
};
|
|
135
212
|
var renderFormList = useMemoizedFn(function (formConfig) {
|
|
136
213
|
return reduce(blocks, function (result, item) {
|
|
137
214
|
if (includes(['auto', 'grid', 'writer'], item.type) && includes(item.mode, formConfig.formMode)) {
|
|
@@ -152,7 +229,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
152
229
|
},
|
|
153
230
|
onUpdate: {
|
|
154
231
|
post: function post(data) {
|
|
155
|
-
|
|
232
|
+
var _item$dataset2;
|
|
233
|
+
return handleDataSourceFormat(item.dataSourceFormat, (_item$dataset2 = item.dataset) === null || _item$dataset2 === void 0 ? void 0 : _item$dataset2.code, data);
|
|
156
234
|
}
|
|
157
235
|
}
|
|
158
236
|
};
|
|
@@ -250,7 +328,6 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
250
328
|
});
|
|
251
329
|
resolve(_data);
|
|
252
330
|
}
|
|
253
|
-
;
|
|
254
331
|
});
|
|
255
332
|
});
|
|
256
333
|
var afterSubmit = useMemoizedFn(function (success, mainKey, res) {
|
|
@@ -289,7 +366,7 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
289
366
|
renderFormList: renderFormList,
|
|
290
367
|
renderFormExtra: renderFormExtra,
|
|
291
368
|
mainFormLdId: "block_main",
|
|
292
|
-
initData: ((_ctx$pagePublicResour2 = ctx.pagePublicResource) === null || _ctx$pagePublicResour2 === void 0 ? void 0 : _ctx$pagePublicResour2[id]) || initData,
|
|
369
|
+
initData: ((_ctx$pagePublicResour2 = ctx.pagePublicResource) === null || _ctx$pagePublicResour2 === void 0 ? void 0 : _ctx$pagePublicResour2[id]) || initData || _initData,
|
|
293
370
|
ref: ref || formRef,
|
|
294
371
|
readOnly: readOnly,
|
|
295
372
|
showSaveBtn: showSave,
|
|
@@ -304,7 +381,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
304
381
|
beforeSubmit: beforeSubmit,
|
|
305
382
|
afterSubmit: advance.events.onSaveCallback ? afterSubmit : null,
|
|
306
383
|
onValueChange: onValueChange,
|
|
307
|
-
onChildChange: onChildChange
|
|
384
|
+
onChildChange: onChildChange,
|
|
385
|
+
setVerifyRules: setVerifyRules
|
|
308
386
|
})));
|
|
309
387
|
});
|
|
310
388
|
LCForm.defaultProps = omitBadProps(defaultMeta);
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
"name": "格式化数据",
|
|
245
245
|
"desc": "格式化单表提交数据",
|
|
246
246
|
"type": "_JSEditor",
|
|
247
|
-
"defaultCode": "function dataSourceFormat(values, submitData) { \n return submitData; \n}",
|
|
247
|
+
"defaultCode": "function dataSourceFormat(dataSetKey, values, submitData) { \n return { [dataSetKey]: submitData }; \n}",
|
|
248
248
|
"mustConfirm": true,
|
|
249
249
|
"wrapper": "collapse",
|
|
250
250
|
"wrapperProps": { "suppressIcon": true }
|
|
@@ -562,37 +562,43 @@
|
|
|
562
562
|
"key": "onMount",
|
|
563
563
|
"name": "组件首次渲染时",
|
|
564
564
|
"desc": "在组件首次渲染时,执行方法",
|
|
565
|
-
"func": "(instance)
|
|
565
|
+
"func": "function onMount(instance) {\n\t\n}"
|
|
566
566
|
},
|
|
567
567
|
{
|
|
568
568
|
"key": "beforeSave",
|
|
569
569
|
"name": "保存前置事件",
|
|
570
570
|
"desc": "保存前置事件,promise,返回false取消执行",
|
|
571
|
-
"func": "(values, data)
|
|
571
|
+
"func": "function beforeSave(values, data) {\n return values; \n}"
|
|
572
572
|
},
|
|
573
573
|
{
|
|
574
574
|
"key": "onSaveCallback",
|
|
575
575
|
"name": "保存后回调",
|
|
576
576
|
"desc": "保存后回调事件",
|
|
577
|
-
"func": "(success, mainKey, res)
|
|
577
|
+
"func": "function onSaveCallback(success, mainKey, res) {\n\t\n}"
|
|
578
578
|
},
|
|
579
579
|
{
|
|
580
580
|
"key": "onUnmount",
|
|
581
581
|
"name": "组件卸载时",
|
|
582
582
|
"desc": "在组件卸载时,执行方法",
|
|
583
|
-
"func": "(instance)
|
|
583
|
+
"func": "function onUnmount(instance) {\n\t\n}"
|
|
584
584
|
},
|
|
585
585
|
{
|
|
586
586
|
"key": "onValueChange",
|
|
587
587
|
"name": "参数变化的事件",
|
|
588
588
|
"desc": "参数变化时,执行方法",
|
|
589
|
-
"func": "(change, data)
|
|
589
|
+
"func": "function onValueChange(change, data) {\n\t\n}"
|
|
590
590
|
},
|
|
591
591
|
{
|
|
592
592
|
"key": "onChildChange",
|
|
593
593
|
"name": "表单内容发生改变时的回调",
|
|
594
594
|
"desc": "表单内容发生改变时的回调",
|
|
595
|
-
"func": "(instance)
|
|
595
|
+
"func": "function onChildChange(instance) {\n\t\n}"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"key": "onPagePublicResourceChanged",
|
|
599
|
+
"name": "页面共享资源变化后",
|
|
600
|
+
"desc": "当页面共享资源发生变化后(pagePublicResourceChanged),执行方法",
|
|
601
|
+
"func": "function onPagePublicResourceChanged(resource, instance) {\n\t\n}"
|
|
596
602
|
}
|
|
597
603
|
]
|
|
598
604
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["
|
|
3
|
+
var _excluded = ["className"];
|
|
3
4
|
import React from 'react';
|
|
5
|
+
import { useMemoizedFn } from 'ahooks';
|
|
4
6
|
import Index from "./index";
|
|
5
7
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
6
|
-
var
|
|
8
|
+
var className = _ref.className,
|
|
7
9
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
8
|
-
|
|
10
|
+
var handleClick = useMemoizedFn(function () {});
|
|
11
|
+
return /*#__PURE__*/React.createElement(Index, _extends({
|
|
12
|
+
onClick: handleClick
|
|
13
|
+
}, props));
|
|
9
14
|
};
|
|
10
15
|
export default FunctionDesign;
|
|
@@ -1,21 +1,271 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
5
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
6
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
1
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["id"];
|
|
3
|
-
import React, { useRef } from 'react';
|
|
4
|
-
import
|
|
8
|
+
var _excluded = ["id", "title", "type", "size", "iconFont", "block", "ghost", "css", "className", "onClick", "advance", "impexpSetting"];
|
|
9
|
+
import React, { useRef, useState, useEffect } from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
import { useMemoizedFn, useMount, useUnmount, useRequest } from 'ahooks';
|
|
12
|
+
import { notification, Icon as IconAntd, Upload, Button as ButtonAntd, Progress } from 'luck-design/antd';
|
|
13
|
+
import styled from 'styled-components';
|
|
14
|
+
import classNames from 'classnames';
|
|
15
|
+
import styles from "./index.less";
|
|
16
|
+
import { useRemoteSource } from "../../../engine/provider/ContextProvider";
|
|
5
17
|
import Wrapper from "../Wrapper";
|
|
6
|
-
|
|
18
|
+
import { LdButton as Button } from "../../../../components/LdCom";
|
|
19
|
+
import Icon from "../../../../components/IconFont";
|
|
20
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
21
|
+
import { omitBadProps } from "../../../engine/tools/helper";
|
|
22
|
+
import { exportExcel, readExportExcelState } from "../../../constants/api-url";
|
|
23
|
+
import defaultMeta from "../../../engine/meta/imex.props.default.json";
|
|
24
|
+
import { isUrl } from '@luck-design-biz/base/utils';
|
|
25
|
+
var StyledButton = styled(Button).withConfig({
|
|
26
|
+
displayName: "StyledButton",
|
|
27
|
+
componentId: "luckda-6530__sc-mil6cj-0"
|
|
28
|
+
})(["", ""], function (props) {
|
|
29
|
+
return props.$css;
|
|
30
|
+
});
|
|
31
|
+
var LCButton = function LCButton(_ref) {
|
|
7
32
|
var id = _ref.id,
|
|
8
|
-
|
|
33
|
+
title = _ref.title,
|
|
34
|
+
type = _ref.type,
|
|
35
|
+
size = _ref.size,
|
|
36
|
+
iconFont = _ref.iconFont,
|
|
37
|
+
block = _ref.block,
|
|
38
|
+
ghost = _ref.ghost,
|
|
39
|
+
css = _ref.css,
|
|
40
|
+
className = _ref.className,
|
|
41
|
+
onClick = _ref.onClick,
|
|
42
|
+
advance = _ref.advance,
|
|
43
|
+
impexpSetting = _ref.impexpSetting,
|
|
44
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
9
45
|
var ref = useRef();
|
|
46
|
+
var uploadRef = useRef();
|
|
47
|
+
var _useRemoteSource = useRemoteSource(),
|
|
48
|
+
module = _useRemoteSource.module,
|
|
49
|
+
moduleCode = _useRemoteSource.moduleCode;
|
|
50
|
+
var _useState = useState(false),
|
|
51
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
+
uploadLoading = _useState2[0],
|
|
53
|
+
setUploadLoading = _useState2[1];
|
|
54
|
+
var _useRequest = useRequest(exportExcel, {
|
|
55
|
+
manual: true
|
|
56
|
+
}),
|
|
57
|
+
_loading = _useRequest.loading,
|
|
58
|
+
runAsync = _useRequest.runAsync,
|
|
59
|
+
data = _useRequest.data;
|
|
60
|
+
var fecthExcelState = function fecthExcelState(payload, procress, resolve, reject) {
|
|
61
|
+
// 查询进度
|
|
62
|
+
readExportExcelState(payload).then(function (ret) {
|
|
63
|
+
var cpage = ret.cpage,
|
|
64
|
+
total = ret.total,
|
|
65
|
+
downloadUrl = ret.downloadUrl;
|
|
66
|
+
if (cpage >= total) {
|
|
67
|
+
resolve("".concat(window.location.origin, "/api").concat(downloadUrl));
|
|
68
|
+
} else {
|
|
69
|
+
procress(cpage / total * 100);
|
|
70
|
+
fecthExcelState(payload, procress, resolve, reject);
|
|
71
|
+
}
|
|
72
|
+
}).catch(function () {
|
|
73
|
+
reject();
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
var handleExportAll = function handleExportAll(procress) {
|
|
77
|
+
return new Promise( /*#__PURE__*/function () {
|
|
78
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {
|
|
79
|
+
var joiner, payload;
|
|
80
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
81
|
+
while (1) switch (_context.prev = _context.next) {
|
|
82
|
+
case 0:
|
|
83
|
+
joiner = 'apiUrl'.indexOf('?') !== -1 ? '&' : '?';
|
|
84
|
+
_context.next = 3;
|
|
85
|
+
return runAsync({
|
|
86
|
+
apiUrl: "apiurl".concat(joiner, "token=").concat(window.cookie.get(window.appConfig.authSaveKey)),
|
|
87
|
+
code: impexpSetting.customParam
|
|
88
|
+
});
|
|
89
|
+
case 3:
|
|
90
|
+
payload = _context.sent;
|
|
91
|
+
if (payload && typeof payload === 'string') {
|
|
92
|
+
fecthExcelState(payload, procress, resolve, reject);
|
|
93
|
+
} else {
|
|
94
|
+
reject();
|
|
95
|
+
}
|
|
96
|
+
case 5:
|
|
97
|
+
case "end":
|
|
98
|
+
return _context.stop();
|
|
99
|
+
}
|
|
100
|
+
}, _callee);
|
|
101
|
+
}));
|
|
102
|
+
return function (_x, _x2) {
|
|
103
|
+
return _ref2.apply(this, arguments);
|
|
104
|
+
};
|
|
105
|
+
}());
|
|
106
|
+
};
|
|
107
|
+
var doExportAll = function doExportAll(onExportAll) {
|
|
108
|
+
var key = 'exportAll';
|
|
109
|
+
var notificationConfig = {
|
|
110
|
+
key: key,
|
|
111
|
+
duration: null,
|
|
112
|
+
message: '正在导出数据...',
|
|
113
|
+
placement: 'bottomRight',
|
|
114
|
+
closeIcon: /*#__PURE__*/React.createElement("div", null),
|
|
115
|
+
icon: /*#__PURE__*/React.createElement(IconAntd, {
|
|
116
|
+
type: "cloud-download",
|
|
117
|
+
className: styles.exportTheme
|
|
118
|
+
})
|
|
119
|
+
};
|
|
120
|
+
var process = function process(i) {
|
|
121
|
+
notification.open(_objectSpread(_objectSpread({}, notificationConfig), {}, {
|
|
122
|
+
description: /*#__PURE__*/React.createElement(Progress, {
|
|
123
|
+
percent: i
|
|
124
|
+
})
|
|
125
|
+
}));
|
|
126
|
+
};
|
|
127
|
+
notification.open(_objectSpread(_objectSpread({}, notificationConfig), {}, {
|
|
128
|
+
description: /*#__PURE__*/React.createElement(Progress, {
|
|
129
|
+
percent: 0
|
|
130
|
+
})
|
|
131
|
+
}));
|
|
132
|
+
onExportAll(process).then(function (ret) {
|
|
133
|
+
if (ret) {
|
|
134
|
+
window.location.href = ret;
|
|
135
|
+
}
|
|
136
|
+
notification.close(key);
|
|
137
|
+
}).catch(function () {
|
|
138
|
+
return notification.open(_objectSpread(_objectSpread({}, notificationConfig), {}, {
|
|
139
|
+
icon: /*#__PURE__*/React.createElement(IconAntd, {
|
|
140
|
+
type: "cloud-download",
|
|
141
|
+
className: styles.exportErrorTheme
|
|
142
|
+
}),
|
|
143
|
+
message: '导出失败',
|
|
144
|
+
duration: 4
|
|
145
|
+
}));
|
|
146
|
+
});
|
|
147
|
+
};
|
|
10
148
|
var getTargetDom = useMemoizedFn(function () {
|
|
11
|
-
|
|
149
|
+
var _ref$current;
|
|
150
|
+
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.buttonNode;
|
|
12
151
|
});
|
|
152
|
+
var getActionUrl = function getActionUrl() {
|
|
153
|
+
var caturl = impexpSetting.customType ? "selectKey=".concat(impexpSetting.customParam) : "inputKey=".concat(impexpSetting.customParam);
|
|
154
|
+
return caturl;
|
|
155
|
+
};
|
|
156
|
+
var formItemProps = {
|
|
157
|
+
action: getActionUrl(),
|
|
158
|
+
// 上传地址
|
|
159
|
+
headers: {
|
|
160
|
+
Authorization: "Bearer ".concat(window.cookie.get(window.appConfig.authSaveKey))
|
|
161
|
+
},
|
|
162
|
+
name: 'files',
|
|
163
|
+
showUploadList: false,
|
|
164
|
+
beforeUpload: function beforeUpload(file, fileList) {
|
|
165
|
+
setUploadLoading(true);
|
|
166
|
+
return file;
|
|
167
|
+
},
|
|
168
|
+
onChange: function onChange(e) {
|
|
169
|
+
setUploadLoading(false);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
var handleClick = useMemoizedFn( /*#__PURE__*/function () {
|
|
173
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
174
|
+
var _uploadRef$current;
|
|
175
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
176
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
177
|
+
case 0:
|
|
178
|
+
if (!onClick) {
|
|
179
|
+
_context2.next = 3;
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
onClick(e);
|
|
183
|
+
return _context2.abrupt("return");
|
|
184
|
+
case 3:
|
|
185
|
+
if (impexpSetting.type === 'export') {
|
|
186
|
+
doExportAll(handleExportAll);
|
|
187
|
+
} else {
|
|
188
|
+
if (uploadRef.current) {
|
|
189
|
+
(_uploadRef$current = uploadRef.current) === null || _uploadRef$current === void 0 || (_uploadRef$current = _uploadRef$current.upload) === null || _uploadRef$current === void 0 || (_uploadRef$current = _uploadRef$current.uploader) === null || _uploadRef$current === void 0 || _uploadRef$current.onClick();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
case 4:
|
|
193
|
+
case "end":
|
|
194
|
+
return _context2.stop();
|
|
195
|
+
}
|
|
196
|
+
}, _callee2);
|
|
197
|
+
}));
|
|
198
|
+
return function (_x3) {
|
|
199
|
+
return _ref3.apply(this, arguments);
|
|
200
|
+
};
|
|
201
|
+
}());
|
|
202
|
+
// console.log(formItemProps, module, moduleCode)
|
|
203
|
+
|
|
13
204
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
14
205
|
id: id,
|
|
15
|
-
displayName: "
|
|
206
|
+
displayName: "Imex",
|
|
16
207
|
getTargetDom: getTargetDom
|
|
208
|
+
}, /*#__PURE__*/React.createElement(StyledButton, {
|
|
209
|
+
ref: ref,
|
|
210
|
+
type: type,
|
|
211
|
+
size: size,
|
|
212
|
+
block: block,
|
|
213
|
+
ghost: ghost,
|
|
214
|
+
$css: css,
|
|
215
|
+
className: classNames(_defineProperty({}, className, !!className)),
|
|
216
|
+
onClick: handleClick,
|
|
217
|
+
loading: !!_loading || !!uploadLoading
|
|
17
218
|
}, /*#__PURE__*/React.createElement("div", {
|
|
18
|
-
|
|
19
|
-
|
|
219
|
+
style: {
|
|
220
|
+
display: 'none'
|
|
221
|
+
}
|
|
222
|
+
}, /*#__PURE__*/React.createElement(Upload, _extends({}, formItemProps, {
|
|
223
|
+
ref: uploadRef
|
|
224
|
+
}))), iconFont ? /*#__PURE__*/React.createElement(Icon, {
|
|
225
|
+
type: iconFont
|
|
226
|
+
}) : null, title || formatMessage({
|
|
227
|
+
id: 'luckda.lowcode.painter.import',
|
|
228
|
+
label: '导入'
|
|
229
|
+
})));
|
|
20
230
|
};
|
|
21
|
-
|
|
231
|
+
LCButton.propTypes = {
|
|
232
|
+
/**
|
|
233
|
+
* @name 唯一标识
|
|
234
|
+
* @type string
|
|
235
|
+
* @disabled true
|
|
236
|
+
*/
|
|
237
|
+
id: PropTypes.string.isRequired,
|
|
238
|
+
/**
|
|
239
|
+
* @name 按钮标题
|
|
240
|
+
* @type string
|
|
241
|
+
* @default 12:3:9
|
|
242
|
+
*/
|
|
243
|
+
title: PropTypes.string,
|
|
244
|
+
/**
|
|
245
|
+
* @name 按钮类型
|
|
246
|
+
* @type _ButtonType
|
|
247
|
+
* @default 'default'
|
|
248
|
+
*/
|
|
249
|
+
type: PropTypes.oneOf(['default', 'primary', 'dashed', 'danger']),
|
|
250
|
+
/**
|
|
251
|
+
* @name impexpSetting
|
|
252
|
+
* @type _ImpExpAlone
|
|
253
|
+
* @default { "customType": false, "customParam": false, "type": "export" }
|
|
254
|
+
*/
|
|
255
|
+
impexpSetting: PropTypes.object,
|
|
256
|
+
/**
|
|
257
|
+
* @name 按钮大小
|
|
258
|
+
* @type segmented
|
|
259
|
+
* @options [{ "label": "小", "value": "small"}, { "label": "中", "value": "middle" }, { "label": "大", "value": "large" }]
|
|
260
|
+
* @default 'default'
|
|
261
|
+
*/
|
|
262
|
+
size: PropTypes.oneOf(['small', 'default', 'large']),
|
|
263
|
+
/**
|
|
264
|
+
* @name 将按钮宽度调整为其父宽度的选项
|
|
265
|
+
* @type boolean
|
|
266
|
+
* @default false
|
|
267
|
+
*/
|
|
268
|
+
block: PropTypes.bool
|
|
269
|
+
};
|
|
270
|
+
LCButton.defaultProps = omitBadProps(defaultMeta);
|
|
271
|
+
export default LCButton;
|
|
@@ -14,40 +14,72 @@
|
|
|
14
14
|
"disabled": true
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"key": "
|
|
18
|
-
"name": "
|
|
19
|
-
"desc": "
|
|
20
|
-
"type": "
|
|
17
|
+
"key": "title",
|
|
18
|
+
"name": "标题",
|
|
19
|
+
"desc": "按钮上显示的文字",
|
|
20
|
+
"type": "_I18nInput",
|
|
21
|
+
"default": "导入|导出"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"key": "impexpSetting",
|
|
25
|
+
"type": "_ImpExpAlone",
|
|
26
|
+
"default": {
|
|
27
|
+
"customType": false,
|
|
28
|
+
"customParam": false,
|
|
29
|
+
"type": "export"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"key": "size",
|
|
34
|
+
"name": "按钮",
|
|
35
|
+
"type": "segmented",
|
|
36
|
+
"repositioning": true,
|
|
21
37
|
"options": [
|
|
22
38
|
{
|
|
23
|
-
"label": "
|
|
24
|
-
"value": "
|
|
39
|
+
"label": "小",
|
|
40
|
+
"value": "small"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"label": "中",
|
|
44
|
+
"value": "middle"
|
|
25
45
|
},
|
|
26
46
|
{
|
|
27
|
-
"label": "
|
|
28
|
-
"value": "
|
|
47
|
+
"label": "大",
|
|
48
|
+
"value": "large"
|
|
29
49
|
}
|
|
30
50
|
],
|
|
31
|
-
"default": "
|
|
51
|
+
"default": "middle"
|
|
32
52
|
},
|
|
33
53
|
{
|
|
34
|
-
"key": "
|
|
35
|
-
"name": "
|
|
36
|
-
"desc": "
|
|
37
|
-
"type": "
|
|
38
|
-
"
|
|
54
|
+
"key": "block",
|
|
55
|
+
"name": "块级",
|
|
56
|
+
"desc": "将按钮宽度调整为其父宽度的选项",
|
|
57
|
+
"type": "switch",
|
|
58
|
+
"repositioning": true,
|
|
59
|
+
"default": false
|
|
39
60
|
},
|
|
40
61
|
{
|
|
41
|
-
"key": "
|
|
42
|
-
"name": "
|
|
43
|
-
"
|
|
44
|
-
"
|
|
62
|
+
"key": "type",
|
|
63
|
+
"name": "按钮类型",
|
|
64
|
+
"type": "_ButtonType",
|
|
65
|
+
"default": "primary"
|
|
45
66
|
},
|
|
46
67
|
{
|
|
47
|
-
"key": "
|
|
48
|
-
"name": "
|
|
49
|
-
"
|
|
50
|
-
"
|
|
68
|
+
"key": "iconFont",
|
|
69
|
+
"name": "图标",
|
|
70
|
+
"type": "_Icon",
|
|
71
|
+
"next": {
|
|
72
|
+
"name": "选择图标",
|
|
73
|
+
"autoClose": true,
|
|
74
|
+
"props": [
|
|
75
|
+
{
|
|
76
|
+
"key": "iconFont",
|
|
77
|
+
"name": "#图标选择器",
|
|
78
|
+
"type": "_IconSelector"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"repositioning": true
|
|
51
83
|
}
|
|
52
84
|
],
|
|
53
85
|
"css": {},
|
|
@@ -79,4 +111,4 @@
|
|
|
79
111
|
}
|
|
80
112
|
]
|
|
81
113
|
}
|
|
82
|
-
}
|
|
114
|
+
}
|