@@ -47,7 +47,7 @@ | |||
<div class="pxline"></div> | |||
<div class="flex_right_pain_body"> | |||
<message-card | |||
v-for="message in (messageStatus === 1 ? messageList : hisMessageList)" | |||
v-for="message in (messageStatus === 1 ? messageList.filter(m => m.status === 1) : hisMessageList)" | |||
:key="message.id" | |||
:message="message" | |||
@mark-read="markMessageAsReaded" | |||
@@ -90,21 +90,21 @@ const router = new Router({ | |||
name: 'history', | |||
component: () => import('@/views/main_web/workspace/components/file-milestone'), | |||
}, | |||
{ | |||
path: '/cloud', | |||
name: 'cloud', | |||
component: () => import('@/views/main_web/cloud'), | |||
}, | |||
{ | |||
path: '/cloudrecycle', | |||
name: 'cloudrecycle', | |||
component: () => import('@/views/main_web/cloudrecycle'), | |||
}, | |||
{ | |||
path: '/cloudsource', | |||
name: 'cloudsource', | |||
component: () => import('@/views/main_web/cloudsource'), | |||
}, | |||
// { | |||
// path: '/cloud', | |||
// name: 'cloud', | |||
// component: () => import('@/views/main_web/cloud'), | |||
// }, | |||
// { | |||
// path: '/cloudrecycle', | |||
// name: 'cloudrecycle', | |||
// component: () => import('@/views/main_web/cloudrecycle'), | |||
// }, | |||
// { | |||
// path: '/cloudsource', | |||
// name: 'cloudsource', | |||
// component: () => import('@/views/main_web/cloudsource'), | |||
// }, | |||
// 探索者后台 | |||
{ | |||
path: '/company', | |||
@@ -1,271 +0,0 @@ | |||
<!-- | |||
* @Description: 云盘回收站组件 | |||
* @version: V1.0 | |||
* @Author: xzx | |||
* @Date: 2019-11-04 17:22:44 | |||
* @LastEditors: xzx | |||
* @LastEditTime: 2019-12-08 14:34:32 | |||
--> | |||
<template> | |||
<div class="layout_content cloudindexbody mt-48" id="app"> | |||
<section class="yiyun_warpContent"> | |||
<div class="yiyun-rows mt-30" id="newFolder"> | |||
<!-- 头部面包屑 --> | |||
<div class="yiyun-col-9"> | |||
<div class="yinyun_file_row"> | |||
<span class="yiyun_text-title mr-20"> | |||
<a href="javascript:;" @click="toCloud()">{{ projName }} | |||
<i class="icon font_family icon-icon_fanhui"></i> 回收站</a> | |||
</span> | |||
</div> | |||
</div> | |||
<div class="yiyun-col-3"> | |||
<div class="yinyun_file_row"> | |||
<el-button class="fr" @click="clearRecycle">清空</el-button> | |||
</div> | |||
</div> | |||
</div> | |||
</section> | |||
<section class="yiyun_warpContent"> | |||
<div class="yiyun-rows"> | |||
<!-- 云盘文件list --> | |||
<div class="yiyun_file_box mt-20"> | |||
<ul class="yiyun_cloud_fileList"> | |||
<li v-for="item in listFolderArch" v-bind:key="item.folderId"> | |||
<div class="bghover"> | |||
<div :class="'defultImage ' + item.extension" v-if=" | |||
item.extension != 'jpg' && | |||
item.extension != 'png' && | |||
item.extension != 'bmp' && | |||
item.extension != 'gif' && | |||
item.extension != 'jpeg' | |||
"></div> | |||
<div class="defultImage img_bg" v-if=" | |||
item.extension == 'jpg' || | |||
item.extension == 'png' || | |||
item.extension == 'bmp' || | |||
item.extension == 'gif' || | |||
item.extension == 'jpeg' | |||
"> | |||
<div class="file_Imgbox"> | |||
<img v-lazy="imgSrc + item.alias" alt="" class="file_Img" /> | |||
</div> | |||
</div> | |||
<div class="top_optionBar"> | |||
<el-dropdown> | |||
<span class="el-dropdown-link"> | |||
<i class="icon iconfont icon_small-icon_small_wenjianshezhi settingIcon"></i> | |||
</span> | |||
<el-dropdown-menu slot="dropdown"> | |||
<el-dropdown-item><span @click="downLoadFile(item)">下载</span></el-dropdown-item> | |||
<el-dropdown-item divided><span @click="returnMyFile(item)">放回原处</span></el-dropdown-item> | |||
<el-dropdown-item divided><span @click="deleteFile(item)">彻底删除</span></el-dropdown-item> | |||
</el-dropdown-menu> | |||
</el-dropdown> | |||
</div> | |||
</div> | |||
<span class="yiyun_file_infobox"> | |||
<span class="yiyun_file_name" :title="item.objectName" @click="showFile(item)">{{ item.objectName }}</span> | |||
<span class="yiyun_file_name">剩余{{ item.strDeletedDays }}天</span> | |||
</span> | |||
</li> | |||
</ul> | |||
</div> | |||
</div> | |||
</section> | |||
</div> | |||
</template> | |||
<script> | |||
export default { | |||
elNew: "#newFolder", | |||
data() { | |||
return { | |||
imgSrc: process.env.API_HOST + "archives/cover?path=", | |||
listFolderArch: [], | |||
projName: sessionStorage.projName, | |||
openFolderId: null | |||
}; | |||
}, | |||
mounted: function () { | |||
this.listFolderData(); | |||
}, | |||
methods: { | |||
/** | |||
* 跳转到云盘页面 | |||
*/ | |||
toCloud: function () { | |||
sessionStorage.login = "cloud"; | |||
this.$router.push({ | |||
path: "/cloud" | |||
}); | |||
}, | |||
/** | |||
* 获取列表数据 | |||
*/ | |||
listFolderData: function () { | |||
var thisApp = this; | |||
thisApp.listFolderArch = []; | |||
this.$axios({ | |||
method: "get", | |||
url: encodeURI( | |||
process.env.API_HOST + | |||
"folders/resource/recycle/" + | |||
sessionStorage.userId + | |||
"/" + | |||
sessionStorage.projId | |||
) | |||
}) | |||
.then(function (response) { | |||
thisApp.listFolderArch = response.data.data; | |||
}) | |||
.catch(function (error) { | |||
console.log(error); | |||
}); | |||
}, | |||
/** | |||
* 下载文件 | |||
* item:文件对象 | |||
*/ | |||
downLoadFile: function (item) { | |||
if (item.alias != null) { | |||
var url = process.env.API_HOST + "archives/download/" + item.objectID; | |||
var iframe = document.createElement("iframe"); | |||
iframe.style.display = "none"; | |||
iframe.src = url; | |||
document.body.appendChild(iframe); | |||
} | |||
}, | |||
/** | |||
* 删除文件 | |||
* item:文件对象 | |||
*/ | |||
deleteFile: function (item) { | |||
var thisApp = this; | |||
this.$confirm("彻底删除文件:" + item.objectName + ", 是否继续?", "提示", { | |||
confirmButtonText: "确定", | |||
cancelButtonText: "取消", | |||
type: "warning" | |||
}) | |||
.then(() => { | |||
this.$axios({ | |||
method: "delete", | |||
url: encodeURI(process.env.API_HOST + "folders/resource/recycle"), | |||
data: item | |||
}) | |||
.then(response => { | |||
if (response.data.state == 1) { | |||
thisApp.$notify({ | |||
message: "删除成功!", | |||
type: "success", | |||
offset: 100, | |||
duration: 2500 | |||
}); | |||
thisApp.listFolderData(); | |||
} else { | |||
thisApp.$notify({ | |||
message: response.data.message, | |||
type: "error", | |||
offset: 100, | |||
duration: 5000 | |||
}); | |||
} | |||
}) | |||
.catch(error => { | |||
console.log(error); | |||
}); | |||
}) | |||
.catch(() => {}); | |||
}, | |||
/** | |||
* 还原文件 | |||
* file:源数据 | |||
*/ | |||
returnMyFile: function (file) { | |||
var thisApp = this; | |||
this.$confirm("此操作将还原文件, 是否继续?", "", { | |||
confirmButtonText: "确定", | |||
cancelButtonText: "取消", | |||
type: "warning" | |||
}) | |||
.then(() => { | |||
file.deleted = 0; | |||
this.$axios({ | |||
method: "put", | |||
url: encodeURI(process.env.API_HOST + "archives"), | |||
data: file | |||
}) | |||
.then(function (response) { | |||
if (response.data.state == 1) { | |||
thisApp.$notify({ | |||
message: response.data.message, | |||
type: "success", | |||
offset: 100, | |||
duration: 2500 | |||
}); | |||
thisApp.listFolderData(); | |||
} | |||
}) | |||
.catch(function (error) { | |||
console.log(error); | |||
}); | |||
}) | |||
.catch(() => { | |||
thisApp.$notify({ | |||
type:"warning", | |||
message: "操作已取消", | |||
offset: 100, | |||
duration: 1300 | |||
}); | |||
}); | |||
}, | |||
/** | |||
* 清空 | |||
*/ | |||
clearRecycle: function () { | |||
if (thisApp.listFolderArch.length <= 0) { | |||
return; | |||
} | |||
var thisApp = this; | |||
this.$confirm("您正在进行清空操作.是否继续", "提示", { | |||
confirmButtonText: "确定", | |||
cancelButtonText: "取消", | |||
type: "warning" | |||
}) | |||
.then(() => { | |||
this.$axios({ | |||
method: "delete", | |||
url: encodeURI( | |||
process.env.API_HOST + "folders/resource/recycle/list" | |||
), | |||
data: thisApp.listFolderArch | |||
}) | |||
.then(response => { | |||
if (response.data.state == 1) { | |||
thisApp.$notify({ | |||
message: "清空成功!", | |||
type: "success", | |||
offset: 100, | |||
duration: 2500 | |||
}); | |||
thisApp.listFolderData(); | |||
} else { | |||
thisApp.$notify({ | |||
message: response.data.message, | |||
type: "error", | |||
offset: 100, | |||
duration: 5000 | |||
}); | |||
} | |||
}) | |||
.catch(error => { | |||
console.log(error); | |||
}); | |||
}) | |||
.catch(() => {}); | |||
} | |||
} | |||
}; | |||
</script> |
@@ -1,222 +0,0 @@ | |||
<!-- | |||
* @Description: 云盘资源管理器组件 | |||
* @version: V1.0 | |||
* @Author: xzx | |||
* @Date: 2019-11-04 17:22:44 | |||
* @LastEditors: xzx | |||
* @LastEditTime: 2019-12-08 14:33:54 | |||
--> | |||
<template> | |||
<div id="app"> | |||
<div class="layout_content"> | |||
<section class="title_section"> | |||
<div class="EC_col_8"> | |||
<div class="adminnavBox"> | |||
<h3>资源管理器</h3> | |||
</div> | |||
</div> | |||
</section> | |||
<section class="yiyun_section1"> | |||
<div class="fl_navBox"> | |||
<div class="fl_navBox_body"> | |||
<div class="admin_treeBox navtree"> | |||
<!-- 树形导航 --> | |||
<div class="navtreebox"> | |||
<template> | |||
<el-tree :data="listFolderData" node-key="id" default-expand-all ref="tree" :indent="10" @node-click="nodeClick" :highlight-current="true" :filter-node-method="filterTreeNode" :expand-on-click-node="false" class="mt-10 chengjitree"> | |||
<span class="custom-tree-node" slot-scope="{ node }"> | |||
<span> | |||
<i class="el-icon-floder"></i> | |||
<i :class="node.icon"></i> | |||
<span>{{ node.label }}</span> | |||
</span> | |||
</span> | |||
</el-tree> | |||
</template> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="fl_contentBox"> | |||
<div class="admin_contentBox_body"> | |||
<div class="admin_contentBox_bodyPain" v-if="currentPain == 1"> | |||
<!-- 右侧内容Box --> | |||
<div class="mlr-10"> | |||
<h4 class="admintitle">查看文件</h4> | |||
</div> | |||
<div class="mlr-10"> | |||
<div class="border-line"></div> | |||
</div> | |||
<div class="mlr-10"> | |||
<div class="yiyunTable_list"> | |||
<!-- form --> | |||
<el-table :data="listWorkFolderTable" style="width: 100%"> | |||
<el-table-column label width="36"> | |||
<template> | |||
<img src="/static/img/folder1.svg" /> | |||
</template> | |||
</el-table-column> | |||
<el-table-column prop="nodeName" label="文件名"> | |||
<template slot-scope="scope"> | |||
<span style="cursor: pointer;">{{ | |||
scope.row.objectName | |||
}}</span> | |||
</template> | |||
</el-table-column> | |||
<el-table-column prop="nodeName" label="负责人"> | |||
<template slot-scope="scope"> | |||
<span>{{ scope.row.managerName }}</span> | |||
</template> | |||
</el-table-column> | |||
<el-table-column prop="nodeName" label="创建时间"> | |||
<template slot-scope="scope"> | |||
<span>{{ scope.row.strCreateTime }}</span> | |||
</template> | |||
</el-table-column> | |||
<el-table-column prop="nodeName" label="修改时间"> | |||
<template slot-scope="scope"> | |||
<span>{{ scope.row.strModifytime }}</span> | |||
</template> | |||
</el-table-column> | |||
<el-table-column prop="nodeName" label="文件类型"> | |||
<template slot-scope="scope"> | |||
<span v-if="scope.row.baseType == 1">文件</span> | |||
<span v-if="scope.row.baseType == 0">文件夹</span> | |||
</template> | |||
</el-table-column> | |||
<!-- <el-table-column label="操作" width="150px"> | |||
<template slot-scope="scope"> | |||
<span class="option_grayBtn ml-20">操作记录</span> | |||
</template> | |||
</el-table-column> --> | |||
</el-table> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</section> | |||
</div> | |||
</div> | |||
</template> | |||
<script> | |||
export default { | |||
elNew: "#app", | |||
data() { | |||
return { | |||
listWorkFolderTable: [], | |||
currentPain: "1", //右侧默认面板 | |||
listFolderData: [], | |||
filterTreeText: "" //搜索tree | |||
}; | |||
}, | |||
mounted: function () { | |||
this.getListFolderData(); | |||
}, | |||
methods: { | |||
/* | |||
* 筛选符合条件的tree节点 | |||
*/ | |||
filterTreeNode: function (value, data) { | |||
if (!value) return true; | |||
return data.label.indexOf(value) !== -1; | |||
}, | |||
/** | |||
* 树节点-点击事件 | |||
*/ | |||
nodeClick: function (data) { | |||
if (data.label == "回收站") { | |||
this.getListCloudRecycle(); | |||
} else { | |||
var superid = data.id; | |||
if (data.id == data.data.projID) { | |||
superid = data.data.folderID; | |||
} | |||
this.getListFolderNode(superid); | |||
} | |||
}, | |||
/** | |||
* 获取树节点数据 | |||
*/ | |||
getListFolderData: function () { | |||
var thisApp = this; | |||
var param = { | |||
userid: sessionStorage.userId, | |||
projid: sessionStorage.projId | |||
}; | |||
this.$axios({ | |||
method: "get", | |||
url: encodeURI( | |||
process.env.API_HOST + | |||
"folders/resource/manager/" + | |||
param.userid + | |||
"/" + | |||
param.projid | |||
) | |||
}) | |||
.then(response => { | |||
thisApp.listFolderData = response.data.data; | |||
}) | |||
.catch(error => { | |||
console.log(error); | |||
}); | |||
}, | |||
/** | |||
* 获取文件夹节点数据 | |||
*/ | |||
getListFolderNode: function (superid) { | |||
var thisApp = this; | |||
var userid = sessionStorage.userId; | |||
var projid = sessionStorage.projId; | |||
this.$axios({ | |||
method: "get", | |||
url: encodeURI( | |||
process.env.API_HOST + | |||
"folders/resource/manager/" + | |||
userid + | |||
"/" + | |||
projid + | |||
"/" + | |||
superid | |||
) | |||
}) | |||
.then(response => { | |||
thisApp.listWorkFolderTable = response.data.data; | |||
}) | |||
.catch(error => { | |||
thisApp.listWorkFolderTable = []; | |||
}); | |||
}, | |||
/** | |||
* 获取回收站数据 | |||
*/ | |||
getListCloudRecycle: function () { | |||
var thisApp = this; | |||
this.$axios({ | |||
method: "get", | |||
url: encodeURI( | |||
process.env.API_HOST + | |||
"folders/resource/recycle/" + | |||
sessionStorage.userId + | |||
"/" + | |||
sessionStorage.projId | |||
) | |||
}) | |||
.then(function (response) { | |||
thisApp.listWorkFolderTable = response.data.data; | |||
}) | |||
.catch(function (error) { | |||
console.log(error); | |||
}); | |||
} | |||
}, | |||
watch: { | |||
/* | |||
* 筛选tree关键字 | |||
*/ | |||
filterTreeText(val) { | |||
this.$refs.tree.filter(val); | |||
} | |||
} | |||
}; | |||
</script> |
@@ -1,554 +0,0 @@ | |||
<!-- | |||
* @Description: | |||
* @version: | |||
* @Author: xzx | |||
* @Date: 2019-11-04 17:22:44 | |||
* @LastEditors: xzx | |||
* @LastEditTime: 2019-12-09 14:55:18 | |||
--> | |||
<template> | |||
<div id="app" v-cloak> | |||
<div class="listfilewarp1"> | |||
<div class="layout_content2"> | |||
<!-- 文件大box --> | |||
<div class="juzhongtext" v-if="isShowRecycleTip"> | |||
回收站暂时没有文件! | |||
</div> | |||
<template v-if="!isShowRecycleTip"> | |||
<section | |||
class="yiyun_section_warp list_fileBox" | |||
v-for="(folder, index) in filesList" | |||
:key="index" | |||
> | |||
<div | |||
class="yinyong_warpBox hidescollbar" | |||
@click="clickYinyongWarpBox()" | |||
> | |||
<div class="yiyun_section_top" id="bignav"> | |||
<!-- 系统时间 --> | |||
<div class="section_item fl section_item_aside_fl"> | |||
<h3 class="yiyuntitle">{{ folder.folderName }}</h3> | |||
</div> | |||
<!-- 右侧操作栏 --> | |||
<div class="section_item fr section_item_aside_fr"> | |||
<div class="fr ml-10"> | |||
<el-button @click="clearRecycle(folder)">清空</el-button> | |||
</div> | |||
<div class="fifle_search fr"> | |||
<!-- <el-input placeholder="搜索我的文件" prefix-icon="icon font_family icon-icon_sousuo searchsize" class="el-input_mini" v-model="searchMyFile"></el-input> --> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="clear"></div> | |||
<!-- 应用列表(缩略图) --> | |||
<div class="yiyun_row_recyle_warp"> | |||
<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> | |||
<div | |||
class="defultImage-mid img_bg-mid" | |||
v-if=" | |||
file.extension == 'jpg' || | |||
file.extension == 'png' || | |||
file.extension == 'bmp' || | |||
file.extension == 'gif' || | |||
file.extension == 'jpeg' | |||
" | |||
> | |||
<div class="file_Imgbox-mid"> | |||
<img | |||
v-lazy="imgSrc + file.alias" | |||
alt="" | |||
class="file_Img" | |||
/> | |||
</div> | |||
</div> | |||
<div class="top_optionBar"> | |||
<el-dropdown> | |||
<span class="el-dropdown-link"> | |||
<i | |||
class="icon iconfont icon_small-icon_small_wenjianshezhi settingIcon" | |||
></i> | |||
</span> | |||
<el-dropdown-menu slot="dropdown"> | |||
<el-dropdown-item | |||
><span | |||
@click="downLoadMyFile(file)" | |||
v-if=" | |||
file.extension != 'map' && | |||
file.extension != 'supermap' | |||
" | |||
>下载</span | |||
></el-dropdown-item | |||
> | |||
<el-dropdown-item divided | |||
><span @click="returnMyFile(file)" | |||
>放回原处</span | |||
></el-dropdown-item | |||
> | |||
<el-dropdown-item divided | |||
><span @click="delMyFile(file)" | |||
>彻底删除</span | |||
></el-dropdown-item | |||
> | |||
</el-dropdown-menu> | |||
</el-dropdown> | |||
</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) | |||
" | |||
@click="clickFoldergroup(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> | |||
<li @click="returnMyFile(BtnRightFile)">放回原处</li> | |||
<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> | |||
</template> | |||
</div> | |||
</div> | |||
</div> | |||
</template> | |||
<script> | |||
export default { | |||
data() { | |||
return { | |||
imgSrc: process.env.API_HOST + "archives/cover?path=", | |||
filesList: [], | |||
projId: sessionStorage.projId, | |||
userId: sessionStorage.userId, | |||
BtnRightFile: "", //右键文件对象 | |||
top: 0, | |||
left: 0, | |||
rightMenuvisible: false, | |||
isShowRecycleTip: false, | |||
/*********分组菜单 ***************/ | |||
rightFoldergroupMenuvisible: false, | |||
btnRightFoldergroup: {}, | |||
}; | |||
}, | |||
mounted: function () { | |||
this.listFiles(); | |||
}, | |||
methods: { | |||
/** | |||
* 获取回收站里的文件 | |||
*/ | |||
async getListFiles(){ | |||
//const res = await fetchApi('') | |||
}, | |||
/** | |||
* 获取当前工作下文件 | |||
*/ | |||
listFiles: function () { | |||
var thisApp = this; | |||
thisApp.rightMenuvisible = false; | |||
thisApp | |||
.$axios({ | |||
method: "get", | |||
url: encodeURI( | |||
process.env.API_HOST + "folders/resource/recycle/" + thisApp.userId | |||
), | |||
}) | |||
.then((response) => { | |||
thisApp.filesList = response.data.data; | |||
if (thisApp.filesList.length > 0) { | |||
thisApp.isShowRecycleTip = false; | |||
} else { | |||
thisApp.isShowRecycleTip = true; | |||
} | |||
}) | |||
.catch((error) => { | |||
console.log(error); | |||
}); | |||
}, | |||
/** | |||
* 下载文件 | |||
* item:文件对象 | |||
*/ | |||
downLoadMyFile: function (item) { | |||
if (item.alias != null) { | |||
var url = process.env.API_HOST + "archives/download/" + item.archID; | |||
var iframe = document.createElement("iframe"); | |||
iframe.style.display = "none"; | |||
iframe.src = url; | |||
document.body.appendChild(iframe); | |||
} | |||
}, | |||
/** | |||
* 还原文件 | |||
* file:源数据 | |||
*/ | |||
returnMyFile: function (file) { | |||
var thisApp = this; | |||
file.deleted = 0; | |||
this.$axios({ | |||
method: "put", | |||
url: encodeURI( | |||
process.env.API_HOST + | |||
"archives/update/restore/" + | |||
file.archID + | |||
"/" + | |||
sessionStorage.userId | |||
), | |||
data: file, | |||
}) | |||
.then(function (response) { | |||
if (response.data.state == 1) { | |||
thisApp.$notify({ | |||
message: response.data.message, | |||
type: "success", | |||
offset: 100, | |||
duration: 2500, | |||
}); | |||
thisApp.listFiles(); | |||
} | |||
}) | |||
.catch(function (error) { | |||
console.log(error); | |||
}); | |||
}, | |||
/** | |||
* 删除我的文件 | |||
* file:源数据 | |||
*/ | |||
delMyFile: function (file) { | |||
var thisApp = this; | |||
this.$confirm("您正在删除 " + file.archName + " 文件是否继续?", "", { | |||
confirmButtonText: "确定", | |||
cancelButtonText: "取消", | |||
type: "warning", | |||
}) | |||
.then(() => { | |||
this.$axios({ | |||
method: "delete", | |||
url: encodeURI( | |||
process.env.API_HOST + | |||
"folders/resource/recycle/" + | |||
file.archID + | |||
"/" + | |||
sessionStorage.userId | |||
), | |||
}) | |||
.then(function (response) { | |||
if (response.data.state == 1) { | |||
thisApp.$notify({ | |||
message: response.data.message, | |||
type: "success", | |||
offset: 100, | |||
duration: 2500, | |||
}); | |||
thisApp.listFiles(); | |||
} | |||
}) | |||
.catch(function (error) { | |||
console.log(error); | |||
}); | |||
}) | |||
.catch(() => { | |||
thisApp.$notify({ | |||
message: "已取消操作", | |||
type: "info", | |||
offset: 100, | |||
duration: 2500, | |||
}); | |||
}); | |||
}, | |||
/** | |||
* 清空 | |||
*/ | |||
clearRecycle: function (currFileList) { | |||
if (currFileList.length <= 0) { | |||
return; | |||
} | |||
var listFolder = []; | |||
listFolder.push(currFileList); | |||
var data = { userId: sessionStorage.userId, listFolder: listFolder }; | |||
var thisApp = this; | |||
this.$confirm("您正在进行清空操作,是否继续?", "", { | |||
confirmButtonText: "确定", | |||
cancelButtonText: "取消", | |||
type: "warning", | |||
}) | |||
.then(() => { | |||
this.$axios({ | |||
method: "delete", | |||
url: encodeURI( | |||
process.env.API_HOST + "folders/resource/recycle/listarch" | |||
), | |||
data: data, | |||
}) | |||
.then((response) => { | |||
if (response.data.state == 1) { | |||
thisApp.$notify({ | |||
message: "清空成功!", | |||
type: "success", | |||
offset: 100, | |||
duration: 2500, | |||
}); | |||
thisApp.listFiles(); | |||
} | |||
}) | |||
.catch((error) => { | |||
console.log(error); | |||
}); | |||
}) | |||
.catch(() => { | |||
thisApp.$notify({ | |||
message: "已取消操作", | |||
type: "info", | |||
offset: 100, | |||
duration: 2500, | |||
}); | |||
}); | |||
}, | |||
/** | |||
* 右键文件 | |||
*/ | |||
rightShowMenu: function (e, file) { | |||
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 = true; | |||
this.rightFoldergroupMenuvisible = false; | |||
this.BtnRightFile = file; | |||
}, | |||
/** | |||
* 关闭右键 | |||
*/ | |||
closeShowMenu: function () { | |||
this.rightMenuvisible = false; | |||
}, | |||
/******* 右键文件分组菜单 *********/ | |||
clickYinyongWarpBox: function () { | |||
this.rightMenuvisible = false; | |||
this.rightFoldergroupMenuvisible = false; | |||
}, | |||
/** | |||
* 单机分组 | |||
*/ | |||
clickFoldergroup: function (foldergroup) { | |||
this.rightFoldergroupMenuvisible = false; | |||
}, | |||
/** | |||
* 右键文件分组 | |||
*/ | |||
rightFoldergroupShowMenu: function (e, 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() { | |||
this.rightFoldergroupMenuvisible = false; | |||
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((response) => { | |||
if (response.data.state == 1) { | |||
this.$notify({ | |||
message: response.data.message, | |||
type: "success", | |||
offset: 100, | |||
duration: 2500, | |||
}); | |||
this.rightFoldergroupMenuvisible = false; | |||
this.listFiles(); | |||
} | |||
}) | |||
.catch(function (error) { | |||
console.log(error); | |||
}); | |||
}) | |||
.catch(() => { | |||
this.$notify({ | |||
message: "已取消操作", | |||
type: "info", | |||
offset: 100, | |||
duration: 2500, | |||
}); | |||
}); | |||
}, | |||
/** | |||
* 彻底删除 | |||
*/ | |||
delMyFoldergroup: function () { | |||
this.rightFoldergroupMenuvisible = false; | |||
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((response) => { | |||
if (response.data.state == 1) { | |||
this.$notify({ | |||
message: response.data.message, | |||
type: "success", | |||
offset: 100, | |||
duration: 2500, | |||
}); | |||
this.rightFoldergroupMenuvisible = false; | |||
this.listFiles(); | |||
} | |||
}) | |||
.catch(function (error) { | |||
console.log(error); | |||
}); | |||
}) | |||
.catch(() => { | |||
this.$notify({ | |||
message: "已取消删除", | |||
type: "info", | |||
offset: 100, | |||
duration: 2500, | |||
}); | |||
}); | |||
}, | |||
}, | |||
watch: { | |||
rightMenuvisiblerightMenuvisible(value) { | |||
if (value) { | |||
document.body.addEventListener("click", this.closeShowMenu); | |||
} else { | |||
document.body.removeEventListener("click", this.closeShowMenu); | |||
} | |||
}, | |||
}, | |||
}; | |||
</script> | |||
<style></style> |
@@ -1,81 +0,0 @@ | |||
<template> | |||
<div> | |||
<div class="yiyun_wenjian_list loding-mask-parent"> | |||
<div> | |||
<!-- 非图片文件图标 --> | |||
<div | |||
v-if="!oneOf(file.extension, imgExtensionList) && !oneOf(file.extension, VideoExtensionList)" | |||
class="defultImage-mid toumin" | |||
:class="`${file.extension}-mid ${!oneOf(file.extension,filePreviewList) ? '':''} ` " | |||
/> | |||
<!-- 图片文件图标 --> | |||
<div | |||
v-else-if="oneOf(file.extension, imgExtensionList)" | |||
class="defultImage-mid img_bg-mid toumin" | |||
> | |||
<div class="file_Im gbox-mid"> | |||
<img v-lazy="file.alias" alt class="file_Img" /> | |||
</div> | |||
</div> | |||
<!-- 视频文件图标 --> | |||
<div | |||
v-else | |||
class="defultImage-mid video-mid toumin" | |||
> | |||
</div> | |||
<!-- 右键菜单 --> | |||
<div class="contextmenu" v-show="isFileRightMenuVisible" | |||
:style="{ top: fileRightMenuTop + 'px', left: fileRightMenuLeft + 'px'}" | |||
> | |||
<ul class="rightMenu fileRightMenu"> | |||
<li v-if="fileInLocal && isClient && !otherUserIsWorking" @click.stop="openfileBtnClick">打开</li> | |||
<li v-else-if="!fileInLocal && isClient" class="function-disabled" title="请先下载文件再打开">打开</li> | |||
<li v-else-if="fileInLocal && isClient && otherUserIsWorking" class="function-disabled" title="文件工作中无法打开">打开</li> | |||
<li v-if="fileInLocal && isClient && !otherUserIsWorking" @click.stop="openFileWith">打开方式</li> | |||
<li v-else-if="(!fileInLocal || otherUserIsWorking) && isClient" class="function-disabled">打开方式</li> | |||
<li v-if="isClient && isInWorkFolder" @click.stop="copyFileBtnClick">创建文件副本</li> | |||
<li v-if="isClient && isInWorkFolder && !otherUserIsWorking" @click.stop="deleteFileClick">移动到回收站</li> | |||
<li v-if="isClient && isInWorkFolder && otherUserIsWorking" class="function-disabled" title="文件工作中无法删除">移动到回收站</li> | |||
<li v-if="!isClient && oneOf(file.extension,filePreviewList)" | |||
@click.stop="filePreview">在线预览</li> | |||
<li v-else-if="!isClient && !(oneOf(file.extension,filePreviewList))" class="function-disabled" title="暂时不支持此类文件的预览">在线预览</li> | |||
</ul> | |||
</div> | |||
<!-- 右上设置按钮 --> | |||
<!-- 下拉列表 --> | |||
<div class="top_optionBar" v-show="false"> | |||
<el-dropdown> | |||
<span class="el-dropdown-link"> | |||
<i | |||
class="icon iconfont icon_small-icon_small_wenjianshezhi settingIcon" | |||
/> | |||
</span> | |||
<el-dropdown-menu slot="dropdown"> | |||
<el-dropdown-item | |||
@click.native="fileClick(file)" | |||
v-if=" | |||
isClient && | |||
fileInLocal | |||
" | |||
> | |||
<span>打开</span> | |||
</el-dropdown-item> | |||
</el-dropdown-menu> | |||
</el-dropdown> | |||
</div> | |||
<!-- 文件名 --> | |||
<strong | |||
class="yiyunwenjian_name" | |||
:title="file.archName + '.' + file.extension" | |||
>{{ file.archName }}<span v-show="!oneOf(file.extension, RecExtensionList)">.{{file.extension}}</span></strong> | |||
<span | |||
v-if="isInWorkFolder && file.createUserId != currentUserId" | |||
class="yiyunwenjian_infodesc" | |||
>{{ file.createUserName }} 创建</span> | |||
</div> | |||
</div> | |||
</div> | |||
</template> |
@@ -8,6 +8,7 @@ | |||
:titleList="titleList" | |||
class="operate-bar" | |||
@changeContentBtnClick="changeContentBtnClick" | |||
v-show="false" | |||
/> | |||
<div class="out-wrap"> | |||
<div class="search-res-page-wrap"> | |||