提交 8046ff02 编写于 作者: NoSubject's avatar NoSubject

增加OOXML对象,用于版式文件转换为word

上级 ec56e515
......@@ -413,6 +413,7 @@ exports.build_web_move = build_web_move;
function build_concat_o2(){
var src = [
'o2web/source/o2_core/polyfill.js',
'o2web/source/o2_lib/mootools/mootools-1.6.0_all.js',
'o2web/source/o2_lib/mootools/plugin/mBox.js',
'o2web/source/o2_core/o2.js'
......@@ -436,7 +437,7 @@ function build_concat_base(){
var dest = 'target/o2server/servers/webServer/x_desktop/js/';
return gulp.src(src, {sourcemaps: true})
//.pipe(sourceMap.init())
//.pipe(concat('o2.js'))
.pipe(concat('base.js'))
.pipe(gulp.dest(dest))
.pipe(concat('base.min.js'))
.pipe(uglify())
......@@ -606,6 +607,7 @@ function build_concat_cms_xform(){
function build_bundle(){
let path = "o2_core";
var src = [
'o2web/source/o2_core/polyfill.js',
'o2web/source/o2_lib/mootools/mootools-1.6.0_all.js',
'o2web/source/o2_lib/mootools/plugin/mBox.js',
'o2web/source/o2_core/o2.js',
......
......@@ -340,6 +340,7 @@ function createO2ConcatTask(path, isMin, thisOptions) {
gulp.task(path+" : concat", function(){
var option = thisOptions || options;
var src = [
'source/' + path + '/polyfill.js',
'source/o2_lib/mootools/mootools-1.6.0_all.js',
'source/o2_lib/mootools/plugin/mBox.js',
'source/' + path + '/o2.js'
......@@ -450,6 +451,7 @@ function createO2ConcatTask(path, isMin, thisOptions) {
gulp.task(path+" : bundle", function(){
var option = thisOptions || options;
var src = [
'source/' + path + '/polyfill.js',
'source/o2_lib/mootools/mootools-1.6.0_all.js',
'source/o2_lib/mootools/plugin/mBox.js',
'source/' + path + '/o2.js',
......
此差异已折叠。
此差异已折叠。
......@@ -163,6 +163,13 @@
</table>
<div id="text{$.pid}toWordArea" style="display: text{($.toWord=='y')?'block':'none'}">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.wordConversionType}}:</td>
<td class="editTableValue">
<input class="editTableRadio" name="wordConversionType" text{($.wordConversionType!='service')?'checked':''} type="radio" value="ooxml"/>OOXML
<input class="editTableRadio" name="wordConversionType" text{($.wordConversionType=='service')?'checked':''} type="radio" value="service"/>Service
</td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.fileName}}:</td>
<td class="editTableValue"><input type="text" name="toWordFilename" value="text{$.toWordFilename}" class="editTableInput"/></td>
......
......@@ -110,9 +110,7 @@
<!-- 红头 -->
<div class="doc_block">
<p class="MsoRedHeader" align=center style='text-align:center;line-height:auto; mso-line-height-rule:exactly;'><b>
<span class="doc_layout_redHeader" style='font-size:42.0pt;font-family:宋体;color:red;letter-spacing:normal'>红头文件</span>
</b></p>
<div class="MsoRedHeader doc_layout_redHeader" align=center style='text-align:center;mso-line-height-rule:exactly;font-weight:bold; font-size:42.0pt;font-family:宋体,sans-serif;color:red;letter-spacing:normal''> 红头文件</div>
</div>
<div class="doc_block doc_layout_fileno_area">
......
......@@ -99,9 +99,7 @@
<!-- 红头 -->
<div class="doc_block">
<p class="MsoRedHeader" align=center style='text-align:center;line-height:auto; mso-line-height-rule:exactly;'><b>
<span class="doc_layout_redHeader" style='font-size:42.0pt;font-family:宋体;color:red;letter-spacing:normal'>XXXXXX令</span>
</b></p>
<div class="MsoRedHeader doc_layout_redHeader" align=center style='text-align:center;mso-line-height-rule:exactly;font-weight:bold; font-size:42.0pt;font-family:宋体,sans-serif;color:red;letter-spacing:normal''>XXXXXX令</div>
</div>
<div class="doc_block">
......
......@@ -130,9 +130,7 @@ AAAAAAAAAAAAAAAnBAAAZHJzL2Rvd25yZXYueG1sUEsFBgAAAAAEAAQA8wAAAC4FAAAAAA==
<!-- 红头 -->
<div class="doc_block">
<p class="MsoRedHeader" align=center style='text-align:center;line-height:auto; mso-line-height-rule:exactly;'><b>
<span class="doc_layout_redHeader" style='font-size:42.0pt;font-family:宋体;color:red;letter-spacing:normal'>×××××公司函</span>
</b></p>
<div class="MsoRedHeader doc_layout_redHeader" align=center style='text-align:center;mso-line-height-rule:exactly;font-weight:bold; font-size:42.0pt;font-family:宋体,sans-serif;color:red;letter-spacing:normal''>公司函</div>
</div>
<!--[if gte vml 1]>
......
......@@ -110,9 +110,7 @@
<!-- 红头 -->
<div class="doc_block">
<p class="MsoRedHeader" align=center style='text-align:center;line-height:auto; mso-line-height-rule:exactly;'><b>
<span class="doc_layout_redHeader" style='font-size:42.0pt;font-family:宋体;color:red;letter-spacing:normal'>××××××纪要</span>
</b></p>
<div class="MsoRedHeader doc_layout_redHeader" align=center style='text-align:center;mso-line-height-rule:exactly;font-weight:bold; font-size:42.0pt;font-family:宋体,sans-serif;color:red;letter-spacing:normal''>××××××纪要</div>
</div>
<div class="doc_block">
......
......@@ -110,9 +110,7 @@
<!-- 红头 -->
<div class="doc_block">
<p class="MsoRedHeader" align=center style='text-align:center;line-height:auto; mso-line-height-rule:exactly;'><b>
<span class="doc_layout_redHeader" style='font-size:42.0pt;font-family:宋体;color:red;letter-spacing:normal'>××××××纪要</span>
</b></p>
<div class="MsoRedHeader doc_layout_redHeader" align=center style='text-align:center;mso-line-height-rule:exactly;font-weight:bold; font-size:42.0pt;font-family:宋体,sans-serif;color:red;letter-spacing:normal''>××××××纪要</div>
</div>
<div class="doc_block">
......
......@@ -107,10 +107,7 @@
<!-- 红头 -->
<div class="doc_block">
<p class="MsoRedHeader" align=center style='text-align:center;line-height:auto; mso-line-height-rule:exactly;'><b>
<span class="doc_layout_redHeader" style='font-size:64.0pt;font-family:华文中宋;color:red;letter-spacing:normal'>
<span style='transform-origin: 50% 0%; height: 74pt; color: red; font-family:华文中宋; font-size: 46.8pt; mso-ansi-font-size:72pt; display: block; transform: scale(1, 1.538); mso-font-kerning: 0pt; mso-font-width:65%;'>纪 委 文 件</span></span>
</b></p>
<div class="MsoRedHeader doc_layout_redHeader" align=center style='text-align:center;mso-line-height-rule:exactly;font-weight:bold; font-size:42.0pt;font-family:宋体,sans-serif;color:red;letter-spacing:normal''>纪 委 文 件</div>
</div>
<div class="doc_block">
......
......@@ -764,6 +764,8 @@ MWF.xApplication.process.FormDesigner.LP = {
"fullScreen": "Full Screen",
"fullScreenInfo": "Whether to allow full screen display",
"wordConversion": "Convert to word",
"wordConversionType": "Convert Type",
"wordConversionWithService": "By Service",
"fileName": "Filename",
"fileSite": "Attachment site",
"addPageNumber": "Page Number",
......
......@@ -768,6 +768,8 @@ MWF.xApplication.process.FormDesigner.LP = {
"fullScreen": "全屏",
"fullScreenInfo": "是否允许全屏显示",
"wordConversion": "WORD转换",
"wordConversionType": "转换方式",
"wordConversionWithService": "使用服务",
"fileName": "文件名",
"fileSite": "附件site",
"addPageNumber": "添加页码",
......
......@@ -2195,7 +2195,8 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
editorConfig.extraPlugins = "quicktable,tableresize";
//editorConfig.mathJaxLib = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML',
editorConfig.removeButtons = 'NumberedList,Source,Save,NewPage,Preview,Print,Templates,Paste,PasteFromWord,Scayt,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Bold,Italic,Underline,Strike,Subscript,Superscript,CopyFormatting,RemoveFormat,BulletedList,Outdent,Indent,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Link,Unlink,Anchor,Image,Flash,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,TextColor,BGColor,Maximize,ShowBlocks,About,Styles,Font,FontSize';
//editorConfig.removeButtons = 'NumberedList,Source,Save,NewPage,Preview,Print,Templates,Paste,PasteFromWord,Scayt,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Bold,Italic,Underline,Strike,Subscript,Superscript,CopyFormatting,RemoveFormat,BulletedList,Outdent,Indent,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Link,Unlink,Anchor,Image,Flash,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,TextColor,BGColor,Maximize,ShowBlocks,About,Styles,Font,FontSize';
editorConfig.removeButtons = 'Source,Save,NewPage,Preview,Print,Templates,Paste,PasteFromWord,Scayt,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Bold,Italic,Underline,Strike,Subscript,Superscript,CopyFormatting,RemoveFormat,Outdent,Indent,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Link,Unlink,Anchor,Image,Flash,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,TextColor,BGColor,Maximize,ShowBlocks,About,Styles,Font,FontSize';
//editorConfig.extraAllowedContent = mathElements.join(' ') + '(*)[*]{*};img[data-mathml,data-custom-editor,role](Wirisformula)';
......@@ -2361,6 +2362,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
}else{
this.filetextEditor = CKEDITOR.replace(this.layout_filetext, this._getEditorConfig());
}
this.filetextEditor.on("instanceReady", function(e){
if (callback) callback(e);
}.bind(this));
......@@ -2373,7 +2375,16 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
this.filetextEditor.element.$.store("scale", this.scale);
}.bind(this) );
this.filetextEditor.on( 'afterPaste', function( e ) {
debugger;
}.bind(this));
this.filetextEditor.on( 'afterPasteFromWord', function( e ) {
debugger;
}.bind(this));
this.filetextEditor.on( 'paste', function( e ) {
debugger;
var html = e.data.dataValue;
//if (this.json.fullWidth=="y") html = html.replace(/\x20/g, " ");
var rexbr = /\<br\>|\<br \/\>|\<br\/\>/g;
......@@ -3330,32 +3341,37 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
"height":"auto"
});
}.bind(this), function(){
var content = encodeURIComponent(this.getDocumentHtml());
//var content = "<html xmlns:v=\"urn:schemas-microsoft-com:vml\"><head><meta charset=\"UTF-8\" /></head><body>"+tmpNode.get("html")+"</body></html>";
var fileName = docNmae || this.json.toWordFilename || "$doc";
var n = fileName.lastIndexOf(".");
if (n==-1) fileName = fileName+".doc";
var body = {
"fileName": fileName,
"site": this.json.toWordSite || "$doc",
"content": content
};
o2.Actions.get("x_processplatform_assemble_surface").docToWord(this.form.businessData.work.id, body, function(json){
if (this.form.businessData.workCompleted){
o2.Actions.get("x_processplatform_assemble_surface").getAttachmentWorkcompleted(json.data.id, this.form.businessData.workCompleted.id,function(attjson){
if (callback) callback(attjson.data);
this.showToWord(attjson.data);
}.bind(this));
}else{
o2.Actions.get("x_processplatform_assemble_surface").getAttachment(json.data.id, this.form.businessData.work.id,function(attjson){
if (callback) callback(attjson.data);
this.showToWord(attjson.data);
}.bind(this));
}
}.bind(this));
//tmpNode.destroy();
if (this.json.wordConversionType==="service"){
var content = encodeURIComponent(this.getDocumentHtml());
var body = {
"fileName": fileName,
"site": this.json.toWordSite || "$doc",
"content": content
};
o2.Actions.get("x_processplatform_assemble_surface").docToWord(this.form.businessData.work.id, body, function(json){
if (this.form.businessData.workCompleted){
o2.Actions.get("x_processplatform_assemble_surface").getAttachmentWorkcompleted(json.data.id, this.form.businessData.workCompleted.id,function(attjson){
if (callback) callback(attjson.data);
this.showToWord(attjson.data);
}.bind(this));
}else{
o2.Actions.get("x_processplatform_assemble_surface").getAttachment(json.data.id, this.form.businessData.work.id,function(attjson){
if (callback) callback(attjson.data);
this.showToWord(attjson.data);
}.bind(this));
}
}.bind(this));
}else{
var content = this.getDocumentHtml();
o2.xDesktop.requireApp("process.Xform", "widget.OOXML", function(){
(new o2.OOXML.WML()).load(content);
});
}
if (!toEdit){
this._readFiletext();
......
......@@ -30,6 +30,7 @@
xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk"
xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh wp14">
<w:body>
<w:p>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册