mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-09 19:06:45 +08:00
Merge remote-tracking branch 'yx/250605-added-yzt'
This commit is contained in:
@@ -4,10 +4,19 @@
|
||||
:title="modelTitle"
|
||||
:visible="props.isModalVisible"
|
||||
@cancel="onCancel"
|
||||
@ok="onCancel"
|
||||
:footer="null"
|
||||
width="1250px"
|
||||
>
|
||||
<div style="padding: 20px;">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<a-space>
|
||||
<a-button style="width: 60px;height: 32px;background: #4395FF;border-radius: 4px 4px 4px 4px;color: #FFFFFF;" @click="exportClick">导出</a-button>
|
||||
<a-tooltip>
|
||||
<template #title>导出全部数据</template>
|
||||
<a-button style="width: 88px;height: 32px;background: #FFFFFF;border-radius: 4px 4px 4px 4px;border: 1px solid #E6E6E6;color: #333333 ;" @click="exportClickAll">导出全部</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</div>
|
||||
<a-table
|
||||
rowKey="id"
|
||||
:columns="modelColumns"
|
||||
@@ -17,6 +26,10 @@
|
||||
class="custom-table"
|
||||
:loading="data.tableLoading"
|
||||
:rowKey="id"
|
||||
:row-selection="{
|
||||
selectedRowKeys: data.selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => {data.selectedRowKeys=selectedRowKeys},
|
||||
}"
|
||||
>
|
||||
<!-- :loading="tableLoading"-->
|
||||
<template v-slot:header>
|
||||
@@ -55,6 +68,10 @@
|
||||
import { reactive,ref,onMounted } from "vue";
|
||||
import draggable from 'vuedraggable';
|
||||
import * as api from "../../api/indexOvervoew";
|
||||
import downLoad from "../../utils/downLoad";
|
||||
import axios from "axios";
|
||||
import {message} from "ant-design-vue";
|
||||
import Cookies from "vue-cookies";
|
||||
const props = defineProps({
|
||||
isModalVisible: {
|
||||
type: Boolean,
|
||||
@@ -76,7 +93,9 @@ const data = reactive({
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
dataSource: [],
|
||||
tableLoading: false
|
||||
tableLoading: false,
|
||||
selectedRowKeys: [],
|
||||
type:null
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
@@ -86,6 +105,7 @@ onMounted(() => {
|
||||
const getModelColumns = ()=>{
|
||||
if(props.modalType==1){
|
||||
modelTitle.value = '项目'
|
||||
data.type = 21
|
||||
modelColumns.value = [
|
||||
{title: "项目名称", dataIndex: "projectName", key: "projectName", ellipsis: true, align: "center",},
|
||||
{title: "归属组织", dataIndex: "sourceBelongFullName", key: "sourceBelongFullName", ellipsis: true, align: "center",},
|
||||
@@ -107,6 +127,7 @@ const getModelColumns = ()=>{
|
||||
]
|
||||
}else if(props.modalType==2){
|
||||
modelTitle.value = '学习路径'
|
||||
data.type = 22
|
||||
modelColumns.value = [
|
||||
{title: "路径名称", dataIndex: "routerName", key: "routerName", ellipsis: true, align: "center",},
|
||||
{title: "归属组织", dataIndex: "orgFullName", key: "orgFullName", ellipsis: true, align: "center",},
|
||||
@@ -131,6 +152,7 @@ const getModelColumns = ()=>{
|
||||
]
|
||||
}else if(props.modalType==3){
|
||||
modelTitle.value = '面授'
|
||||
data.type = 23
|
||||
modelColumns.value = [
|
||||
{title: "面授名称", dataIndex: "offcourseName", key: "offcourseName", ellipsis: true, align: "center",},
|
||||
{title: "归属组织", dataIndex: "sourceBelongFullName", key: "sourceBelongFullName", ellipsis: true, align: "center",},
|
||||
@@ -141,6 +163,7 @@ const getModelColumns = ()=>{
|
||||
]
|
||||
}else if(props.modalType==4){
|
||||
modelTitle.value = '在线课程'
|
||||
data.type = 24
|
||||
modelColumns.value = [
|
||||
{title: "在线课名称", dataIndex: "courseName", key: "courseName", ellipsis: true, align: "center",},
|
||||
{title: "归属组织", dataIndex: "sourceBelongFullName", key: "sourceBelongFullName", ellipsis: true, align: "center",},
|
||||
@@ -157,6 +180,7 @@ const getModelColumns = ()=>{
|
||||
]
|
||||
}else if(props.modalType==5){
|
||||
modelTitle.value = '考试'
|
||||
data.type = 25
|
||||
modelColumns.value = [
|
||||
{title: "考试名称", dataIndex: "testName", key: "testName", ellipsis: true, align: "center",},
|
||||
{title: "考试时间", dataIndex: "examTime", key: "examTime", ellipsis: true, align: "center",},
|
||||
@@ -173,6 +197,7 @@ const getModelColumns = ()=>{
|
||||
]
|
||||
}else if(props.modalType==6){
|
||||
modelTitle.value = '案例'
|
||||
data.type = 26
|
||||
modelColumns.value = [
|
||||
{title: "案例标题", dataIndex: "caseName", key: "caseName", ellipsis: true, align: "center",},
|
||||
{title: "案例作者", dataIndex: "authorName", key: "authorName", ellipsis: true, align: "center",},
|
||||
@@ -190,6 +215,7 @@ const getModelColumns = ()=>{
|
||||
]
|
||||
}else if(props.modalType==7){
|
||||
modelTitle.value = '专业力'
|
||||
data.type = 27
|
||||
modelColumns.value = [
|
||||
{title: "岗位名称", dataIndex: "stdPositionName", key: "stdPositionName", ellipsis: true, align: "center",},
|
||||
{title: "资格等级", dataIndex: "qualsLevelName", key: "qualsLevelName", ellipsis: true, align: "center",},
|
||||
@@ -263,6 +289,19 @@ const modelChangePagination = (page) =>{
|
||||
data.pageNo = page;
|
||||
getTableData();
|
||||
}
|
||||
|
||||
const exportClick = ()=>{
|
||||
if (!data.selectedRowKeys.length) {
|
||||
return message.warning("请至少选择一条数据进行导出");
|
||||
}else {
|
||||
fetchExportReport({type:data.type, ids:data.selectedRowKeys,id:props.studentId});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const exportClickAll = ()=>{
|
||||
fetchExportReport({type: data.type,id:props.studentId});
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tableBox {
|
||||
|
||||
@@ -1331,6 +1331,7 @@ export default {
|
||||
ellipsis: true,
|
||||
width: 120,
|
||||
align: "center",
|
||||
sorter: true,
|
||||
colSortNo: 19,
|
||||
visible: true,
|
||||
},
|
||||
|
||||
@@ -4,10 +4,19 @@
|
||||
:title="modelTitle"
|
||||
:visible="props.isModalVisible"
|
||||
@cancel="onCancel"
|
||||
@ok="onCancel"
|
||||
:footer="null"
|
||||
width="1250px"
|
||||
>
|
||||
<div style="padding: 20px;">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<a-space>
|
||||
<a-button style="width: 60px;height: 32px;background: #4395FF;border-radius: 4px 4px 4px 4px;color: #FFFFFF;" @click="exportClick">导出</a-button>
|
||||
<a-tooltip>
|
||||
<template #title>导出全部数据</template>
|
||||
<a-button style="width: 88px;height: 32px;background: #FFFFFF;border-radius: 4px 4px 4px 4px;border: 1px solid #E6E6E6;color: #333333 ;" @click="exportClickAll">导出全部</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</div>
|
||||
<a-table
|
||||
rowKey="id"
|
||||
:columns="modelColumns"
|
||||
@@ -16,7 +25,10 @@
|
||||
:pagination="false"
|
||||
class="custom-table"
|
||||
:loading="data.tableLoading"
|
||||
:rowKey="id"
|
||||
:row-selection="{
|
||||
selectedRowKeys: data.selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => {data.selectedRowKeys=selectedRowKeys},
|
||||
}"
|
||||
>
|
||||
<!-- :loading="tableLoading"-->
|
||||
<template v-slot:header>
|
||||
@@ -55,6 +67,10 @@
|
||||
import { reactive,ref,onMounted } from "vue";
|
||||
import draggable from 'vuedraggable';
|
||||
import * as api from "../../api/indexOvervoew";
|
||||
import downLoad from "../../utils/downLoad";
|
||||
import axios from "axios";
|
||||
import {message} from "ant-design-vue";
|
||||
import Cookies from "vue-cookies";
|
||||
const props = defineProps({
|
||||
isModalVisible: {
|
||||
type: Boolean,
|
||||
@@ -80,7 +96,9 @@
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
dataSource: [],
|
||||
tableLoading: false
|
||||
tableLoading: false,
|
||||
selectedRowKeys: [],
|
||||
type:null
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
@@ -92,6 +110,7 @@
|
||||
if(props.reportType=='project'){
|
||||
if(props.secondReportType=='student'){
|
||||
modelTitle.value = '人员'
|
||||
data.type = 8
|
||||
modelColumns.value = [
|
||||
{title: "工号", dataIndex: "studentUserNo",key: "studentUserNo",width: 120,ellipsis: true,},
|
||||
{title: "姓名",dataIndex: "studentName",key: "studentName",width: 120,ellipsis: true,},
|
||||
@@ -118,6 +137,7 @@
|
||||
]
|
||||
}else if(props.secondReportType=='task'){
|
||||
modelTitle.value = '任务'
|
||||
data.type = 7
|
||||
modelColumns.value = [
|
||||
{title: "阶段名称",dataIndex: "stageName",key: "stageName",width: 120,ellipsis: true,},
|
||||
{title: "任务名称",dataIndex: "taskName",key: "taskName",width: 120,ellipsis: true,},
|
||||
@@ -137,6 +157,7 @@
|
||||
}else if(props.reportType=='router'){
|
||||
if(props.secondReportType=='chapter'){
|
||||
modelTitle.value = '关卡'
|
||||
data.type = 9
|
||||
modelColumns.value = [
|
||||
{title: "关卡名称", dataIndex: "chapterName",key: "chapterName",width: 120,ellipsis: true,},
|
||||
{title: "关卡任务总数",dataIndex: "chapterTaskNum",key: "chapterTaskNum",width: 120,ellipsis: true,
|
||||
@@ -160,6 +181,7 @@
|
||||
]
|
||||
}else if(props.secondReportType=='task'){
|
||||
modelTitle.value = '任务'
|
||||
data.type = 10
|
||||
modelColumns.value = [
|
||||
{title: "任务名称",dataIndex: "routerTaskName",key: "routerTaskName",width: 120,ellipsis: true,},
|
||||
{title: "所在关卡",dataIndex: "routerChapterName",key: "routerChapterName",width: 120,ellipsis: true,},
|
||||
@@ -182,6 +204,7 @@
|
||||
]
|
||||
}else if(props.secondReportType=='student'){
|
||||
modelTitle.value = '人员'
|
||||
data.type = 11
|
||||
modelColumns.value = [
|
||||
{title: "工号", dataIndex: "studentUserNo",key: "studentUserNo",width: 120,ellipsis: true,},
|
||||
{title: "姓名",dataIndex: "studentName",key: "studentName",width: 120,ellipsis: true,},
|
||||
@@ -206,7 +229,7 @@
|
||||
}
|
||||
},
|
||||
{title: "当前关卡",dataIndex: "currentChapter",key: "currentChapter",width: 120,ellipsis: true,},
|
||||
{title: "关卡进度",dataIndex: "chapterProgress",key: "chapterProgress",width: 120,ellipsis: true,
|
||||
{title: "关卡进度",dataIndex: "currentChapterProgress",key: "currentChapterProgress",width: 120,ellipsis: true,
|
||||
customRender: (text) => {return !text.value && text.value != 0?'0%':text.value + "%";}
|
||||
},
|
||||
{title: "总任务完成率",dataIndex: "taskCompletedRate",key: "taskCompletedRate",width: 120,ellipsis: true,
|
||||
@@ -230,6 +253,7 @@
|
||||
}else if(props.reportType=='offcourse'){
|
||||
if(props.secondReportType=='teacher'){
|
||||
modelTitle.value = '讲师'
|
||||
data.type = 12
|
||||
modelColumns.value = [
|
||||
{title: "开课次数", dataIndex: "totalCourseNum", key: "totalCourseNum", ellipsis: true, align: "center",
|
||||
customRender: (text) => {return !text.value?'0':text.value;}
|
||||
@@ -247,6 +271,7 @@
|
||||
]
|
||||
}else if(props.secondReportType=='student'){
|
||||
modelTitle.value = '人员'
|
||||
data.type = 13
|
||||
modelColumns.value = [
|
||||
{title: "工号", dataIndex: "studentUserNo",key: "studentUserNo",width: 120,ellipsis: true,},
|
||||
{title: "姓名",dataIndex: "studentName",key: "studentName",width: 120,ellipsis: true,},
|
||||
@@ -283,6 +308,7 @@
|
||||
}else if(props.reportType=='online'){
|
||||
if(props.secondReportType=='content'){
|
||||
modelTitle.value = '课件'
|
||||
data.type = 14
|
||||
modelColumns.value = [
|
||||
{title: "课件名称", dataIndex: "contentName", key: "contentName", ellipsis: true, align: "center",},
|
||||
{title: "归属组织", dataIndex: "sourceBelongFullName", key: "sourceBelongFullName", ellipsis: true, align: "center",},
|
||||
@@ -307,6 +333,7 @@
|
||||
]
|
||||
}else if(props.secondReportType=='student'){
|
||||
modelTitle.value = '人员'
|
||||
data.type = 15
|
||||
modelColumns.value = [
|
||||
{title: "工号", dataIndex: "studentUserNo",key: "studentUserNo",width: 120,ellipsis: true,},
|
||||
{title: "姓名",dataIndex: "studentName",key: "studentName",width: 120,ellipsis: true,},
|
||||
@@ -342,6 +369,7 @@
|
||||
}else if(props.reportType=='exam'){
|
||||
if(props.secondReportType=='student'){
|
||||
modelTitle.value = '人员'
|
||||
data.type = 16
|
||||
modelColumns.value = [
|
||||
{title: "工号", dataIndex: "studentUserNo",key: "studentUserNo",width: 120,ellipsis: true,},
|
||||
{title: "姓名",dataIndex: "studentName",key: "studentName",width: 120,ellipsis: true,},
|
||||
@@ -378,6 +406,7 @@
|
||||
}else if(props.reportType=='case'){
|
||||
if(props.secondReportType=='author'){
|
||||
modelTitle.value = '作者'
|
||||
data.type = 17
|
||||
modelColumns.value = [
|
||||
{title: "案例名称", dataIndex: "caseName", key: "caseName", ellipsis: true, align: "center",},
|
||||
{title: "归属组织", dataIndex: "orgName", key: "orgName", ellipsis: true, align: "center",},
|
||||
@@ -403,6 +432,7 @@
|
||||
}else if(props.reportType=='professional'){
|
||||
if(props.secondReportType=='task'){
|
||||
modelTitle.value = '任务'
|
||||
data.type = 18
|
||||
modelColumns.value = [
|
||||
{title: "任务名称", dataIndex: "taskName", key: "taskName", ellipsis: true, align: "center",},
|
||||
{title: "任务类型", dataIndex: "taskType", key: "taskType", ellipsis: true, align: "center",},
|
||||
@@ -419,6 +449,7 @@
|
||||
]
|
||||
}else if(props.secondReportType=='student'){
|
||||
modelTitle.value = '人员'
|
||||
data.type = 19
|
||||
modelColumns.value = [
|
||||
{title: "工号", dataIndex: "studentUserNo",key: "studentUserNo",width: 120,ellipsis: true,},
|
||||
{title: "姓名",dataIndex: "studentName",key: "studentName",width: 120,ellipsis: true,},
|
||||
@@ -514,6 +545,34 @@
|
||||
console.log(data.pageNo)
|
||||
getTableData();
|
||||
}
|
||||
|
||||
const exportClick = ()=>{
|
||||
if (!data.selectedRowKeys.length) {
|
||||
return message.warning("请至少选择一条数据进行导出");
|
||||
}else {
|
||||
fetchExportReport({type:data.type, ids:data.selectedRowKeys,id:props.currentId});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const exportClickAll = ()=>{
|
||||
fetchExportReport({type: data.type,id:props.currentId});
|
||||
}
|
||||
|
||||
function fetchExportReport(data) {
|
||||
//根据逗号分隔开的id
|
||||
axios({
|
||||
method: "post",
|
||||
url: "/reportsnake/export/report",
|
||||
data: data,
|
||||
responseType: "blob",
|
||||
headers: {
|
||||
token: Cookies.get("token"),
|
||||
},
|
||||
}).then((res) => {
|
||||
downLoad(res.data, modelTitle.value + ".xlsx");
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tableBox {
|
||||
|
||||
Reference in New Issue
Block a user