Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zys-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
zys-ui
Commits
5f04d733
提交
5f04d733
authored
8月 16, 2023
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
下载、批量下载联调;新建文件接口联调
上级
2c86b025
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
145 行增加
和
20 行删除
+145
-20
FileTable.vue
src/components/common/FileTable.vue
+10
-2
Box.vue
src/components/file/box/contextMenu/Box.vue
+1
-1
FileGrid.vue
src/components/file/components/FileGrid.vue
+1
-1
OperationMenu.vue
src/components/file/components/OperationMenu.vue
+8
-2
file.js
src/libs/qiwen/globalFunction/file.js
+92
-1
staticRoute.js
src/router/staticRoute.js
+11
-11
index.vue
src/views/read/wpsReader/index.vue
+22
-2
没有找到文件。
src/components/common/FileTable.vue
浏览文件 @
5f04d733
...
@@ -42,7 +42,11 @@
...
@@ -42,7 +42,11 @@
:title=
"`$
{scope.row.isDir ? '' : '点击预览'}`"
:title=
"`$
{scope.row.isDir ? '' : '点击预览'}`"
style="width: 30px; max-height: 30px; cursor: pointer"
style="width: 30px; max-height: 30px; cursor: pointer"
@click="
@click="
$file.handleFileNameClick(scope.row, scope.$index, sortedFileList)
$file.handleFileNameClickNew(
scope.row,
scope.$index,
sortedFileList
)
"
"
v-else
v-else
/>
/>
...
@@ -61,7 +65,11 @@
...
@@ -61,7 +65,11 @@
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
<span
@
click=
"
@
click=
"
$file.handleFileNameClick(scope.row, scope.$index, sortedFileList)
$file.handleFileNameClickNew(
scope.row,
scope.$index,
sortedFileList
)
"
"
>
>
<span
<span
...
...
src/components/file/box/contextMenu/Box.vue
浏览文件 @
5f04d733
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
>
>
<li
<li
class=
"right-menu-item"
class=
"right-menu-item"
@
click=
"$file.handleFileNameClick(selectedFile, 0, [selectedFile])"
@
click=
"$file.handleFileNameClick
New
(selectedFile, 0, [selectedFile])"
v-if=
"seeBtnShow"
v-if=
"seeBtnShow"
>
>
<i
class=
"el-icon-view"
></i>
查看
<i
class=
"el-icon-view"
></i>
查看
...
...
src/components/file/components/FileGrid.vue
浏览文件 @
5f04d733
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
:title=
"$file.getFileNameComplete(item)"
:title=
"$file.getFileNameComplete(item)"
:style=
"`width: $
{gridSize + 40}px; `"
:style=
"`width: $
{gridSize + 40}px; `"
:class="item.userFileId === selectedFile.userFileId ? 'active' : ''"
:class="item.userFileId === selectedFile.userFileId ? 'active' : ''"
@click="$file.handleFileNameClick(item, index, fileListSorted)"
@click="$file.handleFileNameClick
New
(item, index, fileListSorted)"
@contextmenu.prevent="handleContextMenu(item, index, $event)"
@contextmenu.prevent="handleContextMenu(item, index, $event)"
>
>
<video
<video
...
...
src/components/file/components/OperationMenu.vue
浏览文件 @
5f04d733
...
@@ -292,8 +292,14 @@ export default {
...
@@ -292,8 +292,14 @@ export default {
},
},
// 批量下载文件链接
// 批量下载文件链接
batchDownloadLink
()
{
batchDownloadLink
()
{
const
baseApi
=
"/api"
;
// return `${
return
`
${
baseApi
}
/filetransfer/batchDownloadFile?userFileIds=
${
this
.
selectedFiles
// process.env.VUE_APP_BASE_API
// }/filetransfer/batchDownloadFile?userFileIds=${this.selectedFiles
// .map((item) => item.userFileId)
// .join(",")}`;
return
`
${
process
.
env
.
VUE_APP_BASE_API
}
/v1/api/folder/transfer/batchDownloadFile?userFileIds=
${
this
.
selectedFiles
.
map
((
item
)
=>
item
.
userFileId
)
.
map
((
item
)
=>
item
.
userFileId
)
.
join
(
","
)}
`
;
.
join
(
","
)}
`
;
},
},
...
...
src/libs/qiwen/globalFunction/file.js
浏览文件 @
5f04d733
...
@@ -9,6 +9,7 @@ import {
...
@@ -9,6 +9,7 @@ import {
markdownFileType
markdownFileType
}
from
'@/libs/qiwen/map.js'
}
from
'@/libs/qiwen/map.js'
import
{
officeFileType
}
from
'@/libs/qiwen/map.js'
import
{
officeFileType
}
from
'@/libs/qiwen/map.js'
import
{
getViewUrlDbPath
}
from
'@/api/wps'
// 全局函数 - 文件相关
// 全局函数 - 文件相关
const
fileFunction
=
{
const
fileFunction
=
{
...
@@ -286,8 +287,98 @@ const fileFunction = {
...
@@ -286,8 +287,98 @@ const fileFunction = {
Number
(
router
.
currentRoute
.
query
.
fileType
)
===
4
?
currentIndex
:
0
Number
(
router
.
currentRoute
.
query
.
fileType
)
===
4
?
currentIndex
:
0
Vue
.
prototype
.
$openBox
.
audioPreview
({
audioList
,
defaultIndex
})
Vue
.
prototype
.
$openBox
.
audioPreview
({
audioList
,
defaultIndex
})
},
},
/**
* 文件预览——word使用wps预览,pdf使用pdf组件进行预览
* @description 若当前点击的为文件夹,则进入文件夹内部;若是文件,则进行相应的预览。
* @param {object} row 文件信息
* @param {number} currentIndex 当前文件索引
* @param {array} fileList 文件列表
*/
handleFileNameClickNew
(
row
,
currentIndex
,
fileList
=
[])
{
// 如果当前文件在回收站中,则不允许预览
if
(
row
.
deleteFlag
!==
undefined
&&
row
.
deleteFlag
!==
0
)
{
return
false
}
// 若是文件夹则进入该文件夹
if
(
row
.
isDir
)
{
// debugger
if
(
router
.
currentRoute
.
name
===
'Share'
)
{
// 当前是查看他人分享列表的页面
router
.
push
({
query
:
{
filePath
:
`
${
row
.
shareFilePath
===
'/'
?
''
:
row
.
shareFilePath
}
/
${
row
.
fileName
}
`
}
})
}
else
if
(
Number
(
router
.
currentRoute
.
query
.
fileType
)
===
8
)
{
// 当前是我的已分享列表页面
router
.
push
({
query
:
{
fileType
:
8
,
filePath
:
`
${
row
.
shareFilePath
===
'/'
?
''
:
row
.
shareFilePath
}
/
${
row
.
fileName
}
`
,
shareBatchNum
:
row
.
shareBatchNum
}
})
}
else
if
(
Number
(
router
.
currentRoute
.
query
.
fileType
)
!==
6
)
{
// 回收站页面不允许打开文件夹
// 网盘页面
router
.
push
({
query
:
{
filePath
:
`
${
row
.
filePath
===
'/'
?
''
:
row
.
filePath
}
/
${
row
.
fileName
}
`
,
fileType
:
router
.
currentRoute
.
query
.
fileType
}
})
}
}
else
{
const
WORD
=
[
'doc'
,
'docx'
]
const
PDF
=
[
'pdf'
]
// 若当前点击项是word
if
(
WORD
.
includes
(
row
.
extendName
.
toLowerCase
()))
{
let
flag
=
false
// 根据当前路由判断,是否支持编辑,目前只要我的创作才能够编辑
console
.
log
(
'router.currentRoute'
,
router
.
currentRoute
);
if
(
router
.
currentRoute
.
name
===
'MyCreate'
)
{
flag
=
true
}
console
.
log
(
123
,
row
);
const
{
fileId
,
identifier
}
=
row
const
params
=
{
fileId
:
identifier
,
flag
}
getViewUrlDbPath
(
params
).
then
(
res
=>
{
if
(
res
.
data
)
{
console
.
log
(
res
.
data
);
// 跳转 使用sessionStorage,避免关键信息在ip中暴露
// 使用push会停留当前页面,故不采纳
// params 传递参数,子组件无法渲染iframe组件,故不采纳
// localStorage.wpsUrl = res.data.wpsUrl
// localStorage.token = res.data.token
// let resolve = $el.$router.resolve({
// path: '/wpsReader',
// query: {
// wpsUrl: res.data.wpsUrl,
// token: res.data.token
// }
// })
// window.open(resolve.href, '_blank')
}
})
// router.push('/wpsReader')
return
false
}
// 若当前点击项是pdf
if
(
PDF
.
includes
(
row
.
extendName
.
toLowerCase
()))
{
router
.
push
(
'/pdfReader'
)
return
false
}
}
},
/**
/**
* 文件预览
* 文件预览
——原始奇文的方法,使用的onlyoffice预览
* @description 若当前点击的为文件夹,则进入文件夹内部;若是文件,则进行相应的预览。
* @description 若当前点击的为文件夹,则进入文件夹内部;若是文件,则进行相应的预览。
* @param {object} row 文件信息
* @param {object} row 文件信息
* @param {number} currentIndex 当前文件索引
* @param {number} currentIndex 当前文件索引
...
...
src/router/staticRoute.js
浏览文件 @
5f04d733
...
@@ -36,17 +36,17 @@ export const staticRouters = [
...
@@ -36,17 +36,17 @@ export const staticRouters = [
affix
:
false
affix
:
false
}
}
},
},
{
//
{
path
:
'myTemplate'
,
//
path: 'myTemplate',
component
:
()
=>
import
(
'@/views/mine/myTemplate/index.vue'
),
//
component: () => import('@/views/mine/myTemplate/index.vue'),
name
:
'MyTemplate'
,
//
name: 'MyTemplate',
meta
:
{
//
meta: {
title
:
'我的模板'
,
//
title: '我的模板',
icon
:
'dashboard'
,
//
icon: 'dashboard',
noCache
:
false
,
//
noCache: false,
affix
:
false
//
affix: false
}
//
}
},
//
},
{
{
path
:
'myCollect'
,
path
:
'myCollect'
,
component
:
()
=>
import
(
'@/views/mine/myCollect/index.vue'
),
component
:
()
=>
import
(
'@/views/mine/myCollect/index.vue'
),
...
...
src/views/read/wpsReader/index.vue
浏览文件 @
5f04d733
<
template
>
<
template
>
<div>
阅读wps
</div>
<div>
阅读wps
<div
id=
"viewFile"
></div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{};
import
WebOfficeSDK
from
"/public/weboffice/web-office-sdk-v1.1.8.es"
;
export
default
{
mounted
()
{
// this.getBookList();
console
.
log
(
"WebOfficeSDK"
,
WebOfficeSDK
);
this
.
openWps
(
this
.
$route
.
query
.
wpsUrl
,
this
.
$route
.
query
.
token
);
},
methods
:
{
async
openWps
(
url
,
token
)
{
this
.
wps
=
WebOfficeSDK
.
config
({
wpsUrl
:
url
,
// 如果需要通过js-sdk传递token方式鉴权,则需要包含_w_tokentype=1参数
mount
:
document
.
querySelector
(
"#viewFile"
),
});
this
.
wps
.
setToken
({
token
});
this
.
wps
.
ready
();
},
},
};
</
script
>
</
script
>
<
style
lang=
""
></
style
>
<
style
lang=
""
></
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论