<template>
    <el-dialog width="400" v-model="dialogVisible" style="padding: 0; " title="以锁屏" :close-on-click-modal="false" :show-close="false">
        <div class="drawerbox_box">
            <el-input v-model="loginName" placeholder="请输入登录账号" />
            <el-button style="width: 100%; margin-top: 20px;" type="primary" @click="loginNameclick">确认</el-button>
        </div>
    </el-dialog>

</template>

<script setup>
import { ref } from 'vue'
import { useUser } from "@/store/user.js"
import { ElMessage } from 'element-plus'
const store = useUser()
const loginName = ref()
const loginNameclick = () => {
    if (loginName.value == store.userInfo.loginName) {
        dialogVisible.value = false
    } else {
        ElMessage({
            message: '输入错误',
            type: 'Error',
        })
    }
}
const dialogVisible = ref(false)

function shows() {
    dialogVisible.value = true
}

defineExpose({
    shows
})


</script>

<style scoped lang="scss">
.drawerbox {
    :deep(.el-drawer__body) {
        background: #1c1d1f !important;
    }

    .drawerbox_box {
        color: #fff;
    }
}
</style>