Commit d4cbe7514d396cf58e3fcd77542bb6d91ec3d655
1 parent
b754316f
wip: 细节修改
Showing
2 changed files
with
35 additions
and
8 deletions
src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
| @@ -37,7 +37,11 @@ | @@ -37,7 +37,11 @@ | ||
| 37 | style="padding: 0 200px" | 37 | style="padding: 0 200px" |
| 38 | /> | 38 | /> |
| 39 | </div> | 39 | </div> |
| 40 | - <div></div> | 40 | + <div class="binding"> |
| 41 | + <div class="size color">班级:_____________</div> | ||
| 42 | + <div class="size color">姓名:_____________</div> | ||
| 43 | + <div class="size color">学号:_____________</div> | ||
| 44 | + </div> | ||
| 41 | <div class="test-group"> | 45 | <div class="test-group"> |
| 42 | <div | 46 | <div |
| 43 | class="outer-item" | 47 | class="outer-item" |
| @@ -160,14 +164,14 @@ | @@ -160,14 +164,14 @@ | ||
| 160 | </div> | 164 | </div> |
| 161 | <div class="edit-button"> | 165 | <div class="edit-button"> |
| 162 | <el-button | 166 | <el-button |
| 163 | - :disabled="testData.length < 1" | 167 | + :disabled="dataYesNo(groups)" |
| 164 | class="button-width" | 168 | class="button-width" |
| 165 | type="primary" | 169 | type="primary" |
| 166 | @click="handleSava" | 170 | @click="handleSava" |
| 167 | >保存试卷</el-button | 171 | >保存试卷</el-button |
| 168 | > | 172 | > |
| 169 | <el-button | 173 | <el-button |
| 170 | - :disabled="testData.length < 1" | 174 | + :disabled="dataYesNo(groups)" |
| 171 | class="button-width" | 175 | class="button-width" |
| 172 | plain | 176 | plain |
| 173 | @click="handleSava('print')" | 177 | @click="handleSava('print')" |
| @@ -428,7 +432,9 @@ export default { | @@ -428,7 +432,9 @@ export default { | ||
| 428 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; | 432 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; |
| 429 | const body = iframeRef.contentWindow.document.body; | 433 | const body = iframeRef.contentWindow.document.body; |
| 430 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 | 434 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 |
| 431 | - const height = body.scrollHeight; // 获取内容的高度 | 435 | + const height = body.offsetHeight; // 获取内容的高度 |
| 436 | + console.log(height, "height"); | ||
| 437 | + console.log(body, "body"); | ||
| 432 | iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 | 438 | iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 |
| 433 | // 获取第一个P标签 | 439 | // 获取第一个P标签 |
| 434 | const firstP = doc.getElementsByTagName("p")[0]; | 440 | const firstP = doc.getElementsByTagName("p")[0]; |
| @@ -803,6 +809,20 @@ export default { | @@ -803,6 +809,20 @@ export default { | ||
| 803 | JSON.stringify(this.groups) | 809 | JSON.stringify(this.groups) |
| 804 | ); | 810 | ); |
| 805 | }, | 811 | }, |
| 812 | + dataYesNo(data) { | ||
| 813 | + if (data.length < 1 || !data) { | ||
| 814 | + return true; | ||
| 815 | + } | ||
| 816 | + let list = []; | ||
| 817 | + data.forEach((item) => { | ||
| 818 | + list.push(...item.subQuestionIds); | ||
| 819 | + }); | ||
| 820 | + if (list.length < 1 && !list) { | ||
| 821 | + return true; | ||
| 822 | + } else { | ||
| 823 | + return false; | ||
| 824 | + } | ||
| 825 | + }, | ||
| 806 | }, | 826 | }, |
| 807 | }; | 827 | }; |
| 808 | </script> | 828 | </script> |
| @@ -842,7 +862,11 @@ export default { | @@ -842,7 +862,11 @@ export default { | ||
| 842 | justify-content: space-around; | 862 | justify-content: space-around; |
| 843 | align-items: center; | 863 | align-items: center; |
| 844 | } | 864 | } |
| 845 | - | 865 | + .binding { |
| 866 | + display: flex; | ||
| 867 | + padding: 20px 80px; | ||
| 868 | + justify-content: space-around; | ||
| 869 | + } | ||
| 846 | .test-group { | 870 | .test-group { |
| 847 | .test-group-title { | 871 | .test-group-title { |
| 848 | position: relative; | 872 | position: relative; |
src/views/basic/askTestQuestion/wrongQuestion.vue
| @@ -660,7 +660,12 @@ export default { | @@ -660,7 +660,12 @@ export default { | ||
| 660 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; | 660 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; |
| 661 | const body = iframeRef.contentWindow.document.body; | 661 | const body = iframeRef.contentWindow.document.body; |
| 662 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 | 662 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 |
| 663 | - const height = body.scrollHeight; // 获取内容的高度 | 663 | + const height = body.offsetHeight; // 获取内容的高度 |
| 664 | + console.log(height, "height"); | ||
| 665 | + // console.log("body.offsetHeight:", body.offsetHeight); | ||
| 666 | + // console.log("body.clientHeight:", body.clientHeight); | ||
| 667 | + // console.log("body.scrollHeight:", body.scrollHeight); | ||
| 668 | + | ||
| 664 | iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 | 669 | iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 |
| 665 | // 获取第一个P标签 | 670 | // 获取第一个P标签 |
| 666 | const firstP = doc.getElementsByTagName("p")[0]; | 671 | const firstP = doc.getElementsByTagName("p")[0]; |
| @@ -726,8 +731,6 @@ export default { | @@ -726,8 +731,6 @@ export default { | ||
| 726 | } | 731 | } |
| 727 | } | 732 | } |
| 728 | .topic { | 733 | .topic { |
| 729 | - height: fit-content; | ||
| 730 | - max-height: 500px; | ||
| 731 | margin-top: 15px; | 734 | margin-top: 15px; |
| 732 | display: flex; | 735 | display: flex; |
| 733 | flex-direction: column; | 736 | flex-direction: column; |