2023年8月25日 修复问题
This commit is contained in:
parent
b749de8b3c
commit
eb4e662a3b
|
@ -95,7 +95,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" name="config-kcExportConfigTpkwcqkjzglx" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from './KcExportConfigTpkwcqkjzglx.data';
|
||||
|
@ -108,6 +108,9 @@
|
|||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { JInput } from '/@/components/Form';
|
||||
import { getSysConfig } from '/@/views/site/utils/index';
|
||||
import { getUserInfo, getUserId } from '/@/views/site/utils/index';
|
||||
|
||||
const roleList = computed(() => getUserInfo()?.roleList??[]);
|
||||
|
||||
const queryParam = ref<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
|
@ -131,6 +134,8 @@
|
|||
},
|
||||
beforeFetch: (params) => {
|
||||
params.column = '',params.order = '';//新生成的默认不带排序
|
||||
params.findByDwmc = !roleList.value.filter(x => x.roleCode == 'admin' ).length
|
||||
params.findGh = getUserId()
|
||||
params.xqxn = getSysConfig().flag1;
|
||||
return Object.assign(params, queryParam.value);
|
||||
},
|
||||
|
@ -144,7 +149,7 @@
|
|||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: { span: 24 },
|
||||
|
@ -261,18 +266,20 @@
|
|||
}
|
||||
|
||||
async function onExportWord(){
|
||||
let fileName = '教学听课情况表.pdf';
|
||||
// let fileName = '教学听课情况表.docx';
|
||||
// let fileName = '教学听课情况表.pdf';
|
||||
let fileName = '教学听课情况表.docx';
|
||||
let paramsForm = queryParam.value;
|
||||
|
||||
const data = await defHttp.get({ url: '/config/kcExportConfigTpkwcqkjzglx/exportPdf', params: paramsForm, responseType: 'blob' }, { isTransformResponse: false });
|
||||
// const data = await defHttp.get({ url: '/config/kcExportConfigTpkwcqkjzglx/exportWord', params: paramsForm, responseType: 'blob' }, { isTransformResponse: false });
|
||||
paramsForm = { ...paramsForm, findByDwmc: !roleList.value.filter(x => x.roleCode == 'admin' ).length, findGh: getUserId() }
|
||||
|
||||
// const data = await defHttp.get({ url: '/config/kcExportConfigTpkwcqkjzglx/exportPdf', params: paramsForm, responseType: 'blob' }, { isTransformResponse: false });
|
||||
const data = await defHttp.get({ url: '/config/kcExportConfigTpkwcqkjzglx/exportWord', params: paramsForm, responseType: 'blob' }, { isTransformResponse: false });
|
||||
if (!data) {
|
||||
createMessage.warning('文件下载失败');
|
||||
return;
|
||||
}
|
||||
let blobOptions = { type: 'application/pdf' };
|
||||
// let blobOptions = { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' };
|
||||
// let blobOptions = { type: 'application/pdf' };
|
||||
let blobOptions = { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' };
|
||||
|
||||
let navigator:any = window.navigator;
|
||||
let msSaveBlob = navigator.msSaveBlob;
|
||||
|
|
|
@ -54,7 +54,8 @@
|
|||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" @click="handleAddYq" preIcon="ant-design:plus-outlined"> 听课要求</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<!-- <a-button v-if="!roleList.filter(x => x.roleCode == 'admin' ).length" admin type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> -->
|
||||
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<!-- <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> -->
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
|
@ -96,7 +97,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" name="config-kcExportConfigTpkwcqkjzglx" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from './KcExportConfigTpkwcqkjzglx.data';
|
||||
|
@ -108,6 +109,9 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { JInput } from '/@/components/Form';
|
||||
import { getUserInfo, getUserId } from '/@/views/site/utils/index';
|
||||
|
||||
const roleList = computed(() => getUserInfo()?.roleList??[]);
|
||||
|
||||
const queryParam = ref<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
|
@ -130,13 +134,20 @@
|
|||
},
|
||||
beforeFetch: (params) => {
|
||||
params.column = '',params.order = '';//新生成的默认不带排序
|
||||
params.findByDwmc = !roleList.value.filter(x => x.roleCode == 'admin' ).length
|
||||
params.findGh = getUserId()
|
||||
return Object.assign(params, queryParam.value);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "人员信息",
|
||||
url: getExportUrl,
|
||||
params: () => Object.assign({},queryParam.value)
|
||||
params: () => {
|
||||
let params:any = {};
|
||||
params.findByDwmc = !roleList.value.filter(x => x.roleCode == 'admin' ).length
|
||||
params.findGh = getUserId()
|
||||
return Object.assign(params,queryParam.value);
|
||||
}
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
|
@ -237,6 +248,8 @@
|
|||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
// queryParam.value.findByDwmc = !!roleList.value.filter(x => x.roleCode == 'admin' ).length
|
||||
// queryParam.value.findGh = getUserId()
|
||||
reload();
|
||||
}
|
||||
|
||||
|
@ -246,6 +259,8 @@
|
|||
function searchReset() {
|
||||
queryParam.value = {};
|
||||
selectedRowKeys.value = [];
|
||||
// queryParam.value.findByDwmc = !!roleList.value.filter(x => x.roleCode == 'admin' ).length
|
||||
// queryParam.value.findGh = getUserId()
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
@ -263,6 +278,8 @@
|
|||
let fileName = '教学听课情况表.docx';
|
||||
let paramsForm = queryParam.value;
|
||||
|
||||
// paramsForm = { ...paramsForm, findByDwmc: !!roleList.value.filter(x => x.roleCode == 'admin' ).length, findGh: getUserId() }
|
||||
|
||||
// const data = await defHttp.get({ url: '/config/kcExportConfigTpkwcqkjzglx/exportPdf', params: paramsForm, responseType: 'blob' }, { isTransformResponse: false });
|
||||
const data = await defHttp.get({ url: '/config/kcExportConfigTpkwcqkjzglx/exportWord', params: paramsForm, responseType: 'blob' }, { isTransformResponse: false });
|
||||
if (!data) {
|
||||
|
|
Loading…
Reference in New Issue