Blame view

src/views/card/index.vue 4.66 KB
4c4f7640   梁保满   路由表,路由前端文件
1
  <template>
a37317f4   阿宝   使用分析,发卡记录
2
3
4
5
6
7
    <div>
      <back-box>
        <template slot="title">
          <span>发卡记录</span>
        </template>
      </back-box>
533a17d8   梁保满   备题组卷添加批量设置答案
8
9
10
11
12
13
      <el-empty
        :image-size="100"
        v-if="!tableData.length && !loading"
        description="暂无数据"
      ></el-empty>
      <!-- <div class="page-content">
a37317f4   阿宝   使用分析,发卡记录
14
15
        <div class="answer-header">
          <div class="sel-box">
225a00b6   梁保满   飞书问题解决
16
            <el-cascader size="small"
a37317f4   阿宝   使用分析,发卡记录
17
              class="sel"
a37317f4   阿宝   使用分析,发卡记录
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
              clearable
              placeholder="选择班级"
              v-model="query.classId"
              :options="gradeList"
              :props="props"
              :show-all-levels="false"
            ></el-cascader>
            <el-input
              placeholder="请输入学生姓名"
              v-model="query.studentName"
              class="input-with-select"
              @keyup.enter.native="_QueryData(2)"
            >
              <el-button
                slot="append"
                icon="el-icon-search"
                @click="_QueryData(1)"
              ></el-button>
            </el-input>
            <el-input
              placeholder="请输入学生学号"
              v-model="query.studentCode"
              class="input-with-select"
              @keyup.enter.native="_QueryData(3)"
            >
              <el-button
                slot="append"
                icon="el-icon-search"
                @click="_QueryData(2)"
              ></el-button>
            </el-input>
            <el-button type="primary" round @click="_QueryData(1)"
              >筛选</el-button
            >
          </div>
        </div>
        <div class="table-box">
          <el-table :data="tableData" border style="width: 100%">
            <el-table-column
              align="center"
              label="答题器编码"
              prop="sn"
            ></el-table-column>
            <el-table-column
              align="center"
              label="班级"
              prop="className"
            ></el-table-column>
            <el-table-column
              align="center"
              label="学生姓名"
              prop="studentName"
            ></el-table-column>
            <el-table-column
              align="center"
              label="学号"
              prop="studentId"
            ></el-table-column>
            <el-table-column
              align="center"
              label="类型"
              prop="type"
            ></el-table-column>
            <el-table-column
              align="center"
              label="描述"
              prop="desc"
            ></el-table-column>
            <el-table-column
              align="center"
              label="操作时间"
              prop="time"
            ></el-table-column>
          </el-table>
        </div>
533a17d8   梁保满   备题组卷添加批量设置答案
93
      </div> -->
a37317f4   阿宝   使用分析,发卡记录
94
    </div>
4c4f7640   梁保满   路由表,路由前端文件
95
96
97
98
  </template>
  
  <script>
  export default {
a37317f4   阿宝   使用分析,发卡记录
99
100
101
102
103
104
105
106
107
    data() {
      return {
        props: { multiple: true, checkStrictly: false },
        query: {
          classId: [],
          studentName: "",
          studentCode: "",
        },
        gradeList: [],
6d7bd862   梁保满   飞书bug
108
        tableData: [],
a37317f4   阿宝   使用分析,发卡记录
109
110
111
      };
    },
    created() {
533a17d8   梁保满   备题组卷添加批量设置答案
112
      // this._QueryGradeList();
a37317f4   阿宝   使用分析,发卡记录
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
    },
    methods: {
      // 查找班级
      async _QueryGradeList() {
        this.loading = true;
        const { data, status, info } = await this.$request.gradeList();
        console.log(status);
        if (status === 0) {
          if (!!data.list) {
            this.gradeList =
              data.list?.map((item) => {
                let gradeList = {
                  value: item.grade,
                  label: item.gradeName,
                };
                gradeList.children =
                  item.classList?.map((items) => {
                    return {
1365ef5e   梁保满   优化
131
                      value: items.id,
a37317f4   阿宝   使用分析,发卡记录
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
                      label: items.className,
                    };
                  }) || [];
                return gradeList;
              }) || [];
          }
        } else {
          this.$message.error(info);
        }
      },
      async _QueryData(type) {
        let query = {};
        query.gradeName = this.query.gradeName;
        query.classId = this.query.classId;
        if (type == 1) {
          query.classId = this.query.classId;
          this.query.studentCode = "";
          this.query.studentName = "";
        } else if (type == 2) {
          query.studentName = this.query.studentName;
          this.query.classId = "";
          this.query.studentCode = "";
        } else if (type == 3) {
          query.studentCode = this.query.studentCode;
          this.query.classId = "";
          this.query.studentName = "";
        }
        this.loading = true;
        const { data, status, info } = await this.$request.cardList({
          ...query,
        });
        this.loading = false;
        console.log(status);
        if (status === 0) {
          this.tableData = data.list || [];
        } else {
          this.$message.error(info);
        }
      },
    },
  };
4c4f7640   梁保满   路由表,路由前端文件
173
174
  </script>
  
a37317f4   阿宝   使用分析,发卡记录
175
  <style lang="scss" scoped>
533a17d8   梁保满   备题组卷添加批量设置答案
176
177
  .table-box {
    padding: 0 20px;
a37317f4   阿宝   使用分析,发卡记录
178
  }
4c4f7640   梁保满   路由表,路由前端文件
179
  </style>