mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-11 20:01:10 +00:00
import and export sdoc (#6508)
* import and export sdoc * rebase and optimize * update * optimize code * update iconfont * update seafile-js version * update --------- Co-authored-by: 杨顺强 <978987373@qq.com>
This commit is contained in:
@@ -314,10 +314,24 @@ class DirentGridView extends React.Component {
|
||||
|
||||
exportDocx = () => {
|
||||
const serviceUrl = window.app.config.serviceURL;
|
||||
let dirent = this.state.activeDirent ? this.state.activeDirent : '';
|
||||
if (!dirent) {
|
||||
return;
|
||||
}
|
||||
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;
|
||||
let filePath = this.getDirentPath(dirent);
|
||||
window.location.href = serviceUrl + '/repo/sdoc_export_to_docx/' + repoID + '/?file_path=' + filePath;
|
||||
};
|
||||
|
||||
exportSdoc = () => {
|
||||
const serviceUrl = window.app.config.serviceURL;
|
||||
let dirent = this.state.activeDirent ? this.state.activeDirent : '';
|
||||
if (!dirent) {
|
||||
return;
|
||||
}
|
||||
let repoID = this.props.repoID;
|
||||
let filePath = this.getDirentPath(dirent);
|
||||
window.location.href = serviceUrl + '/lib/' + repoID + '/file/' + filePath + '?dl=1';
|
||||
};
|
||||
|
||||
onMenuItemClick = (operation, currentObject, event) => {
|
||||
@@ -356,6 +370,9 @@ class DirentGridView extends React.Component {
|
||||
case 'Export docx':
|
||||
this.exportDocx();
|
||||
break;
|
||||
case 'Export sdoc':
|
||||
this.exportSdoc();
|
||||
break;
|
||||
case 'Convert to sdoc':
|
||||
this.onItemConvert(currentObject, event, 'sdoc');
|
||||
break;
|
||||
|
Reference in New Issue
Block a user