Commit 34aad61a28551efb6b35788760a798e7f04c340d

Authored by 刘鸿
1 parent cccc5fe0

fix:修复tag列表显示问题、分享班级问题

src/views/basic/askTestQuestion/index.vue
... ... @@ -386,6 +386,7 @@ export default {
386 386 this.$store.getters.info.showRole ||
387 387 this.$store.getters.info.permissions[0].role;
388 388 this.query.dateStatus = "onWeek";
  389 + this.query.tagId = "";
389 390 await this._loadQueryDatas();
390 391 },
391 392 methods: {
... ... @@ -511,15 +512,18 @@ export default {
511 512 this.subjectList = data?.subjectNames ?? [];
512 513 this.query.subject = data?.subjectNames[0] ?? "";
513 514 },
514   - async _loadTypes() {
  515 + async _loadTypes(queryParams) {
515 516 let fetchTypeNames =
516 517 this.role == "ROLE_PERSONAL"
517 518 ? this.$request.pPaperTagList
518 519 : this.$request.fetchTypeNames;
519 520  
520 521 const { data, status, info } = await fetchTypeNames({
521   - classId: this.query.class,
  522 + ...queryParams,
  523 + status: 1,
522 524 type: 0,
  525 + page: this.listPage.page,
  526 + size: this.listPage.size
523 527 });
524 528 if (status != 0) {
525 529 this.$message.error(info);
... ... @@ -536,7 +540,6 @@ export default {
536 540 value: "",
537 541 label: "请选择标签",
538 542 });
539   - this.query.tagId = "";
540 543 },
541 544 async _loadClassData() {
542 545 const fetchClassList =
... ... @@ -558,7 +561,6 @@ export default {
558 561 this.$loading.open();
559 562 await this._loadClassData();
560 563 await this._loadSubjectData();
561   - if (this.dataType == "2") await this._loadTypes();
562 564 this.$loading.close();
563 565 await this._serach();
564 566 },
... ... @@ -580,6 +582,8 @@ export default {
580 582 share: this.tabType, //分享类型
581 583 };
582 584  
  585 +
  586 +
583 587 queryParams.classId = this.query.class;
584 588 queryParams.subjectName = this.query.subject;
585 589 queryParams.tagId = this.query.tagId;
... ... @@ -588,6 +592,7 @@ export default {
588 592 queryParams.start = this.query.dateRange[0] ?? "";
589 593 queryParams.end = this.query.dateRange[1] ?? "";
590 594 }
  595 + if (this.dataType == "2") await this._loadTypes(queryParams);
591 596 const { data, status, info } = await fetchPaperList({
592 597 ...queryParams,
593 598 status: 1,
... ...
src/views/basic/askTestQuestion/recycle.vue
... ... @@ -11,13 +11,13 @@
11 11 </el-header>
12 12 <div class="default-filter">
13 13 <el-input v-model="query.paper" :placeholder="dataType == '1' ? '搜索课件' : '搜索试卷'"
14   - suffix-icon="el-icon-search" class="filter-input" clearable />
  14 + suffix-icon="el-icon-search" class="filter-input" clearable />
15 15 <el-select @change="_changeClass" v-model="query.class" class="filter-select" placeholder="选择班级">
16   - <el-option v-for="item in classList" :key="item.classId" :label="item.className"
  16 + <el-option v-for="item in classList" :key="item.classId" :label="item.className"
17 17 :value="item.classId" />
18 18 </el-select>
19 19 <el-select v-model="query.subject" placeholder="选择科目" class="filter-select">
20   - <el-option v-for=" item in subjectList " :key="item" :label="item" :value="item" />
  20 + <el-option v-for=" item in subjectList " :key="item" :label="item" :value="item" />
21 21 </el-select>
22 22 <el-select v-if="dataType == '2'" v-model="query.tagId" placeholder="选择测验类型" class="filter-select">
23 23 <el-option v-for="item in typeList" :key="item.label" :label="item.label" :value="item.value" />
... ... @@ -89,7 +89,8 @@
89 89 </el-main>
90 90 <el-footer class="el-footer-pagination">
91 91 <div class="el-footer-pagination-box">
92   - <el-pagination background layout="prev, pager, next" :total="listPage.total">
  92 + <el-pagination @current-change="pageSizeChange" background layout="prev, pager, next"
  93 + :page-size="listPage.size" :current-page="listPage.page" :total="listPage.total">
93 94 </el-pagination>
94 95 </div>
95 96 </el-footer>
... ... @@ -141,7 +142,7 @@ export default {
141 142 this.$store.getters.info.permissions[0].role;
142 143  
143 144 var dateRange = setDateRules('onDay');
144   - console.log(dateRange)
  145 + this.query.tagId = "";
145 146 this.query.dateRange = [dateRange.startDay, dateRange.endDay];
146 147 await this._loadQueryDatas();
147 148 await this._serach();
... ... @@ -154,6 +155,10 @@ export default {
154 155 }
155 156 },
156 157 methods: {
  158 + async pageSizeChange(value) {
  159 + this.listPage.page = value;
  160 + await this._serach();
  161 + },
157 162 async modify(obj) {
158 163 //恢复答题卡
159 164 let modifyPaper =
... ... @@ -212,14 +217,15 @@ export default {
212 217 this.subjectList = data?.subjectNames ?? [];
213 218 this.query.subject = data?.subjectNames[0] ?? "";
214 219 },
215   - async _loadTypes() {
  220 + async _loadTypes(queryParams) {
216 221 let fetchTypeNames =
217 222 this.role == "ROLE_PERSONAL"
218 223 ? this.$request.pPaperTagList
219 224 : this.$request.fetchTypeNames;
220 225  
221 226 const { data, status, info } = await fetchTypeNames({
222   - classId: this.query.class,
  227 + ...queryParams,
  228 + status: queryParams.type,
223 229 type: 0,
224 230 });
225 231 if (status != 0) {
... ... @@ -237,7 +243,6 @@ export default {
237 243 value: "",
238 244 label: "请选择标签",
239 245 });
240   - this.query.tagId = "";
241 246 },
242 247 async _loadClassData() {
243 248 const fetchClassList =
... ... @@ -259,7 +264,6 @@ export default {
259 264 this.$loading.open();
260 265 await this._loadClassData();
261 266 await this._loadSubjectData();
262   - if (this.dataType == "2") await this._loadTypes();
263 267 this.$loading.close();
264 268 await this._serach();
265 269 },
... ... @@ -284,9 +288,12 @@ export default {
284 288 queryParams.subjectName = this.query.subject;
285 289 queryParams.tagId = this.query.tagId;
286 290 queryParams.title = this.query.paper;
287   - // queryParams.start = this.query.dateRange[0];
288   - // queryParams.end = this.query.dateRange[1];
289   -
  291 + if (this.query?.dateRange?.length >= 2) {
  292 + queryParams.start = this.query.dateRange[0] ?? "";
  293 + queryParams.end = this.query.dateRange[1] ?? "";
  294 + }
  295 + console.log(queryParams)
  296 + if (this.dataType == "2") await this._loadTypes(queryParams);
290 297 const { data, status, info } = await fetchPaperList({
291 298 ...queryParams,
292 299 status: 2,
... ...
src/views/basic/askTestQuestion/update.vue
... ... @@ -510,7 +510,11 @@ export default {
510 510  
511 511 this.classSharingType = true;
512 512  
513   - var classResponse = await this.$request.tClassFromGrade(this.classId, this.form.subjectName);
  513 + var grade = this.gradeClassList.find(item => item.gradeName == this.form.gradeName);
  514 +
  515 + var classResponse = await this.$request.tClassGrade(grade?.grade, this.form.subjectName);
  516 +
  517 + // var classResponse = await this.$request.tClassFromGrade(this.classId, this.form.subjectName);
514 518  
515 519 if (classResponse.status != 0) {
516 520 this.$message.error(classResponse.info);
... ...