fix(frontend): 优化分组表单中订阅模式的字段显示逻辑
- 订阅模式下隐藏 Exclusive 字段并默认为开启状态 - 编辑分组时禁用计费类型字段,防止修改 - 移除编辑表单中无用的 subscription_type watch
This commit is contained in:
@@ -180,7 +180,7 @@
|
||||
/>
|
||||
<p class="input-hint">{{ t('admin.groups.rateMultiplierHint') }}</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<div v-if="createForm.subscription_type !== 'subscription'" class="flex items-center gap-3">
|
||||
<button
|
||||
type="button"
|
||||
@click="createForm.is_exclusive = !createForm.is_exclusive"
|
||||
@@ -323,7 +323,7 @@
|
||||
class="input"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<div v-if="editForm.subscription_type !== 'subscription'" class="flex items-center gap-3">
|
||||
<button
|
||||
type="button"
|
||||
@click="editForm.is_exclusive = !editForm.is_exclusive"
|
||||
@@ -360,8 +360,9 @@
|
||||
<Select
|
||||
v-model="editForm.subscription_type"
|
||||
:options="subscriptionTypeOptions"
|
||||
:disabled="true"
|
||||
/>
|
||||
<p class="input-hint">{{ t('admin.groups.subscription.typeHint') }}</p>
|
||||
<p class="input-hint">{{ t('admin.groups.subscription.typeNotEditable') }}</p>
|
||||
</div>
|
||||
|
||||
<!-- Subscription limits (only show when subscription type is selected) -->
|
||||
@@ -676,16 +677,11 @@ const confirmDelete = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 监听 subscription_type 变化,配额模式时重置 rate_multiplier 为 1
|
||||
// 监听 subscription_type 变化,订阅模式时重置 rate_multiplier 为 1,is_exclusive 为 true
|
||||
watch(() => createForm.subscription_type, (newVal) => {
|
||||
if (newVal === 'subscription') {
|
||||
createForm.rate_multiplier = 1.0
|
||||
}
|
||||
})
|
||||
|
||||
watch(() => editForm.subscription_type, (newVal) => {
|
||||
if (newVal === 'subscription') {
|
||||
editForm.rate_multiplier = 1.0
|
||||
createForm.is_exclusive = true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user