diff --git a/dist (3).zip b/dist (3).zip
new file mode 100644
index 0000000..7986f17
Binary files /dev/null and b/dist (3).zip differ
diff --git a/dist (4).zip b/dist (4).zip
new file mode 100644
index 0000000..a9b7cd3
Binary files /dev/null and b/dist (4).zip differ
diff --git a/dist (5).zip b/dist (5).zip
new file mode 100644
index 0000000..f3dfc0b
Binary files /dev/null and b/dist (5).zip differ
diff --git a/dist (6).zip b/dist (6).zip
new file mode 100644
index 0000000..bef79c9
Binary files /dev/null and b/dist (6).zip differ
diff --git a/dist (7).zip b/dist (7).zip
new file mode 100644
index 0000000..67d2eae
Binary files /dev/null and b/dist (7).zip differ
diff --git a/dist.zip b/dist.zip
new file mode 100644
index 0000000..73234f4
Binary files /dev/null and b/dist.zip differ
diff --git a/package.json b/package.json
index 76651ec..17d2fe0 100644
--- a/package.json
+++ b/package.json
@@ -15,6 +15,10 @@
},
"dependencies": {
"@onlyoffice/document-editor-vue": "^1.1.1",
+ "@vue-office/docx": "^1.0.0",
+ "@vue-office/excel": "^1.0.0",
+ "@vue-office/pdf": "^1.0.0",
+ "@vue/composition-api": "^1.7.1",
"axios": "0.18.1",
"core-js": "^3.26.1",
"docx-preview": "^0.1.14",
diff --git a/public/index.html b/public/index.html
index 066ba82..dceb76e 100644
--- a/public/index.html
+++ b/public/index.html
@@ -5,7 +5,7 @@
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -181,9 +136,14 @@ import pageUtils from '@/utils/pageUtils'
import { Message } from 'element-ui'
import { getFilesInfoByName, getFilesInfoByType } from '@/utils/http/interface'
import { toBase64 } from 'js-base64'
-
+import VueOfficeDocx from '@vue-office/docx'
+import VueOfficePdf from '@vue-office/pdf'
export default {
name: 'FileList',
+ components:{
+ VueOfficeDocx,
+ VueOfficePdf
+ },
filters: {
statusFilter(status) {
const statusMap = {
@@ -298,7 +258,16 @@ export default {
// }
// 浏览查看
viewDialogVisible:false,
- viewUrl:null
+ viewUrl:null,
+
+ //在线浏览的文件信息
+ viewFileData:null,
+
+ //在线浏览文件类型
+ isWord:false,
+ isPdf:false,
+ //用户IP
+ ip:null,
}
},
created() {
@@ -323,6 +292,7 @@ export default {
+
//提示
showInfo(){
if (this.showInfoStatus == false) {
@@ -374,17 +344,14 @@ export default {
},
- viewFile(link){
- var url = 'http://127.0.0.1:8043/api/' + link; //要预览文件的访问地址
- this.viewUrl='http://114.116.228.69:8041/onlinePreview?url='+encodeURIComponent(toBase64(url))
- this.viewDialogVisible = true
- //
- // window.open();
- },
+
+ //关闭在线浏览
viewHandleClose(){
this.viewDialogVisible = false
this.viewUrl = null
+ this.isPdf = false
+ this.isWord = false
},
//关闭上传弹窗
@@ -472,6 +439,11 @@ export default {
return require('@/assets/file_icon/excel3.svg')
case 'pdf':
return require('@/assets/file_icon/pdf3.svg')
+ case 'zip':
+ case 'rar':
+ return require('@/assets/file_icon/zip.svg')
+ case 'exe':
+ return require('@/assets/file_icon/exe.svg')
default:
return require("@/assets/file_icon/unu.svg")
}
@@ -501,9 +473,47 @@ export default {
// 判断是否为文件夹
if (file.directory){
//是 进入
- this.path = this.path + file.name + "/"
- this.getFilesDirMeta()
- this.fileLevel = this.fileLevel + 1
+ //检测用户信息 这块逻辑放到后端更好
+ var dep = localStorage.getItem('dep')
+ if (file.name === '一室') {
+ console.log(file.name)
+
+ if (dep ==='一室' || dep === '管理员'){
+ //继续访问下一层
+ this.path = this.path + file.name + "/"
+ this.getFilesDirMeta()
+ this.fileLevel = this.fileLevel + 1
+ }else{
+ //无权访问 提示信息 后续可做成输入密码授权访问
+ Message.warning("抱歉,您无权限访问,您的部门是:"+ dep)
+ }
+ }else if (file.name === '二室') {
+ if (dep === '二室'|| dep === '管理员'){
+ //继续访问下一层
+ this.path = this.path + file.name + "/"
+ this.getFilesDirMeta()
+ this.fileLevel = this.fileLevel + 1
+ }else {
+ //无权访问 提示信息 后续可做成输入密码授权访问
+ Message.warning("抱歉,您无权限访问,您的部门是:"+ dep)
+ }
+ }else if (file.name === '四室') {
+ if (dep === '四室'|| dep === '管理员'){
+ //继续访问下一层
+ this.path = this.path + file.name + "/"
+ this.getFilesDirMeta()
+ this.fileLevel = this.fileLevel + 1
+ }else {
+ //无权访问 提示信息 后续可做成输入密码授权访问
+ Message.warning("抱歉,您无权限访问,您的部门是:"+ dep)
+ }
+ }else {
+ //不做限制
+ this.path = this.path + file.name + "/"
+ this.getFilesDirMeta()
+ this.fileLevel = this.fileLevel + 1
+ }
+
}else {
//不是 直接下载
@@ -516,6 +526,13 @@ export default {
console.log(file.name)
console.log(file.directory)
},
+ saveFileData(file){
+ //目前只用于在线浏览 保存文件url信息、判断文件是什么类型
+ //保存文件信息 用于判断文件类型
+ this.viewFileData = file
+
+ this.viewUrl ="http://"+ window.location.host + "/api/files"+this.path + file.name,file.name
+ },
//返回上一层
back2Up(){
//先判断是否处于根目录
@@ -550,7 +567,29 @@ export default {
Message.warning("添加文件夹失败,该文件夹可能已经存在~")
}
})
- }
+ },
+ // 在线浏览
+ onlineView(){
+ if (this.viewFileData.directory){
+ // 是文件夹 提示无法展示
+ Message.warning("您选择的是文件夹 无法在线浏览")
+ }else {
+ //文件 判断文件类型
+ if (this.viewFileData.name.endsWith('.docx')) {
+ //word文档
+ this.isWord = true
+ this.viewDialogVisible = true
+ }else if (this.viewFileData.name.endsWith('.pdf')){
+ this.isPdf = true
+ this.viewDialogVisible = true
+ }else {
+ Message.warning("您的文件暂不支持在线浏览 请下载查看")
+ }
+ }
+
+
+ },
+
},
mounted() {
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index c16e4f0..de3c264 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -146,7 +146,7 @@ export default {
localStorage.setItem("role", res.auth[0].authority);
this.loading = true
Message.success("登录成功")
- pageUtils.openPage(this.$router,"/fileListV2/1"); //跳转至主页
+ pageUtils.openPage(this.$router,"/fileListV3"); //跳转至主页
}
// Cookies.set("token", res.data.token); // 放置token到Cookie
diff --git a/src/views/onlyOfficeTest/OnlyOfficeTest.vue b/src/views/onlyOfficeTest/OnlyOfficeTest.vue
index 3eb36b1..f84a5e9 100644
--- a/src/views/onlyOfficeTest/OnlyOfficeTest.vue
+++ b/src/views/onlyOfficeTest/OnlyOfficeTest.vue
@@ -53,7 +53,7 @@ export default{
// getAction('/file/selectById', { id: this.id }).then(res => {
this.option.isEdit = true
this.option.lang = 'zh-CN'
- this.option.url = 'http://114.116.228.69:8043/api/files/ZPABOZ-%E7%BA%A2%E5%B1%B1%E5%BC%80%E6%BA%90%E5%B9%B3%E5%8F%B0%E7%AE%A1%E7%90%86%E5%91%98%E6%9D%83%E9%99%90%E5%88%86%E7%B1%BB%E7%BB%9F%E8%AE%A121.1.3.xlsx'
+ // this.option.url = 'http://114.116.228.69:8043/api/files/ZPABOZ-%E7%BA%A2%E5%B1%B1%E5%BC%80%E6%BA%90%E5%B9%B3%E5%8F%B0%E7%AE%A1%E7%90%86%E5%91%98%E6%9D%83%E9%99%90%E5%88%86%E7%B1%BB%E7%BB%9F%E8%AE%A121.1.3.xlsx'
this.option.title = '123'
this.option.fileType = 'xlsx'
this.option.isPrint = false
diff --git a/src/views/userManage/UserManage.vue b/src/views/userManage/UserManage.vue
index 8ac756e..4a0ba7f 100644
--- a/src/views/userManage/UserManage.vue
+++ b/src/views/userManage/UserManage.vue
@@ -12,7 +12,7 @@