JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_时间判断跳转

This commit is contained in:
杨航
2026-03-09 20:02:21 +08:00
parent cfb9e6cc04
commit 728194108f
+85 -48
View File
@@ -9,7 +9,8 @@
<!-- {{activeDate}} -->
<calendarCom ref="calendarComRef" @change="changeDate" />
<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"
:class="index === tableData.length - 1 ? 'last-item' : ''" @click="handleDetail(item)"></todoItem>
<view class="empty-box" v-show="tableData.length === 0">暂无数据</view>
</view>
<view class="more-btn" v-show="showMoreBtn" @click="getMoreData">点击加载更多</view>
@@ -17,38 +18,53 @@
</template>
<script setup>
import { ref, onMounted, computed } from 'vue'
import calendarCom from './calendar.vue'
import todoItem from './todo-item.vue'
import common from '@/common/common.js'
import { queryHaveToDo } from '@/api/index'
import { queryTraExamPapersByPapersId } from '@/api/examination.js'
import { queryTestPapers, queryOrgTree } from '@/api/competition.js'
import { checkTraPartnerInfoById } from '@/api/sparring.js'
import { queryTraUserAnonyByUserId } from '@/api/user.js'
const activeDate = ref('')
const tableData = ref([])
const pageObj = ref({
import {
ref,
onMounted,
computed
} from 'vue'
import calendarCom from './calendar.vue'
import todoItem from './todo-item.vue'
import common from '@/common/common.js'
import {
queryHaveToDo
} from '@/api/index'
import {
queryTraExamPapersByPapersId
} from '@/api/examination.js'
import {
queryTestPapers,
queryOrgTree
} from '@/api/competition.js'
import {
checkTraPartnerInfoById
} from '@/api/sparring.js'
import {
queryTraUserAnonyByUserId
} from '@/api/user.js'
const activeDate = ref('')
const tableData = ref([])
const pageObj = ref({
totalNum: 0,
page: 1,
limit: 10
})
const calendarComRef = ref(null)
const changeDate = date => {
})
const calendarComRef = ref(null)
const changeDate = date => {
activeDate.value = date
getDataList(date, 1)
}
const showMoreBtn = computed(() => {
}
const showMoreBtn = computed(() => {
return pageObj.value.totalNum > pageObj.value.page * pageObj.value.limit
})
const getMoreData = () => {
})
const getMoreData = () => {
pageObj.value.page += 1
getDataList(activeDate.value)
}
const initCalendar = () => {
}
const initCalendar = () => {
calendarComRef.value && calendarComRef.value.initDate()
}
const getDataList = (date, flag) => {
}
const getDataList = (date, flag) => {
common.loading()
if (flag === 1) {
tableData.value = []
@@ -70,8 +86,8 @@ const getDataList = (date, flag) => {
.finally(() => {
common.hideLoading()
})
}
const handleDetail = item => {
}
const handleDetail = item => {
console.log(item)
switch (item.type) {
case '00':
@@ -87,6 +103,20 @@ const handleDetail = item => {
toExaminationDetail(item)
break
case '04':
toTaskDetail(item)
break
default:
break
}
}
const toTaskDetail = (item) => {
if (item.limitTyp === '02') {
if (item.isTimeOut === '01') {
return common.msg('任务未开始');
} else if (item.isTimeOut === '02') {
return common.msg('任务已结束');
}
}
common.setPageCache('learning_tasks_details', {
...item,
taskId: item.id,
@@ -96,16 +126,20 @@ const handleDetail = item => {
ossAddr: item.ossKey
})
common.navigateTo('/pages/learningTasks/details?taskId=' + item.id)
break
default:
break
}
}
// 去PK
const toPKDetail = async item => {
// 去PK
const toPKDetail = async item => {
console.log(item)
if (item.isTimeOut !== '00') {
if (item.isTimeOut === '01') common.msg('竞赛未开始');
if (item.isTimeOut === '02') common.msg('竞赛已结束');
return;
}
const comId = item.id
common.loading()
const result = Promise.all([queryTestPapers({ comId }), queryTraUserAnonyByUserId(), queryOrgTree()])
const result = Promise.all([queryTestPapers({
comId
}), queryTraUserAnonyByUserId(), queryOrgTree()])
result
.then(res => {
const papersId = res[0].body
@@ -123,9 +157,9 @@ const toPKDetail = async item => {
.catch(() => {
common.msg('网络繁忙,请稍后再试!')
})
}
// 去考试
const toExaminationDetail = async item => {
}
// 去考试
const toExaminationDetail = async item => {
common.loading()
queryTraExamPapersByPapersId({
papersId: item.id
@@ -138,9 +172,9 @@ const toExaminationDetail = async item => {
.finally(() => {
common.hideLoading()
})
}
// 跳转 课程详情
const toSparringDetail = item => {
}
// 跳转 课程详情
const toSparringDetail = item => {
if (item.id) {
checkTraPartnerInfoById({
traId: item.id
@@ -152,14 +186,16 @@ const toSparringDetail = item => {
}
})
}
}
defineExpose({ initCalendar })
}
defineExpose({
initCalendar
})
</script>
<style lang="scss" scoped>
$bg-margin-left: 30rpx;
$bg-margin-left: 30rpx;
.module_title_div {
.module_title_div {
display: flex;
margin: 30rpx $bg-margin-left;
align-items: center;
@@ -185,6 +221,7 @@ $bg-margin-left: 30rpx;
}
.icon_3 {
// margin-top: 10rpx;
.img {
width: 38rpx;
@@ -199,9 +236,9 @@ $bg-margin-left: 30rpx;
line-height: 46rpx;
text-align: left;
}
}
}
.cont-box {
.cont-box {
margin: 0 $bg-margin-left;
background-color: #fff;
border-radius: 22rpx;
@@ -220,12 +257,12 @@ $bg-margin-left: 30rpx;
text-align: center;
font-size: 23rpx;
}
}
}
.empty-box {
.empty-box {
text-align: center;
color: #999;
font-size: 24rpx;
line-height: 120rpx;
}
}
</style>