<script>
import {mapMutations} from "vuex";
import {
  generateAnimals,
  generateArchives,
  generateBreedingPlans,
  generateHealths,
  generateUsers
} from "@/utils/common.js";

export default {
  name: "ZooData",
  methods: {
    ...mapMutations(['updateUsers', 'updateAnimals', 'updateBreedingPlans', 'updateArchives','updateHealths']),
    usersData() {
      this.updateUsers(generateUsers())
      return ElMessage({
        message: '成功',
        type: 'success',
      })
    },
    animalsData() {
      this.updateAnimals(generateAnimals())
      return ElMessage({
        message: '成功',
        type: 'success',
      })
    },
    breedingPlansData() {
      this.updateBreedingPlans(generateBreedingPlans())
      return ElMessage({
        message: '成功',
        type: 'success',
      })
    },
    archiveData() {
      this.updateArchives(generateArchives())
      return ElMessage({
        message: '成功',
        type: 'success',
      })
    },
    healthData() {
      this.updateHealths(generateHealths())
      return ElMessage({
        message: '成功',
        type: 'success',
      })
    },
  }
}
</script>

<template>
  <el-button type="primary" @click="usersData">生成用户信息</el-button>
  <el-button type="primary" @click="animalsData">生成动物信息</el-button>
  <el-button type="primary" @click="breedingPlansData">生成饲养计划信息</el-button>
  <el-button type="primary" @click="archiveData">生成档案信息</el-button>
  <el-button type="primary" @click="healthData">生成健康监测信息</el-button>
  <el-button type="primary" @click="$router.push('/login')">跳转登录</el-button>
</template>

<style scoped>

</style>