Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
6872b20c
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,发现更多精彩内容 >>
提交
6872b20c
编写于
10月 27, 2020
作者:
NoSubject
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'featrue/datagrid_attachment_mobile' into 'wrdp'
数据网格附件移动端支持 See merge request o2oa/o2oa!1933
上级
4987c061
1748eec2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
115 addition
and
51 deletion
+115
-51
o2web/source/x_component_process_FormDesigner/Module/Attachment.js
...rce/x_component_process_FormDesigner/Module/Attachment.js
+2
-2
o2web/source/x_component_process_Xform/Attachment.js
o2web/source/x_component_process_Xform/Attachment.js
+12
-1
o2web/source/x_component_process_Xform/DatagridMobile.js
o2web/source/x_component_process_Xform/DatagridMobile.js
+98
-6
o2web/source/x_component_process_Xform/DatagridPC.js
o2web/source/x_component_process_Xform/DatagridPC.js
+3
-42
未找到文件。
o2web/source/x_component_process_FormDesigner/Module/Attachment.js
浏览文件 @
6872b20c
...
...
@@ -66,8 +66,8 @@ MWF.xApplication.process.FormDesigner.Module.Attachment = MWF.FCAttachment = new
_initModule
:
function
(){
this
.
node
.
empty
();
if
(
this
.
parentContainer
.
json
.
moduleName
==
"
datagrid$Data
"
&&
!
this
.
json
.
size
)
this
.
json
.
size
=
"
min
"
;
if
(
this
.
parentContainer
.
json
.
moduleName
==
"
datagrid$Data
"
&&
!
this
.
json
.
listStyle
)
this
.
json
.
listStyle
=
"
sequence
"
;
if
(
this
.
parentContainer
&&
this
.
parentContainer
.
json
.
moduleName
==
"
datagrid$Data
"
&&
!
this
.
json
.
size
)
this
.
json
.
size
=
"
min
"
;
if
(
this
.
parentContainer
&&
this
.
parentContainer
.
json
.
moduleName
==
"
datagrid$Data
"
&&
!
this
.
json
.
listStyle
)
this
.
json
.
listStyle
=
"
sequence
"
;
this
.
loadAttachmentController
(
this
.
json
.
editorProperties
);
this
.
setPropertiesOrStyles
(
"
styles
"
);
...
...
o2web/source/x_component_process_Xform/Attachment.js
浏览文件 @
6872b20c
...
...
@@ -1589,7 +1589,18 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
getTextData
:
function
(){
var
data
=
[];
this
.
attachmentController
.
attachments
.
each
(
function
(
att
){
data
.
push
(
att
.
data
);
var
o
=
{
"
id
"
:
att
.
data
.
id
,
"
person
"
:
att
.
data
.
person
,
"
creatorUid
"
:
att
.
data
.
creatorUid
,
"
name
"
:
att
.
data
.
name
,
"
orderNumber
"
:
att
.
data
.
orderNumber
,
"
length
"
:
att
.
data
.
length
,
"
extension
"
:
att
.
data
.
extension
,
"
lastUpdateTime
"
:
att
.
data
.
lastUpdateTime
,
"
activityName
"
:
att
.
data
.
activityName
}
data
.
push
(
o
);
});
return
data
;
},
...
...
o2web/source/x_component_process_Xform/DatagridMobile.js
浏览文件 @
6872b20c
...
...
@@ -219,6 +219,8 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
var
module
=
this
.
editModules
[
index
];
if
(
module
&&
module
.
json
.
type
==
"
ImageClipper
"
){
this
.
_createImage
(
cell
,
module
,
v
);
}
else
if
(
module
&&
(
module
.
json
.
type
==
"
Attachment
"
||
module
.
json
.
type
==
"
AttachmentDg
"
)
){
this
.
_createAttachment
(
cell
,
module
,
v
);
}
else
{
text
=
this
.
_getValueText
(
index
,
v
);
if
(
module
&&
module
.
json
.
type
==
"
Textarea
"
){
...
...
@@ -306,6 +308,8 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
var
module
=
this
.
editModules
[
index
];
if
(
module
&&
module
.
json
.
type
==
"
ImageClipper
"
){
this
.
_createImage
(
cell
,
module
,
v
)
}
else
if
(
module
&&
(
module
.
json
.
type
==
"
Attachment
"
||
module
.
json
.
type
==
"
AttachmentDg
"
)
){
this
.
_createAttachment
(
cell
,
module
,
v
);
}
else
{
text
=
this
.
_getValueText
(
index
,
v
);
if
(
module
&&
module
.
json
.
type
==
"
Textarea
"
){
...
...
@@ -415,6 +419,50 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
"
max-width
"
:
"
90%
"
})
},
_createAttachment
:
function
(
cell
,
module
,
data
){
cell
.
empty
();
var
options
=
{
"
style
"
:
module
.
json
.
style
||
"
default
"
,
"
title
"
:
"
附件区域
"
,
"
listStyle
"
:
module
.
json
.
dg_listStyle
||
"
icon
"
,
"
size
"
:
module
.
json
.
dg_size
||
"
min
"
,
"
resize
"
:
(
module
.
json
.
dg_resize
===
"
y
"
||
this
.
json
.
dg_resize
===
"
true
"
),
"
attachmentCount
"
:
0
,
"
isUpload
"
:
false
,
"
isDelete
"
:
false
,
"
isReplace
"
:
false
,
"
isDownload
"
:
true
,
"
isSizeChange
"
:
(
module
.
json
.
dg_isSizeChange
===
"
y
"
||
module
.
json
.
dg_isSizeChange
===
"
true
"
),
"
readonly
"
:
true
,
"
availableListStyles
"
:
module
.
json
.
dg_availableListStyles
?
module
.
json
.
dg_availableListStyles
:
[
"
list
"
,
"
seq
"
,
"
icon
"
,
"
preview
"
],
"
isDeleteOption
"
:
"
n
"
,
"
isReplaceOption
"
:
"
n
"
,
"
toolbarGroupHidden
"
:
module
.
json
.
dg_toolbarGroupHidden
||
[]
};
if
(
this
.
readonly
)
options
.
readonly
=
true
;
var
atts
=
[];
data
.
each
(
function
(
d
){
var
att
=
module
.
attachmentController
.
attachments
.
find
(
function
(
a
){
return
d
.
id
==
a
.
data
.
id
;
});
if
(
att
)
module
.
attachmentController
.
removeAttachment
(
att
);
});
module
.
setAttachmentBusinessData
();
var
attachmentController
=
new
MWF
.
xApplication
.
process
.
Xform
.
AttachmentController
(
cell
,
this
,
options
);
attachmentController
.
load
();
data
.
each
(
function
(
att
)
{
var
attachment
=
this
.
form
.
businessData
.
attachmentList
.
find
(
function
(
a
){
return
a
.
id
==
att
.
id
;
});
var
attData
=
attachment
||
att
;
//if (att.site===this.json.id || (this.json.isOpenInOffice && this.json.officeControlName===att.site)) this.attachmentController.addAttachment(att);
attachmentController
.
addAttachment
(
attData
);
}.
bind
(
this
));
},
_createItemTitleNode
:
function
(
node
,
idx
){
var
n
=
idx
+
1
;
var
titleDiv
=
new
Element
(
"
div
"
,
{
"
styles
"
:
this
.
json
.
itemTitleStyles
}).
inject
(
node
);
...
...
@@ -588,6 +636,15 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
if
(
datagridDataDiv
)
datagridDataDiv
.
destroy
();
}
datagrid
.
editModules
.
each
(
function
(
module
){
if
(
module
&&
(
module
.
json
.
type
==
"
Attachment
"
||
module
.
json
.
type
==
"
AttachmentDg
"
)){
module
.
attachmentController
.
attachments
.
each
(
function
(
att
){
datagrid
.
form
.
workAction
.
deleteAttachment
(
att
.
data
.
id
,
datagrid
.
form
.
businessData
.
work
.
id
);
});
module
.
attachmentController
.
clear
();
}
});
datagrid
.
currentEditLine
=
null
;
if
(
!
_self
.
gridData
.
data
.
length
){
...
...
@@ -679,6 +736,11 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
i
=
this
.
currentEditLine
.
getElement
(
"
table
"
).
getElements
(
"
tr
"
)[
idx
].
getElement
(
"
td
"
).
get
(
"
text
"
);
}
data
=
{
"
value
"
:
[
i
],
"
text
"
:
[
i
]};
}
else
if
(
module
.
json
.
type
==
"
Attachment
"
||
module
.
json
.
type
==
"
AttachmentDg
"
){
var
data
=
module
.
getTextData
();
//data.site = module.json.site;
if
(
!
griddata
[
id
])
griddata
[
id
]
=
{};
griddata
[
id
][
module
.
json
.
id
]
=
data
;
}
else
{
data
=
module
.
getTextData
();
//if (data.value[0]) flag = false;
...
...
@@ -697,6 +759,8 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
if
(
module
.
json
.
type
==
"
ImageClipper
"
){
this
.
_createImage
(
cell
,
module
,
data
.
text
);
}
else
if
(
module
.
json
.
type
==
"
Attachment
"
||
module
.
json
.
type
==
"
AttachmentDg
"
){
this
.
_createAttachment
(
cell
,
module
,
data
);
}
else
{
var
text
=
this
.
_getValueText
(
idx
,
data
.
text
.
join
(
"
,
"
));
if
(
module
.
json
.
type
==
"
Textarea
"
){
...
...
@@ -719,6 +783,8 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
var
cellData
=
data
[
th
.
get
(
"
id
"
)];
if
(
module
.
json
.
type
==
"
ImageClipper
"
){
this
.
_createImage
(
cell
,
module
,
data
.
text
);
}
else
if
(
module
.
json
.
type
==
"
Attachment
"
||
module
.
json
.
type
==
"
AttachmentDg
"
){
this
.
_createAttachment
(
cell
,
module
,
data
);
}
else
{
var
text
=
this
.
_getValueText
(
idx
,
data
.
text
.
join
(
"
,
"
));
if
(
module
.
json
.
type
==
"
Textarea
"
){
...
...
@@ -757,13 +823,15 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
this
.
validationMode
();
this
.
fireEvent
(
"
completeLineEdit
"
,
[
table
]);
this
.
addAction
.
set
(
"
text
"
,
MWF
.
xApplication
.
process
.
Xform
.
LP
.
addLine
);
this
.
addAction
.
removeEvents
(
"
click
"
);
this
.
addAction
.
addEvent
(
"
click
"
,
function
(){
this
.
_addLine
();
}.
bind
(
this
));
if
(
this
.
addAction
){
this
.
addAction
.
set
(
"
text
"
,
MWF
.
xApplication
.
process
.
Xform
.
LP
.
addLine
);
this
.
addAction
.
removeEvents
(
"
click
"
);
this
.
addAction
.
addEvent
(
"
click
"
,
function
(){
this
.
_addLine
();
}.
bind
(
this
));
}
this
.
form
.
saveFormData
();
return
true
;
},
_editorTrGoBack
:
function
(){
...
...
@@ -881,6 +949,21 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
this
.
form
.
confirm
(
"
warn
"
,
e
,
MWF
.
xApplication
.
process
.
Xform
.
LP
.
deleteDatagridLineTitle
,
MWF
.
xApplication
.
process
.
Xform
.
LP
.
deleteDatagridLine
,
300
,
120
,
function
(){
_self
.
fireEvent
(
"
deleteLine
"
,
[
currentTable
]);
var
data
=
currentTable
.
retrieve
(
"
data
"
);
//var attKeys = [];
debugger
;
var
titleThs
=
_self
.
table
.
getElements
(
"
th
"
);
titleThs
.
each
(
function
(
th
,
i
){
var
key
=
th
.
get
(
"
id
"
);
var
module
=
_self
.
editModules
[
i
];
if
(
key
&&
module
&&
(
module
.
json
.
type
==
"
Attachment
"
||
module
.
json
.
type
==
"
AttachmentDg
"
)){
data
[
key
][
module
.
json
.
id
].
each
(
function
(
d
){
_self
.
form
.
workAction
.
deleteAttachment
(
d
.
id
,
_self
.
form
.
businessData
.
work
.
id
);
});
}
});
node
.
destroy
();
//datagrid._loadZebraStyle();
datagrid
.
_loadSequence
();
...
...
@@ -897,6 +980,8 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
this
.
close
();
_self
.
fireEvent
(
"
afterDeleteLine
"
);
_self
.
form
.
saveFormData
();
},
function
(){
//var color = currentTr.retrieve("bgcolor");
//currentTr.tween("background-color", color);
...
...
@@ -1483,6 +1568,13 @@ MWF.xApplication.process.Xform.DatagridMobile$Data = new Class({
moduleNodes
.
each
(
function
(
node
){
var
json
=
this
.
form
.
_getDomjson
(
node
);
var
isField
=
false
;
if
(
json
.
type
==
"
Attachment
"
||
json
.
type
==
"
AttachmentDg
"
){
json
.
type
=
"
AttachmentDg
"
;
//json.site = this.dataGrid.getAttachmentRandomSite();
//json.id = json.site;
}
var
module
=
this
.
form
.
_loadModule
(
json
,
node
,
function
(){
isField
=
this
.
field
;
this
.
field
=
false
;
...
...
o2web/source/x_component_process_Xform/DatagridPC.js
浏览文件 @
6872b20c
...
...
@@ -79,10 +79,6 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
this
.
editorTr
=
trs
[
trs
.
length
-
1
];
this
.
editorTr
.
addClass
(
"
datagridEditorTr
"
);
this
.
editorTr
.
addEvent
(
"
blur
"
,
function
(){
alert
(
'
blur
'
)
});
return
this
.
editorTr
;
},
_addTitleActionColumn
:
function
(){
...
...
@@ -440,7 +436,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
if
(
!
this
.
editValidation
()){
return
false
;
}
debugger
;
this
.
isEdit
=
false
;
var
flag
=
true
;
...
...
@@ -489,7 +485,7 @@ debugger;
if
(
cell
){
if
(
module
.
json
.
type
==
"
ImageClipper
"
){
this
.
_createImage
(
cell
,
module
,
data
.
text
);
}
if
(
module
.
json
.
type
==
"
Attachment
"
||
module
.
json
.
type
==
"
AttachmentDg
"
){
}
else
if
(
module
.
json
.
type
==
"
Attachment
"
||
module
.
json
.
type
==
"
AttachmentDg
"
){
this
.
_createAttachment
(
cell
,
module
,
data
);
}
else
{
var
text
=
this
.
_getValueText
(
idx
-
1
,
data
.
text
.
join
(
"
,
"
));
...
...
@@ -626,29 +622,6 @@ debugger;
var
currentTr
=
node
.
getParent
(
"
tr
"
);
if
(
currentTr
){
this
.
editorTr
.
inject
(
currentTr
,
"
after
"
);
this
.
editorTr
.
focus
();
this
.
editModules
.
each
(
function
(
module
,
idx
){
if
(
module
.
json
.
type
==
"
Attachment
"
||
module
.
json
.
type
==
"
AttachmentDg
"
){
//module.json.site = this.getAttachmentRandomSite();
//module.json.id = module.json.site;
//module.reload();
// var d = this.getData();
//
// var titleThs = this.titleTr.getElements("th");
// var th = titleThs[idx+1];
// var title = th.get("id");
//
// var atts = [];
// d.data.each(function(line){
// atts = line[title][module.json.id];
// });
//d.data
// if (json.type=="Attachment" || json.type=="AttachmentDg" ){
// module.
// }
}
}.
bind
(
this
));
}
this
.
isEdit
=
true
;
this
.
validationMode
();
...
...
@@ -665,9 +638,6 @@ debugger;
currentTr
.
tween
(
"
background-color
"
,
"
#ffd4d4
"
);
var
datagrid
=
this
;
var
_self
=
this
;
this
.
form
.
confirm
(
"
warn
"
,
e
,
MWF
.
xApplication
.
process
.
Xform
.
LP
.
deleteDatagridLineTitle
,
MWF
.
xApplication
.
process
.
Xform
.
LP
.
deleteDatagridLine
,
300
,
120
,
function
(){
_self
.
fireEvent
(
"
deleteLine
"
,
[
currentTr
]);
...
...
@@ -684,14 +654,6 @@ debugger;
});
}
});
// attKeys.each(function(k){
// if (data[k]){
// data[k].each(function(d){
// _self.form.workAction.deleteAttachment(d.id, _self.form.businessData.work.id);
// });
// }
// });
currentTr
.
destroy
();
datagrid
.
_loadZebraStyle
();
...
...
@@ -1396,6 +1358,5 @@ MWF.xApplication.process.Xform.DatagridPC$Data = new Class({
this
.
dataGrid
.
editModules
.
push
(
module
);
}.
bind
(
this
));
}
},
}
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录