Commit df2979bc59739a60c7bf8234c1625da8e949e610

Authored by 刘有才luck
1 parent 0b9ef2ed

wip: 细节修改

src/views/basic/askTestQuestion/components/analysisDialog.vue
... ... @@ -10,7 +10,7 @@
10 10 :src="analysisUrl"
11 11 ref="iframe"
12 12 @load="onIFrameLoad()"
13   - style="width: 100%; border: none; /* 启用点击穿透 */"
  13 + style="width: 100%; border: none; max-height: 600px; /* 启用点击穿透 */"
14 14 ></iframe>
15 15 </div>
16 16  
... ... @@ -94,8 +94,6 @@ export default {
94 94 .test-box {
95 95 width: 100%;
96 96 box-sizing: border-box;
97   - padding: 20px;
98   - max-height: 600px;
99   - overflow-y: auto;
  97 + overflow: auto;
100 98 }
101 99 </style>
... ...
src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
... ... @@ -69,7 +69,7 @@
69 69 @mouseenter="handleGroupMouseEnter(group.questionType, 'all')"
70 70 >
71 71 <div class="size-16" style="font-weight: 600">
72   - {{ index + 1 }}、
  72 + {{ numberToChinese(index + 1) }}、
73 73 <span
74 74 @mouseenter="
75 75 (event) => handleItemMouseEnter(event, group.questionType)
... ... @@ -207,7 +207,7 @@
207 207 <!-- 每个组的标题 -->
208 208 <div class="group-title">
209 209 <div class="size" style="font-weight: 600">
210   - {{ index + 1 }}、{{ group.questionTitle }}
  210 + {{ numberToChinese(index + 1) }}、{{ group.questionTitle }}
211 211 </div>
212 212 <div class="size">
213 213 单题分值:
... ... @@ -434,9 +434,10 @@ export default {
434 434 const iframeRef = this.$refs["iframe" + id][0]; // 获取对应的 iframe
435 435 const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;
436 436 const body = iframeRef.contentWindow.document.body;
437   - body.style.overflowX = "hidden"; // 不允许出现横向滚动条
  437 + body.style.overflow = "hidden"; // 不允许出现横向滚动条
438 438 const height = body.offsetHeight; // 获取内容的高度
439 439 iframeRef.style.height = `${height + 40}px`; // 设置 iframe 的高度
  440 + iframeRef.style.overflow = "hidden"; // 设置 iframe 的高度
440 441 // 获取第一个P标签
441 442 const firstP = doc.getElementsByTagName("p")[0];
442 443 // 或者修改第一个 < p > 标签的内容;
... ... @@ -755,7 +756,7 @@ export default {
755 756  
756 757 // 清空
757 758 handleClear() {
758   - this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  759 + this.$confirm("确定要清空试题篮内的全部题目吗?", "提示", {
759 760 confirmButtonText: "确定",
760 761 cancelButtonText: "取消",
761 762 confirmButtonClass: "el-button--danger1",
... ... @@ -847,11 +848,54 @@ export default {
847 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 895 </script>
853 896 <style lang="scss" scoped>
854 897 .title {
  898 + font-size: 18px !important;
855 899 font-weight: 600;
856 900 }
857 901  
... ... @@ -870,7 +914,7 @@ export default {
870 914 padding: 0 20px;
871 915  
872 916 .test-title {
873   - font-size: 20px !important;
  917 + font-size: 22px !important;
874 918 font-weight: 700;
875 919 text-align: center;
876 920 color: #000000;
... ... @@ -917,7 +961,7 @@ export default {
917 961 width: 100%;
918 962 text-align: center;
919 963 font-weight: 600;
920   - font-size: 16px !important;
  964 + font-size: 18px !important;
921 965 line-height: 60px;
922 966 color: #000000;
923 967  
... ... @@ -989,7 +1033,7 @@ export default {
989 1033 }
990 1034  
991 1035 .size {
992   - font-size: 14px !important;
  1036 + font-size: 16px !important;
993 1037 }
994 1038  
995 1039 .color {
... ...
src/views/basic/askTestQuestion/wrongQuestion.vue
... ... @@ -251,7 +251,10 @@
251 251 </div>
252 252 <div class="shopping" @click="handleShop">
253 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 258 <div>
256 259 <div class="size">试</div>
257 260 <div class="size">题</div>
... ... @@ -628,12 +631,13 @@ export default {
628 631 const iframeRef = this.$refs["iframe" + index][0]; // 获取对应的 iframe
629 632 const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;
630 633 const body = iframeRef.contentWindow.document.body;
631   - body.style.overflowX = "hidden"; // 不允许出现横向滚动条
  634 + body.style.overflow = "hidden"; // 不允许出现横向滚动条
632 635 const height = body.offsetHeight; // 获取内容的高度
633 636 // console.log("body.offsetHeight:", body.offsetHeight);
634 637 // console.log("body.clientHeight:", body.clientHeight);
635 638 // console.log("body.scrollHeight:", body.scrollHeight);
636 639 iframeRef.style.height = `${height + 40}px`; // 设置 iframe 的高度
  640 + iframeRef.style.overflow = "hidden"; // 设置 iframe 的高度
637 641 // 获取第一个P标签
638 642 const firstP = doc.getElementsByTagName("p")[0];
639 643 // 或者修改第一个 < p > 标签的内容;
... ... @@ -707,11 +711,11 @@ export default {
707 711 flex: 1;
708 712 padding: 10px 20px;
709 713 .box-info-title {
710   - font-size: 16px !important;
  714 + font-size: 17px !important;
711 715 font-weight: 600;
712 716 color: #000000;
713 717 span {
714   - font-size: 14px !important;
  718 + font-size: 16px !important;
715 719 color: #999999;
716 720 }
717 721 }
... ... @@ -759,7 +763,7 @@ export default {
759 763  
760 764 .shopping {
761 765 width: 50px;
762   - height: 135px;
  766 + height: 140px;
763 767 position: fixed;
764 768 top: 30%;
765 769 right: 0;
... ... @@ -786,7 +790,7 @@ export default {
786 790 line-height: 25px;
787 791 }
788 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 832 margin-right: 10px;
829 833 }
830 834 .size {
831   - font-size: 14px !important;
  835 + font-size: 16px !important;
832 836 }
833 837 .font-weight {
834 838 font-weight: 400;
... ...