JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_时间判断跳转
This commit is contained in:
+249
-212
@@ -1,231 +1,268 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="module_title_div">
|
<view class="module_title_div">
|
||||||
<view class="icon icon_1">
|
<view class="icon icon_1">
|
||||||
<!-- <image class="img" :src="icon"></image> -->
|
<!-- <image class="img" :src="icon"></image> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="text font_pf">我的待办</view>
|
<view class="text font_pf">我的待办</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cont-box">
|
<view class="cont-box">
|
||||||
<!-- {{activeDate}} -->
|
<!-- {{activeDate}} -->
|
||||||
<calendarCom ref="calendarComRef" @change="changeDate" />
|
<calendarCom ref="calendarComRef" @change="changeDate" />
|
||||||
<view class="table-list">
|
<view class="table-list">
|
||||||
<todoItem v-for="(item, index) in tableData" :dataInfo="item" :class="index === tableData.length - 1 ? 'last-item' : ''" @click="handleDetail(item)"></todoItem>
|
<todoItem v-for="(item, index) in tableData" :dataInfo="item"
|
||||||
<view class="empty-box" v-show="tableData.length === 0">暂无数据</view>
|
:class="index === tableData.length - 1 ? 'last-item' : ''" @click="handleDetail(item)"></todoItem>
|
||||||
</view>
|
<view class="empty-box" v-show="tableData.length === 0">暂无数据</view>
|
||||||
<view class="more-btn" v-show="showMoreBtn" @click="getMoreData">点击加载更多</view>
|
</view>
|
||||||
</view>
|
<view class="more-btn" v-show="showMoreBtn" @click="getMoreData">点击加载更多</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, computed } from 'vue'
|
import {
|
||||||
import calendarCom from './calendar.vue'
|
ref,
|
||||||
import todoItem from './todo-item.vue'
|
onMounted,
|
||||||
import common from '@/common/common.js'
|
computed
|
||||||
import { queryHaveToDo } from '@/api/index'
|
} from 'vue'
|
||||||
import { queryTraExamPapersByPapersId } from '@/api/examination.js'
|
import calendarCom from './calendar.vue'
|
||||||
import { queryTestPapers, queryOrgTree } from '@/api/competition.js'
|
import todoItem from './todo-item.vue'
|
||||||
import { checkTraPartnerInfoById } from '@/api/sparring.js'
|
import common from '@/common/common.js'
|
||||||
import { queryTraUserAnonyByUserId } from '@/api/user.js'
|
import {
|
||||||
const activeDate = ref('')
|
queryHaveToDo
|
||||||
const tableData = ref([])
|
} from '@/api/index'
|
||||||
const pageObj = ref({
|
import {
|
||||||
totalNum: 0,
|
queryTraExamPapersByPapersId
|
||||||
page: 1,
|
} from '@/api/examination.js'
|
||||||
limit: 10
|
import {
|
||||||
})
|
queryTestPapers,
|
||||||
const calendarComRef = ref(null)
|
queryOrgTree
|
||||||
const changeDate = date => {
|
} from '@/api/competition.js'
|
||||||
activeDate.value = date
|
import {
|
||||||
getDataList(date, 1)
|
checkTraPartnerInfoById
|
||||||
}
|
} from '@/api/sparring.js'
|
||||||
const showMoreBtn = computed(() => {
|
import {
|
||||||
return pageObj.value.totalNum > pageObj.value.page * pageObj.value.limit
|
queryTraUserAnonyByUserId
|
||||||
})
|
} from '@/api/user.js'
|
||||||
const getMoreData = () => {
|
const activeDate = ref('')
|
||||||
pageObj.value.page += 1
|
const tableData = ref([])
|
||||||
getDataList(activeDate.value)
|
const pageObj = ref({
|
||||||
}
|
totalNum: 0,
|
||||||
const initCalendar = () => {
|
page: 1,
|
||||||
calendarComRef.value && calendarComRef.value.initDate()
|
limit: 10
|
||||||
}
|
})
|
||||||
const getDataList = (date, flag) => {
|
const calendarComRef = ref(null)
|
||||||
common.loading()
|
const changeDate = date => {
|
||||||
if (flag === 1) {
|
activeDate.value = date
|
||||||
tableData.value = []
|
getDataList(date, 1)
|
||||||
pageObj.value = {
|
}
|
||||||
totalNum: 0,
|
const showMoreBtn = computed(() => {
|
||||||
page: 1,
|
return pageObj.value.totalNum > pageObj.value.page * pageObj.value.limit
|
||||||
limit: 10
|
})
|
||||||
}
|
const getMoreData = () => {
|
||||||
}
|
pageObj.value.page += 1
|
||||||
queryHaveToDo({
|
getDataList(activeDate.value)
|
||||||
date,
|
}
|
||||||
...pageObj.value
|
const initCalendar = () => {
|
||||||
})
|
calendarComRef.value && calendarComRef.value.initDate()
|
||||||
.then(res => {
|
}
|
||||||
let _arr = res.body || []
|
const getDataList = (date, flag) => {
|
||||||
pageObj.value.totalNum = res.total
|
common.loading()
|
||||||
tableData.value = tableData.value.concat(_arr)
|
if (flag === 1) {
|
||||||
})
|
tableData.value = []
|
||||||
.finally(() => {
|
pageObj.value = {
|
||||||
common.hideLoading()
|
totalNum: 0,
|
||||||
})
|
page: 1,
|
||||||
}
|
limit: 10
|
||||||
const handleDetail = item => {
|
}
|
||||||
console.log(item)
|
}
|
||||||
switch (item.type) {
|
queryHaveToDo({
|
||||||
case '00':
|
date,
|
||||||
common.navigateTo('/pages/courseDetail/index?crsId=' + item.id)
|
...pageObj.value
|
||||||
break
|
})
|
||||||
case '01':
|
.then(res => {
|
||||||
toSparringDetail(item)
|
let _arr = res.body || []
|
||||||
break
|
pageObj.value.totalNum = res.total
|
||||||
case '02':
|
tableData.value = tableData.value.concat(_arr)
|
||||||
toPKDetail(item)
|
})
|
||||||
break
|
.finally(() => {
|
||||||
case '03':
|
common.hideLoading()
|
||||||
toExaminationDetail(item)
|
})
|
||||||
break
|
}
|
||||||
case '04':
|
const handleDetail = item => {
|
||||||
common.setPageCache('learning_tasks_details', {
|
console.log(item)
|
||||||
...item,
|
switch (item.type) {
|
||||||
taskId: item.id,
|
case '00':
|
||||||
taskName: item.name,
|
common.navigateTo('/pages/courseDetail/index?crsId=' + item.id)
|
||||||
taskSums: item.planPersionNumber,
|
break
|
||||||
taskFinishSums: item.realPersionNumber,
|
case '01':
|
||||||
ossAddr: item.ossKey
|
toSparringDetail(item)
|
||||||
})
|
break
|
||||||
common.navigateTo('/pages/learningTasks/details?taskId=' + item.id)
|
case '02':
|
||||||
break
|
toPKDetail(item)
|
||||||
default:
|
break
|
||||||
break
|
case '03':
|
||||||
}
|
toExaminationDetail(item)
|
||||||
}
|
break
|
||||||
// 去PK
|
case '04':
|
||||||
const toPKDetail = async item => {
|
toTaskDetail(item)
|
||||||
const comId = item.id
|
break
|
||||||
common.loading()
|
default:
|
||||||
const result = Promise.all([queryTestPapers({ comId }), queryTraUserAnonyByUserId(), queryOrgTree()])
|
break
|
||||||
result
|
}
|
||||||
.then(res => {
|
}
|
||||||
const papersId = res[0].body
|
const toTaskDetail = (item) => {
|
||||||
common.setPageCache('competition_list', {
|
if (item.limitTyp === '02') {
|
||||||
papersId: papersId, // 试卷id
|
if (item.isTimeOut === '01') {
|
||||||
isAnony: res[1].body.isAnony, // 是否匿名 Y是N否
|
return common.msg('任务未开始');
|
||||||
ruleDesc: item.ruleDesc, // 规则说明
|
} else if (item.isTimeOut === '02') {
|
||||||
comName: item.comName, // 标题
|
return common.msg('任务已结束');
|
||||||
comId: comId
|
}
|
||||||
})
|
}
|
||||||
common.setValue('orgTree', res[2].body ?? [])
|
common.setPageCache('learning_tasks_details', {
|
||||||
common.hideLoading()
|
...item,
|
||||||
common.navigateTo(`/pages/competition/matching?papersId=${papersId}&comId=${comId}`)
|
taskId: item.id,
|
||||||
})
|
taskName: item.name,
|
||||||
.catch(() => {
|
taskSums: item.planPersionNumber,
|
||||||
common.msg('网络繁忙,请稍后再试!')
|
taskFinishSums: item.realPersionNumber,
|
||||||
})
|
ossAddr: item.ossKey
|
||||||
}
|
})
|
||||||
// 去考试
|
common.navigateTo('/pages/learningTasks/details?taskId=' + item.id)
|
||||||
const toExaminationDetail = async item => {
|
}
|
||||||
common.loading()
|
// 去PK
|
||||||
queryTraExamPapersByPapersId({
|
const toPKDetail = async item => {
|
||||||
papersId: item.id
|
console.log(item)
|
||||||
})
|
if (item.isTimeOut !== '00') {
|
||||||
.then(res => {
|
if (item.isTimeOut === '01') common.msg('竞赛未开始');
|
||||||
common.setPageCache('testing_hall_details', res.body)
|
if (item.isTimeOut === '02') common.msg('竞赛已结束');
|
||||||
common.navigateTo('/pages/testingHall/details')
|
return;
|
||||||
})
|
}
|
||||||
.catch(() => {})
|
const comId = item.id
|
||||||
.finally(() => {
|
common.loading()
|
||||||
common.hideLoading()
|
const result = Promise.all([queryTestPapers({
|
||||||
})
|
comId
|
||||||
}
|
}), queryTraUserAnonyByUserId(), queryOrgTree()])
|
||||||
// 跳转 课程详情
|
result
|
||||||
const toSparringDetail = item => {
|
.then(res => {
|
||||||
if (item.id) {
|
const papersId = res[0].body
|
||||||
checkTraPartnerInfoById({
|
common.setPageCache('competition_list', {
|
||||||
traId: item.id
|
papersId: papersId, // 试卷id
|
||||||
}).then(res => {
|
isAnony: res[1].body.isAnony, // 是否匿名 Y是N否
|
||||||
if (res.body.inRange) {
|
ruleDesc: item.ruleDesc, // 规则说明
|
||||||
common.navigateTo('/pages/sparring/detail?traId=' + item.id)
|
comName: item.comName, // 标题
|
||||||
} else {
|
comId: comId
|
||||||
common.show('提示', res.body.message, false)
|
})
|
||||||
}
|
common.setValue('orgTree', res[2].body ?? [])
|
||||||
})
|
common.hideLoading()
|
||||||
}
|
common.navigateTo(`/pages/competition/matching?papersId=${papersId}&comId=${comId}`)
|
||||||
}
|
})
|
||||||
defineExpose({ initCalendar })
|
.catch(() => {
|
||||||
|
common.msg('网络繁忙,请稍后再试!')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 去考试
|
||||||
|
const toExaminationDetail = async item => {
|
||||||
|
common.loading()
|
||||||
|
queryTraExamPapersByPapersId({
|
||||||
|
papersId: item.id
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
common.setPageCache('testing_hall_details', res.body)
|
||||||
|
common.navigateTo('/pages/testingHall/details')
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
.finally(() => {
|
||||||
|
common.hideLoading()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 跳转 课程详情
|
||||||
|
const toSparringDetail = item => {
|
||||||
|
if (item.id) {
|
||||||
|
checkTraPartnerInfoById({
|
||||||
|
traId: item.id
|
||||||
|
}).then(res => {
|
||||||
|
if (res.body.inRange) {
|
||||||
|
common.navigateTo('/pages/sparring/detail?traId=' + item.id)
|
||||||
|
} else {
|
||||||
|
common.show('提示', res.body.message, false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({
|
||||||
|
initCalendar
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
$bg-margin-left: 30rpx;
|
$bg-margin-left: 30rpx;
|
||||||
|
|
||||||
.module_title_div {
|
.module_title_div {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 30rpx $bg-margin-left;
|
margin: 30rpx $bg-margin-left;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
margin-right: 6rpx;
|
margin-right: 6rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon_1 {
|
.icon_1 {
|
||||||
.img {
|
.img {
|
||||||
width: 31rpx;
|
width: 31rpx;
|
||||||
height: 36rpx;
|
height: 36rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon_2 {
|
.icon_2 {
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
|
|
||||||
.img {
|
.img {
|
||||||
width: 38rpx;
|
width: 38rpx;
|
||||||
height: 38rpx;
|
height: 38rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon_3 {
|
.icon_3 {
|
||||||
// margin-top: 10rpx;
|
|
||||||
.img {
|
|
||||||
width: 38rpx;
|
|
||||||
height: 31rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
// margin-top: 10rpx;
|
||||||
font-size: 34rpx;
|
.img {
|
||||||
color: #323e57;
|
width: 38rpx;
|
||||||
font-weight: 700;
|
height: 31rpx;
|
||||||
line-height: 46rpx;
|
}
|
||||||
text-align: left;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.cont-box {
|
.title {
|
||||||
margin: 0 $bg-margin-left;
|
font-size: 34rpx;
|
||||||
background-color: #fff;
|
color: #323e57;
|
||||||
border-radius: 22rpx;
|
font-weight: 700;
|
||||||
padding: 20rpx;
|
line-height: 46rpx;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.table-list {
|
.cont-box {
|
||||||
padding: 16rpx;
|
margin: 0 $bg-margin-left;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 22rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
|
||||||
.last-item {
|
.table-list {
|
||||||
border-bottom: 0 !important;
|
padding: 16rpx;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.more-btn {
|
.last-item {
|
||||||
color: rgb(144, 147, 153);
|
border-bottom: 0 !important;
|
||||||
text-align: center;
|
}
|
||||||
font-size: 23rpx;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-box {
|
.more-btn {
|
||||||
text-align: center;
|
color: rgb(144, 147, 153);
|
||||||
color: #999;
|
text-align: center;
|
||||||
font-size: 24rpx;
|
font-size: 23rpx;
|
||||||
line-height: 120rpx;
|
}
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
.empty-box {
|
||||||
|
text-align: center;
|
||||||
|
color: #999;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 120rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user