Commit 34aad61a28551efb6b35788760a798e7f04c340d

Authored by 刘鸿
1 parent cccc5fe0

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

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