刘嘉昕 | b845fa0 | 2025-06-09 17:34:59 +0800 | [diff] [blame] | 1 | import React, { useState, useEffect } from 'react'; |
| 2 | import axios from 'axios'; |
| 3 | import "../upload.css"; |
| 4 | import "../uploadtorrent.css"; |
| 5 | import { Form, Input, Select, Button, Typography, Space, message,Switch } from 'antd'; |
| 6 | import { useParams, useNavigate, useLocation, useSearchParams } from 'react-router-dom'; // 添加 useLocation |
| 7 | import { InboxOutlined } from '@ant-design/icons'; |
| 8 | const { TextArea } = Input; |
| 9 | const { Text } = Typography; |
| 10 | |
| 11 | |
| 12 | function UploadTorrentFull() { |
| 13 | const [userid,setuserid] = useState(1); |
| 14 | const [title, setTitle] = useState(''); |
| 15 | const [description, setDescription] = useState(''); |
| 16 | const [categoryId, setCategoryId] = useState(''); |
| 17 | const [file, setFile] = useState(null); |
| 18 | const [categories, setCategories] = useState([]); |
| 19 | const [showSuccess, setShowSuccess] = useState(false); |
| 20 | const [form] = Form.useForm(); |
| 21 | const location = useLocation(); // 添加这行获取location对象 |
| 22 | // 在组件状态中添加 |
| 23 | // 获取参数并设置默认值 |
| 24 | //const [manageId, setManageId] = useState(parseInt(searchParams.get('manageid')) || 1); |
| 25 | // 正确从location.state获取参数 |
| 26 | const {requestid} = location.state || {}; |
| 27 | |
| 28 | // 通用参数 |
| 29 | const [dpi, setDpi] = useState(''); |
| 30 | const [caption, setCaption] = useState(''); |
| 31 | const [region, setRegion] = useState(''); |
| 32 | const [year, setYear] = useState(''); |
| 33 | const [genre, setGenre] = useState(''); |
| 34 | const [format, setFormat] = useState(''); |
| 35 | const [resolution, setResolution] = useState(''); |
| 36 | const [coverImage, setCoverImage] = useState(null); |
| 37 | |
| 38 | // 特殊参数 |
| 39 | const [codecFormat, setCodecFormat] = useState(''); |
| 40 | const [platform, setPlatform] = useState(''); |
| 41 | const [language, setLanguage] = useState(''); |
| 42 | const [eventType, setEventType] = useState(''); |
| 43 | const [source, setSource] = useState(''); |
| 44 | const [style, setStyle] = useState(''); |
| 45 | const [dataType, setdataType] = useState(''); |
| 46 | const [isMainland, setIsMainland] = useState(false); |
| 47 | |
| 48 | // 根据分类显示不同的表单字段 |
| 49 | const [showMovieFields, setShowMovieFields] = useState(false); |
| 50 | const [showMusicFields, setShowMusicFields] = useState(false); |
| 51 | const [showGameFields, setShowGameFields] = useState(false); |
| 52 | const [showTvFields, setShowTvFields] = useState(false); |
| 53 | const [showAnimeFields, setShowAnimeFields] = useState(false); |
| 54 | const [showlearningFields, setShowlearningFields] = useState(false); |
| 55 | const [showsoftwareFields, setShowsoftwareFields] = useState(false); |
| 56 | const [showvarietyFields, setShowvarietyFields] = useState(false); |
| 57 | const [showsportsFields, setShowsportsFields] = useState(false); |
| 58 | const [showdocFields, setShowdocFields] = useState(false); |
| 59 | const [showotherFields, setShowotherFields] = useState(false); |
| 60 | // 其他分类字段... |
| 61 | // 编码格式选项 |
| 62 | const codecFormats = [ |
| 63 | { value: 'H.264', label: 'H.264' }, |
| 64 | { value: 'H.265', label: 'H.265' }, |
| 65 | { value: 'AV1', label: 'AV1' }, |
| 66 | { value: 'VP9', label: 'VP9' }, |
| 67 | { value: 'VC1', label: 'VC1' }, |
| 68 | { value: 'X264', label: 'X264' }, |
| 69 | ]; |
| 70 | const regions = [ |
| 71 | { value: '大陆', label: '大陆' }, |
| 72 | { value: '港台', label: '港台' }, |
| 73 | { value: '欧美', label: '欧美' }, |
| 74 | { value: '日韩', label: '日韩' }, |
| 75 | { value: '其他', label: '其他' }, |
| 76 | ]; |
| 77 | const genres = [ |
| 78 | { value: '动作', label: '动作' }, |
| 79 | { value: '喜剧', label: '喜剧' }, |
| 80 | { value: '爱情', label: '爱情' }, |
| 81 | { value: '科幻', label: '科幻' }, |
| 82 | { value: '恐怖', label: '恐怖' }, |
| 83 | { value: '动作', label: '动作' }, |
| 84 | { value: '冒险', label: '冒险' }, |
| 85 | { value: '历史', label: '历史' }, |
| 86 | { value: '悬疑', label: '悬疑' }, |
| 87 | { value: '其他', label: '其他' }, |
| 88 | ]; |
| 89 | const resolutions = [ |
| 90 | { value: '720p', label: '720p' }, |
| 91 | { value: '1080p', label: '1080p' }, |
| 92 | { value: '2K', label: '2K' }, |
| 93 | { value: '4K', label: '4K' }, |
| 94 | { value: '8K', label: '8K' }, |
| 95 | { value: '其他', label: '其他' }, |
| 96 | ]; |
| 97 | |
| 98 | |
| 99 | const eventTypes = [ |
| 100 | { value: '足球', label: '足球' }, |
| 101 | { value: '篮球', label: '篮球' }, |
| 102 | { value: '网球', label: '网球' }, |
| 103 | { value: '乒乓球', label: '乒乓球' }, |
| 104 | { value: '羽毛球', label: '羽毛球' }, |
| 105 | ] |
| 106 | const styles = [ |
| 107 | { value: '大陆综艺', label: '大陆综艺' }, |
| 108 | { value: '日韩综艺', label: '日韩综艺' }, |
| 109 | { value: '欧美综艺', label: '欧美综艺' }, |
| 110 | { value: '其他', label: '其他' }, |
| 111 | ] |
| 112 | const platforms = [ |
| 113 | { value: 'PC', label: 'PC' }, |
| 114 | { value: 'PS5', label: 'PS5' }, |
| 115 | { value: 'Xbox', label: 'Xbox' }, |
| 116 | { value: 'Switch', label: 'Switch' }, |
| 117 | { value: '手机', label: '手机' }, |
| 118 | { value: '其他', label: '其他' }, |
| 119 | ] |
| 120 | const gamegenres = [ |
| 121 | { value: '角色扮演', label: '角色扮演' }, |
| 122 | { value: '射击', label: '射击' }, |
| 123 | { value: '冒险', label: '冒险' }, |
| 124 | { value: '策略', label: '策略' }, |
| 125 | { value: '体育', label: '体育' }, |
| 126 | { value: '桌面游戏', label: '桌面游戏'}, |
| 127 | { value: '其他', label: '其他' }, |
| 128 | ] |
| 129 | const dataTypes = [ |
| 130 | { value: '压缩包', label: '压缩包' }, |
| 131 | { value: '补丁', label: '补丁' }, |
| 132 | { value: '安装包', label: '安装包' }, |
| 133 | { value: 'nds', label: 'nds' }, |
| 134 | { value: '其他', label: '其他' }, |
| 135 | ] |
| 136 | const languages = [ |
| 137 | { value: '中文', label: '中文' }, |
| 138 | { value: '英文', label: '英文' }, |
| 139 | { value: '日文', label: '日文' }, |
| 140 | { value: '其他', label: '其他' }, |
| 141 | ] |
| 142 | const musicgenres = [ |
| 143 | { value: '专辑', label: '专辑' }, |
| 144 | { value: '单曲', label: '单曲' }, |
| 145 | { value: 'EP', label: 'EP' }, |
| 146 | { value: '现场', label: '现场' }, |
| 147 | { value: '其他', label: '其他' }, |
| 148 | ] |
| 149 | const musicstyles = [ |
| 150 | { value: '流行', label: '流行' }, |
| 151 | { value: '摇滚', label: '摇滚' }, |
| 152 | { value: '电子', label: '电子' }, |
| 153 | { value: '古典', label: '古典' }, |
| 154 | { value: '爵士', label: '爵士' }, |
| 155 | { value: '民谣', label: '民谣' }, |
| 156 | { value: '说唱', label: '说唱' }, |
| 157 | { value: '其他', label: '其他' }, |
| 158 | ] |
| 159 | const musicformats = [ |
| 160 | { value: 'MP3', label: 'MP3' }, |
| 161 | { value: 'FLAC', label: 'FLAC' }, |
| 162 | { value: 'WAV', label: 'WAV' }, |
| 163 | { value: 'AAC', label: 'AAC' }, |
| 164 | { value: 'OGG', label: 'OGG' }, |
| 165 | { value: '其他', label: '其他' }, |
| 166 | ] |
| 167 | const anigenres = [ |
| 168 | { value: '新番连载', label: '新番连载' }, |
| 169 | { value: '剧场版', label: '剧场版' }, |
| 170 | { value: 'OVA', label: 'OVA' }, |
| 171 | { value: '完结动漫', label: '完结动漫' }, |
| 172 | { value: '其他', label: '其他' }, |
| 173 | ] |
| 174 | const animeformats = [ |
| 175 | { value: 'ZIP', label: 'ZIP' }, |
| 176 | { value: 'RAR', label: 'RAR' }, |
| 177 | { value: '7Z', label: '7Z' }, |
| 178 | { value: 'MKV', label: 'MKV' }, |
| 179 | { value: 'MP4', label: 'MP4' }, |
| 180 | { value: '其他', label: '其他' }, |
| 181 | ] |
| 182 | const varietygenres = [ |
| 183 | { value: '真人秀', label: '真人秀' }, |
| 184 | { value: '选秀', label: '选秀' }, |
| 185 | { value: '访谈', label: '访谈' }, |
| 186 | { value: '游戏', label: '游戏' }, |
| 187 | { value: '音乐', label: '音乐' }, |
| 188 | { value: '其他', label: '其他' }, |
| 189 | ] |
| 190 | const sportsgenres = [ |
| 191 | { value: '足球', label: '足球' }, |
| 192 | { value: '篮球', label: '篮球' }, |
| 193 | { value: '网球', label: '网球' }, |
| 194 | { value: '乒乓球', label: '乒乓球' }, |
| 195 | { value: '羽毛球', label: '羽毛球' }, |
| 196 | { value: '其他', label: '其他' }, |
| 197 | ] |
| 198 | const softwaregenres = [ |
| 199 | { value: '系统软件', label: '系统软件' }, |
| 200 | { value: '应用软件', label: '应用软件' }, |
| 201 | { value: '游戏软件', label: '游戏软件' }, |
| 202 | { value: '驱动程序', label: '驱动程序' }, |
| 203 | { value: '办公软件', label: '办公软件' }, |
| 204 | { value: '其他', label: '其他' }, |
| 205 | ] |
| 206 | const softwareplatforms = [ |
| 207 | { value: 'Windows', label: 'Windows' }, |
| 208 | { value: 'Mac', label: 'Mac' }, |
| 209 | { value: 'Linux', label: 'Linux' }, |
| 210 | { value: 'Android', label: 'Android' }, |
| 211 | { value: 'iOS', label: 'iOS' }, |
| 212 | { value: '其他', label: '其他' }, |
| 213 | ] |
| 214 | const softwareformats = [ |
| 215 | { value: 'EXE', label: 'EXE' }, |
| 216 | { value: 'DMG', label: 'DMG' }, |
| 217 | { value: '光盘镜像', label: '光盘镜像' }, |
| 218 | { value: 'APK', label: 'APK' }, |
| 219 | { value: 'IPA', label: 'IPA' }, |
| 220 | { value: '其他', label: '其他' }, |
| 221 | ] |
| 222 | const learninggenres = [ |
| 223 | { value: '计算机', label: '计算机' }, |
| 224 | { value: '软件', label: '软件' }, |
| 225 | { value: '人文', label: '人文' }, |
| 226 | { value: '外语', label: '外语' }, |
| 227 | { value: '理工类', label: '理工类' }, |
| 228 | { value: '其他', label: '其他' }, |
| 229 | ] |
| 230 | const learningformats = [ |
| 231 | { value: 'PDF', label: 'PDF' }, |
| 232 | { value: 'EPUB', label: 'EPUB' }, |
| 233 | { value: '视频', label: '视频' }, |
| 234 | { value: '音频', label: '音频' }, |
| 235 | { value: 'PPT', label: 'PPT' }, |
| 236 | { value: '其他', label: '其他' }, |
| 237 | ] |
| 238 | const sourceTypes = [ |
| 239 | { value: 'CCTV', label: 'CCTV' }, |
| 240 | { value: '卫视', label: '卫视' }, |
| 241 | { value: '国家地理', label: '国家地理' }, |
| 242 | { value: 'BBC', label: 'BBC' }, |
| 243 | { value: 'Discovery', label: 'Discovery' }, |
| 244 | { value: '其他', label: '其他' }, |
| 245 | ] |
| 246 | const othergenres = [ |
| 247 | { value: '电子书', label: '电子书' }, |
| 248 | { value: '视频', label: '视频' }, |
| 249 | { value: 'MP3', label: 'MP3' }, |
| 250 | { value: '图片', label: '图片' }, |
| 251 | { value: '其他', label: '其他' }, |
| 252 | ] |
| 253 | useEffect(() => { |
| 254 | axios.get('http://localhost:8080/categories') |
| 255 | .then(res => setCategories(res.data)) |
| 256 | .catch(err => console.error('加载分类失败', err)); |
| 257 | }, []); |
| 258 | |
| 259 | // 根据选择的分类显示不同的表单字段 |
| 260 | useEffect(() => { |
| 261 | setShowMovieFields(categoryId === '1'); |
| 262 | setShowMusicFields(categoryId === '3'); |
| 263 | setShowGameFields(categoryId === '5'); |
| 264 | setShowTvFields(categoryId === '2'); |
| 265 | setShowAnimeFields(categoryId === '4'); |
| 266 | setShowlearningFields(categoryId === '9'); |
| 267 | setShowsoftwareFields(categoryId === '8'); |
| 268 | setShowvarietyFields(categoryId === '6'); |
| 269 | setShowsportsFields(categoryId === '7'); |
| 270 | setShowdocFields(categoryId === '10'); |
| 271 | setShowotherFields(categoryId === '11'); |
| 272 | // 其他分类... |
| 273 | }, [categoryId]); |
| 274 | |
| 275 | |
| 276 | const handleSubmit = async (e) => { |
| 277 | //e.preventDefault(); |
| 278 | if (!coverImage) { |
| 279 | alert('请选择一个 图片 文件'); |
| 280 | return; |
| 281 | } |
| 282 | if (!file) { |
| 283 | alert('请选择一个 .torrent 文件'); |
| 284 | return; |
| 285 | } |
| 286 | |
| 287 | if (!categoryId) { |
| 288 | alert('请选择分类'); |
| 289 | return; |
| 290 | } |
| 291 | |
| 292 | |
| 293 | const formData = new FormData(); |
| 294 | formData.append('userid', userid); |
| 295 | formData.append('file', file); |
| 296 | // Add cover image if it exists |
| 297 | formData.append('coverImage', coverImage); |
| 298 | formData.append('title', title); |
| 299 | formData.append('description', description); |
| 300 | formData.append('categoryId', categoryId); |
| 301 | formData.append('requestId', requestid); |
| 302 | |
| 303 | |
| 304 | // 通用参数 |
| 305 | if (dpi) formData.append('dpi', dpi); |
| 306 | if (caption) formData.append('caption', caption); |
| 307 | if (region) formData.append('region', region); |
| 308 | if (year) formData.append('year', year); |
| 309 | if (genre) formData.append('genre', genre); |
| 310 | if (format) formData.append('format', format); |
| 311 | if (resolution) formData.append('resolution', resolution); |
| 312 | |
| 313 | // 特殊参数 |
| 314 | if (codecFormat) formData.append('codecFormat', codecFormat); |
| 315 | if (platform) formData.append('platform', platform); |
| 316 | if (language) formData.append('language', language); |
| 317 | if (eventType) formData.append('eventType', eventType); |
| 318 | if (source) formData.append('source', source); |
| 319 | if (style) formData.append('style', style); |
| 320 | if (dataType) formData.append('dataType', dataType); |
| 321 | formData.append('isMainland', isMainland.toString()); |
| 322 | |
| 323 | try { |
| 324 | const response = await axios.post('http://localhost:8080/torrent/fullrequest', formData, { |
| 325 | headers: { 'Content-Type': 'multipart/form-data' }, |
| 326 | responseType: 'blob', |
| 327 | }); |
| 328 | |
| 329 | // 创建下载链接 |
| 330 | const url = window.URL.createObjectURL(new Blob([response.data])); |
| 331 | const link = document.createElement('a'); |
| 332 | link.href = url; |
| 333 | link.setAttribute('download', file.name); |
| 334 | document.body.appendChild(link); |
| 335 | link.click(); |
| 336 | link.remove(); |
| 337 | |
| 338 | // 显示成功提示 |
| 339 | setShowSuccess(true); |
| 340 | // 清空表单 |
| 341 | setTitle(''); |
| 342 | setDescription(''); |
| 343 | setCategoryId(''); |
| 344 | setFile(null); |
| 345 | // 清空其他字段... |
| 346 | } catch (err) { |
| 347 | console.error('上传失败', err.response?.data || err.message); |
| 348 | alert(err.response?.data || '上传失败,请检查后端是否启动'); |
| 349 | } |
| 350 | }; |
| 351 | |
| 352 | // return ( |
| 353 | // <div className="max-w-2xl mx-auto mt-10 p-6 bg-white shadow rounded"> |
| 354 | // <h2 className="text-2xl font-bold mb-6 text-orange-800 text-center border-b-2 border-orange-200 pb-3">上传种子</h2> |
| 355 | // <form onSubmit={handleSubmit} className="space-y-6"> |
| 356 | // {/* 封面图片 - 大型上传区域 */} |
| 357 | // <div className="form-group text-center"> |
| 358 | // <label className="upload-area text-orange-800 font-medium cursor-pointer p-8 border-2 border-dashed border-orange-300 rounded-lg hover:border-orange-400 transition-colors"> |
| 359 | // <svg xmlns="http://www.w3.org/2000/svg" className="mx-auto h-12 w-12 text-orange-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |
| 360 | // <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" /> |
| 361 | // </svg> |
| 362 | // <p className="mt-2 text-sm">点击或拖拽上传封面图片</p> |
| 363 | // <input |
| 364 | // type="file" |
| 365 | // accept="image/*" |
| 366 | // onChange={(e) => setCoverImage(e.target.files[0])} |
| 367 | // className="hidden" |
| 368 | // id="cover-image-upload" |
| 369 | // /> |
| 370 | // </label> |
| 371 | // <input |
| 372 | // type="file" |
| 373 | // accept="image/*" |
| 374 | // onChange={(e) => setCoverImage(e.target.files[0])} |
| 375 | // className="sr-only" |
| 376 | // id="cover-image-upload-real" |
| 377 | // /> |
| 378 | // </div> |
| 379 | |
| 380 | // {/* 种子文件 - 大型上传区域 */} |
| 381 | // <div className="form-group text-center"> |
| 382 | // <label className="upload-area text-orange-800 font-medium cursor-pointer p-8 border-2 border-dashed border-orange-300 rounded-lg hover:border-orange-400 transition-colors"> |
| 383 | // <svg xmlns="http://www.w3.org/2000/svg" className="mx-auto h-12 w-12 text-orange-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |
| 384 | // <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" /> |
| 385 | // </svg> |
| 386 | // <p className="mt-2 text-sm">点击或拖拽上传种子文件(.torrent)</p> |
| 387 | // <input |
| 388 | // type="file" |
| 389 | // accept=".torrent" |
| 390 | // onChange={(e) => setFile(e.target.files[0])} |
| 391 | // className="hidden" |
| 392 | // id="torrent-file-upload" |
| 393 | // required |
| 394 | // /> |
| 395 | // </label> |
| 396 | // <input |
| 397 | // type="file" |
| 398 | // accept=".torrent" |
| 399 | // onChange={(e) => setFile(e.target.files[0])} |
| 400 | // className="sr-only" |
| 401 | // id="torrent-file-upload-real" |
| 402 | // required |
| 403 | // /> |
| 404 | // </div> |
| 405 | |
| 406 | // {/* 标题 */} |
| 407 | // <div className="form-group"> |
| 408 | // <label className="form-label text-orange-800 text-center">标题</label> |
| 409 | // <input |
| 410 | // type="text" |
| 411 | // placeholder="输入种子标题" |
| 412 | // value={title} |
| 413 | // onChange={(e) => setTitle(e.target.value)} |
| 414 | // className="form-control text-center" |
| 415 | // required |
| 416 | // /> |
| 417 | // </div> |
| 418 | |
| 419 | // {/* 描述 */} |
| 420 | // <div className="form-group"> |
| 421 | // <label className="form-label text-orange-800 text-center">描述</label> |
| 422 | // <textarea |
| 423 | // placeholder="输入种子描述" |
| 424 | // value={description} |
| 425 | // onChange={(e) => setDescription(e.target.value)} |
| 426 | // className="form-control text-center" |
| 427 | // rows={3} |
| 428 | // /> |
| 429 | // </div> |
| 430 | |
| 431 | // {/* 分类 - 美化下拉框 */} |
| 432 | // <div className="form-group"> |
| 433 | // <label className="form-label text-orange-800 text-center">分类</label> |
| 434 | // <div className="relative"> |
| 435 | // <select |
| 436 | // value={categoryId} |
| 437 | // onChange={(e) => setCategoryId(e.target.value)} |
| 438 | // className="custom-select" |
| 439 | // required |
| 440 | // > |
| 441 | // <option value="">请选择分类</option> |
| 442 | // {categories.map(cat => ( |
| 443 | // <option key={cat.categoryid} value={cat.categoryid}>{cat.category_name}</option> |
| 444 | // ))} |
| 445 | // </select> |
| 446 | // <div className="select-arrow"> |
| 447 | // <svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-4 text-orange-500" viewBox="0 0 20 20" fill="currentColor"> |
| 448 | // <path fillRule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clipRule="evenodd" /> |
| 449 | // </svg> |
| 450 | // </div> |
| 451 | // </div> |
| 452 | // </div> |
| 453 | |
| 454 | // {/* 动态字段 - 电影 */} |
| 455 | // {showMovieFields && ( |
| 456 | // <> |
| 457 | // <div className="form-group"> |
| 458 | // <label className="form-label text-orange-800 text-center">字幕/说明</label> |
| 459 | // <input |
| 460 | // type="text" |
| 461 | // placeholder="输入字幕/说明" |
| 462 | // value={caption} |
| 463 | // onChange={(e) => setCaption(e.target.value)} |
| 464 | // className="form-control text-center" |
| 465 | // /> |
| 466 | // </div> |
| 467 | // <div className="form-group"> |
| 468 | // <label className="form-label text-orange-800 text-center">地区</label> |
| 469 | // <div className="relative"> |
| 470 | // <select |
| 471 | // value={region} |
| 472 | // onChange={(e) => setRegion(e.target.value)} |
| 473 | // className="custom-select" |
| 474 | // > |
| 475 | // <option value="">请选择地区</option> |
| 476 | // {regions.map((region) => ( |
| 477 | // <option key={region.value} value={region.value}> |
| 478 | // {region.label} |
| 479 | // </option> |
| 480 | // ))} |
| 481 | // </select> |
| 482 | // <div className="select-arrow"> |
| 483 | // <svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-4 text-orange-500" viewBox="0 0 20 20" fill="currentColor"> |
| 484 | // <path fillRule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clipRule="evenodd" /> |
| 485 | // </svg> |
| 486 | // </div> |
| 487 | // </div> |
| 488 | // </div> |
| 489 | // <div className="form-group"> |
| 490 | // <label className="form-label text-orange-800 text-center">年份</label> |
| 491 | // <input |
| 492 | // type="text" |
| 493 | // placeholder="输入年份" |
| 494 | // value={year} |
| 495 | // onChange={(e) => setYear(e.target.value)} |
| 496 | // className="form-control text-center" |
| 497 | // /> |
| 498 | // </div> |
| 499 | // <div className="form-group"> |
| 500 | // <label className="form-label text-orange-800 text-center">类型</label> |
| 501 | // <div className="relative"> |
| 502 | // <select |
| 503 | // value={genre} |
| 504 | // onChange={(e) => setGenre(e.target.value)} |
| 505 | // className="custom-select" |
| 506 | // > |
| 507 | // <option value="">请选择类型</option> |
| 508 | // {genres.map((format) => ( |
| 509 | // <option key={format.value} value={format.value}> |
| 510 | // {format.label} |
| 511 | // </option> |
| 512 | // ))} |
| 513 | // </select> |
| 514 | // <div className="select-arrow"> |
| 515 | // <svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-4 text-orange-500" viewBox="0 0 20 20" fill="currentColor"> |
| 516 | // <path fillRule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clipRule="evenodd" /> |
| 517 | // </svg> |
| 518 | // </div> |
| 519 | // </div> |
| 520 | // </div> |
| 521 | // <div className="form-group"> |
| 522 | // <label className="form-label text-orange-800 text-center">编码格式</label> |
| 523 | // <div className="relative"> |
| 524 | // <select |
| 525 | // value={codecFormat} |
| 526 | // onChange={(e) => setCodecFormat(e.target.value)} |
| 527 | // className="custom-select" |
| 528 | // > |
| 529 | // <option value="">请选择编码格式</option> |
| 530 | // {codecFormats.map((format) => ( |
| 531 | // <option key={format.value} value={format.value}> |
| 532 | // {format.label} |
| 533 | // </option> |
| 534 | // ))} |
| 535 | // </select> |
| 536 | // <div className="select-arrow"> |
| 537 | // <svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-4 text-orange-500" viewBox="0 0 20 20" fill="currentColor"> |
| 538 | // <path fillRule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clipRule="evenodd" /> |
| 539 | // </svg> |
| 540 | // </div> |
| 541 | // </div> |
| 542 | // </div> |
| 543 | // <div className="form-group"> |
| 544 | // <label className="form-label text-orange-800 text-center">分辨率</label> |
| 545 | // <div className="relative"> |
| 546 | // <select |
| 547 | // value={resolution} |
| 548 | // onChange={(e) => setResolution(e.target.value)} |
| 549 | // className="custom-select" |
| 550 | // > |
| 551 | // <option value="">请选择分辨率</option> |
| 552 | // {resolutions.map((resolution) => ( |
| 553 | // <option key={resolution.value} value={resolution.value}> |
| 554 | // {resolution.label} |
| 555 | // </option> |
| 556 | // ))} |
| 557 | // </select> |
| 558 | // <div className="select-arrow"> |
| 559 | // <svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-4 text-orange-500" viewBox="0 0 20 20" fill="currentColor"> |
| 560 | // <path fillRule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clipRule="evenodd" /> |
| 561 | // </svg> |
| 562 | // </div> |
| 563 | // </div> |
| 564 | // </div> |
| 565 | // </> |
| 566 | // )} |
| 567 | |
| 568 | // {/* 动态字段 - 剧集 */} |
| 569 | // {showTvFields && ( |
| 570 | // <> |
| 571 | // <div className="form-group"> |
| 572 | // <label className="form-label text-orange-800">地区</label> |
| 573 | // <select |
| 574 | // value={region} |
| 575 | // onChange={(e) => setRegion(e.target.value)} |
| 576 | // className="form-control" |
| 577 | // > |
| 578 | // <option value="">请选择地区</option> |
| 579 | // {regions.map((region) => ( |
| 580 | // <option key={region.value} value={region.value}> |
| 581 | // {region.label} |
| 582 | // </option> |
| 583 | // ))} |
| 584 | // </select> |
| 585 | // </div> |
| 586 | // <div className="form-group"> |
| 587 | // <label className="form-label text-orange-800">格式</label> |
| 588 | // <select |
| 589 | // value={format} |
| 590 | // onChange={(e) => setFormat(e.target.value)} |
| 591 | // className="form-control" |
| 592 | // > |
| 593 | // <option value="">请选择格式</option> |
| 594 | // {resolutions.map((format) => ( |
| 595 | // <option key={format.value} value={format.value}> |
| 596 | // {format.label} |
| 597 | // </option> |
| 598 | // ))} |
| 599 | // </select> |
| 600 | // </div> |
| 601 | // <div className="form-group"> |
| 602 | // <label className="form-label text-orange-800">类型</label> |
| 603 | // <select |
| 604 | // value={genre} |
| 605 | // onChange={(e) => setGenre(e.target.value)} |
| 606 | // className="form-control" |
| 607 | // > |
| 608 | // <option value="">请选择类型</option> |
| 609 | // {genres.map((genre) => ( |
| 610 | // <option key={genre.value} value={genre.value}> |
| 611 | // {genre.label} |
| 612 | // </option> |
| 613 | // ))} |
| 614 | // </select> |
| 615 | // </div> |
| 616 | // </> |
| 617 | // )} |
| 618 | |
| 619 | // {/* 动态字段 - 游戏 */} |
| 620 | // {showGameFields && ( |
| 621 | // <> |
| 622 | // <div className="form-group"> |
| 623 | // <label className="form-label text-orange-800">平台</label> |
| 624 | // <select |
| 625 | // value={platform} |
| 626 | // onChange={(e) => setPlatform(e.target.value)} |
| 627 | // className="form-control" |
| 628 | // > |
| 629 | // <option value="">请选择平台</option> |
| 630 | // {platforms.map((platform) => ( |
| 631 | // <option key={platform.value} value={platform.value}> |
| 632 | // {platform.label} |
| 633 | // </option> |
| 634 | // ))} |
| 635 | // </select> |
| 636 | // </div> |
| 637 | // <div className="form-group"> |
| 638 | // <label className="form-label text-orange-800">类型</label> |
| 639 | // <select |
| 640 | // value={genre} |
| 641 | // onChange={(e) => setGenre(e.target.value)} |
| 642 | // className="form-control" |
| 643 | // > |
| 644 | // <option value="">请选择类型</option> |
| 645 | // {gamegenres.map((genre) => ( |
| 646 | // <option key={genre.value} value={genre.value}> |
| 647 | // {genre.label} |
| 648 | // </option> |
| 649 | // ))} |
| 650 | // </select> |
| 651 | // </div> |
| 652 | // <div className="form-group"> |
| 653 | // <label className="form-label text-orange-800">语言</label> |
| 654 | // <select |
| 655 | // value={language} |
| 656 | // onChange={(e) => setLanguage(e.target.value)} |
| 657 | // className="form-control" |
| 658 | // > |
| 659 | // <option value="">请选择语言</option> |
| 660 | // {languages.map((language) => ( |
| 661 | // <option key={language.value} value={language.value}> |
| 662 | // {language.label} |
| 663 | // </option> |
| 664 | // ))} |
| 665 | // </select> |
| 666 | // </div> |
| 667 | // <div className="form-group"> |
| 668 | // <label className="form-label text-orange-800">数据类型</label> |
| 669 | // <select |
| 670 | // value={dataType} |
| 671 | // onChange={(e) => setdataType(e.target.value)} |
| 672 | // className="form-control" |
| 673 | // > |
| 674 | // <option value="">请选择数据类型</option> |
| 675 | // {dataTypes.map((dataType) => ( |
| 676 | // <option key={dataType.value} value={dataType.value}> |
| 677 | // {dataType.label} |
| 678 | // </option> |
| 679 | // ))} |
| 680 | // </select> |
| 681 | // </div> |
| 682 | // </> |
| 683 | // )} |
| 684 | |
| 685 | // {/* 动态字段 - 综艺 */} |
| 686 | // {showvarietyFields && ( |
| 687 | // <> |
| 688 | // <div className="form-group"> |
| 689 | // <label className="flex items-center"> |
| 690 | // <input |
| 691 | // type="checkbox" |
| 692 | // checked={isMainland} |
| 693 | // onChange={(e) => setIsMainland(e.target.checked)} |
| 694 | // className="mr-2" |
| 695 | // /> |
| 696 | // 是否大陆综艺 |
| 697 | // </label> |
| 698 | // </div> |
| 699 | // <div className="form-group"> |
| 700 | // <label className="form-label text-orange-800">类型</label> |
| 701 | // <select |
| 702 | // value={style} |
| 703 | // onChange={(e) => setStyle(e.target.value)} |
| 704 | // className="form-control" |
| 705 | // > |
| 706 | // <option value="">请选择类型</option> |
| 707 | // {varietygenres.map((style) => ( |
| 708 | // <option key={style.value} value={style.value}> |
| 709 | // {style.label} |
| 710 | // </option> |
| 711 | // ))} |
| 712 | // </select> |
| 713 | // </div> |
| 714 | // <div className="form-group"> |
| 715 | // <label className="form-label text-orange-800">格式</label> |
| 716 | // <select |
| 717 | // value={format} |
| 718 | // onChange={(e) => setFormat(e.target.value)} |
| 719 | // className="form-control" |
| 720 | // > |
| 721 | // <option value="">请选择格式</option> |
| 722 | // {resolutions.map((format) => ( |
| 723 | // <option key={format.value} value={format.value}> |
| 724 | // {format.label} |
| 725 | // </option> |
| 726 | // ))} |
| 727 | // </select> |
| 728 | // </div> |
| 729 | // </> |
| 730 | // )} |
| 731 | |
| 732 | // {/* 动态字段 - 动漫 */} |
| 733 | // {showAnimeFields && ( |
| 734 | // <> |
| 735 | // <div className="form-group"> |
| 736 | // <label className="form-label text-orange-800">类型</label> |
| 737 | // <select |
| 738 | // value={genre} |
| 739 | // onChange={(e) => setGenre(e.target.value)} |
| 740 | // className="form-control" |
| 741 | // > |
| 742 | // <option value="">请选择类型</option> |
| 743 | // {anigenres.map((genre) => ( |
| 744 | // <option key={genre.value} value={genre.value}> |
| 745 | // {genre.label} |
| 746 | // </option> |
| 747 | // ))} |
| 748 | // </select> |
| 749 | // </div> |
| 750 | // <div className="form-group"> |
| 751 | // <label className="form-label text-orange-800">格式</label> |
| 752 | // <select |
| 753 | // value={format} |
| 754 | // onChange={(e) => setFormat(e.target.value)} |
| 755 | // className="form-control" |
| 756 | // > |
| 757 | // <option value="">请选择格式</option> |
| 758 | // {animeformats.map((format) => ( |
| 759 | // <option key={format.value} value={format.value}> |
| 760 | // {format.label} |
| 761 | // </option> |
| 762 | // ))} |
| 763 | // </select> |
| 764 | // </div> |
| 765 | // <div className="form-group"> |
| 766 | // <label className="form-label text-orange-800">分辨率</label> |
| 767 | // <select |
| 768 | // value={resolution} |
| 769 | // onChange={(e) => setResolution(e.target.value)} |
| 770 | // className="form-control" |
| 771 | // > |
| 772 | // <option value="">请选择分辨率</option> |
| 773 | // {resolutions.map((resolution) => ( |
| 774 | // <option key={resolution.value} value={resolution.value}> |
| 775 | // {resolution.label} |
| 776 | // </option> |
| 777 | // ))} |
| 778 | // </select> |
| 779 | // </div> |
| 780 | // </> |
| 781 | // )} |
| 782 | |
| 783 | // {/* 动态字段 - 学习 */} |
| 784 | // {showlearningFields && ( |
| 785 | // <> |
| 786 | // <div className="form-group"> |
| 787 | // <label className="form-label text-orange-800">类型</label> |
| 788 | // <select |
| 789 | // value={genre} |
| 790 | // onChange={(e) => setGenre(e.target.value)} |
| 791 | // className="form-control" |
| 792 | // > |
| 793 | // <option value="">请选择类型</option> |
| 794 | // {learninggenres.map((genre) => ( |
| 795 | // <option key={genre.value} value={genre.value}> |
| 796 | // {genre.label} |
| 797 | // </option> |
| 798 | // ))} |
| 799 | // </select> |
| 800 | // </div> |
| 801 | // <div className="form-group"> |
| 802 | // <label className="form-label text-orange-800">格式</label> |
| 803 | // <select |
| 804 | // value={format} |
| 805 | // onChange={(e) => setFormat(e.target.value)} |
| 806 | // className="form-control" |
| 807 | // > |
| 808 | // <option value="">请选择格式</option> |
| 809 | // {learningformats.map((format) => ( |
| 810 | // <option key={format.value} value={format.value}> |
| 811 | // {format.label} |
| 812 | // </option> |
| 813 | // ))} |
| 814 | // </select> |
| 815 | // </div> |
| 816 | // </> |
| 817 | // )} |
| 818 | |
| 819 | // {/* 动态字段 - 软件 */} |
| 820 | // {showsoftwareFields && ( |
| 821 | // <> |
| 822 | // <div className="form-group"> |
| 823 | // <label className="form-label text-orange-800">平台</label> |
| 824 | // <select |
| 825 | // value={platform} |
| 826 | // onChange={(e) => setPlatform(e.target.value)} |
| 827 | // className="form-control" |
| 828 | // > |
| 829 | // <option value="">请选择平台</option> |
| 830 | // {softwareplatforms.map((platform) => ( |
| 831 | // <option key={platform.value} value={platform.value}> |
| 832 | // {platform.label} |
| 833 | // </option> |
| 834 | // ))} |
| 835 | // </select> |
| 836 | // </div> |
| 837 | // <div className="form-group"> |
| 838 | // <label className="form-label text-orange-800">类型</label> |
| 839 | // <select |
| 840 | // value={genre} |
| 841 | // onChange={(e) => setGenre(e.target.value)} |
| 842 | // className="form-control" |
| 843 | // > |
| 844 | // <option value="">请选择类型</option> |
| 845 | // {softwaregenres.map((genre) => ( |
| 846 | // <option key={genre.value} value={genre.value}> |
| 847 | // {genre.label} |
| 848 | // </option> |
| 849 | // ))} |
| 850 | // </select> |
| 851 | // </div> |
| 852 | // <div className="form-group"> |
| 853 | // <label className="form-label text-orange-800">格式</label> |
| 854 | // <select |
| 855 | // value={format} |
| 856 | // onChange={(e) => setFormat(e.target.value)} |
| 857 | // className="form-control" |
| 858 | // > |
| 859 | // <option value="">请选择格式</option> |
| 860 | // {softwareformats.map((format) => ( |
| 861 | // <option key={format.value} value={format.value}> |
| 862 | // {format.label} |
| 863 | // </option> |
| 864 | // ))} |
| 865 | // </select> |
| 866 | // </div> |
| 867 | // </> |
| 868 | // )} |
| 869 | |
| 870 | // {/* 动态字段 - 体育 */} |
| 871 | // {showsportsFields && ( |
| 872 | // <> |
| 873 | // <div className="form-group"> |
| 874 | // <label className="form-label text-orange-800">类型</label> |
| 875 | // <select |
| 876 | // value={genre} |
| 877 | // onChange={(e) => setGenre(e.target.value)} |
| 878 | // className="form-control" |
| 879 | // > |
| 880 | // <option value="">请选择类型</option> |
| 881 | // {sportsgenres.map((genre) => ( |
| 882 | // <option key={genre.value} value={genre.value}> |
| 883 | // {genre.label} |
| 884 | // </option> |
| 885 | // ))} |
| 886 | // </select> |
| 887 | // </div> |
| 888 | // <div className="form-group"> |
| 889 | // <label className="form-label text-orange-800">格式</label> |
| 890 | // <select |
| 891 | // value={format} |
| 892 | // onChange={(e) => setFormat(e.target.value)} |
| 893 | // className="form-control" |
| 894 | // > |
| 895 | // <option value="">请选择格式</option> |
| 896 | // {resolutions.map((format) => ( |
| 897 | // <option key={format.value} value={format.value}> |
| 898 | // {format.label} |
| 899 | // </option> |
| 900 | // ))} |
| 901 | // </select> |
| 902 | // </div> |
| 903 | // <div className="form-group"> |
| 904 | // <label className="form-label text-orange-800">赛事类型</label> |
| 905 | // <select |
| 906 | // value={eventType} |
| 907 | // onChange={(e) => setEventType(e.target.value)} |
| 908 | // className="form-control" |
| 909 | // > |
| 910 | // <option value="">请选择赛事类型</option> |
| 911 | // {eventTypes.map((eventType) => ( |
| 912 | // <option key={eventType.value} value={eventType.value}> |
| 913 | // {eventType.label} |
| 914 | // </option> |
| 915 | // ))} |
| 916 | // </select> |
| 917 | // </div> |
| 918 | // </> |
| 919 | // )} |
| 920 | |
| 921 | // {/* 动态字段 - 纪录片 */} |
| 922 | // {showdocFields && ( |
| 923 | // <> |
| 924 | // <div className="form-group"> |
| 925 | // <label className="form-label text-orange-800">年份</label> |
| 926 | // <input |
| 927 | // type="text" |
| 928 | // placeholder="如 1999, 2020" |
| 929 | // value={year} |
| 930 | // onChange={(e) => setYear(e.target.value)} |
| 931 | // className="form-control" |
| 932 | // /> |
| 933 | // </div> |
| 934 | // <div className="form-group"> |
| 935 | // <label className="form-label text-orange-800">视频源</label> |
| 936 | // <select |
| 937 | // value={source} |
| 938 | // onChange={(e) => setSource(e.target.value)} |
| 939 | // className="form-control" |
| 940 | // > |
| 941 | // <option value="">请选择视频源</option> |
| 942 | // {sourceTypes.map((source) => ( |
| 943 | // <option key={source.value} value={source.value}> |
| 944 | // {source.label} |
| 945 | // </option> |
| 946 | // ))} |
| 947 | // </select> |
| 948 | // </div> |
| 949 | // <div className="form-group"> |
| 950 | // <label className="form-label text-orange-800">格式</label> |
| 951 | // <select |
| 952 | // value={format} |
| 953 | // onChange={(e) => setFormat(e.target.value)} |
| 954 | // className="form-control" |
| 955 | // > |
| 956 | // <option value="">请选择格式</option> |
| 957 | // {resolutions.map((format) => ( |
| 958 | // <option key={format.value} value={format.value}> |
| 959 | // {format.label} |
| 960 | // </option> |
| 961 | // ))} |
| 962 | // </select> |
| 963 | // </div> |
| 964 | // </> |
| 965 | // )} |
| 966 | |
| 967 | // {/* 动态字段 - 音乐 */} |
| 968 | // {showMusicFields && ( |
| 969 | // <> |
| 970 | // <div className="form-group"> |
| 971 | // <label className="form-label text-orange-800">类型</label> |
| 972 | // <select |
| 973 | // value={genre} |
| 974 | // onChange={(e) => setGenre(e.target.value)} |
| 975 | // className="form-control" |
| 976 | // > |
| 977 | // <option value="">请选择类型</option> |
| 978 | // {musicgenres.map((genre) => ( |
| 979 | // <option key={genre.value} value={genre.value}> |
| 980 | // {genre.label} |
| 981 | // </option> |
| 982 | // ))} |
| 983 | // </select> |
| 984 | // </div> |
| 985 | // <div className="form-group"> |
| 986 | // <label className="form-label text-orange-800">地区</label> |
| 987 | // <select |
| 988 | // value={region} |
| 989 | // onChange={(e) => setRegion(e.target.value)} |
| 990 | // className="form-control" |
| 991 | // > |
| 992 | // <option value="">请选择地区</option> |
| 993 | // {regions.map((region) => ( |
| 994 | // <option key={region.value} value={region.value}> |
| 995 | // {region.label} |
| 996 | // </option> |
| 997 | // ))} |
| 998 | // </select> |
| 999 | // </div> |
| 1000 | // <div className="form-group"> |
| 1001 | // <label className="form-label text-orange-800">风格</label> |
| 1002 | // <select |
| 1003 | // value={style} |
| 1004 | // onChange={(e) => setStyle(e.target.value)} |
| 1005 | // className="form-control" |
| 1006 | // > |
| 1007 | // <option value="">请选择风格</option> |
| 1008 | // {musicstyles.map((style) => ( |
| 1009 | // <option key={style.value} value={style.value}> |
| 1010 | // {style.label} |
| 1011 | // </option> |
| 1012 | // ))} |
| 1013 | // </select> |
| 1014 | // </div> |
| 1015 | // <div className="form-group"> |
| 1016 | // <label className="form-label text-orange-800">格式</label> |
| 1017 | // <select |
| 1018 | // value={format} |
| 1019 | // onChange={(e) => setFormat(e.target.value)} |
| 1020 | // className="form-control" |
| 1021 | // > |
| 1022 | // <option value="">请选择格式</option> |
| 1023 | // {musicformats.map((format) => ( |
| 1024 | // <option key={format.value} value={format.value}> |
| 1025 | // {format.label} |
| 1026 | // </option> |
| 1027 | // ))} |
| 1028 | // </select> |
| 1029 | // </div> |
| 1030 | // </> |
| 1031 | // )} |
| 1032 | |
| 1033 | // {/* 动态字段 - 其他 */} |
| 1034 | // {showotherFields && ( |
| 1035 | // <> |
| 1036 | // <div className="form-group"> |
| 1037 | // <label className="form-label text-orange-800">类型</label> |
| 1038 | // <select |
| 1039 | // value={genre} |
| 1040 | // onChange={(e) => setGenre(e.target.value)} |
| 1041 | // className="form-control" |
| 1042 | // > |
| 1043 | // <option value="">请选择类型</option> |
| 1044 | // {othergenres.map((genre) => ( |
| 1045 | // <option key={genre.value} value={genre.value}> |
| 1046 | // {genre.label} |
| 1047 | // </option> |
| 1048 | // ))} |
| 1049 | // </select> |
| 1050 | // </div> |
| 1051 | // </> |
| 1052 | // )} |
| 1053 | |
| 1054 | |
| 1055 | // {/* 其他动态字段... (保持相同的美化样式) */} |
| 1056 | // {/* 这里省略了其他动态字段的代码,但它们都使用相同的自定义下拉框样式 */} |
| 1057 | |
| 1058 | // {/* 提交按钮 - 居中 */} |
| 1059 | // <div className="text-center"> |
| 1060 | // <button |
| 1061 | // type="submit" |
| 1062 | // className="submit-btn" |
| 1063 | // > |
| 1064 | // 上传种子 |
| 1065 | // </button> |
| 1066 | // </div> |
| 1067 | |
| 1068 | // {showSuccess && ( |
| 1069 | // <div className="success-message text-center"> |
| 1070 | // 上传成功! |
| 1071 | // </div> |
| 1072 | // )} |
| 1073 | // </form> |
| 1074 | // </div> |
| 1075 | // ); |
| 1076 | // } |
| 1077 | return ( |
| 1078 | <div className="container"> |
| 1079 | <div className="card"> |
| 1080 | <h2 className="title">上传种子</h2> |
| 1081 | <Form |
| 1082 | layout="vertical" |
| 1083 | onFinish={handleSubmit} |
| 1084 | className="form" |
| 1085 | > |
| 1086 | {/* 封面图片 - 自定义上传区域 */} |
| 1087 | <Form.Item |
| 1088 | name="coverImage" |
| 1089 | label={<span style={{ fontSize: '19px' , fontWeight: 'bold'}}>封面图片</span>} |
| 1090 | rules={[{ required: true, message: '请上传封面图片' }]} |
| 1091 | > |
| 1092 | <div |
| 1093 | className="uploadArea" |
| 1094 | onClick={() => document.getElementById('cover-image-upload').click()} |
| 1095 | > |
| 1096 | <InboxOutlined className="uploadIcon" /> |
| 1097 | <p className="uploadText">点击或拖拽上传封面图片</p> |
| 1098 | <input |
| 1099 | type="file" |
| 1100 | accept="image/*" |
| 1101 | onChange={(e) => { |
| 1102 | setCoverImage(e.target.files[0]); |
| 1103 | form.setFieldsValue({ coverImage: e.target.files[0] }); |
| 1104 | }} |
| 1105 | className="hiddenInput" |
| 1106 | id="cover-image-upload" |
| 1107 | /> |
| 1108 | </div> |
| 1109 | </Form.Item> |
| 1110 | |
| 1111 | {/* 种子文件 - 自定义上传区域 */} |
| 1112 | <Form.Item |
| 1113 | name="torrentFile" |
| 1114 | label={<span style={{ fontSize: '19px' , fontWeight: 'bold'}}>种子文件</span>} |
| 1115 | rules={[{ required: true, message: '请上传.torrent文件' }]} |
| 1116 | > |
| 1117 | <div |
| 1118 | className="uploadArea" |
| 1119 | onClick={() => document.getElementById('torrent-file-upload').click()} |
| 1120 | > |
| 1121 | <InboxOutlined className="uploadIcon" /> |
| 1122 | <p className="uploadText">点击或拖拽上传种子文件(.torrent)</p> |
| 1123 | <input |
| 1124 | type="file" |
| 1125 | accept=".torrent" |
| 1126 | onChange={(e) => { |
| 1127 | setFile(e.target.files[0]); |
| 1128 | form.setFieldsValue({ torrentFile: e.target.files[0] }); |
| 1129 | }} |
| 1130 | className="hiddenInput" |
| 1131 | id="torrent-file-upload" |
| 1132 | /> |
| 1133 | </div> |
| 1134 | </Form.Item> |
| 1135 | |
| 1136 | {/* 标题 */} |
| 1137 | <Form.Item |
| 1138 | name="title" |
| 1139 | label={<span style={{ fontSize: '19px' , fontWeight: 'bold'}}>标题</span>} // 直接包裹label |
| 1140 | rules={[{ required: true, message: '请输入标题' }]} |
| 1141 | //labelCol={{ style: { fontSize: '30px !important ' } }} // ✅ 调整 Label 字体 |
| 1142 | > |
| 1143 | <Input |
| 1144 | placeholder="输入种子标题" |
| 1145 | value={title} |
| 1146 | onChange={(e) => { |
| 1147 | setTitle(e.target.value); |
| 1148 | form.setFieldsValue({ title: e.target.value }); |
| 1149 | }} |
| 1150 | //style={styles.input} |
| 1151 | style={{ fontSize: '19px' }} // ✅ 调整 Input 字体 |
| 1152 | /> |
| 1153 | </Form.Item> |
| 1154 | |
| 1155 | {/* 描述 */} |
| 1156 | <Form.Item |
| 1157 | name="description" |
| 1158 | label={<span style={{ fontSize: '19px' , fontWeight: 'bold'}}>描述</span>} |
| 1159 | > |
| 1160 | <TextArea |
| 1161 | placeholder="输入种子描述" |
| 1162 | value={description} |
| 1163 | onChange={(e) => { |
| 1164 | setDescription(e.target.value); |
| 1165 | form.setFieldsValue({ description: e.target.value }); |
| 1166 | }} |
| 1167 | rows={3} |
| 1168 | style={styles.textArea} |
| 1169 | /> |
| 1170 | </Form.Item> |
| 1171 | |
| 1172 | {/* 分类 - 美化下拉框 */} |
| 1173 | <Form.Item |
| 1174 | name="categoryId" |
| 1175 | label={<span style={{ fontSize: '19px' , fontWeight: 'bold' }}>分类</span>} |
| 1176 | rules={[{ required: true, message: '请选择分类' }]} |
| 1177 | > |
| 1178 | <Select |
| 1179 | placeholder="请选择分类" |
| 1180 | value={categoryId} |
| 1181 | onChange={(value) => { |
| 1182 | const stringValue = String(value); |
| 1183 | setCategoryId(stringValue); |
| 1184 | console.log('Selected category ID:', stringValue); |
| 1185 | form.setFieldsValue({ categoryId: value }); |
| 1186 | // 触发分类变化后的逻辑 |
| 1187 | setShowMovieFields(value === '1'); |
| 1188 | setShowTvFields(value === '2'); |
| 1189 | setShowAnimeFields(value === '4'); |
| 1190 | setShowGameFields(value === '5'); |
| 1191 | setShowvarietyFields(value === '6'); |
| 1192 | setShowMusicFields(value === '3'); |
| 1193 | setShowlearningFields(value === '9'); |
| 1194 | setShowsoftwareFields(value === '8'); |
| 1195 | setShowsportsFields(value === '7'); |
| 1196 | setShowdocFields(value === '10'); |
| 1197 | setShowotherFields(value === '11'); |
| 1198 | }} |
| 1199 | style={styles.select} |
| 1200 | > |
| 1201 | <Option value="">请选择分类</Option> |
| 1202 | {categories.map(cat => ( |
| 1203 | <Option key={cat.categoryid} value={cat.categoryid}>{cat.category_name}</Option> |
| 1204 | ))} |
| 1205 | </Select> |
| 1206 | </Form.Item> |
| 1207 | |
| 1208 | {/* 动态字段 - 电影 */} |
| 1209 | {showMovieFields && ( |
| 1210 | <> |
| 1211 | <Form.Item |
| 1212 | name="caption" |
| 1213 | label="字幕/说明" |
| 1214 | rules={[{ required: true, message: '请输入字幕/说明' }]} |
| 1215 | > |
| 1216 | <Input |
| 1217 | placeholder="输入字幕/说明" |
| 1218 | value={caption} |
| 1219 | onChange={(e) => { |
| 1220 | setCaption(e.target.value); |
| 1221 | form.setFieldsValue({ caption: e.target.value }); |
| 1222 | }} |
| 1223 | className="text-center" |
| 1224 | /> |
| 1225 | </Form.Item> |
| 1226 | <Form.Item |
| 1227 | name="region" |
| 1228 | label="地区" |
| 1229 | > |
| 1230 | <Select |
| 1231 | placeholder="请选择地区" |
| 1232 | value={region} |
| 1233 | onChange={(value) => { |
| 1234 | setRegion(value); |
| 1235 | form.setFieldsValue({ region: value }); |
| 1236 | }} |
| 1237 | className="w-full" |
| 1238 | > |
| 1239 | <Option value="">请选择地区</Option> |
| 1240 | {regions.map((region) => ( |
| 1241 | <Option key={region.value} value={region.value}> |
| 1242 | {region.label} |
| 1243 | </Option> |
| 1244 | ))} |
| 1245 | </Select> |
| 1246 | </Form.Item> |
| 1247 | <Form.Item |
| 1248 | name="year" |
| 1249 | label="年份" |
| 1250 | > |
| 1251 | <Input |
| 1252 | placeholder="输入年份" |
| 1253 | value={year} |
| 1254 | onChange={(e) => { |
| 1255 | setYear(e.target.value); |
| 1256 | form.setFieldsValue({ year: e.target.value }); |
| 1257 | }} |
| 1258 | className="text-center" |
| 1259 | /> |
| 1260 | </Form.Item> |
| 1261 | <Form.Item |
| 1262 | name="genre" |
| 1263 | label="类型" |
| 1264 | > |
| 1265 | <Select |
| 1266 | placeholder="请选择类型" |
| 1267 | value={genre} |
| 1268 | onChange={(value) => { |
| 1269 | setGenre(value); |
| 1270 | form.setFieldsValue({ genre: value }); |
| 1271 | }} |
| 1272 | className="w-full" |
| 1273 | > |
| 1274 | <Option value="">请选择类型</Option> |
| 1275 | {genres.map((format) => ( |
| 1276 | <Option key={format.value} value={format.value}> |
| 1277 | {format.label} |
| 1278 | </Option> |
| 1279 | ))} |
| 1280 | </Select> |
| 1281 | </Form.Item> |
| 1282 | <Form.Item |
| 1283 | name="codecFormat" |
| 1284 | label="编码格式" |
| 1285 | > |
| 1286 | <Select |
| 1287 | placeholder="请选择编码格式" |
| 1288 | value={codecFormat} |
| 1289 | onChange={(value) => { |
| 1290 | setCodecFormat(value); |
| 1291 | form.setFieldsValue({ codecFormat: value }); |
| 1292 | }} |
| 1293 | className="w-full" |
| 1294 | > |
| 1295 | <Option value="">请选择编码格式</Option> |
| 1296 | {codecFormats.map((format) => ( |
| 1297 | <Option key={format.value} value={format.value}> |
| 1298 | {format.label} |
| 1299 | </Option> |
| 1300 | ))} |
| 1301 | </Select> |
| 1302 | </Form.Item> |
| 1303 | <Form.Item |
| 1304 | name="resolution" |
| 1305 | label="分辨率" |
| 1306 | > |
| 1307 | <Select |
| 1308 | placeholder="请选择分辨率" |
| 1309 | value={resolution} |
| 1310 | onChange={(value) => { |
| 1311 | setResolution(value); |
| 1312 | form.setFieldsValue({ resolution: value }); |
| 1313 | }} |
| 1314 | className="w-full" |
| 1315 | > |
| 1316 | <Option value="">请选择分辨率</Option> |
| 1317 | {resolutions.map((resolution) => ( |
| 1318 | <Option key={resolution.value} value={resolution.value}> |
| 1319 | {resolution.label} |
| 1320 | </Option> |
| 1321 | ))} |
| 1322 | </Select> |
| 1323 | </Form.Item> |
| 1324 | </> |
| 1325 | )} |
| 1326 | |
| 1327 | {/* 动态字段 - 剧集 */} |
| 1328 | {showTvFields && ( |
| 1329 | <> |
| 1330 | <Form.Item |
| 1331 | name="region" |
| 1332 | label="地区" |
| 1333 | > |
| 1334 | <Select |
| 1335 | placeholder="请选择地区" |
| 1336 | value={region} |
| 1337 | onChange={(value) => { |
| 1338 | setRegion(value); |
| 1339 | form.setFieldsValue({ region: value }); |
| 1340 | }} |
| 1341 | className="w-full" |
| 1342 | > |
| 1343 | <Option value="">请选择地区</Option> |
| 1344 | {regions.map((region) => ( |
| 1345 | <Option key={region.value} value={region.value}> |
| 1346 | {region.label} |
| 1347 | </Option> |
| 1348 | ))} |
| 1349 | </Select> |
| 1350 | </Form.Item> |
| 1351 | <Form.Item |
| 1352 | name="format" |
| 1353 | label="格式" |
| 1354 | > |
| 1355 | <Select |
| 1356 | placeholder="请选择格式" |
| 1357 | value={format} |
| 1358 | onChange={(value) => { |
| 1359 | setFormat(value); |
| 1360 | form.setFieldsValue({ format: value }); |
| 1361 | }} |
| 1362 | className="w-full" |
| 1363 | > |
| 1364 | <Option value="">请选择格式</Option> |
| 1365 | {resolutions.map((format) => ( |
| 1366 | <Option key={format.value} value={format.value}> |
| 1367 | {format.label} |
| 1368 | </Option> |
| 1369 | ))} |
| 1370 | </Select> |
| 1371 | </Form.Item> |
| 1372 | <Form.Item |
| 1373 | name="genre" |
| 1374 | label="类型" |
| 1375 | > |
| 1376 | <Select |
| 1377 | placeholder="请选择类型" |
| 1378 | value={genre} |
| 1379 | onChange={(value) => { |
| 1380 | setGenre(value); |
| 1381 | form.setFieldsValue({ genre: value }); |
| 1382 | }} |
| 1383 | className="w-full" |
| 1384 | > |
| 1385 | <Option value="">请选择类型</Option> |
| 1386 | {genres.map((genre) => ( |
| 1387 | <Option key={genre.value} value={genre.value}> |
| 1388 | {genre.label} |
| 1389 | </Option> |
| 1390 | ))} |
| 1391 | </Select> |
| 1392 | </Form.Item> |
| 1393 | </> |
| 1394 | )} |
| 1395 | |
| 1396 | {/* 动态字段 - 游戏 */} |
| 1397 | {showGameFields && ( |
| 1398 | <> |
| 1399 | <Form.Item |
| 1400 | name="platform" |
| 1401 | label="平台" |
| 1402 | > |
| 1403 | <Select |
| 1404 | placeholder="请选择平台" |
| 1405 | value={platform} |
| 1406 | onChange={(value) => { |
| 1407 | setPlatform(value); |
| 1408 | form.setFieldsValue({ platform: value }); |
| 1409 | }} |
| 1410 | className="w-full" |
| 1411 | > |
| 1412 | <Option value="">请选择平台</Option> |
| 1413 | {platforms.map((platform) => ( |
| 1414 | <Option key={platform.value} value={platform.value}> |
| 1415 | {platform.label} |
| 1416 | </Option> |
| 1417 | ))} |
| 1418 | </Select> |
| 1419 | </Form.Item> |
| 1420 | <Form.Item |
| 1421 | name="genre" |
| 1422 | label="类型" |
| 1423 | > |
| 1424 | <Select |
| 1425 | placeholder="请选择类型" |
| 1426 | value={genre} |
| 1427 | onChange={(value) => { |
| 1428 | setGenre(value); |
| 1429 | form.setFieldsValue({ genre: value }); |
| 1430 | }} |
| 1431 | className="w-full" |
| 1432 | > |
| 1433 | <Option value="">请选择类型</Option> |
| 1434 | {gamegenres.map((genre) => ( |
| 1435 | <Option key={genre.value} value={genre.value}> |
| 1436 | {genre.label} |
| 1437 | </Option> |
| 1438 | ))} |
| 1439 | </Select> |
| 1440 | </Form.Item> |
| 1441 | <Form.Item |
| 1442 | name="language" |
| 1443 | label="语言" |
| 1444 | > |
| 1445 | <Select |
| 1446 | placeholder="请选择语言" |
| 1447 | value={language} |
| 1448 | onChange={(value) => { |
| 1449 | setLanguage(value); |
| 1450 | form.setFieldsValue({ language: value }); |
| 1451 | }} |
| 1452 | className="w-full" |
| 1453 | > |
| 1454 | <Option value="">请选择语言</Option> |
| 1455 | {languages.map((language) => ( |
| 1456 | <Option key={language.value} value={language.value}> |
| 1457 | {language.label} |
| 1458 | </Option> |
| 1459 | ))} |
| 1460 | </Select> |
| 1461 | </Form.Item> |
| 1462 | <Form.Item |
| 1463 | name="dataType" |
| 1464 | label="数据类型" |
| 1465 | > |
| 1466 | <Select |
| 1467 | placeholder="请选择数据类型" |
| 1468 | value={dataType} |
| 1469 | onChange={(value) => { |
| 1470 | setDataType(value); |
| 1471 | form.setFieldsValue({ dataType: value }); |
| 1472 | }} |
| 1473 | className="w-full" |
| 1474 | > |
| 1475 | <Option value="">请选择数据类型</Option> |
| 1476 | {dataTypes.map((dataType) => ( |
| 1477 | <Option key={dataType.value} value={dataType.value}> |
| 1478 | {dataType.label} |
| 1479 | </Option> |
| 1480 | ))} |
| 1481 | </Select> |
| 1482 | </Form.Item> |
| 1483 | </> |
| 1484 | )} |
| 1485 | |
| 1486 | {/* 动态字段 - 综艺 */} |
| 1487 | {showvarietyFields && ( |
| 1488 | <> |
| 1489 | <Form.Item |
| 1490 | name="isMainland" |
| 1491 | label="是否大陆综艺" |
| 1492 | valuePropName="checked" |
| 1493 | > |
| 1494 | <Switch |
| 1495 | checked={isMainland} |
| 1496 | onChange={(checked) => { |
| 1497 | setIsMainland(checked); |
| 1498 | form.setFieldsValue({ isMainland: checked }); |
| 1499 | }} |
| 1500 | /> |
| 1501 | </Form.Item> |
| 1502 | <Form.Item |
| 1503 | name="style" |
| 1504 | label="类型" |
| 1505 | > |
| 1506 | <Select |
| 1507 | placeholder="请选择类型" |
| 1508 | value={style} |
| 1509 | onChange={(value) => { |
| 1510 | setStyle(value); |
| 1511 | form.setFieldsValue({ style: value }); |
| 1512 | }} |
| 1513 | className="w-full" |
| 1514 | > |
| 1515 | <Option value="">请选择类型</Option> |
| 1516 | {varietygenres.map((style) => ( |
| 1517 | <Option key={style.value} value={style.value}> |
| 1518 | {style.label} |
| 1519 | </Option> |
| 1520 | ))} |
| 1521 | </Select> |
| 1522 | </Form.Item> |
| 1523 | <Form.Item |
| 1524 | name="format" |
| 1525 | label="格式" |
| 1526 | > |
| 1527 | <Select |
| 1528 | placeholder="请选择格式" |
| 1529 | value={format} |
| 1530 | onChange={(value) => { |
| 1531 | setFormat(value); |
| 1532 | form.setFieldsValue({ format: value }); |
| 1533 | }} |
| 1534 | className="w-full" |
| 1535 | > |
| 1536 | <Option value="">请选择格式</Option> |
| 1537 | {resolutions.map((format) => ( |
| 1538 | <Option key={format.value} value={format.value}> |
| 1539 | {format.label} |
| 1540 | </Option> |
| 1541 | ))} |
| 1542 | </Select> |
| 1543 | </Form.Item> |
| 1544 | </> |
| 1545 | )} |
| 1546 | |
| 1547 | {/* 动态字段 - 动漫 */} |
| 1548 | {showAnimeFields && ( |
| 1549 | <> |
| 1550 | <Form.Item |
| 1551 | name="genre" |
| 1552 | label="类型" |
| 1553 | > |
| 1554 | <Select |
| 1555 | placeholder="请选择类型" |
| 1556 | value={genre} |
| 1557 | onChange={(value) => { |
| 1558 | setGenre(value); |
| 1559 | form.setFieldsValue({ genre: value }); |
| 1560 | }} |
| 1561 | className="w-full" |
| 1562 | > |
| 1563 | <Option value="">请选择类型</Option> |
| 1564 | {anigenres.map((genre) => ( |
| 1565 | <Option key={genre.value} value={genre.value}> |
| 1566 | {genre.label} |
| 1567 | </Option> |
| 1568 | ))} |
| 1569 | </Select> |
| 1570 | </Form.Item> |
| 1571 | <Form.Item |
| 1572 | name="format" |
| 1573 | label="格式" |
| 1574 | > |
| 1575 | <Select |
| 1576 | placeholder="请选择格式" |
| 1577 | value={format} |
| 1578 | onChange={(value) => { |
| 1579 | setFormat(value); |
| 1580 | form.setFieldsValue({ format: value }); |
| 1581 | }} |
| 1582 | className="w-full" |
| 1583 | > |
| 1584 | <Option value="">请选择格式</Option> |
| 1585 | {animeformats.map((format) => ( |
| 1586 | <Option key={format.value} value={format.value}> |
| 1587 | {format.label} |
| 1588 | </Option> |
| 1589 | ))} |
| 1590 | </Select> |
| 1591 | </Form.Item> |
| 1592 | <Form.Item |
| 1593 | name="resolution" |
| 1594 | label="分辨率" |
| 1595 | > |
| 1596 | <Select |
| 1597 | placeholder="请选择分辨率" |
| 1598 | value={resolution} |
| 1599 | onChange={(value) => { |
| 1600 | setResolution(value); |
| 1601 | form.setFieldsValue({ resolution: value }); |
| 1602 | }} |
| 1603 | className="w-full" |
| 1604 | > |
| 1605 | <Option value="">请选择分辨率</Option> |
| 1606 | {resolutions.map((resolution) => ( |
| 1607 | <Option key={resolution.value} value={resolution.value}> |
| 1608 | {resolution.label} |
| 1609 | </Option> |
| 1610 | ))} |
| 1611 | </Select> |
| 1612 | </Form.Item> |
| 1613 | </> |
| 1614 | )} |
| 1615 | |
| 1616 | {/* 动态字段 - 学习 */} |
| 1617 | {showlearningFields && ( |
| 1618 | <> |
| 1619 | <Form.Item |
| 1620 | name="genre" |
| 1621 | label="类型" |
| 1622 | > |
| 1623 | <Select |
| 1624 | placeholder="请选择类型" |
| 1625 | value={genre} |
| 1626 | onChange={(value) => { |
| 1627 | setGenre(value); |
| 1628 | form.setFieldsValue({ genre: value }); |
| 1629 | }} |
| 1630 | className="w-full" |
| 1631 | > |
| 1632 | <Option value="">请选择类型</Option> |
| 1633 | {learninggenres.map((genre) => ( |
| 1634 | <Option key={genre.value} value={genre.value}> |
| 1635 | {genre.label} |
| 1636 | </Option> |
| 1637 | ))} |
| 1638 | </Select> |
| 1639 | </Form.Item> |
| 1640 | <Form.Item |
| 1641 | name="format" |
| 1642 | label="格式" |
| 1643 | > |
| 1644 | <Select |
| 1645 | placeholder="请选择格式" |
| 1646 | value={format} |
| 1647 | onChange={(value) => { |
| 1648 | setFormat(value); |
| 1649 | form.setFieldsValue({ format: value }); |
| 1650 | }} |
| 1651 | className="w-full" |
| 1652 | > |
| 1653 | <Option value="">请选择格式</Option> |
| 1654 | {learningformats.map((format) => ( |
| 1655 | <Option key={format.value} value={format.value}> |
| 1656 | {format.label} |
| 1657 | </Option> |
| 1658 | ))} |
| 1659 | </Select> |
| 1660 | </Form.Item> |
| 1661 | </> |
| 1662 | )} |
| 1663 | |
| 1664 | {/* 动态字段 - 软件 */} |
| 1665 | {showsoftwareFields && ( |
| 1666 | <> |
| 1667 | <Form.Item |
| 1668 | name="platform" |
| 1669 | label="平台" |
| 1670 | > |
| 1671 | <Select |
| 1672 | placeholder="请选择平台" |
| 1673 | value={platform} |
| 1674 | onChange={(value) => { |
| 1675 | setPlatform(value); |
| 1676 | form.setFieldsValue({ platform: value }); |
| 1677 | }} |
| 1678 | className="w-full" |
| 1679 | > |
| 1680 | <Option value="">请选择平台</Option> |
| 1681 | {softwareplatforms.map((platform) => ( |
| 1682 | <Option key={platform.value} value={platform.value}> |
| 1683 | {platform.label} |
| 1684 | </Option> |
| 1685 | ))} |
| 1686 | </Select> |
| 1687 | </Form.Item> |
| 1688 | <Form.Item |
| 1689 | name="genre" |
| 1690 | label="类型" |
| 1691 | > |
| 1692 | <Select |
| 1693 | placeholder="请选择类型" |
| 1694 | value={genre} |
| 1695 | onChange={(value) => { |
| 1696 | setGenre(value); |
| 1697 | form.setFieldsValue({ genre: value }); |
| 1698 | }} |
| 1699 | className="w-full" |
| 1700 | > |
| 1701 | <Option value="">请选择类型</Option> |
| 1702 | {softwaregenres.map((genre) => ( |
| 1703 | <Option key={genre.value} value={genre.value}> |
| 1704 | {genre.label} |
| 1705 | </Option> |
| 1706 | ))} |
| 1707 | </Select> |
| 1708 | </Form.Item> |
| 1709 | <Form.Item |
| 1710 | name="format" |
| 1711 | label="格式" |
| 1712 | > |
| 1713 | <Select |
| 1714 | placeholder="请选择格式" |
| 1715 | value={format} |
| 1716 | onChange={(value) => { |
| 1717 | setFormat(value); |
| 1718 | form.setFieldsValue({ format: value }); |
| 1719 | }} |
| 1720 | className="w-full" |
| 1721 | > |
| 1722 | <Option value="">请选择格式</Option> |
| 1723 | {softwareformats.map((format) => ( |
| 1724 | <Option key={format.value} value={format.value}> |
| 1725 | {format.label} |
| 1726 | </Option> |
| 1727 | ))} |
| 1728 | </Select> |
| 1729 | </Form.Item> |
| 1730 | </> |
| 1731 | )} |
| 1732 | |
| 1733 | {/* 动态字段 - 体育 */} |
| 1734 | {showsportsFields && ( |
| 1735 | <> |
| 1736 | <Form.Item |
| 1737 | name="genre" |
| 1738 | label="类型" |
| 1739 | > |
| 1740 | <Select |
| 1741 | placeholder="请选择类型" |
| 1742 | value={genre} |
| 1743 | onChange={(value) => { |
| 1744 | setGenre(value); |
| 1745 | form.setFieldsValue({ genre: value }); |
| 1746 | }} |
| 1747 | className="w-full" |
| 1748 | > |
| 1749 | <Option value="">请选择类型</Option> |
| 1750 | {sportsgenres.map((genre) => ( |
| 1751 | <Option key={genre.value} value={genre.value}> |
| 1752 | {genre.label} |
| 1753 | </Option> |
| 1754 | ))} |
| 1755 | </Select> |
| 1756 | </Form.Item> |
| 1757 | <Form.Item |
| 1758 | name="format" |
| 1759 | label="格式" |
| 1760 | > |
| 1761 | <Select |
| 1762 | placeholder="请选择格式" |
| 1763 | value={format} |
| 1764 | onChange={(value) => { |
| 1765 | setFormat(value); |
| 1766 | form.setFieldsValue({ format: value }); |
| 1767 | }} |
| 1768 | className="w-full" |
| 1769 | > |
| 1770 | <Option value="">请选择格式</Option> |
| 1771 | {resolutions.map((format) => ( |
| 1772 | <Option key={format.value} value={format.value}> |
| 1773 | {format.label} |
| 1774 | </Option> |
| 1775 | ))} |
| 1776 | </Select> |
| 1777 | </Form.Item> |
| 1778 | <Form.Item |
| 1779 | name="eventType" |
| 1780 | label="赛事类型" |
| 1781 | > |
| 1782 | <Select |
| 1783 | placeholder="请选择赛事类型" |
| 1784 | value={eventType} |
| 1785 | onChange={(value) => { |
| 1786 | setEventType(value); |
| 1787 | form.setFieldsValue({ eventType: value }); |
| 1788 | }} |
| 1789 | className="w-full" |
| 1790 | > |
| 1791 | <Option value="">请选择赛事类型</Option> |
| 1792 | {eventTypes.map((eventType) => ( |
| 1793 | <Option key={eventType.value} value={eventType.value}> |
| 1794 | {eventType.label} |
| 1795 | </Option> |
| 1796 | ))} |
| 1797 | </Select> |
| 1798 | </Form.Item> |
| 1799 | </> |
| 1800 | )} |
| 1801 | |
| 1802 | {/* 动态字段 - 纪录片 */} |
| 1803 | {showdocFields && ( |
| 1804 | <> |
| 1805 | <Form.Item |
| 1806 | name="year" |
| 1807 | label="年份" |
| 1808 | > |
| 1809 | <Input |
| 1810 | placeholder="如 1999, 2020" |
| 1811 | value={year} |
| 1812 | onChange={(e) => { |
| 1813 | setYear(e.target.value); |
| 1814 | form.setFieldsValue({ year: e.target.value }); |
| 1815 | }} |
| 1816 | className="w-full" |
| 1817 | /> |
| 1818 | </Form.Item> |
| 1819 | <Form.Item |
| 1820 | name="source" |
| 1821 | label="视频源" |
| 1822 | > |
| 1823 | <Select |
| 1824 | placeholder="请选择视频源" |
| 1825 | value={source} |
| 1826 | onChange={(value) => { |
| 1827 | setSource(value); |
| 1828 | form.setFieldsValue({ source: value }); |
| 1829 | }} |
| 1830 | className="w-full" |
| 1831 | > |
| 1832 | <Option value="">请选择视频源</Option> |
| 1833 | {sourceTypes.map((source) => ( |
| 1834 | <Option key={source.value} value={source.value}> |
| 1835 | {source.label} |
| 1836 | </Option> |
| 1837 | ))} |
| 1838 | </Select> |
| 1839 | </Form.Item> |
| 1840 | <Form.Item |
| 1841 | name="format" |
| 1842 | label="格式" |
| 1843 | > |
| 1844 | <Select |
| 1845 | placeholder="请选择格式" |
| 1846 | value={format} |
| 1847 | onChange={(value) => { |
| 1848 | setFormat(value); |
| 1849 | form.setFieldsValue({ format: value }); |
| 1850 | }} |
| 1851 | className="w-full" |
| 1852 | > |
| 1853 | <Option value="">请选择格式</Option> |
| 1854 | {resolutions.map((format) => ( |
| 1855 | <Option key={format.value} value={format.value}> |
| 1856 | {format.label} |
| 1857 | </Option> |
| 1858 | ))} |
| 1859 | </Select> |
| 1860 | </Form.Item> |
| 1861 | </> |
| 1862 | )} |
| 1863 | |
| 1864 | {/* 动态字段 - 音乐 */} |
| 1865 | {showMusicFields && ( |
| 1866 | <> |
| 1867 | <Form.Item |
| 1868 | name="genre" |
| 1869 | label="类型" |
| 1870 | > |
| 1871 | <Select |
| 1872 | placeholder="请选择类型" |
| 1873 | value={genre} |
| 1874 | onChange={(value) => { |
| 1875 | setGenre(value); |
| 1876 | form.setFieldsValue({ genre: value }); |
| 1877 | }} |
| 1878 | className="w-full" |
| 1879 | > |
| 1880 | <Option value="">请选择类型</Option> |
| 1881 | {musicgenres.map((genre) => ( |
| 1882 | <Option key={genre.value} value={genre.value}> |
| 1883 | {genre.label} |
| 1884 | </Option> |
| 1885 | ))} |
| 1886 | </Select> |
| 1887 | </Form.Item> |
| 1888 | <Form.Item |
| 1889 | name="region" |
| 1890 | label="地区" |
| 1891 | > |
| 1892 | <Select |
| 1893 | placeholder="请选择地区" |
| 1894 | value={region} |
| 1895 | onChange={(value) => { |
| 1896 | setRegion(value); |
| 1897 | form.setFieldsValue({ region: value }); |
| 1898 | }} |
| 1899 | className="w-full" |
| 1900 | > |
| 1901 | <Option value="">请选择地区</Option> |
| 1902 | {regions.map((region) => ( |
| 1903 | <Option key={region.value} value={region.value}> |
| 1904 | {region.label} |
| 1905 | </Option> |
| 1906 | ))} |
| 1907 | </Select> |
| 1908 | </Form.Item> |
| 1909 | <Form.Item |
| 1910 | name="style" |
| 1911 | label="风格" |
| 1912 | > |
| 1913 | <Select |
| 1914 | placeholder="请选择风格" |
| 1915 | value={style} |
| 1916 | onChange={(value) => { |
| 1917 | setStyle(value); |
| 1918 | form.setFieldsValue({ style: value }); |
| 1919 | }} |
| 1920 | className="w-full" |
| 1921 | > |
| 1922 | <Option value="">请选择风格</Option> |
| 1923 | {musicstyles.map((style) => ( |
| 1924 | <Option key={style.value} value={style.value}> |
| 1925 | {style.label} |
| 1926 | </Option> |
| 1927 | ))} |
| 1928 | </Select> |
| 1929 | </Form.Item> |
| 1930 | <Form.Item |
| 1931 | name="format" |
| 1932 | label="格式" |
| 1933 | > |
| 1934 | <Select |
| 1935 | placeholder="请选择格式" |
| 1936 | value={format} |
| 1937 | onChange={(value) => { |
| 1938 | setFormat(value); |
| 1939 | form.setFieldsValue({ format: value }); |
| 1940 | }} |
| 1941 | className="w-full" |
| 1942 | > |
| 1943 | <Option value="">请选择格式</Option> |
| 1944 | {musicformats.map((format) => ( |
| 1945 | <Option key={format.value} value={format.value}> |
| 1946 | {format.label} |
| 1947 | </Option> |
| 1948 | ))} |
| 1949 | </Select> |
| 1950 | </Form.Item> |
| 1951 | </> |
| 1952 | )} |
| 1953 | |
| 1954 | {/* 动态字段 - 其他 */} |
| 1955 | {showotherFields && ( |
| 1956 | <> |
| 1957 | <Form.Item |
| 1958 | name="genre" |
| 1959 | label="类型" |
| 1960 | > |
| 1961 | <Select |
| 1962 | placeholder="请选择类型" |
| 1963 | value={genre} |
| 1964 | onChange={(value) => { |
| 1965 | setGenre(value); |
| 1966 | form.setFieldsValue({ genre: value }); |
| 1967 | }} |
| 1968 | className="w-full" |
| 1969 | > |
| 1970 | <Option value="">请选择类型</Option> |
| 1971 | {othergenres.map((genre) => ( |
| 1972 | <Option key={genre.value} value={genre.value}> |
| 1973 | {genre.label} |
| 1974 | </Option> |
| 1975 | ))} |
| 1976 | </Select> |
| 1977 | </Form.Item> |
| 1978 | </> |
| 1979 | )} |
| 1980 | {/* 提交按钮 */} |
| 1981 | <Form.Item> |
| 1982 | <Button |
| 1983 | type="primary" |
| 1984 | htmlType="submit" |
| 1985 | className="submitButton" |
| 1986 | onMouseOver={(e) => e.target.style.backgroundColor = '#ff7f00'} |
| 1987 | onMouseOut={(e) => e.target.style.backgroundColor = '#ff8c00'} |
| 1988 | > |
| 1989 | 上传种子 |
| 1990 | </Button> |
| 1991 | </Form.Item> |
| 1992 | |
| 1993 | {showSuccess && ( |
| 1994 | <div className="successMessage"> |
| 1995 | 上传成功! |
| 1996 | </div> |
| 1997 | )} |
| 1998 | </Form> |
| 1999 | </div> |
| 2000 | </div> |
| 2001 | ); |
| 2002 | } |
| 2003 | |
| 2004 | export default UploadTorrentFull; |
| 2005 | |