|
|
|
@ -440,7 +440,7 @@ function onPrivateView(row:matterInfo){ |
|
|
|
const info =btoa(encodeURIComponent(`${row.name}`)) //预览模式不需要绝对路径,只核对一下文件名即可 |
|
|
|
const _url=`${siteHost}${apiURL}/alien/download/${row.uuid}/${row.name}?access_token=${_token}` |
|
|
|
//前半部分内容是为了校验信息,主要内容是fileurl |
|
|
|
window.open(`/#/onlyoffice?name=${row.name}&dtype=${_type}&info=${info}&fileurl=`+encodeURIComponent(_url),"_blank") |
|
|
|
window.open(`/#/onlyoffice?name=${row.name}&dtype=${_type}&info=${info}&fileurl=`+window.btoa(encodeURIComponent(_url)),"_blank") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
@ -453,6 +453,33 @@ function onPrivateView(row:matterInfo){ |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//onlyoffice在线编辑 |
|
|
|
async function onlyOfficeEdit(row:matterInfo){ |
|
|
|
const _type=fileType(row.name!) |
|
|
|
if(_type===""){ |
|
|
|
alert("暂不支持该类型编辑") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
let _token=document.cookie.match(/hxpan=([\w-]*)/) |
|
|
|
if (_token&&_token.length>1){ |
|
|
|
_token=_token[1] |
|
|
|
} |
|
|
|
|
|
|
|
ElMessageBox.confirm("线上资源有限,确定继续线上编辑吗", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning", |
|
|
|
}).then(()=>{ |
|
|
|
//office file |
|
|
|
//base64 encode for MASK |
|
|
|
const _verify = btoa(row.uuid.match(/(\w+-\w+)/)![0]+"true") //增加一个权限验证的标记 |
|
|
|
const info =btoa(encodeURIComponent(`${row.userUuid}/root${row.path}`)) //编辑模式必须要全路径 |
|
|
|
const _url=`${siteHost}${apiURL}/alien/download/${row.uuid}/${row.name}?access_token=${_token}` |
|
|
|
window.open(`/#/onlyoffice?name=${row.name}&dtype=${_type}&info=${info}&verify=${_verify}&fileurl=`+window.btoa(encodeURIComponent(_url)),"_blank") |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//--------------UPGRADE: multy file upload section---------------- |
|
|
|
|
|
|
|
//自定义上传,目的是支持多文件上传, 使用html原生组件,是为了解决并发问题 |
|
|
|
@ -756,7 +783,7 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
<el-button size="small" :icon="View" circle @click="onPrivateView(scope.row)"></el-button> |
|
|
|
<el-button size="small" :icon="Share" circle @click="onShareMatter(scope.row)"></el-button> |
|
|
|
<el-button size="small" :icon="Download" circle @click="onDownload(scope.row)"></el-button> |
|
|
|
<!-- <el-button size="small" :icon="Edit" circle @click="onMatterRename(scope.row)"></el-button> --> |
|
|
|
<el-button size="small" :icon="Edit" circle @click="onlyOfficeEdit(scope.row)"></el-button> |
|
|
|
<el-button size="small" :icon="Delete" circle @click="onDelMatter(scope.row)"></el-button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
@ -772,7 +799,7 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
<div class="table-grid" v-else> |
|
|
|
<div class="grid-item" v-for="row in matterList"> |
|
|
|
<div class="grid"> |
|
|
|
<div class="grid-box" @mouseover="handleMouseEnter(row)"> |
|
|
|
<div class="grid-box" @click="handleMouseEnter(row)"> |
|
|
|
<svg-icon v-if="row.dir" icon-class="folder-icon" size="80px"/> |
|
|
|
<el-image v-else-if="getFileIcon(row.name)==='img'" style="width: 80px;" :preview-src-list="[getImageDownloadURL(row.uuid,row.name)]" :src="getImagePreivewURL(row.uuid,row.name)" /> |
|
|
|
<svg-icon v-else :icon-class="getFileIcon(row.name)+'-icon'" size="80px"/> |
|
|
|
@ -781,8 +808,9 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
</div> |
|
|
|
<div class="grid-menus" v-show="currentHoverRow === row.name"> |
|
|
|
<el-button v-if="getFileIcon(row.name)!='img'" size="small" :icon="View" circle @click="onPrivateView(row)"></el-button> |
|
|
|
<el-button size="small" :icon="Share" circle @click="onShareMatter(row)"></el-button> |
|
|
|
<el-button size="small" :icon="Share" circle @click="onShareMatter(row)"></el-button> |
|
|
|
<el-button size="small" :icon="Download" circle @click="onDownload(row)"></el-button> |
|
|
|
<el-button size="small" :icon="Edit" circle @click="onlyOfficeEdit(row)"></el-button> |
|
|
|
<el-button size="small" :icon="Delete" circle @click="onDelMatter(row)"></el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -862,6 +890,7 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
display: flex; |
|
|
|
flex-wrap: wrap; /* 关键属性,允许子元素自动换行 */ |
|
|
|
.grid-item{ |
|
|
|
position: relative; |
|
|
|
height: 134px; |
|
|
|
width: 134px; |
|
|
|
margin: 5px; |
|
|
|
@ -872,6 +901,14 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
align-items: center; |
|
|
|
text-align:center; |
|
|
|
} |
|
|
|
.grid-menus{ |
|
|
|
position: absolute; |
|
|
|
top: 10px; |
|
|
|
button{ |
|
|
|
color: #000000; |
|
|
|
margin: 4px; |
|
|
|
} |
|
|
|
} |
|
|
|
.grid{ |
|
|
|
:hover { |
|
|
|
background-color: #c4c4c4; /* 悬停时的背景色 */ |
|
|
|
|