提交 5310d28c authored 作者: 钟是志's avatar 钟是志

word转html

上级 e03d4b19
...@@ -161,6 +161,7 @@ export const uploadWordToHtml = (file) => { ...@@ -161,6 +161,7 @@ export const uploadWordToHtml = (file) => {
let url = queryApiActionPath() + '/ImageLibApi/convert'; let url = queryApiActionPath() + '/ImageLibApi/convert';
const formData = new FormData(); const formData = new FormData();
formData.append('file', file); formData.append('file', file);
formData.append('prefix', window.specialImportantSystemConfig.dfs);
formData.append('token', getToken()); formData.append('token', getToken());
return fetch(url, { return fetch(url, {
method: 'POST', method: 'POST',
......
...@@ -39,24 +39,11 @@ export default class WordMenu extends BtnMenu { ...@@ -39,24 +39,11 @@ export default class WordMenu extends BtnMenu {
uploadWordToHtml(file) uploadWordToHtml(file)
.then((res) => { .then((res) => {
setTimeout(() => { setTimeout(() => {
if (res && res.length > 10) { if (res && res.html) {
let url = queryFileUrl(res);
window.message.success('上传文件成功'); window.message.success('上传文件成功');
// 30354 【移动端】家庭经济困难学生认定,手机端这么搞,已通过项目组审核 // 30354 【移动端】家庭经济困难学生认定,手机端这么搞,已通过项目组审核
// 将 embed 改完iframe 解决移动端不显示pdf 文件的bug // 将 embed 改完iframe 解决移动端不显示pdf 文件的bug
this.editor.txt.append(` this.editor.txt.append(res.html);
<p class='wangEditor-aHref'><a href='${url}' target='_blank' download='${fileName}'>${fileName}</a></p>
<p class='wangEditor-pdfReader'>
<iframe width='100%'
height='768px'
name='plugin'
id='plugin'
src='${window.specialImportantSystemConfig?.pdfReadPrefixUrl ? window.specialImportantSystemConfig?.pdfReadPrefixUrl + url : url}'
type='application/pdf'
internalinstanceid='3'
title='${fileName}'/>
</p>
`);
} }
}, 2000); }, 2000);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论