Commit 0b9ef2ed75618051a283fe14025c5f2192bfc33b
1 parent
7feaa4bf
feat: bug修复
Showing
3 changed files
with
48 additions
and
18 deletions
src/views/basic/askTestQuestion/components/analysisDialog.vue
| ... | ... | @@ -17,7 +17,7 @@ |
| 17 | 17 | <span slot="title" class="title"> 题目解析 </span> |
| 18 | 18 | </el-dialog> |
| 19 | 19 | </template> |
| 20 | - <script> | |
| 20 | +<script> | |
| 21 | 21 | export default { |
| 22 | 22 | name: "analysisDialog", |
| 23 | 23 | props: { |
| ... | ... | @@ -58,12 +58,9 @@ export default { |
| 58 | 58 | const iframeRef = this.$refs.iframe; // 获取对应的 iframe |
| 59 | 59 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; |
| 60 | 60 | const body = iframeRef.contentWindow.document.body; |
| 61 | - body.style.overflowX = "hidden"; // 不允许出现横向滚动条 | |
| 62 | - const height = body.scrollHeight; // 获取内容的高度 | |
| 63 | - console.log(height, "height"); | |
| 64 | - console.log(body, "body"); | |
| 65 | - | |
| 66 | - iframeRef.style.height = `${height}px`; // 设置 iframe 的高度 | |
| 61 | + // body.style.overflowX = "hidden"; // 不允许出现横向滚动条 | |
| 62 | + const height = body.offsetHeight; // 获取内容的高度 | |
| 63 | + iframeRef.style.height = `${height + 40}px`; // 设置 iframe 的高度 | |
| 67 | 64 | // 获取第一个P标签 |
| 68 | 65 | const firstP = doc.getElementsByTagName("p")[0]; |
| 69 | 66 | // 或者修改第一个 < p > 标签的内容; |
| ... | ... | @@ -90,7 +87,7 @@ export default { |
| 90 | 87 | }, |
| 91 | 88 | }; |
| 92 | 89 | </script> |
| 93 | - <style lang="scss" scoped> | |
| 90 | +<style lang="scss" scoped> | |
| 94 | 91 | .title { |
| 95 | 92 | font-weight: 600; |
| 96 | 93 | } |
| ... | ... | @@ -98,5 +95,7 @@ export default { |
| 98 | 95 | width: 100%; |
| 99 | 96 | box-sizing: border-box; |
| 100 | 97 | padding: 20px; |
| 98 | + max-height: 600px; | |
| 99 | + overflow-y: auto; | |
| 101 | 100 | } |
| 102 | -</style> | |
| 103 | 101 | \ No newline at end of file |
| 102 | +</style> | ... | ... |
src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
| ... | ... | @@ -436,7 +436,7 @@ export default { |
| 436 | 436 | const body = iframeRef.contentWindow.document.body; |
| 437 | 437 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 |
| 438 | 438 | const height = body.offsetHeight; // 获取内容的高度 |
| 439 | - iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 | |
| 439 | + iframeRef.style.height = `${height + 40}px`; // 设置 iframe 的高度 | |
| 440 | 440 | // 获取第一个P标签 |
| 441 | 441 | const firstP = doc.getElementsByTagName("p")[0]; |
| 442 | 442 | // 或者修改第一个 < p > 标签的内容; |
| ... | ... | @@ -755,14 +755,11 @@ export default { |
| 755 | 755 | |
| 756 | 756 | // 清空 |
| 757 | 757 | handleClear() { |
| 758 | - this.$confirm("确定要清空试题篮内的全部题目吗?", "提示", { | |
| 759 | - confirmButtonText: "清空", | |
| 758 | + this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", { | |
| 759 | + confirmButtonText: "确定", | |
| 760 | 760 | cancelButtonText: "取消", |
| 761 | 761 | confirmButtonClass: "el-button--danger1", |
| 762 | 762 | cancelButtonClass: "el-button--primary", |
| 763 | - showClose: false, | |
| 764 | - roundButton: true, | |
| 765 | - center: false, | |
| 766 | 763 | type: "warning", |
| 767 | 764 | }) |
| 768 | 765 | .then(() => { |
| ... | ... | @@ -776,12 +773,46 @@ export default { |
| 776 | 773 | this.userId + "testlist", |
| 777 | 774 | JSON.stringify(this.testData) |
| 778 | 775 | ); |
| 779 | - | |
| 780 | 776 | this.$emit("setQuestions"); |
| 777 | + this.$message({ | |
| 778 | + type: "success", | |
| 779 | + message: "清空成功!", | |
| 780 | + }); | |
| 781 | 781 | }) |
| 782 | 782 | .catch(() => { |
| 783 | - console.log("取消"); | |
| 783 | + this.$message({ | |
| 784 | + type: "info", | |
| 785 | + message: "已取消", | |
| 786 | + }); | |
| 784 | 787 | }); |
| 788 | + | |
| 789 | + // this.$confirm("确定要清空试题篮内的全部题目吗?", "提示", { | |
| 790 | + // confirmButtonText: "清空", | |
| 791 | + // cancelButtonText: "取消", | |
| 792 | + // confirmButtonClass: "el-button--danger1", | |
| 793 | + // cancelButtonClass: "el-button--primary", | |
| 794 | + // showClose: false, | |
| 795 | + // roundButton: true, | |
| 796 | + // center: false, | |
| 797 | + // type: "warning", | |
| 798 | + // }) | |
| 799 | + // .then(() => { | |
| 800 | + // this.groups = []; | |
| 801 | + // this.testDataFun(); | |
| 802 | + // localStorage.setItem( | |
| 803 | + // this.userId + "question", | |
| 804 | + // JSON.stringify(this.groups) | |
| 805 | + // ); | |
| 806 | + // localStorage.setItem( | |
| 807 | + // this.userId + "testlist", | |
| 808 | + // JSON.stringify(this.testData) | |
| 809 | + // ); | |
| 810 | + | |
| 811 | + // this.$emit("setQuestions"); | |
| 812 | + // }) | |
| 813 | + // .catch(() => { | |
| 814 | + // console.log("取消"); | |
| 815 | + // }); | |
| 785 | 816 | }, |
| 786 | 817 | // 继续选题 |
| 787 | 818 | handleSelect() { | ... | ... |
src/views/basic/askTestQuestion/wrongQuestion.vue
| ... | ... | @@ -633,7 +633,7 @@ export default { |
| 633 | 633 | // console.log("body.offsetHeight:", body.offsetHeight); |
| 634 | 634 | // console.log("body.clientHeight:", body.clientHeight); |
| 635 | 635 | // console.log("body.scrollHeight:", body.scrollHeight); |
| 636 | - iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 | |
| 636 | + iframeRef.style.height = `${height + 40}px`; // 设置 iframe 的高度 | |
| 637 | 637 | // 获取第一个P标签 |
| 638 | 638 | const firstP = doc.getElementsByTagName("p")[0]; |
| 639 | 639 | // 或者修改第一个 < p > 标签的内容; | ... | ... |