瀏覽代碼

[VersionBeta] V.1.0.0.0

[Adds]
1.右键菜单移到回收站
2.回收站显示文件和文件夹
3.清空按钮
4.回收站里右键菜单
new-cli
zxm 4 年之前
父節點
當前提交
0f911ef421
共有 2 個檔案被更改,包括 189 行新增23 行删除
  1. +138
    -18
      src/views/main_web/recycle.vue
  2. +51
    -5
      src/views/main_web/workspace.vue

+ 138
- 18
src/views/main_web/recycle.vue 查看文件

@@ -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) {


+ 51
- 5
src/views/main_web/workspace.vue 查看文件

@@ -849,12 +849,10 @@
>
<div
class="yiyun_wenjian_list"
@dblclick="intoFoldergroup(foldergroup)"
>
@dblclick="intoFoldergroup(foldergroup)">
<div
class="defultImage-mid foldernew-mid"
@contextmenu.prevent="rightShowMenu($event, foldergroup, 4)"
>
@contextmenu.prevent="rightShowMenu($event, foldergroup, 4)">
</div>
<strong
class="yiyunwenjian_name"
@@ -1736,7 +1734,7 @@
<li @click="copyAndMoveFoldergroup(btnRightFoldergoup,'move')">转移至其他工作</li>
<li @click="copyAndMoveFoldergroup(btnRightFoldergoup,'copy')">复制至其它工作</li>
<li @click="renameFoldergroup(btnRightFoldergoup)">重命名</li>
<li>移到回收站</li>
<li @click="removeRecycle(btnRightFoldergoup)">移到回收站</li>
</ul>
</div>
</div>
@@ -4141,6 +4139,7 @@ export default {
file.deleted = 1;
file.createTime = new Date(file.createTime);
file.modifyTime = new Date(file.modifyTime);
file.modifyUserID = sessionStorage.userId
this.$axios({
method: "put",
url: encodeURI(process.env.API_HOST + "archives/update/del"),
@@ -5917,6 +5916,53 @@ export default {
console.log(error);
});
},
/**
* 文件分组- 移到回收站
*/
removeRecycle:function(btnRightFoldergoup){
var thisApp = this
this.$axios({
method: "get",
url: encodeURI(process.env.API_HOST + "folders/foldergroup/del/update/"+btnRightFoldergoup.folderGroupID+"/"+sessionStorage.userId),
data: {
foldergroupId:btnRightFoldergoup.folderGroupID,
userId:sessionStorage.userId
}
}).then(response => {
if (response.data.state == 1) {
if (thisApp.dbClickSelectedFolderGroupData == null || JSON.stringify(thisApp.dbClickSelectedFolderGroupData) == '{}') {
thisApp.folderGroupBreads=[]
thisApp.listFiles();
}else {
thisApp.intoFoldergroup(thisApp.dbClickSelectedFolderGroupData);
}
this.$notify({
title: "恭喜您",
message: "移至回收站成功!",
type: "success",
offset: 100,
duration: 2500
});
} else {
this.$notify({
title: "温馨提示",
message: response.data.message,
type: "error",
offset: 100,
duration: 5000
});
}
}).catch(error => {
console.log(error);
this.$notify({
title: "温馨提示",
message: "移至回收站成功失败!",
type: "error",
offset: 100,
duration: 5000
});
});
}
/****协作空间 拖拽功能方法 end*/
},
watch: {


Loading…
取消
儲存