yusheng 9 месяцев назад
Родитель
Сommit
2f170db82a

+ 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;

+ 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 [