feat: 重新解析支持单URL,顶栏保留全部重解析
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
</template>
|
||||
|
||||
<el-button size="small" @click="refresh" :loading="loading">刷新</el-button>
|
||||
<el-button size="small" @click="doBatchParse" :loading="parseLoading" v-if="selectedConfigId">全部重新解析</el-button>
|
||||
|
||||
<!-- 审批/拒绝(待审核配置) -->
|
||||
<template v-if="selectedConfig?.status==='pending'">
|
||||
@@ -96,7 +97,7 @@
|
||||
<el-button size="small" @click="toggleView(page)">
|
||||
{{ expandedSet.has(page.url) ? '收起' : '查看' }}
|
||||
</el-button>
|
||||
<el-button size="small" @click="doBatchParse" :loading="parseLoading">重新解析</el-button>
|
||||
<el-button size="small" @click="reparseUrl(page)" :loading="reparsingUrls.has(page.url)">重新解析</el-button>
|
||||
<el-popconfirm title="确认删除此访问结果?" @confirm="deleteResult(page)">
|
||||
<template #reference>
|
||||
<el-button size="small" type="danger" text>删除</el-button>
|
||||
@@ -159,6 +160,7 @@ const allConfigVersions = ref([])
|
||||
const allResults = ref([])
|
||||
const pageParsed = ref({})
|
||||
const expandedSet = reactive(new Set())
|
||||
const reparsingUrls = reactive(new Set())
|
||||
|
||||
const totalResults = computed(() => allResults.value.length)
|
||||
|
||||
@@ -272,6 +274,22 @@ const toggleView = (page) => {
|
||||
else expandedSet.add(page.url)
|
||||
}
|
||||
|
||||
const reparseUrl = async (page) => {
|
||||
if (!selectedConfigId.value || !page.accessResultId) return
|
||||
reparsingUrls.add(page.url)
|
||||
try {
|
||||
const r = await api.adapter.parse(selectedConfigId.value, page.accessResultId)
|
||||
const parsed = r.data
|
||||
if (parsed) {
|
||||
const newParsed = { ...pageParsed.value }
|
||||
newParsed[page.url] = parsed
|
||||
pageParsed.value = newParsed
|
||||
}
|
||||
ElMessage.success('已重新解析')
|
||||
} catch { ElMessage.error('解析失败') }
|
||||
finally { reparsingUrls.delete(page.url) }
|
||||
}
|
||||
|
||||
const deleteResult = async (page) => {
|
||||
try {
|
||||
await api.accessResults.delete(page.accessResultId)
|
||||
|
||||
Reference in New Issue
Block a user