From b06cd06ec15961e7eafb0d9faed03a1a3c953be3 Mon Sep 17 00:00:00 2001 From: erio Date: Mon, 30 Mar 2026 21:04:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(channel):=20=E5=B9=B3=E5=8F=B0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=94=B9=E4=B8=BA=E5=8B=BE=E9=80=89=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E5=8B=BE=E9=80=89=E5=90=8E=E5=87=BA=E7=8E=B0=20Tab=20=E4=BD=86?= =?UTF-8?q?=E4=B8=8D=E8=87=AA=E5=8A=A8=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/admin/ChannelsView.vue | 98 +++++++---------------- 1 file changed, 27 insertions(+), 71 deletions(-) diff --git a/frontend/src/views/admin/ChannelsView.vue b/frontend/src/views/admin/ChannelsView.vue index fe69f050..19420f53 100644 --- a/frontend/src/views/admin/ChannelsView.vue +++ b/frontend/src/views/admin/ChannelsView.vue @@ -234,70 +234,25 @@
-
- -
- -
- -
-
-
- -
- {{ t('admin.channels.form.noPlatforms', '点击"添加平台"开始配置渠道') }} -
- - -
-
{{ t('admin.channels.form.platformConfig', '平台配置') }} +
+
+ + + {{ t('admin.groups.platforms.' + p, p) }} +
@@ -544,7 +499,6 @@ const editingChannel = ref(null) const submitting = ref(false) const showDeleteDialog = ref(false) const deletingChannel = ref(null) -const showPlatformMenu = ref(false) const activeTab = ref('basic') // Groups @@ -597,10 +551,6 @@ function formatDate(value: string): string { // ── Platform section helpers ── const activePlatforms = computed(() => form.platforms.map(s => s.platform)) -const availablePlatformsToAdd = computed(() => - platformOrder.filter(p => !activePlatforms.value.includes(p)) -) - function addPlatformSection(platform: GroupPlatform) { form.platforms.push({ platform, @@ -609,8 +559,15 @@ function addPlatformSection(platform: GroupPlatform) { model_mapping: {}, model_pricing: [] }) - showPlatformMenu.value = false - activeTab.value = platform +} + +function togglePlatform(platform: GroupPlatform) { + const idx = form.platforms.findIndex(s => s.platform === platform) + if (idx >= 0) { + removePlatformSection(idx) + } else { + addPlatformSection(platform) + } } function removePlatformSection(idx: number) { @@ -873,7 +830,6 @@ function resetForm() { form.restrict_models = false form.billing_model_source = 'requested' form.platforms = [] - showPlatformMenu.value = false activeTab.value = 'basic' }