Merge branch '20220418-zjl-报表打印另存为默认格式打开文件内容乱码' into 'master-0422-合并'
4.22 报表打印另存为默认格式打开文件内容乱码 See merge request eshop/fe_service_ebtp_frontend!28
This commit is contained in:
@ -11,6 +11,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var path; //文档地址
|
var path; //文档地址
|
||||||
var fileName;//weboffice文件名
|
var fileName;//weboffice文件名
|
||||||
|
var fileType;//文件类型
|
||||||
|
|
||||||
function getQueryString(name) {
|
function getQueryString(name) {
|
||||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||||
@ -56,7 +57,7 @@
|
|||||||
|
|
||||||
<!--AfterPublishAsPDFToURL-->
|
<!--AfterPublishAsPDFToURL-->
|
||||||
|
|
||||||
<body onload="path=getQueryString('path');fileName=getQueryString('fileName');init(path);">
|
<body onload="path=getQueryString('path');fileName=getQueryString('fileName');fileType=getQueryString('fileType');init(path);">
|
||||||
|
|
||||||
<script type="text/javascript" for="TANGER_OCX" event="OnDocumentOpened(File, Document)">
|
<script type="text/javascript" for="TANGER_OCX" event="OnDocumentOpened(File, Document)">
|
||||||
|
|
||||||
@ -87,7 +88,7 @@
|
|||||||
}
|
}
|
||||||
//调用文档通用属性方法 1-打开 2-保存(另存为) 4-打印
|
//调用文档通用属性方法 1-打开 2-保存(另存为) 4-打印
|
||||||
function generalProp(param) {
|
function generalProp(param) {
|
||||||
TANGER_OCX.WebFileName = fileName + ".doc";//文档默认名称
|
TANGER_OCX.WebFileName = fileName + "." + fileType;//文档默认名称
|
||||||
TANGER_OCX.ShowDialog(param)
|
TANGER_OCX.ShowDialog(param)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -34,7 +34,7 @@ const ReportPrint: React.FC<{}> = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="text"
|
type="text"
|
||||||
key={item.id}
|
key={item.id}
|
||||||
onClick={() => onClickLink(item.url, item.dicName, response?.data)}
|
onClick={() => onClickLink(item.url, item.dicName, item.queryType, response?.data)}
|
||||||
style={{ color: '#b30000', background: 'rgba(0, 0, 0, 0)' }}
|
style={{ color: '#b30000', background: 'rgba(0, 0, 0, 0)' }}
|
||||||
>
|
>
|
||||||
{index + 1}、{item.dicName}
|
{index + 1}、{item.dicName}
|
||||||
@ -86,11 +86,11 @@ const ReportPrint: React.FC<{}> = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClickLink = (url: string, name: string, data: any) => {
|
const onClickLink = (url: string, name: string, type: string, data: any) => {
|
||||||
editLoading();
|
editLoading();
|
||||||
const fileName: string = `${data.sectionName}-${data.sectionNum}-${data.roomType == 1 ? '预审' : ''}${name}${defId == 'recruit_multi' ? `第${data.roomSort}轮` : ''}${data.reviewMark == 1 ? `(第${data.reviewSort}次重新评审)` : ''}`;
|
const fileName: string = `${data.sectionName}-${data.sectionNum}-${data.roomType == 1 ? '预审' : ''}${name}${defId == 'recruit_multi' ? `第${data.roomSort}轮` : ''}${data.reviewMark == 1 ? `(第${data.reviewSort}次重新评审)` : ''}`;
|
||||||
const format = fileName.replace(/\//g, "-") //格式化文件名称
|
const format = fileName.replace(/\//g, "-") //格式化文件名称
|
||||||
window.ntkoBrowser.openWindow('/Weboffice4Path.html?path=' + encodeURIComponent(url) + '&fileName=' + format);
|
window.ntkoBrowser.openWindow('/Weboffice4Path.html?path=' + encodeURIComponent(url) + '&fileType=' + type + '&fileName=' + format);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user