Parcourir la source

归档 表格文字超出隐藏

liuQiang il y a 1 an
Parent
commit
e1f44e4597

+ 7 - 1
src/api/biz/actor.js

@@ -34,7 +34,13 @@ export function updateActor(data) {
     data: data
   })
 }
-
+// 归档
+export function documentation(data) {
+  return request({
+    url: '/biz/actor/'+data,
+    method: 'put',
+  })
+}
 // 删除文档协作
 export function delActor(autoId) {
   return request({

+ 17 - 6
src/layout/indexCommon.vue

@@ -678,7 +678,7 @@ const addFileTab = (data, bool,copy,history,fileId) => {
             editableTabsValue.value = par.id// 新建时标签跳转
             setTimeout(() => {
 
-              iframeSize(par.id)
+              iframeSize(par.id,history)
             }, 1000);
           }
         } else {
@@ -696,7 +696,7 @@ const addFileTab = (data, bool,copy,history,fileId) => {
         par.show = true
         editableTabsValue.value = par.id// 标签跳转
         setTimeout(() => {
-          iframeSize(par.id)
+          iframeSize(par.id,history)
         }, 1000);
       } else {
         par.show = false
@@ -720,8 +720,11 @@ const addFileTab = (data, bool,copy,history,fileId) => {
         editableTabsValue.value = par.id// 新建时标签跳转
         setTimeout(() => {
 
-          iframeSize(par.id)
+          iframeSize(par,history)
         }, 1000);
+        // console.log('open======');
+        // window.open(`http://192.168.1.8:81/dev-api/api/history/655b0d360f078a3dc7fd19e4`)
+        // window.open(`${window.location.origin}/fileEdit?clickRowId=${thisData.docId}&canEdit=${bool}&canCopy=${copy}&history=${history}&fileId=${fileId}`)
       }
     } else {
       par.show = false
@@ -828,8 +831,8 @@ const closeFileTab = (item, index, e) => {
   // console.log("iFrameData", iFrameData.value);
 };
 // 控制iframe大小
-const iframeSize = (id) => {
-  const outIframe = document.getElementById("iframe" + id);
+const iframeSize = (par,history) => {
+  const outIframe = document.getElementById("iframe" + par.id);
   const inIframe =
     outIframe.contentDocument.getElementsByTagName("iframe")[0];
   // console.log('outIframe', outIframe.parentElement);
@@ -838,7 +841,15 @@ const iframeSize = (id) => {
     outIframe.parentElement.offsetHeight + "px";
   inIframe.style.width = outIframe.style.width =
     outIframe.parentElement.offsetWidth + "px";
-
+      // if(history){
+      //     var widgetIFrameParent = inIframe.parentNode;
+      //     outIframe.remove();
+      //     // widgetIFrameParent.append("<iframe id=\"widgetIFrame\" style=\"width: 100%;height: 600px\" src=\"\"></iframe>");
+      //     widgetIFrameParent.append("<iframe :src=\"item.src\" frameborder=\"0\" :id=\"`iframe${item.id}`\" :name=\"`iframe${item.id}`\" width=\"100%\" height=\"800px\" class=\"iframeBox\" ></iframe>");
+      //     var widgetIFrameNew = document.getElementById("iframe" + par.id);
+      //     // widgetIFrameNew.attr('src',encodeURI(par.src));
+      //     // widgetIFrameNew.css('width',"100%")
+      // }
   // console.log('dom',outIframe.parentElement.offsetWidth);
   // console.log('inIframe',inIframe);
 }

+ 4 - 4
src/views/department/MyFile.vue

@@ -189,7 +189,7 @@
                                 @selection-change="handleSelectionChange1" :single-select="true" @row-click="folderClick"
                                 @row-contextmenu="folderRClick" ref="taskTableRef">
                                 <el-table-column type="selection" width="55" />
-                                <el-table-column label="名称" width="180">
+                                <el-table-column label="名称" :show-overflow-tooltip="true" width="280">
                                     <template #default="scope">
                                         <span class="juzhong">
                                             <el-icon v-if="scope.row.isFavorite == 'N'" @click.stop="collectByStar(scope.row,true)" class="juli">
@@ -202,7 +202,7 @@
                                         </span>
                                     </template>
                                 </el-table-column>
-                                <el-table-column prop="createTime" label="时间" width="180" />
+                                <el-table-column prop="createTime" label="时间" width="280" />
                                 <el-table-column prop="dirType" label="类型">
                                     <template #default="scope">
                                         <span v-if="scope.row.dirType == '1'">普通目录</span>
@@ -251,7 +251,7 @@
                                     @row-contextmenu="handleRowClick" @selection-change="handleSelectionChange"
                                     @row-click="mouseClick" :default-sort="{ prop: 'createTime', order: 'descending' }">
                                     <el-table-column type="selection" width="55" />
-                                    <el-table-column label="名称" width="200">
+                                    <el-table-column label="名称" width="280">
                                         <template #default="scope">
                                             <span style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="juzhong">
                                             <el-icon v-if="scope.row.isFavorite == 'N'" @click.stop="collectByStar(scope.row,false)">
@@ -272,7 +272,7 @@
                                         </span>
                                         </template>
                                     </el-table-column>
-                                    <el-table-column prop="createTime" label="时间" sortable width="180" />
+                                    <el-table-column prop="createTime" label="时间" sortable width="280" />
                                     <el-table-column prop="fileType" label="类型" />
                                     <el-table-column label="大小">
                                         <template #default="scope">

+ 22 - 16
src/views/myfile/MyFile.vue

@@ -216,7 +216,7 @@
                                     @selection-change="handleSelectionChange1" :single-select="true" @row-click="folderClick"
                                     @row-contextmenu="folderRClick" ref="taskTableRef">
                                     <el-table-column type="selection" width="55" />
-                                    <el-table-column label="名称" width="180">
+                                    <el-table-column label="名称" :show-overflow-tooltip="true" width="280">
                                         <template #default="scope">
                                             <span style="display: flex;align-items: center;">
                                                 <el-icon v-if="scope.row.isFavorite == 'N'" @click.stop="collectByStar(scope.row,true)" style="margin-right: 7px;">
@@ -229,7 +229,7 @@
                                                 </span>
                                             </template>
                                         </el-table-column>
-                                        <el-table-column prop="createTime" label="时间" width="180" />
+                                        <el-table-column prop="createTime" label="时间" width="280" />
                                         <!-- <el-table-column prop="dirType" label="类型">
                                             <template #default="scope">
                                                 <span v-if="scope.row.isEncrypt == 'N'">公开目录</span>
@@ -279,7 +279,7 @@
                                         @row-contextmenu="handleRowClick" @selection-change="handleSelectionChange"
                                         @row-click="mouseClick" :default-sort="{ prop: 'createTime', order: 'descending' }">
                                         <el-table-column type="selection" width="55" />
-                                        <el-table-column label="名称" width="200">
+                                        <el-table-column label="名称" width="280">
                                             <template #default="scope">
                                                 <span
                                                     style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: flex;align-items: center;">
@@ -301,7 +301,7 @@
                                                 </span>
                                             </template>
                                         </el-table-column>
-                                        <el-table-column prop="createTime" label="时间" sortable width="180" />
+                                        <el-table-column prop="createTime" label="时间" sortable width="280" />
                                         <el-table-column prop="fileType" label="类型" />
                                         <el-table-column label="大小">
                                             <template #default="scope">
@@ -320,7 +320,7 @@
                                     <p @click="chooseSet(item, index, 1)" class="chooseSet">
                                         <img :src="item.img" alt="">
                                         {{ item.name }}
-                                        <span v-if="item.name == '在线编辑' || item.name == '协作' ? true : false"
+                                        <span v-if=" item.name == '协作' ? true : false"
                                             style="color: #7084B4;float: right;position: relative;" class="arrow">></span>
                                     </p>
                                 </template>
@@ -330,7 +330,7 @@
                                     <img src="../../assets/images/user.png" alt="">
                                     选择人员
                                 </p>
-                                <p class="chooseSet" @click="goLock">
+                                <p class="chooseSet" @click="goLock" v-if="clickRow.isActor === 'Y' && clickRow.isFiled != 'Y'">
                                     <img src="../../assets/images/archiveTray.png" alt="">
                                     归档
                                 </p>
@@ -442,6 +442,7 @@
 <script>
 import { ref, toRaw, onMounted, inject, onActivated } from 'vue'
 import myfile from '../../api/myfile/myfile'
+import {documentation}from "@/api/biz/actor.js"
 import uploadApi from '../../api/upload/upload'
 import { delFavorite } from '@/api/biz/favorite.js'
 import documents from '../../api/document/document'
@@ -1526,6 +1527,9 @@ export default {
             if (!canEditArr.includes(copyFileType.value)) {
                 arr = arr.filter(item => item.name !== "在线编辑" && item.name !== "协作" && item.name !== "历史版本")
             }
+            if (clickRow.value.isFiled === "Y") {
+                arr = arr.filter(item => item.name !== "在线编辑" && item.name !== "协作")
+            }
             if (!imgTypeArr.includes(copyFileType.value)) {
                 arr = arr.filter(item => item.name !== "文字识别")
             }
@@ -1601,17 +1605,19 @@ export default {
 
         }
         // 归档
-        function goLock() {
-            fileCount.lockActor(clickRowId.value).then(res => {
-                if (res.code === 200) {
-                    ElMessage({
-                        type: "success",
-                        message: "归档成功"
-                    })
-                    cliCC.value = false
-                    anyP.value = false
+       async function goLock() {
+            console.log('goLockclickRow',clickRow.value);
+            const res = await documentation(clickRow.value.docId)
+                console.log('res',res);
+                if(res.code == 200){
+                     ElMessage({
+                            type: "success",
+                            message: "成功归档"
+                        })
                 }
-            })
+                cliCC.value = false
+                anyP.value = false
+                refreshFile()
         }
         function formatFileSize(fileSize) {
             if (fileSize >= 1024 * 1024 * 1024) {

+ 113 - 3
src/views/myjoin/MyJoin.vue

@@ -4,12 +4,12 @@
             <!-- 功能 -->
             <div class="tabBox">
                 <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" tab-position="top">
-                    <el-tab-pane label="我发起的" name="first">
+                    <el-tab-pane label="我发起的" name="first" style="min-height:300px">
                         <div>
                             <!-- <el-button @click="newFileAdd">新建文件</el-button> -->
                         </div>
                         <div>
-                            <el-table :data="myEjoy" style="width: 100%;cursor: pointer;" @row-click="rowClickFN">
+                            <el-table @row-contextmenu="handleRowClick" :data="myEjoy" style="width: 100%;cursor: pointer;" @row-click="rowClickFN">
                                 <!-- <el-table-column type="selection" width="55" /> -->
                                 <el-table-column label="名称" width="200">
                                     <template #default="scope">
@@ -33,6 +33,14 @@
                                     </template>
                                 </el-table-column>
                             </el-table>
+                            <div class="setCli" v-if="cliCC" :style="{ left: xz  - 100+ 'px', top: yz -150 + 'px' }">
+                                <template v-for="(item, index) in rightMenuData" :key="index">
+                                    <p @click="chooseSet(item, index, 1)" class="chooseSet">
+                                        <img :src="item.img" alt="">
+                                        {{ item.name }}
+                                    </p>
+                                </template>
+                            </div>
                         </div>
                     </el-tab-pane>
                     <el-tab-pane label="我参与的" name="second">
@@ -88,6 +96,8 @@ import { toRaw } from "@vue/reactivity";
 import AddFile from './components/AddFile.vue'
 import FileEdit from "@/views/myfile/components/FileEdit.vue";
 import { ElMessage } from 'element-plus';
+import archiveTray from "@/assets/images/archiveTray.png";
+import {documentation}from "@/api/biz/actor.js"
 export default {
     setup() {
         const activeName = ref('first')
@@ -103,6 +113,16 @@ export default {
         const showEdit = ref(false)
         const thisLClickRow = ref()//当前左键的文件
         const addFileTab = inject("addFileTab");
+        const clickRow = ref()
+        let xz = ref(0)
+        let yz = ref(0)
+        const cliCC = ref(false)
+        const rightMenuData = ref([
+            {
+                name:'归档',
+                img:archiveTray
+            }
+        ])
         const rowClickFN = (row,col,e)=>{
             console.log('row',row);
             thisLClickRow.value = row
@@ -158,9 +178,50 @@ export default {
         function threeBe(data){
             newAdd.value = data
         }
+        // 我发起的右键事件
+        // 文件名表格每一行点击事件
+        function handleRowClick(row, col, e) {
+            console.log('row', row);
+            clickRow.value = row
+            e.preventDefault();
+            e.stopPropagation();
+            xz.value = e.pageX
+            yz.value = e.pageY
+            if (cliCC.value === true) {
+                cliCC.value = false
+            } else {
+                cliCC.value = true
+            }
+        }
+        // 关闭文件夹右键菜单
+        const closeRMenu = () => {
+            // console.log("close");
+            cliCC.value = false;
+        };
+        const chooseSet =async (row, index, num)=>{
+            if (row.name == '归档') {
+                if(clickRow.value.isFiled == 'Y'){
+                    return ElMessage({
+                            type: "error",
+                            message: "文件已归档,请勿重复操作"
+                        })
+                }
+                const res = await documentation(clickRow.value.docId)
+                console.log('res',res);
+                if(res.code == 200){
+                     ElMessage({
+                            type: "success",
+                            message: "成功归档"
+                        })
+                }
+                cliCC.value = false
+            }
+        }
+
         onMounted(() => {
             getCountPeople()
             getMyJoin()
+            window.addEventListener("click", closeRMenu, true);
         })
         return {
             activeName,
@@ -183,7 +244,16 @@ export default {
             copyRow,
             clickRowId,
             showEdit,
-            addFileTab
+            addFileTab,
+            handleRowClick,
+            clickRow,
+            xz,
+            yz,
+            rightMenuData,
+            archiveTray,
+            closeRMenu,
+            cliCC,
+            chooseSet
         }
     },
     components:{
@@ -207,6 +277,7 @@ export default {
     height: 40px;
     margin: 0 auto;
     background-color: #F5F7F9;
+    position: relative;
 }
 .preview {
   width: 100%;
@@ -214,6 +285,45 @@ export default {
   background-color: #fff;
   overflow: hidden;
 }
+.setCli {
+    width: 156px;
+    max-height: auto;
+    position: absolute;
+    // top: -70px;
+    // left: 300px;
+    flex-wrap: 400;
+    background-color: white;
+    border: 1px solid gray;
+    border-radius: 4px;
+    z-index: 300000000;
+    overflow-y: auto;
+    // font-size: 16px;
+}
+.chooseSet {
+    width: 140px;
+    height: 30px;
+    line-height: 30px;
+    margin: 5px auto;
+    font-size: 13px;
+    cursor: pointer;
+    // display: flex;
+    // align-items: center;
+    // position: relative;
+    img {
+        margin-right: 4px;
+        vertical-align: middle;
+    }
+}
+
+.chooseSet:hover {
+    width: 140px;
+    height: 30px;
+    line-height: 30px;
+    margin: 5px auto;
+    font-size: 13px;
+    background-color: #F5F7F9;
+    /* color: white; */
+}
 :deep(.el-tabs__nav) {
     margin: 0 calc(100% - 55%);
 }

+ 23 - 16
src/views/publicment/MyFile.vue

@@ -187,7 +187,7 @@
                                 @selection-change="handleSelectionChange1" :single-select="true" @row-click="folderClick"
                                 @row-contextmenu="folderRClick" ref="taskTableRef">
                                 <el-table-column type="selection" width="55" />
-                                <el-table-column label="名称" width="180">
+                                <el-table-column label="名称" :show-overflow-tooltip="true" width="280">
                                     <template #default="scope">
                                         <span class="juzhong">
                                             <el-icon v-if="scope.row.isFavorite == 'N'" @click.stop="collectByStar(scope.row,true)" class="juli">
@@ -200,7 +200,7 @@
                                         </span>
                                     </template>
                                 </el-table-column>
-                                <el-table-column prop="createTime" label="时间" width="180" />
+                                <el-table-column prop="createTime" label="时间" width="280" />
                                 <el-table-column prop="dirType" label="类型">
                                      <template #default="scope">
                                         <span v-if="scope.row.dirType == '1'">普通目录</span>
@@ -249,7 +249,7 @@
                                     @row-contextmenu="handleRowClick" @selection-change="handleSelectionChange"
                                     @row-click="mouseClick" :default-sort="{ prop: 'createTime', order: 'descending' }">
                                     <el-table-column type="selection" width="55" />
-                                    <el-table-column label="名称" width="200">
+                                    <el-table-column label="名称" width="280">
                                         <template #default="scope">
                                             <span style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="juzhong">
                                             <el-icon v-if="scope.row.isFavorite == 'N'" @click.stop="collectByStar(scope.row,false)" class="juli">
@@ -270,7 +270,7 @@
                                         </span>
                                         </template>
                                     </el-table-column>
-                                    <el-table-column prop="createTime" label="时间" sortable width="180" />
+                                    <el-table-column prop="createTime" label="时间" sortable width="280" />
                                     <el-table-column prop="fileType" label="类型" />
                                     <el-table-column label="大小">
                                         <template #default="scope">
@@ -289,7 +289,7 @@
                                 <p @click="chooseSet(item, index, 1)" v-if="!noMenuItem" class="chooseSet" style="cursor: pointer;">
                                     <img :src="item.img" alt="">
                                     {{ item.name }}
-                                    <span v-if="item.name == '在线编辑' || item.name == '协作' ? true : false"
+                                    <span v-if="item.name == '协作' ? true : false"
                                         style="color: #7084B4;float: right;position: relative;" class="arrow"></span>
                                 </p>
                             </template>
@@ -299,7 +299,7 @@
                                 <img src="../../assets/images/user.png" alt="">
                                 选择人员
                             </p>
-                            <p class="chooseSet" @click="goLock">
+                            <p class="chooseSet" @click="goLock" v-if="clickRow.isActor === 'Y' && clickRow.isFiled != 'Y'">
                                 <img src="../../assets/images/archiveTray.png" alt="">
                                 归档
                             </p>
@@ -407,6 +407,7 @@
 <script>
 import { ref, toRaw, onMounted ,onActivated} from 'vue'
 import myfile from '../../api/myfile/myfile'
+import {documentation}from "@/api/biz/actor.js"
 import { delFavorite } from '@/api/biz/favorite.js'
 import documents from '../../api/document/document'
 import fileCount from '../../api/fileCount/fileCount'
@@ -1372,6 +1373,9 @@ export default {
             if (!canEditArr.includes(copyFileType.value)) {
                 arr = arr.filter(item => item.name !== "在线编辑" && item.name !== "协作" && item.name !== "历史版本")
             }
+            if (clickRow.value.isFiled === "Y") {
+                arr = arr.filter(item => item.name !== "在线编辑" && item.name !== "协作")
+            }
             if (!imgTypeArr.includes(copyFileType.value)) {
                 arr = arr.filter(item => item.name !== "文字识别")
             }
@@ -1383,6 +1387,7 @@ export default {
             if(thisRole.value.length){
                 arr = publicRightMenuRole(toRaw(thisRole.value),arr)
             }
+            //  console.log('thisFolder',thisFolder.value);
             if(thisFolder.value.dirType == '1'&& !isDept.value){
                 arr = ordinaryFolder.value
             }
@@ -1460,17 +1465,19 @@ export default {
             
         }
         // 归档
-        function goLock() {
-            fileCount.lockActor(clickRowId.value).then(res => {
-                if (res.code === 200) {
-                    ElMessage({
-                        type: "success",
-                        message: "归档成功"
-                    })
-                    cliCC.value = false
-                    anyP.value = false
+       async function goLock() {
+            console.log('goLockclickRow',clickRow.value);
+            const res = await documentation(clickRow.value.docId)
+                console.log('res',res);
+                if(res.code == 200){
+                     ElMessage({
+                            type: "success",
+                            message: "成功归档"
+                        })
                 }
-            })
+                cliCC.value = false
+                anyP.value = false
+                refreshFile()
         }
         function formatFileSize(fileSize) {
             if (fileSize >= 1024 * 1024 * 1024) {