Commit df2979bc59739a60c7bf8234c1625da8e949e610
1 parent
0b9ef2ed
wip: 细节修改
Showing
3 changed files
with
64 additions
and
18 deletions
src/views/basic/askTestQuestion/components/analysisDialog.vue
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | :src="analysisUrl" | 10 | :src="analysisUrl" |
11 | ref="iframe" | 11 | ref="iframe" |
12 | @load="onIFrameLoad()" | 12 | @load="onIFrameLoad()" |
13 | - style="width: 100%; border: none; /* 启用点击穿透 */" | 13 | + style="width: 100%; border: none; max-height: 600px; /* 启用点击穿透 */" |
14 | ></iframe> | 14 | ></iframe> |
15 | </div> | 15 | </div> |
16 | 16 | ||
@@ -94,8 +94,6 @@ export default { | @@ -94,8 +94,6 @@ export default { | ||
94 | .test-box { | 94 | .test-box { |
95 | width: 100%; | 95 | width: 100%; |
96 | box-sizing: border-box; | 96 | box-sizing: border-box; |
97 | - padding: 20px; | ||
98 | - max-height: 600px; | ||
99 | - overflow-y: auto; | 97 | + overflow: auto; |
100 | } | 98 | } |
101 | </style> | 99 | </style> |
src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
@@ -69,7 +69,7 @@ | @@ -69,7 +69,7 @@ | ||
69 | @mouseenter="handleGroupMouseEnter(group.questionType, 'all')" | 69 | @mouseenter="handleGroupMouseEnter(group.questionType, 'all')" |
70 | > | 70 | > |
71 | <div class="size-16" style="font-weight: 600"> | 71 | <div class="size-16" style="font-weight: 600"> |
72 | - {{ index + 1 }}、 | 72 | + {{ numberToChinese(index + 1) }}、 |
73 | <span | 73 | <span |
74 | @mouseenter=" | 74 | @mouseenter=" |
75 | (event) => handleItemMouseEnter(event, group.questionType) | 75 | (event) => handleItemMouseEnter(event, group.questionType) |
@@ -207,7 +207,7 @@ | @@ -207,7 +207,7 @@ | ||
207 | <!-- 每个组的标题 --> | 207 | <!-- 每个组的标题 --> |
208 | <div class="group-title"> | 208 | <div class="group-title"> |
209 | <div class="size" style="font-weight: 600"> | 209 | <div class="size" style="font-weight: 600"> |
210 | - {{ index + 1 }}、{{ group.questionTitle }} | 210 | + {{ numberToChinese(index + 1) }}、{{ group.questionTitle }} |
211 | </div> | 211 | </div> |
212 | <div class="size"> | 212 | <div class="size"> |
213 | 单题分值: | 213 | 单题分值: |
@@ -434,9 +434,10 @@ export default { | @@ -434,9 +434,10 @@ export default { | ||
434 | const iframeRef = this.$refs["iframe" + id][0]; // 获取对应的 iframe | 434 | const iframeRef = this.$refs["iframe" + id][0]; // 获取对应的 iframe |
435 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; | 435 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; |
436 | const body = iframeRef.contentWindow.document.body; | 436 | const body = iframeRef.contentWindow.document.body; |
437 | - body.style.overflowX = "hidden"; // 不允许出现横向滚动条 | 437 | + body.style.overflow = "hidden"; // 不允许出现横向滚动条 |
438 | const height = body.offsetHeight; // 获取内容的高度 | 438 | const height = body.offsetHeight; // 获取内容的高度 |
439 | iframeRef.style.height = `${height + 40}px`; // 设置 iframe 的高度 | 439 | iframeRef.style.height = `${height + 40}px`; // 设置 iframe 的高度 |
440 | + iframeRef.style.overflow = "hidden"; // 设置 iframe 的高度 | ||
440 | // 获取第一个P标签 | 441 | // 获取第一个P标签 |
441 | const firstP = doc.getElementsByTagName("p")[0]; | 442 | const firstP = doc.getElementsByTagName("p")[0]; |
442 | // 或者修改第一个 < p > 标签的内容; | 443 | // 或者修改第一个 < p > 标签的内容; |
@@ -755,7 +756,7 @@ export default { | @@ -755,7 +756,7 @@ export default { | ||
755 | 756 | ||
756 | // 清空 | 757 | // 清空 |
757 | handleClear() { | 758 | handleClear() { |
758 | - this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", { | 759 | + this.$confirm("确定要清空试题篮内的全部题目吗?", "提示", { |
759 | confirmButtonText: "确定", | 760 | confirmButtonText: "确定", |
760 | cancelButtonText: "取消", | 761 | cancelButtonText: "取消", |
761 | confirmButtonClass: "el-button--danger1", | 762 | confirmButtonClass: "el-button--danger1", |
@@ -847,11 +848,54 @@ export default { | @@ -847,11 +848,54 @@ export default { | ||
847 | return false; | 848 | return false; |
848 | } | 849 | } |
849 | }, | 850 | }, |
851 | + | ||
852 | + numberToChinese(num) { | ||
853 | + const units = ["", "十", "百", "千", "万", "十万", "百万", "千万", "亿"]; | ||
854 | + const digits = [ | ||
855 | + "零", | ||
856 | + "一", | ||
857 | + "二", | ||
858 | + "三", | ||
859 | + "四", | ||
860 | + "五", | ||
861 | + "六", | ||
862 | + "七", | ||
863 | + "八", | ||
864 | + "九", | ||
865 | + ]; | ||
866 | + | ||
867 | + if (num === 0) return digits[0]; | ||
868 | + | ||
869 | + let result = ""; | ||
870 | + let unitIndex = 0; // 单位索引 | ||
871 | + let zeroFlag = false; // 用于处理连续的零 | ||
872 | + | ||
873 | + while (num > 0) { | ||
874 | + const digit = num % 10; // 取出当前最低位的数字 | ||
875 | + if (digit !== 0) { | ||
876 | + result = digits[digit] + units[unitIndex] + result; // 拼接数字和单位 | ||
877 | + zeroFlag = false; // 当前位不是零,重置标志 | ||
878 | + } else if (!zeroFlag) { | ||
879 | + result = digits[0] + result; // 只在前面有非零数字时添加零 | ||
880 | + zeroFlag = true; // 设置标志,表示已经添加过零 | ||
881 | + } | ||
882 | + num = Math.floor(num / 10); // 去掉最低位 | ||
883 | + unitIndex++; // 单位索引加一 | ||
884 | + } | ||
885 | + | ||
886 | + // 处理“十”的特殊情况 | ||
887 | + if (result.startsWith(digits[1]) && result.length > 1) { | ||
888 | + result = result.replace(digits[1], ""); // 去掉开头的“一十” | ||
889 | + } | ||
890 | + | ||
891 | + return result; | ||
892 | + }, | ||
850 | }, | 893 | }, |
851 | }; | 894 | }; |
852 | </script> | 895 | </script> |
853 | <style lang="scss" scoped> | 896 | <style lang="scss" scoped> |
854 | .title { | 897 | .title { |
898 | + font-size: 18px !important; | ||
855 | font-weight: 600; | 899 | font-weight: 600; |
856 | } | 900 | } |
857 | 901 | ||
@@ -870,7 +914,7 @@ export default { | @@ -870,7 +914,7 @@ export default { | ||
870 | padding: 0 20px; | 914 | padding: 0 20px; |
871 | 915 | ||
872 | .test-title { | 916 | .test-title { |
873 | - font-size: 20px !important; | 917 | + font-size: 22px !important; |
874 | font-weight: 700; | 918 | font-weight: 700; |
875 | text-align: center; | 919 | text-align: center; |
876 | color: #000000; | 920 | color: #000000; |
@@ -917,7 +961,7 @@ export default { | @@ -917,7 +961,7 @@ export default { | ||
917 | width: 100%; | 961 | width: 100%; |
918 | text-align: center; | 962 | text-align: center; |
919 | font-weight: 600; | 963 | font-weight: 600; |
920 | - font-size: 16px !important; | 964 | + font-size: 18px !important; |
921 | line-height: 60px; | 965 | line-height: 60px; |
922 | color: #000000; | 966 | color: #000000; |
923 | 967 | ||
@@ -989,7 +1033,7 @@ export default { | @@ -989,7 +1033,7 @@ export default { | ||
989 | } | 1033 | } |
990 | 1034 | ||
991 | .size { | 1035 | .size { |
992 | - font-size: 14px !important; | 1036 | + font-size: 16px !important; |
993 | } | 1037 | } |
994 | 1038 | ||
995 | .color { | 1039 | .color { |
src/views/basic/askTestQuestion/wrongQuestion.vue
@@ -251,7 +251,10 @@ | @@ -251,7 +251,10 @@ | ||
251 | </div> | 251 | </div> |
252 | <div class="shopping" @click="handleShop"> | 252 | <div class="shopping" @click="handleShop"> |
253 | <div class="shopping-select">{{ questions.length }}</div> | 253 | <div class="shopping-select">{{ questions.length }}</div> |
254 | - <i class="el-icon-shopping-cart-full" style="padding: 5px 0 0 0"></i> | 254 | + <i |
255 | + class="el-icon-shopping-cart-full" | ||
256 | + style="font-size: 18px !important" | ||
257 | + ></i> | ||
255 | <div> | 258 | <div> |
256 | <div class="size">试</div> | 259 | <div class="size">试</div> |
257 | <div class="size">题</div> | 260 | <div class="size">题</div> |
@@ -628,12 +631,13 @@ export default { | @@ -628,12 +631,13 @@ export default { | ||
628 | const iframeRef = this.$refs["iframe" + index][0]; // 获取对应的 iframe | 631 | const iframeRef = this.$refs["iframe" + index][0]; // 获取对应的 iframe |
629 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; | 632 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; |
630 | const body = iframeRef.contentWindow.document.body; | 633 | const body = iframeRef.contentWindow.document.body; |
631 | - body.style.overflowX = "hidden"; // 不允许出现横向滚动条 | 634 | + body.style.overflow = "hidden"; // 不允许出现横向滚动条 |
632 | const height = body.offsetHeight; // 获取内容的高度 | 635 | const height = body.offsetHeight; // 获取内容的高度 |
633 | // console.log("body.offsetHeight:", body.offsetHeight); | 636 | // console.log("body.offsetHeight:", body.offsetHeight); |
634 | // console.log("body.clientHeight:", body.clientHeight); | 637 | // console.log("body.clientHeight:", body.clientHeight); |
635 | // console.log("body.scrollHeight:", body.scrollHeight); | 638 | // console.log("body.scrollHeight:", body.scrollHeight); |
636 | iframeRef.style.height = `${height + 40}px`; // 设置 iframe 的高度 | 639 | iframeRef.style.height = `${height + 40}px`; // 设置 iframe 的高度 |
640 | + iframeRef.style.overflow = "hidden"; // 设置 iframe 的高度 | ||
637 | // 获取第一个P标签 | 641 | // 获取第一个P标签 |
638 | const firstP = doc.getElementsByTagName("p")[0]; | 642 | const firstP = doc.getElementsByTagName("p")[0]; |
639 | // 或者修改第一个 < p > 标签的内容; | 643 | // 或者修改第一个 < p > 标签的内容; |
@@ -707,11 +711,11 @@ export default { | @@ -707,11 +711,11 @@ export default { | ||
707 | flex: 1; | 711 | flex: 1; |
708 | padding: 10px 20px; | 712 | padding: 10px 20px; |
709 | .box-info-title { | 713 | .box-info-title { |
710 | - font-size: 16px !important; | 714 | + font-size: 17px !important; |
711 | font-weight: 600; | 715 | font-weight: 600; |
712 | color: #000000; | 716 | color: #000000; |
713 | span { | 717 | span { |
714 | - font-size: 14px !important; | 718 | + font-size: 16px !important; |
715 | color: #999999; | 719 | color: #999999; |
716 | } | 720 | } |
717 | } | 721 | } |
@@ -759,7 +763,7 @@ export default { | @@ -759,7 +763,7 @@ export default { | ||
759 | 763 | ||
760 | .shopping { | 764 | .shopping { |
761 | width: 50px; | 765 | width: 50px; |
762 | - height: 135px; | 766 | + height: 140px; |
763 | position: fixed; | 767 | position: fixed; |
764 | top: 30%; | 768 | top: 30%; |
765 | right: 0; | 769 | right: 0; |
@@ -786,7 +790,7 @@ export default { | @@ -786,7 +790,7 @@ export default { | ||
786 | line-height: 25px; | 790 | line-height: 25px; |
787 | } | 791 | } |
788 | .size { | 792 | .size { |
789 | - font-size: 14px !important; | 793 | + font-size: 16px !important; |
790 | } | 794 | } |
791 | } | 795 | } |
792 | } | 796 | } |
@@ -828,7 +832,7 @@ export default { | @@ -828,7 +832,7 @@ export default { | ||
828 | margin-right: 10px; | 832 | margin-right: 10px; |
829 | } | 833 | } |
830 | .size { | 834 | .size { |
831 | - font-size: 14px !important; | 835 | + font-size: 16px !important; |
832 | } | 836 | } |
833 | .font-weight { | 837 | .font-weight { |
834 | font-weight: 400; | 838 | font-weight: 400; |