fix task article link drawer
Frontend CI / Frontend (push) Successful in 5m6s
Backend CI / Backend (push) Successful in 16m45s

This commit is contained in:
2026-05-14 21:14:27 +08:00
parent 34dda524d7
commit 765dae4bf1
15 changed files with 735 additions and 104 deletions
@@ -7,7 +7,7 @@ import type { Dayjs } from 'dayjs'
import { computed, onBeforeUnmount, reactive, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import ArticleDetailDrawer from '@/components/ArticleDetailDrawer.vue'
import GeneratedArticleLinksDrawer from '@/components/GeneratedArticleLinksDrawer.vue'
import { instantTasksApi, promptRulesApi } from '@/lib/api'
import { formatDateTime, getGenerateStatusMeta } from '@/lib/display'
import { formatPublishPlatformList } from '@/lib/publish-platforms'
@@ -17,8 +17,8 @@ const { t } = useI18n()
const page = ref(1)
const pageSize = ref(20)
const createdRange = ref<[Dayjs, Dayjs] | null>(null)
const detailOpen = ref(false)
const selectedArticleId = ref<number | null>(null)
const articleLinksOpen = ref(false)
const selectedTask = ref<InstantTaskItem | null>(null)
const draftFilters = reactive<{
prompt_rule_id?: number
@@ -54,6 +54,7 @@ const statusOptions = computed(() => [
{ label: getGenerateStatusMeta('queued').label, value: 'queued' },
{ label: getGenerateStatusMeta('running').label, value: 'running' },
{ label: getGenerateStatusMeta('completed').label, value: 'completed' },
{ label: getGenerateStatusMeta('partial_success').label, value: 'partial_success' },
{ label: getGenerateStatusMeta('failed').label, value: 'failed' },
])
@@ -135,12 +136,14 @@ function handleTableChange(nextPage: number, nextPageSize: number): void {
pageSize.value = nextPageSize
}
function openArticle(task: InstantTaskItem): void {
if (!task.article_id) {
const selectedTaskArticles = computed(() => selectedTask.value?.articles ?? [])
function openTaskArticles(task: InstantTaskItem): void {
if (!task.articles?.length) {
return
}
selectedArticleId.value = task.article_id
detailOpen.value = true
selectedTask.value = task
articleLinksOpen.value = true
}
function startPolling(): void {
@@ -281,8 +284,8 @@ onBeforeUnmount(() => {
shape="circle"
size="small"
class="action-btn action-eye"
:disabled="!record.article_id"
@click="openArticle(record)"
:disabled="!record.articles?.length"
@click="openTaskArticles(record)"
>
<EyeOutlined />
</a-button>
@@ -293,10 +296,9 @@ onBeforeUnmount(() => {
</template>
</a-table>
<ArticleDetailDrawer
:open="detailOpen"
:article-id="selectedArticleId"
@close="detailOpen = false"
<GeneratedArticleLinksDrawer
v-model:open="articleLinksOpen"
:articles="selectedTaskArticles"
/>
</div>
</template>