Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
e547dcb3
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,发现更多精彩内容 >>
提交
e547dcb3
编写于
10月 29, 2020
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
查询增加视图功能
上级
2b851e5d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
131 addition
and
74 deletion
+131
-74
o2web/source/x_component_query_Query/Statement.js
o2web/source/x_component_query_Query/Statement.js
+131
-74
未找到文件。
o2web/source/x_component_query_Query/Statement.js
浏览文件 @
e547dcb3
...
...
@@ -21,7 +21,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
this
.
app
=
app
;
this
.
container
=
$
(
container
);
this
.
json
=
json
;
this
.
json
=
json
||
{}
;
this
.
parentMacro
=
parentMacro
;
...
...
@@ -36,6 +36,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
this
.
selectedItems
=
[];
this
.
hideColumns
=
[];
this
.
openColumns
=
[];
this
.
parameter
=
{};
this
.
gridJson
=
null
;
...
...
@@ -87,68 +88,116 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
this
.
paging
.
reload
();
}
},
_initPage
:
function
(){
this
.
count
=
this
.
bundleItems
.
length
;
var
i
=
this
.
count
/
this
.
json
.
pageSize
;
this
.
pages
=
(
i
.
toInt
()
<
i
)
?
i
.
toInt
()
+
1
:
i
;
this
.
currentPage
=
this
.
options
.
defaultPage
||
1
;
this
.
options
.
defaultPage
=
null
;
},
// _initPage: function(){
// var i = this.count/this.json.pageSize;
// this.pages = (i.toInt()<i) ? i.toInt()+1 : i;
// this.currentPage = this.options.defaultPage || 1;
// this.options.defaultPage = null;
// },
lookup
:
function
(
data
,
callback
){
if
(
this
.
lookuping
)
return
;
this
.
lookuping
=
true
;
// this.getLookupAction(function(){
// if (this.json.application){
var
d
=
data
||
{};
// d.count = this.json.count;
// this.lookupAction.bundleView(this.json.id, d, function(json){
// this.bundleItems = json.data.valueList;
// this._initPage();
this
.
currentPage
=
this
.
options
.
defaultPage
||
1
;
this
.
options
.
defaultPage
=
null
;
if
(
this
.
noDataTextNode
)
this
.
noDataTextNode
.
destroy
();
this
.
loadCurrentPageData
(
function
(
json
)
{
if
(
typeOf
(
json
.
count
)
===
"
number
"
)
this
.
totalCount
=
json
.
count
;
if
(
this
.
totalCount
){
this
.
fireEvent
(
"
postLoad
"
);
//用户配置的事件
this
.
lookuping
=
false
;
if
(
callback
)
callback
(
this
);
}
else
{
this
.
viewPageAreaNode
.
empty
();
if
(
this
.
viewJson
.
noDataText
){
var
noDataTextNodeStyle
=
this
.
css
.
noDataTextNode
;
if
(
this
.
viewJson
.
viewStyles
&&
this
.
viewJson
.
viewStyles
[
"
noDataTextNode
"
]
){
noDataTextNodeStyle
=
this
.
viewJson
.
viewStyles
[
"
noDataTextNode
"
];
}
this
.
noDataTextNode
=
new
Element
(
"
div
"
,
{
"
styles
"
:
noDataTextNodeStyle
,
"
text
"
:
this
.
viewJson
.
noDataText
}).
inject
(
this
.
contentAreaNode
);
}
// if (this.loadingAreaNode){
// this.loadingAreaNode.destroy();
// this.loadingAreaNode = null;
// }
this
.
fireEvent
(
"
postLoad
"
);
//用户配置的事件
this
.
lookuping
=
false
;
if
(
callback
)
callback
(
this
);
}
var
d
=
data
||
{};
// d.count = this.json.count;
// this.lookupAction.bundleView(this.json.id, d, function(json){
// this.bundleItems = json.data.valueList;
// this._initPage();
}.
bind
(
this
),
true
,
"
all
"
);
debugger
;
this
.
currentPage
=
this
.
options
.
defaultPage
||
1
;
this
.
options
.
defaultPage
=
null
;
if
(
this
.
noDataTextNode
)
this
.
noDataTextNode
.
destroy
();
this
.
loadCurrentPageData
(
function
(
json
)
{
if
(
this
.
count
){
this
.
fireEvent
(
"
postLoad
"
);
//用户配置的事件
this
.
lookuping
=
false
;
if
(
callback
)
callback
(
this
);
}
else
{
this
.
viewPageAreaNode
.
empty
();
if
(
this
.
viewJson
.
noDataText
){
var
noDataTextNodeStyle
=
this
.
css
.
noDataTextNode
;
if
(
this
.
viewJson
.
viewStyles
&&
this
.
viewJson
.
viewStyles
[
"
noDataTextNode
"
]
){
noDataTextNodeStyle
=
this
.
viewJson
.
viewStyles
[
"
noDataTextNode
"
];
}
this
.
noDataTextNode
=
new
Element
(
"
div
"
,
{
"
styles
"
:
noDataTextNodeStyle
,
"
text
"
:
this
.
viewJson
.
noDataText
}).
inject
(
this
.
contentAreaNode
);
}
// if (this.loadingAreaNode){
// this.loadingAreaNode.destroy();
// this.loadingAreaNode = null;
// }
this
.
fireEvent
(
"
postLoad
"
);
//用户配置的事件
this
.
lookuping
=
false
;
if
(
callback
)
callback
(
this
);
}
}.
bind
(
this
),
true
,
"
all
"
);
// }.bind(this));
// }
// }.bind(this));
// }
// }.bind(this));
},
getParameter
:
function
(){
(
this
.
viewJson
.
filterList
||
[]
).
each
(
function
(
f
)
{
var
value
=
f
.
value
;
if
(
f
.
valueType
===
"
script
"
){
value
=
this
.
Macro
.
exec
(
f
.
valueScript
?
f
.
valueScript
.
code
:
""
,
this
);
}
else
if
(
f
.
value
.
indexOf
(
"
@
"
)
>
-
1
){
debugger
;
var
user
=
layout
.
user
;
switch
(
f
.
value
)
{
case
"
@person
"
:
value
=
user
.
distinguishedName
;
break
;
case
"
@identityList
"
:
value
=
user
.
identityList
.
map
(
function
(
d
)
{
return
d
.
distinguishedName
;
})
break
;
case
"
@unitList
"
:
o2
.
Actions
.
load
(
"
x_organization_assemble_express
"
).
UnitAction
.
listWithPerson
({
"
personList
"
:
[
user
.
distinguishedName
]
},
function
(
json
)
{
value
=
json
.
unitList
;
},
null
,
false
)
break
;
case
"
@unitAllList
"
:
o2
.
Actions
.
load
(
"
x_organization_assemble_express
"
).
UnitAction
.
listWithIdentitySupNested
({
"
personList
"
:
[
user
.
distinguishedName
]
},
function
(
json
)
{
value
=
json
.
unitList
;
},
null
,
false
)
break
;
case
"
@year
"
:
value
=
(
new
Date
().
getFullYear
()).
toString
();
break
;
case
"
@season
"
:
break
;
case
"
@month
"
:
value
=
new
Date
().
format
(
"
%Y-%m
"
);
break
;
case
"
@time
"
:
value
=
new
Date
().
format
(
"
db
"
);
break
;
case
"
@date
"
:
value
=
new
Date
().
format
(
"
%Y-%m-%
"
);
break
;
default
:
}
}
this
.
parameter
[
f
.
parameter
]
=
value
;
}.
bind
(
this
))
},
loadCurrentPageData
:
function
(
callback
,
async
,
type
){
//是否需要在翻页的时候清空之前的items ?
debugger
;
if
(
this
.
pageloading
)
return
;
this
.
pageloading
=
true
;
...
...
@@ -157,9 +206,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
var
p
=
this
.
currentPage
;
var
d
=
{
"
filterList
"
:
[],
"
parameter
"
:
{
}
"
parameter
"
:
this
.
getParameter
()
};
while
(
this
.
viewTable
.
rows
.
length
>
1
){
...
...
@@ -171,34 +218,44 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
this
.
json
.
statementId
||
this
.
json
.
statementName
,
type
||
"
data
"
,
p
,
this
.
json
.
pageSize
,
d
,
function
(
json
){
this
.
gridJson
=
json
.
data
;
if
(
type
===
"
all
"
||
type
===
"
count
"
){
if
(
typeOf
(
json
.
count
)
===
"
number
"
){
this
.
count
=
json
.
count
;
var
i
=
this
.
count
/
this
.
json
.
pageSize
;
this
.
pages
=
(
i
.
toInt
()
<
i
)
?
i
.
toInt
()
+
1
:
i
;
}
}
this
.
gridJson
=
json
.
data
;
this
.
fireEvent
(
"
postLoadPageData
"
);
this
.
fireEvent
(
"
postLoadPageData
"
);
// if (this.viewJson.group.column){
// this.gridJson = json.data.groupGrid;
// }else{
// this.gridJson = json.data.grid;
// if (this.viewJson.group.column){
// this.gridJson = json.data.groupGrid;
// }else{
// this.gridJson = json.data.grid;
this
.
loadData
();
// }
if
(
this
.
gridJson
.
length
)
this
.
_loadPageNode
();
if
(
this
.
loadingAreaNode
){
this
.
loadingAreaNode
.
destroy
();
this
.
loadingAreaNode
=
null
;
}
// }
if
(
this
.
gridJson
.
length
)
this
.
_loadPageNode
();
if
(
this
.
loadingAreaNode
){
this
.
loadingAreaNode
.
destroy
();
this
.
loadingAreaNode
=
null
;
}
this
.
pageloading
=
false
;
this
.
pageloading
=
false
;
this
.
fireEvent
(
"
loadView
"
);
//options 传入的事件
this
.
fireEvent
(
"
postLoadPage
"
);
this
.
fireEvent
(
"
loadView
"
);
//options 传入的事件
this
.
fireEvent
(
"
postLoadPage
"
);
if
(
callback
)
callback
(
json
);
}.
bind
(
this
),
null
,
async
===
false
?
false
:
true
);
if
(
callback
)
callback
(
json
);
}.
bind
(
this
),
null
,
async
===
false
?
false
:
true
);
},
getView
:
function
(
callback
){
this
.
getViewRes
=
o2
.
Actions
.
load
(
"
x_query_assemble_surface
"
).
StatementAction
.
get
(
this
.
json
.
statementId
||
this
.
json
.
statementName
,
function
(
json
){
debugger
;
this
.
viewJson
=
JSON
.
decode
(
json
.
data
.
view
);
var
viewData
=
JSON
.
decode
(
json
.
data
.
view
);
if
(
!
this
.
json
.
pageSize
)
this
.
json
.
pageSize
=
viewData
.
pageSize
;
this
.
viewJson
=
viewData
.
data
;
this
.
json
.
application
=
json
.
data
.
query
;
//this.json = Object.merge(this.json, json.data);
this
.
statementJson
=
json
.
data
;
...
...
@@ -487,10 +544,10 @@ MWF.xApplication.query.Query.Statement.Item = new Class({
// ev.stopPropagation();
// }.bind(this));
// }else{
td
.
addEvent
(
"
click
"
,
function
(
ev
){
this
.
openWorkAndCompleted
(
ev
)
ev
.
stopPropagation
();
}.
bind
(
this
));
td
.
addEvent
(
"
click
"
,
function
(
ev
){
this
.
openWorkAndCompleted
(
ev
)
ev
.
stopPropagation
();
}.
bind
(
this
));
// }
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录