2023年8月25日 修复错误代码
This commit is contained in:
parent
eb4e662a3b
commit
9bebeefb9d
|
@ -95,7 +95,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" name="config-kcExportConfigTpkwcqkjzglx" setup>
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { ref, reactive, computed, watch, nextTick } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from './KcExportConfigTpkwcqkjzglx.data';
|
||||
|
@ -119,6 +119,22 @@
|
|||
|
||||
const { createMessage } = useMessage();
|
||||
|
||||
const xqDictTag = ref();
|
||||
|
||||
watch(() => xqDictTag.value?.dictOptions,(d) => {
|
||||
if(d){
|
||||
queryParam.value.xqxn = d[0]?.value
|
||||
if(queryParam.value.xqxn){
|
||||
nextTick(() => {
|
||||
reload();
|
||||
})
|
||||
}
|
||||
}
|
||||
},{
|
||||
deep:true,
|
||||
immediate:true,
|
||||
});
|
||||
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
|
@ -136,7 +152,7 @@
|
|||
params.column = '',params.order = '';//新生成的默认不带排序
|
||||
params.findByDwmc = !roleList.value.filter(x => x.roleCode == 'admin' ).length
|
||||
params.findGh = getUserId()
|
||||
params.xqxn = getSysConfig().flag1;
|
||||
//params.xqxn = getSysConfig().flag1;
|
||||
return Object.assign(params, queryParam.value);
|
||||
},
|
||||
},
|
||||
|
@ -266,20 +282,26 @@
|
|||
}
|
||||
|
||||
async function onExportWord(){
|
||||
// let fileName = '教学听课情况表.pdf';
|
||||
let fileName = '教学听课情况表.docx';
|
||||
let dcType = 'pdf';
|
||||
// let dcType = 'doc';
|
||||
|
||||
let fileName = dcType == 'pdf'?'教学听课情况表.pdf':'教学听课情况表.docx';
|
||||
// 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 });
|
||||
let url = dcType == 'pdf'?'/config/kcExportConfigTpkwcqkjzglx/exportPdf':'/config/kcExportConfigTpkwcqkjzglx/exportWord'
|
||||
|
||||
const data = await defHttp.get({ url, 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 = dcType == 'pdf'?{ type: 'application/pdf' }:{ type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' };
|
||||
// let blobOptions = { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' };
|
||||
|
||||
let navigator:any = window.navigator;
|
||||
let msSaveBlob = navigator.msSaveBlob;
|
||||
|
|
Loading…
Reference in New Issue