Commit a1adf9e81ccad600889ef18dd0f14d53c7bed7f1

Authored by 刘有才luck
1 parent 03105460

wip: bug修复

src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
... ... @@ -203,6 +203,8 @@
203 203 :min="1"
204 204 :max="30"
205 205 style="width: 100px"
  206 + :step="1"
  207 + :precision="0"
206 208 ></el-input-number>
207 209 </div>
208 210 </div>
... ...
src/views/basic/askTestQuestion/wrongQuestion.vue
... ... @@ -256,9 +256,10 @@
256 256 </template>
257 257  
258 258 <script>
259   -import { setDateRules } from "@/utils";
  259 +import { setDateRules, getKnowledge } from "@/utils";
260 260 import wrongQuestionDialog from "./components/wrongQuestionDialog.vue";
261 261 import analysisDialog from "./components/analysisDialog.vue";
  262 +
262 263 export default {
263 264 components: {
264 265 wrongQuestionDialog,
... ... @@ -373,12 +374,16 @@ export default {
373 374 let param = {
374 375 ...this.listPage,
375 376 ...this.formData,
  377 + startScoreRate: this.formData.startScoreRate.toString(),
  378 + endScoreRate: this.formData.endScoreRate.toString(),
376 379 startDate: this.formData.dateRange[0],
377 380 endDate: this.formData.dateRange[1],
378 381 };
379 382 let data = await this.$request.getWrongQuestionList(param);
380 383 this.queryLoading = false;
381   - this.topicList = data.data.records;
  384 + this.topicList = data.data.records.map((item) => {
  385 + return { ...item, knowledge: getKnowledge(item.knowledge) };
  386 + });
382 387 this.listPage.total = data.data.total;
383 388 // this.topicList = await this.loadAndModifyHTML(data.data.records);
384 389 },
... ... @@ -420,6 +425,9 @@ export default {
420 425 if (value > this.formData.endScoreRate) {
421 426 this.formData.startScoreRate = this.formData.endScoreRate;
422 427 }
  428 + if (!value) {
  429 + this.formData.startScoreRate = 0;
  430 + }
423 431 },
424 432 // 输入不超过100
425 433 endValidateInput(value) {
... ... @@ -432,6 +440,9 @@ export default {
432 440 if (value < this.formData.startScoreRate) {
433 441 this.formData.endScoreRate = this.formData.startScoreRate;
434 442 }
  443 + if (!value) {
  444 + this.formData.endScoreRate = 0;
  445 + }
435 446 },
436 447  
437 448 // 搜索按钮
... ... @@ -596,18 +607,18 @@ export default {
596 607 // 获取ref
597 608 onIFrameLoad(index) {
598 609 const iframeRef = this.$refs["iframe" + index][0]; // 获取对应的 iframe
599   - // const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;
600   - // const body = iframeRef.contentWindow.document.body;
601   - // body.style.overflowX = "hidden"; // 不允许出现横向滚动条
602   - // const height = body.scrollHeight; // 获取内容的高度
603   - // iframeRef.style.height = `${height}px`; // 设置 iframe 的高度
604   - // // 获取第一个P标签
605   - // const firstP = doc.getElementsByTagName("p")[0];
606   - // // 或者修改第一个 < p > 标签的内容;
607   - // if (firstP) {
608   - // let a = this.processString(firstP.innerHTML);
609   - // firstP.innerHTML = a;
610   - // }
  610 + const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;
  611 + const body = iframeRef.contentWindow.document.body;
  612 + body.style.overflowX = "hidden"; // 不允许出现横向滚动条
  613 + const height = body.scrollHeight; // 获取内容的高度
  614 + iframeRef.style.height = `${height}px`; // 设置 iframe 的高度
  615 + // 获取第一个P标签
  616 + const firstP = doc.getElementsByTagName("p")[0];
  617 + // 或者修改第一个 < p > 标签的内容;
  618 + if (firstP) {
  619 + let a = this.processString(firstP.innerHTML);
  620 + firstP.innerHTML = a;
  621 + }
611 622 },
612 623  
613 624 // 子集删除后 父级需要更新
... ...