zoo-frontend/src/pages/data.vue
2024-06-10 12:32:27 +08:00

67 lines
1.9 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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() {
generateUsers()
return ElMessage({
message: '成功',
type: 'success',
})
},
animalsData() {
generateAnimals()
return ElMessage({
message: '成功',
type: 'success',
})
},
breedingPlansData() {
generateBreedingPlans()
return ElMessage({
message: '成功',
type: 'success',
})
},
archiveData() {
generateArchives()
return ElMessage({
message: '成功',
type: 'success',
})
},
healthData() {
generateHealths()
return ElMessage({
message: '成功',
type: 'success',
})
},
}
}
</script>
<template>
生成数据最好先确保数据库中的各表没有数据再使用使用方法从左到右依次点击每点击应该需等到弹出成功提示才继续点击下一个
<hr />
<el-button type="primary" @click="usersData">生成用户信息预计需要5秒左右</el-button>
<el-button type="primary" @click="animalsData">生成动物信息预计需要5秒左右</el-button>
<el-button type="primary" @click="breedingPlansData">生成饲养计划信息预计需要10秒左右</el-button>
<el-button type="primary" @click="archiveData">生成档案信息预计需要5分钟左右</el-button>
<el-button type="primary" @click="healthData">生成健康监测信息预计需要5分钟左右</el-button>
<el-button type="primary" @click="$router.push('/login')">跳转登录</el-button>
</template>
<style scoped>
</style>