|
|
@@ -400,6 +400,7 @@ Vue.component('spaceEditor', {
|
|
|
_pdfEnhancing: false,
|
|
|
defaultEditorFontFamily: "'仿宋_GB2312', 'FangSong_GB2312', FangSong, serif",
|
|
|
defaultEditorFontSize: "20pt",
|
|
|
+ defaultEditorLineHeight: "1.75",
|
|
|
}
|
|
|
},
|
|
|
name: "spaceEditor",
|
|
|
@@ -2361,7 +2362,7 @@ Vue.component('spaceEditor', {
|
|
|
} else if (blockText != "") {
|
|
|
textBlock.style.textAlign = "justify";
|
|
|
textBlock.style.textIndent = "2em";
|
|
|
- textBlock.style.lineHeight = "1.8";
|
|
|
+ textBlock.style.lineHeight = "1.75";
|
|
|
trimFirstTextIndent(textBlock);
|
|
|
}
|
|
|
}
|
|
|
@@ -2479,7 +2480,7 @@ Vue.component('spaceEditor', {
|
|
|
if (result.messages && result.messages.length) {
|
|
|
wordUi.showMessage('warning', 'Word 已导入,少量复杂格式可能需要人工检查。');
|
|
|
} else {
|
|
|
- wordUi.showMessage('success', 'Word 文件已导入正文,原有段落格式已尽量保留;未指定格式的段落使用仿宋_GB2312、20pt、首行缩进2字符。');
|
|
|
+ wordUi.showMessage('success', 'Word 文件已导入正文,原有段落格式已尽量保留;未指定格式的段落使用仿宋_GB2312、20pt、首行缩进2字符、1.75倍行距。');
|
|
|
}
|
|
|
}.bind(this))
|
|
|
.catch(function (error) {
|
|
|
@@ -2561,6 +2562,9 @@ Vue.component('spaceEditor', {
|
|
|
} else if (!textIndent && /^(P|LI|BLOCKQUOTE)$/i.test(node.tagName)) {
|
|
|
node.style.textIndent = '2em';
|
|
|
}
|
|
|
+ if (!(node.style && node.style.lineHeight) && /^(P|LI|BLOCKQUOTE)$/i.test(node.tagName)) {
|
|
|
+ node.style.lineHeight = this.defaultEditorLineHeight;
|
|
|
+ }
|
|
|
if (node.getAttribute && node.getAttribute('align')) {
|
|
|
node.style.textAlign = node.getAttribute('align');
|
|
|
node.removeAttribute('align');
|
|
|
@@ -2652,9 +2656,13 @@ Vue.component('spaceEditor', {
|
|
|
if (editor.model.schema.checkAttribute(firstBlock.name, 'textIndent')) {
|
|
|
writer.setAttribute('textIndent', '2em', firstBlock);
|
|
|
}
|
|
|
- });
|
|
|
+ if (editor.model.schema.checkAttribute(firstBlock.name, 'lineHeight')) {
|
|
|
+ writer.setAttribute('lineHeight', this.defaultEditorLineHeight, firstBlock);
|
|
|
+ }
|
|
|
+ }.bind(this));
|
|
|
editor.execute('fontFamily', { value: this.defaultEditorFontFamily });
|
|
|
editor.execute('fontSize', { value: this.defaultEditorFontSize });
|
|
|
+ this.refreshLineHeightControl(editor);
|
|
|
},
|
|
|
convertWordWithServer: function (file) {
|
|
|
var formData = new FormData();
|