Commit 8149b0b0 by 周添尉

添加了网盘的分享,共享,分享码和首页地图的搜索地址功能

parent 63d633c3
...@@ -57,6 +57,15 @@ $.extend({ ...@@ -57,6 +57,15 @@ $.extend({
window.event.cancelBubble = true; window.event.cancelBubble = true;
} }
}, },
//阻止默认行为
preventDefualt:function(){
var event = event || window.event;
if (typeof event.preventDefault != 'undefined') {//w3c
event.preventDefault();
} else{
event.returnValue = false;//ie
}
},
//返回屏幕分辨率的宽和高 //返回屏幕分辨率的宽和高
getViewSizeWithScrollbar:function(){//包含滚动条 getViewSizeWithScrollbar:function(){//包含滚动条
if (window.innerWidth) { if (window.innerWidth) {
...@@ -154,7 +163,48 @@ $.extend({ ...@@ -154,7 +163,48 @@ $.extend({
str = str.replace(/ss|SS/, date.getSeconds() > 9 ? date.getSeconds().toString() : '0' + date.getSeconds()); str = str.replace(/ss|SS/, date.getSeconds() > 9 ? date.getSeconds().toString() : '0' + date.getSeconds());
str = str.replace(/s|S/g, date.getSeconds()); str = str.replace(/s|S/g, date.getSeconds());
return str; return str;
} },
//文件的大小转为B,KB,MB,GB
fileSizeToStr : function(limit){
var size = "";
if( limit < 0.1 * 1024 ){ //如果小于0.1KB转化成B
size = limit.toFixed(2) + "B";
}else if(limit < 0.1 * 1024 * 1024 ){//如果小于0.1MB转化成KB
size = (limit / 1024).toFixed(2) + "KB";
}else if(limit < 0.1 * 1024 * 1024 * 1024){ //如果小于0.1GB转化成MB
size = (limit / (1024 * 1024)).toFixed(2) + "MB";
}else{ //其他转化成GB
size = (limit / (1024 * 1024 * 1024)).toFixed(2) + "GB";
}
var sizestr = size + "";
var len = sizestr.indexOf("\.");
var dec = sizestr.substr(len + 1, 2);
if(dec == "00"){//当小数点后为00时 去掉小数部分
return sizestr.substring(0,len) + sizestr.substr(len + 3,2);
}
return sizestr;
},
/*
** randomWord 产生任意长度随机字母数字组合
** randomFlag-是否任意长度 min-任意长度最小位[固定位数] max-任意长度最大位
** xuanfeng 2014-08-28
*/
randomWord : function(randomFlag, min, max){
var str = "",
range = min,
arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
// 随机产生
if(randomFlag){
range = Math.round(Math.random() * (max-min)) + min;
}
for(var i=0; i<range; i++){
pos = Math.round(Math.random() * (arr.length-1));
str += arr[pos];
}
return str;
}
// //
} }
}); });
\ No newline at end of file
...@@ -139,7 +139,7 @@ a{ ...@@ -139,7 +139,7 @@ a{
text-align:center; text-align:center;
color:white; color:white;
line-height: 40px; line-height: 40px;
border-radius: 20px; border-radius:5px;
margin:0 auto 13px; margin:0 auto 13px;
} }
.login_item_login:hover{ .login_item_login:hover{
......
...@@ -257,6 +257,10 @@ a{ ...@@ -257,6 +257,10 @@ a{
.index_container_header{ .index_container_header{
border-bottom:2px solid #1887f6; border-bottom:2px solid #1887f6;
height:30px; height:30px;
position:relative;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.index_container_header>label{ .index_container_header>label{
display:inline-block; display:inline-block;
...@@ -274,18 +278,26 @@ a{ ...@@ -274,18 +278,26 @@ a{
line-height:28px; line-height:28px;
} }
.index_container_header>label+span+span{ .index_container_header>label+span+span{
font-size:12px; font-size: 12px;
color:#1887f6; color: #1887f6;
vertical-align: middle; vertical-align:middle;
} }
.index_container_header>img{ .index_container_header>img{
float: right;
background: #b9dbfc; background: #b9dbfc;
margin-left: 7px;
border-radius: 3px; border-radius: 3px;
padding: 1px; padding: 1px;
margin-top: 5px; top: 5px;
display: none; display: none;
position: absolute;
}
.index_container_header>img:first-of-type{
right:0;
}
.index_container_header>img:first-of-type+img{
right:24px;
}
.index_container_header>img:first-of-type+img+img{
right: 48px;
} }
.index_container_header>img:hover{ .index_container_header>img:hover{
background:#ddeefd; background:#ddeefd;
...@@ -1013,9 +1025,13 @@ a{ ...@@ -1013,9 +1025,13 @@ a{
border:1px solid #ABD6EA !important; border:1px solid #ABD6EA !important;
border-radius: 5px; border-radius: 5px;
} }
.disk_rubbish_fileName:hover{
cursor: default !important;
color:#333 !important;
}
.disk_content_lump_click>div:hover{ .disk_content_lump_click>div:hover{
cursor: pointer !important; cursor: pointer;
color:#2CA4F0 !important; color:#2CA4F0;
} }
.disk_content_lump img{ .disk_content_lump img{
width:100%; width:100%;
...@@ -1105,6 +1121,14 @@ a{ ...@@ -1105,6 +1121,14 @@ a{
background:#93D5FF; background:#93D5FF;
font-weight:bold; font-weight:bold;
} }
.disk_move_title>span:first-child{
display: inline-block;
/* width: 345px; */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
}
.disk_move_title>span:first-child+span{ .disk_move_title>span:first-child+span{
float:right; float:right;
margin-top:10px; margin-top:10px;
...@@ -1187,7 +1211,7 @@ a{ ...@@ -1187,7 +1211,7 @@ a{
} }
.disk_upload_content>div{ .disk_upload_content>div{
padding:0px; padding:0px;
height:274px; height:374px;
} }
.disk_upload_content>div:first-child{ .disk_upload_content>div:first-child{
background:#fafbf6; background:#fafbf6;
...@@ -1218,8 +1242,10 @@ a{ ...@@ -1218,8 +1242,10 @@ a{
text-align: center; text-align: center;
} }
.disk_upload_left_content_container{ .disk_upload_left_content_container{
border:2px dashed #ccc; border:2px dashed #eee;
margin:53px 60px 10px; margin:52px 40px 0px;
padding:40px 0;
border-radius: 5px;
} }
.disk_upload_left_content_container>img{ .disk_upload_left_content_container>img{
margin-top:15px; margin-top:15px;
...@@ -1239,9 +1265,10 @@ a{ ...@@ -1239,9 +1265,10 @@ a{
color:#bbb; color:#bbb;
margin-bottom:15px; margin-bottom:15px;
} }
.disk_upload_left_content_container+div{ .disk_upload_left_content_container>img+div+div+div{
font-size:12px; font-size:12px;
color:#bbb; color:#bbb;
margin-bottom:15px;
} }
.disk_upload_right_header{ .disk_upload_right_header{
padding:0 7px; padding:0 7px;
...@@ -1257,7 +1284,7 @@ a{ ...@@ -1257,7 +1284,7 @@ a{
padding:0 0 0 10px; padding:0 0 0 10px;
} }
.disk_upload_right_content{ .disk_upload_right_content{
height:219px; height:319px;
overflow: auto; overflow: auto;
padding:4px 7px 0; padding:4px 7px 0;
} }
...@@ -1266,7 +1293,7 @@ a{ ...@@ -1266,7 +1293,7 @@ a{
border:1px solid transparent; border:1px solid transparent;
border-radius:3px; border-radius:3px;
height:24px; height:24px;
line-height:24px; line-height:22px;
color:#999; color:#999;
margin-top: 3px; margin-top: 3px;
} }
...@@ -1317,12 +1344,14 @@ a{ ...@@ -1317,12 +1344,14 @@ a{
padding: 2px; padding: 2px;
font-size: 12px; font-size: 12px;
box-shadow: 0 2px 4px rgba(126,205,255,0.6); box-shadow: 0 2px 4px rgba(126,205,255,0.6);
margin-left:3px;
margin-top: 2px;
} }
.disk_upload_right_content>div>div:first-child+div>.glyphicon:hover{ .disk_upload_right_content>div>div:first-child+div>.glyphicon:hover{
background:#3AA2E0; background:#3AA2E0;
} }
.disk_upload_right_content>div>div:first-child+div>.glyphicon-ok{ .disk_upload_right_content>div>div:first-child+div>.glyphicon-ok{
margin-left:46px; margin-left:50px;
display: none; display: none;
background:#3AA2E0; background:#3AA2E0;
cursor: default; cursor: default;
...@@ -1333,6 +1362,284 @@ a{ ...@@ -1333,6 +1362,284 @@ a{
color:#333; color:#333;
border-top: 1px solid #f3f0f0; border-top: 1px solid #f3f0f0;
} }
.disk_rubbishBtn,.disk_shareCodeBtn{
display: none;
}
.disk_createShare{
overflow: hidden;
}
.disk_createShare_content{
padding:30px 30px 0;
}
.disk_createShare_content>div{
padding:0;
height:40px;
line-height:40px;
}
.disk_createShare_content select,.disk_createShare_content input{
height:40px;
color:#333;
background:#eee;
}
.disk_createShare_content span{
display: inline-block;
height: 40px;
line-height: 40px;
background: #93D5FF;
color: white;
border-radius: 4px;
margin-left:5%;
cursor: pointer;
width:95%;
text-align: center;
}
.disk_createShare_content span:hover{
opacity: 0.8;
}
.disk_createShare_content>div:first-child{
font-size:14px;
color:#bbb;
}
.disk_createShare_btn{
margin-top:30px;
}
.disk_createShare_btn:after{
content:'';
display: block;
width:50%;
height:40px;
background: #93D5FF;
float: left;
}
.disk_createShare_btn{
padding:0px;
text-align: right;
}
.disk_createShare_btn>span{
cursor: pointer;
display: inline-block;
width:25%;
height:40px;
line-height:40px;
text-align: center;
background: #93D5FF;
color:white;
}
.disk_createShare_btn>span:first-child{
background: #36ACF7;
}
.disk_createShare_btn>span:hover{
opacity: 0.8;
}
.disk_createShare_after{
overflow: hidden;
display:none;
}
.disk_createShare_after_title{
margin:30px 30px 0;
}
.disk_createShare_after_title>span:first-child{
background: #7EC1ED;
color: white;
border-radius: 50%;
padding: 2px;
font-size: 12px;
box-shadow: 0 2px 4px rgba(126,205,255,0.6);
margin-right:5px;
}
.disk_createShare_after_title>span{
color:#2ba0ea;
}
.disk_createShare_content>div>div{
padding:0px;
}
/*******************分享的样式*******************/
.share_cotainer{
width:400px;
height:276px;
position:absolute;
top:50%;
left:50%;
margin-top:-138px;
margin-left:-200px;
background:white;
border-radius: 5px;
}
.share_cotainer_header{
height:75px;
line-height:75px;
background: #9AD8FF;
border-radius: 5px 5px 0 0;
color:white;
padding-left:35px;
font-size:16px;
}
.share_cotainer_header>img+span{
font-size:18px;
font-weight: bold;
margin-right:8px;
margin-left:12px;
}
.share_cotainer_code{
padding:0 30px;
}
.share_cotainer_code>div:first-child{
color:#999;
margin:28px 0 18px;
}
.share_cotainer_code>div:first-child+div>input{
background: #eee;
border-radius: 4px;
height:40px;
width:100%;
border: none;
color:#333;
}
.share_cotainer_code>div:first-child+div+div{
margin:22px 0 40px;
display: inline-block;
width:134px;
height:40px;
line-height:40px;
background: #9AD8FF;
text-align: center;
border-radius: 4px;
color:white;
cursor: pointer;
}
.share_cotainer_code>div:first-child+div+div:hover{
opacity: 0.8;
}
.share_clound{
position:absolute;
bottom:0;
height:300px;
width:100%;
}
.shareDetail_container{
background: white;
min-height:100%;
border-radius: 5px;
padding:20px 15px 20px;
}
.shareDetail_container_header{
height:40px;
line-height: 40px;
padding-left:10px;
}
.shareDetail_container_header>img{
margin-right:7px;
}
.shareDetail_container_header>label{
color: #424e67;
font-weight: 200;
}
.shareDetail_container_header>span{
float:right;
height: 32px;
line-height: 32px;
text-align: center;
cursor: pointer;
margin-left:10px;
border: 1px solid #c0d9fe;
border-radius: 4px;
padding:0 10px;
color: #3b8cff;
}
.shareDetail_container_header i{
margin-right:3px;
}
.shareDetail_container_header>span:hover{
color: #77afff ;
}
.shareDetail_container_time{
border-bottom:1px solid #f1f5fb;
padding:10px 0 15px 10px;
font-size: 12px;
}
.shareDetail_container_time>span:first-child{
color:#999;
font-size: 14px;
vertical-align: bottom;
}
.shareDetail_container_time>span:first-child+span{
margin-right:16px;
margin-left:6px;
}
.shareDetail_container_mulu{
height:26px;
line-height:40px;
padding-left:10px;
font-size:12px;
}
.shareDetail_container_mulu>label{
font-weight: normal;
cursor: text;
}
.shareDetail_container_mulu>span:not(.shareDetail_container_mulu_shuxian){
color:#3b8cff;
cursor: pointer;
}
.shareDetail_container_mulu>span:not(.shareDetail_container_mulu_shuxian):hover{
text-decoration: underline;
}
.shareDetail_container_mulu_shuxian{
color:#c5d8f3;
padding: 0 5px;
}
.shareDetail_container_mulu_noClick{
color:#666 !important;
cursor: text !important;
}
.shareDetail_container_mulu_noClick:hover{
text-decoration: none !important;
}
/*************分享的列表样式***************/
.shareDetail_table tbody>tr:hover td{
background:#f6faff;
border-top: 1px solid #daebfe !important;
border-bottom: 1px solid #daebfe;
}
.shareDetail_table tbody .selected td {
background-color: #f6faff;
border-top: 1px solid #daebfe !important;
border-bottom: 1px solid #daebfe;
}
.shareDetail_table tbody td,.shareDetail_table thead th{
border-left:0px;
}
.shareDetail_table tbody>tr>td,.shareDetail_table tbody>tr>th,.shareDetail_table tfoot>tr>td,.shareDetail_table tfoot>tr>th,.shareDetail_table thead>tr>td, .table>thead>tr>th{
border-top:1px solid #f1f5fb;
}
.shareDetail_table .fixed-table-body{
height:auto;
}
.shareDetail_table .bootstrap-table .table > thead > tr > th{
border-bottom:0px;
}
.shareDetail_table .fixed-table-container{
border:0px;
}
/* .shareDetail_table thead>tr>th{
border-bottom:1px solid #f1f5fb;
} */
.shareDetail_table .bootstrap-table .table{
border-bottom:1px solid #f1f5fb;
}
.shareDetail_table tbody>tr:first-child td{
border-top:1px solid #f1f5fb;
}
/********************/
.shareDetail_downLoad{
cursor: pointer;
}
.shareDetail_downLoad:hover{
text-decoration: underline;
color:#3b8cff;
}
...@@ -16,14 +16,15 @@ ...@@ -16,14 +16,15 @@
<div class="disk_container container-fluid"> <div class="disk_container container-fluid">
<div class="row disk_search"> <div class="row disk_search">
<div class="col-md-3"> <div class="col-md-3">
<div class="col-md-3"><img src="${ctx}/custom/images/disk_home.png" wdith="14" height="14" /><span>|</span></div> <div class="col-md-3" onclick="location.href='disk'"><img src="${ctx}/custom/images/disk_home.png" wdith="14" height="14" /><span>|</span></div>
<div class="col-md-3"><img src="${ctx}/custom/images/disk_last.png" wdith="14" height="14" /><span>|</span></div> <div class="col-md-3"><img src="${ctx}/custom/images/disk_last.png" wdith="14" height="14" /><span>|</span></div>
<div class="col-md-3"><img src="${ctx}/custom/images/disk_next.png" wdith="14" height="14" /><span>|</span></div> <div class="col-md-3"><img src="${ctx}/custom/images/disk_next.png" wdith="14" height="14" /><span>|</span></div>
<div class="col-md-3"><img src="${ctx}/custom/images/disk_circle.png" wdith="14" height="14" /></div> <div id="disk_rubbish" class="col-md-3" onclick="disk_rubbish()"><img src="${ctx}/custom/images/disk_circle.png" wdith="14" height="14" /></div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="disk_search_center"> <div class="disk_search_center">
<a onclick="disk_backFolder(this)"><span class="glyphicon glyphicon-folder-close"></span><span>我的网盘</span><span class="glyphicon glyphicon-triangle-right"></span></a> <a href="disk"><span class="glyphicon glyphicon-folder-close"></span><span>我的网盘</span><span class="glyphicon glyphicon-triangle-right"></span></a>
<!-- <a onclick="disk_backFolder(this)"><span class="glyphicon glyphicon-folder-close"></span><span>我的网盘</span><span class="glyphicon glyphicon-triangle-right"></span></a> -->
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
...@@ -38,11 +39,16 @@ ...@@ -38,11 +39,16 @@
<div class="col-md-12 disk_content_header"> <div class="col-md-12 disk_content_header">
<div class="col-md-11"> <div class="col-md-11">
<a href="javascript:disk_uploadFolder()"><img src="${ctx}/custom/images/disk_upload.png" width="16" height="16" /><span>上传文件</span></a> <a href="javascript:disk_uploadFolder()"><img src="${ctx}/custom/images/disk_upload.png" width="16" height="16" /><span>上传文件</span></a>
<%-- <a href="#"><img src="${ctx}/custom/images/disk_xiazai.png" width="16" height="16" /><span>下载文件</span></a> --%> <a class="disk_document_default" href="javascript:disk_downFolder()"><img src="${ctx}/custom/images/disk_xiazai.png" width="16" height="16" /><span>下载文件</span></a>
<a href="javascript:disk_addFolder()"><img src="${ctx}/custom/images/disk_add.png" width="16" height="16" /><span>新建文件夹</span></a> <a href="javascript:disk_addFolder()"><img src="${ctx}/custom/images/disk_add.png" width="16" height="16" /><span>新建文件夹</span></a>
<a class="disk_document_default" href="javascript:disk_deleteFolder()"><img src="${ctx}/custom/images/disk_delete.png" width="16" height="16" /><span>删除</span></a> <a class="disk_document_default" href="javascript:disk_deleteFolder()"><img src="${ctx}/custom/images/disk_delete.png" width="16" height="16" /><span>删除</span></a>
<a href="#"><img src="${ctx}/custom/images/disk_share.png" width="16" height="16" /><span>分享</span></a> <a class="disk_document_default" href="javascript:disk_shareFolder()"><img src="${ctx}/custom/images/disk_share.png" width="16" height="16" /><span>分享</span></a>
<a class="disk_document_default" href="javascript:disk_moveFolder()"><img src="${ctx}/custom/images/disk_move.png" width="16" height="16" /><span>移动到</span></a> <a class="disk_document_default" href="javascript:disk_moveFolder()"><img src="${ctx}/custom/images/disk_move.png" width="16" height="16" /><span>移动到</span></a>
<!-- <a class="disk_document_default" href="javascript:disk_enjoyFolder()"><img src="/jfV5portal/custom/images/disk_return.png" width="16" height="16"><span>共享</span></a> -->
<a id="disk_shareCode" href="javascript:disk_shareCode()"><img src="/jfV5portal/custom/images/disk_shareCode.png" width="14" height="14"><span>分享码</span></a>
<a class="disk_rubbishBtn disk_document_default" href="javascript:disk_reductionFolder()"><img src="/jfV5portal/custom/images/disk_return.png" width="16" height="16"><span>还原文件</span></a>
<a class="disk_rubbishBtn disk_document_default" href="javascript:disk_thoroughDeleteFolder()"><img src="/jfV5portal/custom/images/disk_thoroughDelete.png" width="16" height="16"><span>彻底删除</span></a>
<a class="disk_shareCodeBtn disk_document_default" href="javascript:disk_cancelShareCode()"><img src="/jfV5portal/custom/images/disk_cancelShare.png" width="14" height="14"><span>取消分享</span></a>
</div> </div>
<div class="col-md-1"><span onclick="disk_content_toggle(this)" class="disk_content_toggleBtn glyphicon glyphicon-th-large" title="切换到列表模式"></span></div> <div class="col-md-1"><span onclick="disk_content_toggle(this)" class="disk_content_toggleBtn glyphicon glyphicon-th-large" title="切换到列表模式"></span></div>
</div> </div>
...@@ -132,95 +138,91 @@ ...@@ -132,95 +138,91 @@
<!-- end --> <!-- end -->
</div> </div>
</div> </div>
<!-- 回收站 --> <!-- 回收站
<div class="row disk_rubbish" style="display:none;"> <div class="row disk_rubbish" style="display:none;">
回收站 <div class="col-md-12 disk_content_header">
</div> <div class="col-md-11">
<a href="javascript:disk_uploadFolder()"><img src="/jfV5portal/custom/images/disk_return.png" width="16" height="16"><span>还原位置</span></a>
<a href="javascript:disk_addFolder()"><img src="/jfV5portal/custom/images/disk_thoroughDelete.png" width="16" height="16"><span>彻底删除</span></a>
</div>
<div class="col-md-1"><span onclick="disk_content_toggle(this)" class="disk_content_toggleBtn glyphicon glyphicon-th-large" title="切换到列表模式"></span></div>
</div>
</div> -->
</div> </div>
<!-- 普通菜单 -->
<div class="disk_menu" id="disk_menu"> <div class="disk_menu" id="disk_menu">
<ul> <ul>
<li onclick="disk_addFolder(this)" class="disk_menu_noClick disk_menu_noClickBtn">新建文件夹</li> <li onclick="disk_addFolder(this)" class="disk_menu_noClickBtn">新建文件夹</li>
<li onclick="disk_uploadFolder(this)" class="disk_menu_noClick disk_menu_noClickBtn">上传文件</li> <li onclick="disk_uploadFolder(this)" class="disk_menu_noClickBtn">上传文件</li>
<li onclick="disk_enterFolder(this)" class="disk_menu_clickBtn">打开文件夹</li> <li onclick="disk_enterFolder(this)" class="disk_menu_clickBtn">打开文件夹</li>
<li onclick="disk_editFolder(this)" class="disk_menu_clickBtn">重命名</li> <li onclick="disk_editFolder(this)" class="disk_menu_clickBtn">重命名</li>
<li onclick="alert()" class="disk_menu_clickBtn">分享到</li> <li onclick="disk_shareFolder(this)" class="disk_menu_clickBtn">分享</li>
<li onclick="disk_deleteFolder(this)" class="disk_menu_clickBtn">删除</li> <li onclick="disk_deleteFolder(this)" class="disk_menu_clickBtn">删除</li>
<li onclick="disk_downFolder(this)" class="disk_menu_clickBtn">下载</li> <li onclick="disk_downFolder(this)" class="disk_menu_clickBtn">下载</li>
<li onclick="disk_moveFolder(this)" class="disk_menu_clickBtn">移动到</li> <li onclick="disk_moveFolder(this)" class="disk_menu_clickBtn">移动到</li>
<li onclick="disk_enjoyFolder(this)" class="disk_menu_clickBtn">共享</li>
</ul> </ul>
</div> </div>
<%-- <div class="row" style="margin:0px;width:800px;height:400px;padding: 0px;border-radius: 5px;overflow: hidden;"> <!-- 回收站的菜单 -->
<div class="disk_move_title"><span>选择文件上传</span><span onclick="$.fancybox.close()" class="glyphicon glyphicon-remove"></span></div> <div class="disk_menu" id="disk_rubbish_menu">
<div class="disk_upload_content col-md-12"> <ul>
<div class="col-md-6 disk_upload_left_content"> <li onclick="disk_reductionFolder(this)" class="disk_menu_clickBtn">还原文件</li>
<div class="disk_upload_left_content_container"> <li onclick="disk_thoroughDeleteFolder(this)" class="disk_menu_clickBtn">彻底删除</li>
<img src="${ctx}/custom/images/disk_uploadBg.png" width="70" height="60" /> </ul>
<div><span>选择文件上传</span><input type="file" style="display:none;"/></div> </div>
<div>或者将文件拖拽到此处</div>
</div> <!-- 分享码的菜单 -->
<div>可一次选择多个文件</div> <div class="disk_menu" id="disk_shareCode_menu">
</div> <ul>
<div class="col-md-6"> <li onclick="disk_cancelShareCode(this)" class="disk_menu_clickBtn">取消分享</li>
<div class="col-md-12 disk_upload_right_header"> </ul>
<div class="col-md-8">文件名</div> </div>
<div class="col-md-4">文件大小</div>
</div> <%--<div class="row" style="margin:0px;width:468px;height:800px;padding: 0px;border-radius: 5px;overflow: hidden;">
<div class="col-md-12 disk_upload_right_content"> <div class="disk_move_title">分享文件 : <span>我的文件.doc</span><span onclick="$.fancybox.close()" class="glyphicon glyphicon-remove"></span></div>
<div class="col-md-12"> <div class="disk_createShare">
<div class="col-md-8"><span>1.</span><span title="ASP操作手册ASP操作手册ASP操作手册.doc">ASP操作手册ASP操作手册ASP操作手册.doc</span></div> <div class="col-md-12 disk_createShare_content">
<div class="col-md-4"> <div class="col-md-3">分享的形式 : </div>
<span>12KB</span> <div class="col-md-9">
<div class="progress disk_progress" style="display:none;"> <select class="form-control">
<div style='width:50%' class="progress-bar-info progress-bar progress-bar-striped active" role="progressbar" > <option>加密</option>
<!-- 50% --> <option>公开</option>
</div> </select>
</div>
<span class="glyphicon glyphicon-ok" style="display:inline-block;"></span>
<span class="glyphicon glyphicon-pause"></span>
<span class="glyphicon glyphicon-remove"></span>
</div>
</div>
<div class="col-md-12">
<div class="col-md-8"><span>10.</span><span title="ASP操作手册.doc">ASP操作手册.doc</span></div>
<div class="col-md-4">
<span>1024KB</span>
<div class="progress disk_progress">
<div style='width:90%' class="progress-bar-info progress-bar progress-bar-striped active" role="progressbar" >
<!-- 50% -->
</div>
</div>
<span class="glyphicon glyphicon-ok"></span>
<span class="glyphicon glyphicon-pause"></span>
<span class="glyphicon glyphicon-remove"></span>
</div>
</div>
<div class="col-md-12">
<div class="col-md-8"><span>110.</span><span title="ASP操作手册.doc">ASP操作手册.doc</span></div>
<div class="col-md-4">
<span>12KB</span>
<div class="progress disk_progress">
<div style='width:20%' class="progress-bar-info progress-bar progress-bar-striped active" role="progressbar" >
<!-- 50% -->
</div>
</div>
<span class="glyphicon glyphicon-ok"></span>
<span class="glyphicon glyphicon-pause"></span>
<span class="glyphicon glyphicon-remove"></span>
</div>
</div>
</div> </div>
<div class="col-md-12 disk_upload_right_bottom"> </div>
已选择<span>17</span>个文件,共<span>875MB</span> <div class="col-md-12 disk_createShare_content">
<div class="col-md-3">有效期选择 : </div>
<div class="col-md-9">
<select class="form-control">
<option>永久有效</option>
<option>7天</option>
<option>1天</option>
</select>
</div> </div>
</div> </div>
<div class="col-md-12 disk_createShare_btn">
<span onclick="disk_createShare()">创建链接</span><span onclick="$.fancybox.close()">取消</span>
</div>
</div> </div>
<div class="disk_upload_btn col-md-12"> <div class="disk_createShare_after">
<div class="col-md-6"></div> <div class="disk_createShare_after_title"><span class="glyphicon glyphicon-ok"></span><span>分享文件链接创建成功 , </span><span id="disk_createShare_after_time">永久有效</span></div>
<div class="col-md-6"><span>上传</span><span onclick='$.fancybox.close()'>取消</span></div> <div class="col-md-12 disk_createShare_content">
<div class="col-md-3">分享链接 : </div>
<div class="col-md-9">
<input type="text" class="form-control" id="disk_createShare_after_link"/>
</div>
</div>
<div class="col-md-12 disk_createShare_content">
<div class="col-md-3">分享密码 : </div>
<div class="col-md-9">
<div class="col-md-6"><input type="text" class="form-control" id="disk_createShare_after_pwd"/></div>
<div class="col-md-6"><span>复制链接和分享码</span></div>
</div>
</div>
</div> </div>
</div> --%> </div>--%>
<!-- 尾部 --> <!-- 尾部 -->
<jsp:include page="/footer.jsp"></jsp:include> <jsp:include page="/footer.jsp"></jsp:include>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div class="index_search"> <div class="index_search">
<div class="index_search_content"> <div class="index_search_content">
<input type="text" value="大数据搜索引擎" onclick="index_search(this)"/> <input type="text" value="大数据搜索引擎" onclick="index_search(this)"/>
<div class="index_search_img"><img src="${ctx}/custom/images/index4_search.png" height="22"/></div> <div class="index_search_img" onclick="init_index_map($(this).prev().val())"><img src="${ctx}/custom/images/index4_search.png" height="22"/></div>
<div class="index_search_show"> <div class="index_search_show">
<div class="index_search_show_content"> <div class="index_search_show_content">
<div><label>所属区:</label></div> <div><label>所属区:</label></div>
......
...@@ -5,7 +5,7 @@ $(function() { ...@@ -5,7 +5,7 @@ $(function() {
//初始化容器的最小高度 //初始化容器的最小高度
init_index_contaner_minHeight(); init_index_contaner_minHeight();
//初始化块状显示 //初始化块状显示
init_disk_lump(); init_disk_lump();
...@@ -35,13 +35,15 @@ $(function() { ...@@ -35,13 +35,15 @@ $(function() {
//点击容器外时取消选中状态 //点击容器外时取消选中状态
$(document).click(function(e){ $(document).click(function(e){
//console.log($(e.target)) //console.log($(e.target));
//去掉右键的菜单 //去掉右键的菜单
$('#disk_menu').hide(); $('#disk_menu').hide();
$('#disk_rubbish_menu').hide();
$('#disk_shareCode_menu').hide();
//如果不需要取消选中的文件时,或者是fancybox的内容 //如果不需要取消选中的文件时,或者是fancybox的内容,或者是点击了菜单上面的按钮,或者是提示框时
if($(e.target).parents('.fancybox-opened').length==1||$(e.target).hasClass('disk_document_default')||$(e.target).parent().hasClass('disk_document_default')){ if($(e.target).parents('.xcConfirm').length==1||$(e.target).parents('.disk_rubbsh_menu').length==1||$(e.target).parents('.disk_menu').length==1||$(e.target).parents('.fancybox-overlay').length==1||$(e.target).hasClass('disk_document_default')||$(e.target).parent().hasClass('disk_document_default')){
return; return;
} }
...@@ -107,8 +109,6 @@ function init_disk_lump(){ ...@@ -107,8 +109,6 @@ function init_disk_lump(){
var infos = [ var infos = [
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'}, {id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'},
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'}, {id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'},
{id:'uuid3',fileName:'我的文件',fileImg:'disk_module3.png',lastTime:'2018-06-15 12:50',fileType:'folder_myFile',fileSize:'50KB'},
{id:'uuid4',fileName:'我的共享',fileImg:'disk_module4.png',lastTime:'2018-06-13 15:10',fileType:'folder_myShare',fileSize:'5MB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'}, {id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'}, {id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'}, {id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
...@@ -192,18 +192,30 @@ function init_disk_createLump(lump_json){ ...@@ -192,18 +192,30 @@ function init_disk_createLump(lump_json){
$create_content.bind('click',function(){ $create_content.bind('click',function(){
disk_lump_click(this); disk_lump_click(this);
}) })
$create_content.bind('dblclick',function(){
disk_lump_dbClick(this);
})
$create_container.append($create_content); $create_container.append($create_content);
init_disk_select_fileImg(lump_json); init_disk_select_fileImg(lump_json);
var $create_img = $('<img src="'+ctx+'/custom/images/'+lump_json.fileImg+'" />'); var $create_img = $('<img src="'+ctx+'/custom/images/'+lump_json.fileImg+'" />');
var $create_div = $('<div></div>').text(lump_json.fileName); var $create_div = $('<div></div>').text(lump_json.fileName);
$create_div.bind('click',function(){ if($('#disk_rubbish').data('rubbish')){
disk_click_div_edit(this); //如果是回收站时,则鼠标移动到文件名时去掉原来的效果
}) $create_div.hover(function(){
$(this).addClass('disk_rubbish_fileName');
},function(){
$(this).removeClass('disk_rubbish_fileName');
});
}
else{
//如果不是显示回收站的时候
$create_div.bind('click',function(){
disk_click_div_edit(this);
})
$create_content.bind('dblclick',function(){
disk_lump_dbClick(this);
})
}
var $create_input = $('<input type="text" class="form-control"/>').val(lump_json.fileName); var $create_input = $('<input type="text" class="form-control"/>').val(lump_json.fileName);
//输入框失去焦点时 //输入框失去焦点时
$create_input.bind('blur',function(){ $create_input.bind('blur',function(){
...@@ -211,6 +223,7 @@ function init_disk_createLump(lump_json){ ...@@ -211,6 +223,7 @@ function init_disk_createLump(lump_json){
}) })
$create_input.css('display','none'); $create_input.css('display','none');
$create_content.append($create_img).append($create_div).append($create_input); $create_content.append($create_img).append($create_div).append($create_input);
} }
//新建文件夹 //新建文件夹
...@@ -406,7 +419,7 @@ function disk_lump_dbClick(handler){ ...@@ -406,7 +419,7 @@ function disk_lump_dbClick(handler){
//添加目录的导航效果 //添加目录的导航效果
var $search_center = $('.disk_search_center'); var $search_center = $('.disk_search_center');
var $create_a = $('<a href="#"></a>'); var $create_a = $('<a onclick="disk_backFolder(this)"></a>');
var $create_span1 = $('<span></span>').text($(handler).find('div').text()); var $create_span1 = $('<span></span>').text($(handler).find('div').text());
var $create_span2 = $('<span></span>').addClass('glyphicon glyphicon-triangle-right'); var $create_span2 = $('<span></span>').addClass('glyphicon glyphicon-triangle-right');
$create_a.append($create_span1).append($create_span2); $create_a.append($create_span1).append($create_span2);
...@@ -428,20 +441,32 @@ function disk_lump_dbClick(handler){ ...@@ -428,20 +441,32 @@ function disk_lump_dbClick(handler){
//容器的右键效果 //容器的右键效果
function init_disk_contextmenu(){ function init_disk_contextmenu(){
$('.disk_content_lump,.disk_content_list').bind('contextmenu',function(e){ $('.disk_content_lump,.disk_content_list').bind('contextmenu',function(e){
var $disk_menu;
if($('#disk_rubbish').data('rubbish')){
$disk_menu = $('#disk_rubbish_menu');
}
else if($('#disk_shareCode').data('shareCode')){
$disk_menu = $('#disk_shareCode_menu');
}
else{
$disk_menu = $('#disk_menu');
}
//console.log($(e.target)); //console.log($(e.target));
//如果是正在编辑的时候就不做操作 //如果是正在编辑的时候就不做操作
if($(e.target).is('input')){ if($(e.target).is('input')){
return false; return false;
} }
//如果是列表模式时 //如果是列表模式时,或者是分享码的列表时
if($('.disk_content_toggleBtn').data('toggleList')){ if($('.disk_content_toggleBtn').data('toggleList')||$('#disk_shareCode').data('shareCode')){
//点击空白的地方 //点击空白的地方
if($(e.target).hasClass('fixed-table-body')){ if($(e.target).hasClass('fixed-table-body')){
//去掉之前选中的列 //去掉之前选中的列
//$('#disk_content_list').bootstrapTable('uncheckAll'); //$('#disk_content_list').bootstrapTable('uncheckAll');
$('#disk_menu').find('.disk_menu_noClickBtn').removeClass('disk_menu_noClick'); $disk_menu.find('.disk_menu_noClickBtn').removeClass('disk_menu_noClick');
$('#disk_menu').find('.disk_menu_clickBtn').addClass('disk_menu_noClick'); $disk_menu.find('.disk_menu_clickBtn').addClass('disk_menu_noClick');
} }
//点击文件夹 //点击文件夹
else if($(e.target).parents('tbody').length==1){ else if($(e.target).parents('tbody').length==1){
...@@ -451,8 +476,8 @@ function init_disk_contextmenu(){ ...@@ -451,8 +476,8 @@ function init_disk_contextmenu(){
//选中当前的列 //选中当前的列
$('#disk_content_list').bootstrapTable('check',$(e.target).parents('tr').data('index')); $('#disk_content_list').bootstrapTable('check',$(e.target).parents('tr').data('index'));
$('#disk_menu').find('.disk_menu_noClickBtn').addClass('disk_menu_noClick'); $disk_menu.find('.disk_menu_noClickBtn').addClass('disk_menu_noClick');
$('#disk_menu').find('.disk_menu_clickBtn').removeClass('disk_menu_noClick'); $disk_menu.find('.disk_menu_clickBtn').removeClass('disk_menu_noClick');
} }
//点击了分页和table的头部 //点击了分页和table的头部
else if($(e.target).parents('thead').length==1||$(e.target).hasClass('fixed-table-pagination')||$(e.target).parents('.fixed-table-pagination').length==1){ else if($(e.target).parents('thead').length==1||$(e.target).hasClass('fixed-table-pagination')||$(e.target).parents('.fixed-table-pagination').length==1){
...@@ -463,8 +488,8 @@ function init_disk_contextmenu(){ ...@@ -463,8 +488,8 @@ function init_disk_contextmenu(){
else{ else{
//右键时,切换是否可以点击的按钮 //右键时,切换是否可以点击的按钮
if($(e.target).hasClass('disk_content_lump')){ if($(e.target).hasClass('disk_content_lump')){
$('#disk_menu').find('.disk_menu_noClickBtn').removeClass('disk_menu_noClick'); $disk_menu.find('.disk_menu_noClickBtn').removeClass('disk_menu_noClick');
$('#disk_menu').find('.disk_menu_clickBtn').addClass('disk_menu_noClick'); $disk_menu.find('.disk_menu_clickBtn').addClass('disk_menu_noClick');
} }
else{ else{
//先去掉之前选中的 //先去掉之前选中的
...@@ -472,13 +497,13 @@ function init_disk_contextmenu(){ ...@@ -472,13 +497,13 @@ function init_disk_contextmenu(){
//然后给自己加个样式 //然后给自己加个样式
$(e.target).parents('.col-md-2').children('div').addClass('disk_content_lump_click'); $(e.target).parents('.col-md-2').children('div').addClass('disk_content_lump_click');
$('#disk_menu').find('.disk_menu_noClickBtn').addClass('disk_menu_noClick'); $disk_menu.find('.disk_menu_noClickBtn').addClass('disk_menu_noClick');
$('#disk_menu').find('.disk_menu_clickBtn').removeClass('disk_menu_noClick'); $disk_menu.find('.disk_menu_clickBtn').removeClass('disk_menu_noClick');
} }
} }
//显示菜单 //显示菜单
$('#disk_menu').show(); $disk_menu.show();
var e = e || event; var e = e || event;
var scrollTop=document.documentElement.scrollTop||document.body.scrollTop; var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;
...@@ -490,8 +515,8 @@ function init_disk_contextmenu(){ ...@@ -490,8 +515,8 @@ function init_disk_contextmenu(){
var mouse_left = e.clientX; var mouse_left = e.clientX;
var mouse_top= e.clientY; var mouse_top= e.clientY;
//菜单的宽高 //菜单的宽高
var menu_width= $('#disk_menu').outerWidth(true); var menu_width= $disk_menu.outerWidth(true);
var menu_height= $('#disk_menu').outerHeight(true); var menu_height= $disk_menu.outerHeight(true);
//如果右边的超出了 //如果右边的超出了
if(client_width-mouse_left-scrollWidth<menu_width){ if(client_width-mouse_left-scrollWidth<menu_width){
mouse_left = client_width - menu_width - scrollWidth; mouse_left = client_width - menu_width - scrollWidth;
...@@ -504,7 +529,7 @@ function init_disk_contextmenu(){ ...@@ -504,7 +529,7 @@ function init_disk_contextmenu(){
mouse_top = mouse_top + scrollTop; mouse_top = mouse_top + scrollTop;
} }
//当滑动滚动条时也能准确获取菜单位置 //当滑动滚动条时也能准确获取菜单位置
$('#disk_menu').css({'top':mouse_top+"px",'left':mouse_left+"px"}); $disk_menu.css({'top':mouse_top+"px",'left':mouse_left+"px"});
//阻止默认事件 //阻止默认事件
return false; return false;
}) })
...@@ -519,7 +544,7 @@ function disk_deleteFolder(handler){ ...@@ -519,7 +544,7 @@ function disk_deleteFolder(handler){
//如果是列表时 //如果是列表时
if($('.disk_content_toggleBtn').data('toggleList')){ if($('.disk_content_toggleBtn').data('toggleList')){
//如果是块状 //如果是列表
var list_rows = $('#disk_content_list').bootstrapTable('getSelections'); var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
if(list_rows.length==0){ if(list_rows.length==0){
var txt3 = "请选择要删除的文件!!!"; var txt3 = "请选择要删除的文件!!!";
...@@ -545,8 +570,8 @@ function disk_deleteFolder(handler){ ...@@ -545,8 +570,8 @@ function disk_deleteFolder(handler){
} }
else{ else{
//如果是块状时 //如果是块状时
var jsmp_rows = $('.disk_content_lump').find('.disk_content_lump_click'); var lump_rows = $('.disk_content_lump').find('.disk_content_lump_click');
if(jsmp_rows.length==0){ if(lump_rows.length==0){
var txt1 = "请选择要删除的文件!!!"; var txt1 = "请选择要删除的文件!!!";
var option1 = { var option1 = {
title: "提示", title: "提示",
...@@ -559,8 +584,8 @@ function disk_deleteFolder(handler){ ...@@ -559,8 +584,8 @@ function disk_deleteFolder(handler){
var option2 = { var option2 = {
title: "删除提示", title: "删除提示",
onOk: function(){ onOk: function(){
for(var i = 0 ; i < jsmp_rows.length ; i ++){ for(var i = 0 ; i < lump_rows.length ; i ++){
$(jsmp_rows[i]).parent().remove(); $(lump_rows[i]).parent().remove();
} }
} }
} }
...@@ -578,22 +603,34 @@ function disk_content_toggle(handler){ ...@@ -578,22 +603,34 @@ function disk_content_toggle(handler){
$(handler).attr('title','切换到缩略图模式'); $(handler).attr('title','切换到缩略图模式');
$(handler).removeClass('glyphicon-th-large').addClass('glyphicon-th-list'); $(handler).removeClass('glyphicon-th-large').addClass('glyphicon-th-list');
//重新渲染列表 if($('#disk_rubbish').data('rubbish')){
var infos = [ //重新渲染列表
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'}, var infos = [
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'}, {id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid3',fileName:'我的文件',fileImg:'disk_module3.png',lastTime:'2018-06-15 12:50',fileType:'folder_myFile',fileSize:'50KB'}, {id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid4',fileName:'我的共享',fileImg:'disk_module4.png',lastTime:'2018-06-13 15:10',fileType:'folder_myShare',fileSize:'5MB'}, {id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'}, {id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'}, {id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'}, {id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'}, {id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'}
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'}, ]
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'}, init_disk_rubbish_list(infos);
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'} }
] else{
//重新渲染列表
init_disk_list(infos); var infos = [
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'},
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'}
]
init_disk_list(infos);
}
} }
else{ else{
//缩略图形式 //缩略图形式
...@@ -602,7 +639,37 @@ function disk_content_toggle(handler){ ...@@ -602,7 +639,37 @@ function disk_content_toggle(handler){
$(handler).removeClass('glyphicon-th-list').addClass('glyphicon-th-large'); $(handler).removeClass('glyphicon-th-list').addClass('glyphicon-th-large');
//重新渲染块状 //重新渲染块状
if($('#disk_rubbish').data('rubbish')){
var infos = [
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'}
]
}
else{
var infos = [
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'},
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'}
]
}
//先清空容器
$('.disk_content_lump').html('');
//渲染块状
for(var i = 0 ; i<infos.length;i++){
init_disk_createLump(infos[i]);
}
} }
$('.disk_content_lump,.disk_content_list').toggle(); $('.disk_content_lump,.disk_content_list').toggle();
} }
...@@ -612,6 +679,7 @@ function init_disk_list(infos){ ...@@ -612,6 +679,7 @@ function init_disk_list(infos){
for(var i=0;i<infos.length;i++){ for(var i=0;i<infos.length;i++){
init_disk_select_fileImg(infos[i]); init_disk_select_fileImg(infos[i]);
} }
$('#disk_content_list').bootstrapTable('destroy').bootstrapTable({ $('#disk_content_list').bootstrapTable('destroy').bootstrapTable({
/* showColumns:true, /* showColumns:true,
showToggle:true, showToggle:true,
...@@ -709,6 +777,79 @@ function init_disk_list(infos){ ...@@ -709,6 +777,79 @@ function init_disk_list(infos){
}) })
} }
//初始化回收站的列表
function init_disk_rubbish_list(infos){
for(var i=0;i<infos.length;i++){
init_disk_select_fileImg(infos[i]);
}
$('#disk_content_list').bootstrapTable('destroy').bootstrapTable({
/* showColumns:true,
showToggle:true,
showRefresh:true,
search:true, */
/* url: "bootstrap-table/data/data1.json", // 获取表格数据的url */
data:infos,
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
/* striped: true, //表格显示条纹,默认为false */
pagination: false, // 在表格底部显示分页组件,默认false
pageList: [5,10,15,20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码,
uniqueId:'id',
clickToSelect:true,//True to select checkbox or radiobox when the column is clicked.
queryParams:function(params){
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
// limit: params.limit, //页面大小
offset: params.offset, //页码
pageSize:this.pageSize,
pageNumber:this.pageNumber
/* projectId: $("#projectId").val(),
requirement_Id:$("#requirement_Id").val(),
length: 6 */
};
return temp;
},
columns: [
{
checkbox: true, // 显示一个勾选框
align: 'center', // 居中显示
valign: 'middle'
},{
field: 'fileName',
title: '文件名称',
align: 'left',
valign: 'middle',
width:400,
formatter: function (value, row, index) {
return '<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'+ctx+'/custom/images/'+ row.fileImg +'" height="44" ></div><div class="col-md-10"><div style="color:#666;cursor:text;">'+ value +'</div><input type="text" value='+ value +' class="form-control" onblur="disk_input_blur(this)" /></div></div>';
}
}, {
field: 'lastTime',
title: '删除时间',
align: 'center',
valign: 'middle',
order:'asc',
sortable:'true'
}, {
field: 'fileType',
title: '类型',
align: 'center',
valign: 'middle'
},{
field: 'fileSize',
title: '大小',
align: 'center',
valign: 'middle'
}
],
//选中时隐藏菜单
onCheck:function(row){
$('#disk_rubbish_menu').hide();
}
})
}
//修改文件名 //修改文件名
function disk_editFolder(handler){ function disk_editFolder(handler){
//右键删除时,如果是不能点击时 //右键删除时,如果是不能点击时
...@@ -731,8 +872,8 @@ function disk_editFolder(handler){ ...@@ -731,8 +872,8 @@ function disk_editFolder(handler){
} }
else{ else{
//如果是块状时 //如果是块状时
var $jsmp_rows = $('.disk_content_lump').find('.disk_content_lump_click'); var $lump_rows = $('.disk_content_lump').find('.disk_content_lump_click');
disk_click_div_edit($jsmp_rows.find('div')); disk_click_div_edit($lump_rows.find('div'));
} }
} }
...@@ -755,7 +896,7 @@ function disk_list_dbClick(row,handler){ ...@@ -755,7 +896,7 @@ function disk_list_dbClick(row,handler){
//添加目录的导航效果 //添加目录的导航效果
var $search_center = $('.disk_search_center'); var $search_center = $('.disk_search_center');
var $create_a = $('<a href="#"></a>'); var $create_a = $('<a onclick="disk_backFolder(this)"></a>');
var $create_span1 = $('<span></span>').text($(handler).find('.disk_content_list_fileName input').val()); var $create_span1 = $('<span></span>').text($(handler).find('.disk_content_list_fileName input').val());
var $create_span2 = $('<span></span>').addClass('glyphicon glyphicon-triangle-right'); var $create_span2 = $('<span></span>').addClass('glyphicon glyphicon-triangle-right');
$create_a.append($create_span1).append($create_span2); $create_a.append($create_span1).append($create_span2);
...@@ -791,15 +932,15 @@ function disk_enterFolder(handler){ ...@@ -791,15 +932,15 @@ function disk_enterFolder(handler){
} }
else{ else{
//如果是块状时 //如果是块状时
var $jsmp_rows = $('.disk_content_lump').find('.disk_content_lump_click'); var $lump_rows = $('.disk_content_lump').find('.disk_content_lump_click');
disk_lump_dbClick($jsmp_rows); disk_lump_dbClick($lump_rows);
} }
} }
//返回到最开始的展示情况 //返回到最开始的展示情况
function disk_backFolder(handler){ function disk_backFolder(handler){
//如果已经是在最开始的时候就不做操作 //如果已经是最后一个了
if($('.disk_search_center>a').length==1){ if($(handler).next().length==0){
return; return;
} }
//清除之后的a //清除之后的a
...@@ -812,8 +953,6 @@ function disk_backFolder(handler){ ...@@ -812,8 +953,6 @@ function disk_backFolder(handler){
var list_infos = [ var list_infos = [
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'}, {id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'},
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'}, {id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'},
{id:'uuid3',fileName:'我的文件',fileImg:'disk_module3.png',lastTime:'2018-06-15 12:50',fileType:'folder_myFile',fileSize:'50KB'},
{id:'uuid4',fileName:'我的共享',fileImg:'disk_module4.png',lastTime:'2018-06-13 15:10',fileType:'folder_myShare',fileSize:'5MB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'}, {id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'}, {id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'}, {id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
...@@ -831,8 +970,6 @@ function disk_backFolder(handler){ ...@@ -831,8 +970,6 @@ function disk_backFolder(handler){
var lump_infos = [ var lump_infos = [
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'}, {id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'},
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'}, {id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'},
{id:'uuid3',fileName:'我的文件',fileImg:'disk_module3.png',lastTime:'2018-06-15 12:50',fileType:'folder_myFile',fileSize:'50KB'},
{id:'uuid4',fileName:'我的共享',fileImg:'disk_module4.png',lastTime:'2018-06-13 15:10',fileType:'folder_myShare',fileSize:'5MB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'}, {id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'}, {id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'}, {id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
...@@ -860,7 +997,7 @@ function disk_moveFolder(handler){ ...@@ -860,7 +997,7 @@ function disk_moveFolder(handler){
var rows; var rows;
//如果是列表时 //如果是列表时
if($('.disk_content_toggleBtn').data('toggleList')){ if($('.disk_content_toggleBtn').data('toggleList')){
//如果是块状 //如果是列表
rows = $('#disk_content_list').bootstrapTable('getSelections'); rows = $('#disk_content_list').bootstrapTable('getSelections');
} }
else{ else{
...@@ -932,6 +1069,17 @@ function disk_moveFolder_save(){ ...@@ -932,6 +1069,17 @@ function disk_moveFolder_save(){
} }
//选择共享人之后的保存
function disk_enjoyUser_save(){
var treeObj = $.fn.zTree.getZTreeObj("disk_enjoyUser_tree");
var nodes = treeObj.getSelectedNodes();
console.log(nodes)
$.fancybox.close();
//重新渲染显示的内容
}
//初始化文件时移动的目录 //初始化文件时移动的目录
function init_disk_move_tree(rows_data){ function init_disk_move_tree(rows_data){
var ztreeData = [ var ztreeData = [
...@@ -945,13 +1093,7 @@ function init_disk_move_tree(rows_data){ ...@@ -945,13 +1093,7 @@ function init_disk_move_tree(rows_data){
{pid:'A6',id:'A7',name:'我的文件夹5',fileType:'folder'}, {pid:'A6',id:'A7',name:'我的文件夹5',fileType:'folder'},
{pid:'0',id:'B',name:'共享文件',fileType:'folder_share'}, {pid:'0',id:'B',name:'共享文件',fileType:'folder_share'},
{pid:'B',id:'B4',name:'我的文件夹5',fileType:'folder'}, {pid:'B',id:'B4',name:'我的文件夹5',fileType:'folder'},
{pid:'B',id:'B4',name:'我的文件夹6',fileType:'folder'}, {pid:'B',id:'B4',name:'我的文件夹6',fileType:'folder'}
{pid:'0',id:'C',name:'我的文件',fileType:'folder_myFile'},
{pid:'C',id:'C4',name:'我的文件夹7',fileType:'folder'},
{pid:'C',id:'C4',name:'我的文件夹8',fileType:'folder'},
{pid:'0',id:'D',name:'我的共享',fileType:'folder_myShare'},
{pid:'D',id:'D4',name:'我的文件夹7',fileType:'folder'},
{pid:'D',id:'D4',name:'我的文件夹8',fileType:'folder'}
]; ];
for(var i =0;i<ztreeData.length;i++){ for(var i =0;i<ztreeData.length;i++){
...@@ -1005,6 +1147,80 @@ function init_disk_move_tree(rows_data){ ...@@ -1005,6 +1147,80 @@ function init_disk_move_tree(rows_data){
} }
//初始化共享人的树
function init_disk_enjoyUser_tree(rows_data){
var ztreeData = [
{pid:'0',id:'A',name:'技术部',icon:'custom/images/disk_enjoy_users.png'},
{pid:'A',id:'A1',name:'联系人1',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A2',name:'联系人2',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A3',name:'联系人3',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A4',name:'联系人4',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A5',name:'联系人5',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A6',name:'联系人6',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A7',name:'联系人7',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A8',name:'联系人8',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A9',name:'联系人9',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A10',name:'联系人10',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A11',name:'联系人11',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A12',name:'联系人12',icon:'custom/images/disk_enjoy_user.png'}
];
/*for(var i =0;i<ztreeData.length;i++){
init_disk_select_fileImg(ztreeData[i]);
}*/
//还要做一步过滤
//1.把自身及以下文件过滤掉
//2.所有节点不是文件夹的过滤掉
var zTreeObj;
// zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
var setting = {
callback : {
onClick : function(event, treeId, treeNode) {
//$('#' + treeNode.tId).find('.curSelectedNode').removeClass('curSelectedNode');
//如果是父节点时,则取消选中状态,但是要添加一个选中样式
if (treeNode.isParent) {
zTreeObj.cancelSelectedNode(treeNode);
$(event.target).addClass('curSelectedNode');
}
}
},
data : {
simpleData : {
enable : true,
idKey : "id",
pIdKey : "pid",
rootPId : 0
}
},
view : {
nameIsHTML : true,
showTitle : true,
//双击节点时,是否自动展开父节点的标识,true / false 分别表示双击节点 切换 / 不切换 展开状态
dblClickExpand : true,
//点击节点时,按下 Ctrl 或 Cmd 键是否允许取消选择操作。
autoCancelSelected : true,
//是否显示连线
showLine: false
}
};
// zTree 的数据属性,深入使用请参考 API 文档(zTreeNode 节点数据详解)
zTreeObj = $.fn.zTree.init($("#disk_enjoyUser_tree"), setting, ztreeData);
//展开根节点
/*function filter(node) {
return (node.pid == 0);
}
var filter_nodes = zTreeObj.getNodesByFilter(filter); // 查找根节点集合
for (var i = 0; i < filter_nodes.length; i++) {
zTreeObj.expandNode(filter_nodes[i], true, true, true);
}*/
}
//初始化文件的图片 //初始化文件的图片
function init_disk_select_fileImg(ztreeData){ function init_disk_select_fileImg(ztreeData){
if(',jpg,png,jpeg,gif,'.indexOf(','+ ztreeData.fileType +',')==-1){ if(',jpg,png,jpeg,gif,'.indexOf(','+ ztreeData.fileType +',')==-1){
...@@ -1026,7 +1242,7 @@ function init_disk_select_fileImg(ztreeData){ ...@@ -1026,7 +1242,7 @@ function init_disk_select_fileImg(ztreeData){
ztreeData.icon='custom/images/disk_module2_close.png'; ztreeData.icon='custom/images/disk_module2_close.png';
ztreeData.fileImg='disk_module2_close.png'; ztreeData.fileImg='disk_module2_close.png';
break; break;
case 'folder_myFile': /*case 'folder_myFile':
ztreeData.iconOpen='custom/images/disk_module3.png'; ztreeData.iconOpen='custom/images/disk_module3.png';
ztreeData.iconClose='custom/images/disk_module3_close.png'; ztreeData.iconClose='custom/images/disk_module3_close.png';
ztreeData.icon='custom/images/disk_module3_close.png'; ztreeData.icon='custom/images/disk_module3_close.png';
...@@ -1037,7 +1253,7 @@ function init_disk_select_fileImg(ztreeData){ ...@@ -1037,7 +1253,7 @@ function init_disk_select_fileImg(ztreeData){
ztreeData.iconClose='custom/images/disk_module4_close.png'; ztreeData.iconClose='custom/images/disk_module4_close.png';
ztreeData.icon='custom/images/disk_module4_close.png'; ztreeData.icon='custom/images/disk_module4_close.png';
ztreeData.fileImg='disk_module4_close.png'; ztreeData.fileImg='disk_module4_close.png';
break; break;*/
case 'folder': case 'folder':
ztreeData.iconOpen='custom/images/disk_module5.png'; ztreeData.iconOpen='custom/images/disk_module5.png';
ztreeData.iconClose='custom/images/disk_module5_close.png'; ztreeData.iconClose='custom/images/disk_module5_close.png';
...@@ -1075,10 +1291,48 @@ function disk_downFolder(handler){ ...@@ -1075,10 +1291,48 @@ function disk_downFolder(handler){
if(handler&&$(handler).hasClass('disk_menu_noClick')){ if(handler&&$(handler).hasClass('disk_menu_noClick')){
return; return;
} }
//下载文件
$('<a href="https://codeload.github.com/douban/douban-client/legacy.zip/master" download="proposed_file_name">Download</a>')[0].click();
var list_rows;
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
}
else{
//如果是块状时
var list_rows = $('.disk_content_lump').find('.disk_content_lump_click');
}
if(list_rows.length==0){
var txt = "请选择要下载的文件!!!";
var option = {
title: "下载提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.confirm,option);
}
else{
var txt2 = "是否要下载选中的文件!!!";
var option2 = {
title: "下载提示",
onOk: function(){
/*//获得选中的数据
var rows_data = [];
for(var i=0;i<list_rows.length;i++ ){
if($(list_rows[i]).data('lump_data')){
//获得块状的数据
rows_data.push($(list_rows[i]).data('lump_data'));
}
else{
//获得列表的数据
rows_data.push(list_rows[i]);
}
}*/
//下载文件
$('<a href="https://codeload.github.com/douban/douban-client/legacy.zip/master" download="proposed_file_name">Download</a>')[0].click();
}
}
window.wxc.xcConfirm(txt2, window.wxc.xcConfirm.typeEnum.warning,option2);
}
} }
//上传文件的显示 //上传文件的显示
...@@ -1093,12 +1347,12 @@ function disk_uploadFolder(handler){ ...@@ -1093,12 +1347,12 @@ function disk_uploadFolder(handler){
strVar += " <div class=\"disk_move_title\"><span>选择文件上传<\/span><span onclick=\"$.fancybox.close()\" class=\"glyphicon glyphicon-remove\"><\/span><\/div>\n"; strVar += " <div class=\"disk_move_title\"><span>选择文件上传<\/span><span onclick=\"$.fancybox.close()\" class=\"glyphicon glyphicon-remove\"><\/span><\/div>\n";
strVar += " <div class=\"disk_upload_content col-md-12\">\n"; strVar += " <div class=\"disk_upload_content col-md-12\">\n";
strVar += " <div class=\"col-md-6 disk_upload_left_content\">\n"; strVar += " <div class=\"col-md-6 disk_upload_left_content\">\n";
strVar += " <div class=\"disk_upload_left_content_container\">\n"; strVar += " <div class=\"disk_upload_left_content_container\" id=\"disk_upload_drop\" >\n";
strVar += " <img src=\"custom/images/disk_uploadBg.png\" width=\"70\" height=\"60\" />\n"; strVar += " <img src=\"custom/images/disk_uploadBg.png\" width=\"70\" height=\"60\" />\n";
strVar += " <div><span>选择文件上传<\/span><input type=\"file\" style=\"display:none;\"/><\/div>\n"; strVar += " <div><span onclick=\"$(this).next().click()\">选择文件上传<\/span><input onchange=\"disk_upload_file()\" type=\"file\" style=\"display:none;\" multiple=\"multiple\" /><\/div>\n";
strVar += " <div>或者将文件拖拽到此处<\/div>\n"; strVar += " <div>或者将文件拖拽到此处<\/div>\n";
strVar += " <div>可一次选择多个文件<\/div>\n";
strVar += " <\/div>\n"; strVar += " <\/div>\n";
strVar += " <div>可一次选择多个文件<\/div>\n";
strVar += " <\/div>\n"; strVar += " <\/div>\n";
strVar += " <div class=\"col-md-6\">\n"; strVar += " <div class=\"col-md-6\">\n";
strVar += " <div class=\"col-md-12 disk_upload_right_header\">\n"; strVar += " <div class=\"col-md-12 disk_upload_right_header\">\n";
...@@ -1106,7 +1360,7 @@ function disk_uploadFolder(handler){ ...@@ -1106,7 +1360,7 @@ function disk_uploadFolder(handler){
strVar += " <div class=\"col-md-5\">文件大小<\/div>\n"; strVar += " <div class=\"col-md-5\">文件大小<\/div>\n";
strVar += " <\/div>\n"; strVar += " <\/div>\n";
strVar += " <div class=\"col-md-12 disk_upload_right_content\">\n"; strVar += " <div class=\"col-md-12 disk_upload_right_content\">\n";
strVar += " <div class=\"col-md-12\">\n"; /*strVar += " <div class=\"col-md-12\">\n";
strVar += " <div class=\"col-md-7\"><span>1.<\/span><span title=\"ASP操作手册ASP操作手册ASP操作手册.doc\">ASP操作手册ASP操作手册ASP操作手册.doc<\/span><\/div>\n"; strVar += " <div class=\"col-md-7\"><span>1.<\/span><span title=\"ASP操作手册ASP操作手册ASP操作手册.doc\">ASP操作手册ASP操作手册ASP操作手册.doc<\/span><\/div>\n";
strVar += " <div class=\"col-md-5\">\n"; strVar += " <div class=\"col-md-5\">\n";
strVar += " <span>12KB<\/span>\n"; strVar += " <span>12KB<\/span>\n";
...@@ -1147,10 +1401,10 @@ function disk_uploadFolder(handler){ ...@@ -1147,10 +1401,10 @@ function disk_uploadFolder(handler){
strVar += " <span class=\"glyphicon glyphicon-pause\"><\/span>\n"; strVar += " <span class=\"glyphicon glyphicon-pause\"><\/span>\n";
strVar += " <span class=\"glyphicon glyphicon-remove\"><\/span>\n"; strVar += " <span class=\"glyphicon glyphicon-remove\"><\/span>\n";
strVar += " <\/div>\n"; strVar += " <\/div>\n";
strVar += " <\/div>\n"; strVar += " <\/div>\n";*/
strVar += " <\/div>\n"; strVar += " <\/div>\n";
strVar += " <div class=\"col-md-12 disk_upload_right_bottom\">\n"; strVar += " <div class=\"col-md-12 disk_upload_right_bottom\">\n";
strVar += " 已选择<span>17<\/span>个文件,共<span>875MB<\/span>\n"; strVar += " 已选择<span id=\"disk_upload_fileCount\">0<\/span>个文件,共<span id=\"disk_upload_fileSize\">0B<\/span>\n";
strVar += " <\/div>\n"; strVar += " <\/div>\n";
strVar += " <\/div>\n"; strVar += " <\/div>\n";
strVar += " <\/div>\n"; strVar += " <\/div>\n";
...@@ -1172,6 +1426,697 @@ function disk_uploadFolder(handler){ ...@@ -1172,6 +1426,697 @@ function disk_uploadFolder(handler){
} }
}); });
//初始化文件的拖拉上传
init_disk_drop();
}
//初始化文件的拖拉上传
function init_disk_drop(){
var drop_content = $('#disk_upload_drop')[0];
//当被鼠标拖动的对象进入其容器范围内时触发此事件
drop_content.ondragenter = function(event) {
//阻止默认行为
$.jfbrother.preventDefualt();
$(this).css('borderColor','#ccc');
}
//当被鼠标拖动的对象离开其容器范围内时触发此事件
drop_content.ondragleave = function(event) {
//阻止默认行为
$.jfbrother.preventDefualt();
$(this).css('borderColor','#eee');
}
//当某被拖动的对象在另一对象容器范围内拖动时触发此事件
drop_content.ondragover = function(event) {
//阻止默认行为
$.jfbrother.preventDefualt();
$(this).css('borderColor','#ccc');
}
//在一个拖动过程中,释放鼠标键时触发此事件
drop_content.ondrop = function(event) {
$(this).css('borderColor','#eee');
//阻止默认行为
$.jfbrother.preventDefualt();
//拖入的文件必须是外部的,不能使浏览器内的
var files = event.dataTransfer.files;
for(var i=0;i<files.length;i++){
disk_create_uploadList(files[i]);
}
}
} }
//文件的上传
function disk_upload_file(){
var files = event.currentTarget.files;
for(var i=0;i<files.length;i++){
disk_create_uploadList(files[i]);
}
}
//根据一个json来渲染上传文件的列表
function disk_create_uploadList(json_data){
var $contaner = $('<div></div>').addClass('col-md-12');
$contaner.data('upload_data',json_data);
var $contaner_left = $('<div></div>').addClass('col-md-7');
var $contaner_right = $('<div></div>').addClass('col-md-5');
$contaner.append($contaner_left).append($contaner_right);
//索引
var $index_span = $('<span></span>');
var file_index = $('.disk_upload_right_content>div').length+1;
$index_span.text(file_index+'.');
//文件名
var $file_name = $('<span></span>');
$file_name.attr('title',json_data.name);
$file_name.text(json_data.name);
$contaner_left.append($index_span).append($file_name);
//文件大小
var $file_size = $('<span></span>');
$file_size.text($.jfbrother.fileSizeToStr(json_data.size));
$file_size.attr('title',$.jfbrother.fileSizeToStr(json_data.size));
//进度条
var $progress = $('<div></div>').addClass('progress disk_progress');
var $progress_value = $('<div class="progress-bar progress-bar-striped active" role="progressbar"></div>');
$progress_value.css('width','0%');
$progress.append($progress_value);
//ok
var $ok_span = $('<span></span>').addClass('glyphicon glyphicon-ok');
//pause
var $pause_span = $('<span></span>').addClass('glyphicon glyphicon-pause');
$pause_span.bind('click',disk_uploadFile_stop);
//remove
var $remove_span = $('<span></span>').addClass('glyphicon glyphicon-remove');
$remove_span.bind('click',disk_uploadFile_remove);
$contaner_right.append($file_size).append($progress).append($ok_span).append($pause_span).append($remove_span);
$('.disk_upload_right_content').append($contaner);
//计算文件的大小以及个数
$('#disk_upload_fileCount').text(file_index);
var old_size = $('#disk_upload_fileSize').data('old_size') || 0;
var new_size = old_size + json_data.size;
$('#disk_upload_fileSize').text($.jfbrother.fileSizeToStr(new_size));
//把原来的大小存放起来,便于以后的计算
$('#disk_upload_fileSize').data('old_size',new_size);
}
//上传文件的删除
function disk_uploadFile_remove(){
//去掉上传信息
var $container = $(this).parent().parent();
var file_size = $container.data('upload_data').size;
//删除节点之后的所有文件信息的索引都减一
$container.nextAll().each(function(index,element){
var $span_index = $(element).children('div').eq(0).find('span').eq(0);
var index = $span_index.text();
$span_index.text(index.substring(0, index.length-1)-1+'.');
})
$container.remove();
//修改文件个数和大小
$('#disk_upload_fileCount').text($('#disk_upload_fileCount').text()-1);
var old_size = $('#disk_upload_fileSize').data('old_size');
var new_size = old_size-file_size;
$('#disk_upload_fileSize').text($.jfbrother.fileSizeToStr(new_size));
//把原来的大小存放起来,便于以后的计算
$('#disk_upload_fileSize').data('old_size',new_size);
}
//文件上传的暂停和开始
function disk_uploadFile_stop(){
if($(this).hasClass('glyphicon-pause')){
//暂停
}
else{
//开始
}
//进度条的动态效果
$(this).prev().prev().find('.progress-bar').toggleClass('active');
//修改图标
$(this).toggleClass('glyphicon-play');
$(this).toggleClass('glyphicon-pause');
}
//显示回收站
function disk_rubbish(){
//删掉目录导航栏
$('.disk_search_center>a').eq(0).nextAll().remove();
//显示切换按钮
$('.disk_content_toggleBtn').show();
//标记下是否是切换到了回收站
$('#disk_rubbish').data('rubbish',true);
//模拟几条垃圾数据
var infos = [
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'},
]
$('.disk_content_header>div:first-child>a').hide();
$('.disk_rubbishBtn').show();
//如果是列表时,或者是在分享码的列表时
if($('.disk_content_toggleBtn').data('toggleList')||$('#disk_shareCode').data('shareCode')){
//渲染列表
init_disk_rubbish_list(infos);
}
else{
//渲染块状
//先清空容器
$('.disk_content_lump').html('');
//渲染块状
for(var i = 0 ; i<infos.length;i++){
init_disk_createLump(infos[i]);
}
}
}
//还原文件
function disk_reductionFolder(handler){
//右键还原文件时,如果是不能点击时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
if(list_rows.length==0){
var txt3 = "请选择要还原的文件!!!";
var option3 = {
title: "还原提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt3, window.wxc.xcConfirm.typeEnum.confirm,option3);
}
else{
var txt4 = "是否要还原选中的文件!!!";
var option4 = {
title: "还原提示",
onOk: function(){
for(var i = 0; i<list_rows.length;i++){
//根据id来删除行
$('#disk_content_list').bootstrapTable('removeByUniqueId',list_rows[i].id);
//然后做还原操作
}
}
}
window.wxc.xcConfirm(txt4, window.wxc.xcConfirm.typeEnum.warning,option4);
}
}
else{
//如果是块状时
var lump_rows = $('.disk_content_lump').find('.disk_content_lump_click');
if(lump_rows.length==0){
var txt1 = "请选择要还原的文件!!!";
var option1 = {
title: "还原提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt1, window.wxc.xcConfirm.typeEnum.confirm,option1);
}
else{
var txt2 = "是否要还原选中的文件!!!";
var option2 = {
title: "还原提示",
onOk: function(){
//先做删除
for(var i = 0 ; i < lump_rows.length ; i ++){
$(lump_rows[i]).parent().remove();
}
//再还原
}
}
window.wxc.xcConfirm(txt2, window.wxc.xcConfirm.typeEnum.warning,option2);
}
}
}
//彻底删除文件
function disk_thoroughDeleteFolder(handler){
//右键彻底删除文件时,如果是不能点击时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
if(list_rows.length==0){
var txt3 = "请选择要彻底删除的文件!!!";
var option3 = {
title: "彻底删除提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt3, window.wxc.xcConfirm.typeEnum.confirm,option3);
}
else{
var txt4 = "是否要彻底删除选中的文件!!!";
var option4 = {
title: "彻底删除提示",
onOk: function(){
for(var i = 0; i<list_rows.length;i++){
//根据id来删除行
$('#disk_content_list').bootstrapTable('removeByUniqueId',list_rows[i].id);
//然后做彻底删除操作
}
}
}
window.wxc.xcConfirm(txt4, window.wxc.xcConfirm.typeEnum.warning,option4);
}
}
else{
//如果是块状时
var lump_rows = $('.disk_content_lump').find('.disk_content_lump_click');
if(lump_rows.length==0){
var txt1 = "请选择要彻底删除的文件!!!";
var option1 = {
title: "彻底删除提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt1, window.wxc.xcConfirm.typeEnum.confirm,option1);
}
else{
var txt2 = "是否要彻底删除选中的文件!!!";
var option2 = {
title: "彻底删除提示",
onOk: function(){
//先做删除
for(var i = 0 ; i < lump_rows.length ; i ++){
console.log($(lump_rows[i]).data('lump_data'))
$(lump_rows[i]).parent().remove();
}
//再彻底删除
}
}
window.wxc.xcConfirm(txt2, window.wxc.xcConfirm.typeEnum.warning,option2);
}
}
}
//文件的共享
function disk_shareFolder(handler){
//右键分享文件时,如果是不能点击时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
var list_rows;
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
}
else{
//如果是块状时
var list_rows = $('.disk_content_lump').find('.disk_content_lump_click');
}
if(list_rows.length==0){
var txt = "请选择要分享的文件!!!";
var option = {
title: "分享提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.confirm,option);
return;
}
//获得选中的数据
var rows_data = [];
for(var i=0;i<list_rows.length;i++ ){
if($(list_rows[i]).data('lump_data')){
//获得块状的数据
rows_data.push($(list_rows[i]).data('lump_data'));
}
else{
//获得列表的数据
rows_data.push(list_rows[i]);
}
}
console.log(rows_data)
var strVar = "";
strVar += "<div class=\"row\" style=\"margin:0px;width:468px;padding: 0px;border-radius: 5px;overflow: hidden;\">\n";
strVar += " <div class=\"disk_move_title\">分享文件 : <span><\/span><span onclick=\"$.fancybox.close()\" class=\"glyphicon glyphicon-remove\"><\/span><\/div>\n";
strVar += " <div class=\"disk_createShare\">\n";
strVar += " <div class=\"col-md-12 disk_createShare_content\">\n";
strVar += " <div class=\"col-md-3\">分享的形式 : <\/div>\n";
strVar += " <div class=\"col-md-9\">\n";
strVar += " <select class=\"form-control\" id=\"disk_createShare_after_password\">\n";
strVar += " <option value=\"0\">加密<\/option>\n";
strVar += " <option value=\"1\">公开<\/option>\n";
strVar += " <\/select>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"col-md-12 disk_createShare_content\">\n";
strVar += " <div class=\"col-md-3\">有效期选择 : <\/div>\n";
strVar += " <div class=\"col-md-9\">\n";
strVar += " <select class=\"form-control\" id=\"disk_createShare_after_date\">\n";
strVar += " <option>永久有效<\/option>\n";
strVar += " <option>7天<\/option>\n";
strVar += " <option>1天<\/option>\n";
strVar += " <\/select>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"col-md-12 disk_createShare_btn\"> \n";
strVar += " <span onclick=\"disk_createShare()\">创建链接<\/span><span onclick=\"$.fancybox.close()\">取消<\/span>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"disk_createShare_after\">\n";
strVar += " <div class=\"disk_createShare_after_title\"><span class=\"glyphicon glyphicon-ok\"><\/span><span>分享文件链接创建成功 , <\/span><span id=\"disk_createShare_after_time\"><\/span><\/div>\n";
strVar += " <div class=\"col-md-12 disk_createShare_content\">\n";
strVar += " <div class=\"col-md-3\">分享链接 : <\/div>\n";
strVar += " <div class=\"col-md-9\">\n";
strVar += " <input type=\"text\" oninput=\"$(this).val($(this).data('value'));$(this).select()\" onfocus=\"$(this).select();\" class=\"form-control\" id=\"disk_createShare_after_link\"/>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"col-md-12 disk_createShare_content\" style=\"margin-bottom:30px;\">\n";
strVar += " <div class=\"col-md-3\">分享密码 : <\/div>\n";
strVar += " <div class=\"col-md-9\">\n";
strVar += " <div class=\"col-md-6\"><input oninput=\"$(this).val($(this).data('value'));$(this).select()\" onfocus=\"$(this).select();\" type=\"text\" class=\"form-control\" id=\"disk_createShare_after_pwd\"/><\/div>\n";
strVar += " <div class=\"col-md-6\"><span onclick=\"disk_share_copy()\">复制链接和分享码<\/span><\/div>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div id=\"disk_share_copy_message\" style=\"display:none;text-align:center;margin-bottom:0px;\" class=\"col-md-12 alert alert-success\" role=\"alert\">\n";
strVar += " <a href=\"#\" class=\"alert-link\">复制成功<\/a>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += "<\/div>\n";
//分享文件
$.fancybox.open(strVar,{
//显示之前触发
beforeShow : function( instance, current ) {
//去掉fancybox原来的间距
$('.fancybox-skin').css('padding','0');
},
//显示之后触发
afterShow : function( instance, current ){
//隐藏右上角的X
$('.fancybox-close').hide();
}
});
//如果只有一个文件时
if(rows_data.length==1){
$('.disk_move_title>span').eq(0).text(rows_data[0].fileName);
$('.disk_move_title>span').eq(0).attr('title',rows_data[0].fileName);
}
else{
var fileNames = '';
for(var i = 0 ;i<rows_data.length;i++){
fileNames += rows_data[i].fileName + ',';
}
//截取掉最后一个','并且加个总个数
fileNames = fileNames.substring(0, fileNames.length-1) + '(共'+ rows_data.length +'项)';
$('.disk_move_title>span').eq(0).text(fileNames);
$('.disk_move_title>span').eq(0).attr('title',fileNames);
}
}
//创建分享链接
function disk_createShare(){
$('.disk_createShare').hide();
$('.disk_createShare_after').show();
//分享形式
var pwd = $('#disk_createShare_after_password').val();
//有效时间
var time = $('#disk_createShare_after_date').val();
if(time=='永久有效'){
$('#disk_createShare_after_time').text(time);
}
else{
$('#disk_createShare_after_time').text('链接'+time+'后失效');
}
//如果分享为加密时
if($('#disk_createShare_after_password').val()==0){
//随机产生4位的随机数
var rand = $.jfbrother.randomWord(true,4,4);
$('#disk_createShare_after_pwd').val(rand);
}
else{
//如果为公开时
$('#disk_createShare_after_pwd').parent().css('visibility','hidden');
$('#disk_createShare_after_pwd').parent().parent().prev().css('visibility','hidden');
$('#disk_createShare_after_pwd').parent().next().find('span').text('复制链接');
}
//把原来的值存放起来
$('#disk_createShare_after_pwd').data('value',$('#disk_createShare_after_pwd').val());
//链接
var old_href = location.href;
var new_href = old_href.substring(0, old_href.lastIndexOf('/'));
$('#disk_createShare_after_link').val(new_href+'/share');
//把原来的值存放起来
$('#disk_createShare_after_link').data('value',$('#disk_createShare_after_link').val());
}
//分享文件的链接和分享码
function disk_share_copy(){
//要复制的内容
var value;
if($('#disk_createShare_after_pwd').val()==''){
value = '链接 : '+$('#disk_createShare_after_link').val();
}
else{
value ='链接 : '+$('#disk_createShare_after_link').val()+' 密码 : '+$('#disk_createShare_after_pwd').val();
}
//创建一个新的输入框来存放
var oInput = $('<input type="text" />').val(value);
$('body').append(oInput);
//选中对象
oInput.select();
//执行浏览器复制命令
document.execCommand("Copy");
//复制后移除
oInput.remove();
//显示提示
$('#disk_share_copy_message').fadeIn();
//定时关闭了提示
setTimeout(function() {
$('#disk_share_copy_message').fadeOut();
}, 3000)
}
//共享文件
function disk_enjoyFolder(handler){
//右键共享文件时,如果是不能点击时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
var rows;
//如果是列表时
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
rows = $('#disk_content_list').bootstrapTable('getSelections');
}
else{
//如果是块状时
rows = $('.disk_content_lump').find('.disk_content_lump_click');
}
if(rows.length==0){
var txt = "请选择要共享的文件!!!";
var option = {
title: "提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.confirm,option);
return;
}
//获得选中的数据
var rows_data = [];
for(var i=0;i<rows.length;i++ ){
if($(rows[i]).data('lump_data')){
//获得块状的数据
rows_data.push($(rows[i]).data('lump_data'));
}
else{
//获得列表的数据
rows_data.push(rows[i]);
}
}
console.log(rows_data)
var strVar = "";
strVar += "<div style=\"width:268px;padding:0px;border-radius:5px;overflow:hidden;\">\n";
strVar += " <div class=\"disk_move_title\"><span>选择要共享的人<\/span><span onclick=\"$.fancybox.close()\" class=\"glyphicon glyphicon-remove\"><\/span><\/div>\n";
strVar += " <div id=\"disk_enjoyUser_tree\" style=\"height:220px;overflow:auto;\" class=\"ztree disk_move_tree\"><\/div>\n";
strVar += " <div class=\"disk_move_btn\">\n";
strVar += " <span onclick=\"disk_enjoyUser_save()\">确定<\/span><span onclick=\"$.fancybox.close()\">取消<\/span>\n";
strVar += " <\/div>\n";
strVar += "<\/div>\n";
$.fancybox.open(strVar,{
//显示之前触发
beforeShow : function( instance, current ) {
//去掉fancybox原来的间距
/*$('.fancybox-opened').css('width','268px');*/
$('.fancybox-skin').css('padding','0');
},
//显示之后触发
afterShow : function( instance, current ){
//隐藏右上角的X
$('.fancybox-close').hide();
}
});
//初始化文件目录
init_disk_enjoyUser_tree(rows_data);
}
//我的分享码
function disk_shareCode(){
$('#disk_shareCode').data('shareCode',true);
//删掉目录导航栏
$('.disk_search_center>a').eq(0).nextAll().remove();
//隐藏切换视图的功能
$('.disk_content_toggleBtn').hide();
//模拟几条垃圾数据
var infos = [
{id:'uuid1',fileName:'分享文件1',shareTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB',shareCode:'UkN5',shareLink:'http://localhost:8080/jfV5portal/share',activeTime:'永久有效'},
{id:'uuid2',fileName:'分享文件2',shareTime:'2018-06-18 12:10',fileType:'word',fileSize:'2MB',shareCode:'5238',shareLink:'http://localhost:8080/jfV5portal/share',activeTime:'7天后'},
{id:'uuid3',fileName:'分享文件3',shareTime:'2018-06-18 12:10',fileType:'excel',fileSize:'5MB',shareCode:'fsdf',shareLink:'http://localhost:8080/jfV5portal/share',activeTime:'1天后'},
{id:'uuid4',fileName:'分享文件4',shareTime:'2018-06-18 12:10',fileType:'rar',fileSize:'3MB',shareCode:'sd12',shareLink:'http://localhost:8080/jfV5portal/share',activeTime:'永久有效'},
{id:'uuid5',fileName:'分享文件5',shareTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB',shareCode:'tret',shareLink:'http://localhost:8080/jfV5portal/share',activeTime:'永久有效'}
]
//显示取消分享的按钮
$('.disk_content_header>div:first-child>a').hide();
$('.disk_shareCodeBtn').show();
//显示列表
$('.disk_content_list').show();
$('.disk_content_lump').hide();
//渲染列表
init_disk_shareCode_list(infos);
}
//取消分享
function disk_cancelShareCode(handler){
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
if(list_rows.length==0){
var txt3 = "请选择要取消分享的文件!!!";
var option3 = {
title: "取消分享提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt3, window.wxc.xcConfirm.typeEnum.confirm,option3);
}
else{
var txt4 = "是否要取消分享选中的文件!!!";
var option4 = {
title: "取消分享提示",
onOk: function(){
for(var i = 0; i<list_rows.length;i++){
//根据id来删除行
$('#disk_content_list').bootstrapTable('removeByUniqueId',list_rows[i].id);
//然后做取消分享操作
}
}
}
window.wxc.xcConfirm(txt4, window.wxc.xcConfirm.typeEnum.warning,option4);
}
}
//初始化我的分享码的列表
function init_disk_shareCode_list(infos){
for(var i=0;i<infos.length;i++){
init_disk_select_fileImg(infos[i]);
}
$('#disk_content_list').bootstrapTable('destroy').bootstrapTable({
/* showColumns:true,
showToggle:true,
showRefresh:true,
search:true, */
/* url: "bootstrap-table/data/data1.json", // 获取表格数据的url */
data:infos,
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
/* striped: true, //表格显示条纹,默认为false */
pagination: false, // 在表格底部显示分页组件,默认false
pageList: [5,10,15,20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码,
uniqueId:'id',
clickToSelect:true,//True to select checkbox or radiobox when the column is clicked.
queryParams:function(params){
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
// limit: params.limit, //页面大小
offset: params.offset, //页码
pageSize:this.pageSize,
pageNumber:this.pageNumber
/* projectId: $("#projectId").val(),
requirement_Id:$("#requirement_Id").val(),
length: 6 */
};
return temp;
},
columns: [
{
checkbox: true, // 显示一个勾选框
align: 'center', // 居中显示
valign: 'middle'
},{
field: 'fileName',
title: '文件名称',
align: 'left',
valign: 'middle',
width:400,
formatter: function (value, row, index) {
return '<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'+ctx+'/custom/images/'+ row.fileImg +'" height="44" ></div><div class="col-md-10"><div style="color:#666;cursor:text;">'+ value +'</div><input type="text" value='+ value +' class="form-control" onblur="disk_input_blur(this)" /></div></div>';
}
}, {
field: 'shareTime',
title: '分享时间',
align: 'center',
valign: 'middle',
order:'asc',
sortable:'true'
}, {
field: 'fileType',
title: '类型',
align: 'center',
valign: 'middle'
},{
field: 'fileSize',
title: '大小',
align: 'center',
valign: 'middle'
},{
field: 'shareCode',
title: '分享码',
align: 'center',
valign: 'middle'
},{
field: 'shareLink',
title: '分享链接',
align: 'center',
valign: 'middle'
},{
field: 'activeTime',
title: '有效时间',
align: 'center',
valign: 'middle'
}
],
//选中时隐藏菜单
onCheck:function(row){
$('#disk_shareCode_menu').hide();
}
})
}
...@@ -330,7 +330,9 @@ function init_index_search(){ ...@@ -330,7 +330,9 @@ function init_index_search(){
}) })
} }
//初始化地图 //初始化地图
function init_index_map(){ function init_index_map(key){
//先显示加载图片
$('#index_map').prev().show();
/*var map = new BMap.Map("index_map"); /*var map = new BMap.Map("index_map");
map.centerAndZoom(new BMap.Point(116.404, 39.915), 11); map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
map.addControl(new BMap.MapTypeControl({mapTypes: [BMAP_NORMAL_MAP,BMAP_HYBRID_MAP]})); //2D图,卫星图 右上角 map.addControl(new BMap.MapTypeControl({mapTypes: [BMAP_NORMAL_MAP,BMAP_HYBRID_MAP]})); //2D图,卫星图 右上角
...@@ -342,51 +344,32 @@ function init_index_map(){ ...@@ -342,51 +344,32 @@ function init_index_map(){
var geolocation = new BMap.Geolocation(); var geolocation = new BMap.Geolocation();
geolocation.getCurrentPosition(function(r){ geolocation.getCurrentPosition(function(r){
if(this.getStatus() == BMAP_STATUS_SUCCESS){ if(this.getStatus() == BMAP_STATUS_SUCCESS){
var mk = new BMap.Marker(r.point);
map.addOverlay(mk);
/*map.panTo(r.point);//地图中心点移到当前位置*/ /*map.panTo(r.point);//地图中心点移到当前位置*/
/*alert('您的位置:'+r.point.lng+','+r.point.lat);*/ /*alert('您的位置:'+r.point.lng+','+r.point.lat);*/
var point = new BMap.Point(r.point.lng,r.point.lat); var point = new BMap.Point(r.point.lng,r.point.lat);
map.centerAndZoom(point,12); map.centerAndZoom(point,12);
/*map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放*/ /*map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放*/
// 创建地理编码实例 // 创建地理编码实例
var myGeo = new BMap.Geocoder(); var myGeo = new BMap.Geocoder();
// 根据坐标得到地址描述 if(key){
myGeo.getLocation(point, function(result){ // 将地址解析结果显示在地图上,并调整地图视野
if (result){ myGeo.getPoint(key, function(result){
var opts = { point = result;
/*width : 80, // 信息窗口宽度 map.centerAndZoom(point, 12);
height: 50, // 信息窗口高度 */ if(result){
title : "您所在的位置:", // 信息窗口标题 //如果存在时则添加一个标注
height:80 map.addOverlay(new BMap.Marker(point));
}
//创建信息窗口对象
if(result.addressComponents.province==result.addressComponents.city){
var infoWindow = new BMap.InfoWindow(result.addressComponents.province + " - " + result.addressComponents.district +"<div style='float:right;margin-top:30px;color:#1887f6' class='index_map_more'><a href='javascript:window.open(\"http://www.edushi.com/mapcity.html\")'>查看三维地图详情</a></div>", opts);
}
else{
var infoWindow = new BMap.InfoWindow(result.addressComponents.province + " - " + result.addressComponents.city + " - " + result.addressComponents.district +"<div style='float:right;margin-top:30px;color:#1887f6' class='index_map_more'><a href='javascript:window.open(\"http://www.edushi.com/mapcity.html\")'>查看三维地图详情</a></div>", opts);
}
//map.addControl(new BMap.NavigationControl()); //左上角移动控件
map.addControl(new BMap.ScaleControl()); //左下角标尺控件
map.addControl(new BMap.OverviewMapControl()); //右下角缩略地图,注意观察,不然看不到
map.addControl(new BMap.MapTypeControl({mapTypes: [BMAP_NORMAL_MAP,BMAP_HYBRID_MAP]})); //右上角 地图控件
if(result.addressComponents.city=="北京市"||result.addressComponents.city=="上海市"||result.addressComponents.city=="广州市"||result.addressComponents.city=="深圳市"){
map.addControl(new BMap.MapTypeControl({anchor: BMAP_ANCHOR_TOP_LEFT})); //左上角 地图控件
map.setCurrentCity(result.addressComponents.city); //由于有3D图,需要设置城市哦 ,目前支持北京、上海、广州、深圳4个城市3D图
}
else{
map.addControl(new BMap.MapTypeControl({anchor: BMAP_ANCHOR_TOP_LEFT,mapTypes: [BMAP_NORMAL_MAP,BMAP_SATELLITE_MAP,BMAP_HYBRID_MAP]})); //左上角 地图控件
} }
//文字提示
//打开信息窗口 index_show_mapTip(map,myGeo,point);
map.openInfoWindow(infoWindow, map.getCenter()); });
} }
}); else{
var mk = new BMap.Marker(r.point);
map.addOverlay(mk);
//文字提示
index_show_mapTip(map,myGeo,point);
}
} }
else { else {
alert('failed'+this.getStatus()); alert('failed'+this.getStatus());
...@@ -407,6 +390,44 @@ function init_index_map(){ ...@@ -407,6 +390,44 @@ function init_index_map(){
}); });
} }
//显示地图的提示文字
function index_show_mapTip(map,myGeo,point){
// 根据坐标得到地址描述
myGeo.getLocation(point, function(result){
if (result){
var opts = {
width : 80, // 信息窗口宽度
height: 90, // 信息窗口高度
title : "您所在的位置:", // 信息窗口标题
}
//创建信息窗口对象
if(result.addressComponents.province==result.addressComponents.city){
var infoWindow = new BMap.InfoWindow(result.addressComponents.province + " - " + result.addressComponents.district +"<div style='float:right;margin-top:30px;' class='index_map_more'><a style='color:#1887f6' href='javascript:window.open(\"http://www.edushi.com/mapcity.html\")'>查看三维地图详情</a></div>", opts);
}
else{
var infoWindow = new BMap.InfoWindow(result.addressComponents.province + " - " + result.addressComponents.city + " - " + result.addressComponents.district +"<div style='float:right;margin-top:30px;' class='index_map_more'><a style='color:#1887f6' href='javascript:window.open(\"http://www.edushi.com/mapcity.html\")'>查看三维地图详情</a></div>", opts);
}
//map.addControl(new BMap.NavigationControl()); //左上角移动控件
map.addControl(new BMap.ScaleControl()); //左下角标尺控件
map.addControl(new BMap.OverviewMapControl()); //右下角缩略地图,注意观察,不然看不到
map.addControl(new BMap.MapTypeControl({mapTypes: [BMAP_NORMAL_MAP,BMAP_HYBRID_MAP]})); //右上角 地图控件
if(result.addressComponents.city=="北京市"||result.addressComponents.city=="上海市"||result.addressComponents.city=="广州市"||result.addressComponents.city=="深圳市"){
map.addControl(new BMap.MapTypeControl({anchor: BMAP_ANCHOR_TOP_LEFT})); //左上角 地图控件
map.setCurrentCity(result.addressComponents.city); //由于有3D图,需要设置城市哦 ,目前支持北京、上海、广州、深圳4个城市3D图
}
else{
map.addControl(new BMap.MapTypeControl({anchor: BMAP_ANCHOR_TOP_LEFT,mapTypes: [BMAP_NORMAL_MAP,BMAP_SATELLITE_MAP,BMAP_HYBRID_MAP]})); //左上角 地图控件
}
//打开信息窗口
map.openInfoWindow(infoWindow, map.getCenter());
}
});
}
//点击搜索时 //点击搜索时
function index_search(handler){ function index_search(handler){
$('.index_search_content>input').val(''); $('.index_search_content>input').val('');
......
//提交分享码
function share_sendCode(handler){
/*//1.验证分享码过期
var $error_message = $(handler).parent().next();
$error_message.find('a').text('请正确填写分享码');
$error_message.fadeIn();
setTimeout(function() {
$error_message.fadeOut();
}, 3000)*/
//2.跳转到详情
var old_href = location.href;
var new_href = old_href.substring(0, old_href.lastIndexOf('/'));
location.href= new_href +'/shareDetail';
}
\ No newline at end of file
$(function(){
//初始化分享列表
init_shareDetail();
})
//初始化分享列表
function init_shareDetail(){
var list_infos = [
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'},
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'},
{id:'uuid3',fileName:'我的文件',fileImg:'disk_module3.png',lastTime:'2018-06-15 12:50',fileType:'folder_myFile',fileSize:'50KB'},
{id:'uuid4',fileName:'我的共享',fileImg:'disk_module4.png',lastTime:'2018-06-13 15:10',fileType:'folder_myShare',fileSize:'5MB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'}
]
init_shareDetail_list(list_infos);
}
//初始化文件的列表
function init_shareDetail_list(infos){
for(var i=0;i<infos.length;i++){
init_disk_select_fileImg(infos[i]);
}
$('#shareDetail_list').bootstrapTable('destroy').bootstrapTable({
/* showColumns:true,
showToggle:true,
showRefresh:true,
search:true, */
/* url: "bootstrap-table/data/data1.json", // 获取表格数据的url */
data:infos,
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
/* striped: true, //表格显示条纹,默认为false */
pagination: false, // 在表格底部显示分页组件,默认false
pageList: [5,10,15,20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码,
uniqueId:'id',
clickToSelect:true,//True to select checkbox or radiobox when the column is clicked.
queryParams:function(params){
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
// limit: params.limit, //页面大小
offset: params.offset, //页码
pageSize:this.pageSize,
pageNumber:this.pageNumber
/* projectId: $("#projectId").val(),
requirement_Id:$("#requirement_Id").val(),
length: 6 */
};
return temp;
},
columns: [
{
checkbox: true, // 显示一个勾选框
align: 'center', // 居中显示
valign: 'middle'
},{
field: 'fileName',
title: '文件名称',
align: 'left',
valign: 'middle',
formatter: function (value, row, index) {
return '<img style="margin-right:10px;vertical-align:top;" src="'+ctx+'/custom/images/'+ row.fileImg +'" height="44" ><span style="margin-top:12px;display:inline-block;">'+value+'</span>';
}
}, {
field: 'lastTime',
title: '修改时间',
align: 'center',
valign: 'middle',
order:'asc',
sortable:'true'
}, {
field: 'fileType',
title: '类型',
align: 'center',
valign: 'middle'
},{
field: 'fileSize',
title: '大小',
align: 'center',
valign: 'middle'
},{
field: 'ck',
title: '操作',
align: 'center',
valign: 'middle',
formatter: function (value, row, index) {
return '<span class="shareDetail_downLoad" onclick="$.jfbrother.stopPropagation();shareDetail_downLoad(\''+row.id+'\')">下载</span>';
}
}
],
//当用户双击某一行的时候触发
onDblClickRow:function(row, $element){
//根据id重新渲染列表
shareDetail_list_dbClick(row);
}
//
})
}
//双击列表时,根据id重新渲染列表
function shareDetail_list_dbClick(row){
console.log(row)
//添加目录的导航效果
var $search_center = $('.shareDetail_container_mulu');
//如果是第一次双击时
if($search_center.find('span').length==0){
//把全部文件隐藏起来
$search_center.find('label').hide();
//返回上一级
var $prev_span = $('<span></span>').text('返回上一级');
$prev_span.bind('click',function(){
shareDetail_nav_click($search_center.find('.shareDetail_container_mulu_noClick').prev().prev());
})
//竖线
var $shuxian_span = $('<span></span>').text('|').addClass('shareDetail_container_mulu_shuxian');
//全部文件
var $allFiles_span = $('<span></span>').text('全部文件');
$allFiles_span.bind('click',function(){
shareDetail_nav_click($(this));
})
$search_center.append($prev_span).append($shuxian_span).append($allFiles_span);
}
//改变最后添加之前最后一个的样式,并且绑定一个事件
var $noClick_span = $search_center.find('.shareDetail_container_mulu_noClick').removeClass('shareDetail_container_mulu_noClick');
$noClick_span.bind('click',function(){
shareDetail_nav_click($(this));
})
//箭头
var $jiantou_span = $('<span></span>').text('>').addClass('shareDetail_container_mulu_shuxian');
//文件名
var $file_span = $('<span></span>').text(row.fileName).addClass('shareDetail_container_mulu_noClick');
//把文件的id存放起来
$file_span.data('fileId',row.id);
$search_center.append($jiantou_span).append($file_span);
//重新渲染列表,模拟几条数据
var infos = [
{id:'uuid8',fileName:'我的文件1',fileImg:'disk_module5.png',lastTime:'2018-06-19 14:20',fileType:'folder',fileSize:'200KB'},
{id:'uuid9',fileName:'我的文件2',fileImg:'disk_module5.png',lastTime:'2018-06-18 15:50',fileType:'folder',fileSize:'100KB'},
{id:'uuid10',fileName:'我的文件3',fileImg:'disk_module5.png',lastTime:'2018-06-15 12:50',fileType:'folder',fileSize:'50KB'}
]
init_shareDetail_list(infos);
}
//点击文件时
function shareDetail_nav_click(handler){
console.log($(handler).data('fileId'));
var fileId = $(handler).data('fileId');
//要显示的列表
var result_list;
//如果操作的是全部文件时
if(!fileId){
var $all_label = $('.shareDetail_container_mulu>label');
//显示全部文件
$all_label.show();
//去掉之后的所有导航
$all_label.nextAll().remove();
//模拟数据
var result_list = [
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'},
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'},
{id:'uuid3',fileName:'我的文件',fileImg:'disk_module3.png',lastTime:'2018-06-15 12:50',fileType:'folder_myFile',fileSize:'50KB'},
{id:'uuid4',fileName:'我的共享',fileImg:'disk_module4.png',lastTime:'2018-06-13 15:10',fileType:'folder_myShare',fileSize:'5MB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'}
]
}
else{
//去掉点击本身之后的所有导航
$(handler).nextAll().remove();
//并改变自身的样式
$(handler).addClass('shareDetail_container_mulu_noClick');
//解除自身的绑定事件
$(handler).unbind();
//模拟数据
var result_list = [
{id:'uuid8',fileName:'我的文件1',fileImg:'disk_module5.png',lastTime:'2018-06-19 14:20',fileType:'folder',fileSize:'200KB'},
{id:'uuid9',fileName:'我的文件2',fileImg:'disk_module5.png',lastTime:'2018-06-18 15:50',fileType:'folder',fileSize:'100KB'},
{id:'uuid10',fileName:'我的文件3',fileImg:'disk_module5.png',lastTime:'2018-06-15 12:50',fileType:'folder',fileSize:'50KB'}
]
}
//重新渲染列表
init_shareDetail_list(result_list);
}
//初始化文件的图片
function init_disk_select_fileImg(ztreeData){
if(',jpg,png,jpeg,gif,'.indexOf(','+ ztreeData.fileType +',')==-1){
//非图片类型需要判断显示的图片
//iconOpen:文件夹树形结构打开图片
//iconClose:文件夹树形结构关闭图片
//icon:文件夹树形结构叶子图片
//fileImg:桌面显示图片
switch (ztreeData.fileType) {
case 'folder_company':
ztreeData.iconOpen='custom/images/disk_module1.png';
ztreeData.iconClose='custom/images/disk_module1_close.png';
ztreeData.icon='custom/images/disk_module1_close.png';
ztreeData.fileImg='disk_module1_close.png';
break;
case 'folder_share':
ztreeData.iconOpen='custom/images/disk_module2.png';
ztreeData.iconClose='custom/images/disk_module2_close.png';
ztreeData.icon='custom/images/disk_module2_close.png';
ztreeData.fileImg='disk_module2_close.png';
break;
case 'folder_myFile':
ztreeData.iconOpen='custom/images/disk_module3.png';
ztreeData.iconClose='custom/images/disk_module3_close.png';
ztreeData.icon='custom/images/disk_module3_close.png';
ztreeData.fileImg='disk_module3_close.png';
break;
case 'folder_myShare':
ztreeData.iconOpen='custom/images/disk_module4.png';
ztreeData.iconClose='custom/images/disk_module4_close.png';
ztreeData.icon='custom/images/disk_module4_close.png';
ztreeData.fileImg='disk_module4_close.png';
break;
case 'folder':
ztreeData.iconOpen='custom/images/disk_module5.png';
ztreeData.iconClose='custom/images/disk_module5_close.png';
ztreeData.icon='custom/images/disk_module5_close.png';
ztreeData.fileImg='disk_module5_close.png';
break;
case 'rar':
ztreeData.fileImg='disk_rar.png';
break;
case 'txt':
ztreeData.fileImg='disk_unknow.png';
break;
case 'ppt':
ztreeData.fileImg='disk_ppt.png';
break;
case 'pdf':
ztreeData.fileImg=='disk_pdf.png';
break;
case 'excel':
ztreeData.fileImg='disk_excel.png';
break;
case 'word':
ztreeData.fileImg='disk_word.png';
break;
default:
ztreeData.fileImg='disk_unknow.png';
break;
}
}
}
//取消分享
function shareDetail_cancelShare(){
var list_rows = $('#shareDetail_list').bootstrapTable('getSelections');
if(list_rows.length==0){
var txt3 = "请选择要取消分享的文件!!!";
var option3 = {
title: "取消分享提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt3, window.wxc.xcConfirm.typeEnum.confirm,option3);
}
else{
var txt4 = "是否要取消分享选中的文件!!!";
var option4 = {
title: "取消分享提示",
onOk: function(){
for(var i = 0; i<list_rows.length;i++){
//根据id来删除行
$('#shareDetail_list').bootstrapTable('removeByUniqueId',list_rows[i].id);
//然后做取消分享操作
}
}
}
window.wxc.xcConfirm(txt4, window.wxc.xcConfirm.typeEnum.warning,option4);
}
}
//下载
function shareDetail_downLoad(id){
var list_rows;
var txt4 = "是否要下载选中的文件!!!";
if(id){
list_rows = $('#shareDetail_list').bootstrapTable('getRowByUniqueId',id);
txt4="是否要下载该文件!!!";
}
else{
list_rows = $('#shareDetail_list').bootstrapTable('getSelections');
}
if(list_rows.length==0){
var txt3 = "请选择要下载的文件!!!";
var option3 = {
title: "下载提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt3, window.wxc.xcConfirm.typeEnum.confirm,option3);
}
else{
/*var txt4 = "是否要下载选中的文件!!!";*/
var option4 = {
title: "下载提示",
onOk: function(){
window.open('https://codeload.github.com/douban/douban-client/legacy.zip/master');
}
}
window.wxc.xcConfirm(txt4, window.wxc.xcConfirm.typeEnum.warning,option4);
}
}
...@@ -139,7 +139,7 @@ a{ ...@@ -139,7 +139,7 @@ a{
text-align:center; text-align:center;
color:white; color:white;
line-height: 40px; line-height: 40px;
border-radius: 20px; border-radius:5px;
margin:0 auto 13px; margin:0 auto 13px;
} }
.login_item_login:hover{ .login_item_login:hover{
...@@ -282,7 +282,7 @@ form input:focus{ ...@@ -282,7 +282,7 @@ form input:focus{
<p>Powered By © 2014-<%=jt.now_year() %> www.jfbrother.com </p> <p>Powered By © 2014-<%=jt.now_year() %> www.jfbrother.com </p>
</div> </div>
<div class="footer_links"> <div class="footer_links">
<p>建议使用IE8.0及以上版本浏览器/现代浏览器访问本站</p> <p>建议使用IE9.0及以上版本浏览器/现代浏览器访问本站</p>
</div> </div>
</div> </div>
</div> </div>
......
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
<title>分享</title>
<jsp:include page="header.jsp"></jsp:include>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/portlet/js/jwAppPortletModule.js" charset="utf-8"></script>
<script src="${ctx}/jfcas04/js/share.js"></script>
</head>
<body style="width:100%;background:#E8F6FF">
<!-- 头部 -->
<div class="share_cotainer">
<div class="share_cotainer_header">
<img src="${ctx}/custom/images/share_user.png" width="44" height="44"/><span>薛博文</span><span>向你分享了文件</span>
</div>
<div class="share_cotainer_code">
<div>请输入分享码 : </div>
<div><input type="text" class="form-control"/></div>
<div onclick="share_sendCode(this)">提交分享码</div>
</div>
<div style="text-align: center;margin-bottom: 0px;display: none;" class="alert alert-danger" role="alert">
<a href="#" class="alert-link">分享码已过期</a>
</div>
</div>
<div class="share_clound" style="background:url(${ctx}/custom/images/share_bg.png);"></div>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
<title>分享</title>
<jsp:include page="header.jsp"></jsp:include>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/portlet/js/jwAppPortletModule.js" charset="utf-8"></script>
<script src="${ctx}/jfcas04/js/shareDetail.js"></script>
</head>
<body style="padding:30px;background:#EDF1F5;width:100%;">
<div class="shareDetail_container">
<div class="shareDetail_container_header">
<img src="${ctx}/custom/images/disk_rar.png" width="26" height="26" />
<label>新建文件夹等</label>
<span onclick="shareDetail_downLoad()"><i class="glyphicon glyphicon-download-alt"></i>下载</span>
<span onclick="shareDetail_cancelShare()"><i class="glyphicon glyphicon-ban-circle"></i>取消分享</span>
</div>
<div class="shareDetail_container_time">
<span class="glyphicon glyphicon-time"></span><span>2018-07-06 10:14</span><span>失效时间 : 永久有效</span>
</div>
<div class="shareDetail_container_mulu">
<label>全部文件</label>
<!-- <span>返回上一级</span>
<span class="shareDetail_container_mulu_shuxian">|</span>
<span>全部文件</span>
<span class="shareDetail_container_mulu_shuxian">></span>
<span>新建文件夹</span> -->
</div>
<div class="disk_table shareDetail_table">
<table id="shareDetail_list"></table>
</div>
</div>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html> <html>
<head> <head>
<title>首页</title> <title>首页</title>
</head> </head>
<body> <body style="margin:0;padding:0;">
<!-- 头部 --> <!-- 头部 -->
<div style="background:url(${ctx}/custom/images/index2_img.jpg)"></div> <img src="${ctx}/custom/images/index2_img.jpg" />
</body> </body>
</html> </html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html> <html>
<head> <head>
<title>首页</title> <title>首页</title>
</head> </head>
<body> <body style="margin:0;padding:0;">
<!-- 头部 --> <!-- 头部 -->
首页3 <img src="${ctx}/custom/images/index3_img.jpg" />
</body> </body>
</html> </html>
...@@ -70,8 +70,16 @@ ...@@ -70,8 +70,16 @@
method="disk"> method="disk">
<result name="disk">/jfcas04/disk.jsp</result> <result name="disk">/jfcas04/disk.jsp</result>
</action> </action>
<!-- 分享 -->
<action name="share" class="com.jw.app.portlet.action.viewAction"
method="share">
<result name="share">/jfcas04/share.jsp</result>
</action>
<!-- 分享 -->
<action name="shareDetail" class="com.jw.app.portlet.action.viewAction"
method="shareDetail">
<result name="shareDetail">/jfcas04/shareDetail.jsp</result>
</action>
</package> </package>
<package name="caslogin" extends="struts-default,json-default"> <package name="caslogin" extends="struts-default,json-default">
<action name="jfcas" class="com.gaowj.system.login.CasAction"> <action name="jfcas" class="com.gaowj.system.login.CasAction">
......
...@@ -45,4 +45,12 @@ public class viewAction extends BasicAction { ...@@ -45,4 +45,12 @@ public class viewAction extends BasicAction {
return "disk"; return "disk";
} }
public String share() throws BusinessException {
return "share";
}
public String shareDetail() throws BusinessException {
return "shareDetail";
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment