|
@@ -0,0 +1,128 @@
|
|
|
|
+<template>
|
|
|
|
+ <div id="index">
|
|
|
|
+ <list-frame title="题库列表页" @query="onsearch" :total="total" :needFilter="false" :needAdd="false">
|
|
|
|
+ <el-select v-model="form.id" size="mini" placeholder="请选择计划" @change="changejh">
|
|
|
|
+ <el-option v-for="(i, index) in planList" :key="index" :label="i.title" :value="i.id"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+
|
|
|
|
+ <el-select v-model="form.termid" size="mini" placeholder="请选择期" @change="changeqi">
|
|
|
|
+ <el-option label="请选择" value="shanghai"></el-option>
|
|
|
|
+ <el-option v-for="(m, index) in termList" :key="index" :label="m.termnum" :value="m.termid"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+
|
|
|
|
+ <el-select v-model="form.name" size="mini" placeholder="请选择班">
|
|
|
|
+ <el-option v-for="(m, index) in classList" :key="index" :label="m.name" :value="m.id"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-button type="primary" size="mini" @click="onsearch()"> 查询</el-button>
|
|
|
|
+ <data-table :fields="fields" :data="list" :opera="opera" @edit="toEdit" @delete="toDelete"> </data-table>
|
|
|
|
+ </list-frame>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+import listFrame from '@frame/layout/admin/list-frame';
|
|
|
|
+import dataTable from '@frame/components/data-table';
|
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
+const { mapActions } = createNamespacedHelpers('attendance');
|
|
|
|
+const { mapActions: student } = createNamespacedHelpers('student');
|
|
|
|
+const { mapActions: trainplan } = createNamespacedHelpers('trainplan');
|
|
|
|
+const { mapActions: util } = createNamespacedHelpers('util');
|
|
|
|
+const { mapActions: classes } = createNamespacedHelpers('classes');
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ metaInfo: { title: '题库列表页' },
|
|
|
|
+ name: 'index',
|
|
|
|
+ props: {},
|
|
|
|
+ components: {
|
|
|
|
+ listFrame,
|
|
|
|
+ dataTable,
|
|
|
|
+ },
|
|
|
|
+ data: () => ({
|
|
|
|
+ classList: [],
|
|
|
|
+ termList: [],
|
|
|
|
+ planList: [],
|
|
|
|
+ opera: [
|
|
|
|
+ {
|
|
|
|
+ label: '编辑',
|
|
|
|
+ icon: 'el-icon-edit',
|
|
|
|
+ method: 'edit',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '删除',
|
|
|
|
+ icon: 'el-icon-delete',
|
|
|
|
+ method: 'delete',
|
|
|
|
+ confirm: true,
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ fields: [
|
|
|
|
+ { label: '日期', prop: 'date' },
|
|
|
|
+ { label: '时间', prop: 'time' },
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+ label: '类型',
|
|
|
|
+ prop: 'type',
|
|
|
|
+ format: item => {
|
|
|
|
+ return item === '0' ? '上课考勤' : item === '1' ? '上课考勤' : '';
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '状态',
|
|
|
|
+ prop: 'status',
|
|
|
|
+ format: item => {
|
|
|
|
+ return item === '0' ? '未签到' : item === '1' ? '签到' : '迟到';
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ form: {},
|
|
|
|
+ list: [],
|
|
|
|
+ total: 0,
|
|
|
|
+ }),
|
|
|
|
+ created() {
|
|
|
|
+ this.searchinfo();
|
|
|
|
+ },
|
|
|
|
+ computed: { ...mapState(['user']) },
|
|
|
|
+ methods: {
|
|
|
|
+ ...mapActions(['query', 'delete']),
|
|
|
|
+ ...student({ stuquery: 'query' }),
|
|
|
|
+ ...trainplan({ schPlanquery: 'query' }),
|
|
|
|
+ ...util({ fetchUtil: 'fetch' }),
|
|
|
|
+ ...classes({ classesquery: 'query' }),
|
|
|
|
+ async searchinfo() {
|
|
|
|
+ // let stuid = this.user.id;
|
|
|
|
+ const res = await this.schPlanquery();
|
|
|
|
+ this.$set(this, `planList`, res.data);
|
|
|
|
+ },
|
|
|
|
+ //计划
|
|
|
|
+ async changejh(ids) {
|
|
|
|
+ const res = await this.fetchUtil({ model: 'schtime', planid: ids, schid: this.user.code });
|
|
|
|
+
|
|
|
|
+ this.$set(this, `termList`, res.data.term);
|
|
|
|
+ },
|
|
|
|
+ async changeqi(termid) {
|
|
|
|
+ const res = await this.classesquery({ termid });
|
|
|
|
+ console.log(res.data);
|
|
|
|
+ this.$set(this, `classList`, res.data);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ async onsearch({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
|
+ const res = await this.query({ skip, termid: this.form.termid, classid: this.form.classid, limit, ...info });
|
|
|
|
+
|
|
|
|
+ console.log(res.data);
|
|
|
|
+
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ toEdit({ data }) {
|
|
|
|
+ this.$router.push({ path: '/itembank/detail', query: { id: data.id } });
|
|
|
|
+ },
|
|
|
|
+ async toDelete({ data }) {
|
|
|
|
+ const res = await this.delete(data.id);
|
|
|
|
+ this.$checkRes(res, '删除成功', '删除失败');
|
|
|
|
+ this.search();
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less" scoped></style>
|