Commit d4cbe7514d396cf58e3fcd77542bb6d91ec3d655

Authored by 刘有才luck
1 parent b754316f

wip: 细节修改

src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
... ... @@ -37,7 +37,11 @@
37 37 style="padding: 0 200px"
38 38 />
39 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 45 <div class="test-group">
42 46 <div
43 47 class="outer-item"
... ... @@ -160,14 +164,14 @@
160 164 </div>
161 165 <div class="edit-button">
162 166 <el-button
163   - :disabled="testData.length < 1"
  167 + :disabled="dataYesNo(groups)"
164 168 class="button-width"
165 169 type="primary"
166 170 @click="handleSava"
167 171 >保存试卷</el-button
168 172 >
169 173 <el-button
170   - :disabled="testData.length < 1"
  174 + :disabled="dataYesNo(groups)"
171 175 class="button-width"
172 176 plain
173 177 @click="handleSava('print')"
... ... @@ -428,7 +432,9 @@ export default {
428 432 const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;
429 433 const body = iframeRef.contentWindow.document.body;
430 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 438 iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度
433 439 // 获取第一个P标签
434 440 const firstP = doc.getElementsByTagName("p")[0];
... ... @@ -803,6 +809,20 @@ export default {
803 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 828 </script>
... ... @@ -842,7 +862,11 @@ export default {
842 862 justify-content: space-around;
843 863 align-items: center;
844 864 }
845   -
  865 + .binding {
  866 + display: flex;
  867 + padding: 20px 80px;
  868 + justify-content: space-around;
  869 + }
846 870 .test-group {
847 871 .test-group-title {
848 872 position: relative;
... ...
src/views/basic/askTestQuestion/wrongQuestion.vue
... ... @@ -660,7 +660,12 @@ export default {
660 660 const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;
661 661 const body = iframeRef.contentWindow.document.body;
662 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 669 iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度
665 670 // 获取第一个P标签
666 671 const firstP = doc.getElementsByTagName("p")[0];
... ... @@ -726,8 +731,6 @@ export default {
726 731 }
727 732 }
728 733 .topic {
729   - height: fit-content;
730   - max-height: 500px;
731 734 margin-top: 15px;
732 735 display: flex;
733 736 flex-direction: column;
... ...