dbsd_kczx/src/views/site/studentWdkc/studentDbtx.vue

154 lines
5.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="indexBackClass" id="stuwdkcDom">
<div style="margin-top: 20px;">
<span style="margin-left: 30px;font-size: 24px;font-weight: 600;">工作台</span>
</div>
<a-tabs v-model:activeKey="activeKey" style="padding: 10px;">
<a-tab-pane key="1" tab="待办">
<div style="width: 100%; text-align: right; ">
<RouterLink target='_blank' to="/site/studentWeiduMore">查看更多</RouterLink>
</div>
<div style="min-height:70px;">
<a-row>
<a-col :span="24" style="padding: 0 10px;margin-bottom: 10px;" v-for="(item,index2) in dataSource" :key="index2">
<a-row style="margin-top: 15px;">
<a-col :span="22" style="text-align:left;padding-left:15px;">
<div style="margin-top: 5px;">{{index2+1}}、{{item.content}}</div>
</a-col>
<a-col :span="2" style="text-align:right">
<a-button type="primary" @click="openKecheng(item)" style="margin-left:10px;">查看</a-button>
</a-col>
</a-row>
</a-col>
<a-col :span="24" v-show="dataSource.length == 0" style="text-align: center;">
<span style="line-height:60px;">暂无提醒</span>
</a-col>
</a-row>
</div>
</a-tab-pane>
<a-tab-pane key="2" force-render >
<template #tab>
<span style="color: black;">
已办
</span>
</template>
<div style="width: 100%; text-align: right; ">
<RouterLink target='_blank' to="/site/teacherYiyueMore">查看更多</RouterLink>
</div>
<div style="min-height:70px;">
<a-row>
<a-col :span="24" style="padding: 0 10px;margin-bottom: 10px;" v-for="(item,index2) in dataYySource" :key="index2">
<a-row style="margin-top: 15px;">
<a-col :span="22" style="text-align:left;padding-left:15px;">
<div style="margin-top: 5px;">{{index2+1}}、{{item.content}}</div>
</a-col>
<a-col :span="2" style="text-align:right">
<a-button type="primary" @click="openKecheng(item)" style="margin-left:10px;">已办</a-button>
</a-col>
</a-row>
</a-col>
<a-col :span="24" v-show="dataYySource.length == 0" style="text-align: center;">
<span style="line-height:60px;">暂无提醒</span>
</a-col>
</a-row>
</div>
</a-tab-pane>
</a-tabs>
<!-- <div style="min-height:70px;">
<a-row>
<a-col :span="24" style="padding: 0 10px;margin-bottom: 10px;" v-for="(item,index2) in dataSource" :key="index2">
<a-row style="margin-top: 15px;">
<a-col :span="18" style="text-align:left;padding-left:15px;">
<div>{{index2+1}}{{item.content}}</div>
</a-col>
<a-col :span="6" style="text-align:right">
<span>提醒时间{{item.createTime}}</span>
<a-button type="primary" @click="openKecheng(item)" style="margin-left:10px;">查看</a-button>
</a-col>
</a-row>
</a-col>
<a-col :span="24" v-show="dataSource.length == 0" style="text-align: center;">
<span>暂无通知</span>
</a-col>
</a-row>
</div> -->
</div>
</template>
<script lang="ts" setup>
import { defHttp } from '/@/utils/http/axios';
import { ref, onMounted } from 'vue';
import { getSysConfig } from '/@/views/site/utils/index';
//用户相关
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
const dataSource = ref([]);
const dataYySource = ref([]);
const activeKey = ref('1');
//进入就加载
onMounted(() => {
loaddata()
setInterval(() => {
loaddata()
}, 60*1000);
});
function loaddata(){
// defHttp.get({ url: '/zyDbtx/zyDbtx/list',params:{pageSize:10,pageNo:1,createBy:userStore.getUserInfo.username} }).then((res) => {
// dataSource.value = res.records;
// });
defHttp.get({ url: '/zyDbtx/zyDbtx/list',params:{pageSize:5,pageNo:1,createBy:userStore.getUserInfo.username,flag:'0'} }).then((res) => {
dataSource.value = res.records;
});
defHttp.get({ url: '/zyDbtx/zyDbtx/list',params:{pageSize:5,pageNo:1,createBy:userStore.getUserInfo.username,flag:'1'} }).then((res) => {
dataYySource.value = res.records;
});
}
function openKecheng(record){
//通知类型0发布作业 1评分 2测验 3问卷 4讨论 9通知公告
if(record.type=='9'||record.type=='4'||record.type=='1'){
defHttp.post({ url: '/zyDbtx/zyDbtx/deleteById',params:{id:record.id} }).then((res) => {
loaddata()
});
}
var url = "/stuzy/studentMain";
if(record.type=='0'||record.type=='1'){//当前作业+评分
url = "/stuzy/studentDqzy";
}else if(record.type=='2'){//测验消息
url = "/stuzy/stuCeshiWenjuan";
}else if(record.type=='3'){//问卷消息
url = "/stuzy/stuDcwjWenjuan";
}else if(record.type=='4'){//讨论区
url = "/stuzy/stuTlq";
}else if(record.type=='9'){//通知公告
url = "/stuzy/StudentGonggaoList";
}
url = url +"?rwbh="+record.rwbh+"&xqxn="+getSysConfig().flag1+"&teano="+record.fbr;
window.open(url,'_blank')
}
</script>
<style lang="less" scoped>
.indexBackClass{
background: #fff;
margin: 20px 0;
padding-bottom: 20px;
}
.jtkcTitleClass{
background-image: linear-gradient(to right ,#1c84c6, #67b4e5);
color: white;
line-height: 30px;
padding: 3px 0 0 10px;
font-weight: 600;
height: 30px;
}
</style>