Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
b9262338
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,发现更多精彩内容 >>
提交
b9262338
编写于
11月 06, 2020
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
查询视图修改
上级
cce1e4a7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
153 addition
and
149 deletion
+153
-149
o2web/source/o2_core/o2/xScript/ViewEnvironment.js
o2web/source/o2_core/o2/xScript/ViewEnvironment.js
+6
-7
o2web/source/x_component_query_Query/Statement.js
o2web/source/x_component_query_Query/Statement.js
+17
-18
o2web/source/x_component_query_StatementDesigner/$Statement/view.html
.../x_component_query_StatementDesigner/$Statement/view.html
+50
-50
o2web/source/x_component_query_StatementDesigner/widget/ViewFilter.js
.../x_component_query_StatementDesigner/widget/ViewFilter.js
+80
-74
未找到文件。
o2web/source/o2_core/o2/xScript/ViewEnvironment.js
浏览文件 @
b9262338
...
...
@@ -669,13 +669,12 @@ MWF.xScript.ViewEnvironment = function (ev) {
this
.
statement
=
{
"
execute
"
:
function
(
statement
,
callback
,
async
)
{
var
filterList
=
{
"
filterList
"
:
(
statement
.
filter
||
null
)
};
MWF
.
Actions
.
get
(
"
x_query_assemble_surface
"
).
execute
(
statement
.
view
,
statement
.
application
,
filterList
,
function
(
json
)
{
var
data
=
{
"
grid
"
:
json
.
data
.
grid
,
};
if
(
callback
)
callback
(
data
);
},
null
,
async
);
var
obj
=
{
"
filterList
"
:
(
statement
.
filterList
||
[]),
parameter
:
(
statement
.
parameter
||
{})
};
MWF
.
Actions
.
load
(
"
x_query_assemble_surface
"
).
StatementAction
.
executeV2
(
statement
.
name
,
statement
.
mode
||
"
data
"
,
statement
.
page
||
1
,
statement
.
pageSize
||
20
,
obj
,
function
(
json
)
{
if
(
callback
)
callback
(
json
);
},
null
,
async
);
},
"
select
"
:
function
(
statement
,
callback
,
options
)
{
if
(
statement
.
statement
)
{
...
...
o2web/source/x_component_query_Query/Statement.js
浏览文件 @
b9262338
...
...
@@ -177,14 +177,15 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
this
.
filterList
.
push
(
d
);
}.
bind
(
this
))
},
loadParameter
:
function
(
data
){
loadParameter
:
function
(){
this
.
parameter
=
{};
var
parameter
=
this
.
json
.
parameter
?
Object
.
clone
(
this
.
json
.
parameter
)
:
{};
//系统默认的参数
(
this
.
viewJson
.
fil
terList
||
[]
).
each
(
function
(
f
)
{
(
this
.
viewJson
.
parame
terList
||
[]
).
each
(
function
(
f
)
{
var
value
=
f
.
value
;
if
(
data
.
parameter
&&
data
.
parameter
[
f
.
parameter
]
){
value
=
data
.
parameter
[
f
.
parameter
];
delete
data
.
parameter
[
f
.
parameter
];
if
(
parameter
&&
parameter
[
f
.
parameter
]
){
value
=
parameter
[
f
.
parameter
];
delete
parameter
[
f
.
parameter
];
}
debugger
;
if
(
typeOf
(
value
)
===
"
date
"
){
...
...
@@ -254,14 +255,12 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
this
.
parameter
[
f
.
parameter
]
=
value
;
}.
bind
(
this
));
//传入的参数
if
(
data
.
parameter
){
for
(
var
p
in
data
.
parameter
){
var
value
=
data
.
parameter
[
p
];
if
(
typeOf
(
value
)
===
"
date
"
){
value
=
"
{ts '
"
+
value
+
"
'}
"
}
this
.
parameter
[
p
]
=
value
;
for
(
var
p
in
parameter
){
var
value
=
parameter
[
p
];
if
(
typeOf
(
value
)
===
"
date
"
){
value
=
"
{ts '
"
+
value
+
"
'}
"
}
parameter
[
p
]
=
value
;
}
},
loadCurrentPageData
:
function
(
callback
,
async
,
type
){
...
...
@@ -484,14 +483,14 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
switchStatement
:
function
(
json
)
{
this
.
switchView
(
json
);
},
setFilter
:
function
(
filter
,
callback
){
setFilter
:
function
(
filter
,
parameter
,
callback
){
if
(
this
.
lookuping
||
this
.
pageloading
)
return
;
if
(
!
filter
)
filter
=
{
"
filterList
"
:
[],
"
paramter
"
:
{}
}
;
if
(
typeOf
(
filter
)
===
"
object
"
)
return
;
this
.
json
.
filter
=
filter
.
filterList
||
[]
;
this
.
json
.
param
ter
=
filter
.
paramter
||
{}
;
if
(
!
filter
)
filter
=
[]
;
if
(
!
parameter
)
parameter
=
{}
;
this
.
json
.
filter
=
filter
;
this
.
json
.
param
eter
=
parameter
;
if
(
this
.
viewAreaNode
){
this
.
createViewNode
({
"
filterList
"
:
this
.
json
.
filter
.
clone
()
,
"
paramter
"
:
Object
.
clone
(
this
.
json
.
paramter
)
},
callback
);
this
.
createViewNode
({
"
filterList
"
:
this
.
json
.
filter
.
clone
()
},
callback
);
}
}
});
...
...
o2web/source/x_component_query_StatementDesigner/$Statement/view.html
浏览文件 @
b9262338
...
...
@@ -166,28 +166,28 @@
<td
class=
"editTableTitle"
>
数据类型:
</td>
<td
class=
"editTableValue"
><select
class=
"datatypeInput_vf"
>
<!-- onchange="if (this.selectedIndex==2){-->
<!-- $('text{$.id}view
Fil
terDateFormulaSelector').setStyle('display', 'block');-->
<!-- $('text{$.id}view
Fil
terDateOnlyFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Fil
terTimeOnlyFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Parame
terDateFormulaSelector').setStyle('display', 'block');-->
<!-- $('text{$.id}view
Parame
terDateOnlyFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Parame
terTimeOnlyFormulaSelector').setStyle('display', 'none');-->
<!-- }else if (this.selectedIndex==3){-->
<!-- $('text{$.id}view
Fil
terDateFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Fil
terDateOnlyFormulaSelector').setStyle('display', 'block');-->
<!-- $('text{$.id}view
Fil
terTimeOnlyFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Parame
terDateFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Parame
terDateOnlyFormulaSelector').setStyle('display', 'block');-->
<!-- $('text{$.id}view
Parame
terTimeOnlyFormulaSelector').setStyle('display', 'none');-->
<!-- }else if (this.selectedIndex==4){-->
<!-- $('text{$.id}view
Fil
terDateFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Fil
terDateOnlyFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Fil
terTimeOnlyFormulaSelector').setStyle('display', 'block');-->
<!-- $('text{$.id}view
Parame
terDateFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Parame
terDateOnlyFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Parame
terTimeOnlyFormulaSelector').setStyle('display', 'block');-->
<!-- }else{-->
<!-- $('text{$.id}view
Fil
terDateFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Fil
terDateOnlyFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Fil
terTimeOnlyFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Parame
terDateFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Parame
terDateOnlyFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Parame
terTimeOnlyFormulaSelector').setStyle('display', 'none');-->
<!-- }-->
<!-- if (this.selectedIndex==0){-->
<!-- $('text{$.id}view
Fil
terTextFormulaSelector').setStyle('display', 'block');-->
<!-- $('text{$.id}view
Parame
terTextFormulaSelector').setStyle('display', 'block');-->
<!-- }else{-->
<!-- $('text{$.id}view
Fil
terTextFormulaSelector').setStyle('display', 'none');-->
<!-- $('text{$.id}view
Parame
terTextFormulaSelector').setStyle('display', 'none');-->
<!-- }">-->
<option
value=
"textValue"
selected
>
文本
</option>
...
...
@@ -201,9 +201,9 @@
<tr>
<td
class=
"editTableTitle"
></td>
<td
class=
"editTableValue"
>
<input
type=
"radio"
class=
"restrict
Fil
terInput_vf"
value=
"restrict"
name=
"text{$.id}viewFilterType"
onclick=
"if (this.checked){
<input
type=
"radio"
class=
"restrict
Parame
terInput_vf"
value=
"restrict"
name=
"text{$.id}viewFilterType"
onclick=
"if (this.checked){
debugger;
$('text{$.id}view
Fil
terRestrict').setStyle('display', 'block');
$('text{$.id}view
Parame
terRestrict').setStyle('display', 'block');
$('text{$.id}parameterInputTr').setStyle('display', 'table-row');
// $('text{$.id}parameterInputSelectTr').setStyle('display', 'table-row');
$('text{$.id}viewCustomFilterRestrict').setStyle('display', 'none');
...
...
@@ -211,7 +211,7 @@
$('text{$.id}pathInputSelectTr').setStyle('display', 'none');
}"
/>
作为默认过滤条件
<br>
<input
type=
"radio"
class=
"customFilterInput_vf"
value=
"custom"
name=
"text{$.id}viewFilterType"
onclick=
"if (this.checked){
$('text{$.id}view
Fil
terRestrict').setStyle('display', 'none');
$('text{$.id}view
Parame
terRestrict').setStyle('display', 'none');
$('text{$.id}parameterInputTr').setStyle('display', 'none');
// $('text{$.id}parameterInputSelectTr').setStyle('display', 'none');
$('text{$.id}viewCustomFilterRestrict').setStyle('display', 'block');
...
...
@@ -221,32 +221,32 @@
</td>
</tr>
</table>
<div
id=
"text{$.id}view
Fil
terRestrict"
style=
"display: none"
>
<div
id=
"text{$.id}view
Parame
terRestrict"
style=
"display: none"
>
<table
width=
"100%"
border=
"0"
cellpadding=
"5"
cellspacing=
"0"
class=
"editTable"
>
<tr>
<td
class=
"editTableTitle"
id=
"text{$.id}view
Fil
terValueTitleArea"
>
值:
</td>
<td
class=
"editTableTitle"
id=
"text{$.id}view
Parame
terValueTitleArea"
>
值:
</td>
<td
class=
"editTableValue"
>
<input
class=
"editTableRadio"
name=
"view
Fil
terValueType"
type=
"radio"
value=
"input"
checked
onclick=
"
<input
class=
"editTableRadio"
name=
"view
Parame
terValueType"
type=
"radio"
value=
"input"
checked
onclick=
"
if (this.checked){
$('text{$.id}view
Fil
terValueScriptDiv').setStyle('display', 'none');
$('text{$.id}view
Fil
terValueArea').setStyle('display', 'table-row');
$('text{$.id}view
Fil
terFormulaSelector').setStyle('display', 'block');
$('text{$.id}view
Parame
terValueScriptDiv').setStyle('display', 'none');
$('text{$.id}view
Parame
terValueArea').setStyle('display', 'table-row');
$('text{$.id}view
Parame
terFormulaSelector').setStyle('display', 'block');
}
"
/>
输入
<input
class=
"editTableRadio"
name=
"view
Fil
terValueType"
type=
"radio"
value=
"script"
onclick=
"
<input
class=
"editTableRadio"
name=
"view
Parame
terValueType"
type=
"radio"
value=
"script"
onclick=
"
if (this.checked){
$('text{$.id}view
Fil
terValueScriptDiv').setStyle('display', 'block');
$('text{$.id}view
Fil
terValueArea').setStyle('display', 'none');
$('text{$.id}view
Fil
terFormulaSelector').setStyle('display', 'none');
$('text{$.id}view
Parame
terValueScriptDiv').setStyle('display', 'block');
$('text{$.id}view
Parame
terValueArea').setStyle('display', 'none');
$('text{$.id}view
Parame
terFormulaSelector').setStyle('display', 'none');
}
"
/>
脚本
</td>
</tr>
<tr
id=
"text{$.id}view
Fil
terValueArea"
>
<tr
id=
"text{$.id}view
Parame
terValueArea"
>
<td
class=
"editTableTitle"
></td>
<td
class=
"editTableValue"
>
<input
type=
"text"
class=
"editTableInput valueTextInput_vf"
style=
"display: block"
onkeypress=
"$('text{$.id}view
Fil
terTextFormulaSelector').getElements('input').set('checked', false)"
/>
<input
type=
"text"
class=
"editTableInput valueTextInput_vf"
style=
"display: block"
onkeypress=
"$('text{$.id}view
Parame
terTextFormulaSelector').getElements('input').set('checked', false)"
/>
<input
type=
"number"
class=
"editTableInput valueNumberInput_vf"
style=
"display: none"
/>
<input
type=
"text"
class=
"editTableInput valueDatetimeInput_vf"
style=
"display: none"
readonly
/>
<input
type=
"text"
class=
"editTableInput valueDateInput_vf"
style=
"display: none"
readonly
/>
...
...
@@ -259,62 +259,62 @@
</tr>
</table>
<div
id=
"text{$.id}view
Fil
terFormulaSelector"
>
<div
style=
"display: none"
id=
"text{$.id}view
Fil
terDateFormulaSelector"
>
<div
id=
"text{$.id}view
Parame
terFormulaSelector"
>
<div
style=
"display: none"
id=
"text{$.id}view
Parame
terDateFormulaSelector"
>
<table
width=
"100%"
border=
"0"
cellpadding=
"5"
cellspacing=
"0"
class=
"editTable"
>
<tr>
<td
class=
"editTableTitle"
></td>
<td
class=
"editTableValue"
>
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terDateFormula"
type=
"radio"
value=
"@year"
/>
当前年度
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terDateFormula"
type=
"radio"
value=
"@season"
/>
当前季度
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terDateFormula"
type=
"radio"
value=
"@month"
/>
当前月份
<br/>
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terDateFormula"
type=
"radio"
value=
"@time"
/>
当前时间
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terDateFormula"
type=
"radio"
value=
"@date"
/>
当天
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terDateFormula"
type=
"radio"
value=
"@year"
/>
当前年度
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terDateFormula"
type=
"radio"
value=
"@season"
/>
当前季度
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terDateFormula"
type=
"radio"
value=
"@month"
/>
当前月份
<br/>
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terDateFormula"
type=
"radio"
value=
"@time"
/>
当前时间
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terDateFormula"
type=
"radio"
value=
"@date"
/>
当天
</td>
</tr>
</table>
</div>
<div
style=
"display: none"
id=
"text{$.id}view
Fil
terDateOnlyFormulaSelector"
>
<div
style=
"display: none"
id=
"text{$.id}view
Parame
terDateOnlyFormulaSelector"
>
<table
width=
"100%"
border=
"0"
cellpadding=
"5"
cellspacing=
"0"
class=
"editTable"
>
<tr>
<td
class=
"editTableTitle"
></td>
<td
class=
"editTableValue"
>
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueDateInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terDateFormula"
type=
"radio"
value=
"@year"
/>
当前年度
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueDateInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terDateFormula"
type=
"radio"
value=
"@season"
/>
当前季度
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueDateInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terDateFormula"
type=
"radio"
value=
"@month"
/>
当前月份
<br/>
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueDateInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terDateFormula"
type=
"radio"
value=
"@date"
/>
当天
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueDateInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terDateFormula"
type=
"radio"
value=
"@year"
/>
当前年度
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueDateInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terDateFormula"
type=
"radio"
value=
"@season"
/>
当前季度
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueDateInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terDateFormula"
type=
"radio"
value=
"@month"
/>
当前月份
<br/>
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueDateInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terDateFormula"
type=
"radio"
value=
"@date"
/>
当天
</td>
</tr>
</table>
</div>
<div
style=
"display: none"
id=
"text{$.id}view
Fil
terTimeOnlyFormulaSelector"
>
<div
style=
"display: none"
id=
"text{$.id}view
Parame
terTimeOnlyFormulaSelector"
>
<table
width=
"100%"
border=
"0"
cellpadding=
"5"
cellspacing=
"0"
class=
"editTable"
>
<tr>
<td
class=
"editTableTitle"
></td>
<td
class=
"editTableValue"
>
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueTimeInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terDateFormula"
type=
"radio"
value=
"@time"
/>
当前时间
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueTimeInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terDateFormula"
type=
"radio"
value=
"@time"
/>
当前时间
</td>
</tr>
</table>
</div>
<div
style=
"display: block"
id=
"text{$.id}view
Fil
terTextFormulaSelector"
>
<div
style=
"display: block"
id=
"text{$.id}view
Parame
terTextFormulaSelector"
>
<table
width=
"100%"
border=
"0"
cellpadding=
"5"
cellspacing=
"0"
class=
"editTable"
>
<tr>
<td
class=
"editTableTitle"
></td>
<td
class=
"editTableValue"
>
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueTextInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terTextFormula"
onclick=
""
type=
"radio"
value=
"@person"
/>
当前人
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueTextInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terTextFormula"
type=
"radio"
value=
"@identityList"
/>
当前身份
<br/>
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueTextInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terTextFormula"
type=
"radio"
value=
"@unitList"
/>
当前人所在直接组织
<br/>
<input
onclick=
"$('text{$.id}view
FilterValueArea').getElement('.valueTextInput_vf').set('value', this.value)"
name=
"text{$.id}viewFil
terTextFormula"
type=
"radio"
value=
"@unitAllList"
/>
当前人所在所有组织
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueTextInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terTextFormula"
onclick=
""
type=
"radio"
value=
"@person"
/>
当前人
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueTextInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terTextFormula"
type=
"radio"
value=
"@identityList"
/>
当前身份
<br/>
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueTextInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terTextFormula"
type=
"radio"
value=
"@unitList"
/>
当前人所在直接组织
<br/>
<input
onclick=
"$('text{$.id}view
ParameterValueArea').getElement('.valueTextInput_vf').set('value', this.value)"
name=
"text{$.id}viewParame
terTextFormula"
type=
"radio"
value=
"@unitAllList"
/>
当前人所在所有组织
</td>
</tr>
</table>
</div>
</div>
<div
style=
"display:none"
id=
"text{$.id}view
Fil
terValueScriptDiv"
>
<div
name=
"text{$.id}view
Fil
terValueScript"
title=
"脚本"
></div>
<div
style=
"display:none"
id=
"text{$.id}view
Parame
terValueScriptDiv"
>
<div
name=
"text{$.id}view
Parame
terValueScript"
title=
"脚本"
></div>
</div>
</div>
...
...
o2web/source/x_component_query_StatementDesigner/widget/ViewFilter.js
浏览文件 @
b9262338
...
...
@@ -50,13 +50,17 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
}
},
loadData
:
function
()
{
if
(
this
.
filtrData
.
parameterData
&&
this
.
filtrData
.
parameterData
.
length
)
{
this
.
filtrData
.
parameterData
.
each
(
function
(
data
)
{
data
.
type
=
"
parameter
"
;
this
.
items
.
push
(
new
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
ItemParameter
(
this
,
data
));
}.
bind
(
this
));
}
if
(
this
.
filtrData
.
filtrData
&&
this
.
filtrData
.
filtrData
.
length
)
{
this
.
filtrData
.
filtrData
.
each
(
function
(
data
)
{
if
(
this
.
options
.
withForm
){
this
.
items
.
push
(
new
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
ItemWithForm
(
this
,
data
));
}
else
{
this
.
items
.
push
(
new
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
(
this
,
data
));
}
data
.
type
=
"
filter
"
;
this
.
items
.
push
(
new
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
ItemFilter
(
this
,
data
));
}.
bind
(
this
));
}
...
...
@@ -87,25 +91,25 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
this
.
scriptArea
.
load
(
v
);
}.
bind
(
this
));
},
create
Fil
terValueScriptArea
:
function
(
node
)
{
create
Parame
terValueScriptArea
:
function
(
node
)
{
var
title
=
node
.
get
(
"
title
"
);
MWF
.
require
(
"
MWF.widget.ScriptArea
"
,
function
()
{
this
.
fil
terValueScriptArea
=
new
MWF
.
widget
.
ScriptArea
(
node
,
{
this
.
parame
terValueScriptArea
=
new
MWF
.
widget
.
ScriptArea
(
node
,
{
"
title
"
:
title
,
"
isload
"
:
true
,
"
isbind
"
:
false
,
"
maxObj
"
:
this
.
app
.
formContentNode
||
this
.
app
.
pageContentNode
,
"
onChange
"
:
function
()
{
this
.
filterValueScriptData
=
this
.
fil
terValueScriptArea
.
toJson
();
this
.
parameterValueScriptData
=
this
.
parame
terValueScriptArea
.
toJson
();
}.
bind
(
this
),
"
onSave
"
:
function
()
{
//this.app.saveForm();
}.
bind
(
this
),
"
style
"
:
"
formula
"
});
var
v
=
(
this
.
filterValueScriptData
)
?
this
.
fil
terValueScriptData
.
code
:
""
;
this
.
fil
terValueScriptArea
.
load
(
v
);
var
v
=
(
this
.
parameterValueScriptData
)
?
this
.
parame
terValueScriptData
.
code
:
""
;
this
.
parame
terValueScriptArea
.
load
(
v
);
}.
bind
(
this
));
},
createCustomFilterValueScriptArea
:
function
(
node
)
{
...
...
@@ -151,7 +155,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
// this.parameterInputSelect = this.inputAreaNode.getElement(".parameterInputSelect_vf");
this
.
datatypeInput
=
this
.
inputAreaNode
.
getElement
(
"
.datatypeInput_vf
"
);
this
.
restrict
FilterInput
=
this
.
inputAreaNode
.
getElement
(
"
.restrictFil
terInput_vf
"
);
this
.
restrict
ParameterInput
=
this
.
inputAreaNode
.
getElement
(
"
.restrictParame
terInput_vf
"
);
this
.
customFilterInput
=
this
.
inputAreaNode
.
getElement
(
"
.customFilterInput_vf
"
);
// this.logicInput = this.inputAreaNode.getElement(".logicInput_vf");
...
...
@@ -171,11 +175,11 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
if
(
this
.
app
.
statement
&&
this
.
app
.
statement
.
view
)
{
var
dataId
=
this
.
app
.
statement
.
view
.
data
.
id
;
this
.
filterValueType
=
this
.
inputAreaNode
.
getElements
(
"
[name='
"
+
dataId
+
"
viewFil
terValueType']
"
);
this
.
filterValueScriptDiv
=
this
.
inputAreaNode
.
getElement
(
"
#
"
+
dataId
+
"
viewFil
terValueScriptDiv
"
);
this
.
filterValueScript
=
this
.
inputAreaNode
.
getElement
(
"
[name='
"
+
dataId
+
"
viewFil
terValueScript']
"
);
if
(
this
.
fil
terValueScript
)
{
this
.
create
FilterValueScriptArea
(
this
.
fil
terValueScript
);
this
.
parameterValueType
=
this
.
inputAreaNode
.
getElements
(
"
[name='
"
+
dataId
+
"
viewParame
terValueType']
"
);
this
.
parameterValueScriptDiv
=
this
.
inputAreaNode
.
getElement
(
"
#
"
+
dataId
+
"
viewParame
terValueScriptDiv
"
);
this
.
parameterValueScript
=
this
.
inputAreaNode
.
getElement
(
"
[name='
"
+
dataId
+
"
viewParame
terValueScript']
"
);
if
(
this
.
parame
terValueScript
)
{
this
.
create
ParameterValueScriptArea
(
this
.
parame
terValueScript
);
}
this
.
customFilterValueTypes
=
this
.
inputAreaNode
.
getElements
(
"
[name='
"
+
dataId
+
"
viewCustomFilterValueType']
"
);
...
...
@@ -194,7 +198,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
"
target
"
:
this
.
app
.
content
,
"
format
"
:
"
db
"
,
"
onComplate
"
:
function
()
{
this
.
node
.
getElement
(
"
#
"
+
id
+
"
view
Fil
terDateFormulaSelector
"
).
getElements
(
"
input
"
).
set
(
"
checked
"
,
false
);
this
.
node
.
getElement
(
"
#
"
+
id
+
"
view
Parame
terDateFormulaSelector
"
).
getElements
(
"
input
"
).
set
(
"
checked
"
,
false
);
}.
bind
(
this
)
});
new
MWF
.
widget
.
Calendar
(
this
.
valueDateInput
,
{
...
...
@@ -302,7 +306,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
//if (this.app.statement.view){
// var id = this.app.view.data.id;
// var div = this.node.getElement("#"+id+"view
Fil
terValueArea2");
// var div = this.node.getElement("#"+id+"view
Parame
terValueArea2");
// // inputs = div.getElements("input");
// if( div ){
//this.valueTextInput2 = div.getElement(".valueTextInput2_vf") || null;
...
...
@@ -320,7 +324,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
// "target": this.app.content,
// "format": "db",
// "onComplate": function(){
// this.node.getElement("#"+id+"view
Fil
terDateFormulaSelector2").getElements("input").set("checked", false);
// this.node.getElement("#"+id+"view
Parame
terDateFormulaSelector2").getElements("input").set("checked", false);
// }.bind(this)
// });
// new MWF.widget.Calendar(this.valueDateInput2, {
...
...
@@ -411,23 +415,23 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
}
var
config
=
{
"
textValue
"
:
{
"
selectorArea
"
:
"
#
"
+
id
+
"
view
Fil
terTextFormulaSelector
"
,
"
selectorArea
"
:
"
#
"
+
id
+
"
view
Parame
terTextFormulaSelector
"
,
"
input
"
:
this
.
valueTextInput
},
"
datetimeValue
"
:
{
"
selectorArea
"
:
"
#
"
+
id
+
"
view
Fil
terDateFormulaSelector
"
,
"
selectorArea
"
:
"
#
"
+
id
+
"
view
Parame
terDateFormulaSelector
"
,
"
input
"
:
this
.
valueDatetimeInput
},
"
dateTimeValue
"
:
{
"
selectorArea
"
:
"
#
"
+
id
+
"
view
Fil
terDateFormulaSelector
"
,
"
selectorArea
"
:
"
#
"
+
id
+
"
view
Parame
terDateFormulaSelector
"
,
"
input
"
:
this
.
valueDatetimeInput
},
"
dateValue
"
:
{
"
selectorArea
"
:
"
#
"
+
id
+
"
view
Fil
terDateOnlyFormulaSelector
"
,
"
selectorArea
"
:
"
#
"
+
id
+
"
view
Parame
terDateOnlyFormulaSelector
"
,
"
input
"
:
this
.
valueDateInput
},
"
timeValue
"
:
{
"
selectorArea
"
:
"
#
"
+
id
+
"
view
Fil
terTimeOnlyFormulaSelector
"
,
"
selectorArea
"
:
"
#
"
+
id
+
"
view
Parame
terTimeOnlyFormulaSelector
"
,
"
input
"
:
this
.
valueTimeInput
},
"
numberValue
"
:
{
...
...
@@ -439,10 +443,10 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
};
var
formulaSelectorIdList
=
[
"
#
"
+
id
+
"
view
Fil
terTextFormulaSelector
"
,
"
#
"
+
id
+
"
view
Fil
terDateFormulaSelector
"
,
"
#
"
+
id
+
"
view
Fil
terDateOnlyFormulaSelector
"
,
"
#
"
+
id
+
"
view
Fil
terTimeOnlyFormulaSelector
"
"
#
"
+
id
+
"
view
Parame
terTextFormulaSelector
"
,
"
#
"
+
id
+
"
view
Parame
terDateFormulaSelector
"
,
"
#
"
+
id
+
"
view
Parame
terDateOnlyFormulaSelector
"
,
"
#
"
+
id
+
"
view
Parame
terTimeOnlyFormulaSelector
"
];
var
inputList
=
[
...
...
@@ -516,13 +520,13 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
},
modifyOrAddFilterItem
:
function
()
{
var
flag
;
if
(
this
.
current
Filter
Item
)
{
if
(
this
.
currentItem
)
{
flag
=
this
.
modifyFilterItem
();
}
else
{
if
(
this
.
options
.
withForm
){
flag
=
this
.
addFilterItemWithForm
();
}
else
if
(
this
.
restrict
Fil
terInput
.
checked
)
{
flag
=
this
.
add
Fil
terItem
();
}
else
if
(
this
.
restrict
Parame
terInput
.
checked
)
{
flag
=
this
.
add
Parame
terItem
();
}
else
{
flag
=
this
.
addCustomFilterItem
();
}
...
...
@@ -533,7 +537,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
"
path
"
:
""
,
"
parameter
"
:
""
,
"
title
"
:
""
,
"
type
"
:
this
.
restrict
FilterInput
.
checked
?
"
restrict
"
:
"
custom
"
,
"
type
"
:
this
.
restrict
ParameterInput
.
checked
?
"
parameter
"
:
"
custom
"
,
"
comparison
"
:
"
equals
"
,
"
formatType
"
:
"
textValue
"
,
"
value
"
:
""
,
...
...
@@ -546,32 +550,32 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
var
data
=
this
.
getInputData
();
if
(
this
.
options
.
withForm
){
if
(
this
.
verificationDataWithForm
(
data
))
{
this
.
current
Filter
Item
.
reload
(
data
);
this
.
current
Filter
Item
.
unSelected
();
this
.
currentItem
.
reload
(
data
);
this
.
currentItem
.
unSelected
();
this
.
fireEvent
(
"
change
"
);
return
true
;
}
}
else
if
(
this
.
restrict
Fil
terInput
.
checked
){
}
else
if
(
this
.
restrict
Parame
terInput
.
checked
){
if
(
this
.
verificationData
(
data
))
{
this
.
current
Filter
Item
.
reload
(
data
);
this
.
current
Filter
Item
.
unSelected
();
this
.
currentItem
.
reload
(
data
);
this
.
currentItem
.
unSelected
();
this
.
fireEvent
(
"
change
"
);
return
true
;
}
}
else
{
if
(
this
.
verificationDataCustom
(
data
))
{
this
.
current
Filter
Item
.
reload
(
data
);
this
.
current
Filter
Item
.
unSelected
();
this
.
currentItem
.
reload
(
data
);
this
.
currentItem
.
unSelected
();
this
.
fireEvent
(
"
change
"
);
return
true
;
}
}
return
false
;
},
add
Fil
terItem
:
function
()
{
add
Parame
terItem
:
function
()
{
var
data
=
this
.
getInputData
();
if
(
this
.
verificationData
(
data
))
{
this
.
items
.
push
(
new
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
(
this
,
data
));
this
.
items
.
push
(
new
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
Parameter
(
this
,
data
));
this
.
fireEvent
(
"
change
"
);
return
true
;
}
...
...
@@ -586,10 +590,10 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
}
return
false
;
},
addFilterItem
WithForm
:
function
(){
addFilterItem
:
function
(){
var
data
=
this
.
getInputData
();
if
(
this
.
verificationDataWithForm
(
data
))
{
this
.
items
.
push
(
new
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
WithForm
(
this
,
data
));
this
.
items
.
push
(
new
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
Filter
(
this
,
data
));
this
.
fireEvent
(
"
change
"
);
return
true
;
}
...
...
@@ -746,7 +750,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
var
parameter
=
this
.
parameterInput
?
this
.
parameterInput
.
get
(
"
value
"
)
:
""
;
var
title
=
this
.
titleInput
.
get
(
"
value
"
);
if
(
this
.
restrict
FilterInput
.
checked
)
var
type
=
"
restrict
"
;
if
(
this
.
restrict
ParameterInput
.
checked
)
var
type
=
"
parameter
"
;
if
(
this
.
customFilterInput
.
checked
)
var
type
=
"
custom
"
;
// var comparison = this.comparisonInput.options[this.comparisonInput.selectedIndex].value;
...
...
@@ -808,8 +812,8 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
"
otherValue
"
:
value2
,
"
code
"
:
this
.
scriptData
};
}
else
if
(
type
===
"
restrict
"
)
{
this
.
fil
terValueType
.
each
(
function
(
radio
)
{
}
else
if
(
type
===
"
parameter
"
)
{
this
.
parame
terValueType
.
each
(
function
(
radio
)
{
if
(
radio
.
get
(
"
checked
"
))
valueType
=
radio
.
get
(
"
value
"
);
});
return
{
...
...
@@ -823,7 +827,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
//"otherValue": value2,
"
code
"
:
this
.
scriptData
,
"
valueType
"
:
valueType
,
"
valueScript
"
:
this
.
fil
terValueScriptData
"
valueScript
"
:
this
.
parame
terValueScriptData
};
}
else
{
var
valueType
=
""
;
...
...
@@ -971,23 +975,23 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
}
}
if
(
data
.
type
===
"
restrict
"
)
{
this
.
fil
terValueType
.
each
(
function
(
radio
)
{
if
(
data
.
type
===
"
parameter
"
)
{
this
.
parame
terValueType
.
each
(
function
(
radio
)
{
if
(
data
.
valueType
)
{
if
(
data
.
valueType
===
radio
.
get
(
"
value
"
))
radio
.
set
(
"
checked
"
,
true
);
}
else
{
if
(
"
input
"
===
radio
.
get
(
"
value
"
))
radio
.
set
(
"
checked
"
,
true
);
}
});
if
(
this
.
fil
terValueScriptArea
)
{
if
(
this
.
parame
terValueScriptArea
)
{
if
(
!
data
.
valueType
||
data
.
valueType
===
"
input
"
)
{
this
.
fil
terValueScriptDiv
.
hide
();
this
.
fil
terValueScriptData
=
""
;
this
.
fil
terValueScriptArea
.
editor
.
setValue
(
""
);
this
.
parame
terValueScriptDiv
.
hide
();
this
.
parame
terValueScriptData
=
""
;
this
.
parame
terValueScriptArea
.
editor
.
setValue
(
""
);
}
else
{
this
.
fil
terValueScriptDiv
.
show
();
this
.
fil
terValueScriptData
=
data
.
valueScript
;
this
.
fil
terValueScriptArea
.
editor
.
setValue
(
data
.
valueScript
?
data
.
valueScript
.
code
:
""
);
this
.
parame
terValueScriptDiv
.
show
();
this
.
parame
terValueScriptData
=
data
.
valueScript
;
this
.
parame
terValueScriptArea
.
editor
.
setValue
(
data
.
valueScript
?
data
.
valueScript
.
code
:
""
);
}
}
}
...
...
@@ -1000,27 +1004,30 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
},
deleteItem
:
function
(
item
)
{
if
(
this
.
current
Filter
Item
==
item
)
item
.
unSelected
();
if
(
this
.
currentItem
==
item
)
item
.
unSelected
();
this
.
items
.
erase
(
item
);
item
.
node
.
destroy
();
MWF
.
release
(
item
);
this
.
fireEvent
(
"
change
"
);
},
getData
:
function
()
{
var
d
ata
=
[];
var
parameterD
ata
=
[];
var
customData
=
[];
var
filterData
=
[];
this
.
items
.
each
(
function
(
item
)
{
if
(
item
.
data
.
type
===
"
custom
"
)
{
customData
.
push
(
item
.
data
);
}
else
if
(
item
.
data
.
type
===
"
filter
"
)
{
filterData
.
push
(
item
.
data
);
}
else
{
d
ata
.
push
(
item
.
data
);
parameterD
ata
.
push
(
item
.
data
);
}
}.
bind
(
this
));
return
{
"
data
"
:
data
,
"
customData
"
:
customData
};
return
{
"
parameterData
"
:
parameterData
,
"
customData
"
:
customData
,
"
filterData
"
:
filterData
};
}
});
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
=
new
Class
({
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
Parameter
=
new
Class
({
Implements
:
[
Events
],
initialize
:
function
(
filter
,
data
)
{
this
.
filter
=
filter
;
...
...
@@ -1062,17 +1069,16 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter.Item = new Class({
this
.
filter
.
verificationNode
=
null
;
this
.
filter
.
parameterInput
.
setStyle
(
"
background-color
"
,
"
#FFF
"
);
}
this
.
filter
.
restrict
Fil
terInput
.
set
(
"
checked
"
,
true
);
this
.
filter
.
restrict
Fil
terInput
.
click
();
if
(
this
.
filter
.
current
FilterItem
)
this
.
filter
.
currentFilter
Item
.
unSelected
();
this
.
filter
.
restrict
Parame
terInput
.
set
(
"
checked
"
,
true
);
this
.
filter
.
restrict
Parame
terInput
.
click
();
if
(
this
.
filter
.
current
Item
)
this
.
filter
.
current
Item
.
unSelected
();
this
.
node
.
setStyles
(
this
.
css
.
itemNode_current
);
this
.
filter
.
current
Filter
Item
=
this
;
this
.
filter
.
currentItem
=
this
;
this
.
filter
.
setData
(
this
.
data
);
},
unSelected
:
function
()
{
this
.
node
.
setStyles
(
this
.
css
.
itemNode
);
this
.
filter
.
currentFilterItem
=
null
;
this
.
filter
.
currentItem
=
this
;
this
.
filter
.
currentItem
=
null
;
},
deleteItem
:
function
(
e
)
{
var
_self
=
this
;
...
...
@@ -1089,7 +1095,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter.Item = new Class({
});
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
ItemCustom
=
new
Class
({
Extends
:
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
,
Extends
:
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
Parameter
,
initialize
:
function
(
filter
,
data
)
{
this
.
filter
=
filter
;
this
.
data
=
data
;
...
...
@@ -1106,9 +1112,9 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter.ItemCustom = new Clas
}
this
.
filter
.
customFilterInput
.
set
(
"
checked
"
,
true
);
this
.
filter
.
customFilterInput
.
click
();
if
(
this
.
filter
.
current
FilterItem
)
this
.
filter
.
currentFilter
Item
.
unSelected
();
if
(
this
.
filter
.
current
Item
)
this
.
filter
.
current
Item
.
unSelected
();
this
.
node
.
setStyles
(
this
.
css
.
itemNode_current
);
this
.
filter
.
current
Filter
Item
=
this
;
this
.
filter
.
currentItem
=
this
;
this
.
filter
.
setData
(
this
.
data
);
},
getText
:
function
()
{
...
...
@@ -1117,8 +1123,8 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter.ItemCustom = new Clas
},
});
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
WithForm
=
new
Class
({
Extends
:
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
,
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
Filter
=
new
Class
({
Extends
:
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
.
Item
Parameter
,
initialize
:
function
(
filter
,
data
)
{
this
.
filter
=
filter
;
this
.
data
=
data
;
...
...
@@ -1135,9 +1141,9 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter.ItemWithForm = new Cl
}
// this.filter.customFilterInput.set("checked", true);
// this.filter.customFilterInput.click();
if
(
this
.
filter
.
current
FilterItem
)
this
.
filter
.
currentFilter
Item
.
unSelected
();
if
(
this
.
filter
.
current
Item
)
this
.
filter
.
current
Item
.
unSelected
();
this
.
node
.
setStyles
(
this
.
css
.
itemNode_current
);
this
.
filter
.
current
Filter
Item
=
this
;
this
.
filter
.
currentItem
=
this
;
this
.
filter
.
setData
(
this
.
data
);
},
getText
:
function
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录