Commit bafcb65c by 周添尉

网盘的共享

parent 8e4486a4
...@@ -996,6 +996,7 @@ a{ ...@@ -996,6 +996,7 @@ a{
text-align: center; text-align: center;
padding-top:22px; padding-top:22px;
cursor: pointer; cursor: pointer;
padding-bottom: 25px;
} }
.disk_content_header>div:first-child span{ .disk_content_header>div:first-child span{
margin:0 15px 0 5px; margin:0 15px 0 5px;
...@@ -1162,6 +1163,35 @@ a{ ...@@ -1162,6 +1163,35 @@ a{
font-size:16px; font-size:16px;
margin-right:-1px; margin-right:-1px;
} }
.disk_move_search{
margin: 10px 5px 3px;
}
.disk_move_search>input{
outline:none;
border:1px solid #f2f2f2;
border-radius: 4px;
height: 30px;
line-height: 28px;
padding-left:6px;
color:#bbb;
width:70%;
}
.disk_move_search>span{
border:1px solid #f2f2f2;
height: 30px;
line-height: 28px;
color:#333;
display: inline-block;
width:25%;
margin-left:5%;
vertical-align: bottom;
text-align:center;
cursor: pointer;
border-radius: 4px;
}
.disk_move_search>span:hover{
background: #f3f3f3;
}
.disk_move_btn{ .disk_move_btn{
height:40px; height:40px;
line-height:40px; line-height:40px;
...@@ -1386,7 +1416,7 @@ a{ ...@@ -1386,7 +1416,7 @@ a{
color:#333; color:#333;
border-top: 1px solid #f3f0f0; border-top: 1px solid #f3f0f0;
} }
.disk_rubbishBtn,.disk_shareCodeBtn{ .disk_rubbishBtn,.disk_shareCodeBtn,.disk_enjoyBtn{
display: none; display: none;
} }
.disk_createShare{ .disk_createShare{
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
<jsp:include page="header.jsp"></jsp:include> <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 type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/portlet/js/jwAppPortletModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/storepersonal/js/storePersonalModule.js" charset="utf-8"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/storepersonal/js/storePersonalModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/store/js/storeModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/storeshare/js/storeShareModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/user/js/jwAppUserModule.js" charset="utf-8"></script>
<script src="${ctx}/jfcas04/js/disk.js"></script> <script src="${ctx}/jfcas04/js/disk.js"></script>
</head> </head>
<body> <body>
...@@ -16,13 +19,13 @@ ...@@ -16,13 +19,13 @@
<!-- 内容部分 --> <!-- 内容部分 -->
<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-2">
<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-6" onclick="location.href='disk'"><img src="${ctx}/custom/images/disk_home.png" wdith="14" height="14" /><span>|</span></div>
<div class="col-md-3" id="disk_backFolder_prev" onclick="disk_backFolder_prev(this)"><img src="${ctx}/custom/images/disk_last.png" wdith="14" height="14" /><span>|</span></div> <%-- <div class="col-md-3" id="disk_backFolder_prev" onclick="disk_backFolder_prev(this)"><img src="${ctx}/custom/images/disk_last.png" wdith="14" height="14" /><span>|</span></div>
<div class="col-md-3" id="disk_backFolder_next" onclick="disk_backFolder_next(this)"><img src="${ctx}/custom/images/disk_next.png" wdith="14" height="14" /><span>|</span></div> <div class="col-md-3" id="disk_backFolder_next" onclick="disk_backFolder_next(this)"><img src="${ctx}/custom/images/disk_next.png" wdith="14" height="14" /><span>|</span></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 id="disk_rubbish" class="col-md-6" 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-7">
<div class="disk_search_center"> <div class="disk_search_center">
<a href="disk"><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> --> <!-- <a onclick="disk_backFolder(this)"><span class="glyphicon glyphicon-folder-close"></span><span>我的网盘</span><span class="glyphicon glyphicon-triangle-right"></span></a> -->
...@@ -50,6 +53,7 @@ ...@@ -50,6 +53,7 @@
<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_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_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> <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>
<a class="disk_enjoyBtn disk_document_default" href="javascript:disk_cancelEnjoy()"><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>
...@@ -163,6 +167,7 @@ ...@@ -163,6 +167,7 @@
<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> <li onclick="disk_enjoyFolder(this)" class="disk_menu_clickBtn">共享</li>
<li onclick="disk_cancelEnjoy(this)" class="disk_menu_clickBtn" style="display:none;">取消共享</li>
</ul> </ul>
</div> </div>
......
$(function() { $(function() {
/*for(var i =1;i<=9;i++){
var str = "";
for(var j = 1;j<=i;j++){
str = str + (j + '*' + i + '=' + (i*j)) + ' ';
}
console.log(str)
}*/
//去掉尾部的一个div //去掉尾部的一个div
$('.index_footer').next().remove(); $('.index_footer').next().remove();
...@@ -227,7 +235,7 @@ function disk_click_div_edit(handler){ ...@@ -227,7 +235,7 @@ function disk_click_div_edit(handler){
var lump_data = $(handler).parent().data('lump_data'); var lump_data = $(handler).parent().data('lump_data');
if($(handler).parent().hasClass('disk_content_lump_click')){ if($(handler).parent().hasClass('disk_content_lump_click')){
//如果是公司文件或者是共享文件时,则不做编辑操作,直接是双击点击去的效果 //如果是公司文件或者是共享文件时,则不做编辑操作,直接是双击点击去的效果
if(lump_data.FILE_TYPE=='folder_company'||lump_data.FILE_TYPE=='folder_share'){ if(lump_data.apiIndex=='1'||lump_data.apiIndex=='2'){
disk_lump_dbClick($(handler).parent()); disk_lump_dbClick($(handler).parent());
} }
else{ else{
...@@ -255,6 +263,7 @@ function disk_input_blur(handler){ ...@@ -255,6 +263,7 @@ function disk_input_blur(handler){
disk_find_folder($(handler),input_val); disk_find_folder($(handler),input_val);
var count = $(handler).data('count'); var count = $(handler).data('count');
count==0?input_val=input_val:input_val=input_val+'('+ count +')'; count==0?input_val=input_val:input_val=input_val+'('+ count +')';
//给input和div赋值
$(handler).prev().show().text(input_val); $(handler).prev().show().text(input_val);
$(handler).val(input_val) $(handler).val(input_val)
//如果值存在那就表示是修改操作,否则是添加操作 //如果值存在那就表示是修改操作,否则是添加操作
...@@ -266,8 +275,7 @@ function disk_input_blur(handler){ ...@@ -266,8 +275,7 @@ function disk_input_blur(handler){
FIELD_UUID:lump_data.UUID, FIELD_UUID:lump_data.UUID,
FIELD_FILE_NAME:input_val, FIELD_FILE_NAME:input_val,
FIELD_FATHER_ID:lump_data.FATHER_ID, FIELD_FATHER_ID:lump_data.FATHER_ID,
FIELD_ISFILE:lump_data.ISFILE, FIELD_ISFILE:lump_data.ISFILE
FIELD_OLD_FILE_NAME:lump_data.FILE_NAME
}); });
} }
else{ else{
...@@ -361,6 +369,7 @@ function disk_lump_click(handler){ ...@@ -361,6 +369,7 @@ function disk_lump_click(handler){
function disk_lump_dbClick(handler){ function disk_lump_dbClick(handler){
//文件的数据 //文件的数据
var lump_data = $(handler).data('lump_data'); var lump_data = $(handler).data('lump_data');
//console.log(lump_data)
//重新渲染块状 //重新渲染块状
disk_dbClick_custom($(handler).find('input'),lump_data,function(infos){ disk_dbClick_custom($(handler).find('input'),lump_data,function(infos){
//先清空容器 //先清空容器
...@@ -375,12 +384,38 @@ function disk_lump_dbClick(handler){ ...@@ -375,12 +384,38 @@ function disk_lump_dbClick(handler){
var $disk_content_lump = $('.disk_content_lump'); var $disk_content_lump = $('.disk_content_lump');
var $no_file_content = $('<div></div>').addClass('disk_content_lump_noFile'); var $no_file_content = $('<div></div>').addClass('disk_content_lump_noFile');
var $no_file_img = $('<img src='+ctx+'/custom/images/disk_lump_noFile.png width="131" height="116" />'); var $no_file_img = $('<img src='+ctx+'/custom/images/disk_lump_noFile.png width="131" height="116" />');
var $no_file_text = $('<p></p>').text('超大空间等你来填满,快来上传吧~'); var $no_file_text;
var $no_file_btn = $('<p><span onclick="disk_uploadFolder()">上传文件</span></p>'); var $no_file_btn;
//如果是公司文件时
if(lump_data.apiIndex=='1'){
$no_file_text = $('<p></p>').text('暂无数据~');
}
//如果是共享文件时
else if(lump_data.apiIndex=='2'){
$no_file_text = $('<p></p>').text('暂无共享数据~');
}
//如果为普通文件时
else{
$no_file_text = $('<p></p>').text('超大空间等你来填满,快来上传吧~');
$no_file_btn = $('<p><span onclick="disk_uploadFolder()">上传文件</span></p>');
}
$disk_content_lump.append($no_file_content); $disk_content_lump.append($no_file_content);
$no_file_content.append($no_file_img).append($no_file_text).append($no_file_btn); $no_file_content.append($no_file_img).append($no_file_text).append($no_file_btn);
} }
}); });
//如果是公司文件时,则隐藏所有的按钮
if(lump_data.FILE_TYPE=='folder_company'){
$('.disk_content_header>div:first-child>a').hide();
//显示下载按钮
$('.disk_content_header>div:first-child>a').eq(1).show();
}
else if(lump_data.FILE_TYPE=='folder_share'){
//显示取消共享的按钮
$('.disk_content_header>div:first-child>a').hide();
$('.disk_enjoyBtn').show();
}
} }
//把自身的uuid当做parentId来查找下面的子目录,不穿则表示查找跟节点,获得的可以是回收站可以是正常文件delete_flag 1为回收站的文件,0是正常文件 //把自身的uuid当做parentId来查找下面的子目录,不穿则表示查找跟节点,获得的可以是回收站可以是正常文件delete_flag 1为回收站的文件,0是正常文件
...@@ -388,7 +423,7 @@ function init_disk_infos(delete_flag,lump_data){ ...@@ -388,7 +423,7 @@ function init_disk_infos(delete_flag,lump_data){
var infos; var infos;
//如果没传入值,表示是查找根目录 //如果没传入值,表示是查找根目录
if(!lump_data){ if(!lump_data){
infos = storePersonalModule.storePersonalDataAction.list_storePersonalnofile().rowSet; infos = storePersonalModule.storePersonalDataAction.listAll_storePersonalnofile().rowSet;
var results = []; var results = [];
//把重复的parentId!=A的过滤掉,以及带有删除标识的判断下 //把重复的parentId!=A的过滤掉,以及带有删除标识的判断下
for( var i = 0 ; i < infos.length ; i ++){ for( var i = 0 ; i < infos.length ; i ++){
...@@ -403,38 +438,94 @@ function init_disk_infos(delete_flag,lump_data){ ...@@ -403,38 +438,94 @@ function init_disk_infos(delete_flag,lump_data){
} }
} }
} }
//做个一个标识,来标识是要调用哪个api
for(var i = 0 ; i < results.length;i++ ){
results[i].apiIndex = '0';
}
if(delete_flag=='0'){ if(delete_flag=='0'){
//把公司文件和共享文件写死 //把公司文件和共享文件写死
var default_infos = [ var default_infos = [
{UUID:'A',FILE_NAME:'公司文件',UPDATE_TIME:'',FILE_TYPE:'folder_company',FILE_SIZE:0}, {UUID:'B',FILE_NAME:'公司文件',UPDATE_TIME:'',FILE_TYPE:'folder_company',FILE_SIZE:0,apiIndex:'1'},
{UUID:'B',FILE_NAME:'共享文件',UPDATE_TIME:'',FILE_TYPE:'folder_share',FILE_SIZE:0}, {UUID:'C',FILE_NAME:'共享文件',UPDATE_TIME:'',FILE_TYPE:'folder_share',FILE_SIZE:0,apiIndex:'2'},
]; ];
results = default_infos.concat(results); results = default_infos.concat(results);
} }
return results; return results;
} }
if(lump_data.FILE_TYPE=="folder_company"){ if(lump_data.apiIndex=='1'){
//如果是公司文件时 //如果uuid==B的时候为根节点
console.log(lump_data) if(lump_data.UUID=='B'){
infos = storeModule.storeDataAction.list_storenofile().rowSet;
}
//否则为其子节点
else{
infos = storeModule.storeDataAction.list_storenofile({
FIELD_FATHER_ID:lump_data.UUID
}).rowSet;
}
//做个一个标识,来标识是要调用哪个api
for(var i = 0 ; i < infos.length;i++ ){
infos[i].apiIndex = '1';
} }
else if(lump_data.FILE_TYPE=="folder_share"){ }
else if(lump_data.apiIndex=='2'){
//如果是共享文件时 //如果是共享文件时
alert(2) //如果uuid==C的时候为根节点
if(lump_data.UUID=='C'){
infos = [];
var storeShare_list = storeShareModule.storeShareDataAction.list().rowSet;
//先获得共享的数据,再根据FILE_UUID去查找普通文件信息
for(var i = 0 ; i < storeShare_list.length;i++ ){
var v_query = {} ;
v_query.FIELD_UUID=storeShare_list[i].FILE_UUID;
var result_storeShare_list = storePersonalModule.storePersonalDataAction.listAll_storePersonalnofile(v_query).rowSet;
//把共享中的FILE_UUID,CREATE_NAME,CREATOR_ID,SHARE_ID,SHARE_NAME,SHARE_TIME保留下来
result_storeShare_list[0].FILE_UUID = storeShare_list[i].UUID;
result_storeShare_list[0].CREATE_NAME = storeShare_list[i].CREATE_NAME;
result_storeShare_list[0].CREATOR_ID = storeShare_list[i].CREATOR_ID;
result_storeShare_list[0].SHARE_ID = storeShare_list[i].SHARE_ID;
result_storeShare_list[0].SHARE_NAME = storeShare_list[i].SHARE_NAME;
result_storeShare_list[0].SHARE_TIME = storeShare_list[i].SHARE_TIME;
infos.push(result_storeShare_list[0]);
}
}
else{
infos = storePersonalModule.storePersonalDataAction.listAll_storePersonalnofile({
FIELD_FATHER_ID:lump_data.UUID
}).rowSet;
//遍历下给每个数据加上共享信息
for(var i = 0;i<infos.length;i++){
//用索引i来区别下,不然会出现同一个FILE_UUID
infos[i].FILE_UUID=lump_data.FILE_UUID + i ;
infos[i].CREATE_NAME=lump_data.CREATE_NAME;
infos[i].CREATOR_ID=lump_data.CREATOR_ID;
infos[i].SHARE_ID=lump_data.SHARE_ID;
infos[i].SHARE_NAME=lump_data.SHARE_NAME;
infos[i].SHARE_TIME=lump_data.SHARE_TIME;
}
}
//做个一个标识,来标识是要调用哪个api
for(var i = 0 ; i < infos.length;i++ ){
infos[i].apiIndex = '2';
}
} }
else{ else{
//如果是普通文件时 //如果是普通文件时
infos = storePersonalModule.storePersonalDataAction.list_storePersonalnofile({ infos = storePersonalModule.storePersonalDataAction.listAll_storePersonalnofile({
FIELD_FATHER_ID:lump_data.UUID FIELD_FATHER_ID:lump_data.UUID
}).rowSet; }).rowSet;
//把删除后的文件去掉 //把删除后的文件去掉
for( var i = 0 ; i < infos.length ; i ++){ for( var i = 0 ; i < infos.length ; i ++){
if(infos[i].DELETE_FLAG!=delete_flag){ if(infos[i].DELETE_FLAG!=delete_flag){
infos.splice(i,1); infos.splice(i,1);
//做个一个标识,来标识是要调用哪个api
infos[i].apiIndex = '0';
} }
} }
} }
return infos; return infos;
} }
...@@ -443,6 +534,7 @@ function init_disk_contextmenu(){ ...@@ -443,6 +534,7 @@ 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; var $disk_menu;
var lump_data;
if($('#disk_rubbish').data('rubbish')){ if($('#disk_rubbish').data('rubbish')){
$disk_menu = $('#disk_rubbish_menu'); $disk_menu = $('#disk_rubbish_menu');
} }
...@@ -465,8 +557,10 @@ function init_disk_contextmenu(){ ...@@ -465,8 +557,10 @@ function init_disk_contextmenu(){
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'); var a_length = $('.disk_search_center>a').eq(1).length;
$disk_menu.find('.disk_menu_clickBtn').addClass('disk_menu_noClick'); if(a_length!=0){
lump_data = $('.disk_search_center>a').eq(1).data('lump_data');
}
} }
//点击文件夹 //点击文件夹
else if($(e.target).parents('tbody').length==1){ else if($(e.target).parents('tbody').length==1){
...@@ -475,9 +569,7 @@ function init_disk_contextmenu(){ ...@@ -475,9 +569,7 @@ 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'));
var lump_data = $(e.target).parents('tr').find('.disk_content_list_fileName>div').eq(1).data('lump_data'); lump_data = $(e.target).parents('tr').find('.disk_content_list_fileName>div').eq(1).data('lump_data');
//菜单的显示
init_disk_menu_toggle($disk_menu,lump_data);
} }
//点击了分页和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){
...@@ -487,21 +579,24 @@ function init_disk_contextmenu(){ ...@@ -487,21 +579,24 @@ function init_disk_contextmenu(){
//如果是缩略图的模式时 //如果是缩略图的模式时
else{ else{
//右键时,切换是否可以点击的按钮 //右键时,切换是否可以点击的按钮
if($(e.target).hasClass('disk_content_lump')){ if($(e.target).hasClass('disk_content_lump')||$(e.target).hasClass('col-md-2')){
$disk_menu.find('.disk_menu_noClickBtn').removeClass('disk_menu_noClick'); var a_length = $('.disk_search_center>a').eq(1).length;
$disk_menu.find('.disk_menu_clickBtn').addClass('disk_menu_noClick'); if(a_length!=0){
lump_data = $('.disk_search_center>a').eq(1).data('lump_data');
}
} }
else{ else{
//先去掉之前选中的 //先去掉之前选中的
$(e.target).parents('.disk_content_lump').find('.disk_content_lump_click').removeClass('disk_content_lump_click'); $(e.target).parents('.disk_content_lump').find('.disk_content_lump_click').removeClass('disk_content_lump_click');
//然后给自己加个样式 //然后给自己加个样式
$(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');
var lump_data = $(e.target).parents('.col-md-2').children('div').data('lump_data'); lump_data = $(e.target).parents('.col-md-2').children('div').data('lump_data');
//菜单的显示
init_disk_menu_toggle($disk_menu,lump_data);
} }
} }
//菜单的显示
init_disk_menu_toggle($disk_menu,lump_data);
//显示菜单 //显示菜单
$disk_menu.show(); $disk_menu.show();
...@@ -538,10 +633,60 @@ function init_disk_contextmenu(){ ...@@ -538,10 +633,60 @@ function init_disk_contextmenu(){
//菜单的切换显示 //菜单的切换显示
function init_disk_menu_toggle(disk_menu,lump_data){ function init_disk_menu_toggle(disk_menu,lump_data){
var $disk_menu = disk_menu; var $disk_menu = disk_menu;
if(!lump_data){
$disk_menu.find('.disk_menu_noClickBtn').removeClass('disk_menu_noClick');
$disk_menu.find('.disk_menu_clickBtn').addClass('disk_menu_noClick');
return;
}
else{
$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');
//如果是公司文件和共享文件时,则不显示重命名,分享,删除,移动到,共享 }
if(lump_data.FILE_TYPE=='folder_company'||lump_data.FILE_TYPE=='folder_share'){ //如果是在首页点击了公司文件则不显示重命名,分享,删除,移动到,共享
if($('.disk_search_center>a').eq(0).next().length==0&&lump_data.FILE_TYPE=='folder_company'){
$disk_menu.find('.disk_menu_clickBtn').addClass('disk_menu_noClick');
$disk_menu.find('li').eq(2).removeClass('disk_menu_noClick');
$disk_menu.find('li').eq(6).removeClass('disk_menu_noClick');
return;
}
//如果是在首页点击了共享文件时,则不显示重命名,分享,删除,移动到,共享,下载
if($('.disk_search_center>a').eq(0).next().length==0&&lump_data.FILE_TYPE=='folder_share'){
$disk_menu.find('.disk_menu_clickBtn').addClass('disk_menu_noClick');
$disk_menu.find('li').eq(2).removeClass('disk_menu_noClick');
return;
}
//普通文件的空白位置
if(lump_data.apiIndex=='0'&&lump_data.FATHER_ID=='A'&&$('.disk_search_center>a').eq(0).next().length!=0){
$disk_menu.find('.disk_menu_noClickBtn').removeClass('disk_menu_noClick');
$disk_menu.find('.disk_menu_clickBtn').addClass('disk_menu_noClick');
}
//如果点击了公司文件的空白位置
if(lump_data.UUID=='B'){
$disk_menu.find('li').addClass('disk_menu_noClick');
}
//如果点击了共享文件的空白位置
if(lump_data.UUID=='C'&&lump_data.apiIndex=='2'){
$disk_menu.find('li').addClass('disk_menu_noClick');
$disk_menu.find('li:last').hide();
}
else if(lump_data.apiIndex=='2'){
$disk_menu.find('li').eq(3).addClass('disk_menu_noClick');
$disk_menu.find('li').eq(4).addClass('disk_menu_noClick');
$disk_menu.find('li').eq(5).addClass('disk_menu_noClick');
$disk_menu.find('li').eq(6).addClass('disk_menu_noClick');
$disk_menu.find('li').eq(7).addClass('disk_menu_noClick');
$disk_menu.find('li').eq(8).addClass('disk_menu_noClick');
//根目录显示取消共享的操作,子目录不显示
if($('.disk_search_center>a').eq(1).next().length==0){
$disk_menu.find('li:last').show();
$disk_menu.find('li:last').removeClass('disk_menu_noClick');
}
else{
$disk_menu.find('li:last').hide();
}
}
//如果是公司文件
if(lump_data.apiIndex=='1'){
$disk_menu.find('li').eq(3).addClass('disk_menu_noClick'); $disk_menu.find('li').eq(3).addClass('disk_menu_noClick');
$disk_menu.find('li').eq(4).addClass('disk_menu_noClick'); $disk_menu.find('li').eq(4).addClass('disk_menu_noClick');
$disk_menu.find('li').eq(5).addClass('disk_menu_noClick'); $disk_menu.find('li').eq(5).addClass('disk_menu_noClick');
...@@ -588,6 +733,12 @@ function disk_content_toggle(handler){ ...@@ -588,6 +733,12 @@ function disk_content_toggle(handler){
$(handler).data('toggleList',true); $(handler).data('toggleList',true);
$(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(lump_data&&lump_data.apiIndex=='2'){
init_disk_enjoy_list(infos);
}
else{
if($('#disk_rubbish').data('rubbish')){ if($('#disk_rubbish').data('rubbish')){
init_disk_rubbish_list(infos); init_disk_rubbish_list(infos);
} }
...@@ -595,6 +746,7 @@ function disk_content_toggle(handler){ ...@@ -595,6 +746,7 @@ function disk_content_toggle(handler){
init_disk_list(infos); init_disk_list(infos);
} }
} }
}
else{ else{
//缩略图形式 //缩略图形式
$(handler).data('toggleList',false); $(handler).data('toggleList',false);
...@@ -610,6 +762,126 @@ function disk_content_toggle(handler){ ...@@ -610,6 +762,126 @@ function disk_content_toggle(handler){
$('.disk_content_lump,.disk_content_list').toggle(); $('.disk_content_lump,.disk_content_list').toggle();
} }
//初始化共享文件的列表
function init_disk_enjoy_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:'FILE_UUID',
//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: 'FILE_NAME',
title: '文件名称',
align: 'left',
valign: 'middle',
width:400,
formatter: function (value, row, index) {
if(row.fileImg){
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" data-lump_data=\''+JSON.stringify(row)+'\'><div>'+ value +'</div><input type="text" value=\''+ value +'\' class="form-control" onblur="disk_input_blur(this)" /></div></div>';
}
else{
return '<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'+ctx+'/photo/photo.jsp?ls_photo='+row.FILE_SAVE_PATH+row.FILE_SVAE_NAME+'" height="44" ></div><div class="col-md-10" data-lump_data=\''+JSON.stringify(row)+'\'><div>'+ value +'</div><input type="text" value=\''+ value +'\' class="form-control" onblur="disk_input_blur(this)" /></div></div>';
}
}
}, {
field: 'SHARE_TIME',
title: '共享时间',
align: 'center',
valign: 'middle',
order:'asc',
sortable:'true'
}, {
field: 'FILE_TYPE',
title: '类型',
align: 'center',
valign: 'middle'
},{
field: 'FILE_SIZE',
title: '大小',
align: 'center',
valign: 'middle',
formatter: function (value, row, index) {
return $.jfbrother.fileSizeToStr(row.FILE_SIZE);
}
},{
field: 'SHARE_NAME',
title: '共享目标人',
align: 'center',
valign: 'middle'
},{
field: 'CREATE_NAME',
title: '创建人',
align: 'center',
valign: 'middle'
}
],
//选中时隐藏菜单
onCheck:function(row){
$('#disk_menu').hide();
},
//当用户点击某一列的时候触发
onClickCell:function(field, value, row, $element){
if(field=='FILE_NAME'){
//编辑,把td传入
disk_editFolder_list($element);
}
},
//当用户双击某一行的时候触发
onDblClickRow:function(row, $element){
//根据file_uuid重新渲染列表
disk_list_dbClick(row,$element);
},
//当用户单击某一行的时候触发
onClickRow:function(row, $element){
//选中这行
//在根据file_uuid来获得对象
$('#disk_content_list tr').each(function(index,element){
if($(element).data('uniqueid')==row.FILE_UUID){
var index = $(element).data('index');
//如果正处于编辑状态那就选中,否则就反着选
if($(element).find('.disk_content_list_fileName input').css('display')!='none'||!$(element).find('input[type="checkbox"]').prop('checked')){
$('#disk_content_list').bootstrapTable('check',index);
}
else{
$('#disk_content_list').bootstrapTable('uncheck',index);
}
}
})
}
//
})
}
//初始化文件的列表 //初始化文件的列表
function init_disk_list(infos){ function init_disk_list(infos){
for(var i=0;i<infos.length;i++){ for(var i=0;i<infos.length;i++){
...@@ -739,7 +1011,7 @@ function init_disk_rubbish_list(infos){ ...@@ -739,7 +1011,7 @@ function init_disk_rubbish_list(infos){
pageList: [5,10,15,20], // 设置页面可以显示的数据条数 pageList: [5,10,15,20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数 pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码, pageNumber: 1, // 首页页码,
uniqueId:'id', uniqueId:'UUID',
clickToSelect:true,//True to select checkbox or radiobox when the column is clicked. clickToSelect:true,//True to select checkbox or radiobox when the column is clicked.
queryParams:function(params){ queryParams:function(params){
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的 var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
...@@ -759,28 +1031,33 @@ function init_disk_rubbish_list(infos){ ...@@ -759,28 +1031,33 @@ function init_disk_rubbish_list(infos){
align: 'center', // 居中显示 align: 'center', // 居中显示
valign: 'middle' valign: 'middle'
},{ },{
field: 'fileName', field: 'FILE_NAME',
title: '文件名称', title: '文件名称',
align: 'left', align: 'left',
valign: 'middle', valign: 'middle',
width:400, width:400,
formatter: function (value, row, index) { 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>'; if(row.fileImg){
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" data-lump_data=\''+JSON.stringify(row)+'\'><div>'+ value +'</div><input type="text" value=\''+ value +'\' class="form-control" onblur="disk_input_blur(this)" /></div></div>';
}
else{
return '<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'+ctx+'/photo/photo.jsp?ls_photo='+row.FILE_SAVE_PATH+row.FILE_SVAE_NAME+'" height="44" ></div><div class="col-md-10" data-lump_data=\''+JSON.stringify(row)+'\'><div>'+ value +'</div><input type="text" value=\''+ value +'\' class="form-control" onblur="disk_input_blur(this)" /></div></div>';
}
} }
}, { }, {
field: 'lastTime', field: 'UPDATE_TIME',
title: '删除时间', title: '删除时间',
align: 'center', align: 'center',
valign: 'middle', valign: 'middle',
order:'asc', order:'asc',
sortable:'true' sortable:'true'
}, { }, {
field: 'fileType', field: 'FILE_TYPE',
title: '类型', title: '类型',
align: 'center', align: 'center',
valign: 'middle' valign: 'middle'
},{ },{
field: 'fileSize', field: 'FILE_SIZE',
title: '大小', title: '大小',
align: 'center', align: 'center',
valign: 'middle' valign: 'middle'
...@@ -824,7 +1101,7 @@ function disk_editFolder(handler){ ...@@ -824,7 +1101,7 @@ function disk_editFolder(handler){
function disk_editFolder_list(handler){ function disk_editFolder_list(handler){
var lump_data = $(handler).find('div').eq(2).data('lump_data'); var lump_data = $(handler).find('div').eq(2).data('lump_data');
//如果是公司文件或者是共享文件则不能编辑 //如果是公司文件或者是共享文件则不能编辑
if(lump_data.FILE_TYPE=='folder_share'||lump_data.FILE_TYPE=='folder_company'){ if(lump_data.apiIndex=='1'||lump_data.apiIndex=='2'){
return; return;
} }
var $input = $(handler).find('input'); var $input = $(handler).find('input');
...@@ -837,8 +1114,25 @@ function disk_editFolder_list(handler){ ...@@ -837,8 +1114,25 @@ function disk_editFolder_list(handler){
//双击列表时 //双击列表时
function disk_list_dbClick(row,handler){ function disk_list_dbClick(row,handler){
disk_dbClick_custom($(handler).find('.disk_content_list_fileName input'),row,function(infos){ disk_dbClick_custom($(handler).find('.disk_content_list_fileName input'),row,function(infos){
//如果是共享文件,那就显示共享的列表
if(row.apiIndex=='2'){
init_disk_enjoy_list(infos);
}
else{
init_disk_list(infos); init_disk_list(infos);
}
}); });
//如果是公司文件时
if(row.FILE_TYPE=='folder_company'){
$('.disk_content_header>div:first-child>a').hide();
//显示下载按钮
$('.disk_content_header>div:first-child>a').eq(1).show();
}
else if(row.FILE_TYPE=='folder_share'){
//显示取消共享的按钮
$('.disk_content_header>div:first-child>a').hide();
$('.disk_enjoyBtn').show();
}
} }
//块状以及列表的双击点击事件的提取,返回一个数组,callback回调 //块状以及列表的双击点击事件的提取,返回一个数组,callback回调
...@@ -875,9 +1169,17 @@ function disk_enterFolder(handler){ ...@@ -875,9 +1169,17 @@ function disk_enterFolder(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');
//在根据uuid来获得对象 var uuid;
//如果是共享文件,并且是共享文件的子目录,则根据file_uuid来获得对象
if(list_rows[0].apiIndex=='2'&&$('.disk_search_center>a').eq(0).next().length!=0){
uuid = list_rows[0].FILE_UUID;
}
//否则就用uuid来获得对象
else{
uuid = list_rows[0].UUID;
}
$('#disk_content_list tr').each(function(index,element){ $('#disk_content_list tr').each(function(index,element){
if($(element).data('uniqueid')==list_rows[0].UUID){ if($(element).data('uniqueid')==uuid){
disk_list_dbClick(list_rows[0],$(element)); disk_list_dbClick(list_rows[0],$(element));
return false; return false;
} }
...@@ -901,13 +1203,18 @@ function disk_backFolder(handler){ ...@@ -901,13 +1203,18 @@ function disk_backFolder(handler){
var lump_data = $(handler).data('lump_data'); var lump_data = $(handler).data('lump_data');
//获得数据列表 //获得数据列表
var lump_infos = init_disk_infos('0',lump_data); var lump_infos = init_disk_infos('0',lump_data);
//重新渲染数据 //重新渲染数据
if($('.disk_content_toggleBtn').data('toggleList')){ if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时 //如果是列表时
//重新渲染列表 //重新渲染列表
//如果是共享文件,那就显示共享的列表
if(lump_data.apiIndex=='2'){
init_disk_enjoy_list(lump_infos);
}
else{
init_disk_list(lump_infos); init_disk_list(lump_infos);
} }
}
else{ else{
//如果是块状时 //如果是块状时
//根据一个json数据去渲染块状 //根据一个json数据去渲染块状
...@@ -966,6 +1273,7 @@ function disk_moveFolder(handler){ ...@@ -966,6 +1273,7 @@ function disk_moveFolder(handler){
var strVar = ""; var strVar = "";
strVar += "<div style=\"width:268px;padding:0px;border-radius:5px;overflow:hidden;\">\n"; 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 class=\"disk_move_title\"><span>移动文件<\/span><span onclick=\"$.fancybox.close()\" class=\"glyphicon glyphicon-remove\"><\/span><\/div>\n";
strVar += " <div class=\"disk_move_search\"><input placeholder=\"搜索文件夹\" type=\"text\" ><span onclick=\"alert('搜索')\">搜索</span><\/div>\n";
strVar += " <div id=\"disk_move_tree\" style=\"height:220px;overflow:auto;\" class=\"ztree disk_move_tree\"><\/div>\n"; strVar += " <div id=\"disk_move_tree\" style=\"height:220px;overflow:auto;\" class=\"ztree disk_move_tree\"><\/div>\n";
strVar += " <div class=\"disk_move_btn\">\n"; strVar += " <div class=\"disk_move_btn\">\n";
strVar += " <span onclick=\"disk_moveFolder_save()\">确定<\/span><span onclick=\"$.fancybox.close()\">取消<\/span>\n"; strVar += " <span onclick=\"disk_moveFolder_save()\">确定<\/span><span onclick=\"$.fancybox.close()\">取消<\/span>\n";
...@@ -1002,31 +1310,71 @@ function disk_moveFolder_save(){ ...@@ -1002,31 +1310,71 @@ function disk_moveFolder_save(){
} }
//选择共享人之后的保存 //选择共享人之后的保存,做了多选文件的共享(暂时只能单文件)
function disk_enjoyUser_save(){ function disk_enjoyUser_save(lump_data){
var treeObj = $.fn.zTree.getZTreeObj("disk_enjoyUser_tree"); var treeObj = $.fn.zTree.getZTreeObj("disk_enjoyUser_tree");
var nodes = treeObj.getSelectedNodes(); var nodes = treeObj.getSelectedNodes();
console.log(nodes) var query = {};
var uuids = '';
var userIds = '';
for(var i = 0 ; i< lump_data.length;i++){
uuids = uuids + lump_data[i].UUID+',';
}
for(var i = 0 ; i< nodes.length;i++){
userIds = userIds + nodes[i].USER_ID+',';
}
uuids = uuids.substring(0, uuids.length-1);
userIds = userIds.substring(0, userIds.length-1);
query.FIELD_CODE = uuids;
query.FIELD_USER_ID = userIds;
var result = storePersonalModule.storePersonalActAction.shareStorePersonal(query);
$.fancybox.close(); $.fancybox.close();
}
//重新渲染显示的内容 //取消共享操作
function disk_cancelEnjoy(handler){
//如果是子目录中的共享,则做个提示操作
if($('.disk_search_center>a').eq(1).next().length!=0){
var txt = '只能取消共享根目录!!!';
var option = {
title: '取消共享提示',
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error,option);
return;
}
disk_confirm(handler,'取消共享',function(list_rows,uuids){
//数据库的取消共享信息
var result = disk_cancelEnjoy_sql(uuids);
});
}
//取消共享的数据库操作
function disk_cancelEnjoy_sql(uuids){
var query = {};
query.FIELD_CODE=uuids;
//先软删除
var result1 = storeShareModule.storeShareActAction.deleteStoreShare(query);
//再真正的删除
var result2 = storeShareModule.storeShareActAction.deleteTrueStoreShare(query);
} }
//初始化文件时移动的目录 //初始化文件时移动的目录
function init_disk_move_tree(rows_data){ function init_disk_move_tree(rows_data){
var infos = infos = storePersonalModule.storePersonalDataAction.listAll_storePersonalnofile().rowSet;
console.log(infos)
var ztreeData = [ var ztreeData = [
{pid:'0',id:'A',name:"公司文件",fileType:'folder_company'}, {pid:'0',id:'A',name:"公司文件",FILE_TYPE:'folder_company'},
{pid:'A',id:'A1',name:'我的文件夹1',fileType:'folder'}, {pid:'A',id:'A1',name:'我的文件夹1',FILE_TYPE:'folder'},
{pid:'A',id:'A2',name:'我的文件夹2',fileType:'folder'}, {pid:'A',id:'A2',name:'我的文件夹2',FILE_TYPE:'folder'},
{pid:'A',id:'A3',name:'我的文件夹3',fileType:'folder'}, {pid:'A',id:'A3',name:'我的文件夹3',FILE_TYPE:'folder'},
{pid:'A',id:'A4',name:'我的文件夹4',fileType:'folder'}, {pid:'A',id:'A4',name:'我的文件夹4',FILE_TYPE:'folder'},
{pid:'A4',id:'A5',name:'我的文件夹5',fileType:'folder'}, {pid:'A4',id:'A5',name:'我的文件夹5',FILE_TYPE:'folder'},
{pid:'A5',id:'A6',name:'我的文件夹5',fileType:'folder'}, {pid:'A5',id:'A6',name:'我的文件夹5',FILE_TYPE:'folder'},
{pid:'A6',id:'A7',name:'我的文件夹5',fileType:'folder'}, {pid:'A6',id:'A7',name:'我的文件夹5',FILE_TYPE:'folder'},
{pid:'0',id:'B',name:'共享文件',fileType:'folder_share'}, {pid:'0',id:'B',name:'共享文件',FILE_TYPE:'folder_share'},
{pid:'B',id:'B4',name:'我的文件夹5',fileType:'folder'}, {pid:'B',id:'B4',name:'我的文件夹5',FILE_TYPE:'folder'},
{pid:'B',id:'B4',name:'我的文件夹6',fileType:'folder'} {pid:'B',id:'B4',name:'我的文件夹6',FILE_TYPE:'folder'}
]; ];
for(var i =0;i<ztreeData.length;i++){ for(var i =0;i<ztreeData.length;i++){
...@@ -1082,25 +1430,23 @@ function init_disk_move_tree(rows_data){ ...@@ -1082,25 +1430,23 @@ function init_disk_move_tree(rows_data){
//初始化共享人的树 //初始化共享人的树
function init_disk_enjoyUser_tree(rows_data){ function init_disk_enjoyUser_tree(rows_data){
var ztreeData = [ /*var result = jwAppUserModel.jwAppsUserDataAction.listALLUserUnit();*/
{pid:'0',id:'A',name:'技术部',icon:'custom/images/disk_enjoy_users.png'}, var ztreeData;
{pid:'A',id:'A1',name:'联系人1',icon:'custom/images/disk_enjoy_user.png'}, $.ajax({
{pid:'A',id:'A2',name:'联系人2',icon:'custom/images/disk_enjoy_user.png'}, url:'userchoiceData_listUser',
{pid:'A',id:'A3',name:'联系人3',icon:'custom/images/disk_enjoy_user.png'}, type:'post',
{pid:'A',id:'A4',name:'联系人4',icon:'custom/images/disk_enjoy_user.png'}, async:false,
{pid:'A',id:'A5',name:'联系人5',icon:'custom/images/disk_enjoy_user.png'}, success:function(data){
{pid:'A',id:'A6',name:'联系人6',icon:'custom/images/disk_enjoy_user.png'}, ztreeData = data.rowSet;
{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++){ for(var i = 0 ;i<ztreeData.length;i++){
init_disk_select_fileImg(ztreeData[i]); ztreeData[i].icon = 'custom/images/disk_enjoy_users.png';
}*/ //所有都显示文件夹的样子
//ztreeData[i].isParent=true;
}
console.log(ztreeData)
//还要做一步过滤 //还要做一步过滤
//1.把自身及以下文件过滤掉 //1.把自身及以下文件过滤掉
...@@ -1122,9 +1468,12 @@ function init_disk_enjoyUser_tree(rows_data){ ...@@ -1122,9 +1468,12 @@ function init_disk_enjoyUser_tree(rows_data){
data : { data : {
simpleData : { simpleData : {
enable : true, enable : true,
idKey : "id", idKey : "USER_ID",
pIdKey : "pid", pIdKey : "PARENT_ID",
rootPId : 0 rootPId : 0
},
key: {
name: "USER_NAME"
} }
}, },
view : { view : {
...@@ -1580,7 +1929,7 @@ function disk_confirm(handler,txt,sqlCallback,customCallback){ ...@@ -1580,7 +1929,7 @@ function disk_confirm(handler,txt,sqlCallback,customCallback){
list_rows = $('.disk_content_lump').find('.disk_content_lump_click'); list_rows = $('.disk_content_lump').find('.disk_content_lump_click');
} }
if(list_rows.length==0){ if(list_rows.length==0){
var txt1 = '请选择要'+txt+'的文件!!!'; var txt1 = '请选择要'+txt+'的文件或文件夹!!!';
var option1 = { var option1 = {
title: txt+'提示', title: txt+'提示',
btn:parseInt("0001",2) btn:parseInt("0001",2)
...@@ -1588,7 +1937,7 @@ function disk_confirm(handler,txt,sqlCallback,customCallback){ ...@@ -1588,7 +1937,7 @@ function disk_confirm(handler,txt,sqlCallback,customCallback){
window.wxc.xcConfirm(txt1, window.wxc.xcConfirm.typeEnum.confirm,option1); window.wxc.xcConfirm(txt1, window.wxc.xcConfirm.typeEnum.confirm,option1);
return; return;
} }
var txt3 = '是否要'+txt+'选中的文件!!!'; var txt3 = '是否要'+txt+'选中的文件或文件夹!!!';
var option3 = { var option3 = {
title: txt+'提示', title: txt+'提示',
onOk: function(){ onOk: function(){
...@@ -1606,7 +1955,7 @@ function disk_confirm(handler,txt,sqlCallback,customCallback){ ...@@ -1606,7 +1955,7 @@ function disk_confirm(handler,txt,sqlCallback,customCallback){
//存在公司文件或者是共享文件则退出 //存在公司文件或者是共享文件则退出
if(list_row_obj.FILE_TYPE=='folder_company'||list_row_obj.FILE_TYPE=='folder_share'){ if(list_row_obj.FILE_TYPE=='folder_company'||list_row_obj.FILE_TYPE=='folder_share'){
var txt2 = '存在无法'+txt+'的文件!!!'; var txt2 = '存在无法'+txt+'的文件!!!';
var option2 = { var option2 = {
title: txt+'提示', title: txt+'提示',
btn:parseInt("0001",2) btn:parseInt("0001",2)
...@@ -1617,13 +1966,13 @@ function disk_confirm(handler,txt,sqlCallback,customCallback){ ...@@ -1617,13 +1966,13 @@ function disk_confirm(handler,txt,sqlCallback,customCallback){
//存在下级目录或文件,已共享文件,已分享文件时则退出 //存在下级目录或文件,已共享文件,已分享文件时则退出
var error_txt = ''; var error_txt = '';
if(list_row_obj.FILENUMBER>0){ if(list_row_obj.apiIndex=='0'&&list_row_obj.FILENUMBER>0){
error_txt = '存在下级文件或目录,无法删除!'; error_txt = '存在下级文件或目录或回收站里存在下级文件或目录,无法删除!';
} }
if(list_row_obj.GXCOUNT>0){ if(list_row_obj.apiIndex=='0'&&list_row_obj.GXCOUNT>0){
error_txt = '存在已共享文件或目录,无法删除!'; error_txt = '存在已共享文件或目录,无法删除!';
} }
if(list_row_obj.FXCOUNT>0){ if(list_row_obj.apiIndex=='0'&&list_row_obj.FXCOUNT>0){
error_txt = '存在已分享文件或目录,无法删除!'; error_txt = '存在已分享文件或目录,无法删除!';
} }
if(error_txt!=''){ if(error_txt!=''){
...@@ -1636,7 +1985,13 @@ function disk_confirm(handler,txt,sqlCallback,customCallback){ ...@@ -1636,7 +1985,13 @@ function disk_confirm(handler,txt,sqlCallback,customCallback){
return; return;
} }
//如果是共享文件时,则FILE_UUID是真正的UUID
if(list_row_obj.apiIndex=='2'){
uuids = uuids + list_row_obj.FILE_UUID + ',';
}
else{
uuids = uuids + list_row_obj.UUID + ','; uuids = uuids + list_row_obj.UUID + ',';
}
lump_datas.push(list_row_obj); lump_datas.push(list_row_obj);
} }
uuids = uuids.substring(0, uuids.length-1); uuids = uuids.substring(0, uuids.length-1);
...@@ -1650,9 +2005,15 @@ function disk_confirm(handler,txt,sqlCallback,customCallback){ ...@@ -1650,9 +2005,15 @@ function disk_confirm(handler,txt,sqlCallback,customCallback){
//删除页面的 //删除页面的
for(var i = 0 ; i < list_rows.length ; i ++){ for(var i = 0 ; i < list_rows.length ; i ++){
if($('.disk_content_toggleBtn').data('toggleList')){ if($('.disk_content_toggleBtn').data('toggleList')){
//根据uuid来删除行 //如果是共享文件那就根据file_uuid来删除行
if(list_rows[i].apiIndex=='2'){
$('#disk_content_list').bootstrapTable('removeByUniqueId',list_rows[i].FILE_UUID);
}
//否则根据uuid来删除行
else{
$('#disk_content_list').bootstrapTable('removeByUniqueId',list_rows[i].UUID); $('#disk_content_list').bootstrapTable('removeByUniqueId',list_rows[i].UUID);
} }
}
else{ else{
$(list_rows[i]).parent().remove(); $(list_rows[i]).parent().remove();
} }
...@@ -1889,14 +2250,13 @@ function disk_enjoyFolder(handler){ ...@@ -1889,14 +2250,13 @@ function disk_enjoyFolder(handler){
} }
} }
console.log(rows_data)
var strVar = ""; var strVar = "";
strVar += "<div style=\"width:268px;padding:0px;border-radius:5px;overflow:hidden;\">\n"; 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 class=\"disk_move_title\"><span>选择要共享的人<\/span><span onclick=\"$.fancybox.close()\" class=\"glyphicon glyphicon-remove\"><\/span><\/div>\n";
strVar += " <div class=\"disk_move_search\"><input placeholder=\"搜索人员\" type=\"text\" ><span onclick=\"alert('搜索')\">搜索</span><\/div>\n";
strVar += " <div id=\"disk_enjoyUser_tree\" style=\"height:220px;overflow:auto;\" class=\"ztree disk_move_tree\"><\/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 += " <div class=\"disk_move_btn\">\n";
strVar += " <span onclick=\"disk_enjoyUser_save()\">确定<\/span><span onclick=\"$.fancybox.close()\">取消<\/span>\n"; strVar += " <span>确定<\/span><span onclick=\"$.fancybox.close()\">取消<\/span>\n";
strVar += " <\/div>\n"; strVar += " <\/div>\n";
strVar += "<\/div>\n"; strVar += "<\/div>\n";
...@@ -1914,6 +2274,10 @@ function disk_enjoyFolder(handler){ ...@@ -1914,6 +2274,10 @@ function disk_enjoyFolder(handler){
} }
}); });
$('.disk_move_btn>span').eq(0).bind('click',function(){
disk_enjoyUser_save(rows_data);
})
//初始化文件目录 //初始化文件目录
init_disk_enjoyUser_tree(rows_data); init_disk_enjoyUser_tree(rows_data);
} }
...@@ -1964,8 +2328,8 @@ function disk_cancelShareCode(handler){ ...@@ -1964,8 +2328,8 @@ function disk_cancelShareCode(handler){
title: "取消分享提示", title: "取消分享提示",
onOk: function(){ onOk: function(){
for(var i = 0; i<list_rows.length;i++){ for(var i = 0; i<list_rows.length;i++){
//根据id来删除行 //根据uuid来删除行
$('#disk_content_list').bootstrapTable('removeByUniqueId',list_rows[i].id); $('#disk_content_list').bootstrapTable('removeByUniqueId',list_rows[i].UUID);
//然后做取消分享操作 //然后做取消分享操作
} }
} }
...@@ -2062,12 +2426,3 @@ function init_disk_shareCode_list(infos){ ...@@ -2062,12 +2426,3 @@ function init_disk_shareCode_list(infos){
}) })
} }
//返回一级目录
function disk_backFolder_prev(handler){
}
//前进一个目录
function disk_backFolder_next(hanlder){
}
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
/* .xcConfirm .popBox .txtBox{margin: 40px 100px; height: 100px; overflow: hidden;} */ /* .xcConfirm .popBox .txtBox{margin: 40px 100px; height: 100px; overflow: hidden;} */
.xcConfirm .popBox .txtBox{ .xcConfirm .popBox .txtBox{
margin: 30px 100px; margin: 30px 100px;
height: 57px; height: 61px;
overflow: hidden; overflow: hidden;
margin-top: 40px; margin-top: 40px;
} }
......
<%@ 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" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<div class="indedx_header"> <div class="indedx_header">
<div onclick="location.href='interim'"> <div onclick="location.href='interim'">
...@@ -9,10 +10,10 @@ ...@@ -9,10 +10,10 @@
<a href="javascript:void(0)" class="index_header_showMessage"> <a href="javascript:void(0)" class="index_header_showMessage">
<img src="${ctx}/custom/images/index4_loginmessage.png" width="12" height="12" />登录信息 <img src="${ctx}/custom/images/index4_loginmessage.png" width="12" height="12" />登录信息
<ul> <ul>
<li><span>登录账号</span><span>test001</span></li> <li><span>登录账号</span><span><s:property value="#session.userInfo['EMID']"/></span></li>
<li><span>姓名</span><span>小周</span></li> <li><span>姓名</span><span><s:property value="#session.userInfo['EMNAME']"/></span></li>
<li><span>登录时间</span><span>2018.02.22 12:24:38</span></li> <li><span>登录IP</span><span><s:property value="#session.userInfo['LOGINIP']"/></span></li>
<li><span>上次时间</span><span>2017.02.22 12:24:38</span></li> <li><span>上次时间</span><span><s:property value="#session.userInfo['BEFORETIME']"/></span></li>
</ul> </ul>
</a><span>|</span> </a><span>|</span>
<a href="#"> <a href="#">
......
...@@ -72,27 +72,27 @@ public class actAction extends BasicAction { ...@@ -72,27 +72,27 @@ public class actAction extends BasicAction {
//去除不要更新的字段 //去除不要更新的字段
entity.remove("OPETYPE"); entity.remove("OPETYPE");
//处理目录/文件重名的问题,处理是直接在文件和目录后加数字 //处理目录/文件重名的问题,处理是直接在文件和目录后加数字
Map<String,Object> v_congfu_query = new HashMap<String,Object>(); // Map<String,Object> v_congfu_query = new HashMap<String,Object>();
v_congfu_query.put("FATHER_ID", entity.get("FATHER_ID")); // v_congfu_query.put("FATHER_ID", entity.get("FATHER_ID"));
v_congfu_query.put("CREATOR_ID", entity.get("CREATOR_ID")); // v_congfu_query.put("CREATOR_ID", entity.get("CREATOR_ID"));
String isfile_1 = (String) entity.get("ISFILE"); // String isfile_1 = (String) entity.get("ISFILE");
if(StringUtils.equals(isfile_1, "1")){ // if(StringUtils.equals(isfile_1, "1")){
String fname = (String) entity.get("FILE_NAME"); // String fname = (String) entity.get("FILE_NAME");
fname = fname.substring(0,fname.lastIndexOf(".")); // fname = fname.substring(0,fname.lastIndexOf("."));
v_congfu_query.put("FILE_NAME",fname); // v_congfu_query.put("FILE_NAME",fname);
}else{ // }else{
v_congfu_query.put("FILE_NAME", entity.get("FILE_NAME")); // v_congfu_query.put("FILE_NAME", entity.get("FILE_NAME"));
} // }
int ret_count = business.listCount_storePersonal(v_congfu_query); // int ret_count = business.listCount_storePersonal(v_congfu_query);
if(ret_count>0){ // if(ret_count>0){
String fname = (String) entity.get("FILE_NAME"); // String fname = (String) entity.get("FILE_NAME");
if(StringUtils.equals(isfile_1, "1")){ // if(StringUtils.equals(isfile_1, "1")){
fname = fname.substring(0,fname.lastIndexOf("."))+"("+ret_count+")."+fname.substring(fname.lastIndexOf(".")+1); // fname = fname.substring(0,fname.lastIndexOf("."))+"("+ret_count+")."+fname.substring(fname.lastIndexOf(".")+1);
}else{ // }else{
fname = fname + "("+ret_count+")"; // fname = fname + "("+ret_count+")";
} // }
entity.put("FILE_NAME",fname); // entity.put("FILE_NAME",fname);
} // }
//处理超限问题 //处理超限问题
StoreUserBusiness business_storeuser = BusinessManager.getBusiness(StoreUserBusiness.class); StoreUserBusiness business_storeuser = BusinessManager.getBusiness(StoreUserBusiness.class);
Map<String,Object> storeuserQuery = new HashMap<String,Object>(); Map<String,Object> storeuserQuery = new HashMap<String,Object>();
...@@ -227,7 +227,7 @@ public class actAction extends BasicAction { ...@@ -227,7 +227,7 @@ public class actAction extends BasicAction {
} }
} }
// //
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功")); jsonObject.putAll(Status.getStatusSuccessMessage("保存成功,"+entity.get("FILE_NAME")));
} }
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败")); jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
...@@ -246,33 +246,33 @@ public class actAction extends BasicAction { ...@@ -246,33 +246,33 @@ public class actAction extends BasicAction {
StorePersonalBusiness business = BusinessManager.getBusiness(StorePersonalBusiness.class); StorePersonalBusiness business = BusinessManager.getBusiness(StorePersonalBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
String father_path = request.getParameter("FATHER_PATH"); String father_path = request.getParameter("FATHER_PATH");
String old_file_name = request.getParameter("OLD_FILE_NAME"); // String old_file_name = request.getParameter("OLD_FILE_NAME");
try { try {
String is_fname = (String) entity.get("FILE_NAME"); // String is_fname = (String) entity.get("FILE_NAME");
if(!StringUtils.equals(is_fname, old_file_name)){ // if(!StringUtils.equals(is_fname, old_file_name)){
//处理目录/文件重名的问题,处理是直接在文件和目录后加数字 // //处理目录/文件重名的问题,处理是直接在文件和目录后加数字
Map<String,Object> v_congfu_query = new HashMap<String,Object>(); // Map<String,Object> v_congfu_query = new HashMap<String,Object>();
v_congfu_query.put("FATHER_ID", entity.get("FATHER_ID")); // v_congfu_query.put("FATHER_ID", entity.get("FATHER_ID"));
v_congfu_query.put("CREATOR_ID", entity.get("CREATOR_ID")); // v_congfu_query.put("CREATOR_ID", entity.get("CREATOR_ID"));
String isfile_1 = (String) entity.get("ISFILE"); // String isfile_1 = (String) entity.get("ISFILE");
if(StringUtils.equals(isfile_1, "1")){ // if(StringUtils.equals(isfile_1, "1")){
String fname = (String) entity.get("FILE_NAME"); // String fname = (String) entity.get("FILE_NAME");
fname = fname.substring(0,fname.lastIndexOf(".")); // fname = fname.substring(0,fname.lastIndexOf("."));
v_congfu_query.put("FILE_NAME",fname); // v_congfu_query.put("FILE_NAME",fname);
}else{ // }else{
v_congfu_query.put("FILE_NAME", entity.get("FILE_NAME")); // v_congfu_query.put("FILE_NAME", entity.get("FILE_NAME"));
} // }
int ret_count = business.listCount_storePersonal(v_congfu_query); // int ret_count = business.listCount_storePersonal(v_congfu_query);
if(ret_count>0){ // if(ret_count>0){
String fname = (String) entity.get("FILE_NAME"); // String fname = (String) entity.get("FILE_NAME");
if(StringUtils.equals(isfile_1, "1")){ // if(StringUtils.equals(isfile_1, "1")){
fname = fname.substring(0,fname.lastIndexOf("."))+"("+ret_count+")."+fname.substring(fname.lastIndexOf(".")+1); // fname = fname.substring(0,fname.lastIndexOf("."))+"("+ret_count+")."+fname.substring(fname.lastIndexOf(".")+1);
}else{ // }else{
fname = fname + "("+ret_count+")"; // fname = fname + "("+ret_count+")";
} // }
entity.put("FILE_NAME",fname); // entity.put("FILE_NAME",fname);
} // }
} // }
//去除不要更新的字段 //去除不要更新的字段
entity.remove("OPETYPE"); entity.remove("OPETYPE");
boolean is_save2db = Boolean.parseBoolean(PropUtil.getValue("uploadfile_savetodb", "quartz_service", "true")); boolean is_save2db = Boolean.parseBoolean(PropUtil.getValue("uploadfile_savetodb", "quartz_service", "true"));
...@@ -372,7 +372,7 @@ public class actAction extends BasicAction { ...@@ -372,7 +372,7 @@ public class actAction extends BasicAction {
} }
} }
// //
jsonObject.putAll(Status.getStatusSuccessMessage("修改成功")); jsonObject.putAll(Status.getStatusSuccessMessage("修改成功,"+entity.get("FILE_NAME")));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("修改失败")); jsonObject.putAll(Status.getStatusErrorMessage("修改失败"));
e.printStackTrace(); e.printStackTrace();
......
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