Răsfoiți Sursa

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-fm into dengfei

695593266@qq.com 8 luni în urmă
părinte
comite
82779c07c4

+ 1 - 1
qiankun_config/store.js

@@ -19,6 +19,6 @@ export default function (state) {
     store.commit('user/setUserInfo', state.user.info);
   }
   if (state.user?.authorityDept) {
-    store.dispatch('user/getCurrentUserAuthorityDept');
+    // store.dispatch('user/getCurrentUserAuthorityDept');
   }
 }

+ 7 - 11
src/views/doc/components/browse.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="browse" v-loading="loading">
-    <span class="fullscreen" v-if="fileType == 1" @click="showEditFlag = true">
+    <span class="fullscreen" v-if="fileType == 1" @click="open">
       <i class="el-icon-full-screen"></i>
       全屏
     </span>
@@ -33,7 +33,7 @@
 </template>
 
 <script>
-  import { getFileType } from '../util.js';
+  import { setFileUrl } from '../util.js';
 
   export default {
     data() {
@@ -47,19 +47,15 @@
     },
 
     methods: {
+      open() {
+        window.open(this.fileUrl);
+      },
       setFileUrl(row) {
         this.loading = true;
         this.fileUrl = '';
         this.isShow = false;
-        let file = row.storagePath[0];
-        let fileNames = file.storePath.split('/');
-        let url =
-          window.location.origin +
-          '/api/main/file/getFile?objectName=' +
-          file.storePath +
-          '&fullfilename=' +
-          fileNames[fileNames.length - 1];
-        this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
+
+        this.fileUrl = setFileUrl(row);
         this.$nextTick(() => {
           this.$refs.Iframe.onload = () => {
             this.loading = false;

+ 12 - 10
src/views/doc/components/file-editAll.vue

@@ -219,10 +219,9 @@
 
         if (this.options.length > 0) {
           this.form.businessCodeId = this.options[0].id;
-          this.form.codeType=this.options[0].parentId
-
-        }else{
-          this.form.businessCodeId=''
+          this.form.codeType = this.options[0].parentId;
+        } else {
+          this.form.businessCodeId = '';
         }
       },
       setTree(data) {
@@ -236,18 +235,21 @@
         });
       },
       async typeChange(val) {
-        let data = await listParentId({
+        let obj = {
           pageNum: 1,
           size: 100,
-          parentId: val,
-          objId:this.nodeData?.id,
-          objParentId:this.nodeData?.parentId,
-        });
+          parentId: val
+        };
+        if (this.fileType == 0) {
+          obj['objId'] = this.nodeData?.id;
+          obj['objParentId'] = this.nodeData?.parentId;
+        }
+        let data = await listParentId(obj);
         this.options = data.list.filter((item) => item.type == 2);
         this.form.businessCodeId = '';
       },
       cascaderChange() {
-        this.getCode()
+        this.getCode();
       },
       // getCodeOpen() {
       //   this.$refs.getCode.open();

+ 55 - 16
src/views/doc/components/file-table-list.vue

@@ -221,6 +221,23 @@
         <!-- </div> -->
       </template>
 
+      <template v-slot:directoryId="{ row }">
+        <el-cascader
+          style="width: 100%"
+          v-model="row.directoryId"
+          class="my-cascader"
+          :disabled="true"
+          :options="folderList"
+          :props="{
+            value: 'id',
+            label: 'name',
+            children: 'sonDirectoryList',
+            emitPath: false,
+            checkStrictly: true
+          }"
+        ></el-cascader>
+      </template>
+
       <!-- 操作列 -->
       <template v-slot:action="{ row }">
         <el-dropdown
@@ -466,6 +483,15 @@
               );
             }
           },
+          {
+            label: '文档位置',
+            prop: 'directoryId',
+            slot: 'directoryId',
+            width: 220,
+            align: 'center',
+            fixed: 'left',
+            showOverflowTooltip: true
+          },
           {
             label: '编码',
             prop: 'code',
@@ -756,28 +782,28 @@
           return;
         }
 
