diff --git a/client/.env.production b/client/.env.production index 8802f8c..4b8949b 100644 --- a/client/.env.production +++ b/client/.env.production @@ -3,4 +3,5 @@ ENV = 'production' # base api VUE_APP_BASE_API = 'https://testsearch.ctc.ac.cn/api' +#VUE_APP_BASE_API = 'http://47.95.0.242:2222/api' diff --git a/client/package.json b/client/package.json index 06ce63b..086cf64 100644 --- a/client/package.json +++ b/client/package.json @@ -17,6 +17,7 @@ "dependencies": { "@riophae/vue-treeselect": "^0.4.0", "axios": "0.18.1", + "echarts": "^5.4.0", "element-china-area-data": "^5.0.2", "element-ui": "2.13.0", "file-saver": "^2.0.2", diff --git a/client/src/api/ability.js b/client/src/api/ability.js index 4f7fe26..d7b9218 100644 --- a/client/src/api/ability.js +++ b/client/src/api/ability.js @@ -155,6 +155,13 @@ export function updateQtask(id,data) { }) } +export function deleteQtask(id) { + return request({ + url:`/ability/qtask/${id}/`, + method:'delete' + }) +} + export function qtaskStart(id) { return request({ url:`/ability/qtask/${id}/start/`, diff --git a/client/src/api/video.js b/client/src/api/video.js index b81335f..491c062 100644 --- a/client/src/api/video.js +++ b/client/src/api/video.js @@ -49,7 +49,7 @@ export function getVideoPlayCode(id) { method: 'get' }) } - +//已弃用 export function getMyView(id, data) { return request({ url: `/vod/video/${id}/myview/`, @@ -57,7 +57,7 @@ export function getMyView(id, data) { data }) } - +//已弃用 export function refreshMyView(id, data) { return request({ url: `/vod/video/${id}/myview/`, @@ -65,3 +65,92 @@ export function refreshMyView(id, data) { data }) } + +//开始播放 +export function videoStart(id) { + return request({ + url: `/vod/video/${id}/start/`, + method: 'get' + }) +} +//观看统计 +export function videoView2(data) { + return request({ + url: `/vod/view2/`, + method: 'get', + data + }) +} +//我的观看统计 +export function myVideoView2(data) { + return request({ + url: `/vod/view2/my/`, + method: 'get', + data + }) +} +//观看记录 +export function viewItem(data) { + return request({ + url: `/vod/viewitem/`, + method: 'get', + data + }) +} +//我的观看记录 +export function myViewItem(data) { + return request({ + url: `/vod/viewitem/my/`, + method: 'get', + data + }) +} +//更新观看记录 +export function refreshViewItem(id, data) { + return request({ + url: `/vod/viewitem/${id}/`, + method: 'put', + data + }) +} + +//本视频的我的观看统计 +export function myView(id) { + return request({ + url: `/vod/video/${id}/my/`, + method: 'get' + }) +} +//播放完成 +export function viewItemComplete(id) { + return request({ + url: `/vod/viewitem/${id}/complete/`, + method: 'get' + }) +} + + +//单位观看量统计 +export function groupByOrgView(data) { + return request({ + url: '/vod/analyse/group_by_org_view/', + method: 'post', + data + }) +} +//个人观看量统计 +export function groupByUserView(data) { + return request({ + url: '/vod/analyse/group_by_user_view/', + method: 'post', + data + }) +} +//视频大类播放量统计 +export function groupByCategoryView(data) { + return request({ + url: '/vod/analyse/group_by_video_category_big/', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/client/src/router/index.js b/client/src/router/index.js index 9be6a5b..1b5c7d5 100644 --- a/client/src/router/index.js +++ b/client/src/router/index.js @@ -300,12 +300,19 @@ export const asyncRoutes = [ meta: { title: '上传视频', perms: ['video_create'] } }, { - path: 'index/:id', - name: 'Index', + path: 'index', + name: 'index', component: () => import('@/views/testvideo/index.vue'), meta: { title: '视频播放', perms: ['video_view'] }, hidden: true }, + { + path: 'videoStatistics', + name: 'videoStatistics', + component: () => import('@/views/testvideo/videoStatistics.vue'), + meta: { title: '视频播放统计', perms: ['video_view'] }, + // hidden: true + }, ] }, { diff --git a/client/src/views/ability/mQualityTask.vue b/client/src/views/ability/mQualityTask.vue index 42e4eb3..35da8ab 100644 --- a/client/src/views/ability/mQualityTask.vue +++ b/client/src/views/ability/mQualityTask.vue @@ -289,11 +289,11 @@ label-position="right" :rules="rule" > - + - - + + - + - - + + 执行 - + >编辑 发布 + 删除 @@ -135,7 +140,7 @@ @@ -188,7 +257,7 @@ color: #333; text-align: center; line-height: 40px; - position: fixed; + position: absolute; width: 100%; z-index: 1010; } @@ -239,4 +308,30 @@ border: 1px solid #e74e4e; border-radius: 15px; } + .viewRecordList{ + display: flex; + flex-direction: column; + } + .viewRecordItemWrap{ + margin: 10px 0; + padding: 5px 0; + border-bottom: 1px solid #dddddd; + } + .recordName{ + font-size: 15px; + font-weight: 600; + color: #333333; + margin-bottom: 10px; + } + .viewInfo{ + font-size: 14px; + color: #a2a2a2; + padding-bottom: 5px; + } + .viewInfo_tiem{ + color:#6090e6 + } + .viewInfo_current{ + color:#86c793 + } diff --git a/client/src/views/testvideo/videoStatistics.vue b/client/src/views/testvideo/videoStatistics.vue new file mode 100644 index 0000000..e293150 --- /dev/null +++ b/client/src/views/testvideo/videoStatistics.vue @@ -0,0 +1,610 @@ + + diff --git a/client/src/views/testvideo/videolist.vue b/client/src/views/testvideo/videolist.vue index 4147db5..0e55a62 100644 --- a/client/src/views/testvideo/videolist.vue +++ b/client/src/views/testvideo/videolist.vue @@ -54,12 +54,12 @@
- {{o.views}} + {{o.views_n}} {{o.viewsp}} + background-color: white;" icon="el-icon-s-custom">{{o.viewsp_n}} @@ -182,7 +182,16 @@ }else{ sessionStorage.removeItem('videoType'); } - this.$router.push({name: "Index", params: {fileid: a.fileid, id: a.id}}) + let routeData = this.$router.resolve({ + path: "/test/index", + query: { + id: a.id + } + }); + + //必要操作,否则不会打开新页面 + window.open(routeData.href, '_blank'); + // this.$router.push({path: "index", query: {fileid: a.fileid, id: a.id}}) } }, }; diff --git a/client_mp/common/http.api.js b/client_mp/common/http.api.js index c8225e3..a9f581b 100644 --- a/client_mp/common/http.api.js +++ b/client_mp/common/http.api.js @@ -50,8 +50,10 @@ const install = (Vue, vm) => { let getExamList = (params={})=>vm.$u.get('/exam/exam/', params);//考试列表 let startExam = (id)=>vm.$u.post(`/exam/exam/${id}/start/`);//开始考试 let submitExam = (id,params={})=>vm.$u.post(`/exam/examrecord/${id}/submit/`,params);//开始考试 - let examRecord = (id,params={})=>vm.$u.get(`/exam/examrecord/self/`,params);//我的考试记录 + let examRecord = (id,params={})=>vm.$u.get(`/exam/examrecord/self/`,params);//我的考试记录 let examRecordDetail = (id,params={})=>vm.$u.get(`/exam/examrecord/${id}/`,params);//我的考试记录 + let paperDetail = (id,params={})=>vm.$u.get(`/exam/paper/${id}/`,params);//测试 + let questionList = (params={})=>vm.$u.get(`/exam/question/`,params);//题目 vm.$u.api = {getUserInfo, getCode, @@ -79,6 +81,8 @@ const install = (Vue, vm) => { startExam, submitExam, examRecord, + paperDetail, + questionList, examRecordDetail }; } diff --git a/client_mp/pages.json b/client_mp/pages.json index 52a5514..f6925b1 100644 --- a/client_mp/pages.json +++ b/client_mp/pages.json @@ -131,6 +131,42 @@ ,{ "path" : "pages/exam/index", "style" : + { + "navigationBarTitleText": "考试", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/exam/test", + "style" : + { + "navigationBarTitleText": "练习", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/exam/question", + "style" : + { + "navigationBarTitleText": "专题练习", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/exam/testDetail", + "style" : + { + "navigationBarTitleText": "练习题目", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/exam/exam", + "style" : { "navigationBarTitleText": "考试列表", "enablePullDownRefresh": false diff --git a/client_mp/pages/exam/erroRrecord.vue b/client_mp/pages/exam/erroRrecord.vue new file mode 100644 index 0000000..02409e3 --- /dev/null +++ b/client_mp/pages/exam/erroRrecord.vue @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/client_mp/pages/exam/exam.vue b/client_mp/pages/exam/exam.vue index 8183fd0..085c88e 100644 --- a/client_mp/pages/exam/exam.vue +++ b/client_mp/pages/exam/exam.vue @@ -1,6 +1,27 @@ @@ -8,11 +29,28 @@ export default { data() { return { - + query:{ + page: 1 + }, + examList: [] } }, + onLoad() { + this.getExamList(); + }, methods: { - + getExamList(){ + this.$u.api.getExamList(this.query).then(res=>{ + this.examList = res.data.results + }) + }, + attendExam(val){ + console.log(val) + uni.setStorageSync('currentExam', val) + uni.navigateTo({ + url:"/pages/exam/preview" + }) + } } } diff --git a/client_mp/pages/exam/index.vue b/client_mp/pages/exam/index.vue index 085c88e..20f0555 100644 --- a/client_mp/pages/exam/index.vue +++ b/client_mp/pages/exam/index.vue @@ -1,27 +1,11 @@ @@ -32,29 +16,79 @@ query:{ page: 1 }, - examList: [] + cellList: [ + {img:'../../static/exam/exam.png',title:'正式考试',id:'exam'}, + {img:'../../static/exam/test.png',title:'模拟测试',id:'test'}, + {img:'../../static/exam/question.png',title:'专题练习',id:'question'}, + {img:'../../static/exam/errorIcon.png',title:'错题记录',id:'record'}, + ] } }, - onLoad() { - this.getExamList(); - }, methods: { - getExamList(){ - this.$u.api.getExamList(this.query).then(res=>{ - this.examList = res.data.results - }) - }, - attendExam(val){ - console.log(val) - uni.setStorageSync('currentExam', val) - uni.navigateTo({ - url:"/pages/exam/preview" - }) + intoPage(item){ + switch (item.id){ + case 'exam': + uni.navigateTo({ + url:"/pages/exam/exam" + }) + break; + case 'test': + uni.navigateTo({ + url:"/pages/exam/test" + }) + break; + case 'question': + uni.navigateTo({ + url:"/pages/exam/question" + }) + break; + case 'erroRrecord': + uni.navigateTo({ + url:"/pages/exam/erroRrecord" + }) + break; + } + } } } diff --git a/client_mp/pages/exam/question.vue b/client_mp/pages/exam/question.vue new file mode 100644 index 0000000..1513a2f --- /dev/null +++ b/client_mp/pages/exam/question.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/client_mp/pages/exam/test.vue b/client_mp/pages/exam/test.vue new file mode 100644 index 0000000..a36599a --- /dev/null +++ b/client_mp/pages/exam/test.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/client_mp/pages/exam/testDetail.vue b/client_mp/pages/exam/testDetail.vue new file mode 100644 index 0000000..95ed8a3 --- /dev/null +++ b/client_mp/pages/exam/testDetail.vue @@ -0,0 +1,294 @@ + + + + + \ No newline at end of file diff --git a/server/temp/570eef2524c1a8e683521a9e16a59039.djcache b/server/temp/570eef2524c1a8e683521a9e16a59039.djcache new file mode 100644 index 0000000..f2514f0 Binary files /dev/null and b/server/temp/570eef2524c1a8e683521a9e16a59039.djcache differ