Commit 6c2c6735 authored by Facius's avatar Facius

feat: 首页机构id

parent 4e601988
...@@ -96,6 +96,13 @@ let learnApiFun = function(vm) { ...@@ -96,6 +96,13 @@ let learnApiFun = function(vm) {
'/rest/question/query/everyTaskList/' + questionWarehouseId, '/rest/question/query/everyTaskList/' + questionWarehouseId,
params params
) )
// 练习分析
let studyRecord = async (questionWarehouseId, params = {}) =>
await vm.$u.get(
'/rest/question/query/studyRecord/' + questionWarehouseId,
params
)
const learnApi = { const learnApi = {
getQuestion, getQuestion,
getQuestionTotal, getQuestionTotal,
...@@ -119,6 +126,7 @@ let learnApiFun = function(vm) { ...@@ -119,6 +126,7 @@ let learnApiFun = function(vm) {
searchQuestion, searchQuestion,
checkGetQuestion, checkGetQuestion,
everyTaskList, everyTaskList,
studyRecord,
} }
return learnApi return learnApi
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<text v-else>{{ title }}</text> <text v-else>{{ title }}</text>
<u-icon class="icon-view" name="arrow-up-fill"></u-icon> <u-icon class="icon-view" name="arrow-up-fill"></u-icon>
</view> </view>
<view>{{ orgIdText }}</view>
<view v-if="noExam" class="tip-view"> <view v-if="noExam" class="tip-view">
<text>您还未选择题库,请先选择题库</text> <text>您还未选择题库,请先选择题库</text>
</view> </view>
...@@ -128,6 +129,9 @@ export default { ...@@ -128,6 +129,9 @@ export default {
} }
}, },
computed: { computed: {
orgIdText() {
return getApp().globalData.orgId
},
title() { title() {
return this.selected.title || '请选择题库' return this.selected.title || '请选择题库'
}, },
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
> >
<view class="select-area"> <view class="select-area">
<view @click="handleClickArea" class="area-text-view"> <view @click="handleClickArea" class="area-text-view">
<text>{{ currentProvince.label }}</text> <text>{{ currentProvince.label || '请选择' }}</text>
<u-icon name="arrow-down"></u-icon> <u-icon name="arrow-down"></u-icon>
</view> </view>
<view class="loading-view" v-if="loading"> <view class="loading-view" v-if="loading">
......
...@@ -174,18 +174,18 @@ export default { ...@@ -174,18 +174,18 @@ export default {
// }, 500) // }, 500)
}) })
} }
this.queryExamRecord()
this.chartInit() this.chartInit()
this.queryExamRecord()
}, },
methods: { methods: {
chartInit() { chartInit() {
this.chartData.series = [ this.chartData.series = [
{ {
name: '时间轴1', name: '答题数',
pointShape: 'circle', pointShape: 'circle',
legendShape: 'circle', legendShape: 'circle',
data: [ data: [
[10000, 55], [10000, 55], // 【日期, 数值】
[30000, 25], [30000, 25],
[50000, 55], [50000, 55],
[70000, 25], [70000, 25],
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
], ],
}, },
{ {
name: '时间轴2', name: '正确率',
pointShape: 'circle', pointShape: 'circle',
legendShape: 'circle', legendShape: 'circle',
data: [ data: [
...@@ -205,6 +205,7 @@ export default { ...@@ -205,6 +205,7 @@ export default {
], ],
}, },
] ]
this.studyRecord()
}, },
// 每日一练统计 // 每日一练统计
everyTaskList(year, month) { everyTaskList(year, month) {
...@@ -230,6 +231,37 @@ export default { ...@@ -230,6 +231,37 @@ export default {
console.log(err) 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() { queryExamRecord() {
this.recordParams.current += 1 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