diff --git a/src/api/index.js b/src/api/index.js index f316091..4d4670c 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,5 +1,4 @@ import Setting from '@/setting' -let host = 'http://192.168.31.152:8001' let uploadURL = Setting.apiUploadURL export default { @@ -15,9 +14,9 @@ export default { removeVideo: `${uploadURL}/oss/manage/removeVideo`, //查询电话是否存在 - queryProvince: `enterprise/province/queryProvince`, - queryCity: `enterprise/city/queryCity`, - queryClient: `enterprise/client/list`, + queryProvince: `cjEnterprise/province/queryProvince`, + queryCity: `cjEnterprise/city/queryCity`, + queryClient: `cjEnterprise/client/list`, // 个人中心 userinfoUpdate:`management/userInfo/update`, diff --git a/src/assets/img/img.jpg b/src/assets/img/img.jpg deleted file mode 100644 index cbe6c00..0000000 Binary files a/src/assets/img/img.jpg and /dev/null differ diff --git a/src/assets/img/login-input.png b/src/assets/img/login-input.png deleted file mode 100644 index d6166fb..0000000 Binary files a/src/assets/img/login-input.png and /dev/null differ diff --git a/src/mixins/examDo/index.js b/src/mixins/examDo/index.js new file mode 100644 index 0000000..ce160f8 --- /dev/null +++ b/src/mixins/examDo/index.js @@ -0,0 +1,60 @@ +export default { + mounted() { + this.insertScript() + }, + methods: { + initMedia(item){ + if(item.videoAudio && !item.player){ + this.$get(`${this.api.getPlayAuth}/${item.videoAudio}`).then(res => { + let playAuth = res.data.playAuth + this.$nextTick(() => { + item.player = new Aliplayer({ + id: item.mediaEleId, + width: '100%', + autoplay: false, + vid : item.videoAudio, + playauth : playAuth, + encryptType:1, //当播放私有加密流时需要设置。 + }) + }) + }).catch(res => {}) + } + }, + updateProgress(item,isFillBlank){ + let subjects = this.subjects + if(isFillBlank){ + let index = item.getAttribute('data-index') + if([...item.parentElement.querySelectorAll('input')].some(n => n.value)){ + subjects[3][index].hadAnswer = 1 + }else{ + subjects[3][index].hadAnswer = 0 + } + this.fillBlankAnsweredCount = subjects[3].filter(n => n.hadAnswer).length + }else{ + this.singleAnsweredCount = subjects[0].filter(n => n.val).length + this.multipleAnsweredCount = subjects[1].filter(n => n.val.length).length + this.judgeAnsweredCount = subjects[2].filter(n => n.val).length + this.briefAnswerAnsweredCount = subjects[4].filter(n => n.val).length + } + let answered = this.singleAnsweredCount + this.multipleAnsweredCount + this.judgeAnsweredCount + this.fillBlankAnsweredCount + this.briefAnswerAnsweredCount + this.progress = this.totalLen ? Math.floor((answered / this.totalLen * 100)) : 0 + }, + insertScript(){ + const linkTag = document.createElement('link') + linkTag.id = 'aliplayerLink' + linkTag.rel = 'stylesheet' + linkTag.href = 'https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css' + document.body.appendChild(linkTag) + + const scriptTag = document.createElement('script') + scriptTag.id = 'aliplayerScript' + scriptTag.type = 'text/javascript' + scriptTag.src = 'https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js' + document.body.appendChild(scriptTag) + this.$once('hook:beforeDestroy', function () { + document.body.removeChild(document.querySelector('#aliplayerLink')) + document.body.removeChild(document.querySelector('#aliplayerScript')) + }) + }, + } +} \ No newline at end of file diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue index 4263161..8b5bdf3 100644 --- a/src/pages/account/login/index.vue +++ b/src/pages/account/login/index.vue @@ -98,9 +98,9 @@ export default { password: this.loginForm.password } this.login(data).then(() => { - this.$router.replace('/index') - }) - .catch(() => {}) + let redirect = decodeURIComponent(this.$route.query.redirect || '/') + this.$router.replace(redirect) + }).catch(() => {}) } }) }, diff --git a/src/pages/achievement/detail/index.vue b/src/pages/achievement/assessment/index.vue similarity index 59% rename from src/pages/achievement/detail/index.vue rename to src/pages/achievement/assessment/index.vue index 8d9f4fd..aee75c6 100644 --- a/src/pages/achievement/detail/index.vue +++ b/src/pages/achievement/assessment/index.vue @@ -105,7 +105,7 @@ export default { this.getData() }, methods: { - getData() { + getData() { this.$post(`${this.api.answerDetail}?userId=${this.userId}&assessmentId=${this.assessmentId}&paperId=${this.id}`) .then(res => { this.paperName = res.paperName @@ -142,125 +142,5 @@ export default { \ No newline at end of file diff --git a/src/pages/achievement/list/examResults.vue b/src/pages/achievement/list/examResults.vue index b530def..043b88c 100644 --- a/src/pages/achievement/list/examResults.vue +++ b/src/pages/achievement/list/examResults.vue @@ -86,7 +86,7 @@ export default { id: row.paperId, assessmentId: row.id }) - this.$router.push('detail') + this.$router.push('assessment') }, } }; diff --git a/src/pages/achievement/practice/index.vue b/src/pages/achievement/practice/index.vue index 2085103..454c1f9 100644 --- a/src/pages/achievement/practice/index.vue +++ b/src/pages/achievement/practice/index.vue @@ -156,124 +156,5 @@ export default { \ No newline at end of file diff --git a/src/pages/exam/detail/index.vue b/src/pages/exam/detail/index.vue index ebf9e33..05e82f1 100644 --- a/src/pages/exam/detail/index.vue +++ b/src/pages/exam/detail/index.vue @@ -135,125 +135,5 @@ export default { \ No newline at end of file diff --git a/src/pages/exam/do/index.vue b/src/pages/exam/do/index.vue index ea76110..636c87a 100644 --- a/src/pages/exam/do/index.vue +++ b/src/pages/exam/do/index.vue @@ -91,10 +91,11 @@ diff --git a/src/pages/index/list/index.vue b/src/pages/index/list/index.vue index 68859a5..b7c29b8 100644 --- a/src/pages/index/list/index.vue +++ b/src/pages/index/list/index.vue @@ -146,7 +146,7 @@ export default { avgScore: 0, totalDuration: 0, pagePractice: 1, - pageSizePractice: 10, + pageSizePractice: 5, totalPractice: 0, practiceData: [], practiceDateList: [], diff --git a/src/pages/practice/do/index.vue b/src/pages/practice/do/index.vue index 434deed..af2bd94 100644 --- a/src/pages/practice/do/index.vue +++ b/src/pages/practice/do/index.vue @@ -89,11 +89,12 @@ diff --git a/src/pages/practice/randomDo/index.vue b/src/pages/practice/randomDo/index.vue index 6414f37..e841f00 100644 --- a/src/pages/practice/randomDo/index.vue +++ b/src/pages/practice/randomDo/index.vue @@ -84,10 +84,11 @@ diff --git a/src/pages/setting/person/index.vue b/src/pages/setting/person/index.vue index a513f59..dc6b2b7 100644 --- a/src/pages/setting/person/index.vue +++ b/src/pages/setting/person/index.vue @@ -191,7 +191,6 @@
@@ -515,7 +514,6 @@ input:focus { margin-top: 10px; width: 80px; height: 80px; - background: url('../../../assets/img/img.jpg'); border-radius: 50%; .head { diff --git a/src/pages/wrongBook/do/index.vue b/src/pages/wrongBook/do/index.vue index 1359930..f1d2513 100644 --- a/src/pages/wrongBook/do/index.vue +++ b/src/pages/wrongBook/do/index.vue @@ -53,6 +53,7 @@ {{index+1}}.
+
diff --git a/src/router/modules/achievement.js b/src/router/modules/achievement.js index ae06f66..1861dd2 100644 --- a/src/router/modules/achievement.js +++ b/src/router/modules/achievement.js @@ -20,9 +20,9 @@ export default { meta: { title: '我的成绩' } }, { - name: `${pre}detail`, - path: `detail`, - component: () => import('@/pages/achievement/detail'), + name: `${pre}assessment`, + path: `assessment`, + component: () => import('@/pages/achievement/assessment'), meta: { title: '答题详情' } }, { diff --git a/src/router/permission.js b/src/router/permission.js index 7109123..9d34932 100644 --- a/src/router/permission.js +++ b/src/router/permission.js @@ -6,18 +6,13 @@ router.beforeEach((to, from, next) => { document.title = Setting.titleSuffix; const role = util.session.get(Setting.usernameKey); if (!role && to.path !== '/login') { - next('/login'); - } else if (to.meta.permission) { - role === 'admin' ? next() : next('/403'); + next({ + path: '/login', + query: {redirect: to.fullPath} + }) } else if(role && to.path == '/login') { next('/index') } else { - if (navigator.userAgent.indexOf('MSIE') > -1 && to.path === '/editor') { - Vue.prototype.$alert('vue-quill-editor组件不兼容IE10及以下浏览器,请使用更高版本的浏览器查看', '浏览器不兼容通知', { - confirmButtonText: '确定' - }); - } else { - next(); - } - } + next() + } }); \ No newline at end of file diff --git a/src/setting.js b/src/setting.js index 31a33ce..ef5b68d 100644 --- a/src/setting.js +++ b/src/setting.js @@ -49,62 +49,9 @@ const Setting = { /** * 布局配置 * */ - // 侧边菜单宽度,单位 px,不可动态修改,需与 setting.less 的 @menuSideWidth 保持一致 - menuSideWidth: 256, layout: { // 需要隐藏顶栏的页面路径 - hideNavList: ['practice-do','practice-randomDo','setting-person','achievement-detail','achievement-practice','exam-do','exam-detail','wrongBook-do'], - // 侧边栏风格,可选值为 dark 或 light - siderTheme: 'dark', - // 顶栏风格,可选值为 light、dark 或 primary - headerTheme: 'light', - // 顶栏是否置顶,开启后会覆盖侧边栏,需开启 headerFix - headerStick: false, - // 是否开启多 Tabs 页签 - tabs: true, - // 多 Tabs 页签是否显示图标,开启 tabs 时有效 - showTabsIcon: true, - // 是否固定多 Tabs 多页签 - tabsFix: true, - // 是否固定侧边栏 - siderFix: true, - // 是否固定顶栏 - headerFix: true, - // 是否在下滑时隐藏顶栏,需开启 headerFix,如果开启了 tabsFix,Tabs 也会被隐藏 - headerHide: false, - // 是否显示顶部菜单栏 - // 一般来说,侧边的菜单栏足以满足大部分业务,如需动态切换侧边栏,可开启此选项启用顶部一级菜单,此时侧边栏将作为二级菜单 - headerMenu: false, - // 侧边菜单栏是否开启手风琴模式 - menuAccordion: true, - // 是否显示折叠侧边栏按钮,移动端下会自动强制开启 - showSiderCollapse: true, - // 侧边菜单栏是否默认折起 - menuCollapse: false, - // 侧边菜单折起时,是否在子菜单前显示父级菜单名称 - showCollapseMenuTitle: false, - // 是否显示重载按钮 - showReload: true, - // 是否显示搜索 - showSearch: true, - // 是否显示通知 - showNotice: true, - // 是否显示全屏 - showFullscreen: true, - // 在手机访问时,是否在顶部显示小尺寸 logo - showMobileLogo: true, - // 是否显示全局面包屑,开启 headerMenu 时不可用 - showBreadcrumb: true, - // 全局面包屑是否显示图标,开启 showBreadcrumb 时有效 - showBreadcrumbIcon: false, - // 是否显示日志入口,开启与否,不影响日志记录,如不希望用户看到可关闭 - showLog: true, - // 是否显示多语言 - showI18n: true, - // 是否支持动态修改布局配置,移动端下会自动强制关闭 - enableSetting: true, - // 退出登录时,是否二次确认 - logoutConfirm: true + hideNavList: ['practice-do','practice-randomDo','setting-person','achievement-assessment','achievement-practice','exam-do','exam-detail','wrongBook-do'], }, /** * 功能配置 diff --git a/src/styles/pages/testPaperDetail.scss b/src/styles/pages/testPaperDetail.scss new file mode 100644 index 0000000..c99a013 --- /dev/null +++ b/src/styles/pages/testPaperDetail.scss @@ -0,0 +1,95 @@ +.box{ + width: 90%; + margin: 0 auto; +} +.title{ + text-align: center; + font-size: 18px; + font-weight: 600; +} +.metas{ + display: flex; + justify-content: center; + margin: 20px 0 30px; + .name{ + font-size: 12px; + color: #717171; + } + .val{ + font-size: 12px; + color: #929292; + } +} +.tab{ + display: flex; + align-items: center; + margin-bottom: 10px; + li{ + position: relative; + padding: 0 44px; + margin-right: 7px; + font-size: 13px; + line-height: 46px; + text-align: center; + color: #444; + border: 1px solid #ececec; + cursor: pointer; + &:hover{ + opacity: .8; + } + &.active:after{ + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 4px; + background-color: #e80909; + } + } +} +.wrap{ + .item{ + padding-bottom: 30px; + margin-bottom: 30px; + border-bottom: 1px dashed #f4f4f4; + + .key{ + font-weight: bold; + color: #333; + font-size: 14px; + } + .val{ + color: #757575; + font-size: 14px; + } + .answer{ + display: flex; + align-items: center; + padding: 15px; + margin: 15px 0; + font-size: 12px; + border: 1px solid #e8e8e8; + background-color: #f3f2f2; + .info{ + display: inline-flex; + align-items: center; + margin-right: 30px; + } + } + .meta{ + padding-left: 10px; + margin: 20px 0; + font-size: 12px; + &.ans{ + display: flex; + .info{ + margin-right: 20px; + } + } + .key{ + margin-bottom: 5px; + } + } + } +} \ No newline at end of file diff --git a/src/styles/pages/tree.scss b/src/styles/pages/tree.scss index f540890..b51c24a 100644 --- a/src/styles/pages/tree.scss +++ b/src/styles/pages/tree.scss @@ -2,7 +2,6 @@ $insideColor: rgba(245, 242, 255, 0.8); //内部节点的边框颜色 $outColor: rgba(255, 255, 255, 0.8); //外部节点的边框颜色 -//混合代码,提取item共同样式 @mixin public { cursor: pointer; font-size: 14px; @@ -16,91 +15,96 @@ $outColor: rgba(255, 255, 255, 0.8); //外部节点的边框颜色 } } -.side_tree{ - width: 100%; - font-size: 14px; - color: #333; +.side_view{ + height: 600px; + padding: 40px 20px; + background-color: #fff; + overflow: auto; + i{ margin-left: 5px; font-size: 17px; + color: $--color-primary; } span{ margin-left: 5px; font-size: 14px; } -} -.item { - @include public; - width: 100%; - padding: 15px 0; - background:rgba(255,255,255,1); - box-shadow:1px 14px 29px 0px rgba(255,69,69,0.19); - border-radius:10px; - text-align: left; - margin-top: 20px; -} -.empty{ - width: 25px; -} -.item:first{ - margin-top: 0; -} -.item1 { - @include public; - margin-top: 20px; - margin-left: 23px; -} -.item2 { - @include public; - margin-top: 20px; - margin-left:80px -} -.item3 { - @include public; - margin-top: 20px; - margin-left:95px -} -.item2:hover{ - color: $--color-primary; -} -.edit{ - display: inline-block; - width: 17px; - height: 17px; - background: url(../../../assets/svg/edit.svg) 0 0/cover no-repeat; -} -// 使三角形旋转动画 -.arrowTransform { - transition: 0.4s; - transform-origin: center; - transform: rotateZ(0deg); -} -.arrowTransformReturn { - transition: 0.4s; - transform-origin: center; - transform: rotateZ(90deg); -} - -//复选框样式 -.checkBox { - width: 14px; - height: 14px; - border-radius: 7px; - margin-left: 10px; - margin-right: 10px; - border: 2px solid rgba(146, 120, 255, 1); -} - -//当点击复选框时候切换背景图片 -.isActive { - background: url('../../../assets/img/icon-yigouxuan.png'); - background-size: 14px 14px; /*按比例缩放*/ -} + .side_icon{ + text-align: right; + i{ + cursor:pointer; + font-size: 20px; + } + } + .side_tree{ + width: 100%; + font-size: 14px; + color: #333; -.side_icon{ - text-align: right; + .item { + @include public; + width: 100%; + padding: 15px 0; + background:rgba(255,255,255,1); + box-shadow:1px 14px 29px 0px rgba(255,69,69,0.19); + border-radius:10px; + text-align: left; + margin-top: 20px; + } + .empty{ + width: 25px; + } + .item:first{ + margin-top: 0; + } + .item1 { + @include public; + margin-top: 20px; + margin-left: 23px; + } + .item2 { + @include public; + margin-top: 20px; + margin-left:80px + } + .item3 { + @include public; + margin-top: 20px; + margin-left:95px + } + .item2:hover{ + color: $--color-primary; + } + .edit{ + display: inline-block; + width: 17px; + height: 17px; + background: url(../../../assets/svg/edit.svg) 0 0/cover no-repeat; + } + .arrowTransform { + transition: 0.4s; + transform-origin: center; + transform: rotateZ(0deg); + } + .arrowTransformReturn { + transition: 0.4s; + transform-origin: center; + transform: rotateZ(90deg); + } + + .checkBox { + width: 14px; + height: 14px; + border-radius: 7px; + margin-left: 10px; + margin-right: 10px; + border: 2px solid rgba(146, 120, 255, 1); + } + } + &.second{ + .item2{ + margin-left: 50px; + } + } } -.side_icon i{ - cursor:pointer; - font-size: 20px; -} \ No newline at end of file