Commit 54e8889ea5b3198df86c40513661b25387c76685
Merge branch 'ezTeach-2.0.0.0.release' of http://120.78.57.84/baoman/Ezquiz_Plat…
…form into ezTeach-2.0.0.0.release
Showing
10 changed files
with
472 additions
and
260 deletions
src/App.vue
| 1 | <template> | 1 | <template> |
| 2 | - <div id="app" ref="app"> | ||
| 3 | - <transition name="fade" mode="out-in"> | ||
| 4 | - <router-view></router-view> | ||
| 5 | - </transition> | ||
| 6 | - </div> | 2 | + <div id="app" ref="app"> |
| 3 | + <transition name="fade" mode="out-in"> | ||
| 4 | + <router-view></router-view> | ||
| 5 | + </transition> | ||
| 6 | + </div> | ||
| 7 | </template> | 7 | </template> |
| 8 | 8 | ||
| 9 | <script> | 9 | <script> |
| 10 | import _ from "lodash"; | 10 | import _ from "lodash"; |
| 11 | export default { | 11 | export default { |
| 12 | - name: "app", | ||
| 13 | - mounted() { | 12 | + name: "app", |
| 13 | + mounted() {}, | ||
| 14 | + methods: { | ||
| 15 | + _reSize() { | ||
| 16 | + const $app = this.$refs.app; | ||
| 14 | 17 | ||
| 15 | - }, | ||
| 16 | - methods: { | ||
| 17 | - _reSize() { | 18 | + const standardScale = "100%" / "100%"; |
| 18 | 19 | ||
| 19 | - const $app = this.$refs.app; | 20 | + const docHeight = document.body.clientHeight; |
| 20 | 21 | ||
| 21 | - const standardScale = "100%" / "100%"; | 22 | + const docWidth = document.body.clientWidth; |
| 22 | 23 | ||
| 23 | - const docHeight = document.body.clientHeight; | 24 | + if (docWidth < 1700) { |
| 25 | + const currentScale = docHeight / docWidth; | ||
| 24 | 26 | ||
| 25 | - const docWidth = document.body.clientWidth; | 27 | + let [scale, translate] = [0, 0]; |
| 28 | + if (currentScale < standardScale) { | ||
| 29 | + // 以高度计算 | ||
| 30 | + scale = docHeight / 1080; | ||
| 26 | 31 | ||
| 27 | - if (docWidth < 1700) { | 32 | + const shouleWidth = 1920 * scale; |
| 28 | 33 | ||
| 29 | - const currentScale = docHeight / docWidth; | 34 | + const offsetWidth = docWidth - shouleWidth; |
| 30 | 35 | ||
| 31 | - let [scale, translate] = [0, 0]; | ||
| 32 | - if (currentScale < standardScale) { | ||
| 33 | - // 以高度计算 | ||
| 34 | - scale = docHeight / 1080; | 36 | + translate = |
| 37 | + offsetWidth > 0 ? `translate(${offsetWidth / 2}px, 0)` : ""; | ||
| 38 | + } else { | ||
| 39 | + // 以宽度计算 | ||
| 40 | + scale = docWidth / 1920; | ||
| 35 | 41 | ||
| 36 | - const shouleWidth = 1920 * scale; | 42 | + const shouleHeight = 1080 * scale; |
| 37 | 43 | ||
| 38 | - const offsetWidth = docWidth - shouleWidth; | 44 | + const offsetHeight = docHeight - shouleHeight; |
| 39 | 45 | ||
| 40 | - translate = | ||
| 41 | - offsetWidth > 0 ? `translate(${offsetWidth / 2}px, 0)` : ""; | 46 | + translate = |
| 47 | + offsetHeight > 0 ? `translate(0, ${offsetHeight / 2}px)` : ""; | ||
| 48 | + } | ||
| 42 | 49 | ||
| 43 | - } else { | ||
| 44 | - // 以宽度计算 | ||
| 45 | - scale = docWidth / 1920; | ||
| 46 | - | ||
| 47 | - const shouleHeight = 1080 * scale; | ||
| 48 | - | ||
| 49 | - const offsetHeight = docHeight - shouleHeight; | ||
| 50 | - | ||
| 51 | - translate = | ||
| 52 | - offsetHeight > 0 ? `translate(0, ${offsetHeight / 2}px)` : ""; | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - if (docHeight <= 600) { | ||
| 56 | - | ||
| 57 | - $app.style.cssText = ` | 50 | + if (docHeight <= 600) { |
| 51 | + $app.style.cssText = ` | ||
| 58 | transform: scale(${scale}) ${translate}; | 52 | transform: scale(${scale}) ${translate}; |
| 59 | transform-origin: top left; | 53 | transform-origin: top left; |
| 60 | min-width: 1920px; | 54 | min-width: 1920px; |
| 61 | min-height:830px; | 55 | min-height:830px; |
| 62 | `; | 56 | `; |
| 63 | - } | ||
| 64 | - else if (docHeight == 610) { | ||
| 65 | - $app.style.cssText = ` | 57 | + } else if (docHeight == 610) { |
| 58 | + $app.style.cssText = ` | ||
| 66 | transform: scale(${scale}) ${translate}; | 59 | transform: scale(${scale}) ${translate}; |
| 67 | transform-origin: top left; | 60 | transform-origin: top left; |
| 68 | min-width: 1920px; | 61 | min-width: 1920px; |
| 69 | min-height:885px; | 62 | min-height:885px; |
| 70 | - `; | ||
| 71 | - } | ||
| 72 | - else if (docHeight <= 606) { | ||
| 73 | - $app.style.cssText = ` | 63 | + `; |
| 64 | + } else if (docHeight <= 606) { | ||
| 65 | + $app.style.cssText = ` | ||
| 74 | transform: scale(${scale}) ${translate}; | 66 | transform: scale(${scale}) ${translate}; |
| 75 | transform-origin: top left; | 67 | transform-origin: top left; |
| 76 | min-width: 1920px; | 68 | min-width: 1920px; |
| 77 | min-height:850px; | 69 | min-height:850px; |
| 78 | `; | 70 | `; |
| 79 | - } | ||
| 80 | - else if (docHeight <= 650) { | ||
| 81 | - | ||
| 82 | - $app.style.cssText = ` | 71 | + } else if (docHeight <= 650) { |
| 72 | + $app.style.cssText = ` | ||
| 83 | transform: scale(${scale}) ${translate}; | 73 | transform: scale(${scale}) ${translate}; |
| 84 | transform-origin: top left; | 74 | transform-origin: top left; |
| 85 | min-width: 1920px; | 75 | min-width: 1920px; |
| 86 | min-height:850px; | 76 | min-height:850px; |
| 87 | `; | 77 | `; |
| 88 | - } | ||
| 89 | - else if (docHeight <= 700) { | ||
| 90 | - | ||
| 91 | - $app.style.cssText = ` | 78 | + } else if (docHeight <= 700) { |
| 79 | + $app.style.cssText = ` | ||
| 92 | transform: scale(${scale}) ${translate}; | 80 | transform: scale(${scale}) ${translate}; |
| 93 | transform-origin: top left; | 81 | transform-origin: top left; |
| 94 | min-width: 1920px; | 82 | min-width: 1920px; |
| 95 | min-height: 890px; | 83 | min-height: 890px; |
| 96 | `; | 84 | `; |
| 97 | - } | ||
| 98 | - else if (docHeight <= 750) { | ||
| 99 | - | ||
| 100 | - $app.style.cssText = ` | 85 | + } else if (docHeight <= 750) { |
| 86 | + $app.style.cssText = ` | ||
| 101 | transform: scale(${scale}) ${translate}; | 87 | transform: scale(${scale}) ${translate}; |
| 102 | transform-origin: top left; | 88 | transform-origin: top left; |
| 103 | min-width: 1920px; | 89 | min-width: 1920px; |
| 104 | min-height: 910px; | 90 | min-height: 910px; |
| 105 | `; | 91 | `; |
| 106 | - } | ||
| 107 | - else { | ||
| 108 | - $app.style.cssText = ` | ||
| 109 | - transform: scale(${scale}) ${translate}; | ||
| 110 | - transform-origin: top left; | ||
| 111 | - min-width: 1920px; | ||
| 112 | - min-height:1045px; | 92 | + } |
| 93 | + // else { | ||
| 94 | + // $app.style.cssText = ` | ||
| 95 | + // transform: scale(${scale}) ${translate}; | ||
| 96 | + // transform-origin: top left; | ||
| 97 | + // min-width: 1920px; | ||
| 98 | + // min-height:1045px; | ||
| 99 | + // `; | ||
| 100 | + // } | ||
| 101 | + else { | ||
| 102 | + $app.style.cssText = ` | ||
| 103 | + transform: scale(${scale}) ${translate}; | ||
| 104 | + transform-origin: top left; | ||
| 105 | + min-width: 1920px; | ||
| 106 | + min-height:989px; | ||
| 113 | `; | 107 | `; |
| 114 | - } | ||
| 115 | - | ||
| 116 | - } else { | ||
| 117 | - $app.style.cssText = ''; | ||
| 118 | - } | ||
| 119 | - }, | ||
| 120 | - }, | ||
| 121 | - created() { | ||
| 122 | - let that = this; | ||
| 123 | - | ||
| 124 | - this.$nextTick(() => { | ||
| 125 | - if (document.createEvent) { | ||
| 126 | - that._reSize(); | ||
| 127 | - } else if (document.createEventObject) { | ||
| 128 | - that._reSize(); | ||
| 129 | - } | ||
| 130 | - }); | ||
| 131 | - } | ||
| 132 | -} | ||
| 133 | - | 108 | + } |
| 109 | + } else { | ||
| 110 | + $app.style.cssText = ""; | ||
| 111 | + } | ||
| 112 | + }, | ||
| 113 | + }, | ||
| 114 | + created() { | ||
| 115 | + let that = this; | ||
| 116 | + | ||
| 117 | + this.$nextTick(() => { | ||
| 118 | + if (document.createEvent) { | ||
| 119 | + that._reSize(); | ||
| 120 | + } else if (document.createEventObject) { | ||
| 121 | + that._reSize(); | ||
| 122 | + } | ||
| 123 | + }); | ||
| 124 | + }, | ||
| 125 | +}; | ||
| 134 | </script> | 126 | </script> |
| 135 | 127 | ||
| 136 | <style lang="scss"> | 128 | <style lang="scss"> |
| 137 | body { | 129 | body { |
| 138 | - margin: 0px; | ||
| 139 | - padding: 0px; | ||
| 140 | - font-family: Microsoft YaHei, Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, SimSun, sans-serif; | ||
| 141 | - -webkit-font-smoothing: antialiased; | 130 | + margin: 0px; |
| 131 | + padding: 0px; | ||
| 132 | + font-family: Microsoft YaHei, Helvetica Neue, Helvetica, PingFang SC, | ||
| 133 | + Hiragino Sans GB, SimSun, sans-serif; | ||
| 134 | + -webkit-font-smoothing: antialiased; | ||
| 142 | } | 135 | } |
| 143 | 136 | ||
| 144 | #app { | 137 | #app { |
| 145 | - position: absolute; | ||
| 146 | - top: 0px; | ||
| 147 | - bottom: 0px; | ||
| 148 | - width: 100%; | 138 | + position: absolute; |
| 139 | + top: 0px; | ||
| 140 | + bottom: 0px; | ||
| 141 | + width: 100%; | ||
| 149 | } | 142 | } |
| 150 | 143 | ||
| 151 | a { | 144 | a { |
| 152 | - color: #56a9ff; | 145 | + color: #56a9ff; |
| 153 | } | 146 | } |
| 154 | 147 | ||
| 155 | .fade-enter-active, | 148 | .fade-enter-active, |
| 156 | .fade-leave-active { | 149 | .fade-leave-active { |
| 157 | - transition: all .2s ease; | 150 | + transition: all 0.2s ease; |
| 158 | } | 151 | } |
| 159 | 152 | ||
| 160 | .fade-enter, | 153 | .fade-enter, |
| 161 | .fade-leave-active { | 154 | .fade-leave-active { |
| 162 | - opacity: 0; | 155 | + opacity: 0; |
| 163 | } | 156 | } |
| 164 | 157 | ||
| 165 | #nprogress .bar { | 158 | #nprogress .bar { |
| 166 | - height: 3px !important; | ||
| 167 | - background: #56a9ff !important; //自定义颜色 | 159 | + height: 3px !important; |
| 160 | + background: #56a9ff !important; //自定义颜色 | ||
| 168 | } | 161 | } |
| 169 | </style> | 162 | </style> |
src/api/urls/apis.js
| @@ -506,7 +506,7 @@ export default { | @@ -506,7 +506,7 @@ export default { | ||
| 506 | // 获取年级信息 | 506 | // 获取年级信息 |
| 507 | teacherClassList: "api_html/teaching/classList", | 507 | teacherClassList: "api_html/teaching/classList", |
| 508 | // 获取班级信息 | 508 | // 获取班级信息 |
| 509 | - teacherGradeList: "api_html/teaching/grade", | 509 | + teacherGradeList: "api_html/teaching/gradeByTeacher", |
| 510 | // 保存接口 | 510 | // 保存接口 |
| 511 | getWrongQuestionSave: "api_html/teaching/wrongQuestion/save", | 511 | getWrongQuestionSave: "api_html/teaching/wrongQuestion/save", |
| 512 | }; | 512 | }; |
src/assets/images/aside/wrong-question-default.png
0 → 100644
6.1 KB
src/assets/images/aside/wrong-question.png
0 → 100644
5.88 KB
src/router/index.js
| @@ -346,8 +346,8 @@ let addrouters = [ | @@ -346,8 +346,8 @@ let addrouters = [ | ||
| 346 | }, | 346 | }, |
| 347 | { | 347 | { |
| 348 | path: "/wrongQuestion", | 348 | path: "/wrongQuestion", |
| 349 | - iconImage: require("@/assets/images/aside/suitangwen-baobiao-default.png"), | ||
| 350 | - selectedIconImage: require("@/assets/images/aside/suitangwen-baobiao-selected.png"), | 349 | + iconImage: require("@/assets/images/aside/wrong-question-default.png"), |
| 350 | + selectedIconImage: require("@/assets/images/aside/wrong-question.png"), | ||
| 351 | name: "错题组卷", | 351 | name: "错题组卷", |
| 352 | demoRoles: ["ROLE_JIAOSHI"], | 352 | demoRoles: ["ROLE_JIAOSHI"], |
| 353 | component: wrongQuestion, | 353 | component: wrongQuestion, |
src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
| @@ -37,6 +37,11 @@ | @@ -37,6 +37,11 @@ | ||
| 37 | style="padding: 0 200px" | 37 | style="padding: 0 200px" |
| 38 | /> | 38 | /> |
| 39 | </div> | 39 | </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> | ||
| 40 | <div class="test-group"> | 45 | <div class="test-group"> |
| 41 | <div | 46 | <div |
| 42 | class="outer-item" | 47 | class="outer-item" |
| @@ -59,7 +64,7 @@ | @@ -59,7 +64,7 @@ | ||
| 59 | <div | 64 | <div |
| 60 | class="test-group-title" | 65 | class="test-group-title" |
| 61 | :class="{ | 66 | :class="{ |
| 62 | - border: selectedIndex == group.questionType, | 67 | + borderTitle: selectedIndex == group.questionType, |
| 63 | }" | 68 | }" |
| 64 | @mouseenter="handleGroupMouseEnter(group.questionType, 'all')" | 69 | @mouseenter="handleGroupMouseEnter(group.questionType, 'all')" |
| 65 | > | 70 | > |
| @@ -95,7 +100,7 @@ | @@ -95,7 +100,7 @@ | ||
| 95 | left: tooltipPosition.x + 'px', | 100 | left: tooltipPosition.x + 'px', |
| 96 | }" | 101 | }" |
| 97 | > | 102 | > |
| 98 | - 单击设置试卷标题 | 103 | + 单击修改大题名称 |
| 99 | </div> | 104 | </div> |
| 100 | 105 | ||
| 101 | <span | 106 | <span |
| @@ -144,6 +149,7 @@ | @@ -144,6 +149,7 @@ | ||
| 144 | width: 100%; | 149 | width: 100%; |
| 145 | pointer-events: none; | 150 | pointer-events: none; |
| 146 | border: none; /* 启用点击穿透 */ | 151 | border: none; /* 启用点击穿透 */ |
| 152 | + padding: 0 0 0 10px; | ||
| 147 | " | 153 | " |
| 148 | ></iframe> | 154 | ></iframe> |
| 149 | </div> | 155 | </div> |
| @@ -158,10 +164,18 @@ | @@ -158,10 +164,18 @@ | ||
| 158 | >分 | 164 | >分 |
| 159 | </div> | 165 | </div> |
| 160 | <div class="edit-button"> | 166 | <div class="edit-button"> |
| 161 | - <el-button class="button-width" type="primary" @click="handleSava" | 167 | + <el-button |
| 168 | + :disabled="dataYesNo(groups)" | ||
| 169 | + class="button-width" | ||
| 170 | + type="primary" | ||
| 171 | + @click="handleSava" | ||
| 162 | >保存试卷</el-button | 172 | >保存试卷</el-button |
| 163 | > | 173 | > |
| 164 | - <el-button class="button-width" plain @click="handleSava('print')" | 174 | + <el-button |
| 175 | + :disabled="dataYesNo(groups)" | ||
| 176 | + class="button-width" | ||
| 177 | + plain | ||
| 178 | + @click="handleSava('print')" | ||
| 165 | >保存并打印</el-button | 179 | >保存并打印</el-button |
| 166 | > | 180 | > |
| 167 | <el-button | 181 | <el-button |
| @@ -177,10 +191,10 @@ | @@ -177,10 +191,10 @@ | ||
| 177 | </div> | 191 | </div> |
| 178 | </div> | 192 | </div> |
| 179 | <div class="edit-info"> | 193 | <div class="edit-info"> |
| 180 | - <div class="title size color" style="padding: 15px 0 0 10px"> | 194 | + <div class="title size color" style="padding: 10px 0 5px 10px"> |
| 181 | 题目排序 | 195 | 题目排序 |
| 182 | - <span class="title size" style="color: #999999" | ||
| 183 | - >(拖拽题号可拖拽排序)</span | 196 | + <span class="title size font-weight" style="color: #999999" |
| 197 | + >(拖拽题号可排序)</span | ||
| 184 | > | 198 | > |
| 185 | </div> | 199 | </div> |
| 186 | <!-- 外层容器,允许拖拽整个组 --> | 200 | <!-- 外层容器,允许拖拽整个组 --> |
| @@ -202,9 +216,10 @@ | @@ -202,9 +216,10 @@ | ||
| 202 | v-model="group.questionScore" | 216 | v-model="group.questionScore" |
| 203 | :min="1" | 217 | :min="1" |
| 204 | :max="30" | 218 | :max="30" |
| 205 | - style="width: 100px" | ||
| 206 | - :step="1" | ||
| 207 | - :precision="0" | 219 | + style="width: 120px" |
| 220 | + :precision="1" | ||
| 221 | + :step="0.5" | ||
| 222 | + @change="handleInput" | ||
| 208 | ></el-input-number> | 223 | ></el-input-number> |
| 209 | </div> | 224 | </div> |
| 210 | </div> | 225 | </div> |
| @@ -274,6 +289,13 @@ export default { | @@ -274,6 +289,13 @@ export default { | ||
| 274 | return null; | 289 | return null; |
| 275 | }, | 290 | }, |
| 276 | }, | 291 | }, |
| 292 | + userId: { | ||
| 293 | + // uid | ||
| 294 | + type: [String, Number], | ||
| 295 | + default() { | ||
| 296 | + return null; | ||
| 297 | + }, | ||
| 298 | + }, | ||
| 277 | }, | 299 | }, |
| 278 | data() { | 300 | data() { |
| 279 | return { | 301 | return { |
| @@ -302,24 +324,32 @@ export default { | @@ -302,24 +324,32 @@ export default { | ||
| 302 | visible(val) { | 324 | visible(val) { |
| 303 | if (val) { | 325 | if (val) { |
| 304 | // 上面数据测试 | 326 | // 上面数据测试 |
| 305 | - this.testData = JSON.parse(localStorage.getItem("testData")) || []; | ||
| 306 | - this.groups = JSON.parse(localStorage.getItem("question")) || []; | 327 | + this.testData = |
| 328 | + JSON.parse(localStorage.getItem(this.userId + "testData")) || []; | ||
| 329 | + this.groups = | ||
| 330 | + JSON.parse(localStorage.getItem(this.userId + "question")) || []; | ||
| 307 | // 如果都没有直接return 执行初始化 | 331 | // 如果都没有直接return 执行初始化 |
| 308 | if (this.groups.length == 0) { | 332 | if (this.groups.length == 0) { |
| 309 | this.init(); | 333 | this.init(); |
| 310 | - localStorage.setItem("testData", JSON.stringify(this.list)); | 334 | + localStorage.setItem( |
| 335 | + this.userId + "testData", | ||
| 336 | + JSON.stringify(this.list) | ||
| 337 | + ); | ||
| 311 | return; | 338 | return; |
| 312 | } | 339 | } |
| 313 | // 如果一致 就直接赋值 | 340 | // 如果一致 就直接赋值 |
| 314 | if ( | 341 | if ( |
| 315 | this.arraysHaveSameIds(this.testData, this.list) && | 342 | this.arraysHaveSameIds(this.testData, this.list) && |
| 316 | - JSON.parse(localStorage.getItem("question")) | 343 | + JSON.parse(localStorage.getItem(this.userId + "question")) |
| 317 | ) { | 344 | ) { |
| 318 | return; | 345 | return; |
| 319 | } else { | 346 | } else { |
| 320 | let data = this.findMissingIds(this.testData, this.list); | 347 | let data = this.findMissingIds(this.testData, this.list); |
| 321 | this.testData = this.list; | 348 | this.testData = this.list; |
| 322 | - localStorage.setItem("testData", JSON.stringify(this.testData)); | 349 | + localStorage.setItem( |
| 350 | + this.userId + "testData", | ||
| 351 | + JSON.stringify(this.testData) | ||
| 352 | + ); | ||
| 323 | this.testAddDel(this.groups, data.addArr, data.delArr); | 353 | this.testAddDel(this.groups, data.addArr, data.delArr); |
| 324 | } | 354 | } |
| 325 | } else { | 355 | } else { |
| @@ -346,7 +376,10 @@ export default { | @@ -346,7 +376,10 @@ export default { | ||
| 346 | this.groups.reduce((accumulator, current) => { | 376 | this.groups.reduce((accumulator, current) => { |
| 347 | return accumulator.concat(current.subQuestionIds); | 377 | return accumulator.concat(current.subQuestionIds); |
| 348 | }, []) || []; | 378 | }, []) || []; |
| 349 | - localStorage.setItem("testData", JSON.stringify(this.testData)); | 379 | + localStorage.setItem( |
| 380 | + this.userId + "testData", | ||
| 381 | + JSON.stringify(this.testData) | ||
| 382 | + ); | ||
| 350 | }, | 383 | }, |
| 351 | /** 按钮 - 取消 */ | 384 | /** 按钮 - 取消 */ |
| 352 | handleClose() { | 385 | handleClose() { |
| @@ -370,7 +403,10 @@ export default { | @@ -370,7 +403,10 @@ export default { | ||
| 370 | allItems.forEach((item, index) => { | 403 | allItems.forEach((item, index) => { |
| 371 | item.globalIndex = index + 1; | 404 | item.globalIndex = index + 1; |
| 372 | }); | 405 | }); |
| 373 | - localStorage.setItem("question", JSON.stringify(this.groups)); | 406 | + localStorage.setItem( |
| 407 | + this.userId + "question", | ||
| 408 | + JSON.stringify(this.groups) | ||
| 409 | + ); | ||
| 374 | }, | 410 | }, |
| 375 | classifyByType(arr) { | 411 | classifyByType(arr) { |
| 376 | const result = {}; | 412 | const result = {}; |
| @@ -397,7 +433,9 @@ export default { | @@ -397,7 +433,9 @@ export default { | ||
| 397 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; | 433 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; |
| 398 | const body = iframeRef.contentWindow.document.body; | 434 | const body = iframeRef.contentWindow.document.body; |
| 399 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 | 435 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 |
| 400 | - const height = body.scrollHeight; // 获取内容的高度 | 436 | + const height = body.offsetHeight; // 获取内容的高度 |
| 437 | + console.log(height, "height"); | ||
| 438 | + console.log(body, "body"); | ||
| 401 | iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 | 439 | iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 |
| 402 | // 获取第一个P标签 | 440 | // 获取第一个P标签 |
| 403 | const firstP = doc.getElementsByTagName("p")[0]; | 441 | const firstP = doc.getElementsByTagName("p")[0]; |
| @@ -421,7 +459,10 @@ export default { | @@ -421,7 +459,10 @@ export default { | ||
| 421 | // 保存修改后的内容,回车或失去焦点时触发 | 459 | // 保存修改后的内容,回车或失去焦点时触发 |
| 422 | save() { | 460 | save() { |
| 423 | this.isEditing = false; | 461 | this.isEditing = false; |
| 424 | - localStorage.setItem("question", JSON.stringify(this.groups)); | 462 | + localStorage.setItem( |
| 463 | + this.userId + "question", | ||
| 464 | + JSON.stringify(this.groups) | ||
| 465 | + ); | ||
| 425 | }, | 466 | }, |
| 426 | 467 | ||
| 427 | // 单题title修改 | 468 | // 单题title修改 |
| @@ -438,7 +479,10 @@ export default { | @@ -438,7 +479,10 @@ export default { | ||
| 438 | // 单体title保存 | 479 | // 单体title保存 |
| 439 | groupSave(index) { | 480 | groupSave(index) { |
| 440 | this.$set(this.groups[index], "input", false); | 481 | this.$set(this.groups[index], "input", false); |
| 441 | - localStorage.setItem("question", JSON.stringify(this.groups)); | 482 | + localStorage.setItem( |
| 483 | + this.userId + "question", | ||
| 484 | + JSON.stringify(this.groups) | ||
| 485 | + ); | ||
| 442 | }, | 486 | }, |
| 443 | // 高亮 | 487 | // 高亮 |
| 444 | selectItem(id, type) { | 488 | selectItem(id, type) { |
| @@ -456,10 +500,16 @@ export default { | @@ -456,10 +500,16 @@ export default { | ||
| 456 | let _index = this.groups.findIndex((item) => item.questionType == id); | 500 | let _index = this.groups.findIndex((item) => item.questionType == id); |
| 457 | if (_index != -1) { | 501 | if (_index != -1) { |
| 458 | this.groups.splice(_index, 1); | 502 | this.groups.splice(_index, 1); |
| 459 | - localStorage.setItem("question", JSON.stringify(this.groups)); | 503 | + localStorage.setItem( |
| 504 | + this.userId + "question", | ||
| 505 | + JSON.stringify(this.groups) | ||
| 506 | + ); | ||
| 460 | this.updateGlobalIndexes(); | 507 | this.updateGlobalIndexes(); |
| 461 | this.testDataFun(); | 508 | this.testDataFun(); |
| 462 | - localStorage.setItem("testlist", JSON.stringify(this.testData)); | 509 | + localStorage.setItem( |
| 510 | + this.userId + "testlist", | ||
| 511 | + JSON.stringify(this.testData) | ||
| 512 | + ); | ||
| 463 | this.$emit("setQuestions"); | 513 | this.$emit("setQuestions"); |
| 464 | } | 514 | } |
| 465 | } else { | 515 | } else { |
| @@ -470,10 +520,16 @@ export default { | @@ -470,10 +520,16 @@ export default { | ||
| 470 | ); | 520 | ); |
| 471 | } | 521 | } |
| 472 | }); | 522 | }); |
| 473 | - localStorage.setItem("question", JSON.stringify(this.groups)); | 523 | + localStorage.setItem( |
| 524 | + this.userId + "question", | ||
| 525 | + JSON.stringify(this.groups) | ||
| 526 | + ); | ||
| 474 | this.updateGlobalIndexes(); | 527 | this.updateGlobalIndexes(); |
| 475 | this.testDataFun(); | 528 | this.testDataFun(); |
| 476 | - localStorage.setItem("testlist", JSON.stringify(this.testData)); | 529 | + localStorage.setItem( |
| 530 | + this.userId + "testlist", | ||
| 531 | + JSON.stringify(this.testData) | ||
| 532 | + ); | ||
| 477 | this.$emit("setQuestions"); | 533 | this.$emit("setQuestions"); |
| 478 | } | 534 | } |
| 479 | }, | 535 | }, |
| @@ -547,19 +603,32 @@ export default { | @@ -547,19 +603,32 @@ export default { | ||
| 547 | return false; | 603 | return false; |
| 548 | }, | 604 | }, |
| 549 | processString(input) { | 605 | processString(input) { |
| 550 | - // 正则表达式:匹配最多三位数字 | ||
| 551 | - const regex = /^(\d{1,3})/; | ||
| 552 | - | ||
| 553 | - // 测试字符串是否以数字开头 | ||
| 554 | - const match = input.match(regex); | 606 | + // 正则表达式: |
| 607 | + // const regexs = [/[0-9]+[.)]/, /(\d+分)/, /^(\d{1,3})/]; | ||
| 555 | 608 | ||
| 609 | + // // 使用正则表达式匹配并处理输入字符串 | ||
| 610 | + // for (const regex of regexs) { | ||
| 611 | + // const match = input.match(regex); | ||
| 612 | + // if (match) { | ||
| 613 | + // if (regex === regexs[2]) { | ||
| 614 | + // // 如果匹配第三条规则,使用substring截取返回结果的长度加1 | ||
| 615 | + // const matchLength = match[0].length; | ||
| 616 | + // return input.substring(matchLength + 1).trim(); | ||
| 617 | + // } else { | ||
| 618 | + // // 如果匹配第一条或第二条规则,替换匹配的部分 | ||
| 619 | + // input = input.replace(regex, ""); | ||
| 620 | + // } | ||
| 621 | + // } | ||
| 622 | + // } | ||
| 623 | + const match = input.match(/^(\d{1,3})/); | ||
| 556 | if (match) { | 624 | if (match) { |
| 557 | - // 如果匹配,去掉开头的数字并返回剩余部分 | ||
| 558 | - return input.substring(match[0].length + 1).trim(); | 625 | + const matchLength = match[0].length; |
| 626 | + input = input.substring(matchLength + 1).trim(); | ||
| 559 | } | 627 | } |
| 560 | - | ||
| 561 | - // 如果没有匹配,直接返回原字符串 | ||
| 562 | - return input; | 628 | + // 使用正则表达式匹配并处理输入字符串 |
| 629 | + input = input.replace(/[0-9]+[.).]/, ""); | ||
| 630 | + input = input.replace(/(\d+(\.\d+)?分)/g, ""); | ||
| 631 | + return input.trim(); | ||
| 563 | }, | 632 | }, |
| 564 | 633 | ||
| 565 | // 接受两个参数,返回需要删除的数据以及需要添加的数据 | 634 | // 接受两个参数,返回需要删除的数据以及需要添加的数据 |
| @@ -608,16 +677,14 @@ export default { | @@ -608,16 +677,14 @@ export default { | ||
| 608 | // 删除数据 | 677 | // 删除数据 |
| 609 | arr3.forEach((item3) => { | 678 | arr3.forEach((item3) => { |
| 610 | // 在 array1 中找到匹配的 type | 679 | // 在 array1 中找到匹配的 type |
| 611 | - let matchedArray1Item = arr1.find( | ||
| 612 | - (item1) => item1.questionType == item3.questionType | 680 | + let matchedArray1Item = arr1.find((item1) => |
| 681 | + item1.subQuestionIds.filter((item) => item.id == item3.id) | ||
| 613 | ); | 682 | ); |
| 614 | if (matchedArray1Item) { | 683 | if (matchedArray1Item) { |
| 615 | // 如果找到了匹配的 type,遍历 matchedArray1Item 的 items | 684 | // 如果找到了匹配的 type,遍历 matchedArray1Item 的 items |
| 616 | let _index = matchedArray1Item.subQuestionIds.findIndex( | 685 | let _index = matchedArray1Item.subQuestionIds.findIndex( |
| 617 | (item) => item.id === item3.id | 686 | (item) => item.id === item3.id |
| 618 | ); | 687 | ); |
| 619 | - console.log("_index"); | ||
| 620 | - | ||
| 621 | if (_index != -1) { | 688 | if (_index != -1) { |
| 622 | matchedArray1Item.subQuestionIds.splice(_index, 1); | 689 | matchedArray1Item.subQuestionIds.splice(_index, 1); |
| 623 | } | 690 | } |
| @@ -673,10 +740,21 @@ export default { | @@ -673,10 +740,21 @@ export default { | ||
| 673 | if (res.status == 0) { | 740 | if (res.status == 0) { |
| 674 | this.groups = []; | 741 | this.groups = []; |
| 675 | this.testData = []; | 742 | this.testData = []; |
| 676 | - localStorage.setItem("testlist", JSON.stringify(this.testData)); | ||
| 677 | - localStorage.setItem("question", JSON.stringify(this.groups)); | 743 | + localStorage.setItem( |
| 744 | + this.userId + "testlist", | ||
| 745 | + JSON.stringify(this.testData) | ||
| 746 | + ); | ||
| 747 | + localStorage.setItem( | ||
| 748 | + this.userId + "question", | ||
| 749 | + JSON.stringify(this.groups) | ||
| 750 | + ); | ||
| 678 | this.$emit("setQuestions"); | 751 | this.$emit("setQuestions"); |
| 679 | this.handleClose(); | 752 | this.handleClose(); |
| 753 | + this.$message({ | ||
| 754 | + message: "已保存到“即时测-组卷-我自编的”", | ||
| 755 | + type: "success", | ||
| 756 | + }); | ||
| 757 | + | ||
| 680 | if (type == "print") { | 758 | if (type == "print") { |
| 681 | this.$request | 759 | this.$request |
| 682 | .tPaperDetail({ | 760 | .tPaperDetail({ |
| @@ -693,7 +771,7 @@ export default { | @@ -693,7 +771,7 @@ export default { | ||
| 693 | // 清空 | 771 | // 清空 |
| 694 | handleClear() { | 772 | handleClear() { |
| 695 | this.$confirm("确定要清空试题篮内的全部题目吗?", "提示", { | 773 | this.$confirm("确定要清空试题篮内的全部题目吗?", "提示", { |
| 696 | - confirmButtonText: "确定", | 774 | + confirmButtonText: "清空", |
| 697 | cancelButtonText: "取消", | 775 | cancelButtonText: "取消", |
| 698 | confirmButtonClass: "el-button--danger1", | 776 | confirmButtonClass: "el-button--danger1", |
| 699 | cancelButtonClass: "el-button--primary", | 777 | cancelButtonClass: "el-button--primary", |
| @@ -705,8 +783,15 @@ export default { | @@ -705,8 +783,15 @@ export default { | ||
| 705 | .then(() => { | 783 | .then(() => { |
| 706 | this.groups = []; | 784 | this.groups = []; |
| 707 | this.testDataFun(); | 785 | this.testDataFun(); |
| 708 | - localStorage.setItem("question", JSON.stringify(this.groups)); | ||
| 709 | - localStorage.setItem("testlist", JSON.stringify(this.testData)); | 786 | + localStorage.setItem( |
| 787 | + this.userId + "question", | ||
| 788 | + JSON.stringify(this.groups) | ||
| 789 | + ); | ||
| 790 | + localStorage.setItem( | ||
| 791 | + this.userId + "testlist", | ||
| 792 | + JSON.stringify(this.testData) | ||
| 793 | + ); | ||
| 794 | + | ||
| 710 | this.$emit("setQuestions"); | 795 | this.$emit("setQuestions"); |
| 711 | }) | 796 | }) |
| 712 | .catch(() => { | 797 | .catch(() => { |
| @@ -724,6 +809,30 @@ export default { | @@ -724,6 +809,30 @@ export default { | ||
| 724 | return sum + Number(item.questionScore) * item.subQuestionIds.length; | 809 | return sum + Number(item.questionScore) * item.subQuestionIds.length; |
| 725 | }, 0); | 810 | }, 0); |
| 726 | }, | 811 | }, |
| 812 | + | ||
| 813 | + // 当分数发生变化的时候 | ||
| 814 | + handleInput() { | ||
| 815 | + localStorage.setItem( | ||
| 816 | + this.userId + "question", | ||
| 817 | + JSON.stringify(this.groups) | ||
| 818 | + ); | ||
| 819 | + }, | ||
| 820 | + dataYesNo(data) { | ||
| 821 | + if (data.length < 1) { | ||
| 822 | + return true; | ||
| 823 | + } | ||
| 824 | + let list = []; | ||
| 825 | + data.forEach((item) => { | ||
| 826 | + list.push(...item.subQuestionIds); | ||
| 827 | + }); | ||
| 828 | + console.log(list, "list"); | ||
| 829 | + | ||
| 830 | + if (list.length < 1) { | ||
| 831 | + return true; | ||
| 832 | + } else { | ||
| 833 | + return false; | ||
| 834 | + } | ||
| 835 | + }, | ||
| 727 | }, | 836 | }, |
| 728 | }; | 837 | }; |
| 729 | </script> | 838 | </script> |
| @@ -739,9 +848,9 @@ export default { | @@ -739,9 +848,9 @@ export default { | ||
| 739 | .test { | 848 | .test { |
| 740 | flex: 1; | 849 | flex: 1; |
| 741 | height: fit-content; | 850 | height: fit-content; |
| 742 | - max-height: 742px; | 851 | + height: 742px; |
| 743 | overflow-y: auto; | 852 | overflow-y: auto; |
| 744 | - box-shadow: 0 0 10px 0 #999999; | 853 | + box-shadow: 0 0 10px 0 #cfcfcf; |
| 745 | margin-right: 20px; | 854 | margin-right: 20px; |
| 746 | box-sizing: border-box; | 855 | box-sizing: border-box; |
| 747 | padding: 0 20px; | 856 | padding: 0 20px; |
| @@ -763,13 +872,17 @@ export default { | @@ -763,13 +872,17 @@ export default { | ||
| 763 | justify-content: space-around; | 872 | justify-content: space-around; |
| 764 | align-items: center; | 873 | align-items: center; |
| 765 | } | 874 | } |
| 766 | - | 875 | + .binding { |
| 876 | + display: flex; | ||
| 877 | + padding: 20px 80px; | ||
| 878 | + justify-content: space-around; | ||
| 879 | + } | ||
| 767 | .test-group { | 880 | .test-group { |
| 768 | .test-group-title { | 881 | .test-group-title { |
| 769 | position: relative; | 882 | position: relative; |
| 770 | height: 40px; | 883 | height: 40px; |
| 771 | - line-height: 30px; | ||
| 772 | - padding: 10px 0 0 0; | 884 | + line-height: 40px; |
| 885 | + padding: 0; | ||
| 773 | } | 886 | } |
| 774 | } | 887 | } |
| 775 | } | 888 | } |
| @@ -782,7 +895,8 @@ export default { | @@ -782,7 +895,8 @@ export default { | ||
| 782 | .edit-title { | 895 | .edit-title { |
| 783 | width: 100%; | 896 | width: 100%; |
| 784 | height: 200px; | 897 | height: 200px; |
| 785 | - border: 1px solid #999999; | 898 | + border: 1px solid #cfcfcf; |
| 899 | + border-radius: 5px; | ||
| 786 | 900 | ||
| 787 | .edit-title-info { | 901 | .edit-title-info { |
| 788 | height: 60px; | 902 | height: 60px; |
| @@ -814,11 +928,12 @@ export default { | @@ -814,11 +928,12 @@ export default { | ||
| 814 | 928 | ||
| 815 | .edit-info { | 929 | .edit-info { |
| 816 | flex: 1; | 930 | flex: 1; |
| 817 | - border: 1px solid #999999; | 931 | + border: 1px solid #cfcfcf; |
| 818 | margin-top: 20px; | 932 | margin-top: 20px; |
| 819 | max-height: 500px; | 933 | max-height: 500px; |
| 820 | padding: 10px; | 934 | padding: 10px; |
| 821 | overflow: auto; | 935 | overflow: auto; |
| 936 | + border-radius: 5px; | ||
| 822 | 937 | ||
| 823 | .group-item { | 938 | .group-item { |
| 824 | margin: 10px; | 939 | margin: 10px; |
| @@ -838,14 +953,14 @@ export default { | @@ -838,14 +953,14 @@ export default { | ||
| 838 | .questions { | 953 | .questions { |
| 839 | display: flex; | 954 | display: flex; |
| 840 | flex-wrap: wrap; | 955 | flex-wrap: wrap; |
| 841 | - | 956 | + padding: 10px 0; |
| 842 | .question-item { | 957 | .question-item { |
| 843 | width: 35px; | 958 | width: 35px; |
| 844 | height: 35px; | 959 | height: 35px; |
| 845 | border: 1px solid rgb(172, 188, 249); | 960 | border: 1px solid rgb(172, 188, 249); |
| 846 | border-radius: 4px; | 961 | border-radius: 4px; |
| 847 | cursor: grab; | 962 | cursor: grab; |
| 848 | - margin: 5px 8px; | 963 | + margin: 0 10px 10px 10px; |
| 849 | line-height: 35px; | 964 | line-height: 35px; |
| 850 | text-align: center; | 965 | text-align: center; |
| 851 | font-size: 16px !important; | 966 | font-size: 16px !important; |
| @@ -882,6 +997,7 @@ export default { | @@ -882,6 +997,7 @@ export default { | ||
| 882 | .border { | 997 | .border { |
| 883 | border: 1px solid rgb(173, 190, 250); | 998 | border: 1px solid rgb(173, 190, 250); |
| 884 | position: relative; | 999 | position: relative; |
| 1000 | + border-radius: 3px; | ||
| 885 | 1001 | ||
| 886 | .border-del { | 1002 | .border-del { |
| 887 | position: absolute; | 1003 | position: absolute; |
| @@ -894,7 +1010,7 @@ export default { | @@ -894,7 +1010,7 @@ export default { | ||
| 894 | color: rgb(67, 141, 255); | 1010 | color: rgb(67, 141, 255); |
| 895 | font-size: 14px !important; | 1011 | font-size: 14px !important; |
| 896 | line-height: 28px; | 1012 | line-height: 28px; |
| 897 | - font-weight: 600; | 1013 | + |
| 898 | cursor: pointer; | 1014 | cursor: pointer; |
| 899 | } | 1015 | } |
| 900 | } | 1016 | } |
| @@ -919,9 +1035,16 @@ export default { | @@ -919,9 +1035,16 @@ export default { | ||
| 919 | background: rgb(233, 237, 253); | 1035 | background: rgb(233, 237, 253); |
| 920 | width: fit-content; | 1036 | width: fit-content; |
| 921 | } | 1037 | } |
| 1038 | +.borderTitle { | ||
| 1039 | + background: rgba(102, 127, 253, 0.1); | ||
| 1040 | + padding: 0; | ||
| 1041 | +} | ||
| 922 | 1042 | ||
| 923 | .title-bg { | 1043 | .title-bg { |
| 924 | background: rgb(115, 142, 246); | 1044 | background: rgb(115, 142, 246); |
| 925 | border-bottom: 1px solid rgb(115, 142, 246); | 1045 | border-bottom: 1px solid rgb(115, 142, 246); |
| 926 | } | 1046 | } |
| 1047 | +.font-weight { | ||
| 1048 | + font-weight: 400; | ||
| 1049 | +} | ||
| 927 | </style> | 1050 | </style> |
src/views/basic/askTestQuestion/update.vue
| @@ -80,7 +80,7 @@ | @@ -80,7 +80,7 @@ | ||
| 80 | </div> | 80 | </div> |
| 81 | <div class="qs-partScore"> | 81 | <div class="qs-partScore"> |
| 82 | <p v-if="subQuestion.questionType != 3">------</p> | 82 | <p v-if="subQuestion.questionType != 3">------</p> |
| 83 | - <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2" | 83 | + <el-input-number :disabled="isViewer && !isWrong" class="number-ipt" v-else size="medium" :min="0" :precision="2" |
| 84 | :max="subQuestion.score" :step="0.5" v-model="subQuestion.partScore" label="漏选得分" /> | 84 | :max="subQuestion.score" :step="0.5" v-model="subQuestion.partScore" label="漏选得分" /> |
| 85 | </div> | 85 | </div> |
| 86 | <div class="qs-options"> | 86 | <div class="qs-options"> |
| @@ -162,7 +162,7 @@ | @@ -162,7 +162,7 @@ | ||
| 162 | </div> | 162 | </div> |
| 163 | <div class="qs-partScore"> | 163 | <div class="qs-partScore"> |
| 164 | <p v-if="question.questionType != 3">------</p> | 164 | <p v-if="question.questionType != 3">------</p> |
| 165 | - <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2" | 165 | + <el-input-number :disabled="isViewer && !isWrong" class="number-ipt" v-else size="medium" :min="0" :precision="2" |
| 166 | :max="question.score" :step="0.5" v-model="question.partScore" label="漏选得分" /> | 166 | :max="question.score" :step="0.5" v-model="question.partScore" label="漏选得分" /> |
| 167 | </div> | 167 | </div> |
| 168 | <div class="qs-options"> | 168 | <div class="qs-options"> |
| @@ -331,7 +331,7 @@ | @@ -331,7 +331,7 @@ | ||
| 331 | </div> | 331 | </div> |
| 332 | <div class="content-fi"> | 332 | <div class="content-fi"> |
| 333 | <el-button type="info" @click="linkBack">取消</el-button> | 333 | <el-button type="info" @click="linkBack">取消</el-button> |
| 334 | - <el-button class="green-el-button" @click="save">保存</el-button> | 334 | + <el-button v-if="!isViewer || isWrong" class="green-el-button" @click="save">保存</el-button> |
| 335 | </div> | 335 | </div> |
| 336 | </el-main> | 336 | </el-main> |
| 337 | </el-container> | 337 | </el-container> |
src/views/basic/askTestQuestion/wrongQuestion.vue
| 1 | <template> | 1 | <template> |
| 2 | <div class="page-content" v-loading="queryLoading"> | 2 | <div class="page-content" v-loading="queryLoading"> |
| 3 | <div class="page-title"> | 3 | <div class="page-title"> |
| 4 | - <span class="default-title">错题组卷</span> | 4 | + <span class="default-title" |
| 5 | + >错题组卷 | ||
| 6 | + <span class="font-weight size" style="color: #666666" | ||
| 7 | + >(暂仅包含即时测内使用"导入的试卷"测验后产生的错题,不包含授课端截屏保存的错题)</span | ||
| 8 | + ></span | ||
| 9 | + > | ||
| 10 | + | ||
| 5 | <div> | 11 | <div> |
| 6 | <el-select | 12 | <el-select |
| 7 | v-model="formData.grade" | 13 | v-model="formData.grade" |
| @@ -21,7 +27,7 @@ | @@ -21,7 +27,7 @@ | ||
| 21 | @change="changeSubject" | 27 | @change="changeSubject" |
| 22 | v-model="formData.subjectName" | 28 | v-model="formData.subjectName" |
| 23 | placeholder="" | 29 | placeholder="" |
| 24 | - style="width: 100px; margin-left: 10px" | 30 | + style="width: 120px; margin-left: 10px" |
| 25 | > | 31 | > |
| 26 | <el-option | 32 | <el-option |
| 27 | v-for="(item, index) in subjectList" | 33 | v-for="(item, index) in subjectList" |
| @@ -49,7 +55,7 @@ | @@ -49,7 +55,7 @@ | ||
| 49 | </div> | 55 | </div> |
| 50 | </el-col> | 56 | </el-col> |
| 51 | <el-col class="col-margin" :span="12"> | 57 | <el-col class="col-margin" :span="12"> |
| 52 | - <span style="font-weight: 600">时间:</span> | 58 | + <span style="font-weight: 600; white-space: nowrap">时间:</span> |
| 53 | <el-date-picker | 59 | <el-date-picker |
| 54 | :clearable="false" | 60 | :clearable="false" |
| 55 | value-format="yyyy-MM-dd" | 61 | value-format="yyyy-MM-dd" |
| @@ -71,7 +77,7 @@ | @@ -71,7 +77,7 @@ | ||
| 71 | </el-col> | 77 | </el-col> |
| 72 | <el-col class="col-margin" :span="8"> | 78 | <el-col class="col-margin" :span="8"> |
| 73 | <span style="font-weight: 600">得分率:</span> | 79 | <span style="font-weight: 600">得分率:</span> |
| 74 | - <div> | 80 | + <div style="font-size: 16px !important"> |
| 75 | <el-input | 81 | <el-input |
| 76 | v-model="formData.startScoreRate" | 82 | v-model="formData.startScoreRate" |
| 77 | type="number" | 83 | type="number" |
| @@ -95,10 +101,7 @@ | @@ -95,10 +101,7 @@ | ||
| 95 | </div> | 101 | </div> |
| 96 | </el-col> | 102 | </el-col> |
| 97 | <el-col class="col-margin" :span="7" | 103 | <el-col class="col-margin" :span="7" |
| 98 | - ><span | ||
| 99 | - style="font-weight: 600; width: fit-content; white-space: nowrap" | ||
| 100 | - >题型:</span | ||
| 101 | - > | 104 | + ><span style="font-weight: 600; white-space: nowrap">题型:</span> |
| 102 | <div | 105 | <div |
| 103 | @click="handleQuestion(item.value)" | 106 | @click="handleQuestion(item.value)" |
| 104 | class="select-box" | 107 | class="select-box" |
| @@ -114,7 +117,6 @@ | @@ -114,7 +117,6 @@ | ||
| 114 | @click="handleSearch" | 117 | @click="handleSearch" |
| 115 | style="background: #6b73f5" | 118 | style="background: #6b73f5" |
| 116 | type="primary" | 119 | type="primary" |
| 117 | - y | ||
| 118 | >筛选错题</el-button | 120 | >筛选错题</el-button |
| 119 | ></el-col | 121 | ></el-col |
| 120 | > | 122 | > |
| @@ -130,13 +132,21 @@ | @@ -130,13 +132,21 @@ | ||
| 130 | >道题)</span | 132 | >道题)</span |
| 131 | > | 133 | > |
| 132 | </div> | 134 | </div> |
| 135 | + <div | ||
| 136 | + style="text-align: center; line-height: 400px" | ||
| 137 | + v-if="topicList.length < 1" | ||
| 138 | + > | ||
| 139 | + 筛选条件下,暂无题目 | ||
| 140 | + </div> | ||
| 133 | <div class="topic" v-for="(item, index) in topicList" :key="index"> | 141 | <div class="topic" v-for="(item, index) in topicList" :key="index"> |
| 134 | <div class="topic-title"> | 142 | <div class="topic-title"> |
| 135 | <div style="display: flex"> | 143 | <div style="display: flex"> |
| 136 | <div style="display: flex; align-items: center"> | 144 | <div style="display: flex; align-items: center"> |
| 137 | - <span class="size"> 第 {{ item.questionIndex }} 题 </span> | 145 | + <span class="size font-weight"> |
| 146 | + 第 {{ item.questionIndex }} 题 | ||
| 147 | + </span> | ||
| 138 | <div | 148 | <div |
| 139 | - class="select-box Selected size" | 149 | + class="select-box Selected size font-weight" |
| 140 | style="padding: 3px 5px; margin-right: 20px" | 150 | style="padding: 3px 5px; margin-right: 20px" |
| 141 | > | 151 | > |
| 142 | {{ | 152 | {{ |
| @@ -148,39 +158,46 @@ | @@ -148,39 +158,46 @@ | ||
| 148 | </div> | 158 | </div> |
| 149 | <div> | 159 | <div> |
| 150 | <span class="color size"> 得分率: </span> | 160 | <span class="color size"> 得分率: </span> |
| 151 | - <span class="score-color size">{{ item.scoreRate }}%</span> | ||
| 152 | - <span class="size">({{ item.joinClassNames }})</span> | 161 | + <span class="score-color size" |
| 162 | + >{{ formatNumber(item.scoreRate) }}%</span | ||
| 163 | + > | ||
| 164 | + <span class="size font-weight" | ||
| 165 | + >({{ item.joinClassNames }})</span | ||
| 166 | + > | ||
| 153 | </div> | 167 | </div> |
| 154 | </div> | 168 | </div> |
| 155 | <div> | 169 | <div> |
| 156 | - <span class="color size">来自试卷:</span | ||
| 157 | - ><span class="size">{{ item.paperName }}</span> | ||
| 158 | - <span class="color size" style="margin-left: 20px" | 170 | + <span class="color size font-weight">来自试卷:</span |
| 171 | + ><span class="size font-weight">{{ item.paperName }}</span> | ||
| 172 | + <span class="color size font-weight" style="margin-left: 20px" | ||
| 159 | >测试时间:</span | 173 | >测试时间:</span |
| 160 | - ><span class="size">{{ item.testTime }}</span> | 174 | + ><span class="size font-weight">{{ item.testTime }}</span> |
| 161 | </div> | 175 | </div> |
| 162 | </div> | 176 | </div> |
| 163 | 177 | ||
| 164 | <iframe | 178 | <iframe |
| 165 | - class="topic-info" | ||
| 166 | :src="item.screenshot" | 179 | :src="item.screenshot" |
| 167 | :ref="'iframe' + index" | 180 | :ref="'iframe' + index" |
| 168 | - style="width: 100%" | 181 | + style="width: 100%; border: none; padding: 0 0 0 10px" |
| 169 | @load="onIFrameLoad(index)" | 182 | @load="onIFrameLoad(index)" |
| 170 | /> | 183 | /> |
| 171 | <!-- <div class="topic-info" v-html="item.modifiedHtml"></div> --> | 184 | <!-- <div class="topic-info" v-html="item.modifiedHtml"></div> --> |
| 172 | <div class="topic-bottom"> | 185 | <div class="topic-bottom"> |
| 173 | - <div> | 186 | + <div style="padding-left: 20px"> |
| 174 | <span | 187 | <span |
| 175 | v-if="item.answerScreenshot" | 188 | v-if="item.answerScreenshot" |
| 176 | - class="knowledge size" | 189 | + class="knowledge size font-weight" |
| 177 | @click="handleAnalysis(item.answerScreenshot)" | 190 | @click="handleAnalysis(item.answerScreenshot)" |
| 178 | ><i class="el-icon-key"></i>查看解析</span | 191 | ><i class="el-icon-key"></i>查看解析</span |
| 179 | > | 192 | > |
| 180 | - <span class="color size">知识点:</span> | ||
| 181 | - <span class="size">{{ item.knowledge }}</span> | 193 | + <span class="color size font-weight">知识点:</span> |
| 194 | + <span v-if="item.knowledge" class="size">{{ | ||
| 195 | + item.knowledge | ||
| 196 | + }}</span> | ||
| 197 | + <span v-else class="size color font-weight">未标注</span> | ||
| 182 | </div> | 198 | </div> |
| 183 | <el-button | 199 | <el-button |
| 200 | + style="margin-right: 20px" | ||
| 184 | v-if="!questions.some((obj) => item.id === obj.id)" | 201 | v-if="!questions.some((obj) => item.id === obj.id)" |
| 185 | class="button" | 202 | class="button" |
| 186 | type="primary" | 203 | type="primary" |
| @@ -190,9 +207,9 @@ | @@ -190,9 +207,9 @@ | ||
| 190 | <el-button | 207 | <el-button |
| 191 | v-else | 208 | v-else |
| 192 | plain | 209 | plain |
| 193 | - style="padding: 5px 10px" | 210 | + style="padding: 5px 10px; margin-right: 20px" |
| 194 | @click="handleDel(item)" | 211 | @click="handleDel(item)" |
| 195 | - >移除试卷</el-button | 212 | + >移出试卷</el-button |
| 196 | > | 213 | > |
| 197 | </div> | 214 | </div> |
| 198 | </div> | 215 | </div> |
| @@ -219,6 +236,7 @@ | @@ -219,6 +236,7 @@ | ||
| 219 | questions.map((item) => item.id) | 236 | questions.map((item) => item.id) |
| 220 | ) | 237 | ) |
| 221 | " | 238 | " |
| 239 | + style="margin-right: 20px" | ||
| 222 | @click="handleAllTest()" | 240 | @click="handleAllTest()" |
| 223 | >全选本页</el-button | 241 | >全选本页</el-button |
| 224 | > | 242 | > |
| @@ -227,8 +245,8 @@ | @@ -227,8 +245,8 @@ | ||
| 227 | class="button-size" | 245 | class="button-size" |
| 228 | v-else | 246 | v-else |
| 229 | plain | 247 | plain |
| 230 | - style="padding: 5px 10px" | ||
| 231 | - >移除本页</el-button | 248 | + style="padding: 5px 10px; margin-right: 20px" |
| 249 | + >移出本页</el-button | ||
| 232 | > | 250 | > |
| 233 | </div> | 251 | </div> |
| 234 | <div class="shopping" @click="handleShop"> | 252 | <div class="shopping" @click="handleShop"> |
| @@ -247,6 +265,7 @@ | @@ -247,6 +265,7 @@ | ||
| 247 | :sectionId="formData.sectionId" | 265 | :sectionId="formData.sectionId" |
| 248 | :gradeId="formData.grade" | 266 | :gradeId="formData.grade" |
| 249 | @setQuestions="setQuestions" | 267 | @setQuestions="setQuestions" |
| 268 | + :userId="userId" | ||
| 250 | /> | 269 | /> |
| 251 | <analysisDialog | 270 | <analysisDialog |
| 252 | :visible.sync="analysisVisible" | 271 | :visible.sync="analysisVisible" |
| @@ -289,8 +308,8 @@ export default { | @@ -289,8 +308,8 @@ export default { | ||
| 289 | classList: [], | 308 | classList: [], |
| 290 | // 时间选择 | 309 | // 时间选择 |
| 291 | dateList: [ | 310 | dateList: [ |
| 292 | - { type: "onDay", name: "今天" }, | ||
| 293 | { type: "onWeek", name: "本周" }, | 311 | { type: "onWeek", name: "本周" }, |
| 312 | + { type: "onMonth", name: "本月" }, | ||
| 294 | { type: "term", name: "本学期" }, | 313 | { type: "term", name: "本学期" }, |
| 295 | ], | 314 | ], |
| 296 | // 题型选择 | 315 | // 题型选择 |
| @@ -307,27 +326,34 @@ export default { | @@ -307,27 +326,34 @@ export default { | ||
| 307 | formData: { | 326 | formData: { |
| 308 | classId: 1, // 班级选中 | 327 | classId: 1, // 班级选中 |
| 309 | // type: "onDay", // 时间类型 | 328 | // type: "onDay", // 时间类型 |
| 310 | - type: "onDay", // 时间类型 | 329 | + type: "onWeek", // 时间类型 |
| 311 | dateRange: ["2022-03-01", "2023-05-01"], // 开始结束时间 | 330 | dateRange: ["2022-03-01", "2023-05-01"], // 开始结束时间 |
| 312 | startScoreRate: 0, // 开始区间 | 331 | startScoreRate: 0, // 开始区间 |
| 313 | - endScoreRate: 100, // 结束区间 | 332 | + endScoreRate: 60, // 结束区间 |
| 314 | questionType: null, // 题型 | 333 | questionType: null, // 题型 |
| 315 | subjectName: null, // 科目 | 334 | subjectName: null, // 科目 |
| 316 | grade: null, // 年级 | 335 | grade: null, // 年级 |
| 317 | gradeName: null, // 年级名称 | 336 | gradeName: null, // 年级名称 |
| 318 | }, | 337 | }, |
| 338 | + userId: "", | ||
| 319 | questions: [], | 339 | questions: [], |
| 320 | }; | 340 | }; |
| 321 | }, | 341 | }, |
| 322 | created() { | 342 | created() { |
| 343 | + let user = JSON.parse(localStorage.getItem("info")); | ||
| 344 | + this.userId = user.uid; | ||
| 323 | this.handleDate(this.formData.type); | 345 | this.handleDate(this.formData.type); |
| 324 | this.queryLoading = true; | 346 | this.queryLoading = true; |
| 325 | this.getGradeList(); | 347 | this.getGradeList(); |
| 326 | - if (!localStorage.getItem("testlist")) { | ||
| 327 | - localStorage.setItem("testlist", JSON.stringify(this.questions)); | 348 | + if (!localStorage.getItem(this.userId + "testlist")) { |
| 349 | + localStorage.setItem( | ||
| 350 | + this.userId + "testlist", | ||
| 351 | + JSON.stringify(this.questions) | ||
| 352 | + ); | ||
| 328 | } else { | 353 | } else { |
| 329 | - this.questions = JSON.parse(localStorage.getItem("testlist")); | ||
| 330 | - console.log(this.questions, "==="); | 354 | + this.questions = JSON.parse( |
| 355 | + localStorage.getItem(this.userId + "testlist") | ||
| 356 | + ); | ||
| 331 | } | 357 | } |
| 332 | }, | 358 | }, |
| 333 | methods: { | 359 | methods: { |
| @@ -370,7 +396,10 @@ export default { | @@ -370,7 +396,10 @@ export default { | ||
| 370 | return list; | 396 | return list; |
| 371 | }, | 397 | }, |
| 372 | // 获取列表 | 398 | // 获取列表 |
| 373 | - async getList() { | 399 | + async getList(type) { |
| 400 | + if (type) { | ||
| 401 | + this.listPage.page = 1; | ||
| 402 | + } | ||
| 374 | let param = { | 403 | let param = { |
| 375 | ...this.listPage, | 404 | ...this.listPage, |
| 376 | ...this.formData, | 405 | ...this.formData, |
| @@ -389,7 +418,7 @@ export default { | @@ -389,7 +418,7 @@ export default { | ||
| 389 | }, | 418 | }, |
| 390 | pageSizeChange(value) { | 419 | pageSizeChange(value) { |
| 391 | this.listPage.page = value; | 420 | this.listPage.page = value; |
| 392 | - this.handleSearch(); | 421 | + this.getList(); |
| 393 | }, | 422 | }, |
| 394 | 423 | ||
| 395 | // 全选按钮 | 424 | // 全选按钮 |
| @@ -419,12 +448,10 @@ export default { | @@ -419,12 +448,10 @@ export default { | ||
| 419 | if (value < this.minValue) { | 448 | if (value < this.minValue) { |
| 420 | this.formData.startScoreRate = this.minValue; // 修正值 | 449 | this.formData.startScoreRate = this.minValue; // 修正值 |
| 421 | } | 450 | } |
| 422 | - if (value > this.maxValue) { | ||
| 423 | - this.formData.startScoreRate = this.maxValue; // 修正值 | ||
| 424 | - } | ||
| 425 | if (value > this.formData.endScoreRate) { | 451 | if (value > this.formData.endScoreRate) { |
| 426 | this.formData.startScoreRate = this.formData.endScoreRate; | 452 | this.formData.startScoreRate = this.formData.endScoreRate; |
| 427 | } | 453 | } |
| 454 | + | ||
| 428 | if (!value) { | 455 | if (!value) { |
| 429 | this.formData.startScoreRate = 0; | 456 | this.formData.startScoreRate = 0; |
| 430 | } | 457 | } |
| @@ -434,12 +461,13 @@ export default { | @@ -434,12 +461,13 @@ export default { | ||
| 434 | if (value < this.minValue) { | 461 | if (value < this.minValue) { |
| 435 | this.formData.endScoreRate = this.minValue; // 修正值 | 462 | this.formData.endScoreRate = this.minValue; // 修正值 |
| 436 | } | 463 | } |
| 437 | - if (value > this.maxValue) { | ||
| 438 | - this.formData.endScoreRate = this.maxValue; // 修正值 | ||
| 439 | - } | 464 | + |
| 440 | if (value < this.formData.startScoreRate) { | 465 | if (value < this.formData.startScoreRate) { |
| 441 | this.formData.endScoreRate = this.formData.startScoreRate; | 466 | this.formData.endScoreRate = this.formData.startScoreRate; |
| 442 | } | 467 | } |
| 468 | + if (value > this.maxValue) { | ||
| 469 | + this.formData.endScoreRate = this.maxValue; // 修正值 | ||
| 470 | + } | ||
| 443 | if (!value) { | 471 | if (!value) { |
| 444 | this.formData.endScoreRate = 0; | 472 | this.formData.endScoreRate = 0; |
| 445 | } | 473 | } |
| @@ -448,50 +476,63 @@ export default { | @@ -448,50 +476,63 @@ export default { | ||
| 448 | // 搜索按钮 | 476 | // 搜索按钮 |
| 449 | handleSearch() { | 477 | handleSearch() { |
| 450 | this.queryLoading = true; | 478 | this.queryLoading = true; |
| 451 | - this.getList(); | 479 | + this.getList("type"); |
| 452 | }, | 480 | }, |
| 453 | 481 | ||
| 454 | // 加入试卷 | 482 | // 加入试卷 |
| 455 | handleAddTest(item) { | 483 | handleAddTest(item) { |
| 456 | // if (this.questions.includes(item.id)) return; | 484 | // if (this.questions.includes(item.id)) return; |
| 457 | if (this.questions.some((obj) => obj.id === item.id)) return; | 485 | if (this.questions.some((obj) => obj.id === item.id)) return; |
| 458 | - this.questions = JSON.parse(localStorage.getItem("testlist")) || []; | 486 | + this.questions = |
| 487 | + JSON.parse(localStorage.getItem(this.userId + "testlist")) || []; | ||
| 459 | this.questions.push(item); | 488 | this.questions.push(item); |
| 460 | - localStorage.setItem("testlist", JSON.stringify(this.questions)); | 489 | + localStorage.setItem( |
| 490 | + this.userId + "testlist", | ||
| 491 | + JSON.stringify(this.questions) | ||
| 492 | + ); | ||
| 461 | }, | 493 | }, |
| 462 | // 移除试卷 | 494 | // 移除试卷 |
| 463 | handleDel(item) { | 495 | handleDel(item) { |
| 464 | let _index = this.questions.findIndex((obj) => obj.id === item.id); | 496 | let _index = this.questions.findIndex((obj) => obj.id === item.id); |
| 465 | if (_index !== -1) { | 497 | if (_index !== -1) { |
| 466 | this.questions.splice(_index, 1); // 从索引位置删除一个元素 | 498 | this.questions.splice(_index, 1); // 从索引位置删除一个元素 |
| 467 | - localStorage.setItem("testlist", JSON.stringify(this.questions)); | 499 | + localStorage.setItem( |
| 500 | + this.userId + "testlist", | ||
| 501 | + JSON.stringify(this.questions) | ||
| 502 | + ); | ||
| 468 | } | 503 | } |
| 469 | }, | 504 | }, |
| 470 | // 全部选中 | 505 | // 全部选中 |
| 471 | handleAllTest() { | 506 | handleAllTest() { |
| 472 | // 获取原来的localStorage | 507 | // 获取原来的localStorage |
| 473 | - let list = JSON.parse(localStorage.getItem("testlist")) || []; | 508 | + let list = |
| 509 | + JSON.parse(localStorage.getItem(this.userId + "testlist")) || []; | ||
| 474 | 510 | ||
| 475 | let ids = this.topicList.map((item) => { | 511 | let ids = this.topicList.map((item) => { |
| 476 | return item; | 512 | return item; |
| 477 | }); | 513 | }); |
| 478 | - console.log(list, "-=-11-="); | ||
| 479 | - | ||
| 480 | this.questions = this.removeDuplicates([...ids, ...list]); | 514 | this.questions = this.removeDuplicates([...ids, ...list]); |
| 481 | - localStorage.setItem("testlist", JSON.stringify(this.questions)); | 515 | + localStorage.setItem( |
| 516 | + this.userId + "testlist", | ||
| 517 | + JSON.stringify(this.questions) | ||
| 518 | + ); | ||
| 482 | }, | 519 | }, |
| 483 | // 全部删除 | 520 | // 全部删除 |
| 484 | handleDelTest() { | 521 | handleDelTest() { |
| 485 | let list = this.removeMatchingValues(this.topicList, this.questions); | 522 | let list = this.removeMatchingValues(this.topicList, this.questions); |
| 486 | this.questions = list; | 523 | this.questions = list; |
| 487 | - console.log("移除本业", this.questions); | ||
| 488 | - | ||
| 489 | - localStorage.setItem("testlist", JSON.stringify(this.questions)); | 524 | + localStorage.setItem( |
| 525 | + this.userId + "testlist", | ||
| 526 | + JSON.stringify(this.questions) | ||
| 527 | + ); | ||
| 490 | }, | 528 | }, |
| 491 | // 重置 去除locastorage 以及 questions | 529 | // 重置 去除locastorage 以及 questions |
| 492 | handleRest() { | 530 | handleRest() { |
| 493 | this.questions = []; | 531 | this.questions = []; |
| 494 | - localStorage.setItem("testlist", JSON.stringify(this.questions)); | 532 | + localStorage.setItem( |
| 533 | + this.userId + "testlist", | ||
| 534 | + JSON.stringify(this.questions) | ||
| 535 | + ); | ||
| 495 | }, | 536 | }, |
| 496 | // 去重 | 537 | // 去重 |
| 497 | removeDuplicates(arr) { | 538 | removeDuplicates(arr) { |
| @@ -529,27 +570,17 @@ export default { | @@ -529,27 +570,17 @@ export default { | ||
| 529 | 570 | ||
| 530 | // 获取科目列表 | 571 | // 获取科目列表 |
| 531 | async getSubject(params) { | 572 | async getSubject(params) { |
| 532 | - console.log(params, "params"); | ||
| 533 | - | ||
| 534 | let data = await this.$request.getSubjectList(params); | 573 | let data = await this.$request.getSubjectList(params); |
| 535 | - console.log(data, "--------"); | ||
| 536 | - | ||
| 537 | this.subjectList = data.data.subjectNames; | 574 | this.subjectList = data.data.subjectNames; |
| 538 | - console.log(this.subjectList, "我被打印了"); | ||
| 539 | - | ||
| 540 | this.formData.subjectName = this.subjectList[0]; | 575 | this.formData.subjectName = this.subjectList[0]; |
| 541 | this.getClassList(); | 576 | this.getClassList(); |
| 542 | }, | 577 | }, |
| 543 | // 获取年级列表 | 578 | // 获取年级列表 |
| 544 | async getGradeList() { | 579 | async getGradeList() { |
| 545 | let data = await this.$request.getClassList(); | 580 | let data = await this.$request.getClassList(); |
| 546 | - console.log(data, "----------data"); | ||
| 547 | - | ||
| 548 | this.gradeList = Array.from( | 581 | this.gradeList = Array.from( |
| 549 | new Map(data.data.list.map((item) => [item.grade, item])).values() | 582 | new Map(data.data.list.map((item) => [item.grade, item])).values() |
| 550 | ); | 583 | ); |
| 551 | - console.log(this.gradeList, "gradeList"); | ||
| 552 | - | ||
| 553 | this.formData.grade = this.gradeList[0].grade; | 584 | this.formData.grade = this.gradeList[0].grade; |
| 554 | this.formData.sectionId = this.gradeList[0].section; | 585 | this.formData.sectionId = this.gradeList[0].section; |
| 555 | this.formData.gradeName = this.gradeList.find( | 586 | this.formData.gradeName = this.gradeList.find( |
| @@ -559,8 +590,6 @@ export default { | @@ -559,8 +590,6 @@ export default { | ||
| 559 | }, | 590 | }, |
| 560 | // 获取班级信息 | 591 | // 获取班级信息 |
| 561 | async getClassList() { | 592 | async getClassList() { |
| 562 | - console.log(this.formData, "this.formDate"); | ||
| 563 | - | ||
| 564 | let data = await this.$request.getGradeList({ | 593 | let data = await this.$request.getGradeList({ |
| 565 | grade: this.formData.grade, | 594 | grade: this.formData.grade, |
| 566 | subjectName: this.formData.subjectName, | 595 | subjectName: this.formData.subjectName, |
| @@ -572,7 +601,7 @@ export default { | @@ -572,7 +601,7 @@ export default { | ||
| 572 | }), | 601 | }), |
| 573 | ]; | 602 | ]; |
| 574 | this.formData.classId = null; | 603 | this.formData.classId = null; |
| 575 | - this.getList(); | 604 | + this.getList("type"); |
| 576 | }, | 605 | }, |
| 577 | 606 | ||
| 578 | // 年级改变 | 607 | // 年级改变 |
| @@ -589,29 +618,42 @@ export default { | @@ -589,29 +618,42 @@ export default { | ||
| 589 | this.getClassList(); | 618 | this.getClassList(); |
| 590 | }, | 619 | }, |
| 591 | processString(input) { | 620 | processString(input) { |
| 592 | - // 正则表达式:匹配最多三位数字 | ||
| 593 | - const regex = /^(\d{1,3})/; | ||
| 594 | - | ||
| 595 | - // 测试字符串是否以数字开头 | ||
| 596 | - const match = input.match(regex); | ||
| 597 | - | 621 | + const match = input.match(/^(\d{1,3})/); |
| 598 | if (match) { | 622 | if (match) { |
| 599 | - // 如果匹配,去掉开头的数字并返回剩余部分 | ||
| 600 | - return input.substring(match[0].length + 1).trim(); | 623 | + const matchLength = match[0].length; |
| 624 | + input = input.substring(matchLength + 1).trim(); | ||
| 601 | } | 625 | } |
| 602 | - | ||
| 603 | - // 如果没有匹配,直接返回原字符串 | ||
| 604 | - return input; | 626 | + // 使用正则表达式匹配并处理输入字符串 |
| 627 | + input = input.replace(/[0-9]+[.).]/, ""); | ||
| 628 | + input = input.replace(/(\d+(\.\d+)?分)/g, ""); | ||
| 629 | + return input.trim(); | ||
| 605 | }, | 630 | }, |
| 606 | 631 | ||
| 607 | // 获取ref | 632 | // 获取ref |
| 608 | onIFrameLoad(index) { | 633 | onIFrameLoad(index) { |
| 609 | const iframeRef = this.$refs["iframe" + index][0]; // 获取对应的 iframe | 634 | const iframeRef = this.$refs["iframe" + index][0]; // 获取对应的 iframe |
| 635 | + // const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; | ||
| 636 | + // const body = iframeRef.contentWindow.document.body; | ||
| 637 | + // body.style.overflowX = "hidden"; // 不允许出现横向滚动条 | ||
| 638 | + // const height = body.scrollHeight; // 获取内容的高度 | ||
| 639 | + // iframeRef.style.height = `${height}px`; // 设置 iframe 的高度 | ||
| 640 | + // // 获取第一个P标签 | ||
| 641 | + // const firstP = doc.getElementsByTagName("p")[0]; | ||
| 642 | + // // 或者修改第一个 < p > 标签的内容; | ||
| 643 | + // if (firstP) { | ||
| 644 | + // let a = this.processString(firstP.innerHTML); | ||
| 645 | + // firstP.innerHTML = a; | ||
| 646 | + // } | ||
| 610 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; | 647 | const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; |
| 611 | const body = iframeRef.contentWindow.document.body; | 648 | const body = iframeRef.contentWindow.document.body; |
| 612 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 | 649 | body.style.overflowX = "hidden"; // 不允许出现横向滚动条 |
| 613 | - const height = body.scrollHeight; // 获取内容的高度 | ||
| 614 | - iframeRef.style.height = `${height}px`; // 设置 iframe 的高度 | 650 | + const height = body.offsetHeight; // 获取内容的高度 |
| 651 | + console.log(height, "height"); | ||
| 652 | + // console.log("body.offsetHeight:", body.offsetHeight); | ||
| 653 | + // console.log("body.clientHeight:", body.clientHeight); | ||
| 654 | + // console.log("body.scrollHeight:", body.scrollHeight); | ||
| 655 | + | ||
| 656 | + iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 | ||
| 615 | // 获取第一个P标签 | 657 | // 获取第一个P标签 |
| 616 | const firstP = doc.getElementsByTagName("p")[0]; | 658 | const firstP = doc.getElementsByTagName("p")[0]; |
| 617 | // 或者修改第一个 < p > 标签的内容; | 659 | // 或者修改第一个 < p > 标签的内容; |
| @@ -623,7 +665,8 @@ export default { | @@ -623,7 +665,8 @@ export default { | ||
| 623 | 665 | ||
| 624 | // 子集删除后 父级需要更新 | 666 | // 子集删除后 父级需要更新 |
| 625 | setQuestions() { | 667 | setQuestions() { |
| 626 | - this.questions = JSON.parse(localStorage.getItem("testlist")) || []; | 668 | + this.questions = |
| 669 | + JSON.parse(localStorage.getItem(this.userId + "testlist")) || []; | ||
| 627 | }, | 670 | }, |
| 628 | 671 | ||
| 629 | // 查看解析 | 672 | // 查看解析 |
| @@ -631,6 +674,24 @@ export default { | @@ -631,6 +674,24 @@ export default { | ||
| 631 | this.analysisUrl = url; | 674 | this.analysisUrl = url; |
| 632 | this.analysisVisible = true; | 675 | this.analysisVisible = true; |
| 633 | }, | 676 | }, |
| 677 | + | ||
| 678 | + // 保留两位小数 | ||
| 679 | + formatNumber(num) { | ||
| 680 | + // 检查是否是数字 | ||
| 681 | + if (typeof num !== "number") { | ||
| 682 | + throw new Error("输入必须是数字"); | ||
| 683 | + } | ||
| 684 | + | ||
| 685 | + // 检查小数位数 | ||
| 686 | + const parts = num.toString().split("."); | ||
| 687 | + if (parts.length === 2 && parts[1].length > 2) { | ||
| 688 | + // 如果小数部分超过两位,保留两位小数 | ||
| 689 | + return Math.round(num * 100) / 100; | ||
| 690 | + } else { | ||
| 691 | + // 否则返回原数据 | ||
| 692 | + return num; | ||
| 693 | + } | ||
| 694 | + }, | ||
| 634 | }, | 695 | }, |
| 635 | }; | 696 | }; |
| 636 | </script> | 697 | </script> |
| @@ -675,12 +736,10 @@ export default { | @@ -675,12 +736,10 @@ export default { | ||
| 675 | } | 736 | } |
| 676 | } | 737 | } |
| 677 | .topic { | 738 | .topic { |
| 678 | - height: fit-content; | ||
| 679 | - max-height: 500px; | ||
| 680 | margin-top: 15px; | 739 | margin-top: 15px; |
| 681 | display: flex; | 740 | display: flex; |
| 682 | flex-direction: column; | 741 | flex-direction: column; |
| 683 | - box-shadow: 0px 0px 9px 0px #999999; | 742 | + box-shadow: 0px 0px 9px 0px #cfcfcf; |
| 684 | border-radius: 5px; | 743 | border-radius: 5px; |
| 685 | .topic-title { | 744 | .topic-title { |
| 686 | height: 45px; | 745 | height: 45px; |
| @@ -692,19 +751,14 @@ export default { | @@ -692,19 +751,14 @@ export default { | ||
| 692 | padding: 0 20px; | 751 | padding: 0 20px; |
| 693 | border-radius: 5px 5px 0 0; | 752 | border-radius: 5px 5px 0 0; |
| 694 | } | 753 | } |
| 695 | - .topic-info { | ||
| 696 | - overflow-y: auto; | ||
| 697 | - max-height: 300px; | ||
| 698 | - } | ||
| 699 | .topic-bottom { | 754 | .topic-bottom { |
| 700 | height: 45px; | 755 | height: 45px; |
| 701 | display: flex; | 756 | display: flex; |
| 702 | align-items: center; | 757 | align-items: center; |
| 703 | justify-content: space-between; | 758 | justify-content: space-between; |
| 704 | - margin: 0 20px; | ||
| 705 | font-weight: 600; | 759 | font-weight: 600; |
| 706 | box-sizing: border-box; | 760 | box-sizing: border-box; |
| 707 | - border-top: 1px solid #d2cdcd; | 761 | + border-top: 1px dashed #e0dbdb; |
| 708 | .knowledge { | 762 | .knowledge { |
| 709 | color: rgb(105, 134, 205); | 763 | color: rgb(105, 134, 205); |
| 710 | margin-right: 30px; | 764 | margin-right: 30px; |
| @@ -718,15 +772,14 @@ export default { | @@ -718,15 +772,14 @@ export default { | ||
| 718 | display: flex; | 772 | display: flex; |
| 719 | justify-content: space-between; | 773 | justify-content: space-between; |
| 720 | align-items: center; | 774 | align-items: center; |
| 721 | - border-top: 1px solid #666666; | 775 | + border-top: 1px solid #cfcfcf; |
| 722 | background: #ffffff; | 776 | background: #ffffff; |
| 723 | - box-shadow: 0 0 3px 0 #666666; | ||
| 724 | padding: 5px 20px 0 20px; | 777 | padding: 5px 20px 0 20px; |
| 725 | } | 778 | } |
| 726 | 779 | ||
| 727 | .shopping { | 780 | .shopping { |
| 728 | - width: 40px; | ||
| 729 | - height: 120px; | 781 | + width: 50px; |
| 782 | + height: 135px; | ||
| 730 | position: fixed; | 783 | position: fixed; |
| 731 | top: 30%; | 784 | top: 30%; |
| 732 | right: 0; | 785 | right: 0; |
| @@ -744,13 +797,13 @@ export default { | @@ -744,13 +797,13 @@ export default { | ||
| 744 | text-align: center; | 797 | text-align: center; |
| 745 | cursor: pointer; | 798 | cursor: pointer; |
| 746 | .shopping-select { | 799 | .shopping-select { |
| 747 | - width: 20px; | ||
| 748 | - height: 20px; | 800 | + width: 25px; |
| 801 | + height: 25px; | ||
| 749 | border-radius: 50%; | 802 | border-radius: 50%; |
| 750 | - background: yellow; | ||
| 751 | - color: red; | ||
| 752 | - line-height: 20px; | 803 | + background: #eb5151; |
| 804 | + color: #ffffff; | ||
| 753 | font-size: 12px !important; | 805 | font-size: 12px !important; |
| 806 | + line-height: 25px; | ||
| 754 | } | 807 | } |
| 755 | .size { | 808 | .size { |
| 756 | font-size: 14px !important; | 809 | font-size: 14px !important; |
| @@ -766,6 +819,7 @@ export default { | @@ -766,6 +819,7 @@ export default { | ||
| 766 | margin: 10px 0; | 819 | margin: 10px 0; |
| 767 | display: flex; | 820 | display: flex; |
| 768 | align-items: center; | 821 | align-items: center; |
| 822 | + font-size: 16px !important; | ||
| 769 | } | 823 | } |
| 770 | .button { | 824 | .button { |
| 771 | background: #6b73f5; | 825 | background: #6b73f5; |
| @@ -775,6 +829,7 @@ export default { | @@ -775,6 +829,7 @@ export default { | ||
| 775 | padding: 5px 10px; | 829 | padding: 5px 10px; |
| 776 | border-radius: 5px; | 830 | border-radius: 5px; |
| 777 | margin: 0 8px; | 831 | margin: 0 8px; |
| 832 | + font-size: 16px !important; | ||
| 778 | cursor: pointer; | 833 | cursor: pointer; |
| 779 | white-space: nowrap; | 834 | white-space: nowrap; |
| 780 | width: fit-content; | 835 | width: fit-content; |
| @@ -795,4 +850,15 @@ export default { | @@ -795,4 +850,15 @@ export default { | ||
| 795 | .size { | 850 | .size { |
| 796 | font-size: 14px !important; | 851 | font-size: 14px !important; |
| 797 | } | 852 | } |
| 853 | +.font-weight { | ||
| 854 | + font-weight: 400; | ||
| 855 | +} | ||
| 856 | +.filter-datePicker { | ||
| 857 | + font-size: 16px !important; | ||
| 858 | +} | ||
| 859 | +::v-deep .el-button { | ||
| 860 | + span { | ||
| 861 | + font-size: 16px !important; | ||
| 862 | + } | ||
| 863 | +} | ||
| 798 | </style> | 864 | </style> |
src/views/basic/dataSync/index.vue
| @@ -57,12 +57,12 @@ | @@ -57,12 +57,12 @@ | ||
| 57 | 57 | ||
| 58 | <script> | 58 | <script> |
| 59 | import { formatDate } from "@/utils"; | 59 | import { formatDate } from "@/utils"; |
| 60 | +import conf from "@/config/index"; | ||
| 60 | export default { | 61 | export default { |
| 61 | data() { | 62 | data() { |
| 62 | return { | 63 | return { |
| 63 | role: "", | 64 | role: "", |
| 64 | - downLoading: false, | ||
| 65 | - url: "/api_html/teaching/importData", | 65 | + downLoading: false, |
| 66 | file: {}, | 66 | file: {}, |
| 67 | dialogVisible: false, | 67 | dialogVisible: false, |
| 68 | tipData: { | 68 | tipData: { |
| @@ -82,6 +82,21 @@ export default { | @@ -82,6 +82,21 @@ export default { | ||
| 82 | this.url = "/api_html/personal/importData" | 82 | this.url = "/api_html/personal/importData" |
| 83 | } | 83 | } |
| 84 | }, | 84 | }, |
| 85 | + computed: { | ||
| 86 | + url: function () { | ||
| 87 | + var requestUrl = ''; | ||
| 88 | + var ogrinUrl = "/api_html/teaching/importData"; | ||
| 89 | + var baseUrl = conf.baseURL; | ||
| 90 | + if (baseUrl == '/' && ogrinUrl.indexOf('/') == 0) { | ||
| 91 | + requestUrl = ogrinUrl; | ||
| 92 | + } | ||
| 93 | + else { | ||
| 94 | + requestUrl = baseUrl + ogrinUrl | ||
| 95 | + } | ||
| 96 | + console.log(requestUrl); | ||
| 97 | + return requestUrl; | ||
| 98 | + } | ||
| 99 | + }, | ||
| 85 | methods: { | 100 | methods: { |
| 86 | async downloadFile() { | 101 | async downloadFile() { |
| 87 | if (this.downLoading) return; | 102 | if (this.downLoading) return; |
src/views/personal/dataSync/index.vue
| @@ -58,11 +58,11 @@ | @@ -58,11 +58,11 @@ | ||
| 58 | 58 | ||
| 59 | <script> | 59 | <script> |
| 60 | import { formatDate } from "@/utils"; | 60 | import { formatDate } from "@/utils"; |
| 61 | +import conf from "@/config/index"; | ||
| 61 | export default { | 62 | export default { |
| 62 | data() { | 63 | data() { |
| 63 | return { | 64 | return { |
| 64 | - downLoading: false, | ||
| 65 | - url: "/api_html/personal/importData", | 65 | + downLoading: false, |
| 66 | file: {}, | 66 | file: {}, |
| 67 | dialogVisible: false, | 67 | dialogVisible: false, |
| 68 | tipData: { | 68 | tipData: { |
| @@ -72,6 +72,21 @@ export default { | @@ -72,6 +72,21 @@ export default { | ||
| 72 | }, | 72 | }, |
| 73 | }; | 73 | }; |
| 74 | }, | 74 | }, |
| 75 | + computed: { | ||
| 76 | + url: function () { | ||
| 77 | + var requestUrl = ''; | ||
| 78 | + var ogrinUrl = "/api_html/personal/importData"; | ||
| 79 | + var baseUrl = conf.baseURL; | ||
| 80 | + if (baseUrl == '/' && ogrinUrl.indexOf('/') == 0) { | ||
| 81 | + requestUrl = ogrinUrl; | ||
| 82 | + } | ||
| 83 | + else { | ||
| 84 | + requestUrl = baseUrl + ogrinUrl | ||
| 85 | + } | ||
| 86 | + console.log(requestUrl); | ||
| 87 | + return requestUrl; | ||
| 88 | + } | ||
| 89 | + }, | ||
| 75 | methods: { | 90 | methods: { |
| 76 | async downloadFile() { | 91 | async downloadFile() { |
| 77 | if (this.downLoading) return; | 92 | if (this.downLoading) return; |