From 34049c5b45d8fb6b224b9e31e92fec2ec406dc4c Mon Sep 17 00:00:00 2001 From: shijing Date: Fri, 25 Nov 2022 14:26:11 +0800 Subject: [PATCH 1/5] videoStatistics --- client/package.json | 1 + client/src/api/video.js | 93 ++- client/src/router/index.js | 11 +- client/src/views/testvideo/index.vue | 163 ++++- .../src/views/testvideo/videoStatistics.vue | 610 ++++++++++++++++++ client/src/views/testvideo/videolist.vue | 15 +- 6 files changed, 852 insertions(+), 41 deletions(-) create mode 100644 client/src/views/testvideo/videoStatistics.vue 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/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/testvideo/index.vue b/client/src/views/testvideo/index.vue index 23b83da..71f1854 100644 --- a/client/src/views/testvideo/index.vue +++ b/client/src/views/testvideo/index.vue @@ -1,6 +1,6 @@ @@ -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}}) } }, }; From 4d0cb487e17eceda66029680e8b827e4c0936e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Mon, 28 Nov 2022 10:13:35 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/.env.production | 1 + client/src/api/ability.js | 7 ++++ client/src/views/ability/mQualityTask.vue | 18 +++++----- client/src/views/ability/qualityTask.vue | 29 ++++++++++++--- client/src/views/ability/qualityTaskDo.vue | 10 ++++-- server/server/settings_dev.py | 34 +++++++++--------- .../570eef2524c1a8e683521a9e16a59039.djcache | Bin 0 -> 48 bytes 7 files changed, 67 insertions(+), 32 deletions(-) create mode 100644 server/temp/570eef2524c1a8e683521a9e16a59039.djcache 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/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/views/ability/mQualityTask.vue b/client/src/views/ability/mQualityTask.vue index e091f75..789e94e 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 @@ + + \ 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..bed06cc 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:'qusetion'}, + {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..02409e3 --- /dev/null +++ b/client_mp/pages/exam/question.vue @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file 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..aae9806 --- /dev/null +++ b/client_mp/pages/exam/testDetail.vue @@ -0,0 +1,294 @@ + + + + + \ No newline at end of file From 821fb53ae982bd92def8d623bb4c72769375a4f7 Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 28 Nov 2022 10:45:56 +0800 Subject: [PATCH 4/5] examTest --- client_mp/pages/exam/testDetail.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client_mp/pages/exam/testDetail.vue b/client_mp/pages/exam/testDetail.vue index aae9806..95ed8a3 100644 --- a/client_mp/pages/exam/testDetail.vue +++ b/client_mp/pages/exam/testDetail.vue @@ -89,8 +89,6 @@ this.scollHeight = res.windowHeight*ratio - 230; this.currentExam = uni.getStorageSync('currentExam'); this.initQuestion(); - this.getpaperDetail(); - }, methods: { handleSubmit(){ @@ -139,6 +137,7 @@ this.currentOptions = options_ }, nextQ(){ + this.showAns = false; let index = this.currentIndex + 1 if(index= 0){ this.currentIndex = index this.initQuestion() From b8c9fce0ccb5c23c587a61d79bf41b6732c183e5 Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 28 Nov 2022 11:13:11 +0800 Subject: [PATCH 5/5] examTest --- client_mp/common/http.api.js | 2 + client_mp/pages.json | 9 ++++ client_mp/pages/exam/index.vue | 2 +- client_mp/pages/exam/question.vue | 69 ++++++++++++++++++++++++++++++- 4 files changed, 80 insertions(+), 2 deletions(-) diff --git a/client_mp/common/http.api.js b/client_mp/common/http.api.js index d83da23..a9f581b 100644 --- a/client_mp/common/http.api.js +++ b/client_mp/common/http.api.js @@ -53,6 +53,7 @@ const install = (Vue, vm) => { 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, @@ -81,6 +82,7 @@ const install = (Vue, vm) => { submitExam, examRecord, paperDetail, + questionList, examRecordDetail }; } diff --git a/client_mp/pages.json b/client_mp/pages.json index e4ee84b..f6925b1 100644 --- a/client_mp/pages.json +++ b/client_mp/pages.json @@ -145,6 +145,15 @@ "enablePullDownRefresh": false } + } + ,{ + "path" : "pages/exam/question", + "style" : + { + "navigationBarTitleText": "专题练习", + "enablePullDownRefresh": false + } + } ,{ "path" : "pages/exam/testDetail", diff --git a/client_mp/pages/exam/index.vue b/client_mp/pages/exam/index.vue index bed06cc..20f0555 100644 --- a/client_mp/pages/exam/index.vue +++ b/client_mp/pages/exam/index.vue @@ -19,7 +19,7 @@ cellList: [ {img:'../../static/exam/exam.png',title:'正式考试',id:'exam'}, {img:'../../static/exam/test.png',title:'模拟测试',id:'test'}, - {img:'../../static/exam/question.png',title:'专题练习',id:'qusetion'}, + {img:'../../static/exam/question.png',title:'专题练习',id:'question'}, {img:'../../static/exam/errorIcon.png',title:'错题记录',id:'record'}, ] } diff --git a/client_mp/pages/exam/question.vue b/client_mp/pages/exam/question.vue index 02409e3..1513a2f 100644 --- a/client_mp/pages/exam/question.vue +++ b/client_mp/pages/exam/question.vue @@ -1,8 +1,75 @@ \ No newline at end of file + .cellWrap{ + display: flex; + flex-direction: column; + margin: auto; + margin-top: 30upx; + margin-bottom: 30upx; + justify-content: space-evenly; + + } +.cellItem{ + text-align: center; + margin-top: 50upx; + width: 60%; + margin-left: 20%; +} + +.cellText{ + height: 60upx; + line-height: 60upx; + text-align: center; + color: #339900; + border: 1px solid #339900; + border-radius: 15rpx; +} + .cellItem:nth-of-type(2) .cellText{ + color: #efb336; + border: 1px solid #efb336; +} + .cellItem:nth-of-type(3) .cellText{ + color: #1296db; + border: 1px solid #1296db; +} +