优化tk版页面
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
class="w-full rounded-xl flex items-center gap-2 px-3 py-2.5 transition-all duration-200" style="height: 6vh;"
|
||||
:class="currentView === 'auto_dm' ? 'bg-white text-blue-600 shadow shadow-blue-900/20' : 'text-slate-400 hover:bg-[rgba(21,96,250,0.06)]'">
|
||||
<img :src="currentView === 'auto_dm' ? nav33 : nav3" class="w-9 h-9 object-contain flex-shrink-0" />
|
||||
<span class="text-base font-medium truncate">自动私信</span>
|
||||
<span class="text-base font-medium truncate">自动私信(即时消息)</span>
|
||||
</button>
|
||||
|
||||
<button @click="currentView = 'auto_dm_tk'"
|
||||
|
||||
@@ -76,13 +76,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rounded-xl border border-gray-200 bg-gradient-to-br from-slate-50 via-white to-blue-50/40 p-4">
|
||||
<div
|
||||
class="rounded-xl border border-gray-200 bg-gradient-to-br from-slate-50 via-white to-blue-50/40 p-4">
|
||||
<div class="flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<div class="text-sm font-medium text-gray-900">运行设置</div>
|
||||
<p class="text-xs text-gray-500">控制分组轮换、单用户节奏,以及首次进入全流程的分组。</p>
|
||||
</div>
|
||||
<span class="rounded-full border border-gray-200 bg-white px-3 py-1 text-xs text-gray-600">启动前生效</span>
|
||||
<span
|
||||
class="rounded-full border border-gray-200 bg-white px-3 py-1 text-xs text-gray-600">启动前生效</span>
|
||||
</div>
|
||||
<div class="mt-4 grid grid-cols-1 gap-3 md:grid-cols-2">
|
||||
<div class="rounded-xl border border-gray-200 bg-white/90 p-3 shadow-sm">
|
||||
@@ -105,21 +107,12 @@
|
||||
class="h-11 w-full rounded-lg border border-gray-300 bg-white px-4 text-sm text-gray-800 outline-none focus:border-blue-500 disabled:cursor-not-allowed disabled:opacity-60"
|
||||
@blur="handlePostUserSleepBlur" />
|
||||
</div>
|
||||
<div class="rounded-xl border border-gray-200 bg-white/90 p-3 shadow-sm">
|
||||
<label class="mb-2 block text-xs font-medium text-gray-500">全流程起始分组</label>
|
||||
<select v-model.number="configForm.initialFullGroupNumber" :disabled="isConfigControlDisabled"
|
||||
class="h-11 w-full rounded-lg border border-gray-300 bg-white px-4 text-sm text-gray-800 outline-none focus:border-blue-500 disabled:cursor-not-allowed disabled:opacity-60"
|
||||
@change="handleInitialFullGroupChange">
|
||||
<option v-for="option in startFullGroupOptions" :key="option.value" :value="option.value"
|
||||
:disabled="!option.enabled">
|
||||
{{ option.label }}({{ option.hint }}{{ option.enabled ? '' : ',未启用' }})
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label v-if="!isBrotherInfoMode"
|
||||
class="flex min-h-[92px] flex-col justify-between rounded-xl border border-gray-200 bg-white/90 p-3 shadow-sm">
|
||||
<span class="text-xs font-medium text-gray-500">未读消息处理</span>
|
||||
<span class="flex h-11 items-center gap-3 rounded-lg border border-gray-200 bg-gray-50 px-4 text-sm text-gray-700">
|
||||
<span
|
||||
class="flex h-11 items-center gap-3 rounded-lg border border-gray-200 bg-gray-50 px-4 text-sm text-gray-700">
|
||||
<input v-model="configForm.replyUnreadMessages" :disabled="isConfigControlDisabled"
|
||||
type="checkbox" class="h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500" />
|
||||
<span>开启 AI 回复未读消息</span>
|
||||
@@ -172,22 +165,31 @@
|
||||
<span class="font-medium text-gray-900">视图分组</span>
|
||||
</div>
|
||||
<span class="text-xs text-gray-500">每组支持 0-3 个视图</span>
|
||||
<div class="mt-2 text-sm font-medium text-gray-800">第 {{ effectiveInitialFullGroupNumber }} 组起始全流程
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-3 gap-4">
|
||||
<div v-for="(count, index) in configForm.groupViewCounts" :key="index"
|
||||
class="rounded-xl border border-gray-200 bg-white p-4">
|
||||
:class="['rounded-xl border p-4 transition-all', count > 0 ? 'cursor-pointer bg-white hover:border-blue-300 hover:shadow-sm' : 'bg-gray-50', effectiveInitialFullGroupNumber === index + 1 ? 'border-blue-500 ring-2 ring-blue-100' : 'border-gray-200']"
|
||||
@click="handleSelectInitialFullGroup(index)">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<div>
|
||||
<div class="text-sm font-medium text-gray-800">第 {{ index + 1 }} 组</div>
|
||||
<div class="mt-1 text-xs text-gray-500">{{ groupRangeLabel(index) }}</div>
|
||||
</div>
|
||||
<span class="rounded-full bg-gray-100 px-2 py-1 text-[10px] text-gray-600">{{ groupViewText(count)
|
||||
}}</span>
|
||||
<span
|
||||
:class="['rounded-full px-2 py-1 text-[10px]', effectiveInitialFullGroupNumber === index + 1 ? 'bg-blue-100 text-blue-700' : 'bg-gray-100 text-gray-600']">
|
||||
{{ effectiveInitialFullGroupNumber === index + 1 ? '全流程' : groupViewText(count) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-3 text-[11px] text-gray-500">
|
||||
{{ count > 0 ? '点击此卡片设为起始全流程组' : '当前分组未启用,无法作为起始组' }}
|
||||
</div>
|
||||
<input v-model.number="configForm.groupViewCounts[index]" :disabled="isConfigControlDisabled"
|
||||
type="number" min="0" max="3" step="1"
|
||||
class="mt-4 h-11 w-full rounded-lg border border-gray-300 bg-gray-50 px-4 text-sm text-gray-800 outline-none focus:border-blue-500 disabled:cursor-not-allowed disabled:opacity-60"
|
||||
@blur="handleGroupCountBlur(index)" />
|
||||
@click.stop @blur="handleGroupCountBlur(index)" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -370,7 +372,6 @@ const dataPoolLabel = computed(() => (isBrotherInfoMode.value ? '大哥池' : '
|
||||
const normalizedGroupSwitchMinutes = computed(() => clampMinutes(configForm.groupSwitchMinutes))
|
||||
const normalizedGroupViewCounts = computed(() => normalizeGroupViewCounts(configForm.groupViewCounts))
|
||||
const effectiveInitialFullGroupNumber = computed(() => resolveInitialFullGroupNumber(configForm.initialFullGroupNumber, normalizedGroupViewCounts.value))
|
||||
const startFullGroupOptions = computed(() => normalizedGroupViewCounts.value.map((enabledCount, groupIndex) => ({ value: groupIndex + 1, label: `第 ${groupIndex + 1} 组`, hint: groupRangeLabel(groupIndex), enabled: enabledCount > 0 })))
|
||||
const browserViewGroups = computed(() => normalizedGroupViewCounts.value.map((enabledCount, groupIndex) => {
|
||||
const baseViewId = TIKTOK_VIEW_IDS[groupIndex * 3]
|
||||
return { groupIndex, label: `视图 ${baseViewId}-${baseViewId + 2}`, views: Array.from({ length: 3 }, (_, offset) => ({ viewId: baseViewId + offset, enabled: offset < enabledCount, active: activeViewId.value === baseViewId + offset })) }
|
||||
@@ -426,7 +427,7 @@ async function showBrowserWorkspace(viewId, fallbackStatusText) {
|
||||
}
|
||||
function handleGreetingConfirm(data) { configForm.prologueList = { yolo: data.sentences || [], ...(data.translations || {}) }; configForm.needTranslate = Boolean(data.needTranslate); showGreetingDialog.value = false; invalidatePreparedState(); void saveSharedConfig() }
|
||||
function handleSwitchMinutesBlur() { configForm.groupSwitchMinutes = clampMinutes(configForm.groupSwitchMinutes); invalidatePreparedState() }
|
||||
function handleInitialFullGroupChange() { configForm.initialFullGroupNumber = effectiveInitialFullGroupNumber.value; invalidatePreparedState(); void saveSharedConfig() }
|
||||
function handleSelectInitialFullGroup(index) { if (isConfigControlDisabled.value) return; if ((normalizedGroupViewCounts.value[index] || 0) <= 0) return; const nextGroupNumber = index + 1; if (configForm.initialFullGroupNumber === nextGroupNumber) return; configForm.initialFullGroupNumber = nextGroupNumber; invalidatePreparedState('全流程起始分组已变更,请重新预热视图'); void saveSharedConfig() }
|
||||
function handlePostUserSleepBlur() { configForm.postUserSleepSeconds = clampPositiveSeconds(configForm.postUserSleepSeconds, 6); invalidatePreparedState() }
|
||||
function handleGroupCountBlur(index) { configForm.groupViewCounts[index] = clampGroupCount(configForm.groupViewCounts[index]); configForm.initialFullGroupNumber = effectiveInitialFullGroupNumber.value; invalidatePreparedState('视图配置已变更,请重新预热视图') }
|
||||
function groupViewText(count) { return count <= 0 ? '不启用' : `开启 ${count} 个` }
|
||||
|
||||
Reference in New Issue
Block a user