Commit 6c2c6735 authored by Facius's avatar Facius

feat: 首页机构id

parent 4e601988
......@@ -96,6 +96,13 @@ let learnApiFun = function(vm) {
'/rest/question/query/everyTaskList/' + questionWarehouseId,
params
)
// 练习分析
let studyRecord = async (questionWarehouseId, params = {}) =>
await vm.$u.get(
'/rest/question/query/studyRecord/' + questionWarehouseId,
params
)
const learnApi = {
getQuestion,
getQuestionTotal,
......@@ -119,6 +126,7 @@ let learnApiFun = function(vm) {
searchQuestion,
checkGetQuestion,
everyTaskList,
studyRecord,
}
return learnApi
}
......
......@@ -23,6 +23,7 @@
<text v-else>{{ title }}</text>
<u-icon class="icon-view" name="arrow-up-fill"></u-icon>
</view>
<view>{{ orgIdText }}</view>
<view v-if="noExam" class="tip-view">
<text>您还未选择题库,请先选择题库</text>
</view>
......@@ -128,6 +129,9 @@ export default {
}
},
computed: {
orgIdText() {
return getApp().globalData.orgId
},
title() {
return this.selected.title || '请选择题库'
},
......
......@@ -44,7 +44,7 @@
>
<view class="select-area">
<view @click="handleClickArea" class="area-text-view">
<text>{{ currentProvince.label }}</text>
<text>{{ currentProvince.label || '请选择' }}</text>
<u-icon name="arrow-down"></u-icon>
</view>
<view class="loading-view" v-if="loading">
......
......@@ -174,18 +174,18 @@ export default {
// }, 500)
})
}
this.queryExamRecord()
this.chartInit()
this.queryExamRecord()
},
methods: {
chartInit() {
this.chartData.series = [
{
name: '时间轴1',
name: '答题数',
pointShape: 'circle',
legendShape: 'circle',
data: [
[10000, 55],
[10000, 55], // 【日期, 数值】
[30000, 25],
[50000, 55],
[70000, 25],
......@@ -193,7 +193,7 @@ export default {
],
},
{
name: '时间轴2',
name: '正确率',
pointShape: 'circle',
legendShape: 'circle',
data: [
......@@ -205,6 +205,7 @@ export default {
],
},
]
this.studyRecord()
},
// 每日一练统计
everyTaskList(year, month) {
......@@ -230,6 +231,37 @@ export default {
console.log(err)
})
},
// 练习分析
studyRecord(start, end) {
var params = {}
if (!start || !end) {
// 近七天
end = new Date().getTime()
start = new Date().setDate(new Date().getDay() - 6)
}
console.log(
'---------start---------',
start,
'---------start---------',
end
)
params = {
startDate: this.$u.timeFormat(start, 'yyyy-mm-dd'),
endDate: this.$u.timeFormat(end, 'yyyy-mm-dd'),
}
this.$u.api
.studyRecord(this.questionWarehouseId, params)
.then((res) => {
console.log('----------studyRecord------------', res)
// this.days = []
// for (var item of res) {
// this.days.push(item.time.replace(/\-0/g, '\-'))
// }
})
.catch((err) => {
console.log(err)
})
},
// 模考记录
queryExamRecord() {
this.recordParams.current += 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment