@luck-design-biz/luckda 0.0.21 → 0.0.22-2
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/README.md +21 -30
- package/es/components/Builder/index.js +3 -3
- package/es/components/LdAutoForm/index.js +7 -9
- package/es/components/LdCard/index.js +6 -7
- package/es/components/LdCard/model.js +1 -1
- package/es/components/LdCom/index.js +3 -3
- package/es/components/LdFormList/index.js +15 -16
- package/es/components/LdGrid/index.js +7 -8
- package/es/components/LdGrid/model.js +1 -1
- package/es/components/LdGridForm/index.js +10 -10
- package/es/components/LdInfoPanel/index.js +2 -2
- package/es/components/LdTree/index.js +4 -5
- package/es/helper/FromItems.js +1 -1
- package/es/helper/action.js +3 -3
- package/es/helper/form.js +2 -2
- package/es/helper/ldBuilder.js +1 -1
- package/es/helper/ldComBuild.js +4 -4
- package/es/index.js +9 -9
- package/es/services.js +1 -1
- package/es/upload/Form/gridForm.js +20 -15
- package/es/upload/Form/index.js +3 -2
- package/es/upload/FormItem/index.js +0 -0
- package/es/upload/GridCell/index.js +1 -1
- package/es/upload/index.js +3 -3
- package/es/utils/action.js +1 -1
- package/es/utils/form.js +4 -4
- package/es/utils/grid.js +24 -26
- package/es/utils/index.js +3 -3
- package/lib/components/Builder/index.js +2 -4
- package/lib/components/LdAutoForm/index.js +5 -8
- package/lib/components/LdCard/index.js +6 -8
- package/lib/components/LdCom/index.js +7 -12
- package/lib/components/LdFormList/index.js +10 -12
- package/lib/components/LdGrid/index.js +6 -8
- package/lib/components/LdGridForm/index.js +6 -7
- package/lib/components/LdInfoPanel/index.js +2 -3
- package/lib/components/LdPop/index.js +2 -4
- package/lib/components/LdTree/index.js +3 -5
- package/lib/helper/FromItems.js +15 -29
- package/lib/helper/action.js +4 -6
- package/lib/helper/form.js +4 -6
- package/lib/helper/ldBuilder.js +1 -2
- package/lib/helper/ldComBuild.js +7 -11
- package/lib/services.js +1 -1
- package/lib/upload/Form/gridForm.js +21 -17
- package/lib/upload/Form/index.js +3 -3
- package/lib/upload/FormItem/index.js +1 -2
- package/lib/upload/GridCell/index.js +2 -3
- package/lib/utils/form.js +5 -8
- package/lib/utils/grid.js +26 -29
- package/package.json +96 -23
- package/README.zh-CN.md +0 -51
package/README.md
CHANGED
|
@@ -1,49 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
luck业务组件库
|
|
3
|
-
---### 安装依赖
|
|
1
|
+
# 微服务 3.0 纯净版
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
npm install
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
### 编译
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm run build
|
|
13
|
-
```
|
|
3
|
+
luck-react-pure 是一个基于 qiankun 框架搭建的极简微服务框架,作为微服务业务子系统的开发基座。旨在为业务子系统提供简单、轻量的解决方案。该框架去除了冗余的功能,专注于提供基本的功能支持,使开发者能够更快速地搭建和开发业务子系统。
|
|
14
4
|
|
|
15
|
-
|
|
5
|
+
## 启动
|
|
16
6
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
首先需要全局安装 yalc
|
|
7
|
+
安装 `node_modules`:
|
|
20
8
|
|
|
21
9
|
```bash
|
|
22
|
-
|
|
10
|
+
pnpm install
|
|
23
11
|
```
|
|
24
12
|
|
|
25
|
-
|
|
13
|
+
## 开始项目
|
|
26
14
|
|
|
27
15
|
```bash
|
|
28
|
-
|
|
16
|
+
pnpm start
|
|
29
17
|
```
|
|
30
18
|
|
|
31
|
-
|
|
19
|
+
## 代码校验
|
|
32
20
|
|
|
33
|
-
|
|
34
|
-
yalc link @luck-design-biz/luckda
|
|
35
|
-
```
|
|
21
|
+
本框架提供了代码校验方案,校验不通过禁止提交代码,当提交代码时将会校验以下内容:
|
|
36
22
|
|
|
37
|
-
###
|
|
23
|
+
### 代码规范
|
|
38
24
|
|
|
39
|
-
|
|
25
|
+
根据 eslint 校验规范。
|
|
40
26
|
|
|
41
|
-
|
|
42
|
-
npm login
|
|
43
|
-
```
|
|
27
|
+
### commit message 校验
|
|
44
28
|
|
|
45
|
-
|
|
29
|
+
commit message 格式:
|
|
46
30
|
|
|
47
31
|
```bash
|
|
48
|
-
|
|
32
|
+
💥 feat(模块): 添加了个很棒的功能
|
|
33
|
+
🐛 fix(模块): 修复了一些 bug
|
|
34
|
+
📝 docs(模块): 更新了一下文档
|
|
35
|
+
💄 UI(模块): 修改了一下样式
|
|
36
|
+
🎨 chore(模块): 对脚手架做了些更改
|
|
37
|
+
🚨 refactor(模块): 重构(即不是新增功能,也不是修改bug的代码变动)
|
|
38
|
+
🐞 test(模块): 增加、修改测试用例
|
|
39
|
+
🌟 release(3.0.1):url
|
|
49
40
|
```
|
|
@@ -5,9 +5,9 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
5
5
|
import React, { createContext, useState, useRef } from 'react';
|
|
6
6
|
import { useRequest, useSetState, useMemoizedFn } from 'ahooks';
|
|
7
7
|
import { BasicForm, BasicFormItem } from 'luck-design';
|
|
8
|
-
import LdPop from
|
|
9
|
-
import { readModlue } from
|
|
10
|
-
import { doAction as doActionUtils } from
|
|
8
|
+
import LdPop from "../LdPop";
|
|
9
|
+
import { readModlue } from "../../services";
|
|
10
|
+
import { doAction as doActionUtils } from "../../helper/action";
|
|
11
11
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
12
12
|
var LuckDaContext = /*#__PURE__*/createContext();
|
|
13
13
|
var builder = function builder(WrappedComponent, moduleCode) {
|
|
@@ -6,9 +6,9 @@ var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSet
|
|
|
6
6
|
import React, { createRef, useContext } from 'react';
|
|
7
7
|
import { transform } from 'lodash';
|
|
8
8
|
import { AutoForm } from '@luck-design-biz/base/FormList';
|
|
9
|
-
import ldBuilder from
|
|
10
|
-
import { getFormItem, formItemDataFormat, dataFormat, behaviorCall } from
|
|
11
|
-
import { LuckDaContext } from
|
|
9
|
+
import ldBuilder from "../../helper/ldBuilder";
|
|
10
|
+
import { getFormItem, formItemDataFormat, dataFormat, behaviorCall } from "../../utils";
|
|
11
|
+
import { LuckDaContext } from "../Builder";
|
|
12
12
|
var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
13
13
|
var _ref$columns = _ref.columns,
|
|
14
14
|
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
@@ -50,11 +50,10 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
50
50
|
var _defaultValues = {};
|
|
51
51
|
var _nodes = transform(columns, function (result, col) {
|
|
52
52
|
if (col.isShowInForm) {
|
|
53
|
-
var _objectSpread2;
|
|
54
53
|
var customFiled = filedsRewrite.find(function (field) {
|
|
55
54
|
return field.name === col.aliaName;
|
|
56
55
|
}) || {};
|
|
57
|
-
_defaultValues = _objectSpread(_objectSpread({}, _defaultValues), {}, (
|
|
56
|
+
_defaultValues = _objectSpread(_objectSpread({}, _defaultValues), {}, _defineProperty(_defineProperty({}, col.aliaName, col['optDefaultValue']), "".concat(col.aliaName, "_virtual"), col['optDefaultValueCvt']));
|
|
58
57
|
result.push(getFormItem(col, _objectSpread(_objectSpread({
|
|
59
58
|
formId: ldId,
|
|
60
59
|
moduleCode: moduleCode
|
|
@@ -101,7 +100,7 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
101
100
|
var values = _ref3.values,
|
|
102
101
|
submitData = _ref3.submitData;
|
|
103
102
|
var _submitData = dataFormat(columns, submitData);
|
|
104
|
-
if (_onOperate
|
|
103
|
+
if (_onOperate !== null && _onOperate !== void 0 && _onOperate.post) return _onOperate.post({
|
|
105
104
|
values: values,
|
|
106
105
|
submitData: _submitData
|
|
107
106
|
}); // 以预设为主
|
|
@@ -113,16 +112,15 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
113
112
|
onQuery: _objectSpread(_objectSpread({
|
|
114
113
|
api: behaviorCall,
|
|
115
114
|
get: function get(formData) {
|
|
116
|
-
var _params2;
|
|
117
115
|
var _relationKey = isMain ? window.appConfig.constraintKeys.PRIMARY : relationKey;
|
|
118
|
-
var _params = (
|
|
116
|
+
var _params = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, isMain ? 'indocno' : 'relationId', formData[mainFormLdId] && formData[mainFormLdId][_relationKey] || ticketData[_relationKey]), "moduleCode", moduleCode), "datasetCode", dataSetKey), "behaviorKey", isMain ? 'readForm' : 'readUniqueForm');
|
|
119
117
|
if (!isMain) _params.relationDs = mainDataSetKey;
|
|
120
118
|
return _params;
|
|
121
119
|
}
|
|
122
120
|
}, onQuery), {}, {
|
|
123
121
|
format: function format(data, res) {
|
|
124
122
|
var formItemData = _objectSpread({}, formItemDataFormat(columns, data));
|
|
125
|
-
if (onQuery
|
|
123
|
+
if (onQuery !== null && onQuery !== void 0 && onQuery.format) return onQuery.format(data, formItemData, res); // 以预设为主
|
|
126
124
|
return formItemData;
|
|
127
125
|
}
|
|
128
126
|
})
|
|
@@ -7,12 +7,12 @@ var _excluded = ["columns", "resources", "actions", "doAction", "afterInit", "na
|
|
|
7
7
|
import React, { forwardRef, useImperativeHandle, useRef, useEffect } from 'react';
|
|
8
8
|
import { getDvaApp } from 'umi';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import { Icon, Tooltip } from 'antd';
|
|
10
|
+
import { Icon, Tooltip } from 'luck-design/antd';
|
|
11
11
|
import { ResultSet, PermissionUtil } from 'luck-design';
|
|
12
12
|
import { includes, difference } from 'lodash';
|
|
13
13
|
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
14
|
-
import createModel from
|
|
15
|
-
import ldBuilder from
|
|
14
|
+
import createModel from "./model";
|
|
15
|
+
import ldBuilder from "../../helper/ldBuilder";
|
|
16
16
|
import { CardList, Card } from '@luck-design-biz/base/List';
|
|
17
17
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
18
18
|
import { build } from '@luck-design-biz/base/Component';
|
|
@@ -135,10 +135,10 @@ var LdIndex = function LdIndex(_ref2) {
|
|
|
135
135
|
});
|
|
136
136
|
var Component = useCreation(function () {
|
|
137
137
|
var _getDvaApp, _getDvaApp2;
|
|
138
|
-
(_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0
|
|
139
|
-
if (!((_getDvaApp2 = getDvaApp())
|
|
138
|
+
(_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 || _getDvaApp.unmodel(namespace);
|
|
139
|
+
if (!((_getDvaApp2 = getDvaApp()) !== null && _getDvaApp2 !== void 0 && _getDvaApp2._store.getState()[namespace])) {
|
|
140
140
|
var _getDvaApp3;
|
|
141
|
-
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0
|
|
141
|
+
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0 || _getDvaApp3.model(createModel(namespace, _objectSpread(_objectSpread({
|
|
142
142
|
isFlow: !!props.isFlow
|
|
143
143
|
}, overModel), {}, {
|
|
144
144
|
dataSetKey: props.dataSetKey,
|
|
@@ -178,7 +178,6 @@ Index.propTypes = {
|
|
|
178
178
|
// 卡片行为
|
|
179
179
|
cardKey: PropTypes.string // 卡片主键
|
|
180
180
|
};
|
|
181
|
-
|
|
182
181
|
Index.defaultProps = {
|
|
183
182
|
resultSet: {},
|
|
184
183
|
suppressInit: false,
|
|
@@ -2,7 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["readAll", "moduleCode", "dataSetKey", "afterQuery"];
|
|
4
4
|
import { createListModel } from '@luck-design-biz/base/utils/modelHelper';
|
|
5
|
-
import { behaviorCall } from
|
|
5
|
+
import { behaviorCall } from "../../utils";
|
|
6
6
|
export default function (namespace) {
|
|
7
7
|
var modelProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8
8
|
var _readAll = modelProps.readAll,
|
|
@@ -2,9 +2,9 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["options"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { Button, Tabs } from 'antd';
|
|
5
|
+
import { Button, Tabs } from 'luck-design/antd';
|
|
6
6
|
import { Collapse, ButtonRadio, IconFont } from '@luck-design-biz/base';
|
|
7
|
-
import { ldComBuilder, filterOptions, deepFilterCom } from
|
|
7
|
+
import { ldComBuilder, filterOptions, deepFilterCom } from "../../helper/ldComBuild";
|
|
8
8
|
export var LdButton = ldComBuilder(Button);
|
|
9
9
|
export var LdCollapse = ldComBuilder(Collapse);
|
|
10
10
|
export var LdButtonRadio = function LdButtonRadio(_ref) {
|
|
@@ -18,7 +18,7 @@ export var LdButtonRadio = function LdButtonRadio(_ref) {
|
|
|
18
18
|
export var LdIconFont = ldComBuilder(IconFont);
|
|
19
19
|
var LdTabs = deepFilterCom(Tabs, function (child) {
|
|
20
20
|
var _child$type;
|
|
21
|
-
return (child === null || child === void 0
|
|
21
|
+
return (child === null || child === void 0 || (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === 'TabPane';
|
|
22
22
|
});
|
|
23
23
|
LdTabs.TabPane = Tabs.TabPane;
|
|
24
24
|
export { LdTabs };
|
|
@@ -17,16 +17,16 @@ import { useCreation, useMemoizedFn, useAsyncEffect } from 'ahooks';
|
|
|
17
17
|
import { BasicDivider } from 'luck-design';
|
|
18
18
|
import { ChildrenUtil } from '@luck-design-biz/base/utils';
|
|
19
19
|
import { FormList, FormListAffix, FormBtn } from '@luck-design-biz/base/FormList';
|
|
20
|
-
import buildLdAutoForm from
|
|
21
|
-
import buildLdGridForm from
|
|
20
|
+
import buildLdAutoForm from "../LdAutoForm";
|
|
21
|
+
import buildLdGridForm from "../LdGridForm";
|
|
22
22
|
import { Collapse } from '@luck-design-biz/base';
|
|
23
|
-
import { LuckDaContext } from
|
|
24
|
-
import { LuckDaPopContext } from
|
|
25
|
-
import createModel from
|
|
26
|
-
import { onBatchSubmitAction } from
|
|
23
|
+
import { LuckDaContext } from "../Builder";
|
|
24
|
+
import { LuckDaPopContext } from "../LdPop";
|
|
25
|
+
import createModel from "./model";
|
|
26
|
+
import { onBatchSubmitAction } from "../../helper/action";
|
|
27
27
|
import { isArray, sortBy, mapValues } from 'lodash';
|
|
28
28
|
import { BpmButton } from '@luck-design-biz/bpm';
|
|
29
|
-
import { readBehaviorCall } from
|
|
29
|
+
import { readBehaviorCall } from "../../services";
|
|
30
30
|
import { parse, stringify } from 'querystring';
|
|
31
31
|
|
|
32
32
|
// 组件
|
|
@@ -87,7 +87,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
87
87
|
var _params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
88
88
|
if (props.formMode !== 'add') {
|
|
89
89
|
var _getDvaApp;
|
|
90
|
-
(_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0
|
|
90
|
+
(_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 || _getDvaApp._store.dispatch({
|
|
91
91
|
type: "".concat(namespace, "/setTicketData"),
|
|
92
92
|
payload: {
|
|
93
93
|
ticketData: _objectSpread(_objectSpread({}, props.ticketData), _params)
|
|
@@ -102,8 +102,8 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
102
102
|
var _ref4 = formListRef.current || {},
|
|
103
103
|
formRefs = _ref4.formRefs;
|
|
104
104
|
var data = formRefs && Object.keys(formRefs).map(function (key) {
|
|
105
|
-
var _formRefs$key, _formRefs$key$
|
|
106
|
-
var getValue = ((
|
|
105
|
+
var _formRefs$key, _formRefs$key$current;
|
|
106
|
+
var getValue = ((_formRefs$key = formRefs[key]) !== null && _formRefs$key !== void 0 && (_formRefs$key = _formRefs$key.formRef) !== null && _formRefs$key !== void 0 && _formRefs$key.current ? formRefs[key].getData : null) || ((_formRefs$key$current = formRefs[key].current) === null || _formRefs$key$current === void 0 ? void 0 : _formRefs$key$current.getFieldsValue);
|
|
107
107
|
return _defineProperty({}, key, getValue && getValue());
|
|
108
108
|
});
|
|
109
109
|
onValueChange(change, data);
|
|
@@ -325,7 +325,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
325
325
|
// 构建带有model的组件
|
|
326
326
|
var builder = function builder(WrappedComponent, namespace, initData) {
|
|
327
327
|
var _getDvaApp2;
|
|
328
|
-
(_getDvaApp2 = getDvaApp()) === null || _getDvaApp2 === void 0
|
|
328
|
+
(_getDvaApp2 = getDvaApp()) === null || _getDvaApp2 === void 0 || _getDvaApp2._store.dispatch({
|
|
329
329
|
type: "".concat(namespace, "/setFormInit"),
|
|
330
330
|
payload: _objectSpread({
|
|
331
331
|
formMode: 'add'
|
|
@@ -352,12 +352,12 @@ var Index = function Index(_ref10) {
|
|
|
352
352
|
var match = useRouteMatch();
|
|
353
353
|
var Component = useCreation(function () {
|
|
354
354
|
var _getDvaApp3, _getDvaApp4, _match$params;
|
|
355
|
-
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0
|
|
356
|
-
if (!((_getDvaApp4 = getDvaApp())
|
|
355
|
+
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0 || _getDvaApp3.unmodel(namespace);
|
|
356
|
+
if (!((_getDvaApp4 = getDvaApp()) !== null && _getDvaApp4 !== void 0 && _getDvaApp4._store.getState()[namespace])) {
|
|
357
357
|
var _getDvaApp5;
|
|
358
|
-
(_getDvaApp5 = getDvaApp()) === null || _getDvaApp5 === void 0
|
|
358
|
+
(_getDvaApp5 = getDvaApp()) === null || _getDvaApp5 === void 0 || _getDvaApp5.model(createModel(namespace, overModel));
|
|
359
359
|
}
|
|
360
|
-
return builder(LdFormList, namespace,
|
|
360
|
+
return builder(LdFormList, namespace, match !== null && match !== void 0 && (_match$params = match.params) !== null && _match$params !== void 0 && _match$params.isEdit ? _objectSpread(_objectSpread({}, initData), {}, {
|
|
361
361
|
formMode: 'edit'
|
|
362
362
|
}) : initData);
|
|
363
363
|
}, [namespace]);
|
|
@@ -388,7 +388,6 @@ Index.propTypes = {
|
|
|
388
388
|
affixLayout: PropTypes.oneOf(['top', 'bottom']),
|
|
389
389
|
onValueChange: PropTypes.func // 参数变化的事件
|
|
390
390
|
};
|
|
391
|
-
|
|
392
391
|
Index.defaultProps = {
|
|
393
392
|
initData: {},
|
|
394
393
|
readOnly: false,
|
|
@@ -11,9 +11,9 @@ import { useCreation } from 'ahooks';
|
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import { build } from '@luck-design-biz/base/Component';
|
|
13
13
|
import { GridList } from '@luck-design-biz/base/List';
|
|
14
|
-
import ldBuilder from
|
|
15
|
-
import { getGridColumn } from
|
|
16
|
-
import createModel from
|
|
14
|
+
import ldBuilder from "../../helper/ldBuilder";
|
|
15
|
+
import { getGridColumn } from "../../utils";
|
|
16
|
+
import createModel from "./model";
|
|
17
17
|
var LdGrid = function LdGrid(_ref) {
|
|
18
18
|
var columns = _ref.columns,
|
|
19
19
|
resources = _ref.resources,
|
|
@@ -93,7 +93,7 @@ var LdGrid = function LdGrid(_ref) {
|
|
|
93
93
|
var mergeFields = union(keys(defaultColumns), keys(customColumns));
|
|
94
94
|
return transform(mergeFields, function (result, field) {
|
|
95
95
|
var _customColumns$field;
|
|
96
|
-
if ((_customColumns$field = customColumns[field])
|
|
96
|
+
if ((_customColumns$field = customColumns[field]) !== null && _customColumns$field !== void 0 && _customColumns$field.hide) {
|
|
97
97
|
// 任何情况都不显示
|
|
98
98
|
} else if (!defaultColumns[field]) {
|
|
99
99
|
// 数据集中不存在的字段以自定义的形式展示
|
|
@@ -167,10 +167,10 @@ var LdIndex = function LdIndex(_ref2) {
|
|
|
167
167
|
var isTreeGrid = isNil(_isTreeGrid) ? includes(props.isTree, props.dataSetKey) : _isTreeGrid;
|
|
168
168
|
var Component = useCreation(function () {
|
|
169
169
|
var _getDvaApp, _getDvaApp2;
|
|
170
|
-
(_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0
|
|
171
|
-
if (!((_getDvaApp2 = getDvaApp())
|
|
170
|
+
(_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 || _getDvaApp.unmodel(namespace);
|
|
171
|
+
if (!((_getDvaApp2 = getDvaApp()) !== null && _getDvaApp2 !== void 0 && _getDvaApp2._store.getState()[namespace])) {
|
|
172
172
|
var _getDvaApp3;
|
|
173
|
-
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0
|
|
173
|
+
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0 || _getDvaApp3.model(createModel(namespace, _objectSpread(_objectSpread({
|
|
174
174
|
isFlow: isTreeGrid || !!props.isFlow
|
|
175
175
|
}, overModel), {}, {
|
|
176
176
|
dataSetKey: props.dataSetKey,
|
|
@@ -215,7 +215,6 @@ Index.propTypes = {
|
|
|
215
215
|
// 初始化后
|
|
216
216
|
rowKey: PropTypes.string // 初始化后
|
|
217
217
|
};
|
|
218
|
-
|
|
219
218
|
Index.defaultProps = {
|
|
220
219
|
columnsRewrite: [],
|
|
221
220
|
columnsReset: null,
|
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
var _excluded = ["readAll", "moduleCode", "dataSetKey", "behaviorKey", "afterQuery"],
|
|
4
4
|
_excluded2 = ["_MultiFieldFilter"];
|
|
5
5
|
import { createMainModel } from '@luck-design-biz/base/utils/modelHelper';
|
|
6
|
-
import { behaviorCall } from
|
|
6
|
+
import { behaviorCall } from "../../utils";
|
|
7
7
|
export default function (namespace) {
|
|
8
8
|
var modelProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9
9
|
var _readAll = modelProps.readAll,
|
|
@@ -6,12 +6,12 @@ var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSet
|
|
|
6
6
|
import React, { createRef, useContext } from 'react';
|
|
7
7
|
import { transform } from 'lodash';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
|
-
import ldBuilder from
|
|
9
|
+
import ldBuilder from "../../helper/ldBuilder";
|
|
10
10
|
import { GridForm } from '@luck-design-biz/base/FormList';
|
|
11
|
-
import { getFormColumn, formItemDataFormat, dataFormat, behaviorCall } from
|
|
12
|
-
import { defaultComName } from
|
|
13
|
-
import { LuckDaContext } from
|
|
14
|
-
import styles from
|
|
11
|
+
import { getFormColumn, formItemDataFormat, dataFormat, behaviorCall } from "../../utils";
|
|
12
|
+
import { defaultComName } from "../../helper/form";
|
|
13
|
+
import { LuckDaContext } from "../Builder";
|
|
14
|
+
import styles from "./index.less";
|
|
15
15
|
var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
16
16
|
var _ref$columns = _ref.columns,
|
|
17
17
|
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
@@ -65,7 +65,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
65
65
|
var _defaultValues = {};
|
|
66
66
|
var _nodes = transform(gridColumns, function (result, col) {
|
|
67
67
|
if (col.isShowInForm) {
|
|
68
|
-
var
|
|
68
|
+
var _customColumn;
|
|
69
69
|
var customColumn = columnsRewrite.find(function (column) {
|
|
70
70
|
return column.field === col.aliaName;
|
|
71
71
|
}) || {};
|
|
@@ -73,7 +73,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
73
73
|
editable: false,
|
|
74
74
|
mode: 'grid'
|
|
75
75
|
});
|
|
76
|
-
_defaultValues = _objectSpread(_objectSpread({}, _defaultValues), {}, (
|
|
76
|
+
_defaultValues = _objectSpread(_objectSpread({}, _defaultValues), {}, _defineProperty(_defineProperty({}, col.aliaName, col['optDefaultValue']), "".concat(col.aliaName, "_virtual"), col['optDefaultValueCvt']));
|
|
77
77
|
result.push(getFormColumn(type, col, _objectSpread(_objectSpread({}, customColumn), {}, {
|
|
78
78
|
formItemRewrite: _objectSpread(_objectSpread({}, (_customColumn = customColumn) === null || _customColumn === void 0 ? void 0 : _customColumn.formItemRewrite), {}, {
|
|
79
79
|
moduleCode: moduleCode,
|
|
@@ -125,7 +125,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
125
125
|
var _submitData = data.map(function (item) {
|
|
126
126
|
return behaviorKey === 'add' ? _objectSpread(_objectSpread({}, dataFormat(gridColumns, item)), {}, _defineProperty({}, window.appConfig.constraintKeys.PRIMARY, null)) : dataFormat(gridColumns, item);
|
|
127
127
|
});
|
|
128
|
-
if (_onOperate
|
|
128
|
+
if (_onOperate !== null && _onOperate !== void 0 && _onOperate.post) return _onOperate.post(_submitData); // 以预设为主
|
|
129
129
|
return _defineProperty({}, dataSetKey, _defineProperty({}, "".concat(behaviorKey, "List"), _submitData));
|
|
130
130
|
}
|
|
131
131
|
});
|
|
@@ -154,7 +154,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
154
154
|
var formItemData = data.map(function (item) {
|
|
155
155
|
return formItemDataFormat(gridColumns, item);
|
|
156
156
|
});
|
|
157
|
-
if (onQuery
|
|
157
|
+
if (onQuery !== null && onQuery !== void 0 && onQuery.format) return onQuery.format(data, formItemData); // 以预设为主
|
|
158
158
|
return formItemData;
|
|
159
159
|
}
|
|
160
160
|
}),
|
|
@@ -167,7 +167,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
167
167
|
indocno: item[window.appConfig.constraintKeys.PRIMARY]
|
|
168
168
|
};
|
|
169
169
|
});
|
|
170
|
-
if (onDelete
|
|
170
|
+
if (onDelete !== null && onDelete !== void 0 && onDelete.post) return onDelete.post(_submitData); // 以预设为主
|
|
171
171
|
return _defineProperty({}, dataSetKey, {
|
|
172
172
|
deleteList: _submitData
|
|
173
173
|
});
|
|
@@ -7,9 +7,9 @@ import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react'
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { useCreation, useRequest } from 'ahooks';
|
|
9
9
|
import { InfoPanel } from 'luck-design';
|
|
10
|
-
import { behaviorCall } from
|
|
10
|
+
import { behaviorCall } from "../../utils";
|
|
11
11
|
import { transform } from 'lodash';
|
|
12
|
-
import ldBuilder from
|
|
12
|
+
import ldBuilder from "../../helper/ldBuilder";
|
|
13
13
|
var formatInfoPanelData = function formatInfoPanelData(columns, data) {
|
|
14
14
|
return transform(columns, function (result, col) {
|
|
15
15
|
result[col.dataIndex] = col.render && col.render(data[col.dataIndex], data) || data["".concat(col.dataIndex, "_virtual")] || data[col.dataIndex];
|
|
@@ -10,13 +10,13 @@ import { isFunction, isNumber, transform, includes, remove, cloneDeep, keys } fr
|
|
|
10
10
|
import { useRequest, useMemoizedFn, useCreation } from 'ahooks';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import classNames from 'classnames';
|
|
13
|
-
import { Icon, Popover } from 'antd';
|
|
13
|
+
import { Icon, Popover } from 'luck-design/antd';
|
|
14
14
|
import { LuckTree } from 'luck-design';
|
|
15
15
|
import { formatMessage, dataToTree, dragTreeData } from '@luck-design-biz/base/utils';
|
|
16
16
|
import { TreeBox } from '@luck-design-biz/base';
|
|
17
|
-
import ldBuilder from
|
|
18
|
-
import { behaviorCall } from
|
|
19
|
-
import styles from
|
|
17
|
+
import ldBuilder from "../../helper/ldBuilder";
|
|
18
|
+
import { behaviorCall } from "../../utils";
|
|
19
|
+
import styles from "./index.less";
|
|
20
20
|
var LdTree = function LdTree(_ref) {
|
|
21
21
|
var columns = _ref.columns,
|
|
22
22
|
resources = _ref.resources,
|
|
@@ -225,7 +225,6 @@ Index.propTypes = {
|
|
|
225
225
|
// 抑制初始化
|
|
226
226
|
afterInit: PropTypes.func // 初始化后
|
|
227
227
|
};
|
|
228
|
-
|
|
229
228
|
Index.defaultProps = {
|
|
230
229
|
readOnly: false,
|
|
231
230
|
title: false,
|
package/es/helper/FromItems.js
CHANGED
|
@@ -31,7 +31,7 @@ import { getDvaApp } from 'umi';
|
|
|
31
31
|
import { BasicFormItem } from 'luck-design';
|
|
32
32
|
import { TreeSelector, RegionFormItem } from '@luck-design-biz/base';
|
|
33
33
|
import { DatadicDropDown, UserSelectDropDown as UserItem } from '@luck-design-biz/base/sys/dropdown';
|
|
34
|
-
import buildUploadFormItem from
|
|
34
|
+
import buildUploadFormItem from "../upload/FormItem";
|
|
35
35
|
export var getNumberItem = function getNumberItem() {
|
|
36
36
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
37
37
|
handleValueChange = _ref.handleValueChange,
|
package/es/helper/action.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
// 通用方法
|
|
4
|
-
import { Modal } from 'antd';
|
|
4
|
+
import { Modal } from 'luck-design/antd';
|
|
5
5
|
import { showPop, formatMessage } from '@luck-design-biz/base/utils';
|
|
6
6
|
import { transform, isArray, startsWith, keyBy } from 'lodash';
|
|
7
|
-
import { dataFormat, behaviorCall } from
|
|
8
|
-
import { defaultComName } from
|
|
7
|
+
import { dataFormat, behaviorCall } from "../utils";
|
|
8
|
+
import { defaultComName } from "./form";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* 提交行为
|
package/es/helper/form.js
CHANGED
|
@@ -97,8 +97,8 @@ export function translator() {
|
|
|
97
97
|
*/
|
|
98
98
|
export function formatCustomProps(props) {
|
|
99
99
|
var _props$confiig;
|
|
100
|
-
if (props
|
|
101
|
-
if (props
|
|
100
|
+
if (props !== null && props !== void 0 && props.multiple) delete props.multiple;
|
|
101
|
+
if (props !== null && props !== void 0 && (_props$confiig = props.confiig) !== null && _props$confiig !== void 0 && _props$confiig.mode) delete props.confiig.mode;
|
|
102
102
|
// alias、sclassKey?
|
|
103
103
|
return props;
|
|
104
104
|
}
|
package/es/helper/ldBuilder.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
|
-
import { LuckDaContext } from
|
|
3
|
+
import { LuckDaContext } from "../components/Builder";
|
|
4
4
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
5
5
|
var builder = function builder(wrapped) {
|
|
6
6
|
var LdCom = function LdCom(props) {
|
package/es/helper/ldComBuild.js
CHANGED
|
@@ -5,9 +5,9 @@ var _excluded = ["className"];
|
|
|
5
5
|
import React, { useContext, Fragment } from 'react';
|
|
6
6
|
import { includes, intersectionWith } from 'lodash';
|
|
7
7
|
import { ChildrenUtil } from '@luck-design-biz/base/utils';
|
|
8
|
-
import { LuckDaContext } from
|
|
8
|
+
import { LuckDaContext } from "../components/Builder";
|
|
9
9
|
import classNames from 'classnames';
|
|
10
|
-
import styles from
|
|
10
|
+
import styles from "./index.less";
|
|
11
11
|
export var getResources = function getResources() {
|
|
12
12
|
var _ref = useContext(LuckDaContext) || {},
|
|
13
13
|
_ref$resources = _ref.resources,
|
|
@@ -19,7 +19,7 @@ export var ldComBuilder = function ldComBuilder(Com) {
|
|
|
19
19
|
var _com$props;
|
|
20
20
|
var resources = getResources();
|
|
21
21
|
var com = /*#__PURE__*/React.createElement(Com, props);
|
|
22
|
-
return !(com
|
|
22
|
+
return !(com !== null && com !== void 0 && (_com$props = com.props) !== null && _com$props !== void 0 && _com$props.resource) || includes(resources, com.props.resource) ? com : Fragment;
|
|
23
23
|
};
|
|
24
24
|
return Component;
|
|
25
25
|
};
|
|
@@ -40,7 +40,7 @@ export var deepFilterCom = function deepFilterCom(Com, childMark) {
|
|
|
40
40
|
}));
|
|
41
41
|
return ChildrenUtil.deepFilter(com, function (child) {
|
|
42
42
|
var _child$props;
|
|
43
|
-
var data = !childMark(child) || !(child
|
|
43
|
+
var data = !childMark(child) || !(child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.resource) || includes(resources, child.props.resource);
|
|
44
44
|
return data;
|
|
45
45
|
});
|
|
46
46
|
};
|
package/es/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { default as ldModuleBuild } from
|
|
2
|
-
export { default as LdTree } from
|
|
3
|
-
export { default as LdGrid } from
|
|
4
|
-
export { default as LdFormList } from
|
|
5
|
-
export { default as buildLdAutoForm } from
|
|
6
|
-
export { default as buildLdGridForm } from
|
|
7
|
-
export { default as LdInfoPanel } from
|
|
8
|
-
export { default as LdCard } from
|
|
9
|
-
export * from
|
|
1
|
+
export { default as ldModuleBuild } from "./components/Builder";
|
|
2
|
+
export { default as LdTree } from "./components/LdTree";
|
|
3
|
+
export { default as LdGrid } from "./components/LdGrid";
|
|
4
|
+
export { default as LdFormList } from "./components/LdFormList";
|
|
5
|
+
export { default as buildLdAutoForm } from "./components/LdAutoForm";
|
|
6
|
+
export { default as buildLdGridForm } from "./components/LdGridForm";
|
|
7
|
+
export { default as LdInfoPanel } from "./components/LdInfoPanel";
|
|
8
|
+
export { default as LdCard } from "./components/LdCard";
|
|
9
|
+
export * from "./components/LdCom";
|
package/es/services.js
CHANGED
|
@@ -2,7 +2,7 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
3
|
import { stringify } from 'querystring';
|
|
4
4
|
import { request } from '@luck-design-biz/base/utils';
|
|
5
|
-
import api from
|
|
5
|
+
import api from "../src/services/ApiConfig";
|
|
6
6
|
export function readModlue(_x) {
|
|
7
7
|
return _readModlue.apply(this, arguments);
|
|
8
8
|
}
|