Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
64e97bd9
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,发现更多精彩内容 >>
提交
64e97bd9
编写于
10月 15, 2020
作者:
NoSubject
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
表单组件支持异步脚本
上级
f10e00fd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
142 addition
and
34 deletion
+142
-34
o2web/source/x_component_process_Xform/DatagridMobile.js
o2web/source/x_component_process_Xform/DatagridMobile.js
+115
-24
o2web/source/x_component_process_Xform/DatagridPC.js
o2web/source/x_component_process_Xform/DatagridPC.js
+27
-10
未找到文件。
o2web/source/x_component_process_Xform/DatagridMobile.js
浏览文件 @
64e97bd9
...
@@ -40,15 +40,24 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
...
@@ -40,15 +40,24 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
if
(
this
.
editable
!=
false
){
if
(
this
.
editable
!=
false
){
this
.
_loadDatagridDataModules
();
this
.
_loadDatagridDataModules
();
//this._addTitleActionColumn();
//this._addTitleActionColumn();
this
.
_loadEditDatagrid
();
// this._loadEditDatagrid();
//this._loadReadDatagrid();
// //this._loadReadDatagrid();
this
.
fireEvent
(
"
postLoad
"
);
// this.fireEvent("postLoad");
this
.
fireEvent
(
"
load
"
);
// this.fireEvent("load");
this
.
_loadEditDatagrid
(
function
(){
this
.
fireEvent
(
"
postLoad
"
);
this
.
fireEvent
(
"
load
"
);
}.
bind
(
this
));
}
else
{
}
else
{
this
.
_loadDatagridDataModules
();
this
.
_loadDatagridDataModules
();
this
.
_loadReadDatagrid
();
this
.
_loadReadDatagrid
(
function
(){
this
.
fireEvent
(
"
postLoad
"
);
this
.
fireEvent
(
"
postLoad
"
);
this
.
fireEvent
(
"
load
"
);
this
.
fireEvent
(
"
load
"
);
}.
bind
(
this
));
// this._loadReadDatagrid();
// this.fireEvent("postLoad");
// this.fireEvent("load");
}
}
},
},
createMobileTable
:
function
(){
createMobileTable
:
function
(){
...
@@ -90,14 +99,18 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
...
@@ -90,14 +99,18 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
},
},
_getValue
:
function
(){
_getValue
:
function
(){
if
(
this
.
moduleValueAG
)
return
this
.
moduleValueAG
;
var
value
=
[];
var
value
=
[];
value
=
this
.
_getBusinessData
();
value
=
this
.
_getBusinessData
();
if
(
!
value
){
if
(
!
value
){
if
(
this
.
json
.
defaultData
&&
this
.
json
.
defaultData
.
code
)
value
=
this
.
form
.
Macro
.
exec
(
this
.
json
.
defaultData
.
code
,
this
);
if
(
this
.
json
.
defaultData
&&
this
.
json
.
defaultData
.
code
)
value
=
this
.
form
.
Macro
.
exec
(
this
.
json
.
defaultData
.
code
,
this
);
value
=
{
"
data
"
:
value
||
[]};
if
(
!
value
.
isAG
)
if
(
o2
.
typeOf
(
value
)
==
"
array
"
)
value
=
{
"
data
"
:
value
||
[]};
}
}
return
value
||
[];
return
value
||
[];
},
},
getValue
:
function
(){
return
this
.
_getValue
();
},
_getValueText
:
function
(
idx
,
value
){
_getValueText
:
function
(
idx
,
value
){
var
module
=
this
.
editModules
[
idx
];
var
module
=
this
.
editModules
[
idx
];
...
@@ -157,6 +170,12 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
...
@@ -157,6 +170,12 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
return
value
;
return
value
;
}
}
break
;
break
;
case
"
Textarea
"
:
var
reg
=
new
RegExp
(
"
\n
"
,
"
g
"
);
var
reg2
=
new
RegExp
(
"
\
u003c
"
,
"
g
"
);
//尖括号转义,否则内容会截断
var
reg3
=
new
RegExp
(
"
\
u003e
"
,
"
g
"
);
value
=
value
.
replace
(
reg2
,
"
<
"
).
replace
(
reg3
,
"
>
"
).
replace
(
reg
,
"
<br/>
"
);
break
;
}
}
}
}
return
value
;
return
value
;
...
@@ -173,8 +192,22 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
...
@@ -173,8 +192,22 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
return
flag
;
return
flag
;
},
},
_loadReadDatagrid
:
function
(){
_loadReadDatagrid
:
function
(
callback
){
this
.
gridData
=
this
.
_getValue
();
if
(
this
.
gridData
&&
this
.
gridData
.
isAG
){
this
.
moduleValueAG
=
this
.
gridData
;
this
.
gridData
.
addResolve
(
function
(
v
){
this
.
gridData
=
v
;
this
.
_loadReadDatagrid
(
callback
);
}.
bind
(
this
));
}
else
{
if
(
o2
.
typeOf
(
this
.
gridData
)
==
"
array
"
)
this
.
gridData
=
{
"
data
"
:
this
.
gridData
};
this
.
__loadReadDatagrid
(
callback
);
this
.
moduleValueAG
=
null
;
}
},
__loadReadDatagrid
:
function
(
callback
){
//this.gridData = this._getValue();
var
titleHeaders
=
this
.
table
.
getElements
(
"
th
"
);
var
titleHeaders
=
this
.
table
.
getElements
(
"
th
"
);
var
tds
=
this
.
table
.
getElements
(
"
td
"
);
var
tds
=
this
.
table
.
getElements
(
"
td
"
);
...
@@ -215,7 +248,12 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
...
@@ -215,7 +248,12 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
this
.
_createImage
(
cell
,
module
,
v
)
this
.
_createImage
(
cell
,
module
,
v
)
}
else
{
}
else
{
text
=
this
.
_getValueText
(
index
,
v
);
text
=
this
.
_getValueText
(
index
,
v
);
cell
.
set
(
"
text
"
,
text
);
if
(
module
&&
module
.
json
.
type
==
"
Textarea
"
){
cell
.
set
(
"
html
"
,
text
);
}
else
{
cell
.
set
(
"
text
"
,
text
);
}
//cell.set("text", text);
}
}
...
@@ -247,13 +285,28 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
...
@@ -247,13 +285,28 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
}.
bind
(
this
));
}.
bind
(
this
));
}.
bind
(
this
));
}.
bind
(
this
));
}
}
if
(
callback
)
callback
();
//this._loadTotal();
//this._loadTotal();
},
},
_loadEditDatagrid
:
function
(){
_loadEditDatagrid
:
function
(
callback
){
debugger
;
if
(
this
.
gridData
&&
this
.
gridData
.
isAG
){
this
.
moduleValueAG
=
this
.
gridData
;
this
.
gridData
.
addResolve
(
function
(
v
){
this
.
gridData
=
v
;
this
.
_loadEditDatagrid
(
callback
);
}.
bind
(
this
));
}
else
{
if
(
o2
.
typeOf
(
this
.
gridData
)
==
"
array
"
)
this
.
gridData
=
{
"
data
"
:
this
.
gridData
};
this
.
__loadEditDatagrid
(
callback
);
this
.
moduleValueAG
=
null
;
}
},
__loadEditDatagrid
:
function
(
callback
){
//this._createHelpNode();
//this._createHelpNode();
this
.
gridData
=
this
.
_getValue
();
//
this.gridData = this._getValue();
var
titleHeaders
=
this
.
table
.
getElements
(
"
th
"
);
var
titleHeaders
=
this
.
table
.
getElements
(
"
th
"
);
var
tds
=
this
.
table
.
getElements
(
"
td
"
);
var
tds
=
this
.
table
.
getElements
(
"
td
"
);
...
@@ -297,7 +350,13 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
...
@@ -297,7 +350,13 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
this
.
_createImage
(
cell
,
module
,
v
)
this
.
_createImage
(
cell
,
module
,
v
)
}
else
{
}
else
{
text
=
this
.
_getValueText
(
index
,
v
);
text
=
this
.
_getValueText
(
index
,
v
);
cell
.
set
(
"
text
"
,
text
);
if
(
module
&&
module
.
json
.
type
==
"
Textarea
"
){
cell
.
set
(
"
html
"
,
text
);
}
else
{
cell
.
set
(
"
text
"
,
text
);
}
//cell.set("text", text);
}
}
// if (typeOf(v)==="object"){
// if (typeOf(v)==="object"){
...
@@ -338,6 +397,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
...
@@ -338,6 +397,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
}
}
// this._loadAddAction();
// this._loadAddAction();
}
}
if
(
callback
)
callback
();
//this._loadTotal();
//this._loadTotal();
},
},
_loadActions
:
function
(
titleDiv
){
_loadActions
:
function
(
titleDiv
){
...
@@ -676,13 +736,19 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
...
@@ -676,13 +736,19 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
}
}
var
cell
;
var
cell
;
var
text
=
this
.
_getValueText
(
idx
,
data
.
text
.
join
(
"
,
"
));
if
(
dataRow
){
if
(
dataRow
){
cell
=
dataRow
.
getElement
(
"
td
"
);
cell
=
dataRow
.
getElement
(
"
td
"
);
if
(
module
.
json
.
type
==
"
ImageClipper
"
){
if
(
module
.
json
.
type
==
"
ImageClipper
"
){
this
.
_createImage
(
cell
,
module
,
data
.
text
);
this
.
_createImage
(
cell
,
module
,
data
.
text
);
}
else
{
}
else
{
cell
.
set
(
"
text
"
,
data
.
text
.
join
(
"
,
"
));
if
(
module
&&
module
.
json
.
type
==
"
Textarea
"
){
cell
.
set
(
"
html
"
,
text
);
}
else
{
cell
.
set
(
"
text
"
,
text
);
}
//cell.set("text", data.text.join(", "));
}
}
}
else
{
}
else
{
dataRow
=
table
.
insertRow
(
idx
);
dataRow
=
table
.
insertRow
(
idx
);
...
@@ -697,7 +763,12 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
...
@@ -697,7 +763,12 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
if
(
module
.
json
.
type
==
"
ImageClipper
"
){
if
(
module
.
json
.
type
==
"
ImageClipper
"
){
this
.
_createImage
(
cell
,
module
,
data
.
text
);
this
.
_createImage
(
cell
,
module
,
data
.
text
);
}
else
{
}
else
{
cell
.
set
(
"
text
"
,
data
.
text
.
join
(
"
,
"
));
if
(
module
&&
module
.
json
.
type
==
"
Textarea
"
){
cell
.
set
(
"
html
"
,
text
);
}
else
{
cell
.
set
(
"
text
"
,
text
);
}
//cell.set("text", data.text.join(", "));
}
}
}
}
}
else
{
}
else
{
...
@@ -1128,13 +1199,33 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
...
@@ -1128,13 +1199,33 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
this
.
setData
(
this
.
_getValue
());
this
.
setData
(
this
.
_getValue
());
},
},
setData
:
function
(
data
){
setData
:
function
(
data
){
// if( typeOf( data ) === "object" && typeOf(data.data) === "array" ){
if
(
!
data
){
if
(
data
){
data
=
this
.
_getValue
();
this
.
_setBusinessData
(
data
);
}
this
.
gridData
=
data
;
this
.
_setData
(
data
);
},
_setData
:
function
(
data
){
if
(
data
&&
data
.
isAG
){
this
.
moduleValueAG
=
data
;
data
.
addResolve
(
function
(
v
){
this
.
_setData
(
v
);
}.
bind
(
this
));
}
else
{
}
else
{
this
.
gridData
=
this
.
_getValue
();
if
(
o2
.
typeOf
(
data
)
==
"
array
"
)
data
=
{
"
data
"
:
data
};
this
.
__setData
(
data
);
this
.
moduleValueAG
=
null
;
}
}
},
__setData
:
function
(
data
){
// if( typeOf( data ) === "object" && typeOf(data.data) === "array" ){
// if (data){
// this._setBusinessData(data);
// this.gridData = data;
// }else{
// this.gridData = this._getValue();
// }
this
.
_setBusinessData
(
data
);
this
.
gridData
=
data
;
// if (this.isEdit) this._completeLineEdit();
// if (this.isEdit) this._completeLineEdit();
if
(
this
.
isEdit
){
if
(
this
.
isEdit
){
...
@@ -1466,4 +1557,4 @@ MWF.xApplication.process.Xform.DatagridMobile$Data = new Class({
...
@@ -1466,4 +1557,4 @@ MWF.xApplication.process.Xform.DatagridMobile$Data = new Class({
}.
bind
(
this
));
}.
bind
(
this
));
}
}
}
}
});
});
\ No newline at end of file
o2web/source/x_component_process_Xform/DatagridPC.js
浏览文件 @
64e97bd9
...
@@ -29,7 +29,6 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
...
@@ -29,7 +29,6 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
this
.
deleteable
=
this
.
json
.
deleteable
!==
"
no
"
;
this
.
deleteable
=
this
.
json
.
deleteable
!==
"
no
"
;
this
.
addable
=
this
.
json
.
addable
!==
"
no
"
;
this
.
addable
=
this
.
json
.
addable
!==
"
no
"
;
debugger
;
this
.
gridData
=
this
.
_getValue
();
this
.
gridData
=
this
.
_getValue
();
this
.
totalModules
=
[];
this
.
totalModules
=
[];
...
@@ -43,9 +42,6 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
...
@@ -43,9 +42,6 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
this
.
fireEvent
(
"
postLoad
"
);
this
.
fireEvent
(
"
postLoad
"
);
this
.
fireEvent
(
"
load
"
);
this
.
fireEvent
(
"
load
"
);
}.
bind
(
this
));
}.
bind
(
this
));
//this._loadReadDatagrid();
//this._loadReadDatagrid();
}
else
{
}
else
{
this
.
_loadDatagridDataModules
();
this
.
_loadDatagridDataModules
();
...
@@ -217,6 +213,12 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
...
@@ -217,6 +213,12 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
return
value
;
return
value
;
}
}
break
;
case
"
Textarea
"
:
var
reg
=
new
RegExp
(
"
\n
"
,
"
g
"
);
var
reg2
=
new
RegExp
(
"
\
u003c
"
,
"
g
"
);
//尖括号转义,否则内容会截断
var
reg3
=
new
RegExp
(
"
\
u003e
"
,
"
g
"
);
value
=
value
.
replace
(
reg2
,
"
<
"
).
replace
(
reg3
,
"
>
"
).
replace
(
reg
,
"
<br/>
"
);
break
;
break
;
// case "address":
// case "address":
// if (typeOf(value)==="array"){
// if (typeOf(value)==="array"){
...
@@ -244,7 +246,12 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
...
@@ -244,7 +246,12 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
if
(
module
&&
module
.
json
.
type
==
"
ImageClipper
"
){
if
(
module
&&
module
.
json
.
type
==
"
ImageClipper
"
){
this
.
_createImage
(
cell
,
module
,
text
)
this
.
_createImage
(
cell
,
module
,
text
)
}
else
{
}
else
{
cell
.
set
(
"
text
"
,
text
);
if
(
module
&&
module
.
json
.
type
==
"
Textarea
"
){
cell
.
set
(
"
html
"
,
text
);
}
else
{
cell
.
set
(
"
text
"
,
text
);
}
// /cell.set("text", text);
}
}
cell
.
addEvent
(
"
click
"
,
function
(
e
){
cell
.
addEvent
(
"
click
"
,
function
(
e
){
this
.
_editLine
(
e
.
target
);
this
.
_editLine
(
e
.
target
);
...
@@ -483,10 +490,16 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
...
@@ -483,10 +490,16 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
if
(
module
.
json
.
type
==
"
ImageClipper
"
){
if
(
module
.
json
.
type
==
"
ImageClipper
"
){
this
.
_createImage
(
cell
,
module
,
data
.
text
);
this
.
_createImage
(
cell
,
module
,
data
.
text
);
}
else
{
}
else
{
cell
.
set
(
"
text
"
,
data
.
text
.
join
(
"
,
"
));
var
text
=
this
.
_getValueText
(
idx
-
1
,
data
.
text
.
join
(
"
,
"
));
if
(
module
.
json
.
type
==
"
Textarea
"
){
cell
.
set
(
"
html
"
,
text
);
}
else
{
cell
.
set
(
"
text
"
,
data
.
text
.
join
(
"
,
"
));
}
}
}
}
else
{
}
else
{
this
.
_createNewEditTd
(
newTr
,
idx
,
editorTds
[
idx
].
get
(
"
id
"
),
data
.
text
.
join
(
"
,
"
),
titleThs
.
length
-
1
);
var
text
=
this
.
_getValueText
(
idx
-
1
,
data
.
text
.
join
(
"
,
"
));
this
.
_createNewEditTd
(
newTr
,
idx
,
editorTds
[
idx
].
get
(
"
id
"
),
text
,
titleThs
.
length
-
1
);
}
}
}
else
{
}
else
{
if
(
!
cell
)
this
.
_createNewEditTd
(
newTr
,
idx
,
id
,
""
,
titleThs
.
length
-
1
);
if
(
!
cell
)
this
.
_createNewEditTd
(
newTr
,
idx
,
id
,
""
,
titleThs
.
length
-
1
);
...
@@ -759,10 +772,14 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
...
@@ -759,10 +772,14 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
var
module
=
this
.
editModules
[
index
];
var
module
=
this
.
editModules
[
index
];
if
(
module
&&
module
.
json
.
type
==
"
ImageClipper
"
){
if
(
module
&&
module
.
json
.
type
==
"
ImageClipper
"
){
this
.
_createImage
(
cell
,
module
,
v
)
this
.
_createImage
(
cell
,
module
,
v
)
;
}
else
{
}
else
{
var
text
=
this
.
_getValueText
(
index
,
v
);
var
text
=
this
.
_getValueText
(
index
,
v
);
cell
.
set
(
"
text
"
,
text
);
if
(
module
&&
module
.
json
.
type
==
"
Textarea
"
){
cell
.
set
(
"
html
"
,
text
);
}
else
{
cell
.
set
(
"
text
"
,
text
);
}
}
}
break
;
break
;
}
}
...
@@ -973,7 +990,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
...
@@ -973,7 +990,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
if
(
data
&&
data
.
isAG
){
if
(
data
&&
data
.
isAG
){
this
.
moduleValueAG
=
data
;
this
.
moduleValueAG
=
data
;
data
.
addResolve
(
function
(
v
){
data
.
addResolve
(
function
(
v
){
this
.
setData
(
v
);
this
.
_
setData
(
v
);
}.
bind
(
this
));
}.
bind
(
this
));
}
else
{
}
else
{
if
(
o2
.
typeOf
(
data
)
==
"
array
"
)
data
=
{
"
data
"
:
data
};
if
(
o2
.
typeOf
(
data
)
==
"
array
"
)
data
=
{
"
data
"
:
data
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录