Files
sionrui/frontend/app/web-gold/src/views/content-style/components/BenchmarkForm.vue

120 lines
2.7 KiB
Vue
Raw Normal View History

2025-11-13 01:06:28 +08:00
<script setup>
import { ref } from 'vue'
2025-11-14 02:15:14 +08:00
import GradientButton from '@/components/GradientButton.vue'
2025-11-13 01:06:28 +08:00
const props = defineProps({
modelValue: {
type: Object,
required: true,
},
loading: {
type: Boolean,
default: false,
},
})
const emit = defineEmits(['update:modelValue', 'analyze', 'reset'])
const form = ref({ ...props.modelValue })
function handleAnalyze() {
emit('update:modelValue', { ...form.value })
emit('analyze')
}
function handleReset() {
form.value = { platform: '抖音', url: '', count: 20, sort_type: 0 }
emit('update:modelValue', { ...form.value })
emit('reset')
}
</script>
<template>
2026-01-27 00:39:12 +08:00
<section class="form-container">
2025-11-13 01:06:28 +08:00
<a-form :model="form" layout="vertical">
<a-form-item label="平台">
<a-radio-group v-model:value="form.platform" button-style="solid">
<a-radio-button value="抖音">抖音</a-radio-button>
</a-radio-group>
</a-form-item>
2026-01-27 00:39:12 +08:00
2025-11-13 01:06:28 +08:00
<a-form-item label="主页/视频链接">
<a-input
v-model:value="form.url"
2026-01-27 00:39:12 +08:00
placeholder="粘贴抖音主页或视频链接"
2025-11-13 01:06:28 +08:00
allow-clear
size="large"
/>
</a-form-item>
2026-01-27 00:39:12 +08:00
<a-form-item label="分析数量">
2025-11-13 01:06:28 +08:00
<div class="slider-row">
2026-01-27 00:39:12 +08:00
<a-slider v-model:value="form.count" :min="1" :max="40" :tooltip-open="true" style="flex:1" />
<a-input-number v-model:value="form.count" :min="1" :max="40" style="width:96px; margin-left:12px;" />
2025-11-13 01:06:28 +08:00
</div>
2026-01-27 00:39:12 +08:00
<div class="form-hint">建议 20-30 个内容</div>
2025-11-13 01:06:28 +08:00
</a-form-item>
2026-01-27 00:39:12 +08:00
2025-11-13 01:06:28 +08:00
<a-space>
2025-11-14 02:15:14 +08:00
<GradientButton
text="开始分析"
:loading="loading"
loading-text="分析中…"
size="middle"
@click="handleAnalyze"
/>
2026-01-27 00:39:12 +08:00
<a-button @click="handleReset">重置</a-button>
2025-11-13 01:06:28 +08:00
</a-space>
</a-form>
</section>
</template>
<style scoped>
2026-01-27 00:39:12 +08:00
.form-container {
2025-11-13 01:06:28 +08:00
background: var(--color-surface);
border-radius: 8px;
padding: 16px;
border: 1px solid var(--color-border);
}
.slider-row {
display: flex;
align-items: center;
}
.form-hint {
2025-12-28 13:49:45 +08:00
margin-top: var(--space-1);
font-size: 14px;
2025-11-13 01:06:28 +08:00
color: var(--color-text-secondary);
}
:deep(.ant-slider) {
padding: 10px 0;
}
:deep(.ant-slider-rail) {
2025-12-28 13:49:45 +08:00
background-color: var(--color-slate-200);
2025-11-13 01:06:28 +08:00
height: 4px;
}
:deep(.ant-slider-track) {
background-color: var(--color-primary);
height: 4px;
}
:deep(.ant-slider:hover .ant-slider-track) {
background-color: var(--color-primary);
}
:deep(.ant-slider-handle::after) {
box-shadow: 0 0 0 2px var(--color-primary);
}
:deep(.ant-slider-handle:focus-visible::after),
:deep(.ant-slider-handle:hover::after),
:deep(.ant-slider-handle:active::after) {
box-shadow: 0 0 0 3px var(--color-primary);
}
</style>