账号导入--可以直接打标签
This commit is contained in:
@@ -25,6 +25,7 @@ export default function AccountsPage() {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [importOpen, setImportOpen] = useState(false);
|
||||
const [importText, setImportText] = useState('');
|
||||
const [importTag, setImportTag] = useState('');
|
||||
const [importing, setImporting] = useState(false);
|
||||
const [tagFilter, setTagFilter] = useState<string>('');
|
||||
const [searchText, setSearchText] = useState('');
|
||||
@@ -137,10 +138,11 @@ export default function AccountsPage() {
|
||||
}
|
||||
setImporting(true);
|
||||
try {
|
||||
const result = await accountApi.import(importText);
|
||||
const result = await accountApi.import(importText, importTag);
|
||||
message.success(result.message);
|
||||
setImportOpen(false);
|
||||
setImportText('');
|
||||
setImportTag('');
|
||||
loadAccounts();
|
||||
loadTags();
|
||||
loadSummary();
|
||||
@@ -375,7 +377,7 @@ export default function AccountsPage() {
|
||||
</Popconfirm>
|
||||
)}
|
||||
{canImport && (
|
||||
<Button type="primary" icon={<ImportOutlined />} onClick={() => setImportOpen(true)}>
|
||||
<Button type="primary" icon={<ImportOutlined />} onClick={() => { setImportTag(''); setImportOpen(true); }}>
|
||||
批量导入
|
||||
</Button>
|
||||
)}
|
||||
@@ -480,6 +482,17 @@ export default function AccountsPage() {
|
||||
placeholder={`用户名|密码|邮箱|邮箱密码|标签\n用户名|密码|邮箱|邮箱密码|标签`}
|
||||
style={{ marginTop: 8 }}
|
||||
/>
|
||||
<div style={{ marginTop: 12 }}>
|
||||
<Text type="secondary">统一标签(可选):未在行内写标签的账号将使用此标签</Text>
|
||||
<Select
|
||||
mode="tags"
|
||||
style={{ width: '100%', marginTop: 4 }}
|
||||
placeholder="输入或选择标签"
|
||||
value={importTag ? [importTag] : []}
|
||||
onChange={(vals) => setImportTag(vals.length > 0 ? vals[vals.length - 1] : '')}
|
||||
options={tags.map((t) => ({ value: t, label: t }))}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
|
||||
Reference in New Issue
Block a user