Ver código fonte

历史记录不使用ifarme

liuQiang 1 ano atrás
pai
commit
6a73f27294

+ 13 - 11
src/components/OnlyOffice/index.vue

@@ -125,19 +125,21 @@ export default {
 				// 	history: his
 				// })
         const his = toRaw(this.hisArr)
-        const curHis =  his.map(item=>{
-          return {
-							created: item.createTime,
-							key: item.fileId,
-							user: {
-								name: item.createBy
-							},
-							version: item.fileId
-						}
-        })
+        // console.log('his',his);
+        // const curHis =  his.map(item=>{
+        //   return {
+				// 			created: item.createTime,
+				// 			key: item.fileId,
+				// 			user: {
+				// 				name: item.createBy
+				// 			},
+				// 			version: item.fileId
+				// 		}
+        // })
+          // console.log('curHis',curHis);
         this.docEditor.refreshHistory({
 					currentVersion: 1,
-					history: curHis
+					history: his
 				})
 			// })	
 		},

+ 12 - 0
src/components/PreHistory/PreHistory.vue

@@ -17,6 +17,14 @@ const props = defineProps({
     type: Boolean,
     default: false,
   },
+  historyDocId: {
+    type: Number,
+    default: 0,
+  },
+  historyFileId: {
+    type: Number,
+    default: 0,
+  },
 });
 const usersArr = ref([]);
 const option = ref({
@@ -60,6 +68,10 @@ const getUsers = async () => {
   usersArr.value = res.data;
 };
 onMounted(() => {
+  if(props.historyFileId){
+    oo(props.historyDocId, props.historyFileId);
+    return
+  }
   let route = useRoute();
   getUsers();
   console.log("route", route.query);

+ 1 - 1
src/views/biz/level/index.vue

@@ -8,7 +8,7 @@
 			<span>内容加密:对文档本身进行私有算法加密混淆,仅本软件能解密打开</span>
 			<span>安全访问二次认证:访问文档时需要再次输入登录密码</span>
 			<span>私有安全访问码:访问文档时需要输入自定义的访问密码,创建文档时定义</span>
-			<span>内容防复制:预览状态下复制文档内容到剪贴板</span>
+			<span>内容防复制:预览状态下不允许复制文档内容到剪贴板</span>
 			<span>防拍照:预留功能,实现难度大</span>
 		</div>
 		<el-table v-loading="loading" :data="levelList" @selection-change="handleSelectionChange">

+ 23 - 14
src/views/myfile/MyFile.vue

@@ -408,7 +408,7 @@
             </div>
             <div class="setCli" id="setCli" v-if="cliCC" :style="{ left: xz + 'px', top: yz - 160 + 'px' }">
                 <template v-for="(item, index) in filterMouseCli()" :key="index">
-                    <p @click="chooseSet(item, index, 1)" :class="{'hasLine':item.name == '删除'||item.name == '重命名' ||item.name == '文字识别','btmLine':item.name == '收藏'}" class="chooseSet">
+                    <p @click="chooseSet(item, index, 1)" :class="{'hasLine':item.name == '删除' ||item.name == '文字识别','btmLine':item.name == '收藏'||item.name == '下载'}" class="chooseSet">
                         <img :src="item.img" alt="">
                         {{ item.name }}
                         <span v-if=" item.name == '协作' ? true : false"
@@ -542,8 +542,9 @@
         :close-delay='200'
         :before-close="closeHis"
     >
-     <iframe :key="nowTime" :src="hisIfarmeData.src" :name="nowTime" id="iframeHis" frameborder="0" width="1200px"
-     height="800px" class="iframeBox" ></iframe>
+     <!-- <iframe :key="nowTime" :src="hisIfarmeData.src" :name="nowTime" id="iframeHis" frameborder="0" width="1200px"
+     height="800px" class="iframeBox" ></iframe> -->
+     <PreHistory v-if="showHis" :historyDocId="historyDocId" :historyFileId="historyFileId"></PreHistory>
     </el-dialog>
     <!-- 查看模板的iframe -->
       <el-dialog
@@ -560,7 +561,7 @@
         <el-icon class="icon" @click="delFull" v-else><CopyDocument /></el-icon>
       </div>
     </template>
-     <iframe :key="nowTime" :src="tempIfarmeData.src" :name="nowTime" id="iframeHis" frameborder="0" width="1200px"
+     <iframe :key="nowTime" :src="tempIfarmeData.src" :name="nowTime" id="iframeHis1" frameborder="0" width="1200px"
      height="800px" class="iframeBox" ></iframe>
     </el-dialog>
     <!-- 给新建的文件命名 -->
@@ -572,6 +573,7 @@
 
 <script>
 import { ref, toRaw, onMounted, inject, onActivated ,watch} from 'vue'
+import PreHistory from "@/components/PreHistory/PreHistory.vue"
 import myfile from '../../api/myfile/myfile'
 import {documentation}from "@/api/biz/actor.js"
 import {getInfo,delInfo}from "@/api/biz/info.js"
@@ -851,24 +853,28 @@ export default {
         const tempIfarmeData = ref({})
         const showTemp = ref(false)
         const fullscreen = ref(false)
+        const historyDocId = ref()
+        const historyFileId= ref()
         const hisIfarmeData = ref({
             // src: `${window.location.origin}/fileEdit?clickRowId=7567&canEdit=0&canCopy=0&history=0&fileId=0`,
         })
         const setHisData = (data)=>{
             nowTime.value = new Date().getTime()
+            historyDocId.value = data.docId
+            historyFileId.value = data.fileId
             hisIfarmeData.value = {
                 // src:`${window.location.origin}/fileEdit?clickRowId=${data.docId}&canEdit=0&canCopy=0&history=1&fileId=${data.fileId}`,
                 src:`${window.location.origin}/preHistory?clickRowId=${data.docId}&fileId=${data.fileId}`,
             }
             showHis.value = true
-            const dom = document.getElementById('iframeHis')
-            if(dom){
-                dom.contentWindow.location.reload();
-            }
-            // console.log(21);
-            setTimeout(() => {
-                iframeSize()
-            }, 200);
+            // const dom = document.getElementById('iframeHis')
+            // if(dom){
+            //     dom.contentWindow.location.reload();
+            // }
+            // // console.log(21);
+            // setTimeout(() => {
+            //     iframeSize()
+            // }, 200);
             // console.log('data',data);
         }
         // 控制iframe大小
@@ -3059,7 +3065,9 @@ export default {
             closeTemp,
             fullscreen,
             toFull,
-            delFull
+            delFull,
+            historyDocId,
+            historyFileId
         }
     },
     watch: {
@@ -3086,7 +3094,8 @@ export default {
         ListShow,
         TreeMenu,
         addFileDrop,
-        addFileTempList
+        addFileTempList,
+        PreHistory
     },
 }