Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
1a9ebebf
o2oa
项目概览
fuyue82
/
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,发现更多精彩内容 >>
提交
1a9ebebf
编写于
4月 13, 2022
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
为数据表格、数据模板添加afterImport事件,修复数据表格、数据模板的resetData问题
上级
539cc2b8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
63 addition
and
18 deletion
+63
-18
o2web/source/x_component_process_FormDesigner/Module/Datatable/template.json
...onent_process_FormDesigner/Module/Datatable/template.json
+4
-0
o2web/source/x_component_process_FormDesigner/Module/Datatemplate/template.json
...nt_process_FormDesigner/Module/Datatemplate/template.json
+4
-0
o2web/source/x_component_process_Xform/DatatablePC.js
o2web/source/x_component_process_Xform/DatatablePC.js
+23
-9
o2web/source/x_component_process_Xform/Datatemplate.js
o2web/source/x_component_process_Xform/Datatemplate.js
+32
-9
未找到文件。
o2web/source/x_component_process_FormDesigner/Module/Datatable/template.json
浏览文件 @
1a9ebebf
...
...
@@ -77,6 +77,10 @@
"code"
:
""
,
"html"
:
""
},
"afterImport"
:
{
"code"
:
""
,
"html"
:
""
},
"click"
:
{
"code"
:
""
,
"html"
:
""
...
...
o2web/source/x_component_process_FormDesigner/Module/Datatemplate/template.json
浏览文件 @
1a9ebebf
...
...
@@ -62,6 +62,10 @@
"code"
:
""
,
"html"
:
""
},
"afterImport"
:
{
"code"
:
""
,
"html"
:
""
},
"click"
:
{
"code"
:
""
,
"html"
:
""
...
...
o2web/source/x_component_process_Xform/DatatablePC.js
浏览文件 @
1a9ebebf
...
...
@@ -165,8 +165,13 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
* @event MWF.xApplication.process.Xform.DatatablePC#import
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 在导入excel,数据设置回数据表格以后触发,this.event指向整理过的导入数据,格式见{@link DatatableData}。
* @event MWF.xApplication.process.Xform.DatatablePC#afterImport
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
"
moduleEvents
"
:
[
"
queryLoad
"
,
"
postLoad
"
,
"
load
"
,
"
afterLoad
"
,
"
beforeLoadLine
"
,
"
afterLoadLine
"
,
"
addLine
"
,
"
deleteLine
"
,
"
afterDeleteLine
"
,
"
editLine
"
,
"
completeLineEdit
"
,
"
cancelLineEdit
"
,
"
export
"
,
"
import
"
,
"
validImport
"
]
"
beforeLoadLine
"
,
"
afterLoadLine
"
,
"
addLine
"
,
"
deleteLine
"
,
"
afterDeleteLine
"
,
"
editLine
"
,
"
completeLineEdit
"
,
"
cancelLineEdit
"
,
"
export
"
,
"
import
"
,
"
validImport
"
,
"
afterImport
"
]
},
initialize
:
function
(
node
,
json
,
form
,
options
){
...
...
@@ -476,13 +481,10 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
this
.
table
.
setStyles
(
this
.
json
.
tableStyles
);
this
.
table
.
set
(
this
.
json
.
properties
);
},
_getValue
:
function
(){
if
(
this
.
moduleValueAG
)
return
this
.
moduleValueAG
;
var
value
=
this
.
_getBusinessData
();
if
(
!
value
){
if
(
this
.
json
.
defaultData
&&
this
.
json
.
defaultData
.
code
)
value
=
this
.
form
.
Macro
.
exec
(
this
.
json
.
defaultData
.
code
,
this
);
if
(
value
&&
!
value
.
then
)
if
(
o2
.
typeOf
(
value
)
===
"
array
"
)
value
=
{
"
data
"
:
value
||
[],
"
total
"
:{}};
}
getDefaultValue
:
function
(){
var
value
;
if
(
this
.
json
.
defaultData
&&
this
.
json
.
defaultData
.
code
)
value
=
this
.
form
.
Macro
.
exec
(
this
.
json
.
defaultData
.
code
,
this
);
if
(
value
&&
!
value
.
then
)
if
(
o2
.
typeOf
(
value
)
===
"
array
"
)
value
=
{
"
data
"
:
value
||
[],
"
total
"
:{}};
if
(
!
value
&&
this
.
multiEditMode
){
value
=
{
"
data
"
:
[],
"
total
"
:{}};
var
count
=
this
.
json
.
defaultCount
?
this
.
json
.
defaultCount
.
toInt
()
:
0
;
...
...
@@ -490,6 +492,14 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
value
.
data
.
push
({})
}
}
return
value
;
},
_getValue
:
function
(){
if
(
this
.
moduleValueAG
)
return
this
.
moduleValueAG
;
var
value
=
this
.
_getBusinessData
();
if
(
!
value
){
value
=
this
.
getDefaultValue
();
}
return
value
||
{
"
data
"
:
[],
"
total
"
:{}};
},
getValue
:
function
(){
...
...
@@ -828,7 +838,8 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
* this.form.get('fieldId').resetData();
*/
resetData
:
function
(){
this
.
setData
(
this
.
_getValue
());
var
value
=
this
.
getDefaultValue
()
||
{
"
data
"
:
[],
"
total
"
:{}};
this
.
setData
(
value
);
},
/**当参数为Promise的时候,请查看文档: {@link https://www.yuque.com/o2oa/ixsnyt/ws07m0|使用Promise处理表单异步}<br/>
* 当表单上没有对应组件的时候,可以使用this.data[fieldId] = data赋值。
...
...
@@ -2400,6 +2411,9 @@ MWF.xApplication.process.Xform.DatatablePC.Importer = new Class({
this
.
datatable
.
fireEvent
(
"
import
"
,
[
data
]
);
this
.
datatable
.
setData
(
{
"
data
"
:
data
}
);
this
.
datatable
.
fireEvent
(
"
afterImport
"
,
[
data
]
);
this
.
form
.
notice
(
MWF
.
xApplication
.
process
.
Xform
.
LP
.
importSuccess
);
},
...
...
o2web/source/x_component_process_Xform/Datatemplate.js
浏览文件 @
1a9ebebf
...
...
@@ -144,8 +144,13 @@ MWF.xApplication.process.Xform.Datatemplate = MWF.APPDatatemplate = new Class(
* @event MWF.xApplication.process.Xform.Datatemplate#import
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 在导入excel,数据设置回数据模板以后触发,this.event指向整理过的导入数据,格式见{@link DatatemplateData}。
* @event MWF.xApplication.process.Xform.Datatemplate#afterImport
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
"
moduleEvents
"
:
[
"
queryLoad
"
,
"
postLoad
"
,
"
load
"
,
"
afterLoad
"
,
"
beforeLoadLine
"
,
"
afterLoadLine
"
,
"
addLine
"
,
"
deleteLine
"
,
"
afterDeleteLine
"
,
"
export
"
,
"
import
"
,
"
validImport
"
]
"
beforeLoadLine
"
,
"
afterLoadLine
"
,
"
addLine
"
,
"
deleteLine
"
,
"
afterDeleteLine
"
,
"
export
"
,
"
import
"
,
"
validImport
"
,
"
afterImport
"
]
},
initialize
:
function
(
node
,
json
,
form
,
options
){
...
...
@@ -326,13 +331,10 @@ MWF.xApplication.process.Xform.Datatemplate = MWF.APPDatatemplate = new Class(
//去要表单的所有组件加载完成以后再去获取外部组件
this
.
form
.
addEvent
(
"
afterModulesLoad
"
,
this
.
bindEvent
);
},
_getValue
:
function
(){
if
(
this
.
moduleValueAG
)
return
this
.
moduleValueAG
;
var
value
=
this
.
_getBusinessData
();
if
(
!
value
){
if
(
this
.
json
.
defaultData
&&
this
.
json
.
defaultData
.
code
)
value
=
this
.
form
.
Macro
.
exec
(
this
.
json
.
defaultData
.
code
,
this
);
if
(
value
&&
!
value
.
then
)
if
(
o2
.
typeOf
(
value
)
===
"
object
"
)
value
=
[
value
];
}
getDefaultValue
:
function
(){
var
value
;
if
(
this
.
json
.
defaultData
&&
this
.
json
.
defaultData
.
code
)
value
=
this
.
form
.
Macro
.
exec
(
this
.
json
.
defaultData
.
code
,
this
);
if
(
value
&&
!
value
.
then
)
if
(
o2
.
typeOf
(
value
)
===
"
object
"
)
value
=
[
value
];
if
(
!
value
){
value
=
[];
var
count
=
this
.
json
.
defaultCount
?
this
.
json
.
defaultCount
.
toInt
()
:
0
;
...
...
@@ -340,6 +342,23 @@ MWF.xApplication.process.Xform.Datatemplate = MWF.APPDatatemplate = new Class(
}
return
value
;
},
_getValue
:
function
(){
if
(
this
.
moduleValueAG
)
return
this
.
moduleValueAG
;
var
value
=
this
.
_getBusinessData
();
if
(
!
value
){
value
=
this
.
getDefaultValue
();
}
// if (!value){
// if (this.json.defaultData && this.json.defaultData.code) value = this.form.Macro.exec(this.json.defaultData.code, this);
// if (value && !value.then) if (o2.typeOf(value)==="object") value = [value];
// }
// if(!value){
// value = [];
// var count = this.json.defaultCount ? this.json.defaultCount.toInt() : 0;
// for( var i=0; i<count; i++ )value.push({})
// }
return
value
;
},
getValue
:
function
(){
return
this
.
_getValue
();
},
...
...
@@ -623,7 +642,8 @@ MWF.xApplication.process.Xform.Datatemplate = MWF.APPDatatemplate = new Class(
* this.form.get('fieldId').resetData();
*/
resetData
:
function
(){
this
.
setData
(
this
.
_getValue
());
var
value
=
this
.
getDefaultValue
()
||
[];
this
.
setData
(
value
);
},
/**当参数为Promise的时候,请查看文档: {@link https://www.yuque.com/o2oa/ixsnyt/ws07m0|使用Promise处理表单异步}<br/>
* 当表单上没有对应组件的时候,可以使用this.data[fieldId] = data赋值。
...
...
@@ -1802,6 +1822,9 @@ MWF.xApplication.process.Xform.Datatemplate.Importer = new Class({
this
.
template
.
fireEvent
(
"
import
"
,
[
data
]
);
this
.
template
.
setData
(
data
);
this
.
template
.
fireEvent
(
"
afterImport
"
,
[
data
]
);
this
.
form
.
notice
(
MWF
.
xApplication
.
process
.
Xform
.
LP
.
importSuccess
);
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录