Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Laurel Lee
O2OA
Commits
3e87f74e
Commit
3e87f74e
authored
3 years ago
by
unknown
Browse files
Options
Download
Email Patches
Plain Diff
api添加getSource和currentEditedLine
parent
351cc0f5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
o2web/source/x_component_process_Xform/$Module.js
+23
-0
o2web/source/x_component_process_Xform/$Module.js
o2web/source/x_component_process_Xform/DatatablePC.js
+16
-0
o2web/source/x_component_process_Xform/DatatablePC.js
o2web/source/x_component_process_Xform/Source.js
+6
-0
o2web/source/x_component_process_Xform/Source.js
o2web/source/x_component_process_Xform/SubSource.js
+6
-0
o2web/source/x_component_process_Xform/SubSource.js
with
51 additions
and
0 deletions
+51
-0
o2web/source/x_component_process_Xform/$Module.js
+
23
-
0
View file @
3e87f74e
...
...
@@ -80,6 +80,29 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module = new Class(
*/
this
.
parentLine
=
null
;
},
/**
* 当前组件在数据源组件中时,可以通过此方法获取所在的上级数据源/子数据源/子数项组件.
* @param {String} [type] 需要获取的类型,"source"为表示数据源,"subSource"表示子数据源,"subSourceItem"表示子数据项组件。
* 如果该参数省略,则获取离当前组件最近的上述组件。
* @return {MWF.xApplication.process.Xform.Source|MWF.xApplication.process.Xform.SubSource|MWF.xApplication.process.Xform.SubSourceItem}。
* @example
* var source = this.target.getSource(); //获取当前组件的所在子上级数据源/子数据源/子数项组件.
* var data = source.data; //获取数据源的值
*
* var source = this.form.get("fieldId").getSource("source"); //获取数据源组件
* var data = source.data; //获取数据源的值
*/
getSource
:
function
(
type
){
if
(
type
){
var
parent
=
this
.
node
.
getParent
();
while
(
parent
&&
parent
.
get
(
"
MWFtype
"
)
!=
type
){
parent
=
parent
.
getParent
();
}
return
(
parent
)
?
parent
.
retrieve
(
"
module
"
)
:
null
;
}
else
{
return
this
.
_getSource
();
}
},
_getSource
:
function
(){
var
parent
=
this
.
node
.
getParent
();
while
(
parent
&&
(
...
...
This diff is collapsed.
Click to expand it.
o2web/source/x_component_process_Xform/DatatablePC.js
+
16
-
0
View file @
3e87f74e
...
...
@@ -789,6 +789,22 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
if
(
!
this
.
_completeLineEdit
()
)
return
;
}
line
.
changeEditMode
(
true
);
/**
* 数据表格当前正在编辑的条目,当数据表格为“同时编辑多行”时无此属性。
* @member {MWF.xApplication.process.Xform.DatatablePC.Line | MWF.xApplication.process.Xform.DatatableMobile.Line | Null}
* @example
* //获取数据表格“dt1”的正在编辑的条目。
* var line = this.form.get("dt1").currentEditedLine;
* //获取数据
* var data = line.getData();
* //设置数据
* line.setData({"subject":"111"});
* //获取subject字段的值
* var data = line.get("subject").getData();
* //设置subject字段的值
* line.get("subject").setData("test1");
*/
this
.
currentEditedLine
=
line
;
},
...
...
This diff is collapsed.
Click to expand it.
o2web/source/x_component_process_Xform/Source.js
+
6
-
0
View file @
3e87f74e
...
...
@@ -109,6 +109,12 @@ MWF.xApplication.process.Xform.Source = MWF.APPSource = new Class(
},
_invoke
:
function
(
callback
){
MWF
.
restful
(
this
.
json
.
httpMethod
,
this
.
uri
,
JSON
.
encode
(
this
.
body
),
function
(
json
){
/**
* @summary 该属性获取当前数据源的数据,当数据源加载完成后才有值。
* @member {Array|Object|String|Number|Boolean|Null}
* @example
* var field = this.form.get("fieldId").data; //获取数据源数据
*/
this
.
data
=
json
;
this
.
fireEvent
(
"
postLoadData
"
);
if
(
callback
)
callback
();
...
...
This diff is collapsed.
Click to expand it.
o2web/source/x_component_process_Xform/SubSource.js
+
6
-
0
View file @
3e87f74e
...
...
@@ -75,6 +75,12 @@ MWF.xApplication.process.Xform.SubSource = MWF.APPSubSource = new Class(
data
=
data
[
p
];
}.
bind
(
this
));
}
/**
* @summary 该属性获取当前子数据源的数据,当所在上级数据源加载完成后才有值。
* @member {Array|Object|String|Number|Boolean|Null}
* @example
* var field = this.form.get("fieldId").data; //获取子数据源数据
*/
this
.
data
=
data
;
},
_loopSub
:
function
(
dom
,
i
){
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help