From 91645e9d87249621aa358ef519111ea72679d959 Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期五, 11 十月 2024 13:34:05 +0800 Subject: [PATCH] 修改 --- src/views/onlineEducation/classCertManage/index.vue | 107 ++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 76 insertions(+), 31 deletions(-) diff --git a/src/views/onlineEducation/classCertManage/index.vue b/src/views/onlineEducation/classCertManage/index.vue index 44616d7..a521771 100644 --- a/src/views/onlineEducation/classCertManage/index.vue +++ b/src/views/onlineEducation/classCertManage/index.vue @@ -1,11 +1,18 @@ <template> <div class="app-container"> - <div style="margin-left: -35px;margin-top: 15px"> - <el-button - size="small" - type="primary" - style="margin-bottom: 10px;margin-left: 20px" - >批量导出</el-button> + <div style="margin-left: -20px;margin-top: 15px;display: flex"> + <json-excel + class="export-excel-wrapper" + :data="jsonData" + :fields="json_fields" + type="xls" + name="学时证书.xls"> + <el-button + size="small" + type="primary" + style="margin-bottom: 10px;margin-left: 20px" + >批量导出</el-button> + </json-excel> <el-date-picker v-model="time" size="small" @@ -47,15 +54,15 @@ @click="resetQuery()" >重置</el-button> </div> - <el-table v-loading="loading" :data="expertList" style="margin-top: 10px"> + <el-table v-loading="loading" :data="expertList" style="margin-top: 10px" @selection-change="changeCheckBoxValue"> <el-table-column type="selection" width="55"></el-table-column> <el-table-column label="ID" align="center" prop="id" /> <el-table-column label="姓名" align="center" prop="name" /> - <el-table-column label="身份证号" align="center" prop="idCard" /> + <el-table-column label="身份证号" align="center" prop="idcard" /> <el-table-column label="推送平台" align="center" prop="institutionName" /> <el-table-column label="所属机构" align="center" prop="trainOrgName" /> - <el-table-column label="批次" align="center" prop="batch" /> - <el-table-column label="证书生成时间" align="center" prop="certCreateTime" /> + <el-table-column label="批次" align="center" prop="batchName" /> + <el-table-column label="证书生成时间" align="center" prop="createTime" /> <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <template #default="scope"> <el-button size="mini" type="text" style="color: #1890ff">查看</el-button> @@ -78,11 +85,12 @@ import { listBatch, listQuestion } from '@/api/onlineEducation/student' import { listPlatSelect } from '@/api/onlineEducation/plat' import moment from 'moment/moment' +import JsonExcel from 'vue-json-excel' import { getSubject } from '@/api/onlineEducation/count' export default { name: "nPeopleManage", dicts: [], - components: { }, + components: { JsonExcel }, data() { return { time: [], @@ -93,7 +101,26 @@ addForm: false, total: 0, platformList: [], - expertList: [], + expertList: [ + // { + // id: 1, + // name: 'xxx', + // idcard: 'xxx', + // institutionName: 'xxx', + // trainOrgName: 'xxx', + // batchName: 'xxx', + // createTime: 'xxx' + // }, + // { + // id: 2, + // name: 'xxx', + // idcard: 'xxx', + // institutionName: 'xxx', + // trainOrgName: 'xxx', + // batchName: 'xxx', + // createTime: 'xxx' + // }, + ], queryParams: { pageNum: 1, pageSize: 10, @@ -102,12 +129,25 @@ endTime: '', trainOrgId: '' }, - trainOrgList: [] + trainOrgList: [], + jsonData: [ + + + ], + json_fields: { + ID: "id", + 姓名: "name", + 身份证号: "idcard", + 推送平台: "institutionName", + 所属机构: "trainOrgName", + 批次: "batchName", + 证书生成时间: "createTime", + } }; }, created() { - this.setDate(); - // this.getList(); + // this.setDate(); + this.getList(); this.getPlat(); }, methods: { @@ -125,22 +165,22 @@ this.queryParams.endTime = moment(this.time[1]).format('YYYY-MM-DD') } - this.loading = true; - listBatch( this.queryParams).then((res) => { - if (res.code == 200) { - this.expertList = res.rows.map(item => { - return { - ...item, - trainOrgName: item.trainOrgName ? item.trainOrgName : '--', - startTime: item.startTime ? item.startTime : '--', - endTime: item.endTime ? item.endTime : '--', - category: item.category ? item.category : '--' - } - }) - this.total = res.total - this.loading = false; - } - }) + // this.loading = true; + // listBatch( this.queryParams).then((res) => { + // if (res.code == 200) { + // this.expertList = res.rows.map(item => { + // return { + // ...item, + // trainOrgName: item.trainOrgName ? item.trainOrgName : '--', + // startTime: item.startTime ? item.startTime : '--', + // endTime: item.endTime ? item.endTime : '--', + // category: item.category ? item.category : '--' + // } + // }) + // this.total = res.total + // this.loading = false; + // } + // }) }, getPlat() { listPlatSelect().then((res) => { @@ -149,6 +189,11 @@ } }) }, + changeCheckBoxValue(val) { + console.log('val',val) + this.jsonData = val; + + }, handleChange(){ }, -- Gitblit v1.9.2