tntd 1.3.51 → 1.3.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Layout/Avatar.js +6 -3
- package/components/Layout/GlobalNavigation/NavigationPopup.js +6 -4
- package/components/Layout/GlobalNavigation/index.js +2 -1
- package/components/Layout/HeaderActions.js +1 -0
- package/components/Layout/README.md +2 -1
- package/components/Layout/createActions.js +10 -2
- package/components/Layout/index.js +10 -1
- package/components/Page/Box.js +3 -3
- package/components/Page/README.md +17 -5
- package/components/Page/index.js +4 -4
- package/components/Page/index.less +31 -7
- package/components/QueryForm/index.js +12 -8
- package/components/QueryListScene/List.js +2 -1
- package/components/locale.js +60 -0
- package/lib/Layout/Avatar.js +11 -3
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +7 -4
- package/lib/Layout/GlobalNavigation/index.js +2 -1
- package/lib/Layout/README.md +2 -1
- package/lib/Layout/createActions.js +14 -1
- package/lib/Layout/index.js +19 -5
- package/lib/Page/Box.js +4 -3
- package/lib/Page/README.md +17 -5
- package/lib/Page/demo.js +302 -0
- package/lib/Page/index.js +4 -4
- package/lib/Page/index.less +31 -7
- package/lib/QueryForm/index.js +14 -11
- package/lib/QueryListScene/Field/SelectInput.js +2 -10
- package/lib/QueryListScene/Field/fieldsMap.js +1 -16
- package/lib/QueryListScene/Field/index.js +47 -131
- package/lib/QueryListScene/List.js +3 -1
- package/lib/QueryListScene/QueryForm/index.js +89 -93
- package/lib/QueryListScene/QueryForm/index.less +3 -17
- package/lib/locale.js +75 -0
- package/package.json +1 -1
- package/lib/0645cf743e4e44ca9da321d689897f07.png +0 -0
- package/lib/09db77de0c24fa0f45f8a5cf299a3d11.png +0 -0
- package/lib/1d0b52448de217857b270af807e9360d.png +0 -0
- package/lib/25d78d77c9c2f0d403e5d899ceb5b1ef.png +0 -0
- package/lib/27fa44ff0c98e1594d79b73045aabedf.png +0 -0
- package/lib/2c95075adb68d6131b59cae9fa554ec2.png +0 -0
- package/lib/377c871d922a25c773a9e7c2f42ed7c0.png +0 -0
- package/lib/3d901589b40bd56ff1fde2bbb700bfe1.png +0 -0
- package/lib/4abe481e130d7be0574e45573de8beb7.png +0 -0
- package/lib/95ee2260a509cd630d89c5367ed1973b.png +0 -0
- package/lib/b9dd5ff3622296fbee51ed68f4bca1bf.png +0 -0
- package/lib/bd2921989f9296089ba58efb7a76f3ef.png +0 -0
- package/lib/index.html +0 -6
- package/lib/main.css +0 -16420
- package/lib/tntd.js +0 -2
- package/lib/tntd.js.LICENSE.txt +0 -36
|
@@ -7,11 +7,14 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _eventemitter = _interopRequireDefault(require("eventemitter3"));
|
|
9
9
|
|
|
10
|
+
var _locale = require("../locale");
|
|
11
|
+
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
13
|
|
|
12
|
-
var _default = function _default() {
|
|
14
|
+
var _default = function _default(params) {
|
|
13
15
|
var eventEmitter = new _eventemitter["default"]();
|
|
14
16
|
var data = {
|
|
17
|
+
language: (params == null ? void 0 : params.language) || 'cn',
|
|
15
18
|
selectedMenuKey: null
|
|
16
19
|
};
|
|
17
20
|
return {
|
|
@@ -24,6 +27,16 @@ var _default = function _default() {
|
|
|
24
27
|
getSelectedMenuKey: function getSelectedMenuKey() {
|
|
25
28
|
return data.selectedMenuKey;
|
|
26
29
|
},
|
|
30
|
+
getLanguage: function getLanguage() {
|
|
31
|
+
return data.language;
|
|
32
|
+
},
|
|
33
|
+
setLanguage: function setLanguage(language) {
|
|
34
|
+
return data.language = language;
|
|
35
|
+
},
|
|
36
|
+
getText: function getText(key) {
|
|
37
|
+
var language = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : data.language;
|
|
38
|
+
return (0, _locale.getText)(key, language);
|
|
39
|
+
},
|
|
27
40
|
on: function on(eventName, callback) {
|
|
28
41
|
eventEmitter.on(eventName, callback);
|
|
29
42
|
},
|
package/lib/Layout/index.js
CHANGED
|
@@ -43,6 +43,8 @@ var _ActionsContext = _interopRequireDefault(require("./ActionsContext"));
|
|
|
43
43
|
|
|
44
44
|
var _createActions = _interopRequireDefault(require("./createActions"));
|
|
45
45
|
|
|
46
|
+
var _storage = require("./storage");
|
|
47
|
+
|
|
46
48
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
47
49
|
|
|
48
50
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -103,7 +105,16 @@ var TNTLayout = function TNTLayout(_ref) {
|
|
|
103
105
|
_ref2$themeSwitch = _ref2.themeSwitch,
|
|
104
106
|
themeSwitch = _ref2$themeSwitch === void 0 ? true : _ref2$themeSwitch;
|
|
105
107
|
|
|
106
|
-
var userInfo = props.userInfo || {};
|
|
108
|
+
var userInfo = props.userInfo || {};
|
|
109
|
+
var actionsContextValue = (0, _createActions["default"])({
|
|
110
|
+
language: (0, _storage.getLanguageStore)() || userInfo.lang || 'cn'
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
var onLanguageChange = function onLanguageChange(language) {
|
|
114
|
+
actionsContextValue.setLanguage(language);
|
|
115
|
+
props == null ? void 0 : props.onLanguageChange(language);
|
|
116
|
+
}; // layout上的指定的属性优先级会高于extendMap中的属性
|
|
117
|
+
|
|
107
118
|
|
|
108
119
|
type = type || displayType;
|
|
109
120
|
config = Object.assign({
|
|
@@ -117,28 +128,31 @@ var TNTLayout = function TNTLayout(_ref) {
|
|
|
117
128
|
}, React.createElement(_AuthContext["default"].Provider, {
|
|
118
129
|
value: (0, _checkAuth["default"])(props.menus)
|
|
119
130
|
}, React.createElement(_ActionsContext["default"].Provider, {
|
|
120
|
-
value:
|
|
131
|
+
value: actionsContextValue
|
|
121
132
|
}, type === 'paas' && React.createElement(_paaslayout["default"], _extends({
|
|
122
133
|
menuAlignMode: menuAlignMode,
|
|
123
134
|
config: config
|
|
124
135
|
}, props, {
|
|
125
136
|
extraHeaderActions: extraHeaderActions,
|
|
126
137
|
isInIframe: isInIframe,
|
|
127
|
-
userInfo: userInfo
|
|
138
|
+
userInfo: userInfo,
|
|
139
|
+
onLanguageChange: onLanguageChange
|
|
128
140
|
})), type === 'enterprise' && React.createElement(_EnterpriseLayout["default"], _extends({
|
|
129
141
|
menuAlignMode: menuAlignMode,
|
|
130
142
|
config: config
|
|
131
143
|
}, props, {
|
|
132
144
|
extraHeaderActions: extraHeaderActions,
|
|
133
145
|
isInIframe: isInIframe,
|
|
134
|
-
userInfo: userInfo
|
|
146
|
+
userInfo: userInfo,
|
|
147
|
+
onLanguageChange: onLanguageChange
|
|
135
148
|
})), (!type || !['paas', 'enterprise'].includes(type)) && React.createElement(_Layout["default"], _extends({
|
|
136
149
|
menuAlignMode: menuAlignMode,
|
|
137
150
|
config: config
|
|
138
151
|
}, props, {
|
|
139
152
|
extraHeaderActions: extraHeaderActions,
|
|
140
153
|
isInIframe: isInIframe,
|
|
141
|
-
userInfo: userInfo
|
|
154
|
+
userInfo: userInfo,
|
|
155
|
+
onLanguageChange: onLanguageChange
|
|
142
156
|
})))));
|
|
143
157
|
};
|
|
144
158
|
|
package/lib/Page/Box.js
CHANGED
|
@@ -29,7 +29,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
29
29
|
|
|
30
30
|
var Box = function Box(_ref) {
|
|
31
31
|
var inLayout = _ref.inLayout,
|
|
32
|
-
clsPrefix = _ref.clsPrefix,
|
|
32
|
+
_ref$clsPrefix = _ref.clsPrefix,
|
|
33
|
+
clsPrefix = _ref$clsPrefix === void 0 ? 'tnt-page' : _ref$clsPrefix,
|
|
33
34
|
children = _ref.children,
|
|
34
35
|
_ref$noPadding = _ref.noPadding,
|
|
35
36
|
noPadding = _ref$noPadding === void 0 ? false : _ref$noPadding,
|
|
@@ -73,8 +74,8 @@ var Box = function Box(_ref) {
|
|
|
73
74
|
className: "".concat(clsPrefix, "-box-card"),
|
|
74
75
|
bordered: bordered,
|
|
75
76
|
bodyStyle: _objectSpread({}, bodyStyle, {
|
|
76
|
-
overflow: 'auto',
|
|
77
|
-
height: inLayout ?
|
|
77
|
+
// overflow: 'auto',
|
|
78
|
+
height: inLayout ? "calc(100% - ".concat(headerHeight, ")") : cardBodyHeight
|
|
78
79
|
}),
|
|
79
80
|
size: size,
|
|
80
81
|
headStyle: headStyle
|
package/lib/Page/README.md
CHANGED
|
@@ -67,8 +67,8 @@ const Demo = (props) => {
|
|
|
67
67
|
<h3>第三种场景, 无标题栏</h3>
|
|
68
68
|
|
|
69
69
|
<Page height="400px">
|
|
70
|
-
<Box title='分组列表' extra={<Button type="primary" size=
|
|
71
|
-
<Box mode="white" title='菜单列表' extra={<Button type="primary" size=
|
|
70
|
+
<Box title='分组列表' extra={<Button type="primary" size='small'>添加</Button>}>第一列</Box>
|
|
71
|
+
<Box mode="white" title='菜单列表' extra={<Button type="primary" size='small'>添加</Button>}>第二列</Box>
|
|
72
72
|
<Box title="系统列表">第三列</Box>
|
|
73
73
|
<Box title="功能注册">第四列</Box>
|
|
74
74
|
</Page>
|
|
@@ -86,7 +86,13 @@ const Demo = (props) => {
|
|
|
86
86
|
// extra={right}
|
|
87
87
|
inLayout
|
|
88
88
|
>
|
|
89
|
-
<Box
|
|
89
|
+
<Box
|
|
90
|
+
title="系统列表"
|
|
91
|
+
width={320}
|
|
92
|
+
mode='white'
|
|
93
|
+
>
|
|
94
|
+
第三列
|
|
95
|
+
</Box>
|
|
90
96
|
<Box title="功能注册">
|
|
91
97
|
第四列<br/>
|
|
92
98
|
第四列<br/>
|
|
@@ -114,7 +120,14 @@ const Demo = (props) => {
|
|
|
114
120
|
第四列<br/>
|
|
115
121
|
第四列<br/>
|
|
116
122
|
第四列<br/>
|
|
117
|
-
|
|
123
|
+
第四列end
|
|
124
|
+
</Box>
|
|
125
|
+
<Box
|
|
126
|
+
title="系统列表"
|
|
127
|
+
width={200}
|
|
128
|
+
mode='white'
|
|
129
|
+
>
|
|
130
|
+
第三列
|
|
118
131
|
</Box>
|
|
119
132
|
</Page>
|
|
120
133
|
</Layout>
|
|
@@ -154,7 +167,6 @@ ReactDOM.render(<Demo />, document.getElementById('root'))
|
|
|
154
167
|
|
|
155
168
|
|
|
156
169
|
|
|
157
|
-
|
|
158
170
|
#### Page.Box
|
|
159
171
|
|
|
160
172
|
描述:Page.Box包裹了antd库中的Card组件,Box属性都会透传到Card组件。
|
package/lib/Page/demo.js
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
<<<<<<< HEAD
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { Icon } from "antd";
|
|
6
|
+
=======
|
|
7
|
+
>>>>>>> b0d5e9811a677a0f26474e1b615ccac1683b6dec
|
|
8
|
+
import { computeWidth, addUnitForValue } from './utils';
|
|
9
|
+
import Box from './Box';
|
|
10
|
+
import './index.less';
|
|
11
|
+
|
|
12
|
+
<<<<<<< HEAD
|
|
13
|
+
const PageWrapper = styled.div`
|
|
14
|
+
position: relative;
|
|
15
|
+
width: 100%;
|
|
16
|
+
overflow-y: hidden;
|
|
17
|
+
.box-white {
|
|
18
|
+
z-index: 1;
|
|
19
|
+
background: ${(props) => `${props.inLayout ? '#fbfcfe' : '#f3f5f6'}`};
|
|
20
|
+
box-shadow: ${(props) => {
|
|
21
|
+
let boxShadow = '0 0 6px 0 rgba(0, 0, 0, 0.1), 0 10px 12px 2px rgba(170, 182, 206, 0.2)';
|
|
22
|
+
if (props.inLayout) {
|
|
23
|
+
boxShadow = '0 0 4px 0 rgba(0, 0, 0, 0.1), 0 6px 10px 2px rgba(170, 182, 206, 0.2)';
|
|
24
|
+
}
|
|
25
|
+
return boxShadow;
|
|
26
|
+
}};
|
|
27
|
+
}
|
|
28
|
+
.box-gray {
|
|
29
|
+
background: ${(props) => `${props.inLayout ? '#f8f9fa' : '#e8ebed'}`};
|
|
30
|
+
// box-shadow: 0 10px 12px 2px rgba(0, 0, 0, 0.1);
|
|
31
|
+
box-shadow: ${(props) => `${props.inLayout ? '0 5px 5px 2px rgba(0, 0, 0, 0.1)' : '0 10px 12px 2px rgba(0, 0, 0, 0.1)'}`};
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
const HeaderWrapper = styled.div`
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
right: 0;
|
|
39
|
+
height: ${(props) => `${props.headerHeight}`};
|
|
40
|
+
padding: ${(props) => `${props.size === 'small' ? 20 : 24}px`};
|
|
41
|
+
z-index: ${(props) => `${props.zIndex}`};
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: row;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
background: ${(props) => `${props.inLayout ? '#ffffff' : '#f0f2f3'}`};
|
|
46
|
+
box-shadow: ${(props) =>
|
|
47
|
+
`${props.inLayout
|
|
48
|
+
? 'none'
|
|
49
|
+
: '0 0 6px 0 rgba(0, 0, 0, 0.1),0 10px 6px 0 rgba(170, 182, 206, 0.2)'
|
|
50
|
+
}`};
|
|
51
|
+
`;
|
|
52
|
+
const ContentWrapper = styled.div`
|
|
53
|
+
display: ${(props) => `${props.boxCount > 0 ? 'flex' : 'block'}`};;
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
width: 100%;
|
|
56
|
+
margin-top: ${(props) => `${props.contentMarginTop}`};
|
|
57
|
+
padding: ${(props) => `${props.contentPadding}`};
|
|
58
|
+
position: relative;
|
|
59
|
+
z-index:0;
|
|
60
|
+
`;
|
|
61
|
+
const Section = styled.div`
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
&:nth-child(1) > * {
|
|
65
|
+
margin-right: 10px;
|
|
66
|
+
}
|
|
67
|
+
&:nth-child(2) > * {
|
|
68
|
+
margin: 0 5px;
|
|
69
|
+
}
|
|
70
|
+
&:nth-child(3) > * {
|
|
71
|
+
margin-left: 10px;
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
const GoBack = styled.div`
|
|
76
|
+
position: relative;
|
|
77
|
+
display: inline-block;
|
|
78
|
+
margin-right: 40px !important;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
&::after {
|
|
81
|
+
content: "";
|
|
82
|
+
position: absolute;
|
|
83
|
+
width: 1px;
|
|
84
|
+
height: 16px;
|
|
85
|
+
right: -20px;
|
|
86
|
+
top: 50%;
|
|
87
|
+
transform: translateY(-50%);
|
|
88
|
+
background-color: #dcdfe6;
|
|
89
|
+
}
|
|
90
|
+
&:hover {
|
|
91
|
+
&,i {
|
|
92
|
+
color: #126BFB;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
i {
|
|
96
|
+
font-size: 14px;
|
|
97
|
+
margin-right: 6px;
|
|
98
|
+
color: #4c4c4c;
|
|
99
|
+
}
|
|
100
|
+
span {
|
|
101
|
+
font-size: 14px;
|
|
102
|
+
font-weight: normal;
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
105
|
+
|
|
106
|
+
const BoxWrapper = styled.div`
|
|
107
|
+
overflow: auto;
|
|
108
|
+
`;
|
|
109
|
+
=======
|
|
110
|
+
const clsPrefix = 'tnt-page';
|
|
111
|
+
>>>>>>> b0d5e9811a677a0f26474e1b615ccac1683b6dec
|
|
112
|
+
|
|
113
|
+
const PageLayout = ({
|
|
114
|
+
className,
|
|
115
|
+
height = '100vh',
|
|
116
|
+
headerHeight = 50,
|
|
117
|
+
children,
|
|
118
|
+
title,
|
|
119
|
+
goBack,
|
|
120
|
+
goBackText,
|
|
121
|
+
center,
|
|
122
|
+
extra,
|
|
123
|
+
size = 'small',
|
|
124
|
+
inLayout = false,
|
|
125
|
+
className,
|
|
126
|
+
...restProps
|
|
127
|
+
}) => {
|
|
128
|
+
// 如果传入只有数字,需要默认加px
|
|
129
|
+
let computedHeaderHeight = addUnitForValue(headerHeight);
|
|
130
|
+
let computedHeight = addUnitForValue(height);
|
|
131
|
+
|
|
132
|
+
// 判断是否有标题栏
|
|
133
|
+
if (!(title || extra || center)) {
|
|
134
|
+
computedHeaderHeight = '0px';
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (inLayout) {
|
|
138
|
+
computedHeaderHeight = '40px';
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// 计算中间的zIndex,灰色递减,白色递增
|
|
142
|
+
let whiteCols = 0;
|
|
143
|
+
let childrenToArray = [];
|
|
144
|
+
|
|
145
|
+
// 计算children type是box的数量
|
|
146
|
+
let boxCount = 0;
|
|
147
|
+
|
|
148
|
+
// 如果children是单个节点,统一转为数组处理计算层级
|
|
149
|
+
console.log('children', children);
|
|
150
|
+
|
|
151
|
+
if (typeof children === 'object') {
|
|
152
|
+
childrenToArray = [children];
|
|
153
|
+
} else if (Array.isArray(children)) {
|
|
154
|
+
childrenToArray = [...children];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
console.log('React.Children', React.Children);
|
|
158
|
+
React.Children.map(children, (child) => {
|
|
159
|
+
if (child.type === Box) {
|
|
160
|
+
boxCount += 1;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
console.log(boxCount);
|
|
165
|
+
|
|
166
|
+
whiteCols = childrenToArray?.filter(({ props }) => props?.mode === 'white')?.length;
|
|
167
|
+
const total = childrenToArray?.length;
|
|
168
|
+
let startIndex = total - whiteCols - 1;
|
|
169
|
+
let endIndex = total - 1;
|
|
170
|
+
const headerStyle = {
|
|
171
|
+
height: computedHeaderHeight,
|
|
172
|
+
padding: `${size === 'small' ? 20 : 24}px`,
|
|
173
|
+
zIndex: total || 2
|
|
174
|
+
};
|
|
175
|
+
const contentStyle = {
|
|
176
|
+
display: boxCount > 0 ? 'flex' : 'block',
|
|
177
|
+
marginTop: computedHeaderHeight,
|
|
178
|
+
padding: inLayout ? '16px 20px' : '0px'
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<<<<<<< HEAD
|
|
183
|
+
<PageWrapper
|
|
184
|
+
className={cn('tntd-page-wrap', className)}
|
|
185
|
+
height={computedHeight}
|
|
186
|
+
inLayout={inLayout}
|
|
187
|
+
{...restProps}
|
|
188
|
+
>
|
|
189
|
+
{
|
|
190
|
+
(title || center || extra) &&
|
|
191
|
+
<HeaderWrapper
|
|
192
|
+
headerHeight={computedHeaderHeight}
|
|
193
|
+
size={size}
|
|
194
|
+
zIndex={total || 2}
|
|
195
|
+
inLayout={inLayout}
|
|
196
|
+
className='page-header-wrap'
|
|
197
|
+
>
|
|
198
|
+
{
|
|
199
|
+
title &&
|
|
200
|
+
<Section className='page-header-title'>
|
|
201
|
+
{
|
|
202
|
+
goBack &&
|
|
203
|
+
<GoBack
|
|
204
|
+
className='page-header-title-back'
|
|
205
|
+
onClick={() => {
|
|
206
|
+
goBack();
|
|
207
|
+
}}
|
|
208
|
+
>
|
|
209
|
+
<Icon type="left" />
|
|
210
|
+
<span>{goBackText ? goBackText : '返回'}</span>
|
|
211
|
+
</GoBack>
|
|
212
|
+
}
|
|
213
|
+
{title}
|
|
214
|
+
</Section>
|
|
215
|
+
}
|
|
216
|
+
{
|
|
217
|
+
center &&
|
|
218
|
+
<Section className='page-header-center'>{center}</Section>
|
|
219
|
+
}
|
|
220
|
+
{
|
|
221
|
+
extra &&
|
|
222
|
+
<Section className='page-header-extra'>{extra}</Section>
|
|
223
|
+
}
|
|
224
|
+
</HeaderWrapper>
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
<ContentWrapper
|
|
228
|
+
contentMarginTop={computedHeaderHeight}
|
|
229
|
+
contentPadding={inLayout ? '16px 20px' : '0px'}
|
|
230
|
+
boxCount={boxCount}
|
|
231
|
+
className='page-body-wrap'
|
|
232
|
+
>
|
|
233
|
+
=======
|
|
234
|
+
<div
|
|
235
|
+
className={
|
|
236
|
+
cn(clsPrefix, {
|
|
237
|
+
[className]: className,
|
|
238
|
+
inLayout
|
|
239
|
+
})
|
|
240
|
+
}
|
|
241
|
+
{...restProps}
|
|
242
|
+
>
|
|
243
|
+
{
|
|
244
|
+
(title || center || extra) && (
|
|
245
|
+
<div className={`${clsPrefix}-header`} style={headerStyle}>
|
|
246
|
+
{
|
|
247
|
+
[title, center, extra].filter(
|
|
248
|
+
item => !!item
|
|
249
|
+
).map(item => (
|
|
250
|
+
<div className={`${clsPrefix}-header-section`}>
|
|
251
|
+
{item}
|
|
252
|
+
</div>
|
|
253
|
+
))
|
|
254
|
+
}
|
|
255
|
+
</div>
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
<div className={`${clsPrefix}-content`} style={contentStyle}>
|
|
259
|
+
>>>>>>> b0d5e9811a677a0f26474e1b615ccac1683b6dec
|
|
260
|
+
{React.Children.map(children, (child) => {
|
|
261
|
+
// 如果children不是Box,就不需要多列布局
|
|
262
|
+
if (!child.type) {
|
|
263
|
+
// console.log("没有type");
|
|
264
|
+
return React.cloneElement(<div>{child}</div>);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const extraProps = {
|
|
268
|
+
headerHeight: computedHeaderHeight,
|
|
269
|
+
size,
|
|
270
|
+
height: computedHeight,
|
|
271
|
+
contentTotalMargin: inLayout ? '32px' : '0px',
|
|
272
|
+
...child.props
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
if (child.type !== Box) {
|
|
276
|
+
return React.cloneElement(child, extraProps);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const { mode = 'gray', width } = child.props;
|
|
280
|
+
|
|
281
|
+
const style = {
|
|
282
|
+
flex: computeWidth(width),
|
|
283
|
+
// 设置cols层级关系
|
|
284
|
+
zIndex: mode === 'gray' ? startIndex-- : endIndex--
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
const className = cn(`${clsPrefix}-box ${clsPrefix}-box-${mode}`);
|
|
288
|
+
|
|
289
|
+
return React.createElement(
|
|
290
|
+
'div',
|
|
291
|
+
{ className, style },
|
|
292
|
+
React.cloneElement(child, extraProps)
|
|
293
|
+
);
|
|
294
|
+
})}
|
|
295
|
+
</div>
|
|
296
|
+
</div>
|
|
297
|
+
);
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
PageLayout.Box = Box;
|
|
301
|
+
|
|
302
|
+
export default PageLayout;
|
package/lib/Page/index.js
CHANGED
|
@@ -108,13 +108,13 @@ var PageLayout = function PageLayout(_ref) {
|
|
|
108
108
|
var props = _ref2.props;
|
|
109
109
|
return (props == null ? void 0 : props.mode) === 'white';
|
|
110
110
|
})) == null ? void 0 : _childrenToArray$filt.length;
|
|
111
|
-
var total = (_childrenToArray2 = childrenToArray) == null ? void 0 : _childrenToArray2.length;
|
|
111
|
+
var total = ((_childrenToArray2 = childrenToArray) == null ? void 0 : _childrenToArray2.length) + 5;
|
|
112
112
|
var startIndex = total - whiteCols - 1;
|
|
113
|
-
var endIndex = total -
|
|
113
|
+
var endIndex = total - 2;
|
|
114
114
|
var headerStyle = {
|
|
115
115
|
height: computedHeaderHeight,
|
|
116
116
|
padding: "".concat(size === 'small' ? 20 : 24, "px"),
|
|
117
|
-
zIndex: total ||
|
|
117
|
+
zIndex: inLayout ? 1 : total || 1
|
|
118
118
|
};
|
|
119
119
|
var contentStyle = {
|
|
120
120
|
display: boxCount > 0 ? 'flex' : 'block',
|
|
@@ -168,7 +168,7 @@ var PageLayout = function PageLayout(_ref) {
|
|
|
168
168
|
var style = {
|
|
169
169
|
flex: (0, _utils.computeWidth)(width),
|
|
170
170
|
// 设置cols层级关系
|
|
171
|
-
zIndex: mode === 'gray' ?
|
|
171
|
+
zIndex: mode === 'gray' ? endIndex-- : startIndex++
|
|
172
172
|
};
|
|
173
173
|
var className = (0, _classnames["default"])("".concat(clsPrefix, "-box ").concat(clsPrefix, "-box-").concat(mode));
|
|
174
174
|
return _react["default"].createElement('div', {
|
package/lib/Page/index.less
CHANGED
|
@@ -1,26 +1,46 @@
|
|
|
1
|
+
.large-size > .ant-layout-content {
|
|
2
|
+
.tnt-page.in-layout {
|
|
3
|
+
height: calc(100vh - 60px);
|
|
4
|
+
}
|
|
5
|
+
}
|
|
1
6
|
.tnt-page {
|
|
2
7
|
position: relative;
|
|
3
8
|
width: 100%;
|
|
4
9
|
height: 100%;
|
|
5
10
|
overflow-y: hidden;
|
|
6
11
|
|
|
12
|
+
&.in-layout {
|
|
13
|
+
box-shadow: none;
|
|
14
|
+
height: calc(100vh - 50px);
|
|
15
|
+
.tnt-page-box,
|
|
16
|
+
.tnt-page-box > .ant-card {
|
|
17
|
+
height: 100%;
|
|
18
|
+
}
|
|
19
|
+
.tnt-page-content .tnt-page-box .ant-card .ant-card-body {
|
|
20
|
+
overflow-x: hidden;
|
|
21
|
+
overflow-y: auto;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
7
25
|
&-box-white {
|
|
8
26
|
z-index: 1;
|
|
9
27
|
background: #f3f5f6;
|
|
10
28
|
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.1), 0 10px 12px 2px rgba(170, 182, 206, 0.2);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
29
|
+
|
|
30
|
+
.in-layout & {
|
|
31
|
+
background: #fafbfc;
|
|
14
32
|
}
|
|
15
33
|
}
|
|
16
34
|
|
|
35
|
+
|
|
17
36
|
&-box-gray {
|
|
18
37
|
background: #e8ebed;
|
|
19
38
|
box-shadow: 0 10px 12px 2px rgba(0, 0, 0, 0.1);
|
|
20
39
|
|
|
21
|
-
.
|
|
40
|
+
.in-layout & {
|
|
22
41
|
background: #f8f9fa;
|
|
23
|
-
box-shadow: 0 5px 5px 2px rgba(0, 0, 0, 0.1);
|
|
42
|
+
// box-shadow: 0 5px 5px 2px rgba(0, 0, 0, 0.1);
|
|
43
|
+
box-shadow: 0 2px 5px 1px rgba(0, 0, 0, 0.1);
|
|
24
44
|
}
|
|
25
45
|
}
|
|
26
46
|
|
|
@@ -36,7 +56,7 @@
|
|
|
36
56
|
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.1),
|
|
37
57
|
0 10px 6px 0 rgba(170, 182, 206, 0.2);
|
|
38
58
|
|
|
39
|
-
.
|
|
59
|
+
.in-layout & {
|
|
40
60
|
background: #ffffff;
|
|
41
61
|
box-shadow: none;
|
|
42
62
|
}
|
|
@@ -76,9 +96,13 @@
|
|
|
76
96
|
.ant-card-head {
|
|
77
97
|
border-bottom: 1px solid #e0e0e0;
|
|
78
98
|
margin-bottom: 0;
|
|
79
|
-
height: 60px;
|
|
99
|
+
// height: 60px;
|
|
80
100
|
.small & {
|
|
81
101
|
height: 40px;
|
|
102
|
+
line-height: 40px;
|
|
103
|
+
}
|
|
104
|
+
.ant-card-head-title {
|
|
105
|
+
font-weight: normal;
|
|
82
106
|
}
|
|
83
107
|
}
|
|
84
108
|
.ant-card-body {
|
package/lib/QueryForm/index.js
CHANGED
|
@@ -35,6 +35,8 @@ var _Icon = _interopRequireDefault(require("../Icon"));
|
|
|
35
35
|
|
|
36
36
|
var _Field = _interopRequireDefault(require("./Field"));
|
|
37
37
|
|
|
38
|
+
var _locale = require("../locale");
|
|
39
|
+
|
|
38
40
|
require("./index.less");
|
|
39
41
|
|
|
40
42
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
@@ -71,10 +73,6 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
71
73
|
|
|
72
74
|
var clsPrefix = 'tnt-queryform';
|
|
73
75
|
|
|
74
|
-
var isInput = function isInput(type) {
|
|
75
|
-
return ['input', 'string', 'search'].includes(type);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
76
|
var QueryForm =
|
|
79
77
|
/*#__PURE__*/
|
|
80
78
|
function (_React$PureComponent) {
|
|
@@ -238,16 +236,16 @@ function (_React$PureComponent) {
|
|
|
238
236
|
onClick: _this2.onShowDrawer
|
|
239
237
|
}, _react["default"].createElement(_Icon["default"], {
|
|
240
238
|
type: "filter"
|
|
241
|
-
}),
|
|
239
|
+
}), _this2.getText('moreFiltering'))), showSearch && _react["default"].createElement(_button["default"], {
|
|
242
240
|
type: "primary",
|
|
243
241
|
onClick: _this2.onSearch
|
|
244
|
-
},
|
|
242
|
+
}, _this2.getText('search')), showReset && _react["default"].createElement(_button["default"], {
|
|
245
243
|
onClick: _this2.onReset
|
|
246
|
-
},
|
|
244
|
+
}, _this2.getText('reset')), showMore && !showFieldCount && _react["default"].createElement(_button["default"], {
|
|
247
245
|
className: "expand-link",
|
|
248
246
|
type: "link",
|
|
249
247
|
onClick: _this2.onToggleExpand
|
|
250
|
-
}, expanded ? '
|
|
248
|
+
}, _this2.getText(expanded ? 'collapse' : 'expand')), _react["default"].Children.map(children, function (child) {
|
|
251
249
|
var _child$props;
|
|
252
250
|
|
|
253
251
|
return child && (child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.align) === 'right' && _react["default"].cloneElement(child);
|
|
@@ -276,7 +274,7 @@ function (_React$PureComponent) {
|
|
|
276
274
|
})), _react["default"].createElement("div", {
|
|
277
275
|
className: "".concat(clsPrefix, "-actions")
|
|
278
276
|
}, renderFormActions()), showFieldCount && _react["default"].createElement(_drawer["default"], _extends({
|
|
279
|
-
title:
|
|
277
|
+
title: this.getText('moreFiltering'),
|
|
280
278
|
visible: drawerVisible,
|
|
281
279
|
onClose: function onClose() {
|
|
282
280
|
return _this2.setState({
|
|
@@ -301,12 +299,17 @@ function (_React$PureComponent) {
|
|
|
301
299
|
}), _react["default"].createElement(_button["default"], {
|
|
302
300
|
type: "primary",
|
|
303
301
|
onClick: this.onSearch
|
|
304
|
-
},
|
|
302
|
+
}, this.getText('search')), _react["default"].createElement(_button["default"], {
|
|
305
303
|
onClick: this.onReset
|
|
306
|
-
},
|
|
304
|
+
}, this.getText('reset')))), extraActions && _react["default"].createElement("div", {
|
|
307
305
|
className: "".concat(clsPrefix, "-extra")
|
|
308
306
|
}, extraActions));
|
|
309
307
|
}
|
|
308
|
+
}, {
|
|
309
|
+
key: "getText",
|
|
310
|
+
value: function getText(key) {
|
|
311
|
+
return (0, _locale.getText)(key, this.props.language || (0, _locale.getLanguage)());
|
|
312
|
+
}
|
|
310
313
|
}, {
|
|
311
314
|
key: "isFieldsWidthOverflow",
|
|
312
315
|
value: function isFieldsWidthOverflow() {
|
|
@@ -27,10 +27,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
27
27
|
|
|
28
28
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
29
|
|
|
30
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
-
|
|
32
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
33
|
-
|
|
34
30
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
31
|
|
|
36
32
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
@@ -50,8 +46,7 @@ var Option = _select["default"].Option;
|
|
|
50
46
|
var _default = function _default(props) {
|
|
51
47
|
var _props$options = props.options,
|
|
52
48
|
options = _props$options === void 0 ? [] : _props$options,
|
|
53
|
-
|
|
54
|
-
inputProps = _objectWithoutProperties(props, ["options", "addonBeforeStyle"]);
|
|
49
|
+
inputProps = _objectWithoutProperties(props, ["options"]);
|
|
55
50
|
|
|
56
51
|
var _useState = (0, _react.useState)(options),
|
|
57
52
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -84,10 +79,7 @@ var _default = function _default(props) {
|
|
|
84
79
|
|
|
85
80
|
var addonBefore = _react["default"].createElement(_select["default"], {
|
|
86
81
|
value: key,
|
|
87
|
-
onChange: onKeyChange
|
|
88
|
-
style: _objectSpread({
|
|
89
|
-
width: '120px'
|
|
90
|
-
}, addonBeforeStyle)
|
|
82
|
+
onChange: onKeyChange
|
|
91
83
|
}, items.map(function (_ref) {
|
|
92
84
|
var label = _ref.label,
|
|
93
85
|
value = _ref.value;
|