Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
6af8434b
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,发现更多精彩内容 >>
提交
6af8434b
编写于
7月 26, 2020
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
视图列增加样式、属性、事件配置
上级
7960233a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
346 addition
and
181 deletion
+346
-181
o2web/source/x_component_query_Query/Viewer.js
o2web/source/x_component_query_Query/Viewer.js
+59
-0
o2web/source/x_component_query_ViewDesigner/$View/column.html
...b/source/x_component_query_ViewDesigner/$View/column.html
+9
-1
o2web/source/x_component_query_ViewDesigner/$View/column.json
...b/source/x_component_query_ViewDesigner/$View/column.json
+32
-0
o2web/source/x_component_query_ViewDesigner/Property.js
o2web/source/x_component_query_ViewDesigner/Property.js
+37
-0
o2web/source/x_component_query_ViewDesigner/View.js
o2web/source/x_component_query_ViewDesigner/View.js
+209
-180
未找到文件。
o2web/source/x_component_query_Query/Viewer.js
浏览文件 @
6af8434b
...
...
@@ -248,9 +248,18 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
var
size
=
MWF
.
getTextSize
(
column
.
displayName
,
viewTitleCellNode
);
viewCell
.
setStyle
(
"
min-width
"
,
""
+
size
.
x
+
"
px
"
);
if
(
this
.
json
.
titleStyles
)
viewCell
.
setStyles
(
this
.
json
.
titleStyles
);
if
(
typeOf
(
column
.
titleStyles
)
===
"
object
"
)
viewCell
.
setStyles
(
column
.
titleStyles
);
if
(
typeOf
(
column
.
titleProperties
)
===
"
object
"
)
viewCell
.
setProperties
(
column
.
titleProperties
);
}
else
{
this
.
hideColumns
.
push
(
column
.
column
);
if
(
typeOf
(
column
.
titleProperties
)
===
"
object
"
)
viewCell
.
setProperties
(
column
.
titleProperties
);
}
if
(
column
.
events
&&
column
.
events
.
loadTitle
&&
column
.
events
.
loadTitle
.
code
){
var
code
=
column
.
events
.
loadTitle
.
code
;
this
.
Macro
.
fire
(
code
,
{
"
node
"
:
viewCell
,
"
json
"
:
column
,
"
data
"
:
column
.
displayName
,
"
view
"
:
this
});
}
if
(
column
.
allowOpen
)
this
.
openColumns
.
push
(
column
.
column
);
}.
bind
(
this
));
this
.
lookup
(
data
);
...
...
@@ -1263,6 +1272,7 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
this
.
prev
=
prev
;
this
.
idx
=
i
;
this
.
clazzType
=
"
item
"
;
this
.
load
();
},
load
:
function
(){
...
...
@@ -1294,6 +1304,8 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
this
.
sequenceTd
.
set
(
"
text
"
,
s
);
}
debugger
;
Object
.
each
(
this
.
view
.
entries
,
function
(
c
,
k
){
var
cell
=
this
.
data
.
data
[
k
];
if
(
cell
===
undefined
)
cell
=
""
;
...
...
@@ -1308,11 +1320,32 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
}
else
{
td
.
set
(
"
text
"
,
v
);
}
if
(
typeOf
(
c
.
contentProperties
)
===
"
object
"
)
td
.
setProperties
(
c
.
contentProperties
);
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
(
this
.
view
.
openColumns
.
indexOf
(
k
)
!==-
1
){
this
.
setOpenWork
(
td
,
c
)
}
if
(
this
.
view
.
json
.
itemStyles
)
td
.
setStyles
(
this
.
view
.
json
.
itemStyles
);
if
(
typeOf
(
c
.
contentStyles
)
===
"
object
"
)
td
.
setStyles
(
c
.
contentStyles
);
}
//}
}.
bind
(
this
));
...
...
@@ -1633,6 +1666,7 @@ MWF.xApplication.query.Query.Viewer.ItemCategory = new Class({
break
;
}
}
if
(
this
.
groupColumn
){
//var text = (this.groupColumn.code) ? MWF.Macro.exec(this.groupColumn.code, {"value": this.data.group, "gridData": this.view.gridJson, "data": this.view.viewData, "entry": this.data}) : this.data.group;
var
text
=
this
.
data
.
group
;
...
...
@@ -1652,8 +1686,33 @@ MWF.xApplication.query.Query.Viewer.ItemCategory = new Class({
this
.
expanded
=
false
;
if
(
this
.
view
.
json
.
itemStyles
)
this
.
categoryTd
.
setStyles
(
this
.
view
.
json
.
itemStyles
);
debugger
;
if
(
this
.
groupColumn
){
if
(
typeOf
(
this
.
groupColumn
.
contentStyles
)
===
"
object
"
)
this
.
categoryTd
.
setStyles
(
this
.
groupColumn
.
contentStyles
);
if
(
typeOf
(
this
.
groupColumn
.
contentProperties
)
===
"
object
"
)
this
.
categoryTd
.
setProperties
(
this
.
groupColumn
.
contentProperties
);
}
this
.
setEvent
();
var
column
=
this
.
groupColumn
;
var
td
=
this
.
categoryTd
;
Object
.
each
(
column
.
events
||
{},
function
(
e
,
key
)
{
if
(
e
.
code
){
if
(
key
===
"
loadContent
"
){
this
.
view
.
Macro
.
fire
(
e
.
code
,
{
"
node
"
:
td
,
"
json
"
:
column
,
"
data
"
:
this
.
data
.
group
,
"
view
"
:
this
.
view
,
"
row
"
:
this
});
}
else
if
(
key
!==
"
loadTitle
"
){
td
.
addEvent
(
key
,
function
(
event
){
return
this
.
view
.
Macro
.
fire
(
e
.
code
,
{
"
node
"
:
td
,
"
json
"
:
column
,
"
data
"
:
this
.
data
.
group
,
"
view
"
:
this
.
view
,
"
row
"
:
this
},
event
);
}.
bind
(
this
));
}
}
});
this
.
view
.
fireEvent
(
"
postLoadCategoryRow
"
,
[
null
,
this
]);
},
setEvent
:
function
(){
...
...
o2web/source/x_component_query_ViewDesigner/$View/column.html
浏览文件 @
6af8434b
...
...
@@ -156,8 +156,16 @@
</table>
</div>
<div
class=
"MWFFormulaArea"
name=
"code"
title=
"显示脚本 (S)"
></div>
</div>
<div
title=
"样式"
class=
"MWFTab"
>
<div
class=
"MWFMaplist"
name=
"titleStyles"
title=
"标题单元格样式"
></div>
<div
class=
"MWFMaplist"
name=
"titleProperties"
title=
"标题单元格属性"
></div>
<div
class=
"MWFMaplist"
name=
"contentStyles"
title=
"内容单元格样式"
></div>
<div
class=
"MWFMaplist"
name=
"contentProperties"
title=
"内容单元格属性"
></div>
</div>
<div
title=
"事件"
class=
"MWFTab"
>
<div
class=
"MWFEventsArea"
name=
"events"
></div>
</div>
<div
title=
"JSON"
class=
"MWFTab"
>
<div
class=
"MWFJSONArea"
style=
"font-family: Verdana, Geneva, sans-serif; font-size:14px"
></div>
</div>
...
...
o2web/source/x_component_query_ViewDesigner/$View/column.json
0 → 100644
浏览文件 @
6af8434b
{
"events"
:
{
"loadTitle"
:
{
"code"
:
""
,
"html"
:
""
},
"loadContent"
:
{
"code"
:
""
,
"html"
:
""
},
"click"
:
{
"code"
:
""
,
"html"
:
""
},
"mousedown"
:
{
"code"
:
""
,
"html"
:
""
},
"mouseup"
:
{
"code"
:
""
,
"html"
:
""
},
"mouseout"
:
{
"code"
:
""
,
"html"
:
""
},
"mouseover"
:
{
"code"
:
""
,
"html"
:
""
}
}
}
\ No newline at end of file
o2web/source/x_component_query_ViewDesigner/Property.js
浏览文件 @
6af8434b
...
...
@@ -17,6 +17,9 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
this
.
data
.
vtype
=
this
.
view
.
json
.
type
;
this
.
data
.
pid
=
this
.
view
.
json
.
id
+
this
.
data
.
id
;
this
.
htmlPath
=
this
.
options
.
path
;
this
.
maplists
=
{};
this
.
designer
=
designer
;
this
.
propertyNode
=
propertyNode
;
...
...
@@ -71,6 +74,7 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
this
.
loadActionStylesArea
();
this
.
loadActionArea
();
this
.
loadStylesList
();
this
.
loadMaplist
();
}
}.
bind
(
this
));
}
else
{
...
...
@@ -792,6 +796,39 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
}.
bind
(
this
));
},
loadMaplist
:
function
(){
var
maplists
=
this
.
propertyContent
.
getElements
(
"
.MWFMaplist
"
);
debugger
;
maplists
.
each
(
function
(
node
){
var
title
=
node
.
get
(
"
title
"
);
var
name
=
node
.
get
(
"
name
"
);
var
collapse
=
node
.
get
(
"
collapse
"
);
var
mapObj
=
this
.
data
[
name
];
if
(
!
mapObj
)
mapObj
=
{};
MWF
.
require
(
"
MWF.widget.Maplist
"
,
function
(){
node
.
empty
();
var
maplist
=
new
MWF
.
widget
.
Maplist
(
node
,
{
"
title
"
:
title
,
"
collapse
"
:
(
collapse
)
?
true
:
false
,
"
onChange
"
:
function
(){
//this.data[name] = maplist.toJson();
//
var
oldData
=
this
.
data
[
name
];
this
.
changeJsonDate
(
name
,
maplist
.
toJson
());
this
.
changeStyle
(
name
,
oldData
);
this
.
changeData
(
name
);
}.
bind
(
this
),
"
onDelete
"
:
function
(
key
){
debugger
;
this
.
module
.
deletePropertiesOrStyles
(
name
,
key
);
}.
bind
(
this
)
});
maplist
.
load
(
mapObj
);
this
.
maplists
[
name
]
=
maplist
;
}.
bind
(
this
));
}.
bind
(
this
));
},
loadActionStylesArea
:
function
()
{
var
_self
=
this
;
var
actionAreas
=
this
.
propertyContent
.
getElements
(
"
.MWFActionStylesArea
"
);
...
...
o2web/source/x_component_query_ViewDesigner/View.js
浏览文件 @
6af8434b
...
...
@@ -1098,19 +1098,205 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
});
MWF
.
xApplication
.
query
.
ViewDesigner
.
View
.
$Module
=
MWF
.
QV$Module
=
new
Class
({
Extends
:
MWF
.
widget
.
Common
,
Implements
:
[
Options
,
Events
],
copyStyles
:
function
(
from
,
to
){
if
(
!
this
.
json
[
to
])
this
.
json
[
to
]
=
{};
Object
.
each
(
from
,
function
(
style
,
key
){
//if (!this.json[to][key])
this
.
json
[
to
][
key
]
=
style
;
}.
bind
(
this
));
},
removeStyles
:
function
(
from
,
to
){
if
(
this
.
json
[
to
]){
Object
.
each
(
from
,
function
(
style
,
key
){
if
(
this
.
json
[
to
][
key
]
&&
this
.
json
[
to
][
key
]
==
style
){
delete
this
.
json
[
to
][
key
];
}
//if (this.json[from][key]){
// delete this.json[to][key];
//}
}.
bind
(
this
));
}
},
setTemplateStyles
:
function
(
styles
){
if
(
styles
.
styles
)
this
.
copyStyles
(
styles
.
styles
,
"
styles
"
);
if
(
styles
.
properties
)
this
.
copyStyles
(
styles
.
properties
,
"
properties
"
);
},
clearTemplateStyles
:
function
(
styles
){
if
(
styles
){
if
(
styles
.
styles
)
this
.
removeStyles
(
styles
.
styles
,
"
styles
"
);
if
(
styles
.
properties
)
this
.
removeStyles
(
styles
.
properties
,
"
properties
"
);
}
},
setStyleTemplate
:
function
(){
if
(
this
.
view
.
templateStyles
&&
this
.
view
.
templateStyles
[
this
.
moduleName
]
){
this
.
setTemplateStyles
(
this
.
view
.
templateStyles
[
this
.
moduleName
]);
}
},
setAllStyles
:
function
(){
this
.
setPropertiesOrStyles
(
"
styles
"
);
this
.
setPropertiesOrStyles
(
"
inputStyles
"
);
this
.
setPropertiesOrStyles
(
"
properties
"
);
this
.
reloadMaplist
();
},
showProperty
:
function
(){
if
(
!
this
.
property
){
this
.
property
=
new
MWF
.
xApplication
.
query
.
ViewDesigner
.
Property
(
this
,
this
.
view
.
designer
.
propertyContentArea
,
this
.
view
.
designer
,
{
"
path
"
:
this
.
propertyPath
,
"
onPostLoad
"
:
function
(){
this
.
property
.
show
();
}.
bind
(
this
)
});
this
.
property
.
load
();
}
else
{
this
.
property
.
show
();
}
},
hideProperty
:
function
(){
if
(
this
.
property
)
this
.
property
.
hide
();
},
deletePropertiesOrStyles
:
function
(
name
,
key
){
if
(
name
==
"
properties
"
){
try
{
this
.
node
.
removeProperty
(
key
);
}
catch
(
e
){}
}
},
setPropertiesOrStyles
:
function
(
name
){
if
(
name
==
"
styles
"
){
try
{
this
.
setCustomStyles
();
}
catch
(
e
){}
}
if
(
name
==
"
properties
"
){
try
{
this
.
node
.
setProperties
(
this
.
json
.
properties
);
}
catch
(
e
){}
}
},
setCustomNodeStyles
:
function
(
node
,
styles
){
var
border
=
node
.
getStyle
(
"
border
"
);
node
.
clearStyles
();
//node.setStyles(styles);
node
.
setStyle
(
"
border
"
,
border
);
Object
.
each
(
styles
,
function
(
value
,
key
){
var
reg
=
/^border
\w
*/ig
;
if
(
!
key
.
test
(
reg
)){
node
.
setStyle
(
key
,
value
);
}
}.
bind
(
this
));
},
setCustomStyles
:
function
(){
var
border
=
this
.
node
.
getStyle
(
"
border
"
);
this
.
node
.
clearStyles
();
this
.
node
.
setStyles
(
this
.
css
.
moduleNode
);
if
(
this
.
initialStyles
)
this
.
node
.
setStyles
(
this
.
initialStyles
);
this
.
node
.
setStyle
(
"
border
"
,
border
);
if
(
this
.
json
.
styles
)
Object
.
each
(
this
.
json
.
styles
,
function
(
value
,
key
){
if
((
value
.
indexOf
(
"
x_processplatform_assemble_surface
"
)
!=-
1
||
value
.
indexOf
(
"
x_portal_assemble_surface
"
)
!=-
1
)){
var
host1
=
MWF
.
Actions
.
getHost
(
"
x_processplatform_assemble_surface
"
);
var
host2
=
MWF
.
Actions
.
getHost
(
"
x_portal_assemble_surface
"
);
if
(
value
.
indexOf
(
"
/x_processplatform_assemble_surface
"
)
!==-
1
){
value
=
value
.
replace
(
"
/x_processplatform_assemble_surface
"
,
host1
+
"
/x_processplatform_assemble_surface
"
);
}
else
if
(
value
.
indexOf
(
"
x_processplatform_assemble_surface
"
)
!==-
1
){
value
=
value
.
replace
(
"
x_processplatform_assemble_surface
"
,
host1
+
"
/x_processplatform_assemble_surface
"
);
}
if
(
value
.
indexOf
(
"
/x_portal_assemble_surface
"
)
!==-
1
){
value
=
value
.
replace
(
"
/x_portal_assemble_surface
"
,
host2
+
"
/x_portal_assemble_surface
"
);
}
else
if
(
value
.
indexOf
(
"
x_portal_assemble_surface
"
)
!==-
1
){
value
=
value
.
replace
(
"
x_portal_assemble_surface
"
,
host2
+
"
/x_portal_assemble_surface
"
);
}
}
var
reg
=
/^border
\w
*/ig
;
if
(
!
key
.
test
(
reg
)){
if
(
key
){
if
(
key
.
toString
().
toLowerCase
()
===
"
display
"
){
if
(
value
.
toString
().
toLowerCase
()
===
"
none
"
){
this
.
node
.
setStyle
(
"
opacity
"
,
0.3
);
}
else
{
this
.
node
.
setStyle
(
"
opacity
"
,
1
);
this
.
node
.
setStyle
(
key
,
value
);
}
}
else
{
this
.
node
.
setStyle
(
key
,
value
);
}
}
}
//this.node.setStyle(key, value);
}.
bind
(
this
));
},
_setEditStyle
:
function
(
name
,
obj
,
oldValue
){
var
title
=
""
;
var
text
=
""
;
if
(
name
===
"
name
"
){
title
=
this
.
json
.
name
||
this
.
json
.
id
;
text
=
this
.
json
.
type
.
substr
(
this
.
json
.
type
.
lastIndexOf
(
"
$
"
)
+
1
,
this
.
json
.
type
.
length
);
this
.
treeNode
.
setText
(
"
<
"
+
text
+
"
>
"
+
title
);
}
if
(
name
===
"
id
"
){
title
=
this
.
json
.
name
||
this
.
json
.
id
;
if
(
!
this
.
json
.
name
){
text
=
this
.
json
.
type
.
substr
(
this
.
json
.
type
.
lastIndexOf
(
"
$
"
)
+
1
,
this
.
json
.
type
.
length
);
this
.
treeNode
.
setText
(
"
<
"
+
text
+
"
>
"
+
this
.
json
.
id
);
}
this
.
treeNode
.
setTitle
(
this
.
json
.
id
);
this
.
node
.
set
(
"
id
"
,
this
.
json
.
id
);
}
this
.
_setEditStyle_custom
(
name
,
obj
,
oldValue
);
},
reloadMaplist
:
function
(){
if
(
this
.
property
)
Object
.
each
(
this
.
property
.
maplists
,
function
(
map
,
name
){
map
.
reload
(
this
.
json
[
name
]);}.
bind
(
this
));
},
getHtml
:
function
(){
var
copy
=
this
.
node
.
clone
(
true
,
true
);
copy
.
clearStyles
(
true
);
var
html
=
copy
.
outerHTML
;
copy
.
destroy
();
return
html
;
},
getJson
:
function
(){
var
json
=
Object
.
clone
(
this
.
json
);
var
o
=
{};
o
[
json
.
id
]
=
json
;
return
o
;
}
});
MWF
.
xApplication
.
query
.
ViewDesigner
.
View
.
Column
=
new
Class
({
initialize
:
function
(
json
,
view
,
next
){
Extends
:
MWF
.
QV$Module
,
initialize
:
function
(
json
,
view
,
next
){
this
.
propertyPath
=
"
../x_component_query_ViewDesigner/$View/column.html
"
;
this
.
view
=
view
;
this
.
view
=
view
;
this
.
json
=
json
;
this
.
next
=
next
;
this
.
css
=
this
.
view
.
css
;
this
.
content
=
this
.
view
.
viewTitleTrNode
;
this
.
domListNode
=
this
.
view
.
domListNode
;
this
.
load
();
},
},
load
:
function
(){
if
(
!
this
.
json
.
events
){
this
.
loadDefaultJson
(
function
()
{
this
.
_load
()
}.
bind
(
this
))
}
else
{
this
.
_load
();
}
},
_load
:
function
(){
this
.
areaNode
=
new
Element
(
"
td
"
,
{
"
styles
"
:
this
.
css
.
viewTitleColumnAreaNode
});
this
.
areaNode
.
store
(
"
column
"
,
this
);
...
...
@@ -1139,6 +1325,26 @@ MWF.xApplication.query.ViewDesigner.View.Column = new Class({
this
.
setCustomStyles
();
},
loadDefaultJson
:
function
(
callback
){
if
(
this
.
view
.
defaultColumnJson
){
this
.
json
=
Object
.
merge
(
this
.
json
,
Object
.
clone
(
this
.
view
.
defaultColumnJson
)
);
if
(
callback
)
callback
(
this
.
json
);
}
var
url
=
this
.
view
.
path
+
"
column.json
"
;
MWF
.
getJSON
(
url
,
{
"
onSuccess
"
:
function
(
obj
){
this
.
view
.
defaultColumnJson
=
Object
.
clone
(
obj
);
this
.
json
=
Object
.
merge
(
this
.
json
,
Object
.
clone
(
obj
)
);
if
(
callback
)
callback
(
this
.
json
);
}.
bind
(
this
),
"
onerror
"
:
function
(
text
){
this
.
view
.
designer
.
notice
(
text
,
"
error
"
);
}.
bind
(
this
),
"
onRequestFailure
"
:
function
(
xhr
){
this
.
view
.
designer
.
notice
(
xhr
.
responseText
,
"
error
"
);
}.
bind
(
this
)
});
},
setCustomStyles
:
function
(){
var
viewStyles
=
this
.
view
.
json
.
data
.
viewStyles
;
var
border
=
this
.
areaNode
.
getStyle
(
"
border
"
);
...
...
@@ -1526,183 +1732,6 @@ MWF.xApplication.query.ViewDesigner.View.Column = new Class({
});
MWF
.
xApplication
.
query
.
ViewDesigner
.
View
.
$Module
=
MWF
.
QV$Module
=
new
Class
({
Extends
:
MWF
.
widget
.
Common
,
Implements
:
[
Options
,
Events
],
copyStyles
:
function
(
from
,
to
){
if
(
!
this
.
json
[
to
])
this
.
json
[
to
]
=
{};
Object
.
each
(
from
,
function
(
style
,
key
){
//if (!this.json[to][key])
this
.
json
[
to
][
key
]
=
style
;
}.
bind
(
this
));
},
removeStyles
:
function
(
from
,
to
){
if
(
this
.
json
[
to
]){
Object
.
each
(
from
,
function
(
style
,
key
){
if
(
this
.
json
[
to
][
key
]
&&
this
.
json
[
to
][
key
]
==
style
){
delete
this
.
json
[
to
][
key
];
}
//if (this.json[from][key]){
// delete this.json[to][key];
//}
}.
bind
(
this
));
}
},
setTemplateStyles
:
function
(
styles
){
if
(
styles
.
styles
)
this
.
copyStyles
(
styles
.
styles
,
"
styles
"
);
if
(
styles
.
properties
)
this
.
copyStyles
(
styles
.
properties
,
"
properties
"
);
},
clearTemplateStyles
:
function
(
styles
){
if
(
styles
){
if
(
styles
.
styles
)
this
.
removeStyles
(
styles
.
styles
,
"
styles
"
);
if
(
styles
.
properties
)
this
.
removeStyles
(
styles
.
properties
,
"
properties
"
);
}
},
setStyleTemplate
:
function
(){
if
(
this
.
view
.
templateStyles
&&
this
.
view
.
templateStyles
[
this
.
moduleName
]
){
this
.
setTemplateStyles
(
this
.
view
.
templateStyles
[
this
.
moduleName
]);
}
},
setAllStyles
:
function
(){
this
.
setPropertiesOrStyles
(
"
styles
"
);
this
.
setPropertiesOrStyles
(
"
inputStyles
"
);
this
.
setPropertiesOrStyles
(
"
properties
"
);
this
.
reloadMaplist
();
},
showProperty
:
function
(){
if
(
!
this
.
property
){
this
.
property
=
new
MWF
.
xApplication
.
query
.
ViewDesigner
.
Property
(
this
,
this
.
view
.
designer
.
propertyContentArea
,
this
.
view
.
designer
,
{
"
path
"
:
this
.
propertyPath
,
"
onPostLoad
"
:
function
(){
this
.
property
.
show
();
}.
bind
(
this
)
});
this
.
property
.
load
();
}
else
{
this
.
property
.
show
();
}
},
hideProperty
:
function
(){
if
(
this
.
property
)
this
.
property
.
hide
();
},
deletePropertiesOrStyles
:
function
(
name
,
key
){
if
(
name
==
"
properties
"
){
try
{
this
.
node
.
removeProperty
(
key
);
}
catch
(
e
){}
}
},
setPropertiesOrStyles
:
function
(
name
){
if
(
name
==
"
styles
"
){
try
{
this
.
setCustomStyles
();
}
catch
(
e
){}
}
if
(
name
==
"
properties
"
){
try
{
this
.
node
.
setProperties
(
this
.
json
.
properties
);
}
catch
(
e
){}
}
},
setCustomNodeStyles
:
function
(
node
,
styles
){
var
border
=
node
.
getStyle
(
"
border
"
);
node
.
clearStyles
();
//node.setStyles(styles);
node
.
setStyle
(
"
border
"
,
border
);
Object
.
each
(
styles
,
function
(
value
,
key
){
var
reg
=
/^border
\w
*/ig
;
if
(
!
key
.
test
(
reg
)){
node
.
setStyle
(
key
,
value
);
}
}.
bind
(
this
));
},
setCustomStyles
:
function
(){
var
border
=
this
.
node
.
getStyle
(
"
border
"
);
this
.
node
.
clearStyles
();
this
.
node
.
setStyles
(
this
.
css
.
moduleNode
);
if
(
this
.
initialStyles
)
this
.
node
.
setStyles
(
this
.
initialStyles
);
this
.
node
.
setStyle
(
"
border
"
,
border
);
if
(
this
.
json
.
styles
)
Object
.
each
(
this
.
json
.
styles
,
function
(
value
,
key
){
if
((
value
.
indexOf
(
"
x_processplatform_assemble_surface
"
)
!=-
1
||
value
.
indexOf
(
"
x_portal_assemble_surface
"
)
!=-
1
)){
var
host1
=
MWF
.
Actions
.
getHost
(
"
x_processplatform_assemble_surface
"
);
var
host2
=
MWF
.
Actions
.
getHost
(
"
x_portal_assemble_surface
"
);
if
(
value
.
indexOf
(
"
/x_processplatform_assemble_surface
"
)
!==-
1
){
value
=
value
.
replace
(
"
/x_processplatform_assemble_surface
"
,
host1
+
"
/x_processplatform_assemble_surface
"
);
}
else
if
(
value
.
indexOf
(
"
x_processplatform_assemble_surface
"
)
!==-
1
){
value
=
value
.
replace
(
"
x_processplatform_assemble_surface
"
,
host1
+
"
/x_processplatform_assemble_surface
"
);
}
if
(
value
.
indexOf
(
"
/x_portal_assemble_surface
"
)
!==-
1
){
value
=
value
.
replace
(
"
/x_portal_assemble_surface
"
,
host2
+
"
/x_portal_assemble_surface
"
);
}
else
if
(
value
.
indexOf
(
"
x_portal_assemble_surface
"
)
!==-
1
){
value
=
value
.
replace
(
"
x_portal_assemble_surface
"
,
host2
+
"
/x_portal_assemble_surface
"
);
}
}
var
reg
=
/^border
\w
*/ig
;
if
(
!
key
.
test
(
reg
)){
if
(
key
){
if
(
key
.
toString
().
toLowerCase
()
===
"
display
"
){
if
(
value
.
toString
().
toLowerCase
()
===
"
none
"
){
this
.
node
.
setStyle
(
"
opacity
"
,
0.3
);
}
else
{
this
.
node
.
setStyle
(
"
opacity
"
,
1
);
this
.
node
.
setStyle
(
key
,
value
);
}
}
else
{
this
.
node
.
setStyle
(
key
,
value
);
}
}
}
//this.node.setStyle(key, value);
}.
bind
(
this
));
},
_setEditStyle
:
function
(
name
,
obj
,
oldValue
){
var
title
=
""
;
var
text
=
""
;
if
(
name
===
"
name
"
){
title
=
this
.
json
.
name
||
this
.
json
.
id
;
text
=
this
.
json
.
type
.
substr
(
this
.
json
.
type
.
lastIndexOf
(
"
$
"
)
+
1
,
this
.
json
.
type
.
length
);
this
.
treeNode
.
setText
(
"
<
"
+
text
+
"
>
"
+
title
);
}
if
(
name
===
"
id
"
){
title
=
this
.
json
.
name
||
this
.
json
.
id
;
if
(
!
this
.
json
.
name
){
text
=
this
.
json
.
type
.
substr
(
this
.
json
.
type
.
lastIndexOf
(
"
$
"
)
+
1
,
this
.
json
.
type
.
length
);
this
.
treeNode
.
setText
(
"
<
"
+
text
+
"
>
"
+
this
.
json
.
id
);
}
this
.
treeNode
.
setTitle
(
this
.
json
.
id
);
this
.
node
.
set
(
"
id
"
,
this
.
json
.
id
);
}
this
.
_setEditStyle_custom
(
name
,
obj
,
oldValue
);
},
reloadMaplist
:
function
(){
if
(
this
.
property
)
Object
.
each
(
this
.
property
.
maplists
,
function
(
map
,
name
){
map
.
reload
(
this
.
json
[
name
]);}.
bind
(
this
));
},
getHtml
:
function
(){
var
copy
=
this
.
node
.
clone
(
true
,
true
);
copy
.
clearStyles
(
true
);
var
html
=
copy
.
outerHTML
;
copy
.
destroy
();
return
html
;
},
getJson
:
function
(){
var
json
=
Object
.
clone
(
this
.
json
);
var
o
=
{};
o
[
json
.
id
]
=
json
;
return
o
;
}
})
MWF
.
require
(
"
MWF.widget.Toolbar
"
,
null
,
false
);
MWF
.
xApplication
.
query
.
ViewDesigner
.
View
.
Actionbar
=
new
Class
({
Extends
:
MWF
.
xApplication
.
query
.
ViewDesigner
.
View
.
$Module
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录