Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
caddcba6
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,发现更多精彩内容 >>
提交
caddcba6
编写于
10月 29, 2020
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
查询增加视图功能
上级
ed241670
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
112 addition
and
37 deletion
+112
-37
o2web/source/x_component_query_Query/Statement.js
o2web/source/x_component_query_Query/Statement.js
+110
-36
o2web/source/x_component_query_StatementDesigner/$Statement/view.json
.../x_component_query_StatementDesigner/$Statement/view.json
+1
-1
o2web/source/x_component_query_StatementDesigner/Statement.js
...b/source/x_component_query_StatementDesigner/Statement.js
+1
-0
未找到文件。
o2web/source/x_component_query_Query/Statement.js
浏览文件 @
caddcba6
...
...
@@ -108,6 +108,8 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
// this._initPage();
debugger
;
this
.
loadParameter
();
this
.
loadFilter
(
data
);
this
.
currentPage
=
this
.
options
.
defaultPage
||
1
;
this
.
options
.
defaultPage
=
null
;
...
...
@@ -146,13 +148,27 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
// }
// }.bind(this));
},
getParameter
:
function
(){
loadFilter
:
function
(
data
){
this
.
filterList
=
[];
(
data
.
filterList
||
[]
).
each
(
function
(
d
)
{
var
parameterName
=
d
.
path
.
replace
(
/
\.
/g
,
"
_
"
);
if
(
d
.
comparison
===
"
like
"
||
d
.
comparison
===
"
notLike
"
){
this
.
parameter
[
parameterName
]
=
"
%
"
+
d
.
value
+
"
%
"
;
}
else
{
this
.
parameter
[
parameterName
]
=
d
.
value
;
}
d
.
value
=
parameterName
;
this
.
filterList
.
push
(
d
);
}.
bind
(
this
))
},
loadParameter
:
function
(){
(
this
.
viewJson
.
filterList
||
[]
).
each
(
function
(
f
)
{
var
value
=
f
.
value
;
debugger
;
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
"
:
...
...
@@ -177,6 +193,16 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
value
=
(
new
Date
().
getFullYear
()).
toString
();
break
;
case
"
@season
"
:
var
m
=
new
Date
().
format
(
"
%m
"
);
if
(
[
"
01
"
,
"
02
"
,
"
03
"
].
contains
(
m
)
){
value
=
"
1
"
}
else
if
(
[
"
04
"
,
"
05
"
,
"
06
"
].
contains
(
m
)
){
value
=
"
2
"
}
else
if
(
[
"
07
"
,
"
08
"
,
"
09
"
].
contains
(
m
)
){
value
=
"
3
"
}
else
{
value
=
"
4
"
}
break
;
case
"
@month
"
:
value
=
new
Date
().
format
(
"
%Y-%m
"
);
...
...
@@ -185,7 +211,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
value
=
new
Date
().
format
(
"
db
"
);
break
;
case
"
@date
"
:
value
=
new
Date
().
format
(
"
%Y-%m-%
"
);
value
=
new
Date
().
format
(
"
%Y-%m-%
d
"
);
break
;
default
:
}
...
...
@@ -205,8 +231,8 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
var
p
=
this
.
currentPage
;
var
d
=
{
"
filterList
"
:
[]
,
"
parameter
"
:
this
.
getParameter
()
"
filterList
"
:
this
.
filterList
,
"
parameter
"
:
this
.
parameter
};
while
(
this
.
viewTable
.
rows
.
length
>
1
){
...
...
@@ -452,48 +478,50 @@ MWF.xApplication.query.Query.Statement.Item = new Class({
debugger
;
Object
.
each
(
this
.
view
.
entries
,
function
(
c
,
k
){
var
cell
=
this
.
data
.
data
[
k
];
if
(
cell
===
undefined
)
cell
=
""
;
//if (cell){
if
(
this
.
view
.
hideColumns
.
indexOf
(
k
)
===-
1
){
var
td
=
new
Element
(
"
td
"
,
{
"
styles
"
:
viewContentTdNode
}).
inject
(
this
.
node
);
if
(
k
!==
this
.
view
.
viewJson
.
group
.
column
){
//var v = (this.view.entries[k].code) ? MWF.Macro.exec(this.view.entries[k].code, {"value": cell, "gridData": this.view.gridJson, "data": this.view.viewData, "entry": this.data}) : cell;
var
v
=
cell
;
if
(
c
.
isHtml
){
td
.
set
(
"
html
"
,
v
);
}
else
{
td
.
set
(
"
text
"
,
v
);
}
if
(
typeOf
(
c
.
contentProperties
)
===
"
object
"
)
td
.
setProperties
(
c
.
contentProperties
);
if
(
this
.
view
.
json
.
itemStyles
)
td
.
setStyles
(
this
.
view
.
json
.
itemStyles
);
if
(
typeOf
(
c
.
contentStyles
)
===
"
object
"
)
td
.
setStyles
(
c
.
contentStyles
);
var
cell
=
this
.
getText
(
c
,
k
,
td
);
//this.data[k];
if
(
cell
===
undefined
||
cell
===
null
)
cell
=
""
;
// if (k!== this.view.viewJson.group.column){
var
v
=
cell
;
if
(
c
.
isHtml
){
td
.
set
(
"
html
"
,
v
);
}
else
{
if
(
this
.
view
.
json
.
itemStyles
)
td
.
setStyles
(
this
.
view
.
json
.
itemStyles
);
td
.
set
(
"
text
"
,
v
);
}
if
(
typeOf
(
c
.
contentProperties
)
===
"
object
"
)
td
.
setProperties
(
c
.
contentProperties
);
if
(
this
.
view
.
json
.
itemStyles
)
td
.
setStyles
(
this
.
view
.
json
.
itemStyles
);
if
(
typeOf
(
c
.
contentStyles
)
===
"
object
"
)
td
.
setStyles
(
c
.
contentStyles
);
// }else{
// if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
// }
if
(
this
.
view
.
openColumns
.
indexOf
(
k
)
!==-
1
){
this
.
setOpenWork
(
td
,
c
)
}
if
(
k
!==
this
.
view
.
viewJson
.
group
.
column
){
Object
.
each
(
c
.
events
||
{},
function
(
e
,
key
)
{
if
(
e
.
code
){
if
(
key
===
"
loadContent
"
){
this
.
view
.
Macro
.
fire
(
e
.
code
,
{
"
node
"
:
td
,
"
json
"
:
c
,
"
data
"
:
v
,
"
view
"
:
this
.
view
,
"
row
"
:
this
});
}
else
if
(
key
!==
"
loadTitle
"
){
td
.
addEvent
(
key
,
function
(
event
){
return
this
.
view
.
Macro
.
fire
(
e
.
code
,
{
"
node
"
:
td
,
"
json
"
:
c
,
"
data
"
:
v
,
"
view
"
:
this
.
view
,
"
row
"
:
this
},
event
);
}.
bind
(
this
));
}
// if (k!== this.view.viewJson.group.column){
Object
.
each
(
c
.
events
||
{},
function
(
e
,
key
)
{
if
(
e
.
code
){
if
(
key
===
"
loadContent
"
){
this
.
view
.
Macro
.
fire
(
e
.
code
,
{
"
node
"
:
td
,
"
json
"
:
c
,
"
data
"
:
v
,
"
view
"
:
this
.
view
,
"
row
"
:
this
});
}
else
if
(
key
!==
"
loadTitle
"
){
td
.
addEvent
(
key
,
function
(
event
){
return
this
.
view
.
Macro
.
fire
(
e
.
code
,
{
"
node
"
:
td
,
"
json
"
:
c
,
"
data
"
:
v
,
"
view
"
:
this
.
view
,
"
row
"
:
this
},
event
);
}.
bind
(
this
));
}
}.
bind
(
this
));
}
}
}.
bind
(
this
));
// }
}
//}
}.
bind
(
this
));
...
...
@@ -523,6 +551,52 @@ MWF.xApplication.query.Query.Statement.Item = new Class({
this
.
view
.
fireEvent
(
"
postLoadItemRow
"
,
[
null
,
this
]);
},
getText
:
function
(
c
,
k
,
td
){
var
path
=
c
.
path
,
code
=
c
.
code
,
obj
=
this
.
data
;
if
(
path
){
var
pathList
=
path
.
split
(
"
.
"
);
for
(
var
i
=
0
;
i
<
pathList
.
length
;
i
++
){
var
p
=
pathList
[
i
];
if
(
(
/
(
^
[
1-9
]\d
*$
)
/
.
test
(
p
))
)
p
=
p
.
toInt
();
if
(
obj
[
p
]
){
obj
=
obj
[
p
];
}
else
{
obj
=
""
;
break
;
}
}
}
if
(
code
&&
code
.
trim
())
obj
=
MWF
.
Macro
.
exec
(
code
,
{
"
value
"
:
obj
,
"
data
"
:
this
.
data
,
"
entry
"
:
c
,
"
node
"
:
td
,
"
json
"
:
c
,
"
row
"
:
this
});
var
toName
=
function
(
value
)
{
if
(
typeOf
(
value
)
===
"
array
"
){
Array
.
each
(
value
,
function
(
v
,
idx
)
{
value
[
idx
]
=
toName
(
v
)
})
}
else
if
(
typeOf
(
value
)
===
"
object
"
){
Object
.
each
(
value
,
function
(
v
,
key
)
{
value
[
key
]
=
toName
(
v
);
})
}
else
if
(
typeOf
(
value
)
===
"
string
"
){
value
=
o2
.
name
.
cn
(
value
)
}
return
value
;
};
var
d
;
if
(
obj
!=
undefined
&&
obj
!=
null
){
if
(
typeOf
(
obj
)
===
"
array
"
)
{
d
=
c
.
isName
?
JSON
.
stringify
(
toName
(
Array
.
clone
(
obj
)))
:
JSON
.
stringify
(
obj
);
}
else
if
(
typeOf
(
obj
)
===
"
object
"
){
d
=
c
.
isName
?
JSON
.
stringify
(
toName
(
Object
.
clone
(
obj
)))
:
JSON
.
stringify
(
obj
);
}
else
{
d
=
c
.
isName
?
o2
.
name
.
cn
(
obj
.
toString
()
)
:
obj
;
}
}
return
d
;
},
setOpenWork
:
function
(
td
,
column
){
td
.
setStyle
(
"
cursor
"
,
"
pointer
"
);
if
(
column
.
clickCode
){
...
...
o2web/source/x_component_query_StatementDesigner/$Statement/view.json
浏览文件 @
caddcba6
...
...
@@ -14,7 +14,7 @@
"selectList"
:
[],
"filterList"
:
[],
"orderList"
:
[],
//
"group"
:
{},
"group"
:
{},
"columnList"
:
[],
//
"calculate"
:
{},
//
"afterGridScriptText"
:
""
,
...
...
o2web/source/x_component_query_StatementDesigner/Statement.js
浏览文件 @
caddcba6
...
...
@@ -854,6 +854,7 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
if
(
typeOf
(
this
.
viewJson
)
===
"
object
"
)
{
this
.
data
.
view
=
JSON
.
stringify
(
this
.
viewJson
);
if
(
!
this
.
data
.
view
.
group
)
this
.
data
.
view
.
group
=
{};
}
//if( !this.data.tableType ){
// this.data.tableType = "dynamic";
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录