2026-04-02 00:31:28 +08:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import {
|
|
|
|
|
DeleteOutlined,
|
|
|
|
|
EditOutlined,
|
2026-04-02 21:16:12 +08:00
|
|
|
PauseCircleOutlined,
|
|
|
|
|
PlayCircleOutlined,
|
2026-04-02 00:31:28 +08:00
|
|
|
PlusOutlined,
|
2026-05-01 20:39:09 +08:00
|
|
|
} from '@ant-design/icons-vue'
|
|
|
|
|
import type { PromptRule, PromptRuleGroup } from '@geo/shared-types'
|
|
|
|
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/vue-query'
|
|
|
|
|
import { message, type TableColumnsType } from 'ant-design-vue'
|
|
|
|
|
import { computed, reactive, ref, watch } from 'vue'
|
|
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
|
|
|
|
|
|
import PromptRuleModal from '@/components/PromptRuleModal.vue'
|
|
|
|
|
import { promptRulesApi } from '@/lib/api'
|
|
|
|
|
import { formatDateTime } from '@/lib/display'
|
|
|
|
|
import { formatError } from '@/lib/errors'
|
2026-05-20 18:09:53 +08:00
|
|
|
import { useCompanyStore } from '@/stores/company'
|
2026-05-01 20:39:09 +08:00
|
|
|
|
|
|
|
|
const queryClient = useQueryClient()
|
|
|
|
|
const { t } = useI18n()
|
2026-05-20 18:09:53 +08:00
|
|
|
const companyStore = useCompanyStore()
|
2026-05-01 20:39:09 +08:00
|
|
|
|
|
|
|
|
const selectedGroupId = ref<number | 'all' | 'ungrouped'>('all')
|
|
|
|
|
const ruleModalOpen = ref(false)
|
|
|
|
|
const editingRule = ref<PromptRule | null>(null)
|
|
|
|
|
const groupModalOpen = ref(false)
|
|
|
|
|
const editingGroupId = ref<number | null>(null)
|
|
|
|
|
const groupForm = reactive({ name: '' })
|
|
|
|
|
const page = ref(1)
|
|
|
|
|
const pageSize = ref(20)
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
const groupsQuery = useQuery({
|
2026-05-20 18:09:53 +08:00
|
|
|
queryKey: computed(() => ['promptRules', 'groups', companyStore.currentBrandId]),
|
|
|
|
|
enabled: computed(() => Boolean(companyStore.currentBrandId)),
|
2026-04-02 00:31:28 +08:00
|
|
|
queryFn: () => promptRulesApi.listGroups(),
|
2026-05-01 20:39:09 +08:00
|
|
|
})
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
const ruleListParams = computed(() => {
|
|
|
|
|
const params: Record<string, unknown> = {
|
|
|
|
|
page: page.value,
|
|
|
|
|
page_size: pageSize.value,
|
|
|
|
|
}
|
2026-05-01 20:39:09 +08:00
|
|
|
if (selectedGroupId.value === 'ungrouped') {
|
|
|
|
|
params.ungrouped = true
|
|
|
|
|
} else if (selectedGroupId.value !== 'all') {
|
|
|
|
|
params.group_id = selectedGroupId.value
|
|
|
|
|
}
|
|
|
|
|
return params
|
|
|
|
|
})
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
const rulesQuery = useQuery({
|
2026-05-20 18:09:53 +08:00
|
|
|
queryKey: computed(() => ['promptRules', 'list', companyStore.currentBrandId, ruleListParams.value]),
|
|
|
|
|
enabled: computed(() => Boolean(companyStore.currentBrandId)),
|
2026-04-02 00:31:28 +08:00
|
|
|
queryFn: () => promptRulesApi.list(ruleListParams.value),
|
2026-05-01 20:39:09 +08:00
|
|
|
})
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
const columns = computed<TableColumnsType<PromptRule>>(() => [
|
2026-05-01 20:39:09 +08:00
|
|
|
{ title: t('custom.promptRule.name'), dataIndex: 'name', key: 'name', width: 160 },
|
|
|
|
|
{
|
|
|
|
|
title: t('custom.promptRule.content'),
|
|
|
|
|
dataIndex: 'prompt_content',
|
|
|
|
|
key: 'prompt_content',
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
},
|
|
|
|
|
{ title: t('custom.promptRule.scene'), dataIndex: 'scene', key: 'scene', width: 120 },
|
|
|
|
|
{
|
|
|
|
|
title: t('custom.promptRule.tone'),
|
|
|
|
|
dataIndex: 'default_tone',
|
|
|
|
|
key: 'default_tone',
|
|
|
|
|
width: 100,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: t('custom.promptRule.wordCount'),
|
|
|
|
|
dataIndex: 'default_word_count',
|
|
|
|
|
key: 'default_word_count',
|
|
|
|
|
width: 100,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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', align: 'right' },
|
|
|
|
|
])
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
const groupMutations = {
|
|
|
|
|
create: useMutation({
|
|
|
|
|
mutationFn: () => promptRulesApi.createGroup({ name: groupForm.name.trim() }),
|
|
|
|
|
onSuccess: async () => {
|
2026-05-01 20:39:09 +08:00
|
|
|
message.success(t('custom.messages.groupCreated'))
|
|
|
|
|
groupModalOpen.value = false
|
|
|
|
|
await queryClient.invalidateQueries({ queryKey: ['promptRules', 'groups'] })
|
2026-04-02 00:31:28 +08:00
|
|
|
},
|
|
|
|
|
onError: (error) => message.error(formatError(error)),
|
|
|
|
|
}),
|
|
|
|
|
update: useMutation({
|
|
|
|
|
mutationFn: () =>
|
|
|
|
|
promptRulesApi.updateGroup(editingGroupId.value as number, { name: groupForm.name.trim() }),
|
|
|
|
|
onSuccess: async () => {
|
2026-05-01 20:39:09 +08:00
|
|
|
message.success(t('custom.messages.groupUpdated'))
|
|
|
|
|
groupModalOpen.value = false
|
|
|
|
|
await queryClient.invalidateQueries({ queryKey: ['promptRules', 'groups'] })
|
2026-04-02 00:31:28 +08:00
|
|
|
},
|
|
|
|
|
onError: (error) => message.error(formatError(error)),
|
|
|
|
|
}),
|
|
|
|
|
remove: useMutation({
|
|
|
|
|
mutationFn: (id: number) => promptRulesApi.removeGroup(id),
|
|
|
|
|
onSuccess: async () => {
|
2026-05-01 20:39:09 +08:00
|
|
|
message.success(t('custom.messages.groupDeleted'))
|
2026-04-02 00:31:28 +08:00
|
|
|
if (selectedGroupId.value === editingGroupId.value) {
|
2026-05-01 20:39:09 +08:00
|
|
|
selectedGroupId.value = 'all'
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
2026-05-01 20:39:09 +08:00
|
|
|
await queryClient.invalidateQueries({ queryKey: ['promptRules'] })
|
2026-04-02 00:31:28 +08:00
|
|
|
},
|
|
|
|
|
onError: (error) => message.error(formatError(error)),
|
|
|
|
|
}),
|
2026-05-01 20:39:09 +08:00
|
|
|
}
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
const ruleMutations = {
|
|
|
|
|
remove: useMutation({
|
|
|
|
|
mutationFn: (id: number) => promptRulesApi.remove(id),
|
|
|
|
|
onSuccess: async () => {
|
2026-05-01 20:39:09 +08:00
|
|
|
message.success(t('custom.messages.ruleDeleted'))
|
|
|
|
|
await queryClient.invalidateQueries({ queryKey: ['promptRules'] })
|
2026-04-02 00:31:28 +08:00
|
|
|
},
|
|
|
|
|
onError: (error) => message.error(formatError(error)),
|
|
|
|
|
}),
|
|
|
|
|
toggleStatus: useMutation({
|
2026-05-01 20:39:09 +08:00
|
|
|
mutationFn: ({ id, status }: { id: number; status: 'enabled' | 'disabled' }) =>
|
2026-04-02 00:31:28 +08:00
|
|
|
promptRulesApi.toggleStatus(id, { status }),
|
|
|
|
|
onSuccess: async (_data, variables) => {
|
|
|
|
|
message.success(
|
2026-05-01 20:39:09 +08:00
|
|
|
variables.status === 'enabled'
|
|
|
|
|
? t('custom.messages.ruleEnabled')
|
|
|
|
|
: t('custom.messages.ruleDisabled'),
|
|
|
|
|
)
|
|
|
|
|
await queryClient.invalidateQueries({ queryKey: ['promptRules'] })
|
2026-04-02 00:31:28 +08:00
|
|
|
},
|
|
|
|
|
onError: (error) => message.error(formatError(error)),
|
|
|
|
|
}),
|
2026-05-01 20:39:09 +08:00
|
|
|
}
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
function openGroupModal(group?: PromptRuleGroup): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
editingGroupId.value = group?.id ?? null
|
|
|
|
|
groupForm.name = group?.name ?? ''
|
|
|
|
|
groupModalOpen.value = true
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function submitGroup(): Promise<void> {
|
2026-05-01 20:39:09 +08:00
|
|
|
if (!groupForm.name.trim()) return
|
2026-04-02 00:31:28 +08:00
|
|
|
if (editingGroupId.value) {
|
2026-05-01 20:39:09 +08:00
|
|
|
await groupMutations.update.mutateAsync()
|
2026-04-02 00:31:28 +08:00
|
|
|
} else {
|
2026-05-01 20:39:09 +08:00
|
|
|
await groupMutations.create.mutateAsync()
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function openRuleModal(rule?: PromptRule): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
editingRule.value = rule ?? null
|
|
|
|
|
ruleModalOpen.value = true
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleTableChange(nextPage: number, nextPageSize: number): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
page.value = nextPage
|
|
|
|
|
pageSize.value = nextPageSize
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
watch(selectedGroupId, () => {
|
2026-05-01 20:39:09 +08:00
|
|
|
page.value = 1
|
|
|
|
|
})
|
2026-05-20 18:09:53 +08:00
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
() => companyStore.currentBrandId,
|
|
|
|
|
() => {
|
|
|
|
|
selectedGroupId.value = 'all'
|
|
|
|
|
editingRule.value = null
|
|
|
|
|
ruleModalOpen.value = false
|
|
|
|
|
groupModalOpen.value = false
|
|
|
|
|
page.value = 1
|
|
|
|
|
},
|
|
|
|
|
)
|
2026-04-02 00:31:28 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="prompt-rule-tab">
|
|
|
|
|
<div class="prompt-rule-tab__layout">
|
|
|
|
|
<!-- Group sidebar -->
|
|
|
|
|
<aside class="prompt-rule-tab__sidebar">
|
|
|
|
|
<div class="prompt-rule-tab__sidebar-head">
|
2026-05-01 20:39:09 +08:00
|
|
|
<h4>{{ t('custom.group.title') }}</h4>
|
2026-04-02 00:31:28 +08:00
|
|
|
<a-button type="text" size="small" @click="openGroupModal()">
|
|
|
|
|
<template #icon><PlusOutlined /></template>
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="prompt-rule-tab__group-list">
|
|
|
|
|
<div
|
|
|
|
|
class="prompt-rule-tab__group-item"
|
|
|
|
|
:class="{ 'prompt-rule-tab__group-item--active': selectedGroupId === 'all' }"
|
|
|
|
|
@click="selectedGroupId = 'all'"
|
|
|
|
|
>
|
2026-05-01 20:39:09 +08:00
|
|
|
<span>{{ t('custom.group.allRules') }}</span>
|
2026-04-02 00:31:28 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
v-for="group in groupsQuery.data.value ?? []"
|
|
|
|
|
:key="group.id"
|
|
|
|
|
class="prompt-rule-tab__group-item"
|
|
|
|
|
:class="{ 'prompt-rule-tab__group-item--active': selectedGroupId === group.id }"
|
|
|
|
|
@click="selectedGroupId = group.id"
|
|
|
|
|
>
|
|
|
|
|
<span>{{ group.name }}</span>
|
|
|
|
|
<span class="prompt-rule-tab__group-actions">
|
|
|
|
|
<a-button type="text" size="small" @click.stop="openGroupModal(group)">
|
|
|
|
|
<template #icon><EditOutlined /></template>
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-popconfirm
|
|
|
|
|
:title="t('custom.group.deleteConfirm')"
|
|
|
|
|
@confirm="groupMutations.remove.mutate(group.id)"
|
|
|
|
|
>
|
|
|
|
|
<a-button type="text" size="small" danger @click.stop>
|
|
|
|
|
<template #icon><DeleteOutlined /></template>
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
class="prompt-rule-tab__group-item"
|
|
|
|
|
:class="{ 'prompt-rule-tab__group-item--active': selectedGroupId === 'ungrouped' }"
|
|
|
|
|
@click="selectedGroupId = 'ungrouped'"
|
|
|
|
|
>
|
2026-05-01 20:39:09 +08:00
|
|
|
<span>{{ t('custom.promptRule.ungrouped') }}</span>
|
2026-04-02 00:31:28 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</aside>
|
|
|
|
|
|
|
|
|
|
<!-- Rule list panel -->
|
|
|
|
|
<div class="prompt-rule-tab__panel">
|
|
|
|
|
<div class="prompt-rule-tab__panel-head">
|
|
|
|
|
<span class="prompt-rule-tab__count">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ t('templates.list.count', { count: rulesQuery.data.value?.total ?? 0 }) }}
|
2026-04-02 00:31:28 +08:00
|
|
|
</span>
|
|
|
|
|
<a-button type="primary" @click="openRuleModal()">
|
|
|
|
|
<template #icon><PlusOutlined /></template>
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ t('common.create') }}
|
2026-04-02 00:31:28 +08:00
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<a-table
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:data-source="rulesQuery.data.value?.items ?? []"
|
|
|
|
|
:loading="rulesQuery.isPending.value"
|
|
|
|
|
:pagination="{
|
|
|
|
|
current: page,
|
|
|
|
|
pageSize,
|
|
|
|
|
total: rulesQuery.data.value?.total ?? 0,
|
|
|
|
|
showSizeChanger: true,
|
|
|
|
|
}"
|
|
|
|
|
row-key="id"
|
|
|
|
|
size="small"
|
|
|
|
|
:scroll="{ x: 1100 }"
|
|
|
|
|
@change="(p: any) => handleTableChange(p.current, p.pageSize)"
|
|
|
|
|
>
|
|
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
|
|
<template v-if="column.key === 'prompt_content'">
|
|
|
|
|
<span class="prompt-rule-tab__content-cell">{{ record.prompt_content }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else-if="column.key === 'scene'">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ record.scene || '--' }}
|
2026-04-02 00:31:28 +08:00
|
|
|
</template>
|
|
|
|
|
<template v-else-if="column.key === 'default_tone'">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ record.default_tone || '--' }}
|
2026-04-02 00:31:28 +08:00
|
|
|
</template>
|
|
|
|
|
<template v-else-if="column.key === 'default_word_count'">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ record.default_word_count || '--' }}
|
2026-04-02 00:31:28 +08:00
|
|
|
</template>
|
|
|
|
|
<template v-else-if="column.key === 'status'">
|
|
|
|
|
<a-tag :color="record.status === 'enabled' ? 'green' : 'default'">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{
|
|
|
|
|
record.status === 'enabled'
|
|
|
|
|
? t('custom.promptRule.enabled')
|
|
|
|
|
: t('custom.promptRule.disabled')
|
|
|
|
|
}}
|
2026-04-02 00:31:28 +08:00
|
|
|
</a-tag>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else-if="column.key === 'created_at'">
|
|
|
|
|
{{ formatDateTime(record.created_at) }}
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else-if="column.key === 'actions'">
|
2026-04-02 21:16:12 +08:00
|
|
|
<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
|
2026-05-01 20:39:09 +08:00
|
|
|
:title="
|
|
|
|
|
record.status === 'enabled'
|
|
|
|
|
? t('custom.promptRule.disabled')
|
|
|
|
|
: t('custom.promptRule.enabled')
|
|
|
|
|
"
|
2026-04-02 00:31:28 +08:00
|
|
|
>
|
2026-04-02 21:16:12 +08:00
|
|
|
<a-button
|
|
|
|
|
type="text"
|
|
|
|
|
shape="circle"
|
|
|
|
|
size="small"
|
|
|
|
|
:class="[
|
|
|
|
|
'action-btn',
|
|
|
|
|
record.status === 'enabled' ? 'action-disable' : 'action-enable',
|
|
|
|
|
]"
|
2026-05-01 20:39:09 +08:00
|
|
|
@click="
|
|
|
|
|
ruleMutations.toggleStatus.mutate({
|
|
|
|
|
id: record.id,
|
|
|
|
|
status: record.status === 'enabled' ? 'disabled' : 'enabled',
|
|
|
|
|
})
|
|
|
|
|
"
|
2026-04-02 21:16:12 +08:00
|
|
|
>
|
|
|
|
|
<PauseCircleOutlined v-if="record.status === 'enabled'" />
|
|
|
|
|
<PlayCircleOutlined v-else />
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-tooltip>
|
2026-04-02 00:31:28 +08:00
|
|
|
<a-popconfirm
|
|
|
|
|
:title="t('custom.promptRule.deleteConfirm')"
|
|
|
|
|
@confirm="ruleMutations.remove.mutate(record.id)"
|
|
|
|
|
>
|
2026-04-02 21:16:12 +08:00
|
|
|
<a-button
|
|
|
|
|
type="text"
|
|
|
|
|
shape="circle"
|
|
|
|
|
size="small"
|
|
|
|
|
class="action-btn action-delete"
|
|
|
|
|
:title="t('common.delete')"
|
|
|
|
|
>
|
|
|
|
|
<DeleteOutlined />
|
2026-04-02 00:31:28 +08:00
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
2026-04-02 21:16:12 +08:00
|
|
|
</div>
|
2026-04-02 00:31:28 +08:00
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</a-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Group modal -->
|
|
|
|
|
<a-modal
|
|
|
|
|
:open="groupModalOpen"
|
|
|
|
|
:title="editingGroupId ? t('custom.group.editTitle') : t('custom.group.createTitle')"
|
2026-05-01 20:39:09 +08:00
|
|
|
:confirm-loading="
|
|
|
|
|
groupMutations.create.isPending.value || groupMutations.update.isPending.value
|
|
|
|
|
"
|
2026-04-02 00:31:28 +08:00
|
|
|
@ok="submitGroup"
|
|
|
|
|
@cancel="groupModalOpen = false"
|
|
|
|
|
>
|
|
|
|
|
<a-form layout="vertical" style="padding-top: 8px">
|
|
|
|
|
<a-form-item :label="t('custom.group.name')" required>
|
|
|
|
|
<a-input v-model:value="groupForm.name" :maxlength="50" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form>
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
|
|
|
<!-- Rule modal -->
|
|
|
|
|
<PromptRuleModal v-model:open="ruleModalOpen" :rule="editingRule" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.prompt-rule-tab__layout {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: 240px minmax(0, 1fr);
|
|
|
|
|
gap: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.prompt-rule-tab__sidebar {
|
|
|
|
|
background: #f8fafc;
|
|
|
|
|
border: 1px solid #e6edf5;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
padding: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.prompt-rule-tab__sidebar-head {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.prompt-rule-tab__sidebar-head h4 {
|
|
|
|
|
margin: 0;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.prompt-rule-tab__group-list {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.prompt-rule-tab__group-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
border: 1px solid transparent;
|
2026-05-01 20:39:09 +08:00
|
|
|
transition:
|
|
|
|
|
background 0.2s,
|
|
|
|
|
border-color 0.2s;
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.prompt-rule-tab__group-item:hover {
|
|
|
|
|
background: #f0f5ff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.prompt-rule-tab__group-item--active {
|
|
|
|
|
border-color: #bfd7ff;
|
|
|
|
|
background: #eef5ff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.prompt-rule-tab__group-actions {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 2px;
|
|
|
|
|
opacity: 0;
|
|
|
|
|
transition: opacity 0.15s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.prompt-rule-tab__group-item:hover .prompt-rule-tab__group-actions {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.prompt-rule-tab__panel-head {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.prompt-rule-tab__count {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: #8c8c8c;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.prompt-rule-tab__content-cell {
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
-webkit-line-clamp: 2;
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #595959;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 720px) {
|
|
|
|
|
.prompt-rule-tab__layout {
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|