mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-13 20:53:47 +08:00
fix conflicts
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user