Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zys-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
zys-ui
Commits
abb709f1
提交
abb709f1
authored
10月 08, 2023
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
统一处理打开文件的问题
上级
f4527808
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
112 行增加
和
56 行删除
+112
-56
.env.development
.env.development
+5
-0
.env.production
.env.production
+5
-2
.env.staging
.env.staging
+5
-2
FileTable.vue
src/components/common/FileTable.vue
+2
-14
Box.vue
src/components/file/box/contextMenu/Box.vue
+2
-2
FileGrid.vue
src/components/file/components/FileGrid.vue
+1
-1
fileKey.js
src/constants/fileKey.js
+42
-0
file.js
src/libs/qiwen/globalFunction/file.js
+28
-17
main.js
src/main.js
+7
-1
index.vue
src/views/home/index.vue
+1
-2
index.vue
src/views/manage/shareManage/index.vue
+1
-1
noteOperationMixins.js
src/views/mine/myNote/components/noteOperationMixins.js
+1
-1
index.vue
src/views/mine/myShare/index.vue
+1
-1
noteList.vue
src/views/read/components/noteList.vue
+1
-2
index.vue
src/views/read/pdfReader/index.vue
+4
-4
index.vue
src/views/resource/external/components/table/index.vue
+3
-3
index.vue
src/views/resource/internal/index.vue
+1
-1
index.vue
src/views/resource/sharedCommunity/index.vue
+2
-2
没有找到文件。
.env.development
浏览文件 @
abb709f1
...
@@ -12,3 +12,7 @@ VUE_APP_BASE_QW_API = '/api'
...
@@ -12,3 +12,7 @@ VUE_APP_BASE_QW_API = '/api'
# 路由懒加载
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 服务器(涉密机)地址
VUE_APP_BASE_HOST = 'http://192.168.1.5:5432/basePdfFiles/'
\ No newline at end of file
.env.production
浏览文件 @
abb709f1
...
@@ -8,4 +8,7 @@ ENV = 'production'
...
@@ -8,4 +8,7 @@ ENV = 'production'
VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = '/prod-api'
# 奇文网盘
# 奇文网盘
VUE_APP_BASE_QW_API = '/api'
VUE_APP_BASE_QW_API = '/api'
\ No newline at end of file
# 服务器(涉密机)地址
VUE_APP_BASE_HOST = 'http://192.168.1.5:5432/basePdfFiles/'
\ No newline at end of file
.env.staging
浏览文件 @
abb709f1
...
@@ -10,4 +10,7 @@ ENV = 'staging'
...
@@ -10,4 +10,7 @@ ENV = 'staging'
VUE_APP_BASE_API = '/stage-api'
VUE_APP_BASE_API = '/stage-api'
# 奇文网盘
# 奇文网盘
VUE_APP_BASE_QW_API = '/api'
VUE_APP_BASE_QW_API = '/api'
\ No newline at end of file
# 服务器(涉密机)地址
VUE_APP_BASE_HOST = 'http://192.168.1.5:5432/basePdfFiles/'
\ No newline at end of file
src/components/common/FileTable.vue
浏览文件 @
abb709f1
...
@@ -41,13 +41,7 @@
...
@@ -41,13 +41,7 @@
:src=
"$file.setFileImg(scope.row)"
:src=
"$file.setFileImg(scope.row)"
: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.handleFileNameClickNew(scope.row, $fileKeys.qiwen)"
$file.handleFileNameClickNew(
scope.row,
scope.$index,
sortedFileList
)
"
v-else
v-else
/>
/>
</
template
>
</
template
>
...
@@ -64,13 +58,7 @@
...
@@ -64,13 +58,7 @@
</
template
>
</
template
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
<span
@
click=
"
@
click=
"$file.handleFileNameClickNew(scope.row, $fileKeys.qiwen)"
$file.handleFileNameClickNew(
scope.row,
scope.$index,
sortedFileList
)
"
>
>
<span
<span
class=
"file-name"
class=
"file-name"
...
...
src/components/file/box/contextMenu/Box.vue
浏览文件 @
abb709f1
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
>
>
<li
<li
class=
"right-menu-item"
class=
"right-menu-item"
@
click=
"$file.handleFileNameClickNew(selectedFile,
0, [selectedFile]
)"
@
click=
"$file.handleFileNameClickNew(selectedFile,
$fileKeys.qiwen
)"
v-if=
"seeBtnShow"
v-if=
"seeBtnShow"
>
>
<i
class=
"el-icon-view"
></i>
查看
<i
class=
"el-icon-view"
></i>
查看
...
@@ -555,7 +555,7 @@ export default {
...
@@ -555,7 +555,7 @@ export default {
* @param {object} fileInfo 文件信息
* @param {object} fileInfo 文件信息
*/
*/
handleClickFileEdit
(
fileInfo
)
{
handleClickFileEdit
(
fileInfo
)
{
this
.
$file
.
handleFileNameClickNew
(
fileInfo
);
this
.
$file
.
handleFileNameClickNew
(
fileInfo
,
this
.
$fileKeys
.
qiwen
);
},
},
/**
/**
* 文件详情按钮点击事件
* 文件详情按钮点击事件
...
...
src/components/file/components/FileGrid.vue
浏览文件 @
abb709f1
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,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.handleFileNameClickNew(item,
index, fileListSorted
)"
@click="$file.handleFileNameClickNew(item,
$fileKeys.qiwen
)"
@contextmenu.prevent="handleContextMenu(item, index, $event)"
@contextmenu.prevent="handleContextMenu(item, index, $event)"
>
>
<video
<video
...
...
src/constants/fileKey.js
0 → 100644
浏览文件 @
abb709f1
// 由于奇文框架、kbase框架和政研室原系统的字段名不一致,导致在预览文件时使用的key不一致
// 此文件用于统一记录文件打开文件的各个key名
const
fileKeys
=
{
qiwen
:
{
extendNameKey
:
'extendName'
,
fileIdKey
:
'fileId'
,
urlKey
:
'fileUrl'
,
},
kbase
:
{
extendNameKey
:
''
,
fileIdKey
:
'id'
,
urlKey
:
'weburl'
,
},
zys
:
{
extendNameKey
:
'suffix'
,
fileIdKey
:
'id'
,
urlKey
:
'url'
,
},
zysDoc
:
{
extendNameKey
:
'docSType'
,
fileIdKey
:
'docId'
,
urlKey
:
''
,
},
zysHome
:
{
extendNameKey
:
'suffix'
,
fileIdKey
:
'id'
,
urlKey
:
'downloadUrl'
,
},
zysShare
:
{
extendNameKey
:
'extendName'
,
fileIdKey
:
'fileId'
,
urlKey
:
'downloadUrl'
,
},
zysNote
:{
extendNameKey
:
'docSType'
,
fileIdKey
:
'docId'
,
urlKey
:
'downloadUrl'
,
}
}
export
default
fileKeys
\ No newline at end of file
src/libs/qiwen/globalFunction/file.js
浏览文件 @
abb709f1
...
@@ -234,11 +234,11 @@ const fileFunction = {
...
@@ -234,11 +234,11 @@ const fileFunction = {
* 文件预览——word使用wps预览,pdf使用pdf组件进行预览
* 文件预览——word使用wps预览,pdf使用pdf组件进行预览
* @description 若当前点击的为文件夹,则进入文件夹内部;若是文件,则进行相应的预览。
* @description 若当前点击的为文件夹,则进入文件夹内部;若是文件,则进行相应的预览。
* @param {object} row 文件信息
* @param {object} row 文件信息
* @param {number} currentIndex 当前文件索引
* @param {string} extendNameKey 后缀名key,用哪一个字段进行后缀名的判断
* @param {array} fileList 文件列表
* @param {string} urlKey 链接key,用哪一个字段进行url的打开
* @param {string} fileIdKey 文件id key,用哪个字段记录文件id
*/
*/
handleFileNameClickNew
(
row
,
currentIndex
=
0
,
fileList
=
[])
{
handleFileNameClickNew
(
row
,
{
extendNameKey
,
urlKey
,
fileIdKey
})
{
// console.log(11, row);
// 若是文件夹则进入该文件夹
// 若是文件夹则进入该文件夹
if
(
row
.
isDir
)
{
if
(
row
.
isDir
)
{
router
.
push
({
router
.
push
({
...
@@ -252,18 +252,33 @@ const fileFunction = {
...
@@ -252,18 +252,33 @@ const fileFunction = {
const
WORD
=
[
'doc'
,
'docx'
]
const
WORD
=
[
'doc'
,
'docx'
]
const
PDF
=
[
'pdf'
]
const
PDF
=
[
'pdf'
]
// 若当前点击项是word
// 若当前点击项是word
let
extendName
=
row
.
extendName
||
row
.
suffix
||
row
.
showType
||
row
.
docSType
let
extendName
=
row
[
extendNameKey
]
// console.log('extendName', extendName);
if
(
!
extendName
)
{
const
{
fileId
,
userId
,
id
,
docId
,
fileUrl
}
=
row
Message
.
error
(
'预览失败!无法判断文件类型:文件类型'
+
extendName
)
return
}
extendName
=
extendName
.
toLowerCase
()
const
fileId
=
row
[
fileIdKey
]
||
row
.
fileId
let
pdfUrl
=
row
[
urlKey
]
||
row
.
url
//有部分url未加前缀,但是浏览器会自动寻址加到当前的主机
if
(
WORD
.
includes
(
extendName
.
toLowerCase
()))
{
if
(
!
pdfUrl
.
includes
(
'http'
))
{
pdfUrl
=
process
.
env
.
VUE_APP_BASE_HOST
+
pdfUrl
}
// console.log('pdfUrl', pdfUrl);
// return
const
{
userId
}
=
row
if
(
WORD
.
includes
(
extendName
))
{
let
flag
=
false
let
flag
=
false
if
(
!
fileId
)
{
Message
.
error
(
'预览失败!文件ID失效:'
+
fileId
)
return
}
// 根据当前文件的作者的userId进行判断,和本人一致则是可编辑
// 根据当前文件的作者的userId进行判断,和本人一致则是可编辑
if
(
store
.
getters
.
userInfo
.
userId
==
userId
)
{
if
(
store
.
getters
.
userInfo
.
userId
==
userId
)
{
flag
=
true
flag
=
true
}
}
const
params
=
{
const
params
=
{
fileId
:
fileId
||
id
,
fileId
,
flag
flag
}
}
getViewUrlDbPath
(
params
).
then
(
res
=>
{
getViewUrlDbPath
(
params
).
then
(
res
=>
{
...
@@ -282,23 +297,19 @@ const fileFunction = {
...
@@ -282,23 +297,19 @@ const fileFunction = {
}
}
})
})
return
false
return
false
// 实际实现逻辑---end
}
}
else
if
(
PDF
.
includes
(
extendName
.
toLowerCase
()))
{
else
if
(
PDF
.
includes
(
extendName
))
{
// console.log(666, 'pdf');
if
(
!
pdfUrl
)
{
// 若当前点击项是pdf
Message
.
error
(
'预览失败!请检查该文件路径是否正确。文件路径:'
+
pdfUrl
)
if
(
!
fileUrl
)
{
Message
.
error
(
'预览失败!请检查该文件路径是否正确。文件路径:'
+
fileUrl
)
return
return
}
}
let
resolve
=
router
.
resolve
({
let
resolve
=
router
.
resolve
({
path
:
'/pdfReader'
,
path
:
'/pdfReader'
,
query
:
{
query
:
{
fileId
,
fileId
,
url
:
file
Url
url
:
pdf
Url
}
}
})
})
// console.log(333, row);
window
.
open
(
resolve
.
href
,
'_blank'
)
window
.
open
(
resolve
.
href
,
'_blank'
)
return
false
return
false
}
}
...
...
src/main.js
浏览文件 @
abb709f1
...
@@ -49,7 +49,8 @@ import DictData from '@/components/DictData'
...
@@ -49,7 +49,8 @@ import DictData from '@/components/DictData'
// 引入右键菜单组件
// 引入右键菜单组件
import
VueContextMenu
from
'vue-contextmenu'
import
VueContextMenu
from
'vue-contextmenu'
// 引入文件keys
import
fileKeys
from
'@/constants/fileKey'
// 全局方法挂载
// 全局方法挂载
Vue
.
prototype
.
getDicts
=
getDicts
Vue
.
prototype
.
getDicts
=
getDicts
...
@@ -70,6 +71,11 @@ for (let key in globalFunction) {
...
@@ -70,6 +71,11 @@ for (let key in globalFunction) {
// 全局配置挂载-奇文
// 全局配置挂载-奇文
Vue
.
prototype
.
$qwConfig
=
qwConfig
Vue
.
prototype
.
$qwConfig
=
qwConfig
// 全局挂载文件keys
Vue
.
prototype
.
$fileKeys
=
fileKeys
// 全局组件挂载
// 全局组件挂载
Vue
.
component
(
'DictTag'
,
DictTag
)
Vue
.
component
(
'DictTag'
,
DictTag
)
Vue
.
component
(
'Pagination'
,
Pagination
)
Vue
.
component
(
'Pagination'
,
Pagination
)
...
...
src/views/home/index.vue
浏览文件 @
abb709f1
...
@@ -145,7 +145,6 @@ export default {
...
@@ -145,7 +145,6 @@ export default {
// 上传文件
// 上传文件
handleUploadFile
()
{
handleUploadFile
()
{
const
uploadFileParams
=
{
filePath
:
"/我的创作"
,
isDir
:
0
};
// 上传文件组件参数
const
uploadFileParams
=
{
filePath
:
"/我的创作"
,
isDir
:
0
};
// 上传文件组件参数
// debugger;
this
.
$openBox
.
uploadFile
({
this
.
$openBox
.
uploadFile
({
params
:
uploadFileParams
,
params
:
uploadFileParams
,
uploadWay
:
0
,
//0-文件上传 1-文件夹上传 2-粘贴图片或拖拽上传
uploadWay
:
0
,
//0-文件上传 1-文件夹上传 2-粘贴图片或拖拽上传
...
@@ -168,7 +167,7 @@ export default {
...
@@ -168,7 +167,7 @@ export default {
// 点击表格某一行
// 点击表格某一行
handleClickName
(
row
)
{
handleClickName
(
row
)
{
console
.
log
(
"row"
,
row
);
console
.
log
(
"row"
,
row
);
this
.
$file
.
handleFileNameClickNew
(
row
);
this
.
$file
.
handleFileNameClickNew
(
row
,
this
.
$fileKeys
.
zysHome
);
},
},
handleToCreate
()
{
handleToCreate
()
{
this
.
$router
.
push
(
"/mine/myCreate"
);
this
.
$router
.
push
(
"/mine/myCreate"
);
...
...
src/views/manage/shareManage/index.vue
浏览文件 @
abb709f1
...
@@ -409,7 +409,7 @@ export default {
...
@@ -409,7 +409,7 @@ export default {
},
},
// 点击打开文件
// 点击打开文件
handleOpenFile
(
file
)
{
handleOpenFile
(
file
)
{
this
.
$file
.
handleFileNameClickNew
(
file
);
this
.
$file
.
handleFileNameClickNew
(
file
,
this
.
$fileKeys
.
zysShare
);
},
},
},
},
};
};
...
...
src/views/mine/myNote/components/noteOperationMixins.js
浏览文件 @
abb709f1
...
@@ -31,7 +31,7 @@ export default {
...
@@ -31,7 +31,7 @@ export default {
this
.
$message
.
success
(
"已复制到剪贴板"
);
this
.
$message
.
success
(
"已复制到剪贴板"
);
break
;
break
;
case
"view"
:
case
"view"
:
this
.
$file
.
handleFileNameClickNew
(
item
);
this
.
$file
.
handleFileNameClickNew
(
item
,
this
.
$fileKeys
.
zysNote
);
break
;
break
;
case
"edit"
:
case
"edit"
:
this
.
handleOpenEditNote
(
item
);
this
.
handleOpenEditNote
(
item
);
...
...
src/views/mine/myShare/index.vue
浏览文件 @
abb709f1
...
@@ -334,7 +334,7 @@ export default {
...
@@ -334,7 +334,7 @@ export default {
},
},
// 点击打开文件
// 点击打开文件
handleOpenFile
(
file
)
{
handleOpenFile
(
file
)
{
this
.
$file
.
handleFileNameClickNew
(
file
);
this
.
$file
.
handleFileNameClickNew
(
file
,
this
.
$fileKeys
.
zysShare
);
},
},
},
},
};
};
...
...
src/views/read/components/noteList.vue
浏览文件 @
abb709f1
...
@@ -283,10 +283,9 @@ export default {
...
@@ -283,10 +283,9 @@ export default {
},
},
// 点击更多的下拉框
// 点击更多的下拉框
handleClickDropdown
(
type
,
item
)
{
handleClickDropdown
(
type
,
item
)
{
console
.
log
(
type
,
item
);
switch
(
type
)
{
switch
(
type
)
{
case
"view"
:
case
"view"
:
this
.
$file
.
handleFileNameClickNew
(
item
);
this
.
$file
.
handleFileNameClickNew
(
item
,
this
.
$fileKeys
.
zysNote
);
break
;
break
;
case
"edit"
:
case
"edit"
:
this
.
handleOpenAddUpdateDialog
(
item
);
this
.
handleOpenAddUpdateDialog
(
item
);
...
...
src/views/read/pdfReader/index.vue
浏览文件 @
abb709f1
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
<div
:class=
"
{ 'reader-container': true, 'show-panel': panelVisible }">
<div
:class=
"
{ 'reader-container': true, 'show-panel': panelVisible }">
<PDFAnnot
<PDFAnnot
:url=
"url"
:url=
"url"
v-if=
"url"
ref=
"pdfRef"
ref=
"pdfRef"
@
copy=
"copyText"
@
copy=
"copyText"
@
addNote=
"addNote"
@
addNote=
"addNote"
...
@@ -60,8 +61,8 @@ export default {
...
@@ -60,8 +61,8 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
// url: "http://
192.168.1.5:5432/files/upload/20230919
/1008502f32c92041fee8d248981770d1.pdf",
// url: "http://
localhost:99/basePdfFiles/upload/20231007
/1008502f32c92041fee8d248981770d1.pdf",
url
:
"/output.pdf"
,
//
url: "/output.pdf",
// 新增笔记需要的参数
// 新增笔记需要的参数
form
:
{
form
:
{
docId
:
""
,
//文档Id
docId
:
""
,
//文档Id
...
@@ -78,12 +79,11 @@ export default {
...
@@ -78,12 +79,11 @@ export default {
panelVisible
:
false
,
//笔记的窗口
panelVisible
:
false
,
//笔记的窗口
noteList
:
[],
noteList
:
[],
pdfAnnotInstance
:
null
,
pdfAnnotInstance
:
null
,
//
url: "",
url
:
""
,
};
};
},
},
mounted
()
{
mounted
()
{
const
{
fileId
,
url
}
=
this
.
$route
.
query
;
const
{
fileId
,
url
}
=
this
.
$route
.
query
;
console
.
log
(
222
,
url
);
this
.
form
.
docId
=
fileId
;
this
.
form
.
docId
=
fileId
;
this
.
url
=
url
;
this
.
url
=
url
;
},
},
...
...
src/views/resource/external/components/table/index.vue
浏览文件 @
abb709f1
...
@@ -53,13 +53,13 @@
...
@@ -53,13 +53,13 @@
>
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<div
class=
"fileName"
>
<div
class=
"fileName"
>
<
el-link
@
click=
"handleOpenFile(scope.row)"
>
<
!--
<el-link
@
click=
"handleOpenFile(scope.row)"
>
--
>
<!--
<img
<!--
<img
:src=
"$file.setFileImg(scope.row, 'showType')"
:src=
"$file.setFileImg(scope.row, 'showType')"
style=
"width: 20px; height: 20px; margin-right: 4px"
style=
"width: 20px; height: 20px; margin-right: 4px"
/>
-->
/>
-->
{{
scope
.
row
.
name
}}
{{
scope
.
row
.
name
}}
<
/el-link
>
<
!--
</el-link>
--
>
</div>
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -210,7 +210,7 @@ export default {
...
@@ -210,7 +210,7 @@ export default {
// 点击打开文件
// 点击打开文件
handleOpenFile
(
file
)
{
handleOpenFile
(
file
)
{
this
.
$file
.
handleFileNameClickNew
(
file
);
this
.
$file
.
handleFileNameClickNew
(
file
,
this
.
$fileKeys
.
kbase
);
},
},
// 获取下载地址
// 获取下载地址
getDownloadFilePath
(
file
)
{
getDownloadFilePath
(
file
)
{
...
...
src/views/resource/internal/index.vue
浏览文件 @
abb709f1
...
@@ -178,7 +178,7 @@ export default {
...
@@ -178,7 +178,7 @@ export default {
// 点击打开文件
// 点击打开文件
handleOpenFile
(
file
)
{
handleOpenFile
(
file
)
{
this
.
$file
.
handleFileNameClickNew
(
file
);
this
.
$file
.
handleFileNameClickNew
(
file
,
this
.
$fileKeys
.
qiwen
);
},
},
async
loadData
()
{
async
loadData
()
{
...
...
src/views/resource/sharedCommunity/index.vue
浏览文件 @
abb709f1
...
@@ -239,7 +239,7 @@ export default {
...
@@ -239,7 +239,7 @@ export default {
},
},
// 点击打开文件
// 点击打开文件
handleOpenFile
(
file
)
{
handleOpenFile
(
file
)
{
this
.
$file
.
handleFileNameClickNew
(
file
);
this
.
$file
.
handleFileNameClickNew
(
file
,
this
.
$fileKeys
.
zysShare
);
},
},
// 批量下载
// 批量下载
handleMultiDownload
()
{
handleMultiDownload
()
{
...
@@ -263,7 +263,7 @@ export default {
...
@@ -263,7 +263,7 @@ export default {
extendName
,
extendName
,
filePath
,
filePath
,
fileName
,
fileName
,
isTemplate
:
false
,
isTemplate
:
false
,
templateId
:
""
,
templateId
:
""
,
};
};
newfile
(
params
)
newfile
(
params
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论