Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
ea5b921e
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,发现更多精彩内容 >>
提交
ea5b921e
编写于
10月 20, 2020
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
查询中增加视图
上级
09dbc8a8
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
223 addition
and
64 deletion
+223
-64
o2web/source/x_component_query_StatementDesigner/$Statement/column.html
..._component_query_StatementDesigner/$Statement/column.html
+9
-1
o2web/source/x_component_query_StatementDesigner/$Statement/statement.html
...mponent_query_StatementDesigner/$Statement/statement.html
+19
-5
o2web/source/x_component_query_StatementDesigner/Property.js
o2web/source/x_component_query_StatementDesigner/Property.js
+15
-0
o2web/source/x_component_query_StatementDesigner/Statement.js
...b/source/x_component_query_StatementDesigner/Statement.js
+180
-58
未找到文件。
o2web/source/x_component_query_StatementDesigner/$Statement/column.html
浏览文件 @
ea5b921e
...
...
@@ -33,10 +33,18 @@
<div
style=
"background-color: #EEE; height:24px; line-height: 24px; text-align: center; font-weight: bold"
>
数据
</div>
<div
class=
"MWFDataData"
id=
"text{$.pid}dataDataEditor"
>
<table
width=
"100%"
border=
"0"
cellpadding=
"5"
cellspacing=
"0"
class=
"editTable"
>
<tr>
<td
class=
"editTableTitle"
>
选择路径:
</td>
<td
class=
"editTableValue"
>
<select
class=
"MWFDataPathSelect"
id=
"text{$.pid}dataPathSelected"
onchange=
" var v=this.options[this.selectedIndex].value; if (true){var n = $('text{$.pid}viewColumnPathInput'); n.set('value', v); n.focus();} "
>
</select>
<div
style=
"line-height: 20px;color:#999;"
>
注:正确填写了查询语句,再测试语句或刷新视图数据可显示(刷新)选择路径。
</div>
</td>
</tr>
<tr>
<td
class=
"editTableTitle"
>
数据路径:
</td>
<td
class=
"editTableValue"
>
<input
onkeypress=
"$('text{$.pid}dataPathSelected').getElement('option').set('selected', true); $('text{$.pid}dataPathSelectedCMS').getElement('option').set('selected', true)"
id=
"text{$.pid}viewColumnPathInput"
type=
"text"
name=
"path"
value=
"text{$.path}"
class=
"editTableInput"
/>
<input
id=
"text{$.pid}viewColumnPathInput"
type=
"text"
name=
"path"
value=
"text{$.path}"
class=
"editTableInput"
/>
<div
style=
"line-height: 20px;color:#999;"
>
注:指该列相对单条数据的路径。比如 0,title,或 0.title
</div>
</td>
</tr>
...
...
o2web/source/x_component_query_StatementDesigner/$Statement/statement.html
浏览文件 @
ea5b921e
...
...
@@ -21,12 +21,27 @@
<div
style=
"height:24px; text-align: center; line-height: 24px; background-color: #EEE; border-top: 1px solid #999; font-weight: bold"
>
执行权限
</div>
<table
width=
"100%"
border=
"0"
cellpadding=
"5"
cellspacing=
"0"
class=
"editTable"
id=
"processEditStarter"
>
<tr>
<td
class=
"editTableTitle"
>
匿名访问:
</td>
<td
class=
"editTableValue"
>
<input
class=
"editTableRadio"
name=
"anonymousAccessible"
text
{($
.anonymousAccessible=
==true)?'checked':''}
type=
"radio"
value=
"true"
onclick=
"if(this.checked){
$('text{$.pid}executePersonListTr').setStyle('display', 'none');
$('text{$.pid}executeUnitListTr').setStyle('display', 'none');
}"
/>
允许
<input
class=
"editTableRadio"
name=
"anonymousAccessible"
text
{($.
anonymousAccessible
!==
true
)?'
checked
'
:
''}
type=
"radio"
value=
"false"
onclick=
"if(this.checked){
$('text{$.pid}executePersonListTr').setStyle('display', '');
$('text{$.pid}executeUnitListTr').setStyle('display', '');
}"
/>
不允许
</td>
</tr>
<tr
id=
"text{$.pid}executePersonListTr"
style=
"display:text{($.anonymousAccessible==true)?'none':''}"
>
<td
class=
"editTableTitle"
>
执行人:
</td>
<td
class=
"editTableValue"
>
<div
class=
"MWFPersonIdentity"
name=
"executePersonList"
></div>
</td>
</tr>
<tr>
<tr
id=
"text{$.pid}executeUnitListTr"
style=
"display:text{($.anonymousAccessible==true)?'none':''}"
>
<td
class=
"editTableTitle"
>
执行组织:
</td>
<td
class=
"editTableValue"
>
<div
class=
"MWFPersonUnit"
name=
"executeUnitList"
></div>
...
...
@@ -34,9 +49,8 @@
</tr>
</table>
</div>
</div>
<div
title=
"JSON"
class=
"MWFTab"
>
<div
title=
"JSON"
class=
"MWFTab"
>
<div
class=
"MWFJSONArea"
style=
"font-family: Verdana, Geneva, sans-serif; font-size:14px"
></div>
</div>
</div>
</div>
\ No newline at end of file
o2web/source/x_component_query_StatementDesigner/Property.js
浏览文件 @
ea5b921e
...
...
@@ -35,12 +35,27 @@ MWF.xApplication.query.StatementDesigner.Property = MWF.SDProperty = new Class({
this
.
loadActionArea
();
this
.
loadStylesList
();
this
.
loadMaplist
();
this
.
loadDataPathSelect
();
}
}.
bind
(
this
));
}
else
{
this
.
propertyContent
.
setStyle
(
"
display
"
,
"
block
"
);
}
},
loadDataPathSelect
:
function
(){
var
nodes
=
this
.
propertyContent
.
getElements
(
"
.MWFDataPathSelect
"
);
nodes
.
each
(
function
(
select
)
{
select
.
empty
();
var
option
=
new
Element
(
"
option
"
,
{
"
text
"
:
"
none
"
,
"
value
"
:
""
}).
inject
(
select
);
this
.
module
.
getColumnDataPath
().
each
(
function
(
model
){
var
option
=
new
Element
(
"
option
"
,
{
"
text
"
:
model
,
"
value
"
:
model
,
"
selected
"
:
(
this
.
data
[
name
]
==
model
)
}).
inject
(
select
);
}.
bind
(
this
));
}.
bind
(
this
))
},
loadViewFilter
:
function
()
{
var
nodes
=
this
.
propertyContent
.
getElements
(
"
.MWFViewFilter
"
);
//var filtrData = this.view.data.data.filterList;
...
...
o2web/source/x_component_query_StatementDesigner/Statement.js
浏览文件 @
ea5b921e
...
...
@@ -441,7 +441,7 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
"
option
"
:
{
"
mode
"
:
"
json
"
}
});
this
.
jsonEditor
.
load
(
function
()
{
this
.
jsonEditor
.
editor
.
setValue
(
"
{}
"
);
this
.
jsonEditor
.
editor
.
setValue
(
this
.
data
.
testParameters
||
"
{}
"
);
}.
bind
(
this
));
}.
bind
(
this
),
false
);
},
...
...
@@ -605,14 +605,22 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
this
.
runMask
.
loadNode
(
this
.
node
);
this
.
saveSilence
(
function
()
{
debugger
;
this
.
execute
(
function
(
json
)
{
this
.
executeData
=
json
;
o2
.
require
(
"
o2.widget.JsonParse
"
,
function
()
{
this
.
runResultNode
.
empty
();
var
jsonResult
=
new
o2
.
widget
.
JsonParse
(
json
,
this
.
runResultNode
);
jsonResult
.
load
();
}.
bind
(
this
));
if
(
this
.
view
)
{
var
flag
=
true
;
if
(
this
.
data
.
type
!==
"
select
"
)
flag
=
false
;
if
(
this
.
data
.
format
===
"
script
"
&&
!
this
.
data
.
scriptText
)
flag
=
false
;
if
(
this
.
data
.
format
!==
"
script
"
&&
!
this
.
data
.
data
)
flag
=
false
;
if
(
flag
)
this
.
view
.
loadViewData
();
}
this
.
setColumnDataPath
(
json
);
this
.
runMask
.
hide
();
}.
bind
(
this
),
function
()
{
if
(
this
.
runMask
)
this
.
runMask
.
hide
();
...
...
@@ -672,6 +680,44 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
// }.bind(this))
}.
bind
(
this
));
},
setColumnDataPath
:
function
(
json
)
{
if
(
this
.
data
.
type
!==
"
select
"
)
return
;
if
(
this
.
data
.
format
===
"
script
"
&&
!
this
.
data
.
scriptText
)
return
;
if
(
this
.
data
.
format
!==
"
script
"
&&
!
this
.
data
.
data
)
return
;
this
.
columnDataPathList
=
[];
debugger
;
var
addPath
=
function
(
value
,
key
)
{
if
(
typeOf
(
value
)
===
"
array
"
)
{
Array
.
each
(
value
,
function
(
v
,
idx
)
{
var
path
=
(
key
||
typeOf
(
key
)
===
"
number
"
)
?
(
key
+
"
.
"
+
idx
)
:
idx
.
toString
();
if
(
!
this
.
columnDataPathList
.
contains
(
path
))
this
.
columnDataPathList
.
push
(
path
);
if
(
typeOf
(
v
)
===
"
array
"
||
typeOf
(
v
)
===
"
object
"
)
addPath
(
v
,
path
);
}.
bind
(
this
))
}
else
if
(
typeOf
(
value
)
===
"
object
"
)
{
Object
.
each
(
value
,
function
(
v
,
k
)
{
var
path
=
(
key
||
typeOf
(
key
)
===
"
number
"
)
?
(
key
+
"
.
"
+
k
)
:
k
;
if
(
!
this
.
columnDataPathList
.
contains
(
path
))
this
.
columnDataPathList
.
push
(
path
);
if
(
typeOf
(
v
)
===
"
array
"
||
typeOf
(
v
)
===
"
object
"
)
addPath
(
v
,
path
);
addPath
(
v
,
path
);
}.
bind
(
this
))
}
else
{
// if( key && !this.columnDataPathList.indexOf(key) )this.columnDataPathList.push(key);
}
}.
bind
(
this
);
for
(
var
i
=
0
;
i
<
json
.
data
.
length
&&
i
<
10
;
i
++
)
{
var
d
=
json
.
data
[
i
];
addPath
(
d
);
}
this
.
columnDataPathList
.
sort
();
if
(
this
.
view
&&
this
.
view
.
items
)
{
this
.
view
.
items
.
each
(
function
(
column
)
{
column
.
refreshColumnPathData
()
})
}
},
getColumnDataPath
:
function
()
{
return
this
.
columnDataPathList
||
[];
},
execute
:
function
(
success
,
failure
)
{
var
json
=
this
.
jsonEditor
.
editor
.
getValue
();
var
o
=
JSON
.
parse
(
json
);
...
...
@@ -737,6 +783,7 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
//}
if
(
this
.
editor
)
this
.
data
.
data
=
this
.
editor
.
editor
.
getValue
();
if
(
this
.
scriptEditor
)
this
.
data
.
scriptText
=
this
.
scriptEditor
.
toJson
().
code
;
if
(
this
.
jsonEditor
)
this
.
data
.
testParameters
=
this
.
jsonEditor
.
editor
.
getValue
();
this
.
designer
.
actions
.
saveStatement
(
this
.
data
,
function
(
json
)
{
this
.
designer
.
notice
(
this
.
designer
.
lp
.
save_success
,
"
success
"
,
this
.
node
,
{
"
x
"
:
"
left
"
,
"
y
"
:
"
bottom
"
});
...
...
@@ -763,6 +810,7 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
if
(
this
.
editor
)
this
.
data
.
data
=
this
.
editor
.
editor
.
getValue
();
if
(
this
.
scriptEditor
)
this
.
data
.
scriptText
=
this
.
scriptEditor
.
toJson
().
code
;
if
(
this
.
jsonEditor
)
this
.
data
.
testParameters
=
this
.
jsonEditor
.
editor
.
getValue
();
this
.
designer
.
actions
.
saveStatement
(
this
.
data
,
function
(
json
)
{
//this.designer.notice(this.designer.lp.save_success, "success", this.node, {"x": "left", "y": "bottom"});
...
...
@@ -946,7 +994,7 @@ MWF.xApplication.query.StatementDesigner.View = new Class({
}.
bind
(
this
)
});
this
.
refreshNode
.
addEvent
(
"
click
"
,
function
(
e
)
{
this
.
loadViewData
();
this
.
statement
.
runStatement
();
e
.
stopPropagation
();
}.
bind
(
this
));
this
.
addColumnNode
.
addEvent
(
"
click
"
,
function
(
e
)
{
...
...
@@ -994,8 +1042,9 @@ MWF.xApplication.query.StatementDesigner.View = new Class({
},
loadViewData
:
function
()
{
debugger
;
if
(
this
.
data
.
id
)
{
this
.
statement
.
saveSilence
(
function
()
{
//
this.statement.saveSilence(function () {
this
.
viewContentBodyNode
.
empty
();
this
.
viewContentTableNode
=
new
Element
(
"
table
"
,
{
"
styles
"
:
this
.
css
.
viewContentTableNode
,
...
...
@@ -1004,15 +1053,18 @@ MWF.xApplication.query.StatementDesigner.View = new Class({
"
cellSpacing
"
:
"
0
"
}).
inject
(
this
.
viewContentBodyNode
);
this
.
statement
.
execute
(
function
(
json
)
{
// this.statement.execute( function (json) {
// this.statement.setColumnDataPath( json );
var
entries
=
{};
json
.
data
.
selectList
.
each
(
function
(
entry
)
{
this
.
json
.
data
.
selectList
.
each
(
function
(
entry
)
{
entries
[
entry
.
column
]
=
entry
;
}.
bind
(
this
));
if
(
json
.
data
.
grid
.
length
)
{
json
.
data
.
grid
.
each
(
function
(
line
,
idx
)
{
if
(
this
.
statement
.
executeData
&&
this
.
statement
.
executeData
.
data
&&
this
.
statement
.
executeData
.
data
.
length
)
{
this
.
statement
.
executeData
.
data
.
each
(
function
(
line
,
idx
)
{
var
tr
=
new
Element
(
"
tr
"
,
{
"
styles
"
:
this
.
json
.
data
.
viewStyles
?
this
.
json
.
data
.
viewStyles
[
"
contentTr
"
]
:
this
.
css
.
viewContentTrNode
}).
inject
(
this
.
viewContentTableNode
);
...
...
@@ -1020,25 +1072,63 @@ MWF.xApplication.query.StatementDesigner.View = new Class({
//this.createViewCheckboxTd( tr );
Object
.
each
(
entries
,
function
(
c
,
k
)
{
var
d
=
line
.
data
[
k
];
if
(
d
!=
undefined
)
{
debugger
;
var
path
=
c
.
path
,
code
=
c
.
code
,
obj
=
line
;
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
"
:
line
,
"
entry
"
:
c
});
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
;
}
}
if
(
d
!=
undefined
&&
d
!=
null
)
{
var
td
=
new
Element
(
"
td
"
,
{
"
styles
"
:
this
.
json
.
data
.
viewStyles
?
this
.
json
.
data
.
viewStyles
[
"
contentTd
"
]
:
this
.
css
.
viewContentTdNode
}).
inject
(
tr
);
//td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.grid, "data": json.data, "entry": line}) : d);
if
(
c
.
isHtml
)
{
td
.
set
(
"
html
"
,
d
);
}
else
{
td
.
set
(
"
text
"
,
d
);
}
//td.set("text", d);
}
}.
bind
(
this
));
// Object.each(line.data, function(d, k){
// var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
// td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.grid, "data": json.data, "entry": line}) : d);
// }.bind(this));
}.
bind
(
this
));
this
.
setContentColumnWidth
();
this
.
setContentHeight
();
...
...
@@ -1056,8 +1146,8 @@ MWF.xApplication.query.StatementDesigner.View = new Class({
"
text
"
:
this
.
json
.
data
.
noDataText
}).
inject
(
this
.
viewContentBodyNode
);
}
}.
bind
(
this
));
}.
bind
(
this
));
//
}.bind(this));
//
}.bind(this));
}
},
addColumn
:
function
()
{
...
...
@@ -1422,6 +1512,38 @@ MWF.xApplication.query.StatementDesigner.View.Column = new Class({
this
.
domListNode
=
this
.
view
.
domListNode
;
this
.
load
();
},
refreshColumnPathData
:
function
()
{
if
(
this
.
property
)
{
this
.
property
.
loadDataPathSelect
();
}
},
getColumnDataPath
:
function
()
{
return
this
.
view
.
statement
.
getColumnDataPath
();
},
showProperty
:
function
()
{
if
(
!
this
.
property
)
{
this
.
property
=
new
MWF
.
xApplication
.
query
.
StatementDesigner
.
Property
(
this
,
this
.
view
.
designer
.
propertyContentArea
,
this
.
view
.
designer
,
{
"
path
"
:
this
.
propertyPath
,
"
onPostLoad
"
:
function
()
{
this
.
property
.
show
();
var
processDiv
=
this
.
property
.
propertyContent
.
getElements
(
"
#
"
+
this
.
json
.
id
+
"
dataPathSelectedProcessArea
"
);
var
cmsDiv
=
this
.
property
.
propertyContent
.
getElements
(
"
#
"
+
this
.
json
.
id
+
"
dataPathSelectedCMSArea
"
);
if
(
this
.
view
.
json
.
type
==
"
cms
"
)
{
processDiv
.
setStyle
(
"
display
"
,
"
none
"
);
cmsDiv
.
setStyle
(
"
display
"
,
"
block
"
);
}
else
{
processDiv
.
setStyle
(
"
display
"
,
"
block
"
);
cmsDiv
.
setStyle
(
"
display
"
,
"
none
"
);
}
}.
bind
(
this
)
});
this
.
property
.
load
();
}
else
{
this
.
property
.
show
();
}
},
selected
:
function
()
{
if
(
this
.
view
.
statement
.
currentSelectedModule
)
{
if
(
this
.
view
.
statement
.
currentSelectedModule
==
this
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录