Commit 0b9ef2ed75618051a283fe14025c5f2192bfc33b

Authored by 刘有才luck
1 parent 7feaa4bf

feat: bug修复

src/views/basic/askTestQuestion/components/analysisDialog.vue
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 <span slot="title" class="title"> 题目解析 </span> 17 <span slot="title" class="title"> 题目解析 </span>
18 </el-dialog> 18 </el-dialog>
19 </template> 19 </template>
20 - <script> 20 +<script>
21 export default { 21 export default {
22 name: "analysisDialog", 22 name: "analysisDialog",
23 props: { 23 props: {
@@ -58,12 +58,9 @@ export default { @@ -58,12 +58,9 @@ export default {
58 const iframeRef = this.$refs.iframe; // 获取对应的 iframe 58 const iframeRef = this.$refs.iframe; // 获取对应的 iframe
59 const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; 59 const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;
60 const body = iframeRef.contentWindow.document.body; 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 // 获取第一个P标签 64 // 获取第一个P标签
68 const firstP = doc.getElementsByTagName("p")[0]; 65 const firstP = doc.getElementsByTagName("p")[0];
69 // 或者修改第一个 < p > 标签的内容; 66 // 或者修改第一个 < p > 标签的内容;
@@ -90,7 +87,7 @@ export default { @@ -90,7 +87,7 @@ export default {
90 }, 87 },
91 }; 88 };
92 </script> 89 </script>
93 - <style lang="scss" scoped> 90 +<style lang="scss" scoped>
94 .title { 91 .title {
95 font-weight: 600; 92 font-weight: 600;
96 } 93 }
@@ -98,5 +95,7 @@ export default { @@ -98,5 +95,7 @@ export default {
98 width: 100%; 95 width: 100%;
99 box-sizing: border-box; 96 box-sizing: border-box;
100 padding: 20px; 97 padding: 20px;
  98 + max-height: 600px;
  99 + overflow-y: auto;
101 } 100 }
102 -</style>  
103 \ No newline at end of file 101 \ No newline at end of file
  102 +</style>
src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
@@ -436,7 +436,7 @@ export default { @@ -436,7 +436,7 @@ export default {
436 const body = iframeRef.contentWindow.document.body; 436 const body = iframeRef.contentWindow.document.body;
437 body.style.overflowX = "hidden"; // 不允许出现横向滚动条 437 body.style.overflowX = "hidden"; // 不允许出现横向滚动条
438 const height = body.offsetHeight; // 获取内容的高度 438 const height = body.offsetHeight; // 获取内容的高度
439 - iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 439 + iframeRef.style.height = `${height + 40}px`; // 设置 iframe 的高度
440 // 获取第一个P标签 440 // 获取第一个P标签
441 const firstP = doc.getElementsByTagName("p")[0]; 441 const firstP = doc.getElementsByTagName("p")[0];
442 // 或者修改第一个 < p > 标签的内容; 442 // 或者修改第一个 < p > 标签的内容;
@@ -755,14 +755,11 @@ export default { @@ -755,14 +755,11 @@ export default {
755 755
756 // 清空 756 // 清空
757 handleClear() { 757 handleClear() {
758 - this.$confirm("确定要清空试题篮内的全部题目吗?", "提示", {  
759 - confirmButtonText: "清空", 758 + this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  759 + confirmButtonText: "确定",
760 cancelButtonText: "取消", 760 cancelButtonText: "取消",
761 confirmButtonClass: "el-button--danger1", 761 confirmButtonClass: "el-button--danger1",
762 cancelButtonClass: "el-button--primary", 762 cancelButtonClass: "el-button--primary",
763 - showClose: false,  
764 - roundButton: true,  
765 - center: false,  
766 type: "warning", 763 type: "warning",
767 }) 764 })
768 .then(() => { 765 .then(() => {
@@ -776,12 +773,46 @@ export default { @@ -776,12 +773,46 @@ export default {
776 this.userId + "testlist", 773 this.userId + "testlist",
777 JSON.stringify(this.testData) 774 JSON.stringify(this.testData)
778 ); 775 );
779 -  
780 this.$emit("setQuestions"); 776 this.$emit("setQuestions");
  777 + this.$message({
  778 + type: "success",
  779 + message: "清空成功!",
  780 + });
781 }) 781 })
782 .catch(() => { 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 handleSelect() { 818 handleSelect() {
src/views/basic/askTestQuestion/wrongQuestion.vue
@@ -633,7 +633,7 @@ export default { @@ -633,7 +633,7 @@ export default {
633 // console.log("body.offsetHeight:", body.offsetHeight); 633 // console.log("body.offsetHeight:", body.offsetHeight);
634 // console.log("body.clientHeight:", body.clientHeight); 634 // console.log("body.clientHeight:", body.clientHeight);
635 // console.log("body.scrollHeight:", body.scrollHeight); 635 // console.log("body.scrollHeight:", body.scrollHeight);
636 - iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 636 + iframeRef.style.height = `${height + 40}px`; // 设置 iframe 的高度
637 // 获取第一个P标签 637 // 获取第一个P标签
638 const firstP = doc.getElementsByTagName("p")[0]; 638 const firstP = doc.getElementsByTagName("p")[0];
639 // 或者修改第一个 < p > 标签的内容; 639 // 或者修改第一个 < p > 标签的内容;