修复翻译按钮不显示的问题
This commit is contained in:
@@ -1120,7 +1120,6 @@ function isRemoveDisabled(token: string): boolean {
|
||||
<div class="pe-title-group">
|
||||
<span>提示词映射(双击修改)</span>
|
||||
<button
|
||||
v-if="unmappedTokens.length > 0"
|
||||
class="pe-auto-trans-btn"
|
||||
@click="() => { translationTargetToken = null; showTranslationPopup = true; }"
|
||||
title="自动翻译未映射词条"
|
||||
|
||||
@@ -35,28 +35,21 @@ function displayTrans(tag: PromptTag) {
|
||||
<div class="pqa-root">
|
||||
<!-- Categories -->
|
||||
<div class="pqa-categories">
|
||||
<button
|
||||
v-for="(c, i) in categories"
|
||||
:key="c.id"
|
||||
class="pqa-tab"
|
||||
:class="{ active: i === store.selectedCategoryIndex }"
|
||||
@click="selectCategory(i)"
|
||||
>
|
||||
<button v-for="(c, i) in categories" :key="c.id" class="pqa-tab"
|
||||
:class="{ active: i === store.selectedCategoryIndex }" @click="selectCategory(i)">
|
||||
{{ c.name }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Groups -->
|
||||
<div class="pqa-groups" v-if="currentCategory?.groups.length">
|
||||
<button
|
||||
v-for="(g, i) in currentCategory.groups"
|
||||
:key="g.id"
|
||||
class="pqa-group-tab"
|
||||
:class="{ active: i === store.selectedGroupIndex }"
|
||||
:style="{ '--group-color': g.color || 'var(--color-text-secondary)' }"
|
||||
@click="selectGroup(i)"
|
||||
@mousedown.prevent
|
||||
>
|
||||
<button v-for="(g, i) in currentCategory.groups" :key="g.id" class="pqa-group-tab"
|
||||
:class="{ active: i === store.selectedGroupIndex }" :style="{
|
||||
'--group-color':
|
||||
g.color && g.color !== 'rgba(0, 0, 0, .0)'
|
||||
? g.color
|
||||
: 'var(--color-text-secondary)'
|
||||
}" @click="selectGroup(i)" @mousedown.prevent>
|
||||
<span class="pqa-dot"></span>
|
||||
{{ g.name }}
|
||||
</button>
|
||||
@@ -64,14 +57,8 @@ function displayTrans(tag: PromptTag) {
|
||||
|
||||
<!-- Tags -->
|
||||
<div class="pqa-tags">
|
||||
<button
|
||||
v-for="tag in filteredTags"
|
||||
:key="tag.key"
|
||||
class="pqa-tag"
|
||||
@click="onTagClick(tag)"
|
||||
@mousedown.prevent
|
||||
:title="tag.key"
|
||||
>
|
||||
<button v-for="tag in filteredTags" :key="tag.key" class="pqa-tag" @click="onTagClick(tag)" @mousedown.prevent
|
||||
:title="tag.key">
|
||||
<span class="pqa-tag-text">{{ displayTrans(tag) }}</span>
|
||||
<span class="pqa-tag-sub" v-if="displayTrans(tag) !== tag.key">{{ tag.key }}</span>
|
||||
</button>
|
||||
@@ -106,10 +93,12 @@ function displayTrans(tag: PromptTag) {
|
||||
.pqa-categories::-webkit-scrollbar {
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
.pqa-categories::-webkit-scrollbar-thumb {
|
||||
background: var(--color-border);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.pqa-categories::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--color-text-tertiary);
|
||||
}
|
||||
@@ -148,10 +137,12 @@ function displayTrans(tag: PromptTag) {
|
||||
.pqa-groups::-webkit-scrollbar {
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
.pqa-groups::-webkit-scrollbar-thumb {
|
||||
background: var(--color-border);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.pqa-groups::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--color-text-tertiary);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
共 {{ tokens.length }} 个未映射词条
|
||||
</div>
|
||||
<div class="tp-actions">
|
||||
<button @click="startTranslation" :disabled="loading" class="tp-btn primary">
|
||||
<button @click="startTranslation" :disabled="loading || tokens.length === 0" class="tp-btn primary">
|
||||
{{ loading ? '翻译中...' : '开始翻译' }}
|
||||
</button>
|
||||
</div>
|
||||
@@ -26,13 +26,17 @@
|
||||
<div class="tp-list">
|
||||
<div class="tp-list-header">
|
||||
<label class="tp-checkbox-wrapper">
|
||||
<input type="checkbox" :checked="isAllSelected" @change="toggleSelectAll" />
|
||||
<input type="checkbox" :checked="isAllSelected" @change="toggleSelectAll" :disabled="tokens.length === 0" />
|
||||
<span>全选</span>
|
||||
</label>
|
||||
<span>原词</span>
|
||||
<span>翻译结果 (可直接编辑)</span>
|
||||
</div>
|
||||
|
||||
<div v-if="tokens.length === 0" class="tp-empty-state">
|
||||
暂无未映射词条
|
||||
</div>
|
||||
|
||||
<div v-for="token in tokens" :key="token" class="tp-item" :class="{ selected: selected.has(token) }">
|
||||
<label class="tp-checkbox-wrapper">
|
||||
<input
|
||||
@@ -333,6 +337,16 @@ function apply() {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tp-empty-state {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--color-text-tertiary);
|
||||
font-size: 0.875rem;
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
/* Scrollbar styling */
|
||||
.tp-list::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
|
||||
Reference in New Issue
Block a user