Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
82bb28dc
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
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,发现更多精彩内容 >>
提交
82bb28dc
编写于
9月 25, 2020
作者:
NoSubject
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
表单组件默认值等脚本,支持异步返回
上级
b9ba6ee4
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
618 addition
and
276 deletion
+618
-276
o2web/source/o2_core/o2.js
o2web/source/o2_core/o2.js
+66
-27
o2web/source/o2_core/o2/actionWorker.js
o2web/source/o2_core/o2/actionWorker.js
+2
-1
o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js
o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js
+15
-4
o2web/source/o2_core/o2/xDesktop/Common.js
o2web/source/o2_core/o2/xDesktop/Common.js
+6
-2
o2web/source/o2_core/o2/xScript/Environment.js
o2web/source/o2_core/o2/xScript/Environment.js
+484
-222
o2web/source/x_component_process_Xform/$Input.js
o2web/source/x_component_process_Xform/$Input.js
+15
-6
o2web/source/x_component_process_Xform/Label.js
o2web/source/x_component_process_Xform/Label.js
+13
-2
o2web/source/x_component_process_Xform/Org.js
o2web/source/x_component_process_Xform/Org.js
+17
-12
未找到文件。
o2web/source/o2_core/o2.js
浏览文件 @
82bb28dc
...
...
@@ -216,11 +216,11 @@
callback
.
apply
(
b
,
par
);
}
else
{
if
(
type
===
"
function
"
||
type
===
"
object
"
){
if
(
callback
[
key
]){
callback
[
key
].
apply
(
b
,
par
);
var
name
=
(
"
on-
"
+
key
).
camelCase
();
if
(
callback
[
name
]){
callback
[
name
].
apply
(
b
,
par
);
}
else
{
var
name
=
(
"
on-
"
+
key
).
camelCase
();
if
(
callback
[
name
])
callback
[
name
].
apply
(
b
,
par
);
if
(
callback
[
key
])
callback
[
key
].
apply
(
b
,
par
);
}
}
}
...
...
@@ -1365,7 +1365,6 @@
//var noCache = cache===false;
var
noCache
=
!
cache
;
//if (Browser.name == "ie")
if
(
_cacheUrls
.
length
){
for
(
var
i
=
0
;
i
<
_cacheUrls
.
length
;
i
++
){
...
...
@@ -1377,7 +1376,7 @@
}
}
var
useWebWorker
=
(
window
.
layout
&&
layout
.
config
&&
config
.
useWebWorker
);
var
useWebWorker
=
(
window
.
layout
&&
layout
.
config
&&
layout
.
config
.
useWebWorker
);
//var noCache = false;
if
(
!
loadAsync
||
!
useWebWorker
){
var
res
=
new
Request
.
JSON
({
...
...
@@ -1423,6 +1422,9 @@
}
//Content-Type application/x-www-form-urlencoded; charset=utf-8
res
.
send
(
data
);
var
oReturn
=
(
callback
.
success
&&
callback
.
success
.
addResolve
)
?
callback
.
success
:
callback
;
oReturn
.
res
=
res
;
return
oReturn
;
}
else
{
var
workerMessage
=
{
method
:
method
,
...
...
@@ -1449,8 +1451,13 @@
}
else
{
o2
.
runCallback
(
callback
,
"
failure
"
,
[
result
.
data
]);
}
actionWorker
.
terminate
();
}
actionWorker
.
postMessage
(
workerMessage
);
var
oReturn
=
(
callback
.
success
&&
callback
.
success
.
addResolve
)
?
callback
.
success
:
callback
;
oReturn
.
actionWorker
=
actionWorker
;
return
oReturn
;
//return callback;
}
//return res;
};
...
...
@@ -1615,19 +1622,29 @@
// }
// }
// });
Date
.
getFromServer
=
function
(
callback
){
if
(
callback
){
o2
.
Actions
.
get
(
"
x_program_center
"
).
echo
(
function
(
json
){
d
=
Date
.
parse
(
json
.
data
.
serverTime
);
o2
.
runCallback
(
callback
,
"
success
"
,
[
d
]);
});
}
else
{
var
d
;
o2
.
Actions
.
get
(
"
x_program_center
"
).
echo
(
function
(
json
){
d
=
Date
.
parse
(
json
.
data
.
serverTime
);
},
null
,
false
);
return
d
;
}
Date
.
getFromServer
=
function
(
async
){
var
d
;
var
cb
=
function
(
json
){
d
=
Date
.
parse
(
json
.
data
.
serverTime
);
return
d
;
}.
ag
().
catch
(
function
(
json
){
return
d
;
});
o2
.
Actions
.
get
(
"
x_program_center
"
).
echo
(
cb
,
null
,
!!
async
);
return
(
!!
async
)
?
cd
:
d
;
// if (callback){
// o2.Actions.get("x_program_center").echo(function(json){
// d = Date.parse(json.data.serverTime);
// o2.runCallback(callback, "success", [d]);
// });
// }else{
// var d;
// o2.Actions.get("x_program_center").echo(function(json){
// d = Date.parse(json.data.serverTime);
// }, null, false);
// return d;
// }
};
Object
.
appendChain
=
function
(
oChain
,
oProto
)
{
...
...
@@ -1679,7 +1696,7 @@
if
(
_self
.
success
.
resolve
)
result
=
_self
.
success
.
resolve
.
apply
(
this
,
arguments
);
if
(
_self
.
success
.
resolveList
){
_self
.
success
.
resolveList
.
each
(
function
(
r
){
r
(
result
,
arguments
)
;
r
esult
=
r
(
result
,
arguments
)
||
result
;
});
}
}
...
...
@@ -1691,7 +1708,7 @@
if
(
_self
.
failure
.
reject
)
result
=
_self
.
failure
.
reject
(
arguments
);
if
(
_self
.
failure
.
rejectList
){
_self
.
failure
.
rejectList
.
each
(
function
(
r
){
r
(
result
,
arguments
)
;
r
esult
=
r
(
result
,
arguments
)
||
result
;
});
}
}
...
...
@@ -1699,25 +1716,43 @@
setResolve
:
function
(
resolve
){
if
(
!
this
.
success
)
this
.
_createSuccess
();
this
.
success
.
resolve
=
resolve
;
return
this
;
},
setReject
:
function
(
reject
){
if
(
!
this
.
failure
)
this
.
_createFailure
();
this
.
reject
=
reject
;
this
.
failure
.
reject
=
reject
;
return
this
;
},
addResolve
:
function
(
resolve
){
if
(
!
this
.
success
)
this
.
_createSuccess
();
if
(
resolve
){
if
(
!
this
.
success
.
resolveList
)
this
.
success
.
resolveList
=
[];
this
.
success
.
resolveList
.
push
(
resolve
);
if
(
!
this
.
success
.
resolve
){
this
.
success
.
resolve
=
resolve
;
}
else
{
if
(
!
this
.
success
.
resolveList
)
this
.
success
.
resolveList
=
[];
this
.
success
.
resolveList
.
push
(
resolve
);
}
}
return
this
;
},
addReject
:
function
(
reject
){
if
(
!
this
.
failure
)
this
.
_createFailure
();
if
(
reject
){
if
(
!
this
.
success
.
rejectList
)
this
.
success
.
rejectList
=
[];
this
.
success
.
rejectList
.
push
(
reject
);
if
(
!
this
.
failure
.
reject
){
this
.
failure
.
reject
=
reject
;
}
else
{
if
(
!
this
.
failure
.
rejectList
)
this
.
failure
.
rejectList
=
[];
this
.
failure
.
rejectList
.
push
(
reject
);
}
}
}
return
this
;
},
then
:
function
(
resolve
){
return
this
.
addResolve
(
resolve
);
},
"
catch
"
:
function
(
reject
){
return
this
.
addReject
(
reject
);
},
});
var
_AsyncGenerator
=
function
(
resolve
,
reject
,
name
){
var
asyncGeneratorPrototype
=
new
_AsyncGeneratorPrototype
(
resolve
,
reject
,
name
);
...
...
@@ -1726,6 +1761,10 @@
o2
.
AsyncGenerator
=
o2
.
AG
=
_AsyncGenerator
;
Function
.
prototype
.
ag
=
function
(){
return
o2
.
AG
(
this
);
}
})();
o2
.
core
=
true
;
...
...
o2web/source/o2_core/o2/actionWorker.js
浏览文件 @
82bb28dc
...
...
@@ -58,15 +58,16 @@ function V(httpRequest) {
json
.
xToken
=
xToken
;
}
_worker
.
postMessage
({
"
type
"
:
"
done
"
,
"
data
"
:
json
});
_worker
.
close
();
},
_errorRequest
:
function
(){
_worker
.
postMessage
({
"
type
"
:
"
error
"
,
"
data
"
:
{
"
status
"
:
this
.
request
.
status
,
"
statusText
"
:
this
.
request
.
statusText
,
"
responseText
"
:
this
.
request
.
responseText
}});
_worker
.
close
();
}
};
this
.
action
=
_action
;
})();
debugger
;
onmessage
=
function
(
e
)
{
debugger
;
...
...
o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js
浏览文件 @
82bb28dc
...
...
@@ -92,6 +92,10 @@ MWF.xDesktop.Actions.RestActions = new Class({
var
async
=
(
option
.
async
===
false
)
?
false
:
true
;
if
(
option
.
failure
&&
option
.
failure
.
failure
)
option
.
failure
=
option
.
failure
.
failure
;
if
(
!
option
.
failure
&&
option
.
success
&&
option
.
success
.
failure
){
option
.
failure
=
option
.
success
.
failure
;
option
.
failure
.
owner
=
option
.
success
;
}
var
callback
=
new
MWF
.
xDesktop
.
Actions
.
RestActions
.
Callback
(
option
.
success
,
option
.
failure
);
if
(
action
.
enctype
&&
(
action
.
enctype
.
toLowerCase
()
==
"
formdata
"
)){
...
...
@@ -555,16 +559,16 @@ MWF.xDesktop.Actions.RestActions.Callback = new Class({
switch
(
responseJSON
.
type
)
{
case
"
success
"
:
if
(
this
.
appendSuccess
)
this
.
appendSuccess
(
responseJSON
);
if
(
this
.
success
)
this
.
success
(
responseJSON
,
responseText
);
if
(
this
.
success
)
return
this
.
success
(
responseJSON
,
responseText
);
break
;
case
"
warn
"
:
MWF
.
xDesktop
.
notice
(
"
info
"
,
{
x
:
"
right
"
,
y
:
"
top
"
},
responseJSON
.
errorMessage
.
join
(
"
\n
"
));
if
(
this
.
appendSuccess
)
this
.
appendSuccess
(
responseJSON
);
if
(
this
.
success
)
this
.
success
(
responseJSON
);
if
(
this
.
success
)
return
this
.
success
(
responseJSON
);
break
;
case
"
error
"
:
this
.
doError
(
null
,
responseText
,
responseJSON
.
message
);
return
this
.
doError
(
null
,
responseText
,
responseJSON
.
message
);
break
;
}
}
else
{
...
...
@@ -582,7 +586,14 @@ MWF.xDesktop.Actions.RestActions.Callback = new Class({
},
doError
:
function
(
xhr
,
text
,
error
){
if
(
this
.
appendFailure
)
this
.
appendFailure
(
xhr
,
text
,
error
);
if
(
this
.
failure
)
this
.
failure
(
xhr
,
text
,
error
);
if
(
this
.
failure
&&
this
.
failure
.
owner
){
if
(
this
.
failure
.
reject
||
(
this
.
failure
.
rejectList
&&
this
.
failure
.
rejectList
.
length
)){
return
this
.
failure
(
xhr
,
text
,
error
);
}
this
.
failure
=
null
;
}
else
{
if
(
this
.
failure
)
return
this
.
failure
(
xhr
,
text
,
error
);
}
if
(
!
this
.
failure
&&
!
this
.
appendFailure
){
if
(
xhr
.
status
!=
0
){
var
errorText
=
error
;
...
...
o2web/source/o2_core/o2/xDesktop/Common.js
浏览文件 @
82bb28dc
...
...
@@ -492,14 +492,18 @@ MWF.xDesktop.getServiceAddressConfigArray = function(config, callback, error) {
config
.
center
.
each
(
function
(
center
){
requests
.
push
(
MWF
.
xDesktop
.
getServiceAddressConfigObject
(
center
,
function
(
serviceAddressList
,
center
){
debugger
;
requests
.
each
(
function
(
res
){
if
(
res
)
if
(
res
.
isRunning
()){
res
.
cancel
();}
if
(
res
&&
res
.
res
)
if
(
res
.
res
.
isRunning
()){
res
.
res
.
cancel
();}
if
(
res
&&
res
.
actionWorker
)
res
.
actionWorker
.
terminate
();
});
if
(
callback
)
callback
(
serviceAddressList
,
center
);
}.
bind
(
this
),
function
(){
debugger
;
if
(
requests
.
length
){
for
(
var
i
=
0
;
i
<
requests
.
length
;
i
++
){
if
(
requests
[
i
].
isRunning
())
return
""
;
if
(
requests
[
i
].
res
)
if
(
requests
[
i
].
res
.
isRunning
())
return
""
;
if
(
requests
[
i
].
actionWorker
&&
requests
[
i
].
actionWorker
.
terminate
)
return
""
;
}
}
if
(
error
)
error
();
...
...
o2web/source/o2_core/o2/xScript/Environment.js
浏览文件 @
82bb28dc
此差异已折叠。
点击以展开。
o2web/source/x_component_process_Xform/$Input.js
浏览文件 @
82bb28dc
...
...
@@ -184,11 +184,13 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({
},
getValue
:
function
(){
var
value
=
this
.
_getBusinessData
();
if
(
!
value
&&
this
.
moduleValueAG
)
value
=
this
.
moduleValueAG
;
if
(
!
value
)
value
=
this
.
_computeValue
();
return
value
||
""
;
},
_setValue
:
function
(
value
){
if
(
o2
.
typeOf
(
value
)
===
"
function
"
&&
value
.
addResolve
){
this
.
moduleValueAG
=
value
;
value
.
addResolve
(
function
(
v
){
this
.
_setValue
(
v
);
// this._setBusinessData(v);
...
...
@@ -199,6 +201,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({
this
.
_setBusinessData
(
value
);
if
(
this
.
node
.
getFirst
())
this
.
node
.
getFirst
().
set
(
"
value
"
,
value
||
""
);
if
(
this
.
readonly
||
this
.
json
.
isReadonly
)
this
.
node
.
set
(
"
text
"
,
value
);
this
.
moduleValueAG
=
null
;
}
},
_loadValue
:
function
(){
...
...
@@ -250,13 +253,19 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({
this
.
setData
(
this
.
getValue
());
},
setData
:
function
(
data
){
this
.
_setBusinessData
(
data
);
if
(
this
.
node
.
getFirst
()){
this
.
node
.
getFirst
().
set
(
"
value
"
,
data
);
this
.
checkDescription
();
this
.
validationMode
();
if
(
o2
.
typeOf
(
data
)
===
"
function
"
&&
data
.
addResolve
){
data
.
addResolve
(
function
(
v
){
this
.
setData
(
v
);
}.
bind
(
this
));
}
else
{
this
.
node
.
set
(
"
text
"
,
data
);
this
.
_setBusinessData
(
data
);
if
(
this
.
node
.
getFirst
()){
this
.
node
.
getFirst
().
set
(
"
value
"
,
data
);
this
.
checkDescription
();
this
.
validationMode
();
}
else
{
this
.
node
.
set
(
"
text
"
,
data
);
}
}
},
...
...
o2web/source/x_component_process_Xform/Label.js
浏览文件 @
82bb28dc
...
...
@@ -10,7 +10,9 @@ MWF.xApplication.process.Xform.Label = MWF.APPLabel = new Class({
if
(
this
.
json
.
valueType
==
"
script
"
){
var
code
=
(
this
.
json
.
script
)
?
this
.
json
.
script
.
code
:
""
;
if
(
code
){
this
.
node
.
set
(
"
text
"
,
this
.
form
.
Macro
.
exec
(
code
,
this
)
||
""
);
var
value
=
this
.
form
.
Macro
.
exec
(
code
,
this
);
this
.
_setNodeText
(
value
);
//this.node.set("text", this.form.Macro.exec(code, this) || "");
}
}
if
(
this
.
json
.
prefixIcon
||
this
.
json
.
suffixIcon
){
...
...
@@ -41,7 +43,16 @@ MWF.xApplication.process.Xform.Label = MWF.APPLabel = new Class({
}
}
},
_setNodeText
:
function
(
value
){
if
(
o2
.
typeOf
(
value
)
===
"
function
"
&&
value
.
addResolve
){
value
.
addResolve
(
function
(
v
){
this
.
_setNodeText
(
v
);
}.
bind
(
this
));
}
else
{
this
.
node
.
set
(
"
text
"
,
value
||
""
);
}
},
setText
:
function
(
text
){
this
.
node
.
set
(
"
text
"
,
text
);
}
});
\ No newline at end of file
});
o2web/source/x_component_process_Xform/Org.js
浏览文件 @
82bb28dc
...
...
@@ -868,21 +868,26 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({
_setValue
:
function
(
value
){
debugger
;
if
(
o2
.
typeOf
(
value
)
===
"
object
"
&&
value
.
resolve
){
var
simple
=
this
.
json
.
storeRange
===
"
simple
"
;
var
values
=
value
.
values
;
value
.
resolve
.
addResolve
(
function
(
fd
){
if
(
typeOf
(
fd
)
!==
"
array
"
)
fd
=
(
fd
)
?
[
fd
]
:
[];
fd
.
each
(
function
(
fdd
){
if
(
fdd
){
if
(
typeOf
(
fdd
)
===
"
string
"
){
var
data
;
this
.
getOrgAction
()[
this
.
getValueMethod
(
fdd
)](
function
(
json
){
data
=
MWF
.
org
.
parseOrgData
(
json
.
data
,
true
,
simple
);
}.
bind
(
this
),
null
,
fdd
,
false
);
values
.
push
(
data
);
}
else
{
values
.
push
(
fdd
);
if
(
o2
.
typeOf
(
fd
)
===
"
function
"
&&
fd
.
addResolve
){
this
.
_setValue
({
"
values
"
:
values
,
"
resolve
"
:
fd
});
}
else
{
if
(
typeOf
(
fd
)
!==
"
array
"
)
fd
=
(
fd
)
?
[
fd
]
:
[];
fd
.
each
(
function
(
fdd
){
if
(
fdd
){
if
(
typeOf
(
fdd
)
===
"
string
"
){
var
data
;
this
.
getOrgAction
()[
this
.
getValueMethod
(
fdd
)](
function
(
json
){
data
=
MWF
.
org
.
parseOrgData
(
json
.
data
,
true
,
simple
);
}.
bind
(
this
),
null
,
fdd
,
false
);
values
.
push
(
data
);
}
else
{
values
.
push
(
fdd
);
}
}
}
}.
bind
(
this
)
);
this
.
__setValue
(
values
);
}
.
bind
(
this
));
this
.
__setValue
(
values
);
}
}.
bind
(
this
));
}
else
{
this
.
__setValue
(
value
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录