tntd 1.4.7 → 1.4.10
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/DevelopmentLogin/LoginModal.js +2 -2
- package/components/Layout/HeaderTabs.js +98 -73
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +98 -98
- package/dist/tntd.js +1 -1
- package/es/DevelopmentLogin/LoginModal.js +2 -2
- package/es/Layout/HeaderTabs.js +19 -15
- package/lib/ArrayInput/icon.js +31 -27
- package/lib/ArrayInput/index.js +298 -211
- package/lib/AuthContext.js +13 -2
- package/lib/Columns/index.js +100 -71
- package/lib/DevelopmentLogin/LoginModal.js +141 -79
- package/lib/DevelopmentLogin/index.js +55 -28
- package/lib/Ellipsis/Svg/CopySVG.js +71 -23
- package/lib/Ellipsis/Svg/TickSVG.js +49 -17
- package/lib/Ellipsis/index.js +154 -148
- package/lib/Handle/index.js +109 -72
- package/lib/Icon/fonts/iconfont.js +43 -1
- package/lib/Icon/iconList.js +8 -119
- package/lib/Icon/index.js +45 -13
- package/lib/Img/Contain.js +81 -49
- package/lib/Img/Cover.js +136 -88
- package/lib/Img/index.js +89 -36
- package/lib/Layout/ActionsContext.js +11 -2
- package/lib/Layout/AppList.js +256 -262
- package/lib/Layout/Application.js +135 -119
- package/lib/Layout/Avatar.js +137 -137
- package/lib/Layout/CompatibleLanguage.js +195 -214
- package/lib/Layout/EnterpriseLayout/Avatar.js +168 -156
- package/lib/Layout/EnterpriseLayout/Language.js +100 -75
- package/lib/Layout/EnterpriseLayout/Theme.js +94 -96
- package/lib/Layout/EnterpriseLayout/index.js +45 -32
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +407 -335
- package/lib/Layout/GlobalNavigation/index.js +158 -110
- package/lib/Layout/Header.js +116 -165
- package/lib/Layout/HeaderActions.js +129 -132
- package/lib/Layout/HeaderNavs.js +113 -90
- package/lib/Layout/HeaderTabs.js +282 -312
- package/lib/Layout/Iconfont.js +15 -2
- package/lib/Layout/Language.js +102 -63
- package/lib/Layout/Layout.js +261 -272
- package/lib/Layout/Logo.js +87 -132
- package/lib/Layout/OrgAppList.js +319 -440
- package/lib/Layout/SideMenu.js +343 -429
- package/lib/Layout/Theme.js +124 -95
- package/lib/Layout/checkAuth.js +35 -21
- package/lib/Layout/createActions.js +51 -38
- package/lib/Layout/images/index.js +41 -33
- package/lib/Layout/index.js +161 -110
- package/lib/Layout/paaslayout/CompactSideMenu.js +178 -200
- package/lib/Layout/paaslayout/Header.js +90 -84
- package/lib/Layout/paaslayout/Logo.js +32 -27
- package/lib/Layout/paaslayout/SideMenu.js +174 -161
- package/lib/Layout/paaslayout/index.js +261 -240
- package/lib/Layout/storage.js +78 -20
- package/lib/Layout/utils.js +143 -93
- package/lib/LoadingButton/index.js +67 -25
- package/lib/Modal/index.js +108 -83
- package/lib/Page/Box.js +81 -56
- package/lib/Page/index.js +173 -151
- package/lib/Page/utils.js +30 -12
- package/lib/QueryForm/Field/Checkbox.js +33 -11
- package/lib/QueryForm/Field/Select.js +99 -63
- package/lib/QueryForm/Field/SelectInput.js +114 -69
- package/lib/QueryForm/Field/fieldsMap.js +52 -30
- package/lib/QueryForm/Field/index.js +158 -76
- package/lib/QueryForm/createActions.js +65 -50
- package/lib/QueryForm/index.js +383 -304
- package/lib/QueryForm/useForm.js +17 -6
- package/lib/QueryListScene/List.js +366 -290
- package/lib/QueryListScene/QueryForm.js +161 -93
- package/lib/QueryListScene/QueryListScene.js +87 -33
- package/lib/QueryListScene/Title.js +20 -10
- package/lib/QueryListScene/Toolbar.js +31 -8
- package/lib/QueryListScene/createActions.js +79 -64
- package/lib/QueryListScene/index.js +40 -23
- package/lib/QueryListScene/useActions.js +17 -6
- package/lib/Select/DropDownWrap.js +124 -60
- package/lib/Select/index.js +561 -425
- package/lib/Table/ResizableTable/index.js +121 -77
- package/lib/Table/index.js +51 -19
- package/lib/Title/index.js +52 -34
- package/lib/index.js +159 -19
- package/lib/locale.js +63 -48
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useState, useEffect, useRef } from
|
|
2
|
-
import styled, { withTheme } from
|
|
3
|
-
import cn from
|
|
4
|
-
import { get } from
|
|
5
|
-
import Icon from
|
|
1
|
+
import { useState, useEffect, useRef } from "react";
|
|
2
|
+
import styled, { withTheme } from "styled-components";
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
import { get } from "lodash";
|
|
5
|
+
import Icon from "../Icon";
|
|
6
6
|
|
|
7
7
|
const TabsContainer = styled.div`
|
|
8
8
|
display: flex;
|
|
@@ -69,8 +69,8 @@ const Tabs = styled.ul`
|
|
|
69
69
|
flex: 1;
|
|
70
70
|
white-space: nowrap;
|
|
71
71
|
padding-right: 40px;
|
|
72
|
-
transition: transform .25s linear;
|
|
73
|
-
position:absolute;
|
|
72
|
+
transition: transform 0.25s linear;
|
|
73
|
+
position: absolute;
|
|
74
74
|
`;
|
|
75
75
|
const TabItem = styled.li`
|
|
76
76
|
position: relative;
|
|
@@ -78,7 +78,7 @@ const TabItem = styled.li`
|
|
|
78
78
|
padding: 0 20px 0 10px;
|
|
79
79
|
cursor: pointer;
|
|
80
80
|
display: inline-block;
|
|
81
|
-
line-height: ${props => props.theme.size ===
|
|
81
|
+
line-height: ${props => (props.theme.size === "large" ? "46px" : "36px")};
|
|
82
82
|
/* transition: background-color .5; */
|
|
83
83
|
width: 130px;
|
|
84
84
|
color: rgba(255,255,255,.6);
|
|
@@ -120,7 +120,7 @@ const TabItem = styled.li`
|
|
|
120
120
|
|
|
121
121
|
a {
|
|
122
122
|
font-size: 14px;
|
|
123
|
-
color: ${props=>props.theme.headerActionsColor};//rgba(255,255,255,.6);
|
|
123
|
+
color: ${props => props.theme.headerActionsColor};//rgba(255,255,255,.6);
|
|
124
124
|
text-rendering: optimizeLegibility;
|
|
125
125
|
-webkit-font-smoothing: antialiased;
|
|
126
126
|
-moz-osx-font-smoothing: grayscale;
|
|
@@ -163,8 +163,20 @@ const TabItem = styled.li`
|
|
|
163
163
|
`;
|
|
164
164
|
|
|
165
165
|
export const HeaderTabs = withTheme(
|
|
166
|
-
({
|
|
167
|
-
|
|
166
|
+
({
|
|
167
|
+
theme,
|
|
168
|
+
className,
|
|
169
|
+
tabs = [],
|
|
170
|
+
onTabChange,
|
|
171
|
+
onTabSelect,
|
|
172
|
+
onTabClose,
|
|
173
|
+
appListVisible,
|
|
174
|
+
orgListVisible,
|
|
175
|
+
orgAppListVisible,
|
|
176
|
+
language,
|
|
177
|
+
...props
|
|
178
|
+
}) => {
|
|
179
|
+
const [selectedKey, setSelectedKey] = useState(props.selectedKey || get(tabs, "0.key"));
|
|
168
180
|
const [tabItems, setTabItems] = useState(tabs || []);
|
|
169
181
|
const [arrowVisible, setArrowVisible] = useState(false);
|
|
170
182
|
const [tabsPositionFlags, setTabsPositionFlags] = useState({ start: true, end: true });
|
|
@@ -172,8 +184,7 @@ export const HeaderTabs = withTheme(
|
|
|
172
184
|
|
|
173
185
|
const getTabsDom = () => tabsRef.current;
|
|
174
186
|
|
|
175
|
-
const onTabClick = (tab,index) => {
|
|
176
|
-
|
|
187
|
+
const onTabClick = (tab, index) => {
|
|
177
188
|
setSelectedKey(tab.key);
|
|
178
189
|
onTabSelect?.(tab);
|
|
179
190
|
|
|
@@ -191,84 +202,86 @@ export const HeaderTabs = withTheme(
|
|
|
191
202
|
newSelectedKey = index === 0 ? newTabItems[0]?.key : newTabItems[index - 1]?.key;
|
|
192
203
|
setSelectedKey(newSelectedKey);
|
|
193
204
|
}
|
|
194
|
-
onTabClose?.(
|
|
205
|
+
onTabClose?.(
|
|
206
|
+
tab,
|
|
207
|
+
newTabItems,
|
|
208
|
+
newTabItems.find(({ key }) => key === newSelectedKey)
|
|
209
|
+
);
|
|
195
210
|
};
|
|
196
211
|
const onMoveToLeft = () => {
|
|
197
212
|
const tabsDom = getTabsDom();
|
|
198
213
|
const parentBBox = tabsDom.parentNode.getBoundingClientRect();
|
|
199
214
|
const parentWidth = parentBBox.width - 32;
|
|
200
|
-
let x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g,
|
|
201
|
-
const index = Math.ceil(x/130);
|
|
202
|
-
const trueX = index*130;
|
|
203
|
-
let newX
|
|
215
|
+
let x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ""));
|
|
216
|
+
const index = Math.ceil(x / 130);
|
|
217
|
+
const trueX = index * 130;
|
|
218
|
+
let newX = Math.min(0, -(trueX - parentWidth));
|
|
204
219
|
tabsDom.style.transform = `translateX(${newX}px)`;
|
|
205
220
|
|
|
206
|
-
const width = tabItems.length*130;
|
|
221
|
+
const width = tabItems.length * 130;
|
|
207
222
|
setTabsPositionFlags({
|
|
208
|
-
start: newX<0,
|
|
209
|
-
end:
|
|
223
|
+
start: newX < 0,
|
|
224
|
+
end: Math.abs(newX) < width - parentWidth,
|
|
210
225
|
});
|
|
211
226
|
};
|
|
212
227
|
const onMoveToRight = () => {
|
|
213
228
|
const tabsDom = getTabsDom();
|
|
214
229
|
const parentBBox = tabsDom.parentNode.getBoundingClientRect();
|
|
215
230
|
const parentWidth = parentBBox.width - 32;
|
|
216
|
-
const width = tabItems.length*130;
|
|
231
|
+
const width = tabItems.length * 130;
|
|
217
232
|
|
|
218
|
-
let x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g,
|
|
219
|
-
const index = Math.floor(x/130);
|
|
220
|
-
const trueX = index*130;
|
|
221
|
-
let newX
|
|
233
|
+
let x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ""));
|
|
234
|
+
const index = Math.floor(x / 130);
|
|
235
|
+
const trueX = index * 130;
|
|
236
|
+
let newX = Math.max(-(width - parentWidth), -(trueX + parentWidth));
|
|
222
237
|
tabsDom.style.transform = `translateX(${newX}px)`;
|
|
223
238
|
|
|
224
239
|
setTabsPositionFlags({
|
|
225
|
-
start: newX<0,
|
|
226
|
-
end:
|
|
240
|
+
start: newX < 0,
|
|
241
|
+
end: Math.abs(newX) < width - parentWidth,
|
|
227
242
|
});
|
|
228
243
|
};
|
|
229
244
|
|
|
230
245
|
const translateTabsDom = (tabs, selectedKey) => {
|
|
231
|
-
if(!selectedKey)return;
|
|
246
|
+
if (!selectedKey) return;
|
|
232
247
|
const index = tabs.indexOf(tabs.find(({ key }) => key === selectedKey));
|
|
233
|
-
if(index
|
|
248
|
+
if (index === -1) return;
|
|
234
249
|
const tabsDom = getTabsDom();
|
|
235
|
-
let x =
|
|
250
|
+
let x = -+tabsDom.style.transform.replace(/[^\d.-]/g, "");
|
|
236
251
|
const bbox = {
|
|
237
|
-
left:index*130,
|
|
238
|
-
right:(index+1)*130
|
|
252
|
+
left: index * 130,
|
|
253
|
+
right: (index + 1) * 130,
|
|
239
254
|
};
|
|
240
255
|
const parentBBox = tabsDom.parentNode.getBoundingClientRect();
|
|
241
256
|
const parentWidth = parentBBox.width - 36;
|
|
242
|
-
const width = tabItems.length*130;
|
|
257
|
+
const width = tabItems.length * 130;
|
|
243
258
|
|
|
244
|
-
let tailX = x + parentWidth
|
|
259
|
+
let tailX = x + parentWidth; //当前滑动窗口尾部坐标
|
|
245
260
|
let newX = -x;
|
|
246
|
-
if(bbox.left<x){
|
|
261
|
+
if (bbox.left < x) {
|
|
247
262
|
newX = -bbox.left;
|
|
248
|
-
}else if(bbox.right>=tailX){
|
|
263
|
+
} else if (bbox.right >= tailX) {
|
|
249
264
|
newX = parentWidth - bbox.right;
|
|
250
265
|
}
|
|
251
|
-
if(newX+width<parentWidth){
|
|
266
|
+
if (newX + width < parentWidth) {
|
|
252
267
|
newX = -(width - parentWidth);
|
|
253
268
|
}
|
|
254
|
-
newX = Math.min(0,newX);
|
|
269
|
+
newX = Math.min(0, newX);
|
|
255
270
|
tabsDom.style.transform = `translateX(${newX}px)`;
|
|
256
|
-
|
|
271
|
+
|
|
257
272
|
setTabsPositionFlags({
|
|
258
|
-
start: newX<0,
|
|
259
|
-
end: Math.abs(newX)<
|
|
273
|
+
start: newX < 0,
|
|
274
|
+
end: Math.abs(newX) < width - parentWidth,
|
|
260
275
|
});
|
|
261
276
|
};
|
|
262
277
|
|
|
263
278
|
useEffect(() => {
|
|
264
|
-
setSelectedKey(props.selectedKey || get(tabs,
|
|
279
|
+
setSelectedKey(props.selectedKey || get(tabs, "0.key"));
|
|
265
280
|
// const t = [{'code':'tagdata','enName':'tagdata','icon':'layer-color','menuName':'打标数据管理打标数据管理打标数据管理','path':'/orion/tag/datalist','key':'tagdata','name':'打标数据管理打标数据管理打标数据管理'},{'code':'taglist','enName':'taglist','icon':'home','menuName':'标签管理','path':'http://baidu.com/orion/tag/list','key':'taglist','name':'标签管理'},{'code':'relation1','enName':'dadicasesearch1','icon':'home','menuName':'案件检索1','path':'/orion/case/relation1','key':'relation1','name':'案件检索1'},{'code':'dadicasesearch-0','enName':'dadicasesearch','icon':'home','menuName':'案件检索-0','path':'/orion/case/relation0','key':'dadicasesearch-0','name':'案件检索-0'},{'code':'dadicasesearch-1','enName':'dadicasesearch','icon':'home','menuName':'案件检索-1','path':'/orion/case/relation1','key':'dadicasesearch-1','name':'案件检索-1'},{'code':'dadicasesearch-2','enName':'dadicasesearch','icon':'home','menuName':'案件检索-2','path':'/orion/case/relation2','key':'dadicasesearch-2','name':'案件检索-2'},{'code':'dadicasesearch-3','enName':'dadicasesearch','icon':'home','menuName':'案件检索-3','path':'/orion/case/relation3','key':'dadicasesearch-3','name':'案件检索-3'},{'code':'dadicasesearch-4','enName':'dadicasesearch','icon':'home','menuName':'案件检索-4','path':'/orion/case/relation4','key':'dadicasesearch-4','name':'案件检索-4'},{'code':'dadicasesearch-5','enName':'dadicasesearch','icon':'home','menuName':'案件检索-5','path':'/orion/case/relation5','key':'dadicasesearch-5','name':'案件检索-5'},{'code':'dadicasesearch-6','enName':'dadicasesearch','icon':'home','menuName':'案件检索-6','path':'/orion/case/relation6','key':'dadicasesearch-6','name':'案件检索-6'},{'code':'dadicasesearch-7','enName':'dadicasesearch','icon':'home','menuName':'案件检索-7','path':'/orion/case/relation7','key':'dadicasesearch-7','name':'案件检索-7'},{'code':'dadicasesearch-8','enName':'dadicasesearch','icon':'home','menuName':'案件检索-8','path':'/orion/case/relation8','key':'dadicasesearch-8','name':'案件检索-8'}] ;
|
|
266
281
|
setTabItems(tabs);
|
|
267
282
|
}, [tabs, props.selectedKey]);
|
|
268
283
|
|
|
269
|
-
useEffect(()=>{
|
|
270
|
-
|
|
271
|
-
},[props.orgAppListVisible]);
|
|
284
|
+
useEffect(() => {}, [props.orgAppListVisible]);
|
|
272
285
|
|
|
273
286
|
useEffect(() => {
|
|
274
287
|
const tabsDom = getTabsDom();
|
|
@@ -283,38 +296,50 @@ export const HeaderTabs = withTheme(
|
|
|
283
296
|
return (
|
|
284
297
|
<TabsContainer
|
|
285
298
|
{...props}
|
|
286
|
-
className={cn(
|
|
299
|
+
className={cn("tnt-layout-header-tabs", { [className]: className })}
|
|
287
300
|
>
|
|
288
301
|
<Tabs className="tnt-layout-header-tabs-content" ref={tabsRef}>
|
|
289
|
-
{
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
>
|
|
300
|
-
<a href={tab.key} onClick={evt => evt.preventDefault()}>{tab.name}</a>
|
|
302
|
+
{tabItems.map((tab, index) => (
|
|
303
|
+
<TabItem
|
|
304
|
+
key={tab.key}
|
|
305
|
+
theme={theme}
|
|
306
|
+
className={cn({
|
|
307
|
+
active: selectedKey === tab.key,
|
|
308
|
+
activeTabPreSibling: tabItems[index + 1]?.key === selectedKey,
|
|
309
|
+
})}
|
|
310
|
+
onClick={() => onTabClick(tab, index)}
|
|
311
|
+
>
|
|
312
|
+
<a href={tab.key} onClick={evt => evt.preventDefault()}>
|
|
301
313
|
{
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
314
|
+
{
|
|
315
|
+
cn: tab.name,
|
|
316
|
+
en: tab.enName || tab.name,
|
|
317
|
+
}[language || "cn"]
|
|
305
318
|
}
|
|
306
|
-
</
|
|
307
|
-
|
|
308
|
-
|
|
319
|
+
</a>
|
|
320
|
+
{tab.closable !== false && tabItems.length > 1 && (
|
|
321
|
+
<Icon
|
|
322
|
+
type="close"
|
|
323
|
+
onClick={closeTabHandle.bind(null, tab, index)}
|
|
324
|
+
/>
|
|
325
|
+
)}
|
|
326
|
+
</TabItem>
|
|
327
|
+
))}
|
|
309
328
|
</Tabs>
|
|
310
|
-
{
|
|
311
|
-
|
|
312
|
-
<
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
329
|
+
{arrowVisible && (
|
|
330
|
+
<div className="tnt-layout-header-tabs-arrows">
|
|
331
|
+
<Icon
|
|
332
|
+
type="left"
|
|
333
|
+
onClick={onMoveToLeft}
|
|
334
|
+
disabled={!tabsPositionFlags.start}
|
|
335
|
+
/>
|
|
336
|
+
<Icon
|
|
337
|
+
type="right"
|
|
338
|
+
onClick={onMoveToRight}
|
|
339
|
+
disabled={!tabsPositionFlags.end}
|
|
340
|
+
/>
|
|
341
|
+
</div>
|
|
342
|
+
)}
|
|
318
343
|
</TabsContainer>
|
|
319
344
|
);
|
|
320
345
|
}
|
package/dist/1.tntd.js
CHANGED
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
object-assign
|
|
10
10
|
(c) Sindre Sorhus
|
|
11
11
|
@license MIT
|
|
12
|
-
*/var c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},n)).join("")?void 0:1}catch(e){return}}()?Object.assign:function(e,t){for(var r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var i in r=Object(arguments[o]))u.call(r,i)&&(n[i]=r[i]);if(c)for(var a=c(r),s=0;s<a.length;s++)p.call(r,a[s])&&(n[a[s]]=r[a[s]])}return n}},90:function(e,t,r){"use strict";r.r(t);var p=r(0),l=r(1),o=r(88);function i(e,t){void 0===t&&(t={});var r,n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(r=n,!(t=void 0===(t=t.doNotParse)?!r||"{"!==r[0]&&"["!==r[0]&&'"'!==r[0]:t))try{return JSON.parse(n)}catch(e){}return e}var a=r(89);function n(e,t){var r=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=(t=t,"string"==typeof(e=e)?o.parse(e,t):"object"==typeof e&&null!==e?e:{}),new Promise(function(){r.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie}).catch(function(){})}function f(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function
|
|
12
|
+
*/var c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},n)).join("")?void 0:1}catch(e){return}}()?Object.assign:function(e,t){for(var r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var i in r=Object(arguments[o]))u.call(r,i)&&(n[i]=r[i]);if(c)for(var a=c(r),s=0;s<a.length;s++)p.call(r,a[s])&&(n[a[s]]=r[a[s]])}return n}},90:function(e,t,r){"use strict";r.r(t);var p=r(0),l=r(1),o=r(88);function i(e,t){void 0===t&&(t={});var r,n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(r=n,!(t=void 0===(t=t.doNotParse)?!r||"{"!==r[0]&&"["!==r[0]&&'"'!==r[0]:t))try{return JSON.parse(n)}catch(e){}return e}var a=r(89);function n(e,t){var r=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=(t=t,"string"==typeof(e=e)?o.parse(e,t):"object"==typeof e&&null!==e?e:{}),new Promise(function(){r.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie}).catch(function(){})}function f(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var m=new(n.prototype._updateBrowserValues=function(e){this.HAS_DOCUMENT_COOKIE&&(this.cookies=o.parse(document.cookie,e))},n.prototype._emitChange=function(e){for(var t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)},n.prototype.get=function(e,t,r){return void 0===t&&(t={}),this._updateBrowserValues(r),i(this.cookies[e],t)},n.prototype.getAll=function(e,t){void 0===e&&(e={}),this._updateBrowserValues(t);var r,n={};for(r in this.cookies)n[r]=i(this.cookies[r],e);return n},n.prototype.set=function(e,t,r){var n;"object"==typeof t&&(t=JSON.stringify(t)),this.cookies=a({},this.cookies,((n={})[e]=t,n)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=o.serialize(e,t,r)),this._emitChange({name:e,value:t,options:r})},n.prototype.remove=function(e,t){var r=t=a({},t,{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=a({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=o.serialize(e,"",r)),this._emitChange({name:e,value:void 0,options:t})},n.prototype.addChangeListener=function(e){this.changeListeners.push(e)},n.prototype.removeChangeListener=function(e){e=this.changeListeners.indexOf(e);0<=e&&this.changeListeners.splice(e,1)},n),y={account:void 0,password:void 0};t.default=function(e){var t=e.visible,n=e.close,r=e.signIn,o=d(Object(p.useState)(!1),2),i=o[0],a=o[1],e=localStorage.getItem("accountInfo");if(e)try{y=JSON.parse(e)}catch(e){}function s(e,t){u(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach(function(e){h(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},c,h({},e,t.target.value)))}var o=d(Object(p.useState)(y),2),c=o[0],u=o[1],e=c.account,o=c.password;return React.createElement(l.Modal,{title:"开发者模拟登陆",visible:t,maskClosable:!1,onOk:function(){a(!0);var e=r&&r(c);e&&e.then&&e.then(function(r){l.message.success("模拟登陆成功"),localStorage.setItem("accountInfo",JSON.stringify(c)),a(!1),setTimeout(function(){var e=r||{},t=e.tdToken,e=e.userId;m.set("_td_token_",t,{path:"/"}),m.set("_uid_",e,{path:"/"}),n()},500)}).catch(function(e){throw a(!1),e})},onCancel:n,confirmLoading:i},React.createElement(l.Form,{labelCol:{span:5},wrapperCol:{span:18}},React.createElement(l.Form.Item,{label:"用户名:"},React.createElement(l.Input,{type:"text",placeholder:"请输入用户名",value:e||void 0,onChange:function(e){return s("account",e)}})),React.createElement(l.Form.Item,{label:"密码:"},React.createElement(l.Input,{type:"text",placeholder:"请输入用户名",value:o||void 0,onChange:function(e){return s("password",e)}}))))}}}]);
|