build: base url
This commit is contained in:
@@ -39,9 +39,12 @@ const TableRow: React.FC<
|
||||
}, [rowSelection]);
|
||||
|
||||
const handleRowExpand = async () => {
|
||||
setExpanded(!expanded);
|
||||
onExpand?.(!expanded, record);
|
||||
if (expanded) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
setExpanded(!expanded);
|
||||
onExpand?.(!expanded, record);
|
||||
setLoading(true);
|
||||
const data = await loadChildren?.(record);
|
||||
setChildrenData(data || []);
|
||||
|
||||
@@ -1,10 +1,31 @@
|
||||
.status-tag {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 2px 10px;
|
||||
border-radius: 20px;
|
||||
width: fit-content;
|
||||
min-width: 76px;
|
||||
height: 26px;
|
||||
font-size: var(--font-size-base);
|
||||
overflow: hidden;
|
||||
|
||||
.download {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
background-color: var(--ant-color-primary);
|
||||
}
|
||||
|
||||
.progress {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
color: var(--color-white-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,9 +33,22 @@ const StatusTag: React.FC<StatusTagProps> = ({ statusValue, download }) => {
|
||||
setStatusColor(StatusColorMap[status]);
|
||||
}, [status]);
|
||||
|
||||
const renderContent = () => {
|
||||
const percent = download?.percent || 0;
|
||||
|
||||
if (download && percent > 0 && percent < 100) {
|
||||
return (
|
||||
<>
|
||||
<span className="progress">{download?.percent || 0}%</span>
|
||||
<span className="download" style={{ width: `${percent}%` }}></span>
|
||||
</>
|
||||
);
|
||||
}
|
||||
return <span>{text}</span>;
|
||||
};
|
||||
return (
|
||||
<span
|
||||
className={classNames('status-tag', { download: download })}
|
||||
className={classNames('status-tag')}
|
||||
style={
|
||||
download
|
||||
? {
|
||||
@@ -48,7 +61,7 @@ const StatusTag: React.FC<StatusTagProps> = ({ statusValue, download }) => {
|
||||
}
|
||||
}
|
||||
>
|
||||
{text}
|
||||
{renderContent()}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user