Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
此号慢热型
o2oa
提交
76d4772d
o2oa
项目概览
此号慢热型
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
5
Star
0
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,发现更多精彩内容 >>
未验证
提交
76d4772d
编写于
1月 10, 2019
作者:
H
huqi1980
提交者:
GitHub
1月 10, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #29 from huqi1980/master
增加图片资源选择器
上级
967f9a16
155ecc2d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
368 addition
and
0 deletion
+368
-0
o2web/source/x_component_Selector/$Selector/default/icon/attr.png
...urce/x_component_Selector/$Selector/default/icon/attr.png
+0
-0
o2web/source/x_component_Selector/PortalFile.js
o2web/source/x_component_Selector/PortalFile.js
+271
-0
o2web/source/x_component_Selector/ProcessFile.js
o2web/source/x_component_Selector/ProcessFile.js
+97
-0
未找到文件。
o2web/source/x_component_Selector/$Selector/default/icon/attr.png
0 → 100644
浏览文件 @
76d4772d
415 字节
o2web/source/x_component_Selector/PortalFile.js
0 → 100644
浏览文件 @
76d4772d
MWF
.
xApplication
.
Selector
=
MWF
.
xApplication
.
Selector
||
{};
MWF
.
xDesktop
.
requireApp
(
"
Selector
"
,
"
Process
"
,
null
,
false
);
MWF
.
xApplication
.
Selector
.
PortalFile
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
Process
,
options
:
{
"
style
"
:
"
default
"
,
"
count
"
:
0
,
"
title
"
:
MWF
.
xApplication
.
Selector
.
LP
.
selectFile
,
"
values
"
:
[],
"
names
"
:
[],
"
isImage
"
:
false
,
"
accept
"
:
[],
"
expand
"
:
false
},
loadSelectItems
:
function
(
addToNext
){
if
(
this
.
options
.
isImage
)
this
.
options
.
accept
=
[
"
png
"
,
"
jpg
"
,
"
bmp
"
,
"
gif
"
,
"
jpeg
"
,
"
jpe
"
];
this
.
portalAction
.
listApplication
(
function
(
json
){
if
(
json
.
data
.
length
){
json
.
data
.
each
(
function
(
data
){
this
.
portalAction
.
listFile
(
data
.
id
,
function
(
fileJson
){
var
files
=
fileJson
.
data
;
if
(
this
.
options
.
accept
&&
this
.
options
.
accept
.
length
){
files
=
files
.
filter
(
function
(
file
){
var
extName
=
file
.
fileName
.
substring
(
file
.
fileName
.
lastIndexOf
(
"
.
"
)
+
1
,
file
.
fileName
.
length
).
toLowerCase
();
return
(
this
.
options
.
accept
.
indexOf
(
extName
)
!==-
1
)
}.
bind
(
this
));
}
if
(
files
.
length
){
data
.
files
=
files
;
var
category
=
this
.
_newItemCategory
(
data
,
this
,
this
.
itemAreaNode
);
files
.
each
(
function
(
d
){
d
.
applicationName
=
data
.
name
;
var
item
=
this
.
_newItem
(
d
,
this
,
category
.
children
);
this
.
items
.
push
(
item
);
}.
bind
(
this
));
}
}.
bind
(
this
));
}.
bind
(
this
));
}
}.
bind
(
this
));
},
loadSelectNode
:
function
(){
this
.
selectNode
=
new
Element
(
"
div
"
,
{
"
styles
"
:
(
this
.
options
.
count
.
toInt
()
===
1
)
?
this
.
css
.
selectNodeSingle
:
this
.
css
.
selectNode
}).
inject
(
this
.
contentNode
);
this
.
itemAreaScrollNode
=
new
Element
(
"
div
"
,
{
"
styles
"
:
this
.
css
.
itemAreaScrollNode
}).
inject
(
this
.
selectNode
);
this
.
itemAreaScrollNode
.
setStyle
(
"
height
"
,
"
408px
"
);
this
.
itemAreaNode
=
new
Element
(
"
div
"
,
{
"
styles
"
:
this
.
css
.
itemAreaNode
}).
inject
(
this
.
itemAreaScrollNode
);
this
.
itemSearchAreaNode
=
new
Element
(
"
div
"
,
{
"
styles
"
:
this
.
css
.
itemAreaNode
}).
inject
(
this
.
itemAreaScrollNode
);
this
.
itemSearchAreaNode
.
setStyle
(
"
display
"
,
"
none
"
);
this
.
loadSelectNodeScroll
();
this
.
initLoadSelectItems
();
this
.
checkLoadSelectItems
();
},
close
:
function
(){
this
.
fireEvent
(
"
close
"
);
this
.
node
.
destroy
();
this
.
container
.
unmask
();
if
(
this
.
maskInterval
){
window
.
clearInterval
(
this
.
maskInterval
);
this
.
maskInterval
=
null
;
}
this
.
selectedItems
.
each
(
function
(
item
){
item
.
destroy
();
});
this
.
items
.
each
(
function
(
item
){
item
.
destroy
();
});
MWF
.
release
(
this
);
delete
this
;
},
_getChildrenItemIds
:
function
(
data
){
return
data
.
files
||
[];
},
_newItemCategory
:
function
(
data
,
selector
,
item
,
level
){
return
new
MWF
.
xApplication
.
Selector
.
PortalFile
.
ItemCategory
(
data
,
selector
,
item
,
level
)
},
_newItemSelected
:
function
(
data
,
selector
,
item
){
return
new
MWF
.
xApplication
.
Selector
.
PortalFile
.
ItemSelected
(
data
,
selector
,
item
)
},
_newItem
:
function
(
data
,
selector
,
container
,
level
){
return
new
MWF
.
xApplication
.
Selector
.
PortalFile
.
Item
(
data
,
selector
,
container
,
level
);
}
});
MWF
.
xApplication
.
Selector
.
PortalFile
.
Item
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
Process
.
Item
,
_setIcon
:
function
(){
this
.
iconNode
.
setStyle
(
"
background-image
"
,
"
url(
"
+
"
/x_component_Selector/$Selector/default/icon/attr.png)
"
);
},
loadSubItem
:
function
(){
return
false
;
},
checkSelectedSingle
:
function
(){
var
selectedItem
=
this
.
selector
.
options
.
values
.
filter
(
function
(
item
,
index
){
if
(
typeOf
(
item
)
===
"
object
"
)
return
(
this
.
data
.
id
===
item
.
id
)
||
(
this
.
data
.
name
===
item
.
name
)
;
if
(
typeOf
(
item
)
===
"
string
"
)
return
(
this
.
data
.
id
===
item
)
||
(
this
.
data
.
name
===
item
);
return
false
;
}.
bind
(
this
));
if
(
selectedItem
.
length
){
this
.
selectedSingle
();
}
},
checkSelected
:
function
(){
var
selectedItem
=
this
.
selector
.
selectedItems
.
filter
(
function
(
item
,
index
){
return
(
item
.
data
.
id
===
this
.
data
.
id
)
||
(
item
.
data
.
name
===
this
.
data
.
name
);
}.
bind
(
this
));
if
(
selectedItem
.
length
){
//selectedItem[0].item = this;
selectedItem
[
0
].
addItem
(
this
);
this
.
selectedItem
=
selectedItem
[
0
];
this
.
setSelected
();
}
},
setEvent
:
function
(){
var
url
=
MWF
.
xDesktop
.
getPortalFileUr
(
this
.
data
.
id
,
this
.
data
.
portal
);
this
.
data
.
url
=
url
;
this
.
node
.
addEvents
({
"
mouseover
"
:
function
(){
this
.
overItem
();
if
(
!
this
.
previewNode
){
var
extName
=
this
.
data
.
fileName
.
substring
(
this
.
data
.
fileName
.
lastIndexOf
(
"
.
"
)
+
1
,
this
.
data
.
fileName
.
length
).
toLowerCase
();
if
([
"
png
"
,
"
jpg
"
,
"
bmp
"
,
"
gif
"
,
"
jpeg
"
,
"
jpe
"
].
indexOf
(
extName
)
!==-
1
){
this
.
previewNode
=
new
Element
(
"
div
"
,
{
"
styles
"
:
this
.
selector
.
css
.
filePreviewNode
});
var
img
=
new
Element
(
"
img
"
,
{
"
src
"
:
url
,
"
styles
"
:
this
.
selector
.
css
.
filePreviewNode
}).
inject
(
this
.
previewNode
);
this
.
tooltip
=
new
mBox
.
Tooltip
({
content
:
this
.
previewNode
,
setStyles
:
{
content
:
{
padding
:
15
,
lineHeight
:
20
}},
attach
:
this
.
node
,
position
:
{
y
:
[
'
center
'
],
x
:
[
'
right
'
,
'
outside
'
]
},
transition
:
'
flyin
'
});
}
}
}.
bind
(
this
),
"
mouseout
"
:
function
(){
this
.
outItem
();
}.
bind
(
this
),
"
click
"
:
function
(){
this
.
clickItem
();
}.
bind
(
this
)
});
},
destroy
:
function
(){
if
(
this
.
tooltip
)
this
.
tooltip
.
destroy
();
this
.
node
.
destroy
();
}
});
MWF
.
xApplication
.
Selector
.
PortalFile
.
ItemSelected
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
Process
.
ItemSelected
,
_getShowName
:
function
(){
return
this
.
data
.
name
;
},
_setIcon
:
function
(){
this
.
iconNode
.
setStyle
(
"
background-image
"
,
"
url(
"
+
"
/x_component_Selector/$Selector/default/icon/attr.png)
"
);
},
check
:
function
(){
if
(
this
.
selector
.
items
.
length
){
var
items
=
this
.
selector
.
items
.
filter
(
function
(
item
,
index
){
return
(
item
.
data
.
id
===
this
.
data
.
id
)
||
(
item
.
data
.
name
===
this
.
data
.
name
);
}.
bind
(
this
));
this
.
items
=
items
;
if
(
items
.
length
){
items
.
each
(
function
(
item
){
item
.
selectedItem
=
this
;
item
.
setSelected
();
}.
bind
(
this
));
}
}
},
setEvent
:
function
(){
var
url
=
MWF
.
xDesktop
.
getPortalFileUr
(
this
.
data
.
id
,
this
.
data
.
portal
);
this
.
data
.
url
=
url
;
this
.
node
.
addEvents
({
"
mouseover
"
:
function
(){
this
.
overItem
();
if
(
!
this
.
previewNode
){
var
extName
=
this
.
data
.
fileName
.
substring
(
this
.
data
.
fileName
.
lastIndexOf
(
"
.
"
)
+
1
,
this
.
data
.
fileName
.
length
).
toLowerCase
();
if
([
"
png
"
,
"
jpg
"
,
"
bmp
"
,
"
gif
"
,
"
jpeg
"
,
"
jpe
"
].
indexOf
(
extName
)
!==-
1
){
this
.
previewNode
=
new
Element
(
"
div
"
,
{
"
styles
"
:
this
.
selector
.
css
.
filePreviewNode
}).
inject
(
this
.
selector
.
node
);
var
img
=
new
Element
(
"
img
"
,
{
"
src
"
:
url
,
"
styles
"
:
this
.
selector
.
css
.
filePreviewNode
}).
inject
(
this
.
previewNode
);
this
.
tooltip
=
new
mBox
.
Tooltip
({
content
:
this
.
previewNode
,
setStyles
:
{
content
:
{
padding
:
15
,
lineHeight
:
20
}},
attach
:
this
.
node
,
position
:
{
y
:
[
'
center
'
],
x
:
[
'
left
'
,
'
outside
'
]
},
transition
:
'
flyin
'
});
}
}
}.
bind
(
this
),
"
mouseout
"
:
function
(){
this
.
outItem
();
}.
bind
(
this
),
"
click
"
:
function
(){
this
.
clickItem
();
}.
bind
(
this
)
});
},
destroy
:
function
(){
if
(
this
.
tooltip
)
this
.
tooltip
.
destroy
();
this
.
node
.
destroy
();
}
});
MWF
.
xApplication
.
Selector
.
PortalFile
.
ItemCategory
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
Process
.
ItemCategory
,
_getShowName
:
function
(){
return
this
.
data
.
name
;
},
createNode
:
function
(){
this
.
node
=
new
Element
(
"
div
"
,
{
"
styles
"
:
this
.
selector
.
css
.
selectorItemCategory_department
}).
inject
(
this
.
container
);
},
_setIcon
:
function
(){
this
.
iconNode
.
setStyle
(
"
background-image
"
,
"
url(
"
+
"
/x_component_Selector/$Selector/default/icon/applicationicon.png)
"
);
},
afterLoad
:
function
(){
return
true
;
},
loadSub
:
function
(
callback
){
if
(
!
this
.
loaded
){
this
.
selector
.
portalAction
.
listFile
(
this
.
data
.
id
,
function
(
subJson
){
subJson
.
data
.
each
(
function
(
subData
){
subData
.
applicationName
=
this
.
data
.
name
;
subData
.
application
=
this
.
data
.
id
;
var
category
=
this
.
selector
.
_newItem
(
subData
,
this
.
selector
,
this
.
children
,
this
.
level
+
1
);
}.
bind
(
this
));
this
.
loaded
=
true
;
if
(
callback
)
callback
();
}.
bind
(
this
),
null
,
this
.
data
.
id
);
}
else
{
if
(
callback
)
callback
();
}
},
_hasChild
:
function
(){
return
true
;
},
check
:
function
(){}
});
o2web/source/x_component_Selector/ProcessFile.js
0 → 100644
浏览文件 @
76d4772d
MWF
.
xApplication
.
Selector
=
MWF
.
xApplication
.
Selector
||
{};
MWF
.
xDesktop
.
requireApp
(
"
Selector
"
,
"
PortalFile
"
,
null
,
false
);
MWF
.
xApplication
.
Selector
.
ProcessFile
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
PortalFile
,
options
:
{
"
style
"
:
"
default
"
,
"
count
"
:
0
,
"
title
"
:
MWF
.
xApplication
.
Selector
.
LP
.
selectFile
,
"
values
"
:
[],
"
names
"
:
[],
"
expand
"
:
false
},
loadSelectItems
:
function
(
addToNext
){
if
(
this
.
options
.
isImage
)
this
.
options
.
accept
=
[
"
png
"
,
"
jpg
"
,
"
bmp
"
,
"
gif
"
,
"
jpeg
"
,
"
jpe
"
];
this
.
processAction
.
listApplication
(
function
(
json
){
if
(
json
.
data
.
length
){
json
.
data
.
each
(
function
(
data
){
this
.
processAction
.
listFile
(
data
.
id
,
function
(
fileJson
){
var
files
=
fileJson
.
data
;
if
(
this
.
options
.
accept
&&
this
.
options
.
accept
.
length
){
files
=
files
.
filter
(
function
(
file
){
var
extName
=
file
.
fileName
.
substring
(
file
.
fileName
.
lastIndexOf
(
"
.
"
)
+
1
,
file
.
fileName
.
length
).
toLowerCase
();
return
(
this
.
options
.
accept
.
indexOf
(
extName
)
!==-
1
)
}.
bind
(
this
));
}
if
(
files
.
length
){
data
.
files
=
files
;
var
category
=
this
.
_newItemCategory
(
data
,
this
,
this
.
itemAreaNode
);
files
.
each
(
function
(
d
){
d
.
applicationName
=
data
.
name
;
var
item
=
this
.
_newItem
(
d
,
this
,
category
.
children
);
this
.
items
.
push
(
item
);
}.
bind
(
this
));
}
}.
bind
(
this
));
}.
bind
(
this
));
}
}.
bind
(
this
));
},
_newItemCategory
:
function
(
data
,
selector
,
item
,
level
){
return
new
MWF
.
xApplication
.
Selector
.
ProcessFile
.
ItemCategory
(
data
,
selector
,
item
,
level
)
},
_newItemSelected
:
function
(
data
,
selector
,
item
){
return
new
MWF
.
xApplication
.
Selector
.
ProcessFile
.
ItemSelected
(
data
,
selector
,
item
)
},
_newItem
:
function
(
data
,
selector
,
container
,
level
){
return
new
MWF
.
xApplication
.
Selector
.
ProcessFile
.
Item
(
data
,
selector
,
container
,
level
);
}
});
MWF
.
xApplication
.
Selector
.
ProcessFile
.
Item
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
PortalFile
.
Item
,
setEvent
:
function
(){
this
.
node
.
addEvents
({
"
mouseover
"
:
function
(){
this
.
overItem
();
}.
bind
(
this
),
"
mouseout
"
:
function
(){
this
.
outItem
();
}.
bind
(
this
),
"
click
"
:
function
(){
this
.
clickItem
();
}.
bind
(
this
)
});
var
url
=
MWF
.
xDesktop
.
getProcessFileUr
(
this
.
data
.
id
,
this
.
data
.
application
);
this
.
data
.
url
=
url
;
var
extName
=
this
.
data
.
fileName
.
substring
(
this
.
data
.
fileName
.
lastIndexOf
(
"
.
"
)
+
1
,
this
.
data
.
fileName
.
length
).
toLowerCase
();
if
([
"
png
"
,
"
jpg
"
,
"
bmp
"
,
"
gif
"
,
"
jpeg
"
,
"
jpe
"
].
indexOf
(
extName
)
!==-
1
){
this
.
previewNode
=
new
Element
(
"
div
"
,
{
"
styles
"
:
this
.
selector
.
css
.
filePreviewNode
});
var
img
=
new
Element
(
"
img
"
,
{
"
src
"
:
url
,
"
styles
"
:
this
.
selector
.
css
.
filePreviewNode
}).
inject
(
this
.
previewNode
);
this
.
tooltip
=
new
mBox
.
Tooltip
({
content
:
this
.
previewNode
,
setStyles
:
{
content
:
{
padding
:
15
,
lineHeight
:
20
}},
attach
:
this
.
node
,
position
:
{
y
:
[
'
center
'
],
x
:
[
'
right
'
,
'
outside
'
]
},
transition
:
'
flyin
'
});
}
}
});
MWF
.
xApplication
.
Selector
.
ProcessFile
.
ItemSelected
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
PortalFile
.
ItemSelected
});
MWF
.
xApplication
.
Selector
.
ProcessFile
.
ItemCategory
=
new
Class
({
Extends
:
MWF
.
xApplication
.
Selector
.
PortalFile
.
ItemCategory
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录