123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <template>
- <div id="home">
- <el-card v-if="!loading">
- <iscome :istrain="data.trainstu" :nottrain="data.notrainstu"></iscome>
- <school :school="data.schs"></school>
- <leave :qj="data.levelqj" :exit="data.levelexit"></leave>
- </el-card>
- </div>
- </template>
- <script>
- import school from './home/school.vue';
- import iscome from './home/iscome.vue';
- import leave from './home/leave.vue';
- import { mapState, createNamespacedHelpers } from 'vuex';
- const { mapActions: count } = createNamespacedHelpers('count');
- export default {
- name: 'home',
- props: {},
- components: { leave, iscome, school },
- data: function() {
- return {
- loading: true,
- data: {},
- };
- },
- created() {
- this.search();
- },
- methods: {
- ...count(['query']),
- async search() {
- let res = await this.query();
- // 柱状图
- //levelexit:退出;
- //levelqj:请假;
- //饼形图
- //notrainstu:没参加培训的;
- //trainstu:已参加学生数;
- //planstu:计划总人数;
- //饼形图,哪个学校多少人
- //schstu:学校上报人数;
- if (this.$checkRes(res)) this.$set(this, `data`, res.data);
- this.loading = false;
- },
- },
- computed: {
- ...mapState(['user']),
- pageTitle() {
- return `${this.$route.meta.title}`;
- },
- },
- metaInfo() {
- return { title: this.$route.meta.title };
- },
- };
- </script>
- <style lang="less" scoped></style>
|