经理
This commit is contained in:
parent
a73b079333
commit
25ccb09f31
@ -30,6 +30,13 @@ const emit = defineEmits<{
|
||||
|
||||
const saving = ref(false);
|
||||
|
||||
type FeatureSwitchKey =
|
||||
| 'canAddBdLeader'
|
||||
| 'canBanUser'
|
||||
| 'canChangeCountry'
|
||||
| 'canGiftProps'
|
||||
| 'canUnbanUser';
|
||||
|
||||
const form = reactive({
|
||||
canAddBdLeader: true,
|
||||
canBanUser: true,
|
||||
@ -66,6 +73,10 @@ watch(
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
function toggleFeature(key: FeatureSwitchKey) {
|
||||
form[key] = !form[key];
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!isUpdate.value && !String(form.userId || '').trim()) {
|
||||
message.warning('请输入经理用户ID');
|
||||
@ -132,26 +143,66 @@ async function handleSubmit() {
|
||||
</FormItem>
|
||||
<FormItem label="功能开关">
|
||||
<div class="feature-switches">
|
||||
<label class="feature-switch-row">
|
||||
<div
|
||||
class="feature-switch-row"
|
||||
role="switch"
|
||||
tabindex="0"
|
||||
:aria-checked="form.canAddBdLeader"
|
||||
@click="toggleFeature('canAddBdLeader')"
|
||||
@keydown.enter.prevent="toggleFeature('canAddBdLeader')"
|
||||
@keydown.space.prevent="toggleFeature('canAddBdLeader')"
|
||||
>
|
||||
<span>加BD Leader</span>
|
||||
<Switch v-model:checked="form.canAddBdLeader" />
|
||||
</label>
|
||||
<label class="feature-switch-row">
|
||||
<Switch v-model:checked="form.canAddBdLeader" @click.stop />
|
||||
</div>
|
||||
<div
|
||||
class="feature-switch-row"
|
||||
role="switch"
|
||||
tabindex="0"
|
||||
:aria-checked="form.canGiftProps"
|
||||
@click="toggleFeature('canGiftProps')"
|
||||
@keydown.enter.prevent="toggleFeature('canGiftProps')"
|
||||
@keydown.space.prevent="toggleFeature('canGiftProps')"
|
||||
>
|
||||
<span>赠送道具</span>
|
||||
<Switch v-model:checked="form.canGiftProps" />
|
||||
</label>
|
||||
<label class="feature-switch-row">
|
||||
<Switch v-model:checked="form.canGiftProps" @click.stop />
|
||||
</div>
|
||||
<div
|
||||
class="feature-switch-row"
|
||||
role="switch"
|
||||
tabindex="0"
|
||||
:aria-checked="form.canBanUser"
|
||||
@click="toggleFeature('canBanUser')"
|
||||
@keydown.enter.prevent="toggleFeature('canBanUser')"
|
||||
@keydown.space.prevent="toggleFeature('canBanUser')"
|
||||
>
|
||||
<span>封禁用户</span>
|
||||
<Switch v-model:checked="form.canBanUser" />
|
||||
</label>
|
||||
<label class="feature-switch-row">
|
||||
<Switch v-model:checked="form.canBanUser" @click.stop />
|
||||
</div>
|
||||
<div
|
||||
class="feature-switch-row"
|
||||
role="switch"
|
||||
tabindex="0"
|
||||
:aria-checked="form.canUnbanUser"
|
||||
@click="toggleFeature('canUnbanUser')"
|
||||
@keydown.enter.prevent="toggleFeature('canUnbanUser')"
|
||||
@keydown.space.prevent="toggleFeature('canUnbanUser')"
|
||||
>
|
||||
<span>解封用户</span>
|
||||
<Switch v-model:checked="form.canUnbanUser" />
|
||||
</label>
|
||||
<label class="feature-switch-row">
|
||||
<Switch v-model:checked="form.canUnbanUser" @click.stop />
|
||||
</div>
|
||||
<div
|
||||
class="feature-switch-row"
|
||||
role="switch"
|
||||
tabindex="0"
|
||||
:aria-checked="form.canChangeCountry"
|
||||
@click="toggleFeature('canChangeCountry')"
|
||||
@keydown.enter.prevent="toggleFeature('canChangeCountry')"
|
||||
@keydown.space.prevent="toggleFeature('canChangeCountry')"
|
||||
>
|
||||
<span>改国家</span>
|
||||
<Switch v-model:checked="form.canChangeCountry" />
|
||||
</label>
|
||||
<Switch v-model:checked="form.canChangeCountry" @click.stop />
|
||||
</div>
|
||||
</div>
|
||||
</FormItem>
|
||||
</Form>
|
||||
@ -168,8 +219,15 @@ async function handleSubmit() {
|
||||
align-items: center;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
.feature-switch-row:focus-visible {
|
||||
border-color: #1677ff;
|
||||
outline: 2px solid rgb(22 119 255 / 20%);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user