Commit 0ebd841a099f7c527e3c67a9361b778ce2946237
1 parent
54e8889e
wip: 代码优化
Showing
2 changed files
with
0 additions
and
24 deletions
src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
| @@ -434,8 +434,6 @@ export default { | @@ -434,8 +434,6 @@ export default { | ||
| 434 | const body = iframeRef.contentWindow.document.body; | 434 | const body = iframeRef.contentWindow.document.body; |
| 435 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 | 435 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 |
| 436 | const height = body.offsetHeight; // 获取内容的高度 | 436 | const height = body.offsetHeight; // 获取内容的高度 |
| 437 | - console.log(height, "height"); | ||
| 438 | - console.log(body, "body"); | ||
| 439 | iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 | 437 | iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 |
| 440 | // 获取第一个P标签 | 438 | // 获取第一个P标签 |
| 441 | const firstP = doc.getElementsByTagName("p")[0]; | 439 | const firstP = doc.getElementsByTagName("p")[0]; |
| @@ -651,7 +649,6 @@ export default { | @@ -651,7 +649,6 @@ export default { | ||
| 651 | // 添加,删除 | 649 | // 添加,删除 |
| 652 | // 需要的数据,添加的数据,删除的数据 | 650 | // 需要的数据,添加的数据,删除的数据 |
| 653 | testAddDel(arr1, arr2, arr3) { | 651 | testAddDel(arr1, arr2, arr3) { |
| 654 | - console.log(arr1, arr3); | ||
| 655 | if (arr2 && arr2.length > 0) { | 652 | if (arr2 && arr2.length > 0) { |
| 656 | // 添加数据,如果没有type重新创建一个type | 653 | // 添加数据,如果没有type重新创建一个type |
| 657 | arr2.forEach((item2) => { | 654 | arr2.forEach((item2) => { |
| @@ -825,8 +822,6 @@ export default { | @@ -825,8 +822,6 @@ export default { | ||
| 825 | data.forEach((item) => { | 822 | data.forEach((item) => { |
| 826 | list.push(...item.subQuestionIds); | 823 | list.push(...item.subQuestionIds); |
| 827 | }); | 824 | }); |
| 828 | - console.log(list, "list"); | ||
| 829 | - | ||
| 830 | if (list.length < 1) { | 825 | if (list.length < 1) { |
| 831 | return true; | 826 | return true; |
| 832 | } else { | 827 | } else { |
src/views/basic/askTestQuestion/wrongQuestion.vue
| @@ -421,11 +421,6 @@ export default { | @@ -421,11 +421,6 @@ export default { | ||
| 421 | this.getList(); | 421 | this.getList(); |
| 422 | }, | 422 | }, |
| 423 | 423 | ||
| 424 | - // 全选按钮 | ||
| 425 | - handleAll() { | ||
| 426 | - console.log(123123); | ||
| 427 | - }, | ||
| 428 | - | ||
| 429 | // 班级选中 | 424 | // 班级选中 |
| 430 | handleClass(id) { | 425 | handleClass(id) { |
| 431 | this.formData.classId = id; | 426 | this.formData.classId = id; |
| @@ -549,7 +544,6 @@ export default { | @@ -549,7 +544,6 @@ export default { | ||
| 549 | removeMatchingValues(arr1, arr2) { | 544 | removeMatchingValues(arr1, arr2) { |
| 550 | const arr1Ids = arr1.map((item) => item.id); | 545 | const arr1Ids = arr1.map((item) => item.id); |
| 551 | const res = arr2.filter((item) => !arr1Ids.includes(item.id)); | 546 | const res = arr2.filter((item) => !arr1Ids.includes(item.id)); |
| 552 | - console.log(res, "res"); | ||
| 553 | 547 | ||
| 554 | return res; | 548 | return res; |
| 555 | }, | 549 | }, |
| @@ -632,23 +626,10 @@ export default { | @@ -632,23 +626,10 @@ export default { | ||
| 632 | // 获取ref | 626 | // 获取ref |
| 633 | onIFrameLoad(index) { | 627 | onIFrameLoad(index) { |
| 634 | const iframeRef = this.$refs["iframe" + index][0]; // 获取对应的 iframe | 628 | const iframeRef = this.$refs["iframe" + index][0]; // 获取对应的 iframe |
| 635 | - // const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; | ||
| 636 | - // const body = iframeRef.contentWindow.document.body; | ||
| 637 | - // body.style.overflowX = "hidden"; // 不允许出现横向滚动条 | ||
| 638 | - // const height = body.scrollHeight; // 获取内容的高度 | ||
| 639 | - // iframeRef.style.height = `${height}px`; // 设置 iframe 的高度 | ||
| 640 | - // // 获取第一个P标签 | ||
| 641 | - // const firstP = doc.getElementsByTagName("p")[0]; | ||
| 642 | - // // 或者修改第一个 < p > 标签的内容; | ||
| 643 | - // if (firstP) { | ||
| 644 | - // let a = this.processString(firstP.innerHTML); | ||
| 645 | - // firstP.innerHTML = a; | ||
| 646 | - // } | ||
| 647 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; | 629 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; |
| 648 | const body = iframeRef.contentWindow.document.body; | 630 | const body = iframeRef.contentWindow.document.body; |
| 649 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 | 631 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 |
| 650 | const height = body.offsetHeight; // 获取内容的高度 | 632 | const height = body.offsetHeight; // 获取内容的高度 |
| 651 | - console.log(height, "height"); | ||
| 652 | // console.log("body.offsetHeight:", body.offsetHeight); | 633 | // console.log("body.offsetHeight:", body.offsetHeight); |
| 653 | // console.log("body.clientHeight:", body.clientHeight); | 634 | // console.log("body.clientHeight:", body.clientHeight); |
| 654 | // console.log("body.scrollHeight:", body.scrollHeight); | 635 | // console.log("body.scrollHeight:", body.scrollHeight); |