<template>
    <body id="login-page">
        <el-form class="login-container" label-position="left" label-width="0px">
            <h3 class="login_title">请选择系统</h3>
            <el-form-item style="width: 100%">
                <el-button color="#87CEFA" style="width: 100%;  border: none" @click="loginToWms">WMS系统</el-button>
            </el-form-item>
            <el-form-item style="width: 100%">
                <el-button color="#87CEEB" style="width: 100%;  border: none" @click="loginToImage">工作图纸</el-button>
            </el-form-item>
            <el-form-item style="width: 100%">
                <el-button color="#87CEEB" style="width: 100%;  border: none" @click="loginToImageTable">所有图纸预览</el-button>
            </el-form-item>
            <el-form-item style="width: 100%">
                <el-button color="#87CEEB" style="width: 100%;  border: none" @click="loginToScanImage">产线扫码</el-button>
            </el-form-item>
            <!-- <el-form-item style="width: 100%">
                <el-button color="#AFEEEE" style="width: 100%;  border: none" @click="loginToSideScan">线边扫码系统</el-button>
            </el-form-item> -->
            <!-- <el-form-item style="width: 100%">
                <el-button color="#ADD8E6" style="width: 100%;  border: none" @click="loginToWcs">WCS系统</el-button>
            </el-form-item> -->
            <!-- <el-form-item style="width: 100%">
                <el-button color="#B0E0E6" style="width: 100%;  border: none" @click="loginToMonitor">监控系统</el-button>
            </el-form-item> -->
        </el-form>
    </body>
</template>

<script setup>
import store from '@/store'
import router from '@/router'
const user = store.getters.getUserNam// 用户名
const token = store.getters.getToken// 密码
// 登录到WMS系统
const loginToWms = () => {
    router.replace({ path: '/home' })
}
// 登录到工作图纸系统
const loginToImage = () => {
    router.replace({ path: '/imageDisplay' })
}
// 登录到所有图纸预览系统
const loginToImageTable = () => {
    router.replace({ path: '/imageTable' })
}
// 登录到产线扫码系统
const loginToScanImage = () => {
    router.replace({ path: '/scanForImage' })
}
// 登录到WCS系统
const loginToWcs = () => {
    const wcsUrl = `https://cxlasrs.ecorp.cat.com/wcs/#/login?user=user&pwd=user`
    window.location.href = wcsUrl// 打开新窗口
}
const loginToMonitor = () => {
    const mpnitorUrl = `https://cxlasrs.ecorp.cat.com?user=${user}&token=${token}`
    window.location.href = mpnitorUrl// 当前窗口跳转
}
</script>
  
<style scoped>
#login-page {
    /* background: url("../assets/img/bg.jpg") no-repeat; */
    background-position: center;
    height: 100%;
    width: 100%;
    background-size: cover;
    position: fixed;
}

body {
    margin: 0px;
}

.login-container {
    border-radius: 15px;
    background-clip: padding-box;
    margin: 90px auto;
    width: 350px;
    padding: 35px 35px 15px 35px;
    background: #fff;
    border: 1px solid #eaeaea;
    box-shadow: 0 0 25px #cac6c6;
}

.login_title {
    margin: 0px auto 40px auto;
    text-align: center;
    color: #505458;
}
</style>  