Blame view

src/views/examinationPaper/recycle.vue 9.47 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
      <div class="answer-header">
        <div class="sel-box">
ee6e7628   梁保满   备题组卷借口数据对接调整
10
          <!-- <el-cascader
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
11
12
13
14
15
16
17
            class="sel sel2"
            :options="options"
            :props="props"
            collapse-tags
            clearable
            placeholder="选择年级-班级"
            v-model="query.gradeClass"
13b58a42   梁保满   备题组卷部分前端页面基本完成
18
            @change="changeGrade"
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
19
20
21
22
            ><template slot-scope="{ node, data }">
              <span>{{ data.label }}</span>
              <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
            </template></el-cascader
ee6e7628   梁保满   备题组卷借口数据对接调整
23
24
25
26
27
28
          > -->
          <el-select
            class="sel"
            v-model="query.classId"
            placeholder="选择班级"
            @change="changClazz"
13b58a42   梁保满   备题组卷部分前端页面基本完成
29
          >
ee6e7628   梁保满   备题组卷借口数据对接调整
30
31
32
33
34
35
36
37
            <el-option
              v-for="item in classList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
13b58a42   梁保满   备题组卷部分前端页面基本完成
38
39
          <el-select
            class="sel"
ee6e7628   梁保满   备题组卷借口数据对接调整
40
            v-model="query.subjectName"
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
41
            placeholder="选择科目"
13b58a42   梁保满   备题组卷部分前端页面基本完成
42
43
            @change="_QueryData()"
          >
13b58a42   梁保满   备题组卷部分前端页面基本完成
44
            <el-option
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
45
              v-for="item in subjectList"
13b58a42   梁保满   备题组卷部分前端页面基本完成
46
47
48
              :key="item.value"
              :label="item.label"
              :value="item.value"
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
49
            >
13b58a42   梁保满   备题组卷部分前端页面基本完成
50
51
52
53
            </el-option>
          </el-select>
          <el-select
            class="sel"
ee6e7628   梁保满   备题组卷借口数据对接调整
54
            v-model="query.tagId"
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
55
            placeholder="选择类型"
13b58a42   梁保满   备题组卷部分前端页面基本完成
56
57
            @change="_QueryData()"
          >
13b58a42   梁保满   备题组卷部分前端页面基本完成
58
            <el-option
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
59
              v-for="item in typeList"
5424ef82   梁保满   接口调整
60
              :key="item.label"
13b58a42   梁保满   备题组卷部分前端页面基本完成
61
62
              :label="item.label"
              :value="item.value"
5424ef82   梁保满   接口调整
63
              >{{ item.label }}
13b58a42   梁保满   备题组卷部分前端页面基本完成
64
65
            </el-option>
          </el-select>
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
66
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
67
68
69
70
71
72
73
74
75
76
77
78
79
80
          <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>
5424ef82   梁保满   接口调整
81
      <ul class="content" v-loading="loading">
13b58a42   梁保满   备题组卷部分前端页面基本完成
82
83
84
85
86
87
88
        <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">
ee6e7628   梁保满   备题组卷借口数据对接调整
89
              {{ item.title }} <span class="label">{{ item.tag }}</span>
13b58a42   梁保满   备题组卷部分前端页面基本完成
90
91
92
93
            </p>
            <p class="num">
              {{ item.gradeName }}
              <em class="s-line">|</em>
ee6e7628   梁保满   备题组卷借口数据对接调整
94
              总题数:{{ item.questionNum }}
13b58a42   梁保满   备题组卷部分前端页面基本完成
95
              <em class="s-line">|</em>
ee6e7628   梁保满   备题组卷借口数据对接调整
96
              预计时长:{{ item.examsDuration }}
13b58a42   梁保满   备题组卷部分前端页面基本完成
97
98
            </p>
            <p class="person">
ee6e7628   梁保满   备题组卷借口数据对接调整
99
100
              {{ item.realName }}<em class="s-line">|</em
              ><span class="date">{{ item.modifiedTime }}</span>
13b58a42   梁保满   备题组卷部分前端页面基本完成
101
102
103
            </p>
          </div>
          <div class="btn-box">
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
104
            <el-tooltip effect="dark" content="恢复" placement="bottom">
13b58a42   梁保满   备题组卷部分前端页面基本完成
105
106
107
108
109
110
              <el-button
                class="edit"
                type="info"
                size="mini"
                circle
                icon="fa fa-mail-reply"
ee6e7628   梁保满   备题组卷借口数据对接调整
111
                @click="modify(item)"
