Blame view

src/views/examinationPaper/recycle.vue 8.19 KB
4c4f7640   梁保满   路由表,路由前端文件
1
  <template>
65f592b6   梁保满   答题卡列表页
2
    <div>
13b58a42   梁保满   备题组卷部分前端页面基本完成
3
      <back-box>
65f592b6   梁保满   答题卡列表页
4
        <template slot="title">
13b58a42   梁保满   备题组卷部分前端页面基本完成
5
          <span>已归档答题卡</span>
65f592b6   梁保满   答题卡列表页
6
7
        </template>
      </back-box>
13b58a42   梁保满   备题组卷部分前端页面基本完成
8
9
10
11
12
13
14
15
16
17
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
      <div class="answer-header">
        <div class="sel-box">
          <el-select
            class="sel"
            v-model="query.gradeName"
            placeholder=""
            @change="changeGrade"
          >
            <el-option
              v-for="item in gradeList"
              :key="item"
              :label="item"
              :value="item"
            >
            </el-option>
          </el-select>
          <el-select
            class="sel"
            v-model="query.type"
            placeholder="选择类型"
            @change="_QueryData()"
          >
            <el-option label="全部" value=""></el-option>
            <el-option
              v-for="item in typeList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
              >{{ item.label }}
            </el-option>
          </el-select>
          <el-select
            class="sel"
            v-model="query.subjectId"
            placeholder="选择科目"
            @change="_QueryData()"
          >
            <el-option label="全部" value=""></el-option>
            <el-option
              v-for="item in subjectList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
          <el-input
            placeholder="输入试卷名称"
            v-model="query.title"
            class="input-with-select"
            @keyup.enter.native="_QueryData(true)"
          >
            <el-button
              slot="append"
              icon="el-icon-search"
              @click="_QueryData(true)"
            ></el-button>
          </el-input>
        </div>
      </div>
      <ul class="content">
        <li class="item" v-for="item in tableData" :key="item.id">
          <div class="pic-box">
            <p class="i-box"><i class="fa fa-map-o"></i></p>
            <p class="ids">{{ item.id }}</p>
          </div>
          <div class="info">
            <p class="title">
              {{ item.title }} <span class="label">{{ item.typeName }}</span>
            </p>
            <p class="num">
              {{ item.gradeName }}
              <em class="s-line">|</em>
              总题数:{{ item.answerNum }}
              <em class="s-line">|</em>
              预计时长:{{ item.time }}
              <em class="s-line">|</em>
            </p>
            <p class="person">
              {{ item.teacher }}<em class="s-line">|</em
              ><span class="date">{{ item.date }}</span>
            </p>
          </div>
          <div class="btn-box">
            <el-tooltip effect="dark" content="使用" placement="bottom">
              <el-button
                class="edit"
                type="info"
                size="mini"
                circle
                icon="fa fa-mail-reply"
                @click="have(item)"
              ></el-button>
            </el-tooltip>
            <el-popconfirm title="确定删除这张答题卡吗?" @confirm="remove(item)">
              <el-button
                slot="reference"
                class="delete"
                type="info"
                size="mini"
                circle
                icon="el-icon-delete"
              ></el-button>
            </el-popconfirm>
          </div>
        </li>
      </ul>
65f592b6   梁保满   答题卡列表页
115
    </div>
