院校招录专业-加入内部录取方式字段
This commit is contained in:
parent
c46eb07a9f
commit
c1ae3394f9
|
|
@ -52,11 +52,9 @@
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="6">
|
<a-col :span="6">
|
||||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
</a-button>
|
<a-button type="primary" preIcon="ant-design:export-outlined" @click="exportXls" style="margin: 8px">导出</a-button>
|
||||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||||
style="margin-left: 8px">重置
|
|
||||||
</a-button>
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
|
@ -94,7 +92,7 @@ import {defHttp} from '/@/utils/http/axios';
|
||||||
import {JVxeColumn, JVxeTypes} from '/@/components/jeecg/JVxeTable/types';
|
import {JVxeColumn, JVxeTypes} from '/@/components/jeecg/JVxeTable/types';
|
||||||
import {useMessage} from '/@/hooks/web/useMessage';
|
import {useMessage} from '/@/hooks/web/useMessage';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
|
import {XLSX_FILE_SUFFIX, XLSX_MIME_TYPE} from "@/hooks/system/useMethods";
|
||||||
const labelCol = reactive({
|
const labelCol = reactive({
|
||||||
xs: {span: 24},
|
xs: {span: 24},
|
||||||
sm: {span: 7},
|
sm: {span: 7},
|
||||||
|
|
@ -200,23 +198,35 @@ const columns = ref<JVxeColumn[]>([
|
||||||
type: JVxeTypes.input,
|
type: JVxeTypes.input,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '录取方式缩写(文x专y)',
|
title: '录取方式缩写(用于筛选条件)',
|
||||||
key: 'rulesEnrollProbabilitySx',
|
key: 'rulesEnrollProbabilitySx',
|
||||||
width: 150,
|
width: 150,
|
||||||
type: JVxeTypes.input,
|
type: JVxeTypes.input,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '录取方式(文*x+专*y)',
|
title: '对外录取方式',
|
||||||
key: 'rulesEnrollProbability',
|
key: 'rulesEnrollProbability',
|
||||||
width: 150,
|
width: 150,
|
||||||
type: JVxeTypes.input,
|
type: JVxeTypes.input,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '录取概率计算规则运算符',
|
title: '对外录取方式运算符',
|
||||||
key: 'probabilityOperator',
|
key: 'probabilityOperator',
|
||||||
width: 150,
|
width: 150,
|
||||||
type: JVxeTypes.input,
|
type: JVxeTypes.input,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '内部录取方式',
|
||||||
|
key: 'privateRulesEnrollProbability',
|
||||||
|
width: 150,
|
||||||
|
type: JVxeTypes.input,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '内部录取方式运算符',
|
||||||
|
key: 'privateProbabilityOperator',
|
||||||
|
width: 150,
|
||||||
|
type: JVxeTypes.input,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '批次',
|
title: '批次',
|
||||||
key: 'batch',
|
key: 'batch',
|
||||||
|
|
@ -312,6 +322,7 @@ enum Api {
|
||||||
// 模拟保存整个表格的数据
|
// 模拟保存整个表格的数据
|
||||||
saveAll = '/yx/yxSchoolMajor/saveBatch',
|
saveAll = '/yx/yxSchoolMajor/saveBatch',
|
||||||
deleteBatch = '/yx/yxSchoolMajor/deleteBatch',
|
deleteBatch = '/yx/yxSchoolMajor/deleteBatch',
|
||||||
|
exportXls = '/yx/yxSchoolMajor/exportXls',
|
||||||
}
|
}
|
||||||
|
|
||||||
loadData();
|
loadData();
|
||||||
|
|
@ -452,7 +463,7 @@ function handleEditClosed(event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当分页参数变化时触发的事件
|
// 当分页参数变化时触发的事件
|
||||||
function handlePageChange(event) {
|
function handlePageChange(event) {
|
||||||
// 重新赋值
|
// 重新赋值
|
||||||
pagination.current = event.current;
|
pagination.current = event.current;
|
||||||
|
|
@ -465,6 +476,49 @@ function handlePageChange(event) {
|
||||||
function handleSelectRowChange(event) {
|
function handleSelectRowChange(event) {
|
||||||
selectedRows.value = event.selectedRows;
|
selectedRows.value = event.selectedRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出xls
|
||||||
|
* @param name
|
||||||
|
* @param url
|
||||||
|
*/
|
||||||
|
async function exportXls(isXlsx = false) {
|
||||||
|
let name = ''
|
||||||
|
let selections = ''
|
||||||
|
if (selectedRows.value) {
|
||||||
|
selectedRows.value.forEach(i=>{
|
||||||
|
selections+=i.id+","
|
||||||
|
})
|
||||||
|
console.log(selectedRows.value)
|
||||||
|
}
|
||||||
|
const data = await defHttp.get({ url: Api.exportXls, params: {selections:selections}, responseType: 'blob', timeout: 60000 }, { isTransformResponse: false });
|
||||||
|
if (!data) {
|
||||||
|
createMessage.warning('文件下载失败');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!name || typeof name != 'string') {
|
||||||
|
name = '导出文件';
|
||||||
|
}
|
||||||
|
let blobOptions = { type: 'application/vnd.ms-excel' };
|
||||||
|
let fileSuffix = '.xls';
|
||||||
|
if (isXlsx === true) {
|
||||||
|
blobOptions['type'] = XLSX_MIME_TYPE;
|
||||||
|
fileSuffix = XLSX_FILE_SUFFIX;
|
||||||
|
}
|
||||||
|
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||||
|
window.navigator.msSaveBlob(new Blob([data], blobOptions), name + fileSuffix);
|
||||||
|
} else {
|
||||||
|
let url = window.URL.createObjectURL(new Blob([data], blobOptions));
|
||||||
|
let link = document.createElement('a');
|
||||||
|
link.style.display = 'none';
|
||||||
|
link.href = url;
|
||||||
|
link.setAttribute('download', name + fileSuffix);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link); //下载完成移除元素
|
||||||
|
window.URL.revokeObjectURL(url); //释放掉blob对象
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue