Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
此号慢热型
o2oa
提交
4c4815b7
o2oa
项目概览
此号慢热型
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
5
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,发现更多精彩内容 >>
提交
4c4815b7
编写于
12月 08, 2020
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复附件上传出错进度条没有删除的问题
上级
5a4c27e3
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
97 addition
and
30 deletion
+97
-30
o2web/source/o2_core/o2/widget/AttachmentController.js
o2web/source/o2_core/o2/widget/AttachmentController.js
+32
-6
o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js
o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js
+6
-0
o2web/source/x_component_Forum/Attachment.js
o2web/source/x_component_Forum/Attachment.js
+34
-20
o2web/source/x_component_cms_Xform/Attachment.js
o2web/source/x_component_cms_Xform/Attachment.js
+13
-2
o2web/source/x_component_process_Xform/Attachment.js
o2web/source/x_component_process_Xform/Attachment.js
+12
-2
未找到文件。
o2web/source/o2_core/o2/widget/AttachmentController.js
浏览文件 @
4c4815b7
...
...
@@ -742,11 +742,11 @@ o2.widget.AttachmentController = o2.widget.ATTER = new Class({
uploadAttachment
:
function
(
e
,
node
){
if
(
this
.
module
)
this
.
module
.
uploadAttachment
(
e
,
node
);
},
doUploadAttachment
:
function
(
obj
,
action
,
invokeUrl
,
parameter
,
finish
,
every
,
beforeUpload
,
multiple
,
accept
,
size
){
doUploadAttachment
:
function
(
obj
,
action
,
invokeUrl
,
parameter
,
finish
,
every
,
beforeUpload
,
multiple
,
accept
,
size
,
failureEvery
){
if
(
FormData
.
expiredIE
){
this
.
doInputUploadAttachment
(
obj
,
action
,
invokeUrl
,
parameter
,
finish
,
every
,
beforeUpload
,
multiple
,
accept
,
size
);
this
.
doInputUploadAttachment
(
obj
,
action
,
invokeUrl
,
parameter
,
finish
,
every
,
beforeUpload
,
multiple
,
accept
,
size
,
failureEvery
);
}
else
{
this
.
doFormDataUploadAttachment
(
obj
,
action
,
invokeUrl
,
parameter
,
finish
,
every
,
beforeUpload
,
multiple
,
accept
,
size
);
this
.
doFormDataUploadAttachment
(
obj
,
action
,
invokeUrl
,
parameter
,
finish
,
every
,
beforeUpload
,
multiple
,
accept
,
size
,
failureEvery
);
}
},
addUploadMessage
:
function
(
fileName
){
...
...
@@ -788,7 +788,7 @@ o2.widget.AttachmentController = o2.widget.ATTER = new Class({
}
},
doInputUploadAttachment
:
function
(
obj
,
action
,
invokeUrl
,
parameter
,
finish
,
every
,
beforeUpload
,
multiple
,
accept
){
doInputUploadAttachment
:
function
(
obj
,
action
,
invokeUrl
,
parameter
,
finish
,
every
,
beforeUpload
,
multiple
,
accept
,
failureEvery
){
var
restActions
=
action
;
if
(
typeOf
(
action
)
==
"
string
"
){
restActions
=
o2
.
Actions
.
get
(
action
).
action
;
...
...
@@ -835,6 +835,7 @@ o2.widget.AttachmentController = o2.widget.ATTER = new Class({
if
(
finish
)
finish
();
}
else
{
//formNode.unmask();
// if(failureEvery)failureEvery(json);
this
.
setMessageTitle
(
messageItem
,
o2
.
LP
.
desktop
.
action
.
sendError
);
this
.
setMessageText
(
messageItem
,
o2
.
LP
.
desktop
.
action
.
sendError
+
"
:
"
+
json
.
message
);
o2
.
xDesktop
.
notice
(
"
error
"
,
{
x
:
"
right
"
,
y
:
"
top
"
},
json
.
message
);
...
...
@@ -897,7 +898,7 @@ o2.widget.AttachmentController = o2.widget.ATTER = new Class({
}.
bind
(
this
));
}.
bind
(
this
));
},
doFormDataUploadAttachment
:
function
(
obj
,
action
,
invokeUrl
,
parameter
,
finish
,
every
,
beforeUpload
,
multiple
,
accept
,
size
){
doFormDataUploadAttachment
:
function
(
obj
,
action
,
invokeUrl
,
parameter
,
finish
,
every
,
beforeUpload
,
multiple
,
accept
,
size
,
failureEvery
){
if
(
!
this
.
uploadFileAreaNode
){
this
.
uploadFileAreaNode
=
new
Element
(
"
div
"
);
var
html
=
"
<input name=
\"
file
\"
multiple type=
\"
file
\"
accept=
\"
*/*
\"
/>
"
;
...
...
@@ -909,6 +910,7 @@ o2.widget.AttachmentController = o2.widget.ATTER = new Class({
if
(
files
.
length
){
var
count
=
files
.
length
;
var
current
=
0
;
var
hasFailUpload
=
false
;
var
restActions
=
action
;
if
(
typeOf
(
action
)
==
"
string
"
){
...
...
@@ -918,7 +920,7 @@ o2.widget.AttachmentController = o2.widget.ATTER = new Class({
var
callback
=
function
(){
if
(
current
==
count
){
if
(
finish
)
finish
();
if
(
finish
)
finish
(
hasFailUpload
);
}
};
...
...
@@ -992,6 +994,14 @@ o2.widget.AttachmentController = o2.widget.ATTER = new Class({
current
++
;
if
(
every
)
every
(
json
,
current
,
count
);
callback
();
},
"
failure
"
:
function
(
xhr
)
{
var
json
=
JSON
.
decode
(
xhr
.
responseText
);
if
(
json
&&
json
.
message
)
o2
.
xDesktop
.
notice
(
"
error
"
,
{
x
:
"
right
"
,
y
:
"
top
"
},
json
.
message
);
current
++
;
hasFailUpload
=
true
;
if
(
failureEvery
)
failureEvery
(
xhr
,
current
,
count
);
callback
();
}
});
}
else
{
...
...
@@ -1005,6 +1015,14 @@ o2.widget.AttachmentController = o2.widget.ATTER = new Class({
current
++
;
if
(
every
)
every
(
json
,
current
,
count
);
callback
();
},
"
failure
"
:
function
(
xhr
)
{
var
json
=
JSON
.
decode
(
xhr
.
responseText
);
if
(
json
&&
json
.
message
)
o2
.
xDesktop
.
notice
(
"
error
"
,
{
x
:
"
right
"
,
y
:
"
top
"
},
json
.
message
);
current
++
;
hasFailUpload
=
true
;
if
(
failureEvery
)
failureEvery
(
xhr
,
current
,
count
);
callback
();
}
});
}
...
...
@@ -1036,6 +1054,14 @@ o2.widget.AttachmentController = o2.widget.ATTER = new Class({
current
++
;
if
(
every
)
every
(
json
,
current
,
count
);
callback
();
},
"
failure
"
:
function
(
xhr
)
{
var
json
=
JSON
.
decode
(
xhr
.
responseText
);
if
(
json
&&
json
.
message
)
o2
.
xDesktop
.
notice
(
"
error
"
,
{
x
:
"
right
"
,
y
:
"
top
"
},
json
.
message
);
current
++
;
hasFailUpload
=
true
;
if
(
failureEvery
)
failureEvery
(
xhr
,
current
,
count
);
callback
();
}
});
}
...
...
o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js
浏览文件 @
4c4815b7
...
...
@@ -367,13 +367,19 @@ MWF.xDesktop.Actions.RestActions = new Class({
},
xhr
.
responseText
]);
break
;
case
"
error
"
:
var
messageId
=
(
messageItem
&&
messageItem
.
moduleMessage
)
?
messageItem
.
moduleMessage
.
data
.
id
:
""
;
if
(
messageId
&&
xhr
)
xhr
.
messageId
=
messageId
;
MWF
.
runCallback
(
callback
,
"
failure
"
,
[
xhr
]);
break
;
}
}
else
{
var
messageId
=
(
messageItem
&&
messageItem
.
moduleMessage
)
?
messageItem
.
moduleMessage
.
data
.
id
:
""
;
if
(
messageId
&&
xhr
)
xhr
.
messageId
=
messageId
;
MWF
.
runCallback
(
callback
,
"
failure
"
,
[
xhr
]);
}
}
else
{
var
messageId
=
(
messageItem
&&
messageItem
.
moduleMessage
)
?
messageItem
.
moduleMessage
.
data
.
id
:
""
;
if
(
messageId
&&
xhr
)
xhr
.
messageId
=
messageId
;
MWF
.
runCallback
(
callback
,
"
failure
"
,
[
xhr
]);
}
},
...
...
o2web/source/x_component_Forum/Attachment.js
浏览文件 @
4c4815b7
...
...
@@ -81,28 +81,42 @@ MWF.xApplication.Forum.Attachment = new Class({
},
createUploadFileNode
:
function
()
{
this
.
attachmentController
.
doUploadAttachment
({
"
site
"
:
this
.
options
.
documentId
},
this
.
actions
.
action
,
"
uploadAttachment
"
,
{
"
id
"
:
this
.
options
.
documentId
,
"
documentid
"
:
this
.
options
.
documentId
},
null
,
function
(
o
){
j
=
o
;
if
(
j
.
data
)
{
//j.userMessage
var
aid
=
typeOf
(
j
.
data
)
==
"
object
"
?
j
.
data
.
id
:
j
.
data
[
0
].
id
;
this
.
actions
.
getAttachment
(
aid
,
this
.
options
.
documentId
,
function
(
json
)
{
json
=
this
.
transportData
(
json
);
if
(
json
.
data
)
{
this
.
attachmentController
.
addAttachment
(
json
.
data
,
o
.
messageId
);
//this.attachmentList.push(json.data);
}
this
.
attachmentController
.
checkActions
();
this
.
attachmentController
.
doUploadAttachment
(
{
"
site
"
:
this
.
options
.
documentId
},
this
.
actions
.
action
,
"
uploadAttachment
"
,
{
"
id
"
:
this
.
options
.
documentId
,
"
documentid
"
:
this
.
options
.
documentId
},
null
,
function
(
o
){
var
j
=
o
;
if
(
j
.
data
)
{
//j.userMessage
var
aid
=
typeOf
(
j
.
data
)
==
"
object
"
?
j
.
data
.
id
:
j
.
data
[
0
].
id
;
this
.
actions
.
getAttachment
(
aid
,
this
.
options
.
documentId
,
function
(
json
)
{
json
=
this
.
transportData
(
json
);
if
(
json
.
data
)
{
this
.
attachmentController
.
addAttachment
(
json
.
data
,
o
.
messageId
);
//this.attachmentList.push(json.data);
}
this
.
attachmentController
.
checkActions
();
this
.
fireEvent
(
"
upload
"
,
[
json
.
data
]);
this
.
fireEvent
(
"
change
"
);
}.
bind
(
this
))
this
.
fireEvent
(
"
upload
"
,
[
json
.
data
]);
this
.
fireEvent
(
"
change
"
);
}.
bind
(
this
))
}
this
.
attachmentController
.
checkActions
();
}.
bind
(
this
),
function
(
files
){
this
.
isQueryUploadSuccess
=
true
;
this
.
fireEvent
(
"
queryUploadAttachment
"
);
return
this
.
isQueryUploadSuccess
;
}.
bind
(
this
),
null
,
null
,
null
,
function
(
o
)
{
//错误的回调
if
(
o
.
messageId
&&
this
.
attachmentController
.
messageItemList
)
{
var
message
=
this
.
attachmentController
.
messageItemList
[
o
.
messageId
];
if
(
message
&&
message
.
node
)
message
.
node
.
destroy
();
}
this
.
attachmentController
.
checkActions
();
}.
bind
(
this
),
function
(
files
){
this
.
isQueryUploadSuccess
=
true
;
this
.
fireEvent
(
"
queryUploadAttachment
"
);
return
this
.
isQueryUploadSuccess
;
}.
bind
(
this
));
// this.uploadFileAreaNode = new Element("div");
// var html = "<input name=\"file\" type=\"file\" multiple/>";
...
...
o2web/source/x_component_cms_Xform/Attachment.js
浏览文件 @
4c4815b7
...
...
@@ -203,6 +203,7 @@ MWF.xApplication.cms.Xform.Attachment = MWF.CMSAttachment = new Class({
}
var
size
=
0
;
if
(
this
.
json
.
attachmentSize
)
size
=
this
.
json
.
attachmentSize
.
toFloat
();
debugger
;
this
.
attachmentController
.
doUploadAttachment
({
"
site
"
:
this
.
json
.
id
},
this
.
form
.
documentAction
.
action
,
"
uploadAttachment
"
,
{
"
id
"
:
this
.
form
.
businessData
.
document
.
id
},
null
,
function
(
o
)
{
if
(
o
.
id
)
{
this
.
form
.
documentAction
.
getAttachment
(
o
.
id
,
this
.
form
.
businessData
.
document
.
id
,
function
(
json
)
{
...
...
@@ -227,7 +228,12 @@ MWF.xApplication.cms.Xform.Attachment = MWF.CMSAttachment = new Class({
}
}
return
true
;
}.
bind
(
this
),
true
,
accept
,
size
);
}.
bind
(
this
),
true
,
accept
,
size
,
function
(
o
)
{
//错误的回调
if
(
o
.
messageId
&&
this
.
attachmentController
.
messageItemList
)
{
var
message
=
this
.
attachmentController
.
messageItemList
[
o
.
messageId
];
if
(
message
&&
message
.
node
)
message
.
node
.
destroy
();
}
}.
bind
(
this
));
// this.uploadFileAreaNode = new Element("div");
// var html = "<input name=\"file\" type=\"file\" multiple/>";
...
...
@@ -366,7 +372,12 @@ MWF.xApplication.cms.Xform.Attachment = MWF.CMSAttachment = new Class({
this
.
attachmentController
.
checkActions
();
}.
bind
(
this
))
}.
bind
(
this
),
null
);
}.
bind
(
this
),
null
,
true
,
accept
,
size
,
function
(
o
)
{
//错误的回调
if
(
o
.
messageId
&&
this
.
attachmentController
.
messageItemList
)
{
var
message
=
this
.
attachmentController
.
messageItemList
[
o
.
messageId
];
if
(
message
&&
message
.
node
)
message
.
node
.
destroy
();
}
}.
bind
(
this
));
// this.replaceFileAreaNode = new Element("div");
// var html = "<input name=\"file\" type=\"file\" multiple/>";
...
...
o2web/source/x_component_process_Xform/Attachment.js
浏览文件 @
4c4815b7
...
...
@@ -1210,7 +1210,12 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
}
}
return
true
;
}.
bind
(
this
),
true
,
accept
,
size
);
}.
bind
(
this
),
true
,
accept
,
size
,
function
(
o
)
{
//错误的回调
if
(
o
.
messageId
&&
this
.
attachmentController
.
messageItemList
)
{
var
message
=
this
.
attachmentController
.
messageItemList
[
o
.
messageId
];
if
(
message
&&
message
.
node
)
message
.
node
.
destroy
();
}
}.
bind
(
this
));
// this.uploadFileAreaNode = new Element("div");
...
...
@@ -1405,7 +1410,12 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
this
.
attachmentController
.
checkActions
();
}.
bind
(
this
))
}.
bind
(
this
),
null
,
true
,
accept
,
size
);
}.
bind
(
this
),
null
,
true
,
accept
,
size
,
function
(
o
)
{
//错误的回调
if
(
o
.
messageId
&&
this
.
attachmentController
.
messageItemList
)
{
var
message
=
this
.
attachmentController
.
messageItemList
[
o
.
messageId
];
if
(
message
&&
message
.
node
)
message
.
node
.
destroy
();
}
}.
bind
(
this
));
// this.replaceFileAreaNode = new Element("div");
// var html = "<input name=\"file\" type=\"file\" multiple/>";
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录