4c4f7640   梁保满   路由表,路由前端文件
116
117
118
119
  </template>
  
  <script>
  export default {
13b58a42   梁保满   备题组卷部分前端页面基本完成
120
121
122
123
124
125
126
127
128
129
130
131
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
    data() {
      return {
        query: {
          gradeName: "二年级",
          type: "",
          subjectId: "",
          title: "",
        },
        gradeList: ["二年级"],
        typeList: [
          { label: "随堂问", value: 1 },
          { label: "即使测", value: 2 },
        ],
        subjectList: [],
        tableData: [
          {
            title: "数学样例试卷202211-324654",
            id: "1062837",
            gradeName: "二年级",
            typeName: "周测",
            answerNum: 45,
            time: 90,
            aboutClazz: [203, 204],
            teacher: "张老师",
            date: "2022-11-04 18:09:49",
            share: 1,
          },
          {
            title: "数学样例试卷202211-4180949",
            id: "1062838",
            gradeName: "二年级",
            typeName: "周测",
            answerNum: 45,
            time: 90,
            aboutClazz: [203, 204],
            teacher: "张老师",
            date: "2022-11-04 18:09:49",
            share: 1,
          },
        ],
        total: 0,
      };
    },
    methods: {
      have(obj) {
        //删除答题卡
        // const { data, code, message } = await this.$request.useAnswerSheet();
        // if (code == 0) {
          this.tableData = this.tableData.filter(item=>{
            return obj.if != item.id
          })
        // } else {
        //   this.$message.error(message);
        // }
      },
      remove(obj) {
        //删除答题卡
        // const { data, code, message } = await this.$request.removeAnswerSheet();
        // if (code == 0) {
          this.tableData = this.tableData.filter(item=>{
            return obj.if != item.id
          })
        // } else {
        //   this.$message.error(message);
        // }
      },
      async _QueryData(type) {
        //获取答题卡列表
        let query = {};
        if (!type) {
          this.query.title = "";
          query = { ...this.query };
        } else {
          query = { title: this.query.title };
          this.query.type = "";
          this.query.subjectId = "";
        }
        for (let key in query) {
          if (!query[key]) {
            query[key] = null;
          }
        }
        this.loading = true;
        const { data, code, message } = await this.$request.fetchAnswerList({
          ...query,
        });
        this.loading = false;
        if (code === 0) {
          this.total = data.total;
          this.tableData = (data.list && [...data.list]) || [];
        } else {
          this.$message.error(message);
        }
      },
      async changeGrade() {
        this._QueryData();
        this._GradeList();
        this._QuerySubjectList();
      },
      async _GradeList() {
        //查询年级列表
        const { data, code, message } = await this.$request.fetchGradeList();
        if (code == 0) {
          this.gradeList = [...data.gradeNames] || [];
          this.query.gradeName = this.gradeList[0];
          this._QuerySubjectList(this.gradeList[0]);
        } else {
          this.$message.error(message);
        }
      },
      async _QuerySubjectList(grade, dont) {
        //查询科目列表
        let param = {};
        if (grade) {
          param.gradeName = grade;
        }
        const { data, code, message } = await this.$request.fetchSubjectList(
          param
        );
        if (code === 0) {
          this.subjectList = data.list.map((item) => {
            return {
              value: item.subjectId,
              label: item.subjectName,
            };
          });
        } else {
          this.$message.error(message);
        }
      },
    },
  };
4c4f7640   梁保满   路由表,路由前端文件
252
253
  </script>
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
  <style lang="scss" scoped>
  .answer-header {
    .sel-box {
      .sel {
        min-width: 160px;
      }
    }
  }
  .content {
    margin: 0 20px;
    background: #f8f8f8;
    padding: 12px;
    border-radius: 20px;
    .item {
      display: flex;
      align-items: center;
      width: 100%;
      overflow: hidden;
      box-sizing: border-box;
      padding: 12px;
      border-radius: 20px;
      background: #fff;
      margin-bottom: 12px;
      &:last-of-type {
        margin-bottom: 0;
      }
      .pic-box {
        width: 80px;
        height: 80px;
        border-radius: 10px;
        margin-right: 10px;
        flex-shrink: 0;
        background: #d7d7d7;
        text-align: center;
        color: #fff;
        font-weight: 500;
        .i-box {
          padding-top: 10px;
          font-size: 32px;
          margin-bottom: 3px;
        }
      }
      .info {
        height: 80px;
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        .s-line {
          padding: 0 5px;
          color: #e2e2e2;
        }
        .title {
          font-size: 16px;
          color: #222;
          font-weight: 500;
          .label {
            display: inline-block;
            font-size: 12px;
            color: #2e9afe;
            line-height: 16px;
            padding: 0 10px;
            border: 1px solid #2e9afe;
            border-radius: 10px;
            transform: translateY(-2px);
          }
        }
        .person {
          color: #666;
        }
      }
      .btn-box {
        flex-shrink: 0;
        .edit {
          margin-right: 12px;
        }
      }
    }
  }
4c4f7640   梁保满   路由表,路由前端文件
334
  </style>