feat(platform): copy vehicle filter links
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { IconCopy } from '@douyinfe/semi-icons';
|
||||
import { Button, Card, Form, Select, Space, Table, Tag, Toast } from '@douyinfe/semi-ui';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { api } from '../api/client';
|
||||
@@ -32,6 +33,15 @@ function sourceEvidenceText(row: VehicleCoverageRow) {
|
||||
return `${row.onlineSourceCount}/${row.sourceCount} 来源在线`;
|
||||
}
|
||||
|
||||
async function copyVehicleShareURL() {
|
||||
try {
|
||||
await navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}${window.location.hash}`);
|
||||
Toast.success('已复制筛选链接');
|
||||
} catch {
|
||||
Toast.error('复制筛选链接失败');
|
||||
}
|
||||
}
|
||||
|
||||
export function Vehicles({
|
||||
onOpenVehicle,
|
||||
onFiltersChange,
|
||||
@@ -158,6 +168,7 @@ export function Vehicles({
|
||||
</Form.Select>
|
||||
<Space>
|
||||
<Button htmlType="submit" theme="solid" type="primary">查询</Button>
|
||||
<Button icon={<IconCopy />} onClick={copyVehicleShareURL}>复制筛选链接</Button>
|
||||
<Button onClick={() => {
|
||||
applyFilters({});
|
||||
}}>重置</Button>
|
||||
|
||||
Reference in New Issue
Block a user