<template>
  <el-dialog v-model="showLogin" width="500" center>
    <el-segmented v-model="loginType" :options="options" block />
    <el-form :model="form" label-width="auto" style="max-width: 600px" class="p-4">
      <el-form-item label="登录账号">
        <el-input v-model="form.name" />
      </el-form-item>
      <el-form-item label="登录密码">
        <el-input v-model="form.name" type="password" />
      </el-form-item>
      <el-form-item label="记住密码">
        <el-switch v-model="form.delivery" />
      </el-form-item>
    </el-form>
    <template #footer>
      <div class="dialog-footer">
        <el-button >取消</el-button>
        <el-button type="primary" >
          确定
        </el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup lang="ts">
import {useShowLogin, useToken} from "~/composables/configState";

const props = defineProps<{
  // 弹窗是否打开
  visible: boolean;
}>();

const form = reactive({
  name: '',
  region: '',
  date1: '',
  date2: '',
  delivery: false,
  type: [],
  resource: '',
  desc: '',
})

const showLogin = useShowLogin();
const loginType = ref('账号登录');
const options = [
  '账号登录',
  '扫码登录',
]
const token = useToken();
</script>
