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

word转html

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