优化达人页面
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
<div class="flex items-center justify-between border-b border-gray-200 px-5 py-4">
|
||||
<div>
|
||||
<h3 class="text-lg font-semibold text-gray-900">大哥池</h3>
|
||||
<p class="mt-1 text-sm text-gray-500">读取本地 sqlite 的 `brother_info` 数据</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<button @click="handleDeleteAll" :disabled="loading || total === 0"
|
||||
@@ -105,7 +104,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="showDeleteConfirm" class="absolute inset-0 z-[10001] flex items-center justify-center bg-black/45 px-4">
|
||||
<div v-if="showDeleteConfirm"
|
||||
class="absolute inset-0 z-[10001] flex items-center justify-center bg-black/45 px-4">
|
||||
<div class="w-full max-w-md rounded-2xl bg-white p-6 shadow-2xl">
|
||||
<div class="text-lg font-semibold text-gray-900">确认全部删除</div>
|
||||
<p class="mt-3 text-sm leading-6 text-gray-600">
|
||||
@@ -113,18 +113,12 @@
|
||||
的全部数据,删除后不可恢复。
|
||||
</p>
|
||||
<div class="mt-6 flex justify-end gap-3">
|
||||
<button
|
||||
@click="showDeleteConfirm = false"
|
||||
:disabled="loading"
|
||||
class="rounded-lg border border-gray-300 bg-white px-4 py-2 text-sm text-gray-700 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
>
|
||||
<button @click="showDeleteConfirm = false" :disabled="loading"
|
||||
class="rounded-lg border border-gray-300 bg-white px-4 py-2 text-sm text-gray-700 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50">
|
||||
取消
|
||||
</button>
|
||||
<button
|
||||
@click="confirmDeleteAll"
|
||||
:disabled="loading"
|
||||
class="rounded-lg bg-red-600 px-4 py-2 text-sm text-white transition-colors hover:bg-red-700 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
>
|
||||
<button @click="confirmDeleteAll" :disabled="loading"
|
||||
class="rounded-lg bg-red-600 px-4 py-2 text-sm text-white transition-colors hover:bg-red-700 disabled:cursor-not-allowed disabled:opacity-50">
|
||||
{{ loading ? '删除中...' : '确认删除' }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -125,7 +125,6 @@
|
||||
<div class="mb-4 flex items-center justify-between gap-4">
|
||||
<div>
|
||||
<label class="mb-1 block text-sm font-medium text-gray-700">数据池来源</label>
|
||||
<p class="text-xs text-gray-500">启动时只需告诉后端用主播池还是大哥池。</p>
|
||||
</div>
|
||||
<span class="rounded-full border border-gray-200 bg-gray-100 px-3 py-1 text-xs text-gray-600">{{
|
||||
dataPoolLabel }}</span>
|
||||
@@ -220,7 +219,6 @@
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<div>
|
||||
<div class="text-sm font-medium text-gray-900">大哥池</div>
|
||||
<p class="mt-1 text-xs leading-5 text-gray-500">参考 brother_info 数据池,维护大哥列表并支持切换为大哥池模式启动任务。</p>
|
||||
</div>
|
||||
<span
|
||||
:class="['rounded-full px-3 py-1 text-xs font-medium', isBrotherInfoMode ? 'bg-fuchsia-100 text-fuchsia-700' : 'bg-gray-100 text-gray-600']">{{
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { getUser } from '@/utils/storage';
|
||||
import { expertInfoPage } from '@/api/account';
|
||||
@@ -151,6 +152,7 @@ const tableData = ref([]);
|
||||
const isRunning = ref(false);
|
||||
const elapsedSeconds = ref(0);
|
||||
const elapsedTimerId = ref(null);
|
||||
const { t } = useI18n();
|
||||
const { countryData, isLoading: isRefreshingCountry, initCountryInfo, refreshCountry, showEditCountryDialog } = useCountryInfo();
|
||||
const { controlExpertCapture } = usePythonBridge();
|
||||
|
||||
@@ -171,7 +173,7 @@ onMounted(() => {
|
||||
userInfo.value = getUser() || {};
|
||||
tenantId.value = String(userInfo.value?.tenantId || '');
|
||||
queryDate.value = buildTodayText();
|
||||
void initCountryInfo((key) => key);
|
||||
void initCountryInfo(t);
|
||||
void loadList();
|
||||
});
|
||||
|
||||
@@ -347,12 +349,12 @@ async function handleStop() {
|
||||
}
|
||||
|
||||
async function refreshCountryFn() {
|
||||
await refreshCountry((key) => key);
|
||||
await refreshCountry(t);
|
||||
}
|
||||
|
||||
async function editCountry() {
|
||||
try {
|
||||
await showEditCountryDialog((key) => key);
|
||||
await showEditCountryDialog(t);
|
||||
} catch {
|
||||
// 用户取消
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user