Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
2670dc15
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,发现更多精彩内容 >>
提交
2670dc15
编写于
3月 23, 2020
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
视图自定义事件、操作条、上下文
上级
21d7f203
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
131 addition
and
27 deletion
+131
-27
o2web/source/o2_core/o2/xScript/ViewEnvironment.js
o2web/source/o2_core/o2/xScript/ViewEnvironment.js
+7
-2
o2web/source/x_component_query_Query/Viewer.js
o2web/source/x_component_query_Query/Viewer.js
+102
-20
o2web/source/x_component_query_Query/lp/zh-cn.js
o2web/source/x_component_query_Query/lp/zh-cn.js
+6
-1
o2web/source/x_component_query_ViewDesigner/$View/view.json
o2web/source/x_component_query_ViewDesigner/$View/view.json
+16
-4
未找到文件。
o2web/source/o2_core/o2/xScript/ViewEnvironment.js
浏览文件 @
2670dc15
...
...
@@ -26,8 +26,13 @@ MWF.xScript.ViewEnvironment = function (ev) {
// this.setData(_data);
this
.
viewContext
=
{
viewInfor
:
_form
.
viewInfor
,
getPageNumber
:
_form
.
getPageNumber
()
getViewInfor
:
function
()
{
return
_form
.
getViewInfor
();
},
getPageInfor
:
function
()
{
return
_form
.
getPageInfor
();
},
getPageData
:
function
()
{
return
_form
.
getPageData
();
},
toPage
:
function
(
pageNumber
)
{
return
_form
.
toPage
(
pageNumber
);
},
selectAll
:
function
()
{
return
_form
.
selectAll
();
},
unSelectAll
:
function
()
{
return
_form
.
unSelectAll
();
},
switchView
:
function
(
options
)
{
return
_form
.
switchView
(
options
);
}
};
//dict
...
...
o2web/source/x_component_query_Query/Viewer.js
浏览文件 @
2670dc15
...
...
@@ -13,7 +13,8 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
"
perPageCount
"
:
50
,
"
isload
"
:
"
true
"
,
"
export
"
:
false
,
"
moduleEvents
"
:
[
"
queryLoad
"
,
"
postLoadData
"
,
"
postLoad
"
,
"
queryLoadRow
"
,
"
postLoadRow
"
,
"
selectRow
"
,
"
unselectRow
"
]
"
moduleEvents
"
:
[
"
queryLoad
"
,
"
postLoad
"
,
"
postLoadPageData
"
,
"
postLoadPage
"
,
"
selectRow
"
,
"
unselectRow
"
,
"
queryLoadItemRow
"
,
"
postLoadItemRow
"
,
"
queryLoadCategoryRow
"
,
"
postLoadCategoryRow
"
]
// "actions": {
// "lookup": {"uri": "/jaxrs/view/flag/{view}/query/{application}/execute", "method":"PUT"},
...
...
@@ -38,6 +39,9 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
this
.
container
=
$
(
container
);
this
.
json
=
json
;
debugger
;
this
.
originalJson
=
Object
.
clone
(
json
);
this
.
viewJson
=
null
;
this
.
filterItems
=
[];
this
.
searchStatus
=
"
none
"
;
//none, custom, default
...
...
@@ -82,7 +86,7 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
//this._loadStyles();
this
.
_loadDomEvents
();
}
})
}
.
bind
(
this
)
)
},
_loadUserInterface
:
function
(){
this
.
loadLayout
();
...
...
@@ -106,7 +110,6 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
this
.
viewPageAreaNode
=
new
Element
(
"
div
"
,
{
"
styles
"
:
this
.
css
.
viewPageAreaNode
}).
inject
(
this
.
viewPageNode
);
},
loadMacro
:
function
(
callback
)
{
this
.
viewInfor
=
this
.
json
;
if
(
!
this
.
Macro
){
//有可能是page\cms\process传入的macro
MWF
.
require
(
"
MWF.xScript.Macro
"
,
function
()
{
this
.
Macro
=
new
MWF
.
Macro
.
ViewContext
(
this
);
...
...
@@ -718,7 +721,9 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
this
.
_initPage
();
if
(
this
.
bundleItems
.
length
){
this
.
loadCurrentPageData
();
this
.
loadCurrentPageData
(
function
()
{
this
.
fireEvent
(
"
postLoad
"
);
//用户配置的事件
}.
bind
(
this
));
}
else
{
//this._loadPageNode();
this
.
viewPageAreaNode
.
empty
();
...
...
@@ -726,14 +731,87 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
this
.
loadingAreaNode
.
destroy
();
this
.
loadingAreaNode
=
null
;
}
this
.
fireEvent
(
"
postLoad
"
);
//用户配置的事件
}
}.
bind
(
this
));
}
}.
bind
(
this
));
},
loadCurrentPageData
:
function
(){
//api 使用 开始
getViewInfor
:
function
(){
return
this
.
json
;
},
getPageInfor
:
function
(){
return
{
pages
:
this
.
pages
,
perPageCount
:
this
.
options
.
perPageCount
,
currentPageNumber
:
this
.
currentPage
};
},
getPageData
:
function
()
{
return
this
.
gridJson
;
},
toPage
:
function
(
pageNumber
,
callback
){
this
.
currentPage
=
pageNumber
;
this
.
loadCurrentPageData
(
callback
);
},
selectAll
:
function
(){
var
flag
=
this
.
json
.
select
||
this
.
viewJson
.
select
||
"
none
"
;
if
(
flag
===
"
multi
"
){
this
.
items
.
each
(
function
(
item
)
{
if
(
item
.
clazzType
===
"
item
"
){
item
.
selected
();
}
else
{
item
.
expand
();
item
.
items
.
each
(
function
(
it
)
{
item
.
selected
();
})
}
})
}
},
unSelectAll
:
function
(){
var
flag
=
this
.
json
.
select
||
this
.
viewJson
.
select
||
"
none
"
;
if
(
flag
===
"
multi
"
){
this
.
items
.
each
(
function
(
item
)
{
if
(
item
.
clazzType
===
"
item
"
){
item
.
unSelected
();
}
else
{
if
(
item
.
items
)
item
.
items
.
each
(
function
(
it
)
{
item
.
unSelected
();
})
}
})
}
},
switchView
:
function
(
json
){
debugger
;
// json = {
// "application": application,
// "viewName": viewName,
// "isTitle": "yes",
// "select": "none",
// "titleStyles": titleStyles,
// "itemStyles": itemStyles,
// "isExpand": "no",
// "filter": filter
// }
this
.
node
.
setStyle
(
"
display
"
,
"
block
"
);
if
(
this
.
loadingAreaNode
)
this
.
loadingAreaNode
.
setStyle
(
"
display
"
,
"
block
"
);
this
.
searchMorph
=
null
;
this
.
viewSearchCustomContentNode
=
null
;
var
newJson
=
Object
.
merge
(
Object
.
clone
(
this
.
originalJson
),
json
);
this
.
container
.
empty
();
this
.
initialize
(
this
.
container
,
newJson
,
Object
.
clone
(
this
.
options
));
},
//api 使用 结束
loadCurrentPageData
:
function
(
callback
){
debugger
;
//是否需要在翻页的时候清空之前的items ?
this
.
items
=
[];
var
p
=
this
.
currentPage
;
var
d
=
{};
var
valueList
=
this
.
bundleItems
.
slice
((
p
-
1
)
*
this
.
json
.
pageSize
,
this
.
json
.
pageSize
*
p
);
...
...
@@ -747,7 +825,7 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
this
.
loadViewRes
=
this
.
lookupAction
.
loadView
(
this
.
json
.
name
,
this
.
json
.
application
,
d
,
function
(
json
){
this
.
viewData
=
json
.
data
;
this
.
fireEvent
(
"
postLoadData
"
);
this
.
fireEvent
(
"
postLoad
Page
Data
"
);
if
(
this
.
viewJson
.
group
.
column
){
this
.
gridJson
=
json
.
data
.
groupGrid
;
...
...
@@ -761,9 +839,12 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
this
.
loadingAreaNode
.
destroy
();
this
.
loadingAreaNode
=
null
;
}
this
.
fireEvent
(
"
loadView
"
);
//options 传入的事件
this
.
fireEvent
(
"
postLoad
"
);
//用户配置的事件
this
.
fireEvent
(
"
postLoadPage
"
);
if
(
callback
)
callback
();
}.
bind
(
this
));
},
...
...
@@ -968,18 +1049,20 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
}
},
_loadModuleEvents
:
function
(){
Object
.
each
(
this
.
json
.
events
,
function
(
e
,
key
){
debugger
;
Object
.
each
(
this
.
viewJson
.
events
,
function
(
e
,
key
){
if
(
e
.
code
){
if
(
this
.
options
.
moduleEvents
.
indexOf
(
key
)
!==-
1
){
this
.
addEvent
(
key
,
function
(
event
){
return
this
.
Macro
.
fire
(
e
.
code
,
this
,
event
);
this
.
addEvent
(
key
,
function
(
event
,
target
){
debugger
;
return
this
.
Macro
.
fire
(
e
.
code
,
target
||
this
,
event
);
}.
bind
(
this
));
}
}
}.
bind
(
this
));
},
_loadDomEvents
:
function
(){
Object
.
each
(
this
.
j
son
.
events
,
function
(
e
,
key
){
Object
.
each
(
this
.
viewJ
son
.
events
,
function
(
e
,
key
){
if
(
e
.
code
){
if
(
this
.
options
.
moduleEvents
.
indexOf
(
key
)
===-
1
){
this
.
node
.
addEvent
(
key
,
function
(
event
){
...
...
@@ -999,11 +1082,11 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
this
.
isSelected
=
false
;
this
.
prev
=
prev
;
this
.
idx
=
i
;
this
.
clazzType
=
"
item
"
;
this
.
load
();
},
load
:
function
(){
debugger
;
this
.
view
.
fireEvent
(
"
queryLoadRow
"
,
[
this
]);
this
.
view
.
fireEvent
(
"
queryLoadItemRow
"
,
[
null
,
this
]);
this
.
node
=
new
Element
(
"
tr
"
,
{
"
styles
"
:
this
.
css
.
viewContentTrNode
});
if
(
this
.
prev
){
...
...
@@ -1027,7 +1110,6 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
}
Object
.
each
(
this
.
view
.
entries
,
function
(
c
,
k
){
debugger
;
var
cell
=
this
.
data
.
data
[
k
];
if
(
cell
===
undefined
)
cell
=
""
;
//if (cell){
...
...
@@ -1066,10 +1148,9 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
this
.
setEvent
();
this
.
view
.
fireEvent
(
"
postLoad
Row
"
,
[
this
]);
this
.
view
.
fireEvent
(
"
postLoad
ItemRow
"
,
[
null
,
this
]);
},
setOpenWork
:
function
(
td
,
column
){
debugger
;
td
.
setStyle
(
"
cursor
"
,
"
pointer
"
);
if
(
column
.
clickCode
){
if
(
!
this
.
view
.
Macro
){
...
...
@@ -1307,10 +1388,11 @@ MWF.xApplication.query.Query.Viewer.ItemCategory = new Class({
this
.
items
=
[];
this
.
loadChild
=
false
;
this
.
idx
=
i
;
this
.
clazzType
=
"
category
"
;
this
.
load
();
},
load
:
function
(){
this
.
view
.
fireEvent
(
"
queryLoad
Row
"
,
[
this
]);
this
.
view
.
fireEvent
(
"
queryLoad
CategoryRow
"
,
[
null
,
this
]);
this
.
node
=
new
Element
(
"
tr
"
,
{
"
styles
"
:
this
.
css
.
viewContentTrNode
}).
inject
(
this
.
view
.
viewTable
);
//if (this.view.json.select==="single" || this.view.json.select==="multi"){
...
...
@@ -1341,7 +1423,7 @@ MWF.xApplication.query.Query.Viewer.ItemCategory = new Class({
this
.
setEvent
();
this
.
view
.
fireEvent
(
"
postLoad
Row
"
,
[
this
]);
this
.
view
.
fireEvent
(
"
postLoad
CategoryRow
"
,
[
null
,
this
]);
},
setEvent
:
function
(){
//if (this.selectTd){
...
...
o2web/source/x_component_query_Query/lp/zh-cn.js
浏览文件 @
2670dc15
...
...
@@ -144,5 +144,10 @@ MWF.xApplication.query.Query.LP = {
"
selecteAllRow
"
:
"
选择所有行
"
,
"
firstPage
"
:
"
第一页
"
,
"
lastPage
"
:
"
最后一页
"
"
lastPage
"
:
"
最后一页
"
,
"
notice
"
:
{
"
deleteEventTitle
"
:
"
删除事件确认
"
,
"
deleteEvent
"
:
"
是否确定删除当前事件吗?
"
}
};
\ No newline at end of file
o2web/source/x_component_query_ViewDesigner/$View/view.json
浏览文件 @
2670dc15
...
...
@@ -45,19 +45,31 @@
"code"
:
""
,
"html"
:
""
},
"postLoad
Data"
:
{
"postLoad
"
:
{
"code"
:
""
,
"html"
:
""
},
"postLoad"
:
{
"postLoadPageData"
:
{
"code"
:
""
,
"html"
:
""
},
"postLoadPage"
:
{
"code"
:
""
,
"html"
:
""
},
"queryLoadItemRow"
:
{
"code"
:
""
,
"html"
:
""
},
"postLoadItemRow"
:
{
"code"
:
""
,
"html"
:
""
},
"queryLoadRow"
:
{
"queryLoad
Category
Row"
:
{
"code"
:
""
,
"html"
:
""
},
"postLoadRow"
:
{
"postLoad
Category
Row"
:
{
"code"
:
""
,
"html"
:
""
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录