|
|
@@ -12,7 +12,10 @@ |
|
|
|
<div class="layout_content2"> |
|
|
|
<!-- 文件大box --> |
|
|
|
<div class="juzhongtext" v-if="isShowRecycleTip"> 回收站暂时没有文件!</div> |
|
|
|
<section class="yiyun_section_warp list_fileBox" v-if="!isShowRecycleTip" v-for="(folder, index) in filesList" :key="index"> |
|
|
|
<section class="yiyun_section_warp list_fileBox" |
|
|
|
v-if="!isShowRecycleTip" |
|
|
|
v-for="(folder, index) in filesList" |
|
|
|
:key="index"> |
|
|
|
<div class="yinyong_warpBox hidescollbar"> |
|
|
|
<div class="yiyun_section_top" id="bignav"> |
|
|
|
<!-- 系统时间 --> |
|
|
@@ -33,22 +36,22 @@ |
|
|
|
<div class="clear"></div> |
|
|
|
<!-- 应用列表(缩略图) --> |
|
|
|
<div class="yiyun_row_recyle_warp"> |
|
|
|
<div v-for="(file, fileIndex) in folder.listArchive" :key="fileIndex" @contextmenu.prevent="rightShowMenu($event, file)"> |
|
|
|
<div v-for="file in folder.listArchive" |
|
|
|
:key="file.archID" |
|
|
|
@contextmenu.prevent="rightShowMenu($event, file)"> |
|
|
|
<div class="yiyun_wenjian_list"> |
|
|
|
<div :class="'defultImage-mid ' + file.extension +'-mid'" v-if=" |
|
|
|
file.extension != 'jpg' && |
|
|
|
file.extension != 'png' && |
|
|
|
file.extension != 'bmp' && |
|
|
|
file.extension != 'gif' && |
|
|
|
file.extension != 'jpeg' |
|
|
|
"></div> |
|
|
|
file.extension != 'jpeg'"></div> |
|
|
|
<div class="defultImage-mid img_bg-mid" v-if=" |
|
|
|
file.extension == 'jpg' || |
|
|
|
file.extension == 'png' || |
|
|
|
file.extension == 'bmp' || |
|
|
|
file.extension == 'gif' || |
|
|
|
file.extension == 'jpeg' |
|
|
|
"> |
|
|
|
file.extension == 'jpeg'"> |
|
|
|
<div class="file_Imgbox-mid"> |
|
|
|
<img v-lazy="imgSrc + file.alias" alt="" class="file_Img" /> |
|
|
|
</div> |
|
|
@@ -65,16 +68,29 @@ |
|
|
|
</el-dropdown-menu> |
|
|
|
</el-dropdown> |
|
|
|
</div> |
|
|
|
<strong class="yiyunwenjian_name" :title="file.archName">{{ |
|
|
|
file.archName |
|
|
|
}}</strong> |
|
|
|
<span class="yiyunwenjian_infodesc">我的文件</span> |
|
|
|
</div> |
|
|
|
<strong class="yiyunwenjian_name" :title="file.archName"> |
|
|
|
{{file.archName}} |
|
|
|
</strong> |
|
|
|
<span class="yiyunwenjian_infodesc">我的文件</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!--删除的文件分组 start--> |
|
|
|
<div class="yiyun_wenjian_list" |
|
|
|
v-for="foldergroup in folder.listFoldergroup" |
|
|
|
:key="foldergroup.folderGroupID" |
|
|
|
@contextmenu.prevent="rightFoldergroupShowMenu($event, foldergroup)"> |
|
|
|
<div class="defultImage-mid foldernew-mid" > |
|
|
|
</div> |
|
|
|
<strong class="yiyunwenjian_name" > |
|
|
|
{{foldergroup.folderGroupName}} |
|
|
|
</strong> |
|
|
|
<strong class="yiyunwenjian_name">{{foldergroup.childCount}}个项目</strong> |
|
|
|
</div> |
|
|
|
<!--删除的文件分组 end--> |
|
|
|
</div> |
|
|
|
<div class="clear"></div> |
|
|
|
<div class="yiyun_line_border"></div> |
|
|
|
<!-- 右键菜单 --> |
|
|
|
<!-- 右键文件菜单 --> |
|
|
|
<div v-show="rightMenuvisible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu"> |
|
|
|
<ul class="rightMenu"> |
|
|
|
<li @click="downLoadMyFile(BtnRightFile)" v-if="BtnRightFile.extension !='map' && BtnRightFile.extension !='supermap' ">下载</li> |
|
|
@@ -82,6 +98,14 @@ |
|
|
|
<li @click="delMyFile(BtnRightFile)">彻底删除</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
<!-- 右键文件分组菜单 --> |
|
|
|
<div v-show="rightFoldergroupMenuvisible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu"> |
|
|
|
<ul class="rightMenu"> |
|
|
|
<!-- <li @click="downLoadMyFoldergroup()">下载</li> --> |
|
|
|
<li @click="returnMyFoldergroup()">放回原处</li> |
|
|
|
<li @click="delMyFoldergroup()">彻底删除</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
</div> |
|
|
@@ -101,7 +125,10 @@ |
|
|
|
top: 0, |
|
|
|
left: 0, |
|
|
|
rightMenuvisible: false, |
|
|
|
isShowRecycleTip:false |
|
|
|
isShowRecycleTip:false, |
|
|
|
/*********分组菜单 ***************/ |
|
|
|
rightFoldergroupMenuvisible:false, |
|
|
|
btnRightFoldergroup:{}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted: function () { |
|
|
@@ -112,9 +139,9 @@ |
|
|
|
* 获取当前工作下文件 |
|
|
|
*/ |
|
|
|
listFiles: function () { |
|
|
|
this.rightMenuvisible = false; |
|
|
|
var thisApp = this; |
|
|
|
this.$axios({ |
|
|
|
thisApp.rightMenuvisible = false; |
|
|
|
thisApp.$axios({ |
|
|
|
method: "get", |
|
|
|
url: encodeURI( |
|
|
|
process.env.API_HOST + "folders/resource/recycle/" + thisApp.userId |
|
|
@@ -177,7 +204,7 @@ |
|
|
|
* 删除我的文件 |
|
|
|
* file:源数据 |
|
|
|
*/ |
|
|
|
delMyFile: function (file) { |
|
|
|
delMyFile: function (file) { |
|
|
|
var thisApp = this; |
|
|
|
this.$confirm("您正在删除 " + file.archName + " 文件是否继续?", "", { |
|
|
|
confirmButtonText: "确定", |
|
|
@@ -246,9 +273,10 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 右键 |
|
|
|
* 右键文件 |
|
|
|
*/ |
|
|
|
rightShowMenu: function (e, file) { |
|
|
|
console.log(file) |
|
|
|
const menuMinWidth = 10; |
|
|
|
const offsetLeft = this.$el.getBoundingClientRect().left; // container margin left |
|
|
|
const offsetWidth = this.$el.offsetWidth; // container width |
|
|
@@ -262,6 +290,7 @@ |
|
|
|
this.left = e.clientX; // fix 位置bug |
|
|
|
this.top = e.clientY; // fix 位置bug |
|
|
|
this.rightMenuvisible = true; |
|
|
|
this.rightFoldergroupMenuvisible = false; |
|
|
|
this.BtnRightFile = file; |
|
|
|
}, |
|
|
|
/** |
|
|
@@ -269,7 +298,98 @@ |
|
|
|
*/ |
|
|
|
closeShowMenu: function () { |
|
|
|
this.rightMenuvisible = false; |
|
|
|
} |
|
|
|
}, |
|
|
|
/******* 右键文件分组菜单 *********/ |
|
|
|
/** |
|
|
|
* 右键文件分组 |
|
|
|
*/ |
|
|
|
rightFoldergroupShowMenu: function (e, foldergroup){ |
|
|
|
console.log(foldergroup) |
|
|
|
const menuMinWidth = 10; |
|
|
|
const offsetLeft = this.$el.getBoundingClientRect().left; // container margin left |
|
|
|
const offsetWidth = this.$el.offsetWidth; // container width |
|
|
|
const maxLeft = offsetWidth - menuMinWidth; // left boundary |
|
|
|
const left = e.clientX - offsetLeft; // 15: margin right |
|
|
|
if (left > maxLeft) { |
|
|
|
this.left = maxLeft; |
|
|
|
} else { |
|
|
|
this.left = left; |
|
|
|
} |
|
|
|
this.left = e.clientX; // fix 位置bug |
|
|
|
this.top = e.clientY; // fix 位置bug |
|
|
|
this.rightMenuvisible = false; |
|
|
|
this.rightFoldergroupMenuvisible = true; |
|
|
|
this.btnRightFoldergroup = foldergroup; |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 下载 |
|
|
|
*/ |
|
|
|
downLoadMyFoldergroup(){ |
|
|
|
this.rightFoldergroupMenuvisible = false; |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 返回原处 |
|
|
|
*/ |
|
|
|
returnMyFoldergroup(){ |
|
|
|
alert(111) |
|
|
|
this.$confirm("您确定要还原 " + this.btnRightFoldergroup.folderGroupName + " 文件夹,是否继续?", "", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}).then(() => { |
|
|
|
this.$axios({ |
|
|
|
method: "get", |
|
|
|
url: encodeURI(process.env.API_HOST + "folders/recycle/update/" +this.btnRightFoldergroup.folderGroupID+'/'+sessionStorage.userId), |
|
|
|
}) |
|
|
|
.then(function (response) { |
|
|
|
if (response.data.state == 1) { |
|
|
|
this.$notify({ |
|
|
|
title: "恭喜您", |
|
|
|
message: response.data.message, |
|
|
|
type: "success", |
|
|
|
offset: 100, |
|
|
|
duration: 2500 |
|
|
|
}); |
|
|
|
this.rightFoldergroupMenuvisible = false; |
|
|
|
this.listFiles(); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(function (error) { |
|
|
|
console.log(error); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 彻底删除 |
|
|
|
*/ |
|
|
|
delMyFoldergroup(){ |
|
|
|
this.$confirm("您正在删除 " + this.btnRightFoldergroup.folderGroupName + " 文件夹,是否继续?", "", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}).then(() => { |
|
|
|
this.$axios({ |
|
|
|
method: "delete", |
|
|
|
url: encodeURI(process.env.API_HOST + "folders/recycle/delete/" +this.btnRightFoldergroup.folderGroupID+'/'+sessionStorage.userId), |
|
|
|
}) |
|
|
|
.then(function (response) { |
|
|
|
if (response.data.state == 1) { |
|
|
|
this.$notify({ |
|
|
|
title: "恭喜您", |
|
|
|
message: response.data.message, |
|
|
|
type: "success", |
|
|
|
offset: 100, |
|
|
|
duration: 2500 |
|
|
|
}); |
|
|
|
this.rightFoldergroupMenuvisible = false; |
|
|
|
this.listFiles(); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(function (error) { |
|
|
|
console.log(error); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
rightMenuvisible(value) { |
|
|
|