Skip to content

Commit 78e0022

Browse files
author
Taois
committed
feat: 实现解析页面及功能
1 parent 14e947f commit 78e0022

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

dashboard/src/views/Parser.vue

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,10 @@
309309
@ok="handleLoadConfig"
310310
@cancel="showConfigDialog = false"
311311
>
312-
<a-form layout="vertical">
312+
<a-form :model="configForm" layout="vertical">
313313
<a-form-item label="配置地址">
314314
<a-input
315-
v-model="configUrl"
315+
v-model="configForm.url"
316316
placeholder="请输入配置地址"
317317
/>
318318
<template #extra>
@@ -332,9 +332,9 @@
332332
:footer="false"
333333
>
334334
<div class="batch-test-content">
335-
<a-form layout="vertical">
335+
<a-form :model="batchTestForm" layout="vertical">
336336
<a-form-item label="测试视频地址">
337-
<a-select v-model="testVideoUrl" placeholder="选择或输入测试视频地址">
337+
<a-select v-model="batchTestForm.videoUrl" placeholder="选择或输入测试视频地址">
338338
<a-option value="https://v.qq.com/x/cover/mzc00200mp8vo9b.html">腾讯视频示例</a-option>
339339
<a-option value="https://www.iqiyi.com/v_19rr7aqk5o.html">爱奇艺示例</a-option>
340340
<a-option value="https://v.youku.com/v_show/id_XNDkxMjQ4NjA4MA==.html">优酷示例</a-option>
@@ -411,8 +411,6 @@ const testingParsers = ref(new Set())
411411
const testResults = ref({})
412412
const batchTesting = ref(false)
413413
const batchTestResults = ref([])
414-
const testVideoUrl = ref('https://v.qq.com/x/cover/mzc00200mp8vo9b.html')
415-
const configUrl = ref('')
416414
const uploadRef = ref(null)
417415
const importFile = ref(null)
418416
@@ -425,6 +423,14 @@ const parserForm = ref({
425423
headerJson: ''
426424
})
427425
426+
const configForm = ref({
427+
url: ''
428+
})
429+
430+
const batchTestForm = ref({
431+
videoUrl: 'https://v.qq.com/x/cover/mzc00200mp8vo9b.html'
432+
})
433+
428434
// 用于拖拽的响应式数据
429435
const dragParsers = ref([])
430436
@@ -489,7 +495,7 @@ const testParser = async (parser) => {
489495
testingParsers.value.add(parser.id)
490496
491497
try {
492-
const result = await parserStore.testParser(parser, testVideoUrl.value)
498+
const result = await parserStore.testParser(parser, batchTestForm.value.videoUrl)
493499
testResults.value[parser.id] = result
494500
495501
Message[result.success ? 'success' : 'error'](result.message)
@@ -586,21 +592,21 @@ const handleImport = async () => {
586592
}
587593
588594
const handleLoadConfig = async () => {
589-
if (!configUrl.value) {
595+
if (!configForm.value.url) {
590596
Message.error('请输入配置地址')
591597
return
592598
}
593599
594-
const success = await parserStore.loadParsersFromConfig(configUrl.value)
600+
const success = await parserStore.loadParsersFromConfig(configForm.value.url)
595601
if (success) {
596602
Message.success('配置加载成功')
597603
showConfigDialog.value = false
598-
configUrl.value = ''
604+
configForm.value.url = ''
599605
}
600606
}
601607
602608
const startBatchTest = async () => {
603-
if (!testVideoUrl.value) {
609+
if (!batchTestForm.value.videoUrl) {
604610
Message.error('请输入测试视频地址')
605611
return
606612
}
@@ -610,7 +616,7 @@ const startBatchTest = async () => {
610616
611617
for (const parser of parserStore.enabledParsers) {
612618
try {
613-
const result = await parserStore.testParser(parser, testVideoUrl.value)
619+
const result = await parserStore.testParser(parser, batchTestForm.value.videoUrl)
614620
batchTestResults.value.push({
615621
id: parser.id,
616622
name: parser.name,

0 commit comments

Comments
 (0)