|
@@ -83,7 +83,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<template v-for="(item, index) in useMenu">
|
|
|
- <div style="display: flex;width: 82px;height: 32px;justify-content: flex-start;align-items: center;line-height: 18px;"
|
|
|
+ <div :class="{'isCheck':haveCheck}" style="display: flex;width: 82px;opacity:0.5;height: 32px;justify-content: flex-start;align-items: center;line-height: 18px;"
|
|
|
@click="getMenu(item, index)">
|
|
|
<div style="margin-left: 5px;">
|
|
|
<img :src="item.img" style="width: 24px;height: 24px;" alt="">
|
|
@@ -233,7 +233,7 @@
|
|
|
<el-button @click="editOnline = true">返回</el-button>
|
|
|
</div>
|
|
|
<FileEdit :docId="clickRowId" :copyRow="copyRow" :historyPrew="historyPrew"
|
|
|
- :historycopyRow="historycopyRow"></FileEdit>
|
|
|
+ :historycopyRow="historycopyRow" :onlyView="onlyView"></FileEdit>
|
|
|
</div>
|
|
|
<!-- 扩容弹窗 -->
|
|
|
<div>
|
|
@@ -424,6 +424,7 @@ import historyList from "@/components/historyList/index.vue"; //选择文件发
|
|
|
import { listVersion } from "@/api/biz/version";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
+import { canPreviewFile } from "@/utils/index.js"
|
|
|
export default {
|
|
|
setup() {
|
|
|
let fileTrees = ref(false)//filetree父传子
|
|
@@ -622,6 +623,10 @@ export default {
|
|
|
const foldertop = ref(0);
|
|
|
const folderleft = ref(0);
|
|
|
const thisFolder = ref({}); //当前右键的文件夹
|
|
|
+ const folderCheckout = ref(false)//是否有勾选
|
|
|
+ const fileCheckout = ref(false)//是否有勾选
|
|
|
+ const haveCheck = ref(false)//是否有勾选
|
|
|
+ const onlyView = ref(false) //预览
|
|
|
function getAllCollect() {
|
|
|
collect.getCollect({}).then(res => {
|
|
|
const maxAge = res.rows.reduce((max, obj) => (obj.orderNum > max ? obj.orderNum : max), res.rows[0].orderNum)
|
|
@@ -800,9 +805,23 @@ export default {
|
|
|
// console.log('row=', toRaw(row));
|
|
|
// console.log('copyFileId',copyFileId.value);//文件id
|
|
|
// console.log('copyFileType',copyFileType.value);//文件type
|
|
|
- showPreview.value = true
|
|
|
- const res = await preview(copyFileId.value)
|
|
|
- previewData.value = URL.createObjectURL(res)
|
|
|
+ //---------------------------
|
|
|
+ // showPreview.value = true
|
|
|
+ // const res = await preview(copyFileId.value)
|
|
|
+ // previewData.value = URL.createObjectURL(res)
|
|
|
+ //--------------------------------------
|
|
|
+ const filePreview = canPreviewFile(copyFileType.value)
|
|
|
+ if(filePreview){
|
|
|
+ onlyView.value = true
|
|
|
+ editOnline.value = false
|
|
|
+ cliCC.value = false
|
|
|
+ }else{
|
|
|
+ showPreview.value = true
|
|
|
+ const res = await preview(copyFileId.value)
|
|
|
+ previewData.value = URL.createObjectURL(res)
|
|
|
+ }
|
|
|
+ console.log('filePreview',filePreview);
|
|
|
+
|
|
|
// console.log('res',res);
|
|
|
} else if (row.name === "历史版本") {
|
|
|
const resHistory = await listVersion({ docId: clickRowId.value })
|
|
@@ -895,6 +914,7 @@ export default {
|
|
|
}
|
|
|
// 表格多选框
|
|
|
function handleSelectionChange(val) {
|
|
|
+ console.log('checkout val',toRaw(val));
|
|
|
if (val.length > 1) {
|
|
|
// 如果选择了多项,只保留最后一项
|
|
|
val.shift();
|
|
@@ -902,6 +922,15 @@ export default {
|
|
|
if (val.length === 1) {
|
|
|
fileId.value = val[0].docId
|
|
|
}
|
|
|
+ if(val.length){
|
|
|
+ folderCheckout.value = true
|
|
|
+ haveCheck.value = true
|
|
|
+ }else{
|
|
|
+ folderCheckout.value = false
|
|
|
+ if(!fileCheckout.value){
|
|
|
+ haveCheck.value = false
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
// 文件夹
|
|
|
function handleSelectionChange1(val) {
|
|
@@ -912,6 +941,15 @@ export default {
|
|
|
if (val.length === 1) {
|
|
|
folderId.value = val[0].dirId
|
|
|
}
|
|
|
+ if(val.length){
|
|
|
+ fileCheckout.value = true
|
|
|
+ haveCheck.value = true
|
|
|
+ }else{
|
|
|
+ fileCheckout.value = false
|
|
|
+ if(!folderCheckout.value){
|
|
|
+ haveCheck.value = false
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
// 重命名
|
|
|
function restName(row, index) {
|
|
@@ -1107,14 +1145,18 @@ export default {
|
|
|
}
|
|
|
|
|
|
//对mouseCli数组进行筛选,实现菜单的区分显示
|
|
|
- const filterMouseCli = () => {
|
|
|
- const typeArr = ['.png', '.jpg', '.jpeg', '.JPG', '.mp3', '.mp4', '.pdf']
|
|
|
- const imgTypeArr = ['.png', '.jpg', '.jpeg', '.JPG']
|
|
|
+ const filterMouseCli = ()=>{
|
|
|
+ const array = ['.doc', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.epub', '.fodt', '.htm', '.html', '.mht', '.odt', '.ott', '.pdf', '.rtf', '.txt', '.djvu', '.xps','csv', 'fods', 'ods', 'ots', 'xls', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx','fodp', 'odp', 'otp', 'pot', 'potm', 'potx', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptm', 'pptx']
|
|
|
+ const typeArr = ['.png','.jpg','.jpeg','.JPG','.mp3','.mp4','.pdf']
|
|
|
+ const imgTypeArr = ['.png','.jpg','.jpeg','.JPG']
|
|
|
let arr = []
|
|
|
- if (!typeArr.includes(copyFileType.value)) {
|
|
|
+ if (!(typeArr.includes(copyFileType.value) || array.includes(copyFileType.value)) ) {
|
|
|
arr = mouseCli.value.filter(item => item.name !== "预览")
|
|
|
} else {
|
|
|
- arr = mouseCli.value.filter(item => item.name !== "在线编辑" && item.name !== "协作" && item.name !== "历史版本")
|
|
|
+ arr = toRaw(mouseCli.value)
|
|
|
+ }
|
|
|
+ if(!array.includes(copyFileType.value)){
|
|
|
+ arr = arr.filter(item => item.name !== "在线编辑" && item.name !== "协作" && item.name !== "历史版本")
|
|
|
}
|
|
|
if (!imgTypeArr.includes(copyFileType.value)) {
|
|
|
arr = arr.filter(item => item.name !== "文字识别")
|
|
@@ -1285,6 +1327,10 @@ export default {
|
|
|
folderCase,//新建文件夹传值
|
|
|
getChildrenC,
|
|
|
oneOrTwo,//父传子判断
|
|
|
+ folderCheckout,
|
|
|
+ fileCheckout,
|
|
|
+ haveCheck,
|
|
|
+ onlyView
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -1552,6 +1598,9 @@ p {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.isCheck{
|
|
|
+ opacity: 1!important;
|
|
|
+}
|
|
|
|
|
|
:deep(.el-tag__content) {
|
|
|
display: block;
|