Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
c868a550
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c868a550
编写于
3月 31, 2020
作者:
NoSubject
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
版式正文痕迹保留修改
上级
a6550c2d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
74 addition
and
27 deletion
+74
-27
o2web/source/o2_core/o2/o2.core.js
o2web/source/o2_core/o2/o2.core.js
+1
-1
o2web/source/x_component_process_Xform/Documenteditor.js
o2web/source/x_component_process_Xform/Documenteditor.js
+73
-26
未找到文件。
o2web/source/o2_core/o2/o2.core.js
浏览文件 @
c868a550
...
...
@@ -311,7 +311,7 @@
// layout.session.token = xToken;
// }
// }
o2
.
runCallback
(
callback
,
"
success
"
,
[
responseJSON
])
o2
.
runCallback
(
callback
,
"
success
"
,
[
responseJSON
])
;
},
onFailure
:
function
(
xhr
){
o2
.
runCallback
(
callback
,
"
requestFailure
"
,
[
xhr
]);
...
...
o2web/source/x_component_process_Xform/Documenteditor.js
浏览文件 @
c868a550
...
...
@@ -638,13 +638,15 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
this
.
_doublePage
();
}
this
.
form
.
addEvent
(
"
beforeProcess
"
,
function
(){
// this.form.addEvent("beforeProcess", function(){
// this.resetData();
// if (this.checkSaveNewEdition()) this.saveNewDataEdition();
// this.notSaveResetData = true;
// }.bind(this));
this
.
form
.
addEvent
(
"
beforeSave
"
,
function
(){
this
.
resetData
();
if
(
this
.
checkSaveNewEdition
())
this
.
saveNewDataEdition
();
this
.
notSaveResetData
=
true
;
}.
bind
(
this
));
this
.
form
.
addEvent
(
"
beforeSave
"
,
function
(){
if
(
!
this
.
notSaveResetData
)
this
.
resetData
();
//if (!this.notSaveResetData) this.resetData();
}.
bind
(
this
));
if
(
this
.
json
.
toWord
==
"
y
"
){
...
...
@@ -872,35 +874,79 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
debugger
;
//if (this.layout_filetext) currentData = this.layout_filetext.get("text");
this
.
resetData
();
var
currentData
=
this
.
data
.
filetext
;
var
currentData
=
{
"
data
"
:
this
.
data
.
filetext
,
"
person
"
:
layout
.
session
.
user
.
distinguishedName
,
"
activityName
"
:
this
.
form
.
businessData
.
activity
.
name
,
"
createTime
"
:
(
new
Date
()).
format
(
"
db
"
)
}
this
.
getHistroyDocumentList
(
function
(){
if
(
this
.
historyDocumentList
&&
this
.
historyDocumentList
.
length
){
this
.
getHistroyDocumentData
(
this
.
historyDocumentList
[
0
].
id
,
function
(
historyData
){
o2
.
load
(
"
/o2_lib/diff-match-patch/diff_match_patch_uncompressed.js
"
,
function
(){
var
dmp
=
new
diff_match_patch
();
dmp
.
Diff_Timeout
=
parseFloat
(
10
);
dmp
.
Diff_EditCost
=
parseFloat
(
4
);
// var historyDataText = this.htmlToText(historyData);
// var currentDataText = this.htmlToText(currentData);
var
historyDataText
=
(
historyData
);
var
currentDataText
=
(
currentData
);
var
diff_d
=
dmp
.
diff_main
(
historyDataText
,
currentDataText
);
dmp
.
diff_cleanupSemantic
(
diff_d
);
var
diff_ds
=
dmp
.
diff_prettyHtml
(
diff_d
);
this
.
data
.
diffFiletext
=
diff_ds
;
this
.
resetData
(
this
.
data
.
diffFiletext
);
this
.
diffHistroy
(
historyData
.
data
,
currentData
.
data
,
function
(
diff_ds
){
this
.
resetData
(
diff_ds
);
if
(
this
.
layout_filetext
){
var
insList
=
this
.
layout_filetext
.
getElements
(
"
ins
"
);
var
delList
=
this
.
layout_filetext
.
getElements
(
"
del
"
);
var
insTitle
=
o2
.
name
.
cn
(
currentData
.
person
)
+
"
添加的内容
\n
"
+
currentData
.
createTime
;
insList
.
set
(
"
title
"
,
insTitle
);
var
delTitle
=
o2
.
name
.
cn
(
currentData
.
person
)
+
"
删除的内容
\n
"
+
currentData
.
createTime
delList
.
set
(
"
title
"
,
delTitle
);
// insList.addEvents({
// "mouseover": function(){alert()}
// })
}
//this.historyAreaNode.set("html", diff_ds);
}.
bind
(
this
));
}.
bind
(
this
))
}
}.
bind
(
this
));
},
diffHistroy
:
function
(
earlyData
,
laterData
,
callback
){
o2
.
load
(
"
/o2_lib/diff-match-patch/diff_match_patch_uncompressed.js
"
,
function
(){
diff_match_patch
.
prototype
.
diff_prettyHtml
=
function
(
diffs
)
{
var
html
=
[];
var
pattern_amp
=
/&/g
;
var
pattern_lt
=
/</g
;
var
pattern_gt
=
/>/g
;
var
pattern_para
=
/
\n
/g
;
for
(
var
x
=
0
;
x
<
diffs
.
length
;
x
++
)
{
var
op
=
diffs
[
x
][
0
];
// Operation (insert, delete, equal)
var
data
=
diffs
[
x
][
1
];
// Text of change.
// var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<')
// .replace(pattern_gt, '>').replace(pattern_para, '¶<br>');
var
text
=
data
;
switch
(
op
)
{
case
DIFF_INSERT
:
html
[
x
]
=
'
<ins style="background:#e6ffe6;">
'
+
text
+
'
</ins>
'
;
break
;
case
DIFF_DELETE
:
html
[
x
]
=
'
<del style="background:#ffe6e6;">
'
+
text
+
'
</del>
'
;
break
;
case
DIFF_EQUAL
:
html
[
x
]
=
'
<span>
'
+
text
+
'
</span>
'
;
break
;
}
}
return
html
.
join
(
''
);
};
var
dmp
=
new
diff_match_patch
();
dmp
.
Diff_Timeout
=
parseFloat
(
10
);
dmp
.
Diff_EditCost
=
parseFloat
(
4
);
// var historyDataText = this.htmlToText(historyData);
// var currentDataText = this.htmlToText(currentData);
// var historyDataText = (historyData);
// var currentDataText = (currentData);
var
diff_d
=
dmp
.
diff_main
(
earlyData
,
laterData
);
dmp
.
diff_cleanupSemantic
(
diff_d
);
var
diff_ds
=
dmp
.
diff_prettyHtml
(
diff_d
);
if
(
callback
)
callback
(
diff_ds
);
}.
bind
(
this
));
},
htmlToText
:
function
(
html
){
var
tmpdiv
=
new
Element
(
"
div
"
,
{
"
html
"
:
html
});
var
text
=
tmpdiv
.
get
(
"
text
"
);
...
...
@@ -909,12 +955,13 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
},
getHistroyDocumentData
:
function
(
id
,
callback
){
o2
.
Actions
.
load
(
"
x_processplatform_assemble_surface
"
).
DocumentVersionAction
.
get
(
id
,
function
(
json
){
if
(
callback
)
callback
(
json
.
data
.
data
);
if
(
callback
)
callback
(
json
.
data
);
}.
bind
(
this
));
},
getHistroyDocumentList
:
function
(
callback
){
if
(
!
this
.
historyDocumentList
){
var
id
=
this
.
form
.
businessData
.
data
[
"
$work
"
].
job
;
//var id = this.form.businessData.data["$work"].job;
var
id
=
this
.
form
.
businessData
.
work
.
job
;
o2
.
Actions
.
load
(
"
x_processplatform_assemble_surface
"
).
DocumentVersionAction
.
listWithJobCategory
(
id
,
this
.
json
.
id
,
function
(
json
){
this
.
historyDocumentList
=
json
.
data
;
if
(
callback
)
callback
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录