-        let createUserS=[],checkOutS=[]
-        this.selection.forEach(item=>{
-          if(!isCreateUserId(item)){
-            createUserS.push(item.name)
+        let createUserS = [],
+          checkOutS = [];
+        this.selection.forEach((item) => {
+          if (!isCreateUserId(item)) {
+            createUserS.push(item.name);
           }
-          if(isCreateUserId(item)){
-            checkOutS.push(item.name)
+          if (isCreateUserId(item)) {
+            checkOutS.push(item.name);
           }
-        })
-        if(createUserS.toString()){
-          this.$message.warning(createUserS+'您不是创建人,无权限修改!');
+        });
+        if (createUserS.toString()) {
+          this.$message.warning(createUserS + '您不是创建人,无权限修改!');
           return;
         }
-        if(!checkOutS.toString()){
-          this.$message.warning(checkOutS+'已被检出 无法修改!');
+        if (!checkOutS.toString()) {
+          this.$message.warning(checkOutS + '已被检出 无法修改!');
           return;
         }
         this.powerOpenShow = true;
-        this.$nextTick(()=>{
-          this.$refs.PowerRefAll.setTableList([])
-        })
-                
+        this.$nextTick(() => {
+          this.$refs.PowerRefAll.setTableList([]);
+        });
       },
       //权限保存
       powerSave(tableList) {
@@ -970,10 +996,23 @@
   };
 </script>
 <style scoped lang="scss">
-  .el-tabs__content {
+  :deep(.el-tabs__content) {
     height: calc(100% - 39px);
+    overflow: auto;
   }
   :deep(.ele-table-tool-title-content) {
     display: contents;
   }
+  .my-cascader {
+  
+
+    :deep(.el-input__inner) {
+      border: none;
+      background: none;
+        cursor: inherit;
+    }
+    :deep(.el-input__suffix) {
+      display: none;
+    }
+  }
 </style>

+ 152 - 119
src/views/doc/components/info.vue

@@ -1,14 +1,8 @@
 <!-- 用户编辑弹窗 -->
 <template>
-  <el-form
-    ref="form"
-    :model="form"
-    style="width: 800px"
-    label-width="120px"
-    disabled
-  >
+  <el-form ref="form" :model="form" label-width="120px" disabled>
     <el-row :gutter="15">
-      <el-col :span="12">
+      <el-col :span="8">
         <el-form-item label="文档类型" prop="type">
           <DictSelection
             dictName="文档类型"
@@ -16,20 +10,27 @@
             :disabled="true"
           ></DictSelection>
         </el-form-item>
-      </el-col>
-
-      <el-col :span="12">
-        <el-form-item label="文档名称" prop="name">
-          <el-input v-model="form.name"></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="12">
         <el-form-item label="文档大小" prop="sizeUnit">
           <el-input v-model="form.sizeUnit"></el-input>
         </el-form-item>
+        <el-form-item label="检出人" prop="checkOutUserName">
+          <el-input v-model="form.checkOutUserName"></el-input>
+        </el-form-item>
+        <el-form-item label="检出时间" prop="checkOutTime">
+          <el-input v-model="form.checkOutTime"> </el-input>
+        </el-form-item>
+        <el-form-item label="创建时间" prop="createTime">
+          <el-input v-model="form.createTime"></el-input>
+        </el-form-item>
+        <el-form-item label="修改时间" prop="updateTime">
+          <el-input v-model="form.updateTime"></el-input>
+        </el-form-item>
       </el-col>
 
-      <el-col :span="12">
+      <el-col :span="8">
+        <el-form-item label="文档名称" prop="name">
+          <el-input v-model="form.name"></el-input>
+        </el-form-item>
         <el-form-item label="文档位置" prop="directoryId">
           <el-cascader
             style="width: 100%"
@@ -44,52 +45,51 @@
             }"
           ></el-cascader>
         </el-form-item>
-      </el-col>
-      <el-col :span="12">
-        <el-form-item label="检出人" prop="checkOutUserName">
-          <el-input v-model="form.checkOutUserName"></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="12">
         <el-form-item label="检出状态" prop="checkOutStatus">
-          <el-input v-model="form.checkOutStatus">
-          
-          </el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="12">
-        <el-form-item label="检出时间" prop="checkOutTime">
-          <el-input v-model="form.checkOutTime">
-          </el-input>
-
+          <el-input v-model="form.checkOutStatus"> </el-input>
         </el-form-item>
-      </el-col>
-      <el-col :span="12">
         <el-form-item label="创建人" prop="createUserName">
           <el-input v-model="form.createUserName"></el-input>
         </el-form-item>
-      </el-col>
-      <el-col :span="12">
-        <el-form-item label="创建时间" prop="createTime">
-          <el-input v-model="form.createTime"></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="12">
         <el-form-item label="修改人" prop="updateUserName">
           <el-input v-model="form.updateUserName"></el-input>
         </el-form-item>
-      </el-col>
-      <el-col :span="12">
-        <el-form-item label="修改时间" prop="updateTime">
-          <el-input v-model="form.updateTime"></el-input>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea"></el-input>
         </el-form-item>
       </el-col>
-      <el-col :span="12">
-        <el-form-item label="备注" prop="remark">
+      <el-col
+        :span="8"
+        v-if="
+          isCreateUserId(form) ||
+          isPower(form, 'download') ||
+          isPower(form, 'revise')
+        "
+      >
+        <el-form-item label="文档地址" prop="filePath">
           <el-input
-            v-model="form.remark"
-            type="textarea"
+            v-model="form.filePath"
+            :title="form.filePath"
+            style="width: calc(100% - 70px)"
           ></el-input>
+          <div
+            style="
+              margin-left: 10px;
+              cursor: pointer;
+              background: #409eff;
+              width: 60px;
+              color: #fff;
+              height: 30px;
+              display: inline-block;
+              text-align: center;
+              line-height: 30px;
+              border-radius: 3px;
+            "
+            @click="copyTextToClipboard(form.filePath)"
+          >
+            复制</div
+          >
+          <!-- <el-button type="primary" size="mini"  @click.native="copyTextToClipboard(form.filePath)" style="width: 60px; margin-left: 10px">复制</el-button> -->
         </el-form-item>
       </el-col>
     </el-row>
@@ -97,86 +97,119 @@
 </template>
 
 <script>
-import { fileGetByIdAPI } from '@/api/doc-manage';
+  import { fileGetByIdAPI } from '@/api/doc-manage';
+  import { isPower, isCreateUserId } from '../util.js';
+  export default {
+    props: {
+      // 上级id
+      parentId: [Number, String],
+      // 文件夹数据
+      folderList: {
+        type: Array,
+        default: () => []
+      }
+    },
+    data() {
+      const defaultForm = {
+        name: '', //名称
+        type: '', //类型
+        sizeUnit: '', //大小
+        unit: '', //单位
+        remark: '', //备注
+        status: '', //状态
+        storagePathId: '',
+        directoryId: '',
+        storagePath: [],
+        id: '',
+        filePath: ''
+      };
+      return {
+        defaultForm,
+        isPower,
+        isCreateUserId,
+        // 表单数据
+        form: { ...defaultForm },
+        // 表单验证规则
+        // 提交状态
+        loading: false
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created() {},
+    watch: {
+      parentId: function (val) {
+        if (val) {
+          this.init(val);
+        }
+      }
+    },
+    methods: {
+      copyTextToClipboard(text) {
+        // alert(1);
+        var textArea = document.createElement('textarea');
+        textArea.value = text;
+        // 避免滚动到页面的最底部
+        document.body.appendChild(textArea);
+        textArea.focus();
+        textArea.select();
+        try {
+          var successful = document.execCommand('copy');
+        if(successful){
+           this.$message.success('复制成功')
+        }
+        } catch (err) {
+          console.error('Oops, unable to copy', err);
+        }
 
-export default {
-  props: {
-    // 上级id
-    parentId: [Number, String],
-    // 文件夹数据
-    folderList: {
-      type: Array,
-      default: () => []
-    }
-  },
-  data() {
-    const defaultForm = {
-      name: '', //名称
-      type: '', //类型
-      sizeUnit: '', //大小
-      unit: '', //单位
-      remark: '', //备注
-      status: '', //状态
-      storagePathId: '',
-      directoryId: '',
-      storagePath: [],
-      id: ''
-    };
-    return {
-      defaultForm,
-      // 表单数据
-      form: { ...defaultForm },
-      // 表单验证规则
-      // 提交状态
-      loading: false
-    };
-  },
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
-    }
-  },
-  created() {},
-  watch: {
-    parentId:function(val) {
-    
-      if (val) {
-        this.init(val);
+        document.body.removeChild(textArea);
+      },
+
+      async init(val) {
+        this.form = await fileGetByIdAPI(val);
+        let file = this.form.storagePath[0];
+        let fileNames = file.storePath.split('/');
+        let url =
+          window.location.origin +
+          '/api/main/file/getFile?objectName=' +
+          file.storePath +
+          '&fullfilename=' +
+          fileNames[fileNames.length - 1];
+        this.form.filePath = url;
+        console.log(this.form, 'this.form');
+        this.form.checkOutStatus =
+          this.form.checkOutStatus == 1 ? '已检出' : '';
+        this.form.type = this.form.type + '';
       }
     }
-  },
-  methods: {
-    async init(val) {
-      this.form = await fileGetByIdAPI(val);
-      this.form.checkOutStatus=this.form.checkOutStatus==1?'已检出':""
-      this.form.type = this.form.type + '';
-    }
-  }
-};
+  };
 </script>
 <style scoped lang="scss">
-.aaa {
-  width: 100%;
-
-  ::v-deep .upload-demo {
+  .aaa {
     width: 100%;
 
-    .el-upload--text {
+    ::v-deep .upload-demo {
       width: 100%;
 
-      button {
+      .el-upload--text {
         width: 100%;
-        background: #ffffff;
-        border: 1px solid #dbdbdb;
-        border-radius: 5px;
+
+        button {
+          width: 100%;
+          background: #ffffff;
+          border: 1px solid #dbdbdb;
+          border-radius: 5px;
+        }
       }
-    }
 
-    .el-upload-list {
-      transform: translate(10px, -39px);
-      position: absolute;
+      .el-upload-list {
+        transform: translate(10px, -39px);
+        position: absolute;
+      }
     }
   }
-}
 </style>

+ 64 - 3
src/views/doc/components/main.vue

@@ -251,10 +251,16 @@ export default {
       this.loading = false;
     },
     /* 选择数据 */
-    onNodeClick(row) {
-      console.log(row,'row')
+    onNodeClick(row, node, list) {
+      console.log('row',row, node, list)
       if (row) {
-        this.current = row;
+        // 构建完整路径
+        const fullPath = this.buildFullPath(row, this.data);
+        // 将完整路径添加到current对象中
+        this.current = {
+          ...row,
+          fullPath: fullPath
+        };
         this.$nextTick(() => {
           this.$refs.tableRef.reload();
         });
@@ -262,6 +268,61 @@ export default {
         this.current = null;
       }
     },
+    
+    /* 构建完整路径 */
+    buildFullPath(currentNode, folderList) {
+      // 如果节点没有parentId,直接返回节点名称
+      if (!currentNode.parentId || currentNode.parentId === 0) {
+        return currentNode.name;
+      }
+      
+      // 递归查找上级节点
+      function findParent(node, list) {
+        let path = [node.name];
+        let parentId = node.parentId;
+        
+        // 递归查找所有父节点
+        function searchParent(id) {
+          for (const item of list) {
+            if (item.id === id) {
+              path.unshift(item.name); // 将父节点名称添加到路径开头
+              if (item.parentId && item.parentId !== 0) {
+                searchParent(item.parentId); // 继续查找上一级
+              }
+              return;
+            }
+            // 如果当前节点有子节点,继续在子节点中查找
+            if (item.sonDirectoryList && item.sonDirectoryList.length > 0) {
+              searchParentInChildren(item.sonDirectoryList, id);
+            }
+          }
+        }
+        
+        // 在子节点列表中查找父节点
+        function searchParentInChildren(children, id) {
+          for (const child of children) {
+            if (child.id === id) {
+              path.unshift(child.name);
+              if (child.parentId && child.parentId !== 0) {
+                searchParent(child.parentId);
+              }
+              return;
+            }
+            if (child.sonDirectoryList && child.sonDirectoryList.length > 0) {
+              searchParentInChildren(child.sonDirectoryList, id);
+            }
+          }
+        }
+        
+        if (parentId) {
+          searchParent(parentId);
+        }
+        
+        return path.join(' / ');
+      }
+      
+      return findParent(currentNode, folderList);
+    },
     allowDrop(draggingNode, dropNode, type) {
       //拖拽限制
       return dropNode.parent.id == draggingNode.parent.id && type != 'inner';

+ 332 - 336
src/views/doc/issue_doc/components/edit.vue

@@ -52,7 +52,6 @@
               format="yyyy-MM-dd HH:mm:ss"
               value-format="yyyy-MM-dd HH:mm:ss"
               style="width: 60%"
-
             >
             </el-date-picker>
             <el-checkbox
@@ -91,10 +90,12 @@
           </el-form-item>
         </el-col> -->
         <el-col :span="6">
-          <el-form-item label="创建时间" prop="createTime" v-if="type == 'view'">
-            <el-input v-model="form.createTime" disabled >
-            </el-input>
-      
+          <el-form-item
+            label="创建时间"
+            prop="createTime"
+            v-if="type == 'view'"
+          >
+            <el-input v-model="form.createTime" disabled> </el-input>
           </el-form-item>
         </el-col>
         <el-col :span="24">
@@ -144,7 +145,6 @@
                   class="ele-action"
                   title="确定要删除此文档吗?"
                   v-if="type != 'view'"
-
                   @confirm="remove(row)"
                 >
                   <template v-slot:reference>
@@ -158,7 +158,7 @@
                   </template>
                 </el-popconfirm>
                 <el-link
-                  v-if="type == 'view'"
+                
                   type="primary"
                   :underline="false"
                   icon="el-icon-edit"
@@ -185,7 +185,7 @@
               height="200px"
               :powerArr="powerArr"
               :isSave="false"
-              :isAdd="type != 'power'&&type != 'view'"
+              :isAdd="type != 'power' && type != 'view'"
               ref="powerRef"
             />
           </el-form-item>
@@ -239,352 +239,348 @@
         </el-button>
       </template>
     </ele-modal>
-    <browse ref="browseRef"></browse>
-
+    <!-- <browse ref="browseRef"></browse> -->
   </ele-modal>
 </template>
-  
-  <script>
-import {
-  sendSave,
-  sendGetById,
-  sendUpdate,
-  recycleAuthority,
-  getDocTreeListAPI
-} from '@/api/doc-manage';
-import power from '@/views/doc/components/power/index.vue';
-import doc_template from '@/views/doc/components/template/doc_template.vue';
-import { mapGetters } from 'vuex';
-import bpmDetail from '@/views/bpm/processInstance/detail.vue';
-import browse from '@/views/doc/components/browseOpen.vue';
-import { fileStatus } from '@/views/doc/util.js';
-const dayjs = require('dayjs');
 
-const defaultForm = {
-  name: '', //名称
-  fileList: [], //文档集合json
-  userAuthority: [], //用户权限集合json
-  releaseTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'), //发布时间
-  failureTime: '', //失效时间
-  isAuthority: '', //是否回收权限 0 1
-  remark: '',
-  releaseUserName: ''
-};
-export default {
-  components: { power, doc_template, bpmDetail,browse },
-  props: {
-    isAdd: {
-      default: true
-    }
-  },
-  data() {
-    return {
-      // 表单数据
-      activeComp: '发布信息',
-      tabOptions: [
-        { key: '发布信息', name: '发布信息' },
-        { key: '签收记录', name: '签收记录' },
-        { key: '工作流', name: '工作流' }
-      ],
-      bpmDetailFlag: true,
+<script>
+  import {
+    sendSave,
+    sendGetById,
+    sendUpdate,
+    recycleAuthority,
+    getDocTreeListAPI
+  } from '@/api/doc-manage';
+  import power from '@/views/doc/components/power/index.vue';
+  import doc_template from '@/views/doc/components/template/doc_template.vue';
+  import { mapGetters } from 'vuex';
+  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+  // import browse from '@/views/doc/components/browseOpen.vue';
+  import { fileStatus,setFileUrl } from '@/views/doc/util.js';
+  const dayjs = require('dayjs');
 
-      form: { ...defaultForm },
-      tableList: [],
-      // 表单验证规则
-      rules: {
-        name: [{ required: true, message: '请输入', trigger: 'blur' }],
-        releaseTime: [{ required: true, message: '请选择', trigger: 'blur' }],
-      },
-      // 提交状态
-      loading: false,
-      title: '',
-      type: '',
-      showEditFlag: false,
-      visible: false,
-      columns: [
-        {
-          label: '编码',
-          prop: 'code',
-          width: 180,
-          align: 'center',
-          fixed: 'left',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'name',
-          label: '文档名称',
-          align: 'center',
-          slot: 'name',
-          showOverflowTooltip: true,
-          minWidth: 200
-        },
-        {
-          prop: 'storagePath',
-          label: '文件名称',
-          align: 'center',
+  const defaultForm = {
+    name: '', //名称
+    fileList: [], //文档集合json
+    userAuthority: [], //用户权限集合json
+    releaseTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'), //发布时间
+    failureTime: '', //失效时间
+    isAuthority: '', //是否回收权限 0 1
+    remark: '',
+    releaseUserName: ''
+  };
+  export default {
+    components: { power, doc_template, bpmDetail },
+    props: {
+      isAdd: {
+        default: true
+      }
+    },
+    data() {
+      return {
+        // 表单数据
+        activeComp: '发布信息',
+        tabOptions: [
+          { key: '发布信息', name: '发布信息' },
+          { key: '签收记录', name: '签收记录' },
+          { key: '工作流', name: '工作流' }
+        ],
+        bpmDetailFlag: true,
 
-          showOverflowTooltip: true,
-          minWidth: 200,
-          formatter: (_row, _column, cellValue) => {
-            return cellValue[0]?.name;
-          }
-        },
-        {
-          prop: 'directoryId',
-          label: '文档位置',
-          align: 'center',
-          slot: 'directoryId',
-          showOverflowTooltip: true,
-          minWidth: 300
-        },
-        {
-          prop: 'version',
-          label: '版本',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
+        form: { ...defaultForm },
+        tableList: [],
+        // 表单验证规则
+        rules: {
+          name: [{ required: true, message: '请输入', trigger: 'blur' }],
+          releaseTime: [{ required: true, message: '请选择', trigger: 'blur' }]
         },
+        // 提交状态
+        loading: false,
+        title: '',
+        type: '',
+        showEditFlag: false,
+        visible: false,
+        columns: [
+          {
+            label: '编码',
+            prop: 'code',
+            width: 180,
+            align: 'center',
+            fixed: 'left',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '文档名称',
+            align: 'center',
+            slot: 'name',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'storagePath',
+            label: '文件名称',
+            align: 'center',
 
-        {
-          prop: 'createUserName',
-          label: '创建人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 160,
-          formatter: (_row, _column, cellValue) => {
-            return this.$util.toDateString(cellValue);
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue[0]?.name;
+            }
+          },
+          {
+            prop: 'directoryId',
+            label: '文档位置',
+            align: 'center',
+            slot: 'directoryId',
+            showOverflowTooltip: true,
+            minWidth: 300
+          },
+          {
+            prop: 'version',
+            label: '版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          },
+          {
+            prop: 'updateUserName',
+            label: '修改人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'updateTime',
+            label: '修改时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160
+          },
+          {
+            prop: 'sizeUnit',
+            label: '文档大小',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return fileStatus(cellValue);
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 200,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right'
           }
-        },
-        {
-          prop: 'updateUserName',
-          label: '修改人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-        {
-          prop: 'updateTime',
-          label: '修改时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 160
-        },
-        {
-          prop: 'sizeUnit',
-          label: '文档大小',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-        {
-          prop: 'status',
-          label: '状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100,
-          formatter: (_row, _column, cellValue) => {
-            return fileStatus(cellValue);
+        ],
+        signColumns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            label: '序号',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+
+          {
+            align: 'center',
+            prop: 'deptName',
+            label: '部门',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            align: 'center',
+            prop: 'name',
+            label: '姓名',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            align: 'center',
+            prop: 'signFor',
+            label: '姓名',
+            showOverflowTooltip: true,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue == 1 ? '是' : '否';
+            }
+          },
+          {
+            align: 'center',
+            prop: 'signForTime',
+            label: '签收时间',
+            showOverflowTooltip: true
           }
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 200,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true,
-          fixed: 'right'
+        ],
+        powerArr: [
+          { name: 'visible', label: '可见' },
+          { name: 'check', label: '查看' },
+          { name: 'browse', label: '浏览' },
+          { name: 'download', label: '下载' },
+          { name: 'print', label: '打印' }
+        ],
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(['user'])
+    },
+    async created() {
+      let query = {
+        type: 0,
+        currentUserId: this.user.info.userId
+      };
+      this.data = await getDocTreeListAPI(query);
+    },
+    methods: {
+      async open(type, row, list, fileType) {
+        this.title =
+          type == 'add'
+            ? '发布'
+            : type == 'edit'
+            ? '编辑'
+            : type == 'power'
+            ? '回收权限'
+            : '详情';
+        this.type = type;
+        if (list) {
+          this.tableList = JSON.parse(JSON.stringify(list));
         }
-      ],
-      signColumns: [
-        {
-          columnKey: 'index',
-          type: 'index',
-          label: '序号',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
 
-        {
-          align: 'center',
-          prop: 'deptName',
-          label: '部门',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          align: 'center',
-          prop: 'name',
-          label: '姓名',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          align: 'center',
-          prop: 'signFor',
-          label: '姓名',
-          showOverflowTooltip: true,
-          formatter: (_row, _column, cellValue) => {
-            return cellValue == 1 ? '是' : '否';
+        if (this.type != 'add') {
+          this.form = await sendGetById(row.id);
+          this.tableList = this.form.fileList;
+          this.$nextTick(() => {
+            this.$refs.powerRef &&
+              this.$refs.powerRef.setTableList(this.form.userAuthority || []);
+          });
+        } else {
+          this.form.releaseUserName = this.user.info.name;
+          if (fileType == 1) {
+            this.tableList = this.tableList.map((item) => {
+              item.directoryId = '';
+              return item;
+            });
           }
-        },
-        {
-          align: 'center',
-          prop: 'signForTime',
-          label: '签收时间',
-          showOverflowTooltip: true
         }
-      ],
-      powerArr: [
-        { name: 'visible', label: '可见' },
-        { name: 'check', label: '查看' },
-        { name: 'browse', label: '浏览' },
-        { name: 'download', label: '下载' },
-        { name: 'print', label: '打印' }
-      ],
-      data: []
-    };
-  },
-  computed: {
-    ...mapGetters(['user'])
-  },
-  async created() {
-    let query = {
-      type: 0,
-      currentUserId: this.user.info.userId
-    };
-    this.data = await getDocTreeListAPI(query);
-  },
-  methods: {
-   async open(type, row, list,fileType) {
-      this.title =
-        type == 'add'
-          ? '发布'
-          : type == 'edit'
-          ? '编辑'
-          : type == 'power'
-          ? '回收权限'
-          : '详情';
-      this.type = type;
-      if (list) {
-        this.tableList = JSON.parse(JSON.stringify(list));
-      }
-
-      if (this.type != 'add') {
-        this.form = await sendGetById(row.id)
-        this.tableList = this.form.fileList;
+        this.bpmDetailFlag = false;
         this.$nextTick(() => {
-          this.$refs.powerRef &&
-            this.$refs.powerRef.setTableList(this.form.userAuthority || []);
+          this.bpmDetailFlag = true;
         });
-      } else {
-        this.form.releaseUserName = this.user.info.name;
-        if(fileType==1){
-          this.tableList=this.tableList.map(item=>{
-            item.directoryId=''
-            return item
-          })
-        }
-      }
-      this.bpmDetailFlag = false;
-      this.$nextTick(() => {
-        this.bpmDetailFlag = true;
-      });
-      this.showEditFlag = true;
-    },
-    disabledDate() {
-      return false;
-    },
-    browseOpen(row) {
-        this.$refs.browseRef.open(row);
+        this.showEditFlag = true;
       },
-    failureTimeChange(){
-      if(this.form.failureTime){
-        this.form.isAuthority=1
-      }else{
-        this.form.isAuthority=0
-
-      }
-    },
-    save() {
-      this.$refs.form.validate((valid) => {
-        if (!valid) {
-          return false;
-        }
-        let isDirectory = true;
-        this.form.fileList = this.tableList;
-        this.form.userAuthority = this.$refs.powerRef.getTableList();
-        if (this.tableList.length == 0) {
-          this.$message.error('请选择发布文档');
-          return;
+      disabledDate() {
+        return false;
+      },
+      browseOpen(row) {
+        window.open(setFileUrl(row));
+      },
+      failureTimeChange() {
+        if (this.form.failureTime) {
+          this.form.isAuthority = 1;
+        } else {
+          this.form.isAuthority = 0;
         }
-        this.tableList.forEach((item) => {
-          console.log(item,'item')
-          if (!item.directoryId) {
-            isDirectory = false;
+      },
+      save() {
+        this.$refs.form.validate((valid) => {
+          if (!valid) {
+            return false;
           }
-        });
-        // console.log(isDirectory,'isDirectory')
-        // return
-        if (!isDirectory) {
-          this.$message.error('请选择文档位置');
-          return;
-        }
-        // if (this.form.userAuthority.length == 0 && this.type != 'power') {
-        //   this.$message.error('请选择通知用户');
-        //   return;
-        // }
-        this.loading = true;
-        if (this.type == 'add') {
-          delete this.form.id;
-        }
-
-        let URL =
-          this.type == 'add'
-            ? sendSave
-            : this.type == 'power'
-            ? recycleAuthority
-            : sendUpdate;
-        URL(this.form)
-          .then((msg) => {
-            this.loading = false;
-            this.$emit('done');
-            this.cancel();
-          })
-          .catch((e) => {
-            this.loading = false;
+          let isDirectory = true;
+          this.form.fileList = this.tableList;
+          this.form.userAuthority = this.$refs.powerRef.getTableList();
+          if (this.tableList.length == 0) {
+            this.$message.error('请选择发布文档');
+            return;
+          }
+          this.tableList.forEach((item) => {
+            console.log(item, 'item');
+            if (!item.directoryId) {
+              isDirectory = false;
+            }
           });
-      });
-    },
-    cancel() {
-      this.form = { ...defaultForm };
-      this.tableList = [];
-      this.$refs.powerRef.setTableList([]);
-      this.showEditFlag = false;
-    },
-    mainCancel() {
-      this.visible = false;
-    },
-    remove(row) {
-      this.tableList = this.tableList.filter((item) => item.id != row.id);
-    },
-    getTableList() {
-      this.tableList.push(...this.$refs.mainRef.getTableList());
-      this.mainCancel();
+          // console.log(isDirectory,'isDirectory')
+          // return
+          if (!isDirectory) {
+            this.$message.error('请选择文档位置');
+            return;
+          }
+          // if (this.form.userAuthority.length == 0 && this.type != 'power') {
+          //   this.$message.error('请选择通知用户');
+          //   return;
+          // }
+          this.loading = true;
+          if (this.type == 'add') {
+            delete this.form.id;
+          }
+
+          let URL =
+            this.type == 'add'
+              ? sendSave
+              : this.type == 'power'
+              ? recycleAuthority
+              : sendUpdate;
+          URL(this.form)
+            .then((msg) => {
+              this.loading = false;
+              this.$emit('done');
+              this.cancel();
+            })
+            .catch((e) => {
+              this.loading = false;
+            });
+        });
+      },
+      cancel() {
+        this.form = { ...defaultForm };
+        this.tableList = [];
+        this.$refs.powerRef.setTableList([]);
+        this.showEditFlag = false;
+      },
+      mainCancel() {
+        this.visible = false;
+      },
+      remove(row) {
+        this.tableList = this.tableList.filter((item) => item.id != row.id);
+      },
+      getTableList() {
+        this.tableList.push(...this.$refs.mainRef.getTableList());
+        this.mainCancel();
+      }
     }
-  }
-};
+  };
 </script>
-  <style scoped lang="scss">
-</style>
-  
+<style scoped lang="scss"></style>

+ 193 - 194
src/views/doc/sendReceive/receive/components/edit.vue

@@ -139,7 +139,6 @@
                   </template>
                 </el-popconfirm>
                 <el-link
-                  v-if="type == 'view'"
                   type="primary"
                   :underline="false"
                   icon="el-icon-edit"
@@ -198,214 +197,214 @@
         </el-button>
       </template>
     </ele-modal>
-    <browse ref="browseRef"></browse>
+    <!-- <browse ref="browseRef"></browse> -->
   </ele-modal>
 </template>
-  
-  <script>
-import { receiveSave,recycleGetById } from '@/api/doc-manage';
-import power from '@/views/doc/components/power/index.vue';
-import browse from '@/views/doc/components/browseOpen.vue';
-import send from '@/views/doc/sendReceive/send/components/sendList.vue';
-import bpmDetail from '@/views/bpm/processInstance/detail.vue';
-import { mapGetters } from 'vuex';
-const dayjs = require('dayjs');
 
-const defaultForm = {
-  name: '',
-  releaseList: [], //回收信息集合
-  recycleTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'), //回收时间
-  recycleUserId: '', //回收人id
-  recycleUserName: '', //回收人名称
-  remark: '', //描述
-  status: '',
-  type: ''
-};
-export default {
-  components: { power, send, bpmDetail, browse },
-  props: {
-    isAdd: {
-      default: true
-    }
-  },
+<script>
+  import { receiveSave, recycleGetById } from '@/api/doc-manage';
+  import power from '@/views/doc/components/power/index.vue';
+  // import browse from '@/views/doc/components/browseOpen.vue';
+  import send from '@/views/doc/sendReceive/send/components/sendList.vue';
+  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+  import { mapGetters } from 'vuex';
+  import { setFileUrl } from '@/views/doc/util.js';
 
-  data() {
-    return {
-      // 表单数据
-      activeComp: '回收信息',
-      tabOptions: [
-        { key: '回收信息', name: '回收信息' },
-        { key: '工作流', name: '工作流' }
-      ],
-      bpmDetailFlag: false,
-      // 表单数据
-      form: { ...defaultForm },
-      userAuthority: [],
-      // 表单验证规则
-      rules: {
-        name: [{ required: true, message: '请输入', trigger: 'blur' }],
-        recycleTime: [{ required: true, message: '请选择', trigger: 'blur' }]
-      },
-      // 提交状态
-      loading: false,
-      title: '',
-      type: '',
-      showEditFlag: false,
-      visible: false,
-      columns: [
-        {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center'
-        },
+  const dayjs = require('dayjs');
 
-        {
-          label: '主题',
-          align: 'center',
-          prop: 'name',
-          width: 220,
-          showOverflowTooltip: true
-        },
+  const defaultForm = {
+    name: '',
+    releaseList: [], //回收信息集合
+    recycleTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'), //回收时间
+    recycleUserId: '', //回收人id
+    recycleUserName: '', //回收人名称
+    remark: '', //描述
+    status: '',
+    type: ''
+  };
+  export default {
+    components: { power, send, bpmDetail },
+    props: {
+      isAdd: {
+        default: true
+      }
+    },
 
-        // {
-        //   align: 'center',
-        //   label: '是否回收权限',
-        //   prop: 'isAuthority',
-        //   width: 120,
-        //   formatter: (_row, _column, cellValue) => {
-        //     return cellValue == 1 ? '是' : '否';
-        //   }
-        // },
-        {
-          align: 'center',
-          label: '回收权限时间',
-          prop: 'isAuthorityTime',
-          width: 180,
-          showOverflowTooltip: true
-        },
-        {
-          align: 'center',
-          label: '失效时间',
-          prop: 'failureTime',
-          width: 180,
-          showOverflowTooltip: true
+    data() {
+      return {
+        // 表单数据
+        activeComp: '回收信息',
+        tabOptions: [
+          { key: '回收信息', name: '回收信息' },
+          { key: '工作流', name: '工作流' }
+        ],
+        bpmDetailFlag: false,
+        // 表单数据
+        form: { ...defaultForm },
+        userAuthority: [],
+        // 表单验证规则
+        rules: {
+          name: [{ required: true, message: '请输入', trigger: 'blur' }],
+          recycleTime: [{ required: true, message: '请选择', trigger: 'blur' }]
         },
+        // 提交状态
+        loading: false,
+        title: '',
+        type: '',
+        showEditFlag: false,
+        visible: false,
+        columns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center'
+          },
 
-        {
-          prop: 'userAuthority',
-          label: '通知用户',
-          align: 'center',
-          formatter: (_row, _column, cellValue) => {
-            return cellValue.map((item) => item.name).toString();
-          }
-        },
-        {
-          align: 'center',
-          label: '发布人',
-          prop: 'releaseUserName',
-          width: 180
-        },
+          {
+            label: '主题',
+            align: 'center',
+            prop: 'name',
+            width: 220,
+            showOverflowTooltip: true
+          },
 
-        {
-          prop: 'releaseTime',
-          align: 'center',
-          label: '发布时间',
-          width: 180
-        },
+          // {
+          //   align: 'center',
+          //   label: '是否回收权限',
+          //   prop: 'isAuthority',
+          //   width: 120,
+          //   formatter: (_row, _column, cellValue) => {
+          //     return cellValue == 1 ? '是' : '否';
+          //   }
+          // },
+          {
+            align: 'center',
+            label: '回收权限时间',
+            prop: 'isAuthorityTime',
+            width: 180,
+            showOverflowTooltip: true
+          },
+          {
+            align: 'center',
+            label: '失效时间',
+            prop: 'failureTime',
+            width: 180,
+            showOverflowTooltip: true
+          },
 
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 200,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true,
-          fixed: 'right'
-        }
-      ],
-      powerArr: [
-        // { name: 'visible', label: '可见' },
-        // { name: 'check', label: '查看' },
-        // { name: 'browse', label: '浏览' },
-        // { name: 'download', label: '下载' },
-        // { name: 'print', label: '打印' }
-      ]
-    };
-  },
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
-    },
-    ...mapGetters(['user'])
-  },
+          {
+            prop: 'userAuthority',
+            label: '通知用户',
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              return cellValue.map((item) => item.name).toString();
+            }
+          },
+          {
+            align: 'center',
+            label: '发布人',
+            prop: 'releaseUserName',
+            width: 180
+          },
 
-  created() {},
-  methods: {
-    async open(type, row) {
-      this.title = type == 'add' ? '新增' : '详情';
-      this.type = type;
-      if (this.type != 'add') {
-        this.form = await recycleGetById(row.id);
-      } else {
-        if (row) {
-          this.form.releaseList = row;
-        }
-        this.form.recycleUserName = this.user.info.name;
-      }
-      this.bpmDetailFlag = false;
-      this.$nextTick(() => {
-        this.bpmDetailFlag = true;
-      });
-      this.showEditFlag = true;
+          {
+            prop: 'releaseTime',
+            align: 'center',
+            label: '发布时间',
+            width: 180
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 200,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right'
+          }
+        ],
+        powerArr: [
+          // { name: 'visible', label: '可见' },
+          // { name: 'check', label: '查看' },
+          // { name: 'browse', label: '浏览' },
+          // { name: 'download', label: '下载' },
+          // { name: 'print', label: '打印' }
+        ]
+      };
     },
-    browseOpen(row) {
-        this.$refs.browseRef.open(row);
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
       },
-    save() {
-      this.$refs.form.validate((valid) => {
-        if (!valid) {
-          return false;
-        }
-        if (this.form.releaseList.length == 0) {
-          this.$message.error('请选择回收信息');
-          return;
+      ...mapGetters(['user'])
+    },
+
+    created() {},
+    methods: {
+      async open(type, row) {
+        this.title = type == 'add' ? '新增' : '详情';
+        this.type = type;
+        if (this.type != 'add') {
+          this.form = await recycleGetById(row.id);
+        } else {
+          if (row) {
+            this.form.releaseList = row;
+          }
+          this.form.recycleUserName = this.user.info.name;
         }
+        this.bpmDetailFlag = false;
+        this.$nextTick(() => {
+          this.bpmDetailFlag = true;
+        });
+        this.showEditFlag = true;
+      },
+      browseOpen(row) {
+        window.open(setFileUrl(row));
+      },
+      save() {
+        this.$refs.form.validate((valid) => {
+          if (!valid) {
+            return false;
+          }
+          if (this.form.releaseList.length == 0) {
+            this.$message.error('请选择回收信息');
+            return;
+          }
 
-        this.loading = true;
-        receiveSave(this.form)
-          .then((msg) => {
-            this.loading = false;
-            this.$emit('done');
-            this.cancel();
-          })
-          .catch((e) => {
-            this.loading = false;
-          });
-      });
-    },
-    cancel() {
-      this.form = { ...defaultForm };
-      this.showEditFlag = false;
-    },
-    sendCancel() {
-      this.visible = false;
-    },
-    remove(row) {
-      this.form.releaseList = this.form.releaseList.filter(
-        (item) => item.id != row.id
-      );
-    },
+          this.loading = true;
+          receiveSave(this.form)
+            .then((msg) => {
+              this.loading = false;
+              this.$emit('done');
+              this.cancel();
+            })
+            .catch((e) => {
+              this.loading = false;
+            });
+        });
+      },
+      cancel() {
+        this.form = { ...defaultForm };
+        this.showEditFlag = false;
+      },
+      sendCancel() {
+        this.visible = false;
+      },
+      remove(row) {
+        this.form.releaseList = this.form.releaseList.filter(
+          (item) => item.id != row.id
+        );
+      },
 
-    getTableList() {
-      this.form.releaseList.push(...this.$refs.sendRef.getTableList());
-      this.sendCancel();
+      getTableList() {
+        this.form.releaseList.push(...this.$refs.sendRef.getTableList());
+        this.sendCancel();
+      }
     }
-  }
-};
+  };
 </script>
-  <style scoped lang="scss">
-</style>
-  
+<style scoped lang="scss"></style>

+ 11 - 0
src/views/doc/util.js

@@ -84,6 +84,17 @@ export function setFolderList(data) {
     }
   });
 }
+export function setFileUrl(row) {
+  let file = row.storagePath[0];
+  let fileNames = file.storePath.split('/');
+  let url =
+    window.location.origin +
+    '/api/main/file/getFile?objectName=' +
+    file.storePath +
+    '&fullfilename=' +
+    fileNames[fileNames.length - 1];
+  return '/kkfile/onlinePreview?url=' + btoa(url);
+}
 
 export function getFileType() {
   return [

+ 1 - 1
src/views/login/index.vue

@@ -194,7 +194,7 @@ export default {
             this.$store.commit('user/setUserInfo', res.data);
             this.loading = false;
             this.$message.success(res.message);
-            this.$store.dispatch('user/getCurrentUserAuthorityDept');
+            // this.$store.dispatch('user/getCurrentUserAuthorityDept');
 
             this.goHome();
           })