fix conflicts

This commit is contained in:
RockYang
2024-03-12 18:07:19 +08:00
74 changed files with 249 additions and 1630 deletions

View File

@@ -8,6 +8,7 @@ type OriginProps = SwitchInstance["$props"];
interface Props extends /* @vue-ignore */ OriginProps {
modelValue: boolean | string | number;
api: (params?: any) => Promise<BaseResponse<any>>;
onSuccess?: (res?: any) => void;
}
const props = defineProps<Props>();
@@ -23,8 +24,9 @@ const _value = computed({
const onBeforeChange = async (params) => {
try {
await props.api({ ...params, value: !_value.value });
const res = await props.api({ ...params, value: !_value.value });
Message.success("操作成功");
props?.onSuccess?.(res);
return true;
} catch (err) {
console.log(err);

View File

@@ -49,11 +49,13 @@ const [visible, setVisible] = useState(false);
</ADoption>
</template>
<template #footer>
<APopconfirm content="确认退出?" position="br" @ok="authStore.logout">
<ASpace align="center" class="logout-area">
<IconExport size="16" />
<span>退出</span>
</ASpace>
<APopconfirm content="确认退出?" position="bl" @ok="authStore.logout">
<AButton status="warning" class="logout-area">
<ASpace align="center">
<IconExport size="16" />
<span>退出登录</span>
</ASpace>
</AButton>
</APopconfirm>
</template>
</ADropdown>
@@ -125,7 +127,8 @@ const [visible, setVisible] = useState(false);
.logout-area {
padding: 8px 0;
display: flex;
width: 80px;
min-width: 80px;
width: 100%;
align-items: center;
justify-content: center;
}