添加导出功能
This commit is contained in:
parent
b407360c75
commit
a7ed61c34f
|
@ -114,6 +114,75 @@ public class LwKhclController extends JeecgController<LwKhcl, ILwKhclService> {
|
|||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/listAll")
|
||||
public Result<IPage<LwKhcl>> listAll(LwKhcl lwKhcl,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
||||
|
||||
String ktbg = lwKhcl.getKtbg();
|
||||
String zqjc = lwKhcl.getZqjc();
|
||||
String lwzg = lwKhcl.getLwzg();
|
||||
String lwcj = lwKhcl.getBylwCjPar();
|
||||
lwKhcl.setKtbg(null);
|
||||
lwKhcl.setZqjc(null);
|
||||
lwKhcl.setLwzg(null);
|
||||
|
||||
|
||||
QueryWrapper<LwKhcl> queryWrapper = QueryGenerator.initQueryWrapper(lwKhcl, req.getParameterMap());
|
||||
if(StringUtils.isNotBlank(ktbg)){
|
||||
if(StringUtils.equals(ktbg,"1")){
|
||||
queryWrapper.isNotNull("ktbg");
|
||||
}else{
|
||||
queryWrapper.isNull("ktbg");
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(zqjc)){
|
||||
if(StringUtils.equals(zqjc,"1")){
|
||||
queryWrapper.isNotNull("zqjc");
|
||||
}else{
|
||||
queryWrapper.isNull("zqjc");
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(lwzg)){
|
||||
if(StringUtils.equals(lwzg,"1")){
|
||||
queryWrapper.isNotNull("lwzg");
|
||||
}else{
|
||||
queryWrapper.isNull("lwzg");
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(lwcj)){
|
||||
try {
|
||||
if(StringUtils.equals(lwcj,"1")){
|
||||
queryWrapper.ge("bylw_cj",90);
|
||||
}else if(StringUtils.equals(lwcj,"2")){
|
||||
queryWrapper.ge("bylw_cj",80);
|
||||
queryWrapper.lt("bylw_cj",90);
|
||||
}else if(StringUtils.equals(lwcj,"3")){
|
||||
queryWrapper.ge("bylw_cj",70);
|
||||
queryWrapper.lt("bylw_cj",80);
|
||||
}else if(StringUtils.equals(lwcj,"4")){
|
||||
queryWrapper.ge("bylw_cj",60);
|
||||
queryWrapper.lt("bylw_cj",70);
|
||||
}else if(StringUtils.equals(lwcj,"5")){
|
||||
queryWrapper.lt("bylw_cj",60);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
Page<LwKhcl> page = new Page<LwKhcl>(pageNo, pageSize);
|
||||
IPage<LwKhcl> pageList = lwKhclService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
* @param request
|
||||
|
@ -169,6 +238,80 @@ public class LwKhclController extends JeecgController<LwKhcl, ILwKhclService> {
|
|||
return mv;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/expor2tXls")
|
||||
public ModelAndView expor2tXls(HttpServletRequest request, LwKhcl lwKhcl) {
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String ktbg = lwKhcl.getKtbg();
|
||||
String zqjc = lwKhcl.getZqjc();
|
||||
String lwzg = lwKhcl.getLwzg();
|
||||
String lwcj = lwKhcl.getBylwCjPar();
|
||||
lwKhcl.setKtbg(null);
|
||||
lwKhcl.setZqjc(null);
|
||||
lwKhcl.setLwzg(null);
|
||||
|
||||
|
||||
QueryWrapper<LwKhcl> queryWrapper = QueryGenerator.initQueryWrapper(lwKhcl, request.getParameterMap());
|
||||
if(StringUtils.isNotBlank(ktbg)){
|
||||
if(StringUtils.equals(ktbg,"1")){
|
||||
queryWrapper.isNotNull("ktbg");
|
||||
}else{
|
||||
queryWrapper.isNull("ktbg");
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(zqjc)){
|
||||
if(StringUtils.equals(zqjc,"1")){
|
||||
queryWrapper.isNotNull("zqjc");
|
||||
}else{
|
||||
queryWrapper.isNull("zqjc");
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(lwzg)){
|
||||
if(StringUtils.equals(lwzg,"1")){
|
||||
queryWrapper.isNotNull("lwzg");
|
||||
}else{
|
||||
queryWrapper.isNull("lwzg");
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(lwcj)){
|
||||
try {
|
||||
if(StringUtils.equals(lwcj,"1")){
|
||||
queryWrapper.ge("bylw_cj",90);
|
||||
}else if(StringUtils.equals(lwcj,"2")){
|
||||
queryWrapper.ge("bylw_cj",80);
|
||||
queryWrapper.lt("bylw_cj",90);
|
||||
}else if(StringUtils.equals(lwcj,"3")){
|
||||
queryWrapper.ge("bylw_cj",70);
|
||||
queryWrapper.lt("bylw_cj",80);
|
||||
}else if(StringUtils.equals(lwcj,"4")){
|
||||
queryWrapper.ge("bylw_cj",60);
|
||||
queryWrapper.lt("bylw_cj",70);
|
||||
}else if(StringUtils.equals(lwcj,"5")){
|
||||
queryWrapper.lt("bylw_cj",60);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
List<LwKhcl> exportList = lwKhclService.list(queryWrapper);
|
||||
//此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "论文考核材料列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, LwKhcl.class);
|
||||
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
||||
ExportParams exportParams=new ExportParams("论文考核材料", "导出人:" + sysUser.getRealname(), "sheet1");
|
||||
exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload());
|
||||
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
||||
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
|
|
|
@ -32,29 +32,45 @@ public class LwKhcl implements Serializable {
|
|||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
|
||||
|
||||
@Excel(name = "院系名称", width = 25)
|
||||
@ApiModelProperty(value = "院系名称")
|
||||
private String ssyxmc;
|
||||
|
||||
@Excel(name = "校内专业", width = 35)
|
||||
@ApiModelProperty(value = "校内专业")
|
||||
private String ssxnzymc;
|
||||
|
||||
@Excel(name = "学生学号", width = 35)
|
||||
@ApiModelProperty(value = "学生学号")
|
||||
private String xsxh;
|
||||
|
||||
@Excel(name = "学生姓名", width = 35)
|
||||
@ApiModelProperty(value = "学生姓名")
|
||||
private String xsxm;
|
||||
|
||||
@Excel(name = "论文题目", width = 35)
|
||||
@ApiModelProperty(value = "论文题目")
|
||||
private String bylwTm;
|
||||
|
||||
@Excel(name = "指导教师姓名", width = 35)
|
||||
@ApiModelProperty(value = "指导教师姓名")
|
||||
private String zdjsxm;
|
||||
|
||||
@Excel(name = "职称", width = 35)
|
||||
@ApiModelProperty(value = "职称")
|
||||
private String zdjszc;
|
||||
|
||||
@Excel(name = "毕业年份", width = 15)
|
||||
@ApiModelProperty(value = "毕业年份")
|
||||
private String bynf;
|
||||
|
||||
@Excel(name = "所属院系名称", width = 25)
|
||||
@ApiModelProperty(value = "所属院系名称")
|
||||
private String ssyxmc;
|
||||
|
||||
@Excel(name = "所属校内专业(大类)名称", width = 35)
|
||||
@ApiModelProperty(value = "所属校内专业(大类)名称")
|
||||
private String ssxnzymc;
|
||||
|
||||
@ApiModelProperty(value = "学生学号")
|
||||
private String xsxh;
|
||||
|
||||
@ApiModelProperty(value = "学生姓名")
|
||||
private String xsxm;
|
||||
|
||||
@ApiModelProperty(value = "班级")
|
||||
private String bj;
|
||||
|
||||
@ApiModelProperty(value = "毕业论文(设计)题目")
|
||||
private String bylwTm;
|
||||
|
||||
@ApiModelProperty(value = "毕业论文(设计)类别")
|
||||
private String bylwLb;
|
||||
|
@ -62,11 +78,6 @@ public class LwKhcl implements Serializable {
|
|||
@ApiModelProperty(value = "毕业论文(设计)成绩")
|
||||
private String bylwCj;
|
||||
|
||||
@ApiModelProperty(value = "指导教师姓名")
|
||||
private String zdjsxm;
|
||||
|
||||
@ApiModelProperty(value = "指导教师职称")
|
||||
private String zdjszc;
|
||||
|
||||
@ApiModelProperty(value = "是否实现电子化管理")
|
||||
private String sfsxdzhgl;
|
||||
|
|
|
@ -141,7 +141,79 @@ public class LwKhclXzController extends JeecgController<LwKhclXz, ILwKhclXzServi
|
|||
IPage<LwKhclXz> pageList = lwKhclXzService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping(value = "/listAll")
|
||||
public Result<IPage<LwKhclXz>> listAll(LwKhclXz lwKhclXz,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
||||
String ktbg = lwKhclXz.getKtbg();
|
||||
String zqjc = lwKhclXz.getZqjc();
|
||||
String lwzg = lwKhclXz.getLwzg();
|
||||
String lwcj = lwKhclXz.getBylwCjPar();
|
||||
lwKhclXz.setKtbg(null);
|
||||
lwKhclXz.setZqjc(null);
|
||||
lwKhclXz.setLwzg(null);
|
||||
|
||||
|
||||
QueryWrapper<LwKhclXz> queryWrapper = QueryGenerator.initQueryWrapper(lwKhclXz, req.getParameterMap());
|
||||
if(StringUtils.isNotBlank(ktbg)){
|
||||
if(StringUtils.equals(ktbg,"1")){
|
||||
queryWrapper.isNotNull("ktbg");
|
||||
}else{
|
||||
queryWrapper.isNull("ktbg");
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(zqjc)){
|
||||
if(StringUtils.equals(zqjc,"1")){
|
||||
queryWrapper.isNotNull("zqjc");
|
||||
}else{
|
||||
queryWrapper.isNull("zqjc");
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(lwzg)){
|
||||
if(StringUtils.equals(lwzg,"1")){
|
||||
queryWrapper.isNotNull("lwzg");
|
||||
}else{
|
||||
queryWrapper.isNull("lwzg");
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(lwcj)){
|
||||
try {
|
||||
if(StringUtils.equals(lwcj,"1")){
|
||||
queryWrapper.ge("bylw_cj",90);
|
||||
}else if(StringUtils.equals(lwcj,"2")){
|
||||
queryWrapper.ge("bylw_cj",80);
|
||||
queryWrapper.lt("bylw_cj",90);
|
||||
}else if(StringUtils.equals(lwcj,"3")){
|
||||
queryWrapper.ge("bylw_cj",70);
|
||||
queryWrapper.lt("bylw_cj",80);
|
||||
}else if(StringUtils.equals(lwcj,"4")){
|
||||
queryWrapper.ge("bylw_cj",60);
|
||||
queryWrapper.lt("bylw_cj",70);
|
||||
}else if(StringUtils.equals(lwcj,"5")){
|
||||
queryWrapper.lt("bylw_cj",60);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Page<LwKhclXz> page = new Page<LwKhclXz>(pageNo, pageSize);
|
||||
IPage<LwKhclXz> pageList = lwKhclXzService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
|
|
|
@ -5,12 +5,14 @@ const { createConfirm } = useMessage();
|
|||
|
||||
enum Api {
|
||||
list = '/lwKhclXz/lwKhclXz/list',
|
||||
listAll = '/lwKhcl/lwKhcl/listAll',
|
||||
save='/lwKhclXz/lwKhclXz/add',
|
||||
edit='/lwKhclXz/lwKhclXz/edit',
|
||||
deleteOne = '/lwKhclXz/lwKhclXz/delete',
|
||||
deleteBatch = '/lwKhclXz/lwKhclXz/deleteBatch',
|
||||
importExcel = '/lwKhclXz/lwKhclXz/importExcel',
|
||||
exportXls = '/lwKhclXz/lwKhclXz/exportXls',
|
||||
export2Xls = '/lwKhcl/lwKhcl/expor2tXls',
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -18,6 +20,7 @@ enum Api {
|
|||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
export const getExport2Url = Api.export2Xls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
|
@ -29,6 +32,7 @@ export const getImportUrl = Api.importExcel;
|
|||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
export const listAll = (params) => defHttp.get({ url: Api.listAll, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
|
|
|
@ -0,0 +1,433 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form
|
||||
ref="formRef3"
|
||||
@keyup.enter.native="searchQuery"
|
||||
:model="queryParam"
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol"
|
||||
class="query-criteria"
|
||||
>
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="ssyxmc">
|
||||
<template #label><span title="院系名称">院系名称</span></template>
|
||||
<j-input placeholder="请输入院系名称" v-model:value="queryParam.ssyxmc" allow-clear></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="ssxnzymc">
|
||||
<template #label><span title="校内专业">校内专业</span></template>
|
||||
<j-input placeholder="请输入校内专业" v-model:value="queryParam.ssxnzymc" allow-clear></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="xsxh">
|
||||
<template #label><span title="学生学号">学生学号</span></template>
|
||||
<j-input placeholder="请输入学生学号" v-model:value="queryParam.xsxh" allow-clear></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="xsxm">
|
||||
<template #label><span title="学生姓名">学生姓名</span></template>
|
||||
<j-input placeholder="请输入学生姓名" v-model:value="queryParam.xsxm" allow-clear></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="bylwTm">
|
||||
<template #label><span title="论文题目">论文题目</span></template>
|
||||
<j-input placeholder="请输入学生姓名" v-model:value="queryParam.bylwTm" allow-clear></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="bylwCj">
|
||||
<template #label><span title="论文成绩">论文成绩</span></template>
|
||||
<a-select placeholder="请选择论文成绩" v-model:value="queryParam.bylwCjPar">
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option value="1">优秀</a-select-option>
|
||||
<a-select-option value="2">良好</a-select-option>
|
||||
<a-select-option value="3">中等</a-select-option>
|
||||
<a-select-option value="4">及格</a-select-option>
|
||||
<a-select-option value="5">不及格</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" style="text-align: right">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls" style="margin-left: 8px"> 导出</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" class="table-style">
|
||||
<template #tableTitle> </template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="lwKhclXz-lwKhclXz" setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { columns, columns2, columns3, superQuerySchema } from './LwKhclXz.data';
|
||||
import { listAll, deleteOne, deleteXkxxOne, batchDelete, getImportUrl, getExport2Url } from './LwKhclXz.api';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { downloadFile, downloadFileLoacl } from '/@/utils/common/renderUtils';
|
||||
import { getFileAccessHttpUrl } from '@/utils/common/compUtils';
|
||||
import { encryptByBase64 } from '@/utils/cipher';
|
||||
import JInput from '/@/components/Form/src/jeecg/components/JInput.vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useGlobSetting } from '/@/hooks/setting';
|
||||
|
||||
const globSetting = useGlobSetting();
|
||||
const baseApiUrl = globSetting.domainUrl;
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
const queryParam2 = ref<any>({});
|
||||
const emit = defineEmits(['callback']);
|
||||
const checkData = ref<any>([]);
|
||||
const dataList = ref<any>([]);
|
||||
const sfxk = ref<number>(0);
|
||||
const lwinfo = reactive<any>({});
|
||||
const docUrl = ref<string>('');
|
||||
const activeKey = ref('1');
|
||||
const ktbgUrl = ref<string>('');
|
||||
const ktbgshyjUrl = ref<string>('');
|
||||
const zqjcUrl = ref<string>('');
|
||||
const lwzgUrl = ref<string>('');
|
||||
const zdjldUrl = ref<string>('');
|
||||
const jcbgUrl = ref<string>('');
|
||||
|
||||
let onlinePreviewDomain = '';
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
api: listAll,
|
||||
columns: columns3,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
showActionColumn: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: '论文考核材料',
|
||||
url: getExport2Url,
|
||||
params: queryParam,
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }] = tableContext;
|
||||
//批量下载
|
||||
async function batchHandleDown(record) {
|
||||
console.log('🙍♂️', record);
|
||||
// 毕业论文-学院-专业-学生姓名-学号
|
||||
var downName =
|
||||
'毕业论文-' +
|
||||
record.value.ssyxmc +
|
||||
'-' +
|
||||
(record.value.ssxnzymc ? record.value.ssxnzymc : '') +
|
||||
'-' +
|
||||
record.value.xsxm +
|
||||
'-' +
|
||||
record.value.xsxh +
|
||||
'';
|
||||
var params = { id: record.value.id, downName };
|
||||
console.log('🕵', params);
|
||||
defHttp.post({ url: '/lwKhclXz/lwKhclXz/getLwBatchDown', params: { id: record.value.id, downName } }).then((res) => {
|
||||
console.log('---------', res);
|
||||
downloadFileLoacl(res.downLoadPath);
|
||||
});
|
||||
}
|
||||
//下载
|
||||
function handleDownload(record) {
|
||||
downloadFile(record);
|
||||
}
|
||||
//预览
|
||||
function handleYulan(record) {
|
||||
console.log('😶', record);
|
||||
var file = getFileAccessHttpUrl(record);
|
||||
window.open('https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file)));
|
||||
}
|
||||
//查看论文材料
|
||||
async function handleChakan(record) {
|
||||
lwinfo.value = record;
|
||||
sfxk.value = 2;
|
||||
|
||||
if (lwinfo.value.ktbg) {
|
||||
var file1 = getFileAccessHttpUrl(record.ktbg);
|
||||
ktbgUrl.value = 'https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1));
|
||||
} else {
|
||||
ktbgUrl.value = '';
|
||||
}
|
||||
|
||||
if (lwinfo.value.ktbgshyj) {
|
||||
var file1 = getFileAccessHttpUrl(record.ktbgshyj);
|
||||
ktbgshyjUrl.value = 'https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1));
|
||||
} else {
|
||||
ktbgshyjUrl.value = '';
|
||||
}
|
||||
|
||||
if (lwinfo.value.zqjc) {
|
||||
var file1 = getFileAccessHttpUrl(record.zqjc);
|
||||
zqjcUrl.value = 'https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1));
|
||||
} else {
|
||||
zqjcUrl.value = '';
|
||||
}
|
||||
|
||||
if (lwinfo.value.lwzg) {
|
||||
var file1 = getFileAccessHttpUrl(record.lwzg);
|
||||
lwzgUrl.value = 'https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1));
|
||||
} else {
|
||||
lwzgUrl.value = '';
|
||||
}
|
||||
|
||||
if (lwinfo.value.zdjld) {
|
||||
var file1 = getFileAccessHttpUrl(record.zdjld);
|
||||
zdjldUrl.value = 'https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1));
|
||||
} else {
|
||||
zdjldUrl.value = '';
|
||||
}
|
||||
|
||||
if (lwinfo.value.ccjg) {
|
||||
jcbgUrl.value = record.ccjg;
|
||||
} else {
|
||||
jcbgUrl.value = '';
|
||||
}
|
||||
}
|
||||
|
||||
const getViewFileDomain = () => defHttp.get({ url: '/sys/comment/getFileViewDomain' });
|
||||
/**
|
||||
* 初始化domain
|
||||
*/
|
||||
async function initViewDomain() {
|
||||
if (!onlinePreviewDomain) {
|
||||
onlinePreviewDomain = await getViewFileDomain();
|
||||
}
|
||||
if (!onlinePreviewDomain.startsWith('http')) {
|
||||
onlinePreviewDomain = 'http://' + onlinePreviewDomain;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '查看论文材料',
|
||||
onClick: handleChakan.bind(null, record),
|
||||
},
|
||||
// {
|
||||
// label: '考核评价材料',
|
||||
// onClick: handleKhpjcl.bind(null, record),
|
||||
// },
|
||||
// {
|
||||
// label: '学生原始材料',
|
||||
// onClick: handleXsyscl.bind(null, record),
|
||||
// },
|
||||
];
|
||||
}
|
||||
//注册table数据
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
sm: 8,
|
||||
xl: 8,
|
||||
xxl: 8,
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 14,
|
||||
});
|
||||
|
||||
const paginationProp = ref<any>({
|
||||
total: 1,
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
});
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
//选课
|
||||
function handleXuanke() {
|
||||
sfxk.value = 1;
|
||||
searchQuery2();
|
||||
}
|
||||
|
||||
//选课提交
|
||||
function handleXUanze(record) {
|
||||
record.mainId = record.id;
|
||||
record.id = null;
|
||||
console.log('😰record----------', record);
|
||||
defHttp
|
||||
.post({
|
||||
url: '/lwKhclXz/lwKhclXz/add',
|
||||
params: record,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log('🤛', res);
|
||||
});
|
||||
xtsuccess();
|
||||
}
|
||||
//选课删除
|
||||
async function handleDel(record) {
|
||||
await deleteXkxxOne({ id: record.id }, xtsuccess);
|
||||
}
|
||||
|
||||
function xtsuccess() {
|
||||
//获取是否有选课信息
|
||||
defHttp.get({ url: '/lwKhclXz/lwKhclXz/list', params: { pageSize: -1 } }).then((res) => {
|
||||
console.log('🧛', res);
|
||||
checkData.value = res.records;
|
||||
});
|
||||
searchQuery2();
|
||||
}
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery2() {
|
||||
queryParam2.value.pageNo = paginationProp.value.current;
|
||||
defHttp.get({ url: '/lwKhcl/lwKhcl/getXkList', params: { pageNo: paginationProp.value.current, ...queryParam2.value } }).then((res) => {
|
||||
dataList.value = res.records;
|
||||
paginationProp.value.total = res.total;
|
||||
paginationProp.value.current = res.pageNo;
|
||||
});
|
||||
}
|
||||
|
||||
//翻页方法
|
||||
async function onPageChange(record) {
|
||||
console.log('👬', record);
|
||||
paginationProp.value.current = record.current;
|
||||
await searchQuery2();
|
||||
}
|
||||
|
||||
//返回首页
|
||||
function handleFanhui() {
|
||||
init();
|
||||
}
|
||||
|
||||
function init() {
|
||||
//获取是否有选课信息
|
||||
defHttp.get({ url: '/lwKhclXz/lwKhclXz/list', params: { pageSize: -1 } }).then((res) => {
|
||||
console.log('🧛', res);
|
||||
if (res.records.length == 0) {
|
||||
sfxk.value = 0;
|
||||
checkData.value = [];
|
||||
} else {
|
||||
sfxk.value = 999;
|
||||
checkData.value = res.records;
|
||||
paginationProp.value.total = res.records.total;
|
||||
paginationProp.value.current = res.records.pages;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function init2() {
|
||||
//获取是否有选课信息
|
||||
defHttp.get({ url: '/lwKhclXz/lwKhclXz/list', params: { pageSize: -1 } }).then((res) => {
|
||||
console.log('🧛', res);
|
||||
if (res.records.length == 0) {
|
||||
sfxk.value = 0;
|
||||
checkData.value = [];
|
||||
} else {
|
||||
sfxk.value = 1;
|
||||
checkData.value = res.records;
|
||||
paginationProp.value.total = res.records.total;
|
||||
paginationProp.value.current = res.records.pages;
|
||||
searchQuery2();
|
||||
}
|
||||
});
|
||||
}
|
||||
// 自动请求并暴露内部方法
|
||||
onMounted(() => {
|
||||
init2();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust {
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust {
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
}
|
||||
.ant-form-item:not(.ant-form-item-with-help) {
|
||||
margin-bottom: 16px;
|
||||
height: 32px;
|
||||
}
|
||||
:deep(.ant-picker),
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.query-criteria {
|
||||
padding-top: 22px;
|
||||
border: 1px solid #eaeef6;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.query-criteria:hover {
|
||||
border: 1px solid #c5d8ff;
|
||||
box-shadow: 2px 2px 10px 2px #e8ecf4;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.table-style {
|
||||
padding: 10px;
|
||||
background: #fff;
|
||||
border: 1px solid #eaeef6;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.table-style:hover {
|
||||
border: 1px solid #e8ecf4;
|
||||
box-shadow: 2px 2px 10px 2px #e8ecf4;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.xn-title {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.selection-title {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.seleciton-line {
|
||||
background: #1890ff;
|
||||
border-radius: 10px;
|
||||
color: #1890ff;
|
||||
}
|
||||
.mbxtitle {
|
||||
font-size: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue