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