<template>
  <v-container fluid class=" pa-0 pt-3">
    <div style="width: 600px;">
          <VtkUpload
            ref="uploadRef"
            v-model="files"
            action="/api/upload"
            list-type="picture"
            :auto-upload="false"
            :limit="5"
            :max-size="2"
            accept=".jpg, .pdf, .xlsx"
            tip="只能上传 jpg/png，不超过 2MB"
             @change="handleChange"
          />
          <v-btn color="primary" class="mt-2" @click="handleSubmit">确认上传</v-btn>
        </div>
    <v-card flat style="height: calc(100vh - 132px)">
      <v-card-text class="d-flex flex-column justify-center align-center text-center fill-height">
        <div>
          <h1 class="">欢迎使用</h1>
          <p class=" mb-8">感谢您选择我们的管理系统</p>
        </div>
      </v-card-text>
    </v-card>
  </v-container>
</template>

<script setup>
import { ref, onMounted, getCurrentInstance } from 'vue'
import { useRouter } from 'vue-router'

const { proxy } = getCurrentInstance()
const router = useRouter()

const files = ref([])
const uploadRef = ref(null)

const handleSubmit = () => {
  uploadRef.value?.submit()
}

const handleChange = (file, fileList) => {
  console.log('文件变化:', file, fileList)
}

// 跳转到模板页面
const goToTemplate = () => {
  router.push('/template/dashboard')
}

// 组件挂载时加载数据
onMounted(() => {
  
})
</script>

<style scoped>

</style>