瀏覽代碼

Merge remote-tracking branch 'origin/v3' into v3

wukai 1 年之前
父節點
當前提交
fcece1c4f0

+ 3 - 5
src/api/fileCount/fileCount.js

@@ -25,17 +25,15 @@ function addActor(num, data) {
 // 我发起的
 function myCount(data) {
     return request({
-        url: `/biz/actor/initiation`,
-        method: "get",
-        params: data,
+        url: `/biz/actor/initiation?${data}`,
+        method: "get"
     })
 }
 // 我参与的
 function myJoin(data) {
     return request({
-        url: `/biz/actor/participation`,
+        url: `/biz/actor/participation?${data}`,
         method: "get",
-        params: data,
     })
 }
 function createFiles(data) {

+ 1 - 1
src/api/upload/upload.js

@@ -1,4 +1,4 @@
-import request from "../../../src/utils/request-file"
+import request from "../../../src/utils/request"
 // 上传文件
 function uploadFile(data) {
     return request({

+ 0 - 5
src/router/index.js

@@ -91,11 +91,6 @@ export const constantRoutes = [{
 		path: 'reindex',
 		component: () => import('@/views/liveChat/index.vue'),
 		name: 'reindex',
-		meta: {
-			title: '返回',
-			icon: 'dashboard',
-			affix: true
-		},
 	},
 	{
 	    path: '/user/profile',

+ 3 - 3
src/utils/index.js

@@ -65,9 +65,9 @@ export const publicRightMenuRole = (role,arr)=>{
   if(!role.some(item=>item == "edit")){
     arr = arr.filter(item => item.name !== "在线编辑")
   }
-  if(!role.some(item=>item == "delete")){
-    arr = arr.filter(item => item.name !== "删除")
-  }
+  // if(!role.some(item=>item == "delete")){
+  //   arr = arr.filter(item => item.name !== "删除")
+  // }
   return arr
 }
 

+ 12 - 0
src/views/department/MyFile.vue

@@ -910,6 +910,12 @@ export default {
             downLoadfile()
             }
             if (row.name === '收藏') {
+                if(clickRow.value.isFavorite === "Y"){
+                return ElMessage({
+                            type: "error",
+                            message: "请勿重复收藏"
+                         })
+                }
                 collects.value = true
             }
             if (row.name === '在线编辑') {
@@ -1428,6 +1434,12 @@ export default {
         };
         // 文件夹收藏事件
         const collectFolder = () => {
+             if(clickRow.value.isFavorite === "Y"){
+                return ElMessage({
+                            type: "error",
+                            message: "请勿重复收藏"
+                         })
+            }
             isFolder.value = 'Y'
             // clickRow.value = thisFolder.value
             // thisFolder.value = ''

+ 3 - 3
src/views/department/modalComponebts/CreateFloder.vue

@@ -12,8 +12,8 @@
                             <el-radio :label="2">组织目录</el-radio>
                         </el-radio-group>
                     </el-form-item>
-                   <template v-if="(boserForm.dirType === 2 || thisType.dirType == '2') && free">
-                        <template v-if="!upFolderData">
+                   <template v-if="(boserForm.dirType === 2 || thisType.dirType == '2')">
+                        <template v-if="!upFolderData && (free || (!free && thisType.dirType != '2' ))">
                             <el-form-item label="是否加密" v-if="!FolderRole.levelCode || free">
                                 <el-switch v-model="boserForm.isEncrypt" active-value="Y" inactive-value="N" />
                             </el-form-item>
@@ -23,7 +23,7 @@
                                 </el-radio-group>
                             </el-form-item>
                         </template>
-                        <template v-if="thisRole.length<1 || free">
+                        <template v-if="(thisRole.length<1 || free) && (free || (!free && thisType.dirType != '2' ))">
                             <el-form-item v-if="!FolderRole.levelCode || free" label="成员权限">
                                 <el-checkbox-group v-model="boserForm.memberRoles">
                                     <el-checkbox v-for="item in dir_rules" :key="item.value"  :label="item.value">{{item.label}}</el-checkbox>

+ 68 - 21
src/views/highSearch/HighSearch.vue

@@ -1,14 +1,27 @@
 <template>
-  <div class="container" v-if="!showPreview">
+<div class="container">
     <div class="logo">
       <img src="@/assets/images/Frame_427319127.png" alt="" />
       <div class="font">聚合智慧文档管理系统</div>
     </div>
     <div class="search_box">
-      <el-select v-model="selectValue" class="m-2" popper-class="typeSelect" placeholder="Select" size="large">
-        <el-option v-for="item in selectOptions" :key="item.value" :label="item.label" :value="item.value">
+      <el-select
+        v-model="selectValue"
+        class="m-2"
+        popper-class="typeSelect"
+        placeholder="Select"
+        size="large"
+      >
+        <el-option
+          v-for="item in selectOptions"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        >
           <span style="float: left">{{ item.label }}</span>
-          <div v-if="item.value === selectValue" style="
+          <div
+            v-if="item.value === selectValue"
+            style="
               position: relative;
               right: -13px;
               color: #000;
@@ -16,21 +29,32 @@
               font-size: 13px;
               text-align: right;
               box-sizing: border-box;
-            ">
+            "
+          >
           </div>
         </el-option>
       </el-select>
       <div class="line">|</div>
-      <el-input class="search_ipt" v-model="searchText" maxlength="32" @keydown.enter="doSearch"
-        placeholder="请输入要查询的内容" />
-      <div class="search_btn" @click="doSearch" style="cursor: pointer;">搜索</div>
+      <el-input
+        class="search_ipt"
+        v-model="searchText"
+        maxlength="32"
+        @keydown.enter="doSearch"
+        placeholder="请输入要查询的内容"
+      />
+      <div class="search_btn" @click="doSearch" style="cursor: pointer">搜索</div>
     </div>
     <div class="result_box">
       <div class="left_box" v-if="listData.length">
         <div class="dataNum">共查询到{{ total }}个相关结果</div>
       </div>
-      <div class="content_box" v-infinite-scroll="setScroll" infinite-scroll-distance="30" v-if="listData.length">
+      <div
+        class="content_box"
+        v-infinite-scroll="setScroll"
+        infinite-scroll-distance="30"
+        v-if="listData.length"
+      >
         <!-- <el-scrollbar height="200px"  ref="scrollRef" id="scrollRef"> -->
         <div class="oneBox" v-for="item in listData" :key="item.id">
           <span class="fileName" @click="toPreview(item)">{{
@@ -40,7 +64,12 @@
             <img src="@/assets/images/bx:bx-time-five.png" alt="" />
             <span>{{ item.content.docInfo.createTime }}</span>
           </div>
-          <div class="flieContent" v-for="par in item.highlightFields.content" :key="par" v-html="par"></div>
+          <div
+            class="flieContent"
+            v-for="par in item.highlightFields.content"
+            :key="par"
+            v-html="par"
+          ></div>
         </div>
         <div class="showAll" v-if="beEnd">已经到达底部~</div>
         <!-- </el-scrollbar> -->
@@ -51,10 +80,13 @@
       </div>
     </div>
   </div>
-  <div v-else class="preview">
-    <FileEdit :docId="clickRowId" :copyRow="copyRow" :historyPrew="historyPrew" :historycopyRow="historycopyRow"
-      :onlyView="onlyView"></FileEdit>
-  </div>
+  <ImgPreview
+    :previewData="previewData"
+    :copyFileType="copyFileType"
+    :showPreview="showPreview"
+    @closeImgPreview="closeImgPreview"
+  ></ImgPreview>
+   <div v-loading.fullscreen="loadingPreview" v-if="loadingPreview" class="lodingBox"></div>
 </template>
 
 <script setup>
@@ -62,6 +94,8 @@ import { onMounted, ref, inject } from "vue";
 import { search } from "@/api/search/search.js";
 import FileEdit from "@/views/myfile/components/FileEdit.vue";
 import iFrame from "@/components/iFrame/index.vue";
+import ImgPreview from "@/components/ImgPreview/ImgPreview.vue";
+import { preview } from "@/api/common/common.js";
 // import IdentifyFont from "@/components/IdentifyFont/IdentifyFont.vue";
 const searchText = ref(""); //搜索ipt的值
 const selectValue = ref(1); //文档空间类型
@@ -78,7 +112,11 @@ const historyPrew = ref();
 const historycopyRow = ref(false);
 const onlyView = ref(false);
 const showPreview = ref(false);
+const loadingPreview = ref(false)
+const previewData = ref(); //需要预览的文件的数据
+const copyFileType = ref()
 const addFileTab = inject("addFileTab");
+const imgTypeArr = [".png", ".jpg", ".jpeg", ".JPG", ".PNG"];
 const selectOptions = [
   { label: "公共文档", value: 1 },
   { label: "部门文档", value: 2 },
@@ -89,7 +127,7 @@ const selectOptions = [
 const openFile = ref(true);
 // ----------------------------
 
-onMounted(async () => { });
+onMounted(async () => {});
 
 const doSearch = async () => {
   if (!searchText.value) {
@@ -153,13 +191,23 @@ const setScroll = async () => {
 };
 const addTab = inject("addTab");
 // 预览事件
-const toPreview = (item) => {
-  addFileTab(item.content.docInfo);
+const toPreview = async (item) => {
   console.log("item", item);
-  // clickRowId.value = item.content.docInfo.docId;
-  // copyRow.value = item.content.docInfo;
-  // showPreview.value = true;
+  loadingPreview.value = true
+  if (imgTypeArr.some((par) => par == item.content.docInfo.fileType)) {
+    const res = await preview(item.content.docInfo.docId);
+    showPreview.value = true;
+    previewData.value = URL.createObjectURL(res);
+    copyFileType.value = item.content.docInfo.fileType
+    loadingPreview.value = false
+  }
+  // addFileTab(item.content.docInfo);
 };
+//关闭图片预览事件
+const closeImgPreview = () => {
+    // console.log('close');
+    showPreview.value = false
+}
 </script>
 
 <style lang="scss" scoped>
@@ -362,7 +410,6 @@ const toPreview = (item) => {
 <style lang="scss">
 //鼠标移动上去的选中色
 .typeSelect {
-
   .el-select-dropdown__item.hover,
   .el-select-dropdown__item:hover {
     background: #f5f7f9 !important;

+ 1 - 1
src/views/login.vue

@@ -162,7 +162,7 @@ import { ElMessage } from "element-plus";
 import Cookies from "js-cookie";
 import { encrypt, decrypt } from "@/utils/jsencrypt";
 import useUserStore from "@/store/modules/user";
-import { sm3 } from "sm-crypto";
+import { sm3 ,sm2} from "sm-crypto";
 
 const userStore = useUserStore();
 const route = useRoute();

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

@@ -971,6 +971,13 @@ export default {
                 downLoadfile()
             }
             if (row.name === '收藏') {
+            //    console.log('clickRow',clickRow.value);
+               if(clickRow.value.isFavorite === "Y"){
+                return ElMessage({
+                            type: "error",
+                            message: "请勿重复收藏"
+                         })
+                }
                 collects.value = true
             }
             if (row.name === '在线编辑') {
@@ -1551,6 +1558,13 @@ export default {
         };
         // 文件夹收藏事件
         const collectFolder = () => {
+            // console.log('clickRow',clickRow.value);
+            if(clickRow.value.isFavorite === "Y"){
+                return ElMessage({
+                            type: "error",
+                            message: "请勿重复收藏"
+                         })
+            }
             isFolder.value = 'Y'
             // clickRow.value = thisFolder.value
             // thisFolder.value = ''

+ 138 - 71
src/views/myjoin/MyJoin.vue

@@ -1,59 +1,23 @@
 <template>
-    <div v-if="!showEdit">
-        <div class="bigBox">
-            <!-- 功能 -->
-            <div class="tabBox">
-                <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" tab-position="top">
-                    <el-tab-pane label="我发起的" name="first" style="min-height:300px">
-                        <div>
-                            <!-- <el-button @click="newFileAdd">新建文件</el-button> -->
-                        </div>
-                        <div>
-                            <el-table @row-contextmenu="handleRowClick" :data="myEjoy" style="width: 100%;cursor: pointer;" @row-click="rowJoinClickFN">
-                                <!-- <el-table-column type="selection" width="55" /> -->
-                                <el-table-column label="名称" width="280">
-                                    <template #default="scope">
-                                        <span style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="juzhong">
-                                            <img :src="getImage(scope.row.fileType)" alt="" class="juli">
-                                            <el-tooltip class="box-item" effect="dark" placement="top"
-                                            :show-after="1000" :content="scope.row.fileName">
-                                                 <span>{{ scope.row.fileName }}</span>
-                                             </el-tooltip>
-                                        </span>
-                                    </template>
-                                </el-table-column>
-                                <el-table-column prop="createTime" label="时间" sortable width="280" />
-                                <el-table-column prop="fileType" label="类型" />
-                                <el-table-column label="大小">
-                                    <template #default="scope">
-                                        <span>
-                                            {{ formatFileSize(scope.row.fileSize) }}
-                                        </span>
-                                    </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">
-                        <el-table :data="myPack" style="width: 100%;cursor: pointer;" @row-click="rowJoinClickFN">
+    <div class="bigBox">
+        <!-- 功能 -->
+        <div class="tabBox">
+            <el-tabs v-model="activeName" v-el-table-infinite-scroll="setPackScroll" :infinite-scroll-distance="30" :infinite-scroll-disabled="packTotal" class="demo-tabs" @tab-click="handleClick" tab-position="top">
+                <el-tab-pane label="我发起的" name="first" style="min-height:300px">
+                    <div>
+                        <!-- <el-button @click="newFileAdd">新建文件</el-button> -->
+                    </div>
+                    <div>
+                        <el-table @row-contextmenu="handleRowClick" height="calc(88vh - 40px - 15px)" :data="myPack" style="width: 100%;cursor: pointer;" @row-click="rowJoinClickFN">
                             <!-- <el-table-column type="selection" width="55" /> -->
                             <el-table-column label="名称" width="280">
                                 <template #default="scope">
                                     <span style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="juzhong">
                                         <img :src="getImage(scope.row.fileType)" alt="" class="juli">
-                                        
                                         <el-tooltip class="box-item" effect="dark" placement="top"
-                                            :show-after="1000" :content="scope.row.fileName">
-                                            <span>{{ scope.row.fileName }}</span>
-                                        </el-tooltip>
+                                        :show-after="1000" :content="scope.row.fileName">
+                                                <span>{{ scope.row.fileName }}</span>
+                                            </el-tooltip>
                                     </span>
                                 </template>
                             </el-table-column>
@@ -66,24 +30,63 @@
                                     </span>
                                 </template>
                             </el-table-column>
+                            <el-table-column label="是否归档">
+                                <template #default="scope">
+                                    <span>
+                                        {{ scope.row.isFiled === "Y"?'已归档':'未归档' }}
+                                    </span>
+                                </template>
+                            </el-table-column>
                         </el-table>
-                    </el-tab-pane>
-                </el-tabs>
-            </div>
-            <!-- 新增文件盒子 -->
-            <div>
-                <AddFile v-if="newAdd" :newAdd="newAdd" @threeBe="threeBe"></AddFile>
-            </div>
+                        <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">
+                    <el-table :data="myEjoy" style="width: 100%;cursor: pointer;" @row-click="rowJoinClickFN">
+                        <!-- <el-table-column type="selection" width="55" /> -->
+                        <el-table-column label="名称" width="280">
+                            <template #default="scope">
+                                <span style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="juzhong">
+                                    <img :src="getImage(scope.row.fileType)" alt="" class="juli">
+                                    
+                                    <el-tooltip class="box-item" effect="dark" placement="top"
+                                        :show-after="1000" :content="scope.row.fileName">
+                                        <span>{{ scope.row.fileName }}</span>
+                                    </el-tooltip>
+                                </span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column prop="createTime" label="时间" sortable width="280" />
+                        <el-table-column prop="fileType" label="类型" />
+                        <el-table-column label="大小">
+                            <template #default="scope">
+                                <span>
+                                    {{ formatFileSize(scope.row.fileSize) }}
+                                </span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="是否归档">
+                                <template #default="scope">
+                                    <span>
+                                        {{ scope.row.isFiled === "Y"?'已归档':'未归档' }}
+                                    </span>
+                                </template>
+                        </el-table-column>
+                    </el-table>
+                </el-tab-pane>
+            </el-tabs>
+        </div>
+        <!-- 新增文件盒子 -->
+        <div>
+            <AddFile v-if="newAdd" :newAdd="newAdd" @threeBe="threeBe"></AddFile>
         </div>
-    </div>
-    <div v-else class="preview">
-        <FileEdit
-        :docId="clickRowId"
-        :copyRow="copyRow"
-        :historyPrew="historyPrew"
-        :historycopyRow="historycopyRow"
-        :onlyView="onlyView"
-        ></FileEdit>
     </div>
 </template>
 
@@ -98,7 +101,11 @@ import { ElMessage } from 'element-plus';
 import archiveTray from "@/assets/images/archiveTray.png";
 import {documentation}from "@/api/biz/actor.js"
 import {getInfo}from "@/api/biz/info.js"
+import elTableInfiniteScroll from 'el-table-infinite-scroll'
 export default {
+    directives: {
+        'el-table-infinite-scroll': elTableInfiniteScroll
+    },
     setup() {
         const activeName = ref('first')
         let collectImg = ref(true)
@@ -113,6 +120,10 @@ export default {
         const showEdit = ref(false)
         const thisLClickRow = ref()//当前左键的文件
         const addFileTab = inject("addFileTab");
+        const ejoyPageNum = ref(1)
+        const packPageNum = ref(1)
+        const ejoyTotal = ref(true)
+        const packTotal = ref(true)
         const clickRow = ref()
         let xz = ref(0)
         let yz = ref(0)
@@ -147,17 +158,67 @@ export default {
             
         }
         function getCountPeople() {
-            fileCount.myCount({}).then(res => {
-                myEjoy.value = res.rows
+            packTotal.value = true
+            packPageNum.value = 1
+            const query = `pageSize=20&pageNum=${packPageNum.value}`
+            fileCount.myCount(query).then(res => {
+                myPack.value = res.rows
+                if(res.rows.length <res.total){
+                    packTotal.value = false
+                }
             })
         }
         function getMyJoin() {
-            fileCount.myJoin({}).then(res => {
-                myPack.value = res.rows
+            ejoyTotal.value = true
+            ejoyPageNum.value = 1
+            const query = `pageSize=20&pageNum=${ejoyPageNum.value}`
+            console.log('query',query);
+            fileCount.myJoin(query).then(res => {
+                myEjoy.value = res.rows
+                if(res.rows.length <res.total){
+                    ejoyTotal.value = false
+                }
             })
         }
+        const setJoinScroll = ()=>{
+            // console.log('btm');
+             ejoyPageNum.value = ejoyPageNum.value + 1
+            const query = `pageSize=20&pageNum=${ejoyPageNum.value}`
+              // -------------先禁止掉事件 定时器1秒钟后才能再次触发
+            ejoyTotal.value = true
+            fileCount.myJoin(query).then(res => {
+                const newarr = toRaw(myEjoy.value).concat(res.rows)
+                console.log('newarr', newarr);
+                myEjoy.value = JSON.parse(JSON.stringify(newarr))
+                if(newarr.length <res.total){
+                    //获取后的数量<total就可以再次获取
+                    setTimeout(()=>{
+                        ejoyTotal.value = false
+                    },1000)
+                }
+            })
+        }
+        const setPackScroll = ()=>{
+            // console.log('btm');
+            packPageNum.value = packPageNum.value + 1
+            const query = `pageSize=20&pageNum=${packPageNum.value}`
+              // -------------先禁止掉事件 定时器1秒钟后才能再次触发
+            packTotal.value = true
+            fileCount.myCount(query).then(res => {
+                const newarr = toRaw(myPack.value).concat(res.rows)
+                console.log('newarr', newarr);
+                myPack.value = JSON.parse(JSON.stringify(newarr))
+                if(newarr.length <res.total){
+                    //获取后的数量<total就可以再次获取
+                    setTimeout(()=>{
+                        packTotal.value = false
+                    },1000)
+                }
+            })
+            
+        }
         function handleClick(data, e) {
-            console.log(data, e, 'tab');
+            // console.log(data, e, 'tab');
         }
         function getImage(file) {
             if (file === '.txt') {
@@ -270,7 +331,13 @@ export default {
             closeRMenu,
             cliCC,
             chooseSet,
-            rowJoinClickFN
+            rowJoinClickFN,
+            ejoyPageNum,
+            packPageNum,
+            ejoyTotal,
+            packTotal,
+            setJoinScroll,
+            setPackScroll
         }
     },
     components:{

+ 12 - 0
src/views/publicment/MyFile.vue

@@ -917,6 +917,12 @@ export default {
             downLoadfile()
             }
             if (row.name === '收藏') {
+                if(clickRow.value.isFavorite === "Y"){
+                return ElMessage({
+                            type: "error",
+                            message: "请勿重复收藏"
+                         })
+                        }
                 collects.value = true
             }
             if (row.name === '在线编辑') {
@@ -1431,6 +1437,12 @@ export default {
         };
         // 文件夹收藏事件
         const collectFolder = () => {
+             if(clickRow.value.isFavorite === "Y"){
+                return ElMessage({
+                            type: "error",
+                            message: "请勿重复收藏"
+                       })
+            }
             isFolder.value = 'Y'
             // clickRow.value = thisFolder.value
             // thisFolder.value = ''

+ 3 - 3
src/views/publicment/modalComponebts/CreateFloder.vue

@@ -12,8 +12,8 @@
                             <el-radio :label="2">组织目录</el-radio>
                         </el-radio-group>
                     </el-form-item>
-                   <template v-if="(boserForm.dirType === 2 || thisType.dirType == '2') && free">
-                        <template v-if="!upFolderData">
+                   <template v-if="(boserForm.dirType === 2 || thisType.dirType == '2')">
+                        <template v-if="!upFolderData  && (free || (!free && thisType.dirType != '2' ))">
                             <el-form-item label="是否加密" v-if="!FolderRole.levelCode || free">
                                 <el-switch v-model="boserForm.isEncrypt" active-value="Y" inactive-value="N" />
                             </el-form-item>
@@ -23,7 +23,7 @@
                                 </el-radio-group>
                             </el-form-item>
                         </template>
-                        <template v-if="thisRole.length<1 || free">
+                        <template v-if="(thisRole.length<1 || free) && (free || (!free && thisType.dirType != '2' ))">
                             <el-form-item v-if="!FolderRole.levelCode || free" label="成员权限">
                                 <el-checkbox-group v-model="boserForm.memberRoles">
                                     <el-checkbox v-for="item in dir_rules" :key="item.value"  :label="item.value">{{item.label}}</el-checkbox>