mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 11:56:44 +08:00
Merge branch 'third' into preview
This commit is contained in:
42
src/api/boe/courseRecord.js
Normal file
42
src/api/boe/courseRecord.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/**我的授课记录*/
|
||||||
|
import ajax from '@/api/boe/boeApiAjax.js'
|
||||||
|
import axios from 'axios'
|
||||||
|
import { getToken } from '@/utils/token'
|
||||||
|
const baseURL = process.env.VUE_APP_BOE_BASE_API;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出授课记录
|
||||||
|
*
|
||||||
|
* @param {Object} kid
|
||||||
|
*/
|
||||||
|
const courseRecordExport = function(data) {
|
||||||
|
return axios.request({
|
||||||
|
baseURL,
|
||||||
|
url: '/b1/system/teacher/teacher-course-export',
|
||||||
|
method: 'post',
|
||||||
|
data:data,
|
||||||
|
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
|
||||||
|
// return ajax.postJson('/b1/system/teacher/teacher-course-export',data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 授课记录列表
|
||||||
|
*
|
||||||
|
* @param {Object} kid
|
||||||
|
*/
|
||||||
|
const courseRecordList = function(data) {
|
||||||
|
return ajax.postJson('/b1/system/teacher/teacher-course-list',data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
courseRecordExport,
|
||||||
|
courseRecordList
|
||||||
|
|
||||||
|
}
|
||||||
@@ -156,6 +156,29 @@ export function formatDate(date){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function formatDateByFmt(date,fmt) {
|
||||||
|
if(/(y+)/.test(fmt)){
|
||||||
|
fmt = fmt.replace(RegExp.$1,(date.getFullYear()+'').substr(4-RegExp.$1.length));
|
||||||
|
}
|
||||||
|
let o = {
|
||||||
|
'M+':date.getMonth() + 1,
|
||||||
|
'd+':date.getDate(),
|
||||||
|
'h+':date.getHours(),
|
||||||
|
'm+':date.getMinutes(),
|
||||||
|
's+':date.getSeconds()
|
||||||
|
};
|
||||||
|
|
||||||
|
// 遍历这个对象
|
||||||
|
for(let k in o){
|
||||||
|
if(new RegExp(`(${k})`).test(fmt)){
|
||||||
|
// console.log(`${k}`)
|
||||||
|
let str = o[k] + '';
|
||||||
|
fmt = fmt.replace(RegExp.$1,(RegExp.$1.length===1)?str:('00'+str).substr(str.length));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fmt;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 把日期格式化为显示时间,yyyy-MM-dd
|
* 把日期格式化为显示时间,yyyy-MM-dd
|
||||||
* @param {Object} date
|
* @param {Object} date
|
||||||
|
|||||||
@@ -1,104 +1,165 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="padding: 12px 32px 10px 12px;">
|
<div style="padding: 12px 32px 10px 12px;">
|
||||||
<div style="display: flex;justify-content: flex-start;">
|
<div style="display: flex;justify-content: flex-start;">
|
||||||
|
|
||||||
<div style="margin-left:10px"><el-input placeholder="名称关键字" clearable></el-input></div>
|
<div><el-input v-model="keyword" placeholder="输入课程名称搜索" clearable></el-input></div>
|
||||||
<div style="padding-left: 10px;"><el-button type="primary" icon="el-icon-search">搜索</el-button></div>
|
<div style="padding-left: 10px;"><el-button @click="recordList()" type="primary" icon="el-icon-search">搜索</el-button></div>
|
||||||
<div style="padding: 0px 5px;"><el-button icon="el-icon-refresh-right" type="primary" >重置</el-button></div>
|
<div style="padding: 0px 5px;"><el-button icon="el-icon-refresh-right" @click="keyword = ''" type="primary" >重置</el-button></div>
|
||||||
|
<div style="padding: 0px 5px;"><el-button type="primary" @click="exportFile()" icon="el-icon-search" size="small" round>导出</el-button></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="Export">
|
<div class="Export">
|
||||||
<div style="padding-left: 10px;"><el-button type="primary" icon="el-icon-search" size="small" round>导出</el-button></div>
|
<!-- <div style="padding-left: 10px;"><el-button type="primary" @click="exportFile()" icon="el-icon-search" size="small" round>导出</el-button></div> -->
|
||||||
<div style="padding: 0px 5px;"><el-button icon="el-icon-refresh-right" type="primary" size="small" round>导出学员信息</el-button></div>
|
<!-- <div style="padding: 0px 5px;"><el-button icon="el-icon-refresh-right" type="primary" size="small" round>导出学员信息</el-button></div> -->
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top:20px;">
|
<div style="margin-top:20px;">
|
||||||
<el-table :data="pageData" border stripe>
|
<el-table :data="pageData" border stripe>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="课程时间"
|
label="课程时间"
|
||||||
prop="time"
|
prop="courseTime"
|
||||||
width="200px">
|
width="200px">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="课程名称"
|
label="课程名称"
|
||||||
prop="courseName"
|
prop="courseName"
|
||||||
width="200px">
|
width="200px">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="开课场地"
|
label="开课场地"
|
||||||
prop="sysType"
|
prop="address"
|
||||||
width="240px">
|
width="240px">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="所属课程"
|
label="所属课程"
|
||||||
prop="status"
|
prop="parentCourse"
|
||||||
width="120px">
|
width="120px">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="所属项目"
|
label="所属项目"
|
||||||
prop="courseUser"
|
prop="parentProject"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="所属路径"
|
label="所属路径"
|
||||||
prop="auditTime"
|
prop="parentRoute"
|
||||||
width="200px"
|
width="200px"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="学习总人数"
|
label="学习总人数"
|
||||||
prop="auditRemark"
|
prop="studentNumber"
|
||||||
width="100px"
|
width="100px"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="时长(分钟)"
|
label="时长(分钟)"
|
||||||
width="100px"
|
|
||||||
prop="studynum"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="评分"
|
|
||||||
width="100px"
|
width="100px"
|
||||||
prop="pf"
|
prop="period"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="评分"
|
||||||
|
width="100px"
|
||||||
|
prop="score"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
label="操作"
|
label="操作"
|
||||||
align="center"
|
align="center"
|
||||||
width="110px"
|
width="150px"
|
||||||
prop="cz"
|
prop="cz"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
></el-table-column>
|
>
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button type="primary" size="small">导出学员信息</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div style="text-align: center; margin-top:57px">
|
||||||
|
<el-pagination
|
||||||
|
background
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="pageInfo.page"
|
||||||
|
:page-sizes="[10, 20, 30, 40]"
|
||||||
|
:page-size="pageInfo.pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="pageInfo.total"
|
||||||
|
></el-pagination>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import apiCourse from '../../api/boe/courseRecord.js';
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
pageData:[{
|
pageData:[],
|
||||||
time:'2022-10-30 13:00:00',
|
keyword:'',
|
||||||
courseName:'时间管理',
|
pageInfo:{},
|
||||||
sysType:'核心能力大楼培训',
|
|
||||||
status:'管理者课程',
|
|
||||||
courseUser:'管理者进阶-腾飞班K1',
|
|
||||||
auditTime:'产品经理路径管理',
|
|
||||||
auditRemark:'35',
|
|
||||||
studynum:'120',
|
|
||||||
pf:'4.5',
|
|
||||||
cz:'导出学员信息'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
time:'2022-10-30 13:00:00',
|
|
||||||
courseName:'时间管理',
|
|
||||||
sysType:'核心能力大楼培训',
|
|
||||||
status:'管理者课程',
|
|
||||||
courseUser:'管理者进阶-腾飞班K1',
|
|
||||||
auditTime:'产品经理路径管理',
|
|
||||||
auditRemark:'35',
|
|
||||||
studynum:'120',
|
|
||||||
pf:'4.5',
|
|
||||||
cz:'导出学员信息'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.recordList(1);
|
||||||
|
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['userInfo'])
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
exportFile(){
|
||||||
|
let req = {
|
||||||
|
teacherId: this.userInfo.sysId
|
||||||
|
// teacherId:"70F80F4E-34BA-10AB-894A-8FA812B19637"
|
||||||
|
}
|
||||||
|
apiCourse.courseRecordExport(req).then(res=>{
|
||||||
|
const link = document.createElement('a');// 创建a标签
|
||||||
|
let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); // 设置文件类型
|
||||||
|
link.style.display = "none";
|
||||||
|
link.href = URL.createObjectURL(blob); // 创建URL
|
||||||
|
link.setAttribute("download", "授课记录.xls");
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
recordList(pageIndex){
|
||||||
|
let req = {
|
||||||
|
// teacherId:"70F80F4E-34BA-10AB-894A-8FA812B19637",
|
||||||
|
teacherId: this.userInfo.sysId,
|
||||||
|
keyword:this.keyword,
|
||||||
|
page:pageIndex,
|
||||||
|
pageSize:10
|
||||||
|
}
|
||||||
|
apiCourse.courseRecordList(req).then(res=>{
|
||||||
|
if(res.status == 200) {
|
||||||
|
this.pageData = res.result.list;
|
||||||
|
this.pageInfo = res.result.pageInfo;
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: res.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 每页显示的条数事件
|
||||||
|
handleSizeChange(val){
|
||||||
|
this.pageInfo.pageSize = val;
|
||||||
|
this.recordList(1);
|
||||||
|
},
|
||||||
|
// 显示制定页的数据
|
||||||
|
handleCurrentChange(val){
|
||||||
|
this.pageInfo.pageIndex = val;
|
||||||
|
this.recordList(this.pageInfo.pageIndex);
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -107,4 +168,4 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
|
|
||||||
<div class="couresstartTime">
|
<div class="couresstartTime">
|
||||||
<div v-if="cinfo.type == 30">
|
<div v-if="cinfo.type == 30">
|
||||||
<span v-if="startTime">授课时间:{{ cinfo.startTime }}</span>
|
<span v-if="cinfo.startTime">授课时间:{{ cinfo.startTime }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -321,7 +321,7 @@ import scene from "@/api/modules/scene.js";
|
|||||||
import apiUserGroup from "@/api/modules/usergroup.js";
|
import apiUserGroup from "@/api/modules/usergroup.js";
|
||||||
import interactBar from "@/components/Portal/interactBar.vue";
|
import interactBar from "@/components/Portal/interactBar.vue";
|
||||||
import courseImage from "@/components/Course/courseImage.vue";
|
import courseImage from "@/components/Course/courseImage.vue";
|
||||||
import { courseType, getType, toScore,formatDate,formatUserNumber } from "@/utils/tools.js";
|
import { courseType, getType, toScore,formatDate,formatUserNumber,formatDateByFmt } from "@/utils/tools.js";
|
||||||
import { deepClone, param } from "../../../utils";
|
import { deepClone, param } from "../../../utils";
|
||||||
import apiSearchterm from "@/api/modules/searchterm.js";
|
import apiSearchterm from "@/api/modules/searchterm.js";
|
||||||
import apiPlace from "@/api/phase2/place.js"
|
import apiPlace from "@/api/phase2/place.js"
|
||||||
@@ -564,7 +564,7 @@ export default {
|
|||||||
row.checked=false;
|
row.checked=false;
|
||||||
})
|
})
|
||||||
item.checked=true;
|
item.checked=true;
|
||||||
|
|
||||||
this.searchData();
|
this.searchData();
|
||||||
},
|
},
|
||||||
handleOptionClick(item,list){
|
handleOptionClick(item,list){
|
||||||
@@ -806,6 +806,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async search() {
|
async search() {
|
||||||
|
//测试时间格式化
|
||||||
|
// let s=1650973801;
|
||||||
|
// var d = new Date(1650973801*1000);
|
||||||
|
// console.log(formatDateByFmt(d,'yyyy-MM-dd hh:mm'),'data');
|
||||||
|
|
||||||
let that = this;
|
let that = this;
|
||||||
if (this.keyword) {
|
if (this.keyword) {
|
||||||
apiSearchterm.save({ keyword: this.course.keyword, type: 1 });
|
apiSearchterm.save({ keyword: this.course.keyword, type: 1 });
|
||||||
@@ -857,9 +862,10 @@ export default {
|
|||||||
res.result.list.forEach(item => {
|
res.result.list.forEach(item => {
|
||||||
// item.startTime
|
// item.startTime
|
||||||
if(item.startTime != '') {
|
if(item.startTime != '') {
|
||||||
let time = item.startTime.split('-');
|
item.startTime=formatDateByFmt(new Date(item.startTime*1000),'yyyy-MM-dd hh:mm')
|
||||||
item.startTime = `${time[0]}年${time[1]}月${time[2]}日`
|
//let time = item.startTime.split('-');
|
||||||
}
|
//item.startTime = `${time[0]}年${time[1]}月${time[2]}日`
|
||||||
|
}
|
||||||
//教师转化
|
//教师转化
|
||||||
if(item.teacher){
|
if(item.teacher){
|
||||||
let dotIdx=item.teacher.indexOf(',');
|
let dotIdx=item.teacher.indexOf(',');
|
||||||
|
|||||||
Reference in New Issue
Block a user