13b58a42   梁保满   备题组卷部分前端页面基本完成
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
              ></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>
5424ef82   梁保满   接口调整
127
      <el-empty :image-size="100" v-if="tableData&&!tableData.legnth&&loading==false" description="没有更多数据"></el-empty>
65f592b6   梁保满   答题卡列表页
128
    </div>
4c4f7640   梁保满   路由表,路由前端文件
129
130
131
132
  </template>
  
  <script>
  export default {
13b58a42   梁保满   备题组卷部分前端页面基本完成
133
134
    data() {
      return {
5424ef82   梁保满   接口调整
135
        loading:false,
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
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
        props: { multiple: true, checkStrictly: true },
        options: [
          {
            value: 1,
            label: "一年级",
            children: [
              {
                value: 2,
                label: "二班",
              },
              {
                value: 3,
                label: "三班",
              },
            ],
          },
          {
            value: 4,
            label: "二年级",
            children: [
              {
                value: 5,
                label: "二班",
              },
              {
                value: 6,
                label: "三班",
              },
            ],
          },
        ],
13b58a42   梁保满   备题组卷部分前端页面基本完成
167
        query: {
5424ef82   梁保满   接口调整
168
169
170
          classId: "",
          subjectName: "",
          tagId: "",
13b58a42   梁保满   备题组卷部分前端页面基本完成
171
172
          title: "",
        },
5424ef82   梁保满   接口调整
173
174
175
176
        classList: [],
        subjectList: [],
        typeList: [],
        tableData: null,
13b58a42   梁保满   备题组卷部分前端页面基本完成
177
178
179
        total: 0,
      };
    },
ee6e7628   梁保满   备题组卷借口数据对接调整
180
181
182
183
184
185
    async created() {
      await this._QueryClassList();
      await this._QuerySubjectList();
      this._QueryTypeList();
      this._QueryData(false);
    },
13b58a42   梁保满   备题组卷部分前端页面基本完成
186
    methods: {
ee6e7628   梁保满   备题组卷借口数据对接调整
187
188
      async modify(obj) {
        //恢复答题卡
6fffbd55   阿宝   组卷接口调整
189
        const { data, status, info } = await this.$request.modifyPaper({
ee6e7628   梁保满   备题组卷借口数据对接调整
190
          paperId: obj.id,
5424ef82   梁保满   接口调整
191
          status: 1,
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
192
        });
ee6e7628   梁保满   备题组卷借口数据对接调整
193
194
195
196
        if (status == 0) {
          let type = this.query.title ? 1 : 0;
          this._QueryData(type);
        } else {
6fffbd55   阿宝   组卷接口调整
197
          this.$message.error(info);
ee6e7628   梁保满   备题组卷借口数据对接调整
198
        }
13b58a42   梁保满   备题组卷部分前端页面基本完成
199
      },
ee6e7628   梁保满   备题组卷借口数据对接调整
200
      async remove(obj) {
13b58a42   梁保满   备题组卷部分前端页面基本完成
201
        //删除答题卡
6fffbd55   阿宝   组卷接口调整
202
        const { data, status, info } = await this.$request.delPaper({
ee6e7628   梁保满   备题组卷借口数据对接调整
203
          paperId: obj.id,
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
204
        });
ee6e7628   梁保满   备题组卷借口数据对接调整
205
206
207
208
        if (status == 0) {
          let type = this.query.title ? 1 : 0;
          this._QueryData(type);
        } else {
6fffbd55   阿宝   组卷接口调整
209
          this.$message.error(info);
ee6e7628   梁保满   备题组卷借口数据对接调整
210
211
212
213
214
215
        }
      },
      //切换班级
      async changClazz() {
        await this._QuerySubjectList();
        this._QueryData(false);
13b58a42   梁保满   备题组卷部分前端页面基本完成
216
217
218
      },
      async _QueryData(type) {
        //获取答题卡列表
5424ef82   梁保满   接口调整
219
        this.loading=true
13b58a42   梁保满   备题组卷部分前端页面基本完成
220
221
222
223
224
225
226
227
228
        let query = {};
        if (!type) {
          this.query.title = "";
          query = { ...this.query };
        } else {
          query = { title: this.query.title };
          this.query.type = "";
          this.query.subjectId = "";
        }
5424ef82   梁保满   接口调整
229
         query.classId = this.query.classId;
13b58a42   梁保满   备题组卷部分前端页面基本完成
230
231
232
233
234
        for (let key in query) {
          if (!query[key]) {
            query[key] = null;
          }
        }
6fffbd55   阿宝   组卷接口调整
235
        const { data, status, info } = await this.$request.fetchPaperList({
13b58a42   梁保满   备题组卷部分前端页面基本完成
236
          ...query,
5424ef82   梁保满   接口调整
237
          status:2
13b58a42   梁保满   备题组卷部分前端页面基本完成
238
239
        });
        this.loading = false;
ee6e7628   梁保满   备题组卷借口数据对接调整
240
        if (status === 0) {
13b58a42   梁保满   备题组卷部分前端页面基本完成
241
242
243
          this.total = data.total;
          this.tableData = (data.list && [...data.list]) || [];
        } else {
6fffbd55   阿宝   组卷接口调整
244
          this.$message.error(info);
13b58a42   梁保满   备题组卷部分前端页面基本完成
245
246
        }
      },
ee6e7628   梁保满   备题组卷借口数据对接调整
247
248
      // 查找班级
      async _QueryClassList() {
6fffbd55   阿宝   组卷接口调整
249
        const { data, status, info } = await this.$request.fetchClassList();
5424ef82   梁保满   接口调整
250
        console.log(status);
ee6e7628   梁保满   备题组卷借口数据对接调整
251
252
253
254
        if (status === 0) {
          if (!!data.list) {
            this.classList = data.list.map((item) => {
              return {
5424ef82   梁保满   接口调整
255
256
                value: item.classId,
                label: item.className,
ee6e7628   梁保满   备题组卷借口数据对接调整
257
258
              };
            });
5424ef82   梁保满   接口调整
259
            this.query.classId = this.classList[0]?.value;
ee6e7628   梁保满   备题组卷借口数据对接调整
260
          }
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
261
        } else {
6fffbd55   阿宝   组卷接口调整
262
          this.$message.error(info);
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
263
264
        }
      },
ee6e7628   梁保满   备题组卷借口数据对接调整
265
266
      // 查找科目
      async _QuerySubjectList() {
6fffbd55   阿宝   组卷接口调整
267
        const { data, status, info } = await this.$request.fetchSubjectList({
5424ef82   梁保满   接口调整
268
          classId: this.query.classId,
ee6e7628   梁保满   备题组卷借口数据对接调整
269
270
271
272
273
274
275
276
        });
        if (status === 0) {
          this.subjectList = data.subjectNames.map((item) => {
            return {
              value: item,
              label: item,
            };
          });
5424ef82   梁保满   接口调整
277
          this.query.subjectName = this.subjectList[0]?.value;
13b58a42   梁保满   备题组卷部分前端页面基本完成
278
        } else {
6fffbd55   阿宝   组卷接口调整
279
          this.$message.error(info);
13b58a42   梁保满   备题组卷部分前端页面基本完成
280
281
        }
      },
ee6e7628   梁保满   备题组卷借口数据对接调整
282
283
      // 查找答题卡类型
      async _QueryTypeList() {
6fffbd55   阿宝   组卷接口调整
284
        const { data, status, info } = await this.$request.fetchTypeNames({
5424ef82   梁保满   接口调整
285
286
          classId: this.query.classId,
        });
ee6e7628   梁保满   备题组卷借口数据对接调整
287
288
        if (status === 0) {
          this.typeList =
5424ef82   梁保满   接口调整
289
            data.list.map((item) => {
ee6e7628   梁保满   备题组卷借口数据对接调整
290
291
292
293
294
              return {
                value: item.tagId,
                label: item.tag,
              };
            }) || [];
5424ef82   梁保满   接口调整
295
296
297
298
          this.typeList.unshift({
            value: "",
            label: "--",
          });
13b58a42   梁保满   备题组卷部分前端页面基本完成
299
        } else {
6fffbd55   阿宝   组卷接口调整
300
          this.$message.error(info);
13b58a42   梁保满   备题组卷部分前端页面基本完成
301
302
303
304
        }
      },
    },
  };
4c4f7640   梁保满   路由表,路由前端文件
305
306
  </script>
  
13b58a42   梁保满   备题组卷部分前端页面基本完成
307
308
309
310
311
312
  <style lang="scss" scoped>
  .answer-header {
    .sel-box {
      .sel {
        min-width: 160px;
      }
b769660c   梁保满   备课组题细节调整,随堂问列表页面开发完成
313
314
315
      :deep(.el-cascader__tags) {
        flex-wrap: nowrap;
      }
13b58a42   梁保满   备题组卷部分前端页面基本完成
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
    }
  }
  .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   梁保满   路由表,路由前端文件
390
  </style>