1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

export/convert sdoc to docx (#5837)

* sdoc to docx

* update
This commit is contained in:
lian
2023-12-26 17:50:06 +08:00
committed by GitHub
parent b943b071ee
commit ab72e093d5
11 changed files with 225 additions and 35 deletions

View File

@@ -230,6 +230,14 @@ class DirentListItem extends React.Component {
this.setState({isShareDialogShow: !this.state.isShareDialogShow});
};
exportDocx = () => {
const serviceUrl = window.app.config.serviceURL;
let repoID = this.props.repoID;
let filePath = this.getDirentPath(this.props.dirent);
let exportToDocxUrl = serviceUrl + '/repo/sdoc_export_to_docx/' + repoID + '/?file_path=' + filePath;
window.location.href = exportToDocxUrl;
};
closeSharedDialog = () => {
this.setState({isShareDialogShow: !this.state.isShareDialogShow});
};
@@ -277,6 +285,12 @@ class DirentListItem extends React.Component {
case 'Convert to Markdown':
this.onItemConvert(event, 'markdown');
break;
case 'Convert to docx':
this.onItemConvert(event, 'docx');
break;
case 'Export docx':
this.exportDocx();
break;
case 'Convert to sdoc':
this.onItemConvert(event, 'sdoc');
break;