Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
1edfac61
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,发现更多精彩内容 >>
提交
1edfac61
编写于
11月 01, 2020
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
查询增加视图
上级
94dc4da7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
188 addition
and
24 deletion
+188
-24
o2web/source/x_component_query_StatementDesigner/$Statement/statementDesigner.html
...query_StatementDesigner/$Statement/statementDesigner.html
+1
-1
o2web/source/x_component_query_StatementDesigner/$Statement/view.html
.../x_component_query_StatementDesigner/$Statement/view.html
+17
-0
o2web/source/x_component_query_StatementDesigner/Property.js
o2web/source/x_component_query_StatementDesigner/Property.js
+1
-1
o2web/source/x_component_query_StatementDesigner/Statement.js
...b/source/x_component_query_StatementDesigner/Statement.js
+45
-22
o2web/source/x_component_query_StatementDesigner/widget/ViewFilter.js
.../x_component_query_StatementDesigner/widget/ViewFilter.js
+124
-0
未找到文件。
o2web/source/x_component_query_StatementDesigner/$Statement/statementDesigner.html
浏览文件 @
1edfac61
...
...
@@ -11,7 +11,7 @@
<select>
<option
value=
"official"
{{
if
$.
data.entityCategory
!=='
dynamic
'
&&
$.
data.entityCategory
!=='
custom
'}}
selected
{{
end
if
}}
>
系统表
</option>
<option
value=
"dynamic"
{{
if
$
.data.entityCategory=
='dynamic'}}
selected
{{
end
if
}}
>
自建数据表
</option>
<option
value=
"custom"
{{
if
$
.data.entityCategory=
='custom'}}
selected
{{
end
if
}}
>
自定义应用
</option
>
<!-- <option value="custom" {{if $.data.entityCategory=='custom'}} selected {{end if}}>自定义应用</option>--
>
</select>
</div>
</div>
...
...
o2web/source/x_component_query_StatementDesigner/$Statement/view.html
浏览文件 @
1edfac61
...
...
@@ -100,10 +100,23 @@
<div
class=
"MWFViewFilter"
>
<div
class=
"inputAreaNode_vf"
>
<table
width=
"100%"
border=
"0"
cellpadding=
"5"
cellspacing=
"0"
class=
"editTable restrictViewFilterTable_vf"
>
<tr
id=
"text{$.id}pathInputSelectTr"
>
<td
class=
"editTableTitle"
>
选择:
</td>
<td
class=
"editTableValue"
>
<select
class=
"pathInputSelect_vf"
></select>
<!-- <div style="line-height: 20px;color:#999;">注:选择路径后,需在选择的值前面加上"表别名.",如:o.</div>-->
</td>
</tr>
<tr>
<td
class=
"editTableTitle"
>
标题:
</td>
<td
class=
"editTableValue"
><input
type=
"text"
class=
"editTableInput titleInput_vf"
/></td>
</tr>
<tr
id=
"text{$.id}parameterInputSelectTr"
style=
"display: none"
>
<td
class=
"editTableTitle"
>
选择参数:
</td>
<td
class=
"editTableValue"
>
<select
class=
"parameterInputSelect_vf"
></select>
</td>
</tr>
<tr
id=
"text{$.id}parameterInputTr"
style=
"display: none"
>
<td
class=
"editTableTitle"
>
参数:
</td>
<td
class=
"editTableValue"
>
...
...
@@ -161,14 +174,18 @@
debugger;
$('text{$.id}viewFilterRestrict').setStyle('display', 'block');
$('text{$.id}parameterInputTr').setStyle('display', 'table-row');
$('text{$.id}parameterInputSelectTr').setStyle('display', 'table-row');
$('text{$.id}viewCustomFilterRestrict').setStyle('display', 'none');
$('text{$.id}pathInputTr').setStyle('display', 'none');
$('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}viewFilterRestrict').setStyle('display', 'none');
$('text{$.id}parameterInputTr').setStyle('display', 'none');
$('text{$.id}parameterInputSelectTr').setStyle('display', 'none');
$('text{$.id}viewCustomFilterRestrict').setStyle('display', 'block');
$('text{$.id}pathInputTr').setStyle('display', 'table-row');
$('text{$.id}pathInputSelectTr').setStyle('display', 'table-row');
}"
checked
/>
作为自定义过滤数据
</td>
</tr>
...
...
o2web/source/x_component_query_StatementDesigner/Property.js
浏览文件 @
1edfac61
...
...
@@ -63,7 +63,7 @@ MWF.xApplication.query.StatementDesigner.Property = MWF.SDProperty = new Class({
nodes
.
each
(
function
(
node
)
{
MWF
.
xDesktop
.
requireApp
(
"
query.StatementDesigner
"
,
"
widget.ViewFilter
"
,
function
()
{
var
_slef
=
this
;
new
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
(
node
,
this
.
view
.
designer
,
{
this
.
viewFilter
=
new
MWF
.
xApplication
.
query
.
StatementDesigner
.
widget
.
ViewFilter
(
node
,
this
.
view
.
designer
,
{
"
filtrData
"
:
filtrData
,
"
customData
"
:
customData
},
{
...
...
o2web/source/x_component_query_StatementDesigner/Statement.js
浏览文件 @
1edfac61
...
...
@@ -576,28 +576,7 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
debugger
;
var
entityClassName
=
e
.
target
.
options
[
e
.
target
.
selectedIndex
].
value
;
this
.
json
.
entityClassName
=
entityClassName
;
if
(
this
.
json
.
format
==
"
jpql
"
)
{
if
(
this
.
editor
)
{
var
re
=
/
(
.*from
\s
*
)
/ig
;
if
(
this
.
json
.
type
==
"
update
"
)
re
=
/
(
.*update
\s
*
)
/ig
;
//if (this.json.type=="select" && this.editor){
var
v
=
this
.
json
.
data
;
var
re2
=
/
(\s
+
)
/ig
;
var
arr
=
re
.
exec
(
v
);
if
(
arr
&&
arr
[
0
])
{
var
left
=
arr
[
0
]
v
=
v
.
substring
(
left
.
length
,
v
.
length
);
//var ar = re2.exec(v);
var
right
=
v
.
substring
(
v
.
indexOf
(
"
"
),
v
.
length
);
this
.
json
.
data
=
left
+
entityClassName
+
right
;
this
.
editor
.
editor
.
setValue
(
this
.
json
.
data
);
}
//}
}
}
this
.
changeEditorEntityClassName
(
entityClassName
.
split
(
"
.
"
).
getLast
()
);
// var className = e.target.options[e.target.selectedIndex].value;
...
...
@@ -649,6 +628,47 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
}
}.
bind
(
this
));
},
changeEditorEntityClassName
:
function
(
entityClassName
){
if
(
this
.
json
.
format
==
"
jpql
"
)
{
if
(
this
.
editor
)
{
var
re
=
/
(
.*from
\s
*
)
/ig
;
if
(
this
.
json
.
type
==
"
update
"
)
re
=
/
(
.*update
\s
*
)
/ig
;
//if (this.json.type=="select" && this.editor){
var
v
=
this
.
json
.
data
;
var
re2
=
/
(\s
+
)
/ig
;
var
arr
=
re
.
exec
(
v
);
if
(
arr
&&
arr
[
0
])
{
var
left
=
arr
[
0
]
v
=
v
.
substring
(
left
.
length
,
v
.
length
);
//var ar = re2.exec(v);
var
right
=
v
.
substring
(
v
.
indexOf
(
"
"
),
v
.
length
);
this
.
json
.
data
=
left
+
entityClassName
+
right
;
this
.
editor
.
editor
.
setValue
(
this
.
json
.
data
);
}
//}
}
if
(
this
.
countEditor
){
var
re
=
/
(
.*from
\s
*
)
/ig
;
var
v
=
this
.
json
.
countData
;
var
re2
=
/
(\s
+
)
/ig
;
var
arr
=
re
.
exec
(
v
);
if
(
arr
&&
arr
[
0
])
{
var
left
=
arr
[
0
]
v
=
v
.
substring
(
left
.
length
,
v
.
length
);
//var ar = re2.exec(v);
var
right
=
v
.
substring
(
v
.
indexOf
(
"
"
),
v
.
length
);
this
.
json
.
countData
=
left
+
entityClassName
+
right
;
this
.
countEditor
.
editor
.
setValue
(
this
.
json
.
countData
);
}
}
}
},
selectTable
:
function
()
{
new
MWF
.
O2Selector
(
this
.
designer
.
content
,
{
...
...
@@ -663,9 +683,12 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
this
.
dynamicTableContent
.
set
(
"
text
"
,
name
);
this
.
json
.
table
=
name
;
this
.
json
.
tableObj
=
items
[
0
].
data
;
this
.
changeEditorEntityClassName
(
name
);
if
(
this
.
view
&&
this
.
view
.
property
&&
this
.
view
.
property
.
viewFilter
)
this
.
view
.
property
.
viewFilter
.
setPathInputSelectOptions
();
}
else
{
this
.
dynamicTableContent
.
set
(
"
text
"
,
""
);
this
.
json
.
table
=
""
;
if
(
this
.
view
&&
this
.
view
.
property
&&
this
.
view
.
property
.
viewFilter
)
this
.
view
.
property
.
viewFilter
.
setPathInputSelectOptions
();
}
}.
bind
(
this
)
});
...
...
o2web/source/x_component_query_StatementDesigner/widget/ViewFilter.js
浏览文件 @
1edfac61
...
...
@@ -124,7 +124,9 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
this
.
titleInput
=
this
.
inputAreaNode
.
getElement
(
"
.titleInput_vf
"
);
this
.
pathInput
=
this
.
inputAreaNode
.
getElement
(
"
.pathInput_vf
"
);
this
.
pathInputSelect
=
this
.
inputAreaNode
.
getElement
(
"
.pathInputSelect_vf
"
);
this
.
parameterInput
=
this
.
inputAreaNode
.
getElement
(
"
.parameterInput_vf
"
);
this
.
parameterInputSelect
=
this
.
inputAreaNode
.
getElement
(
"
.parameterInputSelect_vf
"
);
this
.
datatypeInput
=
this
.
inputAreaNode
.
getElement
(
"
.datatypeInput_vf
"
);
this
.
restrictFilterInput
=
this
.
inputAreaNode
.
getElement
(
"
.restrictFilterInput_vf
"
);
...
...
@@ -199,6 +201,84 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
if
(
e
.
code
==
13
)
this
.
modifyOrAddFilterItem
();
}.
bind
(
this
));
this
.
pathInputSelect
.
addEvent
(
"
change
"
,
function
(
ev
)
{
var
option
=
ev
.
target
.
options
[
ev
.
target
.
selectedIndex
];
debugger
;
var
type
=
option
.
retrieve
(
"
type
"
);
var
d
=
this
.
app
.
statement
.
data
;
if
(
type
===
"
dynamic
"
){
var
field
=
option
.
retrieve
(
"
field
"
);
if
(
field
){
this
.
titleInput
.
set
(
"
value
"
,
field
.
description
||
field
.
name
);
if
(
field
.
name
){
var
path
=
this
.
pathInput
.
get
(
"
value
"
);
if
(
path
.
indexOf
(
"
.
"
)
>
-
1
){
path
=
path
.
split
(
"
.
"
)[
0
]
+
"
.
"
+
field
.
name
;
}
else
{
var
alias
;
var
tableName
=
option
.
retrieve
(
"
tableName
"
);
if
(
d
.
data
.
indexOf
(
tableName
)
>
-
1
){
var
str
=
d
.
data
.
split
(
tableName
)[
1
].
trim
();
if
(
str
.
indexOf
(
"
"
)
)
alias
=
str
.
split
(
"
"
)[
0
];
}
path
=
alias
?
(
alias
+
"
.
"
+
field
.
name
)
:
field
.
name
;
}
this
.
pathInput
.
set
(
"
value
"
,
path
);
}
if
(
field
.
type
){
var
t
;
switch
(
field
.
type
)
{
case
"
string
"
:
case
"
stringList
"
:
case
"
stringLob
"
:
case
"
stringMap
"
:
t
=
"
textValue
"
;
break
;
case
"
integer
"
:
case
"
long
"
:
case
"
double
"
:
case
"
integerList
"
:
case
"
longList
"
:
case
"
doubleList
"
:
t
=
"
numberValue
"
;
break
;
case
"
dateTime
"
:
t
=
"
dateTimeValue
"
;
break
;
case
"
date
"
:
t
=
"
dateValue
"
;
break
;
case
"
time
"
:
t
=
"
timeValue
"
;
break
;
case
"
boolean
"
:
case
"
booleanList
"
:
t
=
"
booleanValue
"
;
break
;
default
:
t
=
"
textValue
"
;
break
;
}
for
(
var
i
=
0
;
i
<
this
.
datatypeInput
.
options
.
length
;
i
++
)
{
if
(
this
.
datatypeInput
.
options
[
i
].
value
===
t
)
{
this
.
datatypeInput
.
options
[
i
].
set
(
"
selected
"
,
true
);
this
.
switchInputDisplay
();
if
(
this
.
datatypeInput
.
onchange
)
this
.
datatypeInput
.
onchange
();
break
;
}
}
}
}
else
{
this
.
titleInput
.
set
(
"
value
"
,
""
);
this
.
pathInput
.
set
(
"
value
"
,
""
);
this
.
datatypeInput
.
options
[
0
].
set
(
"
selected
"
,
true
);
this
.
switchInputDisplay
();
if
(
this
.
datatypeInput
.
onchange
)
this
.
datatypeInput
.
onchange
();
}
}
}.
bind
(
this
))
this
.
setPathInputSelectOptions
()
//if (this.app.statement.view){
// var id = this.app.view.data.id;
// var div = this.node.getElement("#"+id+"viewFilterValueArea2");
...
...
@@ -246,6 +326,38 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
// }
// }
},
setPathInputSelectOptions
:
function
(){
debugger
;
var
d
=
this
.
app
.
statement
.
data
;
this
.
pathInputSelect
.
empty
();
if
(
d
.
entityCategory
===
'
dynamic
'
&&
d
.
table
){
o2
.
Actions
.
load
(
"
x_query_assemble_designer
"
).
TableAction
.
get
(
d
.
table
,
function
(
json
){
if
(
json
.
data
.
data
){
var
ps
=
this
.
pathInput
.
get
(
"
value
"
).
split
(
"
.
"
);
var
p
=
ps
[
1
]
?
ps
[
1
]
:
ps
[
0
];
var
option
=
new
Element
(
"
option
"
,
{
"
text
"
:
""
,
"
value
"
:
""
}).
inject
(
this
.
pathInputSelect
);
option
.
store
(
"
type
"
,
"
dynamic
"
);
option
.
store
(
"
tableName
"
,
json
.
data
.
name
);
var
fieldJson
=
JSON
.
parse
(
json
.
data
.
data
);
fieldJson
.
fieldList
.
each
(
function
(
field
)
{
var
option
=
new
Element
(
"
option
"
,
{
"
text
"
:
field
.
name
+
(
field
.
description
?
(
"
-
"
+
field
.
description
)
:
""
),
"
value
"
:
field
.
name
,
"
selected
"
:
(
field
.
name
===
p
)
}).
inject
(
this
.
pathInputSelect
);
option
.
store
(
"
field
"
,
field
);
option
.
store
(
"
type
"
,
"
dynamic
"
);
option
.
store
(
"
tableName
"
,
json
.
data
.
name
);
}.
bind
(
this
))
}
}.
bind
(
this
))
}
else
if
(
d
.
entityCategory
===
'
official
'
){
}
},
switchInputDisplay
:
function
()
{
var
id
=
""
;
if
(
this
.
app
.
statement
.
view
)
{
...
...
@@ -591,6 +703,18 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
}
}
var
ps
=
this
.
pathInput
.
get
(
"
value
"
).
split
(
"
.
"
);
var
p
=
ps
[
1
]
?
ps
[
1
]
:
ps
[
0
];
var
flag
=
true
;
for
(
var
i
=
0
;
i
<
this
.
pathInputSelect
.
options
.
length
;
i
++
)
{
if
(
this
.
pathInputSelect
.
options
[
i
].
value
===
p
)
{
this
.
pathInputSelect
.
options
[
i
].
set
(
"
selected
"
,
true
);
flag
=
false
;
break
;
}
}
if
(
flag
)
this
.
pathInputSelect
.
options
[
0
].
set
(
"
selected
"
,
true
);
switch
(
data
.
formatType
)
{
case
"
textValue
"
:
this
.
valueTextInput
.
set
(
"
value
"
,
data
.
value
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录