tntd 1.4.32 → 1.4.33-beta.1
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/Ellipsis/index.js +47 -15
- package/components/QueryListScene/QueryForm.js +4 -4
- package/components/QueryListScene/createActions.js +4 -4
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24089 -23289
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +7 -10
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +79 -111
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +33 -40
- package/es/DevelopmentLogin/LoginModal.js +33 -46
- package/es/DevelopmentLogin/index.js +14 -18
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +100 -79
- package/es/Handle/index.js +46 -64
- package/es/Icon/fonts/iconfont.js +7 -12
- package/es/Icon/index.js +12 -15
- package/es/Img/Contain.js +26 -31
- package/es/Img/Cover.js +43 -57
- package/es/Img/index.js +39 -48
- package/es/Layout/ActionsContext.js +3 -2
- package/es/Layout/AppList.js +39 -94
- package/es/Layout/Application.js +28 -74
- package/es/Layout/Avatar.js +30 -67
- package/es/Layout/CompatibleLanguage.js +41 -96
- package/es/Layout/EnterpriseLayout/Avatar.js +39 -77
- package/es/Layout/EnterpriseLayout/Language.js +16 -34
- package/es/Layout/EnterpriseLayout/Theme.js +18 -36
- package/es/Layout/EnterpriseLayout/index.js +14 -16
- package/es/Layout/GlobalNavigation/NavigationPopup.js +61 -172
- package/es/Layout/GlobalNavigation/index.js +22 -56
- package/es/Layout/Header.js +26 -47
- package/es/Layout/HeaderActions.js +45 -59
- package/es/Layout/HeaderNavs.js +24 -51
- package/es/Layout/HeaderTabs.js +53 -106
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +16 -34
- package/es/Layout/Layout.js +88 -110
- package/es/Layout/Logo.js +17 -33
- package/es/Layout/OrgAppList.js +64 -109
- package/es/Layout/SideMenu.js +67 -128
- package/es/Layout/Theme.js +25 -63
- package/es/Layout/index.js +28 -37
- package/es/Layout/paaslayout/CompactSideMenu.js +37 -76
- package/es/Layout/paaslayout/Header.js +23 -46
- package/es/Layout/paaslayout/Logo.js +4 -14
- package/es/Layout/paaslayout/SideMenu.js +41 -80
- package/es/Layout/paaslayout/index.js +77 -104
- package/es/Layout/storage.js +10 -9
- package/es/LoadingButton/index.js +18 -27
- package/es/Modal/index.js +42 -51
- package/es/Page/Box.js +36 -43
- package/es/Page/index.js +56 -71
- package/es/Page/utils.js +0 -5
- package/es/QueryForm/Field/Checkbox.js +7 -11
- package/es/QueryForm/Field/Select.js +34 -44
- package/es/QueryForm/Field/SelectInput.js +31 -46
- package/es/QueryForm/Field/fieldsMap.js +0 -1
- package/es/QueryForm/Field/index.js +46 -78
- package/es/QueryForm/createActions.js +6 -7
- package/es/QueryForm/index.js +79 -140
- package/es/QueryListScene/List.js +83 -139
- package/es/QueryListScene/QueryForm.js +54 -91
- package/es/QueryListScene/QueryListScene.js +29 -47
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +13 -14
- package/es/QueryListScene/createActions.js +4 -4
- package/es/Select/DropDownWrap.js +32 -55
- package/es/Select/index.js +140 -232
- package/es/Table/ResizableTable/index.js +29 -43
- package/es/Table/index.js +20 -19
- package/es/Title/index.js +23 -25
- package/es/locale.js +1 -5
- package/es/utils/checkAuth.js +6 -8
- package/es/utils/findMenuInfoByPath.js +0 -4
- package/es/utils/index.js +17 -27
- package/lib/ArrayInput/icon.js +7 -9
- package/lib/ArrayInput/index.js +82 -131
- package/lib/AuthContext.js +2 -6
- package/lib/Columns/index.js +36 -54
- package/lib/DevelopmentLogin/LoginModal.js +36 -63
- package/lib/DevelopmentLogin/index.js +21 -31
- package/lib/Ellipsis/Svg/CopySVG.js +15 -18
- package/lib/Ellipsis/Svg/TickSVG.js +10 -13
- package/lib/Ellipsis/index.js +105 -93
- package/lib/Handle/index.js +51 -87
- package/lib/Icon/fonts/iconfont.js +7 -12
- package/lib/Icon/iconList.js +1 -2
- package/lib/Icon/index.js +16 -26
- package/lib/Img/Contain.js +29 -40
- package/lib/Img/Cover.js +48 -72
- package/lib/Img/index.js +42 -58
- package/lib/Layout/ActionsContext.js +1 -5
- package/lib/Layout/AppList.js +45 -124
- package/lib/Layout/Application.js +31 -92
- package/lib/Layout/Avatar.js +36 -91
- package/lib/Layout/CompatibleLanguage.js +44 -116
- package/lib/Layout/EnterpriseLayout/Avatar.js +45 -105
- package/lib/Layout/EnterpriseLayout/Language.js +22 -54
- package/lib/Layout/EnterpriseLayout/Theme.js +21 -50
- package/lib/Layout/EnterpriseLayout/index.js +17 -27
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +64 -192
- package/lib/Layout/GlobalNavigation/index.js +28 -80
- package/lib/Layout/Header.js +36 -68
- package/lib/Layout/HeaderActions.js +51 -81
- package/lib/Layout/HeaderNavs.js +30 -70
- package/lib/Layout/HeaderTabs.js +58 -127
- package/lib/Layout/Iconfont.js +4 -9
- package/lib/Layout/Language.js +22 -54
- package/lib/Layout/Layout.js +93 -134
- package/lib/Layout/Logo.js +26 -47
- package/lib/Layout/OrgAppList.js +69 -133
- package/lib/Layout/SideMenu.js +72 -151
- package/lib/Layout/Theme.js +28 -79
- package/lib/Layout/createActions.js +3 -9
- package/lib/Layout/images/index.js +5 -36
- package/lib/Layout/index.js +35 -63
- package/lib/Layout/paaslayout/CompactSideMenu.js +40 -90
- package/lib/Layout/paaslayout/Header.js +30 -60
- package/lib/Layout/paaslayout/Logo.js +11 -24
- package/lib/Layout/paaslayout/SideMenu.js +44 -93
- package/lib/Layout/paaslayout/index.js +82 -128
- package/lib/Layout/storage.js +26 -68
- package/lib/LoadingButton/index.js +21 -36
- package/lib/Modal/index.js +45 -62
- package/lib/Page/Box.js +38 -50
- package/lib/Page/index.js +58 -84
- package/lib/Page/utils.js +5 -16
- package/lib/QueryForm/Field/Checkbox.js +10 -19
- package/lib/QueryForm/Field/Select.js +39 -60
- package/lib/QueryForm/Field/SelectInput.js +36 -65
- package/lib/QueryForm/Field/fieldsMap.js +6 -23
- package/lib/QueryForm/Field/index.js +50 -91
- package/lib/QueryForm/createActions.js +9 -16
- package/lib/QueryForm/index.js +83 -165
- package/lib/QueryForm/useForm.js +1 -6
- package/lib/QueryListScene/List.js +89 -153
- package/lib/QueryListScene/QueryForm.js +58 -101
- package/lib/QueryListScene/QueryListScene.js +31 -56
- package/lib/QueryListScene/Title.js +6 -11
- package/lib/QueryListScene/Toolbar.js +16 -22
- package/lib/QueryListScene/createActions.js +7 -13
- package/lib/QueryListScene/index.js +5 -19
- package/lib/QueryListScene/useActions.js +1 -6
- package/lib/Select/DropDownWrap.js +35 -63
- package/lib/Select/index.js +142 -245
- package/lib/Table/ResizableTable/index.js +31 -54
- package/lib/Table/index.js +21 -34
- package/lib/Title/index.js +26 -34
- package/lib/index.js +36 -57
- package/lib/locale.js +9 -25
- package/lib/utils/checkAuth.js +9 -16
- package/lib/utils/findMenuInfoByPath.js +3 -12
- package/lib/utils/index.js +26 -60
- package/package.json +3 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Describe: 省略号组件
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { useState, useEffect, useRef } from 'react';
|
|
7
|
+
import { useState, useEffect, useRef, useCallback } from 'react';
|
|
8
8
|
import { Popover, Tooltip } from 'antd';
|
|
9
9
|
import copy from 'copy-to-clipboard';
|
|
10
10
|
import CopySVG from './Svg/CopySVG';
|
|
@@ -48,23 +48,42 @@ export default props => {
|
|
|
48
48
|
const [hasCopy, setHasCopy] = useState(false);
|
|
49
49
|
|
|
50
50
|
const elementRef = useRef();
|
|
51
|
+
const timeRef = useRef();
|
|
51
52
|
|
|
52
53
|
useEffect(() => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
// 检查元素是否存在
|
|
55
|
+
if(elementRef.current){
|
|
56
|
+
const checkEllipsis = () => {
|
|
57
|
+
const isActive = isEllipsisActive(elementRef.current);
|
|
58
|
+
setFlag(isActive);
|
|
59
|
+
if (!isActive) {
|
|
60
|
+
setTipVisible(false);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// 初始检查
|
|
65
|
+
checkEllipsis();
|
|
66
|
+
|
|
67
|
+
// 监听 resize 事件,因为窗口大小变化会影响文本截断
|
|
68
|
+
window.addEventListener('resize', checkEllipsis);
|
|
69
|
+
|
|
70
|
+
return () => {
|
|
71
|
+
window.removeEventListener('resize', checkEllipsis);
|
|
72
|
+
if (timeRef.current) {
|
|
73
|
+
clearTimeout(timeRef.current);
|
|
74
|
+
timeRef.current = null;
|
|
75
|
+
}
|
|
76
|
+
elementRef.current = null;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}, [children, content, title]); // 添加必要的依赖项
|
|
80
|
+
|
|
60
81
|
|
|
61
82
|
// original Node
|
|
62
83
|
const inner = typeof children === 'string' ? children : (_popover ? content : title);
|
|
63
84
|
|
|
64
85
|
// for className
|
|
65
|
-
const getClassName =
|
|
66
|
-
return `overflow ${_lines ? 'ellipsis-wrap' : 'ellipsis-nowrap'} ${className || ''}`;
|
|
67
|
-
};
|
|
86
|
+
const getClassName = `overflow ${_lines ? 'ellipsis-wrap' : 'ellipsis-nowrap'} ${className || ''}`;
|
|
68
87
|
|
|
69
88
|
// Tooltip.trigger(default 'hover') ==trigger==> onVisibleChange(visible)
|
|
70
89
|
const handleVisibleChange = (visible) => {
|
|
@@ -76,12 +95,25 @@ export default props => {
|
|
|
76
95
|
// onClick Copy Button
|
|
77
96
|
const handleCopy = (innerText) => {
|
|
78
97
|
copy(innerText);
|
|
79
|
-
|
|
80
|
-
|
|
98
|
+
|
|
99
|
+
// 清除之前的定时器
|
|
100
|
+
if (timeRef.current) {
|
|
101
|
+
clearTimeout(timeRef.current);
|
|
102
|
+
timeRef.current = null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
setHasCopy(true); // 直接设置为 true
|
|
106
|
+
timeRef.current = setTimeout(() => {
|
|
81
107
|
setHasCopy(false);
|
|
82
108
|
}, 1000);
|
|
83
109
|
};
|
|
84
110
|
|
|
111
|
+
const handleCopyClick = useCallback(() => {
|
|
112
|
+
if (elementRef.current) {
|
|
113
|
+
handleCopy(elementRef.current.innerText);
|
|
114
|
+
}
|
|
115
|
+
}, []); // 没有外部依赖
|
|
116
|
+
|
|
85
117
|
const renderNode = () => {
|
|
86
118
|
const popoverNode = (
|
|
87
119
|
<Popover
|
|
@@ -133,7 +165,7 @@ export default props => {
|
|
|
133
165
|
{prefix && prefix}
|
|
134
166
|
{/* content */}
|
|
135
167
|
<div
|
|
136
|
-
className={getClassName
|
|
168
|
+
className={getClassName}
|
|
137
169
|
>
|
|
138
170
|
{inner ? renderNode() : emptyText}
|
|
139
171
|
</div>
|
|
@@ -144,7 +176,7 @@ export default props => {
|
|
|
144
176
|
inner && _copyable &&
|
|
145
177
|
<div
|
|
146
178
|
className='svg-button'
|
|
147
|
-
onClick={
|
|
179
|
+
onClick={handleCopyClick}
|
|
148
180
|
>
|
|
149
181
|
{
|
|
150
182
|
!hasCopy
|
|
@@ -62,7 +62,7 @@ export default class QueryForm extends React.PureComponent {
|
|
|
62
62
|
|
|
63
63
|
// memory 与 url解析setForm时 监听事件异步
|
|
64
64
|
actions.setData('formData', values);
|
|
65
|
-
Promise.resolve().then(()=>{
|
|
65
|
+
Promise.resolve().then(() => {
|
|
66
66
|
onSearch && onSearch(params);
|
|
67
67
|
actions.emit('search', params);
|
|
68
68
|
});
|
|
@@ -73,19 +73,19 @@ export default class QueryForm extends React.PureComponent {
|
|
|
73
73
|
|
|
74
74
|
actions.setFormData(initialValues, false);
|
|
75
75
|
|
|
76
|
-
onReset
|
|
76
|
+
onReset?.(initialValues);
|
|
77
77
|
this.onSearch();
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
onChange = (newValues, changedInfo, ...rest) => {
|
|
81
81
|
const { onChange, actions } = this.props;
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
actions.setFormData(newValues, false);
|
|
84
|
+
onChange?.(
|
|
84
85
|
newValues,
|
|
85
86
|
changedInfo,
|
|
86
87
|
...rest
|
|
87
88
|
);
|
|
88
|
-
actions.setFormData(newValues, false);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
setFormData = (data, needSearch) => {
|
|
@@ -21,18 +21,18 @@ export default () => {
|
|
|
21
21
|
getPagination: () => get(data, 'pagination'),
|
|
22
22
|
|
|
23
23
|
setFormData: (formData, needSearch = true) => {
|
|
24
|
-
set('formData', formData);
|
|
24
|
+
set(data, 'formData', formData);
|
|
25
25
|
eventEmitter.emit('setFormData', formData, needSearch);
|
|
26
26
|
},
|
|
27
27
|
resetFormData: (needSearch = false) => {
|
|
28
28
|
eventEmitter.emit('resetFormData', needSearch);
|
|
29
29
|
},
|
|
30
30
|
setTableDataSource: dataSource => {
|
|
31
|
-
set('dataSource', dataSource);
|
|
31
|
+
set(data, 'dataSource', dataSource);
|
|
32
32
|
eventEmitter.emit('setTableDataSource', dataSource);
|
|
33
33
|
},
|
|
34
34
|
setPagination: pagination => {
|
|
35
|
-
set('pagination', pagination);
|
|
35
|
+
set(data, 'pagination', pagination);
|
|
36
36
|
eventEmitter.emit('setPagination', pagination);
|
|
37
37
|
},
|
|
38
38
|
|
|
@@ -43,7 +43,7 @@ export default () => {
|
|
|
43
43
|
},
|
|
44
44
|
|
|
45
45
|
search: (params = {}, showLoading = true) => {
|
|
46
|
-
return new Promise((resolve
|
|
46
|
+
return new Promise((resolve) => {
|
|
47
47
|
eventEmitter.emit('search', params, {
|
|
48
48
|
callback: resolve,
|
|
49
49
|
showLoading
|
package/dist/1.tntd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonptntd=window.webpackJsonptntd||[]).push([[1],{
|
|
1
|
+
(window.webpackJsonptntd=window.webpackJsonptntd||[]).push([[1],{51:function(t,e,r){r.r(e);var u=r(0),s=r(1);function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){p(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function p(t,e,r){return(e=(t=>(t=((t,e)=>{if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);if("object"!=n(r=r.call(t,e||"default")))return r;throw new TypeError("@@toPrimitive must return a primitive value.")})(t,"string"),"symbol"==n(t)?t:t+""))(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t,e){return(t=>{if(Array.isArray(t))return t})(t)||((t,e)=>{var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,c,i=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(i.push(n.value),i.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(u)throw o}}return i}})(t,e)||((t,e)=>{var r;if(t)return"string"==typeof t?a(t,e):"Map"===(r="Object"===(r={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0})(t,e)||(()=>{throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var y=new(r(10).a),m={account:void 0,password:void 0};e.default=function(t){var e=t.visible,n=t.close,r=t.signIn,t=b(Object(u.useState)(!1),2),o=t[0],a=t[1],t=localStorage.getItem("accountInfo");if(t)try{m=JSON.parse(t)}catch(t){}function c(t,e){l(f(f({},i),{},p({},t,e.target.value)))}var t=b(Object(u.useState)(m),2),i=t[0],l=t[1],t=i.account;return React.createElement(s.Modal,{title:"开发者模拟登陆",visible:e,maskClosable:!1,onOk:function(){a(!0);var t=r&&r(i);t&&t.then&&t.then(function(r){s.message.success("模拟登陆成功"),localStorage.setItem("accountInfo",JSON.stringify(i)),a(!1),setTimeout(function(){var t=r||{},e=t.tdToken,t=t.userId;y.set("_td_token_",e,{path:"/"}),y.set("_uid_",t,{path:"/"}),n()},500)}).catch(function(t){throw a(!1),t})},onCancel:n,confirmLoading:o},React.createElement(s.Form,{labelCol:{span:5},wrapperCol:{span:18}},React.createElement(s.Form.Item,{label:"用户名:"},React.createElement(s.Input,{type:"text",placeholder:"请输入用户名",value:t||void 0,onChange:function(t){return c("account",t)}})),React.createElement(s.Form.Item,{label:"密码:"},React.createElement(s.Input,{type:"text",placeholder:"请输入用户名",value:i.password||void 0,onChange:function(t){return c("password",t)}}))))}}}]);
|