Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
9505c9a2
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,发现更多精彩内容 >>
提交
9505c9a2
编写于
9月 15, 2021
作者:
NoSubject
提交者:
NoSubject
9月 15, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复setData方法的,增加fireChange参数
(cherry picked from commit
26a0fc4f
)
上级
c51a7be6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
33 addition
and
38 deletion
+33
-38
o2web/source/x_component_process_Xform/$Input.js
o2web/source/x_component_process_Xform/$Input.js
+6
-5
o2web/source/x_component_process_Xform/Checkbox.js
o2web/source/x_component_process_Xform/Checkbox.js
+9
-8
o2web/source/x_component_process_Xform/Org.js
o2web/source/x_component_process_Xform/Org.js
+3
-10
o2web/source/x_component_process_Xform/Radio.js
o2web/source/x_component_process_Xform/Radio.js
+8
-8
o2web/source/x_component_process_Xform/Select.js
o2web/source/x_component_process_Xform/Select.js
+7
-7
未找到文件。
o2web/source/x_component_process_Xform/$Input.js
浏览文件 @
9505c9a2
...
...
@@ -354,6 +354,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class(
* 当表单上没有对应组件的时候,可以使用this.data[fieldId] = data赋值。
* @summary 为组件赋值。
* @param data{String|Promise} .
* @param fireChange{boolean} 可选,是否触发change事件,默认false.
* @example
* this.form.get("fieldId").setData("test"); //赋文本值
* @example
...
...
@@ -370,7 +371,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class(
* var promise = dict.get("tools", true); //异步使用数据字典的get方法时返回Promise,参数true表示异步
* field.setData( promise );
*/
setData
:
function
(
data
){
setData
:
function
(
data
,
fireChange
){
// if (data && data.isAG){
// var ag = o2.AG.all(data).then(function(v){
// if (o2.typeOf(v)=="array") v = v[0];
...
...
@@ -383,7 +384,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class(
// }else{
if
(
!!
data
&&
o2
.
typeOf
(
data
.
then
)
==
"
function
"
){
var
p
=
o2
.
promiseAll
(
data
).
then
(
function
(
v
){
this
.
__setData
(
v
);
this
.
__setData
(
v
,
fireChange
);
// if (this.node.getFirst() && !this.readonly && !this.json.isReadonly) {
// this.checkDescription();
// this.validationMode();
...
...
@@ -397,7 +398,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class(
}.
bind
(
this
));
}
else
{
this
.
moduleValueAG
=
null
;
this
.
__setData
(
data
);
this
.
__setData
(
data
,
fireChange
);
// if (this.node.getFirst() && !this.readonly && !this.json.isReadonly) {
// this.checkDescription();
// this.validationMode();
...
...
@@ -406,7 +407,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class(
//this.__setData(data);
//}
},
__setData
:
function
(
data
){
__setData
:
function
(
data
,
fireChange
){
var
old
=
this
.
getInputData
();
this
.
_setBusinessData
(
data
);
if
(
this
.
node
.
getFirst
()){
...
...
@@ -416,7 +417,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class(
}
else
{
this
.
node
.
set
(
"
text
"
,
data
);
}
if
(
old
!==
data
)
this
.
fireEvent
(
"
change
"
);
if
(
fireChange
&&
old
!==
data
)
this
.
fireEvent
(
"
change
"
);
this
.
moduleValueAG
=
null
;
},
...
...
o2web/source/x_component_process_Xform/Checkbox.js
浏览文件 @
9505c9a2
...
...
@@ -217,7 +217,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
}.
bind
(
this
));
},
_setValue
:
function
(
value
,
m
){
_setValue
:
function
(
value
,
m
,
fireChange
){
var
mothed
=
m
||
"
__setValue
"
;
if
(
!!
value
){
var
p
=
o2
.
promiseAll
(
value
).
then
(
function
(
v
){
...
...
@@ -225,11 +225,11 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
if
(
this
.
moduleSelectAG
){
this
.
moduleValueAG
=
this
.
moduleSelectAG
;
this
.
moduleSelectAG
.
then
(
function
(){
this
[
mothed
](
v
);
this
[
mothed
](
v
,
fireChange
);
return
v
;
}.
bind
(
this
),
function
(){});
}
else
{
this
[
mothed
](
v
)
this
[
mothed
](
v
,
fireChange
)
}
return
v
;
}.
bind
(
this
),
function
(){});
...
...
@@ -240,7 +240,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
this
.
moduleValueAG
=
null
;
}.
bind
(
this
));
}
else
{
this
[
mothed
](
value
);
this
[
mothed
](
value
,
fireChange
);
}
...
...
@@ -339,6 +339,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
/**当参数为Promise的时候,请查看文档: {@link https://www.yuque.com/o2oa/ixsnyt/ws07m0|使用Promise处理表单异步}
* @summary 为字段赋值,并且使值对应的选项选中。
* @param data{String|Promise} .
* @param fireChange{boolean} 可选,是否触发change事件,默认false.
* @example
* this.form.get("fieldId").setData("test"); //赋文本值
* @example
...
...
@@ -348,8 +349,8 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
* var promise = dict.get("tools", true); //异步使用数据字典的get方法时返回Promise,参数true表示异步
* field.setData( promise );
*/
setData
:
function
(
data
){
return
this
.
_setValue
(
data
,
"
__setData
"
);
setData
:
function
(
data
,
fireChange
){
return
this
.
_setValue
(
data
,
"
__setData
"
,
fireChange
);
// if (data && data.isAG){
// this.moduleValueAG = data;
// data.addResolve(function(v){
...
...
@@ -361,7 +362,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
// }
},
__setData
:
function
(
data
){
__setData
:
function
(
data
,
fireChange
){
this
.
moduleValueAG
=
null
;
var
old
=
this
.
getInputData
();
this
.
_setBusinessData
(
data
);
...
...
@@ -387,7 +388,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
}
this
.
fieldModuleLoaded
=
true
;
this
.
fireEvent
(
"
setData
"
);
if
(
old
!==
data
)
this
.
fireEvent
(
"
change
"
);
if
(
fireChange
&&
old
!==
data
)
this
.
fireEvent
(
"
change
"
);
},
notValidationMode
:
function
(
text
){
...
...
o2web/source/x_component_process_Xform/Org.js
浏览文件 @
9505c9a2
...
...
@@ -1021,24 +1021,17 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class(
}
if
(
change
)
this
.
fireEvent
(
"
change
"
);
},
setData
:
function
(
value
){
setData
:
function
(
value
,
fireChange
){
if
(
!
value
)
return
false
;
var
oldValues
=
this
.
getData
();
if
(
value
.
length
==
1
&&
!
(
value
[
0
]))
value
=
[];
var
promise
=
this
.
_setValue
(
value
);
Promise
.
resolve
(
promise
).
then
(
function
(
values
){
if
(
fireChange
)
Promise
.
resolve
(
promise
).
then
(
function
(
values
){
o2
.
promiseAll
(
values
).
then
(
function
(
v
){
this
.
checkChange
(
oldValues
,
v
)
}.
bind
(
this
),
function
(){});
// if (values && values.isAG){
// values.then(function(v){
// this.checkChange(oldValues, v)
// }.bind(this));
// }else{
// this.checkChange(oldValues, values)
// }
}.
bind
(
this
),
function
(){});
},
// __setData: function(value){
...
...
o2web/source/x_component_process_Xform/Radio.js
浏览文件 @
9505c9a2
...
...
@@ -288,7 +288,7 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class(
// }.bind(this));
},
_setValue
:
function
(
value
,
m
){
_setValue
:
function
(
value
,
m
,
fireChange
){
var
mothed
=
m
||
"
__setValue
"
;
if
(
!!
value
){
var
p
=
o2
.
promiseAll
(
value
).
then
(
function
(
v
){
...
...
@@ -296,11 +296,11 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class(
if
(
this
.
moduleSelectAG
){
this
.
moduleValueAG
=
this
.
moduleSelectAG
;
this
.
moduleSelectAG
.
then
(
function
(){
this
[
mothed
](
v
);
this
[
mothed
](
v
,
fireChange
);
return
v
;
}.
bind
(
this
),
function
(){});
}
else
{
this
[
mothed
](
v
)
this
[
mothed
](
v
,
fireChange
)
}
return
v
;
}.
bind
(
this
),
function
(){});
...
...
@@ -312,7 +312,7 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class(
this
.
moduleValueAG
=
null
;
}.
bind
(
this
));
}
else
{
this
[
mothed
](
value
);
this
[
mothed
](
value
,
fireChange
);
}
...
...
@@ -411,8 +411,8 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class(
return
null
;
},
setData
:
function
(
data
){
return
this
.
_setValue
(
data
,
"
__setData
"
);
setData
:
function
(
data
,
fireChange
){
return
this
.
_setValue
(
data
,
"
__setData
"
,
fireChange
);
// if (data && data.isAG){
// this.moduleValueAG = o2.AG.all(data).then(function(v){
// if (o2.typeOf(v)=="array") v = v[0];
...
...
@@ -433,7 +433,7 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class(
// }
},
__setData
:
function
(
data
){
__setData
:
function
(
data
,
fireChange
){
this
.
moduleValueAG
=
null
;
var
old
=
this
.
getInputData
();
this
.
_setBusinessData
(
data
);
...
...
@@ -451,7 +451,7 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class(
}
this
.
fieldModuleLoaded
=
true
;
this
.
fireEvent
(
"
setData
"
);
if
(
old
!==
data
)
this
.
fireEvent
(
"
change
"
);
if
(
fireChange
&&
old
!==
data
)
this
.
fireEvent
(
"
change
"
);
},
notValidationMode
:
function
(
text
){
...
...
o2web/source/x_component_process_Xform/Select.js
浏览文件 @
9505c9a2
...
...
@@ -278,7 +278,7 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect = new Class(
this
.
fireEvent
(
"
addOption
"
,
[
text
,
value
])
},
_setValue
:
function
(
value
,
m
){
_setValue
:
function
(
value
,
m
,
fireChange
){
var
mothed
=
m
||
"
__setValue
"
;
if
(
!!
value
){
var
p
=
o2
.
promiseAll
(
value
).
then
(
function
(
v
){
...
...
@@ -286,11 +286,11 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect = new Class(
if
(
this
.
moduleSelectAG
){
this
.
moduleValueAG
=
this
.
moduleSelectAG
;
this
.
moduleSelectAG
.
then
(
function
(){
this
[
mothed
](
v
);
this
[
mothed
](
v
,
fireChange
);
return
v
;
}.
bind
(
this
),
function
(){});
}
else
{
this
[
mothed
](
v
)
this
[
mothed
](
v
,
fireChange
)
}
return
v
;
}.
bind
(
this
),
function
(){});
...
...
@@ -302,7 +302,7 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect = new Class(
this
.
moduleValueAG
=
null
;
}.
bind
(
this
));
}
else
{
this
[
mothed
](
value
);
this
[
mothed
](
value
,
fireChange
);
}
...
...
@@ -424,8 +424,8 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect = new Class(
this
.
setData
(
this
.
getValue
());
},
setData
:
function
(
data
){
return
this
.
_setValue
(
data
,
"
__setData
"
);
setData
:
function
(
data
,
fireChange
){
return
this
.
_setValue
(
data
,
"
__setData
"
,
fireChange
);
// if (data && data.isAG){
// this.moduleValueAG = o2.AG.all(data).then(function(v){
// if (o2.typeOf(v)=="array") v = v[0];
...
...
@@ -478,7 +478,7 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect = new Class(
}
this
.
fieldModuleLoaded
=
true
;
this
.
fireEvent
(
"
setData
"
,
[
data
]);
if
(
old
!==
data
)
this
.
fireEvent
(
"
change
"
);
if
(
fireChange
&&
old
!==
data
)
this
.
fireEvent
(
"
change
"
);
}
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录