Refactor brand service and related components
- Removed ListQuestionVersions method and associated types from BrandService and Queries. - Updated PromptRuleGenerationService to change task naming and handling. - Enhanced ScheduleTaskService to support filtering by created date range and keyword. - Introduced InstantTaskService for managing instant tasks with appropriate filtering and response structures. - Added InstantTaskHandler for handling API requests related to instant tasks. - Created InstantTaskTab component for the admin web interface to display and manage instant tasks. - Updated database migrations to rename source types for articles and generation tasks. - Adjusted models and repository queries to reflect the removal of question version handling.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
import {
|
||||
DeleteOutlined,
|
||||
EditOutlined,
|
||||
PauseCircleOutlined,
|
||||
PlayCircleOutlined,
|
||||
PlusOutlined,
|
||||
} from "@ant-design/icons-vue";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/vue-query";
|
||||
@@ -59,7 +61,7 @@ const columns = computed<TableColumnsType<PromptRule>>(() => [
|
||||
{ title: t("custom.promptRule.articleCount"), dataIndex: "article_count", key: "article_count", width: 100 },
|
||||
{ title: t("custom.promptRule.status"), dataIndex: "status", key: "status", width: 100 },
|
||||
{ title: t("common.createdAt"), dataIndex: "created_at", key: "created_at", width: 168 },
|
||||
{ title: t("common.actions"), key: "actions", width: 140, fixed: "right" },
|
||||
{ title: t("common.actions"), key: "actions", width: 140, fixed: "right", align: "right" },
|
||||
]);
|
||||
|
||||
const groupMutations = {
|
||||
@@ -252,29 +254,53 @@ watch(selectedGroupId, () => {
|
||||
{{ formatDateTime(record.created_at) }}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'actions'">
|
||||
<a-space :size="4">
|
||||
<a-button type="link" size="small" @click="openRuleModal(record)">
|
||||
{{ t("common.edit") }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="link"
|
||||
size="small"
|
||||
@click="ruleMutations.toggleStatus.mutate({
|
||||
id: record.id,
|
||||
status: record.status === 'enabled' ? 'disabled' : 'enabled',
|
||||
})"
|
||||
<div class="table-actions-row">
|
||||
<a-tooltip :title="t('common.edit')">
|
||||
<a-button
|
||||
type="text"
|
||||
shape="circle"
|
||||
size="small"
|
||||
class="action-btn action-edit"
|
||||
@click="openRuleModal(record)"
|
||||
>
|
||||
<EditOutlined />
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
:title="record.status === 'enabled' ? t('custom.promptRule.disabled') : t('custom.promptRule.enabled')"
|
||||
>
|
||||
{{ record.status === "enabled" ? t("custom.promptRule.disabled") : t("custom.promptRule.enabled") }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="text"
|
||||
shape="circle"
|
||||
size="small"
|
||||
:class="[
|
||||
'action-btn',
|
||||
record.status === 'enabled' ? 'action-disable' : 'action-enable',
|
||||
]"
|
||||
@click="ruleMutations.toggleStatus.mutate({
|
||||
id: record.id,
|
||||
status: record.status === 'enabled' ? 'disabled' : 'enabled',
|
||||
})"
|
||||
>
|
||||
<PauseCircleOutlined v-if="record.status === 'enabled'" />
|
||||
<PlayCircleOutlined v-else />
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-popconfirm
|
||||
:title="t('custom.promptRule.deleteConfirm')"
|
||||
@confirm="ruleMutations.remove.mutate(record.id)"
|
||||
>
|
||||
<a-button type="link" size="small" danger>
|
||||
{{ t("common.delete") }}
|
||||
<a-button
|
||||
type="text"
|
||||
shape="circle"
|
||||
size="small"
|
||||
class="action-btn action-delete"
|
||||
:title="t('common.delete')"
|
||||
>
|
||||
<DeleteOutlined />
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
Reference in New Issue
Block a user