feat(platform): copy quality filter links
This commit is contained in:
@@ -43,6 +43,10 @@ function qualityParams(values: Record<string, string>) {
|
||||
return params;
|
||||
}
|
||||
|
||||
function qualityShareURL() {
|
||||
return `${window.location.origin}${window.location.pathname}${window.location.hash}`;
|
||||
}
|
||||
|
||||
async function copyText(value: string, label: string) {
|
||||
const text = value.trim();
|
||||
if (!text) {
|
||||
@@ -57,6 +61,10 @@ async function copyText(value: string, label: string) {
|
||||
}
|
||||
}
|
||||
|
||||
async function copyQualityShareURL() {
|
||||
await copyText(qualityShareURL(), '筛选链接');
|
||||
}
|
||||
|
||||
export function Quality({
|
||||
onOpenVehicle,
|
||||
onHealthLoaded,
|
||||
@@ -194,6 +202,7 @@ export function Quality({
|
||||
</Form.Select>
|
||||
<Space>
|
||||
<Button htmlType="submit" theme="solid" type="primary">筛选</Button>
|
||||
<Button icon={<IconCopy />} onClick={copyQualityShareURL}>复制筛选链接</Button>
|
||||
<Button onClick={() => {
|
||||
applyFilters({});
|
||||
}}>重置</Button>
|
||||
|
||||
Reference in New Issue
Block a user